@a5c-ai/genty-platform 5.1.1-staging.00ceebd28cf2
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 +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/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 +158 -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 +3 -0
- package/dist/governance/types.d.ts.map +1 -0
- package/dist/governance/types.js +5 -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 +176 -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 +13 -0
- package/dist/harness/extensionToolBridge.d.ts.map +1 -0
- package/dist/harness/extensionToolBridge.js +23 -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 +122 -0
- package/dist/harness/internal/createRun/agent-core-loop.d.ts +43 -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 +163 -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 +17 -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 +135 -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 +904 -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 +403 -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 +106 -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 +29 -0
- package/dist/harness/internal/createRun/orchestration/index.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/index.js +370 -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 +656 -0
- package/dist/harness/internal/createRun/orchestration/internalTools.d.ts +27 -0
- package/dist/harness/internal/createRun/orchestration/internalTools.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/internalTools.js +264 -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 +467 -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 +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 +424 -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 +22 -0
- package/dist/harness/internal/createRun/planProcess/prompts.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/prompts.js +239 -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 +4 -0
- package/dist/harness/internal/createRun/planProcess/validation.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/validation.js +260 -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 +59 -0
- package/dist/harness/internal/createRun/prompts.d.ts.map +1 -0
- package/dist/harness/internal/createRun/prompts.js +427 -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 +184 -0
- package/dist/harness/internal/createRun/utils.d.ts.map +1 -0
- package/dist/harness/internal/createRun/utils.js +218 -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 +44 -0
- package/dist/harness/invoker.d.ts.map +1 -0
- package/dist/harness/invoker.js +341 -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/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 +78 -0
- package/dist/harness/piWrapper/moduleSupport.d.ts.map +1 -0
- package/dist/harness/piWrapper/moduleSupport.js +207 -0
- package/dist/harness/piWrapper.d.ts +82 -0
- package/dist/harness/piWrapper.d.ts.map +1 -0
- package/dist/harness/piWrapper.js +406 -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 +278 -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/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 +169 -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/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 +3 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +28 -0
- package/dist/seams/contract.d.ts +63 -0
- package/dist/seams/contract.d.ts.map +1 -0
- package/dist/seams/contract.js +141 -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 +35 -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 +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 +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/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/package.json +161 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.trackChild = trackChild;
|
|
4
|
+
exports.untrackChild = untrackChild;
|
|
5
|
+
exports.cancelRunningProcess = cancelRunningProcess;
|
|
6
|
+
const activeChildren = new Map();
|
|
7
|
+
function trackChild(child) {
|
|
8
|
+
if (child.pid != null) {
|
|
9
|
+
activeChildren.set(child.pid, child);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function untrackChild(pid) {
|
|
13
|
+
if (pid != null) {
|
|
14
|
+
activeChildren.delete(pid);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function cancelRunningProcess(pid, options) {
|
|
18
|
+
const gracePeriodMs = options?.gracePeriodMs ?? 5000;
|
|
19
|
+
const child = activeChildren.get(pid);
|
|
20
|
+
if (!child) {
|
|
21
|
+
try {
|
|
22
|
+
process.kill(pid, "SIGTERM");
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return Promise.resolve(false);
|
|
26
|
+
}
|
|
27
|
+
setTimeout(() => {
|
|
28
|
+
try {
|
|
29
|
+
process.kill(pid, "SIGKILL");
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
// Process already exited.
|
|
33
|
+
}
|
|
34
|
+
}, gracePeriodMs);
|
|
35
|
+
return Promise.resolve(true);
|
|
36
|
+
}
|
|
37
|
+
const result = child.kill("SIGTERM");
|
|
38
|
+
if (!result) {
|
|
39
|
+
return Promise.resolve(false);
|
|
40
|
+
}
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
try {
|
|
43
|
+
child.kill("SIGKILL");
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
// Process already exited.
|
|
47
|
+
}
|
|
48
|
+
}, gracePeriodMs);
|
|
49
|
+
return Promise.resolve(true);
|
|
50
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Harness invoker module.
|
|
3
|
+
*
|
|
4
|
+
* External harnesses are routed through adapters exclusively.
|
|
5
|
+
* Pi uses direct CLI subprocess invocation. The "agent-core" programmatic
|
|
6
|
+
* harness routes through agent-platform create-run orchestration so the full
|
|
7
|
+
* internal tool stack is available.
|
|
8
|
+
*/
|
|
9
|
+
import type { HarnessInvokeOptions, HarnessInvokeResult } from "./types";
|
|
10
|
+
import { buildLaunchSpec, type HarnessCliSpec } from "./invoker/launch";
|
|
11
|
+
import { cancelRunningProcess } from "./invoker/processControl";
|
|
12
|
+
/**
|
|
13
|
+
* Mapping from harness identifier to CLI command and flag details.
|
|
14
|
+
*
|
|
15
|
+
* Only Pi retains a direct CLI mapping. All other (external) harnesses are
|
|
16
|
+
* routed through adapters adapters via {@link invokeViaAgentMux}.
|
|
17
|
+
*/
|
|
18
|
+
export declare const HARNESS_CLI_MAP: Readonly<Record<string, HarnessCliSpec>>;
|
|
19
|
+
export { buildLaunchSpec, cancelRunningProcess };
|
|
20
|
+
/**
|
|
21
|
+
* Builds CLI argument array for a given harness and invocation options.
|
|
22
|
+
*
|
|
23
|
+
* This is a pure function with no side-effects, suitable for unit testing the
|
|
24
|
+
* flag mapping logic in isolation. Only used for harnesses in
|
|
25
|
+
* {@link HARNESS_CLI_MAP} (currently Pi).
|
|
26
|
+
*
|
|
27
|
+
* @throws {BabysitterRuntimeError} if `name` is not a known harness.
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildHarnessArgs(name: string, options: HarnessInvokeOptions): string[];
|
|
30
|
+
/**
|
|
31
|
+
* Invokes a harness CLI and returns the result.
|
|
32
|
+
*
|
|
33
|
+
* The function first attempts to route through adapters (if @adapters/core
|
|
34
|
+
* is installed and the harness has an adapters adapter mapping). When adapters
|
|
35
|
+
* is unavailable, it falls back to direct child-process invocation.
|
|
36
|
+
*
|
|
37
|
+
* Pi uses direct invocation and agent-core uses create-run orchestration;
|
|
38
|
+
* neither is routed through adapters.
|
|
39
|
+
*
|
|
40
|
+
* @throws {BabysitterRuntimeError} if the harness is unknown or the CLI is
|
|
41
|
+
* not installed.
|
|
42
|
+
*/
|
|
43
|
+
export declare function invokeHarness(name: string, options: HarnessInvokeOptions): Promise<HarnessInvokeResult>;
|
|
44
|
+
//# sourceMappingURL=invoker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoker.d.ts","sourceRoot":"","sources":["../../src/harness/invoker.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EACL,eAAe,EACf,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,oBAAoB,EAGrB,MAAM,0BAA0B,CAAC;AAUlC;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAE3D,CAAC;AAOX,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,CAAC;AAMjD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,GAC5B,MAAM,EAAE,CA+BV;AASD;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAkB9B"}
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Harness invoker module.
|
|
4
|
+
*
|
|
5
|
+
* External harnesses are routed through adapters exclusively.
|
|
6
|
+
* Pi uses direct CLI subprocess invocation. The "agent-core" programmatic
|
|
7
|
+
* harness routes through agent-platform create-run orchestration so the full
|
|
8
|
+
* internal tool stack is available.
|
|
9
|
+
*/
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
22
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
23
|
+
}) : function(o, v) {
|
|
24
|
+
o["default"] = v;
|
|
25
|
+
});
|
|
26
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
27
|
+
var ownKeys = function(o) {
|
|
28
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
29
|
+
var ar = [];
|
|
30
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
31
|
+
return ar;
|
|
32
|
+
};
|
|
33
|
+
return ownKeys(o);
|
|
34
|
+
};
|
|
35
|
+
return function (mod) {
|
|
36
|
+
if (mod && mod.__esModule) return mod;
|
|
37
|
+
var result = {};
|
|
38
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
39
|
+
__setModuleDefault(result, mod);
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.cancelRunningProcess = exports.buildLaunchSpec = exports.HARNESS_CLI_MAP = void 0;
|
|
45
|
+
exports.buildHarnessArgs = buildHarnessArgs;
|
|
46
|
+
exports.invokeHarness = invokeHarness;
|
|
47
|
+
const node_child_process_1 = require("node:child_process");
|
|
48
|
+
const babysitter_sdk_1 = require("@a5c-ai/babysitter-sdk");
|
|
49
|
+
const launch_1 = require("./invoker/launch");
|
|
50
|
+
Object.defineProperty(exports, "buildLaunchSpec", { enumerable: true, get: function () { return launch_1.buildLaunchSpec; } });
|
|
51
|
+
const processControl_1 = require("./invoker/processControl");
|
|
52
|
+
Object.defineProperty(exports, "cancelRunningProcess", { enumerable: true, get: function () { return processControl_1.cancelRunningProcess; } });
|
|
53
|
+
const adapterClientFactory_1 = require("./adapters/adapterClientFactory");
|
|
54
|
+
const adapterHarnessMap_1 = require("./adapters/adapterHarnessMap");
|
|
55
|
+
const adapterBridge_1 = require("./adapters/adapterBridge");
|
|
56
|
+
const builtInHarness_1 = require("./builtInHarness");
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
// CLI mapping — Pi only (external harnesses use adapters adapters)
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
/**
|
|
61
|
+
* Mapping from harness identifier to CLI command and flag details.
|
|
62
|
+
*
|
|
63
|
+
* Only Pi retains a direct CLI mapping. All other (external) harnesses are
|
|
64
|
+
* routed through adapters adapters via {@link invokeViaAgentMux}.
|
|
65
|
+
*/
|
|
66
|
+
exports.HARNESS_CLI_MAP = {
|
|
67
|
+
pi: { cli: "pi", workspaceFlag: "--workspace", supportsModel: true, promptStyle: "flag" },
|
|
68
|
+
};
|
|
69
|
+
const PROGRAMMATIC_ONLY_HARNESSES = ["agent-core"];
|
|
70
|
+
const SUPPORTED_HARNESS_NAMES = [
|
|
71
|
+
...PROGRAMMATIC_ONLY_HARNESSES,
|
|
72
|
+
...Object.keys(exports.HARNESS_CLI_MAP),
|
|
73
|
+
];
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
// Arg builder (pure function) — Pi / direct-invoke path only
|
|
76
|
+
// ---------------------------------------------------------------------------
|
|
77
|
+
/**
|
|
78
|
+
* Builds CLI argument array for a given harness and invocation options.
|
|
79
|
+
*
|
|
80
|
+
* This is a pure function with no side-effects, suitable for unit testing the
|
|
81
|
+
* flag mapping logic in isolation. Only used for harnesses in
|
|
82
|
+
* {@link HARNESS_CLI_MAP} (currently Pi).
|
|
83
|
+
*
|
|
84
|
+
* @throws {BabysitterRuntimeError} if `name` is not a known harness.
|
|
85
|
+
*/
|
|
86
|
+
function buildHarnessArgs(name, options) {
|
|
87
|
+
const spec = exports.HARNESS_CLI_MAP[name];
|
|
88
|
+
if (!spec) {
|
|
89
|
+
throw new babysitter_sdk_1.BabysitterRuntimeError("UnknownHarnessError", `Unknown harness: "${name}". Supported harnesses: ${SUPPORTED_HARNESS_NAMES.join(", ")}`, {
|
|
90
|
+
category: babysitter_sdk_1.ErrorCategory.Validation,
|
|
91
|
+
suggestions: [`Did you mean one of: ${SUPPORTED_HARNESS_NAMES.join(", ")}?`],
|
|
92
|
+
nextSteps: ["Use a supported harness name"],
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
const args = [...(spec.baseArgs ?? [])];
|
|
96
|
+
if ((spec.promptStyle ?? "flag") === "positional") {
|
|
97
|
+
args.push(options.prompt);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
args.push("--prompt", options.prompt);
|
|
101
|
+
}
|
|
102
|
+
if (options.model && spec.supportsModel) {
|
|
103
|
+
args.push("--model", options.model);
|
|
104
|
+
}
|
|
105
|
+
if (options.workspace && spec.workspaceFlag) {
|
|
106
|
+
args.push(spec.workspaceFlag, options.workspace);
|
|
107
|
+
}
|
|
108
|
+
return args;
|
|
109
|
+
}
|
|
110
|
+
// ---------------------------------------------------------------------------
|
|
111
|
+
// Invoker
|
|
112
|
+
// ---------------------------------------------------------------------------
|
|
113
|
+
/** Default timeout for harness invocations (15 minutes). */
|
|
114
|
+
const DEFAULT_TIMEOUT_MS = 900_000;
|
|
115
|
+
/**
|
|
116
|
+
* Invokes a harness CLI and returns the result.
|
|
117
|
+
*
|
|
118
|
+
* The function first attempts to route through adapters (if @adapters/core
|
|
119
|
+
* is installed and the harness has an adapters adapter mapping). When adapters
|
|
120
|
+
* is unavailable, it falls back to direct child-process invocation.
|
|
121
|
+
*
|
|
122
|
+
* Pi uses direct invocation and agent-core uses create-run orchestration;
|
|
123
|
+
* neither is routed through adapters.
|
|
124
|
+
*
|
|
125
|
+
* @throws {BabysitterRuntimeError} if the harness is unknown or the CLI is
|
|
126
|
+
* not installed.
|
|
127
|
+
*/
|
|
128
|
+
async function invokeHarness(name, options) {
|
|
129
|
+
const harnessName = (0, builtInHarness_1.normalizeBuiltInHarnessName)(name);
|
|
130
|
+
// Pi remains a direct subprocess; agent-core routes through internal orchestration.
|
|
131
|
+
if (harnessName === "pi" || harnessName === "agent-core") {
|
|
132
|
+
return invokeHarnessDirect(harnessName, options);
|
|
133
|
+
}
|
|
134
|
+
// External harnesses go through adapters
|
|
135
|
+
if (!(0, adapterHarnessMap_1.hasAmuxAdapter)(harnessName)) {
|
|
136
|
+
throw new babysitter_sdk_1.BabysitterRuntimeError("UnknownHarnessError", `No adapters adapter for harness "${name}". External harnesses must have an adapters mapping.`, { category: babysitter_sdk_1.ErrorCategory.Configuration });
|
|
137
|
+
}
|
|
138
|
+
const agentMuxClient = await (0, adapterClientFactory_1.getAgentMuxClient)();
|
|
139
|
+
return (0, adapterBridge_1.invokeViaAgentMux)(agentMuxClient, harnessName, options);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Direct invocation for Pi plus the internal agent-core orchestration path.
|
|
143
|
+
*
|
|
144
|
+
* Pi uses CLI subprocess via `child_process.execFile`. "agent-core" delegates
|
|
145
|
+
* to create-run orchestration rather than a bare session. External harnesses
|
|
146
|
+
* should never reach this function -- they are routed through adapters in
|
|
147
|
+
* {@link invokeHarness}.
|
|
148
|
+
*
|
|
149
|
+
* @throws {BabysitterRuntimeError} if the harness is unknown or the CLI is
|
|
150
|
+
* not installed.
|
|
151
|
+
*/
|
|
152
|
+
async function invokeHarnessDirect(name, options) {
|
|
153
|
+
if (name === "agent-core") {
|
|
154
|
+
return invokeAgentCoreThroughOrchestration(options);
|
|
155
|
+
}
|
|
156
|
+
const spec = exports.HARNESS_CLI_MAP[name];
|
|
157
|
+
if (!spec) {
|
|
158
|
+
throw new babysitter_sdk_1.BabysitterRuntimeError("UnknownHarnessError", `Unknown harness: "${name}". Supported harnesses: ${SUPPORTED_HARNESS_NAMES.join(", ")}`, {
|
|
159
|
+
category: babysitter_sdk_1.ErrorCategory.Validation,
|
|
160
|
+
suggestions: [`Did you mean one of: ${SUPPORTED_HARNESS_NAMES.join(", ")}?`],
|
|
161
|
+
nextSteps: ["Use a supported harness name"],
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
// Verify CLI availability.
|
|
165
|
+
const cliCheck = await (0, babysitter_sdk_1.checkCliAvailable)(spec.cli);
|
|
166
|
+
if (!cliCheck.available) {
|
|
167
|
+
throw new babysitter_sdk_1.BabysitterRuntimeError("HarnessCliNotInstalledError", `Harness CLI "${spec.cli}" is not installed or not found on PATH`, {
|
|
168
|
+
category: babysitter_sdk_1.ErrorCategory.External,
|
|
169
|
+
nextSteps: [
|
|
170
|
+
`Install the "${spec.cli}" CLI and ensure it is on your PATH`,
|
|
171
|
+
`Verify installation by running: ${spec.cli} --version`,
|
|
172
|
+
],
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
const args = buildHarnessArgs(name, options);
|
|
176
|
+
const timeoutMs = options.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
177
|
+
const launch = (0, launch_1.buildLaunchSpec)(name, spec, cliCheck.path, args);
|
|
178
|
+
const startTime = Date.now();
|
|
179
|
+
const streaming = options.streaming;
|
|
180
|
+
return new Promise((resolve, reject) => {
|
|
181
|
+
let childEnv;
|
|
182
|
+
if (options.isolated) {
|
|
183
|
+
const minimal = {};
|
|
184
|
+
for (const key of ['PATH', 'HOME', 'NODE_PATH', 'SYSTEMROOT', 'COMSPEC']) {
|
|
185
|
+
if (process.env[key])
|
|
186
|
+
minimal[key] = process.env[key];
|
|
187
|
+
}
|
|
188
|
+
childEnv = options.env ? { ...minimal, ...options.env } : minimal;
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
childEnv = options.env ? { ...process.env, ...options.env } : process.env;
|
|
192
|
+
}
|
|
193
|
+
let trackedPid;
|
|
194
|
+
try {
|
|
195
|
+
const child = (0, node_child_process_1.spawn)(launch.command, launch.args, {
|
|
196
|
+
cwd: options.workspace,
|
|
197
|
+
windowsHide: true,
|
|
198
|
+
env: childEnv,
|
|
199
|
+
shell: launch.shell,
|
|
200
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
201
|
+
});
|
|
202
|
+
trackedPid = child.pid;
|
|
203
|
+
(0, processControl_1.trackChild)(child);
|
|
204
|
+
let stdoutBuf = "";
|
|
205
|
+
let stderrBuf = "";
|
|
206
|
+
let streamChunkCount = 0;
|
|
207
|
+
let stdoutLineBuf = "";
|
|
208
|
+
let stderrLineBuf = "";
|
|
209
|
+
child.stdout?.on("data", (chunk) => {
|
|
210
|
+
const text = chunk.toString("utf8");
|
|
211
|
+
stdoutBuf += text;
|
|
212
|
+
streamChunkCount++;
|
|
213
|
+
streaming?.onStdout?.(text);
|
|
214
|
+
if (streaming?.onLine) {
|
|
215
|
+
stdoutLineBuf += text;
|
|
216
|
+
const lines = stdoutLineBuf.split("\n");
|
|
217
|
+
stdoutLineBuf = lines.pop() ?? "";
|
|
218
|
+
for (const line of lines)
|
|
219
|
+
streaming.onLine(line, "stdout");
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
child.stderr?.on("data", (chunk) => {
|
|
223
|
+
const text = chunk.toString("utf8");
|
|
224
|
+
stderrBuf += text;
|
|
225
|
+
streamChunkCount++;
|
|
226
|
+
streaming?.onStderr?.(text);
|
|
227
|
+
if (streaming?.onLine) {
|
|
228
|
+
stderrLineBuf += text;
|
|
229
|
+
const lines = stderrLineBuf.split("\n");
|
|
230
|
+
stderrLineBuf = lines.pop() ?? "";
|
|
231
|
+
for (const line of lines)
|
|
232
|
+
streaming.onLine(line, "stderr");
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
const timer = setTimeout(() => {
|
|
236
|
+
child.kill("SIGTERM");
|
|
237
|
+
}, timeoutMs);
|
|
238
|
+
if (options.signal) {
|
|
239
|
+
options.signal.addEventListener("abort", () => {
|
|
240
|
+
child.kill("SIGTERM");
|
|
241
|
+
}, { once: true });
|
|
242
|
+
}
|
|
243
|
+
child.on("close", (code, signal) => {
|
|
244
|
+
clearTimeout(timer);
|
|
245
|
+
(0, processControl_1.untrackChild)(trackedPid);
|
|
246
|
+
const duration = Date.now() - startTime;
|
|
247
|
+
// Flush remaining line buffers
|
|
248
|
+
if (streaming?.onLine) {
|
|
249
|
+
if (stdoutLineBuf)
|
|
250
|
+
streaming.onLine(stdoutLineBuf, "stdout");
|
|
251
|
+
if (stderrLineBuf)
|
|
252
|
+
streaming.onLine(stderrLineBuf, "stderr");
|
|
253
|
+
}
|
|
254
|
+
const output = stderrBuf.length > 0
|
|
255
|
+
? `${stdoutBuf}\n${stderrBuf}`.trim()
|
|
256
|
+
: stdoutBuf.trim();
|
|
257
|
+
const killed = signal === "SIGTERM";
|
|
258
|
+
const exitCode = code ?? 1;
|
|
259
|
+
resolve({
|
|
260
|
+
success: exitCode === 0,
|
|
261
|
+
output: killed
|
|
262
|
+
? `Process timed out after ${timeoutMs}ms\n${output}`.trim()
|
|
263
|
+
: output,
|
|
264
|
+
exitCode,
|
|
265
|
+
duration,
|
|
266
|
+
harness: name,
|
|
267
|
+
streamed: streamChunkCount > 0,
|
|
268
|
+
streamChunkCount,
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
child.on("error", (err) => {
|
|
272
|
+
clearTimeout(timer);
|
|
273
|
+
(0, processControl_1.untrackChild)(trackedPid);
|
|
274
|
+
reject(new babysitter_sdk_1.BabysitterRuntimeError("HarnessSpawnError", `Failed to spawn ${spec.cli}: ${err.message}`, { category: babysitter_sdk_1.ErrorCategory.External }));
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
catch (err) {
|
|
278
|
+
reject(new babysitter_sdk_1.BabysitterRuntimeError("HarnessSpawnError", `Failed to spawn ${spec.cli}: ${err instanceof Error ? err.message : String(err)}`, { category: babysitter_sdk_1.ErrorCategory.External }));
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
async function invokeAgentCoreThroughOrchestration(options) {
|
|
283
|
+
const startTime = Date.now();
|
|
284
|
+
const streaming = options.streaming;
|
|
285
|
+
const { handleHarnessCreateRun } = await Promise.resolve().then(() => __importStar(require("./internal/createRun")));
|
|
286
|
+
let streamChunkCount = 0;
|
|
287
|
+
const { result: exitCode, output } = await captureProcessOutput(() => handleHarnessCreateRun({
|
|
288
|
+
invocationCommand: "invoke",
|
|
289
|
+
prompt: options.prompt,
|
|
290
|
+
harness: "agent-core",
|
|
291
|
+
workspace: options.workspace,
|
|
292
|
+
model: options.model,
|
|
293
|
+
json: false,
|
|
294
|
+
verbose: false,
|
|
295
|
+
interactive: false,
|
|
296
|
+
}), streaming ? (chunk, source) => {
|
|
297
|
+
streamChunkCount++;
|
|
298
|
+
if (source === "stdout")
|
|
299
|
+
streaming.onStdout?.(chunk);
|
|
300
|
+
else
|
|
301
|
+
streaming.onStderr?.(chunk);
|
|
302
|
+
streaming.onLine?.(chunk.trimEnd(), source);
|
|
303
|
+
} : undefined);
|
|
304
|
+
return {
|
|
305
|
+
success: exitCode === 0,
|
|
306
|
+
output: output.trim(),
|
|
307
|
+
exitCode,
|
|
308
|
+
duration: Date.now() - startTime,
|
|
309
|
+
harness: "agent-core",
|
|
310
|
+
streamed: streamChunkCount > 0,
|
|
311
|
+
streamChunkCount,
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
async function captureProcessOutput(run, onChunk) {
|
|
315
|
+
const originalStdoutWrite = process.stdout.write.bind(process.stdout);
|
|
316
|
+
const originalStderrWrite = process.stderr.write.bind(process.stderr);
|
|
317
|
+
let output = "";
|
|
318
|
+
const makeCaptureWrite = (source) => (chunk, encodingOrCallback, callback) => {
|
|
319
|
+
const text = Buffer.isBuffer(chunk)
|
|
320
|
+
? chunk.toString(typeof encodingOrCallback === "string" ? encodingOrCallback : "utf8")
|
|
321
|
+
: String(chunk);
|
|
322
|
+
output += text;
|
|
323
|
+
onChunk?.(text, source);
|
|
324
|
+
if (typeof encodingOrCallback === "function") {
|
|
325
|
+
encodingOrCallback();
|
|
326
|
+
}
|
|
327
|
+
else if (typeof callback === "function") {
|
|
328
|
+
callback();
|
|
329
|
+
}
|
|
330
|
+
return true;
|
|
331
|
+
};
|
|
332
|
+
process.stdout.write = makeCaptureWrite("stdout");
|
|
333
|
+
process.stderr.write = makeCaptureWrite("stderr");
|
|
334
|
+
try {
|
|
335
|
+
return { result: await run(), output };
|
|
336
|
+
}
|
|
337
|
+
finally {
|
|
338
|
+
process.stdout.write = originalStdoutWrite;
|
|
339
|
+
process.stderr.write = originalStderrWrite;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GAP-TOOLS-012: LSP Integration for Code-Aware Routing.
|
|
3
|
+
*
|
|
4
|
+
* Provides types and utilities for resolving language-server symbols
|
|
5
|
+
* and injecting them as context into prompts for model routing.
|
|
6
|
+
*/
|
|
7
|
+
export interface LspServerConfig {
|
|
8
|
+
/** Language identifier (e.g. "typescript", "python"). */
|
|
9
|
+
languageId: string;
|
|
10
|
+
/** Command to spawn the LSP server. */
|
|
11
|
+
command: string;
|
|
12
|
+
/** Arguments passed to the command. */
|
|
13
|
+
args: string[];
|
|
14
|
+
/** Root URI of the workspace (file:// scheme). */
|
|
15
|
+
rootUri: string;
|
|
16
|
+
}
|
|
17
|
+
export type LspSymbolKind = 'function' | 'class' | 'variable' | 'type';
|
|
18
|
+
export interface LspSymbolInfo {
|
|
19
|
+
/** Symbol name. */
|
|
20
|
+
name: string;
|
|
21
|
+
/** Symbol kind. */
|
|
22
|
+
kind: LspSymbolKind;
|
|
23
|
+
/** Source location. */
|
|
24
|
+
location: {
|
|
25
|
+
file: string;
|
|
26
|
+
line: number;
|
|
27
|
+
col: number;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface LspRouteHint {
|
|
31
|
+
/** The symbol this hint relates to. */
|
|
32
|
+
symbol: LspSymbolInfo;
|
|
33
|
+
/** Files that are relevant to this symbol. */
|
|
34
|
+
relevantFiles: string[];
|
|
35
|
+
/** Optional model suggestion for routing. */
|
|
36
|
+
suggestedModel?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Match prompt keywords against known symbols.
|
|
40
|
+
* Returns symbols whose name appears as a word boundary match in the prompt.
|
|
41
|
+
*/
|
|
42
|
+
export declare function resolveSymbolsForPrompt(symbols: LspSymbolInfo[], prompt: string): LspSymbolInfo[];
|
|
43
|
+
/**
|
|
44
|
+
* Render symbol information as a human-readable context block
|
|
45
|
+
* suitable for injection into a system or user prompt.
|
|
46
|
+
*/
|
|
47
|
+
export declare function formatSymbolContext(symbols: LspSymbolInfo[]): string;
|
|
48
|
+
//# sourceMappingURL=lspIntegration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lspIntegration.d.ts","sourceRoot":"","sources":["../../src/harness/lspIntegration.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;AAEvE,MAAM,WAAW,aAAa;IAC5B,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,IAAI,EAAE,aAAa,CAAC;IACpB,uBAAuB;IACvB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,MAAM,WAAW,YAAY;IAC3B,uCAAuC;IACvC,MAAM,EAAE,aAAa,CAAC;IACtB,8CAA8C;IAC9C,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAMD;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,aAAa,EAAE,EACxB,MAAM,EAAE,MAAM,GACb,aAAa,EAAE,CAOjB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,MAAM,CASpE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* GAP-TOOLS-012: LSP Integration for Code-Aware Routing.
|
|
4
|
+
*
|
|
5
|
+
* Provides types and utilities for resolving language-server symbols
|
|
6
|
+
* and injecting them as context into prompts for model routing.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.resolveSymbolsForPrompt = resolveSymbolsForPrompt;
|
|
10
|
+
exports.formatSymbolContext = formatSymbolContext;
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Functions
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
/**
|
|
15
|
+
* Match prompt keywords against known symbols.
|
|
16
|
+
* Returns symbols whose name appears as a word boundary match in the prompt.
|
|
17
|
+
*/
|
|
18
|
+
function resolveSymbolsForPrompt(symbols, prompt) {
|
|
19
|
+
if (!prompt.trim())
|
|
20
|
+
return [];
|
|
21
|
+
const lowerPrompt = prompt.toLowerCase();
|
|
22
|
+
return symbols.filter((sym) => {
|
|
23
|
+
const pattern = new RegExp(`\\b${escapeRegExp(sym.name)}\\b`, 'i');
|
|
24
|
+
return pattern.test(lowerPrompt);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Render symbol information as a human-readable context block
|
|
29
|
+
* suitable for injection into a system or user prompt.
|
|
30
|
+
*/
|
|
31
|
+
function formatSymbolContext(symbols) {
|
|
32
|
+
if (symbols.length === 0)
|
|
33
|
+
return '';
|
|
34
|
+
const lines = symbols.map((sym) => {
|
|
35
|
+
const loc = `${sym.location.file}:${sym.location.line}:${sym.location.col}`;
|
|
36
|
+
return `- ${sym.kind} \`${sym.name}\` at ${loc}`;
|
|
37
|
+
});
|
|
38
|
+
return `## Relevant Symbols\n\n${lines.join('\n')}`;
|
|
39
|
+
}
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
// Helpers
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
function escapeRegExp(str) {
|
|
44
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
45
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GAP-UX-014: Operator Mode Selection
|
|
3
|
+
*
|
|
4
|
+
* In-session mode switching between orchestration modes without
|
|
5
|
+
* restarting the run. Affects prompt personality, breakpoint
|
|
6
|
+
* frequency, and parallelism configuration.
|
|
7
|
+
*/
|
|
8
|
+
/** Available orchestration modes. */
|
|
9
|
+
export type OrchestrationMode = "interactive" | "autonomous" | "plan" | "fast";
|
|
10
|
+
/** Mode configuration that affects runtime behavior. */
|
|
11
|
+
export interface ModeConfig {
|
|
12
|
+
/** Mode identifier. */
|
|
13
|
+
mode: OrchestrationMode;
|
|
14
|
+
/** Human-readable label. */
|
|
15
|
+
label: string;
|
|
16
|
+
/** Description of this mode's behavior. */
|
|
17
|
+
description: string;
|
|
18
|
+
/** Whether breakpoints require human approval. */
|
|
19
|
+
breakpointApproval: "always" | "auto" | "never";
|
|
20
|
+
/** Whether to show plan before execution. */
|
|
21
|
+
showPlan: boolean;
|
|
22
|
+
/** Whether to parallelize independent effects. */
|
|
23
|
+
parallelism: boolean;
|
|
24
|
+
/** Output verbosity level. */
|
|
25
|
+
verbosity: "minimal" | "normal" | "verbose";
|
|
26
|
+
}
|
|
27
|
+
/** Get the current active mode. */
|
|
28
|
+
export declare function getActiveMode(): OrchestrationMode;
|
|
29
|
+
/** Get the configuration for the active mode. */
|
|
30
|
+
export declare function getActiveModeConfig(): ModeConfig;
|
|
31
|
+
/** Switch to a different orchestration mode. Returns the new mode config. */
|
|
32
|
+
export declare function switchMode(mode: OrchestrationMode): ModeConfig;
|
|
33
|
+
/** Get the configuration for a specific mode. */
|
|
34
|
+
export declare function getModeConfig(mode: OrchestrationMode): ModeConfig;
|
|
35
|
+
/** Get all available modes. */
|
|
36
|
+
export declare function getAvailableModes(): ModeConfig[];
|
|
37
|
+
/** Reset mode to default (interactive). Exported for test isolation. */
|
|
38
|
+
export declare function resetMode(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Check if the current mode skips interactive breakpoint prompts.
|
|
41
|
+
* Returns true for "auto" (auto-approve based on rules) but NOT for "always" (always prompt).
|
|
42
|
+
*/
|
|
43
|
+
export declare function shouldAutoApprove(): boolean;
|
|
44
|
+
/** Check if the current mode wants to show plans before execution. */
|
|
45
|
+
export declare function shouldShowPlan(): boolean;
|
|
46
|
+
/** Check if parallel execution is enabled in the current mode. */
|
|
47
|
+
export declare function isParallelEnabled(): boolean;
|
|
48
|
+
/** Format mode information for display. */
|
|
49
|
+
export declare function formatModeInfo(mode?: OrchestrationMode): string;
|
|
50
|
+
//# sourceMappingURL=modeSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modeSelector.d.ts","sourceRoot":"","sources":["../../src/harness/modeSelector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,qCAAqC;AACrC,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAE/E,wDAAwD;AACxD,MAAM,WAAW,UAAU;IACzB,uBAAuB;IACvB,IAAI,EAAE,iBAAiB,CAAC;IACxB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,kBAAkB,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAChD,6CAA6C;IAC7C,QAAQ,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,WAAW,EAAE,OAAO,CAAC;IACrB,8BAA8B;IAC9B,SAAS,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;CAC7C;AA2DD,mCAAmC;AACnC,wBAAgB,aAAa,IAAI,iBAAiB,CAEjD;AAED,iDAAiD;AACjD,wBAAgB,mBAAmB,IAAI,UAAU,CAEhD;AAED,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,IAAI,EAAE,iBAAiB,GAAG,UAAU,CAG9D;AAED,iDAAiD;AACjD,wBAAgB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,UAAU,CAEjE;AAED,+BAA+B;AAC/B,wBAAgB,iBAAiB,IAAI,UAAU,EAAE,CAEhD;AAED,wEAAwE;AACxE,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED,sEAAsE;AACtE,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED,kEAAkE;AAClE,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED,2CAA2C;AAC3C,wBAAgB,cAAc,CAAC,IAAI,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAU/D"}
|