feat(council-archive): register council tools and add write_output_to_file to task tool
- Register council_finalize and council_read in tool registry - Add write_output_to_file param to delegate-task, propagate to LaunchInput - Create council-archive barrel exports
This commit is contained in:
@@ -31,6 +31,7 @@ import {
|
|||||||
createHashlineEditTool,
|
createHashlineEditTool,
|
||||||
createPrepareCouncilPromptTool,
|
createPrepareCouncilPromptTool,
|
||||||
} from "../tools"
|
} from "../tools"
|
||||||
|
import { createCouncilFinalize, createCouncilRead } from "../tools/council-archive"
|
||||||
import { getMainSessionID } from "../features/claude-code-session-state"
|
import { getMainSessionID } from "../features/claude-code-session-state"
|
||||||
import { filterDisabledTools } from "../shared/disabled-tools"
|
import { filterDisabledTools } from "../shared/disabled-tools"
|
||||||
import { isTaskSystemEnabled, log } from "../shared"
|
import { isTaskSystemEnabled, log } from "../shared"
|
||||||
@@ -280,6 +281,8 @@ export function createToolRegistry(args: {
|
|||||||
...taskToolsRecord,
|
...taskToolsRecord,
|
||||||
...hashlineToolsRecord,
|
...hashlineToolsRecord,
|
||||||
prepare_council_prompt: createPrepareCouncilPromptTool(ctx.directory),
|
prepare_council_prompt: createPrepareCouncilPromptTool(ctx.directory),
|
||||||
|
council_finalize: createCouncilFinalize(),
|
||||||
|
council_read: createCouncilRead(),
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const toolDefinition of Object.values(allTools)) {
|
for (const toolDefinition of Object.values(allTools)) {
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
export { createCouncilFinalize } from "./create-council-finalize"
|
||||||
|
export { createCouncilRead } from "./create-council-read"
|
||||||
|
export { extractCouncilResponse, OPENING_TAG, CLOSING_TAG } from "./council-response-extractor"
|
||||||
|
export type { CouncilResponseExtraction } from "./council-response-extractor"
|
||||||
|
export type { CouncilFinalizeArgs, CouncilMemberResult, CouncilFinalizeResult } from "./types"
|
||||||
@@ -80,6 +80,7 @@ export async function executeBackgroundTask(
|
|||||||
skillContent: systemContent,
|
skillContent: systemContent,
|
||||||
category: args.category,
|
category: args.category,
|
||||||
sessionPermission: QUESTION_DENIED_SESSION_PERMISSION,
|
sessionPermission: QUESTION_DENIED_SESSION_PERMISSION,
|
||||||
|
writeOutputToFile: args.write_output_to_file,
|
||||||
})
|
})
|
||||||
|
|
||||||
// OpenCode TUI's `Task` tool UI calculates toolcalls by looking up
|
// OpenCode TUI's `Task` tool UI calculates toolcalls by looking up
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ export function createDelegateTask(options: DelegateTaskToolOptions): ToolDefini
|
|||||||
subagent_type: tool.schema.string().optional().describe("REQUIRED if category not provided. Do NOT provide both category and subagent_type."),
|
subagent_type: tool.schema.string().optional().describe("REQUIRED if category not provided. Do NOT provide both category and subagent_type."),
|
||||||
session_id: tool.schema.string().optional().describe("Existing Task session to continue"),
|
session_id: tool.schema.string().optional().describe("Existing Task session to continue"),
|
||||||
command: tool.schema.string().optional().describe("The command that triggered this task"),
|
command: tool.schema.string().optional().describe("The command that triggered this task"),
|
||||||
|
write_output_to_file: tool.schema.boolean().optional().describe("Write raw task output to file on completion"),
|
||||||
},
|
},
|
||||||
async execute(args: DelegateTaskArgs, toolContext) {
|
async execute(args: DelegateTaskArgs, toolContext) {
|
||||||
const ctx = toolContext as ToolContextWithMetadata
|
const ctx = toolContext as ToolContextWithMetadata
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export interface DelegateTaskArgs {
|
|||||||
session_id?: string
|
session_id?: string
|
||||||
command?: string
|
command?: string
|
||||||
load_skills: string[]
|
load_skills: string[]
|
||||||
|
write_output_to_file?: boolean
|
||||||
execute?: {
|
execute?: {
|
||||||
task_id: string
|
task_id: string
|
||||||
task_dir?: string
|
task_dir?: string
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ export {
|
|||||||
} from "./task"
|
} from "./task"
|
||||||
export { createHashlineEditTool } from "./hashline-edit"
|
export { createHashlineEditTool } from "./hashline-edit"
|
||||||
export { createPrepareCouncilPromptTool } from "./prepare-council-prompt"
|
export { createPrepareCouncilPromptTool } from "./prepare-council-prompt"
|
||||||
|
export { createCouncilFinalize, createCouncilRead } from "./council-archive"
|
||||||
|
|
||||||
export function createBackgroundTools(manager: BackgroundManager, client: OpencodeClient): Record<string, ToolDefinition> {
|
export function createBackgroundTools(manager: BackgroundManager, client: OpencodeClient): Record<string, ToolDefinition> {
|
||||||
const outputManager: BackgroundOutputManager = manager
|
const outputManager: BackgroundOutputManager = manager
|
||||||
|
|||||||
Reference in New Issue
Block a user