refactor(core): use input and output task schemas
This commit is contained in:
parent
af22efb4e4
commit
70ab2e2aea
1 changed files with 4 additions and 4 deletions
|
|
@ -9,7 +9,7 @@ import { SessionMessage } from "../session/message"
|
||||||
import { Prompt } from "../session/prompt"
|
import { Prompt } from "../session/prompt"
|
||||||
import { Tool } from "./tool"
|
import { Tool } from "./tool"
|
||||||
|
|
||||||
export const Parameters = Schema.Struct({
|
export const Input = Schema.Struct({
|
||||||
description: Schema.String.annotate({ description: "A short description of the task" }),
|
description: Schema.String.annotate({ description: "A short description of the task" }),
|
||||||
prompt: Schema.String.annotate({ description: "The task for the agent to perform" }),
|
prompt: Schema.String.annotate({ description: "The task for the agent to perform" }),
|
||||||
subagent_type: Schema.String.annotate({ description: "The specialized agent to use" }),
|
subagent_type: Schema.String.annotate({ description: "The specialized agent to use" }),
|
||||||
|
|
@ -18,7 +18,7 @@ export const Parameters = Schema.Struct({
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
export const Success = Schema.Struct({
|
export const Output = Schema.Struct({
|
||||||
sessionID: SessionV2.ID,
|
sessionID: SessionV2.ID,
|
||||||
status: Schema.Literals(["running", "completed"]),
|
status: Schema.Literals(["running", "completed"]),
|
||||||
output: Schema.String.pipe(Schema.optional),
|
output: Schema.String.pipe(Schema.optional),
|
||||||
|
|
@ -35,8 +35,8 @@ export const make = Effect.fn("TaskTool.make")(function* (
|
||||||
return Tool.make({
|
return Tool.make({
|
||||||
description:
|
description:
|
||||||
"Delegate focused work to a specialized child agent. Foreground calls wait for the result; background calls return immediately and notify this Session when complete.",
|
"Delegate focused work to a specialized child agent. Foreground calls wait for the result; background calls return immediately and notify this Session when complete.",
|
||||||
input: Parameters,
|
input: Input,
|
||||||
output: Success,
|
output: Output,
|
||||||
execute: (parameters, context) =>
|
execute: (parameters, context) =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const parent = yield* sessions.get(context.sessionID)
|
const parent = yield* sessions.get(context.sessionID)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue