summaryrefslogtreecommitdiffhomepage
path: root/packages/app/src/context
diff options
context:
space:
mode:
Diffstat (limited to 'packages/app/src/context')
-rw-r--r--packages/app/src/context/prompt.tsx11
1 files changed, 10 insertions, 1 deletions
diff --git a/packages/app/src/context/prompt.tsx b/packages/app/src/context/prompt.tsx
index 8d3590cd9..25d8146ea 100644
--- a/packages/app/src/context/prompt.tsx
+++ b/packages/app/src/context/prompt.tsx
@@ -21,6 +21,11 @@ export interface FileAttachmentPart extends PartBase {
selection?: TextSelection
}
+export interface AgentPart extends PartBase {
+ type: "agent"
+ name: string
+}
+
export interface ImageAttachmentPart {
type: "image"
id: string
@@ -29,7 +34,7 @@ export interface ImageAttachmentPart {
dataUrl: string
}
-export type ContentPart = TextPart | FileAttachmentPart | ImageAttachmentPart
+export type ContentPart = TextPart | FileAttachmentPart | AgentPart | ImageAttachmentPart
export type Prompt = ContentPart[]
export const DEFAULT_PROMPT: Prompt = [{ type: "text", content: "", start: 0, end: 0 }]
@@ -46,6 +51,9 @@ export function isPromptEqual(promptA: Prompt, promptB: Prompt): boolean {
if (partA.type === "file" && partA.path !== (partB as FileAttachmentPart).path) {
return false
}
+ if (partA.type === "agent" && partA.name !== (partB as AgentPart).name) {
+ return false
+ }
if (partA.type === "image" && partA.id !== (partB as ImageAttachmentPart).id) {
return false
}
@@ -61,6 +69,7 @@ function cloneSelection(selection?: TextSelection) {
function clonePart(part: ContentPart): ContentPart {
if (part.type === "text") return { ...part }
if (part.type === "image") return { ...part }
+ if (part.type === "agent") return { ...part }
return {
...part,
selection: cloneSelection(part.selection),