@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,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Cost data collector for Babysitter runs.
|
|
4
|
+
*
|
|
5
|
+
* Bridges the Claude Code JSONL parser with the run journal: parses a
|
|
6
|
+
* session file (including subagent files), then writes COST_TRACKED events
|
|
7
|
+
* to the run's journal for later aggregation and reporting.
|
|
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.collectCostDataForRun = collectCostDataForRun;
|
|
44
|
+
exports.resolveClaudeCodeSessionDir = resolveClaudeCodeSessionDir;
|
|
45
|
+
const path = __importStar(require("node:path"));
|
|
46
|
+
const os = __importStar(require("node:os"));
|
|
47
|
+
const claudeCodeParser_1 = require("./claudeCodeParser");
|
|
48
|
+
const journal_1 = require("./journal");
|
|
49
|
+
/**
|
|
50
|
+
* Parse a Claude Code session (main + subagents) and write COST_TRACKED
|
|
51
|
+
* events into the run journal.
|
|
52
|
+
*
|
|
53
|
+
* Each assistant message with usage data becomes a separate journal event,
|
|
54
|
+
* preserving the full token breakdown for fine-grained cost analysis.
|
|
55
|
+
*
|
|
56
|
+
* @param runDir - Absolute path to the run directory (e.g. `.a5c/runs/<runId>`).
|
|
57
|
+
* @param sessionJsonlPath - Absolute path to the main session `.jsonl` file.
|
|
58
|
+
* @returns The number of COST_TRACKED events written to the journal.
|
|
59
|
+
*/
|
|
60
|
+
async function collectCostDataForRun(runDir, sessionJsonlPath) {
|
|
61
|
+
const events = await (0, claudeCodeParser_1.parseClaudeCodeSessionWithSubagents)(sessionJsonlPath);
|
|
62
|
+
let written = 0;
|
|
63
|
+
for (const event of events) {
|
|
64
|
+
await (0, journal_1.appendCostEvent)(runDir, event);
|
|
65
|
+
written += 1;
|
|
66
|
+
}
|
|
67
|
+
return written;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Resolve the Claude Code projects directory path for a given session ID.
|
|
71
|
+
*
|
|
72
|
+
* Claude Code stores session JSONL files at:
|
|
73
|
+
* ```
|
|
74
|
+
* ~/.claude/projects/<project-slug>/<sessionId>.jsonl
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* Since we don't always know the project slug, this function returns the
|
|
78
|
+
* base Claude Code projects directory. The caller can then search for the
|
|
79
|
+
* session file within the project subdirectories.
|
|
80
|
+
*
|
|
81
|
+
* If a workspace path is provided, the project slug is derived using Claude
|
|
82
|
+
* Code's path-encoding convention (forward slashes and colons replaced with
|
|
83
|
+
* dashes, prefixed with the drive letter on Windows).
|
|
84
|
+
*
|
|
85
|
+
* @param sessionId - The Claude Code session UUID.
|
|
86
|
+
* @param workspacePath - Optional absolute workspace path to derive the project slug.
|
|
87
|
+
* @returns Absolute path to the session `.jsonl` file (when workspace is
|
|
88
|
+
* provided) or the Claude Code projects directory (when workspace is omitted).
|
|
89
|
+
*/
|
|
90
|
+
function resolveClaudeCodeSessionDir(sessionId, workspacePath) {
|
|
91
|
+
const homeDir = os.homedir();
|
|
92
|
+
const projectsDir = path.join(homeDir, ".claude", "projects");
|
|
93
|
+
if (!workspacePath) {
|
|
94
|
+
return projectsDir;
|
|
95
|
+
}
|
|
96
|
+
// Claude Code encodes the workspace path as the project directory name.
|
|
97
|
+
// On Windows: C:\Users\foo\project -> C--Users-foo-project
|
|
98
|
+
// The colon becomes a dash, backslashes become dashes (so :\ -> --)
|
|
99
|
+
// On Unix: /home/foo/project -> -home-foo-project
|
|
100
|
+
const projectSlug = workspacePath
|
|
101
|
+
.replace(/\\/g, "/") // Normalize to forward slashes.
|
|
102
|
+
.replace(/\//g, "-") // Replace path separators with dashes.
|
|
103
|
+
.replace(/:/g, "-"); // Replace colons with dashes (Windows drive).
|
|
104
|
+
return path.join(projectsDir, projectSlug, `${sessionId}.jsonl`);
|
|
105
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cost tracking module for Babysitter SDK.
|
|
3
|
+
*
|
|
4
|
+
* Provides type definitions, pricing constants, and cost calculation utilities
|
|
5
|
+
* for Anthropic Claude API token usage.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { calculateCostUsd, MODEL_PRICING } from '../cost';
|
|
10
|
+
*
|
|
11
|
+
* const cost = calculateCostUsd('claude-opus-4-6', 1000, 500, 200, 100);
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export { type CostEventData, type ModelCostStats, type KindCostStats, type RunCostStats, type AggregateCostStats, type ModelPricing, type ModelPricingExtended, MODEL_PRICING, MODEL_PRICING_EXTENDED, calculateCostUsd, calculateCostUsdExtended, type CostStatsOptions, } from "./types";
|
|
15
|
+
export { COST_TRACKED_EVENT_TYPE, appendCostEvent, extractCostEvents, computeRunCostStats, } from "./journal";
|
|
16
|
+
export { parseClaudeCodeSession, parseClaudeCodeSessionWithSubagents, aggregateUsageData, type AggregatedUsage, } from "./claudeCodeParser";
|
|
17
|
+
export { collectCostDataForRun, resolveClaudeCodeSessionDir, } from "./collector";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cost/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEL,KAAK,aAAa,EAGlB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAGvB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,aAAa,EACb,sBAAsB,EAGtB,gBAAgB,EAChB,wBAAwB,EAGxB,KAAK,gBAAgB,GACtB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAEL,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAEL,sBAAsB,EACtB,mCAAmC,EACnC,kBAAkB,EAClB,KAAK,eAAe,GACrB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEL,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveClaudeCodeSessionDir = exports.collectCostDataForRun = exports.aggregateUsageData = exports.parseClaudeCodeSessionWithSubagents = exports.parseClaudeCodeSession = exports.computeRunCostStats = exports.extractCostEvents = exports.appendCostEvent = exports.COST_TRACKED_EVENT_TYPE = exports.calculateCostUsdExtended = exports.calculateCostUsd = exports.MODEL_PRICING_EXTENDED = exports.MODEL_PRICING = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Cost tracking module for Babysitter SDK.
|
|
6
|
+
*
|
|
7
|
+
* Provides type definitions, pricing constants, and cost calculation utilities
|
|
8
|
+
* for Anthropic Claude API token usage.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { calculateCostUsd, MODEL_PRICING } from '../cost';
|
|
13
|
+
*
|
|
14
|
+
* const cost = calculateCostUsd('claude-opus-4-6', 1000, 500, 200, 100);
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
var types_1 = require("./types");
|
|
18
|
+
Object.defineProperty(exports, "MODEL_PRICING", { enumerable: true, get: function () { return types_1.MODEL_PRICING; } });
|
|
19
|
+
Object.defineProperty(exports, "MODEL_PRICING_EXTENDED", { enumerable: true, get: function () { return types_1.MODEL_PRICING_EXTENDED; } });
|
|
20
|
+
// Cost calculation
|
|
21
|
+
Object.defineProperty(exports, "calculateCostUsd", { enumerable: true, get: function () { return types_1.calculateCostUsd; } });
|
|
22
|
+
Object.defineProperty(exports, "calculateCostUsdExtended", { enumerable: true, get: function () { return types_1.calculateCostUsdExtended; } });
|
|
23
|
+
var journal_1 = require("./journal");
|
|
24
|
+
// Journal helpers
|
|
25
|
+
Object.defineProperty(exports, "COST_TRACKED_EVENT_TYPE", { enumerable: true, get: function () { return journal_1.COST_TRACKED_EVENT_TYPE; } });
|
|
26
|
+
Object.defineProperty(exports, "appendCostEvent", { enumerable: true, get: function () { return journal_1.appendCostEvent; } });
|
|
27
|
+
Object.defineProperty(exports, "extractCostEvents", { enumerable: true, get: function () { return journal_1.extractCostEvents; } });
|
|
28
|
+
Object.defineProperty(exports, "computeRunCostStats", { enumerable: true, get: function () { return journal_1.computeRunCostStats; } });
|
|
29
|
+
var claudeCodeParser_1 = require("./claudeCodeParser");
|
|
30
|
+
// Claude Code JSONL parser
|
|
31
|
+
Object.defineProperty(exports, "parseClaudeCodeSession", { enumerable: true, get: function () { return claudeCodeParser_1.parseClaudeCodeSession; } });
|
|
32
|
+
Object.defineProperty(exports, "parseClaudeCodeSessionWithSubagents", { enumerable: true, get: function () { return claudeCodeParser_1.parseClaudeCodeSessionWithSubagents; } });
|
|
33
|
+
Object.defineProperty(exports, "aggregateUsageData", { enumerable: true, get: function () { return claudeCodeParser_1.aggregateUsageData; } });
|
|
34
|
+
var collector_1 = require("./collector");
|
|
35
|
+
// Cost data collector
|
|
36
|
+
Object.defineProperty(exports, "collectCostDataForRun", { enumerable: true, get: function () { return collector_1.collectCostDataForRun; } });
|
|
37
|
+
Object.defineProperty(exports, "resolveClaudeCodeSessionDir", { enumerable: true, get: function () { return collector_1.resolveClaudeCodeSessionDir; } });
|
|
38
|
+
// effectCost moved to @a5c-ai/babysitter-agent (GAP-SUBOBS-003)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cost tracking journal helpers for Babysitter SDK.
|
|
3
|
+
*
|
|
4
|
+
* Provides functions to append COST_TRACKED events to the run journal,
|
|
5
|
+
* extract cost events from a journal, and compute aggregated cost statistics.
|
|
6
|
+
*/
|
|
7
|
+
import type { AppendEventResult, JournalEvent } from "../storage/types";
|
|
8
|
+
import type { CostEventData, RunCostStats } from "./types";
|
|
9
|
+
/** Journal event type constant for cost tracking events. */
|
|
10
|
+
export declare const COST_TRACKED_EVENT_TYPE = "COST_TRACKED";
|
|
11
|
+
/**
|
|
12
|
+
* Append a COST_TRACKED event to a run's journal.
|
|
13
|
+
*
|
|
14
|
+
* Computes the USD cost (if not already set) before persisting so that the
|
|
15
|
+
* journal record is self-contained.
|
|
16
|
+
*
|
|
17
|
+
* @param runDir - Absolute path to the run directory.
|
|
18
|
+
* @param costData - Token usage and metadata for the cost event.
|
|
19
|
+
* @returns The append result with seq, ulid, filename, checksum, path, and recordedAt.
|
|
20
|
+
*/
|
|
21
|
+
export declare function appendCostEvent(runDir: string, costData: CostEventData): Promise<AppendEventResult>;
|
|
22
|
+
/**
|
|
23
|
+
* Filter journal events to only COST_TRACKED entries.
|
|
24
|
+
*
|
|
25
|
+
* @param events - Full journal event list (as returned by `loadJournal`).
|
|
26
|
+
* @returns Subset of events whose type is COST_TRACKED.
|
|
27
|
+
*/
|
|
28
|
+
export declare function extractCostEvents(events: JournalEvent[]): JournalEvent[];
|
|
29
|
+
/**
|
|
30
|
+
* Compute aggregated cost statistics for a run from its journal events.
|
|
31
|
+
*
|
|
32
|
+
* Extracts COST_TRACKED events, then accumulates totals with per-model and
|
|
33
|
+
* per-task-kind breakdowns.
|
|
34
|
+
*
|
|
35
|
+
* @param runId - The run identifier (included in the returned stats object).
|
|
36
|
+
* @param events - Full journal event list for the run.
|
|
37
|
+
* @returns Aggregated cost stats for the run.
|
|
38
|
+
*/
|
|
39
|
+
export declare function computeRunCostStats(runId: string, events: JournalEvent[]): RunCostStats;
|
|
40
|
+
//# sourceMappingURL=journal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journal.d.ts","sourceRoot":"","sources":["../../src/cost/journal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EAGb,MAAM,SAAS,CAAC;AAGjB,4DAA4D;AAC5D,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AAEtD;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,aAAa,GACtB,OAAO,CAAC,iBAAiB,CAAC,CA0B5B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAExE;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,YAAY,EAAE,GACrB,YAAY,CAwFd"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Cost tracking journal helpers for Babysitter SDK.
|
|
4
|
+
*
|
|
5
|
+
* Provides functions to append COST_TRACKED events to the run journal,
|
|
6
|
+
* extract cost events from a journal, and compute aggregated cost statistics.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.COST_TRACKED_EVENT_TYPE = void 0;
|
|
10
|
+
exports.appendCostEvent = appendCostEvent;
|
|
11
|
+
exports.extractCostEvents = extractCostEvents;
|
|
12
|
+
exports.computeRunCostStats = computeRunCostStats;
|
|
13
|
+
const storage_1 = require("../storage");
|
|
14
|
+
const types_1 = require("./types");
|
|
15
|
+
/** Journal event type constant for cost tracking events. */
|
|
16
|
+
exports.COST_TRACKED_EVENT_TYPE = "COST_TRACKED";
|
|
17
|
+
/**
|
|
18
|
+
* Append a COST_TRACKED event to a run's journal.
|
|
19
|
+
*
|
|
20
|
+
* Computes the USD cost (if not already set) before persisting so that the
|
|
21
|
+
* journal record is self-contained.
|
|
22
|
+
*
|
|
23
|
+
* @param runDir - Absolute path to the run directory.
|
|
24
|
+
* @param costData - Token usage and metadata for the cost event.
|
|
25
|
+
* @returns The append result with seq, ulid, filename, checksum, path, and recordedAt.
|
|
26
|
+
*/
|
|
27
|
+
async function appendCostEvent(runDir, costData) {
|
|
28
|
+
// Pre-compute costUsd if the caller did not supply it.
|
|
29
|
+
const enriched = { ...costData };
|
|
30
|
+
if (enriched.costUsd == null) {
|
|
31
|
+
const computed = (0, types_1.calculateCostUsd)(enriched.model, enriched.inputTokens, enriched.outputTokens, enriched.cacheCreationTokens, enriched.cacheReadTokens);
|
|
32
|
+
if (computed !== undefined) {
|
|
33
|
+
enriched.costUsd = computed;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Set timestamp if missing.
|
|
37
|
+
if (!enriched.timestamp) {
|
|
38
|
+
enriched.timestamp = new Date().toISOString();
|
|
39
|
+
}
|
|
40
|
+
return (0, storage_1.appendEvent)({
|
|
41
|
+
runDir,
|
|
42
|
+
eventType: exports.COST_TRACKED_EVENT_TYPE,
|
|
43
|
+
event: enriched,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Filter journal events to only COST_TRACKED entries.
|
|
48
|
+
*
|
|
49
|
+
* @param events - Full journal event list (as returned by `loadJournal`).
|
|
50
|
+
* @returns Subset of events whose type is COST_TRACKED.
|
|
51
|
+
*/
|
|
52
|
+
function extractCostEvents(events) {
|
|
53
|
+
return events.filter((e) => e.type === exports.COST_TRACKED_EVENT_TYPE);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Compute aggregated cost statistics for a run from its journal events.
|
|
57
|
+
*
|
|
58
|
+
* Extracts COST_TRACKED events, then accumulates totals with per-model and
|
|
59
|
+
* per-task-kind breakdowns.
|
|
60
|
+
*
|
|
61
|
+
* @param runId - The run identifier (included in the returned stats object).
|
|
62
|
+
* @param events - Full journal event list for the run.
|
|
63
|
+
* @returns Aggregated cost stats for the run.
|
|
64
|
+
*/
|
|
65
|
+
function computeRunCostStats(runId, events) {
|
|
66
|
+
const costEvents = extractCostEvents(events);
|
|
67
|
+
const stats = {
|
|
68
|
+
runId,
|
|
69
|
+
date: costEvents.length > 0 ? costEvents[0].recordedAt : new Date().toISOString(),
|
|
70
|
+
eventCount: costEvents.length,
|
|
71
|
+
totalInputTokens: 0,
|
|
72
|
+
totalOutputTokens: 0,
|
|
73
|
+
totalCacheCreation: 0,
|
|
74
|
+
totalCacheRead: 0,
|
|
75
|
+
totalCostUsd: 0,
|
|
76
|
+
byModel: {},
|
|
77
|
+
byKind: {},
|
|
78
|
+
};
|
|
79
|
+
for (const event of costEvents) {
|
|
80
|
+
const data = event.data;
|
|
81
|
+
const inputTokens = data.inputTokens ?? 0;
|
|
82
|
+
const outputTokens = data.outputTokens ?? 0;
|
|
83
|
+
const cacheCreationTokens = data.cacheCreationTokens ?? 0;
|
|
84
|
+
const cacheReadTokens = data.cacheReadTokens ?? 0;
|
|
85
|
+
// Resolve per-event cost: use pre-computed value or calculate on the fly.
|
|
86
|
+
const eventCost = data.costUsd ??
|
|
87
|
+
(0, types_1.calculateCostUsd)(data.model, inputTokens, outputTokens, cacheCreationTokens, cacheReadTokens) ??
|
|
88
|
+
0;
|
|
89
|
+
// --- Run-level totals ---
|
|
90
|
+
stats.totalInputTokens += inputTokens;
|
|
91
|
+
stats.totalOutputTokens += outputTokens;
|
|
92
|
+
stats.totalCacheCreation += cacheCreationTokens;
|
|
93
|
+
stats.totalCacheRead += cacheReadTokens;
|
|
94
|
+
stats.totalCostUsd += eventCost;
|
|
95
|
+
// --- Per-model breakdown ---
|
|
96
|
+
const model = data.model ?? "unknown";
|
|
97
|
+
if (!stats.byModel[model]) {
|
|
98
|
+
stats.byModel[model] = {
|
|
99
|
+
model,
|
|
100
|
+
eventCount: 0,
|
|
101
|
+
inputTokens: 0,
|
|
102
|
+
outputTokens: 0,
|
|
103
|
+
cacheCreationTokens: 0,
|
|
104
|
+
cacheReadTokens: 0,
|
|
105
|
+
costUsd: 0,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
const ms = stats.byModel[model];
|
|
109
|
+
ms.eventCount += 1;
|
|
110
|
+
ms.inputTokens += inputTokens;
|
|
111
|
+
ms.outputTokens += outputTokens;
|
|
112
|
+
ms.cacheCreationTokens += cacheCreationTokens;
|
|
113
|
+
ms.cacheReadTokens += cacheReadTokens;
|
|
114
|
+
ms.costUsd += eventCost;
|
|
115
|
+
// --- Per-kind breakdown ---
|
|
116
|
+
const kind = data.taskKind ?? "unknown";
|
|
117
|
+
if (!stats.byKind[kind]) {
|
|
118
|
+
stats.byKind[kind] = {
|
|
119
|
+
kind,
|
|
120
|
+
eventCount: 0,
|
|
121
|
+
costUsd: 0,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
const ks = stats.byKind[kind];
|
|
125
|
+
ks.eventCount += 1;
|
|
126
|
+
ks.costUsd += eventCost;
|
|
127
|
+
}
|
|
128
|
+
// Round totals to 6 decimal places to avoid floating-point drift.
|
|
129
|
+
stats.totalCostUsd = Math.round(stats.totalCostUsd * 1_000_000) / 1_000_000;
|
|
130
|
+
for (const ms of Object.values(stats.byModel)) {
|
|
131
|
+
ms.costUsd = Math.round(ms.costUsd * 1_000_000) / 1_000_000;
|
|
132
|
+
}
|
|
133
|
+
for (const ks of Object.values(stats.byKind)) {
|
|
134
|
+
ks.costUsd = Math.round(ks.costUsd * 1_000_000) / 1_000_000;
|
|
135
|
+
}
|
|
136
|
+
return stats;
|
|
137
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pricing constants and calculation functions for Claude models.
|
|
3
|
+
* Extracted from types.ts for max-lines compliance.
|
|
4
|
+
*/
|
|
5
|
+
import type { ModelPricing, ModelPricingExtended } from "./types";
|
|
6
|
+
/**
|
|
7
|
+
* Pricing table for known Claude models.
|
|
8
|
+
*/
|
|
9
|
+
export declare const MODEL_PRICING: Record<string, ModelPricing>;
|
|
10
|
+
export declare const MODEL_PRICING_EXTENDED: Record<string, ModelPricingExtended>;
|
|
11
|
+
/**
|
|
12
|
+
* Calculate the USD cost for a single API interaction.
|
|
13
|
+
*/
|
|
14
|
+
export declare function calculateCostUsd(model: string, inputTokens: number, outputTokens: number, cacheCreationTokens: number, cacheReadTokens: number): number | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Calculate the USD cost with separate 5-minute and 1-hour cache write rates.
|
|
17
|
+
*/
|
|
18
|
+
export declare function calculateCostUsdExtended(model: string, inputTokens: number, outputTokens: number, cacheCreation5mTokens: number, cacheCreation1hTokens: number, cacheReadTokens: number): number | undefined;
|
|
19
|
+
//# sourceMappingURL=pricing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing.d.ts","sourceRoot":"","sources":["../../src/cost/pricing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CA+BtD,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAqCvE,CAAC;AAgBF;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,mBAAmB,EAAE,MAAM,EAC3B,eAAe,EAAE,MAAM,GACtB,MAAM,GAAG,SAAS,CASpB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,qBAAqB,EAAE,MAAM,EAC7B,qBAAqB,EAAE,MAAM,EAC7B,eAAe,EAAE,MAAM,GACtB,MAAM,GAAG,SAAS,CAmBpB"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Pricing constants and calculation functions for Claude models.
|
|
4
|
+
* Extracted from types.ts for max-lines compliance.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.MODEL_PRICING_EXTENDED = exports.MODEL_PRICING = void 0;
|
|
8
|
+
exports.calculateCostUsd = calculateCostUsd;
|
|
9
|
+
exports.calculateCostUsdExtended = calculateCostUsdExtended;
|
|
10
|
+
/**
|
|
11
|
+
* Pricing table for known Claude models.
|
|
12
|
+
*/
|
|
13
|
+
exports.MODEL_PRICING = {
|
|
14
|
+
// --- Opus family ---
|
|
15
|
+
"claude-opus-4-6": {
|
|
16
|
+
inputPer1M: 5, outputPer1M: 25, cacheCreationPer1M: 6.25, cacheReadPer1M: 0.5,
|
|
17
|
+
},
|
|
18
|
+
"claude-opus-4-5": {
|
|
19
|
+
inputPer1M: 5, outputPer1M: 25, cacheCreationPer1M: 6.25, cacheReadPer1M: 0.5,
|
|
20
|
+
},
|
|
21
|
+
"claude-opus-4-1": {
|
|
22
|
+
inputPer1M: 15, outputPer1M: 75, cacheCreationPer1M: 18.75, cacheReadPer1M: 1.5,
|
|
23
|
+
},
|
|
24
|
+
"claude-opus-4-0": {
|
|
25
|
+
inputPer1M: 15, outputPer1M: 75, cacheCreationPer1M: 18.75, cacheReadPer1M: 1.5,
|
|
26
|
+
},
|
|
27
|
+
// --- Sonnet family ---
|
|
28
|
+
"claude-sonnet-4-6": {
|
|
29
|
+
inputPer1M: 3, outputPer1M: 15, cacheCreationPer1M: 3.75, cacheReadPer1M: 0.3,
|
|
30
|
+
},
|
|
31
|
+
"claude-sonnet-4-5": {
|
|
32
|
+
inputPer1M: 3, outputPer1M: 15, cacheCreationPer1M: 3.75, cacheReadPer1M: 0.3,
|
|
33
|
+
},
|
|
34
|
+
"claude-sonnet-4-0": {
|
|
35
|
+
inputPer1M: 3, outputPer1M: 15, cacheCreationPer1M: 3.75, cacheReadPer1M: 0.3,
|
|
36
|
+
},
|
|
37
|
+
// --- Haiku family ---
|
|
38
|
+
"claude-haiku-4-5": {
|
|
39
|
+
inputPer1M: 1, outputPer1M: 5, cacheCreationPer1M: 1.25, cacheReadPer1M: 0.1,
|
|
40
|
+
},
|
|
41
|
+
"claude-haiku-3-5": {
|
|
42
|
+
inputPer1M: 0.8, outputPer1M: 4, cacheCreationPer1M: 1, cacheReadPer1M: 0.08,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
exports.MODEL_PRICING_EXTENDED = {
|
|
46
|
+
"claude-opus-4-6": {
|
|
47
|
+
inputPer1M: 5, outputPer1M: 25, cacheCreationPer1M: 6.25,
|
|
48
|
+
cacheCreation5mPer1M: 6.25, cacheCreation1hPer1M: 10, cacheReadPer1M: 0.5,
|
|
49
|
+
},
|
|
50
|
+
"claude-opus-4-5": {
|
|
51
|
+
inputPer1M: 5, outputPer1M: 25, cacheCreationPer1M: 6.25,
|
|
52
|
+
cacheCreation5mPer1M: 6.25, cacheCreation1hPer1M: 10, cacheReadPer1M: 0.5,
|
|
53
|
+
},
|
|
54
|
+
"claude-opus-4-1": {
|
|
55
|
+
inputPer1M: 15, outputPer1M: 75, cacheCreationPer1M: 18.75,
|
|
56
|
+
cacheCreation5mPer1M: 18.75, cacheCreation1hPer1M: 30, cacheReadPer1M: 1.5,
|
|
57
|
+
},
|
|
58
|
+
"claude-opus-4-0": {
|
|
59
|
+
inputPer1M: 15, outputPer1M: 75, cacheCreationPer1M: 18.75,
|
|
60
|
+
cacheCreation5mPer1M: 18.75, cacheCreation1hPer1M: 30, cacheReadPer1M: 1.5,
|
|
61
|
+
},
|
|
62
|
+
"claude-sonnet-4-6": {
|
|
63
|
+
inputPer1M: 3, outputPer1M: 15, cacheCreationPer1M: 3.75,
|
|
64
|
+
cacheCreation5mPer1M: 3.75, cacheCreation1hPer1M: 6, cacheReadPer1M: 0.3,
|
|
65
|
+
},
|
|
66
|
+
"claude-sonnet-4-5": {
|
|
67
|
+
inputPer1M: 3, outputPer1M: 15, cacheCreationPer1M: 3.75,
|
|
68
|
+
cacheCreation5mPer1M: 3.75, cacheCreation1hPer1M: 6, cacheReadPer1M: 0.3,
|
|
69
|
+
},
|
|
70
|
+
"claude-sonnet-4-0": {
|
|
71
|
+
inputPer1M: 3, outputPer1M: 15, cacheCreationPer1M: 3.75,
|
|
72
|
+
cacheCreation5mPer1M: 3.75, cacheCreation1hPer1M: 6, cacheReadPer1M: 0.3,
|
|
73
|
+
},
|
|
74
|
+
"claude-haiku-4-5": {
|
|
75
|
+
inputPer1M: 1, outputPer1M: 5, cacheCreationPer1M: 1.25,
|
|
76
|
+
cacheCreation5mPer1M: 1.25, cacheCreation1hPer1M: 2, cacheReadPer1M: 0.1,
|
|
77
|
+
},
|
|
78
|
+
"claude-haiku-3-5": {
|
|
79
|
+
inputPer1M: 0.8, outputPer1M: 4, cacheCreationPer1M: 1,
|
|
80
|
+
cacheCreation5mPer1M: 1, cacheCreation1hPer1M: 1.6, cacheReadPer1M: 0.08,
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Resolve pricing for a model identifier.
|
|
85
|
+
*/
|
|
86
|
+
function resolvePricing(model) {
|
|
87
|
+
if (exports.MODEL_PRICING[model])
|
|
88
|
+
return exports.MODEL_PRICING[model];
|
|
89
|
+
const withoutDate = model.replace(/-\d{8}$/, "");
|
|
90
|
+
if (exports.MODEL_PRICING[withoutDate])
|
|
91
|
+
return exports.MODEL_PRICING[withoutDate];
|
|
92
|
+
const keys = Object.keys(exports.MODEL_PRICING).sort((a, b) => b.length - a.length);
|
|
93
|
+
for (const key of keys) {
|
|
94
|
+
if (withoutDate.startsWith(key))
|
|
95
|
+
return exports.MODEL_PRICING[key];
|
|
96
|
+
}
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Calculate the USD cost for a single API interaction.
|
|
101
|
+
*/
|
|
102
|
+
function calculateCostUsd(model, inputTokens, outputTokens, cacheCreationTokens, cacheReadTokens) {
|
|
103
|
+
const pricing = resolvePricing(model);
|
|
104
|
+
if (!pricing)
|
|
105
|
+
return undefined;
|
|
106
|
+
const cost = (inputTokens / 1_000_000) * pricing.inputPer1M +
|
|
107
|
+
(outputTokens / 1_000_000) * pricing.outputPer1M +
|
|
108
|
+
(cacheCreationTokens / 1_000_000) * pricing.cacheCreationPer1M +
|
|
109
|
+
(cacheReadTokens / 1_000_000) * pricing.cacheReadPer1M;
|
|
110
|
+
return Math.round(cost * 1_000_000) / 1_000_000;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Calculate the USD cost with separate 5-minute and 1-hour cache write rates.
|
|
114
|
+
*/
|
|
115
|
+
function calculateCostUsdExtended(model, inputTokens, outputTokens, cacheCreation5mTokens, cacheCreation1hTokens, cacheReadTokens) {
|
|
116
|
+
const pricing = exports.MODEL_PRICING_EXTENDED[model] ?? (() => {
|
|
117
|
+
const base = resolvePricing(model);
|
|
118
|
+
if (!base)
|
|
119
|
+
return undefined;
|
|
120
|
+
return {
|
|
121
|
+
...base,
|
|
122
|
+
cacheCreation5mPer1M: base.cacheCreationPer1M,
|
|
123
|
+
cacheCreation1hPer1M: base.inputPer1M * 2,
|
|
124
|
+
};
|
|
125
|
+
})();
|
|
126
|
+
if (!pricing)
|
|
127
|
+
return undefined;
|
|
128
|
+
const ext = pricing;
|
|
129
|
+
const cost = (inputTokens / 1_000_000) * ext.inputPer1M +
|
|
130
|
+
(outputTokens / 1_000_000) * ext.outputPer1M +
|
|
131
|
+
(cacheCreation5mTokens / 1_000_000) * ext.cacheCreation5mPer1M +
|
|
132
|
+
(cacheCreation1hTokens / 1_000_000) * ext.cacheCreation1hPer1M +
|
|
133
|
+
(cacheReadTokens / 1_000_000) * ext.cacheReadPer1M;
|
|
134
|
+
return Math.round(cost * 1_000_000) / 1_000_000;
|
|
135
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cost tracking type definitions for Babysitter SDK.
|
|
3
|
+
*
|
|
4
|
+
* Covers Anthropic Claude API token usage structures as seen in Claude Code
|
|
5
|
+
* session JSONL files, plus aggregation interfaces for run-level and
|
|
6
|
+
* cross-run cost reporting.
|
|
7
|
+
*
|
|
8
|
+
* Pricing source: https://docs.anthropic.com/en/docs/about-claude/pricing
|
|
9
|
+
* Last verified: 2026-04-05
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Token/cost data for a single API interaction (assistant message).
|
|
13
|
+
*/
|
|
14
|
+
export interface CostEventData {
|
|
15
|
+
model: string;
|
|
16
|
+
inputTokens: number;
|
|
17
|
+
outputTokens: number;
|
|
18
|
+
cacheCreationTokens: number;
|
|
19
|
+
cacheReadTokens: number;
|
|
20
|
+
cacheCreation5mTokens: number;
|
|
21
|
+
cacheCreation1hTokens: number;
|
|
22
|
+
serviceTier?: string;
|
|
23
|
+
effectId?: string;
|
|
24
|
+
taskKind?: string;
|
|
25
|
+
durationMs?: number;
|
|
26
|
+
costUsd?: number;
|
|
27
|
+
timestamp?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface ModelCostStats {
|
|
30
|
+
model: string;
|
|
31
|
+
eventCount: number;
|
|
32
|
+
inputTokens: number;
|
|
33
|
+
outputTokens: number;
|
|
34
|
+
cacheCreationTokens: number;
|
|
35
|
+
cacheReadTokens: number;
|
|
36
|
+
costUsd: number;
|
|
37
|
+
}
|
|
38
|
+
export interface KindCostStats {
|
|
39
|
+
kind: string;
|
|
40
|
+
eventCount: number;
|
|
41
|
+
costUsd: number;
|
|
42
|
+
}
|
|
43
|
+
export interface RunCostStats {
|
|
44
|
+
runId: string;
|
|
45
|
+
date: string;
|
|
46
|
+
eventCount: number;
|
|
47
|
+
totalInputTokens: number;
|
|
48
|
+
totalOutputTokens: number;
|
|
49
|
+
totalCacheCreation: number;
|
|
50
|
+
totalCacheRead: number;
|
|
51
|
+
totalCostUsd: number;
|
|
52
|
+
byModel: Record<string, ModelCostStats>;
|
|
53
|
+
byKind: Record<string, KindCostStats>;
|
|
54
|
+
}
|
|
55
|
+
export interface AggregateCostStats {
|
|
56
|
+
totalRuns: number;
|
|
57
|
+
totalEvents: number;
|
|
58
|
+
totalInputTokens: number;
|
|
59
|
+
totalOutputTokens: number;
|
|
60
|
+
totalCacheCreation: number;
|
|
61
|
+
totalCacheRead: number;
|
|
62
|
+
totalCostUsd: number;
|
|
63
|
+
overallCostUsd: number;
|
|
64
|
+
runs: RunCostStats[];
|
|
65
|
+
}
|
|
66
|
+
export interface ModelPricing {
|
|
67
|
+
inputPer1M: number;
|
|
68
|
+
outputPer1M: number;
|
|
69
|
+
cacheCreationPer1M: number;
|
|
70
|
+
cacheReadPer1M: number;
|
|
71
|
+
}
|
|
72
|
+
export interface ModelPricingExtended extends ModelPricing {
|
|
73
|
+
cacheCreation5mPer1M: number;
|
|
74
|
+
cacheCreation1hPer1M: number;
|
|
75
|
+
}
|
|
76
|
+
export interface CostStatsOptions {
|
|
77
|
+
runId?: string;
|
|
78
|
+
all?: boolean;
|
|
79
|
+
json?: boolean;
|
|
80
|
+
runsDir?: string;
|
|
81
|
+
model?: string;
|
|
82
|
+
kind?: string;
|
|
83
|
+
since?: string;
|
|
84
|
+
until?: string;
|
|
85
|
+
}
|
|
86
|
+
export { MODEL_PRICING, MODEL_PRICING_EXTENDED, calculateCostUsd, calculateCostUsdExtended, } from "./pricing";
|
|
87
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cost/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,YAAY,EAAE,CAAC;CACtB;AAMD,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAMD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Cost tracking type definitions for Babysitter SDK.
|
|
4
|
+
*
|
|
5
|
+
* Covers Anthropic Claude API token usage structures as seen in Claude Code
|
|
6
|
+
* session JSONL files, plus aggregation interfaces for run-level and
|
|
7
|
+
* cross-run cost reporting.
|
|
8
|
+
*
|
|
9
|
+
* Pricing source: https://docs.anthropic.com/en/docs/about-claude/pricing
|
|
10
|
+
* Last verified: 2026-04-05
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.calculateCostUsdExtended = exports.calculateCostUsd = exports.MODEL_PRICING_EXTENDED = exports.MODEL_PRICING = void 0;
|
|
14
|
+
// Re-export pricing constants and functions from the extracted module
|
|
15
|
+
var pricing_1 = require("./pricing");
|
|
16
|
+
Object.defineProperty(exports, "MODEL_PRICING", { enumerable: true, get: function () { return pricing_1.MODEL_PRICING; } });
|
|
17
|
+
Object.defineProperty(exports, "MODEL_PRICING_EXTENDED", { enumerable: true, get: function () { return pricing_1.MODEL_PRICING_EXTENDED; } });
|
|
18
|
+
Object.defineProperty(exports, "calculateCostUsd", { enumerable: true, get: function () { return pricing_1.calculateCostUsd; } });
|
|
19
|
+
Object.defineProperty(exports, "calculateCostUsdExtended", { enumerable: true, get: function () { return pricing_1.calculateCostUsdExtended; } });
|