@a5c-ai/babysitter-sdk 5.0.0 → 5.0.1-staging.04a3db697
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/dist/breakpoints/evaluator.d.ts +33 -0
- package/dist/breakpoints/evaluator.d.ts.map +1 -0
- package/dist/breakpoints/evaluator.js +156 -0
- package/dist/breakpoints/index.d.ts +9 -0
- package/dist/breakpoints/index.d.ts.map +1 -0
- package/dist/breakpoints/index.js +19 -0
- package/dist/breakpoints/patterns.d.ts +24 -0
- package/dist/breakpoints/patterns.d.ts.map +1 -0
- package/dist/breakpoints/patterns.js +88 -0
- package/dist/breakpoints/proven-verification.d.ts +51 -0
- package/dist/breakpoints/proven-verification.d.ts.map +1 -0
- package/dist/breakpoints/proven-verification.js +120 -0
- package/dist/breakpoints/rules.d.ts +26 -0
- package/dist/breakpoints/rules.d.ts.map +1 -0
- package/dist/breakpoints/rules.js +110 -0
- package/dist/breakpoints/types.d.ts +78 -0
- package/dist/breakpoints/types.d.ts.map +1 -0
- package/dist/breakpoints/types.js +7 -0
- package/dist/cli/commands/breakpointRules.d.ts +26 -0
- package/dist/cli/commands/breakpointRules.d.ts.map +1 -0
- package/dist/cli/commands/breakpointRules.js +222 -0
- package/dist/cli/commands/compressOutput.d.ts +24 -0
- package/dist/cli/commands/compressOutput.d.ts.map +1 -0
- package/dist/cli/commands/compressOutput.js +85 -0
- package/dist/cli/commands/compressOutputHelpers.d.ts +15 -0
- package/dist/cli/commands/compressOutputHelpers.d.ts.map +1 -0
- package/dist/cli/commands/compressOutputHelpers.js +367 -0
- package/dist/cli/commands/compression/reset.d.ts +15 -0
- package/dist/cli/commands/compression/reset.d.ts.map +1 -0
- package/dist/cli/commands/compression/reset.js +87 -0
- package/dist/cli/commands/compression/set.d.ts +26 -0
- package/dist/cli/commands/compression/set.d.ts.map +1 -0
- package/dist/cli/commands/compression/set.js +179 -0
- package/dist/cli/commands/compression/status.d.ts +12 -0
- package/dist/cli/commands/compression/status.d.ts.map +1 -0
- package/dist/cli/commands/compression/status.js +133 -0
- package/dist/cli/commands/compression/toggle.d.ts +17 -0
- package/dist/cli/commands/compression/toggle.d.ts.map +1 -0
- package/dist/cli/commands/compression/toggle.js +115 -0
- package/dist/cli/commands/configure/output.d.ts +6 -0
- package/dist/cli/commands/configure/output.d.ts.map +1 -0
- package/dist/cli/commands/configure/output.js +164 -0
- package/dist/cli/commands/configure.d.ts +124 -0
- package/dist/cli/commands/configure.d.ts.map +1 -0
- package/dist/cli/commands/configure.js +300 -0
- package/dist/cli/commands/costStats.d.ts +13 -0
- package/dist/cli/commands/costStats.d.ts.map +1 -0
- package/dist/cli/commands/costStats.js +327 -0
- package/dist/cli/commands/detectExistingRun.d.ts +14 -0
- package/dist/cli/commands/detectExistingRun.d.ts.map +1 -0
- package/dist/cli/commands/detectExistingRun.js +89 -0
- package/dist/cli/commands/harness/install.d.ts +17 -0
- package/dist/cli/commands/harness/install.d.ts.map +1 -0
- package/dist/cli/commands/harness/install.js +83 -0
- package/dist/cli/commands/health/checks.d.ts +10 -0
- package/dist/cli/commands/health/checks.d.ts.map +1 -0
- package/dist/cli/commands/health/checks.js +268 -0
- package/dist/cli/commands/health/environment.d.ts +3 -0
- package/dist/cli/commands/health/environment.d.ts.map +1 -0
- package/dist/cli/commands/health/environment.js +89 -0
- package/dist/cli/commands/health/output.d.ts +5 -0
- package/dist/cli/commands/health/output.d.ts.map +1 -0
- package/dist/cli/commands/health/output.js +92 -0
- package/dist/cli/commands/health.d.ts +74 -0
- package/dist/cli/commands/health.d.ts.map +1 -0
- package/dist/cli/commands/health.js +92 -0
- package/dist/cli/commands/hooks/log.d.ts +15 -0
- package/dist/cli/commands/hooks/log.d.ts.map +1 -0
- package/dist/cli/commands/hooks/log.js +298 -0
- package/dist/cli/commands/hooks/run.d.ts +25 -0
- package/dist/cli/commands/hooks/run.d.ts.map +1 -0
- package/dist/cli/commands/hooks/run.js +234 -0
- package/dist/cli/commands/instructions.d.ts +20 -0
- package/dist/cli/commands/instructions.d.ts.map +1 -0
- package/dist/cli/commands/instructions.js +292 -0
- package/dist/cli/commands/log.d.ts +22 -0
- package/dist/cli/commands/log.d.ts.map +1 -0
- package/dist/cli/commands/log.js +99 -0
- package/dist/cli/commands/mcpServe.d.ts +11 -0
- package/dist/cli/commands/mcpServe.d.ts.map +1 -0
- package/dist/cli/commands/mcpServe.js +35 -0
- package/dist/cli/commands/plugin/marketplaceCommands.d.ts +5 -0
- package/dist/cli/commands/plugin/marketplaceCommands.d.ts.map +1 -0
- package/dist/cli/commands/plugin/marketplaceCommands.js +114 -0
- package/dist/cli/commands/plugin/packageCommands.d.ts +6 -0
- package/dist/cli/commands/plugin/packageCommands.d.ts.map +1 -0
- package/dist/cli/commands/plugin/packageCommands.js +270 -0
- package/dist/cli/commands/plugin/registryCommands.d.ts +5 -0
- package/dist/cli/commands/plugin/registryCommands.d.ts.map +1 -0
- package/dist/cli/commands/plugin/registryCommands.js +128 -0
- package/dist/cli/commands/plugin/shared.d.ts +20 -0
- package/dist/cli/commands/plugin/shared.d.ts.map +1 -0
- package/dist/cli/commands/plugin/shared.js +44 -0
- package/dist/cli/commands/plugin.d.ts +9 -0
- package/dist/cli/commands/plugin.d.ts.map +1 -0
- package/dist/cli/commands/plugin.js +22 -0
- package/dist/cli/commands/processLibrary.d.ts +16 -0
- package/dist/cli/commands/processLibrary.d.ts.map +1 -0
- package/dist/cli/commands/processLibrary.js +156 -0
- package/dist/cli/commands/profile.d.ts +26 -0
- package/dist/cli/commands/profile.d.ts.map +1 -0
- package/dist/cli/commands/profile.js +213 -0
- package/dist/cli/commands/runIterate.d.ts +49 -0
- package/dist/cli/commands/runIterate.d.ts.map +1 -0
- package/dist/cli/commands/runIterate.js +156 -0
- package/dist/cli/commands/runIterateHelpers.d.ts +29 -0
- package/dist/cli/commands/runIterateHelpers.d.ts.map +1 -0
- package/dist/cli/commands/runIterateHelpers.js +134 -0
- package/dist/cli/commands/session/associate.d.ts +10 -0
- package/dist/cli/commands/session/associate.d.ts.map +1 -0
- package/dist/cli/commands/session/associate.js +77 -0
- package/dist/cli/commands/session/checkIteration.d.ts +7 -0
- package/dist/cli/commands/session/checkIteration.d.ts.map +1 -0
- package/dist/cli/commands/session/checkIteration.js +76 -0
- package/dist/cli/commands/session/cleanup.d.ts +5 -0
- package/dist/cli/commands/session/cleanup.d.ts.map +1 -0
- package/dist/cli/commands/session/cleanup.js +20 -0
- package/dist/cli/commands/session/common.d.ts +16 -0
- package/dist/cli/commands/session/common.d.ts.map +1 -0
- package/dist/cli/commands/session/common.js +33 -0
- package/dist/cli/commands/session/init.d.ts +10 -0
- package/dist/cli/commands/session/init.d.ts.map +1 -0
- package/dist/cli/commands/session/init.js +76 -0
- package/dist/cli/commands/session/iterationMessage.d.ts +17 -0
- package/dist/cli/commands/session/iterationMessage.d.ts.map +1 -0
- package/dist/cli/commands/session/iterationMessage.js +106 -0
- package/dist/cli/commands/session/lastMessage.d.ts +13 -0
- package/dist/cli/commands/session/lastMessage.d.ts.map +1 -0
- package/dist/cli/commands/session/lastMessage.js +45 -0
- package/dist/cli/commands/session/resume.d.ts +10 -0
- package/dist/cli/commands/session/resume.d.ts.map +1 -0
- package/dist/cli/commands/session/resume.js +129 -0
- package/dist/cli/commands/session/state.d.ts +7 -0
- package/dist/cli/commands/session/state.d.ts.map +1 -0
- package/dist/cli/commands/session/state.js +49 -0
- package/dist/cli/commands/session/update.d.ts +10 -0
- package/dist/cli/commands/session/update.d.ts.map +1 -0
- package/dist/cli/commands/session/update.js +54 -0
- package/dist/cli/commands/session/whoami.d.ts +5 -0
- package/dist/cli/commands/session/whoami.d.ts.map +1 -0
- package/dist/cli/commands/session/whoami.js +22 -0
- package/dist/cli/commands/skill/discoveryLocal.d.ts +32 -0
- package/dist/cli/commands/skill/discoveryLocal.d.ts.map +1 -0
- package/dist/cli/commands/skill/discoveryLocal.js +383 -0
- package/dist/cli/commands/skill/processMarkers.d.ts +9 -0
- package/dist/cli/commands/skill/processMarkers.d.ts.map +1 -0
- package/dist/cli/commands/skill/processMarkers.js +104 -0
- package/dist/cli/commands/skill/remoteDiscovery.d.ts +4 -0
- package/dist/cli/commands/skill/remoteDiscovery.d.ts.map +1 -0
- package/dist/cli/commands/skill/remoteDiscovery.js +164 -0
- package/dist/cli/commands/skill/types.d.ts +69 -0
- package/dist/cli/commands/skill/types.d.ts.map +1 -0
- package/dist/cli/commands/skill/types.js +2 -0
- package/dist/cli/commands/skill.d.ts +20 -0
- package/dist/cli/commands/skill.d.ts.map +1 -0
- package/dist/cli/commands/skill.js +292 -0
- package/dist/cli/commands/tokensStats.d.ts +70 -0
- package/dist/cli/commands/tokensStats.d.ts.map +1 -0
- package/dist/cli/commands/tokensStats.js +238 -0
- package/dist/cli/commands/tokensStatsFormatting.d.ts +9 -0
- package/dist/cli/commands/tokensStatsFormatting.d.ts.map +1 -0
- package/dist/cli/commands/tokensStatsFormatting.js +137 -0
- package/dist/cli/completionProof.d.ts +4 -0
- package/dist/cli/completionProof.d.ts.map +1 -0
- package/dist/cli/completionProof.js +45 -0
- package/dist/cli/main/argFlagParsers.d.ts +9 -0
- package/dist/cli/main/argFlagParsers.d.ts.map +1 -0
- package/dist/cli/main/argFlagParsers.js +346 -0
- package/dist/cli/main/argFlags.d.ts +4 -0
- package/dist/cli/main/argFlags.d.ts.map +1 -0
- package/dist/cli/main/argFlags.js +77 -0
- package/dist/cli/main/argPositionals.d.ts +3 -0
- package/dist/cli/main/argPositionals.d.ts.map +1 -0
- package/dist/cli/main/argPositionals.js +87 -0
- package/dist/cli/main/args.d.ts +7 -0
- package/dist/cli/main/args.d.ts.map +1 -0
- package/dist/cli/main/args.js +120 -0
- package/dist/cli/main/dispatch.d.ts +5 -0
- package/dist/cli/main/dispatch.d.ts.map +1 -0
- package/dist/cli/main/dispatch.js +44 -0
- package/dist/cli/main/dispatchHarness.d.ts +3 -0
- package/dist/cli/main/dispatchHarness.d.ts.map +1 -0
- package/dist/cli/main/dispatchHarness.js +73 -0
- package/dist/cli/main/dispatchRunSession.d.ts +3 -0
- package/dist/cli/main/dispatchRunSession.d.ts.map +1 -0
- package/dist/cli/main/dispatchRunSession.js +316 -0
- package/dist/cli/main/program.d.ts +17 -0
- package/dist/cli/main/program.d.ts.map +1 -0
- package/dist/cli/main/program.js +94 -0
- package/dist/cli/main/runAssignProcess.d.ts +3 -0
- package/dist/cli/main/runAssignProcess.d.ts.map +1 -0
- package/dist/cli/main/runAssignProcess.js +169 -0
- package/dist/cli/main/runCommands.d.ts +4 -0
- package/dist/cli/main/runCommands.d.ts.map +1 -0
- package/dist/cli/main/runCommands.js +13 -0
- package/dist/cli/main/runCreate.d.ts +5 -0
- package/dist/cli/main/runCreate.d.ts.map +1 -0
- package/dist/cli/main/runCreate.js +382 -0
- package/dist/cli/main/runInspection.d.ts +5 -0
- package/dist/cli/main/runInspection.d.ts.map +1 -0
- package/dist/cli/main/runInspection.js +139 -0
- package/dist/cli/main/runState.d.ts +55 -0
- package/dist/cli/main/runState.d.ts.map +1 -0
- package/dist/cli/main/runState.js +226 -0
- package/dist/cli/main/runSupport.d.ts +49 -0
- package/dist/cli/main/runSupport.d.ts.map +1 -0
- package/dist/cli/main/runSupport.js +364 -0
- package/dist/cli/main/taskCommands.d.ts +6 -0
- package/dist/cli/main/taskCommands.d.ts.map +1 -0
- package/dist/cli/main/taskCommands.js +356 -0
- package/dist/cli/main/types.d.ts +120 -0
- package/dist/cli/main/types.d.ts.map +1 -0
- package/dist/cli/main/types.js +2 -0
- package/dist/cli/main/ui.d.ts +12 -0
- package/dist/cli/main/ui.d.ts.map +1 -0
- package/dist/cli/main/ui.js +177 -0
- package/dist/cli/main/usage.d.ts +7 -0
- package/dist/cli/main/usage.d.ts.map +1 -0
- package/dist/cli/main/usage.js +154 -0
- package/dist/cli/main.d.ts +13 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +50 -0
- package/dist/cli/mcpServeEntry.d.ts +3 -0
- package/dist/cli/mcpServeEntry.d.ts.map +1 -0
- package/dist/cli/mcpServeEntry.js +8 -0
- package/dist/cli/render/ansi.d.ts +12 -0
- package/dist/cli/render/ansi.d.ts.map +1 -0
- package/dist/cli/render/ansi.js +24 -0
- package/dist/cli/render/effectTree.d.ts +17 -0
- package/dist/cli/render/effectTree.d.ts.map +1 -0
- package/dist/cli/render/effectTree.js +46 -0
- package/dist/cli/render/events/effectRequested.d.ts +3 -0
- package/dist/cli/render/events/effectRequested.d.ts.map +1 -0
- package/dist/cli/render/events/effectRequested.js +22 -0
- package/dist/cli/render/events/effectResolved.d.ts +3 -0
- package/dist/cli/render/events/effectResolved.d.ts.map +1 -0
- package/dist/cli/render/events/effectResolved.js +20 -0
- package/dist/cli/render/events/index.d.ts +4 -0
- package/dist/cli/render/events/index.d.ts.map +1 -0
- package/dist/cli/render/events/index.js +25 -0
- package/dist/cli/render/events/processAssigned.d.ts +3 -0
- package/dist/cli/render/events/processAssigned.d.ts.map +1 -0
- package/dist/cli/render/events/processAssigned.js +22 -0
- package/dist/cli/render/events/runCompleted.d.ts +3 -0
- package/dist/cli/render/events/runCompleted.d.ts.map +1 -0
- package/dist/cli/render/events/runCompleted.js +18 -0
- package/dist/cli/render/events/runCreated.d.ts +3 -0
- package/dist/cli/render/events/runCreated.d.ts.map +1 -0
- package/dist/cli/render/events/runCreated.js +19 -0
- package/dist/cli/render/events/runFailed.d.ts +3 -0
- package/dist/cli/render/events/runFailed.d.ts.map +1 -0
- package/dist/cli/render/events/runFailed.js +23 -0
- package/dist/cli/render/events/types.d.ts +6 -0
- package/dist/cli/render/events/types.d.ts.map +1 -0
- package/dist/cli/render/events/types.js +2 -0
- package/dist/cli/render/index.d.ts +5 -0
- package/dist/cli/render/index.d.ts.map +1 -0
- package/dist/cli/render/index.js +14 -0
- package/dist/cli/render/statusBadge.d.ts +4 -0
- package/dist/cli/render/statusBadge.d.ts.map +1 -0
- package/dist/cli/render/statusBadge.js +25 -0
- package/dist/cli/resolveInputPath.d.ts +61 -0
- package/dist/cli/resolveInputPath.d.ts.map +1 -0
- package/dist/cli/resolveInputPath.js +193 -0
- package/dist/compression/config-loader.d.ts +24 -0
- package/dist/compression/config-loader.d.ts.map +1 -0
- package/dist/compression/config-loader.js +179 -0
- package/dist/compression/config.d.ts +49 -0
- package/dist/compression/config.d.ts.map +1 -0
- package/dist/compression/config.js +41 -0
- package/dist/compression/density-filter.d.ts +20 -0
- package/dist/compression/density-filter.d.ts.map +1 -0
- package/dist/compression/density-filter.js +91 -0
- package/dist/compression/library-cache.d.ts +19 -0
- package/dist/compression/library-cache.d.ts.map +1 -0
- package/dist/compression/library-cache.js +149 -0
- package/dist/config/configValidation.d.ts +22 -0
- package/dist/config/configValidation.d.ts.map +1 -0
- package/dist/config/configValidation.js +140 -0
- package/dist/config/defaults.d.ts +67 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +132 -0
- package/dist/config/index.d.ts +26 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +51 -0
- package/dist/config/runs.d.ts +22 -0
- package/dist/config/runs.d.ts.map +1 -0
- package/dist/config/runs.js +192 -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/index.d.ts +18 -0
- package/dist/cost/index.d.ts.map +1 -0
- package/dist/cost/index.js +38 -0
- package/dist/cost/journal.d.ts +40 -0
- package/dist/cost/journal.d.ts.map +1 -0
- package/dist/cost/journal.js +137 -0
- package/dist/cost/pricing.d.ts +19 -0
- package/dist/cost/pricing.d.ts.map +1 -0
- package/dist/cost/pricing.js +135 -0
- package/dist/cost/types.d.ts +87 -0
- package/dist/cost/types.d.ts.map +1 -0
- package/dist/cost/types.js +19 -0
- package/dist/harness/BaseAdapter.d.ts +93 -0
- package/dist/harness/BaseAdapter.d.ts.map +1 -0
- package/dist/harness/BaseAdapter.js +236 -0
- package/dist/harness/adapters/claude-code.d.ts +24 -0
- package/dist/harness/adapters/claude-code.d.ts.map +1 -0
- package/dist/harness/adapters/claude-code.js +64 -0
- package/dist/harness/adapters/codex.d.ts +12 -0
- package/dist/harness/adapters/codex.d.ts.map +1 -0
- package/dist/harness/adapters/codex.js +37 -0
- package/dist/harness/adapters/cursor.d.ts +13 -0
- package/dist/harness/adapters/cursor.d.ts.map +1 -0
- package/dist/harness/adapters/cursor.js +85 -0
- package/dist/harness/adapters/gemini-cli.d.ts +12 -0
- package/dist/harness/adapters/gemini-cli.d.ts.map +1 -0
- package/dist/harness/adapters/gemini-cli.js +34 -0
- package/dist/harness/adapters/github-copilot.d.ts +13 -0
- package/dist/harness/adapters/github-copilot.d.ts.map +1 -0
- package/dist/harness/adapters/github-copilot.js +59 -0
- package/dist/harness/adapters/index.d.ts +12 -0
- package/dist/harness/adapters/index.d.ts.map +1 -0
- package/dist/harness/adapters/index.js +26 -0
- package/dist/harness/adapters/oh-my-pi.d.ts +12 -0
- package/dist/harness/adapters/oh-my-pi.d.ts.map +1 -0
- package/dist/harness/adapters/oh-my-pi.js +41 -0
- package/dist/harness/adapters/openclaw.d.ts +12 -0
- package/dist/harness/adapters/openclaw.d.ts.map +1 -0
- package/dist/harness/adapters/openclaw.js +49 -0
- package/dist/harness/adapters/opencode.d.ts +12 -0
- package/dist/harness/adapters/opencode.d.ts.map +1 -0
- package/dist/harness/adapters/opencode.js +51 -0
- package/dist/harness/adapters/pi.d.ts +12 -0
- package/dist/harness/adapters/pi.d.ts.map +1 -0
- package/dist/harness/adapters/pi.js +41 -0
- package/dist/harness/amuxFallbackMetadata.d.ts +3 -0
- package/dist/harness/amuxFallbackMetadata.d.ts.map +1 -0
- package/dist/harness/amuxFallbackMetadata.js +201 -0
- package/dist/harness/amuxMetadata.d.ts +51 -0
- package/dist/harness/amuxMetadata.d.ts.map +1 -0
- package/dist/harness/amuxMetadata.js +176 -0
- package/dist/harness/customAdapter.d.ts +14 -0
- package/dist/harness/customAdapter.d.ts.map +1 -0
- package/dist/harness/customAdapter.js +124 -0
- package/dist/harness/derivePromptContext.d.ts +75 -0
- package/dist/harness/derivePromptContext.d.ts.map +1 -0
- package/dist/harness/derivePromptContext.js +120 -0
- package/dist/harness/discovery.d.ts +80 -0
- package/dist/harness/discovery.d.ts.map +1 -0
- package/dist/harness/discovery.js +313 -0
- package/dist/harness/hooks/babysitterHooks.d.ts +23 -0
- package/dist/harness/hooks/babysitterHooks.d.ts.map +1 -0
- package/dist/harness/hooks/babysitterHooks.js +162 -0
- package/dist/harness/hooks/promptContexts.d.ts +24 -0
- package/dist/harness/hooks/promptContexts.d.ts.map +1 -0
- package/dist/harness/hooks/promptContexts.js +106 -0
- package/dist/harness/hooks/runState.d.ts +14 -0
- package/dist/harness/hooks/runState.d.ts.map +1 -0
- package/dist/harness/hooks/runState.js +103 -0
- package/dist/harness/hooks/sessionBinding.d.ts +28 -0
- package/dist/harness/hooks/sessionBinding.d.ts.map +1 -0
- package/dist/harness/hooks/sessionBinding.js +153 -0
- package/dist/harness/hooks/stopHookContinuation.d.ts +44 -0
- package/dist/harness/hooks/stopHookContinuation.d.ts.map +1 -0
- package/dist/harness/hooks/stopHookContinuation.js +280 -0
- package/dist/harness/hooks/stopHookHandler.d.ts +35 -0
- package/dist/harness/hooks/stopHookHandler.d.ts.map +1 -0
- package/dist/harness/hooks/stopHookHandler.js +354 -0
- package/dist/harness/hooks/utils.d.ts +43 -0
- package/dist/harness/hooks/utils.d.ts.map +1 -0
- package/dist/harness/hooks/utils.js +215 -0
- package/dist/harness/index.d.ts +20 -0
- package/dist/harness/index.d.ts.map +1 -0
- package/dist/harness/index.js +51 -0
- package/dist/harness/install.d.ts +71 -0
- package/dist/harness/install.d.ts.map +1 -0
- package/dist/harness/install.js +267 -0
- package/dist/harness/installSupport.d.ts +37 -0
- package/dist/harness/installSupport.d.ts.map +1 -0
- package/dist/harness/installSupport.js +203 -0
- package/dist/harness/internal/promptContext.d.ts +3 -0
- package/dist/harness/internal/promptContext.d.ts.map +1 -0
- package/dist/harness/internal/promptContext.js +29 -0
- package/dist/harness/nullAdapter.d.ts +9 -0
- package/dist/harness/nullAdapter.d.ts.map +1 -0
- package/dist/harness/nullAdapter.js +46 -0
- package/dist/harness/registry.d.ts +51 -0
- package/dist/harness/registry.d.ts.map +1 -0
- package/dist/harness/registry.js +235 -0
- package/dist/harness/types.d.ts +200 -0
- package/dist/harness/types.d.ts.map +1 -0
- package/dist/harness/types.js +34 -0
- package/dist/harness/unified/adapter.d.ts +21 -0
- package/dist/harness/unified/adapter.d.ts.map +1 -0
- package/dist/harness/unified/adapter.js +239 -0
- package/dist/harness/unified/capabilities.d.ts +37 -0
- package/dist/harness/unified/capabilities.d.ts.map +1 -0
- package/dist/harness/unified/capabilities.js +79 -0
- package/dist/harness/unified/discovery.d.ts +11 -0
- package/dist/harness/unified/discovery.d.ts.map +1 -0
- package/dist/harness/unified/discovery.js +23 -0
- package/dist/harness/unified/index.d.ts +6 -0
- package/dist/harness/unified/index.d.ts.map +1 -0
- package/dist/harness/unified/index.js +16 -0
- package/dist/harness/unified/promptContext.d.ts +16 -0
- package/dist/harness/unified/promptContext.d.ts.map +1 -0
- package/dist/harness/unified/promptContext.js +56 -0
- package/dist/harness/unified/subprocess.d.ts +57 -0
- package/dist/harness/unified/subprocess.d.ts.map +1 -0
- package/dist/harness/unified/subprocess.js +121 -0
- package/dist/hooks/dispatcher.d.ts +29 -0
- package/dist/hooks/dispatcher.d.ts.map +1 -0
- package/dist/hooks/dispatcher.js +337 -0
- package/dist/hooks/index.d.ts +16 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +20 -0
- package/dist/hooks/types.d.ts +170 -0
- package/dist/hooks/types.d.ts.map +1 -0
- package/dist/hooks/types.js +6 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +76 -0
- package/dist/logging/index.d.ts +3 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +11 -0
- package/dist/logging/runLogger.d.ts +85 -0
- package/dist/logging/runLogger.d.ts.map +1 -0
- package/dist/logging/runLogger.js +182 -0
- package/dist/mcp/index.d.ts +7 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +53 -0
- package/dist/mcp/server.d.ts +3 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +21 -0
- package/dist/mcp/tools/discovery.d.ts +3 -0
- package/dist/mcp/tools/discovery.d.ts.map +1 -0
- package/dist/mcp/tools/discovery.js +117 -0
- package/dist/mcp/tools/runs.d.ts +3 -0
- package/dist/mcp/tools/runs.d.ts.map +1 -0
- package/dist/mcp/tools/runs.js +289 -0
- package/dist/mcp/tools/sessions.d.ts +3 -0
- package/dist/mcp/tools/sessions.d.ts.map +1 -0
- package/dist/mcp/tools/sessions.js +216 -0
- package/dist/mcp/tools/tasks.d.ts +3 -0
- package/dist/mcp/tools/tasks.d.ts.map +1 -0
- package/dist/mcp/tools/tasks.js +230 -0
- package/dist/mcp/transport/index.d.ts +1 -0
- package/dist/mcp/transport/index.d.ts.map +1 -0
- package/dist/mcp/transport/index.js +2 -0
- package/dist/mcp/util/errors.d.ts +14 -0
- package/dist/mcp/util/errors.d.ts.map +1 -0
- package/dist/mcp/util/errors.js +10 -0
- package/dist/mcp/util/resolve-run-dir.d.ts +6 -0
- package/dist/mcp/util/resolve-run-dir.d.ts.map +1 -0
- package/dist/mcp/util/resolve-run-dir.js +11 -0
- package/dist/plugins/index.d.ts +14 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +51 -0
- package/dist/plugins/marketplace.d.ts +36 -0
- package/dist/plugins/marketplace.d.ts.map +1 -0
- package/dist/plugins/marketplace.js +162 -0
- package/dist/plugins/marketplaceHelpers.d.ts +15 -0
- package/dist/plugins/marketplaceHelpers.d.ts.map +1 -0
- package/dist/plugins/marketplaceHelpers.js +114 -0
- package/dist/plugins/migrations.d.ts +52 -0
- package/dist/plugins/migrations.d.ts.map +1 -0
- package/dist/plugins/migrations.js +151 -0
- package/dist/plugins/packageReader.d.ts +47 -0
- package/dist/plugins/packageReader.d.ts.map +1 -0
- package/dist/plugins/packageReader.js +153 -0
- package/dist/plugins/paths.d.ts +30 -0
- package/dist/plugins/paths.d.ts.map +1 -0
- package/dist/plugins/paths.js +69 -0
- package/dist/plugins/registry.d.ts +54 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/registry.js +116 -0
- package/dist/plugins/types.d.ts +133 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +35 -0
- package/dist/processLibrary/active.d.ts +17 -0
- package/dist/processLibrary/active.d.ts.map +1 -0
- package/dist/processLibrary/active.js +216 -0
- package/dist/processLibrary/activeTypes.d.ts +82 -0
- package/dist/processLibrary/activeTypes.d.ts.map +1 -0
- package/dist/processLibrary/activeTypes.js +6 -0
- package/dist/profiles/index.d.ts +25 -0
- package/dist/profiles/index.d.ts.map +1 -0
- package/dist/profiles/index.js +40 -0
- package/dist/profiles/projectProfile.d.ts +67 -0
- package/dist/profiles/projectProfile.d.ts.map +1 -0
- package/dist/profiles/projectProfile.js +169 -0
- package/dist/profiles/projectProfileMerge.d.ts +3 -0
- package/dist/profiles/projectProfileMerge.d.ts.map +1 -0
- package/dist/profiles/projectProfileMerge.js +175 -0
- package/dist/profiles/projectProfileRender.d.ts +3 -0
- package/dist/profiles/projectProfileRender.d.ts.map +1 -0
- package/dist/profiles/projectProfileRender.js +275 -0
- package/dist/profiles/projectTypes.d.ts +149 -0
- package/dist/profiles/projectTypes.d.ts.map +1 -0
- package/dist/profiles/projectTypes.js +6 -0
- package/dist/profiles/types.d.ts +5 -0
- package/dist/profiles/types.d.ts.map +1 -0
- package/dist/profiles/types.js +11 -0
- package/dist/profiles/userProfile.d.ts +67 -0
- package/dist/profiles/userProfile.d.ts.map +1 -0
- package/dist/profiles/userProfile.js +351 -0
- package/dist/profiles/userProfileRender.d.ts +3 -0
- package/dist/profiles/userProfileRender.d.ts.map +1 -0
- package/dist/profiles/userProfileRender.js +188 -0
- package/dist/profiles/userTypes.d.ts +119 -0
- package/dist/profiles/userTypes.d.ts.map +1 -0
- package/dist/profiles/userTypes.js +6 -0
- package/dist/prompts/babysitterMdDiscovery.d.ts +38 -0
- package/dist/prompts/babysitterMdDiscovery.d.ts.map +1 -0
- package/dist/prompts/babysitterMdDiscovery.js +150 -0
- package/dist/prompts/capabilityCollector.d.ts +48 -0
- package/dist/prompts/capabilityCollector.d.ts.map +1 -0
- package/dist/prompts/capabilityCollector.js +126 -0
- package/dist/prompts/capabilityProcessMap.d.ts +33 -0
- package/dist/prompts/capabilityProcessMap.d.ts.map +1 -0
- package/dist/prompts/capabilityProcessMap.js +105 -0
- package/dist/prompts/commandTemplates.d.ts +4 -0
- package/dist/prompts/commandTemplates.d.ts.map +1 -0
- package/dist/prompts/commandTemplates.js +32 -0
- package/dist/prompts/compose.d.ts +28 -0
- package/dist/prompts/compose.d.ts.map +1 -0
- package/dist/prompts/compose.js +197 -0
- package/dist/prompts/context.d.ts +8 -0
- package/dist/prompts/context.d.ts.map +1 -0
- package/dist/prompts/context.js +13 -0
- package/dist/prompts/contextDetect.d.ts +64 -0
- package/dist/prompts/contextDetect.d.ts.map +1 -0
- package/dist/prompts/contextDetect.js +122 -0
- package/dist/prompts/contextShared.d.ts +6 -0
- package/dist/prompts/contextShared.d.ts.map +1 -0
- package/dist/prompts/contextShared.js +63 -0
- package/dist/prompts/continuityOverlay.d.ts +35 -0
- package/dist/prompts/continuityOverlay.d.ts.map +1 -0
- package/dist/prompts/continuityOverlay.js +210 -0
- package/dist/prompts/index.d.ts +23 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +88 -0
- package/dist/prompts/parts/breakpointHandling.d.ts +8 -0
- package/dist/prompts/parts/breakpointHandling.d.ts.map +1 -0
- package/dist/prompts/parts/breakpointHandling.js +12 -0
- package/dist/prompts/parts/codingPhilosophy.d.ts +7 -0
- package/dist/prompts/parts/codingPhilosophy.d.ts.map +1 -0
- package/dist/prompts/parts/codingPhilosophy.js +11 -0
- package/dist/prompts/parts/completionProof.d.ts +6 -0
- package/dist/prompts/parts/completionProof.d.ts.map +1 -0
- package/dist/prompts/parts/completionProof.js +10 -0
- package/dist/prompts/parts/continuityOverlay.d.ts +2 -0
- package/dist/prompts/parts/continuityOverlay.d.ts.map +1 -0
- package/dist/prompts/parts/continuityOverlay.js +5 -0
- package/dist/prompts/parts/criticalRules.d.ts +7 -0
- package/dist/prompts/parts/criticalRules.d.ts.map +1 -0
- package/dist/prompts/parts/criticalRules.js +29 -0
- package/dist/prompts/parts/dependencies.d.ts +6 -0
- package/dist/prompts/parts/dependencies.d.ts.map +1 -0
- package/dist/prompts/parts/dependencies.js +10 -0
- package/dist/prompts/parts/effects.d.ts +6 -0
- package/dist/prompts/parts/effects.d.ts.map +1 -0
- package/dist/prompts/parts/effects.js +10 -0
- package/dist/prompts/parts/gitSafety.d.ts +7 -0
- package/dist/prompts/parts/gitSafety.d.ts.map +1 -0
- package/dist/prompts/parts/gitSafety.js +11 -0
- package/dist/prompts/parts/index.d.ts +37 -0
- package/dist/prompts/parts/index.d.ts.map +1 -0
- package/dist/prompts/parts/index.js +70 -0
- package/dist/prompts/parts/intentFidelityChecks.d.ts +7 -0
- package/dist/prompts/parts/intentFidelityChecks.d.ts.map +1 -0
- package/dist/prompts/parts/intentFidelityChecks.js +14 -0
- package/dist/prompts/parts/interview.d.ts +6 -0
- package/dist/prompts/parts/interview.d.ts.map +1 -0
- package/dist/prompts/parts/interview.js +18 -0
- package/dist/prompts/parts/iteration.d.ts +6 -0
- package/dist/prompts/parts/iteration.d.ts.map +1 -0
- package/dist/prompts/parts/iteration.js +15 -0
- package/dist/prompts/parts/loopControl.d.ts +11 -0
- package/dist/prompts/parts/loopControl.d.ts.map +1 -0
- package/dist/prompts/parts/loopControl.js +22 -0
- package/dist/prompts/parts/nonNegotiables.d.ts +7 -0
- package/dist/prompts/parts/nonNegotiables.d.ts.map +1 -0
- package/dist/prompts/parts/nonNegotiables.js +14 -0
- package/dist/prompts/parts/outputEfficiency.d.ts +7 -0
- package/dist/prompts/parts/outputEfficiency.d.ts.map +1 -0
- package/dist/prompts/parts/outputEfficiency.js +11 -0
- package/dist/prompts/parts/parallelDispatch.d.ts +15 -0
- package/dist/prompts/parts/parallelDispatch.d.ts.map +1 -0
- package/dist/prompts/parts/parallelDispatch.js +46 -0
- package/dist/prompts/parts/parallelPhaseDetection.d.ts +6 -0
- package/dist/prompts/parts/parallelPhaseDetection.d.ts.map +1 -0
- package/dist/prompts/parts/parallelPhaseDetection.js +10 -0
- package/dist/prompts/parts/priorityLadder.d.ts +7 -0
- package/dist/prompts/parts/priorityLadder.d.ts.map +1 -0
- package/dist/prompts/parts/priorityLadder.js +13 -0
- package/dist/prompts/parts/processCreation.d.ts +6 -0
- package/dist/prompts/parts/processCreation.d.ts.map +1 -0
- package/dist/prompts/parts/processCreation.js +10 -0
- package/dist/prompts/parts/processGuidelines.d.ts +7 -0
- package/dist/prompts/parts/processGuidelines.d.ts.map +1 -0
- package/dist/prompts/parts/processGuidelines.js +11 -0
- package/dist/prompts/parts/projectInstructions.d.ts +8 -0
- package/dist/prompts/parts/projectInstructions.d.ts.map +1 -0
- package/dist/prompts/parts/projectInstructions.js +28 -0
- package/dist/prompts/parts/quickReference.d.ts +6 -0
- package/dist/prompts/parts/quickReference.d.ts.map +1 -0
- package/dist/prompts/parts/quickReference.js +17 -0
- package/dist/prompts/parts/recovery.d.ts +7 -0
- package/dist/prompts/parts/recovery.d.ts.map +1 -0
- package/dist/prompts/parts/recovery.js +11 -0
- package/dist/prompts/parts/resultsPosting.d.ts +7 -0
- package/dist/prompts/parts/resultsPosting.d.ts.map +1 -0
- package/dist/prompts/parts/resultsPosting.js +11 -0
- package/dist/prompts/parts/rootCauseGuardrail.d.ts +7 -0
- package/dist/prompts/parts/rootCauseGuardrail.d.ts.map +1 -0
- package/dist/prompts/parts/rootCauseGuardrail.js +13 -0
- package/dist/prompts/parts/runCreation.d.ts +7 -0
- package/dist/prompts/parts/runCreation.d.ts.map +1 -0
- package/dist/prompts/parts/runCreation.js +61 -0
- package/dist/prompts/parts/runOverlapDetection.d.ts +6 -0
- package/dist/prompts/parts/runOverlapDetection.d.ts.map +1 -0
- package/dist/prompts/parts/runOverlapDetection.js +10 -0
- package/dist/prompts/parts/seeAlso.d.ts +7 -0
- package/dist/prompts/parts/seeAlso.d.ts.map +1 -0
- package/dist/prompts/parts/seeAlso.js +11 -0
- package/dist/prompts/parts/taskExamples.d.ts +7 -0
- package/dist/prompts/parts/taskExamples.d.ts.map +1 -0
- package/dist/prompts/parts/taskExamples.js +11 -0
- package/dist/prompts/parts/taskKinds.d.ts +6 -0
- package/dist/prompts/parts/taskKinds.d.ts.map +1 -0
- package/dist/prompts/parts/taskKinds.js +25 -0
- package/dist/prompts/parts/toolPreferences.d.ts +7 -0
- package/dist/prompts/parts/toolPreferences.d.ts.map +1 -0
- package/dist/prompts/parts/toolPreferences.js +11 -0
- package/dist/prompts/parts/userProfile.d.ts +7 -0
- package/dist/prompts/parts/userProfile.d.ts.map +1 -0
- package/dist/prompts/parts/userProfile.js +11 -0
- package/dist/prompts/runtimeContext.d.ts +30 -0
- package/dist/prompts/runtimeContext.d.ts.map +1 -0
- package/dist/prompts/runtimeContext.js +38 -0
- package/dist/prompts/strata.d.ts +60 -0
- package/dist/prompts/strata.d.ts.map +1 -0
- package/dist/prompts/strata.js +243 -0
- package/dist/prompts/templateRenderer.d.ts +18 -0
- package/dist/prompts/templateRenderer.d.ts.map +1 -0
- package/dist/prompts/templateRenderer.js +131 -0
- package/dist/prompts/templates/breakpoint-handling.md +137 -0
- package/dist/prompts/templates/coding-philosophy.md +12 -0
- package/dist/prompts/templates/commands/assimilate.md +47 -0
- package/dist/prompts/templates/commands/cleanup.md +54 -0
- package/dist/prompts/templates/commands/contrib.md +40 -0
- package/dist/prompts/templates/commands/doctor.md +511 -0
- package/dist/prompts/templates/commands/forever.md +11 -0
- package/dist/prompts/templates/commands/project-install.md +25 -0
- package/dist/prompts/templates/commands/retrospect.md +68 -0
- package/dist/prompts/templates/commands/user-install.md +24 -0
- package/dist/prompts/templates/completion-proof.md +21 -0
- package/dist/prompts/templates/critical-rules.md +73 -0
- package/dist/prompts/templates/dependencies.md +9 -0
- package/dist/prompts/templates/effects.md +46 -0
- package/dist/prompts/templates/git-safety.md +9 -0
- package/dist/prompts/templates/intent-fidelity-checks.md +31 -0
- package/dist/prompts/templates/interview.md +65 -0
- package/dist/prompts/templates/iteration.md +41 -0
- package/dist/prompts/templates/loop-control.md +64 -0
- package/dist/prompts/templates/non-negotiables.md +11 -0
- package/dist/prompts/templates/output-efficiency.md +12 -0
- package/dist/prompts/templates/parallel-phase-detection.md +59 -0
- package/dist/prompts/templates/priority-ladder.md +13 -0
- package/dist/prompts/templates/process-creation.md +130 -0
- package/dist/prompts/templates/process-guidelines.md +106 -0
- package/dist/prompts/templates/quick-reference.md +46 -0
- package/dist/prompts/templates/recovery.md +30 -0
- package/dist/prompts/templates/results-posting.md +69 -0
- package/dist/prompts/templates/root-cause-guardrail.md +14 -0
- package/dist/prompts/templates/run-creation.md +80 -0
- package/dist/prompts/templates/run-overlap-detection.md +65 -0
- package/dist/prompts/templates/see-also.md +4 -0
- package/dist/prompts/templates/task-examples.md +229 -0
- package/dist/prompts/templates/task-kinds.md +106 -0
- package/dist/prompts/templates/tool-preferences.md +8 -0
- package/dist/prompts/templates/user-profile.md +48 -0
- package/dist/prompts/types.d.ts +191 -0
- package/dist/prompts/types.d.ts.map +1 -0
- package/dist/prompts/types.js +7 -0
- package/dist/runtime/asyncEffects.d.ts +22 -0
- package/dist/runtime/asyncEffects.d.ts.map +1 -0
- package/dist/runtime/asyncEffects.js +86 -0
- package/dist/runtime/commitEffectResult.d.ts +12 -0
- package/dist/runtime/commitEffectResult.d.ts.map +1 -0
- package/dist/runtime/commitEffectResult.js +240 -0
- package/dist/runtime/constants.d.ts +2 -0
- package/dist/runtime/constants.d.ts.map +1 -0
- package/dist/runtime/constants.js +5 -0
- package/dist/runtime/createRun.d.ts +3 -0
- package/dist/runtime/createRun.d.ts.map +1 -0
- package/dist/runtime/createRun.js +142 -0
- package/dist/runtime/effectGroupRegistry.d.ts +57 -0
- package/dist/runtime/effectGroupRegistry.d.ts.map +1 -0
- package/dist/runtime/effectGroupRegistry.js +107 -0
- package/dist/runtime/errorSuggestions.d.ts +4 -0
- package/dist/runtime/errorSuggestions.d.ts.map +1 -0
- package/dist/runtime/errorSuggestions.js +98 -0
- package/dist/runtime/errorTemplates.d.ts +101 -0
- package/dist/runtime/errorTemplates.d.ts.map +1 -0
- package/dist/runtime/errorTemplates.js +173 -0
- package/dist/runtime/errorUtils.d.ts +10 -0
- package/dist/runtime/errorUtils.d.ts.map +1 -0
- package/dist/runtime/errorUtils.js +42 -0
- package/dist/runtime/exceptions.d.ts +73 -0
- package/dist/runtime/exceptions.d.ts.map +1 -0
- package/dist/runtime/exceptions.js +197 -0
- package/dist/runtime/hooks/runtime.d.ts +31 -0
- package/dist/runtime/hooks/runtime.d.ts.map +1 -0
- package/dist/runtime/hooks/runtime.js +67 -0
- package/dist/runtime/index.d.ts +18 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +61 -0
- package/dist/runtime/instrumentation.d.ts +6 -0
- package/dist/runtime/instrumentation.d.ts.map +1 -0
- package/dist/runtime/instrumentation.js +14 -0
- package/dist/runtime/intrinsics/breakpoint.d.ts +9 -0
- package/dist/runtime/intrinsics/breakpoint.d.ts.map +1 -0
- package/dist/runtime/intrinsics/breakpoint.js +108 -0
- package/dist/runtime/intrinsics/hook.d.ts +26 -0
- package/dist/runtime/intrinsics/hook.d.ts.map +1 -0
- package/dist/runtime/intrinsics/hook.js +45 -0
- package/dist/runtime/intrinsics/index.d.ts +7 -0
- package/dist/runtime/intrinsics/index.d.ts.map +1 -0
- package/dist/runtime/intrinsics/index.js +15 -0
- package/dist/runtime/intrinsics/orchestratorTask.d.ts +4 -0
- package/dist/runtime/intrinsics/orchestratorTask.d.ts.map +1 -0
- package/dist/runtime/intrinsics/orchestratorTask.js +28 -0
- package/dist/runtime/intrinsics/parallel.d.ts +9 -0
- package/dist/runtime/intrinsics/parallel.d.ts.map +1 -0
- package/dist/runtime/intrinsics/parallel.js +160 -0
- package/dist/runtime/intrinsics/parallelGroup.d.ts +16 -0
- package/dist/runtime/intrinsics/parallelGroup.d.ts.map +1 -0
- package/dist/runtime/intrinsics/parallelGroup.js +105 -0
- package/dist/runtime/intrinsics/sleep.d.ts +4 -0
- package/dist/runtime/intrinsics/sleep.d.ts.map +1 -0
- package/dist/runtime/intrinsics/sleep.js +70 -0
- package/dist/runtime/intrinsics/subprocess.d.ts +5 -0
- package/dist/runtime/intrinsics/subprocess.d.ts.map +1 -0
- package/dist/runtime/intrinsics/subprocess.js +56 -0
- package/dist/runtime/intrinsics/task.d.ts +26 -0
- package/dist/runtime/intrinsics/task.d.ts.map +1 -0
- package/dist/runtime/intrinsics/task.js +132 -0
- package/dist/runtime/intrinsics/taskHelpers.d.ts +20 -0
- package/dist/runtime/intrinsics/taskHelpers.d.ts.map +1 -0
- package/dist/runtime/intrinsics/taskHelpers.js +148 -0
- package/dist/runtime/invocation/hashInvocationKey.d.ts +12 -0
- package/dist/runtime/invocation/hashInvocationKey.d.ts.map +1 -0
- package/dist/runtime/invocation/hashInvocationKey.js +12 -0
- package/dist/runtime/invocation/index.d.ts +3 -0
- package/dist/runtime/invocation/index.d.ts.map +1 -0
- package/dist/runtime/invocation/index.js +5 -0
- package/dist/runtime/orchestrateHelpers.d.ts +16 -0
- package/dist/runtime/orchestrateHelpers.d.ts.map +1 -0
- package/dist/runtime/orchestrateHelpers.js +103 -0
- package/dist/runtime/orchestrateIteration.d.ts +4 -0
- package/dist/runtime/orchestrateIteration.d.ts.map +1 -0
- package/dist/runtime/orchestrateIteration.js +213 -0
- package/dist/runtime/parallelStrategies.d.ts +23 -0
- package/dist/runtime/parallelStrategies.d.ts.map +1 -0
- package/dist/runtime/parallelStrategies.js +79 -0
- package/dist/runtime/policy/engine.d.ts +4 -0
- package/dist/runtime/policy/engine.d.ts.map +1 -0
- package/dist/runtime/policy/engine.js +97 -0
- package/dist/runtime/policy/index.d.ts +5 -0
- package/dist/runtime/policy/index.d.ts.map +1 -0
- package/dist/runtime/policy/index.js +13 -0
- package/dist/runtime/policy/logging.d.ts +6 -0
- package/dist/runtime/policy/logging.d.ts.map +1 -0
- package/dist/runtime/policy/logging.js +43 -0
- package/dist/runtime/policy/types.d.ts +55 -0
- package/dist/runtime/policy/types.d.ts.map +1 -0
- package/dist/runtime/policy/types.js +10 -0
- package/dist/runtime/processContext.d.ts +36 -0
- package/dist/runtime/processContext.d.ts.map +1 -0
- package/dist/runtime/processContext.js +161 -0
- package/dist/runtime/replay/createReplayEngine.d.ts +32 -0
- package/dist/runtime/replay/createReplayEngine.d.ts.map +1 -0
- package/dist/runtime/replay/createReplayEngine.js +189 -0
- package/dist/runtime/replay/effectIndex.d.ts +39 -0
- package/dist/runtime/replay/effectIndex.d.ts.map +1 -0
- package/dist/runtime/replay/effectIndex.js +322 -0
- package/dist/runtime/replay/index.d.ts +7 -0
- package/dist/runtime/replay/index.d.ts.map +1 -0
- package/dist/runtime/replay/index.js +19 -0
- package/dist/runtime/replay/replayCursor.d.ts +7 -0
- package/dist/runtime/replay/replayCursor.d.ts.map +1 -0
- package/dist/runtime/replay/replayCursor.js +22 -0
- package/dist/runtime/replay/stateCache.d.ts +50 -0
- package/dist/runtime/replay/stateCache.d.ts.map +1 -0
- package/dist/runtime/replay/stateCache.js +222 -0
- package/dist/runtime/runLifecycleState.d.ts +7 -0
- package/dist/runtime/runLifecycleState.d.ts.map +1 -0
- package/dist/runtime/runLifecycleState.js +54 -0
- package/dist/runtime/schemaValidator.d.ts +16 -0
- package/dist/runtime/schemaValidator.d.ts.map +1 -0
- package/dist/runtime/schemaValidator.js +92 -0
- package/dist/runtime/types.d.ts +240 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime/types.js +2 -0
- package/dist/sdkVersion.d.ts +5 -0
- package/dist/sdkVersion.d.ts.map +1 -0
- package/dist/sdkVersion.js +49 -0
- package/dist/session/cleanup.d.ts +17 -0
- package/dist/session/cleanup.d.ts.map +1 -0
- package/dist/session/cleanup.js +212 -0
- package/dist/session/discovery.d.ts +25 -0
- package/dist/session/discovery.d.ts.map +1 -0
- package/dist/session/discovery.js +44 -0
- package/dist/session/index.d.ts +15 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +42 -0
- package/dist/session/parse.d.ts +45 -0
- package/dist/session/parse.d.ts.map +1 -0
- package/dist/session/parse.js +176 -0
- package/dist/session/transcript.d.ts +7 -0
- package/dist/session/transcript.d.ts.map +1 -0
- package/dist/session/transcript.js +51 -0
- package/dist/session/types.d.ts +196 -0
- package/dist/session/types.d.ts.map +1 -0
- package/dist/session/types.js +45 -0
- package/dist/session/whoami.d.ts +16 -0
- package/dist/session/whoami.d.ts.map +1 -0
- package/dist/session/whoami.js +108 -0
- package/dist/session/write.d.ts +61 -0
- package/dist/session/write.d.ts.map +1 -0
- package/dist/session/write.js +217 -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/cleanup.d.ts +4 -0
- package/dist/storage/cleanup.d.ts.map +1 -0
- package/dist/storage/cleanup.js +96 -0
- package/dist/storage/clock.d.ts +6 -0
- package/dist/storage/clock.d.ts.map +1 -0
- package/dist/storage/clock.js +29 -0
- package/dist/storage/createRunDir.d.ts +6 -0
- package/dist/storage/createRunDir.d.ts.map +1 -0
- package/dist/storage/createRunDir.js +87 -0
- package/dist/storage/icloudWarning.d.ts +6 -0
- package/dist/storage/icloudWarning.d.ts.map +1 -0
- package/dist/storage/icloudWarning.js +84 -0
- package/dist/storage/index.d.ts +9 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +36 -0
- package/dist/storage/journal.d.ts +4 -0
- package/dist/storage/journal.d.ts.map +1 -0
- package/dist/storage/journal.js +133 -0
- package/dist/storage/lock.d.ts +10 -0
- package/dist/storage/lock.d.ts.map +1 -0
- package/dist/storage/lock.js +82 -0
- package/dist/storage/paths.d.ts +23 -0
- package/dist/storage/paths.d.ts.map +1 -0
- package/dist/storage/paths.js +51 -0
- package/dist/storage/runFiles.d.ts +6 -0
- package/dist/storage/runFiles.d.ts.map +1 -0
- package/dist/storage/runFiles.js +44 -0
- package/dist/storage/tasks.d.ts +17 -0
- package/dist/storage/tasks.d.ts.map +1 -0
- package/dist/storage/tasks.js +83 -0
- package/dist/storage/types.d.ts +121 -0
- package/dist/storage/types.d.ts.map +1 -0
- package/dist/storage/types.js +2 -0
- package/dist/storage/ulids.d.ts +11 -0
- package/dist/storage/ulids.d.ts.map +1 -0
- package/dist/storage/ulids.js +25 -0
- package/dist/tasks/batching.d.ts +34 -0
- package/dist/tasks/batching.d.ts.map +1 -0
- package/dist/tasks/batching.js +91 -0
- package/dist/tasks/context.d.ts +11 -0
- package/dist/tasks/context.d.ts.map +1 -0
- package/dist/tasks/context.js +181 -0
- package/dist/tasks/defineTask.d.ts +37 -0
- package/dist/tasks/defineTask.d.ts.map +1 -0
- package/dist/tasks/defineTask.js +99 -0
- package/dist/tasks/effectGroup.d.ts +19 -0
- package/dist/tasks/effectGroup.d.ts.map +1 -0
- package/dist/tasks/effectGroup.js +58 -0
- package/dist/tasks/grouping.d.ts +19 -0
- package/dist/tasks/grouping.d.ts.map +1 -0
- package/dist/tasks/grouping.js +54 -0
- package/dist/tasks/index.d.ts +9 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/index.js +24 -0
- package/dist/tasks/kinds/index.d.ts +7 -0
- package/dist/tasks/kinds/index.d.ts.map +1 -0
- package/dist/tasks/kinds/index.js +162 -0
- package/dist/tasks/kinds/resolvers.d.ts +21 -0
- package/dist/tasks/kinds/resolvers.d.ts.map +1 -0
- package/dist/tasks/kinds/resolvers.js +124 -0
- package/dist/tasks/partitioning.d.ts +11 -0
- package/dist/tasks/partitioning.d.ts.map +1 -0
- package/dist/tasks/partitioning.js +20 -0
- package/dist/tasks/registry.d.ts +53 -0
- package/dist/tasks/registry.d.ts.map +1 -0
- package/dist/tasks/registry.js +147 -0
- package/dist/tasks/serializer.d.ts +62 -0
- package/dist/tasks/serializer.d.ts.map +1 -0
- package/dist/tasks/serializer.js +197 -0
- package/dist/tasks/types.d.ts +180 -0
- package/dist/tasks/types.d.ts.map +1 -0
- package/dist/tasks/types.js +2 -0
- package/dist/test-fixtures/kinds/index.d.ts +56 -0
- package/dist/test-fixtures/kinds/index.d.ts.map +1 -0
- package/dist/test-fixtures/kinds/index.js +44 -0
- package/dist/testing/deterministic.d.ts +62 -0
- package/dist/testing/deterministic.d.ts.map +1 -0
- package/dist/testing/deterministic.js +193 -0
- package/dist/testing/deterministicProviders.d.ts +32 -0
- package/dist/testing/deterministicProviders.d.ts.map +1 -0
- package/dist/testing/deterministicProviders.js +263 -0
- package/dist/testing/index.d.ts +4 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +23 -0
- package/dist/testing/runHarness.d.ts +64 -0
- package/dist/testing/runHarness.d.ts.map +1 -0
- package/dist/testing/runHarness.js +165 -0
- package/dist/testing/snapshots.d.ts +17 -0
- package/dist/testing/snapshots.d.ts.map +1 -0
- package/dist/testing/snapshots.js +24 -0
- package/dist/utils/ancestorWalk.d.ts +14 -0
- package/dist/utils/ancestorWalk.d.ts.map +1 -0
- package/dist/utils/ancestorWalk.js +203 -0
- package/dist/utils/compressContext.d.ts +50 -0
- package/dist/utils/compressContext.d.ts.map +1 -0
- package/dist/utils/compressContext.js +180 -0
- package/dist/utils/processLiveness.d.ts +9 -0
- package/dist/utils/processLiveness.d.ts.map +1 -0
- package/dist/utils/processLiveness.js +36 -0
- package/dist/utils/sessionMarker.d.ts +17 -0
- package/dist/utils/sessionMarker.d.ts.map +1 -0
- package/dist/utils/sessionMarker.js +218 -0
- package/package.json +4 -4
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TaskInvokeOptions } from "../types";
|
|
2
|
+
import { TaskIntrinsicContext } from "./task";
|
|
3
|
+
export declare function runOrchestratorTaskIntrinsic<TPayload, TResult>(payload: TPayload, context: TaskIntrinsicContext, options?: TaskInvokeOptions): Promise<TResult>;
|
|
4
|
+
//# sourceMappingURL=orchestratorTask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestratorTask.d.ts","sourceRoot":"","sources":["../../../src/runtime/intrinsics/orchestratorTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAoB,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAuBhE,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,OAAO,EAC5D,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,oBAAoB,EAC7B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,OAAO,CAAC,CASlB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runOrchestratorTaskIntrinsic = runOrchestratorTaskIntrinsic;
|
|
4
|
+
const task_1 = require("./task");
|
|
5
|
+
const ORCHESTRATOR_TASK_ID = "__sdk.orchestratorTask";
|
|
6
|
+
const orchestratorTask = {
|
|
7
|
+
id: ORCHESTRATOR_TASK_ID,
|
|
8
|
+
build(args) {
|
|
9
|
+
return {
|
|
10
|
+
kind: "orchestrator_task",
|
|
11
|
+
title: args.label,
|
|
12
|
+
metadata: {
|
|
13
|
+
payload: args?.payload,
|
|
14
|
+
orchestratorTask: true,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
function runOrchestratorTaskIntrinsic(payload, context, options) {
|
|
20
|
+
const label = options?.label ?? "orchestrator-task";
|
|
21
|
+
const invokeOptions = { ...options, label };
|
|
22
|
+
return (0, task_1.runTaskIntrinsic)({
|
|
23
|
+
task: orchestratorTask,
|
|
24
|
+
args: { payload, label },
|
|
25
|
+
invokeOptions,
|
|
26
|
+
context,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EffectAction } from "../types";
|
|
2
|
+
export interface ParallelAllOptions {
|
|
3
|
+
maxConcurrency?: number;
|
|
4
|
+
executionStrategy?: 'sequential' | 'concurrent' | 'adaptive';
|
|
5
|
+
}
|
|
6
|
+
export declare function runParallelAll<T>(thunks: Array<() => T | Promise<T>>, options?: ParallelAllOptions): Promise<T[]>;
|
|
7
|
+
export declare function runParallelMap<TItem, TOut>(items: TItem[], fn: (item: TItem) => TOut | Promise<TOut>): Promise<TOut[]>;
|
|
8
|
+
export declare function dedupeEffectActions(actions: EffectAction[]): EffectAction[];
|
|
9
|
+
//# sourceMappingURL=parallel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallel.d.ts","sourceRoot":"","sources":["../../../src/runtime/intrinsics/parallel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAIxC,MAAM,WAAW,kBAAkB;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,YAAY,GAAG,YAAY,GAAG,UAAU,CAAC;CAC9D;AAED,wBAAsB,cAAc,CAAC,CAAC,EACpC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,EACnC,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,CAAC,EAAE,CAAC,CAwDd;AAuED,wBAAsB,cAAc,CAAC,KAAK,EAAE,IAAI,EAC9C,KAAK,EAAE,KAAK,EAAE,EACd,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GACxC,OAAO,CAAC,IAAI,EAAE,CAAC,CAGjB;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAE3E"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runParallelAll = runParallelAll;
|
|
4
|
+
exports.runParallelMap = runParallelMap;
|
|
5
|
+
exports.dedupeEffectActions = dedupeEffectActions;
|
|
6
|
+
const exceptions_1 = require("../exceptions");
|
|
7
|
+
const batching_1 = require("../../tasks/batching");
|
|
8
|
+
async function runParallelAll(thunks, options) {
|
|
9
|
+
// Detect and recover from promise-instead-of-thunk misuse. When callers
|
|
10
|
+
// write [ctx.task(...)] instead of [() => ctx.task(...)], the promises are
|
|
11
|
+
// already executing and will reject with EffectRequestedError as orphaned
|
|
12
|
+
// unhandled rejections (crashing Node). Convert them to thunks wrapping the
|
|
13
|
+
// existing promises so the batch-collection loop can still gather all pending
|
|
14
|
+
// effect actions without orphan rejections.
|
|
15
|
+
let recovered = false;
|
|
16
|
+
for (let i = 0; i < thunks.length; i++) {
|
|
17
|
+
if (typeof thunks[i] !== "function") {
|
|
18
|
+
const isThenable = thunks[i] && typeof thunks[i].then === "function";
|
|
19
|
+
if (isThenable) {
|
|
20
|
+
if (!recovered) {
|
|
21
|
+
thunks = [...thunks]; // shallow copy to avoid mutating caller's array
|
|
22
|
+
recovered = true;
|
|
23
|
+
}
|
|
24
|
+
const promise = thunks[i];
|
|
25
|
+
thunks[i] = (() => promise);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
throw new TypeError(`parallel.all() expects an array of functions (thunks), but element at index ${i} is ${typeof thunks[i]}. Wrap each entry as a function: [() => ctx.task(...)] instead of [ctx.task(...)]`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const results = [];
|
|
33
|
+
const pending = [];
|
|
34
|
+
const maxConcurrency = options?.maxConcurrency;
|
|
35
|
+
if (maxConcurrency !== undefined && maxConcurrency >= 1) {
|
|
36
|
+
// Run thunks with bounded concurrency using a semaphore pattern
|
|
37
|
+
await runWithConcurrencyLimit(thunks, maxConcurrency, results, pending);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// Original behavior: run all thunks sequentially (collecting pending effects)
|
|
41
|
+
for (const thunk of thunks) {
|
|
42
|
+
try {
|
|
43
|
+
const value = await thunk();
|
|
44
|
+
results.push(value);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
const actions = collectPendingActions(error);
|
|
48
|
+
if (actions.length) {
|
|
49
|
+
pending.push(...actions);
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (pending.length) {
|
|
57
|
+
throw new exceptions_1.ParallelPendingError((0, batching_1.buildParallelBatch)(pending, options));
|
|
58
|
+
}
|
|
59
|
+
return results;
|
|
60
|
+
}
|
|
61
|
+
async function runWithConcurrencyLimit(thunks, maxConcurrency, results, pending) {
|
|
62
|
+
// Pre-fill results array with undefined slots to maintain order
|
|
63
|
+
const slots = thunks.map(() => ({ settled: false }));
|
|
64
|
+
let firstNonPendingError = undefined;
|
|
65
|
+
let hasNonPendingError = false;
|
|
66
|
+
let nextIndex = 0;
|
|
67
|
+
const activePromises = new Set();
|
|
68
|
+
const launchNext = () => {
|
|
69
|
+
if (nextIndex >= thunks.length || hasNonPendingError)
|
|
70
|
+
return undefined;
|
|
71
|
+
const idx = nextIndex++;
|
|
72
|
+
const p = (async () => {
|
|
73
|
+
try {
|
|
74
|
+
const value = await thunks[idx]();
|
|
75
|
+
slots[idx] = { value, settled: true };
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
const actions = collectPendingActions(error);
|
|
79
|
+
if (actions.length) {
|
|
80
|
+
pending.push(...actions);
|
|
81
|
+
slots[idx] = { settled: true };
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
if (!hasNonPendingError) {
|
|
85
|
+
firstNonPendingError = error;
|
|
86
|
+
hasNonPendingError = true;
|
|
87
|
+
}
|
|
88
|
+
slots[idx] = { settled: true };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
})();
|
|
92
|
+
const tracked = p.then(() => {
|
|
93
|
+
activePromises.delete(tracked);
|
|
94
|
+
});
|
|
95
|
+
activePromises.add(tracked);
|
|
96
|
+
return tracked;
|
|
97
|
+
};
|
|
98
|
+
// Launch initial batch up to maxConcurrency
|
|
99
|
+
for (let i = 0; i < maxConcurrency && i < thunks.length; i++) {
|
|
100
|
+
void launchNext();
|
|
101
|
+
}
|
|
102
|
+
// As each completes, launch the next
|
|
103
|
+
while (activePromises.size > 0) {
|
|
104
|
+
await Promise.race(activePromises);
|
|
105
|
+
// Launch more if available
|
|
106
|
+
while (activePromises.size < maxConcurrency && nextIndex < thunks.length && !hasNonPendingError) {
|
|
107
|
+
void launchNext();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (hasNonPendingError) {
|
|
111
|
+
throw firstNonPendingError;
|
|
112
|
+
}
|
|
113
|
+
// Collect ordered results (only for non-pending slots)
|
|
114
|
+
for (const slot of slots) {
|
|
115
|
+
if (slot.settled && slot.value !== undefined) {
|
|
116
|
+
results.push(slot.value);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async function runParallelMap(items, fn) {
|
|
121
|
+
const thunks = items.map((item) => () => fn(item));
|
|
122
|
+
return runParallelAll(thunks);
|
|
123
|
+
}
|
|
124
|
+
function dedupeEffectActions(actions) {
|
|
125
|
+
return (0, batching_1.buildParallelBatch)(actions).actions;
|
|
126
|
+
}
|
|
127
|
+
function collectPendingActions(error) {
|
|
128
|
+
if (error instanceof exceptions_1.ParallelPendingError) {
|
|
129
|
+
// Strip auto-assigned parallelGroupId from inner batch actions so the
|
|
130
|
+
// outer buildParallelBatch can assign a unified group to all collected actions.
|
|
131
|
+
return error.batch.actions.map(stripAutoParallelGroupId);
|
|
132
|
+
}
|
|
133
|
+
if (error instanceof exceptions_1.EffectPendingError || error instanceof exceptions_1.EffectRequestedError) {
|
|
134
|
+
return [error.action];
|
|
135
|
+
}
|
|
136
|
+
return [];
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Removes parallelGroupId from schedulerHints that was auto-assigned by an
|
|
140
|
+
* inner buildParallelBatch call. This allows the outer batch to re-group all
|
|
141
|
+
* actions under a single parallelGroupId.
|
|
142
|
+
*
|
|
143
|
+
* We detect "auto-assigned" by checking if the parallelGroupId looks like a
|
|
144
|
+
* hex hash (the format produced by assignParallelGroupHints). User-provided
|
|
145
|
+
* parallelGroupIds typically have descriptive names.
|
|
146
|
+
*
|
|
147
|
+
* However, to be safe and simple, we always strip when collecting from inner
|
|
148
|
+
* ParallelPendingError since inner grouping is superseded by outer grouping.
|
|
149
|
+
*/
|
|
150
|
+
function stripAutoParallelGroupId(action) {
|
|
151
|
+
if (!action.schedulerHints?.parallelGroupId) {
|
|
152
|
+
return action;
|
|
153
|
+
}
|
|
154
|
+
const { parallelGroupId: _stripped, ...restHints } = action.schedulerHints;
|
|
155
|
+
const hasRemainingHints = Object.keys(restHints).length > 0;
|
|
156
|
+
return {
|
|
157
|
+
...action,
|
|
158
|
+
schedulerHints: hasRemainingHints ? restHints : undefined,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ParallelGroupOptions {
|
|
2
|
+
groupLabel: string;
|
|
3
|
+
persistent?: boolean;
|
|
4
|
+
preferredHarness?: string | string[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Runs thunks as a named parallel group with a shared effectGroupId.
|
|
8
|
+
* Supports preferred harness assignment (single string or round-robin array).
|
|
9
|
+
*/
|
|
10
|
+
export declare function runParallelGroup<T>(thunks: Array<() => T | Promise<T>>, options: ParallelGroupOptions): Promise<T[]>;
|
|
11
|
+
/**
|
|
12
|
+
* Fan-out pattern: maps each item through a function, collecting results or
|
|
13
|
+
* pending effects as a group with a shared effectGroupId.
|
|
14
|
+
*/
|
|
15
|
+
export declare function runParallelFanOut<TItem, TOut>(items: TItem[], fn: (item: TItem) => TOut | Promise<TOut>, _options: ParallelGroupOptions): Promise<TOut[]>;
|
|
16
|
+
//# sourceMappingURL=parallelGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelGroup.d.ts","sourceRoot":"","sources":["../../../src/runtime/intrinsics/parallelGroup.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACtC;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,EACnC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,CAAC,EAAE,CAAC,CAqDd;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,IAAI,EACjD,KAAK,EAAE,KAAK,EAAE,EACd,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EACzC,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,IAAI,EAAE,CAAC,CAoCjB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runParallelGroup = runParallelGroup;
|
|
4
|
+
exports.runParallelFanOut = runParallelFanOut;
|
|
5
|
+
const crypto_1 = require("crypto");
|
|
6
|
+
const exceptions_1 = require("../exceptions");
|
|
7
|
+
const batching_1 = require("../../tasks/batching");
|
|
8
|
+
/**
|
|
9
|
+
* Runs thunks as a named parallel group with a shared effectGroupId.
|
|
10
|
+
* Supports preferred harness assignment (single string or round-robin array).
|
|
11
|
+
*/
|
|
12
|
+
async function runParallelGroup(thunks, options) {
|
|
13
|
+
if (thunks.length === 0) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
const effectGroupId = (0, crypto_1.randomUUID)();
|
|
17
|
+
const results = [];
|
|
18
|
+
const pending = [];
|
|
19
|
+
for (const thunk of thunks) {
|
|
20
|
+
try {
|
|
21
|
+
const value = await thunk();
|
|
22
|
+
results.push(value);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
const actions = collectPendingActions(error);
|
|
26
|
+
if (actions.length) {
|
|
27
|
+
pending.push(...actions);
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (pending.length) {
|
|
34
|
+
// Annotate all pending actions with the shared effectGroupId and optional harness hints
|
|
35
|
+
const annotated = pending.map((action, index) => {
|
|
36
|
+
const extraHints = { effectGroupId };
|
|
37
|
+
if (options.persistent) {
|
|
38
|
+
extraHints.groupRole = index === 0 ? "coordinator" : "worker";
|
|
39
|
+
}
|
|
40
|
+
if (options.preferredHarness !== undefined) {
|
|
41
|
+
if (typeof options.preferredHarness === "string") {
|
|
42
|
+
extraHints.preferredHarness = options.preferredHarness;
|
|
43
|
+
}
|
|
44
|
+
else if (Array.isArray(options.preferredHarness) && options.preferredHarness.length > 0) {
|
|
45
|
+
extraHints.preferredHarness = options.preferredHarness[index % options.preferredHarness.length];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
...action,
|
|
50
|
+
schedulerHints: {
|
|
51
|
+
...(action.schedulerHints ?? {}),
|
|
52
|
+
...extraHints,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
throw new exceptions_1.ParallelPendingError((0, batching_1.buildParallelBatch)(annotated));
|
|
57
|
+
}
|
|
58
|
+
return results;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Fan-out pattern: maps each item through a function, collecting results or
|
|
62
|
+
* pending effects as a group with a shared effectGroupId.
|
|
63
|
+
*/
|
|
64
|
+
async function runParallelFanOut(items, fn, _options) {
|
|
65
|
+
if (items.length === 0) {
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
const effectGroupId = (0, crypto_1.randomUUID)();
|
|
69
|
+
const results = [];
|
|
70
|
+
const pending = [];
|
|
71
|
+
for (const item of items) {
|
|
72
|
+
try {
|
|
73
|
+
const value = await fn(item);
|
|
74
|
+
results.push(value);
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
const actions = collectPendingActions(error);
|
|
78
|
+
if (actions.length) {
|
|
79
|
+
pending.push(...actions);
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
throw error;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (pending.length) {
|
|
86
|
+
const annotated = pending.map((action) => ({
|
|
87
|
+
...action,
|
|
88
|
+
schedulerHints: {
|
|
89
|
+
...(action.schedulerHints ?? {}),
|
|
90
|
+
effectGroupId,
|
|
91
|
+
},
|
|
92
|
+
}));
|
|
93
|
+
throw new exceptions_1.ParallelPendingError((0, batching_1.buildParallelBatch)(annotated));
|
|
94
|
+
}
|
|
95
|
+
return results;
|
|
96
|
+
}
|
|
97
|
+
function collectPendingActions(error) {
|
|
98
|
+
if (error instanceof exceptions_1.ParallelPendingError) {
|
|
99
|
+
return error.batch.actions;
|
|
100
|
+
}
|
|
101
|
+
if (error instanceof exceptions_1.EffectPendingError || error instanceof exceptions_1.EffectRequestedError) {
|
|
102
|
+
return [error.action];
|
|
103
|
+
}
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TaskInvokeOptions } from "../types";
|
|
2
|
+
import { TaskIntrinsicContext } from "./task";
|
|
3
|
+
export declare function runSleepIntrinsic(target: string | number, context: TaskIntrinsicContext, options?: TaskInvokeOptions): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=sleep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep.d.ts","sourceRoot":"","sources":["../../../src/runtime/intrinsics/sleep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE1D,OAAO,EAAoB,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AA2BhE,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,OAAO,EAAE,oBAAoB,EAC7B,OAAO,CAAC,EAAE,iBAAiB,iBA2B5B"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runSleepIntrinsic = runSleepIntrinsic;
|
|
4
|
+
const exceptions_1 = require("../exceptions");
|
|
5
|
+
const task_1 = require("./task");
|
|
6
|
+
const SLEEP_TASK_ID = "__sdk.sleep";
|
|
7
|
+
const sleepTask = {
|
|
8
|
+
id: SLEEP_TASK_ID,
|
|
9
|
+
build(args) {
|
|
10
|
+
return {
|
|
11
|
+
kind: "sleep",
|
|
12
|
+
title: `sleep:${args.iso}`,
|
|
13
|
+
sleep: {
|
|
14
|
+
iso: args.iso,
|
|
15
|
+
targetEpochMs: args.targetEpochMs,
|
|
16
|
+
},
|
|
17
|
+
metadata: {
|
|
18
|
+
targetEpochMs: args.targetEpochMs,
|
|
19
|
+
iso: args.iso,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
async function runSleepIntrinsic(target, context, options) {
|
|
25
|
+
const epoch = normalizeSleepTarget(target);
|
|
26
|
+
if (!Number.isFinite(epoch) || epoch < 0) {
|
|
27
|
+
throw new exceptions_1.InvalidSleepTargetError(target);
|
|
28
|
+
}
|
|
29
|
+
const nowMs = context.now().getTime();
|
|
30
|
+
if (epoch <= nowMs) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const iso = new Date(epoch).toISOString();
|
|
34
|
+
const label = options?.label ?? `sleep:${iso}`;
|
|
35
|
+
const invokeOptions = { ...options, label };
|
|
36
|
+
try {
|
|
37
|
+
await (0, task_1.runTaskIntrinsic)({
|
|
38
|
+
task: sleepTask,
|
|
39
|
+
args: { targetEpochMs: epoch, iso },
|
|
40
|
+
invokeOptions,
|
|
41
|
+
context,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
if (shouldShortCircuitPending(error, nowMs)) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function normalizeSleepTarget(target) {
|
|
52
|
+
if (typeof target === "number") {
|
|
53
|
+
return target;
|
|
54
|
+
}
|
|
55
|
+
if (typeof target === "string") {
|
|
56
|
+
const parsed = Date.parse(target);
|
|
57
|
+
return Number.isNaN(parsed) ? NaN : parsed;
|
|
58
|
+
}
|
|
59
|
+
return NaN;
|
|
60
|
+
}
|
|
61
|
+
function shouldShortCircuitPending(error, nowMs) {
|
|
62
|
+
if (!(error instanceof exceptions_1.EffectPendingError)) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
const metadata = error.action.taskDef?.metadata;
|
|
66
|
+
if (typeof metadata?.targetEpochMs !== "number") {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
return metadata.targetEpochMs <= nowMs;
|
|
70
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TaskInvokeOptions } from "../../tasks/types";
|
|
2
|
+
import { SubprocessInvocation, SubprocessResult } from "../types";
|
|
3
|
+
import { TaskIntrinsicContext } from "./task";
|
|
4
|
+
export declare function runSubprocessIntrinsic(invocation: SubprocessInvocation, context: TaskIntrinsicContext, options?: TaskInvokeOptions): Promise<SubprocessResult>;
|
|
5
|
+
//# sourceMappingURL=subprocess.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subprocess.d.ts","sourceRoot":"","sources":["../../../src/runtime/intrinsics/subprocess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAElE,OAAO,EAAoB,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AA6ChE,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,oBAAoB,EAChC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,gBAAgB,CAAC,CAkB3B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runSubprocessIntrinsic = runSubprocessIntrinsic;
|
|
4
|
+
const exceptions_1 = require("../exceptions");
|
|
5
|
+
const task_1 = require("./task");
|
|
6
|
+
const SUBPROCESS_TASK_ID = "__sdk.subprocess";
|
|
7
|
+
const subprocessTask = {
|
|
8
|
+
id: SUBPROCESS_TASK_ID,
|
|
9
|
+
build(args) {
|
|
10
|
+
const invocation = args.invocation;
|
|
11
|
+
const subprocess = {
|
|
12
|
+
processPath: invocation.processPath,
|
|
13
|
+
exportName: invocation.exportName,
|
|
14
|
+
processId: invocation.processId,
|
|
15
|
+
prompt: invocation.prompt,
|
|
16
|
+
inputs: invocation.inputs,
|
|
17
|
+
inputSchema: invocation.inputSchema,
|
|
18
|
+
outputSchema: invocation.outputSchema,
|
|
19
|
+
harness: invocation.harness,
|
|
20
|
+
model: invocation.model,
|
|
21
|
+
maxIterations: invocation.maxIterations,
|
|
22
|
+
shareSession: invocation.shareSession !== false,
|
|
23
|
+
metadata: invocation.metadata,
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
kind: "subprocess",
|
|
27
|
+
title: args.label,
|
|
28
|
+
metadata: {
|
|
29
|
+
subprocess: true,
|
|
30
|
+
processPath: invocation.processPath,
|
|
31
|
+
processId: invocation.processId,
|
|
32
|
+
harness: invocation.harness,
|
|
33
|
+
model: invocation.model,
|
|
34
|
+
maxIterations: invocation.maxIterations,
|
|
35
|
+
shareSession: invocation.shareSession !== false,
|
|
36
|
+
},
|
|
37
|
+
subprocess,
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
function runSubprocessIntrinsic(invocation, context, options) {
|
|
42
|
+
if (context.subprocessSupport !== "babysitter-agent") {
|
|
43
|
+
throw new exceptions_1.RunFailedError("Subprocess effects are only supported when the run is iterated by babysitter-agent.", {
|
|
44
|
+
runId: context.runId,
|
|
45
|
+
processId: context.processId,
|
|
46
|
+
subprocessSupport: context.subprocessSupport ?? "disabled",
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
const label = options?.label ?? invocation.processId ?? invocation.processPath;
|
|
50
|
+
return (0, task_1.runTaskIntrinsic)({
|
|
51
|
+
task: subprocessTask,
|
|
52
|
+
args: { invocation, label },
|
|
53
|
+
invokeOptions: { ...options, label },
|
|
54
|
+
context,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { EffectIndex } from "../replay/effectIndex";
|
|
2
|
+
import type { ReplayCursor } from "../replay/replayCursor";
|
|
3
|
+
import type { DefinedTask, ProcessLogger, TaskInvokeOptions } from "../types";
|
|
4
|
+
import type { PolicyDecisionReporter, PolicyEngine } from "../policy/types";
|
|
5
|
+
export declare function getNewEffectRequestCount(): number;
|
|
6
|
+
export declare function resetNewEffectRequestCount(): void;
|
|
7
|
+
export interface TaskIntrinsicContext {
|
|
8
|
+
runId: string;
|
|
9
|
+
runDir: string;
|
|
10
|
+
processId: string;
|
|
11
|
+
effectIndex: EffectIndex;
|
|
12
|
+
replayCursor: ReplayCursor;
|
|
13
|
+
now: () => Date;
|
|
14
|
+
logger?: ProcessLogger;
|
|
15
|
+
subprocessSupport?: "disabled" | "babysitter-agent";
|
|
16
|
+
policyEngine?: PolicyEngine;
|
|
17
|
+
reportPolicyDecision?: PolicyDecisionReporter;
|
|
18
|
+
}
|
|
19
|
+
export interface TaskIntrinsicInvokeOptions<TArgs, TResult> {
|
|
20
|
+
task: DefinedTask<TArgs, TResult>;
|
|
21
|
+
args: TArgs;
|
|
22
|
+
invokeOptions?: TaskInvokeOptions;
|
|
23
|
+
context: TaskIntrinsicContext;
|
|
24
|
+
}
|
|
25
|
+
export declare function runTaskIntrinsic<TArgs, TResult>(options: TaskIntrinsicInvokeOptions<TArgs, TResult>): Promise<TResult>;
|
|
26
|
+
//# sourceMappingURL=task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../../src/runtime/intrinsics/task.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EACV,WAAW,EAEX,aAAa,EAEb,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAOlB,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EAEb,MAAM,iBAAiB,CAAC;AASzB,wBAAgB,wBAAwB,IAAI,MAAM,CAAmC;AACrF,wBAAgB,0BAA0B,IAAI,IAAI,CAAgC;AAElF,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,YAAY,CAAC;IAC3B,GAAG,EAAE,MAAM,IAAI,CAAC;IAChB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,iBAAiB,CAAC,EAAE,UAAU,GAAG,kBAAkB,CAAC;IACpD,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,oBAAoB,CAAC,EAAE,sBAAsB,CAAC;CAC/C;AAED,MAAM,WAAW,0BAA0B,CAAC,KAAK,EAAE,OAAO;IACxD,IAAI,EAAE,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,EAAE,KAAK,CAAC;IACZ,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,OAAO,EAAE,oBAAoB,CAAC;CAC/B;AAED,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EACnD,OAAO,EAAE,0BAA0B,CAAC,KAAK,EAAE,OAAO,CAAC,GAClD,OAAO,CAAC,OAAO,CAAC,CAmBlB"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNewEffectRequestCount = getNewEffectRequestCount;
|
|
4
|
+
exports.resetNewEffectRequestCount = resetNewEffectRequestCount;
|
|
5
|
+
exports.runTaskIntrinsic = runTaskIntrinsic;
|
|
6
|
+
const journal_1 = require("../../storage/journal");
|
|
7
|
+
const tasks_1 = require("../../storage/tasks");
|
|
8
|
+
const ulids_1 = require("../../storage/ulids");
|
|
9
|
+
const exceptions_1 = require("../exceptions");
|
|
10
|
+
const invocation_1 = require("../invocation");
|
|
11
|
+
const instrumentation_1 = require("../instrumentation");
|
|
12
|
+
const context_1 = require("../../tasks/context");
|
|
13
|
+
const registry_1 = require("../../tasks/registry");
|
|
14
|
+
const serializer_1 = require("../../tasks/serializer");
|
|
15
|
+
const rules_1 = require("../../breakpoints/rules");
|
|
16
|
+
const evaluator_1 = require("../../breakpoints/evaluator");
|
|
17
|
+
const taskHelpers_1 = require("./taskHelpers");
|
|
18
|
+
let _newEffectRequestCount = 0;
|
|
19
|
+
function getNewEffectRequestCount() { return _newEffectRequestCount; }
|
|
20
|
+
function resetNewEffectRequestCount() { _newEffectRequestCount = 0; }
|
|
21
|
+
async function runTaskIntrinsic(options) {
|
|
22
|
+
const { task } = options;
|
|
23
|
+
if (!task || typeof task.build !== "function" || typeof task.id !== "string" || !task.id) {
|
|
24
|
+
throw new exceptions_1.InvalidTaskDefinitionError("ctx.task requires a DefinedTask created via defineTask()");
|
|
25
|
+
}
|
|
26
|
+
const stepId = options.invokeOptions?.stableKey ?? options.context.replayCursor.nextStepId();
|
|
27
|
+
const invocation = (0, invocation_1.hashInvocationKey)({
|
|
28
|
+
processId: options.context.processId,
|
|
29
|
+
stepId,
|
|
30
|
+
taskId: task.id,
|
|
31
|
+
});
|
|
32
|
+
const existing = options.context.effectIndex.getByInvocation(invocation.key);
|
|
33
|
+
if (existing) {
|
|
34
|
+
return handleExistingInvocation(existing, options);
|
|
35
|
+
}
|
|
36
|
+
return requestNewEffect(stepId, invocation.key, invocation.digest, options);
|
|
37
|
+
}
|
|
38
|
+
async function handleExistingInvocation(record, options) {
|
|
39
|
+
if (record.status === "requested") {
|
|
40
|
+
const taskDef = await ensureTaskDefinition(options.context.runDir, record);
|
|
41
|
+
throw new exceptions_1.EffectPendingError((0, taskHelpers_1.buildEffectAction)(record, taskDef));
|
|
42
|
+
}
|
|
43
|
+
return await (0, taskHelpers_1.handleResolvedRecord)(options.context.runDir, record);
|
|
44
|
+
}
|
|
45
|
+
async function requestNewEffect(stepId, invocationKey, invocationHash, options) {
|
|
46
|
+
_newEffectRequestCount++;
|
|
47
|
+
const effectId = (0, ulids_1.nextUlid)();
|
|
48
|
+
const buildCtx = (0, context_1.createTaskBuildContext)({
|
|
49
|
+
effectId, runId: options.context.runId, runDir: options.context.runDir,
|
|
50
|
+
invocationKey, taskId: options.task.id, label: options.invokeOptions?.label,
|
|
51
|
+
});
|
|
52
|
+
const taskDef = await Promise.resolve(options.task.build(options.args, buildCtx));
|
|
53
|
+
if (!taskDef || typeof taskDef.kind !== "string") {
|
|
54
|
+
throw new exceptions_1.InvalidTaskDefinitionError(`Task ${options.task.id} did not provide a kind`);
|
|
55
|
+
}
|
|
56
|
+
// Policy evaluation
|
|
57
|
+
if (options.context.policyEngine) {
|
|
58
|
+
const policyCtx = {
|
|
59
|
+
effectKind: taskDef.kind, taskId: options.task.id, processId: options.context.processId,
|
|
60
|
+
runId: options.context.runId, labels: taskDef.labels,
|
|
61
|
+
metadata: taskDef.metadata,
|
|
62
|
+
};
|
|
63
|
+
const decision = options.context.policyEngine.evaluate(policyCtx);
|
|
64
|
+
if (options.context.reportPolicyDecision) {
|
|
65
|
+
try {
|
|
66
|
+
await options.context.reportPolicyDecision({ timestamp: new Date().toISOString(), context: policyCtx, decision, ruleId: decision.rule?.id });
|
|
67
|
+
}
|
|
68
|
+
catch { /* Best-effort */ }
|
|
69
|
+
}
|
|
70
|
+
if (!decision.allowed) {
|
|
71
|
+
throw new exceptions_1.RunFailedError(`Policy denied effect dispatch: ${decision.reason} [rule: ${decision.rule?.id ?? "unknown"}]`, { details: { ruleId: decision.rule?.id, decision } });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Pre-compute autoApproval for breakpoint effects
|
|
75
|
+
if (taskDef.kind === "breakpoint") {
|
|
76
|
+
try {
|
|
77
|
+
const meta = taskDef.metadata;
|
|
78
|
+
const breakpointId = meta?.breakpointId;
|
|
79
|
+
if (breakpointId) {
|
|
80
|
+
const rules = await (0, rules_1.readRules)();
|
|
81
|
+
const autoApproval = (0, evaluator_1.evaluateAutoApproval)({
|
|
82
|
+
breakpointId, tags: meta?.tags,
|
|
83
|
+
expert: meta?.expert, rules,
|
|
84
|
+
autoApproveAfterN: meta?.autoApproveAfterN,
|
|
85
|
+
});
|
|
86
|
+
taskDef.autoApproval = autoApproval;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
catch { /* Non-critical */ }
|
|
90
|
+
}
|
|
91
|
+
const { taskRef: taskDefRef, inputsRef } = await (0, serializer_1.serializeAndWriteTaskDefinition)({
|
|
92
|
+
runDir: options.context.runDir, effectId, taskId: options.task.id,
|
|
93
|
+
invocationKey, stepId, task: taskDef, inputs: options.args,
|
|
94
|
+
});
|
|
95
|
+
const kind = taskDef.kind;
|
|
96
|
+
const normalizedLabels = (0, taskHelpers_1.collectInvocationLabels)(buildCtx, taskDef);
|
|
97
|
+
const label = (0, taskHelpers_1.deriveEffectLabel)(buildCtx, taskDef, normalizedLabels, options.task.id);
|
|
98
|
+
const labelMetadata = normalizedLabels.length ? normalizedLabels : undefined;
|
|
99
|
+
const eventPayload = {
|
|
100
|
+
effectId, invocationKey, invocationHash, stepId, taskId: options.task.id,
|
|
101
|
+
kind, label, taskDefRef, inputsRef, labels: labelMetadata,
|
|
102
|
+
};
|
|
103
|
+
const appendResult = await (0, journal_1.appendEvent)({ runDir: options.context.runDir, eventType: "EFFECT_REQUESTED", event: eventPayload });
|
|
104
|
+
const syntheticEvent = {
|
|
105
|
+
seq: appendResult.seq, ulid: appendResult.ulid, filename: appendResult.filename,
|
|
106
|
+
path: appendResult.path, type: "EFFECT_REQUESTED", recordedAt: appendResult.recordedAt,
|
|
107
|
+
data: eventPayload, checksum: appendResult.checksum,
|
|
108
|
+
};
|
|
109
|
+
try {
|
|
110
|
+
options.context.effectIndex.applyEvent(syntheticEvent, undefined, { skipSequenceValidation: true });
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
(0, instrumentation_1.emitRuntimeMetric)(options.context.logger, "invocation.collision", { invocationKey, effectId });
|
|
114
|
+
throw new exceptions_1.InvocationCollisionError(invocationKey);
|
|
115
|
+
}
|
|
116
|
+
registry_1.globalTaskRegistry.recordEffect({
|
|
117
|
+
effectId, invocationKey, taskId: options.task.id, kind, label, labels: normalizedLabels,
|
|
118
|
+
status: "pending", taskDefRef, inputsRef, metadata: taskDef.metadata, stepId, requestedAt: appendResult.recordedAt,
|
|
119
|
+
});
|
|
120
|
+
const actionRecord = {
|
|
121
|
+
effectId, invocationKey, invocationHash, stepId, taskId: options.task.id,
|
|
122
|
+
status: "requested", kind, label, labels: labelMetadata, taskDefRef, inputsRef, requestedAt: appendResult.recordedAt,
|
|
123
|
+
};
|
|
124
|
+
const action = (0, taskHelpers_1.buildEffectAction)(actionRecord, taskDef);
|
|
125
|
+
throw new exceptions_1.EffectRequestedError(action);
|
|
126
|
+
}
|
|
127
|
+
async function ensureTaskDefinition(runDir, record) {
|
|
128
|
+
const stored = await (0, tasks_1.readTaskDefinition)(runDir, record.effectId);
|
|
129
|
+
if (!stored)
|
|
130
|
+
throw new exceptions_1.RunFailedError(`Task definition missing for effect ${record.effectId}`, { effectId: record.effectId });
|
|
131
|
+
return stored;
|
|
132
|
+
}
|