@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,234 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* hook:run CLI command.
|
|
4
|
+
*
|
|
5
|
+
* Dispatches hook handling to the appropriate harness adapter.
|
|
6
|
+
* Each harness (e.g. "claude-code") implements its own stop and
|
|
7
|
+
* session-start handlers via the HarnessAdapter interface.
|
|
8
|
+
*
|
|
9
|
+
* The "user-prompt-submit" hook type is harness-agnostic: it reads the
|
|
10
|
+
* Claude Code UserPromptSubmit JSON payload from stdin, applies density-filter
|
|
11
|
+
* compression if the prompt exceeds the configured token threshold, and writes
|
|
12
|
+
* the (possibly compressed) payload to stdout.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.handleHookRun = handleHookRun;
|
|
16
|
+
const harness_1 = require("../../../harness");
|
|
17
|
+
const config_loader_1 = require("../../../compression/config-loader");
|
|
18
|
+
const density_filter_1 = require("../../../compression/density-filter");
|
|
19
|
+
const runLogger_1 = require("../../../logging/runLogger");
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
// Stdin reader
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
async function readStdin() {
|
|
24
|
+
const chunks = [];
|
|
25
|
+
return new Promise((resolve, reject) => {
|
|
26
|
+
process.stdin.on("data", (chunk) => chunks.push(chunk));
|
|
27
|
+
process.stdin.on("end", () => resolve(Buffer.concat(chunks).toString("utf8")));
|
|
28
|
+
process.stdin.on("error", reject);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
async function handleUserPromptSubmit() {
|
|
32
|
+
let raw;
|
|
33
|
+
try {
|
|
34
|
+
raw = await readStdin();
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return 0;
|
|
38
|
+
}
|
|
39
|
+
let payload;
|
|
40
|
+
try {
|
|
41
|
+
payload = JSON.parse(raw);
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// Not valid JSON — pass through unchanged
|
|
45
|
+
process.stdout.write(raw);
|
|
46
|
+
return 0;
|
|
47
|
+
}
|
|
48
|
+
// Apply compression only if enabled; if disabled, falls through and outputs original payload
|
|
49
|
+
const config = (0, config_loader_1.loadCompressionConfig)(process.cwd());
|
|
50
|
+
const layer = config.layers.userPromptHook;
|
|
51
|
+
if (config.enabled && layer.enabled) {
|
|
52
|
+
const prompt = payload.prompt;
|
|
53
|
+
if (typeof prompt === "string") {
|
|
54
|
+
const tokenCount = (0, density_filter_1.estimateTokens)(prompt);
|
|
55
|
+
if (tokenCount > layer.threshold) {
|
|
56
|
+
payload.prompt = (0, density_filter_1.densityFilterText)(prompt, 1 - layer.keepRatio);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
process.stdout.write(JSON.stringify(payload));
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
// pre-tool-use handler (harness-agnostic, self-contained)
|
|
65
|
+
//
|
|
66
|
+
// Reads the Claude Code PreToolUse JSON payload from stdin, checks if the
|
|
67
|
+
// Bash command is a simple compressible one (git, ls, grep, diff, cat, …),
|
|
68
|
+
// and rewrites it to `babysitter compress-output <cmd>` so command output is
|
|
69
|
+
// compressed before it enters Claude's context window.
|
|
70
|
+
//
|
|
71
|
+
// Replaces the external rtk-rewrite.sh hook with a self-contained babysitter
|
|
72
|
+
// implementation.
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
const COMPRESSIBLE_BINS = new Set([
|
|
75
|
+
"git", "ls", "dir", "grep", "rg", "ag", "diff", "delta",
|
|
76
|
+
"cat", "head", "tail", "less", "more",
|
|
77
|
+
]);
|
|
78
|
+
/** Returns true if the command is a plain invocation with no shell operators. */
|
|
79
|
+
function isSimpleCommand(cmd) {
|
|
80
|
+
// Skip rewrites for commands that contain pipes, redirects, subshells, etc.
|
|
81
|
+
return !/[|;&<>`]|\$\(/.test(cmd);
|
|
82
|
+
}
|
|
83
|
+
async function handlePreToolUse() {
|
|
84
|
+
let raw;
|
|
85
|
+
try {
|
|
86
|
+
raw = await readStdin();
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return 0;
|
|
90
|
+
}
|
|
91
|
+
// Check feature flag before doing anything
|
|
92
|
+
const config = (0, config_loader_1.loadCompressionConfig)(process.cwd());
|
|
93
|
+
if (!config.enabled || !config.layers.commandOutputHook.enabled) {
|
|
94
|
+
return 0;
|
|
95
|
+
}
|
|
96
|
+
let payload;
|
|
97
|
+
try {
|
|
98
|
+
payload = JSON.parse(raw);
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
// Not JSON — pass through
|
|
102
|
+
return 0;
|
|
103
|
+
}
|
|
104
|
+
const toolInput = payload.tool_input;
|
|
105
|
+
const command = typeof toolInput?.command === "string" ? toolInput.command.trim() : "";
|
|
106
|
+
if (!command)
|
|
107
|
+
return 0;
|
|
108
|
+
const firstToken = command.split(/\s+/)[0]?.toLowerCase() ?? "";
|
|
109
|
+
if (!COMPRESSIBLE_BINS.has(firstToken))
|
|
110
|
+
return 0;
|
|
111
|
+
if (!isSimpleCommand(command))
|
|
112
|
+
return 0;
|
|
113
|
+
// Respect excludeCommands from config
|
|
114
|
+
const excluded = config.layers.commandOutputHook.excludeCommands;
|
|
115
|
+
if (excluded.some(exc => firstToken === exc.toLowerCase()))
|
|
116
|
+
return 0;
|
|
117
|
+
// Rewrite: prepend `babysitter compress-output`
|
|
118
|
+
const rewritten = `babysitter compress-output ${command}`;
|
|
119
|
+
const updatedInput = { ...toolInput, command: rewritten };
|
|
120
|
+
const response = {
|
|
121
|
+
hookSpecificOutput: {
|
|
122
|
+
hookEventName: "PreToolUse",
|
|
123
|
+
permissionDecision: "allow",
|
|
124
|
+
permissionDecisionReason: "babysitter output compression",
|
|
125
|
+
updatedInput,
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
process.stdout.write(JSON.stringify(response) + "\n");
|
|
129
|
+
return 0;
|
|
130
|
+
}
|
|
131
|
+
// ---------------------------------------------------------------------------
|
|
132
|
+
// Main dispatcher
|
|
133
|
+
// ---------------------------------------------------------------------------
|
|
134
|
+
/** Fire-and-forget log to the structured run log facility. */
|
|
135
|
+
function logHookEvent(hookType, message, context) {
|
|
136
|
+
void (0, runLogger_1.appendRunLog)({
|
|
137
|
+
timestamp: new Date().toISOString(),
|
|
138
|
+
level: "info",
|
|
139
|
+
type: "hook",
|
|
140
|
+
label: `hook:${hookType}`,
|
|
141
|
+
message,
|
|
142
|
+
source: "hook:run",
|
|
143
|
+
context,
|
|
144
|
+
}).catch(() => {
|
|
145
|
+
// Never let logging break hook execution.
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
async function handleHookRun(args) {
|
|
149
|
+
const { hookType, harness, json } = args;
|
|
150
|
+
if (!hookType) {
|
|
151
|
+
const error = {
|
|
152
|
+
error: "MISSING_HOOK_TYPE",
|
|
153
|
+
message: "--hook-type is required for hook:run",
|
|
154
|
+
};
|
|
155
|
+
if (json) {
|
|
156
|
+
process.stderr.write(JSON.stringify(error, null, 2) + "\n");
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
process.stderr.write("Error: --hook-type is required for hook:run\n");
|
|
160
|
+
}
|
|
161
|
+
return 1;
|
|
162
|
+
}
|
|
163
|
+
logHookEvent(hookType, "Hook invoked", { harness });
|
|
164
|
+
// harness-agnostic hook types — handle before adapter lookup
|
|
165
|
+
if (hookType === "user-prompt-submit") {
|
|
166
|
+
const code = await handleUserPromptSubmit();
|
|
167
|
+
logHookEvent(hookType, `Hook completed with code=${code}`);
|
|
168
|
+
return code;
|
|
169
|
+
}
|
|
170
|
+
if (hookType === "pre-tool-use") {
|
|
171
|
+
const code = await handlePreToolUse();
|
|
172
|
+
logHookEvent(hookType, `Hook completed with code=${code}`);
|
|
173
|
+
return code;
|
|
174
|
+
}
|
|
175
|
+
const adapter = (0, harness_1.getAdapterByName)(harness);
|
|
176
|
+
if (!adapter) {
|
|
177
|
+
const supported = (0, harness_1.listSupportedHarnesses)();
|
|
178
|
+
const error = {
|
|
179
|
+
error: "UNSUPPORTED_HARNESS",
|
|
180
|
+
message: `Unsupported harness: "${harness}". Supported: ${supported.join(", ")}`,
|
|
181
|
+
};
|
|
182
|
+
logHookEvent(hookType, `Unsupported harness: ${harness}`, { error: error.error });
|
|
183
|
+
if (json) {
|
|
184
|
+
process.stderr.write(JSON.stringify(error, null, 2) + "\n");
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
process.stderr.write(`Error: ${error.message}\n`);
|
|
188
|
+
}
|
|
189
|
+
return 1;
|
|
190
|
+
}
|
|
191
|
+
if (adapter.supportsHookType && !adapter.supportsHookType(hookType)) {
|
|
192
|
+
const message = adapter.getUnsupportedHookMessage
|
|
193
|
+
? adapter.getUnsupportedHookMessage(hookType)
|
|
194
|
+
: `Harness "${harness}" does not support hook type "${hookType}".`;
|
|
195
|
+
const error = {
|
|
196
|
+
error: "UNSUPPORTED_HOOK_TYPE",
|
|
197
|
+
message,
|
|
198
|
+
};
|
|
199
|
+
logHookEvent(hookType, message, { error: error.error });
|
|
200
|
+
if (json) {
|
|
201
|
+
process.stderr.write(JSON.stringify(error, null, 2) + "\n");
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
process.stderr.write(`Error: ${message}\n`);
|
|
205
|
+
}
|
|
206
|
+
return 1;
|
|
207
|
+
}
|
|
208
|
+
let exitCode;
|
|
209
|
+
switch (hookType) {
|
|
210
|
+
case "stop":
|
|
211
|
+
case "session-end":
|
|
212
|
+
exitCode = await adapter.handleStopHook(args);
|
|
213
|
+
break;
|
|
214
|
+
case "session-start":
|
|
215
|
+
exitCode = await adapter.handleSessionStartHook(args);
|
|
216
|
+
break;
|
|
217
|
+
default: {
|
|
218
|
+
const error = {
|
|
219
|
+
error: "UNKNOWN_HOOK_TYPE",
|
|
220
|
+
message: `Unknown hook type: ${hookType}. Supported: stop, session-end, session-start, user-prompt-submit, pre-tool-use`,
|
|
221
|
+
};
|
|
222
|
+
logHookEvent(hookType, error.message, { error: error.error });
|
|
223
|
+
if (json) {
|
|
224
|
+
process.stderr.write(JSON.stringify(error, null, 2) + "\n");
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
process.stderr.write(`Error: Unknown hook type: ${hookType}. Supported: stop, session-end, session-start, user-prompt-submit, pre-tool-use\n`);
|
|
228
|
+
}
|
|
229
|
+
return 1;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
logHookEvent(hookType, `Hook completed with code=${exitCode}`, { harness });
|
|
233
|
+
return exitCode;
|
|
234
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI handlers for `instructions:*` commands.
|
|
3
|
+
*
|
|
4
|
+
* Each subcommand resolves a PromptContext for the given harness,
|
|
5
|
+
* calls the appropriate composer, and outputs the result.
|
|
6
|
+
*
|
|
7
|
+
* @module cli/commands/instructions
|
|
8
|
+
*/
|
|
9
|
+
export interface InstructionsCommandArgs {
|
|
10
|
+
subcommand: "babysit-skill" | "process-create" | "orchestrate" | "breakpoint-handling";
|
|
11
|
+
harness?: string;
|
|
12
|
+
interactive: boolean | undefined;
|
|
13
|
+
json: boolean;
|
|
14
|
+
showStrata?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Route and handle an `instructions:*` subcommand.
|
|
18
|
+
*/
|
|
19
|
+
export declare function handleInstructionsCommand(args: InstructionsCommandArgs): Promise<number>;
|
|
20
|
+
//# sourceMappingURL=instructions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAoCH,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,eAAe,GAAG,gBAAgB,GAAG,aAAa,GAAG,qBAAqB,CAAC;IACvF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AA4MD;;GAEG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC,MAAM,CAAC,CAwGjB"}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CLI handlers for `instructions:*` commands.
|
|
4
|
+
*
|
|
5
|
+
* Each subcommand resolves a PromptContext for the given harness,
|
|
6
|
+
* calls the appropriate composer, and outputs the result.
|
|
7
|
+
*
|
|
8
|
+
* @module cli/commands/instructions
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.handleInstructionsCommand = handleInstructionsCommand;
|
|
12
|
+
const node_fs_1 = require("node:fs");
|
|
13
|
+
const prompts_1 = require("../../prompts");
|
|
14
|
+
const active_1 = require("../../processLibrary/active");
|
|
15
|
+
const registry_1 = require("../../harness/registry");
|
|
16
|
+
const discovery_1 = require("../../harness/discovery");
|
|
17
|
+
const parse_1 = require("../../session/parse");
|
|
18
|
+
const contextShared_1 = require("../../prompts/contextShared");
|
|
19
|
+
const detectExistingRun_1 = require("./detectExistingRun");
|
|
20
|
+
const COMPOSERS = {
|
|
21
|
+
"babysit-skill": {
|
|
22
|
+
fn: prompts_1.composeBabysitSkillPrompt,
|
|
23
|
+
promptType: "babysit-skill",
|
|
24
|
+
partsIncluded: [
|
|
25
|
+
"non-negotiables", "dependencies", "interview", "user-profile",
|
|
26
|
+
"process-creation", "intent-fidelity-checks", "run-overlap-detection", "run-creation",
|
|
27
|
+
"iteration", "effects", "breakpoint-handling", "results-posting",
|
|
28
|
+
"loop-control", "completion-proof", "task-kinds", "task-examples",
|
|
29
|
+
"quick-reference", "recovery", "process-guidelines", "critical-rules",
|
|
30
|
+
"see-also",
|
|
31
|
+
"project-instructions",
|
|
32
|
+
],
|
|
33
|
+
strataParts: [
|
|
34
|
+
"renderNonNegotiables", "renderDependencies", "renderInterview", "renderUserProfile",
|
|
35
|
+
"renderProcessCreation", "renderIntentFidelityChecks", "renderRunOverlapDetection",
|
|
36
|
+
"renderRunCreation", "renderIteration", "renderEffects", "renderBreakpointHandling",
|
|
37
|
+
"renderResultsPosting", "renderLoopControl", "renderCompletionProof",
|
|
38
|
+
"renderTaskKinds", "renderTaskExamples", "renderQuickReference", "renderRecovery",
|
|
39
|
+
"renderProcessGuidelines", "renderCriticalRules", "renderSeeAlso",
|
|
40
|
+
"renderProjectInstructions",
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
"process-create": {
|
|
44
|
+
fn: prompts_1.composeProcessCreatePrompt,
|
|
45
|
+
promptType: "process-create",
|
|
46
|
+
partsIncluded: [
|
|
47
|
+
"interview", "user-profile", "process-creation",
|
|
48
|
+
"intent-fidelity-checks", "process-guidelines",
|
|
49
|
+
"parallel-phase-detection", "task-kinds", "task-examples",
|
|
50
|
+
"project-instructions",
|
|
51
|
+
],
|
|
52
|
+
strataParts: [
|
|
53
|
+
"renderInterview", "renderUserProfile", "renderProcessCreation",
|
|
54
|
+
"renderIntentFidelityChecks", "renderProcessGuidelines",
|
|
55
|
+
"renderParallelPhaseDetection", "renderTaskKinds", "renderTaskExamples",
|
|
56
|
+
"renderProjectInstructions",
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
"orchestrate": {
|
|
60
|
+
fn: prompts_1.composeOrchestrationPrompt,
|
|
61
|
+
promptType: "orchestrate",
|
|
62
|
+
partsIncluded: [
|
|
63
|
+
"run-overlap-detection", "run-creation", "iteration", "effects", "breakpoint-handling",
|
|
64
|
+
"results-posting", "loop-control", "completion-proof",
|
|
65
|
+
"quick-reference", "recovery", "critical-rules",
|
|
66
|
+
],
|
|
67
|
+
strataParts: [
|
|
68
|
+
"renderRunOverlapDetection", "renderRunCreation", "renderIteration", "renderEffects",
|
|
69
|
+
"renderBreakpointHandling", "renderResultsPosting", "renderLoopControl",
|
|
70
|
+
"renderCompletionProof", "renderQuickReference", "renderRecovery", "renderCriticalRules",
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
"breakpoint-handling": {
|
|
74
|
+
fn: prompts_1.composeBreakpointPrompt,
|
|
75
|
+
promptType: "breakpoint-handling",
|
|
76
|
+
partsIncluded: ["breakpoint-handling", "results-posting"],
|
|
77
|
+
strataParts: ["renderBreakpointHandling", "renderResultsPosting"],
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Resolve a PromptContext factory by harness name.
|
|
82
|
+
*/
|
|
83
|
+
function resolveContextFactory(harness) {
|
|
84
|
+
if (harness === "custom") {
|
|
85
|
+
return (overrides) => createPessimisticPromptContext(overrides);
|
|
86
|
+
}
|
|
87
|
+
if (!(0, registry_1.getAdapterByName)(harness)?.getPromptContext) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
return (overrides) => {
|
|
91
|
+
const context = (0, registry_1.createPromptContextForHarness)(harness, overrides);
|
|
92
|
+
if (!context) {
|
|
93
|
+
throw new Error(`Harness "${harness}" does not provide a prompt context.`);
|
|
94
|
+
}
|
|
95
|
+
return context;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function createPessimisticPromptContext(overrides) {
|
|
99
|
+
return (0, contextShared_1.createPromptContext)({
|
|
100
|
+
harness: "custom",
|
|
101
|
+
harnessLabel: "Custom Harness",
|
|
102
|
+
capabilities: ["task-tool", "breakpoint-routing"],
|
|
103
|
+
pluginRootVar: "",
|
|
104
|
+
loopControlTerm: "in-turn",
|
|
105
|
+
sessionBindingFlags: "",
|
|
106
|
+
hookDriven: false,
|
|
107
|
+
interactiveToolName: "",
|
|
108
|
+
sessionEnvVars: "`--session-id`, `AGENT_SESSION_ID`, or the PID-scoped session marker fallback",
|
|
109
|
+
resumeFlags: "",
|
|
110
|
+
cliSetupSnippet: (0, contextShared_1.createDefaultCliSetupSnippet)(),
|
|
111
|
+
iterateFlags: "",
|
|
112
|
+
hasIntentFidelityChecks: false,
|
|
113
|
+
hasNonNegotiables: false,
|
|
114
|
+
}, overrides);
|
|
115
|
+
}
|
|
116
|
+
function resolveInstructionsHarness(harness) {
|
|
117
|
+
if (harness) {
|
|
118
|
+
return {
|
|
119
|
+
harness,
|
|
120
|
+
source: "explicit",
|
|
121
|
+
warnings: [],
|
|
122
|
+
evidence: [],
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
const caller = (0, discovery_1.detectCallerHarness)();
|
|
126
|
+
if (caller) {
|
|
127
|
+
return {
|
|
128
|
+
harness: caller.name,
|
|
129
|
+
source: "caller",
|
|
130
|
+
warnings: [],
|
|
131
|
+
evidence: caller.matchedEnvVars,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
const hooksMuxCaller = (0, discovery_1.detectCallerHarnessViaHooksMux)();
|
|
135
|
+
if (hooksMuxCaller) {
|
|
136
|
+
return {
|
|
137
|
+
harness: hooksMuxCaller.name,
|
|
138
|
+
source: "hooks-mux",
|
|
139
|
+
warnings: [],
|
|
140
|
+
evidence: hooksMuxCaller.matchedEnvVars,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
harness: "custom",
|
|
145
|
+
source: "fallback",
|
|
146
|
+
warnings: [
|
|
147
|
+
"Host discovery failed for `instructions:*`; using the pessimistic custom-harness prompt context.",
|
|
148
|
+
],
|
|
149
|
+
evidence: [],
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Try to resolve the active process-library root from the SDK directly.
|
|
154
|
+
* Returns the library root and reference root if a binding exists,
|
|
155
|
+
* or undefined values if resolution fails (no binding, network error, etc.).
|
|
156
|
+
*/
|
|
157
|
+
async function tryResolveProcessLibraryRoot() {
|
|
158
|
+
try {
|
|
159
|
+
const resolved = await (0, active_1.resolveActiveProcessLibrary)();
|
|
160
|
+
if (resolved.binding?.dir) {
|
|
161
|
+
const defaultSpec = (0, active_1.getDefaultProcessLibrarySpec)();
|
|
162
|
+
return {
|
|
163
|
+
processLibraryRoot: defaultSpec.processRoot,
|
|
164
|
+
processLibraryReferenceRoot: defaultSpec.referenceRoot,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
catch {
|
|
169
|
+
// No binding exists or resolution failed — fall back to manual instructions
|
|
170
|
+
}
|
|
171
|
+
return {};
|
|
172
|
+
}
|
|
173
|
+
function detectHooksActive(harness) {
|
|
174
|
+
const adapter = (0, registry_1.getAdapterByName)(harness);
|
|
175
|
+
if (!adapter)
|
|
176
|
+
return false;
|
|
177
|
+
const sessionId = adapter.resolveSessionId({});
|
|
178
|
+
if (!sessionId)
|
|
179
|
+
return false;
|
|
180
|
+
const stateDir = adapter.resolveStateDir({});
|
|
181
|
+
if (!stateDir)
|
|
182
|
+
return false;
|
|
183
|
+
const stateFile = (0, parse_1.getSessionFilePath)(stateDir, sessionId);
|
|
184
|
+
return (0, node_fs_1.existsSync)(stateFile);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Route and handle an `instructions:*` subcommand.
|
|
188
|
+
*/
|
|
189
|
+
async function handleInstructionsCommand(args) {
|
|
190
|
+
const resolvedHarness = resolveInstructionsHarness(args.harness);
|
|
191
|
+
const factory = resolveContextFactory(resolvedHarness.harness);
|
|
192
|
+
if (!factory) {
|
|
193
|
+
const known = registry_1.KNOWN_HARNESSES.map((spec) => spec.name).join(", ");
|
|
194
|
+
if (args.json) {
|
|
195
|
+
console.log(JSON.stringify({
|
|
196
|
+
error: "unknown_harness",
|
|
197
|
+
message: `Unknown harness "${resolvedHarness.harness}". Known harnesses: ${known}`,
|
|
198
|
+
}));
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
console.error(`[instructions] Unknown harness "${resolvedHarness.harness}". Known harnesses: ${known}`);
|
|
202
|
+
}
|
|
203
|
+
return 1;
|
|
204
|
+
}
|
|
205
|
+
const composer = COMPOSERS[args.subcommand];
|
|
206
|
+
if (!composer) {
|
|
207
|
+
const known = Object.keys(COMPOSERS).join(", ");
|
|
208
|
+
if (args.json) {
|
|
209
|
+
console.log(JSON.stringify({
|
|
210
|
+
error: "unknown_subcommand",
|
|
211
|
+
message: `Unknown subcommand "${args.subcommand}". Known subcommands: ${known}`,
|
|
212
|
+
}));
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
console.error(`[instructions] Unknown subcommand "${args.subcommand}". Known subcommands: ${known}`);
|
|
216
|
+
}
|
|
217
|
+
return 1;
|
|
218
|
+
}
|
|
219
|
+
// Resolve the active process-library root before composing the prompt
|
|
220
|
+
const libraryInfo = await tryResolveProcessLibraryRoot();
|
|
221
|
+
// Detect whether hooks are actually active in this session.
|
|
222
|
+
// hookDriven=false when: non-interactive mode, or session-start hook never ran.
|
|
223
|
+
// Non-interactive mode never has hooks — the agent must drive the loop in-turn.
|
|
224
|
+
const hooksActive = args.interactive !== false && detectHooksActive(resolvedHarness.harness);
|
|
225
|
+
const hookOverride = {};
|
|
226
|
+
if (!hooksActive) {
|
|
227
|
+
hookOverride.hookDriven = false;
|
|
228
|
+
}
|
|
229
|
+
// Detect execution context (CI, trigger, branch, actor) and derive
|
|
230
|
+
// capability flags so the babysit skill can select context-appropriate
|
|
231
|
+
// library processes when dispatching (e.g. GitHub collaboration,
|
|
232
|
+
// scheduled reporting, local-dev relaxations).
|
|
233
|
+
const executionContext = (0, prompts_1.detectExecutionContext)();
|
|
234
|
+
const capabilityFlags = (0, prompts_1.deriveCapabilityFlags)(executionContext);
|
|
235
|
+
const existingRun = await (0, detectExistingRun_1.detectExistingRun)();
|
|
236
|
+
const ctx = factory({
|
|
237
|
+
interactive: args.interactive,
|
|
238
|
+
...libraryInfo,
|
|
239
|
+
...hookOverride,
|
|
240
|
+
});
|
|
241
|
+
// GAP-PROMPT-001: Use strata-aware composition when --show-strata is set
|
|
242
|
+
let content;
|
|
243
|
+
if (args.showStrata) {
|
|
244
|
+
const taggedParts = composer.strataParts
|
|
245
|
+
.map(name => prompts_1.PART_STRATA_MAP[name])
|
|
246
|
+
.filter((p) => p != null);
|
|
247
|
+
content = (0, prompts_1.composeByStrata)(taggedParts, ctx, { showStrata: true });
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
content = composer.fn(ctx);
|
|
251
|
+
}
|
|
252
|
+
if (args.json) {
|
|
253
|
+
console.log(JSON.stringify({
|
|
254
|
+
harness: resolvedHarness.harness,
|
|
255
|
+
harnessSource: resolvedHarness.source,
|
|
256
|
+
discoveryEvidence: resolvedHarness.evidence,
|
|
257
|
+
interactive: args.interactive,
|
|
258
|
+
promptType: composer.promptType,
|
|
259
|
+
hookDriven: ctx.hookDriven,
|
|
260
|
+
hooksDetected: hooksActive,
|
|
261
|
+
warnings: resolvedHarness.warnings,
|
|
262
|
+
executionContext,
|
|
263
|
+
capabilityFlags,
|
|
264
|
+
suggestedProcesses: (0, prompts_1.processPathsForCapabilities)(capabilityFlags),
|
|
265
|
+
existingRun: existingRun ?? null,
|
|
266
|
+
content,
|
|
267
|
+
partsIncluded: composer.partsIncluded,
|
|
268
|
+
}, null, 2));
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
for (const warning of resolvedHarness.warnings)
|
|
272
|
+
console.error(`[instructions] Warning: ${warning}`);
|
|
273
|
+
console.log(formatTextOutput(executionContext, capabilityFlags, existingRun, content));
|
|
274
|
+
}
|
|
275
|
+
return 0;
|
|
276
|
+
}
|
|
277
|
+
function formatTextOutput(executionContext, capabilityFlags, existingRun, content) {
|
|
278
|
+
const caps = Object.entries(capabilityFlags).filter(([, v]) => v).map(([k]) => k);
|
|
279
|
+
const header = [
|
|
280
|
+
'## Execution Context', '',
|
|
281
|
+
`- CI: \`${executionContext.ci}\``,
|
|
282
|
+
`- Trigger: \`${executionContext.trigger}\``,
|
|
283
|
+
executionContext.branch.ref ? `- Branch: \`${executionContext.branch.ref}\`` : undefined,
|
|
284
|
+
executionContext.repo ? `- Repo: \`${executionContext.repo.owner}/${executionContext.repo.name}\`` : undefined,
|
|
285
|
+
executionContext.actor ? `- Actor: \`${executionContext.actor.login}\`${executionContext.actor.isBot ? ' (bot)' : ''}` : undefined,
|
|
286
|
+
'', `Active context capabilities: ${caps.length > 0 ? caps.map(c => `\`${c}\``).join(', ') : '_(none)_'}`,
|
|
287
|
+
'', 'When selecting library processes to dispatch, prefer those whose triggers match the active capabilities above.', '', '---', '',
|
|
288
|
+
].filter((l) => l !== undefined).join('\n');
|
|
289
|
+
const guide = (0, prompts_1.renderCapabilityProcessGuide)(capabilityFlags);
|
|
290
|
+
const runBlock = existingRun ? (0, detectExistingRun_1.formatExistingRunBlock)(existingRun) : '';
|
|
291
|
+
return header + guide + runBlock + content;
|
|
292
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* log CLI command.
|
|
3
|
+
*
|
|
4
|
+
* Writes a structured log entry to the appropriate contextual log file.
|
|
5
|
+
* Intended to be called from shell hooks and scripts as a canonical way
|
|
6
|
+
* to emit structured logs without embedding JSONL formatting inline.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* babysitter log --type <process|hook|cli> --message <msg> [--run-id <id>] [--label <label>] [--level <level>] [--source <src>] [--json]
|
|
10
|
+
*/
|
|
11
|
+
export interface LogCommandArgs {
|
|
12
|
+
logType: string;
|
|
13
|
+
message: string;
|
|
14
|
+
runId?: string;
|
|
15
|
+
processId?: string;
|
|
16
|
+
label?: string;
|
|
17
|
+
level?: string;
|
|
18
|
+
source?: string;
|
|
19
|
+
json: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function handleLog(args: LogCommandArgs): Promise<number>;
|
|
22
|
+
//# sourceMappingURL=log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;CACf;AAaD,wBAAsB,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA4ErE"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* log CLI command.
|
|
4
|
+
*
|
|
5
|
+
* Writes a structured log entry to the appropriate contextual log file.
|
|
6
|
+
* Intended to be called from shell hooks and scripts as a canonical way
|
|
7
|
+
* to emit structured logs without embedding JSONL formatting inline.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* babysitter log --type <process|hook|cli> --message <msg> [--run-id <id>] [--label <label>] [--level <level>] [--source <src>] [--json]
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.handleLog = handleLog;
|
|
14
|
+
const runLogger_1 = require("../../logging/runLogger");
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
// Validation
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
const VALID_LOG_TYPES = new Set(["process", "hook", "cli"]);
|
|
19
|
+
const VALID_LOG_LEVELS = new Set(["debug", "info", "warn", "error"]);
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
// Handler
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
async function handleLog(args) {
|
|
24
|
+
const { logType, message, runId, processId, label, source, json } = args;
|
|
25
|
+
const level = (args.level || "info");
|
|
26
|
+
if (!logType) {
|
|
27
|
+
const error = { error: "MISSING_LOG_TYPE", message: "--type is required (process, hook, cli)" };
|
|
28
|
+
if (json) {
|
|
29
|
+
process.stderr.write(JSON.stringify(error, null, 2) + "\n");
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
process.stderr.write("Error: --type is required (process, hook, cli)\n");
|
|
33
|
+
}
|
|
34
|
+
return 1;
|
|
35
|
+
}
|
|
36
|
+
if (!VALID_LOG_TYPES.has(logType)) {
|
|
37
|
+
const error = {
|
|
38
|
+
error: "INVALID_LOG_TYPE",
|
|
39
|
+
message: `Invalid log type: "${logType}". Must be one of: process, hook, cli`,
|
|
40
|
+
};
|
|
41
|
+
if (json) {
|
|
42
|
+
process.stderr.write(JSON.stringify(error, null, 2) + "\n");
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
process.stderr.write(`Error: ${error.message}\n`);
|
|
46
|
+
}
|
|
47
|
+
return 1;
|
|
48
|
+
}
|
|
49
|
+
if (!message) {
|
|
50
|
+
const error = { error: "MISSING_MESSAGE", message: "--message is required" };
|
|
51
|
+
if (json) {
|
|
52
|
+
process.stderr.write(JSON.stringify(error, null, 2) + "\n");
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
process.stderr.write("Error: --message is required\n");
|
|
56
|
+
}
|
|
57
|
+
return 1;
|
|
58
|
+
}
|
|
59
|
+
if (!VALID_LOG_LEVELS.has(level)) {
|
|
60
|
+
const error = {
|
|
61
|
+
error: "INVALID_LOG_LEVEL",
|
|
62
|
+
message: `Invalid log level: "${level}". Must be one of: debug, info, warn, error`,
|
|
63
|
+
};
|
|
64
|
+
if (json) {
|
|
65
|
+
process.stderr.write(JSON.stringify(error, null, 2) + "\n");
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
process.stderr.write(`Error: ${error.message}\n`);
|
|
69
|
+
}
|
|
70
|
+
return 1;
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
const logPath = await (0, runLogger_1.appendRunLog)({
|
|
74
|
+
timestamp: new Date().toISOString(),
|
|
75
|
+
level,
|
|
76
|
+
type: logType,
|
|
77
|
+
label: label || undefined,
|
|
78
|
+
message,
|
|
79
|
+
runId: runId || undefined,
|
|
80
|
+
processId: processId || undefined,
|
|
81
|
+
source: source || undefined,
|
|
82
|
+
});
|
|
83
|
+
if (json) {
|
|
84
|
+
console.log(JSON.stringify({ ok: true, logPath }));
|
|
85
|
+
}
|
|
86
|
+
return 0;
|
|
87
|
+
}
|
|
88
|
+
catch (e) {
|
|
89
|
+
const errMsg = e instanceof Error ? e.message : String(e);
|
|
90
|
+
const error = { error: "LOG_WRITE_FAILED", message: errMsg };
|
|
91
|
+
if (json) {
|
|
92
|
+
process.stderr.write(JSON.stringify(error, null, 2) + "\n");
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
process.stderr.write(`Error: Failed to write log: ${errMsg}\n`);
|
|
96
|
+
}
|
|
97
|
+
return 1;
|
|
98
|
+
}
|
|
99
|
+
}
|