@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,497 @@
|
|
|
1
|
+
import { abortUltrawork, advanceUltrawork, blockUltrawork, buildUltraworkPhaseContext, cancelUltraworkChildTask, completeUltrawork, completeUltraworkChildTask, escalateToTeam, getUltrawork, linkPlan, linkResearch, linkTaskRef, recordUltraworkVerification, retargetUltrawork, routeUltrawork, setUltraworkClosureState, startUltrawork, ULTRAWORK_TRANSITIONS, } from '../../lanes/ultrawork/index.js';
|
|
2
|
+
import { handled, parseGateProfile, parseGoalScope, UNHANDLED } from '../../mcp/laneSupport.js';
|
|
3
|
+
import { createEvidenceHorizon } from '../../shared/core/events.js';
|
|
4
|
+
import { layoutPath } from '../../shared/core/contract.js';
|
|
5
|
+
import { readJson, writeJson } from '../../shared/core/json.js';
|
|
6
|
+
import { readOperatorAuthority } from '../../shared/workflow/authority/authority.js';
|
|
7
|
+
import { inferUltraworkPhase } from '../../lanes/ultrawork/phases.js';
|
|
8
|
+
export const ultraworkToolDefinitions = [
|
|
9
|
+
{
|
|
10
|
+
name: 'operator_ultrawork_start',
|
|
11
|
+
description: 'Start a new Ultrawork session.',
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
root: { type: 'string' },
|
|
16
|
+
intent: { type: 'string' },
|
|
17
|
+
sessionId: { type: 'string' },
|
|
18
|
+
route: { type: 'string', enum: ['direct', 'deep-interview', 'plan-only', 'team-escalated'] },
|
|
19
|
+
activationMetadata: { type: 'object' },
|
|
20
|
+
goalScope: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
enum: ['repo-local', 'operator-runtime', 'operator-replacement'],
|
|
23
|
+
description: 'Optional explicit goal scope for this session.',
|
|
24
|
+
},
|
|
25
|
+
gateProfile: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
enum: ['repo-delivery', 'operator-runtime', 'operator-replacement', 'benchmark-harness'],
|
|
28
|
+
description: 'Gate profile to use. If omitted, inferred from intent text and repo identity.',
|
|
29
|
+
},
|
|
30
|
+
assignmentId: { type: 'string', description: 'Optional assignment id from spawn handoff (local session metadata only).' },
|
|
31
|
+
},
|
|
32
|
+
required: ['intent'],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'operator_ultrawork_status',
|
|
37
|
+
description: 'Get current Ultrawork session state.',
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: 'object',
|
|
40
|
+
properties: {
|
|
41
|
+
root: { type: 'string' },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'operator_ultrawork_route',
|
|
47
|
+
description: 'Set the Ultrawork session route.',
|
|
48
|
+
inputSchema: {
|
|
49
|
+
type: 'object',
|
|
50
|
+
properties: {
|
|
51
|
+
root: { type: 'string' },
|
|
52
|
+
route: { type: 'string', enum: ['direct', 'deep-interview', 'plan-only', 'team-escalated'] },
|
|
53
|
+
note: { type: 'string' },
|
|
54
|
+
},
|
|
55
|
+
required: ['route'],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'operator_ultrawork_advance',
|
|
60
|
+
description: 'Advance Ultrawork to a new phase.',
|
|
61
|
+
inputSchema: {
|
|
62
|
+
type: 'object',
|
|
63
|
+
properties: {
|
|
64
|
+
root: { type: 'string' },
|
|
65
|
+
toPhase: { type: 'string', enum: ['clarify', 'plan', 'execute', 'verify', 'review', 'blocked', 'completed', 'aborted'] },
|
|
66
|
+
note: { type: 'string' },
|
|
67
|
+
by: { type: 'string' },
|
|
68
|
+
},
|
|
69
|
+
required: ['toPhase'],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'operator_ultrawork_escalate',
|
|
74
|
+
description: 'Escalate Ultrawork session to a team.',
|
|
75
|
+
inputSchema: {
|
|
76
|
+
type: 'object',
|
|
77
|
+
properties: {
|
|
78
|
+
root: { type: 'string' },
|
|
79
|
+
teamId: { type: 'string' },
|
|
80
|
+
reason: { type: 'string' },
|
|
81
|
+
},
|
|
82
|
+
required: ['teamId', 'reason'],
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'operator_ultrawork_verify',
|
|
87
|
+
description: 'Record Ultrawork verification evidence.',
|
|
88
|
+
inputSchema: {
|
|
89
|
+
type: 'object',
|
|
90
|
+
properties: {
|
|
91
|
+
root: { type: 'string' },
|
|
92
|
+
evidence: { type: 'string' },
|
|
93
|
+
scenarios: {
|
|
94
|
+
type: 'array',
|
|
95
|
+
items: {
|
|
96
|
+
type: 'object',
|
|
97
|
+
properties: {
|
|
98
|
+
class: { type: 'string', enum: ['happy', 'edge', 'regression'] },
|
|
99
|
+
description: { type: 'string' },
|
|
100
|
+
passCondition: { type: 'string' },
|
|
101
|
+
surfaceArtifact: { type: 'string' },
|
|
102
|
+
},
|
|
103
|
+
required: ['class', 'description', 'passCondition', 'surfaceArtifact'],
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
reviewerVerdict: {
|
|
107
|
+
type: 'string',
|
|
108
|
+
enum: ['UNCONDITIONAL_APPROVE', 'looks good but requires minor cleanup'],
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
required: ['evidence'],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'operator_ultrawork_link_plan',
|
|
116
|
+
description: 'Link a plan to the Ultrawork session.',
|
|
117
|
+
inputSchema: {
|
|
118
|
+
type: 'object',
|
|
119
|
+
properties: {
|
|
120
|
+
root: { type: 'string' },
|
|
121
|
+
planId: { type: 'string' },
|
|
122
|
+
},
|
|
123
|
+
required: ['planId'],
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'operator_ultrawork_link_task',
|
|
128
|
+
description: 'Link a task to the Ultrawork session.',
|
|
129
|
+
inputSchema: {
|
|
130
|
+
type: 'object',
|
|
131
|
+
properties: {
|
|
132
|
+
root: { type: 'string' },
|
|
133
|
+
taskId: { type: 'string' },
|
|
134
|
+
},
|
|
135
|
+
required: ['taskId'],
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'operator_ultrawork_link_research',
|
|
140
|
+
description: 'Link a research entry to the Ultrawork session.',
|
|
141
|
+
inputSchema: {
|
|
142
|
+
type: 'object',
|
|
143
|
+
properties: {
|
|
144
|
+
root: { type: 'string' },
|
|
145
|
+
researchId: { type: 'string' },
|
|
146
|
+
},
|
|
147
|
+
required: ['researchId'],
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: 'operator_ultrawork_complete',
|
|
152
|
+
description: 'Complete the Ultrawork session.',
|
|
153
|
+
inputSchema: {
|
|
154
|
+
type: 'object',
|
|
155
|
+
properties: {
|
|
156
|
+
root: { type: 'string' },
|
|
157
|
+
summary: { type: 'string' },
|
|
158
|
+
},
|
|
159
|
+
required: ['summary'],
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: 'operator_ultrawork_block',
|
|
164
|
+
description: 'Block the Ultrawork session.',
|
|
165
|
+
inputSchema: {
|
|
166
|
+
type: 'object',
|
|
167
|
+
properties: {
|
|
168
|
+
root: { type: 'string' },
|
|
169
|
+
reason: { type: 'string' },
|
|
170
|
+
},
|
|
171
|
+
required: ['reason'],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'operator_ultrawork_abort',
|
|
176
|
+
description: 'Abort the Ultrawork session.',
|
|
177
|
+
inputSchema: {
|
|
178
|
+
type: 'object',
|
|
179
|
+
properties: {
|
|
180
|
+
root: { type: 'string' },
|
|
181
|
+
reason: { type: 'string' },
|
|
182
|
+
},
|
|
183
|
+
required: ['reason'],
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: 'operator_ultrawork_retarget',
|
|
188
|
+
description: 'Retarget the active Ultrawork session with an explicit mode. Mutates durable state and records retarget history.',
|
|
189
|
+
inputSchema: {
|
|
190
|
+
type: 'object',
|
|
191
|
+
properties: {
|
|
192
|
+
root: { type: 'string' },
|
|
193
|
+
intent: { type: 'string' },
|
|
194
|
+
mode: { type: 'string', enum: ['replace-intent', 'narrow-scope', 'resume-unchanged', 'fork-child-task'] },
|
|
195
|
+
gateProfile: { type: 'string', enum: ['repo-delivery', 'operator-runtime', 'operator-replacement', 'benchmark-harness'] },
|
|
196
|
+
goalScope: { type: 'string', enum: ['repo-local', 'operator-runtime', 'operator-replacement'] },
|
|
197
|
+
note: { type: 'string' },
|
|
198
|
+
by: { type: 'string' },
|
|
199
|
+
},
|
|
200
|
+
required: ['intent', 'mode'],
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: 'operator_ultragoal_retarget',
|
|
205
|
+
description: 'Update an ultragoal artifact by replacing its stored goal text.',
|
|
206
|
+
inputSchema: {
|
|
207
|
+
type: 'object',
|
|
208
|
+
properties: {
|
|
209
|
+
root: { type: 'string' },
|
|
210
|
+
id: { type: 'string' },
|
|
211
|
+
goal: { type: 'string' },
|
|
212
|
+
note: { type: 'string' },
|
|
213
|
+
},
|
|
214
|
+
required: ['id', 'goal'],
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: 'operator_ultrawork_child_task_complete',
|
|
219
|
+
description: 'Mark a pending ultrawork child task as completed.',
|
|
220
|
+
inputSchema: {
|
|
221
|
+
type: 'object',
|
|
222
|
+
properties: {
|
|
223
|
+
root: { type: 'string' },
|
|
224
|
+
childTaskId: { type: 'string' },
|
|
225
|
+
note: { type: 'string' },
|
|
226
|
+
by: { type: 'string' },
|
|
227
|
+
},
|
|
228
|
+
required: ['childTaskId'],
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: 'operator_ultrawork_child_task_cancel',
|
|
233
|
+
description: 'Mark a pending ultrawork child task as cancelled.',
|
|
234
|
+
inputSchema: {
|
|
235
|
+
type: 'object',
|
|
236
|
+
properties: {
|
|
237
|
+
root: { type: 'string' },
|
|
238
|
+
childTaskId: { type: 'string' },
|
|
239
|
+
note: { type: 'string' },
|
|
240
|
+
by: { type: 'string' },
|
|
241
|
+
},
|
|
242
|
+
required: ['childTaskId'],
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
name: 'operator_ultrawork_set_closure_state',
|
|
247
|
+
description: 'Set the closureState on the active Ultrawork session. Valid values: none, integration_pending, integration_approved, goal_closed.',
|
|
248
|
+
inputSchema: {
|
|
249
|
+
type: 'object',
|
|
250
|
+
properties: {
|
|
251
|
+
root: { type: 'string' },
|
|
252
|
+
closureState: {
|
|
253
|
+
type: 'string',
|
|
254
|
+
enum: ['none', 'integration_pending', 'integration_approved', 'goal_closed'],
|
|
255
|
+
},
|
|
256
|
+
note: { type: 'string' },
|
|
257
|
+
},
|
|
258
|
+
required: ['closureState'],
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: 'operator_ultrawork_next_phase',
|
|
263
|
+
description: 'Read-only ergonomics layer: reads the current Ultrawork phase, validates the requested next phase against the allowed TRANSITIONS table, and returns a structured result with current phase, requested phase, allowed next phases, and a recommendedAction. Does NOT advance state — call operator_ultrawork_advance to actually transition.',
|
|
264
|
+
inputSchema: {
|
|
265
|
+
type: 'object',
|
|
266
|
+
properties: {
|
|
267
|
+
root: { type: 'string' },
|
|
268
|
+
requested: {
|
|
269
|
+
type: 'string',
|
|
270
|
+
enum: ['clarify', 'plan', 'execute', 'verify', 'review', 'blocked', 'completed', 'aborted'],
|
|
271
|
+
description: 'The phase the operator intends to move to.',
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
required: ['requested'],
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
name: 'operator_ultrawork_recompute_phase',
|
|
279
|
+
description: 'D4 — Derive the Ultrawork phase from real execution facts via a hard-coded rule table. Returns currentPhase, inferredPhase, ruleMatched, wouldAdvance, applied. When apply=true AND transition guard passes, advances phase and emits PhaseTransitionEvent. When apply=false, returns inference only; phaseStale is set on operator_snapshot when inferred differs from current.',
|
|
280
|
+
inputSchema: {
|
|
281
|
+
type: 'object',
|
|
282
|
+
properties: {
|
|
283
|
+
root: { type: 'string' },
|
|
284
|
+
modeType: { type: 'string', enum: ['ultrawork'], description: 'Optional ultrawork mode type hint.' },
|
|
285
|
+
modeId: { type: 'string', description: 'Optional ultrawork id; if omitted reads current session.' },
|
|
286
|
+
apply: { type: 'boolean', description: 'If true and transition guard passes, advance the phase. Default false.' },
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
];
|
|
291
|
+
export async function handleUltraworkTool(name, context) {
|
|
292
|
+
const { root, args } = context;
|
|
293
|
+
switch (name) {
|
|
294
|
+
case 'operator_ultrawork_start': {
|
|
295
|
+
const route = typeof args.route === 'string' ? args.route : undefined;
|
|
296
|
+
if (route !== undefined) {
|
|
297
|
+
const validRoutes = ['direct', 'deep-interview', 'plan-only', 'team-escalated'];
|
|
298
|
+
if (!validRoutes.includes(route)) {
|
|
299
|
+
throw new Error(`Invalid route "${route}". Must be one of: ${validRoutes.join(', ')}.`);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
const goalScope = parseGoalScope(args.goalScope);
|
|
303
|
+
if (args.goalScope !== undefined && goalScope === undefined) {
|
|
304
|
+
throw new Error('Invalid goalScope. Must be one of: repo-local, operator-runtime, operator-replacement.');
|
|
305
|
+
}
|
|
306
|
+
const gateProfile = parseGateProfile(args.gateProfile);
|
|
307
|
+
if (args.gateProfile !== undefined && gateProfile === undefined) {
|
|
308
|
+
throw new Error('Invalid gateProfile. Must be one of: repo-delivery, operator-runtime, operator-replacement, benchmark-harness.');
|
|
309
|
+
}
|
|
310
|
+
if (gateProfile !== undefined) {
|
|
311
|
+
const validProfiles = ['repo-delivery', 'operator-runtime', 'operator-replacement', 'benchmark-harness'];
|
|
312
|
+
if (!validProfiles.includes(gateProfile)) {
|
|
313
|
+
throw new Error(`Invalid gateProfile "${gateProfile}". Must be one of: ${validProfiles.join(', ')}.`);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return handled(startUltrawork(root, {
|
|
317
|
+
intent: String(args.intent),
|
|
318
|
+
sessionId: typeof args.sessionId === 'string' ? args.sessionId : undefined,
|
|
319
|
+
route,
|
|
320
|
+
goalScope,
|
|
321
|
+
gateProfile,
|
|
322
|
+
taskId: typeof args.taskId === 'string' ? args.taskId : undefined,
|
|
323
|
+
assignmentId: typeof args.assignmentId === 'string' ? args.assignmentId : undefined,
|
|
324
|
+
activationMetadata: typeof args.activationMetadata === 'object' && args.activationMetadata !== null
|
|
325
|
+
? args.activationMetadata
|
|
326
|
+
: undefined,
|
|
327
|
+
}));
|
|
328
|
+
}
|
|
329
|
+
case 'operator_ultrawork_status':
|
|
330
|
+
return handled(getUltrawork(root));
|
|
331
|
+
case 'operator_ultrawork_route': {
|
|
332
|
+
const route = String(args.route);
|
|
333
|
+
const validRoutes = ['direct', 'deep-interview', 'plan-only', 'team-escalated'];
|
|
334
|
+
if (!validRoutes.includes(route)) {
|
|
335
|
+
throw new Error(`Invalid route "${route}". Must be one of: ${validRoutes.join(', ')}.`);
|
|
336
|
+
}
|
|
337
|
+
return handled(routeUltrawork(root, route, typeof args.note === 'string' ? args.note : undefined));
|
|
338
|
+
}
|
|
339
|
+
case 'operator_ultrawork_advance': {
|
|
340
|
+
const toPhase = String(args.toPhase);
|
|
341
|
+
const validPhases = ['clarify', 'plan', 'execute', 'verify', 'review', 'blocked', 'completed', 'aborted'];
|
|
342
|
+
if (!validPhases.includes(toPhase)) {
|
|
343
|
+
throw new Error(`Invalid Ultrawork phase "${toPhase}". Must be one of: ${validPhases.join(', ')}.`);
|
|
344
|
+
}
|
|
345
|
+
return handled(advanceUltrawork(root, {
|
|
346
|
+
toPhase,
|
|
347
|
+
note: typeof args.note === 'string' ? args.note : undefined,
|
|
348
|
+
by: typeof args.by === 'string' ? args.by : undefined,
|
|
349
|
+
}));
|
|
350
|
+
}
|
|
351
|
+
case 'operator_ultrawork_escalate':
|
|
352
|
+
return handled(escalateToTeam(root, String(args.teamId), String(args.reason)));
|
|
353
|
+
case 'operator_ultrawork_verify':
|
|
354
|
+
return handled(recordUltraworkVerification(root, String(args.evidence), {
|
|
355
|
+
scenarios: Array.isArray(args.scenarios) ? args.scenarios : undefined,
|
|
356
|
+
reviewerVerdict: typeof args.reviewerVerdict === 'string' ? args.reviewerVerdict : undefined,
|
|
357
|
+
}));
|
|
358
|
+
case 'operator_ultrawork_link_plan':
|
|
359
|
+
return handled(linkPlan(root, String(args.planId)));
|
|
360
|
+
case 'operator_ultrawork_link_task':
|
|
361
|
+
return handled(linkTaskRef(root, String(args.taskId)));
|
|
362
|
+
case 'operator_ultrawork_link_research':
|
|
363
|
+
return handled(linkResearch(root, String(args.researchId)));
|
|
364
|
+
case 'operator_ultrawork_complete':
|
|
365
|
+
return handled(completeUltrawork(root, String(args.summary)));
|
|
366
|
+
case 'operator_ultrawork_block':
|
|
367
|
+
return handled(blockUltrawork(root, String(args.reason)));
|
|
368
|
+
case 'operator_ultrawork_abort':
|
|
369
|
+
return handled(abortUltrawork(root, String(args.reason)));
|
|
370
|
+
case 'operator_ultrawork_retarget': {
|
|
371
|
+
const goalScope = parseGoalScope(args.goalScope);
|
|
372
|
+
if (args.goalScope !== undefined && goalScope === undefined) {
|
|
373
|
+
throw new Error('Invalid goalScope. Must be one of: repo-local, operator-runtime, operator-replacement.');
|
|
374
|
+
}
|
|
375
|
+
const gateProfile = parseGateProfile(args.gateProfile);
|
|
376
|
+
if (args.gateProfile !== undefined && gateProfile === undefined) {
|
|
377
|
+
throw new Error('Invalid gateProfile. Must be one of: repo-delivery, operator-runtime, operator-replacement, benchmark-harness.');
|
|
378
|
+
}
|
|
379
|
+
return handled(retargetUltrawork(root, {
|
|
380
|
+
intent: String(args.intent),
|
|
381
|
+
mode: String(args.mode),
|
|
382
|
+
gateProfile,
|
|
383
|
+
goalScope,
|
|
384
|
+
note: typeof args.note === 'string' ? args.note : undefined,
|
|
385
|
+
by: typeof args.by === 'string' ? args.by : undefined,
|
|
386
|
+
}));
|
|
387
|
+
}
|
|
388
|
+
case 'operator_ultragoal_retarget': {
|
|
389
|
+
const goalId = String(args.id);
|
|
390
|
+
const goalPath = layoutPath(root, 'ultragoal', `${goalId}.json`);
|
|
391
|
+
const existing = readJson(goalPath, {});
|
|
392
|
+
const history = Array.isArray(existing.history) ? existing.history : [];
|
|
393
|
+
const next = {
|
|
394
|
+
...existing,
|
|
395
|
+
goal: String(args.goal),
|
|
396
|
+
updatedAt: new Date().toISOString(),
|
|
397
|
+
history: [
|
|
398
|
+
...history,
|
|
399
|
+
{
|
|
400
|
+
at: new Date().toISOString(),
|
|
401
|
+
mode: 'replace-intent',
|
|
402
|
+
note: typeof args.note === 'string' ? args.note : undefined,
|
|
403
|
+
oldGoal: typeof existing.goal === 'string' ? existing.goal : null,
|
|
404
|
+
newGoal: String(args.goal),
|
|
405
|
+
},
|
|
406
|
+
],
|
|
407
|
+
};
|
|
408
|
+
writeJson(goalPath, next);
|
|
409
|
+
return handled({ id: goalId, path: goalPath, data: next });
|
|
410
|
+
}
|
|
411
|
+
case 'operator_ultrawork_child_task_complete':
|
|
412
|
+
return handled(completeUltraworkChildTask(root, String(args.childTaskId), {
|
|
413
|
+
by: typeof args.by === 'string' ? args.by : undefined,
|
|
414
|
+
note: typeof args.note === 'string' ? args.note : undefined,
|
|
415
|
+
}));
|
|
416
|
+
case 'operator_ultrawork_child_task_cancel':
|
|
417
|
+
return handled(cancelUltraworkChildTask(root, String(args.childTaskId), {
|
|
418
|
+
by: typeof args.by === 'string' ? args.by : undefined,
|
|
419
|
+
note: typeof args.note === 'string' ? args.note : undefined,
|
|
420
|
+
}));
|
|
421
|
+
case 'operator_ultrawork_set_closure_state': {
|
|
422
|
+
const closureState = String(args.closureState);
|
|
423
|
+
const validClosureStates = ['none', 'integration_pending', 'integration_approved', 'goal_closed'];
|
|
424
|
+
if (!validClosureStates.includes(closureState)) {
|
|
425
|
+
throw new Error(`Invalid closureState "${closureState}". Must be one of: ${validClosureStates.join(', ')}.`);
|
|
426
|
+
}
|
|
427
|
+
return handled(setUltraworkClosureState(root, closureState, typeof args.note === 'string' ? args.note : undefined));
|
|
428
|
+
}
|
|
429
|
+
case 'operator_ultrawork_next_phase': {
|
|
430
|
+
const requested = String(args.requested);
|
|
431
|
+
const validPhases = ['clarify', 'plan', 'execute', 'verify', 'review', 'blocked', 'completed', 'aborted'];
|
|
432
|
+
if (!validPhases.includes(requested)) {
|
|
433
|
+
throw new Error(`Invalid requested phase "${requested}". Must be one of: ${validPhases.join(', ')}.`);
|
|
434
|
+
}
|
|
435
|
+
const ultrawork = getUltrawork(root);
|
|
436
|
+
if (!ultrawork) {
|
|
437
|
+
throw new Error('No Ultrawork state file found. Start an Ultrawork session first.');
|
|
438
|
+
}
|
|
439
|
+
const current = ultrawork.phase;
|
|
440
|
+
const allowedNext = ULTRAWORK_TRANSITIONS[current];
|
|
441
|
+
const valid = allowedNext.includes(requested);
|
|
442
|
+
let recommendedAction;
|
|
443
|
+
if (allowedNext.length === 0) {
|
|
444
|
+
recommendedAction = `Phase "${current}" is terminal. No further transitions are possible.`;
|
|
445
|
+
}
|
|
446
|
+
else if (valid) {
|
|
447
|
+
recommendedAction = `Call operator_ultrawork_advance with toPhase="${requested}" to proceed.`;
|
|
448
|
+
}
|
|
449
|
+
else {
|
|
450
|
+
recommendedAction = `Transition "${current}" → "${requested}" is not allowed. Allowed next phases: [${allowedNext.join(', ')}].`;
|
|
451
|
+
}
|
|
452
|
+
return handled({
|
|
453
|
+
current,
|
|
454
|
+
requested,
|
|
455
|
+
allowedNext,
|
|
456
|
+
allowed: valid,
|
|
457
|
+
recommendedAction,
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
case 'operator_ultrawork_recompute_phase': {
|
|
461
|
+
const ultrawork = getUltrawork(root);
|
|
462
|
+
if (!ultrawork) {
|
|
463
|
+
throw new Error('No Ultrawork state found. Start an Ultrawork session first.');
|
|
464
|
+
}
|
|
465
|
+
const authority = readOperatorAuthority(root);
|
|
466
|
+
const context = buildUltraworkPhaseContext(ultrawork, authority.reviews, root);
|
|
467
|
+
const inference = inferUltraworkPhase(context);
|
|
468
|
+
const currentPhase = ultrawork.phase;
|
|
469
|
+
const inferredPhase = inference.inferredPhase;
|
|
470
|
+
const wouldAdvance = inferredPhase !== null && inferredPhase !== currentPhase && !inference.blockedByTransitionGuard;
|
|
471
|
+
const apply = args.apply === true;
|
|
472
|
+
let applied = false;
|
|
473
|
+
if (apply && wouldAdvance && inferredPhase !== null) {
|
|
474
|
+
advanceUltrawork(root, {
|
|
475
|
+
toPhase: inferredPhase,
|
|
476
|
+
note: `Phase recomputed by rule_table rule ${inference.ruleMatched ?? 'unknown'}`,
|
|
477
|
+
by: 'operator_ultrawork_recompute_phase',
|
|
478
|
+
trigger: 'reconcile',
|
|
479
|
+
});
|
|
480
|
+
applied = true;
|
|
481
|
+
}
|
|
482
|
+
return handled({
|
|
483
|
+
currentPhase,
|
|
484
|
+
inferredPhase,
|
|
485
|
+
ruleMatched: inference.ruleMatched,
|
|
486
|
+
wouldAdvance,
|
|
487
|
+
applied,
|
|
488
|
+
blockedByTransitionGuard: inference.blockedByTransitionGuard || false,
|
|
489
|
+
noTaskIds: inference.noTaskIds,
|
|
490
|
+
evidenceHorizon: createEvidenceHorizon(root),
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
default:
|
|
494
|
+
return UNHANDLED;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
//# sourceMappingURL=ultrawork.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ultrawork.js","sourceRoot":"","sources":["../../../src/mcp/lanes/ultrawork.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,0BAA0B,EAC1B,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,2BAA2B,EAC3B,iBAAiB,EACjB,cAAc,EACd,wBAAwB,EACxB,cAAc,EACd,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,OAAO,EAA6C,gBAAgB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEvI,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGlE,MAAM,CAAC,MAAM,wBAAwB,GAAqB;IACxD;QACE,IAAI,EAAE,0BAA0B;QAChC,WAAW,EAAE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ACP,wBAAwB,EAAE,SAAS,CAAC,wBAAwB,IAAI,KAAK;gBACrE,SAAS,EAAE,SAAS,CAAC,SAAS;gBAC9B,eAAe,EAAE,qBAAqB,CAAC,IAAI,CAAC;aAC7C,CAAC,CAAC;QACL,CAAC;QACD;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type LaneToolContext, type LaneToolResult } from '../mcp/laneSupport.js';
|
|
2
|
+
import type { ToolDefinition } from '../mcp/toolPartitions.js';
|
|
3
|
+
export declare const linkageToolDefinitions: ToolDefinition[];
|
|
4
|
+
export declare function handleLinkageTool(name: string, context: LaneToolContext): Promise<LaneToolResult>;
|
|
5
|
+
//# sourceMappingURL=linkage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkage.d.ts","sourceRoot":"","sources":["../../src/mcp/linkage.ts"],"names":[],"mappings":"AAIA,OAAO,EAA2B,KAAK,eAAe,EAAE,KAAK,cAAc,EAAa,MAAM,sBAAsB,CAAC;AACrH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAK9D,eAAO,MAAM,sBAAsB,EAAE,cAAc,EAsElD,CAAC;AAEF,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CA6CvG"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { linkRalphTask, unlinkRalphTask } from '../lanes/ralph/index.js';
|
|
2
|
+
import { linkUltraworkAssignment, unlinkUltraworkAssignment, unlinkUltraworkTask } from '../lanes/ultrawork/index.js';
|
|
3
|
+
import { appendLedger } from '../operator/runtime.js';
|
|
4
|
+
import { getTask } from '../shared/state/tasks.js';
|
|
5
|
+
import { handled, requiredString, UNHANDLED } from '../mcp/laneSupport.js';
|
|
6
|
+
const GOVERNANCE_BOUNDARY_ERROR = 'Board/governance operations are not available on operator MCP. Use the enact-factory MCP server (separate process) for assignment sync, observe/push queues, and lifecycle push to the board.';
|
|
7
|
+
export const linkageToolDefinitions = [
|
|
8
|
+
{
|
|
9
|
+
name: 'operator_ralph_link_task',
|
|
10
|
+
description: 'Link the active Ralph session to one operator task id. Fails if already linked to a different task.',
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {
|
|
14
|
+
root: { type: 'string' },
|
|
15
|
+
taskId: { type: 'string' },
|
|
16
|
+
},
|
|
17
|
+
required: ['taskId'],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'operator_ralph_unlink_task',
|
|
22
|
+
description: 'Remove the task link from the active Ralph session.',
|
|
23
|
+
inputSchema: { type: 'object', properties: { root: { type: 'string' } } },
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'operator_ultrawork_unlink_task',
|
|
27
|
+
description: 'Remove the task link from the active Ultrawork session.',
|
|
28
|
+
inputSchema: { type: 'object', properties: { root: { type: 'string' } } },
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'operator_ralph_link_assignment',
|
|
32
|
+
description: 'Stamp an external assignment id on the active Ralph session (from spawn handoff). Local metadata only — does not contact the board or enact-factory.',
|
|
33
|
+
inputSchema: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: {
|
|
36
|
+
root: { type: 'string' },
|
|
37
|
+
assignmentId: { type: 'string', description: 'Assignment id from control-plane handoff (ENACT_ASSIGNMENT_ID).' },
|
|
38
|
+
},
|
|
39
|
+
required: ['assignmentId'],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'operator_ralph_unlink_assignment',
|
|
44
|
+
description: 'Clear the linked assignment id from the active Ralph session.',
|
|
45
|
+
inputSchema: { type: 'object', properties: { root: { type: 'string' } } },
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'operator_ultrawork_link_assignment',
|
|
49
|
+
description: 'Stamp an external assignment id on the active Ultrawork session. Local metadata only.',
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: 'object',
|
|
52
|
+
properties: {
|
|
53
|
+
root: { type: 'string' },
|
|
54
|
+
assignmentId: { type: 'string' },
|
|
55
|
+
},
|
|
56
|
+
required: ['assignmentId'],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'operator_ultrawork_unlink_assignment',
|
|
61
|
+
description: 'Clear the linked assignment id from the active Ultrawork session.',
|
|
62
|
+
inputSchema: { type: 'object', properties: { root: { type: 'string' } } },
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'operator_lane_tracker_acknowledge_close',
|
|
66
|
+
description: 'Acknowledge legitimate close of a local task tracker (cross-repo Epic). Emits task_manual_close for stop-policy.',
|
|
67
|
+
inputSchema: {
|
|
68
|
+
type: 'object',
|
|
69
|
+
properties: {
|
|
70
|
+
root: { type: 'string' },
|
|
71
|
+
taskId: { type: 'string' },
|
|
72
|
+
operatorOverrideReason: { type: 'string' },
|
|
73
|
+
},
|
|
74
|
+
required: ['taskId', 'operatorOverrideReason'],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
export async function handleLinkageTool(name, context) {
|
|
79
|
+
const { root, args } = context;
|
|
80
|
+
switch (name) {
|
|
81
|
+
case 'operator_ralph_link_task':
|
|
82
|
+
return handled(linkRalphTask(root, requiredString(args.taskId, 'operator_ralph_link_task: taskId is required.')));
|
|
83
|
+
case 'operator_ralph_unlink_task':
|
|
84
|
+
return handled(unlinkRalphTask(root));
|
|
85
|
+
case 'operator_ultrawork_unlink_task':
|
|
86
|
+
return handled(unlinkUltraworkTask(root));
|
|
87
|
+
case 'operator_ralph_link_assignment':
|
|
88
|
+
return handled(linkRalphTask(root, String(args.assignmentId)));
|
|
89
|
+
case 'operator_ralph_unlink_assignment':
|
|
90
|
+
return handled(unlinkRalphTask(root));
|
|
91
|
+
case 'operator_ultrawork_link_assignment':
|
|
92
|
+
return handled(linkUltraworkAssignment(root, requiredString(args.assignmentId, 'operator_ultrawork_link_assignment: assignmentId is required.')));
|
|
93
|
+
case 'operator_ultrawork_unlink_assignment':
|
|
94
|
+
return handled(unlinkUltraworkAssignment(root));
|
|
95
|
+
case 'operator_lane_tracker_acknowledge_close': {
|
|
96
|
+
const taskId = String(args.taskId ?? '');
|
|
97
|
+
const operatorOverrideReason = String(args.operatorOverrideReason ?? '');
|
|
98
|
+
if (!taskId)
|
|
99
|
+
throw new Error('operator_lane_tracker_acknowledge_close: taskId is required');
|
|
100
|
+
if (!operatorOverrideReason)
|
|
101
|
+
throw new Error('operator_lane_tracker_acknowledge_close: operatorOverrideReason is required');
|
|
102
|
+
const task = getTask(root, taskId);
|
|
103
|
+
if (!task)
|
|
104
|
+
throw new Error(`operator_lane_tracker_acknowledge_close: Task ${taskId} not found`);
|
|
105
|
+
appendLedger(root, {
|
|
106
|
+
kind: 'task_manual_close',
|
|
107
|
+
action: 'operator_acknowledge_close',
|
|
108
|
+
detail: `Operator acknowledged legitimate close of Task ${taskId} (closureScope='${task.closureScope ?? 'unset'}'). Reason: ${operatorOverrideReason}`,
|
|
109
|
+
taskId,
|
|
110
|
+
metadata: {
|
|
111
|
+
taskId,
|
|
112
|
+
closureScope: task.closureScope,
|
|
113
|
+
operatorOverrideReason,
|
|
114
|
+
surface: 'acknowledge_close',
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
return handled({ acknowledged: true, taskId, reason: operatorOverrideReason });
|
|
118
|
+
}
|
|
119
|
+
case 'operator_ultrawork_seed_items_from_acceptance_criteria':
|
|
120
|
+
case 'operator_ultrawork_reseed_items':
|
|
121
|
+
throw new Error(GOVERNANCE_BOUNDARY_ERROR);
|
|
122
|
+
default:
|
|
123
|
+
return UNHANDLED;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=linkage.js.map
|