@a5c-ai/genty-platform 5.1.1-staging.0007199a1cb2
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 +48 -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 +301 -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 +127 -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 +279 -0
- package/dist/api/sessions.d.ts +17 -0
- package/dist/api/sessions.d.ts.map +1 -0
- package/dist/api/sessions.js +58 -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/analytics.d.ts +46 -0
- package/dist/breakpoints/analytics.d.ts.map +1 -0
- package/dist/breakpoints/analytics.js +64 -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/compression/compaction.d.ts +82 -0
- package/dist/compression/compaction.d.ts.map +1 -0
- package/dist/compression/compaction.js +310 -0
- package/dist/compression/compactionStrategy.d.ts +37 -0
- package/dist/compression/compactionStrategy.d.ts.map +1 -0
- package/dist/compression/compactionStrategy.js +52 -0
- package/dist/compression/compressionFamilies.d.ts +39 -0
- package/dist/compression/compressionFamilies.d.ts.map +1 -0
- package/dist/compression/compressionFamilies.js +123 -0
- package/dist/context/dynamic.d.ts +16 -0
- package/dist/context/dynamic.d.ts.map +1 -0
- package/dist/context/dynamic.js +55 -0
- package/dist/context/instructions.d.ts +15 -0
- package/dist/context/instructions.d.ts.map +1 -0
- package/dist/context/instructions.js +97 -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 +163 -0
- package/dist/cost/types.d.ts +172 -0
- package/dist/cost/types.d.ts.map +1 -0
- package/dist/cost/types.js +229 -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 +245 -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/durableQueue.d.ts +41 -0
- package/dist/daemon/durableQueue.d.ts.map +1 -0
- package/dist/daemon/durableQueue.js +183 -0
- package/dist/daemon/fileWatcher.d.ts +9 -0
- package/dist/daemon/fileWatcher.d.ts.map +1 -0
- package/dist/daemon/fileWatcher.js +144 -0
- package/dist/daemon/index.d.ts +9 -0
- package/dist/daemon/index.d.ts.map +1 -0
- package/dist/daemon/index.js +26 -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 +27 -0
- package/dist/daemon/loop.d.ts.map +1 -0
- package/dist/daemon/loop.js +387 -0
- package/dist/daemon/timerScheduler.d.ts +13 -0
- package/dist/daemon/timerScheduler.d.ts.map +1 -0
- package/dist/daemon/timerScheduler.js +212 -0
- package/dist/daemon/types.d.ts +122 -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 +132 -0
- package/dist/extensions/discovery.d.ts +15 -0
- package/dist/extensions/discovery.d.ts.map +1 -0
- package/dist/extensions/discovery.js +119 -0
- package/dist/extensions/installer.d.ts +14 -0
- package/dist/extensions/installer.d.ts.map +1 -0
- package/dist/extensions/installer.js +100 -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/privacySettings.d.ts +31 -0
- package/dist/governance/privacySettings.d.ts.map +1 -0
- package/dist/governance/privacySettings.js +104 -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 +7 -0
- package/dist/governance/types.d.ts.map +1 -0
- package/dist/governance/types.js +10 -0
- package/dist/harness/adapters/adapterBridge.d.ts +71 -0
- package/dist/harness/adapters/adapterBridge.d.ts.map +1 -0
- package/dist/harness/adapters/adapterBridge.js +117 -0
- package/dist/harness/adapters/adapterClientFactory.d.ts +29 -0
- package/dist/harness/adapters/adapterClientFactory.d.ts.map +1 -0
- package/dist/harness/adapters/adapterClientFactory.js +90 -0
- package/dist/harness/adapters/adapterEventEmitter.d.ts +51 -0
- package/dist/harness/adapters/adapterEventEmitter.d.ts.map +1 -0
- package/dist/harness/adapters/adapterEventEmitter.js +143 -0
- package/dist/harness/adapters/adapterEventMapper.d.ts +63 -0
- package/dist/harness/adapters/adapterEventMapper.d.ts.map +1 -0
- package/dist/harness/adapters/adapterEventMapper.js +100 -0
- package/dist/harness/adapters/adapterHarnessMap.d.ts +25 -0
- package/dist/harness/adapters/adapterHarnessMap.d.ts.map +1 -0
- package/dist/harness/adapters/adapterHarnessMap.js +55 -0
- package/dist/harness/adapters/adapterStdinReader.d.ts +45 -0
- package/dist/harness/adapters/adapterStdinReader.d.ts.map +1 -0
- package/dist/harness/adapters/adapterStdinReader.js +106 -0
- package/dist/harness/adapters/adapterTypes.d.ts +122 -0
- package/dist/harness/adapters/adapterTypes.d.ts.map +1 -0
- package/dist/harness/adapters/adapterTypes.js +11 -0
- package/dist/harness/adapters/index.d.ts +17 -0
- package/dist/harness/adapters/index.d.ts.map +1 -0
- package/dist/harness/adapters/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/budgetDowngrade.d.ts +12 -0
- package/dist/harness/budgetDowngrade.d.ts.map +1 -0
- package/dist/harness/budgetDowngrade.js +71 -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 +177 -0
- package/dist/harness/circuitBreaker.d.ts +51 -0
- package/dist/harness/circuitBreaker.d.ts.map +1 -0
- package/dist/harness/circuitBreaker.js +110 -0
- package/dist/harness/concurrentEffects.d.ts +39 -0
- package/dist/harness/concurrentEffects.d.ts.map +1 -0
- package/dist/harness/concurrentEffects.js +90 -0
- package/dist/harness/effectRouting.d.ts +57 -0
- package/dist/harness/effectRouting.d.ts.map +1 -0
- package/dist/harness/effectRouting.js +130 -0
- package/dist/harness/extensionToolBridge.d.ts +11 -0
- package/dist/harness/extensionToolBridge.d.ts.map +1 -0
- package/dist/harness/extensionToolBridge.js +48 -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/gentySessionContext.d.ts +31 -0
- package/dist/harness/gentySessionContext.d.ts.map +1 -0
- package/dist/harness/gentySessionContext.js +49 -0
- package/dist/harness/gentySessionIntegration.d.ts +16 -0
- package/dist/harness/gentySessionIntegration.d.ts.map +1 -0
- package/dist/harness/gentySessionIntegration.js +66 -0
- package/dist/harness/hostContract.d.ts +69 -0
- package/dist/harness/hostContract.d.ts.map +1 -0
- package/dist/harness/hostContract.js +169 -0
- package/dist/harness/index.d.ts +25 -0
- package/dist/harness/index.d.ts.map +1 -0
- package/dist/harness/index.js +124 -0
- package/dist/harness/internal/createRun/agent-core-loop.d.ts +44 -0
- package/dist/harness/internal/createRun/agent-core-loop.d.ts.map +1 -0
- package/dist/harness/internal/createRun/agent-core-loop.js +247 -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 +196 -0
- package/dist/harness/internal/createRun/orchestration/constants.d.ts +8 -0
- package/dist/harness/internal/createRun/orchestration/constants.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/constants.js +22 -0
- package/dist/harness/internal/createRun/orchestration/dispatch.d.ts +23 -0
- package/dist/harness/internal/createRun/orchestration/dispatch.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/dispatch.js +142 -0
- package/dist/harness/internal/createRun/orchestration/effects.d.ts +135 -0
- package/dist/harness/internal/createRun/orchestration/effects.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/effects.js +948 -0
- package/dist/harness/internal/createRun/orchestration/effectsHelpers.d.ts +21 -0
- package/dist/harness/internal/createRun/orchestration/effectsHelpers.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/effectsHelpers.js +80 -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 +404 -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 +107 -0
- package/dist/harness/internal/createRun/orchestration/hookDecisionEffects.d.ts +32 -0
- package/dist/harness/internal/createRun/orchestration/hookDecisionEffects.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/hookDecisionEffects.js +76 -0
- package/dist/harness/internal/createRun/orchestration/index.d.ts +49 -0
- package/dist/harness/internal/createRun/orchestration/index.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/index.js +505 -0
- package/dist/harness/internal/createRun/orchestration/internalPhase.d.ts +22 -0
- package/dist/harness/internal/createRun/orchestration/internalPhase.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/internalPhase.js +787 -0
- package/dist/harness/internal/createRun/orchestration/internalTools.d.ts +28 -0
- package/dist/harness/internal/createRun/orchestration/internalTools.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/internalTools.js +265 -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 +48 -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/orchestration/workerSessionEnhancer.d.ts +4 -0
- package/dist/harness/internal/createRun/orchestration/workerSessionEnhancer.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/workerSessionEnhancer.js +36 -0
- package/dist/harness/internal/createRun/output.d.ts +40 -0
- package/dist/harness/internal/createRun/output.d.ts.map +1 -0
- package/dist/harness/internal/createRun/output.js +469 -0
- package/dist/harness/internal/createRun/pi.d.ts +10 -0
- package/dist/harness/internal/createRun/pi.d.ts.map +1 -0
- package/dist/harness/internal/createRun/pi.js +35 -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 +161 -0
- package/dist/harness/internal/createRun/planProcess/delegation.d.ts +33 -0
- package/dist/harness/internal/createRun/planProcess/delegation.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/delegation.js +202 -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 +140 -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 +396 -0
- package/dist/harness/internal/createRun/planProcess/phaseHelpers.d.ts +44 -0
- package/dist/harness/internal/createRun/planProcess/phaseHelpers.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/phaseHelpers.js +161 -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 +22 -0
- package/dist/harness/internal/createRun/planProcess/prompts.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/prompts.js +241 -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 +205 -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 +10 -0
- package/dist/harness/internal/createRun/planProcess/validation.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/validation.js +289 -0
- package/dist/harness/internal/createRun/planProcess/validationSource.d.ts +13 -0
- package/dist/harness/internal/createRun/planProcess/validationSource.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/validationSource.js +345 -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 +76 -0
- package/dist/harness/internal/createRun/prompts.d.ts.map +1 -0
- package/dist/harness/internal/createRun/prompts.js +466 -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 +134 -0
- package/dist/harness/internal/createRun/utils.d.ts +195 -0
- package/dist/harness/internal/createRun/utils.d.ts.map +1 -0
- package/dist/harness/internal/createRun/utils.js +237 -0
- package/dist/harness/internal.d.ts +13 -0
- package/dist/harness/internal.d.ts.map +1 -0
- package/dist/harness/internal.js +151 -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 +44 -0
- package/dist/harness/invoker.d.ts.map +1 -0
- package/dist/harness/invoker.js +343 -0
- package/dist/harness/lspIntegration.d.ts +48 -0
- package/dist/harness/lspIntegration.d.ts.map +1 -0
- package/dist/harness/lspIntegration.js +45 -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/multiHarnessDispatch.d.ts +49 -0
- package/dist/harness/multiHarnessDispatch.d.ts.map +1 -0
- package/dist/harness/multiHarnessDispatch.js +73 -0
- package/dist/harness/oauthIntegration.d.ts +55 -0
- package/dist/harness/oauthIntegration.d.ts.map +1 -0
- package/dist/harness/oauthIntegration.js +84 -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/parallelFileOps.d.ts +56 -0
- package/dist/harness/parallelFileOps.d.ts.map +1 -0
- package/dist/harness/parallelFileOps.js +166 -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/profileOrchestration.d.ts +55 -0
- package/dist/harness/profileOrchestration.d.ts.map +1 -0
- package/dist/harness/profileOrchestration.js +61 -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/streamingParallelism.d.ts +43 -0
- package/dist/harness/streamingParallelism.d.ts.map +1 -0
- package/dist/harness/streamingParallelism.js +113 -0
- package/dist/harness/streamingRenderer.d.ts +64 -0
- package/dist/harness/streamingRenderer.d.ts.map +1 -0
- package/dist/harness/streamingRenderer.js +85 -0
- package/dist/harness/types.d.ts +289 -0
- package/dist/harness/types.d.ts.map +1 -0
- package/dist/harness/types.js +34 -0
- package/dist/harness/websocketSession.d.ts +63 -0
- package/dist/harness/websocketSession.d.ts.map +1 -0
- package/dist/harness/websocketSession.js +113 -0
- package/dist/harness/worktreeIsolation.d.ts +39 -0
- package/dist/harness/worktreeIsolation.d.ts.map +1 -0
- package/dist/harness/worktreeIsolation.js +85 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +54 -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/commandDiscovery.d.ts +38 -0
- package/dist/interaction/commandDiscovery.d.ts.map +1 -0
- package/dist/interaction/commandDiscovery.js +106 -0
- package/dist/interaction/index.d.ts +11 -0
- package/dist/interaction/index.d.ts.map +1 -0
- package/dist/interaction/index.js +42 -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/interaction/model-switch.d.ts +16 -0
- package/dist/interaction/model-switch.d.ts.map +1 -0
- package/dist/interaction/model-switch.js +41 -0
- package/dist/interaction/permissionApprovalUi.d.ts +32 -0
- package/dist/interaction/permissionApprovalUi.d.ts.map +1 -0
- package/dist/interaction/permissionApprovalUi.js +96 -0
- package/dist/interaction/steering.d.ts +17 -0
- package/dist/interaction/steering.d.ts.map +1 -0
- package/dist/interaction/steering.js +41 -0
- package/dist/interaction/typedEffectPatterns.d.ts +55 -0
- package/dist/interaction/typedEffectPatterns.d.ts.map +1 -0
- package/dist/interaction/typedEffectPatterns.js +190 -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 +16 -0
- package/dist/mcp/channels/index.d.ts.map +1 -0
- package/dist/mcp/channels/index.js +38 -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/auth.d.ts +57 -0
- package/dist/mcp/client/auth.d.ts.map +1 -0
- package/dist/mcp/client/auth.js +99 -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 +144 -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 +61 -0
- package/dist/mcp/client/index.d.ts +13 -0
- package/dist/mcp/client/index.d.ts.map +1 -0
- package/dist/mcp/client/index.js +30 -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 +215 -0
- package/dist/mcp/client/resourceBrowser.d.ts +52 -0
- package/dist/mcp/client/resourceBrowser.d.ts.map +1 -0
- package/dist/mcp/client/resourceBrowser.js +80 -0
- package/dist/mcp/client/toolRegistry.d.ts +113 -0
- package/dist/mcp/client/toolRegistry.d.ts.map +1 -0
- package/dist/mcp/client/toolRegistry.js +190 -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/microagents/discovery.d.ts +34 -0
- package/dist/microagents/discovery.d.ts.map +1 -0
- package/dist/microagents/discovery.js +72 -0
- package/dist/microagents/dispatch.d.ts +36 -0
- package/dist/microagents/dispatch.d.ts.map +1 -0
- package/dist/microagents/dispatch.js +59 -0
- package/dist/microagents/index.d.ts +35 -0
- package/dist/microagents/index.d.ts.map +1 -0
- package/dist/microagents/index.js +44 -0
- package/dist/microagents/subprocess.d.ts +41 -0
- package/dist/microagents/subprocess.d.ts.map +1 -0
- package/dist/microagents/subprocess.js +75 -0
- package/dist/observability/alertWebhooks.d.ts +35 -0
- package/dist/observability/alertWebhooks.d.ts.map +1 -0
- package/dist/observability/alertWebhooks.js +68 -0
- package/dist/observability/analytics.d.ts +66 -0
- package/dist/observability/analytics.d.ts.map +1 -0
- package/dist/observability/analytics.js +104 -0
- package/dist/observability/auditExport.d.ts +25 -0
- package/dist/observability/auditExport.d.ts.map +1 -0
- package/dist/observability/auditExport.js +108 -0
- package/dist/observability/contextIntrospection.d.ts +40 -0
- package/dist/observability/contextIntrospection.d.ts.map +1 -0
- package/dist/observability/contextIntrospection.js +93 -0
- package/dist/observability/failureTriage.d.ts +28 -0
- package/dist/observability/failureTriage.d.ts.map +1 -0
- package/dist/observability/failureTriage.js +168 -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 +14 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +53 -0
- package/dist/observability/progressSummarizer.d.ts +27 -0
- package/dist/observability/progressSummarizer.d.ts.map +1 -0
- package/dist/observability/progressSummarizer.js +143 -0
- package/dist/observability/promptPlan.d.ts +52 -0
- package/dist/observability/promptPlan.d.ts.map +1 -0
- package/dist/observability/promptPlan.js +101 -0
- package/dist/observability/resumeDashboard.d.ts +32 -0
- package/dist/observability/resumeDashboard.d.ts.map +1 -0
- package/dist/observability/resumeDashboard.js +204 -0
- package/dist/observability/runStatus.d.ts +44 -0
- package/dist/observability/runStatus.d.ts.map +1 -0
- package/dist/observability/runStatus.js +170 -0
- package/dist/observability/subagentHealth.d.ts +66 -0
- package/dist/observability/subagentHealth.d.ts.map +1 -0
- package/dist/observability/subagentHealth.js +107 -0
- package/dist/observability/subagentProgress.d.ts +64 -0
- package/dist/observability/subagentProgress.d.ts.map +1 -0
- package/dist/observability/subagentProgress.js +91 -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/orchestration/defaultOrchestrationProvider.d.ts +30 -0
- package/dist/orchestration/defaultOrchestrationProvider.d.ts.map +1 -0
- package/dist/orchestration/defaultOrchestrationProvider.js +304 -0
- package/dist/orchestration/global.d.ts +27 -0
- package/dist/orchestration/global.d.ts.map +1 -0
- package/dist/orchestration/global.js +51 -0
- package/dist/orchestration/index.d.ts +12 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +17 -0
- package/dist/orchestration/interfaces.d.ts +136 -0
- package/dist/orchestration/interfaces.d.ts.map +1 -0
- package/dist/orchestration/interfaces.js +11 -0
- package/dist/orchestration/registry.d.ts +30 -0
- package/dist/orchestration/registry.d.ts.map +1 -0
- package/dist/orchestration/registry.js +148 -0
- package/dist/plugins/ccCompatibility.d.ts +79 -0
- package/dist/plugins/ccCompatibility.d.ts.map +1 -0
- package/dist/plugins/ccCompatibility.js +139 -0
- package/dist/plugins/index.d.ts +16 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +38 -0
- package/dist/plugins/loader.d.ts +37 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +112 -0
- package/dist/plugins/management.d.ts +33 -0
- package/dist/plugins/management.d.ts.map +1 -0
- package/dist/plugins/management.js +99 -0
- package/dist/plugins/marketplace.d.ts +64 -0
- package/dist/plugins/marketplace.d.ts.map +1 -0
- package/dist/plugins/marketplace.js +101 -0
- package/dist/plugins/sandbox.d.ts +38 -0
- package/dist/plugins/sandbox.d.ts.map +1 -0
- package/dist/plugins/sandbox.js +109 -0
- package/dist/plugins/trust.d.ts +31 -0
- package/dist/plugins/trust.d.ts.map +1 -0
- package/dist/plugins/trust.js +66 -0
- package/dist/plugins/types.d.ts +27 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +7 -0
- package/dist/plugins/validation.d.ts +32 -0
- package/dist/plugins/validation.d.ts.map +1 -0
- package/dist/plugins/validation.js +117 -0
- package/dist/plugins/version-check.d.ts +23 -0
- package/dist/plugins/version-check.d.ts.map +1 -0
- package/dist/plugins/version-check.js +70 -0
- package/dist/plugins/versioning.d.ts +40 -0
- package/dist/plugins/versioning.d.ts.map +1 -0
- package/dist/plugins/versioning.js +101 -0
- package/dist/processes/index.d.ts +12 -0
- package/dist/processes/index.d.ts.map +1 -0
- package/dist/processes/index.js +15 -0
- package/dist/processes/recommender.d.ts +36 -0
- package/dist/processes/recommender.d.ts.map +1 -0
- package/dist/processes/recommender.js +73 -0
- package/dist/processes/scorer.d.ts +26 -0
- package/dist/processes/scorer.d.ts.map +1 -0
- package/dist/processes/scorer.js +104 -0
- package/dist/processes/types.d.ts +48 -0
- package/dist/processes/types.d.ts.map +1 -0
- package/dist/processes/types.js +9 -0
- package/dist/runtime/index.d.ts +9 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +9 -0
- package/dist/seams/contract.d.ts +63 -0
- package/dist/seams/contract.d.ts.map +1 -0
- package/dist/seams/contract.js +146 -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 +72 -0
- package/dist/session/cost.d.ts.map +1 -0
- package/dist/session/cost.js +221 -0
- package/dist/session/crossRunComm.d.ts +40 -0
- package/dist/session/crossRunComm.d.ts.map +1 -0
- package/dist/session/crossRunComm.js +86 -0
- package/dist/session/crossRunState.d.ts +8 -0
- package/dist/session/crossRunState.d.ts.map +1 -0
- package/dist/session/crossRunState.js +45 -0
- package/dist/session/discovery.d.ts +22 -0
- package/dist/session/discovery.d.ts.map +1 -0
- package/dist/session/discovery.js +51 -0
- package/dist/session/history.d.ts +30 -0
- package/dist/session/history.d.ts.map +1 -0
- package/dist/session/history.js +144 -0
- package/dist/session/index.d.ts +8 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +73 -0
- package/dist/session/memoryConsolidation.d.ts +31 -0
- package/dist/session/memoryConsolidation.d.ts.map +1 -0
- package/dist/session/memoryConsolidation.js +135 -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/sessionSharing.d.ts +55 -0
- package/dist/session/sessionSharing.d.ts.map +1 -0
- package/dist/session/sessionSharing.js +113 -0
- package/dist/session/sessionTemplates.d.ts +57 -0
- package/dist/session/sessionTemplates.d.ts.map +1 -0
- package/dist/session/sessionTemplates.js +93 -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/skills/chain.d.ts +31 -0
- package/dist/skills/chain.d.ts.map +1 -0
- package/dist/skills/chain.js +113 -0
- package/dist/skills/discovery.d.ts +34 -0
- package/dist/skills/discovery.d.ts.map +1 -0
- package/dist/skills/discovery.js +185 -0
- package/dist/skills/index.d.ts +12 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +18 -0
- package/dist/skills/router.d.ts +35 -0
- package/dist/skills/router.d.ts.map +1 -0
- package/dist/skills/router.js +143 -0
- package/dist/skills/types.d.ts +33 -0
- package/dist/skills/types.d.ts.map +1 -0
- package/dist/skills/types.js +5 -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 +9 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +11 -0
- package/dist/storage/journalWatcher.d.ts +24 -0
- package/dist/storage/journalWatcher.d.ts.map +1 -0
- package/dist/storage/journalWatcher.js +173 -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/runFiles.d.ts +29 -0
- package/dist/storage/runFiles.d.ts.map +1 -0
- package/dist/storage/runFiles.js +85 -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/dist/trust/harness-signing.d.ts +15 -0
- package/dist/trust/harness-signing.d.ts.map +1 -0
- package/dist/trust/harness-signing.js +46 -0
- package/dist/trust/key-store.d.ts +15 -0
- package/dist/trust/key-store.d.ts.map +1 -0
- package/dist/trust/key-store.js +66 -0
- package/dist/types.d.ts +81 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +21 -0
- package/dist/utils/atomic.d.ts +16 -0
- package/dist/utils/atomic.d.ts.map +1 -0
- package/dist/utils/atomic.js +75 -0
- package/dist/utils/concurrency.d.ts +27 -0
- package/dist/utils/concurrency.d.ts.map +1 -0
- package/dist/utils/concurrency.js +42 -0
- package/dist/utils/defaults.d.ts +11 -0
- package/dist/utils/defaults.d.ts.map +1 -0
- package/dist/utils/defaults.js +13 -0
- package/dist/utils/errors.d.ts +50 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +76 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +18 -0
- package/dist/utils/patterns.d.ts +35 -0
- package/dist/utils/patterns.d.ts.map +1 -0
- package/dist/utils/patterns.js +84 -0
- package/package.json +170 -0
|
@@ -0,0 +1,787 @@
|
|
|
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.runInternalOrchestrationPhase = runInternalOrchestrationPhase;
|
|
37
|
+
exports.resolveWorkspaceRunsDir = resolveWorkspaceRunsDir;
|
|
38
|
+
const node_fs_1 = require("node:fs");
|
|
39
|
+
const path = __importStar(require("node:path"));
|
|
40
|
+
const node_crypto_1 = require("node:crypto");
|
|
41
|
+
const utils_1 = require("../utils");
|
|
42
|
+
const prompts_1 = require("../prompts");
|
|
43
|
+
const constants_1 = require("./constants");
|
|
44
|
+
const effects_1 = require("./effects");
|
|
45
|
+
const internalTools_1 = require("./internalTools");
|
|
46
|
+
const runState_1 = require("../planProcess/runState");
|
|
47
|
+
const planProcess_1 = require("../planProcess");
|
|
48
|
+
const resumeState_1 = require("../resumeState");
|
|
49
|
+
const verbose_1 = require("./verbose");
|
|
50
|
+
const tasks_1 = require("../../../../tasks");
|
|
51
|
+
const history_1 = require("../../../../session/history");
|
|
52
|
+
const gentySessionContext_1 = require("../../../gentySessionContext");
|
|
53
|
+
const gentySessionIntegration_1 = require("../../../gentySessionIntegration");
|
|
54
|
+
const extensionToolBridge_1 = require("../../../extensionToolBridge");
|
|
55
|
+
async function runInternalOrchestrationPhase(args) {
|
|
56
|
+
const state = {
|
|
57
|
+
runId: args.existingRunId,
|
|
58
|
+
runDir: args.existingRunDir,
|
|
59
|
+
sessionBound: args.existingSessionBound,
|
|
60
|
+
iteration: 0,
|
|
61
|
+
pendingActions: new Map(),
|
|
62
|
+
pendingEffectResults: new Map(),
|
|
63
|
+
};
|
|
64
|
+
let orchestrationSession = null;
|
|
65
|
+
// Bug #936: genty's internal (in-process) execution must establish the run
|
|
66
|
+
// lifecycle in the WORKSPACE .a5c/runs, not the global ~/.a5c/runs. When the
|
|
67
|
+
// caller did not pass an explicit runsDir and no BABYSITTER_RUNS_DIR override
|
|
68
|
+
// is set, resolveRunsDir() defaults to the global home dir (scope=global),
|
|
69
|
+
// so the workspace .a5c/runs/ is never created and downstream verification
|
|
70
|
+
// (and run resumption) can't find the run. Force the workspace repo runs dir
|
|
71
|
+
// in that case so the internal path matches the external path's lifecycle.
|
|
72
|
+
// An explicit args.runsDir or BABYSITTER_RUNS_DIR override still wins.
|
|
73
|
+
const resolvedRunsDir = resolveWorkspaceRunsDir(args.runsDir, args.workspace);
|
|
74
|
+
if (resolvedRunsDir && resolvedRunsDir !== args.runsDir) {
|
|
75
|
+
args.runsDir = resolvedRunsDir;
|
|
76
|
+
}
|
|
77
|
+
// Initialize genty session context — wires trust, extensions, instructions, steering, model switch
|
|
78
|
+
let gentyCtx = null;
|
|
79
|
+
try {
|
|
80
|
+
gentyCtx = await (0, gentySessionContext_1.createGentySessionContext)({
|
|
81
|
+
workspace: args.workspace ?? process.cwd(),
|
|
82
|
+
sessionId: (0, node_crypto_1.randomUUID)(),
|
|
83
|
+
model: args.model,
|
|
84
|
+
agentId: `genty-orchestrator-${Date.now()}`,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
// Genty context is optional; orchestration works without it
|
|
89
|
+
}
|
|
90
|
+
if (gentyCtx) {
|
|
91
|
+
args.gentyContext = gentyCtx;
|
|
92
|
+
}
|
|
93
|
+
const activePiSessions = new Set();
|
|
94
|
+
const writeVerbose = (message) => {
|
|
95
|
+
(0, utils_1.writeVerboseLine)(args.verbose, args.json, message, args.outputMode);
|
|
96
|
+
};
|
|
97
|
+
const writeVerboseData = (label, value, maxChars) => {
|
|
98
|
+
(0, utils_1.writeVerboseBlock)(args.verbose, args.json, label, value, maxChars, args.outputMode);
|
|
99
|
+
};
|
|
100
|
+
const registerPiSession = (session) => {
|
|
101
|
+
activePiSessions.add(session);
|
|
102
|
+
return session;
|
|
103
|
+
};
|
|
104
|
+
const shutdownPiSession = async (session) => {
|
|
105
|
+
if (!session) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
activePiSessions.delete(session);
|
|
109
|
+
const maybeAbort = session;
|
|
110
|
+
if (typeof maybeAbort.abort === "function") {
|
|
111
|
+
await maybeAbort.abort().catch(() => undefined);
|
|
112
|
+
}
|
|
113
|
+
session.dispose();
|
|
114
|
+
};
|
|
115
|
+
const describePendingActions = () => Array.from(state.pendingActions.values()).map((action) => ({
|
|
116
|
+
effectId: action.effectId,
|
|
117
|
+
kind: action.kind,
|
|
118
|
+
title: action.taskDef?.title,
|
|
119
|
+
harness: (0, utils_1.resolveTaskHarness)(action, args.selectedHarnessName, args.discovered),
|
|
120
|
+
}));
|
|
121
|
+
const ensureTerminalResult = () => {
|
|
122
|
+
if (state.lastIterationResult?.status === "completed")
|
|
123
|
+
return 0;
|
|
124
|
+
if (state.lastIterationResult?.status === "failed")
|
|
125
|
+
return 1;
|
|
126
|
+
return null;
|
|
127
|
+
};
|
|
128
|
+
const captureProgressSnapshot = () => ({
|
|
129
|
+
runId: state.runId,
|
|
130
|
+
runDir: state.runDir,
|
|
131
|
+
sessionBound: Boolean(state.sessionBound),
|
|
132
|
+
iteration: state.iteration,
|
|
133
|
+
pendingActionIds: Array.from(state.pendingActions.keys()).sort().join(","),
|
|
134
|
+
pendingResultIds: Array.from(state.pendingEffectResults.keys()).sort().join(","),
|
|
135
|
+
lastStatus: state.lastIterationResult?.status,
|
|
136
|
+
hasAskUserQuestionResponse: Boolean(state.lastAskUserQuestionResponse),
|
|
137
|
+
finished: Boolean(state.finished),
|
|
138
|
+
processFileFingerprint: (0, effects_1.readProcessFileFingerprint)(args.processPath),
|
|
139
|
+
});
|
|
140
|
+
const orchestrationStateAdvanced = (before) => {
|
|
141
|
+
const after = captureProgressSnapshot();
|
|
142
|
+
return Object.keys(after).some((key) => after[key]
|
|
143
|
+
!== before[key]);
|
|
144
|
+
};
|
|
145
|
+
const protectedRunEntries = new Set();
|
|
146
|
+
let runSummaryRecorded = false;
|
|
147
|
+
const recordRunSummary = async (status, outcome) => {
|
|
148
|
+
const stateFile = state.sessionBound?.stateFile;
|
|
149
|
+
const sessionId = state.sessionBound?.sessionId;
|
|
150
|
+
if (runSummaryRecorded || !stateFile || !sessionId || !state.runId) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const recordedAt = new Date().toISOString();
|
|
154
|
+
await (0, history_1.addRunSummary)(path.dirname(stateFile), sessionId, {
|
|
155
|
+
runId: state.runId,
|
|
156
|
+
processId: path.basename(args.processPath, path.extname(args.processPath)),
|
|
157
|
+
status,
|
|
158
|
+
startedAt: recordedAt,
|
|
159
|
+
completedAt: recordedAt,
|
|
160
|
+
outcome,
|
|
161
|
+
});
|
|
162
|
+
runSummaryRecorded = true;
|
|
163
|
+
};
|
|
164
|
+
const snapshotProtectedRunEntries = async () => {
|
|
165
|
+
if (!args.runsDir) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
let entries = [];
|
|
169
|
+
try {
|
|
170
|
+
entries = await node_fs_1.promises.readdir(args.runsDir);
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
for (const entry of entries) {
|
|
176
|
+
protectedRunEntries.add(entry);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
const cleanupUnexpectedRunSiblings = async () => {
|
|
180
|
+
if (!args.runsDir || !state.runId) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
let entries = [];
|
|
184
|
+
try {
|
|
185
|
+
entries = await node_fs_1.promises.readdir(args.runsDir);
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
const removed = [];
|
|
191
|
+
for (const entry of entries) {
|
|
192
|
+
if (entry === state.runId || protectedRunEntries.has(entry)) {
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
try {
|
|
196
|
+
const target = path.join(args.runsDir, entry);
|
|
197
|
+
const stat = await node_fs_1.promises.stat(target);
|
|
198
|
+
if (!stat.isDirectory()) {
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
await node_fs_1.promises.rm(target, { recursive: true, force: true });
|
|
202
|
+
removed.push(entry);
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
// Best-effort cleanup only; don't derail the orchestration loop.
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (removed.length > 0) {
|
|
209
|
+
writeVerboseData("phaseOrchestration host cleaned stray run dirs", {
|
|
210
|
+
runId: state.runId,
|
|
211
|
+
removed,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
const syncStateFromRunArtifacts = async () => {
|
|
216
|
+
if (!state.runDir) {
|
|
217
|
+
return { runStatus: null, synchronized: false };
|
|
218
|
+
}
|
|
219
|
+
const before = captureProgressSnapshot();
|
|
220
|
+
const assessed = await (0, resumeState_1.assessRun)(state.runDir).catch(() => null);
|
|
221
|
+
if (!assessed) {
|
|
222
|
+
return { runStatus: null, synchronized: false };
|
|
223
|
+
}
|
|
224
|
+
const pendingTasks = await (0, tasks_1.listTasks)(state.runDir, { status: "requested" }).catch(() => []);
|
|
225
|
+
state.runId = assessed.run.runId;
|
|
226
|
+
state.pendingActions.clear();
|
|
227
|
+
for (const task of pendingTasks) {
|
|
228
|
+
const detail = await (0, tasks_1.readTask)(state.runDir, task.effectId).catch(() => null);
|
|
229
|
+
if (!detail) {
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
const definition = detail.definition;
|
|
233
|
+
const io = typeof definition.io === "object" && definition.io !== null
|
|
234
|
+
? definition.io
|
|
235
|
+
: undefined;
|
|
236
|
+
const action = {
|
|
237
|
+
effectId: task.effectId,
|
|
238
|
+
invocationKey: String(definition.invocationKey ?? task.effectId),
|
|
239
|
+
kind: task.kind,
|
|
240
|
+
label: task.title,
|
|
241
|
+
labels: task.labels,
|
|
242
|
+
taskDef: detail.definition,
|
|
243
|
+
taskId: task.taskId,
|
|
244
|
+
stepId: typeof definition.stepId === "string" ? definition.stepId : undefined,
|
|
245
|
+
taskDefRef: `tasks/${task.effectId}/task.json`,
|
|
246
|
+
inputsRef: typeof io?.inputJsonPath === "string" ? String(io.inputJsonPath) : undefined,
|
|
247
|
+
requestedAt: task.requestedAt,
|
|
248
|
+
};
|
|
249
|
+
state.pendingActions.set(task.effectId, action);
|
|
250
|
+
}
|
|
251
|
+
if (assessed.run.status === "completed") {
|
|
252
|
+
state.lastIterationResult = { status: "completed", output: undefined };
|
|
253
|
+
}
|
|
254
|
+
else if (assessed.run.status === "failed") {
|
|
255
|
+
state.lastIterationResult = {
|
|
256
|
+
status: "failed",
|
|
257
|
+
error: { message: "Run failed" },
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
else if (state.pendingActions.size > 0) {
|
|
261
|
+
state.lastIterationResult = {
|
|
262
|
+
status: "waiting",
|
|
263
|
+
nextActions: Array.from(state.pendingActions.values()),
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
const synchronized = orchestrationStateAdvanced(before);
|
|
267
|
+
if (synchronized) {
|
|
268
|
+
writeVerboseData("phaseOrchestration synced run state", {
|
|
269
|
+
runStatus: assessed.run.status,
|
|
270
|
+
pendingEffects: Array.from(state.pendingActions.keys()),
|
|
271
|
+
journalLength: assessed.journalLength,
|
|
272
|
+
lastEvent: assessed.lastEvent,
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
return { runStatus: assessed.run.status, synchronized };
|
|
276
|
+
};
|
|
277
|
+
const { mergedTools, iterateTool, taskPostTool, finishTool, invokeTool } = (0, internalTools_1.createOrchestrationTools)({
|
|
278
|
+
phaseArgs: args,
|
|
279
|
+
state,
|
|
280
|
+
describePendingActions,
|
|
281
|
+
writeVerbose,
|
|
282
|
+
writeVerboseData,
|
|
283
|
+
});
|
|
284
|
+
const ensureBoundRunContext = async () => {
|
|
285
|
+
const runState = await (0, runState_1.ensureRunAndMaybeBindFromProcessDefinition)({
|
|
286
|
+
processPath: args.processPath,
|
|
287
|
+
prompt: args.prompt ?? "",
|
|
288
|
+
workspace: args.workspace,
|
|
289
|
+
runsDir: args.runsDir,
|
|
290
|
+
selectedHarnessName: args.selectedHarnessName,
|
|
291
|
+
maxIterations: args.maxIterations,
|
|
292
|
+
interactive: args.interactive,
|
|
293
|
+
verbose: args.verbose,
|
|
294
|
+
json: args.json,
|
|
295
|
+
phaseSession: orchestrationSession,
|
|
296
|
+
state,
|
|
297
|
+
});
|
|
298
|
+
if (runState.createdRun) {
|
|
299
|
+
(0, utils_1.emitProgress)({ phase: "2", status: "run-created", runId: runState.runId, runDir: runState.runDir }, args.json, args.verbose, args.outputMode);
|
|
300
|
+
writeVerboseData("phaseOrchestration host run state", runState);
|
|
301
|
+
}
|
|
302
|
+
if (runState.boundSession && runState.sessionBound) {
|
|
303
|
+
(0, utils_1.emitProgress)({
|
|
304
|
+
phase: "2",
|
|
305
|
+
status: "bound",
|
|
306
|
+
runId: runState.runId,
|
|
307
|
+
runDir: runState.runDir,
|
|
308
|
+
harness: runState.sessionBound.harness,
|
|
309
|
+
sessionId: runState.sessionBound.sessionId,
|
|
310
|
+
error: runState.sessionBound.error,
|
|
311
|
+
}, args.json, args.verbose, args.outputMode);
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
const promptOrchestrationAgent = async (message, label = "phaseOrchestration") => {
|
|
315
|
+
if (!orchestrationSession) {
|
|
316
|
+
throw new utils_1.BabysitterRuntimeError("OrchestrationSessionMissing", "The orchestration PI session has not been created.", { category: utils_1.ErrorCategory.Runtime });
|
|
317
|
+
}
|
|
318
|
+
if (!args.json && args.verbose && args.outputMode !== "tui") {
|
|
319
|
+
process.stderr.write(`\n${utils_1.DIM}[${label}] agent turn\n`);
|
|
320
|
+
}
|
|
321
|
+
writeVerboseData(`${label} prompt`, message);
|
|
322
|
+
const progressSnapshot = captureProgressSnapshot();
|
|
323
|
+
let result;
|
|
324
|
+
try {
|
|
325
|
+
result = await (0, utils_1.promptPiWithRetry)({
|
|
326
|
+
session: orchestrationSession,
|
|
327
|
+
message: (0, utils_1.compressInternalHarnessPrompt)(message, args.compressionConfig, "agent"),
|
|
328
|
+
timeout: utils_1.PARENT_PROMPT_TIMEOUT_MS,
|
|
329
|
+
label,
|
|
330
|
+
writeVerbose,
|
|
331
|
+
writeVerboseData,
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
catch (err) {
|
|
335
|
+
const isTimeout = err instanceof utils_1.BabysitterRuntimeError
|
|
336
|
+
&& (err.name === "PiTimeoutError" || err.message.includes("timed out"));
|
|
337
|
+
if (!isTimeout) {
|
|
338
|
+
throw err;
|
|
339
|
+
}
|
|
340
|
+
result = {
|
|
341
|
+
success: false,
|
|
342
|
+
output: `Pi prompt timed out: ${err instanceof Error ? err.message : String(err)}`,
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
if (!result.success) {
|
|
346
|
+
writeVerboseData(`${label} agent failure output`, result.output);
|
|
347
|
+
if (!orchestrationStateAdvanced(progressSnapshot)) {
|
|
348
|
+
throw new utils_1.BabysitterRuntimeError("OrchestrationAgentFailed", result.output, {
|
|
349
|
+
category: utils_1.ErrorCategory.External,
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
if (state.lastIterationResult?.status !== "process-error" &&
|
|
353
|
+
!(0, utils_1.isIgnorablePiPromptFailure)(result.output)) {
|
|
354
|
+
throw new utils_1.BabysitterRuntimeError("OrchestrationAgentFailed", result.output, {
|
|
355
|
+
category: utils_1.ErrorCategory.External,
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
writeVerbose(`[phaseOrchestration agent] ${summarizeAgentText(result.output)}`);
|
|
361
|
+
};
|
|
362
|
+
// Build orchestration system prompt, then layer in genty context (instructions, extensions)
|
|
363
|
+
const orchestrationSystemPrompt = (0, prompts_1.buildOrchestrationSystemPrompt)(args.selectedHarnessName, args.promptContext, args.interactive, (0, prompts_1.prefersAgentOnlyTasks)(args.invocationCommand));
|
|
364
|
+
const appendSystemPrompt = [orchestrationSystemPrompt];
|
|
365
|
+
let sessionCustomTools = mergedTools;
|
|
366
|
+
if (gentyCtx) {
|
|
367
|
+
// Apply AGENTS.md / SYSTEM.md instructions
|
|
368
|
+
if (gentyCtx.instructions.agentInstructions.length > 0) {
|
|
369
|
+
appendSystemPrompt.push(...gentyCtx.instructions.agentInstructions);
|
|
370
|
+
}
|
|
371
|
+
if (gentyCtx.instructions.systemPromptMode === 'append' && gentyCtx.instructions.systemPrompt) {
|
|
372
|
+
appendSystemPrompt.push(gentyCtx.instructions.systemPrompt);
|
|
373
|
+
}
|
|
374
|
+
// Bridge extension tools into the custom tools array
|
|
375
|
+
const extensionTools = (0, extensionToolBridge_1.bridgeExtensionTools)(gentyCtx.extensionRegistry);
|
|
376
|
+
if (extensionTools.length > 0) {
|
|
377
|
+
sessionCustomTools = [...mergedTools, ...extensionTools];
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
orchestrationSession = registerPiSession((0, utils_1.createAgentCoreSession)({
|
|
381
|
+
workspace: args.workspace,
|
|
382
|
+
model: gentyCtx?.modelSwitch.currentModel ?? args.model,
|
|
383
|
+
backend: (0, utils_1.resolveAgentCoreBackendForHarness)(args.selectedHarnessName),
|
|
384
|
+
toolsMode: "coding",
|
|
385
|
+
customTools: sessionCustomTools,
|
|
386
|
+
uiContext: args.interactive && args.rl
|
|
387
|
+
? (0, utils_1.createReadlineAskUserQuestionUiContext)(args.rl)
|
|
388
|
+
: undefined,
|
|
389
|
+
appendSystemPrompt,
|
|
390
|
+
ephemeral: true,
|
|
391
|
+
...(gentyCtx?.instructions.systemPromptMode === 'replace' && gentyCtx.instructions.systemPrompt
|
|
392
|
+
? { systemPrompt: gentyCtx.instructions.systemPrompt }
|
|
393
|
+
: {}),
|
|
394
|
+
}));
|
|
395
|
+
(0, utils_1.emitProgress)({ phase: "2", status: "started", harness: args.selectedHarnessName }, args.json, args.verbose, args.outputMode);
|
|
396
|
+
let unsubscribe = null;
|
|
397
|
+
try {
|
|
398
|
+
await orchestrationSession.initialize();
|
|
399
|
+
if (gentyCtx) {
|
|
400
|
+
await gentyCtx.extensionRegistry.emit({
|
|
401
|
+
type: 'sessionStart',
|
|
402
|
+
timestamp: new Date().toISOString(),
|
|
403
|
+
data: { model: gentyCtx.modelSwitch.currentModel, extensions: gentyCtx.extensionLoadResult },
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
if (!args.json && args.verbose && args.outputMode !== "tui") {
|
|
407
|
+
unsubscribe = (0, verbose_1.subscribeVerbosePiEvents)(orchestrationSession, "orchestrator", args);
|
|
408
|
+
}
|
|
409
|
+
await ensureBoundRunContext();
|
|
410
|
+
if (!state.runId || !state.runDir) {
|
|
411
|
+
throw new utils_1.BabysitterRuntimeError("RunNotCreated", "The orchestration session could not establish a run before iteration.", { category: utils_1.ErrorCategory.Runtime });
|
|
412
|
+
}
|
|
413
|
+
await snapshotProtectedRunEntries();
|
|
414
|
+
let consecutiveTimeouts = 0;
|
|
415
|
+
let consecutiveStalls = 0;
|
|
416
|
+
let consecutiveProcessErrorStalls = 0;
|
|
417
|
+
// #936: a process-error whose journal "advances" each turn (e.g. an agent
|
|
418
|
+
// task that declares outputSchema but whose worker returns markdown, so the
|
|
419
|
+
// SDK rejects every result with the same coercion error) keeps re-arming the
|
|
420
|
+
// auto-advance branch and resets the stall counters — spinning forever on
|
|
421
|
+
// the same iteration. Track the verbatim error signature independently of
|
|
422
|
+
// journal advancement and abort fast once it recurs past the threshold.
|
|
423
|
+
let lastProcessErrorSignature;
|
|
424
|
+
let repeatedProcessErrorCount = 0;
|
|
425
|
+
const observeProcessErrorConvergence = () => {
|
|
426
|
+
if (state.lastIterationResult?.status !== "process-error") {
|
|
427
|
+
lastProcessErrorSignature = undefined;
|
|
428
|
+
repeatedProcessErrorCount = 0;
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
const signature = extractIterationError(state.lastIterationResult.error);
|
|
432
|
+
if (signature === lastProcessErrorSignature) {
|
|
433
|
+
repeatedProcessErrorCount += 1;
|
|
434
|
+
}
|
|
435
|
+
else {
|
|
436
|
+
lastProcessErrorSignature = signature;
|
|
437
|
+
repeatedProcessErrorCount = 1;
|
|
438
|
+
}
|
|
439
|
+
if (repeatedProcessErrorCount >= constants_1.MAX_CONSECUTIVE_PROCESS_ERROR_STALLS) {
|
|
440
|
+
throw new utils_1.BabysitterRuntimeError("OrchestrationProcessErrorLoop", `The run produced the same process-error ${repeatedProcessErrorCount} times without progress; aborting instead of spinning. `
|
|
441
|
+
+ `Underlying error: ${signature}`, { category: utils_1.ErrorCategory.Runtime });
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
// #936: bound repeated delegated-effect failures. A delegated agent/skill/
|
|
445
|
+
// shell effect that keeps failing (e.g. the worker session can't reach a
|
|
446
|
+
// model, so runDelegatedHarnessTask returns success:false every time) must
|
|
447
|
+
// fail the run fast — it must be impossible to re-post the same failing
|
|
448
|
+
// effect thousands of times and spin to the orchestration timeout.
|
|
449
|
+
const delegatedFailureCounts = new Map();
|
|
450
|
+
const recordDelegatedEffectFailure = (effectId, message) => {
|
|
451
|
+
const next = (delegatedFailureCounts.get(effectId) ?? 0) + 1;
|
|
452
|
+
delegatedFailureCounts.set(effectId, next);
|
|
453
|
+
writeVerbose(`[phaseOrchestration host] delegated effect ${effectId} failure ${next}/${constants_1.MAX_DELEGATED_EFFECT_FAILURES}: ${message.slice(0, 200)}`);
|
|
454
|
+
if (next >= constants_1.MAX_DELEGATED_EFFECT_FAILURES) {
|
|
455
|
+
throw new utils_1.BabysitterRuntimeError("DelegatedEffectFailed", `Delegated effect ${effectId} failed ${next} times and is not making progress; aborting the run. Underlying failure: ${message}`, { category: utils_1.ErrorCategory.External });
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
while (state.iteration < args.maxIterations) {
|
|
459
|
+
const observed = await syncStateFromRunArtifacts();
|
|
460
|
+
const terminal = ensureTerminalResult();
|
|
461
|
+
if (terminal !== null) {
|
|
462
|
+
break;
|
|
463
|
+
}
|
|
464
|
+
if ((state.lastIterationResult?.status === "waiting"
|
|
465
|
+
&& state.pendingActions.size === 0)
|
|
466
|
+
|| observed.runStatus === "created"
|
|
467
|
+
|| observed.runStatus === "in-progress") {
|
|
468
|
+
writeVerbose(observed.runStatus === "created"
|
|
469
|
+
? "[phaseOrchestration host] bootstrapping the freshly created run"
|
|
470
|
+
: "[phaseOrchestration host] all pending effects were posted; auto-advancing the run");
|
|
471
|
+
await invokeTool(iterateTool, "babysitter_run_iterate");
|
|
472
|
+
if (ensureTerminalResult() !== null) {
|
|
473
|
+
break;
|
|
474
|
+
}
|
|
475
|
+
// Abort if the auto-advanced iterate keeps yielding the identical
|
|
476
|
+
// process-error (otherwise this branch re-arms every turn and spins).
|
|
477
|
+
observeProcessErrorConvergence();
|
|
478
|
+
consecutiveTimeouts = 0;
|
|
479
|
+
consecutiveStalls = 0;
|
|
480
|
+
consecutiveProcessErrorStalls = 0;
|
|
481
|
+
continue;
|
|
482
|
+
}
|
|
483
|
+
// Auto-execute effects in the host — models struggle with the babysitter tool protocol.
|
|
484
|
+
// Handle shell effects via child_process, all other non-breakpoint effects via delegation.
|
|
485
|
+
if (state.pendingActions.size > 0) {
|
|
486
|
+
let effectsResolved = 0;
|
|
487
|
+
for (const [effectId, action] of state.pendingActions) {
|
|
488
|
+
if (action.kind === 'breakpoint')
|
|
489
|
+
continue;
|
|
490
|
+
if (action.kind === 'shell') {
|
|
491
|
+
const shell = action.shell ?? action.taskDef?.shell;
|
|
492
|
+
if (!shell?.command)
|
|
493
|
+
continue;
|
|
494
|
+
writeVerbose(`[phaseOrchestration host] auto-executing shell effect ${effectId}: ${shell.command} ${(shell.args || []).slice(0, 2).join(' ')}`);
|
|
495
|
+
try {
|
|
496
|
+
const { execFileSync } = await Promise.resolve().then(() => __importStar(require('node:child_process')));
|
|
497
|
+
const stdout = execFileSync(shell.command, shell.args || [], {
|
|
498
|
+
cwd: args.workspace,
|
|
499
|
+
timeout: shell.timeout || 30_000,
|
|
500
|
+
encoding: 'utf8',
|
|
501
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
502
|
+
});
|
|
503
|
+
await invokeTool(taskPostTool, 'babysitter_task_post_result', {
|
|
504
|
+
effectId,
|
|
505
|
+
status: 'ok',
|
|
506
|
+
valueText: stdout,
|
|
507
|
+
});
|
|
508
|
+
effectsResolved++;
|
|
509
|
+
}
|
|
510
|
+
catch (err) {
|
|
511
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
512
|
+
writeVerbose(`[phaseOrchestration host] shell effect ${effectId} failed: ${msg}`);
|
|
513
|
+
await invokeTool(taskPostTool, 'babysitter_task_post_result', {
|
|
514
|
+
effectId,
|
|
515
|
+
status: 'error',
|
|
516
|
+
error: msg,
|
|
517
|
+
});
|
|
518
|
+
effectsResolved++;
|
|
519
|
+
recordDelegatedEffectFailure(effectId, msg);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
else {
|
|
523
|
+
// Build the agent prompt exactly as the SDK effect resolver does so
|
|
524
|
+
// structured-output (outputSchema) instructions are included. Using
|
|
525
|
+
// the raw taskDef means object-shaped prompts ({role,task,...}) and
|
|
526
|
+
// declared output schemas are honored — not blindly JSON.stringified.
|
|
527
|
+
const taskDef = action.taskDef;
|
|
528
|
+
const prompt = taskDef
|
|
529
|
+
? (0, planProcess_1.buildAgentPrompt)(taskDef)
|
|
530
|
+
: String(action.title ?? action.label ?? 'Execute this task');
|
|
531
|
+
writeVerbose(`[phaseOrchestration host] auto-delegating ${action.kind} effect ${effectId}: ${(action.title ?? action.label ?? '').slice(0, 80)}`);
|
|
532
|
+
try {
|
|
533
|
+
const delegated = await (0, planProcess_1.runDelegatedHarnessTask)({
|
|
534
|
+
task: prompt,
|
|
535
|
+
workspace: args.workspace,
|
|
536
|
+
model: args.model,
|
|
537
|
+
timeout: 180_000,
|
|
538
|
+
});
|
|
539
|
+
if (!delegated.success) {
|
|
540
|
+
writeVerbose(`[phaseOrchestration host] ${action.kind} effect ${effectId} returned failure`);
|
|
541
|
+
await invokeTool(taskPostTool, 'babysitter_task_post_result', {
|
|
542
|
+
effectId,
|
|
543
|
+
status: 'error',
|
|
544
|
+
error: delegated.output,
|
|
545
|
+
});
|
|
546
|
+
effectsResolved++;
|
|
547
|
+
recordDelegatedEffectFailure(effectId, delegated.output);
|
|
548
|
+
continue;
|
|
549
|
+
}
|
|
550
|
+
// Bug #936: propagate the AGENT'S RESULT (delegated.output), not the
|
|
551
|
+
// {success,output,harness} wrapper. Coerce against the task's declared
|
|
552
|
+
// outputSchema (mirrors resolveEffect's agent branch) so ctx.task()
|
|
553
|
+
// receives the real value the process expects (e.g. {markdown}).
|
|
554
|
+
const coerced = taskDef
|
|
555
|
+
? (0, planProcess_1.coerceAgentResultValue)(taskDef, delegated.output)
|
|
556
|
+
: delegated.output;
|
|
557
|
+
await invokeTool(taskPostTool, 'babysitter_task_post_result', {
|
|
558
|
+
effectId,
|
|
559
|
+
status: 'ok',
|
|
560
|
+
valueJson: JSON.stringify(coerced),
|
|
561
|
+
});
|
|
562
|
+
effectsResolved++;
|
|
563
|
+
}
|
|
564
|
+
catch (err) {
|
|
565
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
566
|
+
writeVerbose(`[phaseOrchestration host] ${action.kind} effect ${effectId} failed: ${msg}`);
|
|
567
|
+
await invokeTool(taskPostTool, 'babysitter_task_post_result', {
|
|
568
|
+
effectId,
|
|
569
|
+
status: 'error',
|
|
570
|
+
error: msg,
|
|
571
|
+
});
|
|
572
|
+
effectsResolved++;
|
|
573
|
+
recordDelegatedEffectFailure(effectId, msg);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
if (effectsResolved > 0) {
|
|
578
|
+
const totalPending = state.pendingActions.size;
|
|
579
|
+
writeVerbose(`[phaseOrchestration host] auto-resolved ${effectsResolved} effects (${totalPending} still pending)`);
|
|
580
|
+
consecutiveStalls = 0;
|
|
581
|
+
// If all effects resolved, auto-advance the run without prompting the model.
|
|
582
|
+
if (totalPending === 0) {
|
|
583
|
+
writeVerbose('[phaseOrchestration host] all effects auto-resolved — auto-advancing run');
|
|
584
|
+
await invokeTool(iterateTool, "babysitter_run_iterate");
|
|
585
|
+
if (ensureTerminalResult() !== null)
|
|
586
|
+
break;
|
|
587
|
+
consecutiveTimeouts = 0;
|
|
588
|
+
consecutiveProcessErrorStalls = 0;
|
|
589
|
+
}
|
|
590
|
+
continue;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
const progressBeforeTurn = captureProgressSnapshot();
|
|
594
|
+
// Drain any mid-execution steering messages and prepend to prompt
|
|
595
|
+
const steeringContent = gentyCtx ? (0, gentySessionIntegration_1.drainSteeringMessages)(gentyCtx) : undefined;
|
|
596
|
+
// Emit extension turnStart event
|
|
597
|
+
if (gentyCtx) {
|
|
598
|
+
await gentyCtx.extensionRegistry.emit({
|
|
599
|
+
type: 'turnStart',
|
|
600
|
+
timestamp: new Date().toISOString(),
|
|
601
|
+
data: { iteration: state.iteration, runId: state.runId },
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
try {
|
|
605
|
+
let turnPrompt = (0, prompts_1.buildOrchestrationTurnPrompt)({
|
|
606
|
+
processPath: path.resolve(args.processPath),
|
|
607
|
+
userPrompt: args.prompt,
|
|
608
|
+
planningConversationSummary: args.planningConversationSummary,
|
|
609
|
+
maxIterations: args.maxIterations,
|
|
610
|
+
currentIteration: state.iteration,
|
|
611
|
+
runId: state.runId,
|
|
612
|
+
runDir: state.runDir,
|
|
613
|
+
lastStatus: state.lastIterationResult?.status,
|
|
614
|
+
lastError: state.lastIterationResult?.status === "process-error"
|
|
615
|
+
? extractIterationError(state.lastIterationResult.error)
|
|
616
|
+
: undefined,
|
|
617
|
+
pendingEffects: describePendingActions(),
|
|
618
|
+
});
|
|
619
|
+
if (steeringContent) {
|
|
620
|
+
turnPrompt = `[Steering messages from user]\n${steeringContent}\n\n${turnPrompt}`;
|
|
621
|
+
}
|
|
622
|
+
await promptOrchestrationAgent(turnPrompt, `phaseOrchestration iteration ${state.iteration + 1}`);
|
|
623
|
+
}
|
|
624
|
+
catch (err) {
|
|
625
|
+
const isTimeoutFailure = err instanceof utils_1.BabysitterRuntimeError
|
|
626
|
+
&& err.name === "OrchestrationAgentFailed"
|
|
627
|
+
&& (err.message.includes("timed out") || err.message.includes("PiTimeoutError"));
|
|
628
|
+
if (!isTimeoutFailure) {
|
|
629
|
+
throw err;
|
|
630
|
+
}
|
|
631
|
+
consecutiveTimeouts += 1;
|
|
632
|
+
if (consecutiveTimeouts >= constants_1.MAX_CONSECUTIVE_TIMEOUTS) {
|
|
633
|
+
throw new utils_1.BabysitterRuntimeError("OrchestrationAgentTimedOut", `Pi prompt timed out ${consecutiveTimeouts} consecutive times — aborting orchestration.`, { category: utils_1.ErrorCategory.External });
|
|
634
|
+
}
|
|
635
|
+
continue;
|
|
636
|
+
}
|
|
637
|
+
// Emit extension turnEnd event
|
|
638
|
+
if (gentyCtx) {
|
|
639
|
+
await gentyCtx.extensionRegistry.emit({
|
|
640
|
+
type: 'turnEnd',
|
|
641
|
+
timestamp: new Date().toISOString(),
|
|
642
|
+
data: { iteration: state.iteration, runId: state.runId },
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
await cleanupUnexpectedRunSiblings();
|
|
646
|
+
if (ensureTerminalResult() !== null) {
|
|
647
|
+
break;
|
|
648
|
+
}
|
|
649
|
+
if (!orchestrationStateAdvanced(progressBeforeTurn)) {
|
|
650
|
+
await syncStateFromRunArtifacts();
|
|
651
|
+
}
|
|
652
|
+
if (orchestrationStateAdvanced(progressBeforeTurn)) {
|
|
653
|
+
consecutiveTimeouts = 0;
|
|
654
|
+
consecutiveStalls = 0;
|
|
655
|
+
consecutiveProcessErrorStalls = 0;
|
|
656
|
+
continue;
|
|
657
|
+
}
|
|
658
|
+
if (state.lastIterationResult?.status === "process-error") {
|
|
659
|
+
consecutiveProcessErrorStalls += 1;
|
|
660
|
+
if (consecutiveProcessErrorStalls >= constants_1.MAX_CONSECUTIVE_PROCESS_ERROR_STALLS) {
|
|
661
|
+
throw new utils_1.BabysitterRuntimeError("OrchestrationAgentStalled", `The orchestration agent did not retry the run or repair the process after ${consecutiveProcessErrorStalls} consecutive recovery prompts.`, { category: utils_1.ErrorCategory.Runtime });
|
|
662
|
+
}
|
|
663
|
+
continue;
|
|
664
|
+
}
|
|
665
|
+
consecutiveStalls += 1;
|
|
666
|
+
if (consecutiveStalls >= constants_1.MAX_CONSECUTIVE_STALLS) {
|
|
667
|
+
throw new utils_1.BabysitterRuntimeError("OrchestrationAgentStalled", `The orchestration agent did not advance the run or resolve pending effects for ${consecutiveStalls} consecutive turns.`, { category: utils_1.ErrorCategory.Runtime });
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
if (state.lastIterationResult?.status === "completed" || state.lastIterationResult?.status === "failed") {
|
|
671
|
+
await recordRunSummary(state.lastIterationResult.status, state.lastIterationResult.status === "completed"
|
|
672
|
+
? `Run ${state.runId} completed after ${state.iteration} iterations.`
|
|
673
|
+
: `Run ${state.runId} failed after ${state.iteration} iterations.`);
|
|
674
|
+
if (!state.finished) {
|
|
675
|
+
await invokeTool(finishTool, "babysitter_finish_orchestration", {
|
|
676
|
+
summary: state.lastIterationResult.status === "completed"
|
|
677
|
+
? `Run ${state.runId} completed after ${state.iteration} iterations.`
|
|
678
|
+
: `Run ${state.runId} failed after ${state.iteration} iterations.`,
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
const terminalResult = ensureTerminalResult();
|
|
683
|
+
if (terminalResult !== null) {
|
|
684
|
+
return terminalResult;
|
|
685
|
+
}
|
|
686
|
+
await recordRunSummary("failed", `Max iterations (${args.maxIterations}) reached without completion.`);
|
|
687
|
+
return 1;
|
|
688
|
+
}
|
|
689
|
+
catch (error) {
|
|
690
|
+
await recordRunSummary("failed", error instanceof Error ? error.message : String(error));
|
|
691
|
+
writeVerboseData("phaseOrchestration error", error instanceof Error
|
|
692
|
+
? {
|
|
693
|
+
name: error.name,
|
|
694
|
+
message: error.message,
|
|
695
|
+
stack: error.stack,
|
|
696
|
+
runId: state.runId,
|
|
697
|
+
runDir: state.runDir,
|
|
698
|
+
iteration: state.iteration,
|
|
699
|
+
pendingEffects: describePendingActions(),
|
|
700
|
+
lastIterationResult: state.lastIterationResult,
|
|
701
|
+
}
|
|
702
|
+
: error);
|
|
703
|
+
(0, utils_1.emitProgress)({
|
|
704
|
+
phase: "2",
|
|
705
|
+
status: "failed",
|
|
706
|
+
runId: state.runId,
|
|
707
|
+
runDir: state.runDir,
|
|
708
|
+
iteration: state.iteration,
|
|
709
|
+
error: error instanceof Error ? error.message : String(error),
|
|
710
|
+
}, args.json, args.verbose, args.outputMode);
|
|
711
|
+
return 1;
|
|
712
|
+
}
|
|
713
|
+
finally {
|
|
714
|
+
unsubscribe?.();
|
|
715
|
+
await Promise.allSettled(Array.from(activePiSessions).map((session) => shutdownPiSession(session)));
|
|
716
|
+
if (gentyCtx) {
|
|
717
|
+
await gentyCtx.extensionRegistry.emit({
|
|
718
|
+
type: 'sessionEnd',
|
|
719
|
+
timestamp: new Date().toISOString(),
|
|
720
|
+
data: { runId: state.runId },
|
|
721
|
+
});
|
|
722
|
+
await (0, gentySessionContext_1.destroyGentySessionContext)(gentyCtx).catch(() => { });
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Resolve the runs directory for genty's internal (in-process) execution.
|
|
728
|
+
*
|
|
729
|
+
* Precedence (highest first):
|
|
730
|
+
* 1. An explicit runsDir passed by the caller (CLI --runs-dir).
|
|
731
|
+
* 2. The BABYSITTER_RUNS_DIR / BABYSITTER_RUNS_SCOPE env overrides, honored
|
|
732
|
+
* via the SDK's resolveRunsDir({ cwd }).
|
|
733
|
+
* 3. The WORKSPACE repo runs dir (<repoRoot>/.a5c/runs) — NOT the global
|
|
734
|
+
* ~/.a5c/runs. The SDK defaults to global scope when nothing is set, which
|
|
735
|
+
* means a plain `genty call` never materializes the workspace .a5c/runs/.
|
|
736
|
+
* Forcing the workspace dir here makes the internal path establish the run
|
|
737
|
+
* lifecycle where downstream tooling (and the live-stack verification)
|
|
738
|
+
* expects it. See #936 bug 2.
|
|
739
|
+
*
|
|
740
|
+
* The SDK is loaded lazily (sync require, only when this is actually called) to
|
|
741
|
+
* avoid eagerly pulling the heavy SDK + atlas index into the module graph, per
|
|
742
|
+
* the #936 default-provider lazy-load decision.
|
|
743
|
+
*/
|
|
744
|
+
function resolveWorkspaceRunsDir(explicitRunsDir, workspace) {
|
|
745
|
+
if (explicitRunsDir) {
|
|
746
|
+
return explicitRunsDir;
|
|
747
|
+
}
|
|
748
|
+
const cwd = workspace ?? process.cwd();
|
|
749
|
+
// An explicit BABYSITTER_RUNS_DIR override is a deterministic, caller-intended
|
|
750
|
+
// location — honor it verbatim (this is how the live-stack BP path and users
|
|
751
|
+
// pin the runs dir). Do NOT defer to getRunsScope()==="repo": sdk.resolveRunsDir
|
|
752
|
+
// walks UP to the nearest repo root and falls back to the GLOBAL ~/.a5c/runs when
|
|
753
|
+
// `cwd` is not itself a repo root (e.g. genty invoked with an explicit --workspace
|
|
754
|
+
// that is a tmp/live-stack dir, or any non-repo-root workspace). That escaped the
|
|
755
|
+
// run — and its completion proof — out of <workspace>/.a5c/runs where the
|
|
756
|
+
// live-stack validator (and users) look, which was the residual #936 failure.
|
|
757
|
+
if (process.env.BABYSITTER_RUNS_DIR?.trim()) {
|
|
758
|
+
try {
|
|
759
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
760
|
+
const sdk = require("@a5c-ai/babysitter-sdk");
|
|
761
|
+
return sdk.resolveRunsDir({ cwd });
|
|
762
|
+
}
|
|
763
|
+
catch {
|
|
764
|
+
// SDK unavailable: fall through to the deterministic workspace anchor below.
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
// Default genty's internal execution to the runs dir directly under the
|
|
768
|
+
// workspace the CLI was invoked in — <workspace>/.a5c/runs — NOT the global
|
|
769
|
+
// ~/.a5c/runs. Deliberately do NOT use getRepoRunsDir here: it walks UP to the
|
|
770
|
+
// nearest .git/.a5c ancestor, which for a non-git-repo workspace nested under
|
|
771
|
+
// $HOME (e.g. a tmp live-stack workspace) would wrongly anchor on the global
|
|
772
|
+
// ~/.a5c. Anchoring on the workspace directly guarantees the nested run + its
|
|
773
|
+
// completion proof land where the validator (and users) look. See #936 bug 2.
|
|
774
|
+
return path.join(cwd, ".a5c", "runs");
|
|
775
|
+
}
|
|
776
|
+
function summarizeAgentText(text) {
|
|
777
|
+
const normalized = text.replace(/\s+/g, " ").trim();
|
|
778
|
+
if (!normalized) {
|
|
779
|
+
return "(no summary emitted)";
|
|
780
|
+
}
|
|
781
|
+
return normalized.length > 240 ? `${normalized.slice(0, 237)}...` : normalized;
|
|
782
|
+
}
|
|
783
|
+
function extractIterationError(error) {
|
|
784
|
+
return typeof error === "object" && error !== null && "message" in error
|
|
785
|
+
? String(error.message)
|
|
786
|
+
: String(error);
|
|
787
|
+
}
|