@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,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* density-filter — sentence-level compression with FNV-1a deduplication.
|
|
4
|
+
*
|
|
5
|
+
* Used for user-prompt compression (userPromptHook) and sdk-context
|
|
6
|
+
* compression (sdkContextHook) where no query context is available.
|
|
7
|
+
* Selects sentences by length-based score within a token budget.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.estimateTokens = estimateTokens;
|
|
11
|
+
exports.densityFilterText = densityFilterText;
|
|
12
|
+
const BOILERPLATE = [
|
|
13
|
+
'copyright', 'all rights reserved', 'disclaimer',
|
|
14
|
+
'terms of use', 'privacy policy', 'proprietary',
|
|
15
|
+
'confidential', 'trademark',
|
|
16
|
+
];
|
|
17
|
+
function estimateTokens(text) {
|
|
18
|
+
return (text.match(/[\p{L}\p{N}]+|[^\s]/gu) ?? []).length;
|
|
19
|
+
}
|
|
20
|
+
function splitSentences(text) {
|
|
21
|
+
const out = [];
|
|
22
|
+
let cur = '';
|
|
23
|
+
for (const ch of text) {
|
|
24
|
+
if (ch === '\n' || ch === '.' || ch === '!' || ch === '?') {
|
|
25
|
+
if (ch !== '\n')
|
|
26
|
+
cur += ch;
|
|
27
|
+
const t = cur.trim();
|
|
28
|
+
if (t)
|
|
29
|
+
out.push(t);
|
|
30
|
+
cur = '';
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
cur += ch;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const t = cur.trim();
|
|
37
|
+
if (t)
|
|
38
|
+
out.push(t);
|
|
39
|
+
return out;
|
|
40
|
+
}
|
|
41
|
+
function fnv1a(s) {
|
|
42
|
+
let h = 14695981039346656037n;
|
|
43
|
+
for (let i = 0; i < s.length; i++) {
|
|
44
|
+
h = BigInt.asUintN(64, (h ^ BigInt(s.charCodeAt(i))) * 1099511628211n);
|
|
45
|
+
}
|
|
46
|
+
return h;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Density-filter text to the target token budget.
|
|
50
|
+
*
|
|
51
|
+
* Scores sentences by length (longer = higher score, capped at 40 tokens).
|
|
52
|
+
* Deduplicates by FNV-1a hash. Reconstructs in original document order.
|
|
53
|
+
*
|
|
54
|
+
* @param text Input text to compress.
|
|
55
|
+
* @param targetReduction Fraction to remove (0–1). E.g. 0.22 removes ~22%.
|
|
56
|
+
* @returns Compressed text, or original if nothing could be filtered.
|
|
57
|
+
*/
|
|
58
|
+
function densityFilterText(text, targetReduction) {
|
|
59
|
+
const sentences = splitSentences(text);
|
|
60
|
+
if (sentences.length === 0)
|
|
61
|
+
return text;
|
|
62
|
+
const totalTokens = estimateTokens(text);
|
|
63
|
+
const tokenBudget = Math.max(80, Math.round(totalTokens * (1 - targetReduction)));
|
|
64
|
+
const seen = new Set();
|
|
65
|
+
const features = [];
|
|
66
|
+
for (let i = 0; i < sentences.length; i++) {
|
|
67
|
+
const s = sentences[i];
|
|
68
|
+
const h = fnv1a(s.toLowerCase().replace(/\s+/g, ' ').trim());
|
|
69
|
+
if (seen.has(h))
|
|
70
|
+
continue;
|
|
71
|
+
seen.add(h);
|
|
72
|
+
const tc = estimateTokens(s);
|
|
73
|
+
const isBoilerplate = BOILERPLATE.some(p => s.toLowerCase().includes(p));
|
|
74
|
+
features.push({ index: i, tokenCount: tc, score: Math.min(tc, 40) / 40 - (isBoilerplate ? 0.5 : 0) });
|
|
75
|
+
}
|
|
76
|
+
const sorted = [...features].sort((a, b) => b.score - a.score);
|
|
77
|
+
const kept = [];
|
|
78
|
+
let used = 0;
|
|
79
|
+
for (const f of sorted) {
|
|
80
|
+
if (kept.length >= 500)
|
|
81
|
+
break;
|
|
82
|
+
if (used + f.tokenCount <= tokenBudget) {
|
|
83
|
+
kept.push(f.index);
|
|
84
|
+
used += f.tokenCount;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (kept.length === 0)
|
|
88
|
+
return text;
|
|
89
|
+
kept.sort((a, b) => a - b);
|
|
90
|
+
return kept.map(i => sentences[i]).join(' ');
|
|
91
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* library-cache — compress-and-cache process library files (processLibraryCache layer).
|
|
3
|
+
*
|
|
4
|
+
* On first access (or after TTL expiry) a file is read, compressed with
|
|
5
|
+
* densityFilterText, and written to .a5c/cache/compression/<hash>.json.
|
|
6
|
+
* Subsequent reads within TTL are served from cache with zero re-compression cost.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Return compressed content for `filePath`, reading from cache when fresh.
|
|
10
|
+
* On cache miss: reads, compresses, writes to cache, returns compressed content.
|
|
11
|
+
* Returns null if the file doesn't exist or can't be read.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getOrCompressFile(filePath: string, targetReduction: number, ttlHours: number, cacheDir: string): string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Find all SKILL.md and AGENT.md files under `rootDir` (max depth 6).
|
|
16
|
+
* Used by the session-start hook to pre-warm the cache.
|
|
17
|
+
*/
|
|
18
|
+
export declare function findLibraryFiles(rootDir: string): string[];
|
|
19
|
+
//# sourceMappingURL=library-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-cache.d.ts","sourceRoot":"","sources":["../../src/compression/library-cache.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA6CH;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,IAAI,CA0Bf;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAgC1D"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* library-cache — compress-and-cache process library files (processLibraryCache layer).
|
|
4
|
+
*
|
|
5
|
+
* On first access (or after TTL expiry) a file is read, compressed with
|
|
6
|
+
* densityFilterText, and written to .a5c/cache/compression/<hash>.json.
|
|
7
|
+
* Subsequent reads within TTL are served from cache with zero re-compression cost.
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.getOrCompressFile = getOrCompressFile;
|
|
44
|
+
exports.findLibraryFiles = findLibraryFiles;
|
|
45
|
+
const node_fs_1 = require("node:fs");
|
|
46
|
+
const path = __importStar(require("node:path"));
|
|
47
|
+
const crypto = __importStar(require("node:crypto"));
|
|
48
|
+
const density_filter_1 = require("./density-filter");
|
|
49
|
+
function cacheEntryPath(cacheDir, filePath) {
|
|
50
|
+
const hash = crypto.createHash('sha256').update(path.resolve(filePath)).digest('hex').slice(0, 16);
|
|
51
|
+
return path.join(cacheDir, `${hash}.json`);
|
|
52
|
+
}
|
|
53
|
+
function isCacheExpired(compressedAt, ttlHours) {
|
|
54
|
+
return Date.now() - new Date(compressedAt).getTime() > ttlHours * 3_600_000;
|
|
55
|
+
}
|
|
56
|
+
function readCache(cacheDir, filePath, ttlHours) {
|
|
57
|
+
const entryPath = cacheEntryPath(cacheDir, filePath);
|
|
58
|
+
if (!(0, node_fs_1.existsSync)(entryPath))
|
|
59
|
+
return null;
|
|
60
|
+
try {
|
|
61
|
+
const entry = JSON.parse((0, node_fs_1.readFileSync)(entryPath, 'utf8'));
|
|
62
|
+
if (isCacheExpired(entry.compressedAt, ttlHours))
|
|
63
|
+
return null;
|
|
64
|
+
return entry.compressedContent;
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function writeCache(cacheDir, filePath, entry) {
|
|
71
|
+
try {
|
|
72
|
+
(0, node_fs_1.mkdirSync)(cacheDir, { recursive: true });
|
|
73
|
+
(0, node_fs_1.writeFileSync)(cacheEntryPath(cacheDir, filePath), JSON.stringify(entry, null, 2), 'utf8');
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
// Best-effort
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Return compressed content for `filePath`, reading from cache when fresh.
|
|
81
|
+
* On cache miss: reads, compresses, writes to cache, returns compressed content.
|
|
82
|
+
* Returns null if the file doesn't exist or can't be read.
|
|
83
|
+
*/
|
|
84
|
+
function getOrCompressFile(filePath, targetReduction, ttlHours, cacheDir) {
|
|
85
|
+
const resolved = path.resolve(filePath);
|
|
86
|
+
if (!(0, node_fs_1.existsSync)(resolved))
|
|
87
|
+
return null;
|
|
88
|
+
const cached = readCache(cacheDir, resolved, ttlHours);
|
|
89
|
+
if (cached !== null)
|
|
90
|
+
return cached;
|
|
91
|
+
let content;
|
|
92
|
+
try {
|
|
93
|
+
content = (0, node_fs_1.readFileSync)(resolved, 'utf8');
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
const originalTokens = (0, density_filter_1.estimateTokens)(content);
|
|
99
|
+
const compressedContent = originalTokens > 50 ? (0, density_filter_1.densityFilterText)(content, targetReduction) : content;
|
|
100
|
+
writeCache(cacheDir, resolved, {
|
|
101
|
+
filePath: resolved,
|
|
102
|
+
compressedContent,
|
|
103
|
+
originalTokens,
|
|
104
|
+
compressedTokens: (0, density_filter_1.estimateTokens)(compressedContent),
|
|
105
|
+
compressedAt: new Date().toISOString(),
|
|
106
|
+
});
|
|
107
|
+
return compressedContent;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Find all SKILL.md and AGENT.md files under `rootDir` (max depth 6).
|
|
111
|
+
* Used by the session-start hook to pre-warm the cache.
|
|
112
|
+
*/
|
|
113
|
+
function findLibraryFiles(rootDir) {
|
|
114
|
+
const results = [];
|
|
115
|
+
const LIBRARY_FILENAMES = new Set(['SKILL.md', 'AGENT.md']);
|
|
116
|
+
function scan(dir, depth) {
|
|
117
|
+
if (depth > 6)
|
|
118
|
+
return;
|
|
119
|
+
let names;
|
|
120
|
+
try {
|
|
121
|
+
names = (0, node_fs_1.readdirSync)(dir);
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
for (const name of names) {
|
|
127
|
+
if (name.startsWith('.') && name !== '.claude')
|
|
128
|
+
continue;
|
|
129
|
+
if (name === 'node_modules')
|
|
130
|
+
continue;
|
|
131
|
+
const fullPath = path.join(dir, name);
|
|
132
|
+
let isDir = false;
|
|
133
|
+
try {
|
|
134
|
+
isDir = (0, node_fs_1.statSync)(fullPath).isDirectory();
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
if (isDir) {
|
|
140
|
+
scan(fullPath, depth + 1);
|
|
141
|
+
}
|
|
142
|
+
else if (LIBRARY_FILENAMES.has(name)) {
|
|
143
|
+
results.push(fullPath);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
scan(rootDir, 0);
|
|
148
|
+
return results;
|
|
149
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration validation and construction helpers.
|
|
3
|
+
* Extracted from defaults.ts for max-lines compliance.
|
|
4
|
+
*/
|
|
5
|
+
import type { BabysitterConfig, ConfigValidationResult, LogLevel } from "./defaults";
|
|
6
|
+
/**
|
|
7
|
+
* Retrieves configuration with environment variable overrides merged in.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getConfig(overrides?: Partial<BabysitterConfig>): BabysitterConfig;
|
|
10
|
+
/**
|
|
11
|
+
* Validates a configuration object for correctness.
|
|
12
|
+
*/
|
|
13
|
+
export declare function validateConfig(config: BabysitterConfig): ConfigValidationResult;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a frozen copy of the defaults for safe external use.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getDefaults(): Readonly<BabysitterConfig>;
|
|
18
|
+
/**
|
|
19
|
+
* Checks if a value is a valid log level.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isValidLogLevel(value: unknown): value is LogLevel;
|
|
22
|
+
//# sourceMappingURL=configValidation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configValidation.d.ts","sourceRoot":"","sources":["../../src/config/configValidation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAwCrF;;GAEG;AACH,wBAAgB,SAAS,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,gBAAgB,CAqCjF;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,sBAAsB,CA+D/E;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAAC,gBAAgB,CAAC,CAExD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAEjE"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Configuration validation and construction helpers.
|
|
4
|
+
* Extracted from defaults.ts for max-lines compliance.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.getConfig = getConfig;
|
|
8
|
+
exports.validateConfig = validateConfig;
|
|
9
|
+
exports.getDefaults = getDefaults;
|
|
10
|
+
exports.isValidLogLevel = isValidLogLevel;
|
|
11
|
+
const defaults_1 = require("./defaults");
|
|
12
|
+
const runs_1 = require("./runs");
|
|
13
|
+
/**
|
|
14
|
+
* Valid log levels for validation
|
|
15
|
+
*/
|
|
16
|
+
const VALID_LOG_LEVELS = ["debug", "info", "warn", "error", "silent"];
|
|
17
|
+
/**
|
|
18
|
+
* Parses an environment variable as a boolean.
|
|
19
|
+
*/
|
|
20
|
+
function parseEnvBoolean(value) {
|
|
21
|
+
if (!value)
|
|
22
|
+
return false;
|
|
23
|
+
const normalized = value.trim().toLowerCase();
|
|
24
|
+
return normalized === "1" || normalized === "true";
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Parses an environment variable as a positive integer.
|
|
28
|
+
*/
|
|
29
|
+
function parseEnvPositiveInt(value, fallback) {
|
|
30
|
+
if (!value)
|
|
31
|
+
return fallback;
|
|
32
|
+
const parsed = parseInt(value.trim(), 10);
|
|
33
|
+
if (!Number.isFinite(parsed) || parsed <= 0)
|
|
34
|
+
return fallback;
|
|
35
|
+
return parsed;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Parses an environment variable as a log level.
|
|
39
|
+
*/
|
|
40
|
+
function parseEnvLogLevel(value, fallback) {
|
|
41
|
+
if (!value)
|
|
42
|
+
return fallback;
|
|
43
|
+
const normalized = value.trim().toLowerCase();
|
|
44
|
+
if (VALID_LOG_LEVELS.includes(normalized)) {
|
|
45
|
+
return normalized;
|
|
46
|
+
}
|
|
47
|
+
return fallback;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Retrieves configuration with environment variable overrides merged in.
|
|
51
|
+
*/
|
|
52
|
+
function getConfig(overrides) {
|
|
53
|
+
const env = typeof process !== "undefined" ? process.env : {};
|
|
54
|
+
return {
|
|
55
|
+
runsDir: overrides?.runsDir ?? (0, runs_1.resolveRunsDir)(),
|
|
56
|
+
maxIterations: overrides?.maxIterations ??
|
|
57
|
+
parseEnvPositiveInt(env[defaults_1.CONFIG_ENV_VARS.MAX_ITERATIONS], defaults_1.DEFAULTS.maxIterations),
|
|
58
|
+
qualityThreshold: overrides?.qualityThreshold ??
|
|
59
|
+
parseEnvPositiveInt(env[defaults_1.CONFIG_ENV_VARS.QUALITY_THRESHOLD], defaults_1.DEFAULTS.qualityThreshold),
|
|
60
|
+
timeout: overrides?.timeout ?? parseEnvPositiveInt(env[defaults_1.CONFIG_ENV_VARS.TIMEOUT], defaults_1.DEFAULTS.timeout),
|
|
61
|
+
logLevel: overrides?.logLevel ?? parseEnvLogLevel(env[defaults_1.CONFIG_ENV_VARS.LOG_LEVEL], defaults_1.DEFAULTS.logLevel),
|
|
62
|
+
allowSecretLogs: overrides?.allowSecretLogs ?? parseEnvBoolean(env[defaults_1.CONFIG_ENV_VARS.ALLOW_SECRET_LOGS]),
|
|
63
|
+
hookTimeout: overrides?.hookTimeout ?? parseEnvPositiveInt(env[defaults_1.CONFIG_ENV_VARS.HOOK_TIMEOUT], defaults_1.DEFAULTS.hookTimeout),
|
|
64
|
+
nodeTaskTimeout: overrides?.nodeTaskTimeout ??
|
|
65
|
+
parseEnvPositiveInt(env[defaults_1.CONFIG_ENV_VARS.NODE_TASK_TIMEOUT], defaults_1.DEFAULTS.nodeTaskTimeout),
|
|
66
|
+
clockStepMs: overrides?.clockStepMs ?? defaults_1.DEFAULTS.clockStepMs,
|
|
67
|
+
clockStartMs: overrides?.clockStartMs ?? defaults_1.DEFAULTS.clockStartMs,
|
|
68
|
+
layoutVersion: overrides?.layoutVersion ?? defaults_1.DEFAULTS.layoutVersion,
|
|
69
|
+
largeResultPreviewLimit: overrides?.largeResultPreviewLimit ?? defaults_1.DEFAULTS.largeResultPreviewLimit,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Validates a configuration object for correctness.
|
|
74
|
+
*/
|
|
75
|
+
function validateConfig(config) {
|
|
76
|
+
const errors = [];
|
|
77
|
+
const warnings = [];
|
|
78
|
+
if (!config.runsDir || typeof config.runsDir !== "string") {
|
|
79
|
+
errors.push("runsDir must be a non-empty string");
|
|
80
|
+
}
|
|
81
|
+
if (!Number.isFinite(config.maxIterations) || config.maxIterations <= 0) {
|
|
82
|
+
errors.push("maxIterations must be a positive finite number");
|
|
83
|
+
}
|
|
84
|
+
else if (config.maxIterations > 10000) {
|
|
85
|
+
warnings.push("maxIterations is unusually high (>10000), this may cause performance issues");
|
|
86
|
+
}
|
|
87
|
+
if (!Number.isFinite(config.qualityThreshold) || config.qualityThreshold < 0 || config.qualityThreshold > 100) {
|
|
88
|
+
errors.push("qualityThreshold must be a number between 0 and 100");
|
|
89
|
+
}
|
|
90
|
+
if (!Number.isFinite(config.timeout) || config.timeout <= 0) {
|
|
91
|
+
errors.push("timeout must be a positive finite number");
|
|
92
|
+
}
|
|
93
|
+
else if (config.timeout < 1000) {
|
|
94
|
+
warnings.push("timeout is very short (<1s), tasks may fail prematurely");
|
|
95
|
+
}
|
|
96
|
+
if (!VALID_LOG_LEVELS.includes(config.logLevel)) {
|
|
97
|
+
errors.push(`logLevel must be one of: ${VALID_LOG_LEVELS.join(", ")}`);
|
|
98
|
+
}
|
|
99
|
+
if (typeof config.allowSecretLogs !== "boolean") {
|
|
100
|
+
errors.push("allowSecretLogs must be a boolean");
|
|
101
|
+
}
|
|
102
|
+
else if (config.allowSecretLogs) {
|
|
103
|
+
warnings.push("allowSecretLogs is enabled - sensitive data may be exposed in logs");
|
|
104
|
+
}
|
|
105
|
+
if (!Number.isFinite(config.hookTimeout) || config.hookTimeout <= 0) {
|
|
106
|
+
errors.push("hookTimeout must be a positive finite number");
|
|
107
|
+
}
|
|
108
|
+
if (!Number.isFinite(config.nodeTaskTimeout) || config.nodeTaskTimeout <= 0) {
|
|
109
|
+
errors.push("nodeTaskTimeout must be a positive finite number");
|
|
110
|
+
}
|
|
111
|
+
if (!Number.isFinite(config.clockStepMs) || config.clockStepMs <= 0) {
|
|
112
|
+
errors.push("clockStepMs must be a positive finite number");
|
|
113
|
+
}
|
|
114
|
+
if (!Number.isFinite(config.clockStartMs) || config.clockStartMs < 0) {
|
|
115
|
+
errors.push("clockStartMs must be a non-negative finite number");
|
|
116
|
+
}
|
|
117
|
+
if (!config.layoutVersion || typeof config.layoutVersion !== "string") {
|
|
118
|
+
errors.push("layoutVersion must be a non-empty string");
|
|
119
|
+
}
|
|
120
|
+
if (!Number.isFinite(config.largeResultPreviewLimit) || config.largeResultPreviewLimit <= 0) {
|
|
121
|
+
errors.push("largeResultPreviewLimit must be a positive finite number");
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
valid: errors.length === 0,
|
|
125
|
+
errors,
|
|
126
|
+
warnings,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Creates a frozen copy of the defaults for safe external use.
|
|
131
|
+
*/
|
|
132
|
+
function getDefaults() {
|
|
133
|
+
return { ...defaults_1.DEFAULTS };
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Checks if a value is a valid log level.
|
|
137
|
+
*/
|
|
138
|
+
function isValidLogLevel(value) {
|
|
139
|
+
return typeof value === "string" && VALID_LOG_LEVELS.includes(value);
|
|
140
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized Configuration Defaults for Babysitter SDK
|
|
3
|
+
*
|
|
4
|
+
* This module serves as the single source of truth for all default configuration
|
|
5
|
+
* values used throughout the babysitter SDK. Import from here instead of using
|
|
6
|
+
* scattered magic numbers and strings.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Log level type for SDK logging configuration
|
|
10
|
+
*/
|
|
11
|
+
export type LogLevel = "debug" | "info" | "warn" | "error" | "silent";
|
|
12
|
+
/**
|
|
13
|
+
* Complete configuration interface for the Babysitter SDK
|
|
14
|
+
*/
|
|
15
|
+
export interface BabysitterConfig {
|
|
16
|
+
runsDir: string;
|
|
17
|
+
maxIterations: number;
|
|
18
|
+
qualityThreshold: number;
|
|
19
|
+
timeout: number;
|
|
20
|
+
logLevel: LogLevel;
|
|
21
|
+
allowSecretLogs: boolean;
|
|
22
|
+
hookTimeout: number;
|
|
23
|
+
nodeTaskTimeout: number;
|
|
24
|
+
clockStepMs: number;
|
|
25
|
+
clockStartMs: number;
|
|
26
|
+
layoutVersion: string;
|
|
27
|
+
largeResultPreviewLimit: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Validation result for configuration checks
|
|
31
|
+
*/
|
|
32
|
+
export interface ConfigValidationResult {
|
|
33
|
+
valid: boolean;
|
|
34
|
+
errors: string[];
|
|
35
|
+
warnings: string[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Environment variable names for configuration overrides
|
|
39
|
+
*/
|
|
40
|
+
export declare const CONFIG_ENV_VARS: {
|
|
41
|
+
readonly RUNS_DIR: "BABYSITTER_RUNS_DIR";
|
|
42
|
+
readonly RUNS_SCOPE: "BABYSITTER_RUNS_SCOPE";
|
|
43
|
+
readonly MAX_ITERATIONS: "BABYSITTER_MAX_ITERATIONS";
|
|
44
|
+
readonly QUALITY_THRESHOLD: "BABYSITTER_QUALITY_THRESHOLD";
|
|
45
|
+
readonly TIMEOUT: "BABYSITTER_TIMEOUT";
|
|
46
|
+
readonly LOG_LEVEL: "BABYSITTER_LOG_LEVEL";
|
|
47
|
+
readonly ALLOW_SECRET_LOGS: "BABYSITTER_ALLOW_SECRET_LOGS";
|
|
48
|
+
readonly HOOK_TIMEOUT: "BABYSITTER_HOOK_TIMEOUT";
|
|
49
|
+
readonly NODE_TASK_TIMEOUT: "BABYSITTER_NODE_TASK_TIMEOUT";
|
|
50
|
+
};
|
|
51
|
+
/** Default SDK configuration values; env vars and explicit overrides can replace them. */
|
|
52
|
+
export declare const DEFAULTS: Readonly<BabysitterConfig>;
|
|
53
|
+
export declare function getConfiguredGlobalStateRoot(): string;
|
|
54
|
+
/**
|
|
55
|
+
* Normalizes a session-state directory path.
|
|
56
|
+
*/
|
|
57
|
+
export declare function normalizeSessionStateDir(stateDir?: string): string;
|
|
58
|
+
/**
|
|
59
|
+
* Returns the global babysitter state directory (~/.a5c/state/).
|
|
60
|
+
*/
|
|
61
|
+
export declare function getGlobalStateDir(): string;
|
|
62
|
+
/**
|
|
63
|
+
* Returns the global babysitter log directory (~/.a5c/logs/).
|
|
64
|
+
*/
|
|
65
|
+
export declare function getGlobalLogDir(): string;
|
|
66
|
+
export { getConfig, validateConfig, getDefaults, isValidLogLevel } from "./configValidation";
|
|
67
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;IACnB,eAAe,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,uBAAuB,EAAE,MAAM,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;CAUlB,CAAC;AAEX,0FAA0F;AAC1F,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,gBAAgB,CAatC,CAAC;AAEX,wBAAgB,4BAA4B,IAAI,MAAM,CAIrD;AASD;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAYlE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAiBxC;AAGD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Centralized Configuration Defaults for Babysitter SDK
|
|
4
|
+
*
|
|
5
|
+
* This module serves as the single source of truth for all default configuration
|
|
6
|
+
* values used throughout the babysitter SDK. Import from here instead of using
|
|
7
|
+
* scattered magic numbers and strings.
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.isValidLogLevel = exports.getDefaults = exports.validateConfig = exports.getConfig = exports.DEFAULTS = exports.CONFIG_ENV_VARS = void 0;
|
|
44
|
+
exports.getConfiguredGlobalStateRoot = getConfiguredGlobalStateRoot;
|
|
45
|
+
exports.normalizeSessionStateDir = normalizeSessionStateDir;
|
|
46
|
+
exports.getGlobalStateDir = getGlobalStateDir;
|
|
47
|
+
exports.getGlobalLogDir = getGlobalLogDir;
|
|
48
|
+
const path = __importStar(require("node:path"));
|
|
49
|
+
const os = __importStar(require("node:os"));
|
|
50
|
+
/**
|
|
51
|
+
* Environment variable names for configuration overrides
|
|
52
|
+
*/
|
|
53
|
+
exports.CONFIG_ENV_VARS = {
|
|
54
|
+
RUNS_DIR: "BABYSITTER_RUNS_DIR",
|
|
55
|
+
RUNS_SCOPE: "BABYSITTER_RUNS_SCOPE",
|
|
56
|
+
MAX_ITERATIONS: "BABYSITTER_MAX_ITERATIONS",
|
|
57
|
+
QUALITY_THRESHOLD: "BABYSITTER_QUALITY_THRESHOLD",
|
|
58
|
+
TIMEOUT: "BABYSITTER_TIMEOUT",
|
|
59
|
+
LOG_LEVEL: "BABYSITTER_LOG_LEVEL",
|
|
60
|
+
ALLOW_SECRET_LOGS: "BABYSITTER_ALLOW_SECRET_LOGS",
|
|
61
|
+
HOOK_TIMEOUT: "BABYSITTER_HOOK_TIMEOUT",
|
|
62
|
+
NODE_TASK_TIMEOUT: "BABYSITTER_NODE_TASK_TIMEOUT",
|
|
63
|
+
};
|
|
64
|
+
/** Default SDK configuration values; env vars and explicit overrides can replace them. */
|
|
65
|
+
exports.DEFAULTS = {
|
|
66
|
+
runsDir: path.join(getConfiguredGlobalStateRoot(), "runs"),
|
|
67
|
+
maxIterations: 65_000,
|
|
68
|
+
qualityThreshold: 80,
|
|
69
|
+
timeout: 120000,
|
|
70
|
+
logLevel: "info",
|
|
71
|
+
allowSecretLogs: false,
|
|
72
|
+
hookTimeout: 30000,
|
|
73
|
+
nodeTaskTimeout: 15 * 60 * 1000,
|
|
74
|
+
clockStepMs: 1000,
|
|
75
|
+
clockStartMs: Date.UTC(2025, 0, 1, 0, 0, 0, 0),
|
|
76
|
+
layoutVersion: "2026.01-storage-preview",
|
|
77
|
+
largeResultPreviewLimit: 1024 * 1024,
|
|
78
|
+
};
|
|
79
|
+
function getConfiguredGlobalStateRoot() {
|
|
80
|
+
return process.env.BABYSITTER_GLOBAL_STATE_DIR?.trim()
|
|
81
|
+
? path.resolve(process.env.BABYSITTER_GLOBAL_STATE_DIR)
|
|
82
|
+
: path.join(os.homedir(), ".a5c");
|
|
83
|
+
}
|
|
84
|
+
function normalizeComparablePath(value) {
|
|
85
|
+
const normalized = path.normalize(path.resolve(value));
|
|
86
|
+
return process.platform === "win32"
|
|
87
|
+
? normalized.toLowerCase()
|
|
88
|
+
: normalized;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Normalizes a session-state directory path.
|
|
92
|
+
*/
|
|
93
|
+
function normalizeSessionStateDir(stateDir) {
|
|
94
|
+
const globalRoot = getConfiguredGlobalStateRoot();
|
|
95
|
+
if (!stateDir?.trim()) {
|
|
96
|
+
return path.join(globalRoot, "state");
|
|
97
|
+
}
|
|
98
|
+
const resolved = path.resolve(stateDir);
|
|
99
|
+
if (normalizeComparablePath(resolved) === normalizeComparablePath(globalRoot)) {
|
|
100
|
+
return path.join(globalRoot, "state");
|
|
101
|
+
}
|
|
102
|
+
return resolved;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Returns the global babysitter state directory (~/.a5c/state/).
|
|
106
|
+
*/
|
|
107
|
+
function getGlobalStateDir() {
|
|
108
|
+
return normalizeSessionStateDir(process.env.BABYSITTER_STATE_DIR);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Returns the global babysitter log directory (~/.a5c/logs/).
|
|
112
|
+
*/
|
|
113
|
+
function getGlobalLogDir() {
|
|
114
|
+
const override = process.env.BABYSITTER_LOG_DIR?.trim();
|
|
115
|
+
if (override) {
|
|
116
|
+
if (!path.isAbsolute(override)) {
|
|
117
|
+
const rebased = path.join(os.homedir(), ".a5c", "logs");
|
|
118
|
+
// eslint-disable-next-line no-console
|
|
119
|
+
console.warn(`[babysitter] BABYSITTER_LOG_DIR must be an absolute path; got ${JSON.stringify(override)}. Falling back to ${rebased}. Set an absolute path to silence this warning.`);
|
|
120
|
+
return rebased;
|
|
121
|
+
}
|
|
122
|
+
return path.resolve(override);
|
|
123
|
+
}
|
|
124
|
+
const globalRoot = getConfiguredGlobalStateRoot();
|
|
125
|
+
return path.join(globalRoot, "logs");
|
|
126
|
+
}
|
|
127
|
+
// Re-export validation and config functions from the extracted module
|
|
128
|
+
var configValidation_1 = require("./configValidation");
|
|
129
|
+
Object.defineProperty(exports, "getConfig", { enumerable: true, get: function () { return configValidation_1.getConfig; } });
|
|
130
|
+
Object.defineProperty(exports, "validateConfig", { enumerable: true, get: function () { return configValidation_1.validateConfig; } });
|
|
131
|
+
Object.defineProperty(exports, "getDefaults", { enumerable: true, get: function () { return configValidation_1.getDefaults; } });
|
|
132
|
+
Object.defineProperty(exports, "isValidLogLevel", { enumerable: true, get: function () { return configValidation_1.isValidLogLevel; } });
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Babysitter SDK Configuration Module
|
|
3
|
+
*
|
|
4
|
+
* This module provides centralized configuration management for the SDK.
|
|
5
|
+
* Import from this module to access defaults, configuration helpers, and types.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { DEFAULTS, getConfig, validateConfig } from "@a5c-ai/babysitter-sdk/config";
|
|
10
|
+
*
|
|
11
|
+
* // Use defaults directly
|
|
12
|
+
* console.log(DEFAULTS.runsDir); // "/home/alice/.a5c/runs"
|
|
13
|
+
*
|
|
14
|
+
* // Get merged config with env overrides
|
|
15
|
+
* const config = getConfig({ maxIterations: 500 });
|
|
16
|
+
*
|
|
17
|
+
* // Validate configuration
|
|
18
|
+
* const result = validateConfig(config);
|
|
19
|
+
* if (!result.valid) {
|
|
20
|
+
* throw new Error(result.errors.join(", "));
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export { type LogLevel, type BabysitterConfig, type ConfigValidationResult, DEFAULTS, CONFIG_ENV_VARS, getConfig, getGlobalLogDir, getGlobalStateDir, getConfiguredGlobalStateRoot, normalizeSessionStateDir, validateConfig, getDefaults, isValidLogLevel, } from "./defaults";
|
|
25
|
+
export { type RunsScope, findRepoRoot, getGlobalRunsDir, getReadableRunsDirs, getRepoRoot, getRepoRunsDir, getRunsScope, parseRunsScope, resolveExistingRunDir, resolveProjectRootForRun, resolveRunRootFromRunDir, resolveRunsDir, } from "./runs";
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAG3B,QAAQ,EACR,eAAe,EAGf,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,4BAA4B,EAC5B,wBAAwB,EACxB,cAAc,EACd,WAAW,EACX,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,KAAK,SAAS,EACd,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,EACxB,cAAc,GACf,MAAM,QAAQ,CAAC"}
|