@a5c-ai/babysitter-sdk 5.0.0 → 5.0.1-staging.00fa5317c
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 +12 -10
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-approval evaluator.
|
|
3
|
+
*
|
|
4
|
+
* Precedence (highest wins):
|
|
5
|
+
* 0. [GAP-SEC-005] Posture: allowAutoApprove === false (category block)
|
|
6
|
+
* 0b.[GAP-SEC-005] Posture: requireExplicitRule with no matching rule
|
|
7
|
+
* 1. never-auto-approve rule match
|
|
8
|
+
* 2. alwaysBreakOn profile tags
|
|
9
|
+
* 3. auto-approve rule match
|
|
10
|
+
* 4. autoApproveAfterN threshold (clamped by posture minConsecutiveApprovalsForAutoN)
|
|
11
|
+
* 5. prompt (default — no auto-approval)
|
|
12
|
+
*/
|
|
13
|
+
import type { BreakpointRule, AutoApprovalResult, ActionCategory, ApprovalPosture } from "./types";
|
|
14
|
+
import type { BreakpointConfig } from "../profiles/types";
|
|
15
|
+
export interface EvaluateAutoApprovalOptions {
|
|
16
|
+
breakpointId: string;
|
|
17
|
+
tags?: string[];
|
|
18
|
+
expert?: string;
|
|
19
|
+
rules: BreakpointRule[];
|
|
20
|
+
profileConfig?: BreakpointConfig;
|
|
21
|
+
/** Number of consecutive past approvals for this breakpointId. */
|
|
22
|
+
consecutiveApprovals?: number;
|
|
23
|
+
/** autoApproveAfterN from breakpoint definition (-1 = disabled). */
|
|
24
|
+
autoApproveAfterN?: number;
|
|
25
|
+
/** GAP-SEC-005: Explicit action category. Overrides prefix-derived category. */
|
|
26
|
+
actionCategory?: ActionCategory;
|
|
27
|
+
/** GAP-SEC-005: Override posture for this evaluation (skips DEFAULT_POSTURES lookup). */
|
|
28
|
+
postureOverride?: ApprovalPosture;
|
|
29
|
+
/** GAP-SEC-005: When true, posture enforcement is skipped entirely. */
|
|
30
|
+
skipPostureEnforcement?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare function evaluateAutoApproval(options: EvaluateAutoApprovalOptions): AutoApprovalResult;
|
|
33
|
+
//# sourceMappingURL=evaluator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../../src/breakpoints/evaluator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACnG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAmC1D,MAAM,WAAW,2BAA2B;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,kEAAkE;IAClE,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oEAAoE;IACpE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gFAAgF;IAChF,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,yFAAyF;IACzF,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,uEAAuE;IACvE,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,kBAAkB,CA8H7F"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Auto-approval evaluator.
|
|
4
|
+
*
|
|
5
|
+
* Precedence (highest wins):
|
|
6
|
+
* 0. [GAP-SEC-005] Posture: allowAutoApprove === false (category block)
|
|
7
|
+
* 0b.[GAP-SEC-005] Posture: requireExplicitRule with no matching rule
|
|
8
|
+
* 1. never-auto-approve rule match
|
|
9
|
+
* 2. alwaysBreakOn profile tags
|
|
10
|
+
* 3. auto-approve rule match
|
|
11
|
+
* 4. autoApproveAfterN threshold (clamped by posture minConsecutiveApprovalsForAutoN)
|
|
12
|
+
* 5. prompt (default — no auto-approval)
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.evaluateAutoApproval = evaluateAutoApproval;
|
|
16
|
+
const patterns_1 = require("./patterns");
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
// Inlined posture helpers (canonical implementation moved to babysitter-agent)
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
const DEFAULT_POSTURES = {
|
|
21
|
+
read: { name: 'permissive', allowAutoApprove: true, minConsecutiveApprovalsForAutoN: 0, requireExplicitRule: false, requiredApproverLevel: 'any' },
|
|
22
|
+
write: { name: 'cautious', allowAutoApprove: true, minConsecutiveApprovalsForAutoN: 3, requireExplicitRule: false, requiredApproverLevel: 'any' },
|
|
23
|
+
execute: { name: 'guarded', allowAutoApprove: true, minConsecutiveApprovalsForAutoN: 5, requireExplicitRule: true, requiredApproverLevel: 'any' },
|
|
24
|
+
destroy: { name: 'locked', allowAutoApprove: false, minConsecutiveApprovalsForAutoN: -1, requireExplicitRule: true, requiredApproverLevel: 'owner' },
|
|
25
|
+
network: { name: 'cautious', allowAutoApprove: true, minConsecutiveApprovalsForAutoN: 3, requireExplicitRule: false, requiredApproverLevel: 'any' },
|
|
26
|
+
auth: { name: 'locked', allowAutoApprove: false, minConsecutiveApprovalsForAutoN: -1, requireExplicitRule: true, requiredApproverLevel: 'owner' },
|
|
27
|
+
};
|
|
28
|
+
const PREFIX_TO_CATEGORY = {
|
|
29
|
+
'read': 'read', 'write': 'write', 'exec': 'execute', 'execute': 'execute',
|
|
30
|
+
'destroy': 'destroy', 'delete': 'destroy', 'net': 'network', 'network': 'network',
|
|
31
|
+
'auth': 'auth', 'cred': 'auth',
|
|
32
|
+
};
|
|
33
|
+
function getPostureForCategory(category, overrides) {
|
|
34
|
+
const base = DEFAULT_POSTURES[category];
|
|
35
|
+
if (!overrides)
|
|
36
|
+
return base;
|
|
37
|
+
return { ...base, ...overrides };
|
|
38
|
+
}
|
|
39
|
+
function resolvePostureFromBreakpointId(breakpointId) {
|
|
40
|
+
const dotIndex = breakpointId.indexOf('.');
|
|
41
|
+
if (dotIndex === -1)
|
|
42
|
+
return undefined;
|
|
43
|
+
const prefix = breakpointId.substring(0, dotIndex);
|
|
44
|
+
return PREFIX_TO_CATEGORY[prefix];
|
|
45
|
+
}
|
|
46
|
+
function evaluateAutoApproval(options) {
|
|
47
|
+
const { breakpointId, tags, expert, rules, profileConfig, consecutiveApprovals = 0, skipPostureEnforcement = false, } = options;
|
|
48
|
+
let { autoApproveAfterN = -1 } = options;
|
|
49
|
+
const attributes = { tags, expert };
|
|
50
|
+
// Resolve posture
|
|
51
|
+
const effectiveCategory = options.actionCategory ?? resolvePostureFromBreakpointId(breakpointId);
|
|
52
|
+
let posture;
|
|
53
|
+
if (!skipPostureEnforcement && effectiveCategory) {
|
|
54
|
+
const profileOverrides = profileConfig?.postureOverrides?.[effectiveCategory];
|
|
55
|
+
posture = options.postureOverride ?? getPostureForCategory(effectiveCategory, profileOverrides);
|
|
56
|
+
}
|
|
57
|
+
// Check if profile disables posture enforcement globally
|
|
58
|
+
if (profileConfig?.disablePostureEnforcement) {
|
|
59
|
+
posture = undefined;
|
|
60
|
+
}
|
|
61
|
+
// 0. Posture: allowAutoApprove === false (category block)
|
|
62
|
+
if (posture && !posture.allowAutoApprove) {
|
|
63
|
+
return {
|
|
64
|
+
recommended: false,
|
|
65
|
+
reason: `Category '${effectiveCategory}' requires explicit human approval (posture: ${posture.name})`,
|
|
66
|
+
consecutiveApprovals,
|
|
67
|
+
blockedByPosture: true,
|
|
68
|
+
effectiveCategory,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
// 0b. Posture: requireExplicitRule with no matching auto-approve rule
|
|
72
|
+
if (posture && posture.requireExplicitRule) {
|
|
73
|
+
const hasExplicitRule = rules.some(rule => {
|
|
74
|
+
if (rule.action !== "auto-approve")
|
|
75
|
+
return false;
|
|
76
|
+
const pattern = (0, patterns_1.parsePattern)(rule.pattern);
|
|
77
|
+
return (0, patterns_1.matchPattern)(pattern, breakpointId, attributes);
|
|
78
|
+
});
|
|
79
|
+
if (!hasExplicitRule) {
|
|
80
|
+
return {
|
|
81
|
+
recommended: false,
|
|
82
|
+
reason: `Category '${effectiveCategory}' requires an explicit auto-approve rule (posture: ${posture.name})`,
|
|
83
|
+
consecutiveApprovals,
|
|
84
|
+
blockedByPosture: true,
|
|
85
|
+
effectiveCategory,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// 1. Check never-auto-approve rules (highest explicit rule precedence)
|
|
90
|
+
for (const rule of rules) {
|
|
91
|
+
if (rule.action !== "never-auto-approve")
|
|
92
|
+
continue;
|
|
93
|
+
const pattern = (0, patterns_1.parsePattern)(rule.pattern);
|
|
94
|
+
if ((0, patterns_1.matchPattern)(pattern, breakpointId, attributes)) {
|
|
95
|
+
return {
|
|
96
|
+
recommended: false,
|
|
97
|
+
reason: `Blocked by never-auto-approve rule: ${rule.id}`,
|
|
98
|
+
matchedRule: rule.id,
|
|
99
|
+
consecutiveApprovals,
|
|
100
|
+
effectiveCategory,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// 2. Check alwaysBreakOn profile tags
|
|
105
|
+
if (profileConfig?.alwaysBreakOn && tags) {
|
|
106
|
+
for (const alwaysTag of profileConfig.alwaysBreakOn) {
|
|
107
|
+
if (tags.includes(alwaysTag)) {
|
|
108
|
+
return {
|
|
109
|
+
recommended: false,
|
|
110
|
+
reason: `Blocked by alwaysBreakOn tag: ${alwaysTag}`,
|
|
111
|
+
consecutiveApprovals,
|
|
112
|
+
effectiveCategory,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// 3. Check auto-approve rules
|
|
118
|
+
for (const rule of rules) {
|
|
119
|
+
if (rule.action !== "auto-approve")
|
|
120
|
+
continue;
|
|
121
|
+
const pattern = (0, patterns_1.parsePattern)(rule.pattern);
|
|
122
|
+
if ((0, patterns_1.matchPattern)(pattern, breakpointId, attributes)) {
|
|
123
|
+
return {
|
|
124
|
+
recommended: true,
|
|
125
|
+
reason: `Matched auto-approve rule: ${rule.id}`,
|
|
126
|
+
matchedRule: rule.id,
|
|
127
|
+
consecutiveApprovals,
|
|
128
|
+
effectiveCategory,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// 4. Check autoApproveAfterN threshold (clamped by posture)
|
|
133
|
+
if (posture && posture.minConsecutiveApprovalsForAutoN === -1) {
|
|
134
|
+
// Posture disables autoApproveAfterN entirely
|
|
135
|
+
autoApproveAfterN = -1;
|
|
136
|
+
}
|
|
137
|
+
else if (posture && autoApproveAfterN > 0) {
|
|
138
|
+
// Clamp threshold to at least posture minimum
|
|
139
|
+
autoApproveAfterN = Math.max(autoApproveAfterN, posture.minConsecutiveApprovalsForAutoN);
|
|
140
|
+
}
|
|
141
|
+
if (autoApproveAfterN > 0 && consecutiveApprovals >= autoApproveAfterN) {
|
|
142
|
+
return {
|
|
143
|
+
recommended: true,
|
|
144
|
+
reason: `Auto-approved after ${consecutiveApprovals} consecutive approvals (threshold: ${autoApproveAfterN})`,
|
|
145
|
+
consecutiveApprovals,
|
|
146
|
+
effectiveCategory,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
// 5. Default: prompt (no auto-approval)
|
|
150
|
+
return {
|
|
151
|
+
recommended: false,
|
|
152
|
+
reason: "No matching auto-approval rule",
|
|
153
|
+
consecutiveApprovals,
|
|
154
|
+
effectiveCategory,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type { BreakpointRule, BreakpointRuleAction, BreakpointRulesFile, AutoApprovalResult, BreakpointPattern, AttributePredicate, PredicateOp, InteractionKind, ActionCategory, ApprovalPosture, } from "./types";
|
|
2
|
+
export { BREAKPOINT_RULES_SCHEMA_VERSION } from "./types";
|
|
3
|
+
export { parsePattern, matchPattern } from "./patterns";
|
|
4
|
+
export { readRules, writeRules, addRule, removeRule, listRules } from "./rules";
|
|
5
|
+
export { evaluateAutoApproval } from "./evaluator";
|
|
6
|
+
export type { EvaluateAutoApprovalOptions } from "./evaluator";
|
|
7
|
+
export { verifyBreakpointResult, hasSignatureFields } from "./proven-verification";
|
|
8
|
+
export type { BreakpointVerificationConfig, BreakpointVerificationResult, } from "./proven-verification";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/breakpoints/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,cAAc,EACd,eAAe,GAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACnF,YAAY,EACV,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasSignatureFields = exports.verifyBreakpointResult = exports.evaluateAutoApproval = exports.listRules = exports.removeRule = exports.addRule = exports.writeRules = exports.readRules = exports.matchPattern = exports.parsePattern = exports.BREAKPOINT_RULES_SCHEMA_VERSION = void 0;
|
|
4
|
+
var types_1 = require("./types");
|
|
5
|
+
Object.defineProperty(exports, "BREAKPOINT_RULES_SCHEMA_VERSION", { enumerable: true, get: function () { return types_1.BREAKPOINT_RULES_SCHEMA_VERSION; } });
|
|
6
|
+
var patterns_1 = require("./patterns");
|
|
7
|
+
Object.defineProperty(exports, "parsePattern", { enumerable: true, get: function () { return patterns_1.parsePattern; } });
|
|
8
|
+
Object.defineProperty(exports, "matchPattern", { enumerable: true, get: function () { return patterns_1.matchPattern; } });
|
|
9
|
+
var rules_1 = require("./rules");
|
|
10
|
+
Object.defineProperty(exports, "readRules", { enumerable: true, get: function () { return rules_1.readRules; } });
|
|
11
|
+
Object.defineProperty(exports, "writeRules", { enumerable: true, get: function () { return rules_1.writeRules; } });
|
|
12
|
+
Object.defineProperty(exports, "addRule", { enumerable: true, get: function () { return rules_1.addRule; } });
|
|
13
|
+
Object.defineProperty(exports, "removeRule", { enumerable: true, get: function () { return rules_1.removeRule; } });
|
|
14
|
+
Object.defineProperty(exports, "listRules", { enumerable: true, get: function () { return rules_1.listRules; } });
|
|
15
|
+
var evaluator_1 = require("./evaluator");
|
|
16
|
+
Object.defineProperty(exports, "evaluateAutoApproval", { enumerable: true, get: function () { return evaluator_1.evaluateAutoApproval; } });
|
|
17
|
+
var proven_verification_1 = require("./proven-verification");
|
|
18
|
+
Object.defineProperty(exports, "verifyBreakpointResult", { enumerable: true, get: function () { return proven_verification_1.verifyBreakpointResult; } });
|
|
19
|
+
Object.defineProperty(exports, "hasSignatureFields", { enumerable: true, get: function () { return proven_verification_1.hasSignatureFields; } });
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pattern parsing and matching for breakpoint auto-approval rules.
|
|
3
|
+
*
|
|
4
|
+
* Pattern syntax:
|
|
5
|
+
* <id-glob> — e.g., "confirm.*"
|
|
6
|
+
* <id-glob>(<predicate> [AND ...]) — e.g., "*.review(tags contains 'design')"
|
|
7
|
+
*
|
|
8
|
+
* Id-glob supports * as a wildcard matching any segment(s).
|
|
9
|
+
* Attribute predicates: "tags contains '<value>'" or "expert = '<value>'"
|
|
10
|
+
* Multiple predicates joined with AND.
|
|
11
|
+
*/
|
|
12
|
+
import type { BreakpointPattern } from "./types";
|
|
13
|
+
/**
|
|
14
|
+
* Parse a pattern string into a structured BreakpointPattern.
|
|
15
|
+
*/
|
|
16
|
+
export declare function parsePattern(raw: string): BreakpointPattern;
|
|
17
|
+
/**
|
|
18
|
+
* Match a breakpointId and attributes against a parsed pattern.
|
|
19
|
+
*/
|
|
20
|
+
export declare function matchPattern(pattern: BreakpointPattern, breakpointId: string, attributes: {
|
|
21
|
+
tags?: string[];
|
|
22
|
+
expert?: string;
|
|
23
|
+
}): boolean;
|
|
24
|
+
//# sourceMappingURL=patterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patterns.d.ts","sourceRoot":"","sources":["../../src/breakpoints/patterns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAsB,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAElF;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAsB3D;AAwBD;;GAEG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,iBAAiB,EAC1B,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/C,OAAO,CAYT"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Pattern parsing and matching for breakpoint auto-approval rules.
|
|
4
|
+
*
|
|
5
|
+
* Pattern syntax:
|
|
6
|
+
* <id-glob> — e.g., "confirm.*"
|
|
7
|
+
* <id-glob>(<predicate> [AND ...]) — e.g., "*.review(tags contains 'design')"
|
|
8
|
+
*
|
|
9
|
+
* Id-glob supports * as a wildcard matching any segment(s).
|
|
10
|
+
* Attribute predicates: "tags contains '<value>'" or "expert = '<value>'"
|
|
11
|
+
* Multiple predicates joined with AND.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.parsePattern = parsePattern;
|
|
15
|
+
exports.matchPattern = matchPattern;
|
|
16
|
+
/**
|
|
17
|
+
* Parse a pattern string into a structured BreakpointPattern.
|
|
18
|
+
*/
|
|
19
|
+
function parsePattern(raw) {
|
|
20
|
+
const trimmed = raw.trim();
|
|
21
|
+
const parenOpen = trimmed.indexOf("(");
|
|
22
|
+
if (parenOpen === -1) {
|
|
23
|
+
return { idGlob: trimmed, predicates: [] };
|
|
24
|
+
}
|
|
25
|
+
const parenClose = trimmed.lastIndexOf(")");
|
|
26
|
+
if (parenClose === -1 || parenClose <= parenOpen) {
|
|
27
|
+
throw new Error(`Invalid pattern: unmatched parenthesis in "${raw}"`);
|
|
28
|
+
}
|
|
29
|
+
const idGlob = trimmed.slice(0, parenOpen).trim();
|
|
30
|
+
const predicateStr = trimmed.slice(parenOpen + 1, parenClose).trim();
|
|
31
|
+
if (!predicateStr) {
|
|
32
|
+
return { idGlob, predicates: [] };
|
|
33
|
+
}
|
|
34
|
+
const predicates = parsePredicates(predicateStr);
|
|
35
|
+
return { idGlob, predicates };
|
|
36
|
+
}
|
|
37
|
+
function parsePredicates(str) {
|
|
38
|
+
// Split on " AND " (case-insensitive)
|
|
39
|
+
const parts = str.split(/\s+AND\s+/i);
|
|
40
|
+
return parts.map(parseSinglePredicate);
|
|
41
|
+
}
|
|
42
|
+
function parseSinglePredicate(str) {
|
|
43
|
+
const trimmed = str.trim();
|
|
44
|
+
// Match: attr contains 'value' or attr = 'value'
|
|
45
|
+
const match = trimmed.match(/^(\w+)\s+(contains|=)\s+'([^']*)'$/);
|
|
46
|
+
if (!match) {
|
|
47
|
+
throw new Error(`Invalid predicate: "${trimmed}". Expected: attr contains 'value' or attr = 'value'`);
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
attr: match[1],
|
|
51
|
+
op: match[2],
|
|
52
|
+
value: match[3],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Match a breakpointId and attributes against a parsed pattern.
|
|
57
|
+
*/
|
|
58
|
+
function matchPattern(pattern, breakpointId, attributes) {
|
|
59
|
+
if (!matchGlob(pattern.idGlob, breakpointId)) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
for (const pred of pattern.predicates) {
|
|
63
|
+
if (!matchPredicate(pred, attributes)) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Simple glob matching with * wildcards.
|
|
71
|
+
* Each * matches zero or more characters (including dots).
|
|
72
|
+
*/
|
|
73
|
+
function matchGlob(glob, value) {
|
|
74
|
+
// Escape regex special chars except *, then replace * with .*
|
|
75
|
+
const escaped = glob.replace(/[.+?^${}()|[\]\\]/g, "\\$&");
|
|
76
|
+
const regexStr = "^" + escaped.replace(/\*/g, ".*") + "$";
|
|
77
|
+
return new RegExp(regexStr).test(value);
|
|
78
|
+
}
|
|
79
|
+
function matchPredicate(pred, attributes) {
|
|
80
|
+
if (pred.attr === "tags" && pred.op === "contains") {
|
|
81
|
+
return Array.isArray(attributes.tags) && attributes.tags.includes(pred.value);
|
|
82
|
+
}
|
|
83
|
+
if (pred.attr === "expert" && pred.op === "=") {
|
|
84
|
+
return attributes.expert === pred.value;
|
|
85
|
+
}
|
|
86
|
+
// Unknown attribute — no match
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional integration with @a5c-ai/breakpoints-mux proven subsystem.
|
|
3
|
+
*
|
|
4
|
+
* Provides cryptographic verification of breakpoint answers when the
|
|
5
|
+
* breakpoints-mux package is available as an optional peer dependency.
|
|
6
|
+
* Never throws -- always returns a graceful result.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Configuration for breakpoint answer verification.
|
|
10
|
+
*/
|
|
11
|
+
export interface BreakpointVerificationConfig {
|
|
12
|
+
/** Whether verification is enabled. When false, verification is skipped. */
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
/** Directory containing trusted public keys. Passed to breakpoints-mux verifyAnswer. */
|
|
15
|
+
trustedKeysDir?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Result of a breakpoint answer verification attempt.
|
|
19
|
+
*/
|
|
20
|
+
export interface BreakpointVerificationResult {
|
|
21
|
+
/** Whether the answer was successfully verified as authentic. */
|
|
22
|
+
verified: boolean;
|
|
23
|
+
/** Detailed verification result from breakpoints-mux (when available). */
|
|
24
|
+
verificationResult?: {
|
|
25
|
+
valid: boolean;
|
|
26
|
+
publicKeyFingerprint?: string;
|
|
27
|
+
responderName?: string;
|
|
28
|
+
reason?: string;
|
|
29
|
+
verifiedAt: string;
|
|
30
|
+
};
|
|
31
|
+
/** Reason verification was skipped or failed (when verified is false). */
|
|
32
|
+
reason?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Check whether a breakpoint result carries signature fields,
|
|
36
|
+
* indicating it was cryptographically signed via the proven subsystem.
|
|
37
|
+
*/
|
|
38
|
+
export declare function hasSignatureFields(result: Record<string, unknown>): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Verify a breakpoint result's cryptographic signature using the
|
|
41
|
+
* breakpoints-mux proven subsystem.
|
|
42
|
+
*
|
|
43
|
+
* This function never throws. If breakpoints-mux is not installed,
|
|
44
|
+
* verification is disabled, or the result is unsigned, it returns
|
|
45
|
+
* a graceful { verified: false } result with an explanatory reason.
|
|
46
|
+
*
|
|
47
|
+
* @param result - The breakpoint result (may or may not contain signature fields).
|
|
48
|
+
* @param config - Verification configuration. If omitted, defaults to { enabled: true }.
|
|
49
|
+
*/
|
|
50
|
+
export declare function verifyBreakpointResult(result: Record<string, unknown>, config?: BreakpointVerificationConfig): Promise<BreakpointVerificationResult>;
|
|
51
|
+
//# sourceMappingURL=proven-verification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proven-verification.d.ts","sourceRoot":"","sources":["../../src/breakpoints/proven-verification.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,4EAA4E;IAC5E,OAAO,EAAE,OAAO,CAAC;IACjB,wFAAwF;IACxF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,iEAAiE;IACjE,QAAQ,EAAE,OAAO,CAAC;IAClB,0EAA0E;IAC1E,kBAAkB,CAAC,EAAE;QACnB,KAAK,EAAE,OAAO,CAAC;QACf,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAaD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAI3E;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,MAAM,CAAC,EAAE,4BAA4B,GACpC,OAAO,CAAC,4BAA4B,CAAC,CAuEvC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Optional integration with @a5c-ai/breakpoints-mux proven subsystem.
|
|
4
|
+
*
|
|
5
|
+
* Provides cryptographic verification of breakpoint answers when the
|
|
6
|
+
* breakpoints-mux package is available as an optional peer dependency.
|
|
7
|
+
* Never throws -- always returns a graceful result.
|
|
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.hasSignatureFields = hasSignatureFields;
|
|
44
|
+
exports.verifyBreakpointResult = verifyBreakpointResult;
|
|
45
|
+
/**
|
|
46
|
+
* Signature fields expected on a proven breakpoint result.
|
|
47
|
+
* If all four are present, the result is considered signed.
|
|
48
|
+
*/
|
|
49
|
+
const SIGNATURE_FIELDS = [
|
|
50
|
+
"signature",
|
|
51
|
+
"publicKeyFingerprint",
|
|
52
|
+
"signedAt",
|
|
53
|
+
"signedFields",
|
|
54
|
+
];
|
|
55
|
+
/**
|
|
56
|
+
* Check whether a breakpoint result carries signature fields,
|
|
57
|
+
* indicating it was cryptographically signed via the proven subsystem.
|
|
58
|
+
*/
|
|
59
|
+
function hasSignatureFields(result) {
|
|
60
|
+
return SIGNATURE_FIELDS.every((field) => result[field] !== undefined && result[field] !== null);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Verify a breakpoint result's cryptographic signature using the
|
|
64
|
+
* breakpoints-mux proven subsystem.
|
|
65
|
+
*
|
|
66
|
+
* This function never throws. If breakpoints-mux is not installed,
|
|
67
|
+
* verification is disabled, or the result is unsigned, it returns
|
|
68
|
+
* a graceful { verified: false } result with an explanatory reason.
|
|
69
|
+
*
|
|
70
|
+
* @param result - The breakpoint result (may or may not contain signature fields).
|
|
71
|
+
* @param config - Verification configuration. If omitted, defaults to { enabled: true }.
|
|
72
|
+
*/
|
|
73
|
+
async function verifyBreakpointResult(result, config) {
|
|
74
|
+
const effectiveConfig = config ?? { enabled: true };
|
|
75
|
+
// Short-circuit if verification is disabled
|
|
76
|
+
if (!effectiveConfig.enabled) {
|
|
77
|
+
return { verified: false, reason: "verification disabled" };
|
|
78
|
+
}
|
|
79
|
+
// Short-circuit if result does not carry signature fields
|
|
80
|
+
if (!hasSignatureFields(result)) {
|
|
81
|
+
return { verified: false, reason: "result is not signed" };
|
|
82
|
+
}
|
|
83
|
+
// Attempt to dynamically import breakpoints-mux proven subsystem.
|
|
84
|
+
// The module is an optional peer dependency -- the import may fail at runtime.
|
|
85
|
+
// We use a string variable to prevent TypeScript from statically resolving the import.
|
|
86
|
+
try {
|
|
87
|
+
const modulePath = "@a5c-ai/breakpoints-mux/proven";
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
89
|
+
const proven = await Promise.resolve(`${modulePath}`).then(s => __importStar(require(s)));
|
|
90
|
+
const { verifyAnswer } = proven;
|
|
91
|
+
if (typeof verifyAnswer !== "function") {
|
|
92
|
+
return {
|
|
93
|
+
verified: false,
|
|
94
|
+
reason: "breakpoints-mux/proven does not export verifyAnswer",
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
const verificationResult = await verifyAnswer(result, effectiveConfig.trustedKeysDir);
|
|
98
|
+
return {
|
|
99
|
+
verified: verificationResult.valid === true,
|
|
100
|
+
verificationResult,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
// Dynamic import failed -- breakpoints-mux is not installed or broken
|
|
105
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
106
|
+
if (message.includes("Cannot find module") ||
|
|
107
|
+
message.includes("MODULE_NOT_FOUND") ||
|
|
108
|
+
message.includes("ERR_MODULE_NOT_FOUND") ||
|
|
109
|
+
message.includes("Could not resolve")) {
|
|
110
|
+
return {
|
|
111
|
+
verified: false,
|
|
112
|
+
reason: "breakpoints-mux not installed",
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
verified: false,
|
|
117
|
+
reason: `verification failed: ${message}`,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rules CRUD for breakpoint auto-approval.
|
|
3
|
+
* Rules stored at ~/.a5c/breakpoint-approvals/rules.json with atomic writes.
|
|
4
|
+
*/
|
|
5
|
+
import type { BreakpointRule } from "./types";
|
|
6
|
+
/**
|
|
7
|
+
* Read rules from the rules file. Returns empty array if file doesn't exist.
|
|
8
|
+
*/
|
|
9
|
+
export declare function readRules(rulesPath?: string): Promise<BreakpointRule[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Write rules to the rules file atomically.
|
|
12
|
+
*/
|
|
13
|
+
export declare function writeRules(rules: BreakpointRule[], rulesPath?: string): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Add a rule. Deduplicates by rule id.
|
|
16
|
+
*/
|
|
17
|
+
export declare function addRule(rule: BreakpointRule, rulesPath?: string): Promise<BreakpointRule[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Remove a rule by id. Returns the updated list.
|
|
20
|
+
*/
|
|
21
|
+
export declare function removeRule(ruleId: string, rulesPath?: string): Promise<BreakpointRule[]>;
|
|
22
|
+
/**
|
|
23
|
+
* List all rules.
|
|
24
|
+
*/
|
|
25
|
+
export declare function listRules(rulesPath?: string): Promise<BreakpointRule[]>;
|
|
26
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/breakpoints/rules.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,SAAS,CAAC;AAOnE;;GAEG;AACH,wBAAsB,SAAS,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAe7E;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAS3F;AAED;;GAEG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAMjG;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAK9F;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAE7E"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Rules CRUD for breakpoint auto-approval.
|
|
4
|
+
* Rules stored at ~/.a5c/breakpoint-approvals/rules.json with atomic writes.
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.readRules = readRules;
|
|
41
|
+
exports.writeRules = writeRules;
|
|
42
|
+
exports.addRule = addRule;
|
|
43
|
+
exports.removeRule = removeRule;
|
|
44
|
+
exports.listRules = listRules;
|
|
45
|
+
const node_fs_1 = require("node:fs");
|
|
46
|
+
const os = __importStar(require("node:os"));
|
|
47
|
+
const path = __importStar(require("node:path"));
|
|
48
|
+
const atomic_1 = require("../storage/atomic");
|
|
49
|
+
const types_1 = require("./types");
|
|
50
|
+
function defaultRulesPath() {
|
|
51
|
+
return path.join(os.homedir(), ".a5c", "breakpoint-approvals", "rules.json");
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Read rules from the rules file. Returns empty array if file doesn't exist.
|
|
55
|
+
*/
|
|
56
|
+
async function readRules(rulesPath) {
|
|
57
|
+
const filePath = rulesPath ?? defaultRulesPath();
|
|
58
|
+
try {
|
|
59
|
+
const raw = await node_fs_1.promises.readFile(filePath, "utf-8");
|
|
60
|
+
const parsed = JSON.parse(raw);
|
|
61
|
+
if (!Array.isArray(parsed.rules)) {
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
return parsed.rules;
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
if (err.code === "ENOENT") {
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
throw err;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Write rules to the rules file atomically.
|
|
75
|
+
*/
|
|
76
|
+
async function writeRules(rules, rulesPath) {
|
|
77
|
+
const filePath = rulesPath ?? defaultRulesPath();
|
|
78
|
+
const dir = path.dirname(filePath);
|
|
79
|
+
await node_fs_1.promises.mkdir(dir, { recursive: true });
|
|
80
|
+
const data = {
|
|
81
|
+
schemaVersion: types_1.BREAKPOINT_RULES_SCHEMA_VERSION,
|
|
82
|
+
rules,
|
|
83
|
+
};
|
|
84
|
+
await (0, atomic_1.writeFileAtomic)(filePath, JSON.stringify(data, null, 2) + "\n");
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Add a rule. Deduplicates by rule id.
|
|
88
|
+
*/
|
|
89
|
+
async function addRule(rule, rulesPath) {
|
|
90
|
+
const existing = await readRules(rulesPath);
|
|
91
|
+
const filtered = existing.filter(r => r.id !== rule.id);
|
|
92
|
+
filtered.push(rule);
|
|
93
|
+
await writeRules(filtered, rulesPath);
|
|
94
|
+
return filtered;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Remove a rule by id. Returns the updated list.
|
|
98
|
+
*/
|
|
99
|
+
async function removeRule(ruleId, rulesPath) {
|
|
100
|
+
const existing = await readRules(rulesPath);
|
|
101
|
+
const filtered = existing.filter(r => r.id !== ruleId);
|
|
102
|
+
await writeRules(filtered, rulesPath);
|
|
103
|
+
return filtered;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* List all rules.
|
|
107
|
+
*/
|
|
108
|
+
async function listRules(rulesPath) {
|
|
109
|
+
return readRules(rulesPath);
|
|
110
|
+
}
|