|
@@ -15,6 +15,7 @@ import {
|
|
|
} from "ai"
|
|
} from "ai"
|
|
|
|
|
|
|
|
import PROMPT_INITIALIZE from "../session/prompt/initialize.txt"
|
|
import PROMPT_INITIALIZE from "../session/prompt/initialize.txt"
|
|
|
|
|
+import PROMPT_PLAN from "../session/prompt/plan.txt"
|
|
|
|
|
|
|
|
import { App } from "../app/app"
|
|
import { App } from "../app/app"
|
|
|
import { Bus } from "../bus"
|
|
import { Bus } from "../bus"
|
|
@@ -607,17 +608,6 @@ export namespace Session {
|
|
|
]
|
|
]
|
|
|
}),
|
|
}),
|
|
|
).then((x) => x.flat())
|
|
).then((x) => x.flat())
|
|
|
- /*
|
|
|
|
|
- if (inputAgent === "plan")
|
|
|
|
|
- userParts.push({
|
|
|
|
|
- id: Identifier.ascending("part"),
|
|
|
|
|
- messageID: userMsg.id,
|
|
|
|
|
- sessionID: input.sessionID,
|
|
|
|
|
- type: "text",
|
|
|
|
|
- text: PROMPT_PLAN,
|
|
|
|
|
- synthetic: true,
|
|
|
|
|
- })
|
|
|
|
|
- */
|
|
|
|
|
await Plugin.trigger(
|
|
await Plugin.trigger(
|
|
|
"chat.message",
|
|
"chat.message",
|
|
|
{},
|
|
{},
|
|
@@ -720,6 +710,16 @@ export namespace Session {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const agent = await Agent.get(inputAgent)
|
|
const agent = await Agent.get(inputAgent)
|
|
|
|
|
+ if (agent.name === "plan") {
|
|
|
|
|
+ msgs.at(-1)?.parts.push({
|
|
|
|
|
+ id: Identifier.ascending("part"),
|
|
|
|
|
+ messageID: userMsg.id,
|
|
|
|
|
+ sessionID: input.sessionID,
|
|
|
|
|
+ type: "text",
|
|
|
|
|
+ text: PROMPT_PLAN,
|
|
|
|
|
+ synthetic: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
let system = SystemPrompt.header(input.providerID)
|
|
let system = SystemPrompt.header(input.providerID)
|
|
|
system.push(
|
|
system.push(
|
|
|
...(() => {
|
|
...(() => {
|