@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,307 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildProcessDefinitionSystemPrompt = buildProcessDefinitionSystemPrompt;
|
|
4
|
+
exports.buildProcessDefinitionUserPrompt = buildProcessDefinitionUserPrompt;
|
|
5
|
+
exports.buildOrchestrationSystemPrompt = buildOrchestrationSystemPrompt;
|
|
6
|
+
exports.buildOrchestrationBootstrapPrompt = buildOrchestrationBootstrapPrompt;
|
|
7
|
+
exports.buildOrchestrationTurnPrompt = buildOrchestrationTurnPrompt;
|
|
8
|
+
const babysitter_sdk_1 = require("@a5c-ai/babysitter-sdk");
|
|
9
|
+
function formatHarnessCatalog(context) {
|
|
10
|
+
const lines = ["Discovered harnesses:"];
|
|
11
|
+
for (const harness of context.discoveredHarnesses) {
|
|
12
|
+
const parts = [
|
|
13
|
+
`${harness.name}`,
|
|
14
|
+
`installed=${harness.installed ? "yes" : "no"}`,
|
|
15
|
+
`cli=${harness.cliCommand}`,
|
|
16
|
+
`config=${harness.configFound ? "yes" : "no"}`,
|
|
17
|
+
];
|
|
18
|
+
if (harness.version) {
|
|
19
|
+
parts.push(`version=${harness.version}`);
|
|
20
|
+
}
|
|
21
|
+
if (harness.capabilities.length > 0) {
|
|
22
|
+
parts.push(`capabilities=${harness.capabilities.join(",")}`);
|
|
23
|
+
}
|
|
24
|
+
if (harness.name === "pi" || harness.name === "oh-my-pi") {
|
|
25
|
+
parts.push("profile=internal-programmatic");
|
|
26
|
+
}
|
|
27
|
+
else if (harness.installed) {
|
|
28
|
+
parts.push("profile=external-cli");
|
|
29
|
+
}
|
|
30
|
+
lines.push(`- ${parts.join(" | ")}`);
|
|
31
|
+
}
|
|
32
|
+
return lines;
|
|
33
|
+
}
|
|
34
|
+
function formatRuntimeContext(context) {
|
|
35
|
+
return [
|
|
36
|
+
"Runtime environment:",
|
|
37
|
+
`- platform=${context.platform}`,
|
|
38
|
+
`- arch=${context.arch}`,
|
|
39
|
+
`- node=${context.nodeVersion}`,
|
|
40
|
+
`- cwd=${context.cwd}`,
|
|
41
|
+
`- workspace=${context.workspace}`,
|
|
42
|
+
`- compression=${context.compressionEnabled ? "enabled" : "disabled"}`,
|
|
43
|
+
`- secure_pi_sandbox_image=${context.secureSandboxImage}`,
|
|
44
|
+
`- pi_default_bash_sandbox=${context.piDefaultBashSandbox}`,
|
|
45
|
+
`- pi_default_isolated=${context.piIsolationDefault ? "true" : "false"}`,
|
|
46
|
+
...context.envFlags.map((flag) => `- env.${flag.name}=${flag.value}`),
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
function formatHarnessAssignmentGuidance(context) {
|
|
50
|
+
const installedHarnesses = context.discoveredHarnesses
|
|
51
|
+
.filter((h) => h.installed)
|
|
52
|
+
.map((h) => h.name);
|
|
53
|
+
const installedList = installedHarnesses.length > 0
|
|
54
|
+
? installedHarnesses.join(", ")
|
|
55
|
+
: "(none)";
|
|
56
|
+
return [
|
|
57
|
+
"Harness assignment guidance:",
|
|
58
|
+
`- Only assign installed harness names. Installed harnesses: ${installedList}.`,
|
|
59
|
+
"- Default `agent`, legacy `node`, and `orchestrator_task` work to the internal agent-core worker. Prefer `task.execution.harness` to route a task to a specific installed harness. The legacy `task.metadata.harness` field is still supported but `execution.harness` takes precedence when both are present.",
|
|
60
|
+
"- Treat `agent-core` / `oh-my-pi` as the built-in programmatic harness. Its default worker mode is native/local execution with isolation disabled unless the task opts into stronger guardrails.",
|
|
61
|
+
"- Shell and legacy node effects must be executed intentionally by the orchestrating agent and then posted via `task:post`; never assume a host-side auto-executor exists.",
|
|
62
|
+
"- Shell effects run through the internal agent-core worker even when orchestration is bound to an external CLI harness. Keep shell work on that worker by default.",
|
|
63
|
+
"- Do not set `task.metadata.bashSandbox`, `task.metadata.isolated`, or `task.metadata.enableCompaction` for ordinary internal agent-core work. Leave them unset unless the task truly requires stronger guardrails or long-running compaction.",
|
|
64
|
+
"- For risky shell or system-changing subtasks that truly need stronger guardrails, encode them explicitly in task metadata: `bashSandbox: \"secure\"` to opt into AgentSH, `isolated: true` to disable repo/global extensions and skills, and `enableCompaction: true` when a long-running internal worker needs compaction.",
|
|
65
|
+
"- Treat external CLI harnesses (resolved via agent-mux) as text-agent harnesses. Use them only when their behavior is materially better for that task.",
|
|
66
|
+
"- Tasks may include an `execution` field with `model`, `harness`, and `permissions`. `execution.model` is universal (plugins and the built-in harness). `execution.harness` and `execution.permissions` are internal harness routing/guardrail hints, not a universal plugin contract.",
|
|
67
|
+
"- Do not treat `execution.permissions` as a cross-harness security boundary. Plugin targets may ignore it entirely, so route security-sensitive work through an execution path whose enforcement you actually control.",
|
|
68
|
+
"- External CLI harnesses do not inherit AgentSH protection for their own internal shell or tool execution. Route security-sensitive shell work through the internal agent-core worker instead of assuming the external harness is guarded.",
|
|
69
|
+
context.selectedHarnessName
|
|
70
|
+
? `- The selected orchestration binding harness for this run is ${context.selectedHarnessName}.`
|
|
71
|
+
: "- No orchestration binding harness has been selected yet.",
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
function formatSharedContext(context) {
|
|
75
|
+
return [
|
|
76
|
+
"",
|
|
77
|
+
...formatRuntimeContext(context),
|
|
78
|
+
"",
|
|
79
|
+
...formatHarnessCatalog(context),
|
|
80
|
+
"",
|
|
81
|
+
...formatHarnessAssignmentGuidance(context),
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
async function buildProcessDefinitionSystemPrompt(outputDir, context, interactive) {
|
|
85
|
+
// Resolve the active process-library root for the PI context
|
|
86
|
+
let processLibraryRoot;
|
|
87
|
+
let processLibraryReferenceRoot;
|
|
88
|
+
try {
|
|
89
|
+
const resolved = await (0, babysitter_sdk_1.resolveActiveProcessLibrary)();
|
|
90
|
+
if (resolved.binding?.dir) {
|
|
91
|
+
processLibraryRoot = resolved.binding.dir;
|
|
92
|
+
processLibraryReferenceRoot = (0, babysitter_sdk_1.getDefaultProcessLibrarySpec)().referenceRoot;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
// No binding — templates will fall back to manual instructions
|
|
97
|
+
}
|
|
98
|
+
const piCtx = (0, babysitter_sdk_1.createPromptContextFromCatalog)('pi', {
|
|
99
|
+
interactive,
|
|
100
|
+
processLibraryRoot,
|
|
101
|
+
processLibraryReferenceRoot,
|
|
102
|
+
});
|
|
103
|
+
const composedInstructions = (0, babysitter_sdk_1.composeProcessCreatePrompt)(piCtx);
|
|
104
|
+
return [
|
|
105
|
+
"You are the agent-platform create-run PhasePlanProcess agent.",
|
|
106
|
+
"Your job is to turn the user's intent into a concrete babysitter process definition and establish the run context for the later orchestration phase.",
|
|
107
|
+
"",
|
|
108
|
+
"Rules:",
|
|
109
|
+
"- This phase uses the common coding tools plus AskUserQuestion, task, skill, and babysitter_report_process_definition.",
|
|
110
|
+
"- Do not use dedicated create/bind/iterate/post-result babysitter tools in this phase. babysitter_report_process_definition is the only phase-specific babysitter tool here.",
|
|
111
|
+
"- In interactive mode, AskUserQuestion is the only in-loop way to ask the user for clarification. If you need missing requirements, call AskUserQuestion instead of asking in plain text.",
|
|
112
|
+
"- AskUserQuestion is a common tool whose response is conditioned by the interactive setting. Use it when clarification is useful, and ask focused high-signal questions in batches when possible.",
|
|
113
|
+
"- Whenever you call AskUserQuestion, set a generous timeout and a recommended option when safe so the turn can recover cleanly instead of stalling forever.",
|
|
114
|
+
"- Before you author anything, resolve the active shared process-library and search it with the normal file/search tools.",
|
|
115
|
+
"- Before authoring the process in any mode, conduct a real search against the active shared process-library using the normal file/search tools (`read`, `find`, `grep`, `bash`). Do not skip this process-library search step.",
|
|
116
|
+
"- Treat the active process-library root provided in the prompt context as the first place to search. If you need adjacent material, inspect the cloned repo root or reference area using the normal file/search tools.",
|
|
117
|
+
"- Research the workspace before finalizing the process. Use your available read/search/bash/write tools as needed.",
|
|
118
|
+
"- Treat the provided workspace as the only relevant filesystem root unless the user explicitly points you somewhere else.",
|
|
119
|
+
"- You may inspect local babysitter process references when they materially improve the process design. Prefer project `.a5c/processes/`, the active process-library root returned in `binding.dir`, the cloned repo root returned in `defaultSpec.cloneDir` when you need adjacent reference material, local plugin paths such as `plugins/babysitter/skills/babysit/process/`, repository `library/` materials, and local babysitter discover/profile CLI commands when available.",
|
|
120
|
+
"- Use the normal file tools to write the final JavaScript process file to the exact output path provided below. Do not rely on a babysitter-specific write tool.",
|
|
121
|
+
"- The module must export a named `async function process(inputs, ctx)`.",
|
|
122
|
+
"- The process must orchestrate the work through babysitter tasks instead of doing the main implementation directly in `process(inputs, ctx)`.",
|
|
123
|
+
"- Define at least one task with `defineTask(...)`, and invoke tasks from `process(inputs, ctx)` via `await ctx.task(...)`.",
|
|
124
|
+
"- Any task passed to `ctx.task(...)` must be a DefinedTask created via `defineTask(...)`; never pass plain object task definitions or ad-hoc task objects.",
|
|
125
|
+
"- When defining task IO paths, use `inputs.json` for task inputs and `result.json` for task outputs. Do not emit `input.json`.",
|
|
126
|
+
"- Inside that named `process(inputs, ctx)` export, do not reference Node's global process object as `process.*`; use `globalThis.process` or an imported alias like `nodeProcess` instead.",
|
|
127
|
+
"- If the process needs the workspace root, do not assume `ctx.workspaceDir` or `ctx.cwd` exists in runtime context. Resolve it from the module location using `import.meta.url`, for example with `path.dirname(fileURLToPath(import.meta.url))`.",
|
|
128
|
+
"- Keep the generated module syntactically valid ESM. If you embed HTML/CSS/JS asset contents inside the process source, do not use raw nested template literals; prefer arrays joined with \"\\n\", String.raw, or escaped inner backticks and \\${...} sequences.",
|
|
129
|
+
"- The generated process must directly execute the user's requested work. Do not generate a meta-process that writes another babysitter process unless the user explicitly asked for process authoring.",
|
|
130
|
+
"- After the file is written, call babysitter_report_process_definition exactly once with the final path and a concise summary.",
|
|
131
|
+
"- babysitter_report_process_definition creates the babysitter run and binds the session when possible. Do not try to create or bind the run yourself in this phase.",
|
|
132
|
+
"- Do not claim completion in plain text without calling babysitter_report_process_definition.",
|
|
133
|
+
"- If different tasks should run on different harnesses, encode that in the process definition rather than leaving it implicit.",
|
|
134
|
+
"",
|
|
135
|
+
"Process Library Activation:",
|
|
136
|
+
"- The active process-library root is already available in the prompt context. Search it with the normal file/search tools before authoring the process.",
|
|
137
|
+
"",
|
|
138
|
+
"--- Shared Process Creation Instructions ---",
|
|
139
|
+
"",
|
|
140
|
+
composedInstructions,
|
|
141
|
+
"",
|
|
142
|
+
`Process output directory: ${outputDir}`,
|
|
143
|
+
'Choose a descriptive kebab-case filename for your process (e.g. "user-auth-tdd.mjs", "data-pipeline-setup.js"), write it with the normal file tools, and then report the final path.',
|
|
144
|
+
...formatSharedContext(context),
|
|
145
|
+
].join("\n");
|
|
146
|
+
}
|
|
147
|
+
function buildProcessDefinitionUserPrompt(userPrompt, outputDir, options) {
|
|
148
|
+
const interactive = options?.interactive ?? true;
|
|
149
|
+
const workspaceAssessment = options?.workspaceAssessment;
|
|
150
|
+
const workspaceEntries = options?.workspaceEntries ?? [];
|
|
151
|
+
const preferAgentOnlyTasks = options?.preferAgentOnlyTasks === true;
|
|
152
|
+
const workspaceSummary = workspaceEntries.length > 0
|
|
153
|
+
? workspaceEntries.join(", ")
|
|
154
|
+
: "(no files)";
|
|
155
|
+
const lines = [
|
|
156
|
+
interactive
|
|
157
|
+
? "Interactive mode. Run the interview step first. If material requirements are missing, use AskUserQuestion rather than plain-text questions."
|
|
158
|
+
: "Non-interactive mode. Do not call AskUserQuestion; infer missing details from the request and workspace state.",
|
|
159
|
+
"",
|
|
160
|
+
`User request: ${userPrompt}`,
|
|
161
|
+
`Process output directory: ${outputDir}`,
|
|
162
|
+
];
|
|
163
|
+
if (workspaceAssessment === "empty") {
|
|
164
|
+
lines.push("Workspace assessment: empty.", `Workspace entries: ${workspaceSummary}`);
|
|
165
|
+
if (interactive) {
|
|
166
|
+
lines.push("Treat this as a greenfield request, but do not skip the interview just because the workspace is empty.", "If material product or delivery constraints remain ambiguous after workspace and process-library inspection, ask the next highest-signal AskUserQuestion before you finalize the process.");
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
lines.push("Treat this as a greenfield request and move straight to authoring the process.");
|
|
170
|
+
}
|
|
171
|
+
lines.push("You still must resolve the active shared process-library and search it before writing the process.", "Start with the repo/workspace state, then inspect only the most relevant local babysitter process references or discover output before you author the process.", "Do not inspect unrelated directories, home-directory configs, or irrelevant global skill/plugin folders.", "Keep the process practical for a brand-new workspace: plan, scaffold, implement, verify.", "Write a real babysitter process, not a direct one-shot script. The top-level `process()` should orchestrate work through `defineTask(...)` and `ctx.task(...)`.", preferAgentOnlyTasks
|
|
172
|
+
? "Put all implementation and verification in `agent` or `skill` tasks. Do not generate `shell` tasks for this run shape unless the user explicitly required an existing CLI command."
|
|
173
|
+
: "Put the main implementation in one or more `agent` tasks. Use `shell` tasks only for concrete runnable verification or tooling commands.", preferAgentOnlyTasks
|
|
174
|
+
? "Do not add `breakpoint` tasks for this run shape. Treat approval gates as process-authoring bugs unless the user explicitly asked for them."
|
|
175
|
+
: "Use `breakpoint` tasks only when user input or approval is materially required.", "Do not add internal worker guardrail metadata such as `task.metadata.bashSandbox`, `task.metadata.isolated`, or `task.metadata.enableCompaction` unless the task truly requires them.", "Keep generated asset strings syntax-safe. If the process writes JS/HTML/CSS files, avoid raw nested template literals inside the process module; prefer arrays joined with \"\\n\", String.raw, or escaped inner backticks and \\${...} sequences.");
|
|
176
|
+
}
|
|
177
|
+
else if (workspaceAssessment === "non-empty") {
|
|
178
|
+
lines.push(`Workspace assessment: non-empty (${workspaceSummary}).`, "Inspect only the workspace files that are relevant to the request before finalizing the process.", "Do not wander through unrelated global directories or repositories.");
|
|
179
|
+
}
|
|
180
|
+
lines.push("Before writing the process, you MUST search the active process-library with the normal file/search tools to find relevant patterns.", "The generated process must directly execute the user's requested work rather than write another babysitter process.", preferAgentOnlyTasks
|
|
181
|
+
? "For this `/babysitter:call`-style flow, keep the process fully agent/skill driven: no `shell` tasks unless explicitly required, and no `breakpoint` tasks."
|
|
182
|
+
: "Keep breakpoints and shell tasks proportionate to real workflow needs.", "Write the process with the normal file tools now, then call babysitter_report_process_definition exactly once.");
|
|
183
|
+
return lines.join("\n");
|
|
184
|
+
}
|
|
185
|
+
function buildOrchestrationSystemPrompt(selectedHarnessName, context, interactive, preferAgentOnlyTasks) {
|
|
186
|
+
const piCtx = (0, babysitter_sdk_1.createPromptContextFromCatalog)('pi', { interactive });
|
|
187
|
+
const sharedGuidance = [
|
|
188
|
+
(0, babysitter_sdk_1.renderBreakpointHandling)(piCtx),
|
|
189
|
+
(0, babysitter_sdk_1.renderResultsPosting)(piCtx),
|
|
190
|
+
].filter((section) => section.trim().length > 0).join("\n\n---\n\n");
|
|
191
|
+
return [
|
|
192
|
+
"You are the agent-platform create-run PhaseOrchestration agent.",
|
|
193
|
+
"Your job is to run the babysitter orchestration loop through tools, not by narrating what should happen.",
|
|
194
|
+
"Follow the babysit workflow directly: run one iteration, inspect the returned effects, perform the requested effects through `bash`, `task`, `skill`, and the available coding tools, post the results, and repeat until the run reaches a terminal state.",
|
|
195
|
+
"",
|
|
196
|
+
"Rules:",
|
|
197
|
+
`- Treat ${selectedHarnessName} as the target harness binding for this orchestration session.`,
|
|
198
|
+
"- You have your built-in coding tools (bash/read/write/edit/search) plus the custom babysitter tools below. Use them to do the orchestration work itself.",
|
|
199
|
+
"- AskUserQuestion, task, and skill are common tools in this phase. In interactive mode, use AskUserQuestion instead of asking the user in plain text.",
|
|
200
|
+
"- Work in bounded turns. In each turn, call babysitter_run_iterate at most once unless the prompt explicitly tells you otherwise.",
|
|
201
|
+
"- Never drive the orchestration loop through raw `babysitter` CLI commands inside `bash`. Use the custom babysitter tools (`babysitter_run_iterate`, `babysitter_task_post_result`, `babysitter_finish_orchestration`) for loop control.",
|
|
202
|
+
"- Never import or call babysitter SDK/runtime helpers such as `orchestrateIteration`, `commitEffectResult`, or `readTaskResult` from ad-hoc `bash`/`node` scripts. Use the exposed custom babysitter tools instead.",
|
|
203
|
+
"- `bash` is only for actual workspace commands and requested shell effects. It is not a substitute for babysitter loop-control tools.",
|
|
204
|
+
"- Do not implement the user's requested workspace deliverable directly before the bound run yields pending effects or a terminal result. First drive the run through `babysitter_run_iterate`.",
|
|
205
|
+
"- Do not rely on a hidden host-side effect executor. Perform or dispatch each effect intentionally based on the effect payload you received from babysitter_run_iterate.",
|
|
206
|
+
"- Shell and legacy node effects are first-class pending effects. Do not skip them, narrate them, or assume the host will run them for you.",
|
|
207
|
+
"- Do not create, copy, rename, delete, or hand-edit sibling run directories/files inside `.a5c/runs/` (for example debug clones like `TESTCOPY`). The bound run storage is owned by the host and may only be mutated through the custom babysitter tools.",
|
|
208
|
+
preferAgentOnlyTasks
|
|
209
|
+
? "- Prefer wrapped `agent`, `skill`, and delegated-task resolution paths. Treat `shell` effects as exceptional compatibility cases, not the normal plan shape for `/babysitter:call` flows."
|
|
210
|
+
: "- Whenever a shell effect is requested, execute it through `bash` or another intentional worker path, then post the outcome yourself.",
|
|
211
|
+
preferAgentOnlyTasks
|
|
212
|
+
? "- `/babysitter:call` flows should not emit breakpoint effects. If one appears, treat it as a process-authoring regression and repair the process instead of normalizing more approval gates into the run."
|
|
213
|
+
: "- Breakpoint effects are legitimate when the process truly needs user input or approval.",
|
|
214
|
+
"- For delegated or fresh-context work, prefer `task`. For skill-guided execution, prefer `skill`. Use the normal coding tools directly when that is the simplest correct path.",
|
|
215
|
+
"- If a delegated worker, tool call, or interactive question times out, adapt instead of failing the run immediately: increase the timeout when the task is still valid, recover partial progress, or narrow the next step.",
|
|
216
|
+
"- When a tool or delegated worker accepts a `timeout`, use a generous budget by default for meaningful coding or verification work. Substantial delegated work should usually get at least 1800000ms rather than a short interactive default.",
|
|
217
|
+
"- When choosing how to execute pending work, respect task-level harness metadata and the installed harness catalog provided below.",
|
|
218
|
+
"- Stay in the orchestration loop until the run completes, fails, or reaches a hard limit reported by the tools.",
|
|
219
|
+
"- When the run reaches a terminal state, call babysitter_finish_orchestration exactly once.",
|
|
220
|
+
"",
|
|
221
|
+
"--- Shared Orchestration Instructions ---",
|
|
222
|
+
"",
|
|
223
|
+
sharedGuidance,
|
|
224
|
+
"",
|
|
225
|
+
"This phase is the bound internal orchestration phase. External stop-hook and raw CLI loop instructions do not control this session; keep the loop inside the custom babysitter tools exposed here.",
|
|
226
|
+
...formatSharedContext(context),
|
|
227
|
+
].join("\n");
|
|
228
|
+
}
|
|
229
|
+
function buildOrchestrationBootstrapPrompt(processPath, userPrompt, maxIterations) {
|
|
230
|
+
return [
|
|
231
|
+
"Bootstrap the babysitter orchestration session.",
|
|
232
|
+
"",
|
|
233
|
+
`Process path: ${processPath}`,
|
|
234
|
+
`User prompt: ${userPrompt ?? ""}`,
|
|
235
|
+
`Maximum iterations: ${maxIterations}`,
|
|
236
|
+
"",
|
|
237
|
+
"Create the run if needed, bind the session immediately, and then stop.",
|
|
238
|
+
"Do not iterate the run yet unless a later prompt explicitly asks for an iteration turn.",
|
|
239
|
+
].join("\n");
|
|
240
|
+
}
|
|
241
|
+
function buildOrchestrationTurnPrompt(args) {
|
|
242
|
+
const lines = [
|
|
243
|
+
"Continue the babysitter orchestration session for exactly one bounded turn.",
|
|
244
|
+
"",
|
|
245
|
+
`Process path: ${args.processPath}`,
|
|
246
|
+
`User prompt: ${args.userPrompt ?? ""}`,
|
|
247
|
+
args.planningConversationSummary
|
|
248
|
+
? `Planning conversation summary:\n${args.planningConversationSummary}`
|
|
249
|
+
: undefined,
|
|
250
|
+
`Maximum iterations: ${args.maxIterations}`,
|
|
251
|
+
`Current completed iterations: ${args.currentIteration}`,
|
|
252
|
+
`Run id: ${args.runId ?? "(not created)"}`,
|
|
253
|
+
`Run dir: ${args.runDir ?? "(not created)"}`,
|
|
254
|
+
`Last run status: ${args.lastStatus ?? "unknown"}`,
|
|
255
|
+
];
|
|
256
|
+
if (args.fallbackReason) {
|
|
257
|
+
lines.push(`Fallback note: ${args.fallbackReason}`);
|
|
258
|
+
}
|
|
259
|
+
// When recovering from a process-error, instruct the agent to fix the
|
|
260
|
+
// process code before retrying the iteration.
|
|
261
|
+
if (args.lastStatus === "process-error" && args.lastError) {
|
|
262
|
+
lines.push("");
|
|
263
|
+
lines.push("IMPORTANT: The last iteration returned a recoverable process-error.");
|
|
264
|
+
lines.push(`Error: ${args.lastError}`);
|
|
265
|
+
lines.push("");
|
|
266
|
+
lines.push("The process code has a bug. Read the process file, fix the error, save it, and then call babysitter_run_iterate to retry.");
|
|
267
|
+
lines.push("Do NOT call babysitter_finish_orchestration — the run has NOT failed. The journal is clean and the iteration can be retried after the fix.");
|
|
268
|
+
lines.push("");
|
|
269
|
+
lines.push("End with a short plain-text summary of what you fixed.");
|
|
270
|
+
return lines.join("\n");
|
|
271
|
+
}
|
|
272
|
+
if (args.pendingEffects && args.pendingEffects.length > 0) {
|
|
273
|
+
lines.push("");
|
|
274
|
+
lines.push("Pending effects that still need resolution:");
|
|
275
|
+
for (const effect of args.pendingEffects) {
|
|
276
|
+
const parts = [
|
|
277
|
+
effect.effectId,
|
|
278
|
+
effect.kind,
|
|
279
|
+
effect.title || "(untitled)",
|
|
280
|
+
];
|
|
281
|
+
if (effect.harness) {
|
|
282
|
+
parts.push(`harness=${effect.harness}`);
|
|
283
|
+
}
|
|
284
|
+
lines.push(`- ${parts.join(" | ")}`);
|
|
285
|
+
}
|
|
286
|
+
lines.push("");
|
|
287
|
+
lines.push("Resolve every listed pending effect and post its result in this turn.");
|
|
288
|
+
lines.push("After every listed effect is posted, the run must be advanced out of waiting before it can complete. Call babysitter_run_iterate exactly once after the last post if you are the one driving the loop.");
|
|
289
|
+
lines.push("Do not use `task:list`, plain narration, or a completion claim as a substitute for that follow-up babysitter_run_iterate call.");
|
|
290
|
+
lines.push("Handling rules:");
|
|
291
|
+
lines.push("- For `shell` effects, execute the requested command intentionally with `bash`, capture the outcome, then call babysitter_task_post_result with explicit status/stdout/stderr/value fields.");
|
|
292
|
+
lines.push("- For legacy `node`, `agent`, or `orchestrator_task` effects, use `task` for delegated fresh-context execution, `skill` for agentic skill-guided execution, or the available coding tools directly, then call babysitter_task_post_result yourself.");
|
|
293
|
+
lines.push("- Never debug by cloning or editing `.a5c/runs/*` entries directly. Do not create ad-hoc copies like `TESTCOPY`; keep the bound run storage untouched except through the custom babysitter tools.");
|
|
294
|
+
lines.push("- If a delegated worker or tool call exposes a `timeout`, set a generous value for substantive work and retry with a longer timeout or narrower scope before giving up.");
|
|
295
|
+
lines.push("- For `breakpoint` effects, use AskUserQuestion in interactive mode with explicit approval options or choose the best option non-interactively, then post the result.");
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
lines.push("");
|
|
299
|
+
lines.push("Call babysitter_run_iterate exactly once in this turn.");
|
|
300
|
+
lines.push("If the run is freshly created or has not yielded effects yet, do not implement the workspace deliverable directly before that iterate call returns.");
|
|
301
|
+
lines.push("If it returns pending effects, resolve all of them and post every result before stopping.");
|
|
302
|
+
lines.push("If it returns completed or failed, stop after recording the terminal state.");
|
|
303
|
+
}
|
|
304
|
+
lines.push("");
|
|
305
|
+
lines.push("End with a short plain-text summary of what changed in this turn.");
|
|
306
|
+
return lines.filter((line) => typeof line === "string").join("\n");
|
|
307
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface RunSummary {
|
|
2
|
+
runId: string;
|
|
3
|
+
runDir: string;
|
|
4
|
+
processId: string;
|
|
5
|
+
prompt?: string;
|
|
6
|
+
createdAt: string;
|
|
7
|
+
status: string;
|
|
8
|
+
pendingEffects: Record<string, number>;
|
|
9
|
+
totalEffects: number;
|
|
10
|
+
resolvedEffects: number;
|
|
11
|
+
entrypoint: {
|
|
12
|
+
importPath: string;
|
|
13
|
+
exportName?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare function deriveRunStatus(journal: Array<{
|
|
17
|
+
type: string;
|
|
18
|
+
}>, pendingEffects: Record<string, number>): string;
|
|
19
|
+
export declare function discoverRuns(runsDir: string): Promise<RunSummary[]>;
|
|
20
|
+
export declare function assessRun(runDir: string): Promise<{
|
|
21
|
+
run: RunSummary;
|
|
22
|
+
journalLength: number;
|
|
23
|
+
lastEvent: {
|
|
24
|
+
type: string;
|
|
25
|
+
recordedAt: string;
|
|
26
|
+
} | null;
|
|
27
|
+
}>;
|
|
28
|
+
//# sourceMappingURL=resumeState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resumeState.d.ts","sourceRoot":"","sources":["../../../../src/harness/internal/createRun/resumeState.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACzD;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAChC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACrC,MAAM,CASR;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CA8CzE;AAED,wBAAsB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IACvD,GAAG,EAAE,UAAU,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACxD,CAAC,CAgCD"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.deriveRunStatus = deriveRunStatus;
|
|
37
|
+
exports.discoverRuns = discoverRuns;
|
|
38
|
+
exports.assessRun = assessRun;
|
|
39
|
+
const node_fs_1 = require("node:fs");
|
|
40
|
+
const path = __importStar(require("node:path"));
|
|
41
|
+
const babysitter_sdk_1 = require("@a5c-ai/babysitter-sdk");
|
|
42
|
+
function deriveRunStatus(journal, pendingEffects) {
|
|
43
|
+
const types = new Set(journal.map((event) => event.type));
|
|
44
|
+
if (types.has("RUN_COMPLETED"))
|
|
45
|
+
return "completed";
|
|
46
|
+
if (types.has("RUN_FAILED"))
|
|
47
|
+
return "failed";
|
|
48
|
+
const totalPending = Object.values(pendingEffects).reduce((a, b) => a + b, 0);
|
|
49
|
+
if (totalPending > 0)
|
|
50
|
+
return "waiting";
|
|
51
|
+
if (types.has("EFFECT_REQUESTED"))
|
|
52
|
+
return "in-progress";
|
|
53
|
+
if (types.has("RUN_CREATED"))
|
|
54
|
+
return "created";
|
|
55
|
+
return "unknown";
|
|
56
|
+
}
|
|
57
|
+
async function discoverRuns(runsDir) {
|
|
58
|
+
let entries;
|
|
59
|
+
try {
|
|
60
|
+
entries = await node_fs_1.promises.readdir(runsDir);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
const nodeError = error;
|
|
64
|
+
if (nodeError.code === "ENOENT")
|
|
65
|
+
return [];
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
const runs = [];
|
|
69
|
+
for (const entry of entries) {
|
|
70
|
+
const runDir = path.join(runsDir, entry);
|
|
71
|
+
try {
|
|
72
|
+
const stat = await node_fs_1.promises.stat(runDir);
|
|
73
|
+
if (!stat.isDirectory())
|
|
74
|
+
continue;
|
|
75
|
+
const metadata = await (0, babysitter_sdk_1.readRunMetadata)(runDir);
|
|
76
|
+
const journal = await (0, babysitter_sdk_1.loadJournal)(runDir);
|
|
77
|
+
const stateCache = await (0, babysitter_sdk_1.readStateCache)(runDir);
|
|
78
|
+
const pendingEffects = stateCache?.pendingEffectsByKind ?? {};
|
|
79
|
+
const totalEffects = stateCache
|
|
80
|
+
? Object.keys(stateCache.effectsByInvocation).length
|
|
81
|
+
: 0;
|
|
82
|
+
const totalPending = Object.values(pendingEffects).reduce((a, b) => a + b, 0);
|
|
83
|
+
runs.push({
|
|
84
|
+
runId: metadata.runId,
|
|
85
|
+
runDir,
|
|
86
|
+
processId: metadata.processId,
|
|
87
|
+
prompt: metadata.prompt,
|
|
88
|
+
createdAt: metadata.createdAt,
|
|
89
|
+
status: deriveRunStatus(journal, pendingEffects),
|
|
90
|
+
pendingEffects,
|
|
91
|
+
totalEffects,
|
|
92
|
+
resolvedEffects: totalEffects - totalPending,
|
|
93
|
+
entrypoint: metadata.entrypoint,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
runs.sort((a, b) => b.createdAt.localeCompare(a.createdAt));
|
|
101
|
+
return runs.slice(0, 20);
|
|
102
|
+
}
|
|
103
|
+
async function assessRun(runDir) {
|
|
104
|
+
const metadata = await (0, babysitter_sdk_1.readRunMetadata)(runDir);
|
|
105
|
+
const journal = await (0, babysitter_sdk_1.loadJournal)(runDir);
|
|
106
|
+
const stateCache = await (0, babysitter_sdk_1.readStateCache)(runDir);
|
|
107
|
+
const pendingEffects = stateCache?.pendingEffectsByKind ?? {};
|
|
108
|
+
const totalEffects = stateCache
|
|
109
|
+
? Object.keys(stateCache.effectsByInvocation).length
|
|
110
|
+
: 0;
|
|
111
|
+
const totalPending = Object.values(pendingEffects).reduce((a, b) => a + b, 0);
|
|
112
|
+
return {
|
|
113
|
+
run: {
|
|
114
|
+
runId: metadata.runId,
|
|
115
|
+
runDir,
|
|
116
|
+
processId: metadata.processId,
|
|
117
|
+
prompt: metadata.prompt,
|
|
118
|
+
createdAt: metadata.createdAt,
|
|
119
|
+
status: deriveRunStatus(journal, pendingEffects),
|
|
120
|
+
pendingEffects,
|
|
121
|
+
totalEffects,
|
|
122
|
+
resolvedEffects: totalEffects - totalPending,
|
|
123
|
+
entrypoint: metadata.entrypoint,
|
|
124
|
+
},
|
|
125
|
+
journalLength: journal.length,
|
|
126
|
+
lastEvent: journal.length > 0
|
|
127
|
+
? {
|
|
128
|
+
type: journal[journal.length - 1].type,
|
|
129
|
+
recordedAt: journal[journal.length - 1].recordedAt,
|
|
130
|
+
}
|
|
131
|
+
: null,
|
|
132
|
+
};
|
|
133
|
+
}
|