@agimon-ai/doompi-task 0.0.1-alpha.8 → 0.0.1-alpha.80
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 +123 -15
- package/dist/_virtual/_rolldown/runtime.cjs +23 -1
- package/dist/api-contracts.cjs +7 -0
- package/dist/api-contracts.d.cts +2 -0
- package/dist/api-contracts.d.mts +2 -0
- package/dist/api-contracts.mjs +2 -0
- package/dist/commands.cjs +4 -2
- package/dist/commands.d.cts +2 -14
- package/dist/commands.d.mts +2 -14
- package/dist/commands.mjs +2 -2
- package/dist/config.cjs +19 -2
- package/dist/config.d.cts +2 -38
- package/dist/config.d.mts +2 -38
- package/dist/config.mjs +2 -2
- package/dist/delegation-manager.cjs +10 -0
- package/dist/delegation-manager.d.cts +3 -0
- package/dist/delegation-manager.d.mts +3 -0
- package/dist/delegation-manager.mjs +3 -0
- package/dist/extensions/mcp.cjs +1866 -0
- package/dist/extensions/mcp.cjs.map +1 -0
- package/dist/extensions/mcp.d.cts +5 -0
- package/dist/extensions/mcp.d.cts.map +1 -0
- package/dist/extensions/mcp.d.mts +5 -0
- package/dist/extensions/mcp.d.mts.map +1 -0
- package/dist/extensions/mcp.mjs +1836 -0
- package/dist/extensions/mcp.mjs.map +1 -0
- package/dist/extensions/pi.cjs +49 -1
- package/dist/extensions/pi.cjs.map +1 -1
- package/dist/extensions/pi.d.cts +5 -2
- package/dist/extensions/pi.d.cts.map +1 -0
- package/dist/extensions/pi.d.mts +5 -2
- package/dist/extensions/pi.d.mts.map +1 -0
- package/dist/extensions/pi.mjs +44 -1
- package/dist/extensions/pi.mjs.map +1 -1
- package/dist/extensions/server.cjs +57 -0
- package/dist/extensions/server.cjs.map +1 -0
- package/dist/extensions/server.d.cts +5 -0
- package/dist/extensions/server.d.cts.map +1 -0
- package/dist/extensions/server.d.mts +5 -0
- package/dist/extensions/server.d.mts.map +1 -0
- package/dist/extensions/server.mjs +52 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/extensions/web.mjs +1013 -0
- package/dist/extensions/web.mjs.map +1 -0
- package/dist/index.cjs +106 -1
- package/dist/index.d.cts +16 -15
- package/dist/index.d.mts +16 -15
- package/dist/index.mjs +16 -1
- package/dist/logSinkTelemetry.cjs +6 -2
- package/dist/logSinkTelemetry.d.cts +3 -51
- package/dist/logSinkTelemetry.d.mts +3 -51
- package/dist/logSinkTelemetry.mjs +3 -2
- package/dist/src/constants/promptGuidelines.cjs +26 -0
- package/dist/src/constants/promptGuidelines.cjs.map +1 -0
- package/dist/src/constants/promptGuidelines.d.cts +13 -0
- package/dist/src/constants/promptGuidelines.d.cts.map +1 -0
- package/dist/src/constants/promptGuidelines.d.mts +13 -0
- package/dist/src/constants/promptGuidelines.d.mts.map +1 -0
- package/dist/src/constants/promptGuidelines.mjs +26 -0
- package/dist/src/constants/promptGuidelines.mjs.map +1 -0
- package/dist/src/constants/task.cjs +6 -0
- package/dist/src/constants/task.cjs.map +1 -0
- package/dist/src/constants/task.d.cts +4 -0
- package/dist/src/constants/task.d.cts.map +1 -0
- package/dist/src/constants/task.d.mts +4 -0
- package/dist/src/constants/task.d.mts.map +1 -0
- package/dist/src/constants/task.mjs +6 -0
- package/dist/src/constants/task.mjs.map +1 -0
- package/dist/src/extensions/(backend)/channel/_lib/task-graph.cjs +90 -0
- package/dist/src/extensions/(backend)/channel/_lib/task-graph.cjs.map +1 -0
- package/dist/src/extensions/(backend)/channel/_lib/task-graph.mjs +89 -0
- package/dist/src/extensions/(backend)/channel/_lib/task-graph.mjs.map +1 -0
- package/dist/src/extensions/(backend)/channel/task-graph.server.cjs +7 -0
- package/dist/src/extensions/(backend)/channel/task-graph.server.cjs.map +1 -0
- package/dist/src/extensions/(backend)/channel/task-graph.server.mjs +8 -0
- package/dist/src/extensions/(backend)/channel/task-graph.server.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.cjs +317 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.d.cts +39 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.d.cts.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.d.mts +39 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.d.mts.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.mjs +317 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.server.cjs +95 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.server.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.server.mjs +95 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.server.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.cli.cjs +30 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.cli.d.cts +20 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.cli.d.cts.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.cli.d.mts +20 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.cli.d.mts.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.cli.mjs +29 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.server.cjs +19 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.server.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.server.mjs +19 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.server.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/tasks.cli.cjs +8 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/tasks.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/tasks.cli.mjs +9 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/tasks.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/tasks.server.cjs +7 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/tasks.server.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/tasks.server.mjs +8 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/command/tasks.server.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-compact.cli.cjs +6 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-compact.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-compact.cli.mjs +6 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-compact.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-start.cli.cjs +6 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-start.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-start.cli.mjs +6 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-start.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-tree.cli.cjs +6 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-tree.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-tree.cli.mjs +6 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-tree.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/tool-execution-end.cli.cjs +6 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/tool-execution-end.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/tool-execution-end.cli.mjs +6 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/tool-execution-end.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-compact.cli.cjs +7 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-compact.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-compact.cli.mjs +8 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-compact.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.cjs +7 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.mjs +8 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-tree.cli.cjs +7 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-tree.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-tree.cli.mjs +8 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-tree.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/tool-execution-end.cli.cjs +7 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/tool-execution-end.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/tool-execution-end.cli.mjs +8 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/hook/tool-execution-end.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/resource/_lib/task-board.server.cjs +20 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/resource/_lib/task-board.server.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/resource/_lib/task-board.server.mjs +20 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/resource/_lib/task-board.server.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/resource/task-board.server.cjs +7 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/resource/task-board.server.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/resource/task-board.server.mjs +8 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/resource/task-board.server.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.cjs +11 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.mjs +12 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/root.server.cjs +7 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/root.server.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/root.server.mjs +8 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/root.server.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.cli.cjs +160 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.cli.d.cts +25 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.cli.d.cts.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.cli.d.mts +25 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.cli.d.mts.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.cli.mjs +157 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.server.cjs +7 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.server.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.server.mjs +8 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.server.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/task.cli.cjs +7 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/task.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/task.cli.mjs +8 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/task.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/task.server.cjs +7 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/task.server.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/task.server.mjs +8 -0
- package/dist/src/extensions/workspaces/sessions/(backend)/tool/task.server.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/_shared/format.cli.cjs +333 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/_shared/format.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/_shared/format.cli.d.cts +61 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/_shared/format.cli.d.cts.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/_shared/format.cli.d.mts +61 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/_shared/format.cli.d.mts.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/_shared/format.cli.mjs +322 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/_shared/format.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/message/doom-task-notify.cli.cjs +9 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/message/doom-task-notify.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/message/doom-task-notify.cli.mjs +9 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/message/doom-task-notify.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/selectors.cjs +149 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/selectors.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/selectors.d.cts +59 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/selectors.d.cts.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/selectors.d.mts +59 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/selectors.d.mts.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/selectors.mjs +142 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/selectors.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/task-space.cli.cjs +358 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/task-space.cli.cjs.map +1 -0
- package/dist/{tui/taskSpace.d.cts → src/extensions/workspaces/sessions/(frontend)/overlay/_lib/task-space.cli.d.cts} +12 -12
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/task-space.cli.d.cts.map +1 -0
- package/dist/{tui/taskSpace.d.mts → src/extensions/workspaces/sessions/(frontend)/overlay/_lib/task-space.cli.d.mts} +12 -12
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/task-space.cli.d.mts.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/task-space.cli.mjs +355 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/task-space.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/taskOverlay.cjs +165 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/taskOverlay.cjs.map +1 -0
- package/dist/{tui → src/extensions/workspaces/sessions/(frontend)/overlay/_lib}/taskOverlay.d.cts +8 -7
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/taskOverlay.d.cts.map +1 -0
- package/dist/{tui → src/extensions/workspaces/sessions/(frontend)/overlay/_lib}/taskOverlay.d.mts +8 -7
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/taskOverlay.d.mts.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/taskOverlay.mjs +164 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/taskOverlay.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/tool/_lib/task.cli.cjs +13 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/tool/_lib/task.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/tool/_lib/task.cli.mjs +13 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/tool/_lib/task.cli.mjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/tool/task.cli.cjs +7 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/tool/task.cli.cjs.map +1 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/tool/task.cli.mjs +8 -0
- package/dist/src/extensions/workspaces/sessions/(frontend)/tool/task.cli.mjs.map +1 -0
- package/dist/src/models/task.cjs +29 -0
- package/dist/src/models/task.cjs.map +1 -0
- package/dist/{store/types.d.cts → src/models/task.d.cts} +52 -31
- package/dist/src/models/task.d.cts.map +1 -0
- package/dist/{store/types.d.mts → src/models/task.d.mts} +52 -31
- package/dist/src/models/task.d.mts.map +1 -0
- package/dist/src/models/task.mjs +26 -0
- package/dist/src/models/task.mjs.map +1 -0
- package/dist/src/models/taskGraph.cjs +67 -0
- package/dist/{store → src/models}/taskGraph.cjs.map +1 -1
- package/dist/{store → src/models}/taskGraph.d.cts +7 -8
- package/dist/src/models/taskGraph.d.cts.map +1 -0
- package/dist/{store → src/models}/taskGraph.d.mts +7 -8
- package/dist/src/models/taskGraph.d.mts.map +1 -0
- package/dist/src/models/taskGraph.mjs +63 -0
- package/dist/{store → src/models}/taskGraph.mjs.map +1 -1
- package/dist/src/schemas/apiContracts.cjs +51 -0
- package/dist/src/schemas/apiContracts.cjs.map +1 -0
- package/dist/src/schemas/apiContracts.d.cts +53 -0
- package/dist/src/schemas/apiContracts.d.cts.map +1 -0
- package/dist/src/schemas/apiContracts.d.mts +53 -0
- package/dist/src/schemas/apiContracts.d.mts.map +1 -0
- package/dist/src/schemas/apiContracts.mjs +49 -0
- package/dist/src/schemas/apiContracts.mjs.map +1 -0
- package/dist/src/schemas/task.cjs +130 -0
- package/dist/src/schemas/task.cjs.map +1 -0
- package/dist/{tool/schema.d.cts → src/schemas/task.d.cts} +46 -29
- package/dist/src/schemas/task.d.cts.map +1 -0
- package/dist/{tool/schema.d.mts → src/schemas/task.d.mts} +46 -29
- package/dist/src/schemas/task.d.mts.map +1 -0
- package/dist/src/schemas/task.mjs +117 -0
- package/dist/src/schemas/task.mjs.map +1 -0
- package/dist/src/services/config/index.cjs +88 -0
- package/dist/src/services/config/index.cjs.map +1 -0
- package/dist/src/services/config/index.d.cts +42 -0
- package/dist/src/services/config/index.d.cts.map +1 -0
- package/dist/src/services/config/index.d.mts +42 -0
- package/dist/src/services/config/index.d.mts.map +1 -0
- package/dist/src/services/config/index.mjs +72 -0
- package/dist/src/services/config/index.mjs.map +1 -0
- package/dist/src/services/contextContribution/index.cjs +51 -0
- package/dist/src/services/contextContribution/index.cjs.map +1 -0
- package/dist/src/services/contextContribution/index.mjs +46 -0
- package/dist/src/services/contextContribution/index.mjs.map +1 -0
- package/dist/src/services/delegation/index.cjs +629 -0
- package/dist/src/services/delegation/index.cjs.map +1 -0
- package/dist/{delegation/manager.d.cts → src/services/delegation/index.d.cts} +52 -49
- package/dist/src/services/delegation/index.d.cts.map +1 -0
- package/dist/{delegation/manager.d.mts → src/services/delegation/index.d.mts} +52 -49
- package/dist/src/services/delegation/index.d.mts.map +1 -0
- package/dist/src/services/delegation/index.mjs +623 -0
- package/dist/src/services/delegation/index.mjs.map +1 -0
- package/dist/src/services/delegationPlatform/index.cjs +23 -0
- package/dist/src/services/delegationPlatform/index.cjs.map +1 -0
- package/dist/src/services/delegationPlatform/index.mjs +21 -0
- package/dist/src/services/delegationPlatform/index.mjs.map +1 -0
- package/dist/src/services/invariants/index.cjs +64 -0
- package/dist/src/services/invariants/index.cjs.map +1 -0
- package/dist/src/services/invariants/index.d.cts +23 -0
- package/dist/src/services/invariants/index.d.cts.map +1 -0
- package/dist/src/services/invariants/index.d.mts +23 -0
- package/dist/src/services/invariants/index.d.mts.map +1 -0
- package/dist/src/services/invariants/index.mjs +62 -0
- package/dist/src/services/invariants/index.mjs.map +1 -0
- package/dist/src/services/logSinkTelemetry/index.cjs +43 -0
- package/dist/src/services/logSinkTelemetry/index.cjs.map +1 -0
- package/dist/src/services/logSinkTelemetry/index.d.cts +23 -0
- package/dist/src/services/logSinkTelemetry/index.d.cts.map +1 -0
- package/dist/src/services/logSinkTelemetry/index.d.mts +23 -0
- package/dist/src/services/logSinkTelemetry/index.d.mts.map +1 -0
- package/dist/src/services/logSinkTelemetry/index.mjs +41 -0
- package/dist/src/services/logSinkTelemetry/index.mjs.map +1 -0
- package/dist/src/services/paths/index.cjs +233 -0
- package/dist/src/services/paths/index.cjs.map +1 -0
- package/dist/src/services/paths/index.d.cts +25 -0
- package/dist/src/services/paths/index.d.cts.map +1 -0
- package/dist/src/services/paths/index.d.mts +25 -0
- package/dist/src/services/paths/index.d.mts.map +1 -0
- package/dist/src/services/paths/index.mjs +218 -0
- package/dist/src/services/paths/index.mjs.map +1 -0
- package/dist/src/services/processLiveness/index.cjs +20 -0
- package/dist/src/services/processLiveness/index.cjs.map +1 -0
- package/dist/{store/processLiveness.d.cts → src/services/processLiveness/index.d.cts} +3 -4
- package/dist/src/services/processLiveness/index.d.cts.map +1 -0
- package/dist/{store/processLiveness.d.mts → src/services/processLiveness/index.d.mts} +3 -4
- package/dist/src/services/processLiveness/index.d.mts.map +1 -0
- package/dist/src/services/processLiveness/index.mjs +20 -0
- package/dist/src/services/processLiveness/index.mjs.map +1 -0
- package/dist/src/services/reconcile/index.cjs +65 -0
- package/dist/src/services/reconcile/index.cjs.map +1 -0
- package/dist/{store/reconcile.d.cts → src/services/reconcile/index.d.cts} +8 -9
- package/dist/src/services/reconcile/index.d.cts.map +1 -0
- package/dist/{store/reconcile.d.mts → src/services/reconcile/index.d.mts} +8 -9
- package/dist/src/services/reconcile/index.d.mts.map +1 -0
- package/dist/src/services/reconcile/index.mjs +63 -0
- package/dist/src/services/reconcile/index.mjs.map +1 -0
- package/dist/src/services/reducer/index.cjs +350 -0
- package/dist/src/services/reducer/index.cjs.map +1 -0
- package/dist/{store/reducer.d.cts → src/services/reducer/index.d.cts} +12 -13
- package/dist/src/services/reducer/index.d.cts.map +1 -0
- package/dist/{store/reducer.d.mts → src/services/reducer/index.d.mts} +12 -13
- package/dist/src/services/reducer/index.d.mts.map +1 -0
- package/dist/src/services/reducer/index.mjs +345 -0
- package/dist/src/services/reducer/index.mjs.map +1 -0
- package/dist/src/services/taskNarration/index.cjs +32 -0
- package/dist/src/services/taskNarration/index.cjs.map +1 -0
- package/dist/src/services/taskNarration/index.mjs +32 -0
- package/dist/src/services/taskNarration/index.mjs.map +1 -0
- package/dist/src/services/taskResult/index.cjs +174 -0
- package/dist/src/services/taskResult/index.cjs.map +1 -0
- package/dist/src/services/taskResult/index.d.cts +50 -0
- package/dist/src/services/taskResult/index.d.cts.map +1 -0
- package/dist/src/services/taskResult/index.d.mts +50 -0
- package/dist/src/services/taskResult/index.d.mts.map +1 -0
- package/dist/src/services/taskResult/index.mjs +165 -0
- package/dist/src/services/taskResult/index.mjs.map +1 -0
- package/dist/src/services/taskStore/index.cjs +216 -0
- package/dist/src/services/taskStore/index.cjs.map +1 -0
- package/dist/{store/taskStore.d.cts → src/services/taskStore/index.d.cts} +17 -25
- package/dist/src/services/taskStore/index.d.cts.map +1 -0
- package/dist/{store/taskStore.d.mts → src/services/taskStore/index.d.mts} +17 -25
- package/dist/src/services/taskStore/index.d.mts.map +1 -0
- package/dist/src/services/taskStore/index.mjs +213 -0
- package/dist/src/services/taskStore/index.mjs.map +1 -0
- package/dist/src/services/taskTool/index.cjs +106 -0
- package/dist/src/services/taskTool/index.cjs.map +1 -0
- package/dist/src/services/taskTool/index.mjs +105 -0
- package/dist/src/services/taskTool/index.mjs.map +1 -0
- package/dist/src/types/delegation.cjs +7 -0
- package/dist/src/types/delegation.cjs.map +1 -0
- package/dist/src/types/delegation.d.cts +5 -0
- package/dist/src/types/delegation.d.cts.map +1 -0
- package/dist/src/types/delegation.d.mts +5 -0
- package/dist/src/types/delegation.d.mts.map +1 -0
- package/dist/src/types/delegation.mjs +7 -0
- package/dist/src/types/delegation.mjs.map +1 -0
- package/dist/src/types/telemetry.cjs +26 -0
- package/dist/src/types/telemetry.cjs.map +1 -0
- package/dist/src/types/telemetry.d.cts +35 -0
- package/dist/src/types/telemetry.d.cts.map +1 -0
- package/dist/src/types/telemetry.d.mts +35 -0
- package/dist/src/types/telemetry.d.mts.map +1 -0
- package/dist/src/types/telemetry.mjs +26 -0
- package/dist/src/types/telemetry.mjs.map +1 -0
- package/dist/src/types/webTasks.cjs +7 -0
- package/dist/src/types/webTasks.cjs.map +1 -0
- package/dist/src/types/webTasks.mjs +7 -0
- package/dist/src/types/webTasks.mjs.map +1 -0
- package/dist/store-invariants.cjs +5 -0
- package/dist/store-invariants.d.cts +2 -0
- package/dist/store-invariants.d.mts +2 -0
- package/dist/store-invariants.mjs +2 -0
- package/dist/store-paths.cjs +14 -0
- package/dist/store-paths.d.cts +2 -0
- package/dist/store-paths.d.mts +2 -0
- package/dist/store-paths.mjs +2 -0
- package/dist/store-process-liveness.cjs +3 -0
- package/dist/store-process-liveness.d.cts +2 -0
- package/dist/store-process-liveness.d.mts +2 -0
- package/dist/store-process-liveness.mjs +2 -0
- package/dist/store-reconcile.cjs +5 -0
- package/dist/store-reconcile.d.cts +2 -0
- package/dist/store-reconcile.d.mts +2 -0
- package/dist/store-reconcile.mjs +2 -0
- package/dist/store-reducer.cjs +8 -0
- package/dist/store-reducer.d.cts +2 -0
- package/dist/store-reducer.d.mts +2 -0
- package/dist/store-reducer.mjs +2 -0
- package/dist/store-task-graph.cjs +7 -0
- package/dist/store-task-graph.d.cts +2 -0
- package/dist/store-task-graph.d.mts +2 -0
- package/dist/store-task-graph.mjs +2 -0
- package/dist/store-task-store.cjs +3 -0
- package/dist/store-task-store.d.cts +2 -0
- package/dist/store-task-store.d.mts +2 -0
- package/dist/store-task-store.mjs +2 -0
- package/dist/store-types.cjs +6 -0
- package/dist/store-types.d.cts +2 -0
- package/dist/store-types.d.mts +2 -0
- package/dist/store-types.mjs +2 -0
- package/dist/tool-prompt-guidelines.cjs +3 -0
- package/dist/tool-prompt-guidelines.d.cts +2 -0
- package/dist/tool-prompt-guidelines.d.mts +2 -0
- package/dist/tool-prompt-guidelines.mjs +2 -0
- package/dist/tool-response-envelope.cjs +12 -0
- package/dist/tool-response-envelope.d.cts +2 -0
- package/dist/tool-response-envelope.d.mts +2 -0
- package/dist/tool-response-envelope.mjs +2 -0
- package/dist/tool-schema.cjs +17 -0
- package/dist/tool-schema.d.cts +3 -0
- package/dist/tool-schema.d.mts +3 -0
- package/dist/tool-schema.mjs +3 -0
- package/dist/tool-task-tool.cjs +6 -0
- package/dist/tool-task-tool.d.cts +3 -0
- package/dist/tool-task-tool.d.mts +3 -0
- package/dist/tool-task-tool.mjs +3 -0
- package/dist/tui-format.cjs +14 -0
- package/dist/tui-format.d.cts +2 -0
- package/dist/tui-format.d.mts +2 -0
- package/dist/tui-format.mjs +2 -0
- package/dist/tui-selectors.cjs +10 -0
- package/dist/tui-selectors.d.cts +2 -0
- package/dist/tui-selectors.d.mts +2 -0
- package/dist/tui-selectors.mjs +2 -0
- package/dist/tui-task-overlay.cjs +4 -0
- package/dist/tui-task-overlay.d.cts +2 -0
- package/dist/tui-task-overlay.d.mts +2 -0
- package/dist/tui-task-overlay.mjs +2 -0
- package/dist/tui-task-space.cjs +5 -0
- package/dist/tui-task-space.d.cts +2 -0
- package/dist/tui-task-space.d.mts +2 -0
- package/dist/tui-task-space.mjs +2 -0
- package/package.json +167 -109
- package/src/types/webTasks.ts +24 -0
- package/dist/commands.cjs.map +0 -1
- package/dist/commands.d.cts.map +0 -1
- package/dist/commands.d.mts.map +0 -1
- package/dist/commands.mjs.map +0 -1
- package/dist/config.cjs.map +0 -1
- package/dist/config.d.cts.map +0 -1
- package/dist/config.d.mts.map +0 -1
- package/dist/config.mjs.map +0 -1
- package/dist/delegation/manager.cjs +0 -6
- package/dist/delegation/manager.cjs.map +0 -1
- package/dist/delegation/manager.d.cts.map +0 -1
- package/dist/delegation/manager.d.mts.map +0 -1
- package/dist/delegation/manager.mjs +0 -6
- package/dist/delegation/manager.mjs.map +0 -1
- package/dist/extension.cjs +0 -3
- package/dist/extension.cjs.map +0 -1
- package/dist/extension.d.cts +0 -12
- package/dist/extension.d.cts.map +0 -1
- package/dist/extension.d.mts +0 -12
- package/dist/extension.d.mts.map +0 -1
- package/dist/extension.mjs +0 -3
- package/dist/extension.mjs.map +0 -1
- package/dist/extensions/doom.cjs +0 -2
- package/dist/extensions/doom.cjs.map +0 -1
- package/dist/extensions/doom.d.cts +0 -6
- package/dist/extensions/doom.d.cts.map +0 -1
- package/dist/extensions/doom.d.mts +0 -7
- package/dist/extensions/doom.d.mts.map +0 -1
- package/dist/extensions/doom.mjs +0 -2
- package/dist/extensions/doom.mjs.map +0 -1
- package/dist/logSinkTelemetry.cjs.map +0 -1
- package/dist/logSinkTelemetry.d.cts.map +0 -1
- package/dist/logSinkTelemetry.d.mts.map +0 -1
- package/dist/logSinkTelemetry.mjs.map +0 -1
- package/dist/store/invariants.cjs +0 -2
- package/dist/store/invariants.cjs.map +0 -1
- package/dist/store/invariants.d.cts +0 -14
- package/dist/store/invariants.d.cts.map +0 -1
- package/dist/store/invariants.d.mts +0 -14
- package/dist/store/invariants.d.mts.map +0 -1
- package/dist/store/invariants.mjs +0 -2
- package/dist/store/invariants.mjs.map +0 -1
- package/dist/store/paths.cjs +0 -2
- package/dist/store/paths.cjs.map +0 -1
- package/dist/store/paths.d.cts +0 -23
- package/dist/store/paths.d.cts.map +0 -1
- package/dist/store/paths.d.mts +0 -23
- package/dist/store/paths.d.mts.map +0 -1
- package/dist/store/paths.mjs +0 -2
- package/dist/store/paths.mjs.map +0 -1
- package/dist/store/processLiveness.cjs +0 -2
- package/dist/store/processLiveness.cjs.map +0 -1
- package/dist/store/processLiveness.d.cts.map +0 -1
- package/dist/store/processLiveness.d.mts.map +0 -1
- package/dist/store/processLiveness.mjs +0 -2
- package/dist/store/processLiveness.mjs.map +0 -1
- package/dist/store/reconcile.cjs +0 -2
- package/dist/store/reconcile.cjs.map +0 -1
- package/dist/store/reconcile.d.cts.map +0 -1
- package/dist/store/reconcile.d.mts.map +0 -1
- package/dist/store/reconcile.mjs +0 -2
- package/dist/store/reconcile.mjs.map +0 -1
- package/dist/store/reducer.cjs +0 -3
- package/dist/store/reducer.cjs.map +0 -1
- package/dist/store/reducer.d.cts.map +0 -1
- package/dist/store/reducer.d.mts.map +0 -1
- package/dist/store/reducer.mjs +0 -3
- package/dist/store/reducer.mjs.map +0 -1
- package/dist/store/taskGraph.cjs +0 -2
- package/dist/store/taskGraph.d.cts.map +0 -1
- package/dist/store/taskGraph.d.mts.map +0 -1
- package/dist/store/taskGraph.mjs +0 -2
- package/dist/store/taskStore.cjs +0 -2
- package/dist/store/taskStore.cjs.map +0 -1
- package/dist/store/taskStore.d.cts.map +0 -1
- package/dist/store/taskStore.d.mts.map +0 -1
- package/dist/store/taskStore.mjs +0 -2
- package/dist/store/taskStore.mjs.map +0 -1
- package/dist/store/types.cjs +0 -2
- package/dist/store/types.cjs.map +0 -1
- package/dist/store/types.d.cts.map +0 -1
- package/dist/store/types.d.mts.map +0 -1
- package/dist/store/types.mjs +0 -2
- package/dist/store/types.mjs.map +0 -1
- package/dist/tool/promptGuidelines.cjs +0 -2
- package/dist/tool/promptGuidelines.cjs.map +0 -1
- package/dist/tool/promptGuidelines.d.cts +0 -5
- package/dist/tool/promptGuidelines.d.cts.map +0 -1
- package/dist/tool/promptGuidelines.d.mts +0 -5
- package/dist/tool/promptGuidelines.d.mts.map +0 -1
- package/dist/tool/promptGuidelines.mjs +0 -2
- package/dist/tool/promptGuidelines.mjs.map +0 -1
- package/dist/tool/responseEnvelope.cjs +0 -6
- package/dist/tool/responseEnvelope.cjs.map +0 -1
- package/dist/tool/responseEnvelope.d.cts +0 -39
- package/dist/tool/responseEnvelope.d.cts.map +0 -1
- package/dist/tool/responseEnvelope.d.mts +0 -39
- package/dist/tool/responseEnvelope.d.mts.map +0 -1
- package/dist/tool/responseEnvelope.mjs +0 -6
- package/dist/tool/responseEnvelope.mjs.map +0 -1
- package/dist/tool/schema.cjs +0 -2
- package/dist/tool/schema.cjs.map +0 -1
- package/dist/tool/schema.d.cts.map +0 -1
- package/dist/tool/schema.d.mts.map +0 -1
- package/dist/tool/schema.mjs +0 -2
- package/dist/tool/schema.mjs.map +0 -1
- package/dist/tool/taskTool.cjs +0 -3
- package/dist/tool/taskTool.cjs.map +0 -1
- package/dist/tool/taskTool.d.cts +0 -17
- package/dist/tool/taskTool.d.cts.map +0 -1
- package/dist/tool/taskTool.d.mts +0 -17
- package/dist/tool/taskTool.d.mts.map +0 -1
- package/dist/tool/taskTool.mjs +0 -3
- package/dist/tool/taskTool.mjs.map +0 -1
- package/dist/tui/format.cjs +0 -4
- package/dist/tui/format.cjs.map +0 -1
- package/dist/tui/format.d.cts +0 -62
- package/dist/tui/format.d.cts.map +0 -1
- package/dist/tui/format.d.mts +0 -62
- package/dist/tui/format.d.mts.map +0 -1
- package/dist/tui/format.mjs +0 -4
- package/dist/tui/format.mjs.map +0 -1
- package/dist/tui/selectors.cjs +0 -2
- package/dist/tui/selectors.cjs.map +0 -1
- package/dist/tui/selectors.d.cts +0 -53
- package/dist/tui/selectors.d.cts.map +0 -1
- package/dist/tui/selectors.d.mts +0 -53
- package/dist/tui/selectors.d.mts.map +0 -1
- package/dist/tui/selectors.mjs +0 -2
- package/dist/tui/selectors.mjs.map +0 -1
- package/dist/tui/taskOverlay.cjs +0 -2
- package/dist/tui/taskOverlay.cjs.map +0 -1
- package/dist/tui/taskOverlay.d.cts.map +0 -1
- package/dist/tui/taskOverlay.d.mts.map +0 -1
- package/dist/tui/taskOverlay.mjs +0 -2
- package/dist/tui/taskOverlay.mjs.map +0 -1
- package/dist/tui/taskSpace.cjs +0 -5
- package/dist/tui/taskSpace.cjs.map +0 -1
- package/dist/tui/taskSpace.d.cts.map +0 -1
- package/dist/tui/taskSpace.d.mts.map +0 -1
- package/dist/tui/taskSpace.mjs +0 -5
- package/dist/tui/taskSpace.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/store/types.ts"],"mappings":";;KAUY;cAEC,gBAAgB;KAEjB;KAEA;;UAGK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;;;UAUe;EACf;EACA;EACA,OAAO;EACP;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;;UAGM;EACf;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA,WAAW;EACX;EACA;EACA,aAAa;;cAGF;;UAGI;EACf;EACA;EACA;EACA,OAAO;;iBAGO,iBAAiB;;;;;;;;KAWrB;;;;;;;;;UAUK;EACf;EACA;EACA;EACA;EACA;EACA,SAAS;EACT,YAAY;EACZ,eAAe;EACf,kBAAkB;EAClB;EACA,WAAW;;;;;;;;;KAUD;EAEN;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;;EAEA;EAAe;EAAiB;EAAY,YAAY;EAAY,UAAU;;EAC9E;EAAe;EAAmB;EAAY,QAAQ;;EACtD;EAAe;EAAgB;EAAiB;EAAa;;;UAGlD;;EAEf;EACA;;;;;;;;;;UAWe;GACd;EACD,QAAQ;;EAER,SAAS;;EAET;EACA;EACA;EACA,cAAc;EACd;;EAEA;EACA;EACA;EACA;;;UAIe;EACf,QAAQ;EACR,QAAQ;EACR,OAAO;EACP;EACA;EACA;EACA,SAAS;;;iBAIK,mBAAmB,MAAM"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","names":[],"sources":["../../src/store/types.ts"],"mappings":";;KAUY;cAEC,gBAAgB;KAEjB;KAEA;;UAGK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;;;UAUe;EACf;EACA;EACA,OAAO;EACP;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;;UAGM;EACf;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA,WAAW;EACX;EACA;EACA,aAAa;;cAGF;;UAGI;EACf;EACA;EACA;EACA,OAAO;;iBAGO,iBAAiB;;;;;;;;KAWrB;;;;;;;;;UAUK;EACf;EACA;EACA;EACA;EACA;EACA,SAAS;EACT,YAAY;EACZ,eAAe;EACf,kBAAkB;EAClB;EACA,WAAW;;;;;;;;;KAUD;EAEN;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;;EAEA;EAAe;EAAiB;EAAY,YAAY;EAAY,UAAU;;EAC9E;EAAe;EAAmB;EAAY,QAAQ;;EACtD;EAAe;EAAgB;EAAiB;EAAa;;;UAGlD;;EAEf;EACA;;;;;;;;;;UAWe;GACd;EACD,QAAQ;;EAER,SAAS;;EAET;EACA;EACA;EACA,cAAc;EACd;;EAEA;EACA;EACA;EACA;;;UAIe;EACf,QAAQ;EACR,QAAQ;EACR,OAAO;EACP;EACA;EACA;EACA,SAAS;;;iBAIK,mBAAmB,MAAM"}
|
package/dist/store/types.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=`deleted`,t=1;function n(){return{version:1,rev:0,nextId:1,tasks:[]}}function r(e){let t=e.delegation?.state;return t===`requested`||t===`running`}export{e as DELETED_STATUS,t as STORE_SCHEMA_VERSION,n as emptyDocument,r as isDelegationActive};
|
|
2
|
-
//# sourceMappingURL=types.mjs.map
|
package/dist/store/types.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","names":[],"sources":["../../src/store/types.ts"],"sourcesContent":["/**\n * Domain types for the file-backed task store.\n *\n * The on-disk document is the durable source of truth (unlike rpiv-todo, which\n * replayed state from the transcript). Every field here round-trips through\n * JSON, so nothing may hold non-serializable values.\n */\n\nimport type { InlineAgent } from '@agimon-ai/doompi-extension-contracts/subagent-tool';\n\nexport type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'deleted';\n\nexport const DELETED_STATUS: TaskStatus = 'deleted';\n\nexport type TaskAction = 'upsert' | 'list' | 'get' | 'delete' | 'clear' | 'assign' | 'cancel';\n\nexport type DelegationState = 'requested' | 'running' | 'completed' | 'failed' | 'cancelled';\n\n/** Terminal result of a delegated subagent run, copied off the delegation response. */\nexport interface DelegationResult {\n status: string;\n output?: string;\n outputPath?: string;\n sessionFile?: string;\n error?: string;\n durationMs?: number;\n toolCount?: number;\n}\n\n/**\n * Delegation bookkeeping attached to a task that was handed to a subagent.\n *\n * `pid` is the harness process that owns the run: it is the only way to tell an\n * genuinely-running delegation from one orphaned by a harness crash, since the\n * child dies with its parent but the file survives.\n */\nexport interface TaskDelegation {\n requestId: string;\n agent: string;\n state: DelegationState;\n sessionId?: string;\n pid?: number;\n runId?: string;\n model?: string;\n startedAt?: string;\n endedAt?: string;\n result?: DelegationResult;\n}\n\nexport interface Task {\n id: number;\n subject: string;\n description?: string;\n activeForm?: string;\n status: TaskStatus;\n blockedBy?: number[];\n owner?: string;\n metadata?: Record<string, unknown>;\n createdAt?: string;\n updatedAt?: string;\n delegation?: TaskDelegation;\n}\n\nexport const STORE_SCHEMA_VERSION = 1;\n\n/** The complete on-disk document. `rev` increments on every committed write. */\nexport interface TaskDocument {\n version: number;\n rev: number;\n nextId: number;\n tasks: Task[];\n}\n\nexport function emptyDocument(): TaskDocument {\n return { version: STORE_SCHEMA_VERSION, rev: 0, nextId: 1, tasks: [] };\n}\n\n/**\n * A dependency target inside an upsert item: an existing task id, or the `ref`\n * of a task created earlier in the same call.\n *\n * Refs must start with a letter (see `REF_PATTERN`), so a ref is structurally\n * unconfusable with a stringified id and the discrimination is just `typeof`.\n */\nexport type DepToken = number | string;\n\n/**\n * One entry of an `upsert` call. No `id` creates a task; an `id` updates one.\n *\n * `blockedBy` (absolute set) is create-only and `addBlockedBy`/`removeBlockedBy`\n * (additive merge) are update-only, matching the split the two former actions\n * had. A field used against the wrong kind fails that item rather than being\n * silently ignored.\n */\nexport interface TaskItemMutation {\n id?: number;\n ref?: string;\n subject?: string;\n description?: string;\n activeForm?: string;\n status?: TaskStatus;\n blockedBy?: DepToken[];\n addBlockedBy?: DepToken[];\n removeBlockedBy?: DepToken[];\n owner?: string;\n metadata?: Record<string, unknown>;\n}\n\n/**\n * What one upsert item did. `index` is its position in the request array, so a\n * model reading a partial result can tell which entries still need resending.\n *\n * `message` is unprefixed: the `item[N] failed:` framing belongs to the\n * formatter, because the Task Space overlay shows this text on its own.\n */\nexport type UpsertItemOutcome =\n | {\n index: number;\n kind: 'created';\n id: number;\n subject: string;\n status: TaskStatus;\n ref?: string;\n blockedBy?: number[];\n }\n | { index: number; kind: 'updated'; id: number; fromStatus: TaskStatus; toStatus: TaskStatus }\n | { index: number; kind: 'unchanged'; id: number; status: TaskStatus }\n | { index: number; kind: 'failed'; message: string; id?: number; ref?: string };\n\n/** Which tasks an upsert touched, so renderResult names them instead of guessing. */\nexport interface UpsertSummary {\n /** Ids of applied entries, in request order. A failed entry contributes nothing. */\n applied: number[];\n failed: number;\n}\n\n/**\n * Open-shape input bag the reducer accepts. The index signature lets the\n * runtime pass a TypeBox `Static<typeof TaskParamsSchema>` through without\n * casting each field.\n *\n * Per-task fields live on `tasks[]`, not here: a top-level `subject` or\n * `status` would be ambiguous once one call can carry many tasks.\n */\nexport interface TaskMutationParams {\n [key: string]: unknown;\n tasks?: TaskItemMutation[];\n /** `list` filter only. To set a status, upsert the task by id. */\n status?: TaskStatus;\n /** `get`, `delete`, `assign` and `cancel` only. */\n id?: number;\n includeDeleted?: boolean;\n agent?: string;\n inlineAgent?: InlineAgent;\n instructions?: string;\n /** `assign` only: the context pack the parent hands to the child. */\n relevantFiles?: string[];\n priorFindings?: string;\n model?: string;\n context?: 'fresh' | 'fork';\n}\n\n/** Snapshot returned under a tool result's `details` for renderResult. */\nexport interface TaskDetails {\n action: TaskAction;\n params: Record<string, unknown>;\n tasks: Task[];\n nextId: number;\n rev: number;\n error?: string;\n upsert?: UpsertSummary;\n}\n\n/** A delegation is \"live\" while the owning run may still produce a response. */\nexport function isDelegationActive(task: Task): boolean {\n const state = task.delegation?.state;\n return state === 'requested' || state === 'running';\n}\n"],"mappings":"AAYA,MAAa,EAA6B,UAmD7B,EAAuB,EAUpC,SAAgB,GAA8B,CAC5C,MAAO,CAAE,QAAA,EAA+B,IAAK,EAAG,OAAQ,EAAG,MAAO,CAAC,CAAE,CACvE,CAmGA,SAAgB,EAAmB,EAAqB,CACtD,IAAM,EAAQ,EAAK,YAAY,MAC/B,OAAO,IAAU,aAAe,IAAU,SAC5C"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=["Use `task` for work with 3+ steps, when the user gives you a list of tasks, or immediately after receiving new instructions to capture requirements. Skip it for single trivial tasks and purely conversational requests.",`Capture a whole plan in one call: {"action":"upsert","tasks":[{"subject":"Research existing tool"},{"subject":"Write the reducer"},{"subject":"Add tests"}]}. Batch whenever you are writing the plan down — the initial list, a revised plan, or wiring dependencies across several tasks — because one call keeps ids and blockers consistent and shows the user the whole plan at once.`,`Do not batch progress. Mark a task in_progress with its own call BEFORE beginning work, and completed with its own call IMMEDIATELY when it is done. upsert accepts many tasks, but a batch of completions sent at the end of a turn is still wrong: batching is for writing a plan down, single calls are for reporting progress, and the user watches the task list to see where you are. Exactly one task should be in_progress for your own work; delegated tasks run in parallel and do not count against that.`,`Never mark a task completed if tests are failing, the implementation is partial, or you hit unresolved errors, use status "failed" or keep it in_progress and add a new task for the blocker in the same upsert.`,`When every non-deleted task is completed, review the full task list once more and call task {"action":"clear"} to close it. Do not leave an all-completed list open.`,`Status is a state machine: pending → in_progress → completed, plus failed (recoverable, can go back to pending or in_progress) and deleted as a tombstone. Pass activeForm (present-continuous, e.g. 'writing tests') when marking in_progress.`,`One call does both: an entry with an id changes that task, an entry without an id creates one. To change status, upsert the task by id, e.g. {"action":"upsert","tasks":[{"id":3,"status":"completed"}]}. Never omit the id when you meant to change an existing task — an entry with no id creates a new one instead. An entry that carries an id and no other field is rejected.`,`Use blockedBy for dependencies (A is blocked by B). On an entry with no id pass blockedBy as the initial set; on an entry with an id use addBlockedBy / removeBlockedBy (additive merge, do not resend the full array). To depend on a task created earlier in the SAME call, give that earlier entry a "ref" and list the ref string in place of an id: [{"ref":"api","subject":"Design the API"},{"subject":"Implement the API","blockedBy":["api"]}]. A ref must be declared before it is used. Cycles are rejected.`,`upsert applies each entry independently: the entries that pass are committed and the failures are reported with their array index. A failed entry changed nothing, so resend only the corrected failures — never resend the whole call, because an already-applied entry with no id would create a duplicate task.`,`Before assigning work, call subagent with {"action":"agents"} and match each task to an exact discovered agent name. Prefer a discovered general-purpose write-capable agent such as delegate or worker when no specialist fits. Use a focused inlineAgent only for read-only work.`,`Assign every unblocked pending task with task {"action":"assign","id":3,"agent":"reviewer"}, including implementation tasks. Do not use a direct subagent run for work already represented in the shared task list. Use task assign so ownership and terminal results stay visible.`,`Hand over what you already know when you assign. Pass relevantFiles with the paths you have actually read or located for that task, and priorFindings with the facts you established: symbol names, call sites, the approach you picked, what you ruled out. A fresh-context child starts with none of your context and will otherwise spend most of its run re-reading the repo. It treats this verified pack as satisfying initial context exploration, reads known paths directly, and widens discovery only for a concrete missing dependency. Send at most a dozen files and only ones you really opened — a guessed path costs the child more than an omitted one — and keep priorFindings to a few lines of facts, not directives.`,`After assigning work, continue non-overlapping parent work or end your turn. Do not poll or duplicate delegated scope.`,`When a delegated task completes and unblocks another task, repeat agent discovery if needed and assign that newly eligible task promptly. Do not poll in a loop. Completion notifications wake the parent session.`,`If a child asks for a decision through intercom, or an assignment fails to start for another concrete issue, respond, rescope, or retry explicitly. Do not silently leave the task pending.`,`assign refuses tasks that are blocked, already delegated, or completed. Resolve blockers first. Use {"action":"cancel","id":3} to stop a running delegation; the task returns to pending.`,`Doom Task records delegated lifecycle and results on the shared task. The child does not update task status directly. Read the completion or failure result before deciding what to do next.`,`The task list is scoped to this session tree: delegated subagents share it, while unrelated sessions start empty. It persists for later inspection until retention cleanup.`,`Subject must be short and imperative (e.g. 'Research existing tool'); description is long-form detail written when you plan the task, and the delegated brief is that description plus the assign-time instructions, relevantFiles and priorFindings. Put durable scope in description and what you learned while exploring in the assign-time pack — do not repeat one in the other.`];exports.DEFAULT_PROMPT_GUIDELINES=e;
|
|
2
|
-
//# sourceMappingURL=promptGuidelines.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promptGuidelines.cjs","names":[],"sources":["../../src/tool/promptGuidelines.ts"],"sourcesContent":["export const DEFAULT_PROMPT_GUIDELINES: string[] = [\n 'Use `task` for work with 3+ steps, when the user gives you a list of tasks, or immediately after receiving new instructions to capture requirements. Skip it for single trivial tasks and purely conversational requests.',\n 'Capture a whole plan in one call: {\"action\":\"upsert\",\"tasks\":[{\"subject\":\"Research existing tool\"},{\"subject\":\"Write the reducer\"},{\"subject\":\"Add tests\"}]}. Batch whenever you are writing the plan down — the initial list, a revised plan, or wiring dependencies across several tasks — because one call keeps ids and blockers consistent and shows the user the whole plan at once.',\n 'Do not batch progress. Mark a task in_progress with its own call BEFORE beginning work, and completed with its own call IMMEDIATELY when it is done. upsert accepts many tasks, but a batch of completions sent at the end of a turn is still wrong: batching is for writing a plan down, single calls are for reporting progress, and the user watches the task list to see where you are. Exactly one task should be in_progress for your own work; delegated tasks run in parallel and do not count against that.',\n 'Never mark a task completed if tests are failing, the implementation is partial, or you hit unresolved errors, use status \"failed\" or keep it in_progress and add a new task for the blocker in the same upsert.',\n 'When every non-deleted task is completed, review the full task list once more and call task {\"action\":\"clear\"} to close it. Do not leave an all-completed list open.',\n \"Status is a state machine: pending → in_progress → completed, plus failed (recoverable, can go back to pending or in_progress) and deleted as a tombstone. Pass activeForm (present-continuous, e.g. 'writing tests') when marking in_progress.\",\n 'One call does both: an entry with an id changes that task, an entry without an id creates one. To change status, upsert the task by id, e.g. {\"action\":\"upsert\",\"tasks\":[{\"id\":3,\"status\":\"completed\"}]}. Never omit the id when you meant to change an existing task — an entry with no id creates a new one instead. An entry that carries an id and no other field is rejected.',\n 'Use blockedBy for dependencies (A is blocked by B). On an entry with no id pass blockedBy as the initial set; on an entry with an id use addBlockedBy / removeBlockedBy (additive merge, do not resend the full array). To depend on a task created earlier in the SAME call, give that earlier entry a \"ref\" and list the ref string in place of an id: [{\"ref\":\"api\",\"subject\":\"Design the API\"},{\"subject\":\"Implement the API\",\"blockedBy\":[\"api\"]}]. A ref must be declared before it is used. Cycles are rejected.',\n 'upsert applies each entry independently: the entries that pass are committed and the failures are reported with their array index. A failed entry changed nothing, so resend only the corrected failures — never resend the whole call, because an already-applied entry with no id would create a duplicate task.',\n 'Before assigning work, call subagent with {\"action\":\"agents\"} and match each task to an exact discovered agent name. Prefer a discovered general-purpose write-capable agent such as delegate or worker when no specialist fits. Use a focused inlineAgent only for read-only work.',\n 'Assign every unblocked pending task with task {\"action\":\"assign\",\"id\":3,\"agent\":\"reviewer\"}, including implementation tasks. Do not use a direct subagent run for work already represented in the shared task list. Use task assign so ownership and terminal results stay visible.',\n 'Hand over what you already know when you assign. Pass relevantFiles with the paths you have actually read or located for that task, and priorFindings with the facts you established: symbol names, call sites, the approach you picked, what you ruled out. A fresh-context child starts with none of your context and will otherwise spend most of its run re-reading the repo. It treats this verified pack as satisfying initial context exploration, reads known paths directly, and widens discovery only for a concrete missing dependency. Send at most a dozen files and only ones you really opened — a guessed path costs the child more than an omitted one — and keep priorFindings to a few lines of facts, not directives.',\n 'After assigning work, continue non-overlapping parent work or end your turn. Do not poll or duplicate delegated scope.',\n 'When a delegated task completes and unblocks another task, repeat agent discovery if needed and assign that newly eligible task promptly. Do not poll in a loop. Completion notifications wake the parent session.',\n 'If a child asks for a decision through intercom, or an assignment fails to start for another concrete issue, respond, rescope, or retry explicitly. Do not silently leave the task pending.',\n 'assign refuses tasks that are blocked, already delegated, or completed. Resolve blockers first. Use {\"action\":\"cancel\",\"id\":3} to stop a running delegation; the task returns to pending.',\n 'Doom Task records delegated lifecycle and results on the shared task. The child does not update task status directly. Read the completion or failure result before deciding what to do next.',\n 'The task list is scoped to this session tree: delegated subagents share it, while unrelated sessions start empty. It persists for later inspection until retention cleanup.',\n \"Subject must be short and imperative (e.g. 'Research existing tool'); description is long-form detail written when you plan the task, and the delegated brief is that description plus the assign-time instructions, relevantFiles and priorFindings. Put durable scope in description and what you learned while exploring in the assign-time pack — do not repeat one in the other.\",\n];\n"],"mappings":"mEAAA,MAAa,EAAsC,CACjD,4NACA,6XACA,ufACA,mNACA,uKACA,kPACA,qXACA,0fACA,qTACA,sRACA,sRACA,4sBACA,yHACA,qNACA,8LACA,4LACA,+LACA,8KACA,uXACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promptGuidelines.d.cts","names":[],"sources":["../../src/tool/promptGuidelines.ts"],"mappings":";cAAa"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promptGuidelines.d.mts","names":[],"sources":["../../src/tool/promptGuidelines.ts"],"mappings":";cAAa"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=["Use `task` for work with 3+ steps, when the user gives you a list of tasks, or immediately after receiving new instructions to capture requirements. Skip it for single trivial tasks and purely conversational requests.",`Capture a whole plan in one call: {"action":"upsert","tasks":[{"subject":"Research existing tool"},{"subject":"Write the reducer"},{"subject":"Add tests"}]}. Batch whenever you are writing the plan down — the initial list, a revised plan, or wiring dependencies across several tasks — because one call keeps ids and blockers consistent and shows the user the whole plan at once.`,`Do not batch progress. Mark a task in_progress with its own call BEFORE beginning work, and completed with its own call IMMEDIATELY when it is done. upsert accepts many tasks, but a batch of completions sent at the end of a turn is still wrong: batching is for writing a plan down, single calls are for reporting progress, and the user watches the task list to see where you are. Exactly one task should be in_progress for your own work; delegated tasks run in parallel and do not count against that.`,`Never mark a task completed if tests are failing, the implementation is partial, or you hit unresolved errors, use status "failed" or keep it in_progress and add a new task for the blocker in the same upsert.`,`When every non-deleted task is completed, review the full task list once more and call task {"action":"clear"} to close it. Do not leave an all-completed list open.`,`Status is a state machine: pending → in_progress → completed, plus failed (recoverable, can go back to pending or in_progress) and deleted as a tombstone. Pass activeForm (present-continuous, e.g. 'writing tests') when marking in_progress.`,`One call does both: an entry with an id changes that task, an entry without an id creates one. To change status, upsert the task by id, e.g. {"action":"upsert","tasks":[{"id":3,"status":"completed"}]}. Never omit the id when you meant to change an existing task — an entry with no id creates a new one instead. An entry that carries an id and no other field is rejected.`,`Use blockedBy for dependencies (A is blocked by B). On an entry with no id pass blockedBy as the initial set; on an entry with an id use addBlockedBy / removeBlockedBy (additive merge, do not resend the full array). To depend on a task created earlier in the SAME call, give that earlier entry a "ref" and list the ref string in place of an id: [{"ref":"api","subject":"Design the API"},{"subject":"Implement the API","blockedBy":["api"]}]. A ref must be declared before it is used. Cycles are rejected.`,`upsert applies each entry independently: the entries that pass are committed and the failures are reported with their array index. A failed entry changed nothing, so resend only the corrected failures — never resend the whole call, because an already-applied entry with no id would create a duplicate task.`,`Before assigning work, call subagent with {"action":"agents"} and match each task to an exact discovered agent name. Prefer a discovered general-purpose write-capable agent such as delegate or worker when no specialist fits. Use a focused inlineAgent only for read-only work.`,`Assign every unblocked pending task with task {"action":"assign","id":3,"agent":"reviewer"}, including implementation tasks. Do not use a direct subagent run for work already represented in the shared task list. Use task assign so ownership and terminal results stay visible.`,`Hand over what you already know when you assign. Pass relevantFiles with the paths you have actually read or located for that task, and priorFindings with the facts you established: symbol names, call sites, the approach you picked, what you ruled out. A fresh-context child starts with none of your context and will otherwise spend most of its run re-reading the repo. It treats this verified pack as satisfying initial context exploration, reads known paths directly, and widens discovery only for a concrete missing dependency. Send at most a dozen files and only ones you really opened — a guessed path costs the child more than an omitted one — and keep priorFindings to a few lines of facts, not directives.`,`After assigning work, continue non-overlapping parent work or end your turn. Do not poll or duplicate delegated scope.`,`When a delegated task completes and unblocks another task, repeat agent discovery if needed and assign that newly eligible task promptly. Do not poll in a loop. Completion notifications wake the parent session.`,`If a child asks for a decision through intercom, or an assignment fails to start for another concrete issue, respond, rescope, or retry explicitly. Do not silently leave the task pending.`,`assign refuses tasks that are blocked, already delegated, or completed. Resolve blockers first. Use {"action":"cancel","id":3} to stop a running delegation; the task returns to pending.`,`Doom Task records delegated lifecycle and results on the shared task. The child does not update task status directly. Read the completion or failure result before deciding what to do next.`,`The task list is scoped to this session tree: delegated subagents share it, while unrelated sessions start empty. It persists for later inspection until retention cleanup.`,`Subject must be short and imperative (e.g. 'Research existing tool'); description is long-form detail written when you plan the task, and the delegated brief is that description plus the assign-time instructions, relevantFiles and priorFindings. Put durable scope in description and what you learned while exploring in the assign-time pack — do not repeat one in the other.`];export{e as DEFAULT_PROMPT_GUIDELINES};
|
|
2
|
-
//# sourceMappingURL=promptGuidelines.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promptGuidelines.mjs","names":[],"sources":["../../src/tool/promptGuidelines.ts"],"sourcesContent":["export const DEFAULT_PROMPT_GUIDELINES: string[] = [\n 'Use `task` for work with 3+ steps, when the user gives you a list of tasks, or immediately after receiving new instructions to capture requirements. Skip it for single trivial tasks and purely conversational requests.',\n 'Capture a whole plan in one call: {\"action\":\"upsert\",\"tasks\":[{\"subject\":\"Research existing tool\"},{\"subject\":\"Write the reducer\"},{\"subject\":\"Add tests\"}]}. Batch whenever you are writing the plan down — the initial list, a revised plan, or wiring dependencies across several tasks — because one call keeps ids and blockers consistent and shows the user the whole plan at once.',\n 'Do not batch progress. Mark a task in_progress with its own call BEFORE beginning work, and completed with its own call IMMEDIATELY when it is done. upsert accepts many tasks, but a batch of completions sent at the end of a turn is still wrong: batching is for writing a plan down, single calls are for reporting progress, and the user watches the task list to see where you are. Exactly one task should be in_progress for your own work; delegated tasks run in parallel and do not count against that.',\n 'Never mark a task completed if tests are failing, the implementation is partial, or you hit unresolved errors, use status \"failed\" or keep it in_progress and add a new task for the blocker in the same upsert.',\n 'When every non-deleted task is completed, review the full task list once more and call task {\"action\":\"clear\"} to close it. Do not leave an all-completed list open.',\n \"Status is a state machine: pending → in_progress → completed, plus failed (recoverable, can go back to pending or in_progress) and deleted as a tombstone. Pass activeForm (present-continuous, e.g. 'writing tests') when marking in_progress.\",\n 'One call does both: an entry with an id changes that task, an entry without an id creates one. To change status, upsert the task by id, e.g. {\"action\":\"upsert\",\"tasks\":[{\"id\":3,\"status\":\"completed\"}]}. Never omit the id when you meant to change an existing task — an entry with no id creates a new one instead. An entry that carries an id and no other field is rejected.',\n 'Use blockedBy for dependencies (A is blocked by B). On an entry with no id pass blockedBy as the initial set; on an entry with an id use addBlockedBy / removeBlockedBy (additive merge, do not resend the full array). To depend on a task created earlier in the SAME call, give that earlier entry a \"ref\" and list the ref string in place of an id: [{\"ref\":\"api\",\"subject\":\"Design the API\"},{\"subject\":\"Implement the API\",\"blockedBy\":[\"api\"]}]. A ref must be declared before it is used. Cycles are rejected.',\n 'upsert applies each entry independently: the entries that pass are committed and the failures are reported with their array index. A failed entry changed nothing, so resend only the corrected failures — never resend the whole call, because an already-applied entry with no id would create a duplicate task.',\n 'Before assigning work, call subagent with {\"action\":\"agents\"} and match each task to an exact discovered agent name. Prefer a discovered general-purpose write-capable agent such as delegate or worker when no specialist fits. Use a focused inlineAgent only for read-only work.',\n 'Assign every unblocked pending task with task {\"action\":\"assign\",\"id\":3,\"agent\":\"reviewer\"}, including implementation tasks. Do not use a direct subagent run for work already represented in the shared task list. Use task assign so ownership and terminal results stay visible.',\n 'Hand over what you already know when you assign. Pass relevantFiles with the paths you have actually read or located for that task, and priorFindings with the facts you established: symbol names, call sites, the approach you picked, what you ruled out. A fresh-context child starts with none of your context and will otherwise spend most of its run re-reading the repo. It treats this verified pack as satisfying initial context exploration, reads known paths directly, and widens discovery only for a concrete missing dependency. Send at most a dozen files and only ones you really opened — a guessed path costs the child more than an omitted one — and keep priorFindings to a few lines of facts, not directives.',\n 'After assigning work, continue non-overlapping parent work or end your turn. Do not poll or duplicate delegated scope.',\n 'When a delegated task completes and unblocks another task, repeat agent discovery if needed and assign that newly eligible task promptly. Do not poll in a loop. Completion notifications wake the parent session.',\n 'If a child asks for a decision through intercom, or an assignment fails to start for another concrete issue, respond, rescope, or retry explicitly. Do not silently leave the task pending.',\n 'assign refuses tasks that are blocked, already delegated, or completed. Resolve blockers first. Use {\"action\":\"cancel\",\"id\":3} to stop a running delegation; the task returns to pending.',\n 'Doom Task records delegated lifecycle and results on the shared task. The child does not update task status directly. Read the completion or failure result before deciding what to do next.',\n 'The task list is scoped to this session tree: delegated subagents share it, while unrelated sessions start empty. It persists for later inspection until retention cleanup.',\n \"Subject must be short and imperative (e.g. 'Research existing tool'); description is long-form detail written when you plan the task, and the delegated brief is that description plus the assign-time instructions, relevantFiles and priorFindings. Put durable scope in description and what you learned while exploring in the assign-time pack — do not repeat one in the other.\",\n];\n"],"mappings":"AAAA,MAAa,EAAsC,CACjD,4NACA,6XACA,ufACA,mNACA,uKACA,kPACA,qXACA,0fACA,qTACA,sRACA,sRACA,4sBACA,yHACA,qNACA,8LACA,4LACA,+LACA,8KACA,uXACF"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../store/taskGraph.cjs"),t=`All tasks are completed. Review the full task list once more, then close it with task {"action":"clear"}.`,n=`The applied entries are committed. Resend only the failed entries, corrected — a failed entry changed nothing, so a corrected retry is safe. Do not resend an entry that already applied: an entry without an id creates a second task.`,r=`No task changed, so the whole call can be resent once corrected.`;function i(e){let t=e.blockedBy?.length?` ⛓ ${e.blockedBy.map(e=>`#${e}`).join(`,`)}`:``,n=e.status===`in_progress`&&e.activeForm?` (${e.activeForm})`:``,r=e.delegation&&e.delegation.state!==`cancelled`?` [${e.delegation.agent}]`:``;return`[${e.status}] #${e.id} ${e.subject}${n}${r}${t}`}function a(e){let t=e.delegation;if(!t)return[];let n=[` delegated to: ${t.agent} (${t.state})`];return t.model&&n.push(` model: ${t.model}`),t.result?.error&&n.push(` error: ${t.result.error}`),t.result?.outputPath&&n.push(` output file: ${t.result.outputPath}`),t.result?.output&&n.push(` output: ${t.result.output}`),n}function o(t,n){let r=e.deriveBlocks(n.tasks).get(t.id)??[],i=[`#${t.id} [${t.status}] ${t.subject}`];return t.description&&i.push(` description: ${t.description}`),t.activeForm&&i.push(` activeForm: ${t.activeForm}`),t.blockedBy?.length&&i.push(` blockedBy: ${t.blockedBy.map(e=>`#${e}`).join(`, `)}`),r.length&&i.push(` blocks: ${r.map(e=>`#${e}`).join(`, `)}`),t.owner&&i.push(` owner: ${t.owner}`),i.push(...a(t)),i.join(`
|
|
2
|
-
`)}function s(e){switch(e.kind){case`created`:{let t=e.ref?` (ref "${e.ref}")`:``,n=e.blockedBy?.length?` — blocked by ${e.blockedBy.map(e=>`#${e}`).join(`, `)}`:``;return`Created #${e.id}${t}: ${e.subject} (${e.status})${n}`}case`updated`:{let t=e.fromStatus===e.toStatus?``:` (${e.fromStatus} -> ${e.toStatus})`;return`Updated #${e.id}${t}`}case`unchanged`:return`No change: #${e.id} already matches the requested values (status: ${e.status})`;case`failed`:return`Failed${e.id===void 0?``:` #${e.id}`}: ${e.message}`}}function c(e){return e.items.length===1?e.items[0].kind===`failed`?e.items[0].message:`no entry was applied`:[`no entry was applied.`,...e.items.map(e=>`- [${e.index}] ${s(e)}`),r].join(`
|
|
3
|
-
`)}function l(r,a){switch(r.kind){case`upsert`:{let i=r.items.length===1?[s(r.items[0])]:[`Upsert applied ${r.applied}/${r.items.length} entries${r.failed>0?`; ${r.failed} failed`:``}.`,...r.items.map(e=>`- [${e.index}] ${s(e)}`),...r.failed>0?[``,n]:[]];return r.applied>0&&e.isTaskListComplete(a.tasks)&&i.push(t),i.join(`
|
|
4
|
-
`)}case`delete`:return`Deleted #${r.id}: ${r.subject}`;case`clear`:return`Closed task list (cleared ${r.count} tasks)`;case`list`:{let e=a.tasks;return r.includeDeleted||(e=e.filter(e=>e.status!==`deleted`)),r.statusFilter&&(e=e.filter(e=>e.status===r.statusFilter)),e.length===0?`No tasks`:e.map(i).join(`
|
|
5
|
-
`)}case`get`:return o(r.task,a);case`error`:return`Error: ${r.message}`}}function u(e,t,n,r){return{content:[{type:`text`,text:l(r,n)}],details:{action:e,params:t,tasks:n.tasks,nextId:n.nextId,rev:n.rev,...r.kind===`error`?{error:r.message}:{},...r.kind===`upsert`?{upsert:{applied:r.items.flatMap(e=>e.kind===`failed`?[]:[e.id]),failed:r.failed}}:{}}}}function d(e,t,n,r,i){return{content:[{type:`text`,text:i?`Error: ${i}`:r}],details:{action:e,params:t,tasks:n.tasks,nextId:n.nextId,rev:n.rev,...i?{error:i}:{}}}}exports.MSG_ALL_COMPLETE_CLEAR=t,exports.MSG_UPSERT_NONE_APPLIED=r,exports.MSG_UPSERT_PARTIAL=n,exports.buildTextResult=d,exports.buildToolResult=u,exports.formatContent=l,exports.formatUpsertFailureText=c;
|
|
6
|
-
//# sourceMappingURL=responseEnvelope.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"responseEnvelope.cjs","names":["deriveBlocks","isTaskListComplete"],"sources":["../../src/tool/responseEnvelope.ts"],"sourcesContent":["import type { Op } from '../store/reducer.ts';\nimport { deriveBlocks, isTaskListComplete } from '../store/taskGraph.ts';\nimport type {\n Task,\n TaskAction,\n TaskDetails,\n TaskDocument,\n TaskMutationParams,\n UpsertItemOutcome,\n} from '../store/types.ts';\n\nexport const MSG_ALL_COMPLETE_CLEAR =\n 'All tasks are completed. Review the full task list once more, then close it with task {\"action\":\"clear\"}.';\n\n/**\n * Steering for a mixed batch. Unlike a batch of spawned subagents, a failed\n * entry here had no side effect at all, so retrying the failures is the safe\n * move and the model must be told so or it will do nothing. The hazard is the\n * other half: resending an applied create would make a second task.\n */\nexport const MSG_UPSERT_PARTIAL =\n 'The applied entries are committed. Resend only the failed entries, corrected — a failed entry changed nothing, so a corrected retry is safe. Do not resend an entry that already applied: an entry without an id creates a second task.';\n\nexport const MSG_UPSERT_NONE_APPLIED = 'No task changed, so the whole call can be resent once corrected.';\n\n/** `[status] #id subject (activeForm) [agent] ⛓ #dep` — the `list` line format. */\nfunction formatListLine(task: Task): string {\n const block = task.blockedBy?.length ? ` ⛓ ${task.blockedBy.map((id) => `#${id}`).join(',')}` : '';\n const form = task.status === 'in_progress' && task.activeForm ? ` (${task.activeForm})` : '';\n const delegated = task.delegation && task.delegation.state !== 'cancelled' ? ` [${task.delegation.agent}]` : '';\n return `[${task.status}] #${task.id} ${task.subject}${form}${delegated}${block}`;\n}\n\nfunction formatDelegationLines(task: Task): string[] {\n const delegation = task.delegation;\n if (!delegation) return [];\n\n const lines = [` delegated to: ${delegation.agent} (${delegation.state})`];\n if (delegation.model) lines.push(` model: ${delegation.model}`);\n if (delegation.result?.error) lines.push(` error: ${delegation.result.error}`);\n if (delegation.result?.outputPath) lines.push(` output file: ${delegation.result.outputPath}`);\n if (delegation.result?.output) lines.push(` output: ${delegation.result.output}`);\n return lines;\n}\n\nfunction formatGetLines(task: Task, document: TaskDocument): string {\n const blocks = deriveBlocks(document.tasks).get(task.id) ?? [];\n const lines = [`#${task.id} [${task.status}] ${task.subject}`];\n if (task.description) lines.push(` description: ${task.description}`);\n if (task.activeForm) lines.push(` activeForm: ${task.activeForm}`);\n if (task.blockedBy?.length) lines.push(` blockedBy: ${task.blockedBy.map((id) => `#${id}`).join(', ')}`);\n if (blocks.length) lines.push(` blocks: ${blocks.map((id) => `#${id}`).join(', ')}`);\n if (task.owner) lines.push(` owner: ${task.owner}`);\n lines.push(...formatDelegationLines(task));\n return lines.join('\\n');\n}\n\n/** One entry's outcome. Batch lines prefix this with `- [n] `. */\nfunction formatUpsertItem(item: UpsertItemOutcome): string {\n switch (item.kind) {\n case 'created': {\n const ref = item.ref ? ` (ref \"${item.ref}\")` : '';\n const deps = item.blockedBy?.length ? ` — blocked by ${item.blockedBy.map((id) => `#${id}`).join(', ')}` : '';\n return `Created #${item.id}${ref}: ${item.subject} (${item.status})${deps}`;\n }\n case 'updated': {\n const transition = item.fromStatus === item.toStatus ? '' : ` (${item.fromStatus} -> ${item.toStatus})`;\n return `Updated #${item.id}${transition}`;\n }\n case 'unchanged':\n return `No change: #${item.id} already matches the requested values (status: ${item.status})`;\n case 'failed':\n return `Failed${item.id === undefined ? '' : ` #${item.id}`}: ${item.message}`;\n }\n}\n\n/**\n * The thrown message when an upsert applied nothing. Kept separate from\n * `formatContent` because the caller wraps it in the actionable Options block\n * rather than returning it as a successful result.\n */\nexport function formatUpsertFailureText(op: Extract<Op, { kind: 'upsert' }>): string {\n if (op.items.length === 1) return op.items[0].kind === 'failed' ? op.items[0].message : 'no entry was applied';\n return [\n 'no entry was applied.',\n ...op.items.map((item) => `- [${item.index}] ${formatUpsertItem(item)}`),\n MSG_UPSERT_NONE_APPLIED,\n ].join('\\n');\n}\n\n/**\n * Pure formatter: `(op, document) -> string`. The switch is closed over `Op`,\n * so a new reducer variant fails to compile until it is handled here.\n */\nexport function formatContent(op: Op, document: TaskDocument): string {\n switch (op.kind) {\n case 'upsert': {\n // A batch of one is the common case and must not read like a bulk\n // report, so it keeps the exact single-line shape it has always had.\n const lines =\n op.items.length === 1\n ? [formatUpsertItem(op.items[0])]\n : [\n `Upsert applied ${op.applied}/${op.items.length} entries${op.failed > 0 ? `; ${op.failed} failed` : ''}.`,\n ...op.items.map((item) => `- [${item.index}] ${formatUpsertItem(item)}`),\n ...(op.failed > 0 ? ['', MSG_UPSERT_PARTIAL] : []),\n ];\n // Once, last, and only when something landed: emitting it per entry\n // would repeat it for every completion in a batch.\n if (op.applied > 0 && isTaskListComplete(document.tasks)) lines.push(MSG_ALL_COMPLETE_CLEAR);\n return lines.join('\\n');\n }\n case 'delete':\n return `Deleted #${op.id}: ${op.subject}`;\n case 'clear':\n return `Closed task list (cleared ${op.count} tasks)`;\n case 'list': {\n let view = document.tasks;\n if (!op.includeDeleted) view = view.filter((task) => task.status !== 'deleted');\n if (op.statusFilter) view = view.filter((task) => task.status === op.statusFilter);\n return view.length === 0 ? 'No tasks' : view.map(formatListLine).join('\\n');\n }\n case 'get':\n return formatGetLines(op.task, document);\n case 'error':\n return `Error: ${op.message}`;\n }\n}\n\nexport interface ToolResult {\n content: Array<{ type: 'text'; text: string }>;\n details: TaskDetails;\n}\n\n/** Build the LLM-facing envelope. `details` carries the post-mutation snapshot. */\nexport function buildToolResult(\n action: TaskAction,\n params: TaskMutationParams,\n document: TaskDocument,\n op: Op,\n): ToolResult {\n return {\n content: [{ type: 'text', text: formatContent(op, document) }],\n details: {\n action,\n params: params as Record<string, unknown>,\n tasks: document.tasks,\n nextId: document.nextId,\n rev: document.rev,\n ...(op.kind === 'error' ? { error: op.message } : {}),\n // Deliberately no `error` on a partial success: renderResult treats\n // `details.error` as total failure and would hide the rows for the\n // entries that did land.\n ...(op.kind === 'upsert'\n ? {\n upsert: {\n applied: op.items.flatMap((item) => (item.kind === 'failed' ? [] : [item.id])),\n failed: op.failed,\n },\n }\n : {}),\n },\n };\n}\n\n/** Envelope for delegation actions, which do not flow through the reducer. */\nexport function buildTextResult(\n action: TaskAction,\n params: TaskMutationParams,\n document: TaskDocument,\n text: string,\n error?: string,\n): ToolResult {\n return {\n content: [{ type: 'text', text: error ? `Error: ${error}` : text }],\n details: {\n action,\n params: params as Record<string, unknown>,\n tasks: document.tasks,\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AAG,MAAM,QAAS,GAAU,EAAK,OAAS,SAAW,CAAC,EAAI,CAAC,EAAK,EAAE,CAAE,EAC7E,OAAQ,EAAG,MACb,CACF,EACA,CAAC,CACP,CACF,CACF,CAGA,SAAgB,EACd,EACA,EACA,EACA,EACA,EACY,CACZ,MAAO,CACL,QAAS,CAAC,CAAE,KAAM,OAAQ,KAAM,EAAQ,UAAU,IAAU,CAAK,CAAC,EAClE,QAAS,CACP,SACQ,SACR,MAAO,EAAS,MAChB,OAAQ,EAAS,OACjB,IAAK,EAAS,IACd,GAAI,EAAQ,CAAE,OAAM,EAAI,CAAC,CAC3B,CACF,CACF"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { TaskAction, TaskDetails, TaskDocument, TaskMutationParams } from "../store/types.cjs";
|
|
2
|
-
import { Op } from "../store/reducer.cjs";
|
|
3
|
-
//#region src/tool/responseEnvelope.d.ts
|
|
4
|
-
declare const MSG_ALL_COMPLETE_CLEAR = "All tasks are completed. Review the full task list once more, then close it with task {\"action\":\"clear\"}.";
|
|
5
|
-
/**
|
|
6
|
-
* Steering for a mixed batch. Unlike a batch of spawned subagents, a failed
|
|
7
|
-
* entry here had no side effect at all, so retrying the failures is the safe
|
|
8
|
-
* move and the model must be told so or it will do nothing. The hazard is the
|
|
9
|
-
* other half: resending an applied create would make a second task.
|
|
10
|
-
*/
|
|
11
|
-
declare const MSG_UPSERT_PARTIAL = "The applied entries are committed. Resend only the failed entries, corrected — a failed entry changed nothing, so a corrected retry is safe. Do not resend an entry that already applied: an entry without an id creates a second task.";
|
|
12
|
-
declare const MSG_UPSERT_NONE_APPLIED = "No task changed, so the whole call can be resent once corrected.";
|
|
13
|
-
/**
|
|
14
|
-
* The thrown message when an upsert applied nothing. Kept separate from
|
|
15
|
-
* `formatContent` because the caller wraps it in the actionable Options block
|
|
16
|
-
* rather than returning it as a successful result.
|
|
17
|
-
*/
|
|
18
|
-
declare function formatUpsertFailureText(op: Extract<Op, {
|
|
19
|
-
kind: 'upsert';
|
|
20
|
-
}>): string;
|
|
21
|
-
/**
|
|
22
|
-
* Pure formatter: `(op, document) -> string`. The switch is closed over `Op`,
|
|
23
|
-
* so a new reducer variant fails to compile until it is handled here.
|
|
24
|
-
*/
|
|
25
|
-
declare function formatContent(op: Op, document: TaskDocument): string;
|
|
26
|
-
interface ToolResult {
|
|
27
|
-
content: Array<{
|
|
28
|
-
type: 'text';
|
|
29
|
-
text: string;
|
|
30
|
-
}>;
|
|
31
|
-
details: TaskDetails;
|
|
32
|
-
}
|
|
33
|
-
/** Build the LLM-facing envelope. `details` carries the post-mutation snapshot. */
|
|
34
|
-
declare function buildToolResult(action: TaskAction, params: TaskMutationParams, document: TaskDocument, op: Op): ToolResult;
|
|
35
|
-
/** Envelope for delegation actions, which do not flow through the reducer. */
|
|
36
|
-
declare function buildTextResult(action: TaskAction, params: TaskMutationParams, document: TaskDocument, text: string, error?: string): ToolResult;
|
|
37
|
-
//#endregion
|
|
38
|
-
export { MSG_ALL_COMPLETE_CLEAR, MSG_UPSERT_NONE_APPLIED, MSG_UPSERT_PARTIAL, ToolResult, buildTextResult, buildToolResult, formatContent, formatUpsertFailureText };
|
|
39
|
-
//# sourceMappingURL=responseEnvelope.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"responseEnvelope.d.cts","names":[],"sources":["../../src/tool/responseEnvelope.ts"],"mappings":";;;cAWa;;;;;;;cASA;cAGA;;;;;;iBA0DG,wBAAwB,IAAI,QAAQ;EAAM;;;;;;iBAa1C,cAAc,IAAI,IAAI,UAAU;UAmC/B;EACf,SAAS;IAAQ;IAAc;;EAC/B,SAAS;;;iBAIK,gBACd,QAAQ,YACR,QAAQ,oBACR,UAAU,cACV,IAAI,KACH;;iBA0Ba,gBACd,QAAQ,YACR,QAAQ,oBACR,UAAU,cACV,cACA,iBACC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { TaskAction, TaskDetails, TaskDocument, TaskMutationParams } from "../store/types.mjs";
|
|
2
|
-
import { Op } from "../store/reducer.mjs";
|
|
3
|
-
//#region src/tool/responseEnvelope.d.ts
|
|
4
|
-
declare const MSG_ALL_COMPLETE_CLEAR = "All tasks are completed. Review the full task list once more, then close it with task {\"action\":\"clear\"}.";
|
|
5
|
-
/**
|
|
6
|
-
* Steering for a mixed batch. Unlike a batch of spawned subagents, a failed
|
|
7
|
-
* entry here had no side effect at all, so retrying the failures is the safe
|
|
8
|
-
* move and the model must be told so or it will do nothing. The hazard is the
|
|
9
|
-
* other half: resending an applied create would make a second task.
|
|
10
|
-
*/
|
|
11
|
-
declare const MSG_UPSERT_PARTIAL = "The applied entries are committed. Resend only the failed entries, corrected — a failed entry changed nothing, so a corrected retry is safe. Do not resend an entry that already applied: an entry without an id creates a second task.";
|
|
12
|
-
declare const MSG_UPSERT_NONE_APPLIED = "No task changed, so the whole call can be resent once corrected.";
|
|
13
|
-
/**
|
|
14
|
-
* The thrown message when an upsert applied nothing. Kept separate from
|
|
15
|
-
* `formatContent` because the caller wraps it in the actionable Options block
|
|
16
|
-
* rather than returning it as a successful result.
|
|
17
|
-
*/
|
|
18
|
-
declare function formatUpsertFailureText(op: Extract<Op, {
|
|
19
|
-
kind: 'upsert';
|
|
20
|
-
}>): string;
|
|
21
|
-
/**
|
|
22
|
-
* Pure formatter: `(op, document) -> string`. The switch is closed over `Op`,
|
|
23
|
-
* so a new reducer variant fails to compile until it is handled here.
|
|
24
|
-
*/
|
|
25
|
-
declare function formatContent(op: Op, document: TaskDocument): string;
|
|
26
|
-
interface ToolResult {
|
|
27
|
-
content: Array<{
|
|
28
|
-
type: 'text';
|
|
29
|
-
text: string;
|
|
30
|
-
}>;
|
|
31
|
-
details: TaskDetails;
|
|
32
|
-
}
|
|
33
|
-
/** Build the LLM-facing envelope. `details` carries the post-mutation snapshot. */
|
|
34
|
-
declare function buildToolResult(action: TaskAction, params: TaskMutationParams, document: TaskDocument, op: Op): ToolResult;
|
|
35
|
-
/** Envelope for delegation actions, which do not flow through the reducer. */
|
|
36
|
-
declare function buildTextResult(action: TaskAction, params: TaskMutationParams, document: TaskDocument, text: string, error?: string): ToolResult;
|
|
37
|
-
//#endregion
|
|
38
|
-
export { MSG_ALL_COMPLETE_CLEAR, MSG_UPSERT_NONE_APPLIED, MSG_UPSERT_PARTIAL, ToolResult, buildTextResult, buildToolResult, formatContent, formatUpsertFailureText };
|
|
39
|
-
//# sourceMappingURL=responseEnvelope.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"responseEnvelope.d.mts","names":[],"sources":["../../src/tool/responseEnvelope.ts"],"mappings":";;;cAWa;;;;;;;cASA;cAGA;;;;;;iBA0DG,wBAAwB,IAAI,QAAQ;EAAM;;;;;;iBAa1C,cAAc,IAAI,IAAI,UAAU;UAmC/B;EACf,SAAS;IAAQ;IAAc;;EAC/B,SAAS;;;iBAIK,gBACd,QAAQ,YACR,QAAQ,oBACR,UAAU,cACV,IAAI,KACH;;iBA0Ba,gBACd,QAAQ,YACR,QAAQ,oBACR,UAAU,cACV,cACA,iBACC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{deriveBlocks as e,isTaskListComplete as t}from"../store/taskGraph.mjs";const n=`All tasks are completed. Review the full task list once more, then close it with task {"action":"clear"}.`,r=`The applied entries are committed. Resend only the failed entries, corrected — a failed entry changed nothing, so a corrected retry is safe. Do not resend an entry that already applied: an entry without an id creates a second task.`,i=`No task changed, so the whole call can be resent once corrected.`;function a(e){let t=e.blockedBy?.length?` ⛓ ${e.blockedBy.map(e=>`#${e}`).join(`,`)}`:``,n=e.status===`in_progress`&&e.activeForm?` (${e.activeForm})`:``,r=e.delegation&&e.delegation.state!==`cancelled`?` [${e.delegation.agent}]`:``;return`[${e.status}] #${e.id} ${e.subject}${n}${r}${t}`}function o(e){let t=e.delegation;if(!t)return[];let n=[` delegated to: ${t.agent} (${t.state})`];return t.model&&n.push(` model: ${t.model}`),t.result?.error&&n.push(` error: ${t.result.error}`),t.result?.outputPath&&n.push(` output file: ${t.result.outputPath}`),t.result?.output&&n.push(` output: ${t.result.output}`),n}function s(t,n){let r=e(n.tasks).get(t.id)??[],i=[`#${t.id} [${t.status}] ${t.subject}`];return t.description&&i.push(` description: ${t.description}`),t.activeForm&&i.push(` activeForm: ${t.activeForm}`),t.blockedBy?.length&&i.push(` blockedBy: ${t.blockedBy.map(e=>`#${e}`).join(`, `)}`),r.length&&i.push(` blocks: ${r.map(e=>`#${e}`).join(`, `)}`),t.owner&&i.push(` owner: ${t.owner}`),i.push(...o(t)),i.join(`
|
|
2
|
-
`)}function c(e){switch(e.kind){case`created`:{let t=e.ref?` (ref "${e.ref}")`:``,n=e.blockedBy?.length?` — blocked by ${e.blockedBy.map(e=>`#${e}`).join(`, `)}`:``;return`Created #${e.id}${t}: ${e.subject} (${e.status})${n}`}case`updated`:{let t=e.fromStatus===e.toStatus?``:` (${e.fromStatus} -> ${e.toStatus})`;return`Updated #${e.id}${t}`}case`unchanged`:return`No change: #${e.id} already matches the requested values (status: ${e.status})`;case`failed`:return`Failed${e.id===void 0?``:` #${e.id}`}: ${e.message}`}}function l(e){return e.items.length===1?e.items[0].kind===`failed`?e.items[0].message:`no entry was applied`:[`no entry was applied.`,...e.items.map(e=>`- [${e.index}] ${c(e)}`),i].join(`
|
|
3
|
-
`)}function u(e,i){switch(e.kind){case`upsert`:{let a=e.items.length===1?[c(e.items[0])]:[`Upsert applied ${e.applied}/${e.items.length} entries${e.failed>0?`; ${e.failed} failed`:``}.`,...e.items.map(e=>`- [${e.index}] ${c(e)}`),...e.failed>0?[``,r]:[]];return e.applied>0&&t(i.tasks)&&a.push(n),a.join(`
|
|
4
|
-
`)}case`delete`:return`Deleted #${e.id}: ${e.subject}`;case`clear`:return`Closed task list (cleared ${e.count} tasks)`;case`list`:{let t=i.tasks;return e.includeDeleted||(t=t.filter(e=>e.status!==`deleted`)),e.statusFilter&&(t=t.filter(t=>t.status===e.statusFilter)),t.length===0?`No tasks`:t.map(a).join(`
|
|
5
|
-
`)}case`get`:return s(e.task,i);case`error`:return`Error: ${e.message}`}}function d(e,t,n,r){return{content:[{type:`text`,text:u(r,n)}],details:{action:e,params:t,tasks:n.tasks,nextId:n.nextId,rev:n.rev,...r.kind===`error`?{error:r.message}:{},...r.kind===`upsert`?{upsert:{applied:r.items.flatMap(e=>e.kind===`failed`?[]:[e.id]),failed:r.failed}}:{}}}}function f(e,t,n,r,i){return{content:[{type:`text`,text:i?`Error: ${i}`:r}],details:{action:e,params:t,tasks:n.tasks,nextId:n.nextId,rev:n.rev,...i?{error:i}:{}}}}export{n as MSG_ALL_COMPLETE_CLEAR,i as MSG_UPSERT_NONE_APPLIED,r as MSG_UPSERT_PARTIAL,f as buildTextResult,d as buildToolResult,u as formatContent,l as formatUpsertFailureText};
|
|
6
|
-
//# sourceMappingURL=responseEnvelope.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"responseEnvelope.mjs","names":[],"sources":["../../src/tool/responseEnvelope.ts"],"sourcesContent":["import type { Op } from '../store/reducer.ts';\nimport { deriveBlocks, isTaskListComplete } from '../store/taskGraph.ts';\nimport type {\n Task,\n TaskAction,\n TaskDetails,\n TaskDocument,\n TaskMutationParams,\n UpsertItemOutcome,\n} from '../store/types.ts';\n\nexport const MSG_ALL_COMPLETE_CLEAR =\n 'All tasks are completed. Review the full task list once more, then close it with task {\"action\":\"clear\"}.';\n\n/**\n * Steering for a mixed batch. Unlike a batch of spawned subagents, a failed\n * entry here had no side effect at all, so retrying the failures is the safe\n * move and the model must be told so or it will do nothing. The hazard is the\n * other half: resending an applied create would make a second task.\n */\nexport const MSG_UPSERT_PARTIAL =\n 'The applied entries are committed. Resend only the failed entries, corrected — a failed entry changed nothing, so a corrected retry is safe. Do not resend an entry that already applied: an entry without an id creates a second task.';\n\nexport const MSG_UPSERT_NONE_APPLIED = 'No task changed, so the whole call can be resent once corrected.';\n\n/** `[status] #id subject (activeForm) [agent] ⛓ #dep` — the `list` line format. */\nfunction formatListLine(task: Task): string {\n const block = task.blockedBy?.length ? ` ⛓ ${task.blockedBy.map((id) => `#${id}`).join(',')}` : '';\n const form = task.status === 'in_progress' && task.activeForm ? ` (${task.activeForm})` : '';\n const delegated = task.delegation && task.delegation.state !== 'cancelled' ? ` [${task.delegation.agent}]` : '';\n return `[${task.status}] #${task.id} ${task.subject}${form}${delegated}${block}`;\n}\n\nfunction formatDelegationLines(task: Task): string[] {\n const delegation = task.delegation;\n if (!delegation) return [];\n\n const lines = [` delegated to: ${delegation.agent} (${delegation.state})`];\n if (delegation.model) lines.push(` model: ${delegation.model}`);\n if (delegation.result?.error) lines.push(` error: ${delegation.result.error}`);\n if (delegation.result?.outputPath) lines.push(` output file: ${delegation.result.outputPath}`);\n if (delegation.result?.output) lines.push(` output: ${delegation.result.output}`);\n return lines;\n}\n\nfunction formatGetLines(task: Task, document: TaskDocument): string {\n const blocks = deriveBlocks(document.tasks).get(task.id) ?? [];\n const lines = [`#${task.id} [${task.status}] ${task.subject}`];\n if (task.description) lines.push(` description: ${task.description}`);\n if (task.activeForm) lines.push(` activeForm: ${task.activeForm}`);\n if (task.blockedBy?.length) lines.push(` blockedBy: ${task.blockedBy.map((id) => `#${id}`).join(', ')}`);\n if (blocks.length) lines.push(` blocks: ${blocks.map((id) => `#${id}`).join(', ')}`);\n if (task.owner) lines.push(` owner: ${task.owner}`);\n lines.push(...formatDelegationLines(task));\n return lines.join('\\n');\n}\n\n/** One entry's outcome. Batch lines prefix this with `- [n] `. */\nfunction formatUpsertItem(item: UpsertItemOutcome): string {\n switch (item.kind) {\n case 'created': {\n const ref = item.ref ? ` (ref \"${item.ref}\")` : '';\n const deps = item.blockedBy?.length ? ` — blocked by ${item.blockedBy.map((id) => `#${id}`).join(', ')}` : '';\n return `Created #${item.id}${ref}: ${item.subject} (${item.status})${deps}`;\n }\n case 'updated': {\n const transition = item.fromStatus === item.toStatus ? '' : ` (${item.fromStatus} -> ${item.toStatus})`;\n return `Updated #${item.id}${transition}`;\n }\n case 'unchanged':\n return `No change: #${item.id} already matches the requested values (status: ${item.status})`;\n case 'failed':\n return `Failed${item.id === undefined ? '' : ` #${item.id}`}: ${item.message}`;\n }\n}\n\n/**\n * The thrown message when an upsert applied nothing. Kept separate from\n * `formatContent` because the caller wraps it in the actionable Options block\n * rather than returning it as a successful result.\n */\nexport function formatUpsertFailureText(op: Extract<Op, { kind: 'upsert' }>): string {\n if (op.items.length === 1) return op.items[0].kind === 'failed' ? op.items[0].message : 'no entry was applied';\n return [\n 'no entry was applied.',\n ...op.items.map((item) => `- [${item.index}] ${formatUpsertItem(item)}`),\n MSG_UPSERT_NONE_APPLIED,\n ].join('\\n');\n}\n\n/**\n * Pure formatter: `(op, document) -> string`. The switch is closed over `Op`,\n * so a new reducer variant fails to compile until it is handled here.\n */\nexport function formatContent(op: Op, document: TaskDocument): string {\n switch (op.kind) {\n case 'upsert': {\n // A batch of one is the common case and must not read like a bulk\n // report, so it keeps the exact single-line shape it has always had.\n const lines =\n op.items.length === 1\n ? [formatUpsertItem(op.items[0])]\n : [\n `Upsert applied ${op.applied}/${op.items.length} entries${op.failed > 0 ? `; ${op.failed} failed` : ''}.`,\n ...op.items.map((item) => `- [${item.index}] ${formatUpsertItem(item)}`),\n ...(op.failed > 0 ? ['', MSG_UPSERT_PARTIAL] : []),\n ];\n // Once, last, and only when something landed: emitting it per entry\n // would repeat it for every completion in a batch.\n if (op.applied > 0 && isTaskListComplete(document.tasks)) lines.push(MSG_ALL_COMPLETE_CLEAR);\n return lines.join('\\n');\n }\n case 'delete':\n return `Deleted #${op.id}: ${op.subject}`;\n case 'clear':\n return `Closed task list (cleared ${op.count} tasks)`;\n case 'list': {\n let view = document.tasks;\n if (!op.includeDeleted) view = view.filter((task) => task.status !== 'deleted');\n if (op.statusFilter) view = view.filter((task) => task.status === op.statusFilter);\n return view.length === 0 ? 'No tasks' : view.map(formatListLine).join('\\n');\n }\n case 'get':\n return formatGetLines(op.task, document);\n case 'error':\n return `Error: ${op.message}`;\n }\n}\n\nexport interface ToolResult {\n content: Array<{ type: 'text'; text: string }>;\n details: TaskDetails;\n}\n\n/** Build the LLM-facing envelope. `details` carries the post-mutation snapshot. */\nexport function buildToolResult(\n action: TaskAction,\n params: TaskMutationParams,\n document: TaskDocument,\n op: Op,\n): ToolResult {\n return {\n content: [{ type: 'text', text: formatContent(op, document) }],\n details: {\n action,\n params: params as Record<string, unknown>,\n tasks: document.tasks,\n nextId: document.nextId,\n rev: document.rev,\n ...(op.kind === 'error' ? { error: op.message } : {}),\n // Deliberately no `error` on a partial success: renderResult treats\n // `details.error` as total failure and would hide the rows for the\n // entries that did land.\n ...(op.kind === 'upsert'\n ? {\n upsert: {\n applied: op.items.flatMap((item) => (item.kind === 'failed' ? [] : [item.id])),\n failed: op.failed,\n },\n }\n : {}),\n },\n };\n}\n\n/** Envelope for delegation actions, which do not flow through the reducer. */\nexport function buildTextResult(\n action: TaskAction,\n params: TaskMutationParams,\n document: TaskDocument,\n text: string,\n error?: string,\n): ToolResult {\n return {\n content: [{ type: 'text', text: error ? `Error: ${error}` : text }],\n details: {\n action,\n params: params as Record<string, unknown>,\n tasks: document.tasks,\n nextId: document.nextId,\n rev: document.rev,\n ...(error ? { error } : {}),\n },\n };\n}\n"],"mappings":"8EAWA,MAAa,EACX,4GAQW,EACX,0OAEW,EAA0B,mEAGvC,SAAS,EAAe,EAAoB,CAC1C,IAAM,EAAQ,EAAK,WAAW,OAAS,MAAM,EAAK,UAAU,IAAK,GAAO,IAAI,GAAI,CAAC,CAAC,KAAK,GAAG,IAAM,GAC1F,EAAO,EAAK,SAAW,eAAiB,EAAK,WAAa,KAAK,EAAK,WAAW,GAAK,GACpF,EAAY,EAAK,YAAc,EAAK,WAAW,QAAU,YAAc,KAAK,EAAK,WAAW,MAAM,GAAK,GAC7G,MAAO,IAAI,EAAK,OAAO,KAAK,EAAK,GAAG,GAAG,EAAK,UAAU,IAAO,IAAY,GAC3E,CAEA,SAAS,EAAsB,EAAs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IAAK,QACH,MAAO,6BAA6B,EAAG,MAAM,SAC/C,IAAK,OAAQ,CACX,IAAI,EAAO,EAAS,MAGpB,OAFK,EAAG,iBAAgB,EAAO,EAAK,OAAQ,GAAS,EAAK,SAAW,SAAS,GAC1E,EAAG,eAAc,EAAO,EAAK,OAAQ,GAAS,EAAK,SAAW,EAAG,YAAY,GAC1E,EAAK,SAAW,EAAI,WAAa,EAAK,IAAI,CAAc,CAAC,CAAC,KAAK;CAAI,CAC5E,CACA,IAAK,MACH,OAAO,EAAe,EAAG,KAAM,CAAQ,EACzC,IAAK,QACH,MAAO,UAAU,EAAG,SACxB,CACF,CAQA,SAAgB,EACd,EACA,EACA,EACA,EACY,CACZ,MAAO,CACL,QAAS,CAAC,CAAE,KAAM,OAAQ,KAAM,EAAc,EAAI,CAAQ,CAAE,CAAC,EAC7D,QAAS,CACP,SACQ,SACR,MAAO,EAAS,MAChB,OAAQ,EAAS,OACjB,IAAK,EAAS,IACd,GAAI,EAAG,OAAS,QAAU,CAAE,MAAO,EAAG,OAAQ,EAAI,CAAC,EAInD,GAAI,EAAG,OAAS,SACZ,CACE,OAAQ,CACN,QAAS,EAAG,MAAM,QAAS,GAAU,EAAK,OAAS,SAAW,CAAC,EAAI,CAAC,EAAK,EAAE,CAAE,EAC7E,OAAQ,EAAG,MACb,CACF,EACA,CAAC,CACP,CACF,CACF,CAGA,SAAgB,EACd,EACA,EACA,EACA,EACA,EACY,CACZ,MAAO,CACL,QAAS,CAAC,CAAE,KAAM,OAAQ,KAAM,EAAQ,UAAU,IAAU,CAAK,CAAC,EAClE,QAAS,CACP,SACQ,SACR,MAAO,EAAS,MAChB,OAAQ,EAAS,OACjB,IAAK,EAAS,IACd,GAAI,EAAQ,CAAE,OAAM,EAAI,CAAC,CAC3B,CACF,CACF"}
|
package/dist/tool/schema.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require("../delegation/manager.cjs");let e=require("@agimon-ai/doompi-extension-contracts/subagent-tool"),t=require("typebox");const n=[`upsert`,`list`,`get`,`delete`,`clear`,`assign`,`cancel`],r=[`pending`,`in_progress`,`completed`,`failed`,`deleted`],i=[`fresh`,`fork`],a={upsert:[`action`,`tasks`],list:[`action`,`status`,`includeDeleted`],get:[`action`,`id`],delete:[`action`,`id`],clear:[`action`],assign:[`action`,`id`,`agent`,`inlineAgent`,`instructions`,`relevantFiles`,`priorFindings`,`model`,`context`],cancel:[`action`,`id`]};function o(e,t){return a[e].includes(t)}const s=t.Type.Union([t.Type.Integer(),t.Type.String()]),c=t.Type.Object({id:t.Type.Optional(t.Type.Integer({description:`Existing task id to change. Omit to create a new task. An entry with an id never creates: if the id is unknown, only that entry fails.`})),ref:t.Type.Optional(t.Type.String({description:`Temporary name for a task created by this entry, so a LATER entry in the same tasks[] can list it in blockedBy before its real id exists. Must start with a letter. Scoped to this one call and never stored; the response reports which real id it became.`})),subject:t.Type.Optional(t.Type.String({description:`Short imperative subject line (e.g. 'Research existing tool'). Required when the entry has no id; on an entry with an id it renames the task.`})),description:t.Type.Optional(t.Type.String({description:`Long-form task detail. This becomes the brief handed to the subagent when the task is assigned.`})),activeForm:t.Type.Optional(t.Type.String({description:`Present-continuous spinner label shown while status is in_progress (e.g. 'writing tests')`})),status:t.Type.Optional(t.Type.String({enum:[...r],description:`Starting status for a new entry (default pending; deleted is rejected), or the target status for an entry with an id, where the transition must be legal.`})),blockedBy:t.Type.Optional(t.Type.Array(s,{description:`Dependencies for a NEW entry (one with no id): this task is blocked by each target. A number is an existing task id; a string is the ref of a task created by an EARLIER entry in this same array. Use addBlockedBy / removeBlockedBy on an entry that has an id.`})),addBlockedBy:t.Type.Optional(t.Type.Array(s,{description:`Dependencies to add, for an entry with an id. Task ids, or refs declared by an earlier entry. Additive merge — do not resend the full array.`})),removeBlockedBy:t.Type.Optional(t.Type.Array(s,{description:`Dependencies to remove, for an entry with an id. Additive merge — do not resend the full array.`})),owner:t.Type.Optional(t.Type.String({description:`Owner label for this task. assign sets this to the subagent name automatically.`})),metadata:t.Type.Optional(t.Type.Record(t.Type.String(),t.Type.Unknown(),{description:`Arbitrary metadata merged into the task; pass null as a value to delete that key`}))},{additionalProperties:!1}),l=t.Type.Object({action:t.Type.String({enum:[...n],description:`upsert (create new tasks and change existing ones, one or many per call), list, get, delete (tombstone), clear (close/reset the list), assign (delegate to a subagent), cancel (stop a delegated run)`}),tasks:t.Type.Optional(t.Type.Array(c,{minItems:1,description:`upsert only. One entry per task: an entry with an id changes that task, an entry without an id creates one. Entries apply in array order, so a later entry can depend on an earlier one by ref. Each entry succeeds or fails on its own: the ones that succeed are committed and the ones that fail are reported by their array index.`})),id:t.Type.Optional(t.Type.Integer({description:`Task id, for get, delete, assign and cancel. upsert does not accept this field — put the id inside the tasks[] entry you want to change.`})),status:t.Type.Optional(t.Type.String({enum:[...r],description:`list only: return just the tasks in this status. To SET a status, use upsert with the task id inside tasks[].`})),includeDeleted:t.Type.Optional(t.Type.Boolean({description:`If true, list returns deleted (tombstoned) tasks as well. Default: false.`})),agent:t.Type.Optional(t.Type.String({description:`Name of the subagent to delegate this task to (required for assign)`})),inlineAgent:t.Type.Optional(e.InlineAgentSchema),instructions:t.Type.Optional(t.Type.String({description:`Extra instructions appended to the delegated brief (assign only)`})),relevantFiles:t.Type.Optional(t.Type.Array(t.Type.String(),{description:`Files you have ALREADY read or located that the subagent should open first (assign only). Paths relative to the working directory. A child starts with none of your context and otherwise spends most of its run rediscovering the repo. Send only files you actually looked at — a guessed path costs the child more than an omitted one. At most 12; extras are dropped.`})),priorFindings:t.Type.Optional(t.Type.String({description:`What you already established about this task and the subagent should not re-derive (assign only): symbol names, call sites, the approach you chose, what you already ruled out. Facts you discovered, not directives — put directives in instructions. Keep it to a few lines; it is truncated past ~1500 characters.`})),model:t.Type.Optional(t.Type.String({description:`Model override for the delegated run (assign only)`})),context:t.Type.Optional(t.Type.String({enum:[...i],description:`Subagent starting context (assign only): 'fresh' starts clean, 'fork' inherits this conversation. If omitted, uses the agent default, then fresh.`}))});exports.COMMAND_NAME=`tasks`,exports.ERR_REQUIRES_INTERACTIVE=`/tasks requires interactive mode`,exports.MSG_NO_TASKS=`No tasks yet. Ask the agent to add some!`,exports.MSG_UPSERT_FIELD_MISPLACED=`Per-task fields belong inside each tasks[] entry, not at the top level: {"action":"upsert","tasks":[{"id":3,"status":"completed"}]}.`,exports.TASK_ACTIONS=n,exports.TASK_ACTION_FIELDS=a,exports.TASK_CONTEXTS=i,exports.TASK_STATUSES=r,exports.TOOL_LABEL=`Task`,exports.TOOL_NAME=`task`,exports.TaskItemSchema=c,exports.TaskParamsSchema=l,exports.taskActionAcceptsField=o;
|
|
2
|
-
//# sourceMappingURL=schema.cjs.map
|
package/dist/tool/schema.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.cjs","names":["Type","InlineAgentSchema"],"sources":["../../src/tool/schema.ts"],"sourcesContent":["import { InlineAgentSchema } from '@agimon-ai/doompi-extension-contracts/subagent-tool';\nimport { type Static, Type } from 'typebox';\nimport { MAX_BRIEF_FILES } from '../delegation/manager.ts';\nimport type { TaskAction } from '../store/types.ts';\n\nexport const TASK_ACTIONS = ['upsert', 'list', 'get', 'delete', 'clear', 'assign', 'cancel'] as const;\nexport const TASK_STATUSES = ['pending', 'in_progress', 'completed', 'failed', 'deleted'] as const;\nexport const TASK_CONTEXTS = ['fresh', 'fork'] as const;\n\nexport const TOOL_NAME = 'task';\nexport const TOOL_LABEL = 'Task';\nexport const COMMAND_NAME = 'tasks';\n\nexport const ERR_REQUIRES_INTERACTIVE = '/tasks requires interactive mode';\nexport const MSG_NO_TASKS = 'No tasks yet. Ask the agent to add some!';\n\n/**\n * Which top-level fields each action accepts.\n *\n * The params object is flat and shared across every action, so the schema alone\n * cannot express \"upsert has no top-level id\". That gap matters: a call like\n * `{\"action\":\"upsert\",\"id\":3,\"tasks\":[{\"status\":\"completed\"}]}` would otherwise\n * silently create a duplicate task, because the entry itself carries no id.\n */\nexport const TASK_ACTION_FIELDS = {\n upsert: ['action', 'tasks'],\n list: ['action', 'status', 'includeDeleted'],\n get: ['action', 'id'],\n delete: ['action', 'id'],\n clear: ['action'],\n assign: [\n 'action',\n 'id',\n 'agent',\n 'inlineAgent',\n 'instructions',\n 'relevantFiles',\n 'priorFindings',\n 'model',\n 'context',\n ],\n cancel: ['action', 'id'],\n} as const satisfies Record<TaskAction, readonly string[]>;\n\nexport function taskActionAcceptsField(action: TaskAction, field: string): boolean {\n return (TASK_ACTION_FIELDS[action] as readonly string[]).includes(field);\n}\n\n/** Correction hint appended when a per-task field lands at the top level. */\nexport const MSG_UPSERT_FIELD_MISPLACED =\n 'Per-task fields belong inside each tasks[] entry, not at the top level: {\"action\":\"upsert\",\"tasks\":[{\"id\":3,\"status\":\"completed\"}]}.';\n\n/**\n * A dependency target: an existing task id, or the `ref` of a task created\n * earlier in the same call.\n */\nconst DepTokenSchema = Type.Union([Type.Integer(), Type.String()]);\n\n/**\n * One entry of an upsert. `additionalProperties: false` is load-bearing: pi\n * validates tool arguments against this schema before `execute` runs, so a\n * stray `{\"action\":\"update\"}` inside an entry is rejected at the boundary.\n */\nexport const TaskItemSchema = Type.Object(\n {\n id: Type.Optional(\n Type.Integer({\n description:\n 'Existing task id to change. Omit to create a new task. An entry with an id never creates: if the id is unknown, only that entry fails.',\n }),\n ),\n ref: Type.Optional(\n Type.String({\n description:\n 'Temporary name for a task created by this entry, so a LATER entry in the same tasks[] can list it in blockedBy before its real id exists. Must start with a letter. Scoped to this one call and never stored; the response reports which real id it became.',\n }),\n ),\n subject: Type.Optional(\n Type.String({\n description:\n \"Short imperative subject line (e.g. 'Research existing tool'). Required when the entry has no id; on an entry with an id it renames the task.\",\n }),\n ),\n description: Type.Optional(\n Type.String({\n description: 'Long-form task detail. This becomes the brief handed to the subagent when the task is assigned.',\n }),\n ),\n activeForm: Type.Optional(\n Type.String({\n description: \"Present-continuous spinner label shown while status is in_progress (e.g. 'writing tests')\",\n }),\n ),\n status: Type.Optional(\n Type.String({\n enum: [...TASK_STATUSES],\n description:\n 'Starting status for a new entry (default pending; deleted is rejected), or the target status for an entry with an id, where the transition must be legal.',\n }),\n ),\n blockedBy: Type.Optional(\n Type.Array(DepTokenSchema, {\n description:\n 'Dependencies for a NEW entry (one with no id): this task is blocked by each target. A number is an existing task id; a string is the ref of a task created by an EARLIER entry in this same array. Use addBlockedBy / removeBlockedBy on an entry that has an id.',\n }),\n ),\n addBlockedBy: Type.Optional(\n Type.Array(DepTokenSchema, {\n description:\n 'Dependencies to add, for an entry with an id. Task ids, or refs declared by an earlier entry. Additive merge — do not resend the full array.',\n }),\n ),\n removeBlockedBy: Type.Optional(\n Type.Array(DepTokenSchema, {\n description: 'Dependencies to remove, for an entry with an id. Additive merge — do not resend the full array.',\n }),\n ),\n owner: Type.Optional(\n Type.String({ description: 'Owner label for this task. assign sets this to the subagent name automatically.' }),\n ),\n metadata: Type.Optional(\n Type.Record(Type.String(), Type.Unknown(), {\n description: 'Arbitrary metadata merged into the task; pass null as a value to delete that key',\n }),\n ),\n },\n { additionalProperties: false },\n);\n\n/**\n * Tool parameters. Every `description` doubles as LLM-facing prompt copy, so\n * wording changes here change model behaviour.\n */\nexport const TaskParamsSchema = Type.Object({\n action: Type.String({\n enum: [...TASK_ACTIONS],\n description:\n 'upsert (create new tasks and change existing ones, one or many per call), list, get, delete (tombstone), clear (close/reset the list), assign (delegate to a subagent), cancel (stop a delegated run)',\n }),\n tasks: Type.Optional(\n Type.Array(TaskItemSchema, {\n minItems: 1,\n description:\n 'upsert only. One entry per task: an entry with an id changes that task, an entry without an id creates one. Entries apply in array order, so a later entry can depend on an earlier one by ref. Each entry succeeds or fails on its own: the ones that succeed are committed and the ones that fail are reported by their array index.',\n }),\n ),\n id: Type.Optional(\n Type.Integer({\n description:\n 'Task id, for get, delete, assign and cancel. upsert does not accept this field — put the id inside the tasks[] entry you want to change.',\n }),\n ),\n status: Type.Optional(\n Type.String({\n enum: [...TASK_STATUSES],\n description:\n 'list only: return just the tasks in this status. To SET a status, use upsert with the task id inside tasks[].',\n }),\n ),\n includeDeleted: Type.Optional(\n Type.Boolean({\n description: 'If true, list returns deleted (tombstoned) tasks as well. Default: false.',\n }),\n ),\n agent: Type.Optional(\n Type.String({\n description: 'Name of the subagent to delegate this task to (required for assign)',\n }),\n ),\n inlineAgent: Type.Optional(InlineAgentSchema),\n instructions: Type.Optional(\n Type.String({\n description: 'Extra instructions appended to the delegated brief (assign only)',\n }),\n ),\n relevantFiles: Type.Optional(\n Type.Array(Type.String(), {\n description: `Files you have ALREADY read or located that the subagent should open first (assign only). Paths relative to the working directory. A child starts with none of your context and otherwise spends most of its run rediscovering the repo. Send only files you actually looked at — a guessed path costs the child more than an omitted one. At most ${MAX_BRIEF_FILES}; extras are dropped.`,\n }),\n ),\n priorFindings: Type.Optional(\n Type.String({\n description:\n 'What you already established about this task and the subagent should not re-derive (assign only): symbol names, call sites, the approach you chose, what you already ruled out. Facts you discovered, not directives — put directives in instructions. Keep it to a few lines; it is truncated past ~1500 characters.',\n }),\n ),\n model: Type.Optional(Type.String({ description: 'Model override for the delegated run (assign only)' })),\n context: Type.Optional(\n Type.String({\n enum: [...TASK_CONTEXTS],\n description:\n \"Subagent starting context (assign only): 'fresh' starts clean, 'fork' inherits this conversation. If omitted, uses the agent default, then fresh.\",\n }),\n ),\n});\n\nexport type TaskItemParams = Static<typeof TaskItemSchema>;\nexport type TaskParams = Static<typeof TaskParamsSchema>;\n"],"mappings":"kMAKA,MAAa,EAAe,CAAC,SAAU,OAAQ,MAAO,SAAU,QAAS,SAAU,QAAQ,EAC9E,EAAgB,CAAC,UAAW,cAAe,YAAa,SAAU,SAAS,EAC3E,EAAgB,CAAC,QAAS,MAAM,EAiBhC,EAAqB,CAChC,OAAQ,CAAC,SAAU,OAAO,EAC1B,KAAM,CAAC,SAAU,SAAU,gBAAgB,EAC3C,IAAK,CAAC,SAAU,IAAI,EACpB,OAAQ,CA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AAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.cts","names":[],"sources":["../../src/tool/schema.ts"],"mappings":";;;cAKa;cACA;cACA;cAEA;cACA;cACA;cAEA;cACA;;;;;;;;;cAUA;;;;;;;;;iBAoBG,uBAAuB,QAAQ,YAAY;;cAK9C;;;;;;cAcA,gBAAc,KAAA;;;;;;;;;;;;;;;;;cAsEd,kBAAgB,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+DjB,iBAAiB,cAAc;KAC/B,aAAa,cAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.mts","names":[],"sources":["../../src/tool/schema.ts"],"mappings":";;;cAKa;cACA;cACA;cAEA;cACA;cACA;cAEA;cACA;;;;;;;;;cAUA;;;;;;;;;iBAoBG,uBAAuB,QAAQ,YAAY;;cAK9C;;;;;;cAcA,gBAAc,KAAA;;;;;;;;;;;;;;;;;cAsEd,kBAAgB,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+DjB,iBAAiB,cAAc;KAC/B,aAAa,cAAc"}
|
package/dist/tool/schema.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"../delegation/manager.mjs";import{InlineAgentSchema as e}from"@agimon-ai/doompi-extension-contracts/subagent-tool";import{Type as t}from"typebox";const n=[`upsert`,`list`,`get`,`delete`,`clear`,`assign`,`cancel`],r=[`pending`,`in_progress`,`completed`,`failed`,`deleted`],i=[`fresh`,`fork`],a=`task`,o=`Task`,s=`tasks`,c=`/tasks requires interactive mode`,l=`No tasks yet. Ask the agent to add some!`,u={upsert:[`action`,`tasks`],list:[`action`,`status`,`includeDeleted`],get:[`action`,`id`],delete:[`action`,`id`],clear:[`action`],assign:[`action`,`id`,`agent`,`inlineAgent`,`instructions`,`relevantFiles`,`priorFindings`,`model`,`context`],cancel:[`action`,`id`]};function d(e,t){return u[e].includes(t)}const f=`Per-task fields belong inside each tasks[] entry, not at the top level: {"action":"upsert","tasks":[{"id":3,"status":"completed"}]}.`,p=t.Union([t.Integer(),t.String()]),m=t.Object({id:t.Optional(t.Integer({description:`Existing task id to change. Omit to create a new task. An entry with an id never creates: if the id is unknown, only that entry fails.`})),ref:t.Optional(t.String({description:`Temporary name for a task created by this entry, so a LATER entry in the same tasks[] can list it in blockedBy before its real id exists. Must start with a letter. Scoped to this one call and never stored; the response reports which real id it became.`})),subject:t.Optional(t.String({description:`Short imperative subject line (e.g. 'Research existing tool'). Required when the entry has no id; on an entry with an id it renames the task.`})),description:t.Optional(t.String({description:`Long-form task detail. This becomes the brief handed to the subagent when the task is assigned.`})),activeForm:t.Optional(t.String({description:`Present-continuous spinner label shown while status is in_progress (e.g. 'writing tests')`})),status:t.Optional(t.String({enum:[...r],description:`Starting status for a new entry (default pending; deleted is rejected), or the target status for an entry with an id, where the transition must be legal.`})),blockedBy:t.Optional(t.Array(p,{description:`Dependencies for a NEW entry (one with no id): this task is blocked by each target. A number is an existing task id; a string is the ref of a task created by an EARLIER entry in this same array. Use addBlockedBy / removeBlockedBy on an entry that has an id.`})),addBlockedBy:t.Optional(t.Array(p,{description:`Dependencies to add, for an entry with an id. Task ids, or refs declared by an earlier entry. Additive merge — do not resend the full array.`})),removeBlockedBy:t.Optional(t.Array(p,{description:`Dependencies to remove, for an entry with an id. Additive merge — do not resend the full array.`})),owner:t.Optional(t.String({description:`Owner label for this task. assign sets this to the subagent name automatically.`})),metadata:t.Optional(t.Record(t.String(),t.Unknown(),{description:`Arbitrary metadata merged into the task; pass null as a value to delete that key`}))},{additionalProperties:!1}),h=t.Object({action:t.String({enum:[...n],description:`upsert (create new tasks and change existing ones, one or many per call), list, get, delete (tombstone), clear (close/reset the list), assign (delegate to a subagent), cancel (stop a delegated run)`}),tasks:t.Optional(t.Array(m,{minItems:1,description:`upsert only. One entry per task: an entry with an id changes that task, an entry without an id creates one. Entries apply in array order, so a later entry can depend on an earlier one by ref. Each entry succeeds or fails on its own: the ones that succeed are committed and the ones that fail are reported by their array index.`})),id:t.Optional(t.Integer({description:`Task id, for get, delete, assign and cancel. upsert does not accept this field — put the id inside the tasks[] entry you want to change.`})),status:t.Optional(t.String({enum:[...r],description:`list only: return just the tasks in this status. To SET a status, use upsert with the task id inside tasks[].`})),includeDeleted:t.Optional(t.Boolean({description:`If true, list returns deleted (tombstoned) tasks as well. Default: false.`})),agent:t.Optional(t.String({description:`Name of the subagent to delegate this task to (required for assign)`})),inlineAgent:t.Optional(e),instructions:t.Optional(t.String({description:`Extra instructions appended to the delegated brief (assign only)`})),relevantFiles:t.Optional(t.Array(t.String(),{description:`Files you have ALREADY read or located that the subagent should open first (assign only). Paths relative to the working directory. A child starts with none of your context and otherwise spends most of its run rediscovering the repo. Send only files you actually looked at — a guessed path costs the child more than an omitted one. At most 12; extras are dropped.`})),priorFindings:t.Optional(t.String({description:`What you already established about this task and the subagent should not re-derive (assign only): symbol names, call sites, the approach you chose, what you already ruled out. Facts you discovered, not directives — put directives in instructions. Keep it to a few lines; it is truncated past ~1500 characters.`})),model:t.Optional(t.String({description:`Model override for the delegated run (assign only)`})),context:t.Optional(t.String({enum:[...i],description:`Subagent starting context (assign only): 'fresh' starts clean, 'fork' inherits this conversation. If omitted, uses the agent default, then fresh.`}))});export{s as COMMAND_NAME,c as ERR_REQUIRES_INTERACTIVE,l as MSG_NO_TASKS,f as MSG_UPSERT_FIELD_MISPLACED,n as TASK_ACTIONS,u as TASK_ACTION_FIELDS,i as TASK_CONTEXTS,r as TASK_STATUSES,o as TOOL_LABEL,a as TOOL_NAME,m as TaskItemSchema,h as TaskParamsSchema,d as taskActionAcceptsField};
|
|
2
|
-
//# sourceMappingURL=schema.mjs.map
|
package/dist/tool/schema.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.mjs","names":[],"sources":["../../src/tool/schema.ts"],"sourcesContent":["import { InlineAgentSchema } from '@agimon-ai/doompi-extension-contracts/subagent-tool';\nimport { type Static, Type } from 'typebox';\nimport { MAX_BRIEF_FILES } from '../delegation/manager.ts';\nimport type { TaskAction } from '../store/types.ts';\n\nexport const TASK_ACTIONS = ['upsert', 'list', 'get', 'delete', 'clear', 'assign', 'cancel'] as const;\nexport const TASK_STATUSES = ['pending', 'in_progress', 'completed', 'failed', 'deleted'] as const;\nexport const TASK_CONTEXTS = ['fresh', 'fork'] as const;\n\nexport const TOOL_NAME = 'task';\nexport const TOOL_LABEL = 'Task';\nexport const COMMAND_NAME = 'tasks';\n\nexport const ERR_REQUIRES_INTERACTIVE = '/tasks requires interactive mode';\nexport const MSG_NO_TASKS = 'No tasks yet. Ask the agent to add some!';\n\n/**\n * Which top-level fields each action accepts.\n *\n * The params object is flat and shared across every action, so the schema alone\n * cannot express \"upsert has no top-level id\". That gap matters: a call like\n * `{\"action\":\"upsert\",\"id\":3,\"tasks\":[{\"status\":\"completed\"}]}` would otherwise\n * silently create a duplicate task, because the entry itself carries no id.\n */\nexport const TASK_ACTION_FIELDS = {\n upsert: ['action', 'tasks'],\n list: ['action', 'status', 'includeDeleted'],\n get: ['action', 'id'],\n delete: ['action', 'id'],\n clear: ['action'],\n assign: [\n 'action',\n 'id',\n 'agent',\n 'inlineAgent',\n 'instructions',\n 'relevantFiles',\n 'priorFindings',\n 'model',\n 'context',\n ],\n cancel: ['action', 'id'],\n} as const satisfies Record<TaskAction, readonly string[]>;\n\nexport function taskActionAcceptsField(action: TaskAction, field: string): boolean {\n return (TASK_ACTION_FIELDS[action] as readonly string[]).includes(field);\n}\n\n/** Correction hint appended when a per-task field lands at the top level. */\nexport const MSG_UPSERT_FIELD_MISPLACED =\n 'Per-task fields belong inside each tasks[] entry, not at the top level: {\"action\":\"upsert\",\"tasks\":[{\"id\":3,\"status\":\"completed\"}]}.';\n\n/**\n * A dependency target: an existing task id, or the `ref` of a task created\n * earlier in the same call.\n */\nconst DepTokenSchema = Type.Union([Type.Integer(), Type.String()]);\n\n/**\n * One entry of an upsert. `additionalProperties: false` is load-bearing: pi\n * validates tool arguments against this schema before `execute` runs, so a\n * stray `{\"action\":\"update\"}` inside an entry is rejected at the boundary.\n */\nexport const TaskItemSchema = Type.Object(\n {\n id: Type.Optional(\n Type.Integer({\n description:\n 'Existing task id to change. Omit to create a new task. An entry with an id never creates: if the id is unknown, only that entry fails.',\n }),\n ),\n ref: Type.Optional(\n Type.String({\n description:\n 'Temporary name for a task created by this entry, so a LATER entry in the same tasks[] can list it in blockedBy before its real id exists. Must start with a letter. Scoped to this one call and never stored; the response reports which real id it became.',\n }),\n ),\n subject: Type.Optional(\n Type.String({\n description:\n \"Short imperative subject line (e.g. 'Research existing tool'). Required when the entry has no id; on an entry with an id it renames the task.\",\n }),\n ),\n description: Type.Optional(\n Type.String({\n description: 'Long-form task detail. This becomes the brief handed to the subagent when the task is assigned.',\n }),\n ),\n activeForm: Type.Optional(\n Type.String({\n description: \"Present-continuous spinner label shown while status is in_progress (e.g. 'writing tests')\",\n }),\n ),\n status: Type.Optional(\n Type.String({\n enum: [...TASK_STATUSES],\n description:\n 'Starting status for a new entry (default pending; deleted is rejected), or the target status for an entry with an id, where the transition must be legal.',\n }),\n ),\n blockedBy: Type.Optional(\n Type.Array(DepTokenSchema, {\n description:\n 'Dependencies for a NEW entry (one with no id): this task is blocked by each target. A number is an existing task id; a string is the ref of a task created by an EARLIER entry in this same array. Use addBlockedBy / removeBlockedBy on an entry that has an id.',\n }),\n ),\n addBlockedBy: Type.Optional(\n Type.Array(DepTokenSchema, {\n description:\n 'Dependencies to add, for an entry with an id. Task ids, or refs declared by an earlier entry. Additive merge — do not resend the full array.',\n }),\n ),\n removeBlockedBy: Type.Optional(\n Type.Array(DepTokenSchema, {\n description: 'Dependencies to remove, for an entry with an id. Additive merge — do not resend the full array.',\n }),\n ),\n owner: Type.Optional(\n Type.String({ description: 'Owner label for this task. assign sets this to the subagent name automatically.' }),\n ),\n metadata: Type.Optional(\n Type.Record(Type.String(), Type.Unknown(), {\n description: 'Arbitrary metadata merged into the task; pass null as a value to delete that key',\n }),\n ),\n },\n { additionalProperties: false },\n);\n\n/**\n * Tool parameters. Every `description` doubles as LLM-facing prompt copy, so\n * wording changes here change model behaviour.\n */\nexport const TaskParamsSchema = Type.Object({\n action: Type.String({\n enum: [...TASK_ACTIONS],\n description:\n 'upsert (create new tasks and change existing ones, one or many per call), list, get, delete (tombstone), clear (close/reset the list), assign (delegate to a subagent), cancel (stop a delegated run)',\n }),\n tasks: Type.Optional(\n Type.Array(TaskItemSchema, {\n minItems: 1,\n description:\n 'upsert only. One entry per task: an entry with an id changes that task, an entry without an id creates one. Entries apply in array order, so a later entry can depend on an earlier one by ref. Each entry succeeds or fails on its own: the ones that succeed are committed and the ones that fail are reported by their array index.',\n }),\n ),\n id: Type.Optional(\n Type.Integer({\n description:\n 'Task id, for get, delete, assign and cancel. upsert does not accept this field — put the id inside the tasks[] entry you want to change.',\n }),\n ),\n status: Type.Optional(\n Type.String({\n enum: [...TASK_STATUSES],\n description:\n 'list only: return just the tasks in this status. To SET a status, use upsert with the task id inside tasks[].',\n }),\n ),\n includeDeleted: Type.Optional(\n Type.Boolean({\n description: 'If true, list returns deleted (tombstoned) tasks as well. Default: false.',\n }),\n ),\n agent: Type.Optional(\n Type.String({\n description: 'Name of the subagent to delegate this task to (required for assign)',\n }),\n ),\n inlineAgent: Type.Optional(InlineAgentSchema),\n instructions: Type.Optional(\n Type.String({\n description: 'Extra instructions appended to the delegated brief (assign only)',\n }),\n ),\n relevantFiles: Type.Optional(\n Type.Array(Type.String(), {\n description: `Files you have ALREADY read or located that the subagent should open first (assign only). Paths relative to the working directory. A child starts with none of your context and otherwise spends most of its run rediscovering the repo. Send only files you actually looked at — a guessed path costs the child more than an omitted one. At most ${MAX_BRIEF_FILES}; extras are dropped.`,\n }),\n ),\n priorFindings: Type.Optional(\n Type.String({\n description:\n 'What you already established about this task and the subagent should not re-derive (assign only): symbol names, call sites, the approach you chose, what you already ruled out. Facts you discovered, not directives — put directives in instructions. Keep it to a few lines; it is truncated past ~1500 characters.',\n }),\n ),\n model: Type.Optional(Type.String({ description: 'Model override for the delegated run (assign only)' })),\n context: Type.Optional(\n Type.String({\n enum: [...TASK_CONTEXTS],\n description:\n \"Subagent starting context (assign only): 'fresh' starts clean, 'fork' inherits this conversation. If omitted, uses the agent default, then fresh.\",\n }),\n ),\n});\n\nexport type TaskItemParams = Static<typeof TaskItemSchema>;\nexport type TaskParams = Static<typeof TaskParamsSchema>;\n"],"mappings":"yJAKA,MAAa,EAAe,CAAC,SAAU,OAAQ,MAAO,SAAU,QAAS,SAAU,QAAQ,EAC9E,EAAgB,CAAC,UAAW,cAAe,YAAa,SAAU,SAAS,EAC3E,EAAgB,CAAC,QAAS,MAAM,EAEhC,EAAY,OACZ,EAAa,OACb,EAAe,QAEf,EAA2B,mCAC3B,EAAe,2CAUf,EAAqB,CAChC,OAAQ,CAAC,SAAU,OAAO,EAC1B,KAAM,CAAC,SAAU,SAAU,gBAAgB,EAC3C,IAAK,CAAC,SAAU,IAAI,EACpB,OAAQ,CAAC,SAAU,IAAI,EACvB,MAAO,CAAC,QAAQ,EAChB,OAAQ,CACN,SACA,KACA,QACA,cACA,eACA,gBACA,gBACA,QACA,SACF,EACA,OAAQ,CAAC,SAAU,IAAI,CACzB,EAEA,SAAgB,EAAuB,EAAoB,EAAwB,CACjF,OAAQ,EAAmB,EAAO,CAAuB,SAAS,CAAK,CACzE,CAGA,MAAa,EACX,uIAMI,EAAiB,EAAK,MAAM,CAAC,EAAK,QAAQ,EAAG,EAAK,OAAO,CAAC,CAAC,EAOpD,EAAiB,EAAK,OACjC,CACE,GAAI,EAAK,SACP,EAAK,QAAQ,CACX,YACE,wIACJ,CAAC,CACH,EACA,IAAK,EAAK,SACR,EAAK,OAAO,CACV,YACE,6PACJ,CAAC,CACH,EACA,QAAS,EAAK,SACZ,EAAK,OAAO,CACV,YACE,+IACJ,CAAC,CACH,EACA,YAAa,EAAK,SAChB,EAAK,OAAO,CACV,YAAa,iGACf,CAAC,CACH,EACA,WAAY,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,OAAO,CACV,YACE,uTACJ,CAAC,CACH,EACA,MAAO,EAAK,SAAS,EAAK,OAAO,CAAE,YAAa,oDAAqD,CAAC,CAAC,EACvG,QAAS,EAAK,SACZ,EAAK,OAAO,CACV,KAAM,CAAC,GAAG,CAAa,EACvB,YACE,mJACJ,CAAC,CACH,CACF,CAAC"}
|
package/dist/tool/taskTool.cjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logSinkTelemetry.cjs"),t=require("./schema.cjs"),n=require("../store/reducer.cjs"),r=require("../tui/format.cjs"),i=require("./responseEnvelope.cjs"),a=require("./promptGuidelines.cjs"),o=`Manage a shared task list to track multi-step progress, and delegate tasks to subagents`,s=new Set([`upsert`,`list`,`get`,`delete`,`clear`]);var c=class extends Error{};function l(e,t){return new c([`Task ${e} failed: ${t}`,``,`Options:`,`- List the task board and inspect the current ids, states, and blockers.`,`- Correct the arguments or state conflict, then retry once.`,`- Ask the user before cancelling work or changing dependencies to recover.`].join(`
|
|
2
|
-
`))}function u(e,n){let r=Object.keys(n).filter(r=>n[r]!==void 0&&!t.taskActionAcceptsField(e,r));if(r.length===0)return;let i=e===`upsert`?` ${t.MSG_UPSERT_FIELD_MISPLACED}`:``;throw l(e,`${e} does not accept ${r.join(`, `)}.${i}`)}async function d(e,t,r){let{document:a,value:o}=await e.mutate(e=>{let i=n.applyTaskMutation(e,t,r);return{...n.isCommittingOp(i.op)?{document:i.document}:{},value:i}});if(o.op.kind===`error`)throw l(t,o.op.message);if(o.op.kind===`upsert`&&o.op.applied===0)throw l(t,i.formatUpsertFailureText(o.op));return i.buildToolResult(t,r,a,o.op)}function f(n,f){let{store:p,delegation:m}=f;n.registerTool({name:t.TOOL_NAME,label:t.TOOL_LABEL,description:`Manage a shared task list for tracking multi-step progress, and delegate tasks to subagents. Actions: upsert (write tasks — a tasks[] array where an entry with an id changes that task and an entry without an id creates one, so one call can capture a whole plan), list, get, delete (tombstone), clear (close/reset the list), assign (hand the task to a named subagent that works it in the background), cancel (stop a delegated run). upsert applies each entry independently: successes are committed and failures are reported by array index, and an entry can depend on a task created by an earlier entry in the same call via a ref. Batch when writing a plan down; report progress one task at a time. Status: pending → in_progress → completed, plus failed and a deleted tombstone. The list is shared within the current session tree, including delegated subagents, while unrelated sessions start empty. Session stores persist until retention cleanup.`,promptSnippet:o,promptGuidelines:a.DEFAULT_PROMPT_GUIDELINES,parameters:t.TaskParamsSchema,async execute(t,n,r,a,o){let h=n.action,g=n;try{if(u(h,g),s.has(h)){let e=await d(p,h,g);return f.onChange?.(),e}let e;if(h===`assign`?(a?.(i.buildTextResult(h,g,p.snapshot,`Delegating task #${g.id??`unknown`}...`)),e=await m.assign(g.id??NaN,{agent:g.agent,inlineAgent:g.inlineAgent,instructions:g.instructions,relevantFiles:g.relevantFiles,priorFindings:g.priorFindings,model:g.model,context:g.context,signal:r})):(a?.(i.buildTextResult(h,g,p.snapshot,`Requesting cancellation for task #${g.id??`unknown`}...`)),e=await m.cancel(g.id??NaN)),f.onChange?.(),!e.ok)throw l(h,e.message);return i.buildTextResult(h,g,p.snapshot,e.message,void 0)}catch(t){throw f.report?.error(e.TASK_EVENT.toolFailed,t,{"tool.action":h,...g.id===void 0?{}:{"task.id":g.id}}),t instanceof c?t:l(h,t instanceof Error?t.message:String(t))}},renderCall(e,t,n){return r.renderTaskCall(e,t,p.snapshot.tasks)},renderResult(e,t,n,i){return r.renderTaskResult(e,t,n)}})}exports.DEFAULT_PROMPT_GUIDELINES=a.DEFAULT_PROMPT_GUIDELINES,exports.DEFAULT_PROMPT_SNIPPET=o,exports.registerTaskTool=f;
|
|
3
|
-
//# sourceMappingURL=taskTool.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taskTool.cjs","names":["taskActionAcceptsField","MSG_UPSERT_FIELD_MISPLACED","applyTaskMutation","isCommittingOp","formatUpsertFailureText","buildToolResult","TOOL_NAME","TOOL_LABEL","DEFAULT_PROMPT_GUIDELINES","TaskParamsSchema","buildTextResult","TASK_EVENT","renderTaskCall","renderTaskResult"],"sources":["../../src/tool/taskTool.ts"],"sourcesContent":["import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';\nimport type { DelegationManager, DelegationOutcome } from '../delegation/manager.ts';\nimport { TASK_EVENT, type TaskFailureReporter } from '../logSinkTelemetry.ts';\nimport { applyTaskMutation, isCommittingOp, type ReducerAction } from '../store/reducer.ts';\nimport type { TaskStore } from '../store/taskStore.ts';\nimport type { TaskAction, TaskMutationParams } from '../store/types.ts';\nimport { renderTaskCall, renderTaskResult } from '../tui/format.ts';\nimport { buildTextResult, buildToolResult, formatUpsertFailureText, type ToolResult } from './responseEnvelope.ts';\nimport {\n MSG_UPSERT_FIELD_MISPLACED,\n TOOL_LABEL,\n TOOL_NAME,\n TaskParamsSchema,\n taskActionAcceptsField,\n} from './schema.ts';\nimport { DEFAULT_PROMPT_GUIDELINES } from './promptGuidelines.ts';\nexport { DEFAULT_PROMPT_GUIDELINES } from './promptGuidelines.ts';\n\nexport const DEFAULT_PROMPT_SNIPPET =\n 'Manage a shared task list to track multi-step progress, and delegate tasks to subagents';\n\nexport interface TaskToolDependencies {\n store: TaskStore;\n delegation: DelegationManager;\n onChange?: () => void;\n report?: TaskFailureReporter;\n}\n\nconst ACTION_ATTRIBUTE = 'tool.action';\nconst TASK_ID_ATTRIBUTE = 'task.id';\n\nconst REDUCER_ACTIONS = new Set<TaskAction>(['upsert', 'list', 'get', 'delete', 'clear']);\n\nclass TaskToolExecutionError extends Error {}\n\nfunction actionableTaskError(action: TaskAction, message: string): TaskToolExecutionError {\n return new TaskToolExecutionError(\n [\n `Task ${action} failed: ${message}`,\n '',\n 'Options:',\n '- List the task board and inspect the current ids, states, and blockers.',\n '- Correct the arguments or state conflict, then retry once.',\n '- Ask the user before cancelling work or changing dependencies to recover.',\n ].join('\\n'),\n );\n}\n\n/**\n * Reject a field that belongs to a different action.\n *\n * The params schema is flat and shared across every action, so this is the only\n * place `{\"action\":\"upsert\",\"id\":3}` can be caught — and it must be, because\n * the entry it carries has no id and would silently create a duplicate task.\n */\nfunction rejectStrayFields(action: TaskAction, params: TaskMutationParams): void {\n const stray = Object.keys(params).filter((key) => params[key] !== undefined && !taskActionAcceptsField(action, key));\n if (stray.length === 0) return;\n const hint = action === 'upsert' ? ` ${MSG_UPSERT_FIELD_MISPLACED}` : '';\n throw actionableTaskError(action, `${action} does not accept ${stray.join(', ')}.${hint}`);\n}\n\n/** Run an action through the reducer, persisting only when it produced a change. */\nasync function executeReducerAction(\n store: TaskStore,\n action: ReducerAction,\n params: TaskMutationParams,\n): Promise<ToolResult> {\n const { document, value } = await store.mutate((current) => {\n const result = applyTaskMutation(current, action, params);\n return {\n ...(isCommittingOp(result.op) ? { document: result.document } : {}),\n value: result,\n };\n });\n if (value.op.kind === 'error') throw actionableTaskError(action, value.op.message);\n // An upsert that applied nothing is a failed call: it wrote nothing and left\n // `rev` alone, so it must not read to the model as a success. A batch where\n // some entries landed returns normally — that is what partial apply means.\n if (value.op.kind === 'upsert' && value.op.applied === 0) {\n throw actionableTaskError(action, formatUpsertFailureText(value.op));\n }\n // `document` is the committed document, so `details.rev` matches what landed\n // on disk; `value.document` is the pre-write copy and lags by one.\n return buildToolResult(action, params, document, value.op);\n}\n\nexport function registerTaskTool(pi: ExtensionAPI, dependencies: TaskToolDependencies): void {\n const { store, delegation } = dependencies;\n\n pi.registerTool({\n name: TOOL_NAME,\n label: TOOL_LABEL,\n description:\n 'Manage a shared task list for tracking multi-step progress, and delegate tasks to subagents. Actions: upsert (write tasks — a tasks[] array where an entry with an id changes that task and an entry without an id creates one, so one call can capture a whole plan), list, get, delete (tombstone), clear (close/reset the list), assign (hand the task to a named subagent that works it in the background), cancel (stop a delegated run). upsert applies each entry independently: successes are committed and failures are reported by array index, and an entry can depend on a task created by an earlier entry in the same call via a ref. Batch when writing a plan down; report progress one task at a time. Status: pending → in_progress → completed, plus failed and a deleted tombstone. The list is shared within the current session tree, including delegated subagents, while unrelated sessions start empty. Session stores persist until retention cleanup.',\n promptSnippet: DEFAULT_PROMPT_SNIPPET,\n promptGuidelines: DEFAULT_PROMPT_GUIDELINES,\n parameters: TaskParamsSchema,\n\n async execute(_toolCallId, params, signal, onUpdate, _ctx) {\n const action = params.action as TaskAction;\n const mutationParams = params as TaskMutationParams;\n\n try {\n rejectStrayFields(action, mutationParams);\n if (REDUCER_ACTIONS.has(action)) {\n const result = await executeReducerAction(store, action as ReducerAction, mutationParams);\n dependencies.onChange?.();\n return result;\n }\n\n let outcome: DelegationOutcome;\n if (action === 'assign') {\n onUpdate?.(\n buildTextResult(\n action,\n mutationParams,\n store.snapshot,\n `Delegating task #${mutationParams.id ?? 'unknown'}...`,\n ),\n );\n outcome = await delegation.assign(mutationParams.id ?? Number.NaN, {\n agent: mutationParams.agent,\n inlineAgent: mutationParams.inlineAgent,\n instructions: mutationParams.instructions,\n relevantFiles: mutationParams.relevantFiles,\n priorFindings: mutationParams.priorFindings,\n model: mutationParams.model,\n context: mutationParams.context,\n signal,\n });\n } else {\n onUpdate?.(\n buildTextResult(\n action,\n mutationParams,\n store.snapshot,\n `Requesting cancellation for task #${mutationParams.id ?? 'unknown'}...`,\n ),\n );\n outcome = await delegation.cancel(mutationParams.id ?? Number.NaN);\n }\n\n dependencies.onChange?.();\n if (!outcome.ok) throw actionableTaskError(action, outcome.message);\n return buildTextResult(action, mutationParams, store.snapshot, outcome.message, undefined);\n } catch (error) {\n // Rethrown so pi still renders the failure to the model; recorded\n // because this is where a store fault becomes visible to the user.\n dependencies.report?.error(TASK_EVENT.toolFailed, error, {\n [ACTION_ATTRIBUTE]: action,\n ...(mutationParams.id === undefined ? {} : { [TASK_ID_ATTRIBUTE]: mutationParams.id }),\n });\n if (error instanceof TaskToolExecutionError) throw error;\n throw actionableTaskError(action, error instanceof Error ? error.message : String(error));\n }\n },\n\n // Render hooks receive no session identity, so they read the store snapshot\n // that the executing session last loaded. That is the foreground session's\n // own view, which is exactly what its transcript should show.\n renderCall(args, theme, _context) {\n return renderTaskCall(args as never, theme, store.snapshot.tasks);\n },\n\n renderResult(result, options, theme, _context) {\n return renderTaskResult(result, options, theme);\n },\n });\n}\n"],"mappings":"iRAkBa,EACX,0FAYI,EAAkB,IAAI,IAAgB,CAAC,SAAU,OAAQ,MAAO,SAAU,OAAO,CAAC,EAExF,IAAM,EAAN,cAAqC,KAAM,CAAC,EAE5C,SAAS,EAAoB,EAAoB,EAAyC,CACxF,OAAO,IAAI,EACT,CACE,QAAQ,EAAO,WAAW,IAC1B,GACA,WACA,2EACA,8DACA,4EACF,CAAC,CAAC,KAAK;CAAI,CACb,CACF,CASA,SAAS,EAAkB,EAAoB,EAAkC,CAC/E,IAAM,EAAQ,OAAO,KAAK,CAAM,CAAC,CAAC,OAAQ,GAAQ,EAAO,KAAS,IAAA,IAAa,CAACA,EAAAA,uBAAuB,EAAQ,CAAG,CAAC,EACnH,GAAI,EAAM,SAAW,EAAG,OACxB,IAAM,EAAO,IAAW,SAAW,IAAIC,EAAAA,6BAA+B,GACtE,MAAM,EAAoB,EAAQ,GAAG,EAAO,mBAAmB,EAAM,KAAK,IAAI,EAAE,GAAG,GAAM,CAC3F,CAGA,eAAe,EACb,EACA,EACA,EACqB,CACrB,GAAM,CAAE,WAAU,SAAU,MAAM,EAAM,OAAQ,GAAY,CAC1D,IAAM,EAASC,EAAAA,kBAAkB,EAAS,EAAQ,CAAM,EACxD,MAAO,CACL,GAAIC,EAAAA,eAAe,EAAO,EAAE,EAAI,CAAE,SAAU,EAAO,QAAS,EAAI,CAAC,EACjE,MAAO,CACT,CACF,CAAC,EACD,GAAI,EAAM,GAAG,OAAS,QAAS,MAAM,EAAoB,EAAQ,EAAM,GAAG,OAAO,EAIjF,GAAI,EAAM,GAAG,OAAS,UAAY,EAAM,GAAG,UAAY,EACrD,MAAM,EAAoB,EAAQC,EAAAA,wBAAwB,EAAM,EAAE,CAAC,EAIrE,OAAOC,EAAAA,gBAA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B,EAAe,EAAG,CACtF,CAAC,EACG,aAAiB,EAA8B,EAC7C,EAAoB,EAAQ,aAAiB,MAAQ,EAAM,QAAU,OAAO,CAAK,CAAC,CAC1F,CACF,EAKA,WAAW,EAAM,EAAO,EAAU,CAChC,OAAOC,EAAAA,eAAe,EAAe,EAAO,EAAM,SAAS,KAAK,CAClE,EAEA,aAAa,EAAQ,EAAS,EAAO,EAAU,CAC7C,OAAOC,EAAAA,iBAAiB,EAAQ,EAAS,CAAK,CAChD,CACF,CAAC,CACH"}
|
package/dist/tool/taskTool.d.cts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { TaskFailureReporter } from "../logSinkTelemetry.cjs";
|
|
2
|
-
import { TaskStore } from "../store/taskStore.cjs";
|
|
3
|
-
import { DelegationManager } from "../delegation/manager.cjs";
|
|
4
|
-
import { DEFAULT_PROMPT_GUIDELINES } from "./promptGuidelines.cjs";
|
|
5
|
-
import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
6
|
-
//#region src/tool/taskTool.d.ts
|
|
7
|
-
declare const DEFAULT_PROMPT_SNIPPET = "Manage a shared task list to track multi-step progress, and delegate tasks to subagents";
|
|
8
|
-
interface TaskToolDependencies {
|
|
9
|
-
store: TaskStore;
|
|
10
|
-
delegation: DelegationManager;
|
|
11
|
-
onChange?: () => void;
|
|
12
|
-
report?: TaskFailureReporter;
|
|
13
|
-
}
|
|
14
|
-
declare function registerTaskTool(pi: ExtensionAPI, dependencies: TaskToolDependencies): void;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { DEFAULT_PROMPT_GUIDELINES, DEFAULT_PROMPT_SNIPPET, TaskToolDependencies, registerTaskTool };
|
|
17
|
-
//# sourceMappingURL=taskTool.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taskTool.d.cts","names":[],"sources":["../../src/tool/taskTool.ts"],"mappings":";;;;;;cAkBa;UAGI;EACf,OAAO;EACP,YAAY;EACZ;EACA,SAAS;;iBA8DK,iBAAiB,IAAI,cAAc,cAAc"}
|
package/dist/tool/taskTool.d.mts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { TaskFailureReporter } from "../logSinkTelemetry.mjs";
|
|
2
|
-
import { TaskStore } from "../store/taskStore.mjs";
|
|
3
|
-
import { DelegationManager } from "../delegation/manager.mjs";
|
|
4
|
-
import { DEFAULT_PROMPT_GUIDELINES } from "./promptGuidelines.mjs";
|
|
5
|
-
import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
6
|
-
//#region src/tool/taskTool.d.ts
|
|
7
|
-
declare const DEFAULT_PROMPT_SNIPPET = "Manage a shared task list to track multi-step progress, and delegate tasks to subagents";
|
|
8
|
-
interface TaskToolDependencies {
|
|
9
|
-
store: TaskStore;
|
|
10
|
-
delegation: DelegationManager;
|
|
11
|
-
onChange?: () => void;
|
|
12
|
-
report?: TaskFailureReporter;
|
|
13
|
-
}
|
|
14
|
-
declare function registerTaskTool(pi: ExtensionAPI, dependencies: TaskToolDependencies): void;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { DEFAULT_PROMPT_GUIDELINES, DEFAULT_PROMPT_SNIPPET, TaskToolDependencies, registerTaskTool };
|
|
17
|
-
//# sourceMappingURL=taskTool.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taskTool.d.mts","names":[],"sources":["../../src/tool/taskTool.ts"],"mappings":";;;;;;cAkBa;UAGI;EACf,OAAO;EACP,YAAY;EACZ;EACA,SAAS;;iBA8DK,iBAAiB,IAAI,cAAc,cAAc"}
|
package/dist/tool/taskTool.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{TASK_EVENT as e}from"../logSinkTelemetry.mjs";import{MSG_UPSERT_FIELD_MISPLACED as t,TOOL_LABEL as n,TOOL_NAME as r,TaskParamsSchema as i,taskActionAcceptsField as a}from"./schema.mjs";import{applyTaskMutation as o,isCommittingOp as s}from"../store/reducer.mjs";import{renderTaskCall as c,renderTaskResult as l}from"../tui/format.mjs";import{buildTextResult as u,buildToolResult as d,formatUpsertFailureText as f}from"./responseEnvelope.mjs";import{DEFAULT_PROMPT_GUIDELINES as p}from"./promptGuidelines.mjs";const m=`Manage a shared task list to track multi-step progress, and delegate tasks to subagents`,h=new Set([`upsert`,`list`,`get`,`delete`,`clear`]);var g=class extends Error{};function _(e,t){return new g([`Task ${e} failed: ${t}`,``,`Options:`,`- List the task board and inspect the current ids, states, and blockers.`,`- Correct the arguments or state conflict, then retry once.`,`- Ask the user before cancelling work or changing dependencies to recover.`].join(`
|
|
2
|
-
`))}function v(e,n){let r=Object.keys(n).filter(t=>n[t]!==void 0&&!a(e,t));if(r.length===0)return;let i=e===`upsert`?` ${t}`:``;throw _(e,`${e} does not accept ${r.join(`, `)}.${i}`)}async function y(e,t,n){let{document:r,value:i}=await e.mutate(e=>{let r=o(e,t,n);return{...s(r.op)?{document:r.document}:{},value:r}});if(i.op.kind===`error`)throw _(t,i.op.message);if(i.op.kind===`upsert`&&i.op.applied===0)throw _(t,f(i.op));return d(t,n,r,i.op)}function b(t,a){let{store:o,delegation:s}=a;t.registerTool({name:r,label:n,description:`Manage a shared task list for tracking multi-step progress, and delegate tasks to subagents. Actions: upsert (write tasks — a tasks[] array where an entry with an id changes that task and an entry without an id creates one, so one call can capture a whole plan), list, get, delete (tombstone), clear (close/reset the list), assign (hand the task to a named subagent that works it in the background), cancel (stop a delegated run). upsert applies each entry independently: successes are committed and failures are reported by array index, and an entry can depend on a task created by an earlier entry in the same call via a ref. Batch when writing a plan down; report progress one task at a time. Status: pending → in_progress → completed, plus failed and a deleted tombstone. The list is shared within the current session tree, including delegated subagents, while unrelated sessions start empty. Session stores persist until retention cleanup.`,promptSnippet:m,promptGuidelines:p,parameters:i,async execute(t,n,r,i,c){let l=n.action,d=n;try{if(v(l,d),h.has(l)){let e=await y(o,l,d);return a.onChange?.(),e}let e;if(l===`assign`?(i?.(u(l,d,o.snapshot,`Delegating task #${d.id??`unknown`}...`)),e=await s.assign(d.id??NaN,{agent:d.agent,inlineAgent:d.inlineAgent,instructions:d.instructions,relevantFiles:d.relevantFiles,priorFindings:d.priorFindings,model:d.model,context:d.context,signal:r})):(i?.(u(l,d,o.snapshot,`Requesting cancellation for task #${d.id??`unknown`}...`)),e=await s.cancel(d.id??NaN)),a.onChange?.(),!e.ok)throw _(l,e.message);return u(l,d,o.snapshot,e.message,void 0)}catch(t){throw a.report?.error(e.toolFailed,t,{"tool.action":l,...d.id===void 0?{}:{"task.id":d.id}}),t instanceof g?t:_(l,t instanceof Error?t.message:String(t))}},renderCall(e,t,n){return c(e,t,o.snapshot.tasks)},renderResult(e,t,n,r){return l(e,t,n)}})}export{p as DEFAULT_PROMPT_GUIDELINES,m as DEFAULT_PROMPT_SNIPPET,b as registerTaskTool};
|
|
3
|
-
//# sourceMappingURL=taskTool.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taskTool.mjs","names":[],"sources":["../../src/tool/taskTool.ts"],"sourcesContent":["import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';\nimport type { DelegationManager, DelegationOutcome } from '../delegation/manager.ts';\nimport { TASK_EVENT, type TaskFailureReporter } from '../logSinkTelemetry.ts';\nimport { applyTaskMutation, isCommittingOp, type ReducerAction } from '../store/reducer.ts';\nimport type { TaskStore } from '../store/taskStore.ts';\nimport type { TaskAction, TaskMutationParams } from '../store/types.ts';\nimport { renderTaskCall, renderTaskResult } from '../tui/format.ts';\nimport { buildTextResult, buildToolResult, formatUpsertFailureText, type ToolResult } from './responseEnvelope.ts';\nimport {\n MSG_UPSERT_FIELD_MISPLACED,\n TOOL_LABEL,\n TOOL_NAME,\n TaskParamsSchema,\n taskActionAcceptsField,\n} from './schema.ts';\nimport { DEFAULT_PROMPT_GUIDELINES } from './promptGuidelines.ts';\nexport { DEFAULT_PROMPT_GUIDELINES } from './promptGuidelines.ts';\n\nexport const DEFAULT_PROMPT_SNIPPET =\n 'Manage a shared task list to track multi-step progress, and delegate tasks to subagents';\n\nexport interface TaskToolDependencies {\n store: TaskStore;\n delegation: DelegationManager;\n onChange?: () => void;\n report?: TaskFailureReporter;\n}\n\nconst ACTION_ATTRIBUTE = 'tool.action';\nconst TASK_ID_ATTRIBUTE = 'task.id';\n\nconst REDUCER_ACTIONS = new Set<TaskAction>(['upsert', 'list', 'get', 'delete', 'clear']);\n\nclass TaskToolExecutionError extends Error {}\n\nfunction actionableTaskError(action: TaskAction, message: string): TaskToolExecutionError {\n return new TaskToolExecutionError(\n [\n `Task ${action} failed: ${message}`,\n '',\n 'Options:',\n '- List the task board and inspect the current ids, states, and blockers.',\n '- Correct the arguments or state conflict, then retry once.',\n '- Ask the user before cancelling work or changing dependencies to recover.',\n ].join('\\n'),\n );\n}\n\n/**\n * Reject a field that belongs to a different action.\n *\n * The params schema is flat and shared across every action, so this is the only\n * place `{\"action\":\"upsert\",\"id\":3}` can be caught — and it must be, because\n * the entry it carries has no id and would silently create a duplicate task.\n */\nfunction rejectStrayFields(action: TaskAction, params: TaskMutationParams): void {\n const stray = Object.keys(params).filter((key) => params[key] !== undefined && !taskActionAcceptsField(action, key));\n if (stray.length === 0) return;\n const hint = action === 'upsert' ? ` ${MSG_UPSERT_FIELD_MISPLACED}` : '';\n throw actionableTaskError(action, `${action} does not accept ${stray.join(', ')}.${hint}`);\n}\n\n/** Run an action through the reducer, persisting only when it produced a change. */\nasync function executeReducerAction(\n store: TaskStore,\n action: ReducerAction,\n params: TaskMutationParams,\n): Promise<ToolResult> {\n const { document, value } = await store.mutate((current) => {\n const result = applyTaskMutation(current, action, params);\n return {\n ...(isCommittingOp(result.op) ? { document: result.document } : {}),\n value: result,\n };\n });\n if (value.op.kind === 'error') throw actionableTaskError(action, value.op.message);\n // An upsert that applied nothing is a failed call: it wrote nothing and left\n // `rev` alone, so it must not read to the model as a success. A batch where\n // some entries landed returns normally — that is what partial apply means.\n if (value.op.kind === 'upsert' && value.op.applied === 0) {\n throw actionableTaskError(action, formatUpsertFailureText(value.op));\n }\n // `document` is the committed document, so `details.rev` matches what landed\n // on disk; `value.document` is the pre-write copy and lags by one.\n return buildToolResult(action, params, document, value.op);\n}\n\nexport function registerTaskTool(pi: ExtensionAPI, dependencies: TaskToolDependencies): void {\n const { store, delegation } = dependencies;\n\n pi.registerTool({\n name: TOOL_NAME,\n label: TOOL_LABEL,\n description:\n 'Manage a shared task list for tracking multi-step progress, and delegate tasks to subagents. Actions: upsert (write tasks — a tasks[] array where an entry with an id changes that task and an entry without an id creates one, so one call can capture a whole plan), list, get, delete (tombstone), clear (close/reset the list), assign (hand the task to a named subagent that works it in the background), cancel (stop a delegated run). upsert applies each entry independently: successes are committed and failures are reported by array index, and an entry can depend on a task created by an earlier entry in the same call via a ref. Batch when writing a plan down; report progress one task at a time. Status: pending → in_progress → completed, plus failed and a deleted tombstone. The list is shared within the current session tree, including delegated subagents, while unrelated sessions start empty. Session stores persist until retention cleanup.',\n promptSnippet: DEFAULT_PROMPT_SNIPPET,\n promptGuidelines: DEFAULT_PROMPT_GUIDELINES,\n parameters: TaskParamsSchema,\n\n async execute(_toolCallId, params, signal, onUpdate, _ctx) {\n const action = params.action as TaskAction;\n const mutationParams = params as TaskMutationParams;\n\n try {\n rejectStrayFields(action, mutationParams);\n if (REDUCER_ACTIONS.has(action)) {\n const result = await executeReducerAction(store, action as ReducerAction, mutationParams);\n dependencies.onChange?.();\n return result;\n }\n\n let outcome: DelegationOutcome;\n if (action === 'assign') {\n onUpdate?.(\n buildTextResult(\n action,\n mutationParams,\n store.snapshot,\n `Delegating task #${mutationParams.id ?? 'unknown'}...`,\n ),\n );\n outcome = await delegation.assign(mutationParams.id ?? Number.NaN, {\n agent: mutationParams.agent,\n inlineAgent: mutationParams.inlineAgent,\n instructions: mutationParams.instructions,\n relevantFiles: mutationParams.relevantFiles,\n priorFindings: mutationParams.priorFindings,\n model: mutationParams.model,\n context: mutationParams.context,\n signal,\n });\n } else {\n onUpdate?.(\n buildTextResult(\n action,\n mutationParams,\n store.snapshot,\n `Requesting cancellation for task #${mutationParams.id ?? 'unknown'}...`,\n ),\n );\n outcome = await delegation.cancel(mutationParams.id ?? Number.NaN);\n }\n\n dependencies.onChange?.();\n if (!outcome.ok) throw actionableTaskError(action, outcome.message);\n return buildTextResult(action, mutationParams, store.snapshot, outcome.message, undefined);\n } catch (error) {\n // Rethrown so pi still renders the failure to the model; recorded\n // because this is where a store fault becomes visible to the user.\n dependencies.report?.error(TASK_EVENT.toolFailed, error, {\n [ACTION_ATTRIBUTE]: action,\n ...(mutationParams.id === undefined ? {} : { [TASK_ID_ATTRIBUTE]: mutationParams.id }),\n });\n if (error instanceof TaskToolExecutionError) throw error;\n throw actionableTaskError(action, error instanceof Error ? error.message : String(error));\n }\n },\n\n // Render hooks receive no session identity, so they read the store snapshot\n // that the executing session last loaded. That is the foreground session's\n // own view, which is exactly what its transcript should show.\n renderCall(args, theme, _context) {\n return renderTaskCall(args as never, theme, store.snapshot.tasks);\n },\n\n renderResult(result, options, theme, _context) {\n return renderTaskResult(result, options, theme);\n },\n });\n}\n"],"mappings":"ogBAkBA,MAAa,EACX,0FAYI,EAAkB,IAAI,IAAgB,CAAC,SAAU,OAAQ,MAAO,SAAU,OAAO,CAAC,EAExF,IAAM,EAAN,cAAqC,KAAM,CAAC,EAE5C,SAAS,EAAoB,EAAoB,EAAyC,CACxF,OAAO,IAAI,EACT,CACE,QAAQ,EAAO,WAAW,IAC1B,GACA,WACA,2EACA,8DACA,4EACF,CAAC,CAAC,KAAK;CAAI,CACb,CACF,CASA,SAAS,EAAkB,EAAoB,EAAkC,CAC/E,IAAM,EAAQ,OAAO,KAAK,CAAM,CAAC,CAAC,OAAQ,GAAQ,EAAO,KAAS,IAAA,IAAa,CAAC,EAAuB,EAAQ,CAAG,CAAC,EACnH,GAAI,EAAM,SAAW,EAAG,OACxB,IAAM,EAAO,IAAW,SAAW,IAAI,IAA+B,GACtE,MAAM,EAAoB,EAAQ,GAAG,EAAO,mBA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F,CAAC,IAED,IACE,EACE,EACA,EACA,EAAM,SACN,qCAAqC,EAAe,IAAM,UAAU,IACtE,CACF,EACA,EAAU,MAAM,EAAW,OAAO,EAAe,IAAM,GAAU,GAGnE,EAAa,WAAW,EACpB,CAAC,EAAQ,GAAI,MAAM,EAAoB,EAAQ,EAAQ,OAAO,EAClE,OAAO,EAAgB,EAAQ,EAAgB,EAAM,SAAU,EAAQ,QAAS,IAAA,EAAS,CAC3F,OAAS,EAAO,CAQd,MALA,EAAa,QAAQ,MAAM,EAAW,WAAY,EAAO,CACtD,cAAmB,EACpB,GAAI,EAAe,KAAO,IAAA,GAAY,CAAC,EAAI,CAAG,UAAoB,EAAe,EAAG,CACtF,CAAC,EACG,aAAiB,EAA8B,EAC7C,EAAoB,EAAQ,aAAiB,MAAQ,EAAM,QAAU,OAAO,CAAK,CAAC,CAC1F,CACF,EAKA,WAAW,EAAM,EAAO,EAAU,CAChC,OAAO,EAAe,EAAe,EAAO,EAAM,SAAS,KAAK,CAClE,EAEA,aAAa,EAAQ,EAAS,EAAO,EAAU,CAC7C,OAAO,EAAiB,EAAQ,EAAS,CAAK,CAChD,CACF,CAAC,CACH"}
|
package/dist/tui/format.cjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../delegation/manager.cjs");let t=require("@earendil-works/pi-tui"),n=require("@agimon-ai/doompi-ui/theme");const r={pending:`○`,in_progress:`◐`,completed:`●`,failed:`✗`,deleted:`⊘`},i={pending:`dim`,in_progress:`warning`,completed:`success`,failed:`error`,deleted:`muted`},a={pending:`pending`,in_progress:`in progress`,completed:`completed`,failed:`failed`,deleted:`deleted`},o={...r,completed:`✓`,deleted:r.failed},s={...i,deleted:`error`},c=1e3,l={upsert:`✎`,delete:`×`,get:`›`,list:`☰`,clear:`∅`,assign:`⇒`,cancel:`⊗`};function u(e){return e.length===0?l.upsert:e.every(e=>e.id===void 0)?`+`:e.every(e=>e.id!==void 0)?`→`:l.upsert}function d(e,t){return t.fg(s[e],o[e])}function f(e){let t=Math.max(0,Math.floor(e/1e3)),n=t%60,r=Math.floor(t/60);if(r<60)return r===0?`${n}s`:`${r}m${String(n).padStart(2,`0`)}s`;let i=r%60;return`${Math.floor(r/60)}h${String(i).padStart(2,`0`)}m${String(n).padStart(2,`0`)}s`}function p(e){let t=Math.max(0,Math.round(e));return t<c?String(t):t<1e4?`${(t/c).toFixed(1)}k`:`${Math.round(t/c)}k`}function m(t,r,i,a,o=Date.now()){let s=t.status===`in_progress`?`accent`:t.status===`completed`||t.status===`deleted`?`muted`:`text`,c=r.fg(s,t.subject);(t.status===`completed`||t.status===`deleted`)&&(c=r.strikethrough(c));let l=d(t.status,r);i&&(l+=` ${r.fg(`dim`,`#${t.id}`)}`),l+=` ${c}`;let u=t.delegation?.agent;if(u&&t.delegation?.state===`running`){let i=[];a&&(i.push(r.fg(`muted`,`[${f(e.DelegationManager.elapsedMs(a,o))}]`)),a.tokens!==void 0&&i.push(r.fg(`muted`,`[${p(a.tokens)}]`))),i.push(r.fg((0,n.agentIdentityColor)(t.delegation.runId??t.delegation.requestId),`[${u}]`)),l+=` ${i.join(``)}`,a?.currentTool&&(l+=` ${r.fg(`muted`,`· ${a.currentTool}`)}`)}else u&&(l+=` ${r.fg(`muted`,`[${u}]`)}`);return t.status===`in_progress`&&t.activeForm&&(l+=` ${r.fg(`muted`,`(${t.activeForm})`)}`),t.blockedBy?.length&&(l+=` ${r.fg(`muted`,`⛓ ${t.blockedBy.map(e=>`#${e}`).join(`,`)}`)}`),l}function h(e,t){let n=e.status===`in_progress`&&e.activeForm?` (${e.activeForm})`:``,r=e.delegation?.agent?` [${e.delegation.agent}]`:``,i=e.blockedBy?.length?` ⛓ ${e.blockedBy.map(e=>`#${e}`).join(`,`)}`:``;return` ${t} #${e.id} ${e.subject}${n}${r}${i}`}function g(e,n,r){let i=e.action===`upsert`?e.tasks??[]:[],o=e.action===`upsert`?u(i):l[e.action]??e.action,s=n.fg(`toolTitle`,n.bold(`task `))+n.fg(`muted`,o);if(e.action===`upsert`){if(i.length===1){let e=i[0];if(e.id===void 0)e.subject&&(s+=` ${n.fg(`dim`,e.subject)}`);else{let t=r.find(t=>t.id===e.id)?.subject??e.subject??`#${e.id}`;s+=` ${n.fg(`accent`,t)}`}}else i.length>1&&(s+=` ${n.fg(`dim`,`${i.length} tasks`)}`)}else if(e.action===`assign`&&e.id!==void 0){let t=r.find(t=>t.id===e.id)?.subject??`#${e.id}`;s+=` ${n.fg(`accent`,t)}`,e.agent&&(s+=` ${n.fg(`muted`,`→ ${e.agent}`)}`)}else if((e.action===`get`||e.action===`delete`||e.action===`cancel`)&&e.id!==void 0){let t=r.find(t=>t.id===e.id)?.subject??`#${e.id}`;s+=` ${n.fg(`accent`,t)}`}else e.action===`list`&&e.status&&(s+=` ${n.fg(`muted`,a[e.status])}`);return new t.Text(s,0,0)}var _=class{rows;constructor(e){this.rows=e}invalidate(){}render(e){return this.rows.map(({left:n,right:r})=>{if(r===void 0||r.length===0)return(0,t.truncateToWidth)(n,e);let i=(0,t.visibleWidth)(r),a=e-i-2;if(a<=0)return(0,t.truncateToWidth)(n,e);let o=(0,t.truncateToWidth)(n,a),s=Math.max(2,e-(0,t.visibleWidth)(o)-i);return o+` `.repeat(s)+r})}};function v(e){return(e.content??[]).map(e=>e.text??``).join(``)}function y(e){return e.split(`
|
|
2
|
-
`).filter(e=>e.trim().length>0)}function b(e){let t=e.params,n=e.tasks;return t.includeDeleted!==!0&&(n=n.filter(e=>e.status!==`deleted`)),t.status&&(n=n.filter(e=>e.status===t.status)),n}function x(e){let t=e.params;if(t.id!==void 0)return e.tasks.find(e=>e.id===t.id)}function S(e){return(e.upsert?.applied??[]).flatMap(t=>e.tasks.find(e=>e.id===t)??[])}function C(e,n,r){let o=e.details;if(n.isPartial){let n=y(v(e)).at(-1)??`working`;return new t.Text(r.fg(`warning`,`◐`)+r.fg(`dim`,` ${n}`),0,0)}if(e.isError===!0||o?.error!==void 0){let i=y(o?.error??v(e));if(i.length<=1)return new t.Text(r.fg(`error`,`✗`)+r.fg(`dim`,i[0]?` ${i[0]}`:``),0,0);let a=n.expanded?i:i.slice(0,8);return new t.Text([...a.map(e=>r.fg(`toolOutput`,e)),r.fg(`error`,`✗`)].join(`
|
|
3
|
-
`),0,0)}if(!o)return new t.Text(r.fg(`success`,`✓`),0,0);let s=e=>({left:m(e,r,!0),right:r.fg(i[e.status],a[e.status])});if(o.action===`list`){let e=b(o),t=n.expanded?e:e.slice(0,8),i=t.map(s),a=e.length===0?`no tasks`:`${e.length} task${e.length===1?``:`s`}`;return e.length>t.length&&(a+=` · ctrl+o`),i.push({left:r.fg(`success`,`✓`)+r.fg(`dim`,` ${a}`)}),new _(i)}if(o.action===`clear`)return new t.Text(r.fg(`success`,`✓`)+r.fg(`dim`,` cleared`),0,0);if(o.action===`upsert`){let e=S(o),t=o.upsert?.failed??0;if(e.length===1&&t===0)return new _([s(e[0])]);let i=n.expanded?e:e.slice(0,8),a=i.map(s),c=`${e.length} applied`;t>0&&(c+=` · ${t} failed`),e.length>i.length&&(c+=` · ctrl+o`);let l=t>0?r.fg(`warning`,`!`):r.fg(`success`,`✓`);return a.push({left:l+r.fg(`dim`,` ${c}`)}),new _(a)}let c=x(o);return c?new _([s(c)]):new t.Text(r.fg(`success`,`✓`),0,0)}exports.ACTION_GLYPH=l,exports.JustifiedRows=_,exports.STATUS_COLOR=i,exports.STATUS_GLYPH=r,exports.STATUS_LABEL=a,exports.formatCommandTaskLine=h,exports.formatElapsedMs=f,exports.formatOverlayTaskLine=m,exports.formatTokenCount=p,exports.overlayStatusGlyph=d,exports.renderTaskCall=g,exports.renderTaskResult=C;
|
|
4
|
-
//# sourceMappingURL=format.cjs.map
|