@agimon-ai/doompi-task 0.0.1-alpha.9 → 0.0.1-alpha.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -15
- package/dist/apiContracts.cjs +54 -0
- package/dist/apiContracts.cjs.map +1 -0
- package/dist/apiContracts.d.mts +53 -0
- package/dist/apiContracts.d.mts.map +1 -0
- package/dist/apiContracts.mjs +49 -0
- package/dist/apiContracts.mjs.map +1 -0
- package/dist/commands.cjs +4 -2
- package/dist/commands.d.mts +12 -6
- package/dist/commands.d.mts.map +1 -1
- package/dist/commands.mjs +2 -2
- package/dist/config-BPNE_wEU.cjs +173 -0
- package/dist/config-BPNE_wEU.cjs.map +1 -0
- package/dist/config-DmsCPDuF.mjs +72 -0
- package/dist/config-DmsCPDuF.mjs.map +1 -0
- package/dist/config.cjs +19 -2
- package/dist/config.d.mts +2 -38
- package/dist/config.mjs +2 -2
- package/dist/delegation-3hMdTFXF.cjs +661 -0
- package/dist/delegation-3hMdTFXF.cjs.map +1 -0
- package/dist/delegation-BiOy3_7g.mjs +7 -0
- package/dist/delegation-BiOy3_7g.mjs.map +1 -0
- package/dist/delegation-CkGbRaOl.mjs +626 -0
- package/dist/delegation-CkGbRaOl.mjs.map +1 -0
- package/dist/delegation-LDpHP2CC.cjs +12 -0
- package/dist/delegation-LDpHP2CC.cjs.map +1 -0
- package/dist/delegation-Ot2xltLi.d.mts +6 -0
- package/dist/delegation-Ot2xltLi.d.mts.map +1 -0
- package/dist/delegationManager.cjs +10 -0
- package/dist/delegationManager.d.mts +3 -0
- package/dist/delegationManager.mjs +3 -0
- package/dist/delegationPlatform-Cfn-Lqew.cjs +95 -0
- package/dist/delegationPlatform-Cfn-Lqew.cjs.map +1 -0
- package/dist/delegationPlatform-DZ4SZ8a5.mjs +64 -0
- package/dist/delegationPlatform-DZ4SZ8a5.mjs.map +1 -0
- package/dist/extensions/mcp-ui.mjs +23 -0
- package/dist/extensions/mcp-ui.mjs.map +1 -0
- package/dist/extensions/mcp.cjs +1876 -0
- package/dist/extensions/mcp.cjs.map +1 -0
- package/dist/extensions/mcp.d.mts +5 -0
- package/dist/extensions/mcp.d.mts.map +1 -0
- package/dist/extensions/mcp.mjs +1846 -0
- package/dist/extensions/mcp.mjs.map +1 -0
- package/dist/extensions/pi.cjs +437 -1
- package/dist/extensions/pi.cjs.map +1 -1
- package/dist/extensions/pi.d.mts +5 -2
- package/dist/extensions/pi.d.mts.map +1 -0
- package/dist/extensions/pi.mjs +432 -1
- package/dist/extensions/pi.mjs.map +1 -1
- package/dist/extensions/server.cjs +380 -0
- package/dist/extensions/server.cjs.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 +375 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/extensions/web.mjs +1013 -0
- package/dist/extensions/web.mjs.map +1 -0
- package/dist/format.cli-ChQsP1MQ.cjs +393 -0
- package/dist/format.cli-ChQsP1MQ.cjs.map +1 -0
- package/dist/format.cli-Cnc591eb.mjs +322 -0
- package/dist/format.cli-Cnc591eb.mjs.map +1 -0
- package/dist/{delegation/manager.d.cts → index-3-3ZJlaH.d.mts} +42 -39
- package/dist/index-3-3ZJlaH.d.mts.map +1 -0
- package/dist/{store/taskStore.d.cts → index-B7oVjSey.d.mts} +16 -23
- package/dist/index-B7oVjSey.d.mts.map +1 -0
- package/dist/{store/reconcile.d.cts → index-BNMm9g0K.d.mts} +4 -4
- package/dist/index-BNMm9g0K.d.mts.map +1 -0
- package/dist/{tool/responseEnvelope.d.cts → index-C3DgOhEm.d.mts} +17 -5
- package/dist/index-C3DgOhEm.d.mts.map +1 -0
- package/dist/{config.d.cts → index-D4goIk4Z.d.mts} +8 -3
- package/dist/index-D4goIk4Z.d.mts.map +1 -0
- package/dist/{store/reducer.d.mts → index-DIpc6_uJ.d.mts} +5 -5
- package/dist/index-DIpc6_uJ.d.mts.map +1 -0
- package/dist/{store/paths.d.cts → index-XY9VPmfm.d.mts} +9 -6
- package/dist/index-XY9VPmfm.d.mts.map +1 -0
- package/dist/index.cjs +106 -1
- package/dist/index.d.mts +16 -15
- package/dist/index.mjs +16 -1
- package/dist/invariants-DhjEjBPU.cjs +79 -0
- package/dist/invariants-DhjEjBPU.cjs.map +1 -0
- package/dist/invariants-q_UamF7D.mjs +62 -0
- package/dist/invariants-q_UamF7D.mjs.map +1 -0
- package/dist/logSinkTelemetry-C5QjZipw.mjs +41 -0
- package/dist/logSinkTelemetry-C5QjZipw.mjs.map +1 -0
- package/dist/logSinkTelemetry-CqiTuh3a.cjs +52 -0
- package/dist/logSinkTelemetry-CqiTuh3a.cjs.map +1 -0
- package/dist/logSinkTelemetry.cjs +6 -2
- package/dist/logSinkTelemetry.d.mts +7 -35
- package/dist/logSinkTelemetry.d.mts.map +1 -1
- package/dist/logSinkTelemetry.mjs +3 -2
- package/dist/paths-Bg8EEbk1.mjs +218 -0
- package/dist/paths-Bg8EEbk1.mjs.map +1 -0
- package/dist/paths-BsFVRulr.cjs +320 -0
- package/dist/paths-BsFVRulr.cjs.map +1 -0
- package/dist/processLiveness-Ccd9wenT.mjs +20 -0
- package/dist/processLiveness-Ccd9wenT.mjs.map +1 -0
- package/dist/processLiveness-umpNgsPR.cjs +25 -0
- package/dist/processLiveness-umpNgsPR.cjs.map +1 -0
- package/dist/promptGuidelines-DaxWrqud.d.mts +14 -0
- package/dist/promptGuidelines-DaxWrqud.d.mts.map +1 -0
- package/dist/promptGuidelines-g4QT8GNM.mjs +26 -0
- package/dist/promptGuidelines-g4QT8GNM.mjs.map +1 -0
- package/dist/promptGuidelines-j_SZTzlH.cjs +31 -0
- package/dist/promptGuidelines-j_SZTzlH.cjs.map +1 -0
- package/dist/reconcile-BcD-hTbd.mjs +63 -0
- package/dist/reconcile-BcD-hTbd.mjs.map +1 -0
- package/dist/reconcile-cRL0NjDr.cjs +80 -0
- package/dist/reconcile-cRL0NjDr.cjs.map +1 -0
- package/dist/reducer-BEfJFM5L.mjs +345 -0
- package/dist/reducer-BEfJFM5L.mjs.map +1 -0
- package/dist/reducer-BV0YIZ2o.cjs +380 -0
- package/dist/reducer-BV0YIZ2o.cjs.map +1 -0
- package/dist/root.cli-swHZqusx.d.mts +56 -0
- package/dist/root.cli-swHZqusx.d.mts.map +1 -0
- package/dist/selectors-BaS6dObz.mjs +142 -0
- package/dist/selectors-BaS6dObz.mjs.map +1 -0
- package/dist/{tui/selectors.d.cts → selectors-DPDPPjH3.d.mts} +11 -4
- package/dist/selectors-DPDPPjH3.d.mts.map +1 -0
- package/dist/selectors-b-69vb4W.cjs +189 -0
- package/dist/selectors-b-69vb4W.cjs.map +1 -0
- package/dist/storeInvariants.cjs +5 -0
- package/dist/storeInvariants.d.mts +23 -0
- package/dist/storeInvariants.d.mts.map +1 -0
- package/dist/storeInvariants.mjs +2 -0
- package/dist/storePaths.cjs +14 -0
- package/dist/storePaths.d.mts +2 -0
- package/dist/storePaths.mjs +2 -0
- package/dist/storeProcessLiveness.cjs +3 -0
- package/dist/{store/processLiveness.d.mts → storeProcessLiveness.d.mts} +3 -4
- package/dist/storeProcessLiveness.d.mts.map +1 -0
- package/dist/storeProcessLiveness.mjs +2 -0
- package/dist/storeReconcile.cjs +5 -0
- package/dist/storeReconcile.d.mts +2 -0
- package/dist/storeReconcile.mjs +2 -0
- package/dist/storeReducer.cjs +8 -0
- package/dist/storeReducer.d.mts +2 -0
- package/dist/storeReducer.mjs +2 -0
- package/dist/storeTaskGraph.cjs +7 -0
- package/dist/storeTaskGraph.d.mts +2 -0
- package/dist/storeTaskGraph.mjs +2 -0
- package/dist/storeTaskStore.cjs +3 -0
- package/dist/storeTaskStore.d.mts +2 -0
- package/dist/storeTaskStore.mjs +2 -0
- package/dist/storeTypes.cjs +6 -0
- package/dist/storeTypes.d.mts +2 -0
- package/dist/storeTypes.mjs +2 -0
- package/dist/task-B4aF5J9s.mjs +6 -0
- package/dist/task-B4aF5J9s.mjs.map +1 -0
- package/dist/task-CXF9VULl.cjs +49 -0
- package/dist/task-CXF9VULl.cjs.map +1 -0
- package/dist/task-CkFjC3Fo.d.mts +5 -0
- package/dist/task-CkFjC3Fo.d.mts.map +1 -0
- package/dist/{tool/schema.d.cts → task-DHSvdK6E.d.mts} +34 -18
- package/dist/task-DHSvdK6E.d.mts.map +1 -0
- package/dist/task-DKHKuems.mjs +116 -0
- package/dist/task-DKHKuems.mjs.map +1 -0
- package/dist/task-DaagqdPK.cjs +11 -0
- package/dist/task-DaagqdPK.cjs.map +1 -0
- package/dist/task-Dqy88_rr.cjs +193 -0
- package/dist/task-Dqy88_rr.cjs.map +1 -0
- package/dist/task-giCbpKzV.mjs +26 -0
- package/dist/task-giCbpKzV.mjs.map +1 -0
- package/dist/{store/types.d.mts → task-hLh4BOO7.d.mts} +37 -15
- package/dist/task-hLh4BOO7.d.mts.map +1 -0
- package/dist/task-space.cli-BH4Iy_7m.cjs +372 -0
- package/dist/task-space.cli-BH4Iy_7m.cjs.map +1 -0
- package/dist/task-space.cli-CMYNjgOW.mjs +355 -0
- package/dist/task-space.cli-CMYNjgOW.mjs.map +1 -0
- package/dist/task.cli-BM34E7GG.mjs +157 -0
- package/dist/task.cli-BM34E7GG.mjs.map +1 -0
- package/dist/task.cli-CiTkjUaX.cjs +174 -0
- package/dist/task.cli-CiTkjUaX.cjs.map +1 -0
- package/dist/taskGraph-BOQvT0-M.mjs +63 -0
- package/dist/taskGraph-BOQvT0-M.mjs.map +1 -0
- package/dist/taskGraph-BskRslrr.cjs +92 -0
- package/dist/taskGraph-BskRslrr.cjs.map +1 -0
- package/dist/{store/taskGraph.d.cts → taskGraph-YQXCfXTn.d.mts} +4 -4
- package/dist/taskGraph-YQXCfXTn.d.mts.map +1 -0
- package/dist/taskOverlay-B5wJHiml.cjs +175 -0
- package/dist/taskOverlay-B5wJHiml.cjs.map +1 -0
- package/dist/taskOverlay-CljDoTj_.mjs +164 -0
- package/dist/taskOverlay-CljDoTj_.mjs.map +1 -0
- package/dist/taskResult-D2G7b4w-.cjs +224 -0
- package/dist/taskResult-D2G7b4w-.cjs.map +1 -0
- package/dist/taskResult-edBAAKSH.mjs +165 -0
- package/dist/taskResult-edBAAKSH.mjs.map +1 -0
- package/dist/taskStore-CFx12KJk.mjs +213 -0
- package/dist/taskStore-CFx12KJk.mjs.map +1 -0
- package/dist/taskStore-T1pPy-UJ.cjs +220 -0
- package/dist/taskStore-T1pPy-UJ.cjs.map +1 -0
- package/dist/tasks.cli-8VvuN9YQ.cjs +40 -0
- package/dist/tasks.cli-8VvuN9YQ.cjs.map +1 -0
- package/dist/tasks.cli-BZj83YD_.mjs +29 -0
- package/dist/tasks.cli-BZj83YD_.mjs.map +1 -0
- package/dist/telemetry-DOyZLj8E.d.mts +36 -0
- package/dist/telemetry-DOyZLj8E.d.mts.map +1 -0
- package/dist/telemetry-I4md7Xzz.cjs +31 -0
- package/dist/telemetry-I4md7Xzz.cjs.map +1 -0
- package/dist/telemetry-PmX_1Y8a.mjs +26 -0
- package/dist/telemetry-PmX_1Y8a.mjs.map +1 -0
- package/dist/toolPromptGuidelines.cjs +3 -0
- package/dist/toolPromptGuidelines.d.mts +2 -0
- package/dist/toolPromptGuidelines.mjs +2 -0
- package/dist/toolResponseEnvelope.cjs +12 -0
- package/dist/toolResponseEnvelope.d.mts +2 -0
- package/dist/toolResponseEnvelope.mjs +2 -0
- package/dist/toolSchema.cjs +17 -0
- package/dist/toolSchema.d.mts +3 -0
- package/dist/toolSchema.mjs +3 -0
- package/dist/toolTaskTool.cjs +6 -0
- package/dist/toolTaskTool.d.mts +3 -0
- package/dist/toolTaskTool.mjs +3 -0
- package/dist/tuiFormat.cjs +14 -0
- package/dist/tuiFormat.d.mts +61 -0
- package/dist/tuiFormat.d.mts.map +1 -0
- package/dist/tuiFormat.mjs +2 -0
- package/dist/tuiSelectors.cjs +10 -0
- package/dist/tuiSelectors.d.mts +2 -0
- package/dist/tuiSelectors.mjs +2 -0
- package/dist/tuiTaskOverlay.cjs +4 -0
- package/dist/{tui/taskOverlay.d.cts → tuiTaskOverlay.d.mts} +9 -8
- package/dist/tuiTaskOverlay.d.mts.map +1 -0
- package/dist/tuiTaskOverlay.mjs +2 -0
- package/dist/tuiTaskSpace.cjs +5 -0
- package/dist/{tui/taskSpace.d.cts → tuiTaskSpace.d.mts} +11 -12
- package/dist/tuiTaskSpace.d.mts.map +1 -0
- package/dist/tuiTaskSpace.mjs +2 -0
- package/package.json +175 -109
- package/src/types/webTasks.ts +24 -0
- package/dist/_virtual/_rolldown/runtime.cjs +0 -1
- package/dist/commands.cjs.map +0 -1
- package/dist/commands.d.cts +0 -14
- package/dist/commands.d.cts.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 +0 -189
- 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/extensions/pi.d.cts +0 -2
- package/dist/index.d.cts +0 -15
- package/dist/logSinkTelemetry.cjs.map +0 -1
- package/dist/logSinkTelemetry.d.cts +0 -51
- package/dist/logSinkTelemetry.d.cts.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.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 +0 -12
- package/dist/store/processLiveness.d.cts.map +0 -1
- package/dist/store/processLiveness.d.mts.map +0 -1
- package/dist/store/processLiveness.mjs +0 -2
- package/dist/store/processLiveness.mjs.map +0 -1
- package/dist/store/reconcile.cjs +0 -2
- package/dist/store/reconcile.cjs.map +0 -1
- package/dist/store/reconcile.d.cts.map +0 -1
- package/dist/store/reconcile.d.mts +0 -34
- 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 +0 -72
- 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 +0 -25
- package/dist/store/taskGraph.d.mts.map +0 -1
- package/dist/store/taskGraph.mjs +0 -2
- 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 +0 -77
- 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 +0 -165
- package/dist/store/types.d.cts.map +0 -1
- package/dist/store/types.d.mts.map +0 -1
- package/dist/store/types.mjs +0 -2
- package/dist/store/types.mjs.map +0 -1
- package/dist/tool/promptGuidelines.cjs +0 -2
- package/dist/tool/promptGuidelines.cjs.map +0 -1
- package/dist/tool/promptGuidelines.d.cts +0 -5
- package/dist/tool/promptGuidelines.d.cts.map +0 -1
- package/dist/tool/promptGuidelines.d.mts +0 -5
- package/dist/tool/promptGuidelines.d.mts.map +0 -1
- package/dist/tool/promptGuidelines.mjs +0 -2
- package/dist/tool/promptGuidelines.mjs.map +0 -1
- package/dist/tool/responseEnvelope.cjs +0 -6
- package/dist/tool/responseEnvelope.cjs.map +0 -1
- package/dist/tool/responseEnvelope.d.cts.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 +0 -86
- package/dist/tool/schema.d.mts.map +0 -1
- package/dist/tool/schema.mjs +0 -2
- package/dist/tool/schema.mjs.map +0 -1
- package/dist/tool/taskTool.cjs +0 -3
- package/dist/tool/taskTool.cjs.map +0 -1
- package/dist/tool/taskTool.d.cts +0 -17
- package/dist/tool/taskTool.d.cts.map +0 -1
- package/dist/tool/taskTool.d.mts +0 -17
- package/dist/tool/taskTool.d.mts.map +0 -1
- package/dist/tool/taskTool.mjs +0 -3
- package/dist/tool/taskTool.mjs.map +0 -1
- package/dist/tui/format.cjs +0 -4
- package/dist/tui/format.cjs.map +0 -1
- package/dist/tui/format.d.cts +0 -62
- package/dist/tui/format.d.cts.map +0 -1
- package/dist/tui/format.d.mts +0 -62
- package/dist/tui/format.d.mts.map +0 -1
- package/dist/tui/format.mjs +0 -4
- package/dist/tui/format.mjs.map +0 -1
- package/dist/tui/selectors.cjs +0 -2
- package/dist/tui/selectors.cjs.map +0 -1
- package/dist/tui/selectors.d.cts.map +0 -1
- package/dist/tui/selectors.d.mts +0 -53
- package/dist/tui/selectors.d.mts.map +0 -1
- package/dist/tui/selectors.mjs +0 -2
- package/dist/tui/selectors.mjs.map +0 -1
- package/dist/tui/taskOverlay.cjs +0 -2
- package/dist/tui/taskOverlay.cjs.map +0 -1
- package/dist/tui/taskOverlay.d.cts.map +0 -1
- package/dist/tui/taskOverlay.d.mts +0 -38
- package/dist/tui/taskOverlay.d.mts.map +0 -1
- package/dist/tui/taskOverlay.mjs +0 -2
- package/dist/tui/taskOverlay.mjs.map +0 -1
- package/dist/tui/taskSpace.cjs +0 -5
- package/dist/tui/taskSpace.cjs.map +0 -1
- package/dist/tui/taskSpace.d.cts.map +0 -1
- package/dist/tui/taskSpace.d.mts +0 -61
- package/dist/tui/taskSpace.d.mts.map +0 -1
- package/dist/tui/taskSpace.mjs +0 -5
- package/dist/tui/taskSpace.mjs.map +0 -1
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
let node_child_process = require("node:child_process");
|
|
24
|
+
let node_fs = require("node:fs");
|
|
25
|
+
node_fs = __toESM(node_fs, 1);
|
|
26
|
+
let node_os = require("node:os");
|
|
27
|
+
node_os = __toESM(node_os, 1);
|
|
28
|
+
let node_path = require("node:path");
|
|
29
|
+
node_path = __toESM(node_path, 1);
|
|
30
|
+
let _agimon_ai_doompi_core_childProcess = require("@agimon-ai/doompi-core/childProcess");
|
|
31
|
+
//#region src/services/paths/index.ts
|
|
32
|
+
const STORE_PATH_ENV = "DOOM_TASK_STORE";
|
|
33
|
+
const STORE_DIR_NAME = "doom-task";
|
|
34
|
+
const STORE_FILE_NAME = "tasks.json";
|
|
35
|
+
const DEFAULT_CONFIG_DIR_NAME = ".pi";
|
|
36
|
+
const AGENT_DIR_NAME = "agent";
|
|
37
|
+
const PI_CODING_AGENT_DIR_ENV = "PI_CODING_AGENT_DIR";
|
|
38
|
+
const HOME_ALIAS = "~";
|
|
39
|
+
const HOME_ALIAS_PREFIX = "~/";
|
|
40
|
+
const FILE_ENCODING = "utf8";
|
|
41
|
+
const NOT_FOUND_ERROR_CODE = "ENOENT";
|
|
42
|
+
function git(args, cwd) {
|
|
43
|
+
try {
|
|
44
|
+
const trimmed = (0, node_child_process.execFileSync)("git", args, {
|
|
45
|
+
cwd,
|
|
46
|
+
encoding: FILE_ENCODING,
|
|
47
|
+
stdio: [
|
|
48
|
+
"ignore",
|
|
49
|
+
"pipe",
|
|
50
|
+
"ignore"
|
|
51
|
+
]
|
|
52
|
+
}).trim();
|
|
53
|
+
return trimmed.length > 0 ? trimmed : void 0;
|
|
54
|
+
} catch {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async function gitAsync(args, cwd) {
|
|
59
|
+
return new Promise((resolve) => {
|
|
60
|
+
(0, node_child_process.execFile)("git", args, {
|
|
61
|
+
cwd,
|
|
62
|
+
encoding: FILE_ENCODING
|
|
63
|
+
}, (error, stdout) => {
|
|
64
|
+
if (error) {
|
|
65
|
+
resolve(void 0);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const trimmed = stdout.trim();
|
|
69
|
+
resolve(trimmed.length > 0 ? trimmed : void 0);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function resolveAgentDirectory(env) {
|
|
74
|
+
const configured = env[PI_CODING_AGENT_DIR_ENV]?.trim();
|
|
75
|
+
if (configured === HOME_ALIAS) return node_os.default.homedir();
|
|
76
|
+
if (configured?.startsWith(HOME_ALIAS_PREFIX)) return node_path.default.join(node_os.default.homedir(), configured.slice(2));
|
|
77
|
+
return configured ? node_path.default.resolve(configured) : node_path.default.join(node_os.default.homedir(), DEFAULT_CONFIG_DIR_NAME, AGENT_DIR_NAME);
|
|
78
|
+
}
|
|
79
|
+
function isWithin(root, candidate) {
|
|
80
|
+
const relative = node_path.default.relative(node_path.default.resolve(root), node_path.default.resolve(candidate));
|
|
81
|
+
return relative === "" || !relative.startsWith("..") && !node_path.default.isAbsolute(relative);
|
|
82
|
+
}
|
|
83
|
+
/** Resolve the tree root without relying on extension startup order. */
|
|
84
|
+
function resolveSessionKey(rootSessionId, env = process.env) {
|
|
85
|
+
if (!env[_agimon_ai_doompi_core_childProcess.SUBAGENT_CHILD_ENV]) return rootSessionId;
|
|
86
|
+
const parentSessionId = env[_agimon_ai_doompi_core_childProcess.SUBAGENT_PARENT_SESSION_ENV]?.trim();
|
|
87
|
+
if (!parentSessionId) throw new Error(`${_agimon_ai_doompi_core_childProcess.SUBAGENT_PARENT_SESSION_ENV} is required in a subagent child`);
|
|
88
|
+
return parentSessionId;
|
|
89
|
+
}
|
|
90
|
+
/** Resolve one root session tree to a task document under the Pi agent directory. */
|
|
91
|
+
function resolveStorePath(_cwd = process.cwd(), env = process.env, sessionKey = "standalone") {
|
|
92
|
+
const override = env[STORE_PATH_ENV]?.trim();
|
|
93
|
+
if (override) return node_path.default.resolve(override);
|
|
94
|
+
const trimmedSessionKey = sessionKey.trim();
|
|
95
|
+
if (!trimmedSessionKey) throw new Error("doom-task session id cannot be blank");
|
|
96
|
+
return node_path.default.join(resolveAgentDirectory(env), STORE_DIR_NAME, trimmedSessionKey, STORE_FILE_NAME);
|
|
97
|
+
}
|
|
98
|
+
/** Whether a deliberate unscoped task-store override is active. */
|
|
99
|
+
function hasStorePathOverride(env = process.env) {
|
|
100
|
+
return Boolean(env[STORE_PATH_ENV]?.trim());
|
|
101
|
+
}
|
|
102
|
+
/** Exact legacy Git-directory store, if the current working tree has one. */
|
|
103
|
+
function resolveLegacyStoreDirectory(cwd = process.cwd()) {
|
|
104
|
+
const commonDirectory = git([
|
|
105
|
+
"rev-parse",
|
|
106
|
+
"--path-format=absolute",
|
|
107
|
+
"--git-common-dir"
|
|
108
|
+
], cwd);
|
|
109
|
+
return commonDirectory ? node_path.default.join(commonDirectory, STORE_DIR_NAME) : void 0;
|
|
110
|
+
}
|
|
111
|
+
async function resolveLegacyStoreDirectoryAsync(cwd = process.cwd()) {
|
|
112
|
+
const commonDirectory = await gitAsync([
|
|
113
|
+
"rev-parse",
|
|
114
|
+
"--path-format=absolute",
|
|
115
|
+
"--git-common-dir"
|
|
116
|
+
], cwd);
|
|
117
|
+
return commonDirectory ? node_path.default.join(commonDirectory, STORE_DIR_NAME) : void 0;
|
|
118
|
+
}
|
|
119
|
+
/** Remove only the validated legacy Git store unless it contains the active override. */
|
|
120
|
+
function removeLegacyStoreDirectory(currentStorePath, cwd = process.cwd()) {
|
|
121
|
+
const result = {
|
|
122
|
+
removed: [],
|
|
123
|
+
errors: []
|
|
124
|
+
};
|
|
125
|
+
const target = resolveLegacyStoreDirectory(cwd);
|
|
126
|
+
if (!target || node_path.default.basename(target) !== STORE_DIR_NAME || isWithin(target, currentStorePath)) return result;
|
|
127
|
+
try {
|
|
128
|
+
if (!node_fs.default.existsSync(target)) return result;
|
|
129
|
+
node_fs.default.rmSync(target, {
|
|
130
|
+
recursive: true,
|
|
131
|
+
force: true
|
|
132
|
+
});
|
|
133
|
+
result.removed.push(target);
|
|
134
|
+
} catch (error) {
|
|
135
|
+
result.errors.push(`Could not remove legacy task store ${target}: ${String(error)}`);
|
|
136
|
+
}
|
|
137
|
+
return result;
|
|
138
|
+
}
|
|
139
|
+
async function removeLegacyStoreDirectoryAsync(currentStorePath, cwd = process.cwd()) {
|
|
140
|
+
const result = {
|
|
141
|
+
removed: [],
|
|
142
|
+
errors: []
|
|
143
|
+
};
|
|
144
|
+
const target = await resolveLegacyStoreDirectoryAsync(cwd);
|
|
145
|
+
if (!target || node_path.default.basename(target) !== STORE_DIR_NAME || isWithin(target, currentStorePath)) return result;
|
|
146
|
+
try {
|
|
147
|
+
await node_fs.default.promises.access(target);
|
|
148
|
+
await node_fs.default.promises.rm(target, {
|
|
149
|
+
recursive: true,
|
|
150
|
+
force: true
|
|
151
|
+
});
|
|
152
|
+
result.removed.push(target);
|
|
153
|
+
} catch (error) {
|
|
154
|
+
if (error.code !== NOT_FOUND_ERROR_CODE) result.errors.push(`Could not remove legacy task store ${target}: ${String(error)}`);
|
|
155
|
+
}
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
/** Delete expired sibling session stores while preserving active or unreadable stores. */
|
|
159
|
+
function sweepStoreFiles(currentStorePath, ttlMs, now = Date.now()) {
|
|
160
|
+
const result = {
|
|
161
|
+
removed: [],
|
|
162
|
+
errors: []
|
|
163
|
+
};
|
|
164
|
+
const currentSessionDirectory = node_path.default.dirname(currentStorePath);
|
|
165
|
+
const storeDirectory = node_path.default.dirname(currentSessionDirectory);
|
|
166
|
+
let entries;
|
|
167
|
+
try {
|
|
168
|
+
entries = node_fs.default.readdirSync(storeDirectory);
|
|
169
|
+
} catch (error) {
|
|
170
|
+
if (error.code === NOT_FOUND_ERROR_CODE) return result;
|
|
171
|
+
result.errors.push(`Could not read task store directory ${storeDirectory}: ${String(error)}`);
|
|
172
|
+
return result;
|
|
173
|
+
}
|
|
174
|
+
for (const entry of entries) {
|
|
175
|
+
const sessionDirectory = node_path.default.join(storeDirectory, entry);
|
|
176
|
+
const candidate = node_path.default.join(sessionDirectory, STORE_FILE_NAME);
|
|
177
|
+
if (sessionDirectory === currentSessionDirectory || !node_fs.default.existsSync(candidate)) continue;
|
|
178
|
+
try {
|
|
179
|
+
if (node_fs.default.existsSync(lockPathFor(candidate))) continue;
|
|
180
|
+
JSON.parse(node_fs.default.readFileSync(candidate, FILE_ENCODING));
|
|
181
|
+
if (now - node_fs.default.statSync(candidate).mtimeMs <= ttlMs) continue;
|
|
182
|
+
node_fs.default.rmSync(sessionDirectory, {
|
|
183
|
+
recursive: true,
|
|
184
|
+
force: true
|
|
185
|
+
});
|
|
186
|
+
result.removed.push(sessionDirectory);
|
|
187
|
+
} catch (error) {
|
|
188
|
+
result.errors.push(`Could not sweep task store ${candidate}: ${String(error)}`);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return result;
|
|
192
|
+
}
|
|
193
|
+
async function sweepStoreFilesAsync(currentStorePath, ttlMs, now = Date.now()) {
|
|
194
|
+
const result = {
|
|
195
|
+
removed: [],
|
|
196
|
+
errors: []
|
|
197
|
+
};
|
|
198
|
+
const currentSessionDirectory = node_path.default.dirname(currentStorePath);
|
|
199
|
+
const storeDirectory = node_path.default.dirname(currentSessionDirectory);
|
|
200
|
+
let entries;
|
|
201
|
+
try {
|
|
202
|
+
entries = await node_fs.default.promises.readdir(storeDirectory);
|
|
203
|
+
} catch (error) {
|
|
204
|
+
if (error.code === NOT_FOUND_ERROR_CODE) return result;
|
|
205
|
+
result.errors.push(`Could not read task store directory ${storeDirectory}: ${String(error)}`);
|
|
206
|
+
return result;
|
|
207
|
+
}
|
|
208
|
+
for (const entry of entries) {
|
|
209
|
+
const sessionDirectory = node_path.default.join(storeDirectory, entry);
|
|
210
|
+
const candidate = node_path.default.join(sessionDirectory, STORE_FILE_NAME);
|
|
211
|
+
if (sessionDirectory === currentSessionDirectory) continue;
|
|
212
|
+
try {
|
|
213
|
+
await node_fs.default.promises.access(candidate);
|
|
214
|
+
try {
|
|
215
|
+
await node_fs.default.promises.access(lockPathFor(candidate));
|
|
216
|
+
continue;
|
|
217
|
+
} catch (error) {
|
|
218
|
+
if (error.code !== NOT_FOUND_ERROR_CODE) throw error;
|
|
219
|
+
}
|
|
220
|
+
JSON.parse(await node_fs.default.promises.readFile(candidate, FILE_ENCODING));
|
|
221
|
+
if (now - (await node_fs.default.promises.stat(candidate)).mtimeMs <= ttlMs) continue;
|
|
222
|
+
await node_fs.default.promises.rm(sessionDirectory, {
|
|
223
|
+
recursive: true,
|
|
224
|
+
force: true
|
|
225
|
+
});
|
|
226
|
+
result.removed.push(sessionDirectory);
|
|
227
|
+
} catch (error) {
|
|
228
|
+
if (error.code === NOT_FOUND_ERROR_CODE) continue;
|
|
229
|
+
result.errors.push(`Could not sweep task store ${candidate}: ${String(error)}`);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return result;
|
|
233
|
+
}
|
|
234
|
+
function lockPathFor(storePath) {
|
|
235
|
+
return `${storePath}.lock`;
|
|
236
|
+
}
|
|
237
|
+
function tempPathFor(storePath, pid = process.pid) {
|
|
238
|
+
return `${storePath}.tmp.${pid}`;
|
|
239
|
+
}
|
|
240
|
+
//#endregion
|
|
241
|
+
Object.defineProperty(exports, "STORE_PATH_ENV", {
|
|
242
|
+
enumerable: true,
|
|
243
|
+
get: function() {
|
|
244
|
+
return STORE_PATH_ENV;
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
Object.defineProperty(exports, "__toESM", {
|
|
248
|
+
enumerable: true,
|
|
249
|
+
get: function() {
|
|
250
|
+
return __toESM;
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
Object.defineProperty(exports, "hasStorePathOverride", {
|
|
254
|
+
enumerable: true,
|
|
255
|
+
get: function() {
|
|
256
|
+
return hasStorePathOverride;
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
Object.defineProperty(exports, "lockPathFor", {
|
|
260
|
+
enumerable: true,
|
|
261
|
+
get: function() {
|
|
262
|
+
return lockPathFor;
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
Object.defineProperty(exports, "removeLegacyStoreDirectory", {
|
|
266
|
+
enumerable: true,
|
|
267
|
+
get: function() {
|
|
268
|
+
return removeLegacyStoreDirectory;
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
Object.defineProperty(exports, "removeLegacyStoreDirectoryAsync", {
|
|
272
|
+
enumerable: true,
|
|
273
|
+
get: function() {
|
|
274
|
+
return removeLegacyStoreDirectoryAsync;
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
Object.defineProperty(exports, "resolveLegacyStoreDirectory", {
|
|
278
|
+
enumerable: true,
|
|
279
|
+
get: function() {
|
|
280
|
+
return resolveLegacyStoreDirectory;
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
Object.defineProperty(exports, "resolveLegacyStoreDirectoryAsync", {
|
|
284
|
+
enumerable: true,
|
|
285
|
+
get: function() {
|
|
286
|
+
return resolveLegacyStoreDirectoryAsync;
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
Object.defineProperty(exports, "resolveSessionKey", {
|
|
290
|
+
enumerable: true,
|
|
291
|
+
get: function() {
|
|
292
|
+
return resolveSessionKey;
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
Object.defineProperty(exports, "resolveStorePath", {
|
|
296
|
+
enumerable: true,
|
|
297
|
+
get: function() {
|
|
298
|
+
return resolveStorePath;
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
Object.defineProperty(exports, "sweepStoreFiles", {
|
|
302
|
+
enumerable: true,
|
|
303
|
+
get: function() {
|
|
304
|
+
return sweepStoreFiles;
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
Object.defineProperty(exports, "sweepStoreFilesAsync", {
|
|
308
|
+
enumerable: true,
|
|
309
|
+
get: function() {
|
|
310
|
+
return sweepStoreFilesAsync;
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
Object.defineProperty(exports, "tempPathFor", {
|
|
314
|
+
enumerable: true,
|
|
315
|
+
get: function() {
|
|
316
|
+
return tempPathFor;
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
//# sourceMappingURL=paths-BsFVRulr.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths-BsFVRulr.cjs","names":["execFileSync","os","path","SUBAGENT_CHILD_ENV","SUBAGENT_PARENT_SESSION_ENV","fs"],"sources":["../src/services/paths/index.ts"],"sourcesContent":["import { execFile, execFileSync } from 'node:child_process';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport { SUBAGENT_CHILD_ENV, SUBAGENT_PARENT_SESSION_ENV } from '@agimon-ai/doompi-core/childProcess';\n\nexport const STORE_PATH_ENV = 'DOOM_TASK_STORE';\n\nconst STORE_DIR_NAME = 'doom-task';\nconst STORE_FILE_NAME = 'tasks.json';\nconst DEFAULT_CONFIG_DIR_NAME = '.pi';\nconst AGENT_DIR_NAME = 'agent';\nconst PI_CODING_AGENT_DIR_ENV = 'PI_CODING_AGENT_DIR';\nconst HOME_ALIAS = '~';\nconst HOME_ALIAS_PREFIX = '~/';\nconst FILE_ENCODING = 'utf8';\nconst NOT_FOUND_ERROR_CODE = 'ENOENT';\n\nfunction git(args: string[], cwd: string): string | undefined {\n try {\n const output = execFileSync('git', args, {\n cwd,\n encoding: FILE_ENCODING,\n stdio: ['ignore', 'pipe', 'ignore'],\n });\n const trimmed = output.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n } catch {\n return undefined;\n }\n}\n\nasync function gitAsync(args: string[], cwd: string): Promise<string | undefined> {\n return new Promise((resolve) => {\n execFile('git', args, { cwd, encoding: FILE_ENCODING }, (error, stdout) => {\n if (error) {\n resolve(undefined);\n return;\n }\n const trimmed = stdout.trim();\n resolve(trimmed.length > 0 ? trimmed : undefined);\n });\n });\n}\n\nfunction resolveAgentDirectory(env: Readonly<Record<string, string | undefined>>): string {\n const configured = env[PI_CODING_AGENT_DIR_ENV]?.trim();\n if (configured === HOME_ALIAS) return os.homedir();\n if (configured?.startsWith(HOME_ALIAS_PREFIX)) {\n return path.join(os.homedir(), configured.slice(HOME_ALIAS_PREFIX.length));\n }\n return configured ? path.resolve(configured) : path.join(os.homedir(), DEFAULT_CONFIG_DIR_NAME, AGENT_DIR_NAME);\n}\n\nfunction isWithin(root: string, candidate: string): boolean {\n const relative = path.relative(path.resolve(root), path.resolve(candidate));\n return relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));\n}\n\n/** Resolve the tree root without relying on extension startup order. */\nexport function resolveSessionKey(\n rootSessionId: string,\n env: Readonly<Record<string, string | undefined>> = process.env,\n): string {\n if (!env[SUBAGENT_CHILD_ENV]) return rootSessionId;\n const parentSessionId = env[SUBAGENT_PARENT_SESSION_ENV]?.trim();\n if (!parentSessionId) throw new Error(`${SUBAGENT_PARENT_SESSION_ENV} is required in a subagent child`);\n return parentSessionId;\n}\n\n/** Resolve one root session tree to a task document under the Pi agent directory. */\nexport function resolveStorePath(\n _cwd: string = process.cwd(),\n env: Readonly<Record<string, string | undefined>> = process.env,\n sessionKey: string = 'standalone',\n): string {\n const override = env[STORE_PATH_ENV]?.trim();\n if (override) return path.resolve(override);\n\n const trimmedSessionKey = sessionKey.trim();\n if (!trimmedSessionKey) throw new Error('doom-task session id cannot be blank');\n return path.join(resolveAgentDirectory(env), STORE_DIR_NAME, trimmedSessionKey, STORE_FILE_NAME);\n}\n\n/** Whether a deliberate unscoped task-store override is active. */\nexport function hasStorePathOverride(env: Readonly<Record<string, string | undefined>> = process.env): boolean {\n return Boolean(env[STORE_PATH_ENV]?.trim());\n}\n\n/** Exact legacy Git-directory store, if the current working tree has one. */\nexport function resolveLegacyStoreDirectory(cwd: string = process.cwd()): string | undefined {\n const commonDirectory = git(['rev-parse', '--path-format=absolute', '--git-common-dir'], cwd);\n return commonDirectory ? path.join(commonDirectory, STORE_DIR_NAME) : undefined;\n}\n\nexport async function resolveLegacyStoreDirectoryAsync(cwd: string = process.cwd()): Promise<string | undefined> {\n const commonDirectory = await gitAsync(['rev-parse', '--path-format=absolute', '--git-common-dir'], cwd);\n return commonDirectory ? path.join(commonDirectory, STORE_DIR_NAME) : undefined;\n}\n\nexport interface StoreSweepResult {\n removed: string[];\n errors: string[];\n}\n\n/** Remove only the validated legacy Git store unless it contains the active override. */\nexport function removeLegacyStoreDirectory(currentStorePath: string, cwd: string = process.cwd()): StoreSweepResult {\n const result: StoreSweepResult = { removed: [], errors: [] };\n const target = resolveLegacyStoreDirectory(cwd);\n if (!target || path.basename(target) !== STORE_DIR_NAME || isWithin(target, currentStorePath)) return result;\n\n try {\n if (!fs.existsSync(target)) return result;\n fs.rmSync(target, { recursive: true, force: true });\n result.removed.push(target);\n } catch (error) {\n result.errors.push(`Could not remove legacy task store ${target}: ${String(error)}`);\n }\n return result;\n}\n\nexport async function removeLegacyStoreDirectoryAsync(\n currentStorePath: string,\n cwd: string = process.cwd(),\n): Promise<StoreSweepResult> {\n const result: StoreSweepResult = { removed: [], errors: [] };\n const target = await resolveLegacyStoreDirectoryAsync(cwd);\n if (!target || path.basename(target) !== STORE_DIR_NAME || isWithin(target, currentStorePath)) return result;\n\n try {\n await fs.promises.access(target);\n await fs.promises.rm(target, { recursive: true, force: true });\n result.removed.push(target);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== NOT_FOUND_ERROR_CODE) {\n result.errors.push(`Could not remove legacy task store ${target}: ${String(error)}`);\n }\n }\n return result;\n}\n\n/** Delete expired sibling session stores while preserving active or unreadable stores. */\nexport function sweepStoreFiles(currentStorePath: string, ttlMs: number, now: number = Date.now()): StoreSweepResult {\n const result: StoreSweepResult = { removed: [], errors: [] };\n const currentSessionDirectory = path.dirname(currentStorePath);\n const storeDirectory = path.dirname(currentSessionDirectory);\n let entries: string[];\n try {\n entries = fs.readdirSync(storeDirectory);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === NOT_FOUND_ERROR_CODE) return result;\n result.errors.push(`Could not read task store directory ${storeDirectory}: ${String(error)}`);\n return result;\n }\n\n for (const entry of entries) {\n const sessionDirectory = path.join(storeDirectory, entry);\n const candidate = path.join(sessionDirectory, STORE_FILE_NAME);\n if (sessionDirectory === currentSessionDirectory || !fs.existsSync(candidate)) continue;\n try {\n if (fs.existsSync(lockPathFor(candidate))) continue;\n JSON.parse(fs.readFileSync(candidate, FILE_ENCODING));\n if (now - fs.statSync(candidate).mtimeMs <= ttlMs) continue;\n fs.rmSync(sessionDirectory, { recursive: true, force: true });\n result.removed.push(sessionDirectory);\n } catch (error) {\n result.errors.push(`Could not sweep task store ${candidate}: ${String(error)}`);\n }\n }\n return result;\n}\n\nexport async function sweepStoreFilesAsync(\n currentStorePath: string,\n ttlMs: number,\n now: number = Date.now(),\n): Promise<StoreSweepResult> {\n const result: StoreSweepResult = { removed: [], errors: [] };\n const currentSessionDirectory = path.dirname(currentStorePath);\n const storeDirectory = path.dirname(currentSessionDirectory);\n let entries: string[];\n try {\n entries = await fs.promises.readdir(storeDirectory);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === NOT_FOUND_ERROR_CODE) return result;\n result.errors.push(`Could not read task store directory ${storeDirectory}: ${String(error)}`);\n return result;\n }\n\n for (const entry of entries) {\n const sessionDirectory = path.join(storeDirectory, entry);\n const candidate = path.join(sessionDirectory, STORE_FILE_NAME);\n if (sessionDirectory === currentSessionDirectory) continue;\n try {\n await fs.promises.access(candidate);\n try {\n await fs.promises.access(lockPathFor(candidate));\n continue;\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== NOT_FOUND_ERROR_CODE) throw error;\n }\n JSON.parse(await fs.promises.readFile(candidate, FILE_ENCODING));\n if (now - (await fs.promises.stat(candidate)).mtimeMs <= ttlMs) continue;\n await fs.promises.rm(sessionDirectory, { recursive: true, force: true });\n result.removed.push(sessionDirectory);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === NOT_FOUND_ERROR_CODE) continue;\n result.errors.push(`Could not sweep task store ${candidate}: ${String(error)}`);\n }\n }\n return result;\n}\n\nexport function lockPathFor(storePath: string): string {\n return `${storePath}.lock`;\n}\n\nexport function tempPathFor(storePath: string, pid: number = process.pid): string {\n return `${storePath}.tmp.${pid}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAa,iBAAiB;AAE9B,MAAM,iBAAiB;AACvB,MAAM,kBAAkB;AACxB,MAAM,0BAA0B;AAChC,MAAM,iBAAiB;AACvB,MAAM,0BAA0B;AAChC,MAAM,aAAa;AACnB,MAAM,oBAAoB;AAC1B,MAAM,gBAAgB;AACtB,MAAM,uBAAuB;AAE7B,SAAS,IAAI,MAAgB,KAAiC;CAC5D,IAAI;EAMF,MAAM,WAAA,GALSA,mBAAAA,aAAAA,CAAa,OAAO,MAAM;GACvC;GACA,UAAU;GACV,OAAO;IAAC;IAAU;IAAQ;GAAQ;EACpC,CACqB,CAA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GACF,SAAS,OAAO;IACd,IAAK,MAAgC,SAAS,sBAAsB,MAAM;GAC5E;GACA,KAAK,MAAM,MAAMA,QAAAA,QAAG,SAAS,SAAS,WAAW,aAAa,CAAC;GAC/D,IAAI,OAAO,MAAMA,QAAAA,QAAG,SAAS,KAAK,SAAS,EAAA,CAAG,WAAW,OAAO;GAChE,MAAMA,QAAAA,QAAG,SAAS,GAAG,kBAAkB;IAAE,WAAW;IAAM,OAAO;GAAK,CAAC;GACvE,OAAO,QAAQ,KAAK,gBAAgB;EACtC,SAAS,OAAO;GACd,IAAK,MAAgC,SAAS,sBAAsB;GACpE,OAAO,OAAO,KAAK,8BAA8B,UAAU,IAAI,OAAO,KAAK,GAAG;EAChF;CACF;CACA,OAAO;AACT;AAEA,SAAgB,YAAY,WAA2B;CACrD,OAAO,GAAG,UAAU;AACtB;AAEA,SAAgB,YAAY,WAAmB,MAAc,QAAQ,KAAa;CAChF,OAAO,GAAG,UAAU,OAAO;AAC7B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/services/processLiveness/index.ts
|
|
2
|
+
/**
|
|
3
|
+
* Is a process still running?
|
|
4
|
+
*
|
|
5
|
+
* Signal 0 performs the permission and existence check without delivering a
|
|
6
|
+
* signal. EPERM means the process exists but belongs to another user, which
|
|
7
|
+
* still counts as alive.
|
|
8
|
+
*/
|
|
9
|
+
function isProcessAlive(pid) {
|
|
10
|
+
try {
|
|
11
|
+
process.kill(pid, 0);
|
|
12
|
+
return true;
|
|
13
|
+
} catch (error) {
|
|
14
|
+
return error.code === "EPERM";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { isProcessAlive as t };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=processLiveness-Ccd9wenT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processLiveness-Ccd9wenT.mjs","names":[],"sources":["../src/services/processLiveness/index.ts"],"sourcesContent":["/**\n * Is a process still running?\n *\n * Signal 0 performs the permission and existence check without delivering a\n * signal. EPERM means the process exists but belongs to another user, which\n * still counts as alive.\n */\nexport function isProcessAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch (error) {\n return (error as NodeJS.ErrnoException).code === 'EPERM';\n }\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,eAAe,KAAsB;CACnD,IAAI;EACF,QAAQ,KAAK,KAAK,CAAC;EACnB,OAAO;CACT,SAAS,OAAO;EACd,OAAQ,MAAgC,SAAS;CACnD;AACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/services/processLiveness/index.ts
|
|
2
|
+
/**
|
|
3
|
+
* Is a process still running?
|
|
4
|
+
*
|
|
5
|
+
* Signal 0 performs the permission and existence check without delivering a
|
|
6
|
+
* signal. EPERM means the process exists but belongs to another user, which
|
|
7
|
+
* still counts as alive.
|
|
8
|
+
*/
|
|
9
|
+
function isProcessAlive(pid) {
|
|
10
|
+
try {
|
|
11
|
+
process.kill(pid, 0);
|
|
12
|
+
return true;
|
|
13
|
+
} catch (error) {
|
|
14
|
+
return error.code === "EPERM";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
Object.defineProperty(exports, "isProcessAlive", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function() {
|
|
21
|
+
return isProcessAlive;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=processLiveness-umpNgsPR.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processLiveness-umpNgsPR.cjs","names":[],"sources":["../src/services/processLiveness/index.ts"],"sourcesContent":["/**\n * Is a process still running?\n *\n * Signal 0 performs the permission and existence check without delivering a\n * signal. EPERM means the process exists but belongs to another user, which\n * still counts as alive.\n */\nexport function isProcessAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch (error) {\n return (error as NodeJS.ErrnoException).code === 'EPERM';\n }\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,eAAe,KAAsB;CACnD,IAAI;EACF,QAAQ,KAAK,KAAK,CAAC;EACnB,OAAO;CACT,SAAS,OAAO;EACd,OAAQ,MAAgC,SAAS;CACnD;AACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
declare const DEFAULT_PROMPT_GUIDELINES: string[];
|
|
12
|
+
//#endregion
|
|
13
|
+
export { DEFAULT_PROMPT_GUIDELINES as t };
|
|
14
|
+
//# sourceMappingURL=promptGuidelines-DaxWrqud.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptGuidelines-DaxWrqud.d.mts","names":[],"sources":["../src/constants/promptGuidelines.ts"],"mappings":";;;;;;;;;;cASa"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/constants/promptGuidelines.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
|
+
const DEFAULT_PROMPT_GUIDELINES = [
|
|
12
|
+
"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.",
|
|
13
|
+
"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.",
|
|
14
|
+
"When every non-deleted task is completed, review the list once and call {\"action\":\"clear\"}.",
|
|
15
|
+
"Status flow: pending, in_progress, completed. failed is recoverable, deleted is a tombstone. Pass activeForm (e.g. 'writing tests') when marking in_progress.",
|
|
16
|
+
"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.",
|
|
17
|
+
"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.",
|
|
18
|
+
"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.",
|
|
19
|
+
"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.",
|
|
20
|
+
"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.",
|
|
21
|
+
"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."
|
|
22
|
+
];
|
|
23
|
+
//#endregion
|
|
24
|
+
export { DEFAULT_PROMPT_GUIDELINES as t };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=promptGuidelines-g4QT8GNM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptGuidelines-g4QT8GNM.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,4BAAsC;CACjD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/constants/promptGuidelines.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
|
+
const DEFAULT_PROMPT_GUIDELINES = [
|
|
12
|
+
"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.",
|
|
13
|
+
"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.",
|
|
14
|
+
"When every non-deleted task is completed, review the list once and call {\"action\":\"clear\"}.",
|
|
15
|
+
"Status flow: pending, in_progress, completed. failed is recoverable, deleted is a tombstone. Pass activeForm (e.g. 'writing tests') when marking in_progress.",
|
|
16
|
+
"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.",
|
|
17
|
+
"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.",
|
|
18
|
+
"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.",
|
|
19
|
+
"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.",
|
|
20
|
+
"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.",
|
|
21
|
+
"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."
|
|
22
|
+
];
|
|
23
|
+
//#endregion
|
|
24
|
+
Object.defineProperty(exports, "DEFAULT_PROMPT_GUIDELINES", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function() {
|
|
27
|
+
return DEFAULT_PROMPT_GUIDELINES;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=promptGuidelines-j_SZTzlH.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptGuidelines-j_SZTzlH.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,4BAAsC;CACjD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { i as isDelegationActive } from "./task-giCbpKzV.mjs";
|
|
2
|
+
import { t as isProcessAlive } from "./processLiveness-Ccd9wenT.mjs";
|
|
3
|
+
//#region src/services/reconcile/index.ts
|
|
4
|
+
const ERR_ORPHANED_BY_RESTART = "Delegation orphaned by harness restart";
|
|
5
|
+
const ERR_ORPHANED_BY_SESSION = "Delegation orphaned by session restart";
|
|
6
|
+
/**
|
|
7
|
+
* Recover tasks that no longer have anyone able to finish them.
|
|
8
|
+
*
|
|
9
|
+
* A subagent run dies with the harness that spawned it, but the store file
|
|
10
|
+
* outlives both, so a crash leaves tasks stuck in `in_progress` forever. Two
|
|
11
|
+
* kinds of delegation qualify as dead:
|
|
12
|
+
*
|
|
13
|
+
* - the owning pid is gone, so nothing is left to report a result;
|
|
14
|
+
* - the owning pid is *this* process, yet the request is absent from the live
|
|
15
|
+
* set. Settling requires an in-memory record, so an in-process session
|
|
16
|
+
* restart (which clears that map without writing to the store) leaves rows
|
|
17
|
+
* nothing can ever resolve. Checking pid liveness alone misses these, because
|
|
18
|
+
* the pid is our own and very much alive.
|
|
19
|
+
*
|
|
20
|
+
* Delegations owned by a different, still-running pid belong to a parallel
|
|
21
|
+
* session and are left untouched.
|
|
22
|
+
*/
|
|
23
|
+
function reconcileOrphanedDelegations(document, now = (/* @__PURE__ */ new Date()).toISOString(), isAlive = isProcessAlive, self) {
|
|
24
|
+
const orphaned = [];
|
|
25
|
+
const tasks = document.tasks.map((task) => {
|
|
26
|
+
if (!isDelegationActive(task)) return task;
|
|
27
|
+
const pid = task.delegation?.pid;
|
|
28
|
+
if (pid === void 0) return task;
|
|
29
|
+
const abandonedHere = self !== void 0 && pid === self.pid && !self.liveRequestIds.has(task.delegation.requestId);
|
|
30
|
+
if (!abandonedHere && isAlive(pid)) return task;
|
|
31
|
+
const recovered = {
|
|
32
|
+
...task,
|
|
33
|
+
status: "pending",
|
|
34
|
+
updatedAt: now,
|
|
35
|
+
delegation: {
|
|
36
|
+
...task.delegation,
|
|
37
|
+
state: "failed",
|
|
38
|
+
endedAt: now,
|
|
39
|
+
result: {
|
|
40
|
+
status: "failed",
|
|
41
|
+
error: abandonedHere ? ERR_ORPHANED_BY_SESSION : ERR_ORPHANED_BY_RESTART
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
orphaned.push(recovered);
|
|
46
|
+
return recovered;
|
|
47
|
+
});
|
|
48
|
+
if (orphaned.length === 0) return {
|
|
49
|
+
document,
|
|
50
|
+
orphaned
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
document: {
|
|
54
|
+
...document,
|
|
55
|
+
tasks
|
|
56
|
+
},
|
|
57
|
+
orphaned
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { ERR_ORPHANED_BY_SESSION as n, reconcileOrphanedDelegations as r, ERR_ORPHANED_BY_RESTART as t };
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=reconcile-BcD-hTbd.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile-BcD-hTbd.mjs","names":[],"sources":["../src/services/reconcile/index.ts"],"sourcesContent":["import { isDelegationActive, type Task, type TaskDocument } from '../../models/task';\nimport { isProcessAlive } from '../processLiveness';\n\nexport const ERR_ORPHANED_BY_RESTART = 'Delegation orphaned by harness restart';\nexport const ERR_ORPHANED_BY_SESSION = 'Delegation orphaned by session restart';\n\nexport interface ReconcileResult {\n document: TaskDocument;\n orphaned: Task[];\n}\n\n/** The delegations this process can still settle, used to spot its own leftovers. */\nexport interface ReconcileSelf {\n pid: number;\n liveRequestIds: ReadonlySet<string>;\n}\n\n/**\n * Recover tasks that no longer have anyone able to finish them.\n *\n * A subagent run dies with the harness that spawned it, but the store file\n * outlives both, so a crash leaves tasks stuck in `in_progress` forever. Two\n * kinds of delegation qualify as dead:\n *\n * - the owning pid is gone, so nothing is left to report a result;\n * - the owning pid is *this* process, yet the request is absent from the live\n * set. Settling requires an in-memory record, so an in-process session\n * restart (which clears that map without writing to the store) leaves rows\n * nothing can ever resolve. Checking pid liveness alone misses these, because\n * the pid is our own and very much alive.\n *\n * Delegations owned by a different, still-running pid belong to a parallel\n * session and are left untouched.\n */\nexport function reconcileOrphanedDelegations(\n document: TaskDocument,\n now: string = new Date().toISOString(),\n isAlive: (pid: number) => boolean = isProcessAlive,\n self?: ReconcileSelf,\n): ReconcileResult {\n const orphaned: Task[] = [];\n\n const tasks = document.tasks.map((task) => {\n if (!isDelegationActive(task)) return task;\n const pid = task.delegation?.pid;\n if (pid === undefined) return task;\n\n const ownedByThisSession = self !== undefined && pid === self.pid;\n const abandonedHere = ownedByThisSession && !self.liveRequestIds.has(task.delegation!.requestId);\n if (!abandonedHere && isAlive(pid)) return task;\n\n const recovered: Task = {\n ...task,\n status: 'pending',\n updatedAt: now,\n delegation: {\n ...task.delegation!,\n state: 'failed',\n endedAt: now,\n result: {\n status: 'failed',\n error: abandonedHere ? ERR_ORPHANED_BY_SESSION : ERR_ORPHANED_BY_RESTART,\n },\n },\n };\n orphaned.push(recovered);\n return recovered;\n });\n\n if (orphaned.length === 0) return { document, orphaned };\n return { document: { ...document, tasks }, orphaned };\n}\n"],"mappings":";;;AAGA,MAAa,0BAA0B;AACvC,MAAa,0BAA0B;;;;;;;;;;;;;;;;;;AA8BvC,SAAgB,6BACd,UACA,uBAAc,IAAI,KAAK,EAAA,CAAE,YAAY,GACrC,UAAoC,gBACpC,MACiB;CACjB,MAAM,WAAmB,CAAC;CAE1B,MAAM,QAAQ,SAAS,MAAM,KAAK,SAAS;EACzC,IAAI,CAAC,mBAAmB,IAAI,GAAG,OAAO;EACtC,MAAM,MAAM,KAAK,YAAY;EAC7B,IAAI,QAAQ,KAAA,GAAW,OAAO;EAG9B,MAAM,gBADqB,SAAS,KAAA,KAAa,QAAQ,KAAK,OAClB,CAAC,KAAK,eAAe,IAAI,KAAK,WAAY,SAAS;EAC/F,IAAI,CAAC,iBAAiB,QAAQ,GAAG,GAAG,OAAO;EAE3C,MAAM,YAAkB;GACtB,GAAG;GACH,QAAQ;GACR,WAAW;GACX,YAAY;IACV,GAAG,KAAK;IACR,OAAO;IACP,SAAS;IACT,QAAQ;KACN,QAAQ;KACR,OAAO,gBAAgB,0BAA0B;IACnD;GACF;EACF;EACA,SAAS,KAAK,SAAS;EACvB,OAAO;CACT,CAAC;CAED,IAAI,SAAS,WAAW,GAAG,OAAO;EAAE;EAAU;CAAS;CACvD,OAAO;EAAE,UAAU;GAAE,GAAG;GAAU;EAAM;EAAG;CAAS;AACtD"}
|