|
|
@@ -12,8 +12,8 @@ import { Log } from "@/util/log"
|
|
|
|
|
|
export interface TaskPromptOps {
|
|
|
cancel(sessionID: SessionID): void
|
|
|
- resolvePromptParts(template: string): Promise<SessionPrompt.PromptInput["parts"]>
|
|
|
- prompt(input: SessionPrompt.PromptInput): Promise<MessageV2.WithParts>
|
|
|
+ resolvePromptParts(template: string): Effect.Effect<SessionPrompt.PromptInput["parts"]>
|
|
|
+ prompt(input: SessionPrompt.PromptInput): Effect.Effect<MessageV2.WithParts>
|
|
|
}
|
|
|
|
|
|
const id = "task"
|
|
|
@@ -132,24 +132,22 @@ export const TaskTool = Tool.define(
|
|
|
}),
|
|
|
() =>
|
|
|
Effect.gen(function* () {
|
|
|
- const parts = yield* Effect.promise(() => ops.resolvePromptParts(params.prompt))
|
|
|
- const result = yield* Effect.promise(() =>
|
|
|
- ops.prompt({
|
|
|
- messageID,
|
|
|
- sessionID: nextSession.id,
|
|
|
- model: {
|
|
|
- modelID: model.modelID,
|
|
|
- providerID: model.providerID,
|
|
|
- },
|
|
|
- agent: next.name,
|
|
|
- tools: {
|
|
|
- ...(canTodo ? {} : { todowrite: false }),
|
|
|
- ...(canTask ? {} : { task: false }),
|
|
|
- ...Object.fromEntries((cfg.experimental?.primary_tools ?? []).map((item) => [item, false])),
|
|
|
- },
|
|
|
- parts,
|
|
|
- }),
|
|
|
- )
|
|
|
+ const parts = yield* ops.resolvePromptParts(params.prompt)
|
|
|
+ const result = yield* ops.prompt({
|
|
|
+ messageID,
|
|
|
+ sessionID: nextSession.id,
|
|
|
+ model: {
|
|
|
+ modelID: model.modelID,
|
|
|
+ providerID: model.providerID,
|
|
|
+ },
|
|
|
+ agent: next.name,
|
|
|
+ tools: {
|
|
|
+ ...(canTodo ? {} : { todowrite: false }),
|
|
|
+ ...(canTask ? {} : { task: false }),
|
|
|
+ ...Object.fromEntries((cfg.experimental?.primary_tools ?? []).map((item) => [item, false])),
|
|
|
+ },
|
|
|
+ parts,
|
|
|
+ })
|
|
|
|
|
|
return {
|
|
|
title: params.description,
|