@agimon-ai/doompi-task 0.0.1-alpha.7 → 0.0.1-alpha.70
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 +114 -15
- package/dist/api-contracts.cjs +1 -0
- package/dist/api-contracts.d.cts +2 -0
- package/dist/api-contracts.d.mts +2 -0
- package/dist/api-contracts.mjs +1 -0
- package/dist/commands.cjs +1 -2
- package/dist/commands.d.cts +2 -14
- package/dist/commands.d.mts +2 -14
- package/dist/commands.mjs +1 -2
- package/dist/config.cjs +1 -2
- package/dist/config.d.cts +2 -38
- package/dist/config.d.mts +2 -38
- package/dist/config.mjs +1 -2
- package/dist/constants/promptGuidelines.cjs +2 -0
- package/dist/constants/promptGuidelines.cjs.map +1 -0
- package/dist/constants/promptGuidelines.d.cts +13 -0
- package/dist/constants/promptGuidelines.d.cts.map +1 -0
- package/dist/constants/promptGuidelines.d.mts +13 -0
- package/dist/constants/promptGuidelines.d.mts.map +1 -0
- package/dist/constants/promptGuidelines.mjs +2 -0
- package/dist/constants/promptGuidelines.mjs.map +1 -0
- package/dist/constants/task.cjs +2 -0
- package/dist/constants/task.cjs.map +1 -0
- package/dist/constants/task.d.cts +4 -0
- package/dist/constants/task.d.cts.map +1 -0
- package/dist/constants/task.d.mts +4 -0
- package/dist/constants/task.d.mts.map +1 -0
- package/dist/constants/task.mjs +2 -0
- package/dist/constants/task.mjs.map +1 -0
- package/dist/controllers/tasksCommand.cjs +2 -0
- package/dist/controllers/tasksCommand.cjs.map +1 -0
- package/dist/controllers/tasksCommand.d.cts +15 -0
- package/dist/controllers/tasksCommand.d.cts.map +1 -0
- package/dist/controllers/tasksCommand.d.mts +15 -0
- package/dist/controllers/tasksCommand.d.mts.map +1 -0
- package/dist/controllers/tasksCommand.mjs +2 -0
- package/dist/controllers/tasksCommand.mjs.map +1 -0
- package/dist/controllers/webTasksChannel.cjs +2 -0
- package/dist/controllers/webTasksChannel.cjs.map +1 -0
- package/dist/controllers/webTasksChannel.mjs +2 -0
- package/dist/controllers/webTasksChannel.mjs.map +1 -0
- package/dist/delegation-manager.cjs +1 -0
- package/dist/delegation-manager.d.cts +3 -0
- package/dist/delegation-manager.d.mts +3 -0
- package/dist/delegation-manager.mjs +1 -0
- package/dist/extensions/pi.cjs +2 -1
- package/dist/extensions/pi.cjs.map +1 -1
- package/dist/extensions/pi.d.cts +6 -2
- package/dist/extensions/pi.d.cts.map +1 -0
- package/dist/extensions/pi.d.mts +6 -2
- package/dist/extensions/pi.d.mts.map +1 -0
- package/dist/extensions/pi.mjs +2 -1
- package/dist/extensions/pi.mjs.map +1 -1
- package/dist/extensions/server.cjs +2 -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 +2 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +15 -14
- package/dist/index.d.mts +15 -14
- package/dist/index.mjs +1 -1
- package/dist/logSinkTelemetry.cjs +1 -2
- package/dist/logSinkTelemetry.d.cts +3 -51
- package/dist/logSinkTelemetry.d.mts +3 -51
- package/dist/logSinkTelemetry.mjs +1 -2
- package/dist/models/task.cjs +2 -0
- package/dist/models/task.cjs.map +1 -0
- package/dist/{store/types.d.cts → models/task.d.cts} +41 -30
- package/dist/models/task.d.cts.map +1 -0
- package/dist/{store/types.d.mts → models/task.d.mts} +41 -30
- package/dist/models/task.d.mts.map +1 -0
- package/dist/{store/types.mjs → models/task.mjs} +1 -1
- package/dist/models/task.mjs.map +1 -0
- package/dist/models/taskGraph.cjs +2 -0
- package/dist/models/taskGraph.cjs.map +1 -0
- package/dist/{store → models}/taskGraph.d.cts +7 -8
- package/dist/models/taskGraph.d.cts.map +1 -0
- package/dist/{store → models}/taskGraph.d.mts +7 -8
- package/dist/models/taskGraph.d.mts.map +1 -0
- package/dist/models/taskGraph.mjs.map +1 -0
- package/dist/schemas/apiContracts.cjs +2 -0
- package/dist/schemas/apiContracts.cjs.map +1 -0
- package/dist/schemas/apiContracts.d.cts +53 -0
- package/dist/schemas/apiContracts.d.cts.map +1 -0
- package/dist/schemas/apiContracts.d.mts +53 -0
- package/dist/schemas/apiContracts.d.mts.map +1 -0
- package/dist/schemas/apiContracts.mjs +2 -0
- package/dist/schemas/apiContracts.mjs.map +1 -0
- package/dist/schemas/task.cjs +2 -0
- package/dist/schemas/task.cjs.map +1 -0
- package/dist/{tool/schema.d.cts → schemas/task.d.cts} +46 -29
- package/dist/schemas/task.d.cts.map +1 -0
- package/dist/{tool/schema.d.mts → schemas/task.d.mts} +46 -29
- package/dist/schemas/task.d.mts.map +1 -0
- package/dist/schemas/task.mjs +2 -0
- package/dist/schemas/task.mjs.map +1 -0
- package/dist/services/config/index.cjs +2 -0
- package/dist/services/config/index.cjs.map +1 -0
- package/dist/services/config/index.d.cts +42 -0
- package/dist/services/config/index.d.cts.map +1 -0
- package/dist/services/config/index.d.mts +42 -0
- package/dist/services/config/index.d.mts.map +1 -0
- package/dist/services/config/index.mjs +2 -0
- package/dist/services/config/index.mjs.map +1 -0
- package/dist/services/contextContribution/index.cjs +3 -0
- package/dist/services/contextContribution/index.cjs.map +1 -0
- package/dist/services/contextContribution/index.mjs +3 -0
- package/dist/services/contextContribution/index.mjs.map +1 -0
- package/dist/services/delegation/index.cjs +6 -0
- package/dist/services/delegation/index.cjs.map +1 -0
- package/dist/{delegation/manager.d.cts → services/delegation/index.d.cts} +52 -49
- package/dist/services/delegation/index.d.cts.map +1 -0
- package/dist/{delegation/manager.d.mts → services/delegation/index.d.mts} +52 -49
- package/dist/services/delegation/index.d.mts.map +1 -0
- package/dist/services/delegation/index.mjs +6 -0
- package/dist/services/delegation/index.mjs.map +1 -0
- package/dist/services/delegationPlatform/index.cjs +2 -0
- package/dist/services/delegationPlatform/index.cjs.map +1 -0
- package/dist/services/delegationPlatform/index.mjs +2 -0
- package/dist/services/delegationPlatform/index.mjs.map +1 -0
- package/dist/services/invariants/index.cjs +2 -0
- package/dist/services/invariants/index.cjs.map +1 -0
- package/dist/services/invariants/index.d.cts +23 -0
- package/dist/services/invariants/index.d.cts.map +1 -0
- package/dist/services/invariants/index.d.mts +23 -0
- package/dist/services/invariants/index.d.mts.map +1 -0
- package/dist/services/invariants/index.mjs +2 -0
- package/dist/services/invariants/index.mjs.map +1 -0
- package/dist/services/logSinkTelemetry/index.cjs +2 -0
- package/dist/services/logSinkTelemetry/index.cjs.map +1 -0
- package/dist/services/logSinkTelemetry/index.d.cts +23 -0
- package/dist/services/logSinkTelemetry/index.d.cts.map +1 -0
- package/dist/services/logSinkTelemetry/index.d.mts +23 -0
- package/dist/services/logSinkTelemetry/index.d.mts.map +1 -0
- package/dist/services/logSinkTelemetry/index.mjs +2 -0
- package/dist/services/logSinkTelemetry/index.mjs.map +1 -0
- package/dist/services/paths/index.cjs +2 -0
- package/dist/services/paths/index.cjs.map +1 -0
- package/dist/services/paths/index.d.cts +25 -0
- package/dist/services/paths/index.d.cts.map +1 -0
- package/dist/services/paths/index.d.mts +25 -0
- package/dist/services/paths/index.d.mts.map +1 -0
- package/dist/services/paths/index.mjs +2 -0
- package/dist/services/paths/index.mjs.map +1 -0
- package/dist/services/processLiveness/index.cjs +2 -0
- package/dist/services/processLiveness/index.cjs.map +1 -0
- package/dist/{store/processLiveness.d.cts → services/processLiveness/index.d.cts} +3 -4
- package/dist/services/processLiveness/index.d.cts.map +1 -0
- package/dist/{store/processLiveness.d.mts → services/processLiveness/index.d.mts} +3 -4
- package/dist/services/processLiveness/index.d.mts.map +1 -0
- package/dist/{store/processLiveness.mjs → services/processLiveness/index.mjs} +1 -1
- package/dist/services/processLiveness/index.mjs.map +1 -0
- package/dist/services/reconcile/index.cjs +2 -0
- package/dist/services/reconcile/index.cjs.map +1 -0
- package/dist/{store/reconcile.d.cts → services/reconcile/index.d.cts} +8 -9
- package/dist/services/reconcile/index.d.cts.map +1 -0
- package/dist/{store/reconcile.d.mts → services/reconcile/index.d.mts} +8 -9
- package/dist/services/reconcile/index.d.mts.map +1 -0
- package/dist/services/reconcile/index.mjs +2 -0
- package/dist/services/reconcile/index.mjs.map +1 -0
- package/dist/services/reducer/index.cjs +3 -0
- package/dist/services/reducer/index.cjs.map +1 -0
- package/dist/{store/reducer.d.cts → services/reducer/index.d.cts} +12 -13
- package/dist/services/reducer/index.d.cts.map +1 -0
- package/dist/{store/reducer.d.mts → services/reducer/index.d.mts} +12 -13
- package/dist/services/reducer/index.d.mts.map +1 -0
- package/dist/services/reducer/index.mjs +3 -0
- package/dist/services/reducer/index.mjs.map +1 -0
- package/dist/services/taskNarration/index.cjs +2 -0
- package/dist/services/taskNarration/index.cjs.map +1 -0
- package/dist/services/taskNarration/index.mjs +2 -0
- package/dist/services/taskNarration/index.mjs.map +1 -0
- package/dist/services/taskResult/index.cjs +7 -0
- package/dist/services/taskResult/index.cjs.map +1 -0
- package/dist/services/taskResult/index.d.cts +50 -0
- package/dist/services/taskResult/index.d.cts.map +1 -0
- package/dist/services/taskResult/index.d.mts +50 -0
- package/dist/services/taskResult/index.d.mts.map +1 -0
- package/dist/services/taskResult/index.mjs +7 -0
- package/dist/services/taskResult/index.mjs.map +1 -0
- package/dist/services/taskStore/index.cjs +2 -0
- package/dist/services/taskStore/index.cjs.map +1 -0
- package/dist/{store/taskStore.d.cts → services/taskStore/index.d.cts} +17 -25
- package/dist/services/taskStore/index.d.cts.map +1 -0
- package/dist/{store/taskStore.d.mts → services/taskStore/index.d.mts} +17 -25
- package/dist/services/taskStore/index.d.mts.map +1 -0
- package/dist/services/taskStore/index.mjs +2 -0
- package/dist/services/taskStore/index.mjs.map +1 -0
- package/dist/store-invariants.cjs +1 -0
- package/dist/store-invariants.d.cts +2 -0
- package/dist/store-invariants.d.mts +2 -0
- package/dist/store-invariants.mjs +1 -0
- package/dist/store-paths.cjs +1 -0
- package/dist/store-paths.d.cts +2 -0
- package/dist/store-paths.d.mts +2 -0
- package/dist/store-paths.mjs +1 -0
- package/dist/store-process-liveness.cjs +1 -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 +1 -0
- package/dist/store-reconcile.cjs +1 -0
- package/dist/store-reconcile.d.cts +2 -0
- package/dist/store-reconcile.d.mts +2 -0
- package/dist/store-reconcile.mjs +1 -0
- package/dist/store-reducer.cjs +1 -0
- package/dist/store-reducer.d.cts +2 -0
- package/dist/store-reducer.d.mts +2 -0
- package/dist/store-reducer.mjs +1 -0
- package/dist/store-task-graph.cjs +1 -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 +1 -0
- package/dist/store-task-store.cjs +1 -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 +1 -0
- package/dist/store-types.cjs +1 -0
- package/dist/store-types.d.cts +2 -0
- package/dist/store-types.d.mts +2 -0
- package/dist/store-types.mjs +1 -0
- package/dist/tool-prompt-guidelines.cjs +1 -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 +1 -0
- package/dist/tool-response-envelope.cjs +1 -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 +1 -0
- package/dist/tool-schema.cjs +1 -0
- package/dist/tool-schema.d.cts +3 -0
- package/dist/tool-schema.d.mts +3 -0
- package/dist/tool-schema.mjs +1 -0
- package/dist/tool-task-tool.cjs +1 -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 +1 -0
- package/dist/tools/task.cjs +3 -0
- package/dist/tools/task.cjs.map +1 -0
- package/dist/tools/task.d.cts +22 -0
- package/dist/tools/task.d.cts.map +1 -0
- package/dist/tools/task.d.mts +22 -0
- package/dist/tools/task.d.mts.map +1 -0
- package/dist/tools/task.mjs +3 -0
- package/dist/tools/task.mjs.map +1 -0
- package/dist/tui/format.cjs +3 -3
- package/dist/tui/format.cjs.map +1 -1
- package/dist/tui/format.d.cts +19 -20
- package/dist/tui/format.d.cts.map +1 -1
- package/dist/tui/format.d.mts +19 -20
- package/dist/tui/format.d.mts.map +1 -1
- package/dist/tui/format.mjs +3 -3
- package/dist/tui/format.mjs.map +1 -1
- package/dist/tui/selectors.cjs +1 -1
- package/dist/tui/selectors.cjs.map +1 -1
- package/dist/tui/selectors.d.cts +20 -14
- package/dist/tui/selectors.d.cts.map +1 -1
- package/dist/tui/selectors.d.mts +20 -14
- package/dist/tui/selectors.d.mts.map +1 -1
- package/dist/tui/selectors.mjs +1 -1
- package/dist/tui/selectors.mjs.map +1 -1
- package/dist/tui/taskOverlay.cjs +1 -1
- package/dist/tui/taskOverlay.cjs.map +1 -1
- package/dist/tui/taskOverlay.d.cts +4 -5
- package/dist/tui/taskOverlay.d.cts.map +1 -1
- package/dist/tui/taskOverlay.d.mts +4 -5
- package/dist/tui/taskOverlay.d.mts.map +1 -1
- package/dist/tui/taskOverlay.mjs +1 -1
- package/dist/tui/taskOverlay.mjs.map +1 -1
- package/dist/tui/taskSpace.cjs +3 -3
- package/dist/tui/taskSpace.cjs.map +1 -1
- package/dist/tui/taskSpace.d.cts +9 -10
- package/dist/tui/taskSpace.d.cts.map +1 -1
- package/dist/tui/taskSpace.d.mts +9 -10
- package/dist/tui/taskSpace.d.mts.map +1 -1
- package/dist/tui/taskSpace.mjs +3 -3
- package/dist/tui/taskSpace.mjs.map +1 -1
- package/dist/tui-format.cjs +1 -0
- package/dist/tui-format.d.cts +2 -0
- package/dist/tui-format.d.mts +2 -0
- package/dist/tui-format.mjs +1 -0
- package/dist/tui-selectors.cjs +1 -0
- package/dist/tui-selectors.d.cts +2 -0
- package/dist/tui-selectors.d.mts +2 -0
- package/dist/tui-selectors.mjs +1 -0
- package/dist/tui-task-overlay.cjs +1 -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 +1 -0
- package/dist/tui-task-space.cjs +1 -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 +1 -0
- package/dist/types/delegation.cjs +2 -0
- package/dist/types/delegation.cjs.map +1 -0
- package/dist/types/delegation.d.cts +5 -0
- package/dist/types/delegation.d.cts.map +1 -0
- package/dist/types/delegation.d.mts +5 -0
- package/dist/types/delegation.d.mts.map +1 -0
- package/dist/types/delegation.mjs +2 -0
- package/dist/types/delegation.mjs.map +1 -0
- package/dist/types/telemetry.cjs +2 -0
- package/dist/types/telemetry.cjs.map +1 -0
- package/dist/types/telemetry.d.cts +35 -0
- package/dist/types/telemetry.d.cts.map +1 -0
- package/dist/types/telemetry.d.mts +35 -0
- package/dist/types/telemetry.d.mts.map +1 -0
- package/dist/types/telemetry.mjs +2 -0
- package/dist/types/telemetry.mjs.map +1 -0
- package/dist/types/webTasks.cjs +2 -0
- package/dist/types/webTasks.cjs.map +1 -0
- package/dist/types/webTasks.mjs +2 -0
- package/dist/types/webTasks.mjs.map +1 -0
- package/package.json +158 -109
- package/src/extensions/web.ts +18 -0
- package/src/types/webTasks.ts +24 -0
- package/src/web/components/TaskDetailDialog.tsx +251 -0
- package/src/web/components/TaskToolMessage.tsx +120 -0
- package/src/web/components/TasksActivitySection.tsx +200 -0
- package/src/web/lib/taskToolFormat.ts +330 -0
- package/src/web/stores/tasksStore.ts +114 -0
- package/src/web/tsconfig.json +23 -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.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.cjs.map +0 -1
- package/dist/store/taskGraph.d.cts.map +0 -1
- package/dist/store/taskGraph.d.mts.map +0 -1
- package/dist/store/taskGraph.mjs.map +0 -1
- 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.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/{store → models}/taskGraph.mjs +0 -0
package/README.md
CHANGED
|
@@ -1,35 +1,134 @@
|
|
|
1
1
|
# @agimon-ai/doompi-task
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Track persistent, dependency-aware tasks in Pi and optionally delegate them through DoomPi Team.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
compaction because the store is on disk rather than in the transcript.
|
|
5
|
+
Part of the [DoomPi distribution](https://www.npmjs.com/package/@agimon-ai/doompi).
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
Task owns task records and `tasks.json`. Team owns agents and runs. When both are loaded, Task delegates pending work through Team without merging their stored state.
|
|
8
|
+
|
|
9
|
+
> **Alpha:** task and delegation contracts may change between releases.
|
|
10
|
+
|
|
11
|
+
## Requirements
|
|
12
|
+
|
|
13
|
+
- Node.js 22.19.0 or newer
|
|
14
|
+
- Pi 0.85.0 and Pi TUI 0.85.0
|
|
11
15
|
|
|
12
16
|
## Install
|
|
13
17
|
|
|
18
|
+
Define a layer and select it in `.doom/modes.yaml`:
|
|
19
|
+
|
|
20
|
+
```yaml
|
|
21
|
+
layers:
|
|
22
|
+
task:
|
|
23
|
+
packages: ['@agimon-ai/doompi-task']
|
|
24
|
+
|
|
25
|
+
majorMode:
|
|
26
|
+
minimal:
|
|
27
|
+
description: Lean mode with persistent tasks.
|
|
28
|
+
layers: [task]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
For standalone Pi:
|
|
32
|
+
|
|
14
33
|
```bash
|
|
15
|
-
|
|
34
|
+
pi install npm:@agimon-ai/doompi-task
|
|
16
35
|
```
|
|
17
36
|
|
|
18
|
-
|
|
37
|
+
Task works without Team for local graph management. Add `@agimon-ai/doompi-team` to the same
|
|
38
|
+
selected mode when `assign` and `cancel` should launch or control subagents.
|
|
19
39
|
|
|
20
|
-
|
|
21
|
-
`.doom/modes.yaml`: making it optional would only create broken configurations.
|
|
40
|
+
## Use the `task` tool
|
|
22
41
|
|
|
23
|
-
|
|
42
|
+
Supported actions are:
|
|
24
43
|
|
|
25
|
-
|
|
44
|
+
| Action | Purpose |
|
|
45
|
+
| ------------- | ------------------------------------------------------------------ |
|
|
46
|
+
| `upsert` | Create tasks or update status, metadata, dependencies, and details |
|
|
47
|
+
| `list`, `get` | Read the graph or one task |
|
|
48
|
+
| `delete` | Tombstone a task |
|
|
49
|
+
| `clear` | Close and reset the graph after active delegations stop |
|
|
50
|
+
| `assign` | Delegate a pending, unblocked task through Team |
|
|
51
|
+
| `cancel` | Stop a delegated run and return its task to pending |
|
|
26
52
|
|
|
27
|
-
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"action": "upsert",
|
|
56
|
+
"tasks": [
|
|
57
|
+
{ "ref": "design", "subject": "Design the API" },
|
|
58
|
+
{
|
|
59
|
+
"subject": "Implement the API",
|
|
60
|
+
"blockedBy": ["design"]
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The reducer enforces lifecycle transitions and rejects dependency cycles. A graph allows 15
|
|
67
|
+
non-deleted tasks by default; updates still apply when full, but new tasks are rejected until space
|
|
68
|
+
is freed.
|
|
69
|
+
|
|
70
|
+
## TUI
|
|
71
|
+
|
|
72
|
+
Use `/tasks` or `SPC t l` to open the interactive task view. These surfaces require a TUI. The
|
|
73
|
+
`task` tool remains available in headless sessions.
|
|
74
|
+
|
|
75
|
+
## Storage and cleanup
|
|
76
|
+
|
|
77
|
+
The default session-tree store is:
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
~/.pi/agent/doom-task/<session>/tasks.json
|
|
81
|
+
```
|
|
28
82
|
|
|
29
|
-
|
|
83
|
+
Task is authoritative across transcript compaction because the graph is file-backed. This does not
|
|
84
|
+
mean Task persists Team membership, intercom, or child-process state.
|
|
30
85
|
|
|
31
|
-
|
|
86
|
+
Defaults and overrides:
|
|
87
|
+
|
|
88
|
+
| Setting | Default | Purpose |
|
|
89
|
+
| --------------------------------- | -------------- | ------------------------------------------ |
|
|
90
|
+
| `DOOM_TASK_MAX_TASKS` | `15` | Maximum non-deleted tasks |
|
|
91
|
+
| `DOOM_TASK_STORE_TTL_MS` | 30 days | Retention for inactive session-tree stores |
|
|
92
|
+
| `DOOM_TASK_DELEGATION_TIMEOUT_MS` | 20 minutes | Delegated-run result timeout |
|
|
93
|
+
| `DOOM_TASK_STORE` | Unset | Override the complete store file path |
|
|
94
|
+
| `DOOM_TASK_COLLAPSE_KEY` | `ctrl+shift+t` | Override the task-view collapse key |
|
|
95
|
+
|
|
96
|
+
Startup reconciliation removes expired stores and repairs delegation records whose owning process
|
|
97
|
+
is no longer live.
|
|
98
|
+
|
|
99
|
+
## Task and Team together
|
|
100
|
+
|
|
101
|
+
Task uses Team's delegation service and records its lifecycle events on the task. It also contributes
|
|
102
|
+
pending assignments through `doom/background-work`. Team discovers the selected agent, applies
|
|
103
|
+
model and tool policy, owns the run, and returns completion or failure. If Team unloads or is
|
|
104
|
+
replaced, both connections are removed and rebound without leaving a process-global registration.
|
|
105
|
+
Intercom and Team membership remain Team state; `tasks.json` remains Task state.
|
|
106
|
+
|
|
107
|
+
## Public API
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
import { detectCycle, isBlocked, TaskStore, taskExtension } from '@agimon-ai/doompi-task';
|
|
111
|
+
import type { Task, TaskStatus } from '@agimon-ai/doompi-task';
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Focused subpaths include `/tool/schema`, `/store/reducer`, `/store/taskStore`,
|
|
115
|
+
`/delegation/manager`, and `/tui/selectors`. Pi loads `/extensions/pi` through package metadata.
|
|
116
|
+
|
|
117
|
+
## Development
|
|
118
|
+
|
|
119
|
+
Run from this package directory in the workspace:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
pnpm build
|
|
123
|
+
pnpm typecheck
|
|
124
|
+
pnpm test
|
|
125
|
+
pnpm lint
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Maintained by [Agimon](https://agimon.ai/about).
|
|
32
129
|
|
|
33
130
|
## License
|
|
34
131
|
|
|
35
132
|
MIT
|
|
133
|
+
|
|
134
|
+
Named Pi and server factories live in `src/extensions`. Controllers declare commands, tools consume services, and `models` contains the durable task document types and graph. Services own persistence, delegation, and configuration. Public entries are flat files in `src/exports`, with flat package subpaths. Pi shutdown aborts the factory signal to fence pending session initialization immediately; idempotent `onStop` and `onDispose` cleanup awaits pending work before disposing the store and telemetry.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./schemas/apiContracts.cjs");exports.apiContracts=e.apiContracts,exports.default=e.apiContracts;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{apiContracts as e}from"./schemas/apiContracts.mjs";export{e as apiContracts,e as default};
|
package/dist/commands.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./
|
|
2
|
-
//# sourceMappingURL=commands.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./controllers/tasksCommand.cjs");exports.createTasksCommand=e.createTasksCommand;
|
package/dist/commands.d.cts
CHANGED
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/commands.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* `/tasks`, reachable from the leader palette as `SPC t t`.
|
|
6
|
-
*
|
|
7
|
-
* The command opens the Task Space overlay rather than printing a listing: the
|
|
8
|
-
* overlay is the readable surface and it can edit, while a transcript dump could
|
|
9
|
-
* only be read.
|
|
10
|
-
*/
|
|
11
|
-
declare function registerTasksCommand(pi: ExtensionAPI, store: TaskStore): void;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { registerTasksCommand };
|
|
14
|
-
//# sourceMappingURL=commands.d.cts.map
|
|
1
|
+
import { createTasksCommand } from "./controllers/tasksCommand.cjs";
|
|
2
|
+
export { createTasksCommand };
|
package/dist/commands.d.mts
CHANGED
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/commands.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* `/tasks`, reachable from the leader palette as `SPC t t`.
|
|
6
|
-
*
|
|
7
|
-
* The command opens the Task Space overlay rather than printing a listing: the
|
|
8
|
-
* overlay is the readable surface and it can edit, while a transcript dump could
|
|
9
|
-
* only be read.
|
|
10
|
-
*/
|
|
11
|
-
declare function registerTasksCommand(pi: ExtensionAPI, store: TaskStore): void;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { registerTasksCommand };
|
|
14
|
-
//# sourceMappingURL=commands.d.mts.map
|
|
1
|
+
import { createTasksCommand } from "./controllers/tasksCommand.mjs";
|
|
2
|
+
export { createTasksCommand };
|
package/dist/commands.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=commands.mjs.map
|
|
1
|
+
import{createTasksCommand as e}from"./controllers/tasksCommand.mjs";export{e as createTasksCommand};
|
package/dist/config.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e
|
|
2
|
-
//# sourceMappingURL=config.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./services/config/index.cjs");exports.COLLAPSE_KEY_ENV=e.COLLAPSE_KEY_ENV,exports.COLLAPSE_KEY_OFF=e.COLLAPSE_KEY_OFF,exports.DEFAULT_COLLAPSE_KEY=e.DEFAULT_COLLAPSE_KEY,exports.DEFAULT_DELEGATION_TIMEOUT_MS=e.DEFAULT_DELEGATION_TIMEOUT_MS,exports.DEFAULT_MAX_TASKS=e.DEFAULT_MAX_TASKS,exports.DEFAULT_MAX_WIDGET_LINES=e.DEFAULT_MAX_WIDGET_LINES,exports.DEFAULT_STORE_TTL_MS=e.DEFAULT_STORE_TTL_MS,exports.DELEGATION_TIMEOUT_MS_ENV=e.DELEGATION_TIMEOUT_MS_ENV,exports.MAX_TASKS_ENV=e.MAX_TASKS_ENV,exports.MAX_WIDGET_LINES_ENV=e.MAX_WIDGET_LINES_ENV,exports.STORE_TTL_MS_ENV=e.STORE_TTL_MS_ENV,exports.getDelegationTimeoutMs=e.getDelegationTimeoutMs,exports.getMaxTasks=e.getMaxTasks,exports.getMaxWidgetLines=e.getMaxWidgetLines,exports.getStoreTtlMs=e.getStoreTtlMs,exports.parsePiTaskConfig=e.parsePiTaskConfig,exports.resolveCollapseKey=e.resolveCollapseKey;
|
package/dist/config.d.cts
CHANGED
|
@@ -1,38 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Extension configuration, read from the environment.
|
|
4
|
-
*
|
|
5
|
-
* Env rather than a config file: doom-pi already carries per-launch state to Pi
|
|
6
|
-
* through env vars, so this keeps doom-task consistent with how the harness
|
|
7
|
-
* configures the rest of the extension set.
|
|
8
|
-
*/
|
|
9
|
-
declare const MAX_WIDGET_LINES_ENV = "DOOM_TASK_MAX_WIDGET_LINES";
|
|
10
|
-
declare const COLLAPSE_KEY_ENV = "DOOM_TASK_COLLAPSE_KEY";
|
|
11
|
-
declare const STORE_TTL_MS_ENV = "DOOM_TASK_STORE_TTL_MS";
|
|
12
|
-
declare const DELEGATION_TIMEOUT_MS_ENV = "DOOM_TASK_DELEGATION_TIMEOUT_MS";
|
|
13
|
-
declare const DEFAULT_MAX_WIDGET_LINES = 12;
|
|
14
|
-
declare const DEFAULT_COLLAPSE_KEY = "ctrl+shift+t";
|
|
15
|
-
declare const DEFAULT_STORE_TTL_MS: number;
|
|
16
|
-
/** Deliberately under the subagents auto-drain ceiling (30 min) so a headless
|
|
17
|
-
* session still gets the failure and a model turn before draining gives up. */
|
|
18
|
-
declare const DEFAULT_DELEGATION_TIMEOUT_MS: number;
|
|
19
|
-
declare const COLLAPSE_KEY_OFF = "off";
|
|
20
|
-
interface PiTaskConfig {
|
|
21
|
-
maxWidgetLines: number;
|
|
22
|
-
storeTtlMs: number;
|
|
23
|
-
collapseKey: string;
|
|
24
|
-
delegationTimeoutMs: number;
|
|
25
|
-
}
|
|
26
|
-
/** Parse configuration only after the Pi host has applied its project-trust policy. */
|
|
27
|
-
declare function parsePiTaskConfig(value: unknown): PiTaskConfig;
|
|
28
|
-
/** Rows the overlay may use for content, clamped to a sane range. */
|
|
29
|
-
declare function getMaxWidgetLines(env?: NodeJS.ProcessEnv): number;
|
|
30
|
-
/** Retention window for inactive session-tree stores. */
|
|
31
|
-
declare function getStoreTtlMs(env?: NodeJS.ProcessEnv): number;
|
|
32
|
-
/** How long a delegated run may go without reporting a result. */
|
|
33
|
-
declare function getDelegationTimeoutMs(env?: NodeJS.ProcessEnv): number;
|
|
34
|
-
/** Collapse shortcut, or the `off` sentinel when the user disabled it. */
|
|
35
|
-
declare function resolveCollapseKey(env?: NodeJS.ProcessEnv): string;
|
|
36
|
-
//#endregion
|
|
37
|
-
export { COLLAPSE_KEY_ENV, COLLAPSE_KEY_OFF, DEFAULT_COLLAPSE_KEY, DEFAULT_DELEGATION_TIMEOUT_MS, DEFAULT_MAX_WIDGET_LINES, DEFAULT_STORE_TTL_MS, DELEGATION_TIMEOUT_MS_ENV, MAX_WIDGET_LINES_ENV, PiTaskConfig, STORE_TTL_MS_ENV, getDelegationTimeoutMs, getMaxWidgetLines, getStoreTtlMs, parsePiTaskConfig, resolveCollapseKey };
|
|
38
|
-
//# sourceMappingURL=config.d.cts.map
|
|
1
|
+
import { COLLAPSE_KEY_ENV, COLLAPSE_KEY_OFF, DEFAULT_COLLAPSE_KEY, DEFAULT_DELEGATION_TIMEOUT_MS, DEFAULT_MAX_TASKS, DEFAULT_MAX_WIDGET_LINES, DEFAULT_STORE_TTL_MS, DELEGATION_TIMEOUT_MS_ENV, MAX_TASKS_ENV, MAX_WIDGET_LINES_ENV, PiTaskConfig, STORE_TTL_MS_ENV, getDelegationTimeoutMs, getMaxTasks, getMaxWidgetLines, getStoreTtlMs, parsePiTaskConfig, resolveCollapseKey } from "./services/config/index.cjs";
|
|
2
|
+
export { COLLAPSE_KEY_ENV, COLLAPSE_KEY_OFF, DEFAULT_COLLAPSE_KEY, DEFAULT_DELEGATION_TIMEOUT_MS, DEFAULT_MAX_TASKS, DEFAULT_MAX_WIDGET_LINES, DEFAULT_STORE_TTL_MS, DELEGATION_TIMEOUT_MS_ENV, MAX_TASKS_ENV, MAX_WIDGET_LINES_ENV, PiTaskConfig, STORE_TTL_MS_ENV, getDelegationTimeoutMs, getMaxTasks, getMaxWidgetLines, getStoreTtlMs, parsePiTaskConfig, resolveCollapseKey };
|
package/dist/config.d.mts
CHANGED
|
@@ -1,38 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Extension configuration, read from the environment.
|
|
4
|
-
*
|
|
5
|
-
* Env rather than a config file: doom-pi already carries per-launch state to Pi
|
|
6
|
-
* through env vars, so this keeps doom-task consistent with how the harness
|
|
7
|
-
* configures the rest of the extension set.
|
|
8
|
-
*/
|
|
9
|
-
declare const MAX_WIDGET_LINES_ENV = "DOOM_TASK_MAX_WIDGET_LINES";
|
|
10
|
-
declare const COLLAPSE_KEY_ENV = "DOOM_TASK_COLLAPSE_KEY";
|
|
11
|
-
declare const STORE_TTL_MS_ENV = "DOOM_TASK_STORE_TTL_MS";
|
|
12
|
-
declare const DELEGATION_TIMEOUT_MS_ENV = "DOOM_TASK_DELEGATION_TIMEOUT_MS";
|
|
13
|
-
declare const DEFAULT_MAX_WIDGET_LINES = 12;
|
|
14
|
-
declare const DEFAULT_COLLAPSE_KEY = "ctrl+shift+t";
|
|
15
|
-
declare const DEFAULT_STORE_TTL_MS: number;
|
|
16
|
-
/** Deliberately under the subagents auto-drain ceiling (30 min) so a headless
|
|
17
|
-
* session still gets the failure and a model turn before draining gives up. */
|
|
18
|
-
declare const DEFAULT_DELEGATION_TIMEOUT_MS: number;
|
|
19
|
-
declare const COLLAPSE_KEY_OFF = "off";
|
|
20
|
-
interface PiTaskConfig {
|
|
21
|
-
maxWidgetLines: number;
|
|
22
|
-
storeTtlMs: number;
|
|
23
|
-
collapseKey: string;
|
|
24
|
-
delegationTimeoutMs: number;
|
|
25
|
-
}
|
|
26
|
-
/** Parse configuration only after the Pi host has applied its project-trust policy. */
|
|
27
|
-
declare function parsePiTaskConfig(value: unknown): PiTaskConfig;
|
|
28
|
-
/** Rows the overlay may use for content, clamped to a sane range. */
|
|
29
|
-
declare function getMaxWidgetLines(env?: NodeJS.ProcessEnv): number;
|
|
30
|
-
/** Retention window for inactive session-tree stores. */
|
|
31
|
-
declare function getStoreTtlMs(env?: NodeJS.ProcessEnv): number;
|
|
32
|
-
/** How long a delegated run may go without reporting a result. */
|
|
33
|
-
declare function getDelegationTimeoutMs(env?: NodeJS.ProcessEnv): number;
|
|
34
|
-
/** Collapse shortcut, or the `off` sentinel when the user disabled it. */
|
|
35
|
-
declare function resolveCollapseKey(env?: NodeJS.ProcessEnv): string;
|
|
36
|
-
//#endregion
|
|
37
|
-
export { COLLAPSE_KEY_ENV, COLLAPSE_KEY_OFF, DEFAULT_COLLAPSE_KEY, DEFAULT_DELEGATION_TIMEOUT_MS, DEFAULT_MAX_WIDGET_LINES, DEFAULT_STORE_TTL_MS, DELEGATION_TIMEOUT_MS_ENV, MAX_WIDGET_LINES_ENV, PiTaskConfig, STORE_TTL_MS_ENV, getDelegationTimeoutMs, getMaxWidgetLines, getStoreTtlMs, parsePiTaskConfig, resolveCollapseKey };
|
|
38
|
-
//# sourceMappingURL=config.d.mts.map
|
|
1
|
+
import { COLLAPSE_KEY_ENV, COLLAPSE_KEY_OFF, DEFAULT_COLLAPSE_KEY, DEFAULT_DELEGATION_TIMEOUT_MS, DEFAULT_MAX_TASKS, DEFAULT_MAX_WIDGET_LINES, DEFAULT_STORE_TTL_MS, DELEGATION_TIMEOUT_MS_ENV, MAX_TASKS_ENV, MAX_WIDGET_LINES_ENV, PiTaskConfig, STORE_TTL_MS_ENV, getDelegationTimeoutMs, getMaxTasks, getMaxWidgetLines, getStoreTtlMs, parsePiTaskConfig, resolveCollapseKey } from "./services/config/index.mjs";
|
|
2
|
+
export { COLLAPSE_KEY_ENV, COLLAPSE_KEY_OFF, DEFAULT_COLLAPSE_KEY, DEFAULT_DELEGATION_TIMEOUT_MS, DEFAULT_MAX_TASKS, DEFAULT_MAX_WIDGET_LINES, DEFAULT_STORE_TTL_MS, DELEGATION_TIMEOUT_MS_ENV, MAX_TASKS_ENV, MAX_WIDGET_LINES_ENV, PiTaskConfig, STORE_TTL_MS_ENV, getDelegationTimeoutMs, getMaxTasks, getMaxWidgetLines, getStoreTtlMs, parsePiTaskConfig, resolveCollapseKey };
|
package/dist/config.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=config.mjs.map
|
|
1
|
+
import{COLLAPSE_KEY_ENV as e,COLLAPSE_KEY_OFF as t,DEFAULT_COLLAPSE_KEY as n,DEFAULT_DELEGATION_TIMEOUT_MS as r,DEFAULT_MAX_TASKS as i,DEFAULT_MAX_WIDGET_LINES as a,DEFAULT_STORE_TTL_MS as o,DELEGATION_TIMEOUT_MS_ENV as s,MAX_TASKS_ENV as c,MAX_WIDGET_LINES_ENV as l,STORE_TTL_MS_ENV as u,getDelegationTimeoutMs as d,getMaxTasks as f,getMaxWidgetLines as p,getStoreTtlMs as m,parsePiTaskConfig as h,resolveCollapseKey as g}from"./services/config/index.mjs";export{e as COLLAPSE_KEY_ENV,t as COLLAPSE_KEY_OFF,n as DEFAULT_COLLAPSE_KEY,r as DEFAULT_DELEGATION_TIMEOUT_MS,i as DEFAULT_MAX_TASKS,a as DEFAULT_MAX_WIDGET_LINES,o as DEFAULT_STORE_TTL_MS,s as DELEGATION_TIMEOUT_MS_ENV,c as MAX_TASKS_ENV,l as MAX_WIDGET_LINES_ENV,u as STORE_TTL_MS_ENV,d as getDelegationTimeoutMs,f as getMaxTasks,p as getMaxWidgetLines,m as getStoreTtlMs,h as parsePiTaskConfig,g as resolveCollapseKey};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=[`Batch the whole plan in one upsert: {"action":"upsert","tasks":[{"subject":"Research the store"},{"subject":"Write the reducer"}]}. Report progress one call at a time: mark a task in_progress before you start it and completed the moment it lands, never batched at the end of a turn. Keep one task in_progress for your own work; delegated tasks run in parallel and do not count.`,`Never mark a task completed while tests fail or the work is partial. Use failed, or keep it in_progress and add a task for the blocker in the same upsert.`,`When every non-deleted task is completed, review the list once and call {"action":"clear"}.`,`Status flow: pending, in_progress, completed. failed is recoverable, deleted is a tombstone. Pass activeForm (e.g. 'writing tests') when marking in_progress.`,`upsert applies each entry independently: passing entries commit and failures are reported by array index. Resend only the corrected failures, because resending an applied entry with no id creates a duplicate task.`,`Apply the session delegation criteria before choosing what to delegate, then call subagent {"action":"agents"} and use an exact discovered name. Prefer a general-purpose write-capable agent such as delegate or worker when no specialist fits, and use a focused inlineAgent only for read-only work.`,`Assign through assignments[] even for a single task: {"action":"assign","assignments":[{"id":1,"agent":"researcher"}]}. Put independent ready tasks in one batch rather than repeated calls or multi_tool, and do not start a direct subagent run for work already on the task list. Successful entries keep running when another entry fails, so retry only the failures.`,`Fill relevantFiles only with files you actually read or located, and priorFindings only with verified facts in a few lines, not directives. A guessed path costs more than an omitted one.`,`Subject stays short and imperative. description is the durable brief handed to the subagent, extended at assign time by instructions, relevantFiles and priorFindings, so do not repeat one in the other.`,`When a delegated task completes and unblocks another, reconsider it promptly. If a child asks for a decision or an assignment fails to start, respond, rescope or retry instead of leaving it pending. Doom Task records delegated lifecycle and results on the task itself.`];exports.DEFAULT_PROMPT_GUIDELINES=e;
|
|
2
|
+
//# sourceMappingURL=promptGuidelines.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptGuidelines.cjs","names":[],"sources":["../../src/constants/promptGuidelines.ts"],"sourcesContent":["/**\n * Cross-call behaviour the schema cannot express.\n *\n * Every rule lives in exactly one surface. Argument-site mechanics belong to\n * the parameter descriptions in `schemas/task.ts`, the use/do-not-use policy\n * and session scoping belong to the tool description, and general delegation\n * judgement belongs to the Team orchestrator prompt. What is left here is what\n * none of those three can carry: how calls should be sequenced across a turn.\n */\nexport const DEFAULT_PROMPT_GUIDELINES: string[] = [\n 'Batch the whole plan in one upsert: {\"action\":\"upsert\",\"tasks\":[{\"subject\":\"Research the store\"},{\"subject\":\"Write the reducer\"}]}. Report progress one call at a time: mark a task in_progress before you start it and completed the moment it lands, never batched at the end of a turn. Keep one task in_progress for your own work; delegated tasks run in parallel and do not count.',\n 'Never mark a task completed while tests fail or the work is partial. Use failed, or keep it in_progress and add a task for the blocker in the same upsert.',\n 'When every non-deleted task is completed, review the list once and call {\"action\":\"clear\"}.',\n \"Status flow: pending, in_progress, completed. failed is recoverable, deleted is a tombstone. Pass activeForm (e.g. 'writing tests') when marking in_progress.\",\n 'upsert applies each entry independently: passing entries commit and failures are reported by array index. Resend only the corrected failures, because resending an applied entry with no id creates a duplicate task.',\n 'Apply the session delegation criteria before choosing what to delegate, then call subagent {\"action\":\"agents\"} and use an exact discovered name. Prefer a general-purpose write-capable agent such as delegate or worker when no specialist fits, and use a focused inlineAgent only for read-only work.',\n 'Assign through assignments[] even for a single task: {\"action\":\"assign\",\"assignments\":[{\"id\":1,\"agent\":\"researcher\"}]}. Put independent ready tasks in one batch rather than repeated calls or multi_tool, and do not start a direct subagent run for work already on the task list. Successful entries keep running when another entry fails, so retry only the failures.',\n 'Fill relevantFiles only with files you actually read or located, and priorFindings only with verified facts in a few lines, not directives. A guessed path costs more than an omitted one.',\n 'Subject stays short and imperative. description is the durable brief handed to the subagent, extended at assign time by instructions, relevantFiles and priorFindings, so do not repeat one in the other.',\n 'When a delegated task completes and unblocks another, reconsider it promptly. If a child asks for a decision or an assignment fails to start, respond, rescope or retry instead of leaving it pending. Doom Task records delegated lifecycle and results on the task itself.',\n];\n"],"mappings":"AASA,MAAa,EAAsC,CACjD,4XACA,6JACA,8FACA,gKACA,wNACA,2SACA,6WACA,6LACA,4MACA,8QACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/constants/promptGuidelines.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Cross-call behaviour the schema cannot express.
|
|
4
|
+
*
|
|
5
|
+
* Every rule lives in exactly one surface. Argument-site mechanics belong to
|
|
6
|
+
* the parameter descriptions in `schemas/task.ts`, the use/do-not-use policy
|
|
7
|
+
* and session scoping belong to the tool description, and general delegation
|
|
8
|
+
* judgement belongs to the Team orchestrator prompt. What is left here is what
|
|
9
|
+
* none of those three can carry: how calls should be sequenced across a turn.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_PROMPT_GUIDELINES: string[];
|
|
12
|
+
//#endregion
|
|
13
|
+
//# sourceMappingURL=promptGuidelines.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptGuidelines.d.cts","names":[],"sources":["../../src/constants/promptGuidelines.ts"],"mappings":";;;;;;;;;;qBASa"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/constants/promptGuidelines.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Cross-call behaviour the schema cannot express.
|
|
4
|
+
*
|
|
5
|
+
* Every rule lives in exactly one surface. Argument-site mechanics belong to
|
|
6
|
+
* the parameter descriptions in `schemas/task.ts`, the use/do-not-use policy
|
|
7
|
+
* and session scoping belong to the tool description, and general delegation
|
|
8
|
+
* judgement belongs to the Team orchestrator prompt. What is left here is what
|
|
9
|
+
* none of those three can carry: how calls should be sequenced across a turn.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_PROMPT_GUIDELINES: string[];
|
|
12
|
+
//#endregion
|
|
13
|
+
//# sourceMappingURL=promptGuidelines.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptGuidelines.d.mts","names":[],"sources":["../../src/constants/promptGuidelines.ts"],"mappings":";;;;;;;;;;qBASa"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=[`Batch the whole plan in one upsert: {"action":"upsert","tasks":[{"subject":"Research the store"},{"subject":"Write the reducer"}]}. Report progress one call at a time: mark a task in_progress before you start it and completed the moment it lands, never batched at the end of a turn. Keep one task in_progress for your own work; delegated tasks run in parallel and do not count.`,`Never mark a task completed while tests fail or the work is partial. Use failed, or keep it in_progress and add a task for the blocker in the same upsert.`,`When every non-deleted task is completed, review the list once and call {"action":"clear"}.`,`Status flow: pending, in_progress, completed. failed is recoverable, deleted is a tombstone. Pass activeForm (e.g. 'writing tests') when marking in_progress.`,`upsert applies each entry independently: passing entries commit and failures are reported by array index. Resend only the corrected failures, because resending an applied entry with no id creates a duplicate task.`,`Apply the session delegation criteria before choosing what to delegate, then call subagent {"action":"agents"} and use an exact discovered name. Prefer a general-purpose write-capable agent such as delegate or worker when no specialist fits, and use a focused inlineAgent only for read-only work.`,`Assign through assignments[] even for a single task: {"action":"assign","assignments":[{"id":1,"agent":"researcher"}]}. Put independent ready tasks in one batch rather than repeated calls or multi_tool, and do not start a direct subagent run for work already on the task list. Successful entries keep running when another entry fails, so retry only the failures.`,`Fill relevantFiles only with files you actually read or located, and priorFindings only with verified facts in a few lines, not directives. A guessed path costs more than an omitted one.`,`Subject stays short and imperative. description is the durable brief handed to the subagent, extended at assign time by instructions, relevantFiles and priorFindings, so do not repeat one in the other.`,`When a delegated task completes and unblocks another, reconsider it promptly. If a child asks for a decision or an assignment fails to start, respond, rescope or retry instead of leaving it pending. Doom Task records delegated lifecycle and results on the task itself.`];export{e as DEFAULT_PROMPT_GUIDELINES};
|
|
2
|
+
//# sourceMappingURL=promptGuidelines.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptGuidelines.mjs","names":[],"sources":["../../src/constants/promptGuidelines.ts"],"sourcesContent":["/**\n * Cross-call behaviour the schema cannot express.\n *\n * Every rule lives in exactly one surface. Argument-site mechanics belong to\n * the parameter descriptions in `schemas/task.ts`, the use/do-not-use policy\n * and session scoping belong to the tool description, and general delegation\n * judgement belongs to the Team orchestrator prompt. What is left here is what\n * none of those three can carry: how calls should be sequenced across a turn.\n */\nexport const DEFAULT_PROMPT_GUIDELINES: string[] = [\n 'Batch the whole plan in one upsert: {\"action\":\"upsert\",\"tasks\":[{\"subject\":\"Research the store\"},{\"subject\":\"Write the reducer\"}]}. Report progress one call at a time: mark a task in_progress before you start it and completed the moment it lands, never batched at the end of a turn. Keep one task in_progress for your own work; delegated tasks run in parallel and do not count.',\n 'Never mark a task completed while tests fail or the work is partial. Use failed, or keep it in_progress and add a task for the blocker in the same upsert.',\n 'When every non-deleted task is completed, review the list once and call {\"action\":\"clear\"}.',\n \"Status flow: pending, in_progress, completed. failed is recoverable, deleted is a tombstone. Pass activeForm (e.g. 'writing tests') when marking in_progress.\",\n 'upsert applies each entry independently: passing entries commit and failures are reported by array index. Resend only the corrected failures, because resending an applied entry with no id creates a duplicate task.',\n 'Apply the session delegation criteria before choosing what to delegate, then call subagent {\"action\":\"agents\"} and use an exact discovered name. Prefer a general-purpose write-capable agent such as delegate or worker when no specialist fits, and use a focused inlineAgent only for read-only work.',\n 'Assign through assignments[] even for a single task: {\"action\":\"assign\",\"assignments\":[{\"id\":1,\"agent\":\"researcher\"}]}. Put independent ready tasks in one batch rather than repeated calls or multi_tool, and do not start a direct subagent run for work already on the task list. Successful entries keep running when another entry fails, so retry only the failures.',\n 'Fill relevantFiles only with files you actually read or located, and priorFindings only with verified facts in a few lines, not directives. A guessed path costs more than an omitted one.',\n 'Subject stays short and imperative. description is the durable brief handed to the subagent, extended at assign time by instructions, relevantFiles and priorFindings, so do not repeat one in the other.',\n 'When a delegated task completes and unblocks another, reconsider it promptly. If a child asks for a decision or an assignment fails to start, respond, rescope or retry instead of leaving it pending. Doom Task records delegated lifecycle and results on the task itself.',\n];\n"],"mappings":"AASA,MAAa,EAAsC,CACjD,4XACA,6JACA,8FACA,gKACA,wNACA,2SACA,6WACA,6LACA,4MACA,8QACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.cjs","names":[],"sources":["../../src/constants/task.ts"],"sourcesContent":["export const COMMAND_NAME = 'tasks';\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.d.cts","names":[],"sources":["../../src/constants/task.ts"],"mappings":";qBAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.d.mts","names":[],"sources":["../../src/constants/task.ts"],"mappings":";qBAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.mjs","names":[],"sources":["../../src/constants/task.ts"],"sourcesContent":["export const COMMAND_NAME = 'tasks';\n"],"mappings":"AAAA,MAAa,EAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../constants/task.cjs"),t=require("../schemas/task.cjs");function n(n,r,i){return[e.COMMAND_NAME,{description:`Open Task Space for this session tree`,handler:async(e,a)=>{if(!a.hasUI){a.ui.notify(t.ERR_REQUIRES_INTERACTIVE,`error`);return}await i?.(a),n.read(),await r(a,{store:n})}}]}exports.createTasksCommand=n;
|
|
2
|
+
//# sourceMappingURL=tasksCommand.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasksCommand.cjs","names":["COMMAND_NAME","ERR_REQUIRES_INTERACTIVE"],"sources":["../../src/controllers/tasksCommand.ts"],"sourcesContent":["import type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';\n\nimport { COMMAND_NAME, ERR_REQUIRES_INTERACTIVE } from '../schemas/task';\nimport type { TaskStore } from '../services/taskStore';\n\n/**\n * `/tasks`, reachable from the leader palette as `SPC t l`.\n *\n * The command opens the Task Space overlay rather than printing a listing: the\n * overlay is the readable surface and it can edit, while a transcript dump could\n * only be read.\n */\nexport function createTasksCommand(\n store: TaskStore,\n openTaskSpace: (context: ExtensionContext, options: { store: TaskStore }) => Promise<void>,\n waitUntilReady?: (context: ExtensionContext) => Promise<void>,\n): readonly [string, Parameters<ExtensionAPI['registerCommand']>[1]] {\n return [\n COMMAND_NAME,\n {\n description: 'Open Task Space for this session tree',\n handler: async (_args, ctx) => {\n if (!ctx.hasUI) {\n ctx.ui.notify(ERR_REQUIRES_INTERACTIVE, 'error');\n return;\n }\n\n await waitUntilReady?.(ctx);\n store.read();\n await openTaskSpace(ctx, { store });\n },\n },\n ];\n}\n"],"mappings":"0EAYA,SAAgB,EACd,EACA,EACA,EACmE,CACnE,MAAO,CACLA,EAAAA,aACA,CACE,YAAa,wCACb,QAAS,MAAO,EAAO,IAAQ,CAC7B,GAAI,CAAC,EAAI,MAAO,CACd,EAAI,GAAG,OAAOC,EAAAA,yBAA0B,OAAO,EAC/C,MACF,CAEA,MAAM,IAAiB,CAAG,EAC1B,EAAM,KAAK,EACX,MAAM,EAAc,EAAK,CAAE,OAAM,CAAC,CACpC,CACF,CACF,CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TaskStore } from "../services/taskStore/index.cjs";
|
|
2
|
+
import { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
//#region src/controllers/tasksCommand.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* `/tasks`, reachable from the leader palette as `SPC t l`.
|
|
6
|
+
*
|
|
7
|
+
* The command opens the Task Space overlay rather than printing a listing: the
|
|
8
|
+
* overlay is the readable surface and it can edit, while a transcript dump could
|
|
9
|
+
* only be read.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createTasksCommand(store: TaskStore, openTaskSpace: (context: ExtensionContext, options: {
|
|
12
|
+
store: TaskStore;
|
|
13
|
+
}) => Promise<void>, waitUntilReady?: (context: ExtensionContext) => Promise<void>): readonly [string, Parameters<ExtensionAPI['registerCommand']>[1]];
|
|
14
|
+
//#endregion
|
|
15
|
+
//# sourceMappingURL=tasksCommand.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasksCommand.d.cts","names":[],"sources":["../../src/controllers/tasksCommand.ts"],"mappings":";;;;;;;;;;wBAYgB,mBACd,OAAO,WACP,gBAAgB,SAAS,kBAAkB;EAAW,OAAO;MAAgB,eAC7E,kBAAkB,SAAS,qBAAqB,kCAC7B,WAAW"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TaskStore } from "../services/taskStore/index.mjs";
|
|
2
|
+
import { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
//#region src/controllers/tasksCommand.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* `/tasks`, reachable from the leader palette as `SPC t l`.
|
|
6
|
+
*
|
|
7
|
+
* The command opens the Task Space overlay rather than printing a listing: the
|
|
8
|
+
* overlay is the readable surface and it can edit, while a transcript dump could
|
|
9
|
+
* only be read.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createTasksCommand(store: TaskStore, openTaskSpace: (context: ExtensionContext, options: {
|
|
12
|
+
store: TaskStore;
|
|
13
|
+
}) => Promise<void>, waitUntilReady?: (context: ExtensionContext) => Promise<void>): readonly [string, Parameters<ExtensionAPI['registerCommand']>[1]];
|
|
14
|
+
//#endregion
|
|
15
|
+
//# sourceMappingURL=tasksCommand.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasksCommand.d.mts","names":[],"sources":["../../src/controllers/tasksCommand.ts"],"mappings":";;;;;;;;;;wBAYgB,mBACd,OAAO,WACP,gBAAgB,SAAS,kBAAkB;EAAW,OAAO;MAAgB,eAC7E,kBAAkB,SAAS,qBAAqB,kCAC7B,WAAW"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{COMMAND_NAME as e}from"../constants/task.mjs";import{ERR_REQUIRES_INTERACTIVE as t}from"../schemas/task.mjs";function n(n,r,i){return[e,{description:`Open Task Space for this session tree`,handler:async(e,a)=>{if(!a.hasUI){a.ui.notify(t,`error`);return}await i?.(a),n.read(),await r(a,{store:n})}}]}export{n as createTasksCommand};
|
|
2
|
+
//# sourceMappingURL=tasksCommand.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasksCommand.mjs","names":[],"sources":["../../src/controllers/tasksCommand.ts"],"sourcesContent":["import type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';\n\nimport { COMMAND_NAME, ERR_REQUIRES_INTERACTIVE } from '../schemas/task';\nimport type { TaskStore } from '../services/taskStore';\n\n/**\n * `/tasks`, reachable from the leader palette as `SPC t l`.\n *\n * The command opens the Task Space overlay rather than printing a listing: the\n * overlay is the readable surface and it can edit, while a transcript dump could\n * only be read.\n */\nexport function createTasksCommand(\n store: TaskStore,\n openTaskSpace: (context: ExtensionContext, options: { store: TaskStore }) => Promise<void>,\n waitUntilReady?: (context: ExtensionContext) => Promise<void>,\n): readonly [string, Parameters<ExtensionAPI['registerCommand']>[1]] {\n return [\n COMMAND_NAME,\n {\n description: 'Open Task Space for this session tree',\n handler: async (_args, ctx) => {\n if (!ctx.hasUI) {\n ctx.ui.notify(ERR_REQUIRES_INTERACTIVE, 'error');\n return;\n }\n\n await waitUntilReady?.(ctx);\n store.read();\n await openTaskSpace(ctx, { store });\n },\n },\n ];\n}\n"],"mappings":"oHAYA,SAAgB,EACd,EACA,EACA,EACmE,CACnE,MAAO,CACL,EACA,CACE,YAAa,wCACb,QAAS,MAAO,EAAO,IAAQ,CAC7B,GAAI,CAAC,EAAI,MAAO,CACd,EAAI,GAAG,OAAO,EAA0B,OAAO,EAC/C,MACF,CAEA,MAAM,IAAiB,CAAG,EAC1B,EAAM,KAAK,EACX,MAAM,EAAc,EAAK,CAAE,OAAM,CAAC,CACpC,CACF,CACF,CACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../services/paths/index.cjs"),t=require("../services/taskStore/index.cjs"),n=require("../types/webTasks.cjs");function r(e){return typeof e==`object`&&!!e&&typeof e.rev==`number`&&Array.isArray(e.tasks)}function i(e){return{tasks:e.tasks.flatMap(e=>{if(e.status===`deleted`)return[];let t={id:e.id,subject:e.subject,status:e.status,blockedBy:e.blockedBy??[]};return e.description&&(t.description=e.description),e.activeForm&&(t.activeForm=e.activeForm),e.owner&&(t.owner=e.owner),e.updatedAt&&(t.updatedAt=e.updatedAt),e.delegation&&(t.delegation={...e.delegation.agent===void 0?{}:{agent:e.delegation.agent},...e.delegation.state===void 0?{}:{state:e.delegation.state}}),[t]}),rev:e.rev}}function a(a={}){return{frameType:n.TASKS_CHANNEL_TYPE,start(o){let s=new Map,c=c=>{if(s.has(c.sessionId))return;let l=a.storeFor?.(c);if(l===void 0){if(c.environment===void 0)throw Error(`Task channel requires an admitted environment for session '${c.sessionId}'.`);l=new t.TaskStore({cwd:c.cwd,env:c.environment,storePath:e.resolveStorePath(c.cwd,c.environment,c.sessionId)})}l.read();let u={store:l,unsubscribe:()=>void 0};s.set(c.sessionId,u),u.unsubscribe=o.directEvents.subscribe(n.TASKS_CHANNEL_TYPE,c.sessionId,e=>{if(!r(e))return;let t=s.get(c.sessionId);t!==void 0&&(t.latest=e,o.publish(c.sessionId,i(e)))},{replayLatest:!0})},l=e=>{let t=s.get(e);t&&(t.unsubscribe(),t.store.dispose(),s.delete(e))};for(let e of o.sessions())c(e);return{payloadFor(e){c(e);let t=s.get(e.sessionId),n=t?.latest??t?.store.snapshot;return n===void 0?void 0:i(n)},sessionAdded:c,sessionRemoved:l,close(){for(let e of s.keys())l(e)}}}}}exports.createTasksChannel=a;
|
|
2
|
+
//# sourceMappingURL=webTasksChannel.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webTasksChannel.cjs","names":["TASKS_CHANNEL_TYPE","TaskStore","resolveStorePath"],"sources":["../../src/controllers/webTasksChannel.ts"],"sourcesContent":["import type { DoomHubChannelSource, DoomHubSessionScope, DoomHubChannel } from '@agimon-ai/doompi-core/hub-channel';\n\nimport type { TaskDocument } from '../models/task';\nimport { resolveStorePath } from '../services/paths';\nimport { TaskStore } from '../services/taskStore';\nimport { TASKS_CHANNEL_TYPE, type WebTask, type WebTasksPayload } from '../types/webTasks';\n\ninterface TaskStoreSource {\n readonly snapshot: TaskDocument;\n read(): TaskDocument;\n dispose(): void;\n}\n\nfunction isTaskDocument(value: unknown): value is TaskDocument {\n return (\n typeof value === 'object' &&\n value !== null &&\n typeof (value as TaskDocument).rev === 'number' &&\n Array.isArray((value as TaskDocument).tasks)\n );\n}\n\nexport interface TasksChannelOptions {\n /** Injectable for tests. The default opens the session tree's durable task store. */\n storeFor?: (scope: DoomHubSessionScope) => TaskStoreSource;\n}\n\nfunction present(document: TaskDocument): WebTasksPayload {\n const tasks: WebTask[] = document.tasks.flatMap((task) => {\n if (task.status === 'deleted') return [];\n const view: WebTask = {\n id: task.id,\n subject: task.subject,\n status: task.status,\n blockedBy: task.blockedBy ?? [],\n };\n if (task.description) view.description = task.description;\n if (task.activeForm) view.activeForm = task.activeForm;\n if (task.owner) view.owner = task.owner;\n if (task.updatedAt) view.updatedAt = task.updatedAt;\n if (task.delegation) {\n view.delegation = {\n ...(task.delegation.agent === undefined ? {} : { agent: task.delegation.agent }),\n ...(task.delegation.state === undefined ? {} : { state: task.delegation.state }),\n };\n }\n return [view];\n });\n return { tasks, rev: document.rev };\n}\n\n/** Publishes each managed session's durable task graph and follows direct session commits. */\nexport function createTasksChannel(options: TasksChannelOptions = {}): DoomHubChannel {\n return {\n frameType: TASKS_CHANNEL_TYPE,\n start(host) {\n const stores = new Map<string, { store: TaskStoreSource; unsubscribe: () => void; latest?: TaskDocument }>();\n const open = (scope: DoomHubSessionScope): void => {\n if (stores.has(scope.sessionId)) return;\n let store = options.storeFor?.(scope);\n if (store === undefined) {\n if (scope.environment === undefined)\n throw new Error(`Task channel requires an admitted environment for session '${scope.sessionId}'.`);\n store = new TaskStore({\n cwd: scope.cwd,\n env: scope.environment,\n storePath: resolveStorePath(scope.cwd, scope.environment, scope.sessionId),\n });\n }\n store.read();\n const source = { store, unsubscribe: () => undefined as void };\n stores.set(scope.sessionId, source);\n source.unsubscribe = host.directEvents.subscribe(\n TASKS_CHANNEL_TYPE,\n scope.sessionId,\n (payload) => {\n if (!isTaskDocument(payload)) return;\n const current = stores.get(scope.sessionId);\n if (current === undefined) return;\n current.latest = payload;\n host.publish(scope.sessionId, present(payload));\n },\n { replayLatest: true },\n );\n };\n const close = (sessionId: string): void => {\n const source = stores.get(sessionId);\n if (!source) return;\n source.unsubscribe();\n source.store.dispose();\n stores.delete(sessionId);\n };\n for (const scope of host.sessions()) open(scope);\n\n const source: DoomHubChannelSource = {\n payloadFor(scope) {\n open(scope);\n const source = stores.get(scope.sessionId);\n const document = source?.latest ?? source?.store.snapshot;\n return document === undefined ? undefined : present(document);\n },\n sessionAdded: open,\n sessionRemoved: close,\n close() {\n for (const sessionId of stores.keys()) close(sessionId);\n },\n };\n return source;\n },\n };\n}\n"],"mappings":"+HAaA,SAAS,EAAe,EAAuC,CAC7D,OACE,OAAO,GAAU,YACjB,GACA,OAAQ,EAAuB,KAAQ,UACvC,MAAM,QAAS,EAAuB,KAAK,CAE/C,CAOA,SAAS,EAAQ,EAAyC,CAqBxD,MAAO,CAAE,MApBgB,EAAS,MAAM,QAAS,GAAS,CACxD,GAAI,EAAK,SAAW,UAAW,MAAO,CAAC,EACvC,IAAM,EAAgB,CACpB,GAAI,EAAK,GACT,QAAS,EAAK,QACd,OAAQ,EAAK,OACb,UAAW,EAAK,WAAa,CAAC,CAChC,EAWA,OAVI,EAAK,cAAa,EAAK,YAAc,EAAK,aAC1C,EAAK,aAAY,EAAK,WAAa,EAAK,YACxC,EAAK,QAAO,EAAK,MAAQ,EAAK,OAC9B,EAAK,YAAW,EAAK,UAAY,EAAK,WACtC,EAAK,aACP,EAAK,WAAa,CAChB,GAAI,EAAK,WAAW,QAAU,IAAA,GAAY,CAAC,EAAI,CAAE,MAAO,EAAK,WAAW,KAAM,EAC9E,GAAI,EAAK,WAAW,QAAU,IAAA,GAAY,CAAC,EAAI,CAAE,MAAO,EAAK,WAAW,KAAM,CAChF,GAEK,CAAC,CAAI,CACd,CACa,EAAG,IAAK,EAAS,GAAI,CACpC,CAGA,SAAgB,EAAmB,EAA+B,CAAC,EAAmB,CACpF,MAAO,CACL,UAAWA,EAAAA,mBACX,MAAM,EAAM,CACV,IAAM,EAAS,IAAI,IACb,EAAQ,GAAqC,CACjD,GAAI,EAAO,IAAI,EAAM,SAAS,EAAG,OACjC,IAAI,EAAQ,EAAQ,WAAW,CAAK,EACpC,GAAI,IAAU,IAAA,GAAW,CACvB,GAAI,EAAM,cAAgB,IAAA,GACxB,MAAU,MAAM,8DAA8D,EAAM,UAAU,GAAG,EACnG,EAAQ,IAAIC,EAAAA,UAAU,CACpB,IAAK,EAAM,IACX,IAAK,EAAM,YACX,UAAWC,EAAAA,iBAAiB,EAAM,IAAK,EAAM,YAAa,EAAM,SAAS,CAC3E,CAAC,CACH,CACA,EAAM,KAAK,EACX,IAAM,EAAS,CAAE,QAAO,gBAAmB,IAAA,EAAkB,EAC7D,EAAO,IAAI,EAAM,UAAW,CAAM,EAClC,EAAO,YAAc,EAAK,aAAa,UACrCF,EAAAA,mBACA,EAAM,UACL,GAAY,CACX,GAAI,CAAC,EAAe,CAAO,EAAG,OAC9B,IAAM,EAAU,EAAO,IAAI,EAAM,SAAS,EACtC,IAAY,IAAA,KAChB,EAAQ,OAAS,EACjB,EAAK,QAAQ,EAAM,UAAW,EAAQ,CAAO,CAAC,EAChD,EACA,CAAE,aAAc,EAAK,CACvB,CACF,EACM,EAAS,GAA4B,CACzC,IAAM,EAAS,EAAO,IAAI,CAAS,EAC9B,IACL,EAAO,YAAY,EACnB,EAAO,MAAM,QAAQ,EACrB,EAAO,OAAO,CAAS,EACzB,EACA,IAAK,IAAM,KAAS,EAAK,SAAS,EAAG,EAAK,CAAK,EAe/C,MAAO,CAZL,WAAW,EAAO,CAChB,EAAK,CAAK,EACV,IAAM,EAAS,EAAO,IAAI,EAAM,SAAS,EACnC,EAAW,GAAQ,QAAU,GAAQ,MAAM,SACjD,OAAO,IAAa,IAAA,GAAY,IAAA,GAAY,EAAQ,CAAQ,CAC9D,EACA,aAAc,EACd,eAAgB,EAChB,OAAQ,CACN,IAAK,IAAM,KAAa,EAAO,KAAK,EAAG,EAAM,CAAS,CACxD,CAEU,CACd,CACF,CACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{resolveStorePath as e}from"../services/paths/index.mjs";import{TaskStore as t}from"../services/taskStore/index.mjs";import{TASKS_CHANNEL_TYPE as n}from"../types/webTasks.mjs";function r(e){return typeof e==`object`&&!!e&&typeof e.rev==`number`&&Array.isArray(e.tasks)}function i(e){return{tasks:e.tasks.flatMap(e=>{if(e.status===`deleted`)return[];let t={id:e.id,subject:e.subject,status:e.status,blockedBy:e.blockedBy??[]};return e.description&&(t.description=e.description),e.activeForm&&(t.activeForm=e.activeForm),e.owner&&(t.owner=e.owner),e.updatedAt&&(t.updatedAt=e.updatedAt),e.delegation&&(t.delegation={...e.delegation.agent===void 0?{}:{agent:e.delegation.agent},...e.delegation.state===void 0?{}:{state:e.delegation.state}}),[t]}),rev:e.rev}}function a(a={}){return{frameType:n,start(o){let s=new Map,c=c=>{if(s.has(c.sessionId))return;let l=a.storeFor?.(c);if(l===void 0){if(c.environment===void 0)throw Error(`Task channel requires an admitted environment for session '${c.sessionId}'.`);l=new t({cwd:c.cwd,env:c.environment,storePath:e(c.cwd,c.environment,c.sessionId)})}l.read();let u={store:l,unsubscribe:()=>void 0};s.set(c.sessionId,u),u.unsubscribe=o.directEvents.subscribe(n,c.sessionId,e=>{if(!r(e))return;let t=s.get(c.sessionId);t!==void 0&&(t.latest=e,o.publish(c.sessionId,i(e)))},{replayLatest:!0})},l=e=>{let t=s.get(e);t&&(t.unsubscribe(),t.store.dispose(),s.delete(e))};for(let e of o.sessions())c(e);return{payloadFor(e){c(e);let t=s.get(e.sessionId),n=t?.latest??t?.store.snapshot;return n===void 0?void 0:i(n)},sessionAdded:c,sessionRemoved:l,close(){for(let e of s.keys())l(e)}}}}}export{a as createTasksChannel};
|
|
2
|
+
//# sourceMappingURL=webTasksChannel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webTasksChannel.mjs","names":[],"sources":["../../src/controllers/webTasksChannel.ts"],"sourcesContent":["import type { DoomHubChannelSource, DoomHubSessionScope, DoomHubChannel } from '@agimon-ai/doompi-core/hub-channel';\n\nimport type { TaskDocument } from '../models/task';\nimport { resolveStorePath } from '../services/paths';\nimport { TaskStore } from '../services/taskStore';\nimport { TASKS_CHANNEL_TYPE, type WebTask, type WebTasksPayload } from '../types/webTasks';\n\ninterface TaskStoreSource {\n readonly snapshot: TaskDocument;\n read(): TaskDocument;\n dispose(): void;\n}\n\nfunction isTaskDocument(value: unknown): value is TaskDocument {\n return (\n typeof value === 'object' &&\n value !== null &&\n typeof (value as TaskDocument).rev === 'number' &&\n Array.isArray((value as TaskDocument).tasks)\n );\n}\n\nexport interface TasksChannelOptions {\n /** Injectable for tests. The default opens the session tree's durable task store. */\n storeFor?: (scope: DoomHubSessionScope) => TaskStoreSource;\n}\n\nfunction present(document: TaskDocument): WebTasksPayload {\n const tasks: WebTask[] = document.tasks.flatMap((task) => {\n if (task.status === 'deleted') return [];\n const view: WebTask = {\n id: task.id,\n subject: task.subject,\n status: task.status,\n blockedBy: task.blockedBy ?? [],\n };\n if (task.description) view.description = task.description;\n if (task.activeForm) view.activeForm = task.activeForm;\n if (task.owner) view.owner = task.owner;\n if (task.updatedAt) view.updatedAt = task.updatedAt;\n if (task.delegation) {\n view.delegation = {\n ...(task.delegation.agent === undefined ? {} : { agent: task.delegation.agent }),\n ...(task.delegation.state === undefined ? {} : { state: task.delegation.state }),\n };\n }\n return [view];\n });\n return { tasks, rev: document.rev };\n}\n\n/** Publishes each managed session's durable task graph and follows direct session commits. */\nexport function createTasksChannel(options: TasksChannelOptions = {}): DoomHubChannel {\n return {\n frameType: TASKS_CHANNEL_TYPE,\n start(host) {\n const stores = new Map<string, { store: TaskStoreSource; unsubscribe: () => void; latest?: TaskDocument }>();\n const open = (scope: DoomHubSessionScope): void => {\n if (stores.has(scope.sessionId)) return;\n let store = options.storeFor?.(scope);\n if (store === undefined) {\n if (scope.environment === undefined)\n throw new Error(`Task channel requires an admitted environment for session '${scope.sessionId}'.`);\n store = new TaskStore({\n cwd: scope.cwd,\n env: scope.environment,\n storePath: resolveStorePath(scope.cwd, scope.environment, scope.sessionId),\n });\n }\n store.read();\n const source = { store, unsubscribe: () => undefined as void };\n stores.set(scope.sessionId, source);\n source.unsubscribe = host.directEvents.subscribe(\n TASKS_CHANNEL_TYPE,\n scope.sessionId,\n (payload) => {\n if (!isTaskDocument(payload)) return;\n const current = stores.get(scope.sessionId);\n if (current === undefined) return;\n current.latest = payload;\n host.publish(scope.sessionId, present(payload));\n },\n { replayLatest: true },\n );\n };\n const close = (sessionId: string): void => {\n const source = stores.get(sessionId);\n if (!source) return;\n source.unsubscribe();\n source.store.dispose();\n stores.delete(sessionId);\n };\n for (const scope of host.sessions()) open(scope);\n\n const source: DoomHubChannelSource = {\n payloadFor(scope) {\n open(scope);\n const source = stores.get(scope.sessionId);\n const document = source?.latest ?? source?.store.snapshot;\n return document === undefined ? undefined : present(document);\n },\n sessionAdded: open,\n sessionRemoved: close,\n close() {\n for (const sessionId of stores.keys()) close(sessionId);\n },\n };\n return source;\n },\n };\n}\n"],"mappings":"sLAaA,SAAS,EAAe,EAAuC,CAC7D,OACE,OAAO,GAAU,YACjB,GACA,OAAQ,EAAuB,KAAQ,UACvC,MAAM,QAAS,EAAuB,KAAK,CAE/C,CAOA,SAAS,EAAQ,EAAyC,CAqBxD,MAAO,CAAE,MApBgB,EAAS,MAAM,QAAS,GAAS,CACxD,GAAI,EAAK,SAAW,UAAW,MAAO,CAAC,EACvC,IAAM,EAAgB,CACpB,GAAI,EAAK,GACT,QAAS,EAAK,QACd,OAAQ,EAAK,OACb,UAAW,EAAK,WAAa,CAAC,CAChC,EAWA,OAVI,EAAK,cAAa,EAAK,YAAc,EAAK,aAC1C,EAAK,aAAY,EAAK,WAAa,EAAK,YACxC,EAAK,QAAO,EAAK,MAAQ,EAAK,OAC9B,EAAK,YAAW,EAAK,UAAY,EAAK,WACtC,EAAK,aACP,EAAK,WAAa,CAChB,GAAI,EAAK,WAAW,QAAU,IAAA,GAAY,CAAC,EAAI,CAAE,MAAO,EAAK,WAAW,KAAM,EAC9E,GAAI,EAAK,WAAW,QAAU,IAAA,GAAY,CAAC,EAAI,CAAE,MAAO,EAAK,WAAW,KAAM,CAChF,GAEK,CAAC,CAAI,CACd,CACa,EAAG,IAAK,EAAS,GAAI,CACpC,CAGA,SAAgB,EAAmB,EAA+B,CAAC,EAAmB,CACpF,MAAO,CACL,UAAW,EACX,MAAM,EAAM,CACV,IAAM,EAAS,IAAI,IACb,EAAQ,GAAqC,CACjD,GAAI,EAAO,IAAI,EAAM,SAAS,EAAG,OACjC,IAAI,EAAQ,EAAQ,WAAW,CAAK,EACpC,GAAI,IAAU,IAAA,GAAW,CACvB,GAAI,EAAM,cAAgB,IAAA,GACxB,MAAU,MAAM,8DAA8D,EAAM,UAAU,GAAG,EACnG,EAAQ,IAAI,EAAU,CACpB,IAAK,EAAM,IACX,IAAK,EAAM,YACX,UAAW,EAAiB,EAAM,IAAK,EAAM,YAAa,EAAM,SAAS,CAC3E,CAAC,CACH,CACA,EAAM,KAAK,EACX,IAAM,EAAS,CAAE,QAAO,gBAAmB,IAAA,EAAkB,EAC7D,EAAO,IAAI,EAAM,UAAW,CAAM,EAClC,EAAO,YAAc,EAAK,aAAa,UACrC,EACA,EAAM,UACL,GAAY,CACX,GAAI,CAAC,EAAe,CAAO,EAAG,OAC9B,IAAM,EAAU,EAAO,IAAI,EAAM,SAAS,EACtC,IAAY,IAAA,KAChB,EAAQ,OAAS,EACjB,EAAK,QAAQ,EAAM,UAAW,EAAQ,CAAO,CAAC,EAChD,EACA,CAAE,aAAc,EAAK,CACvB,CACF,EACM,EAAS,GAA4B,CACzC,IAAM,EAAS,EAAO,IAAI,CAAS,EAC9B,IACL,EAAO,YAAY,EACnB,EAAO,MAAM,QAAQ,EACrB,EAAO,OAAO,CAAS,EACzB,EACA,IAAK,IAAM,KAAS,EAAK,SAAS,EAAG,EAAK,CAAK,EAe/C,MAAO,CAZL,WAAW,EAAO,CAChB,EAAK,CAAK,EACV,IAAM,EAAS,EAAO,IAAI,EAAM,SAAS,EACnC,EAAW,GAAQ,QAAU,GAAQ,MAAM,SACjD,OAAO,IAAa,IAAA,GAAY,IAAA,GAAY,EAAQ,CAAQ,CAC9D,EACA,aAAc,EACd,eAAgB,EAChB,OAAQ,CACN,IAAK,IAAM,KAAa,EAAO,KAAK,EAAG,EAAM,CAAS,CACxD,CAEU,CACd,CACF,CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./types/delegation.cjs"),t=require("./services/delegation/index.cjs");exports.BACKGROUND_WORK_PROVIDER=t.BACKGROUND_WORK_PROVIDER,exports.DelegationManager=t.DelegationManager,exports.ERR_CANCEL_UNACKNOWLEDGED=t.ERR_CANCEL_UNACKNOWLEDGED,exports.ERR_CHILD_SESSION=t.ERR_CHILD_SESSION,exports.ERR_NO_RUNTIME=t.ERR_NO_RUNTIME,exports.MAX_BRIEF_FILES=e.MAX_BRIEF_FILES,exports.NOTIFY_CUSTOM_TYPE=t.NOTIFY_CUSTOM_TYPE;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { MAX_BRIEF_FILES } from "./types/delegation.cjs";
|
|
2
|
+
import { AssignOptions, BACKGROUND_WORK_PROVIDER, DelegationManager, DelegationManagerOptions, DelegationNotifier, DelegationOutcome, DelegationPlatform, DelegationProgress, ERR_CANCEL_UNACKNOWLEDGED, ERR_CHILD_SESSION, ERR_NO_RUNTIME, NOTIFY_CUSTOM_TYPE } from "./services/delegation/index.cjs";
|
|
3
|
+
export { AssignOptions, BACKGROUND_WORK_PROVIDER, DelegationManager, DelegationManagerOptions, DelegationNotifier, DelegationOutcome, DelegationPlatform, DelegationProgress, ERR_CANCEL_UNACKNOWLEDGED, ERR_CHILD_SESSION, ERR_NO_RUNTIME, MAX_BRIEF_FILES, NOTIFY_CUSTOM_TYPE };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { MAX_BRIEF_FILES } from "./types/delegation.mjs";
|
|
2
|
+
import { AssignOptions, BACKGROUND_WORK_PROVIDER, DelegationManager, DelegationManagerOptions, DelegationNotifier, DelegationOutcome, DelegationPlatform, DelegationProgress, ERR_CANCEL_UNACKNOWLEDGED, ERR_CHILD_SESSION, ERR_NO_RUNTIME, NOTIFY_CUSTOM_TYPE } from "./services/delegation/index.mjs";
|
|
3
|
+
export { AssignOptions, BACKGROUND_WORK_PROVIDER, DelegationManager, DelegationManagerOptions, DelegationNotifier, DelegationOutcome, DelegationPlatform, DelegationProgress, ERR_CANCEL_UNACKNOWLEDGED, ERR_CHILD_SESSION, ERR_NO_RUNTIME, MAX_BRIEF_FILES, NOTIFY_CUSTOM_TYPE };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MAX_BRIEF_FILES as e}from"./types/delegation.mjs";import{BACKGROUND_WORK_PROVIDER as t,DelegationManager as n,ERR_CANCEL_UNACKNOWLEDGED as r,ERR_CHILD_SESSION as i,ERR_NO_RUNTIME as a,NOTIFY_CUSTOM_TYPE as o}from"./services/delegation/index.mjs";export{t as BACKGROUND_WORK_PROVIDER,n as DelegationManager,r as ERR_CANCEL_UNACKNOWLEDGED,i as ERR_CHILD_SESSION,a as ERR_NO_RUNTIME,e as MAX_BRIEF_FILES,o as NOTIFY_CUSTOM_TYPE};
|
package/dist/extensions/pi.cjs
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../types/telemetry.cjs"),t=require("../services/delegation/index.cjs"),n=require("../services/logSinkTelemetry/index.cjs"),r=require("../constants/task.cjs");require("../schemas/task.cjs");const i=require("../controllers/tasksCommand.cjs"),a=require("../services/config/index.cjs"),o=require("../tui/format.cjs"),s=require("../tui/taskOverlay.cjs"),c=require("../services/paths/index.cjs"),l=require("../services/taskStore/index.cjs"),u=require("../tui/taskSpace.cjs"),d=require("../tools/task.cjs"),f=require("../services/contextContribution/index.cjs"),p=require("../services/delegationPlatform/index.cjs"),m=require("../services/taskNarration/index.cjs");let h=require("@agimon-ai/doompi-core/delegation"),g=require("@earendil-works/pi-tui"),_=require("@agimon-ai/doompi-core/background-work"),v=require("@agimon-ai/doompi-core/context-contributions"),y=require("@agimon-ai/doompi-core/narration"),b=require("@agimon-ai/doompi-core/pi-extension"),x=require("@agimon-ai/doompi-core/readiness"),S=require("@agimon-ai/doompi-core/ui-hub");const C=f.TASK_CONTEXT_CONTRIBUTION_SOURCE,w=`error.type`,T=`task.stage`,E={sessionId:`session_id`,storeCleanup:`store_cleanup`,storeSweep:`store_sweep`,storeRead:`store_read`,reconcile:`reconcile`,refresh:`refresh`};function D(e){return e instanceof Error?e.name||`Error`:typeof e==`string`?`StringError`:e&&typeof e==`object`?`ObjectError`:`UnknownError`}const O=(0,b.definePiExtension)(C,({context:O,pi:k,signal:A})=>{let j=n.createTaskErrorReporter(),M=n.toFailureReporter(j),N=!0,P=0,F,I,L,R,z,B,V,H,U,W=e=>{j.recordWarning(`doom_task.narration_failed`,e).catch(e=>{process.emitWarning(`Doom-task could not record a narration failure: ${String(e)}`)})},G={narrate(e){let t=F,n=(0,y.createNarrationRequest)(e);if(t&&n)try{Promise.resolve(t.request(n)).catch(W)}catch(e){W(e)}}},K=async(e,t)=>{t?.throwIfAborted();let n=U;if(!n)throw Error(`doom-task session initialization has not started`);if(n.sessionManager!==e.sessionManager)throw Error(`doom-task readiness belongs to a stale Pi session`);if(await n.operation,t?.throwIfAborted(),!N||A.aborted||n!==U||!H)throw Error(`doom-task readiness belongs to a stale extension generation`)},q=()=>{z?.(),z=void 0,L?.reset(),R?.dispose(),H=void 0},J=new l.TaskStore({report:M,onCommitted:(e,t)=>m.narrateTaskCommit(G,e,t)});I=J;let Y=()=>{N&&!A.aborted&&(R?.update(),B?.update())},X=new t.DelegationManager({store:J,cwd:process.cwd(),platform:p.createNodeDelegationPlatform(),notify:(e,t)=>k.sendMessage(e,t),getSessionId:()=>H,onChange:Y,runTimeoutMs:a.getDelegationTimeoutMs(),report:M,onNotifyError:(e,t)=>{j.recordNotificationError(e,t)}});L=X;let Z=new s.TaskOverlay({getTasks:()=>J.snapshot.tasks,delegation:X});R=Z;let ee={store:J,delegation:X,maxTasks:a.getMaxTasks(),onChange:Y,report:M,waitUntilReady:K},te=async(t,n)=>{if(!N||A.aborted)return;let r=++P;H!==void 0&&q();let i=n,o=async t=>{let n=()=>!t?.aborted&&N&&!A.aborted&&r===P,o=E.sessionId,s=async(t,n)=>{o=t;try{await n()}catch(n){M.warn(e.TASK_EVENT.sessionStartDegraded,n,{[T]:t,[w]:D(n)})}};try{let t=i.sessionManager?.getSessionId();if(!t)throw Error(`doom-task requires a session id`);H=t,J.configureSession(c.resolveSessionKey(t)),o=E.storeCleanup;let r=await c.removeLegacyStoreDirectoryAsync(J.storePath);if(!n())return;o=E.storeSweep;let l=c.hasStorePathOverride()?{removed:[],errors:[]}:await c.sweepStoreFilesAsync(J.storePath,a.getStoreTtlMs());if(!n())return;let u=[...r.errors,...l.errors];for(let t of u)M.warn(e.TASK_EVENT.storeSweepFailed,Error(t));if(u.length>0&&i.hasUI&&i.ui.notify(u.join(`
|
|
2
|
+
`),`warning`),i.hasUI&&Z.setUICtx(i.ui),await s(E.storeRead,async()=>{await J.readAsync(n)}),!n()||(z=J.onExternalChange(Y),await s(E.reconcile,async()=>{await X.reconcile(n)}),!n()))return;o=E.refresh,Y()}catch(t){if(!n())return;throw q(),M.error(e.TASK_EVENT.sessionStartFailed,t,{[T]:o,[w]:D(t)}),t}},s=(0,x.readDoomReadinessCoordinator)(O);if(!s){let e=o();return U={sessionManager:n.sessionManager,operation:e},e}let l=U?.operation,u=(async()=>{l&&await Promise.allSettled([l]),N&&!A.aborted&&r===P&&await s.start(C,`${n.sessionManager.getSessionId()}:${r}`,async e=>(await o(e),{value:void 0})).wait()})();U={sessionManager:n.sessionManager,operation:u},Promise.allSettled([u])},ne=e=>{N&&!A.aborted&&e.toolName===`task`&&Y()},re={description:`Collapse or expand the task overlay`,handler:async e=>{N&&!A.aborted&&e.hasUI&&(await K(e),N&&!A.aborted&&Z.isRegistered()&&Z.toggleCollapse())}},Q=async()=>{if(!N)return;N=!1,P+=1;let e=U?.operation;U=void 0;try{e&&await Promise.allSettled([e]),q(),L?.dispose(),V?.(),V=void 0,I?.dispose()}finally{await j.shutdown()}},$=a.resolveCollapseKey();return{services:[e=>{e.inject([y.DOOM_NARRATION_SERVICE],e=>{let t=(0,y.requireDoomNarrationService)(e);return F=t,()=>{F===t&&(F=void 0)}}),e.inject([v.DOOM_CONTEXT_CONTRIBUTIONS_SERVICE],e=>{let t=(0,v.requireDoomContextContributions)(e).register(f.createTaskContextContribution(()=>J.snapshot.tasks));return()=>t.dispose()}),e.inject([h.DOOM_DELEGATION_SERVICE],e=>{let t=(0,h.readDoomDelegationService)(e);if(t)return X.bind(e,t)}),e.inject([_.DOOM_BACKGROUND_WORK_SERVICE],e=>{let n=(0,_.readDoomBackgroundWorkService)(e);if(!n)return;let r=n.register({provider:t.BACKGROUND_WORK_PROVIDER,listActiveWork:()=>X.listActiveWork()});return B=r,()=>{r.dispose(),B===r&&(B=void 0)}}),e.inject([S.DOOM_UI_HUB_SERVICE],e=>{let t=(0,S.requireDoomUiHub)(e).registerLeader({source:C,bindings:[{id:`tasks.open`,path:[{key:`t`,label:`tasks`,detail:`session task list`,order:65},{key:`l`,label:`list`,detail:`tasks in this session`}],command:{name:r.COMMAND_NAME}}]}),n=()=>t.dispose();return V=n,()=>{n(),V===n&&(V=void 0)}})}],onStop:Q,onDispose:Q,tools:[(0,b.definePiTool)(d.createTaskTool(ee,{renderCall:(e,t)=>o.renderTaskCall(e,t,J.snapshot.tasks),renderResult:o.renderTaskResult}))],commands:[i.createTasksCommand(J,u.openTaskSpace,K)],messageRenderers:[[t.NOTIFY_CUSTOM_TYPE,(e,t,n)=>new g.Text(n.fg(`muted`,typeof e.content==`string`?e.content:``),0,0)]],shortcuts:$===`off`?[]:[[$,re]],events:{session_start:te,session_compact:Y,session_tree:Y,tool_execution_end:ne}}});exports.default=O,exports.taskExtension=O;
|
|
2
3
|
//# sourceMappingURL=pi.cjs.map
|