@slopus/rig 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +144 -1
- package/dist/agent/Agent.d.ts +16 -0
- package/dist/agent/Agent.d.ts.map +1 -1
- package/dist/agent/Agent.js +106 -0
- package/dist/agent/compaction/compactConversation.d.ts +22 -0
- package/dist/agent/compaction/compactConversation.d.ts.map +1 -0
- package/dist/agent/compaction/compactConversation.js +77 -0
- package/dist/agent/compaction/estimateMessagesTokens.d.ts +3 -0
- package/dist/agent/compaction/estimateMessagesTokens.d.ts.map +1 -0
- package/dist/agent/compaction/estimateMessagesTokens.js +39 -0
- package/dist/agent/compaction/formatMessagesForCompaction.d.ts +3 -0
- package/dist/agent/compaction/formatMessagesForCompaction.d.ts.map +1 -0
- package/dist/agent/compaction/formatMessagesForCompaction.js +30 -0
- package/dist/agent/compaction/requestCompactionSummary.d.ts +11 -0
- package/dist/agent/compaction/requestCompactionSummary.d.ts.map +1 -0
- package/dist/agent/compaction/requestCompactionSummary.js +43 -0
- package/dist/agent/context/AgentContext.d.ts +8 -0
- package/dist/agent/context/AgentContext.d.ts.map +1 -1
- package/dist/agent/context/BashContext.d.ts +23 -0
- package/dist/agent/context/BashContext.d.ts.map +1 -1
- package/dist/agent/context/GoalContext.d.ts +7 -0
- package/dist/agent/context/GoalContext.d.ts.map +1 -0
- package/dist/agent/context/GoalContext.js +1 -0
- package/dist/agent/context/SubagentContext.d.ts +20 -1
- package/dist/agent/context/SubagentContext.d.ts.map +1 -1
- package/dist/agent/context/TaskContext.d.ts +8 -0
- package/dist/agent/context/TaskContext.d.ts.map +1 -0
- package/dist/agent/context/TaskContext.js +1 -0
- package/dist/agent/context/UserInputContext.d.ts +7 -0
- package/dist/agent/context/UserInputContext.d.ts.map +1 -0
- package/dist/agent/context/UserInputContext.js +1 -0
- package/dist/agent/context/assertCanWritePath.d.ts +3 -0
- package/dist/agent/context/assertCanWritePath.d.ts.map +1 -0
- package/dist/agent/context/assertCanWritePath.js +11 -0
- package/dist/agent/context/createJustBashBashContext.d.ts.map +1 -1
- package/dist/agent/context/createJustBashBashContext.js +127 -0
- package/dist/agent/context/createNodeAgentContext.d.ts +8 -0
- package/dist/agent/context/createNodeAgentContext.d.ts.map +1 -1
- package/dist/agent/context/createNodeAgentContext.js +15 -2
- package/dist/agent/context/createNodeBashContext.d.ts +2 -0
- package/dist/agent/context/createNodeBashContext.d.ts.map +1 -1
- package/dist/agent/context/createNodeBashContext.js +123 -4
- package/dist/agent/context/createNodeFileSystemContext.d.ts +2 -0
- package/dist/agent/context/createNodeFileSystemContext.d.ts.map +1 -1
- package/dist/agent/context/createNodeFileSystemContext.js +18 -8
- package/dist/agent/context/createSandboxedCommand.d.ts +7 -0
- package/dist/agent/context/createSandboxedCommand.d.ts.map +1 -0
- package/dist/agent/context/createSandboxedCommand.js +47 -0
- package/dist/agent/context/findGitWritablePaths.d.ts +2 -0
- package/dist/agent/context/findGitWritablePaths.d.ts.map +1 -0
- package/dist/agent/context/findGitWritablePaths.js +54 -0
- package/dist/agent/context/isPathInsideWorkspace.d.ts +2 -0
- package/dist/agent/context/isPathInsideWorkspace.d.ts.map +1 -0
- package/dist/agent/context/isPathInsideWorkspace.js +14 -0
- package/dist/agent/context/resolvePotentialPath.d.ts +2 -0
- package/dist/agent/context/resolvePotentialPath.d.ts.map +1 -0
- package/dist/agent/context/resolvePotentialPath.js +32 -0
- package/dist/agent/createPermissionInstructions.d.ts +3 -0
- package/dist/agent/createPermissionInstructions.d.ts.map +1 -0
- package/dist/agent/createPermissionInstructions.js +12 -0
- package/dist/agent/createSubagentInstructions.js +1 -1
- package/dist/agent/createSystemPrompt.d.ts.map +1 -1
- package/dist/agent/createSystemPrompt.js +4 -0
- package/dist/agent/index.d.ts +7 -3
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/loop.d.ts +16 -2
- package/dist/agent/loop.d.ts.map +1 -1
- package/dist/agent/loop.js +115 -15
- package/dist/agent/printAgentMessageToConsole.d.ts +1 -0
- package/dist/agent/printAgentMessageToConsole.d.ts.map +1 -1
- package/dist/agent/types.d.ts +1 -0
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/app/CodingAssistantAgentBackend.d.ts +11 -1
- package/dist/app/CodingAssistantAgentBackend.d.ts.map +1 -1
- package/dist/app/CodingAssistantApp.d.ts +7 -1
- package/dist/app/CodingAssistantApp.d.ts.map +1 -1
- package/dist/app/CodingAssistantApp.js +678 -45
- package/dist/app/ScrollbackPreservingTerminal.d.ts +5 -0
- package/dist/app/ScrollbackPreservingTerminal.d.ts.map +1 -0
- package/dist/app/ScrollbackPreservingTerminal.js +7 -0
- package/dist/app/StartupStatusApp.js +1 -1
- package/dist/app/createCodingAssistantAgent.d.ts +6 -1
- package/dist/app/createCodingAssistantAgent.d.ts.map +1 -1
- package/dist/app/createCodingAssistantAgent.js +22 -5
- package/dist/app/createSlashCommands.d.ts.map +1 -1
- package/dist/app/createSlashCommands.js +42 -0
- package/dist/app/highlightAgentCode.d.ts.map +1 -1
- package/dist/app/highlightAgentCode.js +10 -7
- package/dist/app/humanizeGoalStatus.d.ts +3 -0
- package/dist/app/humanizeGoalStatus.d.ts.map +1 -0
- package/dist/app/humanizeGoalStatus.js +9 -0
- package/dist/app/humanizePermissionMode.d.ts +3 -0
- package/dist/app/humanizePermissionMode.d.ts.map +1 -0
- package/dist/app/humanizePermissionMode.js +9 -0
- package/dist/app/humanizeToolName.d.ts +2 -0
- package/dist/app/humanizeToolName.d.ts.map +1 -0
- package/dist/app/humanizeToolName.js +40 -0
- package/dist/app/main.d.ts.map +1 -1
- package/dist/app/main.js +4 -0
- package/dist/app/renderAgentMarkdown.d.ts.map +1 -1
- package/dist/app/renderAgentMarkdown.js +2 -1
- package/dist/app/runApp.d.ts +2 -0
- package/dist/app/runApp.d.ts.map +1 -1
- package/dist/app/runApp.js +48 -3
- package/dist/app/sanitizeTerminalText.d.ts +2 -0
- package/dist/app/sanitizeTerminalText.d.ts.map +1 -0
- package/dist/app/sanitizeTerminalText.js +55 -0
- package/dist/app/upsertSubagentSummary.d.ts +3 -0
- package/dist/app/upsertSubagentSummary.d.ts.map +1 -0
- package/dist/app/upsertSubagentSummary.js +6 -0
- package/dist/client/ProtocolHttpClient.d.ts +12 -1
- package/dist/client/ProtocolHttpClient.d.ts.map +1 -1
- package/dist/client/ProtocolHttpClient.js +21 -0
- package/dist/client/RemoteAgent.d.ts +11 -1
- package/dist/client/RemoteAgent.d.ts.map +1 -1
- package/dist/client/RemoteAgent.js +91 -1
- package/dist/config/createConfigFile.d.ts.map +1 -1
- package/dist/config/createConfigFile.js +5 -0
- package/dist/config/defaultConfig.d.ts.map +1 -1
- package/dist/config/defaultConfig.js +2 -0
- package/dist/config/mergeConfigValues.d.ts.map +1 -1
- package/dist/config/mergeConfigValues.js +8 -1
- package/dist/config/parseConfigToml.d.ts.map +1 -1
- package/dist/config/parseConfigToml.js +88 -0
- package/dist/config/serializeMcpServers.d.ts +3 -0
- package/dist/config/serializeMcpServers.d.ts.map +1 -0
- package/dist/config/serializeMcpServers.js +34 -0
- package/dist/config/types.d.ts +6 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/writeRuntimeConfig.d.ts.map +1 -1
- package/dist/config/writeRuntimeConfig.js +3 -0
- package/dist/goals/SessionGoal.d.ts +14 -0
- package/dist/goals/SessionGoal.d.ts.map +1 -0
- package/dist/goals/SessionGoal.js +1 -0
- package/dist/goals/createGoalContinuationPrompt.d.ts +3 -0
- package/dist/goals/createGoalContinuationPrompt.d.ts.map +1 -0
- package/dist/goals/createGoalContinuationPrompt.js +17 -0
- package/dist/goals/index.d.ts +5 -0
- package/dist/goals/index.d.ts.map +1 -0
- package/dist/goals/index.js +3 -0
- package/dist/goals/isGoalStatus.d.ts +3 -0
- package/dist/goals/isGoalStatus.d.ts.map +1 -0
- package/dist/goals/isGoalStatus.js +3 -0
- package/dist/goals/normalizeGoalObjective.d.ts +3 -0
- package/dist/goals/normalizeGoalObjective.d.ts.map +1 -0
- package/dist/goals/normalizeGoalObjective.js +11 -0
- package/dist/mcp/McpClientManager.d.ts +12 -0
- package/dist/mcp/McpClientManager.d.ts.map +1 -0
- package/dist/mcp/McpClientManager.js +123 -0
- package/dist/mcp/connectMcpServer.d.ts +8 -0
- package/dist/mcp/connectMcpServer.d.ts.map +1 -0
- package/dist/mcp/connectMcpServer.js +47 -0
- package/dist/mcp/createMcpTool.d.ts +11 -0
- package/dist/mcp/createMcpTool.d.ts.map +1 -0
- package/dist/mcp/createMcpTool.js +43 -0
- package/dist/mcp/index.d.ts +5 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/loadMcpServerConfigs.d.ts +4 -0
- package/dist/mcp/loadMcpServerConfigs.d.ts.map +1 -0
- package/dist/mcp/loadMcpServerConfigs.js +122 -0
- package/dist/mcp/mcpResultToContentBlocks.d.ts +3 -0
- package/dist/mcp/mcpResultToContentBlocks.d.ts.map +1 -0
- package/dist/mcp/mcpResultToContentBlocks.js +51 -0
- package/dist/mcp/mergeMcpTools.d.ts +7 -0
- package/dist/mcp/mergeMcpTools.d.ts.map +1 -0
- package/dist/mcp/mergeMcpTools.js +34 -0
- package/dist/mcp/normalizeMcpName.d.ts +2 -0
- package/dist/mcp/normalizeMcpName.d.ts.map +1 -0
- package/dist/mcp/normalizeMcpName.js +3 -0
- package/dist/mcp/types.d.ts +37 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +1 -0
- package/dist/permissions/PermissionContext.d.ts +7 -0
- package/dist/permissions/PermissionContext.d.ts.map +1 -0
- package/dist/permissions/PermissionContext.js +1 -0
- package/dist/permissions/PermissionMode.d.ts +3 -0
- package/dist/permissions/PermissionMode.d.ts.map +1 -0
- package/dist/permissions/PermissionMode.js +1 -0
- package/dist/permissions/createPermissionContext.d.ts +4 -0
- package/dist/permissions/createPermissionContext.d.ts.map +1 -0
- package/dist/permissions/createPermissionContext.js +16 -0
- package/dist/permissions/index.d.ts +13 -0
- package/dist/permissions/index.d.ts.map +1 -0
- package/dist/permissions/index.js +9 -0
- package/dist/permissions/isPermissionMode.d.ts +3 -0
- package/dist/permissions/isPermissionMode.d.ts.map +1 -0
- package/dist/permissions/isPermissionMode.js +6 -0
- package/dist/permissions/parseAutoPermissionReview.d.ts +7 -0
- package/dist/permissions/parseAutoPermissionReview.d.ts.map +1 -0
- package/dist/permissions/parseAutoPermissionReview.js +33 -0
- package/dist/permissions/parsePermissionMode.d.ts +3 -0
- package/dist/permissions/parsePermissionMode.d.ts.map +1 -0
- package/dist/permissions/parsePermissionMode.js +6 -0
- package/dist/permissions/requestAutoPermissionApproval.d.ts +9 -0
- package/dist/permissions/requestAutoPermissionApproval.d.ts.map +1 -0
- package/dist/permissions/requestAutoPermissionApproval.js +26 -0
- package/dist/permissions/reviewAutoPermission.d.ts +13 -0
- package/dist/permissions/reviewAutoPermission.d.ts.map +1 -0
- package/dist/permissions/reviewAutoPermission.js +70 -0
- package/dist/permissions/shouldElevateToolInAutoMode.d.ts +2 -0
- package/dist/permissions/shouldElevateToolInAutoMode.d.ts.map +1 -0
- package/dist/permissions/shouldElevateToolInAutoMode.js +37 -0
- package/dist/permissions/shouldReviewToolInAutoMode.d.ts +2 -0
- package/dist/permissions/shouldReviewToolInAutoMode.d.ts.map +1 -0
- package/dist/permissions/shouldReviewToolInAutoMode.js +85 -0
- package/dist/permissions/summarizePermissionAction.d.ts +2 -0
- package/dist/permissions/summarizePermissionAction.d.ts.map +1 -0
- package/dist/permissions/summarizePermissionAction.js +29 -0
- package/dist/protocol/SessionProtocol.d.ts +49 -2
- package/dist/protocol/SessionProtocol.d.ts.map +1 -1
- package/dist/protocol/index.d.ts +4 -1
- package/dist/protocol/index.d.ts.map +1 -1
- package/dist/providers/claude-sdk.d.ts.map +1 -1
- package/dist/providers/claude-sdk.js +7 -6
- package/dist/providers/models.d.ts +12 -12
- package/dist/providers/models.d.ts.map +1 -1
- package/dist/providers/models.js +18 -0
- package/dist/providers/types.d.ts +3 -0
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/review/createCodeReviewPrompt.d.ts +2 -0
- package/dist/review/createCodeReviewPrompt.d.ts.map +1 -0
- package/dist/review/createCodeReviewPrompt.js +11 -0
- package/dist/review/index.d.ts +2 -0
- package/dist/review/index.d.ts.map +1 -0
- package/dist/review/index.js +1 -0
- package/dist/server/AgentSessionManager.d.ts +10 -1
- package/dist/server/AgentSessionManager.d.ts.map +1 -1
- package/dist/server/AgentSessionManager.js +203 -12
- package/dist/server/InMemorySession.d.ts +34 -1
- package/dist/server/InMemorySession.d.ts.map +1 -1
- package/dist/server/InMemorySession.js +558 -10
- package/dist/server/InMemorySessionStore.d.ts +2 -0
- package/dist/server/InMemorySessionStore.d.ts.map +1 -1
- package/dist/server/InMemorySessionStore.js +7 -0
- package/dist/server/PersistentSessionStore.d.ts +2 -0
- package/dist/server/PersistentSessionStore.d.ts.map +1 -1
- package/dist/server/PersistentSessionStore.js +80 -5
- package/dist/server/createGoalTitle.d.ts +2 -0
- package/dist/server/createGoalTitle.d.ts.map +1 -0
- package/dist/server/createGoalTitle.js +4 -0
- package/dist/server/createProtocolHttpServer.d.ts.map +1 -1
- package/dist/server/createProtocolHttpServer.js +119 -2
- package/dist/server/runLocalProtocolServer.d.ts.map +1 -1
- package/dist/server/runLocalProtocolServer.js +18 -2
- package/dist/tasks/index.d.ts +2 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/index.js +1 -0
- package/dist/tasks/types.d.ts +39 -0
- package/dist/tasks/types.d.ts.map +1 -0
- package/dist/tasks/types.js +1 -0
- package/dist/tools/Agent.d.ts +13 -3
- package/dist/tools/Agent.d.ts.map +1 -1
- package/dist/tools/Agent.js +40 -12
- package/dist/tools/claude/AskUserQuestion.d.ts +23 -0
- package/dist/tools/claude/AskUserQuestion.d.ts.map +1 -0
- package/dist/tools/claude/AskUserQuestion.js +52 -0
- package/dist/tools/claude/Bash.d.ts +2 -0
- package/dist/tools/claude/Bash.d.ts.map +1 -1
- package/dist/tools/claude/Bash.js +20 -2
- package/dist/tools/claude/SendMessage.d.ts +10 -0
- package/dist/tools/claude/SendMessage.d.ts.map +1 -0
- package/dist/tools/claude/SendMessage.js +33 -0
- package/dist/tools/claude/TaskCreate.d.ts +12 -0
- package/dist/tools/claude/TaskCreate.d.ts.map +1 -0
- package/dist/tools/claude/TaskCreate.js +34 -0
- package/dist/tools/claude/TaskGet.d.ts +16 -0
- package/dist/tools/claude/TaskGet.d.ts.map +1 -0
- package/dist/tools/claude/TaskGet.js +44 -0
- package/dist/tools/claude/TaskList.d.ts +10 -0
- package/dist/tools/claude/TaskList.d.ts.map +1 -0
- package/dist/tools/claude/TaskList.js +51 -0
- package/dist/tools/claude/TaskOutput.d.ts +17 -0
- package/dist/tools/claude/TaskOutput.d.ts.map +1 -0
- package/dist/tools/claude/TaskOutput.js +74 -0
- package/dist/tools/claude/TaskStop.d.ts +10 -0
- package/dist/tools/claude/TaskStop.d.ts.map +1 -0
- package/dist/tools/claude/TaskStop.js +42 -0
- package/dist/tools/claude/TaskUpdate.d.ts +21 -0
- package/dist/tools/claude/TaskUpdate.d.ts.map +1 -0
- package/dist/tools/claude/TaskUpdate.js +55 -0
- package/dist/tools/claude/index.d.ts +111 -5
- package/dist/tools/claude/index.d.ts.map +1 -1
- package/dist/tools/claude/index.js +24 -2
- package/dist/tools/claude/parseBackgroundTaskId.d.ts +2 -0
- package/dist/tools/claude/parseBackgroundTaskId.d.ts.map +1 -0
- package/dist/tools/claude/parseBackgroundTaskId.js +7 -0
- package/dist/tools/claude/taskSchemas.d.ts +14 -0
- package/dist/tools/claude/taskSchemas.d.ts.map +1 -0
- package/dist/tools/claude/taskSchemas.js +18 -0
- package/dist/tools/codex/exec_command.d.ts +8 -6
- package/dist/tools/codex/exec_command.d.ts.map +1 -1
- package/dist/tools/codex/exec_command.js +37 -18
- package/dist/tools/codex/followup_task.d.ts +11 -0
- package/dist/tools/codex/followup_task.d.ts.map +1 -0
- package/dist/tools/codex/followup_task.js +18 -0
- package/dist/tools/codex/humanizeTaskName.d.ts +2 -0
- package/dist/tools/codex/humanizeTaskName.d.ts.map +1 -0
- package/dist/tools/codex/humanizeTaskName.js +4 -0
- package/dist/tools/codex/index.d.ts +90 -7
- package/dist/tools/codex/index.d.ts.map +1 -1
- package/dist/tools/codex/index.js +24 -0
- package/dist/tools/codex/interrupt_agent.d.ts +10 -0
- package/dist/tools/codex/interrupt_agent.d.ts.map +1 -0
- package/dist/tools/codex/interrupt_agent.js +17 -0
- package/dist/tools/codex/list_agents.d.ts +12 -0
- package/dist/tools/codex/list_agents.d.ts.map +1 -0
- package/dist/tools/codex/list_agents.js +23 -0
- package/dist/tools/codex/request_user_input.d.ts +16 -0
- package/dist/tools/codex/request_user_input.d.ts.map +1 -0
- package/dist/tools/codex/request_user_input.js +58 -0
- package/dist/tools/codex/requireSubagentContext.d.ts +3 -0
- package/dist/tools/codex/requireSubagentContext.d.ts.map +1 -0
- package/dist/tools/codex/requireSubagentContext.js +6 -0
- package/dist/tools/codex/spawn_agent.d.ts +9 -0
- package/dist/tools/codex/spawn_agent.d.ts.map +1 -0
- package/dist/tools/codex/spawn_agent.js +35 -0
- package/dist/tools/codex/subagentSchemas.d.ts +8 -0
- package/dist/tools/codex/subagentSchemas.d.ts.map +1 -0
- package/dist/tools/codex/subagentSchemas.js +13 -0
- package/dist/tools/codex/unifiedExecOutput.d.ts +14 -0
- package/dist/tools/codex/unifiedExecOutput.d.ts.map +1 -0
- package/dist/tools/codex/unifiedExecOutput.js +44 -0
- package/dist/tools/codex/update_plan.d.ts +10 -0
- package/dist/tools/codex/update_plan.d.ts.map +1 -0
- package/dist/tools/codex/update_plan.js +34 -0
- package/dist/tools/codex/wait_agent.d.ts +13 -0
- package/dist/tools/codex/wait_agent.d.ts.map +1 -0
- package/dist/tools/codex/wait_agent.js +32 -0
- package/dist/tools/codex/write_stdin.d.ts +6 -1
- package/dist/tools/codex/write_stdin.d.ts.map +1 -1
- package/dist/tools/codex/write_stdin.js +44 -12
- package/dist/tools/goals/create_goal.d.ts +11 -0
- package/dist/tools/goals/create_goal.d.ts.map +1 -0
- package/dist/tools/goals/create_goal.js +29 -0
- package/dist/tools/goals/get_goal.d.ts +9 -0
- package/dist/tools/goals/get_goal.d.ts.map +1 -0
- package/dist/tools/goals/get_goal.js +26 -0
- package/dist/tools/goals/goalSchemas.d.ts +8 -0
- package/dist/tools/goals/goalSchemas.d.ts.map +1 -0
- package/dist/tools/goals/goalSchemas.js +13 -0
- package/dist/tools/goals/index.d.ts +30 -0
- package/dist/tools/goals/index.d.ts.map +1 -0
- package/dist/tools/goals/index.js +7 -0
- package/dist/tools/goals/update_goal.d.ts +11 -0
- package/dist/tools/goals/update_goal.d.ts.map +1 -0
- package/dist/tools/goals/update_goal.js +33 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1 -0
- package/dist/tools/pi/bash.d.ts.map +1 -1
- package/dist/tools/pi/bash.js +2 -0
- package/dist/tools/utils/readSessionWithProgress.d.ts +9 -0
- package/dist/tools/utils/readSessionWithProgress.d.ts.map +1 -0
- package/dist/tools/utils/readSessionWithProgress.js +27 -0
- package/dist/tools/utils/shell.d.ts +2 -0
- package/dist/tools/utils/shell.d.ts.map +1 -1
- package/dist/tools/utils/shell.js +37 -0
- package/dist/tools/utils/summarizeShellOutput.d.ts.map +1 -1
- package/dist/tools/utils/summarizeShellOutput.js +2 -0
- package/dist/user-input/index.d.ts +2 -0
- package/dist/user-input/index.d.ts.map +1 -0
- package/dist/user-input/index.js +1 -0
- package/dist/user-input/types.d.ts +19 -0
- package/dist/user-input/types.d.ts.map +1 -0
- package/dist/user-input/types.js +1 -0
- package/dist/web/assets/highlighted-body-OFNGDK62-BuJOCQJD.js +1 -0
- package/dist/web/assets/highlighted-body-OFNGDK62-TwhCqUaJ.js +1 -0
- package/dist/web/assets/index-B6Bc6sUJ.css +1 -0
- package/dist/web/assets/index-BC99-iZC.js +341 -0
- package/dist/web/assets/index-BZN9jSiw.js +341 -0
- package/dist/web/assets/index-CcF0unjO.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +2 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type TaskStatus = "pending" | "in_progress" | "completed";
|
|
2
|
+
export interface SessionTask {
|
|
3
|
+
activeForm?: string;
|
|
4
|
+
blockedBy: readonly string[];
|
|
5
|
+
blocks: readonly string[];
|
|
6
|
+
description: string;
|
|
7
|
+
id: string;
|
|
8
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
9
|
+
owner?: string;
|
|
10
|
+
status: TaskStatus;
|
|
11
|
+
subject: string;
|
|
12
|
+
}
|
|
13
|
+
export interface CreateTaskRequest {
|
|
14
|
+
activeForm?: string;
|
|
15
|
+
description: string;
|
|
16
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
17
|
+
subject: string;
|
|
18
|
+
}
|
|
19
|
+
export interface UpdateTaskRequest {
|
|
20
|
+
activeForm?: string;
|
|
21
|
+
addBlockedBy?: readonly string[];
|
|
22
|
+
addBlocks?: readonly string[];
|
|
23
|
+
description?: string;
|
|
24
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
25
|
+
owner?: string;
|
|
26
|
+
status?: TaskStatus | "deleted";
|
|
27
|
+
subject?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface UpdateTaskResult {
|
|
30
|
+
error?: string;
|
|
31
|
+
statusChange?: {
|
|
32
|
+
from: TaskStatus;
|
|
33
|
+
to: TaskStatus | "deleted";
|
|
34
|
+
};
|
|
35
|
+
success: boolean;
|
|
36
|
+
taskId: string;
|
|
37
|
+
updatedFields: readonly string[];
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../sources/tasks/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC;AAEjE,MAAM,WAAW,WAAW;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE;QAAE,IAAI,EAAE,UAAU,CAAC;QAAC,EAAE,EAAE,UAAU,GAAG,SAAS,CAAA;KAAE,CAAC;IAChE,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/tools/Agent.d.ts
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
export declare const agentTool: import("../agent/types.js").DefinedTool<import("@sinclair/typebox").TObject<{
|
|
2
2
|
description: import("@sinclair/typebox").TString;
|
|
3
3
|
prompt: import("@sinclair/typebox").TString;
|
|
4
|
-
|
|
4
|
+
run_in_background: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
5
|
+
}>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
5
6
|
output: import("@sinclair/typebox").TString;
|
|
7
|
+
path: import("@sinclair/typebox").TString;
|
|
6
8
|
sessionId: import("@sinclair/typebox").TString;
|
|
7
|
-
status: import("@sinclair/typebox").
|
|
8
|
-
|
|
9
|
+
status: import("@sinclair/typebox").TLiteral<"completed">;
|
|
10
|
+
taskName: import("@sinclair/typebox").TString;
|
|
11
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
12
|
+
agentId: import("@sinclair/typebox").TString;
|
|
13
|
+
description: import("@sinclair/typebox").TString;
|
|
14
|
+
path: import("@sinclair/typebox").TString;
|
|
15
|
+
prompt: import("@sinclair/typebox").TString;
|
|
16
|
+
status: import("@sinclair/typebox").TLiteral<"async_launched">;
|
|
17
|
+
taskName: import("@sinclair/typebox").TString;
|
|
18
|
+
}>]>>;
|
|
9
19
|
//# sourceMappingURL=Agent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Agent.d.ts","sourceRoot":"","sources":["../../sources/tools/Agent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Agent.d.ts","sourceRoot":"","sources":["../../sources/tools/Agent.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;KAoEpB,CAAC"}
|
package/dist/tools/Agent.js
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
2
|
import { defineTool } from "../agent/types.js";
|
|
3
|
-
const
|
|
3
|
+
const completedAgentResultSchema = Type.Object({
|
|
4
4
|
output: Type.String(),
|
|
5
|
+
path: Type.String(),
|
|
5
6
|
sessionId: Type.String(),
|
|
6
|
-
status: Type.
|
|
7
|
+
status: Type.Literal("completed"),
|
|
8
|
+
taskName: Type.String(),
|
|
9
|
+
});
|
|
10
|
+
const backgroundAgentResultSchema = Type.Object({
|
|
11
|
+
agentId: Type.String(),
|
|
12
|
+
description: Type.String(),
|
|
13
|
+
path: Type.String(),
|
|
14
|
+
prompt: Type.String(),
|
|
15
|
+
status: Type.Literal("async_launched"),
|
|
16
|
+
taskName: Type.String(),
|
|
7
17
|
});
|
|
8
18
|
export const agentTool = defineTool({
|
|
9
19
|
name: "Agent",
|
|
10
20
|
label: "Agent",
|
|
11
|
-
description: "Start a
|
|
21
|
+
description: "Start a subagent for a focused, self-contained task. Run it in the foreground when its result is needed immediately, or in the background to keep working while it runs.",
|
|
12
22
|
arguments: Type.Object({
|
|
13
23
|
description: Type.String({
|
|
14
24
|
description: "A short, human-readable description of the delegated task.",
|
|
@@ -16,34 +26,52 @@ export const agentTool = defineTool({
|
|
|
16
26
|
prompt: Type.String({
|
|
17
27
|
description: "Complete instructions for the subagent.",
|
|
18
28
|
}),
|
|
29
|
+
run_in_background: Type.Optional(Type.Boolean({
|
|
30
|
+
description: "Set to true to run the subagent in the background. A completion notification will arrive later.",
|
|
31
|
+
})),
|
|
19
32
|
}),
|
|
20
|
-
returnType:
|
|
21
|
-
execute: async ({ description, prompt }, context, execution) => {
|
|
33
|
+
returnType: Type.Union([completedAgentResultSchema, backgroundAgentResultSchema]),
|
|
34
|
+
execute: async ({ description, prompt, run_in_background }, context, execution) => {
|
|
22
35
|
if (context.subagents === undefined || !context.subagents.canSpawn) {
|
|
23
36
|
throw new Error("This agent has reached the maximum subagent depth.");
|
|
24
37
|
}
|
|
25
38
|
const result = await context.subagents.spawn({
|
|
26
39
|
description,
|
|
40
|
+
...(run_in_background === true ? { background: true } : {}),
|
|
27
41
|
prompt,
|
|
28
42
|
...(execution.toolCallId !== undefined
|
|
29
43
|
? { parentToolCallId: execution.toolCallId }
|
|
30
44
|
: {}),
|
|
31
45
|
}, execution.signal);
|
|
46
|
+
if (result.status === "running") {
|
|
47
|
+
return {
|
|
48
|
+
agentId: result.sessionId,
|
|
49
|
+
description,
|
|
50
|
+
path: result.path,
|
|
51
|
+
prompt,
|
|
52
|
+
status: "async_launched",
|
|
53
|
+
taskName: result.taskName,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
32
56
|
if (result.status !== "completed") {
|
|
33
57
|
throw new Error(result.output);
|
|
34
58
|
}
|
|
35
|
-
return
|
|
59
|
+
return {
|
|
60
|
+
output: result.output,
|
|
61
|
+
path: result.path,
|
|
62
|
+
sessionId: result.sessionId,
|
|
63
|
+
status: "completed",
|
|
64
|
+
taskName: result.taskName,
|
|
65
|
+
};
|
|
36
66
|
},
|
|
37
67
|
toLLM: (result) => [
|
|
38
68
|
{
|
|
39
69
|
type: "text",
|
|
40
|
-
text: result.status === "
|
|
41
|
-
? result.output
|
|
42
|
-
: `The subagent ${result.status}. ${result.output}`,
|
|
70
|
+
text: result.status === "async_launched" ? JSON.stringify(result) : result.output,
|
|
43
71
|
},
|
|
44
72
|
],
|
|
45
|
-
toUI: (result, args) => result.status === "
|
|
46
|
-
? `
|
|
47
|
-
:
|
|
73
|
+
toUI: (result, args) => result.status === "async_launched"
|
|
74
|
+
? `Running in background: ${args.description}`
|
|
75
|
+
: `Completed: ${args.description}`,
|
|
48
76
|
locks: [],
|
|
49
77
|
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const claudeAskUserQuestionTool: import("../../agent/types.js").DefinedTool<import("@sinclair/typebox").TObject<{
|
|
2
|
+
questions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
3
|
+
question: import("@sinclair/typebox").TString;
|
|
4
|
+
header: import("@sinclair/typebox").TString;
|
|
5
|
+
options: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
6
|
+
label: import("@sinclair/typebox").TString;
|
|
7
|
+
description: import("@sinclair/typebox").TString;
|
|
8
|
+
}>>;
|
|
9
|
+
multiSelect: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
10
|
+
}>>;
|
|
11
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
12
|
+
questions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
13
|
+
question: import("@sinclair/typebox").TString;
|
|
14
|
+
header: import("@sinclair/typebox").TString;
|
|
15
|
+
options: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
16
|
+
label: import("@sinclair/typebox").TString;
|
|
17
|
+
description: import("@sinclair/typebox").TString;
|
|
18
|
+
}>>;
|
|
19
|
+
multiSelect: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
20
|
+
}>>;
|
|
21
|
+
answers: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>;
|
|
22
|
+
}>>;
|
|
23
|
+
//# sourceMappingURL=AskUserQuestion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AskUserQuestion.d.ts","sourceRoot":"","sources":["../../../sources/tools/claude/AskUserQuestion.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;GA8CpC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { defineTool } from "../../agent/types.js";
|
|
3
|
+
const optionSchema = Type.Object({
|
|
4
|
+
label: Type.String({ description: "Concise display text for this choice." }),
|
|
5
|
+
description: Type.String({ description: "Context about the choice and its tradeoffs." }),
|
|
6
|
+
}, { additionalProperties: false });
|
|
7
|
+
const questionSchema = Type.Object({
|
|
8
|
+
question: Type.String({ description: "The complete question to ask the user." }),
|
|
9
|
+
header: Type.String({
|
|
10
|
+
maxLength: 12,
|
|
11
|
+
description: "A very short label for the question, at most 12 characters.",
|
|
12
|
+
}),
|
|
13
|
+
options: Type.Array(optionSchema, { minItems: 2, maxItems: 4 }),
|
|
14
|
+
multiSelect: Type.Optional(Type.Boolean({ description: "Allow the user to select multiple choices." })),
|
|
15
|
+
}, { additionalProperties: false });
|
|
16
|
+
export const claudeAskUserQuestionTool = defineTool({
|
|
17
|
+
name: "AskUserQuestion",
|
|
18
|
+
label: "AskUserQuestion",
|
|
19
|
+
description: "Asks the user multiple-choice questions to clarify ambiguity, understand preferences, or make decisions.",
|
|
20
|
+
arguments: Type.Object({ questions: Type.Array(questionSchema, { minItems: 1, maxItems: 4 }) }, { additionalProperties: false }),
|
|
21
|
+
returnType: Type.Object({
|
|
22
|
+
questions: Type.Array(questionSchema),
|
|
23
|
+
answers: Type.Record(Type.String(), Type.String()),
|
|
24
|
+
}),
|
|
25
|
+
async execute({ questions }, context, execution) {
|
|
26
|
+
if (new Set(questions.map((question) => question.question)).size !== questions.length) {
|
|
27
|
+
throw new Error("Interactive question text must be unique.");
|
|
28
|
+
}
|
|
29
|
+
if (context.userInput === undefined) {
|
|
30
|
+
throw new Error("Interactive user input is unavailable in this session.");
|
|
31
|
+
}
|
|
32
|
+
if (execution.toolCallId === undefined) {
|
|
33
|
+
throw new Error("Interactive user input requires a tool call identifier.");
|
|
34
|
+
}
|
|
35
|
+
const normalizedQuestions = questions.map((question, index) => ({
|
|
36
|
+
...question,
|
|
37
|
+
id: `question_${index + 1}`,
|
|
38
|
+
multiSelect: question.multiSelect ?? false,
|
|
39
|
+
}));
|
|
40
|
+
const response = await context.userInput.request({ requestId: execution.toolCallId, questions: normalizedQuestions }, execution.signal === undefined ? undefined : { signal: execution.signal });
|
|
41
|
+
return {
|
|
42
|
+
questions,
|
|
43
|
+
answers: Object.fromEntries(normalizedQuestions.map((question) => [
|
|
44
|
+
question.question,
|
|
45
|
+
(response.answers[question.id] ?? []).join(", "),
|
|
46
|
+
])),
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
toLLM: (result) => [{ type: "text", text: JSON.stringify(result) }],
|
|
50
|
+
toUI: (_result, args) => `Answered ${args.questions.length} question${args.questions.length === 1 ? "" : "s"}`,
|
|
51
|
+
locks: ["user_input"],
|
|
52
|
+
});
|
|
@@ -3,7 +3,9 @@ export declare const claudeBashTool: import("../../agent/types.js").DefinedTool<
|
|
|
3
3
|
timeout: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
4
4
|
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
5
5
|
run_in_background: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
6
|
+
dangerouslyDisableSandbox: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
6
7
|
}>, import("@sinclair/typebox").TObject<{
|
|
8
|
+
backgroundTaskId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
7
9
|
stdout: import("@sinclair/typebox").TString;
|
|
8
10
|
stderr: import("@sinclair/typebox").TString;
|
|
9
11
|
exitCode: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bash.d.ts","sourceRoot":"","sources":["../../../sources/tools/claude/Bash.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"Bash.d.ts","sourceRoot":"","sources":["../../../sources/tools/claude/Bash.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,cAAc;;;;;;;;;;;;GAkDzB,CAAC"}
|
|
@@ -12,14 +12,32 @@ export const claudeBashTool = defineTool({
|
|
|
12
12
|
description: 'Clear, concise description of what this command does in active voice. Never use words like "complex" or "risk" in the description - just describe what it does.',
|
|
13
13
|
})),
|
|
14
14
|
run_in_background: Type.Optional(Type.Boolean({
|
|
15
|
-
description: "Set to true to run this command in the background. Use
|
|
15
|
+
description: "Set to true to run this command in the background. Use TaskOutput to read the output later.",
|
|
16
|
+
})),
|
|
17
|
+
dangerouslyDisableSandbox: Type.Optional(Type.Boolean({
|
|
18
|
+
description: "Request reviewed execution outside the workspace sandbox in Auto mode. Use only when the sandbox blocks a necessary command.",
|
|
16
19
|
})),
|
|
17
20
|
}),
|
|
18
21
|
returnType: shellToolOutputSchema,
|
|
19
|
-
execute: async ({ command, timeout }, context, execution) => {
|
|
22
|
+
execute: async ({ command, run_in_background, timeout }, context, execution) => {
|
|
23
|
+
if (run_in_background === true) {
|
|
24
|
+
const sessionId = await context.bash.startSession({
|
|
25
|
+
command,
|
|
26
|
+
timeoutMs: timeout ?? 120_000,
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
backgroundTaskId: String(sessionId),
|
|
30
|
+
exitCode: null,
|
|
31
|
+
stderr: "",
|
|
32
|
+
stdout: "",
|
|
33
|
+
timedOut: false,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
20
36
|
const options = {};
|
|
21
37
|
if (timeout !== undefined)
|
|
22
38
|
options.timeoutMs = timeout;
|
|
39
|
+
if (execution.onProgress !== undefined)
|
|
40
|
+
options.onProgress = execution.onProgress;
|
|
23
41
|
if (execution.signal !== undefined)
|
|
24
42
|
options.signal = execution.signal;
|
|
25
43
|
return runShellCommand(command, options, context);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const claudeSendMessageTool: import("../../agent/types.js").DefinedTool<import("@sinclair/typebox").TObject<{
|
|
2
|
+
to: import("@sinclair/typebox").TString;
|
|
3
|
+
summary: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
4
|
+
message: import("@sinclair/typebox").TString;
|
|
5
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
6
|
+
message: import("@sinclair/typebox").TString;
|
|
7
|
+
success: import("@sinclair/typebox").TBoolean;
|
|
8
|
+
target: import("@sinclair/typebox").TString;
|
|
9
|
+
}>>;
|
|
10
|
+
//# sourceMappingURL=SendMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SendMessage.d.ts","sourceRoot":"","sources":["../../../sources/tools/claude/SendMessage.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB;;;;;;;;GAkChC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { defineTool } from "../../agent/types.js";
|
|
3
|
+
export const claudeSendMessageTool = defineTool({
|
|
4
|
+
name: "SendMessage",
|
|
5
|
+
label: "SendMessage",
|
|
6
|
+
description: "Send follow-up work to a previously spawned subagent by its task name, path, or agent id. The agent resumes with its full context preserved.",
|
|
7
|
+
arguments: Type.Object({
|
|
8
|
+
to: Type.String({ description: "The target subagent's task name, path, or agent id." }),
|
|
9
|
+
summary: Type.Optional(Type.String({ description: "A short human-readable summary of the follow-up." })),
|
|
10
|
+
message: Type.String({ description: "The follow-up instructions." }),
|
|
11
|
+
}),
|
|
12
|
+
returnType: Type.Object({
|
|
13
|
+
message: Type.String(),
|
|
14
|
+
success: Type.Boolean(),
|
|
15
|
+
target: Type.String(),
|
|
16
|
+
}),
|
|
17
|
+
execute: ({ message, summary, to }, context) => {
|
|
18
|
+
if (context.subagents === undefined) {
|
|
19
|
+
throw new Error("Subagent management is unavailable in this session.");
|
|
20
|
+
}
|
|
21
|
+
const target = context.subagents.followUp(to, message);
|
|
22
|
+
return {
|
|
23
|
+
message: summary === undefined
|
|
24
|
+
? `Follow-up work was sent to ${target.description}.`
|
|
25
|
+
: `${summary}: follow-up work was sent to ${target.description}.`,
|
|
26
|
+
success: true,
|
|
27
|
+
target: target.path,
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
toLLM: (result) => [{ type: "text", text: JSON.stringify(result) }],
|
|
31
|
+
toUI: (result) => result.message,
|
|
32
|
+
locks: [],
|
|
33
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const claudeTaskCreateTool: import("../../agent/types.js").DefinedTool<import("@sinclair/typebox").TObject<{
|
|
2
|
+
subject: import("@sinclair/typebox").TString;
|
|
3
|
+
description: import("@sinclair/typebox").TString;
|
|
4
|
+
activeForm: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
5
|
+
metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
|
|
6
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
7
|
+
task: import("@sinclair/typebox").TObject<{
|
|
8
|
+
id: import("@sinclair/typebox").TString;
|
|
9
|
+
subject: import("@sinclair/typebox").TString;
|
|
10
|
+
}>;
|
|
11
|
+
}>>;
|
|
12
|
+
//# sourceMappingURL=TaskCreate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskCreate.d.ts","sourceRoot":"","sources":["../../../sources/tools/claude/TaskCreate.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB;;;;;;;;;;GAoC/B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { defineTool } from "../../agent/types.js";
|
|
3
|
+
import { taskMetadataSchema } from "./taskSchemas.js";
|
|
4
|
+
export const claudeTaskCreateTool = defineTool({
|
|
5
|
+
name: "TaskCreate",
|
|
6
|
+
label: "TaskCreate",
|
|
7
|
+
description: "Create a structured task for a non-trivial coding session. New tasks begin as pending.",
|
|
8
|
+
arguments: Type.Object({
|
|
9
|
+
subject: Type.String({ description: "A brief actionable title for the task." }),
|
|
10
|
+
description: Type.String({ description: "What needs to be done." }),
|
|
11
|
+
activeForm: Type.Optional(Type.String({ description: "Present-continuous text shown while in progress." })),
|
|
12
|
+
metadata: Type.Optional(taskMetadataSchema),
|
|
13
|
+
}, { additionalProperties: false }),
|
|
14
|
+
returnType: Type.Object({
|
|
15
|
+
task: Type.Object({ id: Type.String(), subject: Type.String() }),
|
|
16
|
+
}),
|
|
17
|
+
execute({ subject, description, activeForm, metadata }, context) {
|
|
18
|
+
if (context.tasks === undefined) {
|
|
19
|
+
throw new Error("Task tracking is unavailable in this session.");
|
|
20
|
+
}
|
|
21
|
+
const task = context.tasks.create({
|
|
22
|
+
subject,
|
|
23
|
+
description,
|
|
24
|
+
...(activeForm !== undefined ? { activeForm } : {}),
|
|
25
|
+
...(metadata !== undefined ? { metadata } : {}),
|
|
26
|
+
});
|
|
27
|
+
return { task: { id: task.id, subject: task.subject } };
|
|
28
|
+
},
|
|
29
|
+
toLLM: ({ task }) => [
|
|
30
|
+
{ type: "text", text: `Task #${task.id} created successfully: ${task.subject}` },
|
|
31
|
+
],
|
|
32
|
+
toUI: ({ task }) => `Created task: ${task.subject}`,
|
|
33
|
+
locks: ["tasks"],
|
|
34
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const claudeTaskGetTool: import("../../agent/types.js").DefinedTool<import("@sinclair/typebox").TObject<{
|
|
2
|
+
taskId: import("@sinclair/typebox").TString;
|
|
3
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
4
|
+
task: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
5
|
+
id: import("@sinclair/typebox").TString;
|
|
6
|
+
subject: import("@sinclair/typebox").TString;
|
|
7
|
+
description: import("@sinclair/typebox").TString;
|
|
8
|
+
activeForm: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
9
|
+
owner: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
10
|
+
status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"pending">, import("@sinclair/typebox").TLiteral<"in_progress">, import("@sinclair/typebox").TLiteral<"completed">]>;
|
|
11
|
+
blocks: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
12
|
+
blockedBy: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
13
|
+
metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
|
|
14
|
+
}>, import("@sinclair/typebox").TNull]>;
|
|
15
|
+
}>>;
|
|
16
|
+
//# sourceMappingURL=TaskGet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskGet.d.ts","sourceRoot":"","sources":["../../../sources/tools/claude/TaskGet.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;GA0C5B,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { defineTool } from "../../agent/types.js";
|
|
3
|
+
import { sessionTaskSchema } from "./taskSchemas.js";
|
|
4
|
+
export const claudeTaskGetTool = defineTool({
|
|
5
|
+
name: "TaskGet",
|
|
6
|
+
label: "TaskGet",
|
|
7
|
+
description: "Get the full details and dependencies for a task by its ID.",
|
|
8
|
+
arguments: Type.Object({ taskId: Type.String({ description: "The ID of the task to retrieve." }) }, { additionalProperties: false }),
|
|
9
|
+
returnType: Type.Object({ task: Type.Union([sessionTaskSchema, Type.Null()]) }),
|
|
10
|
+
execute({ taskId }, context) {
|
|
11
|
+
if (context.tasks === undefined) {
|
|
12
|
+
throw new Error("Task tracking is unavailable in this session.");
|
|
13
|
+
}
|
|
14
|
+
const task = context.tasks.get(taskId);
|
|
15
|
+
return {
|
|
16
|
+
task: task === undefined
|
|
17
|
+
? null
|
|
18
|
+
: {
|
|
19
|
+
...task,
|
|
20
|
+
blockedBy: [...task.blockedBy],
|
|
21
|
+
blocks: [...task.blocks],
|
|
22
|
+
...(task.metadata !== undefined
|
|
23
|
+
? { metadata: { ...task.metadata } }
|
|
24
|
+
: {}),
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
toLLM: ({ task }) => {
|
|
29
|
+
if (task === null)
|
|
30
|
+
return [{ type: "text", text: "Task not found" }];
|
|
31
|
+
const lines = [
|
|
32
|
+
`Task #${task.id}: ${task.subject}`,
|
|
33
|
+
`Status: ${task.status}`,
|
|
34
|
+
`Description: ${task.description}`,
|
|
35
|
+
];
|
|
36
|
+
if (task.blockedBy.length > 0)
|
|
37
|
+
lines.push(`Blocked by: ${task.blockedBy.join(", ")}`);
|
|
38
|
+
if (task.blocks.length > 0)
|
|
39
|
+
lines.push(`Blocks: ${task.blocks.join(", ")}`);
|
|
40
|
+
return [{ type: "text", text: lines.join("\n") }];
|
|
41
|
+
},
|
|
42
|
+
toUI: ({ task }, { taskId }) => task === null ? `Task ${taskId} was not found` : `Read task: ${task.subject}`,
|
|
43
|
+
locks: [],
|
|
44
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const claudeTaskListTool: import("../../agent/types.js").DefinedTool<import("@sinclair/typebox").TObject<{}>, import("@sinclair/typebox").TObject<{
|
|
2
|
+
tasks: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
3
|
+
id: import("@sinclair/typebox").TString;
|
|
4
|
+
subject: import("@sinclair/typebox").TString;
|
|
5
|
+
status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"pending">, import("@sinclair/typebox").TLiteral<"in_progress">, import("@sinclair/typebox").TLiteral<"completed">]>;
|
|
6
|
+
owner: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
7
|
+
blockedBy: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
8
|
+
}>>;
|
|
9
|
+
}>>;
|
|
10
|
+
//# sourceMappingURL=TaskList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskList.d.ts","sourceRoot":"","sources":["../../../sources/tools/claude/TaskList.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,kBAAkB;;;;;;;;GA4C7B,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { defineTool } from "../../agent/types.js";
|
|
3
|
+
import { taskStatusSchema } from "./taskSchemas.js";
|
|
4
|
+
const taskSummarySchema = Type.Object({
|
|
5
|
+
id: Type.String(),
|
|
6
|
+
subject: Type.String(),
|
|
7
|
+
status: taskStatusSchema,
|
|
8
|
+
owner: Type.Optional(Type.String()),
|
|
9
|
+
blockedBy: Type.Array(Type.String()),
|
|
10
|
+
});
|
|
11
|
+
export const claudeTaskListTool = defineTool({
|
|
12
|
+
name: "TaskList",
|
|
13
|
+
label: "TaskList",
|
|
14
|
+
description: "List all tasks with their status, owner, and unresolved dependencies.",
|
|
15
|
+
arguments: Type.Object({}, { additionalProperties: false }),
|
|
16
|
+
returnType: Type.Object({ tasks: Type.Array(taskSummarySchema) }),
|
|
17
|
+
execute(_args, context) {
|
|
18
|
+
if (context.tasks === undefined) {
|
|
19
|
+
throw new Error("Task tracking is unavailable in this session.");
|
|
20
|
+
}
|
|
21
|
+
const tasks = context.tasks.list();
|
|
22
|
+
const completed = new Set(tasks.filter((task) => task.status === "completed").map((task) => task.id));
|
|
23
|
+
return {
|
|
24
|
+
tasks: tasks.map((task) => ({
|
|
25
|
+
id: task.id,
|
|
26
|
+
subject: task.subject,
|
|
27
|
+
status: task.status,
|
|
28
|
+
...(task.owner !== undefined ? { owner: task.owner } : {}),
|
|
29
|
+
blockedBy: task.blockedBy.filter((taskId) => !completed.has(taskId)),
|
|
30
|
+
})),
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
toLLM: ({ tasks }) => [
|
|
34
|
+
{
|
|
35
|
+
type: "text",
|
|
36
|
+
text: tasks.length === 0
|
|
37
|
+
? "No tasks found"
|
|
38
|
+
: tasks
|
|
39
|
+
.map((task) => {
|
|
40
|
+
const owner = task.owner === undefined ? "" : ` (${task.owner})`;
|
|
41
|
+
const blocked = task.blockedBy.length === 0
|
|
42
|
+
? ""
|
|
43
|
+
: ` [blocked by ${task.blockedBy.join(", ")}]`;
|
|
44
|
+
return `#${task.id} [${task.status}] ${task.subject}${owner}${blocked}`;
|
|
45
|
+
})
|
|
46
|
+
.join("\n"),
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
toUI: ({ tasks }) => `Listed ${tasks.length} task${tasks.length === 1 ? "" : "s"}`,
|
|
50
|
+
locks: [],
|
|
51
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const claudeTaskOutputTool: import("../../agent/types.js").DefinedTool<import("@sinclair/typebox").TObject<{
|
|
2
|
+
task_id: import("@sinclair/typebox").TString;
|
|
3
|
+
block: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
4
|
+
timeout: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
5
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
6
|
+
retrieval_status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"not_ready">, import("@sinclair/typebox").TLiteral<"success">, import("@sinclair/typebox").TLiteral<"timeout">]>;
|
|
7
|
+
task: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
8
|
+
command: import("@sinclair/typebox").TString;
|
|
9
|
+
description: import("@sinclair/typebox").TString;
|
|
10
|
+
exitCode: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>>;
|
|
11
|
+
output: import("@sinclair/typebox").TString;
|
|
12
|
+
status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"completed">, import("@sinclair/typebox").TLiteral<"killed">, import("@sinclair/typebox").TLiteral<"running">]>;
|
|
13
|
+
task_id: import("@sinclair/typebox").TString;
|
|
14
|
+
task_type: import("@sinclair/typebox").TLiteral<"local_bash">;
|
|
15
|
+
}>, import("@sinclair/typebox").TNull]>;
|
|
16
|
+
}>>;
|
|
17
|
+
//# sourceMappingURL=TaskOutput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskOutput.d.ts","sourceRoot":"","sources":["../../../sources/tools/claude/TaskOutput.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;GA6D/B,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { defineTool } from "../../agent/types.js";
|
|
3
|
+
import { readSessionWithProgress } from "../utils/readSessionWithProgress.js";
|
|
4
|
+
import { parseBackgroundTaskId } from "./parseBackgroundTaskId.js";
|
|
5
|
+
const backgroundTaskSchema = Type.Object({
|
|
6
|
+
command: Type.String(),
|
|
7
|
+
description: Type.String(),
|
|
8
|
+
exitCode: Type.Optional(Type.Union([Type.Number(), Type.Null()])),
|
|
9
|
+
output: Type.String(),
|
|
10
|
+
status: Type.Union([
|
|
11
|
+
Type.Literal("completed"),
|
|
12
|
+
Type.Literal("killed"),
|
|
13
|
+
Type.Literal("running"),
|
|
14
|
+
]),
|
|
15
|
+
task_id: Type.String(),
|
|
16
|
+
task_type: Type.Literal("local_bash"),
|
|
17
|
+
});
|
|
18
|
+
export const claudeTaskOutputTool = defineTool({
|
|
19
|
+
name: "TaskOutput",
|
|
20
|
+
label: "TaskOutput",
|
|
21
|
+
description: "Read output from a running or completed background shell task.",
|
|
22
|
+
arguments: Type.Object({
|
|
23
|
+
task_id: Type.String({ description: "The background task identifier." }),
|
|
24
|
+
block: Type.Optional(Type.Boolean({ description: "Whether to wait for the task to finish." })),
|
|
25
|
+
timeout: Type.Optional(Type.Number({
|
|
26
|
+
description: "Maximum wait in milliseconds.",
|
|
27
|
+
maximum: 600_000,
|
|
28
|
+
minimum: 0,
|
|
29
|
+
})),
|
|
30
|
+
}),
|
|
31
|
+
returnType: Type.Object({
|
|
32
|
+
retrieval_status: Type.Union([
|
|
33
|
+
Type.Literal("not_ready"),
|
|
34
|
+
Type.Literal("success"),
|
|
35
|
+
Type.Literal("timeout"),
|
|
36
|
+
]),
|
|
37
|
+
task: Type.Union([backgroundTaskSchema, Type.Null()]),
|
|
38
|
+
}),
|
|
39
|
+
execute: async ({ block = true, task_id, timeout = 30_000 }, context, execution) => {
|
|
40
|
+
const sessionId = parseBackgroundTaskId(task_id);
|
|
41
|
+
const snapshot = await readSessionWithProgress({
|
|
42
|
+
bash: context.bash,
|
|
43
|
+
...(execution.onProgress === undefined ? {} : { onProgress: execution.onProgress }),
|
|
44
|
+
sessionId,
|
|
45
|
+
...(execution.signal === undefined ? {} : { signal: execution.signal }),
|
|
46
|
+
waitMs: block ? timeout : 0,
|
|
47
|
+
});
|
|
48
|
+
if (snapshot === undefined) {
|
|
49
|
+
throw new Error("The background task was not found.");
|
|
50
|
+
}
|
|
51
|
+
const stillRunning = snapshot.status === "running";
|
|
52
|
+
return {
|
|
53
|
+
retrieval_status: stillRunning ? (block ? "timeout" : "not_ready") : "success",
|
|
54
|
+
task: {
|
|
55
|
+
command: snapshot.command,
|
|
56
|
+
description: snapshot.command,
|
|
57
|
+
...(stillRunning ? {} : { exitCode: snapshot.exitCode }),
|
|
58
|
+
output: [snapshot.stdout, snapshot.stderr]
|
|
59
|
+
.filter((value) => value.length > 0)
|
|
60
|
+
.join("\n"),
|
|
61
|
+
status: snapshot.status,
|
|
62
|
+
task_id,
|
|
63
|
+
task_type: "local_bash",
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
toLLM: (result) => [{ type: "text", text: JSON.stringify(result) }],
|
|
68
|
+
toUI: (result) => result.retrieval_status === "success"
|
|
69
|
+
? "Background command output is ready."
|
|
70
|
+
: result.retrieval_status === "timeout"
|
|
71
|
+
? "Background command is still running after the wait."
|
|
72
|
+
: "Background command is still running.",
|
|
73
|
+
locks: [],
|
|
74
|
+
});
|