@amsterdamdatalabs/enact-operator 0.1.2
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 +33 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/lanes/autopilot/index.d.ts +95 -0
- package/dist/lanes/autopilot/index.d.ts.map +1 -0
- package/dist/lanes/autopilot/index.js +499 -0
- package/dist/lanes/autopilot/index.js.map +1 -0
- package/dist/lanes/ralph/index.d.ts +118 -0
- package/dist/lanes/ralph/index.d.ts.map +1 -0
- package/dist/lanes/ralph/index.js +680 -0
- package/dist/lanes/ralph/index.js.map +1 -0
- package/dist/lanes/team/index.d.ts +110 -0
- package/dist/lanes/team/index.d.ts.map +1 -0
- package/dist/lanes/team/index.js +748 -0
- package/dist/lanes/team/index.js.map +1 -0
- package/dist/lanes/team/roles.d.ts +15 -0
- package/dist/lanes/team/roles.d.ts.map +1 -0
- package/dist/lanes/team/roles.js +89 -0
- package/dist/lanes/team/roles.js.map +1 -0
- package/dist/lanes/ultrawork/burst.d.ts +69 -0
- package/dist/lanes/ultrawork/burst.d.ts.map +1 -0
- package/dist/lanes/ultrawork/burst.js +254 -0
- package/dist/lanes/ultrawork/burst.js.map +1 -0
- package/dist/lanes/ultrawork/index.d.ts +159 -0
- package/dist/lanes/ultrawork/index.d.ts.map +1 -0
- package/dist/lanes/ultrawork/index.js +919 -0
- package/dist/lanes/ultrawork/index.js.map +1 -0
- package/dist/lanes/ultrawork/phases.d.ts +57 -0
- package/dist/lanes/ultrawork/phases.d.ts.map +1 -0
- package/dist/lanes/ultrawork/phases.js +116 -0
- package/dist/lanes/ultrawork/phases.js.map +1 -0
- package/dist/mcp/activation.d.ts +5 -0
- package/dist/mcp/activation.d.ts.map +1 -0
- package/dist/mcp/activation.js +234 -0
- package/dist/mcp/activation.js.map +1 -0
- package/dist/mcp/cli.d.ts +11 -0
- package/dist/mcp/cli.d.ts.map +1 -0
- package/dist/mcp/cli.js +140 -0
- package/dist/mcp/cli.js.map +1 -0
- package/dist/mcp/continuation.d.ts +5 -0
- package/dist/mcp/continuation.d.ts.map +1 -0
- package/dist/mcp/continuation.js +360 -0
- package/dist/mcp/continuation.js.map +1 -0
- package/dist/mcp/jobs.d.ts +5 -0
- package/dist/mcp/jobs.d.ts.map +1 -0
- package/dist/mcp/jobs.js +212 -0
- package/dist/mcp/jobs.js.map +1 -0
- package/dist/mcp/laneSupport.d.ts +19 -0
- package/dist/mcp/laneSupport.d.ts.map +1 -0
- package/dist/mcp/laneSupport.js +21 -0
- package/dist/mcp/laneSupport.js.map +1 -0
- package/dist/mcp/lanes/autopilot.d.ts +5 -0
- package/dist/mcp/lanes/autopilot.d.ts.map +1 -0
- package/dist/mcp/lanes/autopilot.js +227 -0
- package/dist/mcp/lanes/autopilot.js.map +1 -0
- package/dist/mcp/lanes/ralph.d.ts +5 -0
- package/dist/mcp/lanes/ralph.d.ts.map +1 -0
- package/dist/mcp/lanes/ralph.js +392 -0
- package/dist/mcp/lanes/ralph.js.map +1 -0
- package/dist/mcp/lanes/team.d.ts +5 -0
- package/dist/mcp/lanes/team.d.ts.map +1 -0
- package/dist/mcp/lanes/team.js +413 -0
- package/dist/mcp/lanes/team.js.map +1 -0
- package/dist/mcp/lanes/ultrawork.d.ts +5 -0
- package/dist/mcp/lanes/ultrawork.d.ts.map +1 -0
- package/dist/mcp/lanes/ultrawork.js +497 -0
- package/dist/mcp/lanes/ultrawork.js.map +1 -0
- package/dist/mcp/linkage.d.ts +5 -0
- package/dist/mcp/linkage.d.ts.map +1 -0
- package/dist/mcp/linkage.js +126 -0
- package/dist/mcp/linkage.js.map +1 -0
- package/dist/mcp/planning.d.ts +5 -0
- package/dist/mcp/planning.d.ts.map +1 -0
- package/dist/mcp/planning.js +584 -0
- package/dist/mcp/planning.js.map +1 -0
- package/dist/mcp/rpcTransport.d.ts +17 -0
- package/dist/mcp/rpcTransport.d.ts.map +1 -0
- package/dist/mcp/rpcTransport.js +90 -0
- package/dist/mcp/rpcTransport.js.map +1 -0
- package/dist/mcp/schemas/ralphVerify.d.ts +32 -0
- package/dist/mcp/schemas/ralphVerify.d.ts.map +1 -0
- package/dist/mcp/schemas/ralphVerify.js +20 -0
- package/dist/mcp/schemas/ralphVerify.js.map +1 -0
- package/dist/mcp/server.d.ts +5 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +176 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/system.d.ts +5 -0
- package/dist/mcp/system.d.ts.map +1 -0
- package/dist/mcp/system.js +445 -0
- package/dist/mcp/system.js.map +1 -0
- package/dist/mcp/toolFilter.d.ts +2 -0
- package/dist/mcp/toolFilter.d.ts.map +1 -0
- package/dist/mcp/toolFilter.js +2 -0
- package/dist/mcp/toolFilter.js.map +1 -0
- package/dist/mcp/toolPartitions.d.ts +20 -0
- package/dist/mcp/toolPartitions.d.ts.map +1 -0
- package/dist/mcp/toolPartitions.js +280 -0
- package/dist/mcp/toolPartitions.js.map +1 -0
- package/dist/mcp/toolRuntime.d.ts +9 -0
- package/dist/mcp/toolRuntime.d.ts.map +1 -0
- package/dist/mcp/toolRuntime.js +179 -0
- package/dist/mcp/toolRuntime.js.map +1 -0
- package/dist/mcp/workflow.d.ts +12 -0
- package/dist/mcp/workflow.d.ts.map +1 -0
- package/dist/mcp/workflow.js +723 -0
- package/dist/mcp/workflow.js.map +1 -0
- package/dist/operator/hooks/hookDispatcher.d.ts +39 -0
- package/dist/operator/hooks/hookDispatcher.d.ts.map +1 -0
- package/dist/operator/hooks/hookDispatcher.js +58 -0
- package/dist/operator/hooks/hookDispatcher.js.map +1 -0
- package/dist/operator/hooks/hookGating.d.ts +28 -0
- package/dist/operator/hooks/hookGating.d.ts.map +1 -0
- package/dist/operator/hooks/hookGating.js +61 -0
- package/dist/operator/hooks/hookGating.js.map +1 -0
- package/dist/operator/hooks/hooks.d.ts +20 -0
- package/dist/operator/hooks/hooks.d.ts.map +1 -0
- package/dist/operator/hooks/hooks.js +124 -0
- package/dist/operator/hooks/hooks.js.map +1 -0
- package/dist/operator/hooks/toolGuardHooks.d.ts +86 -0
- package/dist/operator/hooks/toolGuardHooks.d.ts.map +1 -0
- package/dist/operator/hooks/toolGuardHooks.js +163 -0
- package/dist/operator/hooks/toolGuardHooks.js.map +1 -0
- package/dist/operator/hud.d.ts +115 -0
- package/dist/operator/hud.d.ts.map +1 -0
- package/dist/operator/hud.js +229 -0
- package/dist/operator/hud.js.map +1 -0
- package/dist/operator/missions.d.ts +125 -0
- package/dist/operator/missions.d.ts.map +1 -0
- package/dist/operator/missions.js +304 -0
- package/dist/operator/missions.js.map +1 -0
- package/dist/operator/operatorCore.d.ts +11 -0
- package/dist/operator/operatorCore.d.ts.map +1 -0
- package/dist/operator/operatorCore.js +9 -0
- package/dist/operator/operatorCore.js.map +1 -0
- package/dist/operator/operatorRuntimeCore.d.ts +17 -0
- package/dist/operator/operatorRuntimeCore.d.ts.map +1 -0
- package/dist/operator/operatorRuntimeCore.js +17 -0
- package/dist/operator/operatorRuntimeCore.js.map +1 -0
- package/dist/operator/runtime.d.ts +74 -0
- package/dist/operator/runtime.d.ts.map +1 -0
- package/dist/operator/runtime.js +357 -0
- package/dist/operator/runtime.js.map +1 -0
- package/dist/shared/core/bootstrap.d.ts +16 -0
- package/dist/shared/core/bootstrap.d.ts.map +1 -0
- package/dist/shared/core/bootstrap.js +77 -0
- package/dist/shared/core/bootstrap.js.map +1 -0
- package/dist/shared/core/contract.d.ts +71 -0
- package/dist/shared/core/contract.d.ts.map +1 -0
- package/dist/shared/core/contract.js +452 -0
- package/dist/shared/core/contract.js.map +1 -0
- package/dist/shared/core/events.d.ts +57 -0
- package/dist/shared/core/events.d.ts.map +1 -0
- package/dist/shared/core/events.js +36 -0
- package/dist/shared/core/events.js.map +1 -0
- package/dist/shared/core/jobs.d.ts +46 -0
- package/dist/shared/core/jobs.d.ts.map +1 -0
- package/dist/shared/core/jobs.js +137 -0
- package/dist/shared/core/jobs.js.map +1 -0
- package/dist/shared/core/json.d.ts +12 -0
- package/dist/shared/core/json.d.ts.map +1 -0
- package/dist/shared/core/json.js +52 -0
- package/dist/shared/core/json.js.map +1 -0
- package/dist/shared/core/layoutMigration.d.ts +11 -0
- package/dist/shared/core/layoutMigration.d.ts.map +1 -0
- package/dist/shared/core/layoutMigration.js +56 -0
- package/dist/shared/core/layoutMigration.js.map +1 -0
- package/dist/shared/core/lifecycle.d.ts +61 -0
- package/dist/shared/core/lifecycle.d.ts.map +1 -0
- package/dist/shared/core/lifecycle.js +123 -0
- package/dist/shared/core/lifecycle.js.map +1 -0
- package/dist/shared/core/packagePaths.d.ts +2 -0
- package/dist/shared/core/packagePaths.d.ts.map +1 -0
- package/dist/shared/core/packagePaths.js +9 -0
- package/dist/shared/core/packagePaths.js.map +1 -0
- package/dist/shared/core/terminology.d.ts +38 -0
- package/dist/shared/core/terminology.d.ts.map +1 -0
- package/dist/shared/core/terminology.js +54 -0
- package/dist/shared/core/terminology.js.map +1 -0
- package/dist/shared/core/types.d.ts +30 -0
- package/dist/shared/core/types.d.ts.map +1 -0
- package/dist/shared/core/types.js +2 -0
- package/dist/shared/core/types.js.map +1 -0
- package/dist/shared/diagnostics/doctor.d.ts +19 -0
- package/dist/shared/diagnostics/doctor.d.ts.map +1 -0
- package/dist/shared/diagnostics/doctor.js +82 -0
- package/dist/shared/diagnostics/doctor.js.map +1 -0
- package/dist/shared/diagnostics/hostRollout.d.ts +16 -0
- package/dist/shared/diagnostics/hostRollout.d.ts.map +1 -0
- package/dist/shared/diagnostics/hostRollout.js +78 -0
- package/dist/shared/diagnostics/hostRollout.js.map +1 -0
- package/dist/shared/observability/emit.d.ts +3 -0
- package/dist/shared/observability/emit.d.ts.map +1 -0
- package/dist/shared/observability/emit.js +17 -0
- package/dist/shared/observability/emit.js.map +1 -0
- package/dist/shared/observability/testWorkspace.d.ts +4 -0
- package/dist/shared/observability/testWorkspace.d.ts.map +1 -0
- package/dist/shared/observability/testWorkspace.js +35 -0
- package/dist/shared/observability/testWorkspace.js.map +1 -0
- package/dist/shared/state/installRegistry.d.ts +22 -0
- package/dist/shared/state/installRegistry.d.ts.map +1 -0
- package/dist/shared/state/installRegistry.js +51 -0
- package/dist/shared/state/installRegistry.js.map +1 -0
- package/dist/shared/state/session.d.ts +18 -0
- package/dist/shared/state/session.d.ts.map +1 -0
- package/dist/shared/state/session.js +127 -0
- package/dist/shared/state/session.js.map +1 -0
- package/dist/shared/state/state.d.ts +16 -0
- package/dist/shared/state/state.d.ts.map +1 -0
- package/dist/shared/state/state.js +91 -0
- package/dist/shared/state/state.js.map +1 -0
- package/dist/shared/state/tasks.d.ts +113 -0
- package/dist/shared/state/tasks.d.ts.map +1 -0
- package/dist/shared/state/tasks.js +274 -0
- package/dist/shared/state/tasks.js.map +1 -0
- package/dist/shared/workflow/activation/activeSkill.d.ts +46 -0
- package/dist/shared/workflow/activation/activeSkill.d.ts.map +1 -0
- package/dist/shared/workflow/activation/activeSkill.js +158 -0
- package/dist/shared/workflow/activation/activeSkill.js.map +1 -0
- package/dist/shared/workflow/activation/gateProfiles.d.ts +26 -0
- package/dist/shared/workflow/activation/gateProfiles.d.ts.map +1 -0
- package/dist/shared/workflow/activation/gateProfiles.js +102 -0
- package/dist/shared/workflow/activation/gateProfiles.js.map +1 -0
- package/dist/shared/workflow/activation/modeMatrix.d.ts +28 -0
- package/dist/shared/workflow/activation/modeMatrix.d.ts.map +1 -0
- package/dist/shared/workflow/activation/modeMatrix.js +91 -0
- package/dist/shared/workflow/activation/modeMatrix.js.map +1 -0
- package/dist/shared/workflow/activation/skillActivation.d.ts +74 -0
- package/dist/shared/workflow/activation/skillActivation.d.ts.map +1 -0
- package/dist/shared/workflow/activation/skillActivation.js +485 -0
- package/dist/shared/workflow/activation/skillActivation.js.map +1 -0
- package/dist/shared/workflow/activation/skillVariant.d.ts +18 -0
- package/dist/shared/workflow/activation/skillVariant.d.ts.map +1 -0
- package/dist/shared/workflow/activation/skillVariant.js +44 -0
- package/dist/shared/workflow/activation/skillVariant.js.map +1 -0
- package/dist/shared/workflow/authority/authority.d.ts +34 -0
- package/dist/shared/workflow/authority/authority.d.ts.map +1 -0
- package/dist/shared/workflow/authority/authority.js +64 -0
- package/dist/shared/workflow/authority/authority.js.map +1 -0
- package/dist/shared/workflow/closure/closureManifest.d.ts +39 -0
- package/dist/shared/workflow/closure/closureManifest.d.ts.map +1 -0
- package/dist/shared/workflow/closure/closureManifest.js +62 -0
- package/dist/shared/workflow/closure/closureManifest.js.map +1 -0
- package/dist/shared/workflow/closure/closureRequirements.d.ts +12 -0
- package/dist/shared/workflow/closure/closureRequirements.d.ts.map +1 -0
- package/dist/shared/workflow/closure/closureRequirements.js +30 -0
- package/dist/shared/workflow/closure/closureRequirements.js.map +1 -0
- package/dist/shared/workflow/closure/contractParity.d.ts +24 -0
- package/dist/shared/workflow/closure/contractParity.d.ts.map +1 -0
- package/dist/shared/workflow/closure/contractParity.js +238 -0
- package/dist/shared/workflow/closure/contractParity.js.map +1 -0
- package/dist/shared/workflow/closure/contractParityContext.d.ts +8 -0
- package/dist/shared/workflow/closure/contractParityContext.d.ts.map +1 -0
- package/dist/shared/workflow/closure/contractParityContext.js +50 -0
- package/dist/shared/workflow/closure/contractParityContext.js.map +1 -0
- package/dist/shared/workflow/closure/scopeGuard.d.ts +11 -0
- package/dist/shared/workflow/closure/scopeGuard.d.ts.map +1 -0
- package/dist/shared/workflow/closure/scopeGuard.js +69 -0
- package/dist/shared/workflow/closure/scopeGuard.js.map +1 -0
- package/dist/shared/workflow/closure/ultragoalArtifact.d.ts +13 -0
- package/dist/shared/workflow/closure/ultragoalArtifact.d.ts.map +1 -0
- package/dist/shared/workflow/closure/ultragoalArtifact.js +31 -0
- package/dist/shared/workflow/closure/ultragoalArtifact.js.map +1 -0
- package/dist/shared/workflow/closure/workflowReconcile.d.ts +70 -0
- package/dist/shared/workflow/closure/workflowReconcile.d.ts.map +1 -0
- package/dist/shared/workflow/closure/workflowReconcile.js +267 -0
- package/dist/shared/workflow/closure/workflowReconcile.js.map +1 -0
- package/dist/shared/workflow/continuation/continuation.d.ts +109 -0
- package/dist/shared/workflow/continuation/continuation.d.ts.map +1 -0
- package/dist/shared/workflow/continuation/continuation.js +550 -0
- package/dist/shared/workflow/continuation/continuation.js.map +1 -0
- package/dist/shared/workflow/continuation/continuationEventReservations.d.ts +17 -0
- package/dist/shared/workflow/continuation/continuationEventReservations.d.ts.map +1 -0
- package/dist/shared/workflow/continuation/continuationEventReservations.js +88 -0
- package/dist/shared/workflow/continuation/continuationEventReservations.js.map +1 -0
- package/dist/shared/workflow/continuation/continuationFollowUp.d.ts +114 -0
- package/dist/shared/workflow/continuation/continuationFollowUp.d.ts.map +1 -0
- package/dist/shared/workflow/continuation/continuationFollowUp.js +330 -0
- package/dist/shared/workflow/continuation/continuationFollowUp.js.map +1 -0
- package/dist/shared/workflow/continuation/continuationOrchestrator.d.ts +66 -0
- package/dist/shared/workflow/continuation/continuationOrchestrator.d.ts.map +1 -0
- package/dist/shared/workflow/continuation/continuationOrchestrator.js +144 -0
- package/dist/shared/workflow/continuation/continuationOrchestrator.js.map +1 -0
- package/dist/shared/workflow/continuation/hookContinuation.d.ts +44 -0
- package/dist/shared/workflow/continuation/hookContinuation.d.ts.map +1 -0
- package/dist/shared/workflow/continuation/hookContinuation.js +85 -0
- package/dist/shared/workflow/continuation/hookContinuation.js.map +1 -0
- package/dist/shared/workflow/continuation/stopPolicy.d.ts +38 -0
- package/dist/shared/workflow/continuation/stopPolicy.d.ts.map +1 -0
- package/dist/shared/workflow/continuation/stopPolicy.js +435 -0
- package/dist/shared/workflow/continuation/stopPolicy.js.map +1 -0
- package/dist/shared/workflow/continuation/stopVerdict.d.ts +31 -0
- package/dist/shared/workflow/continuation/stopVerdict.d.ts.map +1 -0
- package/dist/shared/workflow/continuation/stopVerdict.js +98 -0
- package/dist/shared/workflow/continuation/stopVerdict.js.map +1 -0
- package/dist/shared/workflow/delegation/delegatedSession.d.ts +118 -0
- package/dist/shared/workflow/delegation/delegatedSession.d.ts.map +1 -0
- package/dist/shared/workflow/delegation/delegatedSession.js +496 -0
- package/dist/shared/workflow/delegation/delegatedSession.js.map +1 -0
- package/dist/shared/workflow/delegation/delegationPrompt.d.ts +3 -0
- package/dist/shared/workflow/delegation/delegationPrompt.d.ts.map +1 -0
- package/dist/shared/workflow/delegation/delegationPrompt.js +15 -0
- package/dist/shared/workflow/delegation/delegationPrompt.js.map +1 -0
- package/dist/shared/workflow/delegation/sessionTasks.d.ts +40 -0
- package/dist/shared/workflow/delegation/sessionTasks.d.ts.map +1 -0
- package/dist/shared/workflow/delegation/sessionTasks.js +73 -0
- package/dist/shared/workflow/delegation/sessionTasks.js.map +1 -0
- package/dist/shared/workflow/delegation/subagentRuntime.d.ts +26 -0
- package/dist/shared/workflow/delegation/subagentRuntime.d.ts.map +1 -0
- package/dist/shared/workflow/delegation/subagentRuntime.js +231 -0
- package/dist/shared/workflow/delegation/subagentRuntime.js.map +1 -0
- package/dist/shared/workflow/delivery/adoAuxiliaryRuntime.d.ts +79 -0
- package/dist/shared/workflow/delivery/adoAuxiliaryRuntime.d.ts.map +1 -0
- package/dist/shared/workflow/delivery/adoAuxiliaryRuntime.js +166 -0
- package/dist/shared/workflow/delivery/adoAuxiliaryRuntime.js.map +1 -0
- package/dist/shared/workflow/delivery/finalWave.d.ts +57 -0
- package/dist/shared/workflow/delivery/finalWave.d.ts.map +1 -0
- package/dist/shared/workflow/delivery/finalWave.js +123 -0
- package/dist/shared/workflow/delivery/finalWave.js.map +1 -0
- package/dist/shared/workflow/delivery/lifecyclePushMap.d.ts +68 -0
- package/dist/shared/workflow/delivery/lifecyclePushMap.d.ts.map +1 -0
- package/dist/shared/workflow/delivery/lifecyclePushMap.js +82 -0
- package/dist/shared/workflow/delivery/lifecyclePushMap.js.map +1 -0
- package/dist/shared/workflow/delivery/prSidecar.d.ts +7 -0
- package/dist/shared/workflow/delivery/prSidecar.d.ts.map +1 -0
- package/dist/shared/workflow/delivery/prSidecar.js +4 -0
- package/dist/shared/workflow/delivery/prSidecar.js.map +1 -0
- package/dist/shared/workflow/delivery/reviewStaleness.d.ts +37 -0
- package/dist/shared/workflow/delivery/reviewStaleness.d.ts.map +1 -0
- package/dist/shared/workflow/delivery/reviewStaleness.js +94 -0
- package/dist/shared/workflow/delivery/reviewStaleness.js.map +1 -0
- package/dist/shared/workflow/planning/hyperplan.d.ts +40 -0
- package/dist/shared/workflow/planning/hyperplan.d.ts.map +1 -0
- package/dist/shared/workflow/planning/hyperplan.js +133 -0
- package/dist/shared/workflow/planning/hyperplan.js.map +1 -0
- package/dist/shared/workflow/planning/notepad.d.ts +17 -0
- package/dist/shared/workflow/planning/notepad.d.ts.map +1 -0
- package/dist/shared/workflow/planning/notepad.js +84 -0
- package/dist/shared/workflow/planning/notepad.js.map +1 -0
- package/dist/shared/workflow/planning/planFormat.d.ts +3 -0
- package/dist/shared/workflow/planning/planFormat.d.ts.map +1 -0
- package/dist/shared/workflow/planning/planFormat.js +14 -0
- package/dist/shared/workflow/planning/planFormat.js.map +1 -0
- package/package.json +155 -0
- package/runtime/hooks/_continuation.mjs +2 -0
- package/runtime/hooks/_lib.mjs +2 -0
- package/runtime/hooks/_toolGuards.mjs +2 -0
- package/runtime/hooks/lanes/resolveSkillActivation.mjs +241 -0
- package/runtime/hooks/lanes/user-prompt-submit.mjs +326 -0
- package/runtime/hooks/layout-dir.mjs +2 -0
- package/runtime/hooks/lifecycle/pre-compact.mjs +121 -0
- package/runtime/hooks/lifecycle/session-start.mjs +356 -0
- package/runtime/hooks/lifecycle/stop.mjs +223 -0
- package/runtime/hooks/observability.mjs +2 -0
- package/runtime/hooks/post-tool-use-failure.mjs +5 -0
- package/runtime/hooks/post-tool-use.mjs +4 -0
- package/runtime/hooks/pre-compact.mjs +4 -0
- package/runtime/hooks/pre-tool-use.mjs +4 -0
- package/runtime/hooks/resolveSkillActivation.mjs +4 -0
- package/runtime/hooks/root-dir.mjs +2 -0
- package/runtime/hooks/session-start.mjs +4 -0
- package/runtime/hooks/shared/_continuation.mjs +341 -0
- package/runtime/hooks/shared/_lib.mjs +60 -0
- package/runtime/hooks/shared/_toolGuards.mjs +237 -0
- package/runtime/hooks/shared/config.mjs +143 -0
- package/runtime/hooks/shared/layout-dir.mjs +12 -0
- package/runtime/hooks/shared/observability.mjs +257 -0
- package/runtime/hooks/shared/root-dir.mjs +9 -0
- package/runtime/hooks/stop.mjs +4 -0
- package/runtime/hooks/subagent-tracker.mjs +4 -0
- package/runtime/hooks/subagents/subagent-tracker.mjs +106 -0
- package/runtime/hooks/tools/post-tool-use-failure.mjs +251 -0
- package/runtime/hooks/tools/post-tool-use.mjs +205 -0
- package/runtime/hooks/tools/pre-tool-use.mjs +268 -0
- package/runtime/hooks/user-prompt-submit.mjs +4 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { layoutPath, readJson, writeJson } from '../../../operator/operatorCore.js';
|
|
3
|
+
const CONTINUATION_EVENT_RESERVATION_SCHEMA_VERSION = 1;
|
|
4
|
+
function now() {
|
|
5
|
+
return new Date().toISOString();
|
|
6
|
+
}
|
|
7
|
+
function continuationEventReservationFile(root) {
|
|
8
|
+
return layoutPath(root, 'state', 'continuation-event-reservations.json');
|
|
9
|
+
}
|
|
10
|
+
function defaultContinuationEventReservationState() {
|
|
11
|
+
return {
|
|
12
|
+
schemaVersion: CONTINUATION_EVENT_RESERVATION_SCHEMA_VERSION,
|
|
13
|
+
updatedAt: now(),
|
|
14
|
+
entries: {},
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function readContinuationEventReservationState(root) {
|
|
18
|
+
const path = continuationEventReservationFile(root);
|
|
19
|
+
if (!existsSync(path)) {
|
|
20
|
+
return defaultContinuationEventReservationState();
|
|
21
|
+
}
|
|
22
|
+
const loaded = readJson(path, defaultContinuationEventReservationState());
|
|
23
|
+
return {
|
|
24
|
+
...defaultContinuationEventReservationState(),
|
|
25
|
+
...loaded,
|
|
26
|
+
schemaVersion: CONTINUATION_EVENT_RESERVATION_SCHEMA_VERSION,
|
|
27
|
+
entries: typeof loaded.entries === 'object' && loaded.entries !== null ? loaded.entries : {},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function writeContinuationEventReservationState(root, state) {
|
|
31
|
+
const next = {
|
|
32
|
+
...state,
|
|
33
|
+
schemaVersion: CONTINUATION_EVENT_RESERVATION_SCHEMA_VERSION,
|
|
34
|
+
updatedAt: now(),
|
|
35
|
+
};
|
|
36
|
+
writeJson(continuationEventReservationFile(root), next);
|
|
37
|
+
return next;
|
|
38
|
+
}
|
|
39
|
+
function pruneExpiredContinuationEventReservations(state, nowMs) {
|
|
40
|
+
const entries = Object.fromEntries(Object.entries(state.entries).filter(([, value]) => Date.parse(value.expiresAt) > nowMs));
|
|
41
|
+
return { ...state, entries };
|
|
42
|
+
}
|
|
43
|
+
export function reserveContinuationEvent(root, input) {
|
|
44
|
+
const nowMs = input.nowMs ?? Date.now();
|
|
45
|
+
const nowIso = new Date(nowMs).toISOString();
|
|
46
|
+
const ttlMs = Math.max(1_000, input.ttlMs ?? 90_000);
|
|
47
|
+
const expiresAt = new Date(nowMs + ttlMs).toISOString();
|
|
48
|
+
const current = pruneExpiredContinuationEventReservations(readContinuationEventReservationState(root), nowMs);
|
|
49
|
+
const existing = current.entries[input.key];
|
|
50
|
+
if (existing) {
|
|
51
|
+
const remainingMs = Math.max(0, Date.parse(existing.expiresAt) - nowMs);
|
|
52
|
+
writeContinuationEventReservationState(root, current);
|
|
53
|
+
return {
|
|
54
|
+
reserved: false,
|
|
55
|
+
key: existing.key,
|
|
56
|
+
source: existing.source,
|
|
57
|
+
reservedAt: existing.reservedAt,
|
|
58
|
+
expiresAt: existing.expiresAt,
|
|
59
|
+
remainingMs,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const entry = {
|
|
63
|
+
key: input.key,
|
|
64
|
+
source: input.source,
|
|
65
|
+
reservedAt: nowIso,
|
|
66
|
+
expiresAt,
|
|
67
|
+
metadata: input.metadata,
|
|
68
|
+
};
|
|
69
|
+
const next = {
|
|
70
|
+
...current,
|
|
71
|
+
entries: {
|
|
72
|
+
...current.entries,
|
|
73
|
+
[input.key]: entry,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
writeContinuationEventReservationState(root, next);
|
|
77
|
+
return {
|
|
78
|
+
reserved: true,
|
|
79
|
+
key: entry.key,
|
|
80
|
+
source: entry.source,
|
|
81
|
+
reservedAt: entry.reservedAt,
|
|
82
|
+
expiresAt: entry.expiresAt,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export function clearContinuationEventReservations(root) {
|
|
86
|
+
writeContinuationEventReservationState(root, defaultContinuationEventReservationState());
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=continuationEventReservations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuationEventReservations.js","sourceRoot":"","sources":["../../../../src/shared/workflow/continuation/continuationEventReservations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE7E,MAAM,6CAA6C,GAAG,CAAU,CAAC;AAyBjE,SAAS,GAAG;IACV,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC;AAED,SAAS,gCAAgC,CAAC,IAAY;IACpD,OAAO,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,sCAAsC,CAAC,CAAC;AAC3E,CAAC;AAED,SAAS,wCAAwC;IAC/C,OAAO;QACL,aAAa,EAAE,6CAA6C;QAC5D,SAAS,EAAE,GAAG,EAAE;QAChB,OAAO,EAAE,EAAE;KACZ,CAAC;AACJ,CAAC;AAED,SAAS,qCAAqC,C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sC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACnD,OAAO;QACL,QAAQ,EAAE,IAAI;QACd,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kCAAkC,CAAC,IAAY;IAC7D,sCAAsC,CAAC,IAAI,EAAE,wCAAwC,EAAE,CAAC,CAAC;AAC3F,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export type FollowUpTrigger = 'stop-deny' | 'session-idle' | 'post-tool-failure' | 'recovery' | 'subagent-stop' | 'team-message' | 'team-resume';
|
|
2
|
+
export type FollowUpStatus = 'queued' | 'replayed' | 'suppressed' | 'acknowledged' | 'expired';
|
|
3
|
+
export type FollowUpLane = 'ralph' | 'ultrawork' | 'autopilot' | 'team' | 'none';
|
|
4
|
+
export declare const DEFAULT_FOLLOW_UP_QUEUE_TTL_MS: number;
|
|
5
|
+
export interface ContinuationFollowUpItem {
|
|
6
|
+
id: string;
|
|
7
|
+
sessionId: string | null;
|
|
8
|
+
dedupeKey: string;
|
|
9
|
+
trigger: FollowUpTrigger;
|
|
10
|
+
status: FollowUpStatus;
|
|
11
|
+
lane: FollowUpLane;
|
|
12
|
+
laneId: string | null;
|
|
13
|
+
prompt: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
expiresAt: string;
|
|
16
|
+
lastReplayedAt: string | null;
|
|
17
|
+
lastReplaySessionId: string | null;
|
|
18
|
+
acknowledgedAt: string | null;
|
|
19
|
+
suppressReason: string | null;
|
|
20
|
+
metadata: Record<string, unknown>;
|
|
21
|
+
}
|
|
22
|
+
interface FollowUpQueueState {
|
|
23
|
+
schemaVersion: 1;
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
items: ContinuationFollowUpItem[];
|
|
26
|
+
}
|
|
27
|
+
export declare function pruneExpiredContinuationFollowUps(root: string, atMs?: number): FollowUpQueueState;
|
|
28
|
+
export interface EnqueueContinuationFollowUpInput {
|
|
29
|
+
sessionId: string | null;
|
|
30
|
+
dedupeKey: string;
|
|
31
|
+
trigger: FollowUpTrigger;
|
|
32
|
+
lane: FollowUpLane;
|
|
33
|
+
laneId: string | null;
|
|
34
|
+
prompt: string;
|
|
35
|
+
queueTtlMs?: number;
|
|
36
|
+
nowMs?: number;
|
|
37
|
+
metadata?: Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
export type EnqueueContinuationFollowUpResult = {
|
|
40
|
+
outcome: 'queued';
|
|
41
|
+
item: ContinuationFollowUpItem;
|
|
42
|
+
} | {
|
|
43
|
+
outcome: 'suppressed';
|
|
44
|
+
reason: string;
|
|
45
|
+
existingId: string;
|
|
46
|
+
};
|
|
47
|
+
export declare function enqueueContinuationFollowUp(root: string, input: EnqueueContinuationFollowUpInput): EnqueueContinuationFollowUpResult;
|
|
48
|
+
export interface RefreshContinuationFollowUpInput {
|
|
49
|
+
dedupeKey: string;
|
|
50
|
+
prompt?: string;
|
|
51
|
+
queueTtlMs?: number;
|
|
52
|
+
nowMs?: number;
|
|
53
|
+
}
|
|
54
|
+
export declare function refreshContinuationFollowUp(root: string, input: RefreshContinuationFollowUpInput): ContinuationFollowUpItem | null;
|
|
55
|
+
export interface ReserveFollowUpReplayInput {
|
|
56
|
+
followUpId: string;
|
|
57
|
+
sessionId: string | null;
|
|
58
|
+
replayReservationTtlMs?: number;
|
|
59
|
+
nowMs?: number;
|
|
60
|
+
}
|
|
61
|
+
export interface ReserveFollowUpReplayResult {
|
|
62
|
+
reserved: boolean;
|
|
63
|
+
item: ContinuationFollowUpItem | null;
|
|
64
|
+
reinjectionText: string | null;
|
|
65
|
+
reason?: string;
|
|
66
|
+
}
|
|
67
|
+
export declare function reserveFollowUpReplay(root: string, input: ReserveFollowUpReplayInput): ReserveFollowUpReplayResult;
|
|
68
|
+
export declare function markFollowUpReplayed(root: string, followUpId: string, sessionId: string | null): ContinuationFollowUpItem | null;
|
|
69
|
+
export interface AcknowledgeContinuationFollowUpInput {
|
|
70
|
+
followUpId?: string;
|
|
71
|
+
dedupeKey?: string;
|
|
72
|
+
continuationId?: string;
|
|
73
|
+
sessionId?: string | null;
|
|
74
|
+
lane?: FollowUpLane;
|
|
75
|
+
reason: string;
|
|
76
|
+
source: string;
|
|
77
|
+
}
|
|
78
|
+
export declare function acknowledgeContinuationFollowUp(root: string, input: AcknowledgeContinuationFollowUpInput): {
|
|
79
|
+
acknowledged: ContinuationFollowUpItem[];
|
|
80
|
+
};
|
|
81
|
+
export declare function acknowledgeContinuationFollowUpsOnProgress(root: string, input: {
|
|
82
|
+
lane: FollowUpLane;
|
|
83
|
+
sessionId: string | null;
|
|
84
|
+
reason: string;
|
|
85
|
+
source: string;
|
|
86
|
+
}): void;
|
|
87
|
+
export declare function readContinuationFollowUpQueue(root: string): {
|
|
88
|
+
items: ContinuationFollowUpItem[];
|
|
89
|
+
counts: Record<FollowUpStatus, number>;
|
|
90
|
+
};
|
|
91
|
+
export declare function findQueuedFollowUpsForSession(root: string, sessionId: string | null): ContinuationFollowUpItem[];
|
|
92
|
+
export declare function findHeadQueuedFollowUp(root: string, trigger?: FollowUpTrigger): ContinuationFollowUpItem | null;
|
|
93
|
+
export declare function pickFollowUpForReplay(root: string, lane: FollowUpLane, sessionId: string | null): ContinuationFollowUpItem | null;
|
|
94
|
+
export declare function buildStopDenyDedupeKey(input: {
|
|
95
|
+
sessionId: string | null;
|
|
96
|
+
lane: FollowUpLane;
|
|
97
|
+
laneId: string | null;
|
|
98
|
+
blockerFingerprint: string;
|
|
99
|
+
}): string;
|
|
100
|
+
export declare function buildSessionIdleDedupeKey(input: {
|
|
101
|
+
sessionId: string | null;
|
|
102
|
+
lane: FollowUpLane;
|
|
103
|
+
laneId: string | null;
|
|
104
|
+
}): string;
|
|
105
|
+
export declare function buildPostToolFailureDedupeKey(input: {
|
|
106
|
+
sessionId: string | null;
|
|
107
|
+
toolName: string;
|
|
108
|
+
}): string;
|
|
109
|
+
export declare function buildTeamMessageFollowUpDedupeKey(teamId: string, messageId: string): string;
|
|
110
|
+
export declare function buildSubagentStopFollowUpDedupeKey(sessionId: string | null, agentId: string, outcome: string): string;
|
|
111
|
+
export declare function buildDelegatedFollowUpDedupeKey(continuationId: string, trigger: string): string;
|
|
112
|
+
export declare function fingerprintBlockers(blockers: string[]): string;
|
|
113
|
+
export {};
|
|
114
|
+
//# sourceMappingURL=continuationFollowUp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuationFollowUp.d.ts","sourceRoot":"","sources":["../../../../src/shared/workflow/continuation/continuationFollowUp.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,eAAe,GACvB,WAAW,GACX,cAAc,GACd,mBAAmB,GACnB,UAAU,GACV,eAAe,GACf,cAAc,GACd,aAAa,CAAC;AAElB,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,UAAU,GAAG,YAAY,GAAG,cAAc,GAAG,SAAS,CAAC;AAE/F,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAGjF,eAAO,MAAM,8BAA8B,QAAqB,CAAC;AAEjE,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,eAAe,CAAC;IACzB,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,mBAAmB,EAAE,MAAM,GAAG,I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AAG,MAAM,CAE3F;AAED,wBAAgB,kCAAkC,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAGrH;AAED,wBAAgB,+BAA+B,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAE/F;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAO9D"}
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { layoutPath, readJson, writeJson } from '../../../operator/operatorCore.js';
|
|
4
|
+
import { appendLedger } from '../../../operator/runtime.js';
|
|
5
|
+
import { reserveContinuationEvent } from '../../../shared/workflow/continuation/continuationEventReservations.js';
|
|
6
|
+
const QUEUE_SCHEMA_VERSION = 1;
|
|
7
|
+
export const DEFAULT_FOLLOW_UP_QUEUE_TTL_MS = 4 * 60 * 60 * 1000;
|
|
8
|
+
function now() {
|
|
9
|
+
return new Date().toISOString();
|
|
10
|
+
}
|
|
11
|
+
function followUpQueueFile(root) {
|
|
12
|
+
return layoutPath(root, 'state', 'continuation-follow-up-queue.json');
|
|
13
|
+
}
|
|
14
|
+
function defaultQueue() {
|
|
15
|
+
return {
|
|
16
|
+
schemaVersion: QUEUE_SCHEMA_VERSION,
|
|
17
|
+
updatedAt: now(),
|
|
18
|
+
items: [],
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function readQueue(root) {
|
|
22
|
+
const path = followUpQueueFile(root);
|
|
23
|
+
if (!existsSync(path)) {
|
|
24
|
+
return defaultQueue();
|
|
25
|
+
}
|
|
26
|
+
const loaded = readJson(path, defaultQueue());
|
|
27
|
+
return {
|
|
28
|
+
...defaultQueue(),
|
|
29
|
+
...loaded,
|
|
30
|
+
schemaVersion: QUEUE_SCHEMA_VERSION,
|
|
31
|
+
items: Array.isArray(loaded.items) ? loaded.items : [],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function writeQueue(root, state) {
|
|
35
|
+
const next = {
|
|
36
|
+
...state,
|
|
37
|
+
schemaVersion: QUEUE_SCHEMA_VERSION,
|
|
38
|
+
updatedAt: now(),
|
|
39
|
+
};
|
|
40
|
+
writeJson(followUpQueueFile(root), next);
|
|
41
|
+
return next;
|
|
42
|
+
}
|
|
43
|
+
function ledgerFollowUp(root, action, detail, metadata) {
|
|
44
|
+
appendLedger(root, {
|
|
45
|
+
kind: 'session',
|
|
46
|
+
action,
|
|
47
|
+
detail,
|
|
48
|
+
actor: 'enact-operator-continuation',
|
|
49
|
+
metadata,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function nowMs() {
|
|
53
|
+
return Date.now();
|
|
54
|
+
}
|
|
55
|
+
export function pruneExpiredContinuationFollowUps(root, atMs = nowMs()) {
|
|
56
|
+
const q = readQueue(root);
|
|
57
|
+
let changed = false;
|
|
58
|
+
const items = q.items.map((item) => {
|
|
59
|
+
if (item.status === 'acknowledged' || item.status === 'suppressed' || item.status === 'expired') {
|
|
60
|
+
return item;
|
|
61
|
+
}
|
|
62
|
+
if (Date.parse(item.expiresAt) <= atMs) {
|
|
63
|
+
changed = true;
|
|
64
|
+
ledgerFollowUp(root, 'continuation_followup_expired', `Follow-up ${item.id} expired`, {
|
|
65
|
+
followUpId: item.id,
|
|
66
|
+
trigger: item.trigger,
|
|
67
|
+
dedupeKey: item.dedupeKey,
|
|
68
|
+
sessionId: item.sessionId,
|
|
69
|
+
lane: item.lane,
|
|
70
|
+
});
|
|
71
|
+
return { ...item, status: 'expired', suppressReason: 'ttl-expired' };
|
|
72
|
+
}
|
|
73
|
+
return item;
|
|
74
|
+
});
|
|
75
|
+
if (!changed) {
|
|
76
|
+
return q;
|
|
77
|
+
}
|
|
78
|
+
return writeQueue(root, { ...q, items });
|
|
79
|
+
}
|
|
80
|
+
export function enqueueContinuationFollowUp(root, input) {
|
|
81
|
+
const at = input.nowMs ?? nowMs();
|
|
82
|
+
let q = pruneExpiredContinuationFollowUps(root, at);
|
|
83
|
+
const ttl = input.queueTtlMs ?? DEFAULT_FOLLOW_UP_QUEUE_TTL_MS;
|
|
84
|
+
const expiresAt = new Date(at + ttl).toISOString();
|
|
85
|
+
const active = q.items.find((i) => i.dedupeKey === input.dedupeKey
|
|
86
|
+
&& (i.status === 'queued' || i.status === 'replayed')
|
|
87
|
+
&& Date.parse(i.expiresAt) > at);
|
|
88
|
+
if (active) {
|
|
89
|
+
ledgerFollowUp(root, 'continuation_followup_suppressed', `Duplicate follow-up enqueue for ${input.dedupeKey}`, {
|
|
90
|
+
followUpId: active.id,
|
|
91
|
+
trigger: input.trigger,
|
|
92
|
+
dedupeKey: input.dedupeKey,
|
|
93
|
+
sessionId: input.sessionId,
|
|
94
|
+
lane: input.lane,
|
|
95
|
+
});
|
|
96
|
+
return { outcome: 'suppressed', reason: 'duplicate-dedupe-key-active', existingId: active.id };
|
|
97
|
+
}
|
|
98
|
+
const item = {
|
|
99
|
+
id: `followup_${randomUUID().replace(/-/g, '').slice(0, 16)}`,
|
|
100
|
+
sessionId: input.sessionId,
|
|
101
|
+
dedupeKey: input.dedupeKey,
|
|
102
|
+
trigger: input.trigger,
|
|
103
|
+
status: 'queued',
|
|
104
|
+
lane: input.lane,
|
|
105
|
+
laneId: input.laneId,
|
|
106
|
+
prompt: input.prompt,
|
|
107
|
+
createdAt: new Date(at).toISOString(),
|
|
108
|
+
expiresAt,
|
|
109
|
+
lastReplayedAt: null,
|
|
110
|
+
lastReplaySessionId: null,
|
|
111
|
+
acknowledgedAt: null,
|
|
112
|
+
suppressReason: null,
|
|
113
|
+
metadata: input.metadata ?? {},
|
|
114
|
+
};
|
|
115
|
+
q = writeQueue(root, { ...q, items: [...q.items, item] });
|
|
116
|
+
ledgerFollowUp(root, 'continuation_followup_queued', `Follow-up queued (${input.trigger})`, {
|
|
117
|
+
followUpId: item.id,
|
|
118
|
+
trigger: item.trigger,
|
|
119
|
+
dedupeKey: item.dedupeKey,
|
|
120
|
+
sessionId: item.sessionId,
|
|
121
|
+
lane: item.lane,
|
|
122
|
+
});
|
|
123
|
+
return { outcome: 'queued', item };
|
|
124
|
+
}
|
|
125
|
+
export function refreshContinuationFollowUp(root, input) {
|
|
126
|
+
const at = input.nowMs ?? nowMs();
|
|
127
|
+
let q = pruneExpiredContinuationFollowUps(root, at);
|
|
128
|
+
const idx = q.items.findIndex((i) => i.dedupeKey === input.dedupeKey && (i.status === 'queued' || i.status === 'replayed'));
|
|
129
|
+
if (idx < 0) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
const cur = q.items[idx];
|
|
133
|
+
const ttl = input.queueTtlMs ?? DEFAULT_FOLLOW_UP_QUEUE_TTL_MS;
|
|
134
|
+
const nextItem = {
|
|
135
|
+
...cur,
|
|
136
|
+
expiresAt: new Date(at + ttl).toISOString(),
|
|
137
|
+
prompt: input.prompt ?? cur.prompt,
|
|
138
|
+
status: 'queued',
|
|
139
|
+
suppressReason: null,
|
|
140
|
+
};
|
|
141
|
+
const items = [...q.items];
|
|
142
|
+
items[idx] = nextItem;
|
|
143
|
+
writeQueue(root, { ...q, items });
|
|
144
|
+
return nextItem;
|
|
145
|
+
}
|
|
146
|
+
export function reserveFollowUpReplay(root, input) {
|
|
147
|
+
const at = input.nowMs ?? nowMs();
|
|
148
|
+
pruneExpiredContinuationFollowUps(root, at);
|
|
149
|
+
const q = readQueue(root);
|
|
150
|
+
const item = q.items.find((i) => i.id === input.followUpId);
|
|
151
|
+
if (!item) {
|
|
152
|
+
return { reserved: false, item: null, reinjectionText: null, reason: 'not-found' };
|
|
153
|
+
}
|
|
154
|
+
if (item.status !== 'queued' && item.status !== 'replayed') {
|
|
155
|
+
return { reserved: false, item, reinjectionText: null, reason: `status-${item.status}` };
|
|
156
|
+
}
|
|
157
|
+
if (Date.parse(item.expiresAt) <= at) {
|
|
158
|
+
return { reserved: false, item, reinjectionText: null, reason: 'expired' };
|
|
159
|
+
}
|
|
160
|
+
const sid = input.sessionId ?? 'none';
|
|
161
|
+
if (item.lastReplaySessionId === sid && item.lastReplayedAt) {
|
|
162
|
+
return { reserved: false, item, reinjectionText: null, reason: 'already-replayed-this-session' };
|
|
163
|
+
}
|
|
164
|
+
const reservation = reserveContinuationEvent(root, {
|
|
165
|
+
key: `followup-replay:${input.followUpId}:${sid}`,
|
|
166
|
+
source: 'continuation-follow-up-replay',
|
|
167
|
+
ttlMs: input.replayReservationTtlMs ?? 90_000,
|
|
168
|
+
nowMs: at,
|
|
169
|
+
metadata: { followUpId: input.followUpId },
|
|
170
|
+
});
|
|
171
|
+
if (!reservation.reserved) {
|
|
172
|
+
return { reserved: false, item, reinjectionText: null, reason: 'hook-reservation-deduped' };
|
|
173
|
+
}
|
|
174
|
+
const reinjectionText = `[Operator follow-up reinjection] ${item.prompt}`;
|
|
175
|
+
return { reserved: true, item, reinjectionText };
|
|
176
|
+
}
|
|
177
|
+
export function markFollowUpReplayed(root, followUpId, sessionId) {
|
|
178
|
+
const q = readQueue(root);
|
|
179
|
+
const idx = q.items.findIndex((i) => i.id === followUpId);
|
|
180
|
+
if (idx < 0) {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
const cur = q.items[idx];
|
|
184
|
+
const sid = sessionId ?? 'none';
|
|
185
|
+
const nextItem = {
|
|
186
|
+
...cur,
|
|
187
|
+
status: 'replayed',
|
|
188
|
+
lastReplayedAt: now(),
|
|
189
|
+
lastReplaySessionId: sid,
|
|
190
|
+
};
|
|
191
|
+
const items = [...q.items];
|
|
192
|
+
items[idx] = nextItem;
|
|
193
|
+
writeQueue(root, { ...q, items });
|
|
194
|
+
ledgerFollowUp(root, 'continuation_followup_replayed', `Follow-up ${followUpId} replayed`, {
|
|
195
|
+
followUpId,
|
|
196
|
+
trigger: cur.trigger,
|
|
197
|
+
dedupeKey: cur.dedupeKey,
|
|
198
|
+
sessionId: cur.sessionId,
|
|
199
|
+
lane: cur.lane,
|
|
200
|
+
replaySessionId: sessionId,
|
|
201
|
+
});
|
|
202
|
+
return nextItem;
|
|
203
|
+
}
|
|
204
|
+
export function acknowledgeContinuationFollowUp(root, input) {
|
|
205
|
+
const q = readQueue(root);
|
|
206
|
+
const acknowledged = [];
|
|
207
|
+
const items = q.items.map((item) => {
|
|
208
|
+
if (item.status === 'acknowledged' || item.status === 'expired') {
|
|
209
|
+
return item;
|
|
210
|
+
}
|
|
211
|
+
let match = false;
|
|
212
|
+
if (input.followUpId) {
|
|
213
|
+
match = item.id === input.followUpId;
|
|
214
|
+
}
|
|
215
|
+
else if (input.dedupeKey) {
|
|
216
|
+
match = item.dedupeKey === input.dedupeKey;
|
|
217
|
+
}
|
|
218
|
+
else if (input.continuationId) {
|
|
219
|
+
match =
|
|
220
|
+
(item.status === 'queued' || item.status === 'replayed')
|
|
221
|
+
&& item.metadata?.continuationId === input.continuationId;
|
|
222
|
+
}
|
|
223
|
+
else if (input.lane !== undefined) {
|
|
224
|
+
match =
|
|
225
|
+
item.lane === input.lane
|
|
226
|
+
&& (input.sessionId === undefined || item.sessionId === input.sessionId || (input.sessionId === null && item.sessionId === null));
|
|
227
|
+
}
|
|
228
|
+
if (!match) {
|
|
229
|
+
return item;
|
|
230
|
+
}
|
|
231
|
+
const next = {
|
|
232
|
+
...item,
|
|
233
|
+
status: 'acknowledged',
|
|
234
|
+
acknowledgedAt: now(),
|
|
235
|
+
suppressReason: null,
|
|
236
|
+
metadata: { ...item.metadata, ackReason: input.reason, ackSource: input.source },
|
|
237
|
+
};
|
|
238
|
+
acknowledged.push(next);
|
|
239
|
+
ledgerFollowUp(root, 'continuation_followup_acknowledged', `Follow-up ${item.id} acknowledged`, {
|
|
240
|
+
followUpId: item.id,
|
|
241
|
+
trigger: item.trigger,
|
|
242
|
+
dedupeKey: item.dedupeKey,
|
|
243
|
+
sessionId: item.sessionId,
|
|
244
|
+
lane: item.lane,
|
|
245
|
+
reason: input.reason,
|
|
246
|
+
source: input.source,
|
|
247
|
+
});
|
|
248
|
+
return next;
|
|
249
|
+
});
|
|
250
|
+
writeQueue(root, { ...q, items });
|
|
251
|
+
return { acknowledged };
|
|
252
|
+
}
|
|
253
|
+
export function acknowledgeContinuationFollowUpsOnProgress(root, input) {
|
|
254
|
+
acknowledgeContinuationFollowUp(root, {
|
|
255
|
+
lane: input.lane,
|
|
256
|
+
sessionId: input.sessionId,
|
|
257
|
+
reason: input.reason,
|
|
258
|
+
source: input.source,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
export function readContinuationFollowUpQueue(root) {
|
|
262
|
+
const q = pruneExpiredContinuationFollowUps(root);
|
|
263
|
+
const counts = {
|
|
264
|
+
queued: 0,
|
|
265
|
+
replayed: 0,
|
|
266
|
+
suppressed: 0,
|
|
267
|
+
acknowledged: 0,
|
|
268
|
+
expired: 0,
|
|
269
|
+
};
|
|
270
|
+
for (const item of q.items) {
|
|
271
|
+
counts[item.status] += 1;
|
|
272
|
+
}
|
|
273
|
+
return { items: q.items, counts };
|
|
274
|
+
}
|
|
275
|
+
export function findQueuedFollowUpsForSession(root, sessionId) {
|
|
276
|
+
pruneExpiredContinuationFollowUps(root);
|
|
277
|
+
const q = readQueue(root);
|
|
278
|
+
return q.items.filter((i) => (i.status === 'queued' || i.status === 'replayed')
|
|
279
|
+
&& (i.sessionId === sessionId || (sessionId === null && i.sessionId === null)));
|
|
280
|
+
}
|
|
281
|
+
export function findHeadQueuedFollowUp(root, trigger) {
|
|
282
|
+
pruneExpiredContinuationFollowUps(root);
|
|
283
|
+
const q = readQueue(root);
|
|
284
|
+
const candidates = q.items.filter((i) => (i.status === 'queued' || i.status === 'replayed')
|
|
285
|
+
&& (!trigger || i.trigger === trigger));
|
|
286
|
+
return candidates.sort((a, b) => Date.parse(a.createdAt) - Date.parse(b.createdAt))[0] ?? null;
|
|
287
|
+
}
|
|
288
|
+
export function pickFollowUpForReplay(root, lane, sessionId) {
|
|
289
|
+
pruneExpiredContinuationFollowUps(root);
|
|
290
|
+
const q = readQueue(root);
|
|
291
|
+
const at = nowMs();
|
|
292
|
+
const candidates = q.items.filter((i) => (i.status === 'queued' || i.status === 'replayed')
|
|
293
|
+
&& i.lane === lane
|
|
294
|
+
&& Date.parse(i.expiresAt) > at
|
|
295
|
+
&& (sessionId === null || i.sessionId === null || i.sessionId === sessionId));
|
|
296
|
+
return candidates.sort((a, b) => Date.parse(a.createdAt) - Date.parse(b.createdAt))[0] ?? null;
|
|
297
|
+
}
|
|
298
|
+
export function buildStopDenyDedupeKey(input) {
|
|
299
|
+
const sid = input.sessionId ?? 'none';
|
|
300
|
+
const lid = input.laneId ?? 'none';
|
|
301
|
+
return `followup:stop-deny:${sid}:${input.lane}:${lid}:${input.blockerFingerprint}`;
|
|
302
|
+
}
|
|
303
|
+
export function buildSessionIdleDedupeKey(input) {
|
|
304
|
+
const sid = input.sessionId ?? 'none';
|
|
305
|
+
const lid = input.laneId ?? 'none';
|
|
306
|
+
return `followup:session-idle:${sid}:${input.lane}:${lid}`;
|
|
307
|
+
}
|
|
308
|
+
export function buildPostToolFailureDedupeKey(input) {
|
|
309
|
+
const sid = input.sessionId ?? 'none';
|
|
310
|
+
return `followup:post-tool-failure:${sid}:${input.toolName}:escalated`;
|
|
311
|
+
}
|
|
312
|
+
export function buildTeamMessageFollowUpDedupeKey(teamId, messageId) {
|
|
313
|
+
return `followup:team-message:${teamId}:${messageId}`;
|
|
314
|
+
}
|
|
315
|
+
export function buildSubagentStopFollowUpDedupeKey(sessionId, agentId, outcome) {
|
|
316
|
+
const sid = sessionId ?? 'none';
|
|
317
|
+
return `followup:subagent-stop:${sid}:${agentId}:${outcome}`;
|
|
318
|
+
}
|
|
319
|
+
export function buildDelegatedFollowUpDedupeKey(continuationId, trigger) {
|
|
320
|
+
return `followup:deleg:${continuationId}:${trigger}`;
|
|
321
|
+
}
|
|
322
|
+
export function fingerprintBlockers(blockers) {
|
|
323
|
+
const s = blockers.join('|').slice(0, 200);
|
|
324
|
+
let h = 0;
|
|
325
|
+
for (let i = 0; i < s.length; i += 1) {
|
|
326
|
+
h = (h * 31 + s.charCodeAt(i)) | 0;
|
|
327
|
+
}
|
|
328
|
+
return `fp_${(h >>> 0).toString(16)}`;
|
|
329
|
+
}
|
|
330
|
+
//# sourceMappingURL=continuationFollowUp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuationFollowUp.js","sourceRoot":"","sources":["../../../../src/shared/workflow/continuation/continuationFollowUp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iEAAiE,CAAC;AAe3G,MAAM,oBAAoB,GAAG,CAAU,CAAC;AACxC,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AA0BjE,SAAS,GAAG;IACV,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAY;IACrC,OAAO,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,mCAAmC,CAAC,CAAC;AACxE,CAAC;AAED,SAAS,YAAY;IACnB,OAAO;QACL,aAAa,EAAE,oBAAoB;QACnC,SAAS,EAAE,GAAG,EAAE;QAChB,KAAK,EAAE,EAAE;KACV,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO,YAAY,EAAE,CA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AAG,IAAI,KAAK,CAAC,QAAQ,YAAY,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,MAAc,EAAE,SAAiB;IACjF,OAAO,yBAAyB,MAAM,IAAI,SAAS,EAAE,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,kCAAkC,CAAC,SAAwB,EAAE,OAAe,EAAE,OAAe;IAC3G,MAAM,GAAG,GAAG,SAAS,IAAI,MAAM,CAAC;IAChC,OAAO,0BAA0B,GAAG,IAAI,OAAO,IAAI,OAAO,EAAE,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,+BAA+B,CAAC,cAAsB,EAAE,OAAe;IACrF,OAAO,kBAAkB,cAAc,IAAI,OAAO,EAAE,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,QAAkB;IACpD,MAAM,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC3C,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACrC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atlas-equivalent continuation orchestrator (Plan 12).
|
|
3
|
+
*
|
|
4
|
+
* TWIN note: runtime/hooks/_continuation.mjs is the runtime .mjs twin of this file.
|
|
5
|
+
* If logic changes here it MUST be reflected in _continuation.mjs, and vice-versa.
|
|
6
|
+
* The .mjs twin replicates isManualTaskCloseLedgerKind and isProtectedOperatorStatePath
|
|
7
|
+
* inline (those are TS-only; cannot be imported into .mjs at runtime).
|
|
8
|
+
*
|
|
9
|
+
* Single integration sink that wires together all five predecessor surfaces so
|
|
10
|
+
* active tasks, delegated sessions, and background work survive idle / stop /
|
|
11
|
+
* compaction boundaries.
|
|
12
|
+
*
|
|
13
|
+
* Per INV-031 the main enact-agent decides and orchestrates; runtime executes
|
|
14
|
+
* explicit graph nodes only. This module is therefore legitimately
|
|
15
|
+
* exported-only: the agent runtime (session-start.mjs / pre-compact.mjs hooks
|
|
16
|
+
* and the MCP operator tools) is the authoritative external caller. It is NOT
|
|
17
|
+
* dead code — it is the integration sink those callers import at runtime.
|
|
18
|
+
*
|
|
19
|
+
* Predecessor surfaces wired here:
|
|
20
|
+
* Slice 1 (subagent-tracker): recordSubagentStartedOnContinuation /
|
|
21
|
+
* recordSubagentStoppedOnContinuation — now reliable because
|
|
22
|
+
* subagent-tracker.mjs no longer crashes on SubagentStart/SubagentStop.
|
|
23
|
+
* Slice 2 (pre-compact): hasPendingLocalTasks — detects compaction survivors
|
|
24
|
+
* written by pre-compact.mjs's compaction-context.json write path.
|
|
25
|
+
* Slice 8 (protected-state): all state reads route through the Operator-owned
|
|
26
|
+
* broker (readContinuationState, readDelegatedSessionsState) rather than
|
|
27
|
+
* raw fs access.
|
|
28
|
+
* Slice 9 (team-transforms): captureActiveWorkflows + team-mailbox injection
|
|
29
|
+
* and role-gating layer is applied before re-enqueueing team work.
|
|
30
|
+
* Slice 10 (close-vocabulary): readContinuationFollowUpQueue /
|
|
31
|
+
* enqueueContinuationFollowUp — unified close-event vocabulary so both
|
|
32
|
+
* Factory workitem_manual_close and Operator task_manual_close unblock the
|
|
33
|
+
* follow-up queue.
|
|
34
|
+
*/
|
|
35
|
+
import { recordSubagentStartedOnContinuation, recordSubagentStoppedOnContinuation } from '../../../shared/workflow/continuation/continuation.js';
|
|
36
|
+
import { type ActiveWorkflowSnapshot } from '../../../shared/workflow/continuation/hookContinuation.js';
|
|
37
|
+
import { type DelegatedSessionResumePlan } from '../../../shared/workflow/delegation/delegatedSession.js';
|
|
38
|
+
export type ContinuationTrigger = 'idle' | 'stop' | 'compaction';
|
|
39
|
+
export interface ContinuationOrchestrationResult {
|
|
40
|
+
trigger: ContinuationTrigger;
|
|
41
|
+
capturedAt: string;
|
|
42
|
+
/** Active workflow snapshot (Slice 9 — captureActiveWorkflows). */
|
|
43
|
+
activeWorkflows: ActiveWorkflowSnapshot;
|
|
44
|
+
/** Pending session-scoped task IDs re-enqueued into continuation state (gap closed by this orchestrator). */
|
|
45
|
+
pendingSessionTaskIds: string[];
|
|
46
|
+
/** Resume plans for stale/active delegated sessions (gap closed by this orchestrator). */
|
|
47
|
+
delegatedSessionResumePlans: DelegatedSessionResumePlan[];
|
|
48
|
+
/** Whether compaction survivors were detected via hasPendingLocalTasks (Slice 2). */
|
|
49
|
+
hasCompactionSurvivors: boolean;
|
|
50
|
+
/** Number of follow-up items enqueued into the close-vocabulary queue (Slice 10). */
|
|
51
|
+
followUpQueuedCount: number;
|
|
52
|
+
/** Subagent IDs currently tracked as active on continuation state (Slice 1). */
|
|
53
|
+
activeSubagentIds: string[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Orchestrate continuation state across an idle / stop / compaction boundary.
|
|
57
|
+
*
|
|
58
|
+
* This is the single integration sink referenced by the atlas plan.
|
|
59
|
+
*/
|
|
60
|
+
export declare function orchestrateContinuation(root: string, trigger: ContinuationTrigger): ContinuationOrchestrationResult;
|
|
61
|
+
/**
|
|
62
|
+
* Convenience re-exports so callers can use the Slice 1 subagent lifecycle
|
|
63
|
+
* surfaces through the orchestrator module without a separate import.
|
|
64
|
+
*/
|
|
65
|
+
export { recordSubagentStartedOnContinuation, recordSubagentStoppedOnContinuation };
|
|
66
|
+
//# sourceMappingURL=continuationOrchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuationOrchestrator.d.ts","sourceRoot":"","sources":["../../../../src/shared/workflow/continuation/continuationOrchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAKL,mCAAmC,EACnC,mCAAmC,EACpC,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAA0B,KAAK,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AAKzH,OAAO,EAIL,KAAK,0BAA0B,EAChC,MAAM,kDAAkD,CAAC;AAe1D,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;AAEjE,MAAM,WAAW,+BAA+B;IAC9C,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,eAAe,EAAE,sBAAsB,CAAC;IACxC,6GAA6G;IAC7G,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,0FAA0F;IAC1F,2BAA2B,EAAE,0BAA0B,EAAE,CAAC;IAC1D,qFAAqF;IACrF,sBAAsB,EAAE,OAAO,CAAC;IAChC,qFAAqF;IACrF,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gFAAgF;IAChF,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,mBAAmB,GAC3B,+BAA+B,CAgHjC;AAED;;;GAGG;AACH,OAAO,EAAE,mCAAmC,EAAE,mCAAmC,EAAE,CAAC"}
|