@agimon-ai/doompi-task 0.0.1-alpha.4 → 0.0.1-alpha.40
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 +110 -15
- package/dist/adapters/node/delegationPlatform.cjs +2 -0
- package/dist/adapters/node/delegationPlatform.cjs.map +1 -0
- package/dist/adapters/node/delegationPlatform.mjs +2 -0
- package/dist/adapters/node/delegationPlatform.mjs.map +1 -0
- package/dist/adapters/pi/extension.cjs +3 -0
- package/dist/adapters/pi/extension.cjs.map +1 -0
- package/dist/adapters/pi/extension.d.cts +10 -0
- package/dist/adapters/pi/extension.d.cts.map +1 -0
- package/dist/adapters/pi/extension.d.mts +10 -0
- package/dist/adapters/pi/extension.d.mts.map +1 -0
- package/dist/adapters/pi/extension.mjs +3 -0
- package/dist/adapters/pi/extension.mjs.map +1 -0
- package/dist/adapters/store/paths.cjs +2 -0
- package/dist/adapters/store/paths.cjs.map +1 -0
- package/dist/adapters/store/paths.d.cts +26 -0
- package/dist/adapters/store/paths.d.cts.map +1 -0
- package/dist/adapters/store/paths.d.mts +26 -0
- package/dist/adapters/store/paths.d.mts.map +1 -0
- package/dist/adapters/store/paths.mjs +2 -0
- package/dist/adapters/store/paths.mjs.map +1 -0
- package/dist/adapters/store/taskStore.cjs +2 -0
- package/dist/adapters/store/taskStore.cjs.map +1 -0
- package/dist/adapters/store/taskStore.d.cts +87 -0
- package/dist/adapters/store/taskStore.d.cts.map +1 -0
- package/dist/adapters/store/taskStore.d.mts +87 -0
- package/dist/adapters/store/taskStore.d.mts.map +1 -0
- package/dist/adapters/store/taskStore.mjs +2 -0
- package/dist/adapters/store/taskStore.mjs.map +1 -0
- package/dist/adapters/telemetry/logSinkTelemetry.cjs +2 -0
- package/dist/adapters/telemetry/logSinkTelemetry.cjs.map +1 -0
- package/dist/adapters/telemetry/logSinkTelemetry.d.cts +23 -0
- package/dist/adapters/telemetry/logSinkTelemetry.d.cts.map +1 -0
- package/dist/adapters/telemetry/logSinkTelemetry.d.mts +23 -0
- package/dist/adapters/telemetry/logSinkTelemetry.d.mts.map +1 -0
- package/dist/adapters/telemetry/logSinkTelemetry.mjs +2 -0
- package/dist/adapters/telemetry/logSinkTelemetry.mjs.map +1 -0
- package/dist/adapters/webTasksChannel.cjs +2 -0
- package/dist/adapters/webTasksChannel.cjs.map +1 -0
- package/dist/adapters/webTasksChannel.d.cts +20 -0
- package/dist/adapters/webTasksChannel.d.cts.map +1 -0
- package/dist/adapters/webTasksChannel.d.mts +20 -0
- package/dist/adapters/webTasksChannel.d.mts.map +1 -0
- package/dist/adapters/webTasksChannel.mjs +2 -0
- package/dist/adapters/webTasksChannel.mjs.map +1 -0
- package/dist/commands/index.cjs +2 -0
- package/dist/commands/index.cjs.map +1 -0
- package/dist/commands/index.d.cts +14 -0
- package/dist/commands/index.d.cts.map +1 -0
- package/dist/commands/index.d.mts +14 -0
- package/dist/commands/index.d.mts.map +1 -0
- package/dist/commands/index.mjs +2 -0
- package/dist/commands/index.mjs.map +1 -0
- package/dist/commands/task/promptGuidelines.cjs +2 -0
- package/dist/commands/task/promptGuidelines.cjs.map +1 -0
- package/dist/commands/task/promptGuidelines.d.cts +5 -0
- package/dist/commands/task/promptGuidelines.d.cts.map +1 -0
- package/dist/commands/task/promptGuidelines.d.mts +5 -0
- package/dist/commands/task/promptGuidelines.d.mts.map +1 -0
- package/dist/commands/task/promptGuidelines.mjs +2 -0
- package/dist/commands/task/promptGuidelines.mjs.map +1 -0
- package/dist/commands/task/responseEnvelope.cjs +7 -0
- package/dist/commands/task/responseEnvelope.cjs.map +1 -0
- package/dist/commands/task/responseEnvelope.d.cts +51 -0
- package/dist/commands/task/responseEnvelope.d.cts.map +1 -0
- package/dist/commands/task/responseEnvelope.d.mts +51 -0
- package/dist/commands/task/responseEnvelope.d.mts.map +1 -0
- package/dist/commands/task/responseEnvelope.mjs +7 -0
- package/dist/commands/task/responseEnvelope.mjs.map +1 -0
- package/dist/commands/task/taskTool.cjs +3 -0
- package/dist/commands/task/taskTool.cjs.map +1 -0
- package/dist/commands/task/taskTool.d.cts +20 -0
- package/dist/commands/task/taskTool.d.cts.map +1 -0
- package/dist/commands/task/taskTool.d.mts +20 -0
- package/dist/commands/task/taskTool.d.mts.map +1 -0
- package/dist/commands/task/taskTool.mjs +3 -0
- package/dist/commands/task/taskTool.mjs.map +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/delegation/manager.cjs +1 -6
- package/dist/delegation/manager.d.cts +3 -189
- package/dist/delegation/manager.d.mts +3 -189
- package/dist/delegation/manager.mjs +1 -6
- package/dist/extension.cjs +1 -3
- package/dist/extension.d.cts +2 -12
- package/dist/extension.d.mts +2 -12
- package/dist/extension.mjs +1 -3
- package/dist/extensions/pi.cjs +1 -2
- package/dist/extensions/pi.d.cts +1 -1
- package/dist/extensions/pi.d.mts +1 -1
- package/dist/extensions/pi.mjs +1 -2
- 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/schemas/task.cjs +2 -0
- package/dist/schemas/task.cjs.map +1 -0
- package/dist/schemas/task.d.cts +103 -0
- package/dist/schemas/task.d.cts.map +1 -0
- package/dist/schemas/task.d.mts +103 -0
- 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/contextContribution.cjs +3 -0
- package/dist/services/contextContribution.cjs.map +1 -0
- package/dist/services/contextContribution.mjs +3 -0
- package/dist/services/contextContribution.mjs.map +1 -0
- package/dist/services/delegation/manager.cjs +6 -0
- package/dist/services/delegation/manager.cjs.map +1 -0
- package/dist/services/delegation/manager.d.cts +192 -0
- package/dist/services/delegation/manager.d.cts.map +1 -0
- package/dist/services/delegation/manager.d.mts +192 -0
- package/dist/services/delegation/manager.d.mts.map +1 -0
- package/dist/services/delegation/manager.mjs +6 -0
- package/dist/services/delegation/manager.mjs.map +1 -0
- package/dist/services/narration/taskNarration.cjs +2 -0
- package/dist/services/narration/taskNarration.cjs.map +1 -0
- package/dist/services/narration/taskNarration.mjs +2 -0
- package/dist/services/narration/taskNarration.mjs.map +1 -0
- package/dist/services/store/invariants.cjs +2 -0
- package/dist/services/store/invariants.cjs.map +1 -0
- package/dist/services/store/invariants.d.cts +24 -0
- package/dist/services/store/invariants.d.cts.map +1 -0
- package/dist/services/store/invariants.d.mts +24 -0
- package/dist/services/store/invariants.d.mts.map +1 -0
- package/dist/services/store/invariants.mjs +2 -0
- package/dist/services/store/invariants.mjs.map +1 -0
- package/dist/services/store/processLiveness.cjs +2 -0
- package/dist/services/store/processLiveness.cjs.map +1 -0
- package/dist/services/store/processLiveness.d.cts +12 -0
- package/dist/services/store/processLiveness.d.cts.map +1 -0
- package/dist/services/store/processLiveness.d.mts +12 -0
- package/dist/services/store/processLiveness.d.mts.map +1 -0
- package/dist/services/store/processLiveness.mjs +2 -0
- package/dist/services/store/processLiveness.mjs.map +1 -0
- package/dist/services/store/reconcile.cjs +2 -0
- package/dist/services/store/reconcile.cjs.map +1 -0
- package/dist/services/store/reconcile.d.cts +34 -0
- package/dist/services/store/reconcile.d.cts.map +1 -0
- package/dist/services/store/reconcile.d.mts +34 -0
- package/dist/services/store/reconcile.d.mts.map +1 -0
- package/dist/services/store/reconcile.mjs +2 -0
- package/dist/services/store/reconcile.mjs.map +1 -0
- package/dist/services/store/reducer.cjs +3 -0
- package/dist/services/store/reducer.cjs.map +1 -0
- package/dist/services/store/reducer.d.cts +72 -0
- package/dist/services/store/reducer.d.cts.map +1 -0
- package/dist/services/store/reducer.d.mts +72 -0
- package/dist/services/store/reducer.d.mts.map +1 -0
- package/dist/services/store/reducer.mjs +3 -0
- package/dist/services/store/reducer.mjs.map +1 -0
- package/dist/services/store/taskGraph.cjs +2 -0
- package/dist/services/store/taskGraph.cjs.map +1 -0
- package/dist/services/store/taskGraph.d.cts +25 -0
- package/dist/services/store/taskGraph.d.cts.map +1 -0
- package/dist/services/store/taskGraph.d.mts +25 -0
- package/dist/services/store/taskGraph.d.mts.map +1 -0
- package/dist/services/store/taskGraph.mjs +2 -0
- package/dist/services/store/taskGraph.mjs.map +1 -0
- package/dist/services/store/types.cjs +2 -0
- package/dist/services/store/types.cjs.map +1 -0
- package/dist/services/store/types.d.cts +177 -0
- package/dist/services/store/types.d.cts.map +1 -0
- package/dist/services/store/types.d.mts +177 -0
- package/dist/services/store/types.d.mts.map +1 -0
- package/dist/services/store/types.mjs +2 -0
- package/dist/services/store/types.mjs.map +1 -0
- package/dist/store/invariants.cjs +1 -2
- package/dist/store/invariants.d.cts +2 -14
- package/dist/store/invariants.d.mts +2 -14
- package/dist/store/invariants.mjs +1 -2
- package/dist/store/paths.cjs +1 -2
- package/dist/store/paths.d.cts +2 -23
- package/dist/store/paths.d.mts +2 -23
- package/dist/store/paths.mjs +1 -2
- package/dist/store/processLiveness.cjs +1 -2
- package/dist/store/processLiveness.d.cts +2 -12
- package/dist/store/processLiveness.d.mts +2 -12
- package/dist/store/processLiveness.mjs +1 -2
- package/dist/store/reconcile.cjs +1 -2
- package/dist/store/reconcile.d.cts +2 -34
- package/dist/store/reconcile.d.mts +2 -34
- package/dist/store/reconcile.mjs +1 -2
- package/dist/store/reducer.cjs +1 -3
- package/dist/store/reducer.d.cts +2 -72
- package/dist/store/reducer.d.mts +2 -72
- package/dist/store/reducer.mjs +1 -3
- package/dist/store/taskGraph.cjs +1 -2
- package/dist/store/taskGraph.d.cts +2 -25
- package/dist/store/taskGraph.d.mts +2 -25
- package/dist/store/taskGraph.mjs +1 -2
- package/dist/store/taskStore.cjs +1 -2
- package/dist/store/taskStore.d.cts +2 -77
- package/dist/store/taskStore.d.mts +2 -77
- package/dist/store/taskStore.mjs +1 -2
- package/dist/store/types.cjs +1 -2
- package/dist/store/types.d.cts +2 -165
- package/dist/store/types.d.mts +2 -165
- package/dist/store/types.mjs +1 -2
- package/dist/tool/promptGuidelines.cjs +1 -2
- package/dist/tool/promptGuidelines.d.cts +2 -5
- package/dist/tool/promptGuidelines.d.mts +2 -5
- package/dist/tool/promptGuidelines.mjs +1 -2
- package/dist/tool/responseEnvelope.cjs +1 -6
- package/dist/tool/responseEnvelope.d.cts +2 -39
- package/dist/tool/responseEnvelope.d.mts +2 -39
- package/dist/tool/responseEnvelope.mjs +1 -6
- package/dist/tool/schema.cjs +1 -2
- package/dist/tool/schema.d.cts +2 -86
- package/dist/tool/schema.d.mts +2 -86
- package/dist/tool/schema.mjs +1 -2
- package/dist/tool/taskTool.cjs +1 -3
- package/dist/tool/taskTool.d.cts +3 -17
- package/dist/tool/taskTool.d.mts +3 -17
- package/dist/tool/taskTool.mjs +1 -3
- package/dist/tui/format.cjs +1 -4
- package/dist/tui/format.d.cts +5 -5
- package/dist/tui/format.d.cts.map +1 -1
- package/dist/tui/format.d.mts +5 -5
- package/dist/tui/format.d.mts.map +1 -1
- package/dist/tui/format.mjs +1 -4
- package/dist/tui/format2.cjs +4 -0
- package/dist/tui/format2.cjs.map +1 -0
- package/dist/tui/format2.d.cts +2 -0
- package/dist/tui/format2.d.mts +2 -0
- package/dist/tui/format2.mjs +4 -0
- package/dist/tui/format2.mjs.map +1 -0
- package/dist/tui/selectors.cjs +1 -2
- package/dist/tui/selectors.d.cts +8 -1
- package/dist/tui/selectors.d.cts.map +1 -1
- package/dist/tui/selectors.d.mts +8 -1
- package/dist/tui/selectors.d.mts.map +1 -1
- package/dist/tui/selectors.mjs +1 -2
- package/dist/tui/selectors2.cjs +2 -0
- package/dist/tui/selectors2.cjs.map +1 -0
- package/dist/tui/selectors2.d.cts +2 -0
- package/dist/tui/selectors2.d.mts +2 -0
- package/dist/tui/selectors2.mjs +2 -0
- package/dist/tui/selectors2.mjs.map +1 -0
- package/dist/tui/taskOverlay.cjs +1 -2
- package/dist/tui/taskOverlay.d.cts +2 -2
- package/dist/tui/taskOverlay.d.cts.map +1 -1
- package/dist/tui/taskOverlay.d.mts +2 -2
- package/dist/tui/taskOverlay.d.mts.map +1 -1
- package/dist/tui/taskOverlay.mjs +1 -2
- package/dist/tui/taskOverlay2.cjs +2 -0
- package/dist/tui/taskOverlay2.cjs.map +1 -0
- package/dist/tui/taskOverlay2.d.cts +2 -0
- package/dist/tui/taskOverlay2.d.mts +2 -0
- package/dist/tui/taskOverlay2.mjs +2 -0
- package/dist/tui/taskOverlay2.mjs.map +1 -0
- package/dist/tui/taskSpace.cjs +1 -5
- package/dist/tui/taskSpace.d.cts +4 -4
- package/dist/tui/taskSpace.d.cts.map +1 -1
- package/dist/tui/taskSpace.d.mts +4 -4
- package/dist/tui/taskSpace.d.mts.map +1 -1
- package/dist/tui/taskSpace.mjs +1 -5
- package/dist/tui/taskSpace2.cjs +5 -0
- package/dist/tui/taskSpace2.cjs.map +1 -0
- package/dist/tui/taskSpace2.d.cts +2 -0
- package/dist/tui/taskSpace2.d.mts +2 -0
- package/dist/tui/taskSpace2.mjs +5 -0
- package/dist/tui/taskSpace2.mjs.map +1 -0
- package/dist/types/config.cjs +2 -0
- package/dist/types/config.cjs.map +1 -0
- package/dist/types/config.d.cts +43 -0
- package/dist/types/config.d.cts.map +1 -0
- package/dist/types/config.d.mts +43 -0
- package/dist/types/config.d.mts.map +1 -0
- package/dist/types/config.mjs +2 -0
- package/dist/types/config.mjs.map +1 -0
- package/dist/types/delegation.cjs +2 -0
- package/dist/types/delegation.cjs.map +1 -0
- package/dist/types/delegation.d.cts +6 -0
- package/dist/types/delegation.d.cts.map +1 -0
- package/dist/types/delegation.d.mts +6 -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/dist/webHub.cjs +1 -0
- package/dist/webHub.d.cts +2 -0
- package/dist/webHub.d.mts +2 -0
- package/dist/webHub.mjs +1 -0
- package/package.json +60 -20
- package/src/types/webTasks.ts +24 -0
- package/web/TaskToolMessage.tsx +119 -0
- package/web/TasksActivitySection.tsx +207 -0
- package/web/index.ts +15 -0
- package/web/taskToolFormat.ts +330 -0
- package/web/tasksStore.ts +72 -0
- package/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.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.map +0 -1
- package/dist/extension.cjs.map +0 -1
- package/dist/extension.d.cts.map +0 -1
- package/dist/extension.d.mts.map +0 -1
- 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/extensions/pi.cjs.map +0 -1
- package/dist/extensions/pi.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.map +0 -1
- package/dist/store/invariants.d.cts.map +0 -1
- package/dist/store/invariants.d.mts.map +0 -1
- package/dist/store/invariants.mjs.map +0 -1
- package/dist/store/paths.cjs.map +0 -1
- package/dist/store/paths.d.cts.map +0 -1
- package/dist/store/paths.d.mts.map +0 -1
- package/dist/store/paths.mjs.map +0 -1
- 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.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.map +0 -1
- 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.map +0 -1
- 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.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.map +0 -1
- 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.map +0 -1
- package/dist/tool/promptGuidelines.d.cts.map +0 -1
- package/dist/tool/promptGuidelines.d.mts.map +0 -1
- package/dist/tool/promptGuidelines.mjs.map +0 -1
- package/dist/tool/responseEnvelope.cjs.map +0 -1
- package/dist/tool/responseEnvelope.d.cts.map +0 -1
- package/dist/tool/responseEnvelope.d.mts.map +0 -1
- package/dist/tool/responseEnvelope.mjs.map +0 -1
- 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.map +0 -1
- package/dist/tool/taskTool.cjs.map +0 -1
- package/dist/tool/taskTool.d.cts.map +0 -1
- package/dist/tool/taskTool.d.mts.map +0 -1
- package/dist/tool/taskTool.mjs.map +0 -1
- package/dist/tui/format.cjs.map +0 -1
- package/dist/tui/format.mjs.map +0 -1
- package/dist/tui/selectors.cjs.map +0 -1
- package/dist/tui/selectors.mjs.map +0 -1
- package/dist/tui/taskOverlay.cjs.map +0 -1
- package/dist/tui/taskOverlay.mjs.map +0 -1
- package/dist/tui/taskSpace.cjs.map +0 -1
- package/dist/tui/taskSpace.mjs.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=`completed`,t=`deleted`;function n(n){let r=n.filter(e=>e.status!==t);return r.length>0&&r.every(t=>t.status===e)}function r(e,t,n){let r=new Map;for(let i of e)i.id===t?r.set(i.id,[...new Set([...i.blockedBy??[],...n])]):r.set(i.id,i.blockedBy?[...i.blockedBy]:[]);let i=new Set,a=new Set,o=e=>{if(i.has(e))return!0;if(a.has(e))return!1;i.add(e);for(let t of r.get(e)??[])if(o(t))return!0;return i.delete(e),a.add(e),!1};for(let e of r.keys())if(o(e))return!0;return!1}function i(e){let t=new Map;for(let n of e)for(let e of n.blockedBy??[]){let r=t.get(e)??[];r.push(n.id),t.set(e,r)}return t}function a(n,r){return(r.blockedBy??[]).filter(r=>{let i=n.find(e=>e.id===r);return i?i.status!==e&&i.status!==t:!1})}function o(e,t){return a(e,t).length>0}exports.deriveBlocks=i,exports.detectCycle=r,exports.isBlocked=o,exports.isTaskListComplete=n,exports.unresolvedBlockers=a;
|
|
2
|
+
//# sourceMappingURL=taskGraph.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taskGraph.cjs","names":[],"sources":["../../../src/services/store/taskGraph.ts"],"sourcesContent":["import type { Task } from './types.ts';\n\nconst COMPLETED_STATUS: Task['status'] = 'completed';\nconst DELETED_STATUS: Task['status'] = 'deleted';\n\n/** True when a non-empty list has no visible work left to finish. */\nexport function isTaskListComplete(taskList: readonly Task[]): boolean {\n const visible = taskList.filter((task) => task.status !== DELETED_STATUS);\n return visible.length > 0 && visible.every((task) => task.status === COMPLETED_STATUS);\n}\n\n/**\n * Would merging `newBlockedBy` into `taskId`'s dependencies introduce a cycle?\n *\n * Takes the proposed additions explicitly so the reducer can ask the question\n * before mutating anything.\n */\nexport function detectCycle(taskList: readonly Task[], taskId: number, newBlockedBy: readonly number[]): boolean {\n const edges = new Map<number, number[]>();\n for (const task of taskList) {\n if (task.id === taskId) {\n edges.set(task.id, [...new Set([...(task.blockedBy ?? []), ...newBlockedBy])]);\n } else {\n edges.set(task.id, task.blockedBy ? [...task.blockedBy] : []);\n }\n }\n\n const visiting = new Set<number>();\n const visited = new Set<number>();\n const hasCycleFrom = (node: number): boolean => {\n if (visiting.has(node)) return true;\n if (visited.has(node)) return false;\n visiting.add(node);\n for (const next of edges.get(node) ?? []) {\n if (hasCycleFrom(next)) return true;\n }\n visiting.delete(node);\n visited.add(node);\n return false;\n };\n\n for (const node of edges.keys()) {\n if (hasCycleFrom(node)) return true;\n }\n return false;\n}\n\n/** Inverse adjacency: for each task, which tasks list it in their blockedBy. */\nexport function deriveBlocks(taskList: readonly Task[]): Map<number, number[]> {\n const blocks = new Map<number, number[]>();\n for (const task of taskList) {\n for (const dep of task.blockedBy ?? []) {\n const dependents = blocks.get(dep) ?? [];\n dependents.push(task.id);\n blocks.set(dep, dependents);\n }\n }\n return blocks;\n}\n\n/**\n * Blocking dependencies of a task that are not yet resolved.\n *\n * `completed` clears a dependency; `failed` deliberately does not, so a failed\n * delegation keeps its dependents blocked instead of silently releasing work\n * that was never actually finished.\n */\nexport function unresolvedBlockers(taskList: readonly Task[], task: Task): number[] {\n return (task.blockedBy ?? []).filter((dep) => {\n const blocker = taskList.find((candidate) => candidate.id === dep);\n if (!blocker) return false;\n return blocker.status !== COMPLETED_STATUS && blocker.status !== DELETED_STATUS;\n });\n}\n\nexport function isBlocked(taskList: readonly Task[], task: Task): boolean {\n return unresolvedBlockers(taskList, task).length > 0;\n}\n"],"mappings":"AAEA,MAAM,EAAmC,YACnC,EAAiC,UAGvC,SAAgB,EAAmB,EAAoC,CACrE,IAAM,EAAU,EAAS,OAAQ,GAAS,EAAK,SAAW,CAAc,EACxE,OAAO,EAAQ,OAAS,GAAK,EAAQ,MAAO,GAAS,EAAK,SAAW,CAAgB,CACvF,CAQA,SAAgB,EAAY,EAA2B,EAAgB,EAA0C,CAC/G,IAAM,EAAQ,IAAI,IAClB,IAAK,IAAM,KAAQ,EACb,EAAK,KAAO,EACd,EAAM,IAAI,EAAK,GAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAI,EAAK,WAAa,CAAC,EAAI,GAAG,CAAY,CAAC,CAAC,CAAC,EAE7E,EAAM,IAAI,EAAK,GAAI,EAAK,UAAY,CAAC,GAAG,EAAK,SAAS,EAAI,CAAC,CAAC,EAIhE,IAAM,EAAW,IAAI,IACf,EAAU,IAAI,IACd,EAAgB,GAA0B,CAC9C,GAAI,EAAS,IAAI,CAAI,EAAG,MAAO,GAC/B,GAAI,EAAQ,IAAI,CAAI,EAAG,MAAO,GAC9B,EAAS,IAAI,CAAI,EACjB,IAAK,IAAM,KAAQ,EAAM,IAAI,CAAI,GAAK,CAAC,EACrC,GAAI,EAAa,CAAI,EAAG,MAAO,GAIjC,OAFA,EAAS,OAAO,CAAI,EACpB,EAAQ,IAAI,CAAI,EACT,EACT,EAEA,IAAK,IAAM,KAAQ,EAAM,KAAK,EAC5B,GAAI,EAAa,CAAI,EAAG,MAAO,GAEjC,MAAO,EACT,CAGA,SAAgB,EAAa,EAAkD,CAC7E,IAAM,EAAS,IAAI,IACnB,IAAK,IAAM,KAAQ,EACjB,IAAK,IAAM,KAAO,EAAK,WAAa,CAAC,EAAG,CACtC,IAAM,EAAa,EAAO,IAAI,CAAG,GAAK,CAAC,EACvC,EAAW,KAAK,EAAK,EAAE,EACvB,EAAO,IAAI,EAAK,CAAU,CAC5B,CAEF,OAAO,CACT,CASA,SAAgB,EAAmB,EAA2B,EAAsB,CAClF,OAAQ,EAAK,WAAa,CAAC,EAAA,CAAG,OAAQ,GAAQ,CAC5C,IAAM,EAAU,EAAS,KAAM,GAAc,EAAU,KAAO,CAAG,EAEjE,OADK,EACE,EAAQ,SAAW,GAAoB,EAAQ,SAAW,EAD5C,EAEvB,CAAC,CACH,CAEA,SAAgB,EAAU,EAA2B,EAAqB,CACxE,OAAO,EAAmB,EAAU,CAAI,CAAC,CAAC,OAAS,CACrD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Task } from "./types.cjs";
|
|
2
|
+
//#region src/services/store/taskGraph.d.ts
|
|
3
|
+
/** True when a non-empty list has no visible work left to finish. */
|
|
4
|
+
declare function isTaskListComplete(taskList: readonly Task[]): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Would merging `newBlockedBy` into `taskId`'s dependencies introduce a cycle?
|
|
7
|
+
*
|
|
8
|
+
* Takes the proposed additions explicitly so the reducer can ask the question
|
|
9
|
+
* before mutating anything.
|
|
10
|
+
*/
|
|
11
|
+
declare function detectCycle(taskList: readonly Task[], taskId: number, newBlockedBy: readonly number[]): boolean;
|
|
12
|
+
/** Inverse adjacency: for each task, which tasks list it in their blockedBy. */
|
|
13
|
+
declare function deriveBlocks(taskList: readonly Task[]): Map<number, number[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Blocking dependencies of a task that are not yet resolved.
|
|
16
|
+
*
|
|
17
|
+
* `completed` clears a dependency; `failed` deliberately does not, so a failed
|
|
18
|
+
* delegation keeps its dependents blocked instead of silently releasing work
|
|
19
|
+
* that was never actually finished.
|
|
20
|
+
*/
|
|
21
|
+
declare function unresolvedBlockers(taskList: readonly Task[], task: Task): number[];
|
|
22
|
+
declare function isBlocked(taskList: readonly Task[], task: Task): boolean;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { deriveBlocks, detectCycle, isBlocked, isTaskListComplete, unresolvedBlockers };
|
|
25
|
+
//# sourceMappingURL=taskGraph.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taskGraph.d.cts","names":[],"sources":["../../../src/services/store/taskGraph.ts"],"mappings":";;;iBAMgB,mBAAmB,mBAAmB;;;;;;;iBAWtC,YAAY,mBAAmB,QAAQ,gBAAgB;;iBA+BvD,aAAa,mBAAmB,SAAS;;;;;;;;iBAmBzC,mBAAmB,mBAAmB,QAAQ,MAAM;iBAQpD,UAAU,mBAAmB,QAAQ,MAAM"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Task } from "./types.mjs";
|
|
2
|
+
//#region src/services/store/taskGraph.d.ts
|
|
3
|
+
/** True when a non-empty list has no visible work left to finish. */
|
|
4
|
+
declare function isTaskListComplete(taskList: readonly Task[]): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Would merging `newBlockedBy` into `taskId`'s dependencies introduce a cycle?
|
|
7
|
+
*
|
|
8
|
+
* Takes the proposed additions explicitly so the reducer can ask the question
|
|
9
|
+
* before mutating anything.
|
|
10
|
+
*/
|
|
11
|
+
declare function detectCycle(taskList: readonly Task[], taskId: number, newBlockedBy: readonly number[]): boolean;
|
|
12
|
+
/** Inverse adjacency: for each task, which tasks list it in their blockedBy. */
|
|
13
|
+
declare function deriveBlocks(taskList: readonly Task[]): Map<number, number[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Blocking dependencies of a task that are not yet resolved.
|
|
16
|
+
*
|
|
17
|
+
* `completed` clears a dependency; `failed` deliberately does not, so a failed
|
|
18
|
+
* delegation keeps its dependents blocked instead of silently releasing work
|
|
19
|
+
* that was never actually finished.
|
|
20
|
+
*/
|
|
21
|
+
declare function unresolvedBlockers(taskList: readonly Task[], task: Task): number[];
|
|
22
|
+
declare function isBlocked(taskList: readonly Task[], task: Task): boolean;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { deriveBlocks, detectCycle, isBlocked, isTaskListComplete, unresolvedBlockers };
|
|
25
|
+
//# sourceMappingURL=taskGraph.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taskGraph.d.mts","names":[],"sources":["../../../src/services/store/taskGraph.ts"],"mappings":";;;iBAMgB,mBAAmB,mBAAmB;;;;;;;iBAWtC,YAAY,mBAAmB,QAAQ,gBAAgB;;iBA+BvD,aAAa,mBAAmB,SAAS;;;;;;;;iBAmBzC,mBAAmB,mBAAmB,QAAQ,MAAM;iBAQpD,UAAU,mBAAmB,QAAQ,MAAM"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=`completed`,t=`deleted`;function n(n){let r=n.filter(e=>e.status!==t);return r.length>0&&r.every(t=>t.status===e)}function r(e,t,n){let r=new Map;for(let i of e)i.id===t?r.set(i.id,[...new Set([...i.blockedBy??[],...n])]):r.set(i.id,i.blockedBy?[...i.blockedBy]:[]);let i=new Set,a=new Set,o=e=>{if(i.has(e))return!0;if(a.has(e))return!1;i.add(e);for(let t of r.get(e)??[])if(o(t))return!0;return i.delete(e),a.add(e),!1};for(let e of r.keys())if(o(e))return!0;return!1}function i(e){let t=new Map;for(let n of e)for(let e of n.blockedBy??[]){let r=t.get(e)??[];r.push(n.id),t.set(e,r)}return t}function a(n,r){return(r.blockedBy??[]).filter(r=>{let i=n.find(e=>e.id===r);return i?i.status!==e&&i.status!==t:!1})}function o(e,t){return a(e,t).length>0}export{i as deriveBlocks,r as detectCycle,o as isBlocked,n as isTaskListComplete,a as unresolvedBlockers};
|
|
2
|
+
//# sourceMappingURL=taskGraph.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taskGraph.mjs","names":[],"sources":["../../../src/services/store/taskGraph.ts"],"sourcesContent":["import type { Task } from './types.ts';\n\nconst COMPLETED_STATUS: Task['status'] = 'completed';\nconst DELETED_STATUS: Task['status'] = 'deleted';\n\n/** True when a non-empty list has no visible work left to finish. */\nexport function isTaskListComplete(taskList: readonly Task[]): boolean {\n const visible = taskList.filter((task) => task.status !== DELETED_STATUS);\n return visible.length > 0 && visible.every((task) => task.status === COMPLETED_STATUS);\n}\n\n/**\n * Would merging `newBlockedBy` into `taskId`'s dependencies introduce a cycle?\n *\n * Takes the proposed additions explicitly so the reducer can ask the question\n * before mutating anything.\n */\nexport function detectCycle(taskList: readonly Task[], taskId: number, newBlockedBy: readonly number[]): boolean {\n const edges = new Map<number, number[]>();\n for (const task of taskList) {\n if (task.id === taskId) {\n edges.set(task.id, [...new Set([...(task.blockedBy ?? []), ...newBlockedBy])]);\n } else {\n edges.set(task.id, task.blockedBy ? [...task.blockedBy] : []);\n }\n }\n\n const visiting = new Set<number>();\n const visited = new Set<number>();\n const hasCycleFrom = (node: number): boolean => {\n if (visiting.has(node)) return true;\n if (visited.has(node)) return false;\n visiting.add(node);\n for (const next of edges.get(node) ?? []) {\n if (hasCycleFrom(next)) return true;\n }\n visiting.delete(node);\n visited.add(node);\n return false;\n };\n\n for (const node of edges.keys()) {\n if (hasCycleFrom(node)) return true;\n }\n return false;\n}\n\n/** Inverse adjacency: for each task, which tasks list it in their blockedBy. */\nexport function deriveBlocks(taskList: readonly Task[]): Map<number, number[]> {\n const blocks = new Map<number, number[]>();\n for (const task of taskList) {\n for (const dep of task.blockedBy ?? []) {\n const dependents = blocks.get(dep) ?? [];\n dependents.push(task.id);\n blocks.set(dep, dependents);\n }\n }\n return blocks;\n}\n\n/**\n * Blocking dependencies of a task that are not yet resolved.\n *\n * `completed` clears a dependency; `failed` deliberately does not, so a failed\n * delegation keeps its dependents blocked instead of silently releasing work\n * that was never actually finished.\n */\nexport function unresolvedBlockers(taskList: readonly Task[], task: Task): number[] {\n return (task.blockedBy ?? []).filter((dep) => {\n const blocker = taskList.find((candidate) => candidate.id === dep);\n if (!blocker) return false;\n return blocker.status !== COMPLETED_STATUS && blocker.status !== DELETED_STATUS;\n });\n}\n\nexport function isBlocked(taskList: readonly Task[], task: Task): boolean {\n return unresolvedBlockers(taskList, task).length > 0;\n}\n"],"mappings":"AAEA,MAAM,EAAmC,YACnC,EAAiC,UAGvC,SAAgB,EAAmB,EAAoC,CACrE,IAAM,EAAU,EAAS,OAAQ,GAAS,EAAK,SAAW,CAAc,EACxE,OAAO,EAAQ,OAAS,GAAK,EAAQ,MAAO,GAAS,EAAK,SAAW,CAAgB,CACvF,CAQA,SAAgB,EAAY,EAA2B,EAAgB,EAA0C,CAC/G,IAAM,EAAQ,IAAI,IAClB,IAAK,IAAM,KAAQ,EACb,EAAK,KAAO,EACd,EAAM,IAAI,EAAK,GAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAI,EAAK,WAAa,CAAC,EAAI,GAAG,CAAY,CAAC,CAAC,CAAC,EAE7E,EAAM,IAAI,EAAK,GAAI,EAAK,UAAY,CAAC,GAAG,EAAK,SAAS,EAAI,CAAC,CAAC,EAIhE,IAAM,EAAW,IAAI,IACf,EAAU,IAAI,IACd,EAAgB,GAA0B,CAC9C,GAAI,EAAS,IAAI,CAAI,EAAG,MAAO,GAC/B,GAAI,EAAQ,IAAI,CAAI,EAAG,MAAO,GAC9B,EAAS,IAAI,CAAI,EACjB,IAAK,IAAM,KAAQ,EAAM,IAAI,CAAI,GAAK,CAAC,EACrC,GAAI,EAAa,CAAI,EAAG,MAAO,GAIjC,OAFA,EAAS,OAAO,CAAI,EACpB,EAAQ,IAAI,CAAI,EACT,EACT,EAEA,IAAK,IAAM,KAAQ,EAAM,KAAK,EAC5B,GAAI,EAAa,CAAI,EAAG,MAAO,GAEjC,MAAO,EACT,CAGA,SAAgB,EAAa,EAAkD,CAC7E,IAAM,EAAS,IAAI,IACnB,IAAK,IAAM,KAAQ,EACjB,IAAK,IAAM,KAAO,EAAK,WAAa,CAAC,EAAG,CACtC,IAAM,EAAa,EAAO,IAAI,CAAG,GAAK,CAAC,EACvC,EAAW,KAAK,EAAK,EAAE,EACvB,EAAO,IAAI,EAAK,CAAU,CAC5B,CAEF,OAAO,CACT,CASA,SAAgB,EAAmB,EAA2B,EAAsB,CAClF,OAAQ,EAAK,WAAa,CAAC,EAAA,CAAG,OAAQ,GAAQ,CAC5C,IAAM,EAAU,EAAS,KAAM,GAAc,EAAU,KAAO,CAAG,EAEjE,OADK,EACE,EAAQ,SAAW,GAAoB,EAAQ,SAAW,EAD5C,EAEvB,CAAC,CACH,CAEA,SAAgB,EAAU,EAA2B,EAAqB,CACxE,OAAO,EAAmB,EAAU,CAAI,CAAC,CAAC,OAAS,CACrD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(){return{version:1,rev:0,nextId:1,tasks:[]}}function t(e){let t=e.delegation?.state;return t===`requested`||t===`running`}exports.DELETED_STATUS=`deleted`,exports.STORE_SCHEMA_VERSION=1,exports.emptyDocument=e,exports.isDelegationActive=t;
|
|
2
|
+
//# sourceMappingURL=types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.cjs","names":[],"sources":["../../../src/services/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/** One task-to-agent handoff inside a native assignment batch. */\nexport interface TaskAssignment {\n id: number;\n agent: string;\n inlineAgent?: InlineAgent;\n instructions?: string;\n relevantFiles?: string[];\n priorFindings?: string;\n model?: string;\n context?: 'fresh' | 'fork';\n}\n\n/** Which assignment entries started, so renderResult can show one consolidated batch. */\nexport interface AssignmentSummary {\n /** Ids of successful entries, in request order. A failed entry contributes nothing. */\n assigned: 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 /** `assign` only: independent task-to-agent handoffs dispatched by one tool call. */\n assignments?: TaskAssignment[];\n /** `list` filter only. To set a status, upsert the task by id. */\n status?: TaskStatus;\n /** `get`, `delete`, and `cancel` only. Assign ids live in `assignments[]`. */\n id?: number;\n includeDeleted?: boolean;\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 assignment?: AssignmentSummary;\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":"AAyEA,SAAgB,GAA8B,CAC5C,MAAO,CAAE,QAAA,EAA+B,IAAK,EAAG,OAAQ,EAAG,MAAO,CAAC,CAAE,CACvE,CAiHA,SAAgB,EAAmB,EAAqB,CACtD,IAAM,EAAQ,EAAK,YAAY,MAC/B,OAAO,IAAU,aAAe,IAAU,SAC5C"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { InlineAgent } from "@agimon-ai/doompi-extension-contracts/subagent-tool";
|
|
2
|
+
//#region src/services/store/types.d.ts
|
|
3
|
+
type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'deleted';
|
|
4
|
+
declare const DELETED_STATUS: TaskStatus;
|
|
5
|
+
type TaskAction = 'upsert' | 'list' | 'get' | 'delete' | 'clear' | 'assign' | 'cancel';
|
|
6
|
+
type DelegationState = 'requested' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
7
|
+
/** Terminal result of a delegated subagent run, copied off the delegation response. */
|
|
8
|
+
interface DelegationResult {
|
|
9
|
+
status: string;
|
|
10
|
+
output?: string;
|
|
11
|
+
outputPath?: string;
|
|
12
|
+
sessionFile?: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
durationMs?: number;
|
|
15
|
+
toolCount?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Delegation bookkeeping attached to a task that was handed to a subagent.
|
|
19
|
+
*
|
|
20
|
+
* `pid` is the harness process that owns the run: it is the only way to tell an
|
|
21
|
+
* genuinely-running delegation from one orphaned by a harness crash, since the
|
|
22
|
+
* child dies with its parent but the file survives.
|
|
23
|
+
*/
|
|
24
|
+
interface TaskDelegation {
|
|
25
|
+
requestId: string;
|
|
26
|
+
agent: string;
|
|
27
|
+
state: DelegationState;
|
|
28
|
+
sessionId?: string;
|
|
29
|
+
pid?: number;
|
|
30
|
+
runId?: string;
|
|
31
|
+
model?: string;
|
|
32
|
+
startedAt?: string;
|
|
33
|
+
endedAt?: string;
|
|
34
|
+
result?: DelegationResult;
|
|
35
|
+
}
|
|
36
|
+
interface Task {
|
|
37
|
+
id: number;
|
|
38
|
+
subject: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
activeForm?: string;
|
|
41
|
+
status: TaskStatus;
|
|
42
|
+
blockedBy?: number[];
|
|
43
|
+
owner?: string;
|
|
44
|
+
metadata?: Record<string, unknown>;
|
|
45
|
+
createdAt?: string;
|
|
46
|
+
updatedAt?: string;
|
|
47
|
+
delegation?: TaskDelegation;
|
|
48
|
+
}
|
|
49
|
+
declare const STORE_SCHEMA_VERSION = 1;
|
|
50
|
+
/** The complete on-disk document. `rev` increments on every committed write. */
|
|
51
|
+
interface TaskDocument {
|
|
52
|
+
version: number;
|
|
53
|
+
rev: number;
|
|
54
|
+
nextId: number;
|
|
55
|
+
tasks: Task[];
|
|
56
|
+
}
|
|
57
|
+
declare function emptyDocument(): TaskDocument;
|
|
58
|
+
/**
|
|
59
|
+
* A dependency target inside an upsert item: an existing task id, or the `ref`
|
|
60
|
+
* of a task created earlier in the same call.
|
|
61
|
+
*
|
|
62
|
+
* Refs must start with a letter (see `REF_PATTERN`), so a ref is structurally
|
|
63
|
+
* unconfusable with a stringified id and the discrimination is just `typeof`.
|
|
64
|
+
*/
|
|
65
|
+
type DepToken = number | string;
|
|
66
|
+
/**
|
|
67
|
+
* One entry of an `upsert` call. No `id` creates a task; an `id` updates one.
|
|
68
|
+
*
|
|
69
|
+
* `blockedBy` (absolute set) is create-only and `addBlockedBy`/`removeBlockedBy`
|
|
70
|
+
* (additive merge) are update-only, matching the split the two former actions
|
|
71
|
+
* had. A field used against the wrong kind fails that item rather than being
|
|
72
|
+
* silently ignored.
|
|
73
|
+
*/
|
|
74
|
+
interface TaskItemMutation {
|
|
75
|
+
id?: number;
|
|
76
|
+
ref?: string;
|
|
77
|
+
subject?: string;
|
|
78
|
+
description?: string;
|
|
79
|
+
activeForm?: string;
|
|
80
|
+
status?: TaskStatus;
|
|
81
|
+
blockedBy?: DepToken[];
|
|
82
|
+
addBlockedBy?: DepToken[];
|
|
83
|
+
removeBlockedBy?: DepToken[];
|
|
84
|
+
owner?: string;
|
|
85
|
+
metadata?: Record<string, unknown>;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* What one upsert item did. `index` is its position in the request array, so a
|
|
89
|
+
* model reading a partial result can tell which entries still need resending.
|
|
90
|
+
*
|
|
91
|
+
* `message` is unprefixed: the `item[N] failed:` framing belongs to the
|
|
92
|
+
* formatter, because the Task Space overlay shows this text on its own.
|
|
93
|
+
*/
|
|
94
|
+
type UpsertItemOutcome = {
|
|
95
|
+
index: number;
|
|
96
|
+
kind: 'created';
|
|
97
|
+
id: number;
|
|
98
|
+
subject: string;
|
|
99
|
+
status: TaskStatus;
|
|
100
|
+
ref?: string;
|
|
101
|
+
blockedBy?: number[];
|
|
102
|
+
} | {
|
|
103
|
+
index: number;
|
|
104
|
+
kind: 'updated';
|
|
105
|
+
id: number;
|
|
106
|
+
fromStatus: TaskStatus;
|
|
107
|
+
toStatus: TaskStatus;
|
|
108
|
+
} | {
|
|
109
|
+
index: number;
|
|
110
|
+
kind: 'unchanged';
|
|
111
|
+
id: number;
|
|
112
|
+
status: TaskStatus;
|
|
113
|
+
} | {
|
|
114
|
+
index: number;
|
|
115
|
+
kind: 'failed';
|
|
116
|
+
message: string;
|
|
117
|
+
id?: number;
|
|
118
|
+
ref?: string;
|
|
119
|
+
};
|
|
120
|
+
/** Which tasks an upsert touched, so renderResult names them instead of guessing. */
|
|
121
|
+
interface UpsertSummary {
|
|
122
|
+
/** Ids of applied entries, in request order. A failed entry contributes nothing. */
|
|
123
|
+
applied: number[];
|
|
124
|
+
failed: number;
|
|
125
|
+
}
|
|
126
|
+
/** One task-to-agent handoff inside a native assignment batch. */
|
|
127
|
+
interface TaskAssignment {
|
|
128
|
+
id: number;
|
|
129
|
+
agent: string;
|
|
130
|
+
inlineAgent?: InlineAgent;
|
|
131
|
+
instructions?: string;
|
|
132
|
+
relevantFiles?: string[];
|
|
133
|
+
priorFindings?: string;
|
|
134
|
+
model?: string;
|
|
135
|
+
context?: 'fresh' | 'fork';
|
|
136
|
+
}
|
|
137
|
+
/** Which assignment entries started, so renderResult can show one consolidated batch. */
|
|
138
|
+
interface AssignmentSummary {
|
|
139
|
+
/** Ids of successful entries, in request order. A failed entry contributes nothing. */
|
|
140
|
+
assigned: number[];
|
|
141
|
+
failed: number;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Open-shape input bag the reducer accepts. The index signature lets the
|
|
145
|
+
* runtime pass a TypeBox `Static<typeof TaskParamsSchema>` through without
|
|
146
|
+
* casting each field.
|
|
147
|
+
*
|
|
148
|
+
* Per-task fields live on `tasks[]`, not here: a top-level `subject` or
|
|
149
|
+
* `status` would be ambiguous once one call can carry many tasks.
|
|
150
|
+
*/
|
|
151
|
+
interface TaskMutationParams {
|
|
152
|
+
[key: string]: unknown;
|
|
153
|
+
tasks?: TaskItemMutation[];
|
|
154
|
+
/** `assign` only: independent task-to-agent handoffs dispatched by one tool call. */
|
|
155
|
+
assignments?: TaskAssignment[];
|
|
156
|
+
/** `list` filter only. To set a status, upsert the task by id. */
|
|
157
|
+
status?: TaskStatus;
|
|
158
|
+
/** `get`, `delete`, and `cancel` only. Assign ids live in `assignments[]`. */
|
|
159
|
+
id?: number;
|
|
160
|
+
includeDeleted?: boolean;
|
|
161
|
+
}
|
|
162
|
+
/** Snapshot returned under a tool result's `details` for renderResult. */
|
|
163
|
+
interface TaskDetails {
|
|
164
|
+
action: TaskAction;
|
|
165
|
+
params: Record<string, unknown>;
|
|
166
|
+
tasks: Task[];
|
|
167
|
+
nextId: number;
|
|
168
|
+
rev: number;
|
|
169
|
+
error?: string;
|
|
170
|
+
upsert?: UpsertSummary;
|
|
171
|
+
assignment?: AssignmentSummary;
|
|
172
|
+
}
|
|
173
|
+
/** A delegation is "live" while the owning run may still produce a response. */
|
|
174
|
+
declare function isDelegationActive(task: Task): boolean;
|
|
175
|
+
//#endregion
|
|
176
|
+
export { AssignmentSummary, DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskAssignment, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive };
|
|
177
|
+
//# sourceMappingURL=types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../../src/services/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;;;UAIe;EACf;EACA;EACA,cAAc;EACd;EACA;EACA;EACA;EACA;;;UAIe;;EAEf;EACA;;;;;;;;;;UAWe;GACd;EACD,QAAQ;;EAER,cAAc;;EAEd,SAAS;;EAET;EACA;;;UAIe;EACf,QAAQ;EACR,QAAQ;EACR,OAAO;EACP;EACA;EACA;EACA,SAAS;EACT,aAAa;;;iBAIC,mBAAmB,MAAM"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { InlineAgent } from "@agimon-ai/doompi-extension-contracts/subagent-tool";
|
|
2
|
+
//#region src/services/store/types.d.ts
|
|
3
|
+
type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'deleted';
|
|
4
|
+
declare const DELETED_STATUS: TaskStatus;
|
|
5
|
+
type TaskAction = 'upsert' | 'list' | 'get' | 'delete' | 'clear' | 'assign' | 'cancel';
|
|
6
|
+
type DelegationState = 'requested' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
7
|
+
/** Terminal result of a delegated subagent run, copied off the delegation response. */
|
|
8
|
+
interface DelegationResult {
|
|
9
|
+
status: string;
|
|
10
|
+
output?: string;
|
|
11
|
+
outputPath?: string;
|
|
12
|
+
sessionFile?: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
durationMs?: number;
|
|
15
|
+
toolCount?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Delegation bookkeeping attached to a task that was handed to a subagent.
|
|
19
|
+
*
|
|
20
|
+
* `pid` is the harness process that owns the run: it is the only way to tell an
|
|
21
|
+
* genuinely-running delegation from one orphaned by a harness crash, since the
|
|
22
|
+
* child dies with its parent but the file survives.
|
|
23
|
+
*/
|
|
24
|
+
interface TaskDelegation {
|
|
25
|
+
requestId: string;
|
|
26
|
+
agent: string;
|
|
27
|
+
state: DelegationState;
|
|
28
|
+
sessionId?: string;
|
|
29
|
+
pid?: number;
|
|
30
|
+
runId?: string;
|
|
31
|
+
model?: string;
|
|
32
|
+
startedAt?: string;
|
|
33
|
+
endedAt?: string;
|
|
34
|
+
result?: DelegationResult;
|
|
35
|
+
}
|
|
36
|
+
interface Task {
|
|
37
|
+
id: number;
|
|
38
|
+
subject: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
activeForm?: string;
|
|
41
|
+
status: TaskStatus;
|
|
42
|
+
blockedBy?: number[];
|
|
43
|
+
owner?: string;
|
|
44
|
+
metadata?: Record<string, unknown>;
|
|
45
|
+
createdAt?: string;
|
|
46
|
+
updatedAt?: string;
|
|
47
|
+
delegation?: TaskDelegation;
|
|
48
|
+
}
|
|
49
|
+
declare const STORE_SCHEMA_VERSION = 1;
|
|
50
|
+
/** The complete on-disk document. `rev` increments on every committed write. */
|
|
51
|
+
interface TaskDocument {
|
|
52
|
+
version: number;
|
|
53
|
+
rev: number;
|
|
54
|
+
nextId: number;
|
|
55
|
+
tasks: Task[];
|
|
56
|
+
}
|
|
57
|
+
declare function emptyDocument(): TaskDocument;
|
|
58
|
+
/**
|
|
59
|
+
* A dependency target inside an upsert item: an existing task id, or the `ref`
|
|
60
|
+
* of a task created earlier in the same call.
|
|
61
|
+
*
|
|
62
|
+
* Refs must start with a letter (see `REF_PATTERN`), so a ref is structurally
|
|
63
|
+
* unconfusable with a stringified id and the discrimination is just `typeof`.
|
|
64
|
+
*/
|
|
65
|
+
type DepToken = number | string;
|
|
66
|
+
/**
|
|
67
|
+
* One entry of an `upsert` call. No `id` creates a task; an `id` updates one.
|
|
68
|
+
*
|
|
69
|
+
* `blockedBy` (absolute set) is create-only and `addBlockedBy`/`removeBlockedBy`
|
|
70
|
+
* (additive merge) are update-only, matching the split the two former actions
|
|
71
|
+
* had. A field used against the wrong kind fails that item rather than being
|
|
72
|
+
* silently ignored.
|
|
73
|
+
*/
|
|
74
|
+
interface TaskItemMutation {
|
|
75
|
+
id?: number;
|
|
76
|
+
ref?: string;
|
|
77
|
+
subject?: string;
|
|
78
|
+
description?: string;
|
|
79
|
+
activeForm?: string;
|
|
80
|
+
status?: TaskStatus;
|
|
81
|
+
blockedBy?: DepToken[];
|
|
82
|
+
addBlockedBy?: DepToken[];
|
|
83
|
+
removeBlockedBy?: DepToken[];
|
|
84
|
+
owner?: string;
|
|
85
|
+
metadata?: Record<string, unknown>;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* What one upsert item did. `index` is its position in the request array, so a
|
|
89
|
+
* model reading a partial result can tell which entries still need resending.
|
|
90
|
+
*
|
|
91
|
+
* `message` is unprefixed: the `item[N] failed:` framing belongs to the
|
|
92
|
+
* formatter, because the Task Space overlay shows this text on its own.
|
|
93
|
+
*/
|
|
94
|
+
type UpsertItemOutcome = {
|
|
95
|
+
index: number;
|
|
96
|
+
kind: 'created';
|
|
97
|
+
id: number;
|
|
98
|
+
subject: string;
|
|
99
|
+
status: TaskStatus;
|
|
100
|
+
ref?: string;
|
|
101
|
+
blockedBy?: number[];
|
|
102
|
+
} | {
|
|
103
|
+
index: number;
|
|
104
|
+
kind: 'updated';
|
|
105
|
+
id: number;
|
|
106
|
+
fromStatus: TaskStatus;
|
|
107
|
+
toStatus: TaskStatus;
|
|
108
|
+
} | {
|
|
109
|
+
index: number;
|
|
110
|
+
kind: 'unchanged';
|
|
111
|
+
id: number;
|
|
112
|
+
status: TaskStatus;
|
|
113
|
+
} | {
|
|
114
|
+
index: number;
|
|
115
|
+
kind: 'failed';
|
|
116
|
+
message: string;
|
|
117
|
+
id?: number;
|
|
118
|
+
ref?: string;
|
|
119
|
+
};
|
|
120
|
+
/** Which tasks an upsert touched, so renderResult names them instead of guessing. */
|
|
121
|
+
interface UpsertSummary {
|
|
122
|
+
/** Ids of applied entries, in request order. A failed entry contributes nothing. */
|
|
123
|
+
applied: number[];
|
|
124
|
+
failed: number;
|
|
125
|
+
}
|
|
126
|
+
/** One task-to-agent handoff inside a native assignment batch. */
|
|
127
|
+
interface TaskAssignment {
|
|
128
|
+
id: number;
|
|
129
|
+
agent: string;
|
|
130
|
+
inlineAgent?: InlineAgent;
|
|
131
|
+
instructions?: string;
|
|
132
|
+
relevantFiles?: string[];
|
|
133
|
+
priorFindings?: string;
|
|
134
|
+
model?: string;
|
|
135
|
+
context?: 'fresh' | 'fork';
|
|
136
|
+
}
|
|
137
|
+
/** Which assignment entries started, so renderResult can show one consolidated batch. */
|
|
138
|
+
interface AssignmentSummary {
|
|
139
|
+
/** Ids of successful entries, in request order. A failed entry contributes nothing. */
|
|
140
|
+
assigned: number[];
|
|
141
|
+
failed: number;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Open-shape input bag the reducer accepts. The index signature lets the
|
|
145
|
+
* runtime pass a TypeBox `Static<typeof TaskParamsSchema>` through without
|
|
146
|
+
* casting each field.
|
|
147
|
+
*
|
|
148
|
+
* Per-task fields live on `tasks[]`, not here: a top-level `subject` or
|
|
149
|
+
* `status` would be ambiguous once one call can carry many tasks.
|
|
150
|
+
*/
|
|
151
|
+
interface TaskMutationParams {
|
|
152
|
+
[key: string]: unknown;
|
|
153
|
+
tasks?: TaskItemMutation[];
|
|
154
|
+
/** `assign` only: independent task-to-agent handoffs dispatched by one tool call. */
|
|
155
|
+
assignments?: TaskAssignment[];
|
|
156
|
+
/** `list` filter only. To set a status, upsert the task by id. */
|
|
157
|
+
status?: TaskStatus;
|
|
158
|
+
/** `get`, `delete`, and `cancel` only. Assign ids live in `assignments[]`. */
|
|
159
|
+
id?: number;
|
|
160
|
+
includeDeleted?: boolean;
|
|
161
|
+
}
|
|
162
|
+
/** Snapshot returned under a tool result's `details` for renderResult. */
|
|
163
|
+
interface TaskDetails {
|
|
164
|
+
action: TaskAction;
|
|
165
|
+
params: Record<string, unknown>;
|
|
166
|
+
tasks: Task[];
|
|
167
|
+
nextId: number;
|
|
168
|
+
rev: number;
|
|
169
|
+
error?: string;
|
|
170
|
+
upsert?: UpsertSummary;
|
|
171
|
+
assignment?: AssignmentSummary;
|
|
172
|
+
}
|
|
173
|
+
/** A delegation is "live" while the owning run may still produce a response. */
|
|
174
|
+
declare function isDelegationActive(task: Task): boolean;
|
|
175
|
+
//#endregion
|
|
176
|
+
export { AssignmentSummary, DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskAssignment, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive };
|
|
177
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../src/services/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;;;UAIe;EACf;EACA;EACA,cAAc;EACd;EACA;EACA;EACA;EACA;;;UAIe;;EAEf;EACA;;;;;;;;;;UAWe;GACd;EACD,QAAQ;;EAER,cAAc;;EAEd,SAAS;;EAET;EACA;;;UAIe;EACf,QAAQ;EACR,QAAQ;EACR,OAAO;EACP;EACA;EACA;EACA,SAAS;EACT,aAAa;;;iBAIC,mBAAmB,MAAM"}
|
|
@@ -0,0 +1,2 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","names":[],"sources":["../../../src/services/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/** One task-to-agent handoff inside a native assignment batch. */\nexport interface TaskAssignment {\n id: number;\n agent: string;\n inlineAgent?: InlineAgent;\n instructions?: string;\n relevantFiles?: string[];\n priorFindings?: string;\n model?: string;\n context?: 'fresh' | 'fork';\n}\n\n/** Which assignment entries started, so renderResult can show one consolidated batch. */\nexport interface AssignmentSummary {\n /** Ids of successful entries, in request order. A failed entry contributes nothing. */\n assigned: 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 /** `assign` only: independent task-to-agent handoffs dispatched by one tool call. */\n assignments?: TaskAssignment[];\n /** `list` filter only. To set a status, upsert the task by id. */\n status?: TaskStatus;\n /** `get`, `delete`, and `cancel` only. Assign ids live in `assignments[]`. */\n id?: number;\n includeDeleted?: boolean;\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 assignment?: AssignmentSummary;\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,CAiHA,SAAgB,EAAmB,EAAqB,CACtD,IAAM,EAAQ,EAAK,YAAY,MAC/B,OAAO,IAAU,aAAe,IAAU,SAC5C"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=
|
|
2
|
-
//# sourceMappingURL=invariants.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../services/store/invariants.cjs");exports.VALID_TRANSITIONS=e.VALID_TRANSITIONS,exports.canonicalizeTasks=e.canonicalizeTasks,exports.isTransitionValid=e.isTransitionValid;
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Allowed forward transitions per source status.
|
|
5
|
-
*
|
|
6
|
-
* `failed` is recoverable (a delegation can be retried) so it may return to
|
|
7
|
-
* pending or in_progress. `completed` is one-way to `deleted`; `deleted` is a
|
|
8
|
-
* terminal tombstone.
|
|
9
|
-
*/
|
|
10
|
-
declare const VALID_TRANSITIONS: Record<TaskStatus, ReadonlySet<TaskStatus>>;
|
|
11
|
-
declare function isTransitionValid(from: TaskStatus, to: TaskStatus): boolean;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { VALID_TRANSITIONS, isTransitionValid };
|
|
14
|
-
//# sourceMappingURL=invariants.d.cts.map
|
|
1
|
+
import { VALID_TRANSITIONS, canonicalizeTasks, isTransitionValid } from "../services/store/invariants.cjs";
|
|
2
|
+
export { VALID_TRANSITIONS, canonicalizeTasks, isTransitionValid };
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Allowed forward transitions per source status.
|
|
5
|
-
*
|
|
6
|
-
* `failed` is recoverable (a delegation can be retried) so it may return to
|
|
7
|
-
* pending or in_progress. `completed` is one-way to `deleted`; `deleted` is a
|
|
8
|
-
* terminal tombstone.
|
|
9
|
-
*/
|
|
10
|
-
declare const VALID_TRANSITIONS: Record<TaskStatus, ReadonlySet<TaskStatus>>;
|
|
11
|
-
declare function isTransitionValid(from: TaskStatus, to: TaskStatus): boolean;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { VALID_TRANSITIONS, isTransitionValid };
|
|
14
|
-
//# sourceMappingURL=invariants.d.mts.map
|
|
1
|
+
import { VALID_TRANSITIONS, canonicalizeTasks, isTransitionValid } from "../services/store/invariants.mjs";
|
|
2
|
+
export { VALID_TRANSITIONS, canonicalizeTasks, isTransitionValid };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=invariants.mjs.map
|
|
1
|
+
import{VALID_TRANSITIONS as e,canonicalizeTasks as t,isTransitionValid as n}from"../services/store/invariants.mjs";export{e as VALID_TRANSITIONS,t as canonicalizeTasks,n as isTransitionValid};
|
package/dist/store/paths.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../
|
|
2
|
-
//# sourceMappingURL=paths.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../adapters/store/paths.cjs");exports.STORE_PATH_ENV=e.STORE_PATH_ENV,exports.hasStorePathOverride=e.hasStorePathOverride,exports.lockPathFor=e.lockPathFor,exports.removeLegacyStoreDirectory=e.removeLegacyStoreDirectory,exports.removeLegacyStoreDirectoryAsync=e.removeLegacyStoreDirectoryAsync,exports.resolveLegacyStoreDirectory=e.resolveLegacyStoreDirectory,exports.resolveLegacyStoreDirectoryAsync=e.resolveLegacyStoreDirectoryAsync,exports.resolveSessionKey=e.resolveSessionKey,exports.resolveStorePath=e.resolveStorePath,exports.sweepStoreFiles=e.sweepStoreFiles,exports.sweepStoreFilesAsync=e.sweepStoreFilesAsync,exports.tempPathFor=e.tempPathFor;
|
package/dist/store/paths.d.cts
CHANGED
|
@@ -1,23 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/** Resolve the tree root without relying on extension startup order. */
|
|
4
|
-
declare function resolveSessionKey(rootSessionId: string, env?: NodeJS.ProcessEnv): string;
|
|
5
|
-
/** Resolve one root session tree to a task document under the Pi agent directory. */
|
|
6
|
-
declare function resolveStorePath(_cwd?: string, env?: NodeJS.ProcessEnv, sessionKey?: string): string;
|
|
7
|
-
/** Whether a deliberate unscoped task-store override is active. */
|
|
8
|
-
declare function hasStorePathOverride(env?: NodeJS.ProcessEnv): boolean;
|
|
9
|
-
/** Exact legacy Git-directory store, if the current working tree has one. */
|
|
10
|
-
declare function resolveLegacyStoreDirectory(cwd?: string): string | undefined;
|
|
11
|
-
interface StoreSweepResult {
|
|
12
|
-
removed: string[];
|
|
13
|
-
errors: string[];
|
|
14
|
-
}
|
|
15
|
-
/** Remove only the validated legacy Git store unless it contains the active override. */
|
|
16
|
-
declare function removeLegacyStoreDirectory(currentStorePath: string, cwd?: string): StoreSweepResult;
|
|
17
|
-
/** Delete expired sibling session stores while preserving active or unreadable stores. */
|
|
18
|
-
declare function sweepStoreFiles(currentStorePath: string, ttlMs: number, now?: number): StoreSweepResult;
|
|
19
|
-
declare function lockPathFor(storePath: string): string;
|
|
20
|
-
declare function tempPathFor(storePath: string, pid?: number): string;
|
|
21
|
-
//#endregion
|
|
22
|
-
export { STORE_PATH_ENV, StoreSweepResult, hasStorePathOverride, lockPathFor, removeLegacyStoreDirectory, resolveLegacyStoreDirectory, resolveSessionKey, resolveStorePath, sweepStoreFiles, tempPathFor };
|
|
23
|
-
//# sourceMappingURL=paths.d.cts.map
|
|
1
|
+
import { STORE_PATH_ENV, StoreSweepResult, hasStorePathOverride, lockPathFor, removeLegacyStoreDirectory, removeLegacyStoreDirectoryAsync, resolveLegacyStoreDirectory, resolveLegacyStoreDirectoryAsync, resolveSessionKey, resolveStorePath, sweepStoreFiles, sweepStoreFilesAsync, tempPathFor } from "../adapters/store/paths.cjs";
|
|
2
|
+
export { STORE_PATH_ENV, StoreSweepResult, hasStorePathOverride, lockPathFor, removeLegacyStoreDirectory, removeLegacyStoreDirectoryAsync, resolveLegacyStoreDirectory, resolveLegacyStoreDirectoryAsync, resolveSessionKey, resolveStorePath, sweepStoreFiles, sweepStoreFilesAsync, tempPathFor };
|
package/dist/store/paths.d.mts
CHANGED
|
@@ -1,23 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/** Resolve the tree root without relying on extension startup order. */
|
|
4
|
-
declare function resolveSessionKey(rootSessionId: string, env?: NodeJS.ProcessEnv): string;
|
|
5
|
-
/** Resolve one root session tree to a task document under the Pi agent directory. */
|
|
6
|
-
declare function resolveStorePath(_cwd?: string, env?: NodeJS.ProcessEnv, sessionKey?: string): string;
|
|
7
|
-
/** Whether a deliberate unscoped task-store override is active. */
|
|
8
|
-
declare function hasStorePathOverride(env?: NodeJS.ProcessEnv): boolean;
|
|
9
|
-
/** Exact legacy Git-directory store, if the current working tree has one. */
|
|
10
|
-
declare function resolveLegacyStoreDirectory(cwd?: string): string | undefined;
|
|
11
|
-
interface StoreSweepResult {
|
|
12
|
-
removed: string[];
|
|
13
|
-
errors: string[];
|
|
14
|
-
}
|
|
15
|
-
/** Remove only the validated legacy Git store unless it contains the active override. */
|
|
16
|
-
declare function removeLegacyStoreDirectory(currentStorePath: string, cwd?: string): StoreSweepResult;
|
|
17
|
-
/** Delete expired sibling session stores while preserving active or unreadable stores. */
|
|
18
|
-
declare function sweepStoreFiles(currentStorePath: string, ttlMs: number, now?: number): StoreSweepResult;
|
|
19
|
-
declare function lockPathFor(storePath: string): string;
|
|
20
|
-
declare function tempPathFor(storePath: string, pid?: number): string;
|
|
21
|
-
//#endregion
|
|
22
|
-
export { STORE_PATH_ENV, StoreSweepResult, hasStorePathOverride, lockPathFor, removeLegacyStoreDirectory, resolveLegacyStoreDirectory, resolveSessionKey, resolveStorePath, sweepStoreFiles, tempPathFor };
|
|
23
|
-
//# sourceMappingURL=paths.d.mts.map
|
|
1
|
+
import { STORE_PATH_ENV, StoreSweepResult, hasStorePathOverride, lockPathFor, removeLegacyStoreDirectory, removeLegacyStoreDirectoryAsync, resolveLegacyStoreDirectory, resolveLegacyStoreDirectoryAsync, resolveSessionKey, resolveStorePath, sweepStoreFiles, sweepStoreFilesAsync, tempPathFor } from "../adapters/store/paths.mjs";
|
|
2
|
+
export { STORE_PATH_ENV, StoreSweepResult, hasStorePathOverride, lockPathFor, removeLegacyStoreDirectory, removeLegacyStoreDirectoryAsync, resolveLegacyStoreDirectory, resolveLegacyStoreDirectoryAsync, resolveSessionKey, resolveStorePath, sweepStoreFiles, sweepStoreFilesAsync, tempPathFor };
|
package/dist/store/paths.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
//# sourceMappingURL=paths.mjs.map
|
|
1
|
+
import{STORE_PATH_ENV as e,hasStorePathOverride as t,lockPathFor as n,removeLegacyStoreDirectory as r,removeLegacyStoreDirectoryAsync as i,resolveLegacyStoreDirectory as a,resolveLegacyStoreDirectoryAsync as o,resolveSessionKey as s,resolveStorePath as c,sweepStoreFiles as l,sweepStoreFilesAsync as u,tempPathFor as d}from"../adapters/store/paths.mjs";export{e as STORE_PATH_ENV,t as hasStorePathOverride,n as lockPathFor,r as removeLegacyStoreDirectory,i as removeLegacyStoreDirectoryAsync,a as resolveLegacyStoreDirectory,o as resolveLegacyStoreDirectoryAsync,s as resolveSessionKey,c as resolveStorePath,l as sweepStoreFiles,u as sweepStoreFilesAsync,d as tempPathFor};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
2
|
-
//# sourceMappingURL=processLiveness.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../services/store/processLiveness.cjs");exports.isProcessAlive=e.isProcessAlive;
|