diff --git a/src/tools/background-task/constants.ts b/src/tools/background-task/constants.ts index 9a2e1fc98..e7ff93b0e 100644 --- a/src/tools/background-task/constants.ts +++ b/src/tools/background-task/constants.ts @@ -2,6 +2,6 @@ export const BACKGROUND_TASK_DESCRIPTION = `Run agent task in background. Return Use \`background_output\` to get results. Prompts MUST be in English.` -export const BACKGROUND_OUTPUT_DESCRIPTION = `Get output from background task. System notifies on completion, so block=true rarely needed.` +export const BACKGROUND_OUTPUT_DESCRIPTION = `Get output from background task. Use full_session=true to fetch session messages with filters. System notifies on completion, so block=true rarely needed.` export const BACKGROUND_CANCEL_DESCRIPTION = `Cancel running background task(s). Use all=true to cancel ALL before final answer.` diff --git a/src/tools/background-task/index.ts b/src/tools/background-task/index.ts index 14cb4cea7..c769b07b8 100644 --- a/src/tools/background-task/index.ts +++ b/src/tools/background-task/index.ts @@ -5,3 +5,4 @@ export { export type * from "./types" export * from "./constants" +export type { BackgroundOutputClient, BackgroundOutputManager, BackgroundCancelClient } from "./tools" diff --git a/src/tools/index.ts b/src/tools/index.ts index d749d427a..3eab094fc 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -35,6 +35,8 @@ export { createSkillMcpTool } from "./skill-mcp" import { createBackgroundOutput, createBackgroundCancel, + type BackgroundOutputManager, + type BackgroundCancelClient, } from "./background-task" import type { PluginInput, ToolDefinition } from "@opencode-ai/plugin" @@ -47,9 +49,11 @@ export { createLookAt } from "./look-at" export { createDelegateTask } from "./delegate-task" export function createBackgroundTools(manager: BackgroundManager, client: OpencodeClient): Record { + const outputManager: BackgroundOutputManager = manager + const cancelClient: BackgroundCancelClient = client return { - background_output: createBackgroundOutput(manager, client), - background_cancel: createBackgroundCancel(manager, client), + background_output: createBackgroundOutput(outputManager, client), + background_cancel: createBackgroundCancel(manager, cancelClient), } }