@a5c-ai/agent-platform 5.0.1-staging.b436b3b3e611
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 +53 -0
- package/dist/anycli/cache.d.ts +45 -0
- package/dist/anycli/cache.d.ts.map +1 -0
- package/dist/anycli/cache.js +118 -0
- package/dist/anycli/index.d.ts +10 -0
- package/dist/anycli/index.d.ts.map +1 -0
- package/dist/anycli/index.js +25 -0
- package/dist/anycli/types.d.ts +32 -0
- package/dist/anycli/types.d.ts.map +1 -0
- package/dist/anycli/types.js +9 -0
- package/dist/api/breakpoints.d.ts +93 -0
- package/dist/api/breakpoints.d.ts.map +1 -0
- package/dist/api/breakpoints.js +334 -0
- package/dist/api/effects.d.ts +14 -0
- package/dist/api/effects.d.ts.map +1 -0
- package/dist/api/effects.js +306 -0
- package/dist/api/effectsTypes.d.ts +79 -0
- package/dist/api/effectsTypes.d.ts.map +1 -0
- package/dist/api/effectsTypes.js +6 -0
- package/dist/api/eventStream.d.ts +34 -0
- package/dist/api/eventStream.d.ts.map +1 -0
- package/dist/api/eventStream.js +126 -0
- package/dist/api/index.d.ts +10 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +27 -0
- package/dist/api/runs.d.ts +85 -0
- package/dist/api/runs.d.ts.map +1 -0
- package/dist/api/runs.js +247 -0
- package/dist/api/utils.d.ts +28 -0
- package/dist/api/utils.d.ts.map +1 -0
- package/dist/api/utils.js +74 -0
- package/dist/breakpoints/approvalChains.d.ts +68 -0
- package/dist/breakpoints/approvalChains.d.ts.map +1 -0
- package/dist/breakpoints/approvalChains.js +111 -0
- package/dist/breakpoints/delegation.d.ts +42 -0
- package/dist/breakpoints/delegation.d.ts.map +1 -0
- package/dist/breakpoints/delegation.js +199 -0
- package/dist/breakpoints/delegationTypes.d.ts +46 -0
- package/dist/breakpoints/delegationTypes.d.ts.map +1 -0
- package/dist/breakpoints/delegationTypes.js +10 -0
- package/dist/breakpoints/postures.d.ts +28 -0
- package/dist/breakpoints/postures.d.ts.map +1 -0
- package/dist/breakpoints/postures.js +100 -0
- package/dist/cli/amuxEventsFormatter.d.ts +26 -0
- package/dist/cli/amuxEventsFormatter.d.ts.map +1 -0
- package/dist/cli/amuxEventsFormatter.js +86 -0
- package/dist/cli/args/argFlags.d.ts +6 -0
- package/dist/cli/args/argFlags.d.ts.map +1 -0
- package/dist/cli/args/argFlags.js +72 -0
- package/dist/cli/args/argPositionals.d.ts +3 -0
- package/dist/cli/args/argPositionals.d.ts.map +1 -0
- package/dist/cli/args/argPositionals.js +18 -0
- package/dist/cli/args/index.d.ts +4 -0
- package/dist/cli/args/index.d.ts.map +1 -0
- package/dist/cli/args/index.js +75 -0
- package/dist/cli/args/types.d.ts +13 -0
- package/dist/cli/args/types.d.ts.map +1 -0
- package/dist/cli/args/types.js +2 -0
- package/dist/cli/commands/daemon.d.ts +31 -0
- package/dist/cli/commands/daemon.d.ts.map +1 -0
- package/dist/cli/commands/daemon.js +156 -0
- package/dist/cli/commands/harness/createRun.d.ts +3 -0
- package/dist/cli/commands/harness/createRun.d.ts.map +1 -0
- package/dist/cli/commands/harness/createRun.js +8 -0
- package/dist/cli/commands/harness/resumeRun.d.ts +20 -0
- package/dist/cli/commands/harness/resumeRun.d.ts.map +1 -0
- package/dist/cli/commands/harness/resumeRun.js +341 -0
- package/dist/cli/commands/jsonlInteractive.d.ts +35 -0
- package/dist/cli/commands/jsonlInteractive.d.ts.map +1 -0
- package/dist/cli/commands/jsonlInteractive.js +302 -0
- package/dist/cli/commands/mcpServe.d.ts +18 -0
- package/dist/cli/commands/mcpServe.d.ts.map +1 -0
- package/dist/cli/commands/mcpServe.js +59 -0
- package/dist/cli/commands/session/history.d.ts +14 -0
- package/dist/cli/commands/session/history.d.ts.map +1 -0
- package/dist/cli/commands/session/history.js +100 -0
- package/dist/cli/commands/tui.d.ts +23 -0
- package/dist/cli/commands/tui.d.ts.map +1 -0
- package/dist/cli/commands/tui.js +183 -0
- package/dist/cli/dispatch.d.ts +4 -0
- package/dist/cli/dispatch.d.ts.map +1 -0
- package/dist/cli/dispatch.js +332 -0
- package/dist/cli/main.d.ts +7 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +41 -0
- package/dist/cli/program.d.ts +7 -0
- package/dist/cli/program.d.ts.map +1 -0
- package/dist/cli/program.js +8 -0
- package/dist/cli/ui.d.ts +9 -0
- package/dist/cli/ui.d.ts.map +1 -0
- package/dist/cli/ui.js +125 -0
- package/dist/compression/compaction.d.ts +82 -0
- package/dist/compression/compaction.d.ts.map +1 -0
- package/dist/compression/compaction.js +310 -0
- package/dist/cost/claudeCodeParser.d.ts +81 -0
- package/dist/cost/claudeCodeParser.d.ts.map +1 -0
- package/dist/cost/claudeCodeParser.js +232 -0
- package/dist/cost/collector.d.ts +42 -0
- package/dist/cost/collector.d.ts.map +1 -0
- package/dist/cost/collector.js +105 -0
- package/dist/cost/effectCost.d.ts +23 -0
- package/dist/cost/effectCost.d.ts.map +1 -0
- package/dist/cost/effectCost.js +26 -0
- package/dist/cost/index.d.ts +7 -0
- package/dist/cost/index.d.ts.map +1 -0
- package/dist/cost/index.js +28 -0
- package/dist/cost/journal.d.ts +40 -0
- package/dist/cost/journal.d.ts.map +1 -0
- package/dist/cost/journal.js +137 -0
- package/dist/cost/types.d.ts +164 -0
- package/dist/cost/types.d.ts.map +1 -0
- package/dist/cost/types.js +228 -0
- package/dist/daemon/automationExecutor.d.ts +16 -0
- package/dist/daemon/automationExecutor.d.ts.map +1 -0
- package/dist/daemon/automationExecutor.js +222 -0
- package/dist/daemon/config.d.ts +8 -0
- package/dist/daemon/config.d.ts.map +1 -0
- package/dist/daemon/config.js +209 -0
- package/dist/daemon/daemonLog.d.ts +13 -0
- package/dist/daemon/daemonLog.d.ts.map +1 -0
- package/dist/daemon/daemonLog.js +64 -0
- package/dist/daemon/fileWatcher.d.ts +9 -0
- package/dist/daemon/fileWatcher.d.ts.map +1 -0
- package/dist/daemon/fileWatcher.js +141 -0
- package/dist/daemon/index.d.ts +7 -0
- package/dist/daemon/index.d.ts.map +1 -0
- package/dist/daemon/index.js +21 -0
- package/dist/daemon/lifecycle.d.ts +12 -0
- package/dist/daemon/lifecycle.d.ts.map +1 -0
- package/dist/daemon/lifecycle.js +257 -0
- package/dist/daemon/loop.d.ts +21 -0
- package/dist/daemon/loop.d.ts.map +1 -0
- package/dist/daemon/loop.js +196 -0
- package/dist/daemon/timerScheduler.d.ts +13 -0
- package/dist/daemon/timerScheduler.d.ts.map +1 -0
- package/dist/daemon/timerScheduler.js +122 -0
- package/dist/daemon/types.d.ts +93 -0
- package/dist/daemon/types.d.ts.map +1 -0
- package/dist/daemon/types.js +25 -0
- package/dist/daemon/webhookListener.d.ts +6 -0
- package/dist/daemon/webhookListener.d.ts.map +1 -0
- package/dist/daemon/webhookListener.js +110 -0
- package/dist/governance/authority.d.ts +68 -0
- package/dist/governance/authority.d.ts.map +1 -0
- package/dist/governance/authority.js +136 -0
- package/dist/governance/bridge.d.ts +17 -0
- package/dist/governance/bridge.d.ts.map +1 -0
- package/dist/governance/bridge.js +46 -0
- package/dist/governance/builtins.d.ts +25 -0
- package/dist/governance/builtins.d.ts.map +1 -0
- package/dist/governance/builtins.js +67 -0
- package/dist/governance/categories.d.ts +58 -0
- package/dist/governance/categories.d.ts.map +1 -0
- package/dist/governance/categories.js +120 -0
- package/dist/governance/decisionTrail.d.ts +60 -0
- package/dist/governance/decisionTrail.d.ts.map +1 -0
- package/dist/governance/decisionTrail.js +68 -0
- package/dist/governance/engine.d.ts +20 -0
- package/dist/governance/engine.d.ts.map +1 -0
- package/dist/governance/engine.js +124 -0
- package/dist/governance/index.d.ts +20 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +75 -0
- package/dist/governance/logging.d.ts +18 -0
- package/dist/governance/logging.d.ts.map +1 -0
- package/dist/governance/logging.js +83 -0
- package/dist/governance/mandate.d.ts +83 -0
- package/dist/governance/mandate.d.ts.map +1 -0
- package/dist/governance/mandate.js +180 -0
- package/dist/governance/permissionEvents.d.ts +51 -0
- package/dist/governance/permissionEvents.d.ts.map +1 -0
- package/dist/governance/permissionEvents.js +52 -0
- package/dist/governance/permissionPropagation.d.ts +18 -0
- package/dist/governance/permissionPropagation.d.ts.map +1 -0
- package/dist/governance/permissionPropagation.js +58 -0
- package/dist/governance/postureBridge.d.ts +17 -0
- package/dist/governance/postureBridge.d.ts.map +1 -0
- package/dist/governance/postureBridge.js +117 -0
- package/dist/governance/sandboxBridge.d.ts +49 -0
- package/dist/governance/sandboxBridge.d.ts.map +1 -0
- package/dist/governance/sandboxBridge.js +77 -0
- package/dist/governance/sandboxPolicy.d.ts +51 -0
- package/dist/governance/sandboxPolicy.d.ts.map +1 -0
- package/dist/governance/sandboxPolicy.js +177 -0
- package/dist/governance/types.d.ts +3 -0
- package/dist/governance/types.d.ts.map +1 -0
- package/dist/governance/types.js +5 -0
- package/dist/harness/amux/amuxBridge.d.ts +71 -0
- package/dist/harness/amux/amuxBridge.d.ts.map +1 -0
- package/dist/harness/amux/amuxBridge.js +117 -0
- package/dist/harness/amux/amuxClientFactory.d.ts +29 -0
- package/dist/harness/amux/amuxClientFactory.d.ts.map +1 -0
- package/dist/harness/amux/amuxClientFactory.js +90 -0
- package/dist/harness/amux/amuxEventEmitter.d.ts +51 -0
- package/dist/harness/amux/amuxEventEmitter.d.ts.map +1 -0
- package/dist/harness/amux/amuxEventEmitter.js +143 -0
- package/dist/harness/amux/amuxEventMapper.d.ts +58 -0
- package/dist/harness/amux/amuxEventMapper.d.ts.map +1 -0
- package/dist/harness/amux/amuxEventMapper.js +92 -0
- package/dist/harness/amux/amuxHarnessMap.d.ts +25 -0
- package/dist/harness/amux/amuxHarnessMap.d.ts.map +1 -0
- package/dist/harness/amux/amuxHarnessMap.js +55 -0
- package/dist/harness/amux/amuxStdinReader.d.ts +45 -0
- package/dist/harness/amux/amuxStdinReader.d.ts.map +1 -0
- package/dist/harness/amux/amuxStdinReader.js +106 -0
- package/dist/harness/amux/amuxTypes.d.ts +122 -0
- package/dist/harness/amux/amuxTypes.d.ts.map +1 -0
- package/dist/harness/amux/amuxTypes.js +11 -0
- package/dist/harness/amux/index.d.ts +17 -0
- package/dist/harness/amux/index.d.ts.map +1 -0
- package/dist/harness/amux/index.js +34 -0
- package/dist/harness/backgroundTracker.d.ts +64 -0
- package/dist/harness/backgroundTracker.d.ts.map +1 -0
- package/dist/harness/backgroundTracker.js +107 -0
- package/dist/harness/builtInHarness.d.ts +3 -0
- package/dist/harness/builtInHarness.d.ts.map +1 -0
- package/dist/harness/builtInHarness.js +18 -0
- package/dist/harness/capabilityRouter.d.ts +76 -0
- package/dist/harness/capabilityRouter.d.ts.map +1 -0
- package/dist/harness/capabilityRouter.js +176 -0
- package/dist/harness/fallbackChains.d.ts +42 -0
- package/dist/harness/fallbackChains.d.ts.map +1 -0
- package/dist/harness/fallbackChains.js +69 -0
- package/dist/harness/hostContract.d.ts +63 -0
- package/dist/harness/hostContract.d.ts.map +1 -0
- package/dist/harness/hostContract.js +136 -0
- package/dist/harness/index.d.ts +10 -0
- package/dist/harness/index.d.ts.map +1 -0
- package/dist/harness/index.js +66 -0
- package/dist/harness/internal/createRun/askUserQuestion.d.ts +11 -0
- package/dist/harness/internal/createRun/askUserQuestion.d.ts.map +1 -0
- package/dist/harness/internal/createRun/askUserQuestion.js +162 -0
- package/dist/harness/internal/createRun/index.d.ts +25 -0
- package/dist/harness/internal/createRun/index.d.ts.map +1 -0
- package/dist/harness/internal/createRun/index.js +137 -0
- package/dist/harness/internal/createRun/orchestration/constants.d.ts +7 -0
- package/dist/harness/internal/createRun/orchestration/constants.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/constants.js +13 -0
- package/dist/harness/internal/createRun/orchestration/effects.d.ts +43 -0
- package/dist/harness/internal/createRun/orchestration/effects.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/effects.js +490 -0
- package/dist/harness/internal/createRun/orchestration/effectsHelpers.d.ts +20 -0
- package/dist/harness/internal/createRun/orchestration/effectsHelpers.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/effectsHelpers.js +79 -0
- package/dist/harness/internal/createRun/orchestration/externalPhase.d.ts +3 -0
- package/dist/harness/internal/createRun/orchestration/externalPhase.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/externalPhase.js +319 -0
- package/dist/harness/internal/createRun/orchestration/externalPhaseHelpers.d.ts +16 -0
- package/dist/harness/internal/createRun/orchestration/externalPhaseHelpers.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/externalPhaseHelpers.js +104 -0
- package/dist/harness/internal/createRun/orchestration/index.d.ts +14 -0
- package/dist/harness/internal/createRun/orchestration/index.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/index.js +36 -0
- package/dist/harness/internal/createRun/orchestration/internalPhase.d.ts +3 -0
- package/dist/harness/internal/createRun/orchestration/internalPhase.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/internalPhase.js +464 -0
- package/dist/harness/internal/createRun/orchestration/internalTools.d.ts +26 -0
- package/dist/harness/internal/createRun/orchestration/internalTools.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/internalTools.js +262 -0
- package/dist/harness/internal/createRun/orchestration/internalToolsHelpers.d.ts +17 -0
- package/dist/harness/internal/createRun/orchestration/internalToolsHelpers.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/internalToolsHelpers.js +23 -0
- package/dist/harness/internal/createRun/orchestration/taskResult.d.ts +10 -0
- package/dist/harness/internal/createRun/orchestration/taskResult.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/taskResult.js +67 -0
- package/dist/harness/internal/createRun/orchestration/types.d.ts +46 -0
- package/dist/harness/internal/createRun/orchestration/types.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/types.js +2 -0
- package/dist/harness/internal/createRun/orchestration/verbose.d.ts +7 -0
- package/dist/harness/internal/createRun/orchestration/verbose.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/verbose.js +240 -0
- package/dist/harness/internal/createRun/output.d.ts +38 -0
- package/dist/harness/internal/createRun/output.d.ts.map +1 -0
- package/dist/harness/internal/createRun/output.js +415 -0
- package/dist/harness/internal/createRun/pi.d.ts +34 -0
- package/dist/harness/internal/createRun/pi.d.ts.map +1 -0
- package/dist/harness/internal/createRun/pi.js +216 -0
- package/dist/harness/internal/createRun/planProcess/agentOutput.d.ts +5 -0
- package/dist/harness/internal/createRun/planProcess/agentOutput.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/agentOutput.js +113 -0
- package/dist/harness/internal/createRun/planProcess/delegation.d.ts +23 -0
- package/dist/harness/internal/createRun/planProcess/delegation.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/delegation.js +176 -0
- package/dist/harness/internal/createRun/planProcess/external.d.ts +14 -0
- package/dist/harness/internal/createRun/planProcess/external.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/external.js +139 -0
- package/dist/harness/internal/createRun/planProcess/index.d.ts +12 -0
- package/dist/harness/internal/createRun/planProcess/index.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/index.js +24 -0
- package/dist/harness/internal/createRun/planProcess/paths.d.ts +7 -0
- package/dist/harness/internal/createRun/planProcess/paths.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/paths.js +98 -0
- package/dist/harness/internal/createRun/planProcess/phase.d.ts +6 -0
- package/dist/harness/internal/createRun/planProcess/phase.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/phase.js +361 -0
- package/dist/harness/internal/createRun/planProcess/phaseHelpers.d.ts +37 -0
- package/dist/harness/internal/createRun/planProcess/phaseHelpers.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/phaseHelpers.js +159 -0
- package/dist/harness/internal/createRun/planProcess/phaseTypes.d.ts +25 -0
- package/dist/harness/internal/createRun/planProcess/phaseTypes.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/phaseTypes.js +6 -0
- package/dist/harness/internal/createRun/planProcess/prompts.d.ts +20 -0
- package/dist/harness/internal/createRun/planProcess/prompts.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/prompts.js +208 -0
- package/dist/harness/internal/createRun/planProcess/recovery.d.ts +18 -0
- package/dist/harness/internal/createRun/planProcess/recovery.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/recovery.js +188 -0
- package/dist/harness/internal/createRun/planProcess/recovery.test.d.ts +2 -0
- package/dist/harness/internal/createRun/planProcess/recovery.test.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/recovery.test.js +68 -0
- package/dist/harness/internal/createRun/planProcess/runState.d.ts +40 -0
- package/dist/harness/internal/createRun/planProcess/runState.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/runState.js +179 -0
- package/dist/harness/internal/createRun/planProcess/understandIntent.d.ts +22 -0
- package/dist/harness/internal/createRun/planProcess/understandIntent.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/understandIntent.js +65 -0
- package/dist/harness/internal/createRun/planProcess/validation.d.ts +2 -0
- package/dist/harness/internal/createRun/planProcess/validation.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/validation.js +212 -0
- package/dist/harness/internal/createRun/planProcess/validationSource.d.ts +11 -0
- package/dist/harness/internal/createRun/planProcess/validationSource.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/validationSource.js +328 -0
- package/dist/harness/internal/createRun/planProcess/validationText.d.ts +3 -0
- package/dist/harness/internal/createRun/planProcess/validationText.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/validationText.js +145 -0
- package/dist/harness/internal/createRun/prompts.d.ts +49 -0
- package/dist/harness/internal/createRun/prompts.d.ts.map +1 -0
- package/dist/harness/internal/createRun/prompts.js +307 -0
- package/dist/harness/internal/createRun/resumeState.d.ts +28 -0
- package/dist/harness/internal/createRun/resumeState.d.ts.map +1 -0
- package/dist/harness/internal/createRun/resumeState.js +133 -0
- package/dist/harness/internal/createRun/utils.d.ts +182 -0
- package/dist/harness/internal/createRun/utils.d.ts.map +1 -0
- package/dist/harness/internal/createRun/utils.js +133 -0
- package/dist/harness/internal.d.ts +13 -0
- package/dist/harness/internal.d.ts.map +1 -0
- package/dist/harness/internal.js +149 -0
- package/dist/harness/invoker/launch.d.ts +20 -0
- package/dist/harness/invoker/launch.d.ts.map +1 -0
- package/dist/harness/invoker/launch.js +23 -0
- package/dist/harness/invoker/processControl.d.ts +11 -0
- package/dist/harness/invoker/processControl.d.ts.map +1 -0
- package/dist/harness/invoker/processControl.js +50 -0
- package/dist/harness/invoker.d.ts +43 -0
- package/dist/harness/invoker.d.ts.map +1 -0
- package/dist/harness/invoker.js +210 -0
- package/dist/harness/modeSelector.d.ts +50 -0
- package/dist/harness/modeSelector.d.ts.map +1 -0
- package/dist/harness/modeSelector.js +124 -0
- package/dist/harness/modelSelection.d.ts +37 -0
- package/dist/harness/modelSelection.d.ts.map +1 -0
- package/dist/harness/modelSelection.js +81 -0
- package/dist/harness/operatorCommands.d.ts +38 -0
- package/dist/harness/operatorCommands.d.ts.map +1 -0
- package/dist/harness/operatorCommands.js +118 -0
- package/dist/harness/piSecureSandbox.d.ts +8 -0
- package/dist/harness/piSecureSandbox.d.ts.map +1 -0
- package/dist/harness/piSecureSandbox.js +366 -0
- package/dist/harness/piSecureSandboxTypes.d.ts +51 -0
- package/dist/harness/piSecureSandboxTypes.d.ts.map +1 -0
- package/dist/harness/piSecureSandboxTypes.js +6 -0
- package/dist/harness/piWrapper/compaction.d.ts +13 -0
- package/dist/harness/piWrapper/compaction.d.ts.map +1 -0
- package/dist/harness/piWrapper/compaction.js +38 -0
- package/dist/harness/piWrapper/instructionPrompts.d.ts +2 -0
- package/dist/harness/piWrapper/instructionPrompts.d.ts.map +1 -0
- package/dist/harness/piWrapper/instructionPrompts.js +97 -0
- package/dist/harness/piWrapper/moduleSupport.d.ts +77 -0
- package/dist/harness/piWrapper/moduleSupport.d.ts.map +1 -0
- package/dist/harness/piWrapper/moduleSupport.js +204 -0
- package/dist/harness/piWrapper.d.ts +80 -0
- package/dist/harness/piWrapper.d.ts.map +1 -0
- package/dist/harness/piWrapper.js +389 -0
- package/dist/harness/piWrapper.test.d.ts +2 -0
- package/dist/harness/piWrapper.test.d.ts.map +1 -0
- package/dist/harness/piWrapper.test.js +193 -0
- package/dist/harness/planMode.d.ts +68 -0
- package/dist/harness/planMode.d.ts.map +1 -0
- package/dist/harness/planMode.js +145 -0
- package/dist/harness/selectionPolicies.d.ts +29 -0
- package/dist/harness/selectionPolicies.d.ts.map +1 -0
- package/dist/harness/selectionPolicies.js +165 -0
- package/dist/harness/types.d.ts +266 -0
- package/dist/harness/types.d.ts.map +1 -0
- package/dist/harness/types.js +34 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/interaction/askUserQuestion/core.d.ts +8 -0
- package/dist/interaction/askUserQuestion/core.d.ts.map +1 -0
- package/dist/interaction/askUserQuestion/core.js +112 -0
- package/dist/interaction/askUserQuestion/terminal.d.ts +15 -0
- package/dist/interaction/askUserQuestion/terminal.d.ts.map +1 -0
- package/dist/interaction/askUserQuestion/terminal.js +128 -0
- package/dist/interaction/askUserQuestion.d.ts +10 -0
- package/dist/interaction/askUserQuestion.d.ts.map +1 -0
- package/dist/interaction/askUserQuestion.js +295 -0
- package/dist/interaction/askUserQuestionTypes.d.ts +31 -0
- package/dist/interaction/askUserQuestionTypes.d.ts.map +1 -0
- package/dist/interaction/askUserQuestionTypes.js +6 -0
- package/dist/interaction/index.d.ts +4 -0
- package/dist/interaction/index.d.ts.map +1 -0
- package/dist/interaction/index.js +20 -0
- package/dist/interaction/interactionRouter.d.ts +25 -0
- package/dist/interaction/interactionRouter.d.ts.map +1 -0
- package/dist/interaction/interactionRouter.js +55 -0
- package/dist/mcp/channels/allowlist.d.ts +19 -0
- package/dist/mcp/channels/allowlist.d.ts.map +1 -0
- package/dist/mcp/channels/allowlist.js +140 -0
- package/dist/mcp/channels/channelManager.d.ts +64 -0
- package/dist/mcp/channels/channelManager.d.ts.map +1 -0
- package/dist/mcp/channels/channelManager.js +137 -0
- package/dist/mcp/channels/inboundQueue.d.ts +47 -0
- package/dist/mcp/channels/inboundQueue.d.ts.map +1 -0
- package/dist/mcp/channels/inboundQueue.js +96 -0
- package/dist/mcp/channels/index.d.ts +17 -0
- package/dist/mcp/channels/index.d.ts.map +1 -0
- package/dist/mcp/channels/index.js +39 -0
- package/dist/mcp/channels/outbound.d.ts +33 -0
- package/dist/mcp/channels/outbound.d.ts.map +1 -0
- package/dist/mcp/channels/outbound.js +94 -0
- package/dist/mcp/channels/permissionRelay.d.ts +62 -0
- package/dist/mcp/channels/permissionRelay.d.ts.map +1 -0
- package/dist/mcp/channels/permissionRelay.js +159 -0
- package/dist/mcp/channels/types.d.ts +135 -0
- package/dist/mcp/channels/types.d.ts.map +1 -0
- package/dist/mcp/channels/types.js +16 -0
- package/dist/mcp/client/config.d.ts +28 -0
- package/dist/mcp/client/config.d.ts.map +1 -0
- package/dist/mcp/client/config.js +142 -0
- package/dist/mcp/client/executor.d.ts +30 -0
- package/dist/mcp/client/executor.d.ts.map +1 -0
- package/dist/mcp/client/executor.js +60 -0
- package/dist/mcp/client/index.d.ts +12 -0
- package/dist/mcp/client/index.d.ts.map +1 -0
- package/dist/mcp/client/index.js +27 -0
- package/dist/mcp/client/manager.d.ts +74 -0
- package/dist/mcp/client/manager.d.ts.map +1 -0
- package/dist/mcp/client/manager.js +214 -0
- package/dist/mcp/client/toolRegistry.d.ts +50 -0
- package/dist/mcp/client/toolRegistry.d.ts.map +1 -0
- package/dist/mcp/client/toolRegistry.js +118 -0
- package/dist/mcp/client/types.d.ts +96 -0
- package/dist/mcp/client/types.d.ts.map +1 -0
- package/dist/mcp/client/types.js +15 -0
- package/dist/mcp/transport/index.d.ts +9 -0
- package/dist/mcp/transport/index.d.ts.map +1 -0
- package/dist/mcp/transport/index.js +13 -0
- package/dist/mcp/transport/session.d.ts +18 -0
- package/dist/mcp/transport/session.d.ts.map +1 -0
- package/dist/mcp/transport/session.js +78 -0
- package/dist/mcp/transport/types.d.ts +19 -0
- package/dist/mcp/transport/types.d.ts.map +1 -0
- package/dist/mcp/transport/types.js +7 -0
- package/dist/mcp/transport/websocket.d.ts +41 -0
- package/dist/mcp/transport/websocket.d.ts.map +1 -0
- package/dist/mcp/transport/websocket.js +271 -0
- package/dist/observability/health.d.ts +19 -0
- package/dist/observability/health.d.ts.map +1 -0
- package/dist/observability/health.js +129 -0
- package/dist/observability/index.d.ts +7 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +22 -0
- package/dist/observability/runStatus.d.ts +44 -0
- package/dist/observability/runStatus.d.ts.map +1 -0
- package/dist/observability/runStatus.js +169 -0
- package/dist/observability/timeline.d.ts +11 -0
- package/dist/observability/timeline.d.ts.map +1 -0
- package/dist/observability/timeline.js +176 -0
- package/dist/observability/types.d.ts +62 -0
- package/dist/observability/types.d.ts.map +1 -0
- package/dist/observability/types.js +8 -0
- package/dist/observability/webhooks.d.ts +68 -0
- package/dist/observability/webhooks.d.ts.map +1 -0
- package/dist/observability/webhooks.js +132 -0
- package/dist/prompts/commandTemplates.d.ts +3 -0
- package/dist/prompts/commandTemplates.d.ts.map +1 -0
- package/dist/prompts/commandTemplates.js +238 -0
- package/dist/runtime/index.d.ts +3 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +28 -0
- package/dist/seams/contract.d.ts +55 -0
- package/dist/seams/contract.d.ts.map +1 -0
- package/dist/seams/contract.js +120 -0
- package/dist/seams/contract.test.d.ts +2 -0
- package/dist/seams/contract.test.d.ts.map +1 -0
- package/dist/seams/contract.test.js +96 -0
- package/dist/seams/index.d.ts +3 -0
- package/dist/seams/index.d.ts.map +1 -0
- package/dist/seams/index.js +8 -0
- package/dist/session/context.d.ts +22 -0
- package/dist/session/context.d.ts.map +1 -0
- package/dist/session/context.js +113 -0
- package/dist/session/continuityState.d.ts +39 -0
- package/dist/session/continuityState.d.ts.map +1 -0
- package/dist/session/continuityState.js +164 -0
- package/dist/session/cost.d.ts +63 -0
- package/dist/session/cost.d.ts.map +1 -0
- package/dist/session/cost.js +194 -0
- package/dist/session/discovery.d.ts +22 -0
- package/dist/session/discovery.d.ts.map +1 -0
- package/dist/session/discovery.js +35 -0
- package/dist/session/history.d.ts +30 -0
- package/dist/session/history.d.ts.map +1 -0
- package/dist/session/history.js +143 -0
- package/dist/session/index.d.ts +7 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +70 -0
- package/dist/session/memoryExtraction.d.ts +65 -0
- package/dist/session/memoryExtraction.d.ts.map +1 -0
- package/dist/session/memoryExtraction.js +201 -0
- package/dist/session/parse.d.ts +45 -0
- package/dist/session/parse.d.ts.map +1 -0
- package/dist/session/parse.js +170 -0
- package/dist/session/persistence.d.ts +46 -0
- package/dist/session/persistence.d.ts.map +1 -0
- package/dist/session/persistence.js +180 -0
- package/dist/session/types.d.ts +267 -0
- package/dist/session/types.d.ts.map +1 -0
- package/dist/session/types.js +45 -0
- package/dist/session/write.d.ts +61 -0
- package/dist/session/write.d.ts.map +1 -0
- package/dist/session/write.js +213 -0
- package/dist/storage/atomic.d.ts +2 -0
- package/dist/storage/atomic.d.ts.map +1 -0
- package/dist/storage/atomic.js +54 -0
- package/dist/storage/clock.d.ts +2 -0
- package/dist/storage/clock.d.ts.map +1 -0
- package/dist/storage/clock.js +6 -0
- package/dist/storage/index.d.ts +7 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +9 -0
- package/dist/storage/journalWatcher.d.ts +24 -0
- package/dist/storage/journalWatcher.d.ts.map +1 -0
- package/dist/storage/journalWatcher.js +172 -0
- package/dist/storage/paths.d.ts +5 -0
- package/dist/storage/paths.d.ts.map +1 -0
- package/dist/storage/paths.js +26 -0
- package/dist/storage/snapshotState.d.ts +10 -0
- package/dist/storage/snapshotState.d.ts.map +1 -0
- package/dist/storage/snapshotState.js +15 -0
- package/dist/storage/storeTaskArtifacts.d.ts +6 -0
- package/dist/storage/storeTaskArtifacts.d.ts.map +1 -0
- package/dist/storage/storeTaskArtifacts.js +55 -0
- package/dist/storage/types.d.ts +21 -0
- package/dist/storage/types.d.ts.map +1 -0
- package/dist/storage/types.js +2 -0
- package/dist/tasks/crud.d.ts +33 -0
- package/dist/tasks/crud.d.ts.map +1 -0
- package/dist/tasks/crud.js +150 -0
- package/dist/tasks/index.d.ts +2 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/index.js +9 -0
- package/package.json +141 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Harness invoker module.
|
|
3
|
+
*
|
|
4
|
+
* External harnesses are routed through agent-mux exclusively.
|
|
5
|
+
* Only Pi and the "agent-core" programmatic harness use direct invocation
|
|
6
|
+
* (Pi via CLI subprocess, agent-core in-process).
|
|
7
|
+
*/
|
|
8
|
+
import type { HarnessInvokeOptions, HarnessInvokeResult } from "./types";
|
|
9
|
+
import { buildLaunchSpec, type HarnessCliSpec } from "./invoker/launch";
|
|
10
|
+
import { cancelRunningProcess } from "./invoker/processControl";
|
|
11
|
+
/**
|
|
12
|
+
* Mapping from harness identifier to CLI command and flag details.
|
|
13
|
+
*
|
|
14
|
+
* Only Pi retains a direct CLI mapping. All other (external) harnesses are
|
|
15
|
+
* routed through agent-mux adapters via {@link invokeViaAgentMux}.
|
|
16
|
+
*/
|
|
17
|
+
export declare const HARNESS_CLI_MAP: Readonly<Record<string, HarnessCliSpec>>;
|
|
18
|
+
export { buildLaunchSpec, cancelRunningProcess };
|
|
19
|
+
/**
|
|
20
|
+
* Builds CLI argument array for a given harness and invocation options.
|
|
21
|
+
*
|
|
22
|
+
* This is a pure function with no side-effects, suitable for unit testing the
|
|
23
|
+
* flag mapping logic in isolation. Only used for harnesses in
|
|
24
|
+
* {@link HARNESS_CLI_MAP} (currently Pi).
|
|
25
|
+
*
|
|
26
|
+
* @throws {BabysitterRuntimeError} if `name` is not a known harness.
|
|
27
|
+
*/
|
|
28
|
+
export declare function buildHarnessArgs(name: string, options: HarnessInvokeOptions): string[];
|
|
29
|
+
/**
|
|
30
|
+
* Invokes a harness CLI and returns the result.
|
|
31
|
+
*
|
|
32
|
+
* The function first attempts to route through agent-mux (if @agent-mux/core
|
|
33
|
+
* is installed and the harness has an amux adapter mapping). When agent-mux
|
|
34
|
+
* is unavailable, it falls back to direct child-process invocation.
|
|
35
|
+
*
|
|
36
|
+
* Pi / agent-core harnesses always use agent-core directly and are never
|
|
37
|
+
* routed through agent-mux.
|
|
38
|
+
*
|
|
39
|
+
* @throws {BabysitterRuntimeError} if the harness is unknown or the CLI is
|
|
40
|
+
* not installed.
|
|
41
|
+
*/
|
|
42
|
+
export declare function invokeHarness(name: string, options: HarnessInvokeOptions): Promise<HarnessInvokeResult>;
|
|
43
|
+
//# sourceMappingURL=invoker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoker.d.ts","sourceRoot":"","sources":["../../src/harness/invoker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEzE,OAAO,EACL,eAAe,EACf,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,oBAAoB,EAGrB,MAAM,0BAA0B,CAAC;AAUlC;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAE3D,CAAC;AAOX,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,CAAC;AAMjD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,GAC5B,MAAM,EAAE,CA+BV;AASD;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAkB9B"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Harness invoker module.
|
|
4
|
+
*
|
|
5
|
+
* External harnesses are routed through agent-mux exclusively.
|
|
6
|
+
* Only Pi and the "agent-core" programmatic harness use direct invocation
|
|
7
|
+
* (Pi via CLI subprocess, agent-core in-process).
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.cancelRunningProcess = exports.buildLaunchSpec = exports.HARNESS_CLI_MAP = void 0;
|
|
11
|
+
exports.buildHarnessArgs = buildHarnessArgs;
|
|
12
|
+
exports.invokeHarness = invokeHarness;
|
|
13
|
+
const node_child_process_1 = require("node:child_process");
|
|
14
|
+
const babysitter_sdk_1 = require("@a5c-ai/babysitter-sdk");
|
|
15
|
+
const agent_core_1 = require("@a5c-ai/agent-core");
|
|
16
|
+
const launch_1 = require("./invoker/launch");
|
|
17
|
+
Object.defineProperty(exports, "buildLaunchSpec", { enumerable: true, get: function () { return launch_1.buildLaunchSpec; } });
|
|
18
|
+
const processControl_1 = require("./invoker/processControl");
|
|
19
|
+
Object.defineProperty(exports, "cancelRunningProcess", { enumerable: true, get: function () { return processControl_1.cancelRunningProcess; } });
|
|
20
|
+
const amuxClientFactory_1 = require("./amux/amuxClientFactory");
|
|
21
|
+
const amuxHarnessMap_1 = require("./amux/amuxHarnessMap");
|
|
22
|
+
const amuxBridge_1 = require("./amux/amuxBridge");
|
|
23
|
+
const builtInHarness_1 = require("./builtInHarness");
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
// CLI mapping — Pi only (external harnesses use agent-mux adapters)
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
/**
|
|
28
|
+
* Mapping from harness identifier to CLI command and flag details.
|
|
29
|
+
*
|
|
30
|
+
* Only Pi retains a direct CLI mapping. All other (external) harnesses are
|
|
31
|
+
* routed through agent-mux adapters via {@link invokeViaAgentMux}.
|
|
32
|
+
*/
|
|
33
|
+
exports.HARNESS_CLI_MAP = {
|
|
34
|
+
pi: { cli: "pi", workspaceFlag: "--workspace", supportsModel: true, promptStyle: "flag" },
|
|
35
|
+
};
|
|
36
|
+
const PROGRAMMATIC_ONLY_HARNESSES = ["agent-core"];
|
|
37
|
+
const SUPPORTED_HARNESS_NAMES = [
|
|
38
|
+
...PROGRAMMATIC_ONLY_HARNESSES,
|
|
39
|
+
...Object.keys(exports.HARNESS_CLI_MAP),
|
|
40
|
+
];
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
// Arg builder (pure function) — Pi / direct-invoke path only
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
/**
|
|
45
|
+
* Builds CLI argument array for a given harness and invocation options.
|
|
46
|
+
*
|
|
47
|
+
* This is a pure function with no side-effects, suitable for unit testing the
|
|
48
|
+
* flag mapping logic in isolation. Only used for harnesses in
|
|
49
|
+
* {@link HARNESS_CLI_MAP} (currently Pi).
|
|
50
|
+
*
|
|
51
|
+
* @throws {BabysitterRuntimeError} if `name` is not a known harness.
|
|
52
|
+
*/
|
|
53
|
+
function buildHarnessArgs(name, options) {
|
|
54
|
+
const spec = exports.HARNESS_CLI_MAP[name];
|
|
55
|
+
if (!spec) {
|
|
56
|
+
throw new babysitter_sdk_1.BabysitterRuntimeError("UnknownHarnessError", `Unknown harness: "${name}". Supported harnesses: ${SUPPORTED_HARNESS_NAMES.join(", ")}`, {
|
|
57
|
+
category: babysitter_sdk_1.ErrorCategory.Validation,
|
|
58
|
+
suggestions: [`Did you mean one of: ${SUPPORTED_HARNESS_NAMES.join(", ")}?`],
|
|
59
|
+
nextSteps: ["Use a supported harness name"],
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const args = [...(spec.baseArgs ?? [])];
|
|
63
|
+
if ((spec.promptStyle ?? "flag") === "positional") {
|
|
64
|
+
args.push(options.prompt);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
args.push("--prompt", options.prompt);
|
|
68
|
+
}
|
|
69
|
+
if (options.model && spec.supportsModel) {
|
|
70
|
+
args.push("--model", options.model);
|
|
71
|
+
}
|
|
72
|
+
if (options.workspace && spec.workspaceFlag) {
|
|
73
|
+
args.push(spec.workspaceFlag, options.workspace);
|
|
74
|
+
}
|
|
75
|
+
return args;
|
|
76
|
+
}
|
|
77
|
+
// ---------------------------------------------------------------------------
|
|
78
|
+
// Invoker
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
/** Default timeout for harness invocations (15 minutes). */
|
|
81
|
+
const DEFAULT_TIMEOUT_MS = 900_000;
|
|
82
|
+
/**
|
|
83
|
+
* Invokes a harness CLI and returns the result.
|
|
84
|
+
*
|
|
85
|
+
* The function first attempts to route through agent-mux (if @agent-mux/core
|
|
86
|
+
* is installed and the harness has an amux adapter mapping). When agent-mux
|
|
87
|
+
* is unavailable, it falls back to direct child-process invocation.
|
|
88
|
+
*
|
|
89
|
+
* Pi / agent-core harnesses always use agent-core directly and are never
|
|
90
|
+
* routed through agent-mux.
|
|
91
|
+
*
|
|
92
|
+
* @throws {BabysitterRuntimeError} if the harness is unknown or the CLI is
|
|
93
|
+
* not installed.
|
|
94
|
+
*/
|
|
95
|
+
async function invokeHarness(name, options) {
|
|
96
|
+
const harnessName = (0, builtInHarness_1.normalizeBuiltInHarnessName)(name);
|
|
97
|
+
// Pi / agent-core always use agent-core directly
|
|
98
|
+
if (harnessName === "pi" || harnessName === "agent-core") {
|
|
99
|
+
return invokeHarnessDirect(harnessName, options);
|
|
100
|
+
}
|
|
101
|
+
// External harnesses go through agent-mux
|
|
102
|
+
if (!(0, amuxHarnessMap_1.hasAmuxAdapter)(harnessName)) {
|
|
103
|
+
throw new babysitter_sdk_1.BabysitterRuntimeError("UnknownHarnessError", `No agent-mux adapter for harness "${name}". External harnesses must have an agent-mux mapping.`, { category: babysitter_sdk_1.ErrorCategory.Configuration });
|
|
104
|
+
}
|
|
105
|
+
const amuxClient = await (0, amuxClientFactory_1.getAmuxClient)();
|
|
106
|
+
return (0, amuxBridge_1.invokeViaAgentMux)(amuxClient, harnessName, options);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Direct child-process invocation for Pi and agent-core harnesses.
|
|
110
|
+
*
|
|
111
|
+
* "agent-core" uses agent-core (in-process). Pi uses CLI subprocess via
|
|
112
|
+
* `child_process.execFile`. External harnesses should never reach this
|
|
113
|
+
* function -- they are routed through agent-mux in {@link invokeHarness}.
|
|
114
|
+
*
|
|
115
|
+
* @throws {BabysitterRuntimeError} if the harness is unknown or the CLI is
|
|
116
|
+
* not installed.
|
|
117
|
+
*/
|
|
118
|
+
async function invokeHarnessDirect(name, options) {
|
|
119
|
+
if (name === "agent-core") {
|
|
120
|
+
const session = (0, agent_core_1.createAgentCoreSession)({
|
|
121
|
+
workspace: options.workspace,
|
|
122
|
+
model: options.model,
|
|
123
|
+
timeout: options.timeout,
|
|
124
|
+
ephemeral: true,
|
|
125
|
+
});
|
|
126
|
+
try {
|
|
127
|
+
const result = await session.prompt(options.prompt, options.timeout);
|
|
128
|
+
return {
|
|
129
|
+
...result,
|
|
130
|
+
harness: "agent-core",
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
finally {
|
|
134
|
+
session.dispose();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
const spec = exports.HARNESS_CLI_MAP[name];
|
|
138
|
+
if (!spec) {
|
|
139
|
+
throw new babysitter_sdk_1.BabysitterRuntimeError("UnknownHarnessError", `Unknown harness: "${name}". Supported harnesses: ${SUPPORTED_HARNESS_NAMES.join(", ")}`, {
|
|
140
|
+
category: babysitter_sdk_1.ErrorCategory.Validation,
|
|
141
|
+
suggestions: [`Did you mean one of: ${SUPPORTED_HARNESS_NAMES.join(", ")}?`],
|
|
142
|
+
nextSteps: ["Use a supported harness name"],
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
// Verify CLI availability.
|
|
146
|
+
const cliCheck = await (0, babysitter_sdk_1.checkCliAvailable)(spec.cli);
|
|
147
|
+
if (!cliCheck.available) {
|
|
148
|
+
throw new babysitter_sdk_1.BabysitterRuntimeError("HarnessCliNotInstalledError", `Harness CLI "${spec.cli}" is not installed or not found on PATH`, {
|
|
149
|
+
category: babysitter_sdk_1.ErrorCategory.External,
|
|
150
|
+
nextSteps: [
|
|
151
|
+
`Install the "${spec.cli}" CLI and ensure it is on your PATH`,
|
|
152
|
+
`Verify installation by running: ${spec.cli} --version`,
|
|
153
|
+
],
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
const args = buildHarnessArgs(name, options);
|
|
157
|
+
const timeoutMs = options.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
158
|
+
const launch = (0, launch_1.buildLaunchSpec)(name, spec, cliCheck.path, args);
|
|
159
|
+
const startTime = Date.now();
|
|
160
|
+
return new Promise((resolve, reject) => {
|
|
161
|
+
const childEnv = options.env
|
|
162
|
+
? { ...process.env, ...options.env }
|
|
163
|
+
: process.env;
|
|
164
|
+
let trackedPid;
|
|
165
|
+
try {
|
|
166
|
+
const child = (0, node_child_process_1.execFile)(launch.command, launch.args, {
|
|
167
|
+
cwd: options.workspace,
|
|
168
|
+
timeout: timeoutMs,
|
|
169
|
+
windowsHide: true,
|
|
170
|
+
maxBuffer: 50 * 1024 * 1024, // 50 MiB
|
|
171
|
+
env: childEnv,
|
|
172
|
+
shell: launch.shell,
|
|
173
|
+
}, (error, stdout, stderr) => {
|
|
174
|
+
(0, processControl_1.untrackChild)(trackedPid);
|
|
175
|
+
const duration = Date.now() - startTime;
|
|
176
|
+
const stderrStr = String(stderr);
|
|
177
|
+
const output = stderrStr.length > 0
|
|
178
|
+
? `${String(stdout)}\n${stderrStr}`.trim()
|
|
179
|
+
: String(stdout).trim();
|
|
180
|
+
if (error) {
|
|
181
|
+
const execError = error;
|
|
182
|
+
const killed = execError.killed === true;
|
|
183
|
+
const exitCode = typeof execError.status === "number" ? execError.status : 1;
|
|
184
|
+
resolve({
|
|
185
|
+
success: false,
|
|
186
|
+
output: killed
|
|
187
|
+
? `Process timed out after ${timeoutMs}ms\n${output}`.trim()
|
|
188
|
+
: output,
|
|
189
|
+
exitCode,
|
|
190
|
+
duration,
|
|
191
|
+
harness: name,
|
|
192
|
+
});
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
resolve({
|
|
196
|
+
success: true,
|
|
197
|
+
output,
|
|
198
|
+
exitCode: 0,
|
|
199
|
+
duration,
|
|
200
|
+
harness: name,
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
trackedPid = child.pid;
|
|
204
|
+
(0, processControl_1.trackChild)(child);
|
|
205
|
+
}
|
|
206
|
+
catch (err) {
|
|
207
|
+
reject(new babysitter_sdk_1.BabysitterRuntimeError("HarnessSpawnError", `Failed to spawn ${spec.cli}: ${err instanceof Error ? err.message : String(err)}`, { category: babysitter_sdk_1.ErrorCategory.External }));
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GAP-UX-014: Operator Mode Selection
|
|
3
|
+
*
|
|
4
|
+
* In-session mode switching between orchestration modes without
|
|
5
|
+
* restarting the run. Affects prompt personality, breakpoint
|
|
6
|
+
* frequency, and parallelism configuration.
|
|
7
|
+
*/
|
|
8
|
+
/** Available orchestration modes. */
|
|
9
|
+
export type OrchestrationMode = "interactive" | "autonomous" | "plan" | "fast";
|
|
10
|
+
/** Mode configuration that affects runtime behavior. */
|
|
11
|
+
export interface ModeConfig {
|
|
12
|
+
/** Mode identifier. */
|
|
13
|
+
mode: OrchestrationMode;
|
|
14
|
+
/** Human-readable label. */
|
|
15
|
+
label: string;
|
|
16
|
+
/** Description of this mode's behavior. */
|
|
17
|
+
description: string;
|
|
18
|
+
/** Whether breakpoints require human approval. */
|
|
19
|
+
breakpointApproval: "always" | "auto" | "never";
|
|
20
|
+
/** Whether to show plan before execution. */
|
|
21
|
+
showPlan: boolean;
|
|
22
|
+
/** Whether to parallelize independent effects. */
|
|
23
|
+
parallelism: boolean;
|
|
24
|
+
/** Output verbosity level. */
|
|
25
|
+
verbosity: "minimal" | "normal" | "verbose";
|
|
26
|
+
}
|
|
27
|
+
/** Get the current active mode. */
|
|
28
|
+
export declare function getActiveMode(): OrchestrationMode;
|
|
29
|
+
/** Get the configuration for the active mode. */
|
|
30
|
+
export declare function getActiveModeConfig(): ModeConfig;
|
|
31
|
+
/** Switch to a different orchestration mode. Returns the new mode config. */
|
|
32
|
+
export declare function switchMode(mode: OrchestrationMode): ModeConfig;
|
|
33
|
+
/** Get the configuration for a specific mode. */
|
|
34
|
+
export declare function getModeConfig(mode: OrchestrationMode): ModeConfig;
|
|
35
|
+
/** Get all available modes. */
|
|
36
|
+
export declare function getAvailableModes(): ModeConfig[];
|
|
37
|
+
/** Reset mode to default (interactive). Exported for test isolation. */
|
|
38
|
+
export declare function resetMode(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Check if the current mode skips interactive breakpoint prompts.
|
|
41
|
+
* Returns true for "auto" (auto-approve based on rules) but NOT for "always" (always prompt).
|
|
42
|
+
*/
|
|
43
|
+
export declare function shouldAutoApprove(): boolean;
|
|
44
|
+
/** Check if the current mode wants to show plans before execution. */
|
|
45
|
+
export declare function shouldShowPlan(): boolean;
|
|
46
|
+
/** Check if parallel execution is enabled in the current mode. */
|
|
47
|
+
export declare function isParallelEnabled(): boolean;
|
|
48
|
+
/** Format mode information for display. */
|
|
49
|
+
export declare function formatModeInfo(mode?: OrchestrationMode): string;
|
|
50
|
+
//# sourceMappingURL=modeSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modeSelector.d.ts","sourceRoot":"","sources":["../../src/harness/modeSelector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,qCAAqC;AACrC,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAE/E,wDAAwD;AACxD,MAAM,WAAW,UAAU;IACzB,uBAAuB;IACvB,IAAI,EAAE,iBAAiB,CAAC;IACxB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,kBAAkB,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAChD,6CAA6C;IAC7C,QAAQ,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,WAAW,EAAE,OAAO,CAAC;IACrB,8BAA8B;IAC9B,SAAS,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;CAC7C;AA2DD,mCAAmC;AACnC,wBAAgB,aAAa,IAAI,iBAAiB,CAEjD;AAED,iDAAiD;AACjD,wBAAgB,mBAAmB,IAAI,UAAU,CAEhD;AAED,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,IAAI,EAAE,iBAAiB,GAAG,UAAU,CAG9D;AAED,iDAAiD;AACjD,wBAAgB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,UAAU,CAEjE;AAED,+BAA+B;AAC/B,wBAAgB,iBAAiB,IAAI,UAAU,EAAE,CAEhD;AAED,wEAAwE;AACxE,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED,sEAAsE;AACtE,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED,kEAAkE;AAClE,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED,2CAA2C;AAC3C,wBAAgB,cAAc,CAAC,IAAI,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAU/D"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* GAP-UX-014: Operator Mode Selection
|
|
4
|
+
*
|
|
5
|
+
* In-session mode switching between orchestration modes without
|
|
6
|
+
* restarting the run. Affects prompt personality, breakpoint
|
|
7
|
+
* frequency, and parallelism configuration.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getActiveMode = getActiveMode;
|
|
11
|
+
exports.getActiveModeConfig = getActiveModeConfig;
|
|
12
|
+
exports.switchMode = switchMode;
|
|
13
|
+
exports.getModeConfig = getModeConfig;
|
|
14
|
+
exports.getAvailableModes = getAvailableModes;
|
|
15
|
+
exports.resetMode = resetMode;
|
|
16
|
+
exports.shouldAutoApprove = shouldAutoApprove;
|
|
17
|
+
exports.shouldShowPlan = shouldShowPlan;
|
|
18
|
+
exports.isParallelEnabled = isParallelEnabled;
|
|
19
|
+
exports.formatModeInfo = formatModeInfo;
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
// Mode definitions
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
const MODE_CONFIGS = {
|
|
24
|
+
interactive: {
|
|
25
|
+
mode: "interactive",
|
|
26
|
+
label: "Interactive",
|
|
27
|
+
description: "Full human-in-the-loop. All breakpoints prompt for approval. Shows plan before execution.",
|
|
28
|
+
breakpointApproval: "always",
|
|
29
|
+
showPlan: true,
|
|
30
|
+
parallelism: false,
|
|
31
|
+
verbosity: "verbose",
|
|
32
|
+
},
|
|
33
|
+
autonomous: {
|
|
34
|
+
mode: "autonomous",
|
|
35
|
+
label: "Autonomous",
|
|
36
|
+
description: "Minimal human intervention. Auto-approves most breakpoints. Maximum parallelism.",
|
|
37
|
+
breakpointApproval: "auto",
|
|
38
|
+
showPlan: false,
|
|
39
|
+
parallelism: true,
|
|
40
|
+
verbosity: "minimal",
|
|
41
|
+
},
|
|
42
|
+
plan: {
|
|
43
|
+
mode: "plan",
|
|
44
|
+
label: "Plan Only",
|
|
45
|
+
description: "Generates and presents a plan, then stops. No execution until explicitly approved.",
|
|
46
|
+
breakpointApproval: "always",
|
|
47
|
+
showPlan: true,
|
|
48
|
+
parallelism: false,
|
|
49
|
+
verbosity: "normal",
|
|
50
|
+
},
|
|
51
|
+
fast: {
|
|
52
|
+
mode: "fast",
|
|
53
|
+
label: "Fast",
|
|
54
|
+
description: "Prioritizes speed. Auto-approves safe breakpoints. Parallel execution. Minimal output.",
|
|
55
|
+
breakpointApproval: "auto",
|
|
56
|
+
showPlan: false,
|
|
57
|
+
parallelism: true,
|
|
58
|
+
verbosity: "minimal",
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
62
|
+
// Mode state
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
/**
|
|
65
|
+
* Active mode state — module-level mutable singleton for in-session switching.
|
|
66
|
+
*
|
|
67
|
+
* This is intentionally module-scoped rather than instance-based because the
|
|
68
|
+
* babysitter CLI runs as a single-session process. Not safe for concurrent
|
|
69
|
+
* multi-session use within a single process. Use {@link resetMode} for test
|
|
70
|
+
* isolation between test cases.
|
|
71
|
+
*/
|
|
72
|
+
let _activeMode = "interactive";
|
|
73
|
+
/** Get the current active mode. */
|
|
74
|
+
function getActiveMode() {
|
|
75
|
+
return _activeMode;
|
|
76
|
+
}
|
|
77
|
+
/** Get the configuration for the active mode. */
|
|
78
|
+
function getActiveModeConfig() {
|
|
79
|
+
return MODE_CONFIGS[_activeMode];
|
|
80
|
+
}
|
|
81
|
+
/** Switch to a different orchestration mode. Returns the new mode config. */
|
|
82
|
+
function switchMode(mode) {
|
|
83
|
+
_activeMode = mode;
|
|
84
|
+
return MODE_CONFIGS[mode];
|
|
85
|
+
}
|
|
86
|
+
/** Get the configuration for a specific mode. */
|
|
87
|
+
function getModeConfig(mode) {
|
|
88
|
+
return MODE_CONFIGS[mode];
|
|
89
|
+
}
|
|
90
|
+
/** Get all available modes. */
|
|
91
|
+
function getAvailableModes() {
|
|
92
|
+
return Object.values(MODE_CONFIGS);
|
|
93
|
+
}
|
|
94
|
+
/** Reset mode to default (interactive). Exported for test isolation. */
|
|
95
|
+
function resetMode() {
|
|
96
|
+
_activeMode = "interactive";
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Check if the current mode skips interactive breakpoint prompts.
|
|
100
|
+
* Returns true for "auto" (auto-approve based on rules) but NOT for "always" (always prompt).
|
|
101
|
+
*/
|
|
102
|
+
function shouldAutoApprove() {
|
|
103
|
+
return MODE_CONFIGS[_activeMode].breakpointApproval === "auto";
|
|
104
|
+
}
|
|
105
|
+
/** Check if the current mode wants to show plans before execution. */
|
|
106
|
+
function shouldShowPlan() {
|
|
107
|
+
return MODE_CONFIGS[_activeMode].showPlan;
|
|
108
|
+
}
|
|
109
|
+
/** Check if parallel execution is enabled in the current mode. */
|
|
110
|
+
function isParallelEnabled() {
|
|
111
|
+
return MODE_CONFIGS[_activeMode].parallelism;
|
|
112
|
+
}
|
|
113
|
+
/** Format mode information for display. */
|
|
114
|
+
function formatModeInfo(mode) {
|
|
115
|
+
const config = mode ? MODE_CONFIGS[mode] : MODE_CONFIGS[_activeMode];
|
|
116
|
+
return [
|
|
117
|
+
`Mode: ${config.label} (${config.mode})`,
|
|
118
|
+
config.description,
|
|
119
|
+
` Breakpoints: ${config.breakpointApproval}`,
|
|
120
|
+
` Plan: ${config.showPlan ? "shown" : "hidden"}`,
|
|
121
|
+
` Parallelism: ${config.parallelism ? "enabled" : "disabled"}`,
|
|
122
|
+
` Verbosity: ${config.verbosity}`,
|
|
123
|
+
].join("\n");
|
|
124
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GAP-HADAPT-002: Model Selection Per Task.
|
|
3
|
+
*
|
|
4
|
+
* Bridges task-level model preferences with harness capability routing.
|
|
5
|
+
* Uses selectHarness from capabilityRouter to find the best harness
|
|
6
|
+
* for a task's model requirement.
|
|
7
|
+
*/
|
|
8
|
+
import { type HarnessCandidate } from "./capabilityRouter";
|
|
9
|
+
/** Minimal task definition shape for model selection. */
|
|
10
|
+
export interface TaskDefInput {
|
|
11
|
+
kind?: string;
|
|
12
|
+
execution?: {
|
|
13
|
+
harness?: string;
|
|
14
|
+
model?: string;
|
|
15
|
+
permissions?: string[];
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
};
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
export interface ModelSelectionResult {
|
|
21
|
+
/** Name of the selected harness, or null if none available. */
|
|
22
|
+
selectedHarness: string | null;
|
|
23
|
+
/** Model that will be used (from task preference or harness default). */
|
|
24
|
+
selectedModel: string | undefined;
|
|
25
|
+
/** Whether a fallback harness was selected (model not matched exactly). */
|
|
26
|
+
fallback: boolean;
|
|
27
|
+
/** Human-readable reason for the selection. */
|
|
28
|
+
reason: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Resolve which harness and model to use for a given task definition.
|
|
32
|
+
*
|
|
33
|
+
* Delegates to selectHarness for scoring, then interprets the result
|
|
34
|
+
* to determine if the model was matched or a fallback was used.
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolveModelForTask(taskDef: TaskDefInput, candidates: HarnessCandidate[]): ModelSelectionResult;
|
|
37
|
+
//# sourceMappingURL=modelSelection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modelSelection.d.ts","sourceRoot":"","sources":["../../src/harness/modelSelection.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAM5B,yDAAyD;AACzD,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE;QACV,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,+DAA+D;IAC/D,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,yEAAyE;IACzE,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,2EAA2E;IAC3E,QAAQ,EAAE,OAAO,CAAC;IAClB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;CAChB;AAMD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,gBAAgB,EAAE,GAC7B,oBAAoB,CAwDtB"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* GAP-HADAPT-002: Model Selection Per Task.
|
|
4
|
+
*
|
|
5
|
+
* Bridges task-level model preferences with harness capability routing.
|
|
6
|
+
* Uses selectHarness from capabilityRouter to find the best harness
|
|
7
|
+
* for a task's model requirement.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.resolveModelForTask = resolveModelForTask;
|
|
11
|
+
const capabilityRouter_1 = require("./capabilityRouter");
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// Core
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
/**
|
|
16
|
+
* Resolve which harness and model to use for a given task definition.
|
|
17
|
+
*
|
|
18
|
+
* Delegates to selectHarness for scoring, then interprets the result
|
|
19
|
+
* to determine if the model was matched or a fallback was used.
|
|
20
|
+
*/
|
|
21
|
+
function resolveModelForTask(taskDef, candidates) {
|
|
22
|
+
if (candidates.length === 0) {
|
|
23
|
+
return {
|
|
24
|
+
selectedHarness: null,
|
|
25
|
+
selectedModel: undefined,
|
|
26
|
+
fallback: false,
|
|
27
|
+
reason: "No harness candidates available",
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const requirements = (0, capabilityRouter_1.buildTaskRequirements)(taskDef);
|
|
31
|
+
const routingResult = (0, capabilityRouter_1.selectHarness)(requirements, candidates);
|
|
32
|
+
if (!routingResult) {
|
|
33
|
+
return {
|
|
34
|
+
selectedHarness: null,
|
|
35
|
+
selectedModel: undefined,
|
|
36
|
+
fallback: false,
|
|
37
|
+
reason: "No harness met minimum score threshold",
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const preferredModel = requirements.preferredModel;
|
|
41
|
+
const selectedCandidate = routingResult.selected;
|
|
42
|
+
// Check if the selected harness actually has the preferred model
|
|
43
|
+
const hasExactModel = preferredModel
|
|
44
|
+
? selectedCandidate?.supportedModels?.includes(preferredModel) ?? false
|
|
45
|
+
: false;
|
|
46
|
+
const hasFamilyMatch = preferredModel && !hasExactModel
|
|
47
|
+
? selectedCandidate?.supportedModels?.some((m) => modelFamilyMatch(m, preferredModel)) ?? false
|
|
48
|
+
: false;
|
|
49
|
+
const modelMatched = hasExactModel || hasFamilyMatch;
|
|
50
|
+
const isFallback = typeof preferredModel === "string" && !modelMatched;
|
|
51
|
+
let reason;
|
|
52
|
+
if (!preferredModel) {
|
|
53
|
+
reason = `Selected ${routingResult.selected.name} (no model preference)`;
|
|
54
|
+
}
|
|
55
|
+
else if (hasExactModel) {
|
|
56
|
+
reason = `Selected ${routingResult.selected.name} — exact model match for ${preferredModel}`;
|
|
57
|
+
}
|
|
58
|
+
else if (hasFamilyMatch) {
|
|
59
|
+
reason = `Selected ${routingResult.selected.name} — model family match for ${preferredModel}`;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
reason = `Selected ${routingResult.selected.name} as fallback — preferred model ${preferredModel} not available`;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
selectedHarness: routingResult.selected.name,
|
|
66
|
+
selectedModel: preferredModel,
|
|
67
|
+
fallback: isFallback,
|
|
68
|
+
reason,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
72
|
+
// Helpers
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
/**
|
|
75
|
+
* Check if two model names share the same family (e.g., "claude-sonnet-4" and "claude-sonnet-4-latest").
|
|
76
|
+
*/
|
|
77
|
+
function modelFamilyMatch(available, preferred) {
|
|
78
|
+
const familyA = available.split("-").slice(0, -1).join("-");
|
|
79
|
+
const familyB = preferred.split("-").slice(0, -1).join("-");
|
|
80
|
+
return familyA.length > 0 && familyA === familyB;
|
|
81
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GAP-USER-001: Operator Command Layer
|
|
3
|
+
*
|
|
4
|
+
* Surfaces key babysitter CLI commands as in-session actions during
|
|
5
|
+
* breakpoint interactions. Enables operators to inspect and manage
|
|
6
|
+
* orchestration without leaving the flow.
|
|
7
|
+
*/
|
|
8
|
+
export interface OperatorCommand {
|
|
9
|
+
/** Short command name for selection. */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Human-readable label. */
|
|
12
|
+
label: string;
|
|
13
|
+
/** Brief description shown during breakpoint interaction. */
|
|
14
|
+
description: string;
|
|
15
|
+
/** The CLI command template. Placeholders: {{runDir}}, {{runId}}, {{effectId}}. */
|
|
16
|
+
commandTemplate: string;
|
|
17
|
+
/** Category for grouping in UI. */
|
|
18
|
+
category: OperatorCommandCategory;
|
|
19
|
+
}
|
|
20
|
+
export type OperatorCommandCategory = "inspect" | "manage" | "debug" | "tokens";
|
|
21
|
+
export declare const OPERATOR_COMMANDS: OperatorCommand[];
|
|
22
|
+
/** Render operator command template with run context. */
|
|
23
|
+
export declare function renderOperatorCommand(template: string, context: {
|
|
24
|
+
runDir?: string;
|
|
25
|
+
runId?: string;
|
|
26
|
+
effectId?: string;
|
|
27
|
+
}): string;
|
|
28
|
+
/** Get operator commands filtered by category. */
|
|
29
|
+
export declare function getCommandsByCategory(category: OperatorCommandCategory): OperatorCommand[];
|
|
30
|
+
/** Get all categories with their commands. */
|
|
31
|
+
export declare function getGroupedCommands(): Record<OperatorCommandCategory, OperatorCommand[]>;
|
|
32
|
+
/** Format commands for display in a breakpoint prompt. */
|
|
33
|
+
export declare function formatCommandsForPrompt(context: {
|
|
34
|
+
runDir?: string;
|
|
35
|
+
runId?: string;
|
|
36
|
+
effectId?: string;
|
|
37
|
+
}): string;
|
|
38
|
+
//# sourceMappingURL=operatorCommands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operatorCommands.d.ts","sourceRoot":"","sources":["../../src/harness/operatorCommands.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,WAAW,eAAe;IAC9B,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB,mFAAmF;IACnF,eAAe,EAAE,MAAM,CAAC;IACxB,mCAAmC;IACnC,QAAQ,EAAE,uBAAuB,CAAC;CACnC;AAED,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAMhF,eAAO,MAAM,iBAAiB,EAAE,eAAe,EAyD9C,CAAC;AAMF,yDAAyD;AACzD,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9D,MAAM,CAKR;AAED,kDAAkD;AAClD,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,uBAAuB,GAAG,eAAe,EAAE,CAE1F;AAED,8CAA8C;AAC9C,wBAAgB,kBAAkB,IAAI,MAAM,CAAC,uBAAuB,EAAE,eAAe,EAAE,CAAC,CAWvF;AAED,0DAA0D;AAC1D,wBAAgB,uBAAuB,CACrC,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9D,MAAM,CAeR"}
|