@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,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildAgentPrompt = buildAgentPrompt;
|
|
4
|
+
exports.buildStructuredAgentOutputInstructions = buildStructuredAgentOutputInstructions;
|
|
5
|
+
exports.extractJsonObjectFromText = extractJsonObjectFromText;
|
|
6
|
+
exports.coerceAgentResultValue = coerceAgentResultValue;
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
function buildAgentPrompt(taskDef) {
|
|
9
|
+
const agent = taskDef.agent;
|
|
10
|
+
if (!agent) {
|
|
11
|
+
return taskDef.title ?? "Execute task";
|
|
12
|
+
}
|
|
13
|
+
const structuredOutputInstructions = buildStructuredAgentOutputInstructions(agent);
|
|
14
|
+
const rawPrompt = agent.prompt;
|
|
15
|
+
if (typeof rawPrompt === "string" && rawPrompt.trim()) {
|
|
16
|
+
return [
|
|
17
|
+
"You are an autonomous agent. PERFORM the task below using your available tools.",
|
|
18
|
+
"Do not just describe what you would do. Execute the work and then summarize what you changed.",
|
|
19
|
+
...structuredOutputInstructions,
|
|
20
|
+
"",
|
|
21
|
+
"Task:",
|
|
22
|
+
rawPrompt.trim(),
|
|
23
|
+
].join("\n");
|
|
24
|
+
}
|
|
25
|
+
if (Array.isArray(rawPrompt) && rawPrompt.length > 0) {
|
|
26
|
+
const lines = rawPrompt
|
|
27
|
+
.filter((entry) => typeof entry === "string" && entry.trim().length > 0)
|
|
28
|
+
.map((entry) => entry.trim());
|
|
29
|
+
if (lines.length > 0) {
|
|
30
|
+
return [
|
|
31
|
+
"You are an autonomous agent. PERFORM the task below using your available tools.",
|
|
32
|
+
"Do not just describe what you would do. Execute the work and then summarize what you changed.",
|
|
33
|
+
...structuredOutputInstructions,
|
|
34
|
+
"",
|
|
35
|
+
"Task:",
|
|
36
|
+
...lines,
|
|
37
|
+
].join("\n");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const prompt = rawPrompt;
|
|
41
|
+
if (!prompt || typeof prompt !== "object") {
|
|
42
|
+
return taskDef.title ?? "Execute task";
|
|
43
|
+
}
|
|
44
|
+
const parts = [];
|
|
45
|
+
parts.push("You are an autonomous agent. PERFORM the task below using your available tools.", "Do not just describe what you would do. Execute the work and then summarize what you changed.", "");
|
|
46
|
+
if (typeof prompt.role === "string") {
|
|
47
|
+
parts.push(`Role: ${prompt.role}`);
|
|
48
|
+
}
|
|
49
|
+
if (typeof prompt.task === "string") {
|
|
50
|
+
parts.push(`\nTask:\n${prompt.task}`);
|
|
51
|
+
}
|
|
52
|
+
if (prompt.context) {
|
|
53
|
+
parts.push(`\nContext:\n${JSON.stringify(prompt.context, null, 2)}`);
|
|
54
|
+
}
|
|
55
|
+
if (Array.isArray(prompt.instructions)) {
|
|
56
|
+
parts.push(`\nInstructions:\n${prompt.instructions.map((item, index) => `${index + 1}. ${item}`).join("\n")}`);
|
|
57
|
+
}
|
|
58
|
+
if (typeof prompt.outputFormat === "string") {
|
|
59
|
+
parts.push(`\nOutput format: ${prompt.outputFormat}`);
|
|
60
|
+
}
|
|
61
|
+
if (structuredOutputInstructions.length > 0) {
|
|
62
|
+
parts.push(`\n${structuredOutputInstructions.join("\n")}`);
|
|
63
|
+
}
|
|
64
|
+
return parts.join("\n");
|
|
65
|
+
}
|
|
66
|
+
function buildStructuredAgentOutputInstructions(agent) {
|
|
67
|
+
const outputSchema = agent.outputSchema;
|
|
68
|
+
if (!outputSchema || typeof outputSchema !== "object") {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
return [
|
|
72
|
+
"Return ONLY a JSON object that matches the declared output schema.",
|
|
73
|
+
"Do not wrap the JSON in markdown fences, and do not prepend or append prose.",
|
|
74
|
+
`Output schema: ${JSON.stringify(outputSchema, null, 2)}`,
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
function extractJsonObjectFromText(text) {
|
|
78
|
+
const trimmed = text.trim();
|
|
79
|
+
if (!trimmed) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
if ((trimmed.startsWith("{") && trimmed.endsWith("}")) || (trimmed.startsWith("[") && trimmed.endsWith("]"))) {
|
|
83
|
+
return trimmed;
|
|
84
|
+
}
|
|
85
|
+
const fenced = trimmed.match(/```(?:json)?\s*([\s\S]*?)```/i);
|
|
86
|
+
if (fenced?.[1]) {
|
|
87
|
+
return fenced[1].trim();
|
|
88
|
+
}
|
|
89
|
+
const firstBrace = trimmed.indexOf("{");
|
|
90
|
+
const lastBrace = trimmed.lastIndexOf("}");
|
|
91
|
+
if (firstBrace >= 0 && lastBrace > firstBrace) {
|
|
92
|
+
return trimmed.slice(firstBrace, lastBrace + 1);
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
function coerceAgentResultValue(taskDef, output) {
|
|
97
|
+
const agent = taskDef.agent;
|
|
98
|
+
if (!agent?.outputSchema || typeof agent.outputSchema !== "object") {
|
|
99
|
+
return output;
|
|
100
|
+
}
|
|
101
|
+
const candidate = extractJsonObjectFromText(output);
|
|
102
|
+
if (!candidate) {
|
|
103
|
+
throw new utils_1.BabysitterRuntimeError("AgentOutputSchemaMismatch", "Agent task declared outputSchema but did not return JSON output", { category: utils_1.ErrorCategory.External });
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
return JSON.parse(candidate);
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
throw new utils_1.BabysitterRuntimeError("AgentOutputSchemaMismatch", error instanceof Error
|
|
110
|
+
? `Agent task declared outputSchema but returned invalid JSON: ${error.message}`
|
|
111
|
+
: "Agent task declared outputSchema but returned invalid JSON", { category: utils_1.ErrorCategory.External });
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type AgentCoreSessionOptions } from "../utils";
|
|
2
|
+
export declare function runDelegatedHarnessTask(args: {
|
|
3
|
+
task: string;
|
|
4
|
+
workspace?: string;
|
|
5
|
+
model?: string;
|
|
6
|
+
harness?: string;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
toolsMode?: AgentCoreSessionOptions["toolsMode"];
|
|
9
|
+
thinkingLevel?: AgentCoreSessionOptions["thinkingLevel"] | "none";
|
|
10
|
+
bashSandbox?: AgentCoreSessionOptions["bashSandbox"];
|
|
11
|
+
skills?: string[];
|
|
12
|
+
customTools?: unknown[];
|
|
13
|
+
}): Promise<{
|
|
14
|
+
success: boolean;
|
|
15
|
+
output: string;
|
|
16
|
+
harness: string;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function execShellEffect(command: string, args: string[], cwd?: string): Promise<{
|
|
19
|
+
stdout: string;
|
|
20
|
+
stderr: string;
|
|
21
|
+
exitCode: number;
|
|
22
|
+
}>;
|
|
23
|
+
//# sourceMappingURL=delegation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegation.d.ts","sourceRoot":"","sources":["../../../../../src/harness/internal/createRun/planProcess/delegation.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,uBAAuB,EAC7B,MAAM,UAAU,CAAC;AAgElB,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,uBAAuB,CAAC,WAAW,CAAC,CAAC;IACjD,aAAa,CAAC,EAAE,uBAAuB,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC;IAClE,WAAW,CAAC,EAAE,uBAAuB,CAAC,aAAa,CAAC,CAAC;IACrD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC;CACzB,GAAG,OAAO,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC,CA0DD;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAyB/D"}
|
|
@@ -0,0 +1,176 @@
|
|
|
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.runDelegatedHarnessTask = runDelegatedHarnessTask;
|
|
37
|
+
exports.execShellEffect = execShellEffect;
|
|
38
|
+
const path = __importStar(require("node:path"));
|
|
39
|
+
const node_child_process_1 = require("node:child_process");
|
|
40
|
+
const node_fs_1 = require("node:fs");
|
|
41
|
+
const invoker_1 = require("../../../invoker");
|
|
42
|
+
const utils_1 = require("../utils");
|
|
43
|
+
const builtInHarness_1 = require("../../../builtInHarness");
|
|
44
|
+
function resolveSkillFileCandidates(workspace, skillRef) {
|
|
45
|
+
const trimmed = skillRef.trim();
|
|
46
|
+
if (!trimmed) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
const candidates = new Set();
|
|
50
|
+
const add = (candidate) => {
|
|
51
|
+
if (!candidate) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
candidates.add(path.resolve(workspace, candidate));
|
|
55
|
+
};
|
|
56
|
+
if (path.isAbsolute(trimmed)) {
|
|
57
|
+
candidates.add(path.resolve(trimmed));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
add(trimmed);
|
|
61
|
+
}
|
|
62
|
+
if (/SKILL\.md$/i.test(trimmed)) {
|
|
63
|
+
add(trimmed);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
add(path.join(trimmed, "SKILL.md"));
|
|
67
|
+
add(path.join(".a5c", "skills", trimmed, "SKILL.md"));
|
|
68
|
+
const parts = trimmed.split(":").filter(Boolean);
|
|
69
|
+
if (parts.length >= 2) {
|
|
70
|
+
const [pluginName, ...skillParts] = parts;
|
|
71
|
+
add(path.join("plugins", pluginName, "skills", ...skillParts, "SKILL.md"));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return Array.from(candidates);
|
|
75
|
+
}
|
|
76
|
+
function loadSkillInstructions(workspace, skillRefs) {
|
|
77
|
+
if (!skillRefs?.length) {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
const instructions = [];
|
|
81
|
+
for (const skillRef of skillRefs) {
|
|
82
|
+
const candidates = resolveSkillFileCandidates(workspace, skillRef);
|
|
83
|
+
for (const candidate of candidates) {
|
|
84
|
+
if (!(0, node_fs_1.existsSync)(candidate)) {
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
instructions.push((0, node_fs_1.readFileSync)(candidate, "utf8"));
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
// Ignore unreadable skill files and continue searching.
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return instructions;
|
|
97
|
+
}
|
|
98
|
+
async function runDelegatedHarnessTask(args) {
|
|
99
|
+
const workspace = path.resolve(args.workspace ?? process.cwd());
|
|
100
|
+
const skillInstructions = loadSkillInstructions(workspace, args.skills);
|
|
101
|
+
const prompt = skillInstructions.length > 0
|
|
102
|
+
? [
|
|
103
|
+
"Follow the loaded skill instructions below while performing the task.",
|
|
104
|
+
"",
|
|
105
|
+
...skillInstructions,
|
|
106
|
+
"",
|
|
107
|
+
"--- Task ---",
|
|
108
|
+
args.task,
|
|
109
|
+
].join("\n")
|
|
110
|
+
: args.task;
|
|
111
|
+
const harnessName = (0, builtInHarness_1.normalizeBuiltInHarnessName)(args.harness?.trim() || "agent-core");
|
|
112
|
+
if ((0, builtInHarness_1.isBuiltInHarnessName)(harnessName)) {
|
|
113
|
+
const session = (0, utils_1.createAgentCoreSession)({
|
|
114
|
+
workspace,
|
|
115
|
+
model: args.model,
|
|
116
|
+
timeout: args.timeout,
|
|
117
|
+
toolsMode: args.toolsMode ?? "coding",
|
|
118
|
+
customTools: args.customTools,
|
|
119
|
+
ephemeral: true,
|
|
120
|
+
...(args.bashSandbox ? { bashSandbox: args.bashSandbox } : {}),
|
|
121
|
+
...(args.thinkingLevel && args.thinkingLevel !== "none"
|
|
122
|
+
? { thinkingLevel: args.thinkingLevel }
|
|
123
|
+
: {}),
|
|
124
|
+
...(skillInstructions.length > 0 ? { appendSystemPrompt: [skillInstructions.join("\n\n---\n\n")] } : {}),
|
|
125
|
+
});
|
|
126
|
+
try {
|
|
127
|
+
await session.initialize();
|
|
128
|
+
const result = await (0, utils_1.promptPiWithRetry)({
|
|
129
|
+
session,
|
|
130
|
+
message: prompt,
|
|
131
|
+
timeout: args.timeout ?? utils_1.PI_PARENT_PROMPT_TIMEOUT_MS,
|
|
132
|
+
label: "delegated-task",
|
|
133
|
+
});
|
|
134
|
+
return {
|
|
135
|
+
success: result.success,
|
|
136
|
+
output: result.output,
|
|
137
|
+
harness: harnessName,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
session.dispose();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
const result = await (0, invoker_1.invokeHarness)(harnessName, {
|
|
145
|
+
prompt,
|
|
146
|
+
workspace,
|
|
147
|
+
model: args.model,
|
|
148
|
+
timeout: args.timeout,
|
|
149
|
+
});
|
|
150
|
+
return {
|
|
151
|
+
success: result.success,
|
|
152
|
+
output: result.output,
|
|
153
|
+
harness: harnessName,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function execShellEffect(command, args, cwd) {
|
|
157
|
+
return new Promise((resolve) => {
|
|
158
|
+
(0, node_child_process_1.execFile)(command, args, {
|
|
159
|
+
cwd,
|
|
160
|
+
timeout: 300_000,
|
|
161
|
+
windowsHide: true,
|
|
162
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
163
|
+
}, (error, stdout, stderr) => {
|
|
164
|
+
let exitCode = 0;
|
|
165
|
+
if (error) {
|
|
166
|
+
const execError = error;
|
|
167
|
+
exitCode = typeof execError.status === "number" ? execError.status : 1;
|
|
168
|
+
}
|
|
169
|
+
resolve({
|
|
170
|
+
stdout: String(stdout),
|
|
171
|
+
stderr: String(stderr),
|
|
172
|
+
exitCode,
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type HarnessPromptContext as SessionCreatePromptContext, type OutputMode } from "../utils";
|
|
2
|
+
export declare function runExternalProcessDefinitionPhase(args: {
|
|
3
|
+
invocationCommand?: string;
|
|
4
|
+
prompt: string;
|
|
5
|
+
outputDir: string;
|
|
6
|
+
workspace?: string;
|
|
7
|
+
model?: string;
|
|
8
|
+
json: boolean;
|
|
9
|
+
verbose: boolean;
|
|
10
|
+
selectedHarnessName: string;
|
|
11
|
+
promptContext: SessionCreatePromptContext;
|
|
12
|
+
outputMode?: OutputMode;
|
|
13
|
+
}): Promise<string>;
|
|
14
|
+
//# sourceMappingURL=external.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external.d.ts","sourceRoot":"","sources":["../../../../../src/harness/internal/createRun/planProcess/external.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,oBAAoB,IAAI,0BAA0B,EACvD,KAAK,UAAU,EAIhB,MAAM,UAAU,CAAC;AASlB,wBAAsB,iCAAiC,CAAC,IAAI,EAAE;IAC5D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,0BAA0B,CAAC;IAC1C,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,GAAG,OAAO,CAAC,MAAM,CAAC,CA+IlB"}
|
|
@@ -0,0 +1,139 @@
|
|
|
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.runExternalProcessDefinitionPhase = runExternalProcessDefinitionPhase;
|
|
37
|
+
const path = __importStar(require("node:path"));
|
|
38
|
+
const invoker_1 = require("../../../invoker");
|
|
39
|
+
const utils_1 = require("../utils");
|
|
40
|
+
const prompts_1 = require("./prompts");
|
|
41
|
+
const recovery_1 = require("./recovery");
|
|
42
|
+
const validation_1 = require("./validation");
|
|
43
|
+
async function runExternalProcessDefinitionPhase(args) {
|
|
44
|
+
const phaseOutputs = [];
|
|
45
|
+
const state = {};
|
|
46
|
+
const writeVerbose = (message) => {
|
|
47
|
+
(0, utils_1.writeVerboseLine)(args.verbose, args.json, message, args.outputMode);
|
|
48
|
+
};
|
|
49
|
+
const writeVerboseData = (label, value, maxChars) => {
|
|
50
|
+
(0, utils_1.writeVerboseBlock)(args.verbose, args.json, label, value, maxChars);
|
|
51
|
+
};
|
|
52
|
+
(0, utils_1.emitProgress)({ phase: "1", status: "started", harness: `${args.selectedHarnessName} (headless)` }, args.json, args.verbose, args.outputMode);
|
|
53
|
+
writeVerbose(`[phasePlanProcess setup] workspace=${path.resolve(args.workspace ?? process.cwd())} model=${args.model ?? "(default)"} outputDir=${path.resolve(args.outputDir)} harness=${args.selectedHarnessName}`);
|
|
54
|
+
const workspaceAssessment = await (0, prompts_1.assessWorkspaceForExternalAuthoring)(args.workspace);
|
|
55
|
+
writeVerboseData("phasePlanProcess workspace assessment", workspaceAssessment);
|
|
56
|
+
const invokeProcessAuthor = async (label, prompt, timeout) => {
|
|
57
|
+
writeVerboseData(`${label} prompt`, prompt);
|
|
58
|
+
const result = await (0, invoker_1.invokeHarness)(args.selectedHarnessName, {
|
|
59
|
+
prompt,
|
|
60
|
+
workspace: args.workspace,
|
|
61
|
+
model: args.model,
|
|
62
|
+
timeout,
|
|
63
|
+
});
|
|
64
|
+
if (!result.success) {
|
|
65
|
+
writeVerboseData(`${label} failure output`, result.output);
|
|
66
|
+
throw new utils_1.BabysitterRuntimeError("ProcessDefinitionFailed", result.output, { category: utils_1.ErrorCategory.External });
|
|
67
|
+
}
|
|
68
|
+
phaseOutputs.push(result.output);
|
|
69
|
+
writeVerboseData(`${label} output`, result.output);
|
|
70
|
+
};
|
|
71
|
+
await invokeProcessAuthor("phasePlanProcess initial", (0, prompts_1.buildExternalProcessDefinitionPrompt)({
|
|
72
|
+
prompt: args.prompt,
|
|
73
|
+
outputDir: args.outputDir,
|
|
74
|
+
workspace: args.workspace,
|
|
75
|
+
promptContext: args.promptContext,
|
|
76
|
+
workspaceAssessment,
|
|
77
|
+
preferAgentOnlyTasks: args.invocationCommand === "call",
|
|
78
|
+
}), 900_000);
|
|
79
|
+
if (!state.report?.processPath) {
|
|
80
|
+
await (0, recovery_1.recoverReportedProcessDefinition)({
|
|
81
|
+
state,
|
|
82
|
+
outputDir: args.outputDir,
|
|
83
|
+
workspace: args.workspace,
|
|
84
|
+
outputs: phaseOutputs,
|
|
85
|
+
verbose: args.verbose,
|
|
86
|
+
json: args.json,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
if (!state.report?.processPath) {
|
|
90
|
+
await invokeProcessAuthor("phasePlanProcess recovery", [
|
|
91
|
+
`Write the full process file now to the output directory ${args.outputDir}.`,
|
|
92
|
+
"Choose a descriptive kebab-case filename (e.g. recovered-process.mjs).",
|
|
93
|
+
"Do not describe the plan only; materialize the file in the workspace.",
|
|
94
|
+
"After writing it, return either a concise summary or the full file in a ```javascript fenced block.",
|
|
95
|
+
].join("\n"), 300_000);
|
|
96
|
+
await (0, recovery_1.recoverReportedProcessDefinition)({
|
|
97
|
+
state,
|
|
98
|
+
outputDir: args.outputDir,
|
|
99
|
+
workspace: args.workspace,
|
|
100
|
+
outputs: phaseOutputs,
|
|
101
|
+
verbose: args.verbose,
|
|
102
|
+
json: args.json,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
if (!state.report?.processPath) {
|
|
106
|
+
await invokeProcessAuthor("phasePlanProcess final recovery", [
|
|
107
|
+
`Final recovery step: write the complete JavaScript process file to the output directory ${args.outputDir}.`,
|
|
108
|
+
"Return the full file in a ```javascript fenced block after it exists on disk.",
|
|
109
|
+
"Do not omit the file write.",
|
|
110
|
+
].join("\n"), 300_000);
|
|
111
|
+
await (0, recovery_1.recoverReportedProcessDefinition)({
|
|
112
|
+
state,
|
|
113
|
+
outputDir: args.outputDir,
|
|
114
|
+
workspace: args.workspace,
|
|
115
|
+
outputs: phaseOutputs,
|
|
116
|
+
verbose: args.verbose,
|
|
117
|
+
json: args.json,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
if (!state.report?.processPath) {
|
|
121
|
+
writeVerboseData("phasePlanProcess unrecoverable outputs", phaseOutputs);
|
|
122
|
+
throw new utils_1.BabysitterRuntimeError("ProcessDefinitionReportMissing", "The process-definition harness did not produce a valid process file or recoverable JavaScript output.", { category: utils_1.ErrorCategory.Runtime });
|
|
123
|
+
}
|
|
124
|
+
await invokeProcessAuthor("phasePlanProcess sdk conformance", (0, prompts_1.buildExternalProcessConformancePrompt)({
|
|
125
|
+
outputPath: state.report.processPath,
|
|
126
|
+
prompt: args.prompt,
|
|
127
|
+
}), 300_000);
|
|
128
|
+
await (0, validation_1.validateProcessExport)(state.report.processPath);
|
|
129
|
+
(0, utils_1.emitProgress)({
|
|
130
|
+
phase: "1",
|
|
131
|
+
status: "completed",
|
|
132
|
+
harness: `${args.selectedHarnessName} (headless)`,
|
|
133
|
+
processPath: state.report.processPath,
|
|
134
|
+
}, args.json, args.verbose, args.outputMode);
|
|
135
|
+
if (!args.json && args.outputMode !== "tui") {
|
|
136
|
+
process.stderr.write(`${utils_1.GREEN}PhasePlanProcess complete:${utils_1.RESET} process=${utils_1.CYAN}${state.report.processPath}${utils_1.RESET}\n`);
|
|
137
|
+
}
|
|
138
|
+
return state.report.processPath;
|
|
139
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compatibility surface for PhasePlanProcess helpers.
|
|
3
|
+
*
|
|
4
|
+
* The implementation lives under ./planProcess/ to keep planning
|
|
5
|
+
* helpers grouped by responsibility instead of accumulating more flat command
|
|
6
|
+
* siblings.
|
|
7
|
+
*/
|
|
8
|
+
export { getGeneratedProcessPath, getProcessOutputDir, } from "./paths";
|
|
9
|
+
export { execShellEffect, runDelegatedHarnessTask, } from "./delegation";
|
|
10
|
+
export { buildAgentPrompt, buildStructuredAgentOutputInstructions, coerceAgentResultValue, extractJsonObjectFromText, } from "./agentOutput";
|
|
11
|
+
export { runPlanProcessPhase, runProcessDefinitionPhase, } from "./phase";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/harness/internal/createRun/planProcess/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,eAAe,EACf,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,EAChB,sCAAsC,EACtC,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Compatibility surface for PhasePlanProcess helpers.
|
|
4
|
+
*
|
|
5
|
+
* The implementation lives under ./planProcess/ to keep planning
|
|
6
|
+
* helpers grouped by responsibility instead of accumulating more flat command
|
|
7
|
+
* siblings.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.runProcessDefinitionPhase = exports.runPlanProcessPhase = exports.extractJsonObjectFromText = exports.coerceAgentResultValue = exports.buildStructuredAgentOutputInstructions = exports.buildAgentPrompt = exports.runDelegatedHarnessTask = exports.execShellEffect = exports.getProcessOutputDir = exports.getGeneratedProcessPath = void 0;
|
|
11
|
+
var paths_1 = require("./paths");
|
|
12
|
+
Object.defineProperty(exports, "getGeneratedProcessPath", { enumerable: true, get: function () { return paths_1.getGeneratedProcessPath; } });
|
|
13
|
+
Object.defineProperty(exports, "getProcessOutputDir", { enumerable: true, get: function () { return paths_1.getProcessOutputDir; } });
|
|
14
|
+
var delegation_1 = require("./delegation");
|
|
15
|
+
Object.defineProperty(exports, "execShellEffect", { enumerable: true, get: function () { return delegation_1.execShellEffect; } });
|
|
16
|
+
Object.defineProperty(exports, "runDelegatedHarnessTask", { enumerable: true, get: function () { return delegation_1.runDelegatedHarnessTask; } });
|
|
17
|
+
var agentOutput_1 = require("./agentOutput");
|
|
18
|
+
Object.defineProperty(exports, "buildAgentPrompt", { enumerable: true, get: function () { return agentOutput_1.buildAgentPrompt; } });
|
|
19
|
+
Object.defineProperty(exports, "buildStructuredAgentOutputInstructions", { enumerable: true, get: function () { return agentOutput_1.buildStructuredAgentOutputInstructions; } });
|
|
20
|
+
Object.defineProperty(exports, "coerceAgentResultValue", { enumerable: true, get: function () { return agentOutput_1.coerceAgentResultValue; } });
|
|
21
|
+
Object.defineProperty(exports, "extractJsonObjectFromText", { enumerable: true, get: function () { return agentOutput_1.extractJsonObjectFromText; } });
|
|
22
|
+
var phase_1 = require("./phase");
|
|
23
|
+
Object.defineProperty(exports, "runPlanProcessPhase", { enumerable: true, get: function () { return phase_1.runPlanProcessPhase; } });
|
|
24
|
+
Object.defineProperty(exports, "runProcessDefinitionPhase", { enumerable: true, get: function () { return phase_1.runProcessDefinitionPhase; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function getProcessOutputDir(workDir: string): string;
|
|
2
|
+
/** @deprecated Use getProcessOutputDir instead */
|
|
3
|
+
export declare function getGeneratedProcessPath(workDir: string): string;
|
|
4
|
+
export declare function normalizeReportedPath(candidate: string, workspace?: string): string;
|
|
5
|
+
export declare function extractMentionedProcessPaths(text: string, workspace?: string): string[];
|
|
6
|
+
export declare function waitForProcessFile(filePath: string, timeoutMs?: number): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../../src/harness/internal/createRun/planProcess/paths.ts"],"names":[],"mappings":"AAOA,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,kDAAkD;AAClD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAMnF;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAoBvF;AAKD,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,SAAS,GAAE,MAAwB,GAClC,OAAO,CAAC,IAAI,CAAC,CAuBf"}
|
|
@@ -0,0 +1,98 @@
|
|
|
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.getProcessOutputDir = getProcessOutputDir;
|
|
37
|
+
exports.getGeneratedProcessPath = getGeneratedProcessPath;
|
|
38
|
+
exports.normalizeReportedPath = normalizeReportedPath;
|
|
39
|
+
exports.extractMentionedProcessPaths = extractMentionedProcessPaths;
|
|
40
|
+
exports.waitForProcessFile = waitForProcessFile;
|
|
41
|
+
const path = __importStar(require("node:path"));
|
|
42
|
+
const node_fs_1 = require("node:fs");
|
|
43
|
+
const utils_1 = require("../utils");
|
|
44
|
+
function getProcessOutputDir(workDir) {
|
|
45
|
+
return path.join(workDir, ".a5c", "processes");
|
|
46
|
+
}
|
|
47
|
+
/** @deprecated Use getProcessOutputDir instead */
|
|
48
|
+
function getGeneratedProcessPath(workDir) {
|
|
49
|
+
return getProcessOutputDir(workDir);
|
|
50
|
+
}
|
|
51
|
+
function normalizeReportedPath(candidate, workspace) {
|
|
52
|
+
const trimmed = candidate.trim().replace(/^['"`]|['"`]$/g, "");
|
|
53
|
+
if (path.isAbsolute(trimmed)) {
|
|
54
|
+
return path.resolve(trimmed);
|
|
55
|
+
}
|
|
56
|
+
return path.resolve(workspace ?? process.cwd(), trimmed);
|
|
57
|
+
}
|
|
58
|
+
function extractMentionedProcessPaths(text, workspace) {
|
|
59
|
+
const patterns = [
|
|
60
|
+
/([A-Za-z]:[\\/][^\r\n"'`]+?\.m?js)\b/g,
|
|
61
|
+
/((?:\.{0,2}[\\/]|\/)[^\r\n"'`]+?\.m?js)\b/g,
|
|
62
|
+
/\b([A-Za-z0-9_.\-\\/]+generated-process\.m?js)\b/g,
|
|
63
|
+
/\b(\.a5c[\\/]processes[\\/][A-Za-z0-9_.-]+\.m?js)\b/g,
|
|
64
|
+
];
|
|
65
|
+
const matches = new Set();
|
|
66
|
+
for (const pattern of patterns) {
|
|
67
|
+
let match;
|
|
68
|
+
while ((match = pattern.exec(text)) !== null) {
|
|
69
|
+
const raw = match[1];
|
|
70
|
+
if (raw) {
|
|
71
|
+
matches.add(normalizeReportedPath(raw, workspace));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return [...matches];
|
|
76
|
+
}
|
|
77
|
+
const POLL_INTERVAL_MS = 1_000;
|
|
78
|
+
const POLL_TIMEOUT_MS = 60_000;
|
|
79
|
+
async function waitForProcessFile(filePath, timeoutMs = POLL_TIMEOUT_MS) {
|
|
80
|
+
const deadline = Date.now() + timeoutMs;
|
|
81
|
+
while (Date.now() < deadline) {
|
|
82
|
+
try {
|
|
83
|
+
await node_fs_1.promises.access(filePath);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
// keep polling
|
|
88
|
+
}
|
|
89
|
+
await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS));
|
|
90
|
+
}
|
|
91
|
+
throw new utils_1.BabysitterRuntimeError("ProcessFileTimeoutError", `Process file was not created within ${timeoutMs / 1_000}s: ${filePath}`, {
|
|
92
|
+
category: utils_1.ErrorCategory.External,
|
|
93
|
+
nextSteps: [
|
|
94
|
+
"Check harness output for errors",
|
|
95
|
+
"Ensure the harness can write to the workspace directory",
|
|
96
|
+
],
|
|
97
|
+
});
|
|
98
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ProcessDefinitionReport } from "../utils";
|
|
2
|
+
export type { RunPlanProcessPhaseArgs } from "./phaseTypes";
|
|
3
|
+
export declare function runPlanProcessPhase(args: import("./phaseTypes").RunPlanProcessPhaseArgs): Promise<ProcessDefinitionReport>;
|
|
4
|
+
/** @deprecated Use runPlanProcessPhase instead */
|
|
5
|
+
export declare const runProcessDefinitionPhase: typeof runPlanProcessPhase;
|
|
6
|
+
//# sourceMappingURL=phase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phase.d.ts","sourceRoot":"","sources":["../../../../../src/harness/internal/createRun/planProcess/phase.ts"],"names":[],"mappings":"AAEA,OAAO,EAaL,KAAK,uBAAuB,EAG7B,MAAM,UAAU,CAAC;AAqBlB,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE5D,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,OAAO,cAAc,EAAE,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CA+WhI;AAED,kDAAkD;AAClD,eAAO,MAAM,yBAAyB,4BAAsB,CAAC"}
|