@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,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nextUlid = exports.getLockPath = exports.getStateFile = exports.getStateDir = exports.getBlobsDir = exports.getTasksDir = exports.getJournalDir = exports.getRunDir = exports.writeTaskResult = exports.readTaskResult = exports.readTaskDefinition = exports.writeTaskDefinition = exports.writeRunOutput = exports.readRunInputs = exports.writeRunMetadata = exports.readRunMetadata = exports.withRunLock = exports.readRunLock = exports.releaseRunLock = exports.acquireRunLock = exports.findOrphanedBlobs = exports.getDiskUsage = exports.loadJournal = exports.appendEvent = exports.createRunDir = void 0;
|
|
4
|
+
var createRunDir_1 = require("./createRunDir");
|
|
5
|
+
Object.defineProperty(exports, "createRunDir", { enumerable: true, get: function () { return createRunDir_1.createRunDir; } });
|
|
6
|
+
var journal_1 = require("./journal");
|
|
7
|
+
Object.defineProperty(exports, "appendEvent", { enumerable: true, get: function () { return journal_1.appendEvent; } });
|
|
8
|
+
Object.defineProperty(exports, "loadJournal", { enumerable: true, get: function () { return journal_1.loadJournal; } });
|
|
9
|
+
var cleanup_1 = require("./cleanup");
|
|
10
|
+
Object.defineProperty(exports, "getDiskUsage", { enumerable: true, get: function () { return cleanup_1.getDiskUsage; } });
|
|
11
|
+
Object.defineProperty(exports, "findOrphanedBlobs", { enumerable: true, get: function () { return cleanup_1.findOrphanedBlobs; } });
|
|
12
|
+
var lock_1 = require("./lock");
|
|
13
|
+
Object.defineProperty(exports, "acquireRunLock", { enumerable: true, get: function () { return lock_1.acquireRunLock; } });
|
|
14
|
+
Object.defineProperty(exports, "releaseRunLock", { enumerable: true, get: function () { return lock_1.releaseRunLock; } });
|
|
15
|
+
Object.defineProperty(exports, "readRunLock", { enumerable: true, get: function () { return lock_1.readRunLock; } });
|
|
16
|
+
Object.defineProperty(exports, "withRunLock", { enumerable: true, get: function () { return lock_1.withRunLock; } });
|
|
17
|
+
var runFiles_1 = require("./runFiles");
|
|
18
|
+
Object.defineProperty(exports, "readRunMetadata", { enumerable: true, get: function () { return runFiles_1.readRunMetadata; } });
|
|
19
|
+
Object.defineProperty(exports, "writeRunMetadata", { enumerable: true, get: function () { return runFiles_1.writeRunMetadata; } });
|
|
20
|
+
Object.defineProperty(exports, "readRunInputs", { enumerable: true, get: function () { return runFiles_1.readRunInputs; } });
|
|
21
|
+
Object.defineProperty(exports, "writeRunOutput", { enumerable: true, get: function () { return runFiles_1.writeRunOutput; } });
|
|
22
|
+
var tasks_1 = require("./tasks");
|
|
23
|
+
Object.defineProperty(exports, "writeTaskDefinition", { enumerable: true, get: function () { return tasks_1.writeTaskDefinition; } });
|
|
24
|
+
Object.defineProperty(exports, "readTaskDefinition", { enumerable: true, get: function () { return tasks_1.readTaskDefinition; } });
|
|
25
|
+
Object.defineProperty(exports, "readTaskResult", { enumerable: true, get: function () { return tasks_1.readTaskResult; } });
|
|
26
|
+
Object.defineProperty(exports, "writeTaskResult", { enumerable: true, get: function () { return tasks_1.writeTaskResult; } });
|
|
27
|
+
var paths_1 = require("./paths");
|
|
28
|
+
Object.defineProperty(exports, "getRunDir", { enumerable: true, get: function () { return paths_1.getRunDir; } });
|
|
29
|
+
Object.defineProperty(exports, "getJournalDir", { enumerable: true, get: function () { return paths_1.getJournalDir; } });
|
|
30
|
+
Object.defineProperty(exports, "getTasksDir", { enumerable: true, get: function () { return paths_1.getTasksDir; } });
|
|
31
|
+
Object.defineProperty(exports, "getBlobsDir", { enumerable: true, get: function () { return paths_1.getBlobsDir; } });
|
|
32
|
+
Object.defineProperty(exports, "getStateDir", { enumerable: true, get: function () { return paths_1.getStateDir; } });
|
|
33
|
+
Object.defineProperty(exports, "getStateFile", { enumerable: true, get: function () { return paths_1.getStateFile; } });
|
|
34
|
+
Object.defineProperty(exports, "getLockPath", { enumerable: true, get: function () { return paths_1.getLockPath; } });
|
|
35
|
+
var ulids_1 = require("./ulids");
|
|
36
|
+
Object.defineProperty(exports, "nextUlid", { enumerable: true, get: function () { return ulids_1.nextUlid; } });
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AppendEventOptions, AppendEventResult, JournalEvent } from "./types";
|
|
2
|
+
export declare function appendEvent(opts: AppendEventOptions): Promise<AppendEventResult>;
|
|
3
|
+
export declare function loadJournal(runDir: string): Promise<JournalEvent[]>;
|
|
4
|
+
//# sourceMappingURL=journal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journal.d.ts","sourceRoot":"","sources":["../../src/storage/journal.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,YAAY,EAAc,MAAM,SAAS,CAAC;AA0B1F,wBAAsB,WAAW,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA+BtF;AA2BD,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CA8BzE"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.appendEvent = appendEvent;
|
|
7
|
+
exports.loadJournal = loadJournal;
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
11
|
+
const paths_1 = require("./paths");
|
|
12
|
+
const atomic_1 = require("./atomic");
|
|
13
|
+
const ulids_1 = require("./ulids");
|
|
14
|
+
const clock_1 = require("./clock");
|
|
15
|
+
const icloudWarning_1 = require("./icloudWarning");
|
|
16
|
+
const discovery_1 = require("../session/discovery");
|
|
17
|
+
const sdkVersion_1 = require("../sdkVersion");
|
|
18
|
+
function formatSeq(seq) {
|
|
19
|
+
return seq.toString().padStart(6, "0");
|
|
20
|
+
}
|
|
21
|
+
async function getExistingSeqs(journalDir) {
|
|
22
|
+
try {
|
|
23
|
+
const entries = await fs_1.promises.readdir(journalDir);
|
|
24
|
+
return entries
|
|
25
|
+
.map((name) => Number(name.split(".")[0]))
|
|
26
|
+
.filter((n) => Number.isFinite(n));
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
const err = error;
|
|
30
|
+
if (err.code === "ENOENT")
|
|
31
|
+
return [];
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async function appendEvent(opts) {
|
|
36
|
+
const journalDir = (0, paths_1.getJournalDir)(opts.runDir);
|
|
37
|
+
await (0, icloudWarning_1.warnIfICloudDrivePath)(journalDir);
|
|
38
|
+
await fs_1.promises.mkdir(journalDir, { recursive: true });
|
|
39
|
+
const seqs = await getExistingSeqs(journalDir);
|
|
40
|
+
const seq = (seqs.length ? Math.max(...seqs) : 0) + 1;
|
|
41
|
+
const ulid = (0, ulids_1.nextUlid)();
|
|
42
|
+
const filename = `${formatSeq(seq)}.${ulid}.json`;
|
|
43
|
+
const recordedAt = (0, clock_1.getClockIsoString)();
|
|
44
|
+
const runHarness = await readRunHarness(opts.runDir);
|
|
45
|
+
const sessionId = (0, discovery_1.resolveAmbientSessionId)(runHarness);
|
|
46
|
+
const eventData = { ...opts.event };
|
|
47
|
+
if (runHarness && eventData.harness === undefined) {
|
|
48
|
+
eventData.harness = runHarness;
|
|
49
|
+
}
|
|
50
|
+
if (sessionId && eventData.sessionId === undefined) {
|
|
51
|
+
eventData.sessionId = sessionId;
|
|
52
|
+
}
|
|
53
|
+
const eventPayload = (0, sdkVersion_1.withSdkVersion)({
|
|
54
|
+
type: opts.eventType,
|
|
55
|
+
recordedAt,
|
|
56
|
+
data: eventData,
|
|
57
|
+
});
|
|
58
|
+
const contents = JSON.stringify(eventPayload, null, 2) + "\n";
|
|
59
|
+
const checksum = crypto_1.default.createHash("sha256").update(contents).digest("hex");
|
|
60
|
+
const payloadWithChecksum = JSON.stringify({ ...eventPayload, checksum }, null, 2) + "\n";
|
|
61
|
+
const targetPath = path_1.default.join(journalDir, filename);
|
|
62
|
+
await (0, atomic_1.writeFileAtomic)(targetPath, payloadWithChecksum);
|
|
63
|
+
return { seq, ulid, filename, checksum, path: targetPath, recordedAt };
|
|
64
|
+
}
|
|
65
|
+
async function readRunHarness(runDir) {
|
|
66
|
+
try {
|
|
67
|
+
const raw = await fs_1.promises.readFile(path_1.default.join(runDir, paths_1.RUN_METADATA_FILE), "utf8");
|
|
68
|
+
const parsed = JSON.parse(raw);
|
|
69
|
+
return typeof parsed.harness === "string" && parsed.harness.trim() !== ""
|
|
70
|
+
? parsed.harness
|
|
71
|
+
: undefined;
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
const err = error;
|
|
75
|
+
if (err.code === "ENOENT") {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function parseJournalFilename(filename) {
|
|
82
|
+
const [seqPart, ulidPart] = filename.replace(/\.json$/i, "").split(".");
|
|
83
|
+
const seq = Number(seqPart);
|
|
84
|
+
if (!Number.isFinite(seq) || !ulidPart) {
|
|
85
|
+
throw new Error(`Invalid journal filename: ${filename}`);
|
|
86
|
+
}
|
|
87
|
+
return { seq, ulid: ulidPart };
|
|
88
|
+
}
|
|
89
|
+
async function loadJournal(runDir) {
|
|
90
|
+
const journalDir = (0, paths_1.getJournalDir)(runDir);
|
|
91
|
+
try {
|
|
92
|
+
const entries = await fs_1.promises.readdir(journalDir);
|
|
93
|
+
const sorted = entries
|
|
94
|
+
.filter((name) => name.endsWith(".json"))
|
|
95
|
+
.sort();
|
|
96
|
+
const events = [];
|
|
97
|
+
for (const file of sorted) {
|
|
98
|
+
const { seq, ulid } = parseJournalFilename(file);
|
|
99
|
+
const fullPath = path_1.default.join(journalDir, file);
|
|
100
|
+
const raw = await parseJournalFile(fullPath);
|
|
101
|
+
events.push({
|
|
102
|
+
seq,
|
|
103
|
+
ulid,
|
|
104
|
+
filename: file,
|
|
105
|
+
path: fullPath,
|
|
106
|
+
type: raw.type ?? "UNKNOWN",
|
|
107
|
+
recordedAt: typeof raw.recordedAt === "string" ? raw.recordedAt : (0, clock_1.getClockIsoString)(),
|
|
108
|
+
sdkVersion: typeof raw.sdkVersion === "string" ? raw.sdkVersion : undefined,
|
|
109
|
+
data: raw.data ?? {},
|
|
110
|
+
checksum: typeof raw.checksum === "string" ? raw.checksum : undefined,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return events;
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
const err = error;
|
|
117
|
+
if (err.code === "ENOENT")
|
|
118
|
+
return [];
|
|
119
|
+
throw error;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async function parseJournalFile(fullPath) {
|
|
123
|
+
const contents = await fs_1.promises.readFile(fullPath, "utf8");
|
|
124
|
+
try {
|
|
125
|
+
return JSON.parse(contents);
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
const parseError = new Error(`Failed to parse journal file ${fullPath}: ${error.message}`);
|
|
129
|
+
parseError.code = "JOURNAL_PARSE_FAILED";
|
|
130
|
+
parseError.path = fullPath;
|
|
131
|
+
throw parseError;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RunLockInfo } from "./types";
|
|
2
|
+
export declare function acquireRunLock(runDir: string, owner: string): Promise<RunLockInfo>;
|
|
3
|
+
export declare function releaseRunLock(runDir: string): Promise<void>;
|
|
4
|
+
export declare function readRunLock(runDir: string): Promise<RunLockInfo | null>;
|
|
5
|
+
export interface WithRunLockOptions {
|
|
6
|
+
retries?: number;
|
|
7
|
+
delayMs?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function withRunLock<T>(runDir: string, owner: string, fn: () => Promise<T>, options?: WithRunLockOptions): Promise<T>;
|
|
10
|
+
//# sourceMappingURL=lock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../src/storage/lock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAKtC,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAmBxF;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,iBAGlD;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAU7E;AAWD,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,WAAW,CAAC,CAAC,EACjC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,CAAC,CAAC,CAuBZ"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.acquireRunLock = acquireRunLock;
|
|
4
|
+
exports.releaseRunLock = releaseRunLock;
|
|
5
|
+
exports.readRunLock = readRunLock;
|
|
6
|
+
exports.withRunLock = withRunLock;
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const paths_1 = require("./paths");
|
|
9
|
+
const clock_1 = require("./clock");
|
|
10
|
+
const processLiveness_1 = require("../utils/processLiveness");
|
|
11
|
+
async function acquireRunLock(runDir, owner) {
|
|
12
|
+
const lockPath = (0, paths_1.getLockPath)(runDir);
|
|
13
|
+
const lockInfo = { pid: process.pid, owner, acquiredAt: (0, clock_1.getClockIsoString)() };
|
|
14
|
+
try {
|
|
15
|
+
await fs_1.promises.writeFile(lockPath, JSON.stringify(lockInfo, null, 2) + "\n", { flag: "wx" });
|
|
16
|
+
return lockInfo;
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
const err = error;
|
|
20
|
+
if (err.code === "EEXIST") {
|
|
21
|
+
const existing = JSON.parse(await fs_1.promises.readFile(lockPath, "utf8"));
|
|
22
|
+
if (!(0, processLiveness_1.isProcessAlive)(existing.pid)) {
|
|
23
|
+
console.warn(`Stale lock detected: PID ${existing.pid} is no longer running. Cleaning up.`);
|
|
24
|
+
await fs_1.promises.unlink(lockPath);
|
|
25
|
+
return acquireRunLock(runDir, owner);
|
|
26
|
+
}
|
|
27
|
+
throw new Error(`run.lock already held by pid ${existing.pid} (${existing.owner})`);
|
|
28
|
+
}
|
|
29
|
+
throw err;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async function releaseRunLock(runDir) {
|
|
33
|
+
const lockPath = (0, paths_1.getLockPath)(runDir);
|
|
34
|
+
await fs_1.promises.rm(lockPath, { force: true });
|
|
35
|
+
}
|
|
36
|
+
async function readRunLock(runDir) {
|
|
37
|
+
const lockPath = (0, paths_1.getLockPath)(runDir);
|
|
38
|
+
try {
|
|
39
|
+
const data = await fs_1.promises.readFile(lockPath, "utf8");
|
|
40
|
+
return JSON.parse(data);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
const err = error;
|
|
44
|
+
if (err.code === "ENOENT")
|
|
45
|
+
return null;
|
|
46
|
+
throw err;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function isLockHeldError(error) {
|
|
50
|
+
if (!(error instanceof Error))
|
|
51
|
+
return false;
|
|
52
|
+
return error.message.startsWith("run.lock already held");
|
|
53
|
+
}
|
|
54
|
+
async function sleep(ms) {
|
|
55
|
+
await new Promise((resolve) => setTimeout(resolve, ms));
|
|
56
|
+
}
|
|
57
|
+
async function withRunLock(runDir, owner, fn, options = {}) {
|
|
58
|
+
const retries = typeof options.retries === "number" ? Math.max(0, Math.floor(options.retries)) : 40;
|
|
59
|
+
const delayMs = typeof options.delayMs === "number" ? Math.max(0, Math.floor(options.delayMs)) : 250;
|
|
60
|
+
let acquired = false;
|
|
61
|
+
for (let attempt = 0; attempt <= retries; attempt += 1) {
|
|
62
|
+
try {
|
|
63
|
+
await acquireRunLock(runDir, owner);
|
|
64
|
+
acquired = true;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
if (!isLockHeldError(error) || attempt === retries) {
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
71
|
+
await sleep(delayMs);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
return await fn();
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
if (acquired) {
|
|
79
|
+
await releaseRunLock(runDir);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const JOURNAL_DIR = "journal";
|
|
2
|
+
export declare const TASKS_DIR = "tasks";
|
|
3
|
+
export declare const BLOBS_DIR = "blobs";
|
|
4
|
+
export declare const STATE_DIR = "state";
|
|
5
|
+
export declare const ORPHANED_DIR = "orphaned";
|
|
6
|
+
export declare const PROCESS_DIR = "process";
|
|
7
|
+
export declare const RUN_METADATA_FILE = "run.json";
|
|
8
|
+
export declare const INPUTS_FILE = "inputs.json";
|
|
9
|
+
export declare const LOCK_FILE = "run.lock";
|
|
10
|
+
export declare const STATE_FILE = "state.json";
|
|
11
|
+
/**
|
|
12
|
+
* Default storage layout version.
|
|
13
|
+
* @see DEFAULTS.layoutVersion for the centralized default
|
|
14
|
+
*/
|
|
15
|
+
export declare const DEFAULT_LAYOUT_VERSION: string;
|
|
16
|
+
export declare function getRunDir(runsRoot: string, runId: string): string;
|
|
17
|
+
export declare function getJournalDir(runDir: string): string;
|
|
18
|
+
export declare function getTasksDir(runDir: string): string;
|
|
19
|
+
export declare function getBlobsDir(runDir: string): string;
|
|
20
|
+
export declare function getStateDir(runDir: string): string;
|
|
21
|
+
export declare function getStateFile(runDir: string): string;
|
|
22
|
+
export declare function getLockPath(runDir: string): string;
|
|
23
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/storage/paths.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,YAAY,CAAC;AACrC,eAAO,MAAM,SAAS,UAAU,CAAC;AACjC,eAAO,MAAM,SAAS,UAAU,CAAC;AACjC,eAAO,MAAM,SAAS,UAAU,CAAC;AACjC,eAAO,MAAM,YAAY,aAAa,CAAC;AACvC,eAAO,MAAM,WAAW,YAAY,CAAC;AACrC,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAC5C,eAAO,MAAM,WAAW,gBAAgB,CAAC;AACzC,eAAO,MAAM,SAAS,aAAa,CAAC;AACpC,eAAO,MAAM,UAAU,eAAe,CAAC;AAEvC;;;GAGG;AACH,eAAO,MAAM,sBAAsB,QAAyB,CAAC;AAE7D,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAElD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DEFAULT_LAYOUT_VERSION = exports.STATE_FILE = exports.LOCK_FILE = exports.INPUTS_FILE = exports.RUN_METADATA_FILE = exports.PROCESS_DIR = exports.ORPHANED_DIR = exports.STATE_DIR = exports.BLOBS_DIR = exports.TASKS_DIR = exports.JOURNAL_DIR = void 0;
|
|
7
|
+
exports.getRunDir = getRunDir;
|
|
8
|
+
exports.getJournalDir = getJournalDir;
|
|
9
|
+
exports.getTasksDir = getTasksDir;
|
|
10
|
+
exports.getBlobsDir = getBlobsDir;
|
|
11
|
+
exports.getStateDir = getStateDir;
|
|
12
|
+
exports.getStateFile = getStateFile;
|
|
13
|
+
exports.getLockPath = getLockPath;
|
|
14
|
+
const path_1 = __importDefault(require("path"));
|
|
15
|
+
const defaults_1 = require("../config/defaults");
|
|
16
|
+
exports.JOURNAL_DIR = "journal";
|
|
17
|
+
exports.TASKS_DIR = "tasks";
|
|
18
|
+
exports.BLOBS_DIR = "blobs";
|
|
19
|
+
exports.STATE_DIR = "state";
|
|
20
|
+
exports.ORPHANED_DIR = "orphaned";
|
|
21
|
+
exports.PROCESS_DIR = "process";
|
|
22
|
+
exports.RUN_METADATA_FILE = "run.json";
|
|
23
|
+
exports.INPUTS_FILE = "inputs.json";
|
|
24
|
+
exports.LOCK_FILE = "run.lock";
|
|
25
|
+
exports.STATE_FILE = "state.json";
|
|
26
|
+
/**
|
|
27
|
+
* Default storage layout version.
|
|
28
|
+
* @see DEFAULTS.layoutVersion for the centralized default
|
|
29
|
+
*/
|
|
30
|
+
exports.DEFAULT_LAYOUT_VERSION = defaults_1.DEFAULTS.layoutVersion;
|
|
31
|
+
function getRunDir(runsRoot, runId) {
|
|
32
|
+
return path_1.default.join(runsRoot, runId);
|
|
33
|
+
}
|
|
34
|
+
function getJournalDir(runDir) {
|
|
35
|
+
return path_1.default.join(runDir, exports.JOURNAL_DIR);
|
|
36
|
+
}
|
|
37
|
+
function getTasksDir(runDir) {
|
|
38
|
+
return path_1.default.join(runDir, exports.TASKS_DIR);
|
|
39
|
+
}
|
|
40
|
+
function getBlobsDir(runDir) {
|
|
41
|
+
return path_1.default.join(runDir, exports.BLOBS_DIR);
|
|
42
|
+
}
|
|
43
|
+
function getStateDir(runDir) {
|
|
44
|
+
return path_1.default.join(runDir, exports.STATE_DIR);
|
|
45
|
+
}
|
|
46
|
+
function getStateFile(runDir) {
|
|
47
|
+
return path_1.default.join(getStateDir(runDir), exports.STATE_FILE);
|
|
48
|
+
}
|
|
49
|
+
function getLockPath(runDir) {
|
|
50
|
+
return path_1.default.join(runDir, exports.LOCK_FILE);
|
|
51
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RunMetadata } from "./types";
|
|
2
|
+
export declare function readRunMetadata(runDir: string): Promise<RunMetadata>;
|
|
3
|
+
export declare function writeRunMetadata(runDir: string, metadata: RunMetadata): Promise<void>;
|
|
4
|
+
export declare function readRunInputs(runDir: string): Promise<unknown>;
|
|
5
|
+
export declare function writeRunOutput(runDir: string, output: unknown): Promise<string>;
|
|
6
|
+
//# sourceMappingURL=runFiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runFiles.d.ts","sourceRoot":"","sources":["../../src/storage/runFiles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAKtC,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAI1E;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAG3F;AAED,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAYpE;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,mBAMnE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.readRunMetadata = readRunMetadata;
|
|
7
|
+
exports.writeRunMetadata = writeRunMetadata;
|
|
8
|
+
exports.readRunInputs = readRunInputs;
|
|
9
|
+
exports.writeRunOutput = writeRunOutput;
|
|
10
|
+
const fs_1 = require("fs");
|
|
11
|
+
const path_1 = __importDefault(require("path"));
|
|
12
|
+
const paths_1 = require("./paths");
|
|
13
|
+
const atomic_1 = require("./atomic");
|
|
14
|
+
const OUTPUT_FILE = "output.json";
|
|
15
|
+
async function readRunMetadata(runDir) {
|
|
16
|
+
const metadataPath = path_1.default.join(runDir, paths_1.RUN_METADATA_FILE);
|
|
17
|
+
const raw = await fs_1.promises.readFile(metadataPath, "utf8");
|
|
18
|
+
return JSON.parse(raw);
|
|
19
|
+
}
|
|
20
|
+
async function writeRunMetadata(runDir, metadata) {
|
|
21
|
+
const metadataPath = path_1.default.join(runDir, paths_1.RUN_METADATA_FILE);
|
|
22
|
+
await (0, atomic_1.writeFileAtomic)(metadataPath, JSON.stringify(metadata, null, 2) + "\n");
|
|
23
|
+
}
|
|
24
|
+
async function readRunInputs(runDir) {
|
|
25
|
+
const inputsPath = path_1.default.join(runDir, paths_1.INPUTS_FILE);
|
|
26
|
+
try {
|
|
27
|
+
const raw = await fs_1.promises.readFile(inputsPath, "utf8");
|
|
28
|
+
return JSON.parse(raw);
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
const err = error;
|
|
32
|
+
if (err.code === "ENOENT") {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async function writeRunOutput(runDir, output) {
|
|
39
|
+
const stateDir = path_1.default.join(runDir, paths_1.STATE_DIR);
|
|
40
|
+
await fs_1.promises.mkdir(stateDir, { recursive: true });
|
|
41
|
+
const outputPath = path_1.default.join(stateDir, OUTPUT_FILE);
|
|
42
|
+
await (0, atomic_1.writeFileAtomic)(outputPath, JSON.stringify(output, null, 2) + "\n");
|
|
43
|
+
return path_1.default.relative(runDir, outputPath).replace(/\\/g, "/");
|
|
44
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { JsonRecord, StoredTaskResult } from "./types";
|
|
2
|
+
export declare function writeTaskDefinition(runDir: string, effectId: string, taskDef: JsonRecord): Promise<string>;
|
|
3
|
+
export declare function readTaskDefinition(runDir: string, effectId: string): Promise<JsonRecord | undefined>;
|
|
4
|
+
export declare function readTaskResult(runDir: string, effectId: string, resultRef?: string): Promise<StoredTaskResult | undefined>;
|
|
5
|
+
export interface WriteTaskResultOptions {
|
|
6
|
+
runDir: string;
|
|
7
|
+
effectId: string;
|
|
8
|
+
result: StoredTaskResult;
|
|
9
|
+
stdout?: string;
|
|
10
|
+
stderr?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function writeTaskResult(options: WriteTaskResultOptions): Promise<{
|
|
13
|
+
resultRef: string;
|
|
14
|
+
stdoutRef: string | undefined;
|
|
15
|
+
stderrRef: string | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=tasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/storage/tasks.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAQvD,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,mBAM9F;AAED,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAY1G;AAED,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAgBvC;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,sBAAsB;;;;GAuBpE"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.writeTaskDefinition = writeTaskDefinition;
|
|
7
|
+
exports.readTaskDefinition = readTaskDefinition;
|
|
8
|
+
exports.readTaskResult = readTaskResult;
|
|
9
|
+
exports.writeTaskResult = writeTaskResult;
|
|
10
|
+
const fs_1 = require("fs");
|
|
11
|
+
const path_1 = __importDefault(require("path"));
|
|
12
|
+
const paths_1 = require("./paths");
|
|
13
|
+
const atomic_1 = require("./atomic");
|
|
14
|
+
const sdkVersion_1 = require("../sdkVersion");
|
|
15
|
+
function resolveTaskPath(runDir, effectId, relative) {
|
|
16
|
+
return path_1.default.join((0, paths_1.getTasksDir)(runDir), effectId, relative);
|
|
17
|
+
}
|
|
18
|
+
async function writeTaskDefinition(runDir, effectId, taskDef) {
|
|
19
|
+
const taskDir = path_1.default.join((0, paths_1.getTasksDir)(runDir), effectId);
|
|
20
|
+
await fs_1.promises.mkdir(taskDir, { recursive: true });
|
|
21
|
+
const taskPath = path_1.default.join(taskDir, "task.json");
|
|
22
|
+
await (0, atomic_1.writeFileAtomic)(taskPath, JSON.stringify((0, sdkVersion_1.withSdkVersion)(taskDef), null, 2) + "\n");
|
|
23
|
+
return path_1.default.relative(runDir, taskPath).replace(/\\/g, "/");
|
|
24
|
+
}
|
|
25
|
+
async function readTaskDefinition(runDir, effectId) {
|
|
26
|
+
const taskPath = resolveTaskPath(runDir, effectId, "task.json");
|
|
27
|
+
try {
|
|
28
|
+
const raw = await fs_1.promises.readFile(taskPath, "utf8");
|
|
29
|
+
return JSON.parse(raw);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
const err = error;
|
|
33
|
+
if (err.code === "ENOENT") {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function readTaskResult(runDir, effectId, resultRef) {
|
|
40
|
+
const resolvedPath = resultRef
|
|
41
|
+
? path_1.default.isAbsolute(resultRef)
|
|
42
|
+
? resultRef
|
|
43
|
+
: path_1.default.join(runDir, resultRef)
|
|
44
|
+
: resolveTaskPath(runDir, effectId, "result.json");
|
|
45
|
+
try {
|
|
46
|
+
const raw = await fs_1.promises.readFile(resolvedPath, "utf8");
|
|
47
|
+
return JSON.parse(raw);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
const err = error;
|
|
51
|
+
if (err.code === "ENOENT") {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async function writeTaskResult(options) {
|
|
58
|
+
const taskDir = path_1.default.join((0, paths_1.getTasksDir)(options.runDir), options.effectId);
|
|
59
|
+
await fs_1.promises.mkdir(taskDir, { recursive: true });
|
|
60
|
+
const resultPath = path_1.default.join(taskDir, "result.json");
|
|
61
|
+
const relativeResultPath = path_1.default.relative(options.runDir, resultPath).replace(/\\/g, "/");
|
|
62
|
+
const stdoutRef = await writeTextIfProvided(options.runDir, options.effectId, "stdout.log", options.stdout);
|
|
63
|
+
const stderrRef = await writeTextIfProvided(options.runDir, options.effectId, "stderr.log", options.stderr);
|
|
64
|
+
if (stdoutRef && !options.result.stdoutRef) {
|
|
65
|
+
options.result.stdoutRef = stdoutRef;
|
|
66
|
+
}
|
|
67
|
+
if (stderrRef && !options.result.stderrRef) {
|
|
68
|
+
options.result.stderrRef = stderrRef;
|
|
69
|
+
}
|
|
70
|
+
await (0, atomic_1.writeFileAtomic)(resultPath, JSON.stringify((0, sdkVersion_1.withSdkVersion)(options.result), null, 2) + "\n");
|
|
71
|
+
return {
|
|
72
|
+
resultRef: relativeResultPath,
|
|
73
|
+
stdoutRef,
|
|
74
|
+
stderrRef,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
async function writeTextIfProvided(runDir, effectId, filename, contents) {
|
|
78
|
+
if (typeof contents !== "string")
|
|
79
|
+
return undefined;
|
|
80
|
+
const filePath = resolveTaskPath(runDir, effectId, filename);
|
|
81
|
+
await (0, atomic_1.writeFileAtomic)(filePath, contents);
|
|
82
|
+
return path_1.default.relative(runDir, filePath).replace(/\\/g, "/");
|
|
83
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { Stats } from "fs";
|
|
2
|
+
export type JsonRecord = Record<string, unknown>;
|
|
3
|
+
export interface RunEntrypointMetadata {
|
|
4
|
+
importPath: string;
|
|
5
|
+
exportName?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface RunMetadata extends JsonRecord {
|
|
8
|
+
runId: string;
|
|
9
|
+
request: string;
|
|
10
|
+
processId: string;
|
|
11
|
+
sdkVersion?: string;
|
|
12
|
+
harness?: string;
|
|
13
|
+
nested?: {
|
|
14
|
+
parentRunId: string;
|
|
15
|
+
parentEffectId?: string;
|
|
16
|
+
parentInvocationKey?: string;
|
|
17
|
+
sessionId?: string;
|
|
18
|
+
shareSession?: boolean;
|
|
19
|
+
};
|
|
20
|
+
entrypoint: RunEntrypointMetadata;
|
|
21
|
+
processPath?: string;
|
|
22
|
+
processRevision?: string;
|
|
23
|
+
layoutVersion: string;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
completionProof?: string;
|
|
26
|
+
prompt?: string;
|
|
27
|
+
inputSchema?: Record<string, unknown>;
|
|
28
|
+
outputSchema?: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
export interface CreateRunDirOptions {
|
|
31
|
+
runsRoot: string;
|
|
32
|
+
runId: string;
|
|
33
|
+
request: string;
|
|
34
|
+
processId?: string;
|
|
35
|
+
harness?: string;
|
|
36
|
+
nested?: {
|
|
37
|
+
parentRunId: string;
|
|
38
|
+
parentEffectId?: string;
|
|
39
|
+
parentInvocationKey?: string;
|
|
40
|
+
sessionId?: string;
|
|
41
|
+
shareSession?: boolean;
|
|
42
|
+
};
|
|
43
|
+
entrypoint?: {
|
|
44
|
+
importPath: string;
|
|
45
|
+
exportName?: string;
|
|
46
|
+
};
|
|
47
|
+
processPath?: string;
|
|
48
|
+
processRevision?: string;
|
|
49
|
+
layoutVersion?: string;
|
|
50
|
+
inputs?: unknown;
|
|
51
|
+
extraMetadata?: Record<string, unknown>;
|
|
52
|
+
prompt?: string;
|
|
53
|
+
inputSchema?: Record<string, unknown>;
|
|
54
|
+
outputSchema?: Record<string, unknown>;
|
|
55
|
+
}
|
|
56
|
+
export interface AppendEventOptions {
|
|
57
|
+
runDir: string;
|
|
58
|
+
event: JsonRecord;
|
|
59
|
+
eventType: string;
|
|
60
|
+
}
|
|
61
|
+
export interface AppendEventResult {
|
|
62
|
+
seq: number;
|
|
63
|
+
ulid: string;
|
|
64
|
+
filename: string;
|
|
65
|
+
checksum: string;
|
|
66
|
+
path: string;
|
|
67
|
+
recordedAt: string;
|
|
68
|
+
}
|
|
69
|
+
export interface DiskUsageReport {
|
|
70
|
+
totalBytes: number;
|
|
71
|
+
journalBytes: number;
|
|
72
|
+
tasksBytes: number;
|
|
73
|
+
blobsBytes: number;
|
|
74
|
+
stateBytes: number;
|
|
75
|
+
}
|
|
76
|
+
export interface OrphanedBlobInfo {
|
|
77
|
+
hash: string;
|
|
78
|
+
bytes: number;
|
|
79
|
+
path: string;
|
|
80
|
+
}
|
|
81
|
+
export interface RunLockInfo {
|
|
82
|
+
pid: number;
|
|
83
|
+
owner: string;
|
|
84
|
+
acquiredAt: string;
|
|
85
|
+
}
|
|
86
|
+
export type FileStatGetter = (path: string) => Promise<Stats>;
|
|
87
|
+
export interface JournalEvent {
|
|
88
|
+
seq: number;
|
|
89
|
+
ulid: string;
|
|
90
|
+
filename: string;
|
|
91
|
+
path: string;
|
|
92
|
+
type: string;
|
|
93
|
+
recordedAt: string;
|
|
94
|
+
sdkVersion?: string;
|
|
95
|
+
data: JsonRecord;
|
|
96
|
+
checksum?: string;
|
|
97
|
+
}
|
|
98
|
+
export interface StoredTaskResult {
|
|
99
|
+
schemaVersion: string;
|
|
100
|
+
effectId: string;
|
|
101
|
+
taskId: string;
|
|
102
|
+
invocationKey: string;
|
|
103
|
+
sdkVersion?: string;
|
|
104
|
+
status: "ok" | "error" | "cancelled";
|
|
105
|
+
result?: unknown;
|
|
106
|
+
value?: unknown;
|
|
107
|
+
resultRef?: string;
|
|
108
|
+
error?: {
|
|
109
|
+
name?: string;
|
|
110
|
+
message?: string;
|
|
111
|
+
stack?: string;
|
|
112
|
+
data?: unknown;
|
|
113
|
+
};
|
|
114
|
+
reason?: string;
|
|
115
|
+
stdoutRef?: string;
|
|
116
|
+
stderrRef?: string;
|
|
117
|
+
startedAt?: string;
|
|
118
|
+
finishedAt?: string;
|
|
119
|
+
metadata?: JsonRecord;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/storage/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC;AAE3B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB,CAAC;IACF,UAAU,EAAE,qBAAqB,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB,CAAC;IACF,UAAU,CAAC,EAAE;QACX,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC;AAE9D,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,IAAI,GAAG,OAAO,GAAG,WAAW,CAAC;IACrC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,OAAO,CAAC;KAChB,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB"}
|