|
|
@@ -9,6 +9,7 @@ import { Agent } from "../agent/agent"
|
|
|
import { SessionPrompt } from "../session/prompt"
|
|
|
import { iife } from "@/util/iife"
|
|
|
import { defer } from "@/util/defer"
|
|
|
+import { Config } from "../config/config"
|
|
|
|
|
|
export const TaskTool = Tool.define("task", async () => {
|
|
|
const agents = await Agent.list().then((x) => x.filter((a) => a.mode !== "primary"))
|
|
|
@@ -77,6 +78,8 @@ export const TaskTool = Tool.define("task", async () => {
|
|
|
ctx.abort.addEventListener("abort", cancel)
|
|
|
using _ = defer(() => ctx.abort.removeEventListener("abort", cancel))
|
|
|
const promptParts = await SessionPrompt.resolvePromptParts(params.prompt)
|
|
|
+
|
|
|
+ const config = await Config.get()
|
|
|
const result = await SessionPrompt.prompt({
|
|
|
messageID,
|
|
|
sessionID: session.id,
|
|
|
@@ -89,6 +92,7 @@ export const TaskTool = Tool.define("task", async () => {
|
|
|
todowrite: false,
|
|
|
todoread: false,
|
|
|
task: false,
|
|
|
+ ...Object.fromEntries((config.experimental?.primary_tools ?? []).map((t) => [t, false])),
|
|
|
...agent.tools,
|
|
|
},
|
|
|
parts: promptParts,
|