@a5c-ai/babysitter-sdk 5.0.1-staging.71bb37a4 → 5.0.1-staging.75c8fb21
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/README.md +68 -0
- package/dist/breakpoints/evaluator.d.ts.map +1 -1
- package/dist/breakpoints/evaluator.js +31 -3
- package/dist/breakpoints/index.d.ts +2 -5
- package/dist/breakpoints/index.d.ts.map +1 -1
- package/dist/breakpoints/index.js +4 -20
- 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/cli/commands/breakpointRules.d.ts.map +1 -1
- package/dist/cli/commands/breakpointRules.js +30 -27
- package/dist/cli/commands/compressOutput.d.ts.map +1 -1
- package/dist/cli/commands/compressOutput.js +9 -345
- 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/costStats.d.ts.map +1 -1
- package/dist/cli/commands/costStats.js +35 -27
- package/dist/cli/commands/harness/install.d.ts +9 -0
- package/dist/cli/commands/harness/install.d.ts.map +1 -1
- package/dist/cli/commands/harness/install.js +20 -31
- 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.map +1 -1
- package/dist/cli/commands/health/environment.js +11 -1
- package/dist/cli/commands/health.d.ts +0 -15
- package/dist/cli/commands/health.d.ts.map +1 -1
- package/dist/cli/commands/health.js +5 -300
- package/dist/cli/commands/hooks/run.d.ts.map +1 -1
- package/dist/cli/commands/hooks/run.js +3 -2
- package/dist/cli/commands/instructions.d.ts +1 -1
- package/dist/cli/commands/instructions.d.ts.map +1 -1
- package/dist/cli/commands/instructions.js +72 -6
- package/dist/cli/commands/mcpServe.d.ts +2 -9
- package/dist/cli/commands/mcpServe.d.ts.map +1 -1
- package/dist/cli/commands/mcpServe.js +5 -29
- package/dist/cli/commands/runIterate.d.ts.map +1 -1
- package/dist/cli/commands/runIterate.js +7 -214
- 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.map +1 -1
- package/dist/cli/commands/session/associate.js +4 -36
- package/dist/cli/commands/session/iterationMessage.d.ts.map +1 -1
- package/dist/cli/commands/session/iterationMessage.js +9 -54
- package/dist/cli/commands/session/resume.d.ts.map +1 -1
- package/dist/cli/commands/session/resume.js +6 -16
- package/dist/cli/commands/skill/discoveryLocal.d.ts +1 -1
- package/dist/cli/commands/skill/discoveryLocal.d.ts.map +1 -1
- package/dist/cli/commands/skill.d.ts +1 -1
- package/dist/cli/commands/skill.d.ts.map +1 -1
- package/dist/cli/commands/skill.js +13 -12
- package/dist/cli/commands/tokensStats.d.ts.map +1 -1
- package/dist/cli/commands/tokensStats.js +40 -157
- 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/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 +1 -3
- package/dist/cli/main/argFlags.d.ts.map +1 -1
- package/dist/cli/main/argFlags.js +3 -343
- package/dist/cli/main/args.d.ts.map +1 -1
- package/dist/cli/main/args.js +4 -27
- package/dist/cli/main/dispatchRunSession.js +0 -10
- package/dist/cli/main/program.js +1 -1
- package/dist/cli/main/runCreate.js +2 -2
- package/dist/cli/main/runSupport.d.ts +9 -1
- package/dist/cli/main/runSupport.d.ts.map +1 -1
- package/dist/cli/main/runSupport.js +71 -1
- package/dist/cli/main/usage.d.ts.map +1 -1
- package/dist/cli/main/usage.js +43 -42
- 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 +3 -126
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +10 -258
- package/dist/config/index.d.ts +3 -2
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +15 -2
- 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/index.d.ts +0 -1
- package/dist/cost/index.d.ts.map +1 -1
- package/dist/cost/index.js +2 -3
- 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 +2 -79
- package/dist/cost/types.d.ts.map +1 -1
- package/dist/cost/types.js +8 -220
- 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 +63 -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 +193 -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.js +1 -1
- 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 +21 -1
- package/dist/harness/discovery.d.ts.map +1 -1
- package/dist/harness/discovery.js +70 -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 +19 -0
- package/dist/harness/hooks/promptContexts.d.ts.map +1 -0
- package/dist/harness/hooks/promptContexts.js +183 -0
- package/dist/harness/hooks/runState.d.ts.map +1 -1
- package/dist/harness/hooks/runState.js +13 -28
- 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 +145 -0
- package/dist/harness/{claudeCode/stopHookState.d.ts → hooks/stopHookContinuation.d.ts} +8 -2
- package/dist/harness/hooks/stopHookContinuation.d.ts.map +1 -0
- package/dist/harness/{claudeCode/stopHookState.js → hooks/stopHookContinuation.js} +22 -21
- 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 +371 -0
- package/dist/harness/hooks/utils.d.ts +29 -0
- package/dist/harness/hooks/utils.d.ts.map +1 -1
- package/dist/harness/hooks/utils.js +90 -0
- package/dist/harness/index.d.ts +12 -9
- package/dist/harness/index.d.ts.map +1 -1
- package/dist/harness/index.js +20 -14
- package/dist/harness/install.d.ts +75 -0
- package/dist/harness/install.d.ts.map +1 -0
- package/dist/harness/install.js +199 -0
- package/dist/harness/installSupport.d.ts.map +1 -1
- package/dist/harness/installSupport.js +19 -0
- package/dist/harness/internal/promptContext.js +1 -1
- package/dist/harness/registry.d.ts +11 -2
- package/dist/harness/registry.d.ts.map +1 -1
- package/dist/harness/registry.js +110 -53
- package/dist/harness/types.d.ts +19 -2
- package/dist/harness/types.d.ts.map +1 -1
- package/dist/harness/unified/adapter.d.ts +5 -5
- package/dist/harness/unified/adapter.d.ts.map +1 -1
- package/dist/harness/unified/adapter.js +57 -26
- package/dist/harness/unified/capabilities.d.ts +5 -5
- package/dist/harness/unified/capabilities.js +7 -7
- package/dist/harness/unified/discovery.d.ts +1 -1
- package/dist/harness/unified/discovery.js +2 -2
- package/dist/harness/unified/promptContext.d.ts +1 -1
- package/dist/harness/unified/promptContext.js +2 -2
- package/dist/harness/unified/subprocess.d.ts +5 -5
- package/dist/harness/unified/subprocess.d.ts.map +1 -1
- package/dist/harness/unified/subprocess.js +10 -7
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/mcp/index.d.ts +0 -4
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +4 -9
- package/dist/mcp/tools/discovery.d.ts.map +1 -1
- package/dist/mcp/tools/discovery.js +3 -2
- package/dist/mcp/tools/sessions.d.ts.map +1 -1
- package/dist/mcp/tools/sessions.js +2 -8
- package/dist/mcp/transport/index.d.ts +0 -4
- package/dist/mcp/transport/index.d.ts.map +1 -1
- package/dist/mcp/transport/index.js +1 -8
- package/dist/mcp/util/resolve-run-dir.d.ts +1 -1
- package/dist/mcp/util/resolve-run-dir.d.ts.map +1 -1
- package/dist/mcp/util/resolve-run-dir.js +3 -39
- package/dist/plugins/marketplace.d.ts +1 -47
- package/dist/plugins/marketplace.d.ts.map +1 -1
- package/dist/plugins/marketplace.js +6 -186
- 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/processLibrary/active.d.ts +2 -83
- package/dist/processLibrary/active.d.ts.map +1 -1
- package/dist/processLibrary/active.js +65 -167
- 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/prompts/compose.js +1 -1
- package/dist/prompts/context.d.ts +1 -9
- package/dist/prompts/context.d.ts.map +1 -1
- package/dist/prompts/context.js +12 -20
- package/dist/prompts/parts/criticalRules.js +1 -1
- package/dist/prompts/parts/runCreation.d.ts.map +1 -1
- package/dist/prompts/parts/runCreation.js +2 -12
- package/dist/prompts/templates/commands/doctor.md +5 -5
- package/dist/prompts/templates/critical-rules.md +2 -2
- package/dist/prompts/templates/effects.md +1 -1
- package/dist/prompts/templates/iteration.md +1 -1
- package/dist/prompts/templates/process-guidelines.md +1 -1
- package/dist/prompts/templates/quick-reference.md +1 -1
- package/dist/prompts/templates/results-posting.md +2 -2
- package/dist/prompts/templates/run-creation.md +2 -2
- package/dist/prompts/templates/run-overlap-detection.md +6 -4
- package/dist/prompts/templates/task-examples.md +7 -7
- package/dist/prompts/templates/task-kinds.md +7 -3
- package/dist/prompts/types.d.ts +1 -1
- package/dist/runtime/commitEffectResult.d.ts.map +1 -1
- package/dist/runtime/commitEffectResult.js +5 -2
- package/dist/runtime/createRun.d.ts.map +1 -1
- package/dist/runtime/createRun.js +28 -14
- 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/exceptions.d.ts +3 -152
- package/dist/runtime/exceptions.d.ts.map +1 -1
- package/dist/runtime/exceptions.js +22 -220
- package/dist/runtime/index.d.ts +2 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +8 -1
- 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 +4 -3
- package/dist/runtime/intrinsics/task.d.ts.map +1 -1
- package/dist/runtime/intrinsics/task.js +31 -260
- 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/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 +2 -7
- package/dist/runtime/orchestrateIteration.d.ts.map +1 -1
- package/dist/runtime/orchestrateIteration.js +46 -267
- 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 +3 -1
- package/dist/runtime/policy/index.d.ts.map +1 -1
- package/dist/runtime/policy/index.js +9 -1
- 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 +4 -0
- package/dist/runtime/policy/types.d.ts.map +1 -1
- package/dist/runtime/processContext.d.ts +3 -0
- package/dist/runtime/processContext.d.ts.map +1 -1
- package/dist/runtime/processContext.js +3 -0
- package/dist/runtime/replay/createReplayEngine.d.ts +1 -0
- package/dist/runtime/replay/createReplayEngine.d.ts.map +1 -1
- package/dist/runtime/replay/createReplayEngine.js +26 -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/types.d.ts +33 -1
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/session/cleanup.d.ts.map +1 -1
- package/dist/session/cleanup.js +26 -21
- package/dist/session/discovery.d.ts +4 -1
- package/dist/session/discovery.d.ts.map +1 -1
- package/dist/session/discovery.js +13 -18
- package/dist/session/types.d.ts +1 -1
- package/dist/session/types.d.ts.map +1 -1
- package/dist/session/whoami.js +2 -2
- package/dist/storage/createRunDir.d.ts.map +1 -1
- package/dist/storage/createRunDir.js +1 -0
- package/dist/storage/types.d.ts +14 -0
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/tasks/kinds/index.d.ts +1 -1
- package/dist/tasks/kinds/index.d.ts.map +1 -1
- package/dist/tasks/kinds/index.js +58 -237
- 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/types.d.ts +18 -3
- package/dist/tasks/types.d.ts.map +1 -1
- 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/sessionMarker.d.ts +3 -7
- package/dist/utils/sessionMarker.d.ts.map +1 -1
- package/dist/utils/sessionMarker.js +32 -216
- package/package.json +28 -5
- package/dist/breakpoints/approvalChains.d.ts +0 -66
- package/dist/breakpoints/approvalChains.d.ts.map +0 -1
- package/dist/breakpoints/approvalChains.js +0 -109
- package/dist/breakpoints/delegation.d.ts +0 -40
- package/dist/breakpoints/delegation.d.ts.map +0 -1
- package/dist/breakpoints/delegation.js +0 -197
- package/dist/breakpoints/delegationTypes.d.ts +0 -44
- package/dist/breakpoints/delegationTypes.d.ts.map +0 -1
- package/dist/breakpoints/delegationTypes.js +0 -8
- package/dist/breakpoints/postures.d.ts +0 -26
- package/dist/breakpoints/postures.d.ts.map +0 -1
- package/dist/breakpoints/postures.js +0 -98
- package/dist/cli/commandRegistry.d.ts +0 -27
- package/dist/cli/commandRegistry.d.ts.map +0 -1
- package/dist/cli/commandRegistry.js +0 -121
- package/dist/compression/compaction.d.ts +0 -80
- package/dist/compression/compaction.d.ts.map +0 -1
- package/dist/compression/compaction.js +0 -308
- package/dist/cost/effectCost.d.ts +0 -21
- package/dist/cost/effectCost.d.ts.map +0 -1
- package/dist/cost/effectCost.js +0 -26
- package/dist/harness/claudeCode/adapter.d.ts +0 -5
- package/dist/harness/claudeCode/adapter.d.ts.map +0 -1
- package/dist/harness/claudeCode/adapter.js +0 -101
- package/dist/harness/claudeCode/discovery.d.ts +0 -3
- package/dist/harness/claudeCode/discovery.d.ts.map +0 -1
- package/dist/harness/claudeCode/discovery.js +0 -11
- package/dist/harness/claudeCode/index.d.ts +0 -3
- package/dist/harness/claudeCode/index.d.ts.map +0 -1
- package/dist/harness/claudeCode/index.js +0 -9
- package/dist/harness/claudeCode/lifecycle.d.ts +0 -5
- package/dist/harness/claudeCode/lifecycle.d.ts.map +0 -1
- package/dist/harness/claudeCode/lifecycle.js +0 -204
- package/dist/harness/claudeCode/promptContext.d.ts +0 -3
- package/dist/harness/claudeCode/promptContext.d.ts.map +0 -1
- package/dist/harness/claudeCode/promptContext.js +0 -23
- package/dist/harness/claudeCode/sessionStart.d.ts +0 -3
- package/dist/harness/claudeCode/sessionStart.d.ts.map +0 -1
- package/dist/harness/claudeCode/sessionStart.js +0 -179
- package/dist/harness/claudeCode/shared.d.ts +0 -43
- package/dist/harness/claudeCode/shared.d.ts.map +0 -1
- package/dist/harness/claudeCode/shared.js +0 -268
- package/dist/harness/claudeCode/stopHook.d.ts +0 -3
- package/dist/harness/claudeCode/stopHook.d.ts.map +0 -1
- package/dist/harness/claudeCode/stopHook.js +0 -303
- package/dist/harness/claudeCode/stopHookState.d.ts.map +0 -1
- package/dist/harness/codex/adapter.d.ts +0 -3
- package/dist/harness/codex/adapter.d.ts.map +0 -1
- package/dist/harness/codex/adapter.js +0 -73
- package/dist/harness/codex/discovery.d.ts +0 -3
- package/dist/harness/codex/discovery.d.ts.map +0 -1
- package/dist/harness/codex/discovery.js +0 -11
- package/dist/harness/codex/hooks.d.ts +0 -4
- package/dist/harness/codex/hooks.d.ts.map +0 -1
- package/dist/harness/codex/hooks.js +0 -85
- package/dist/harness/codex/index.d.ts +0 -2
- package/dist/harness/codex/index.d.ts.map +0 -1
- package/dist/harness/codex/index.js +0 -5
- package/dist/harness/codex/install.d.ts +0 -4
- package/dist/harness/codex/install.d.ts.map +0 -1
- package/dist/harness/codex/install.js +0 -103
- package/dist/harness/codex/promptContext.d.ts +0 -3
- package/dist/harness/codex/promptContext.d.ts.map +0 -1
- package/dist/harness/codex/promptContext.js +0 -22
- package/dist/harness/codex/shared.d.ts +0 -15
- package/dist/harness/codex/shared.d.ts.map +0 -1
- package/dist/harness/codex/shared.js +0 -149
- package/dist/harness/cursor/adapter.d.ts +0 -3
- package/dist/harness/cursor/adapter.d.ts.map +0 -1
- package/dist/harness/cursor/adapter.js +0 -233
- package/dist/harness/cursor/discovery.d.ts +0 -3
- package/dist/harness/cursor/discovery.d.ts.map +0 -1
- package/dist/harness/cursor/discovery.js +0 -11
- package/dist/harness/cursor/hooks.d.ts +0 -8
- package/dist/harness/cursor/hooks.d.ts.map +0 -1
- package/dist/harness/cursor/hooks.js +0 -362
- package/dist/harness/cursor/index.d.ts +0 -2
- package/dist/harness/cursor/index.d.ts.map +0 -1
- package/dist/harness/cursor/index.js +0 -5
- package/dist/harness/cursor/promptContext.d.ts +0 -3
- package/dist/harness/cursor/promptContext.d.ts.map +0 -1
- package/dist/harness/cursor/promptContext.js +0 -22
- package/dist/harness/geminiCli/adapter.d.ts +0 -3
- package/dist/harness/geminiCli/adapter.d.ts.map +0 -1
- package/dist/harness/geminiCli/adapter.js +0 -190
- package/dist/harness/geminiCli/discovery.d.ts +0 -3
- package/dist/harness/geminiCli/discovery.d.ts.map +0 -1
- package/dist/harness/geminiCli/discovery.js +0 -11
- package/dist/harness/geminiCli/hooks.d.ts +0 -9
- package/dist/harness/geminiCli/hooks.d.ts.map +0 -1
- package/dist/harness/geminiCli/hooks.js +0 -401
- package/dist/harness/geminiCli/index.d.ts +0 -2
- package/dist/harness/geminiCli/index.d.ts.map +0 -1
- package/dist/harness/geminiCli/index.js +0 -5
- package/dist/harness/geminiCli/promptContext.d.ts +0 -3
- package/dist/harness/geminiCli/promptContext.d.ts.map +0 -1
- package/dist/harness/geminiCli/promptContext.js +0 -22
- package/dist/harness/githubCopilot/adapter.d.ts +0 -4
- package/dist/harness/githubCopilot/adapter.d.ts.map +0 -1
- package/dist/harness/githubCopilot/adapter.js +0 -215
- package/dist/harness/githubCopilot/discovery.d.ts +0 -3
- package/dist/harness/githubCopilot/discovery.d.ts.map +0 -1
- package/dist/harness/githubCopilot/discovery.js +0 -11
- package/dist/harness/githubCopilot/hooks.d.ts +0 -12
- package/dist/harness/githubCopilot/hooks.d.ts.map +0 -1
- package/dist/harness/githubCopilot/hooks.js +0 -305
- package/dist/harness/githubCopilot/index.d.ts +0 -3
- package/dist/harness/githubCopilot/index.d.ts.map +0 -1
- package/dist/harness/githubCopilot/index.js +0 -7
- package/dist/harness/githubCopilot/promptContext.d.ts +0 -3
- package/dist/harness/githubCopilot/promptContext.d.ts.map +0 -1
- package/dist/harness/githubCopilot/promptContext.js +0 -22
- package/dist/harness/ohMyPi/adapter.d.ts +0 -3
- package/dist/harness/ohMyPi/adapter.d.ts.map +0 -1
- package/dist/harness/ohMyPi/adapter.js +0 -190
- package/dist/harness/ohMyPi/discovery.d.ts +0 -3
- package/dist/harness/ohMyPi/discovery.d.ts.map +0 -1
- package/dist/harness/ohMyPi/discovery.js +0 -11
- package/dist/harness/ohMyPi/index.d.ts +0 -2
- package/dist/harness/ohMyPi/index.d.ts.map +0 -1
- package/dist/harness/ohMyPi/index.js +0 -5
- package/dist/harness/ohMyPi/promptContext.d.ts +0 -3
- package/dist/harness/ohMyPi/promptContext.d.ts.map +0 -1
- package/dist/harness/ohMyPi/promptContext.js +0 -22
- package/dist/harness/openclaw/adapter.d.ts +0 -3
- package/dist/harness/openclaw/adapter.d.ts.map +0 -1
- package/dist/harness/openclaw/adapter.js +0 -288
- package/dist/harness/openclaw/discovery.d.ts +0 -3
- package/dist/harness/openclaw/discovery.d.ts.map +0 -1
- package/dist/harness/openclaw/discovery.js +0 -11
- package/dist/harness/openclaw/index.d.ts +0 -2
- package/dist/harness/openclaw/index.d.ts.map +0 -1
- package/dist/harness/openclaw/index.js +0 -5
- package/dist/harness/openclaw/promptContext.d.ts +0 -3
- package/dist/harness/openclaw/promptContext.d.ts.map +0 -1
- package/dist/harness/openclaw/promptContext.js +0 -22
- package/dist/harness/opencode/adapter.d.ts +0 -3
- package/dist/harness/opencode/adapter.d.ts.map +0 -1
- package/dist/harness/opencode/adapter.js +0 -235
- package/dist/harness/opencode/discovery.d.ts +0 -3
- package/dist/harness/opencode/discovery.d.ts.map +0 -1
- package/dist/harness/opencode/discovery.js +0 -11
- package/dist/harness/opencode/hooks.d.ts +0 -11
- package/dist/harness/opencode/hooks.d.ts.map +0 -1
- package/dist/harness/opencode/hooks.js +0 -264
- package/dist/harness/opencode/index.d.ts +0 -2
- package/dist/harness/opencode/index.d.ts.map +0 -1
- package/dist/harness/opencode/index.js +0 -5
- package/dist/harness/opencode/promptContext.d.ts +0 -3
- package/dist/harness/opencode/promptContext.d.ts.map +0 -1
- package/dist/harness/opencode/promptContext.js +0 -22
- package/dist/harness/pi/adapter.d.ts +0 -4
- package/dist/harness/pi/adapter.d.ts.map +0 -1
- package/dist/harness/pi/adapter.js +0 -198
- package/dist/harness/pi/discovery.d.ts +0 -3
- package/dist/harness/pi/discovery.d.ts.map +0 -1
- package/dist/harness/pi/discovery.js +0 -11
- package/dist/harness/pi/index.d.ts +0 -2
- package/dist/harness/pi/index.d.ts.map +0 -1
- package/dist/harness/pi/index.js +0 -6
- package/dist/harness/pi/promptContext.d.ts +0 -3
- package/dist/harness/pi/promptContext.d.ts.map +0 -1
- package/dist/harness/pi/promptContext.js +0 -22
- package/dist/mcp/channels/allowlist.d.ts +0 -19
- package/dist/mcp/channels/allowlist.d.ts.map +0 -1
- package/dist/mcp/channels/allowlist.js +0 -140
- package/dist/mcp/channels/channelManager.d.ts +0 -64
- package/dist/mcp/channels/channelManager.d.ts.map +0 -1
- package/dist/mcp/channels/channelManager.js +0 -137
- package/dist/mcp/channels/inboundQueue.d.ts +0 -47
- package/dist/mcp/channels/inboundQueue.d.ts.map +0 -1
- package/dist/mcp/channels/inboundQueue.js +0 -96
- package/dist/mcp/channels/index.d.ts +0 -11
- package/dist/mcp/channels/index.d.ts.map +0 -1
- package/dist/mcp/channels/index.js +0 -33
- package/dist/mcp/channels/outbound.d.ts +0 -33
- package/dist/mcp/channels/outbound.d.ts.map +0 -1
- package/dist/mcp/channels/outbound.js +0 -94
- package/dist/mcp/channels/permissionRelay.d.ts +0 -62
- package/dist/mcp/channels/permissionRelay.d.ts.map +0 -1
- package/dist/mcp/channels/permissionRelay.js +0 -159
- package/dist/mcp/channels/types.d.ts +0 -135
- package/dist/mcp/channels/types.d.ts.map +0 -1
- package/dist/mcp/channels/types.js +0 -16
- package/dist/mcp/client/config.d.ts +0 -26
- package/dist/mcp/client/config.d.ts.map +0 -1
- package/dist/mcp/client/config.js +0 -140
- package/dist/mcp/client/executor.d.ts +0 -28
- package/dist/mcp/client/executor.d.ts.map +0 -1
- package/dist/mcp/client/executor.js +0 -58
- package/dist/mcp/client/index.d.ts +0 -10
- package/dist/mcp/client/index.d.ts.map +0 -1
- package/dist/mcp/client/index.js +0 -25
- package/dist/mcp/client/manager.d.ts +0 -72
- package/dist/mcp/client/manager.d.ts.map +0 -1
- package/dist/mcp/client/manager.js +0 -212
- package/dist/mcp/client/toolRegistry.d.ts +0 -48
- package/dist/mcp/client/toolRegistry.d.ts.map +0 -1
- package/dist/mcp/client/toolRegistry.js +0 -116
- package/dist/mcp/client/types.d.ts +0 -94
- package/dist/mcp/client/types.d.ts.map +0 -1
- package/dist/mcp/client/types.js +0 -13
- package/dist/mcp/transport/session.d.ts +0 -16
- package/dist/mcp/transport/session.d.ts.map +0 -1
- package/dist/mcp/transport/session.js +0 -76
- package/dist/mcp/transport/types.d.ts +0 -17
- package/dist/mcp/transport/types.d.ts.map +0 -1
- package/dist/mcp/transport/types.js +0 -5
- package/dist/mcp/transport/websocket.d.ts +0 -39
- package/dist/mcp/transport/websocket.d.ts.map +0 -1
- package/dist/mcp/transport/websocket.js +0 -269
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.resolveOpenCodeStateDir = resolveOpenCodeStateDir;
|
|
37
|
-
exports.resolveOpenCodeSessionId = resolveOpenCodeSessionId;
|
|
38
|
-
exports.handleOpenCodeStopHook = handleOpenCodeStopHook;
|
|
39
|
-
exports.handleOpenCodeSessionStartHook = handleOpenCodeSessionStartHook;
|
|
40
|
-
const path = __importStar(require("node:path"));
|
|
41
|
-
const journal_1 = require("../../storage/journal");
|
|
42
|
-
const runFiles_1 = require("../../storage/runFiles");
|
|
43
|
-
const effectIndex_1 = require("../../runtime/replay/effectIndex");
|
|
44
|
-
const parse_1 = require("../../session/parse");
|
|
45
|
-
const write_1 = require("../../session/write");
|
|
46
|
-
const config_1 = require("../../config");
|
|
47
|
-
const utils_1 = require("../hooks/utils");
|
|
48
|
-
function resolveOpenCodeStateDir(args) {
|
|
49
|
-
return (0, config_1.normalizeSessionStateDir)(args.stateDir ?? process.env.BABYSITTER_STATE_DIR);
|
|
50
|
-
}
|
|
51
|
-
function resolveOpenCodeSessionId(parsed) {
|
|
52
|
-
if (parsed.sessionId) {
|
|
53
|
-
return parsed.sessionId;
|
|
54
|
-
}
|
|
55
|
-
if (process.env.AGENT_SESSION_ID) {
|
|
56
|
-
return process.env.AGENT_SESSION_ID;
|
|
57
|
-
}
|
|
58
|
-
if (process.env.BABYSITTER_SESSION_ID) {
|
|
59
|
-
return process.env.BABYSITTER_SESSION_ID;
|
|
60
|
-
}
|
|
61
|
-
if (process.env.OPENCODE_SESSION_ID) {
|
|
62
|
-
return process.env.OPENCODE_SESSION_ID;
|
|
63
|
-
}
|
|
64
|
-
return undefined;
|
|
65
|
-
}
|
|
66
|
-
async function cleanupSession(filePath) {
|
|
67
|
-
try {
|
|
68
|
-
await (0, write_1.deleteSessionFile)(filePath);
|
|
69
|
-
}
|
|
70
|
-
catch {
|
|
71
|
-
// Best-effort cleanup
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
async function handleOpenCodeStopHook(args) {
|
|
75
|
-
const { verbose } = args;
|
|
76
|
-
const log = (0, utils_1.createHookLogger)("babysitter-opencode-stop-hook");
|
|
77
|
-
log.info("handleStopHook started (opencode)");
|
|
78
|
-
let rawInput;
|
|
79
|
-
try {
|
|
80
|
-
rawInput = await (0, utils_1.readStdin)();
|
|
81
|
-
}
|
|
82
|
-
catch {
|
|
83
|
-
rawInput = "";
|
|
84
|
-
}
|
|
85
|
-
finally {
|
|
86
|
-
if (typeof process.stdin.unref === "function") {
|
|
87
|
-
process.stdin.unref();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
const hookInput = (0, utils_1.parseHookInput)(rawInput);
|
|
91
|
-
const sessionId = (0, utils_1.safeStr)(hookInput, "session_id") ||
|
|
92
|
-
process.env.AGENT_SESSION_ID ||
|
|
93
|
-
process.env.BABYSITTER_SESSION_ID ||
|
|
94
|
-
process.env.OPENCODE_SESSION_ID ||
|
|
95
|
-
"";
|
|
96
|
-
if (!sessionId) {
|
|
97
|
-
log.info("No session ID — allowing exit");
|
|
98
|
-
process.stdout.write("{}\n");
|
|
99
|
-
return 0;
|
|
100
|
-
}
|
|
101
|
-
log.setContext("session", sessionId);
|
|
102
|
-
const stateDir = resolveOpenCodeStateDir(args);
|
|
103
|
-
const runsDir = args.runsDir || ".a5c/runs";
|
|
104
|
-
const filePath = (0, parse_1.getSessionFilePath)(stateDir, sessionId);
|
|
105
|
-
let sessionFile;
|
|
106
|
-
try {
|
|
107
|
-
if (!(await (0, parse_1.sessionFileExists)(filePath))) {
|
|
108
|
-
log.info("No active session — allowing exit");
|
|
109
|
-
process.stdout.write("{}\n");
|
|
110
|
-
return 0;
|
|
111
|
-
}
|
|
112
|
-
sessionFile = await (0, parse_1.readSessionFile)(filePath);
|
|
113
|
-
}
|
|
114
|
-
catch {
|
|
115
|
-
log.warn("Session file read error — allowing exit");
|
|
116
|
-
process.stdout.write("{}\n");
|
|
117
|
-
return 0;
|
|
118
|
-
}
|
|
119
|
-
const { state } = sessionFile;
|
|
120
|
-
const runId = state.runId ?? "";
|
|
121
|
-
if (state.maxIterations > 0 && state.iteration >= state.maxIterations) {
|
|
122
|
-
if (verbose) {
|
|
123
|
-
process.stderr.write(`[hook:run stop] Max iterations (${state.maxIterations}) reached\n`);
|
|
124
|
-
}
|
|
125
|
-
await cleanupSession(filePath);
|
|
126
|
-
process.stdout.write("{}\n");
|
|
127
|
-
return 0;
|
|
128
|
-
}
|
|
129
|
-
if (!runId) {
|
|
130
|
-
log.info("No run associated with session — allowing exit");
|
|
131
|
-
await cleanupSession(filePath);
|
|
132
|
-
process.stdout.write("{}\n");
|
|
133
|
-
return 0;
|
|
134
|
-
}
|
|
135
|
-
log.setContext("run", runId);
|
|
136
|
-
let runState = "";
|
|
137
|
-
let pendingKinds = "";
|
|
138
|
-
try {
|
|
139
|
-
const runDir = path.isAbsolute(runId) ? runId : path.join(runsDir, runId);
|
|
140
|
-
void (0, runFiles_1.readRunMetadata)(runDir);
|
|
141
|
-
const journal = await (0, journal_1.loadJournal)(runDir);
|
|
142
|
-
const index = await (0, effectIndex_1.buildEffectIndex)({ runDir, events: journal });
|
|
143
|
-
const hasCompleted = journal.some((event) => event.type === "RUN_COMPLETED");
|
|
144
|
-
const hasFailed = journal.some((event) => event.type === "RUN_FAILED");
|
|
145
|
-
const pendingRecords = index.listPendingEffects();
|
|
146
|
-
const pendingByKind = (0, utils_1.countPendingByKind)(pendingRecords);
|
|
147
|
-
const kindKeys = Object.keys(pendingByKind);
|
|
148
|
-
if (kindKeys.length > 0) {
|
|
149
|
-
pendingKinds = kindKeys.join(", ");
|
|
150
|
-
}
|
|
151
|
-
if (hasCompleted) {
|
|
152
|
-
runState = "completed";
|
|
153
|
-
}
|
|
154
|
-
else if (hasFailed) {
|
|
155
|
-
runState = "failed";
|
|
156
|
-
}
|
|
157
|
-
else if (pendingRecords.length > 0) {
|
|
158
|
-
runState = "waiting";
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
runState = "created";
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
catch {
|
|
165
|
-
runState = "";
|
|
166
|
-
}
|
|
167
|
-
log.info(`Run state: ${runState || "unknown"}`);
|
|
168
|
-
if (runState === "completed" || runState === "failed" || !runState) {
|
|
169
|
-
await cleanupSession(filePath);
|
|
170
|
-
process.stdout.write("{}\n");
|
|
171
|
-
return 0;
|
|
172
|
-
}
|
|
173
|
-
const nextIteration = state.iteration + 1;
|
|
174
|
-
const currentTime = (0, write_1.getCurrentTimestamp)();
|
|
175
|
-
const updatedState = {
|
|
176
|
-
...state,
|
|
177
|
-
iteration: nextIteration,
|
|
178
|
-
lastIterationAt: currentTime,
|
|
179
|
-
};
|
|
180
|
-
try {
|
|
181
|
-
await (0, write_1.writeSessionFile)(filePath, updatedState, sessionFile.prompt ?? "");
|
|
182
|
-
}
|
|
183
|
-
catch {
|
|
184
|
-
log.warn("Failed to update session state");
|
|
185
|
-
}
|
|
186
|
-
const output = {
|
|
187
|
-
decision: "block",
|
|
188
|
-
reason: pendingKinds
|
|
189
|
-
? `Babysitter iteration ${nextIteration} | Waiting on: ${pendingKinds}. Call 'babysitter run:iterate .a5c/runs/${runId} --json'.`
|
|
190
|
-
: `Babysitter iteration ${nextIteration} | Continue orchestration: call 'babysitter run:iterate .a5c/runs/${runId} --json'.`,
|
|
191
|
-
};
|
|
192
|
-
log.info(`Decision: block (iteration=${nextIteration})`);
|
|
193
|
-
if (verbose) {
|
|
194
|
-
process.stderr.write(`[hook:run stop] Blocking, iteration=${nextIteration}\n`);
|
|
195
|
-
}
|
|
196
|
-
process.stdout.write(JSON.stringify(output, null, 2) + "\n");
|
|
197
|
-
return 0;
|
|
198
|
-
}
|
|
199
|
-
async function handleOpenCodeSessionStartHook(args) {
|
|
200
|
-
const { verbose } = args;
|
|
201
|
-
const log = (0, utils_1.createHookLogger)("babysitter-opencode-session-start-hook");
|
|
202
|
-
log.info("handleSessionStartHook started (opencode)");
|
|
203
|
-
let rawInput;
|
|
204
|
-
try {
|
|
205
|
-
rawInput = await (0, utils_1.readStdin)();
|
|
206
|
-
}
|
|
207
|
-
catch {
|
|
208
|
-
process.stdout.write("{}\n");
|
|
209
|
-
return 0;
|
|
210
|
-
}
|
|
211
|
-
finally {
|
|
212
|
-
if (typeof process.stdin.unref === "function") {
|
|
213
|
-
process.stdin.unref();
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
const hookInput = (0, utils_1.parseHookInput)(rawInput);
|
|
217
|
-
const sessionId = (0, utils_1.safeStr)(hookInput, "session_id") ||
|
|
218
|
-
process.env.AGENT_SESSION_ID ||
|
|
219
|
-
process.env.BABYSITTER_SESSION_ID ||
|
|
220
|
-
process.env.OPENCODE_SESSION_ID ||
|
|
221
|
-
"";
|
|
222
|
-
if (!sessionId) {
|
|
223
|
-
log.info("No session ID — skipping state file creation");
|
|
224
|
-
process.stdout.write("{}\n");
|
|
225
|
-
return 0;
|
|
226
|
-
}
|
|
227
|
-
log.setContext("session", sessionId);
|
|
228
|
-
log.info(`Session ID: ${sessionId}`);
|
|
229
|
-
const stateDir = resolveOpenCodeStateDir(args);
|
|
230
|
-
log.info(`Resolved stateDir: ${stateDir}`);
|
|
231
|
-
const filePath = (0, parse_1.getSessionFilePath)(stateDir, sessionId);
|
|
232
|
-
try {
|
|
233
|
-
if (!(await (0, parse_1.sessionFileExists)(filePath))) {
|
|
234
|
-
const nowTs = (0, write_1.getCurrentTimestamp)();
|
|
235
|
-
const state = {
|
|
236
|
-
active: true,
|
|
237
|
-
iteration: 1,
|
|
238
|
-
maxIterations: 256,
|
|
239
|
-
runId: "",
|
|
240
|
-
runIds: [],
|
|
241
|
-
startedAt: nowTs,
|
|
242
|
-
lastIterationAt: nowTs,
|
|
243
|
-
iterationTimes: [],
|
|
244
|
-
};
|
|
245
|
-
await (0, write_1.writeSessionFile)(filePath, state, "");
|
|
246
|
-
log.info(`Created session state: ${filePath}`);
|
|
247
|
-
if (verbose) {
|
|
248
|
-
process.stderr.write(`[hook:run session-start] Created session state: ${filePath}\n`);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
else {
|
|
252
|
-
log.info(`Session state already exists: ${filePath}`);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
catch (error) {
|
|
256
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
257
|
-
log.warn(`Failed to create session state: ${message}`);
|
|
258
|
-
if (verbose) {
|
|
259
|
-
process.stderr.write(`[hook:run session-start] Failed to create session state: ${message}\n`);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
process.stdout.write("{}\n");
|
|
263
|
-
return 0;
|
|
264
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/harness/opencode/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createOpenCodeAdapter = void 0;
|
|
4
|
-
var adapter_1 = require("./adapter");
|
|
5
|
-
Object.defineProperty(exports, "createOpenCodeAdapter", { enumerable: true, get: function () { return adapter_1.createOpenCodeAdapter; } });
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promptContext.d.ts","sourceRoot":"","sources":["../../../src/harness/opencode/promptContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAMzD,wBAAgB,qBAAqB,CACnC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CAiBf"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createOpenCodeContext = createOpenCodeContext;
|
|
4
|
-
const contextShared_1 = require("../../prompts/contextShared");
|
|
5
|
-
function createOpenCodeContext(overrides) {
|
|
6
|
-
return (0, contextShared_1.createPromptContext)({
|
|
7
|
-
harness: 'opencode',
|
|
8
|
-
harnessLabel: 'OpenCode',
|
|
9
|
-
capabilities: ['task-tool', 'breakpoint-routing'],
|
|
10
|
-
pluginRootVar: '',
|
|
11
|
-
loopControlTerm: 'in-turn',
|
|
12
|
-
sessionBindingFlags: '',
|
|
13
|
-
hookDriven: false,
|
|
14
|
-
interactiveToolName: '',
|
|
15
|
-
sessionEnvVars: 'PID-scoped session marker (authoritative); shell.env-injected session ID and AGENT_SESSION_ID/BABYSITTER_SESSION_ID are fallbacks',
|
|
16
|
-
resumeFlags: '',
|
|
17
|
-
cliSetupSnippet: (0, contextShared_1.createDefaultCliSetupSnippet)(),
|
|
18
|
-
iterateFlags: '',
|
|
19
|
-
hasIntentFidelityChecks: false,
|
|
20
|
-
hasNonNegotiables: false,
|
|
21
|
-
}, overrides);
|
|
22
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { HarnessAdapter, HarnessInstallOptions, HarnessInstallResult } from "../types";
|
|
2
|
-
export declare function installPiPlugin(options: HarnessInstallOptions): Promise<HarnessInstallResult>;
|
|
3
|
-
export declare function createPiAdapter(): HarnessAdapter;
|
|
4
|
-
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/harness/pi/adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EAGd,qBAAqB,EACrB,oBAAoB,EAGrB,MAAM,UAAU,CAAC;AA0HlB,wBAAsB,eAAe,CACnC,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CAM/B;AAED,wBAAgB,eAAe,IAAI,cAAc,CA6FhD"}
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.installPiPlugin = installPiPlugin;
|
|
37
|
-
exports.createPiAdapter = createPiAdapter;
|
|
38
|
-
const path = __importStar(require("node:path"));
|
|
39
|
-
const types_1 = require("../types");
|
|
40
|
-
const promptContext_1 = require("./promptContext");
|
|
41
|
-
const config_1 = require("../../config");
|
|
42
|
-
const parse_1 = require("../../session/parse");
|
|
43
|
-
const write_1 = require("../../session/write");
|
|
44
|
-
const installSupport_1 = require("../installSupport");
|
|
45
|
-
const sessionMarker_1 = require("../../utils/sessionMarker");
|
|
46
|
-
function resolvePiPluginRoot(args = {}) {
|
|
47
|
-
const root = args.pluginRoot || process.env.PI_PLUGIN_ROOT;
|
|
48
|
-
return root ? path.resolve(root) : undefined;
|
|
49
|
-
}
|
|
50
|
-
function resolvePiStateDir(args) {
|
|
51
|
-
return (0, config_1.normalizeSessionStateDir)(args.stateDir ?? process.env.BABYSITTER_STATE_DIR);
|
|
52
|
-
}
|
|
53
|
-
function resolvePiSessionId(parsed) {
|
|
54
|
-
return (0, sessionMarker_1.resolveSessionIdWithMarker)("pi", parsed, ["PI_SESSION_ID"]);
|
|
55
|
-
}
|
|
56
|
-
async function bindPiSession(opts) {
|
|
57
|
-
const stateDir = resolvePiStateDir({
|
|
58
|
-
stateDir: opts.stateDir,
|
|
59
|
-
pluginRoot: opts.pluginRoot,
|
|
60
|
-
});
|
|
61
|
-
const stateFile = (0, parse_1.getSessionFilePath)(stateDir, opts.sessionId);
|
|
62
|
-
if (await (0, parse_1.sessionFileExists)(stateFile)) {
|
|
63
|
-
const existing = await (0, parse_1.readSessionFile)(stateFile);
|
|
64
|
-
if (existing.state.runId && existing.state.runId !== opts.runId) {
|
|
65
|
-
return {
|
|
66
|
-
harness: "pi",
|
|
67
|
-
sessionId: opts.sessionId,
|
|
68
|
-
stateFile,
|
|
69
|
-
error: `Session already associated with run ${existing.state.runId}`,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
await (0, write_1.updateSessionState)(stateFile, { active: true, runId: opts.runId }, existing);
|
|
73
|
-
return {
|
|
74
|
-
harness: "pi",
|
|
75
|
-
sessionId: opts.sessionId,
|
|
76
|
-
stateFile,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
const now = (0, write_1.getCurrentTimestamp)();
|
|
80
|
-
const state = {
|
|
81
|
-
active: true,
|
|
82
|
-
iteration: 1,
|
|
83
|
-
maxIterations: opts.maxIterations ?? 256,
|
|
84
|
-
runId: opts.runId,
|
|
85
|
-
runIds: [],
|
|
86
|
-
startedAt: now,
|
|
87
|
-
lastIterationAt: now,
|
|
88
|
-
iterationTimes: [],
|
|
89
|
-
};
|
|
90
|
-
await (0, write_1.writeSessionFile)(stateFile, state, opts.prompt);
|
|
91
|
-
return {
|
|
92
|
-
harness: "pi",
|
|
93
|
-
sessionId: opts.sessionId,
|
|
94
|
-
stateFile,
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
function writeNoopHookResult() {
|
|
98
|
-
process.stdout.write("{}\n");
|
|
99
|
-
}
|
|
100
|
-
async function installPiFamilyPlugin(args) {
|
|
101
|
-
const packageArgs = ["install"];
|
|
102
|
-
if (args.options.workspace) {
|
|
103
|
-
packageArgs.push("--workspace", path.resolve(args.options.workspace));
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
packageArgs.push("--global");
|
|
107
|
-
}
|
|
108
|
-
return (0, installSupport_1.runPackageBinaryViaNpx)({
|
|
109
|
-
harness: args.harness,
|
|
110
|
-
packageName: args.packageName,
|
|
111
|
-
packageArgs,
|
|
112
|
-
summary: args.options.workspace
|
|
113
|
-
? `Install the published Babysitter ${args.harness} package for the target workspace.`
|
|
114
|
-
: `Install the published Babysitter ${args.harness} package into the user profile.`,
|
|
115
|
-
options: args.options,
|
|
116
|
-
env: process.env,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
async function installPiPlugin(options) {
|
|
120
|
-
return installPiFamilyPlugin({
|
|
121
|
-
harness: "pi",
|
|
122
|
-
packageName: "@a5c-ai/babysitter-pi",
|
|
123
|
-
options,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
function createPiAdapter() {
|
|
127
|
-
return {
|
|
128
|
-
name: "pi",
|
|
129
|
-
isActive() {
|
|
130
|
-
return !!(process.env.AGENT_SESSION_ID ||
|
|
131
|
-
process.env.BABYSITTER_SESSION_ID ||
|
|
132
|
-
process.env.PI_SESSION_ID ||
|
|
133
|
-
process.env.PI_PLUGIN_ROOT);
|
|
134
|
-
},
|
|
135
|
-
autoResolvesSessionId() {
|
|
136
|
-
return true;
|
|
137
|
-
},
|
|
138
|
-
getMissingSessionIdHint() {
|
|
139
|
-
return "Pi should provide PI_SESSION_ID when the Babysitter package is active.";
|
|
140
|
-
},
|
|
141
|
-
supportsHookType(_hookType) {
|
|
142
|
-
return false;
|
|
143
|
-
},
|
|
144
|
-
getUnsupportedHookMessage(hookType) {
|
|
145
|
-
return `Pi does not use babysitter hook:run for "${hookType}". Use the Pi package skills and extension bridge instead.`;
|
|
146
|
-
},
|
|
147
|
-
resolveSessionId(parsed) {
|
|
148
|
-
return resolvePiSessionId(parsed);
|
|
149
|
-
},
|
|
150
|
-
resolveStateDir(args) {
|
|
151
|
-
return resolvePiStateDir(args);
|
|
152
|
-
},
|
|
153
|
-
resolvePluginRoot(args) {
|
|
154
|
-
return resolvePiPluginRoot(args);
|
|
155
|
-
},
|
|
156
|
-
bindSession(opts) {
|
|
157
|
-
return bindPiSession(opts);
|
|
158
|
-
},
|
|
159
|
-
handleStopHook(_args) {
|
|
160
|
-
writeNoopHookResult();
|
|
161
|
-
return Promise.resolve(0);
|
|
162
|
-
},
|
|
163
|
-
handleSessionStartHook(_args) {
|
|
164
|
-
const sessionId = process.env.PI_SESSION_ID || process.env.AGENT_SESSION_ID || process.env.BABYSITTER_SESSION_ID;
|
|
165
|
-
if (sessionId) {
|
|
166
|
-
try {
|
|
167
|
-
(0, sessionMarker_1.writeSessionMarker)("pi", sessionId);
|
|
168
|
-
}
|
|
169
|
-
catch {
|
|
170
|
-
// Non-fatal
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
writeNoopHookResult();
|
|
174
|
-
return Promise.resolve(0);
|
|
175
|
-
},
|
|
176
|
-
findHookDispatcherPath(_startCwd) {
|
|
177
|
-
return null;
|
|
178
|
-
},
|
|
179
|
-
installHarness(options) {
|
|
180
|
-
return (0, installSupport_1.installCliViaNpm)({
|
|
181
|
-
harness: "pi",
|
|
182
|
-
cliCommand: "pi",
|
|
183
|
-
packageName: "@mariozechner/pi-coding-agent",
|
|
184
|
-
summary: "Install the Pi Coding Agent CLI globally via npm.",
|
|
185
|
-
options,
|
|
186
|
-
});
|
|
187
|
-
},
|
|
188
|
-
installPlugin(options) {
|
|
189
|
-
return installPiPlugin(options);
|
|
190
|
-
},
|
|
191
|
-
getCapabilities() {
|
|
192
|
-
return [types_1.HarnessCapability.Programmatic, types_1.HarnessCapability.SessionBinding, types_1.HarnessCapability.HeadlessPrompt];
|
|
193
|
-
},
|
|
194
|
-
getPromptContext(opts) {
|
|
195
|
-
return (0, promptContext_1.createPiContext)(opts);
|
|
196
|
-
},
|
|
197
|
-
};
|
|
198
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/harness/pi/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAEtE,eAAO,MAAM,iBAAiB,EAAE,WAM/B,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PI_DISCOVERY_SPEC = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
exports.PI_DISCOVERY_SPEC = {
|
|
6
|
-
name: "pi",
|
|
7
|
-
cli: "pi",
|
|
8
|
-
callerEnvVars: ["PI_SESSION_ID"],
|
|
9
|
-
capabilities: [types_1.HarnessCapability.Programmatic, types_1.HarnessCapability.SessionBinding, types_1.HarnessCapability.HeadlessPrompt],
|
|
10
|
-
configPaths: [".pi"],
|
|
11
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/harness/pi/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/harness/pi/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.installPiPlugin = exports.createPiAdapter = void 0;
|
|
4
|
-
var adapter_1 = require("./adapter");
|
|
5
|
-
Object.defineProperty(exports, "createPiAdapter", { enumerable: true, get: function () { return adapter_1.createPiAdapter; } });
|
|
6
|
-
Object.defineProperty(exports, "installPiPlugin", { enumerable: true, get: function () { return adapter_1.installPiPlugin; } });
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promptContext.d.ts","sourceRoot":"","sources":["../../../src/harness/pi/promptContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAMzD,wBAAgB,eAAe,CAC7B,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CAiBf"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createPiContext = createPiContext;
|
|
4
|
-
const contextShared_1 = require("../../prompts/contextShared");
|
|
5
|
-
function createPiContext(overrides) {
|
|
6
|
-
return (0, contextShared_1.createPromptContext)({
|
|
7
|
-
harness: 'pi',
|
|
8
|
-
harnessLabel: 'Pi Coding Agent',
|
|
9
|
-
capabilities: ['skills', 'slash-commands', 'task-tool', 'harness-routing', 'programmatic-session'],
|
|
10
|
-
pluginRootVar: '${PI_PLUGIN_ROOT}',
|
|
11
|
-
loopControlTerm: 'skill-driven',
|
|
12
|
-
sessionBindingFlags: '',
|
|
13
|
-
hookDriven: false,
|
|
14
|
-
interactiveToolName: 'AskUserQuestion',
|
|
15
|
-
sessionEnvVars: 'PID-scoped session marker (authoritative); PI_SESSION_ID and AGENT_SESSION_ID/BABYSITTER_SESSION_ID are fallbacks',
|
|
16
|
-
resumeFlags: '',
|
|
17
|
-
cliSetupSnippet: (0, contextShared_1.createDefaultCliSetupSnippet)(),
|
|
18
|
-
iterateFlags: '',
|
|
19
|
-
hasIntentFidelityChecks: false,
|
|
20
|
-
hasNonNegotiables: false,
|
|
21
|
-
}, overrides);
|
|
22
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GAP-MCPC-001: Channel Allowlist.
|
|
3
|
-
*
|
|
4
|
-
* Controls which MCP channels are active. Channels require explicit opt-in.
|
|
5
|
-
* Uses atomic write pattern consistent with other SDK state modules.
|
|
6
|
-
*/
|
|
7
|
-
import type { ChannelConfig, ChannelAllowlistFile } from "./types";
|
|
8
|
-
export declare function getChannelAllowlistPath(stateDir: string): string;
|
|
9
|
-
export declare function readChannelAllowlist(stateDir: string): Promise<ChannelAllowlistFile>;
|
|
10
|
-
export declare function writeChannelAllowlist(stateDir: string, allowlist: ChannelAllowlistFile): Promise<void>;
|
|
11
|
-
/** Add or update a channel in the allowlist. */
|
|
12
|
-
export declare function upsertChannel(stateDir: string, channel: ChannelConfig): Promise<ChannelAllowlistFile>;
|
|
13
|
-
/** Remove a channel from the allowlist. Returns true if removed. */
|
|
14
|
-
export declare function removeChannel(stateDir: string, serverName: string, channelId: string): Promise<boolean>;
|
|
15
|
-
/** Toggle a channel's enabled state. Returns the new enabled state. */
|
|
16
|
-
export declare function toggleChannel(stateDir: string, serverName: string, channelId: string, enabled?: boolean): Promise<boolean | undefined>;
|
|
17
|
-
/** Get all enabled channels. */
|
|
18
|
-
export declare function getEnabledChannels(allowlist: ChannelAllowlistFile): ChannelConfig[];
|
|
19
|
-
//# sourceMappingURL=allowlist.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"allowlist.d.ts","sourceRoot":"","sources":["../../../src/mcp/channels/allowlist.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAenE,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA+B1F;AAED,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,oBAAoB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAGf;AAED,gDAAgD;AAChD,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,oBAAoB,CAAC,CAa/B;AAED,oEAAoE;AACpE,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC,CAUlB;AAED,uEAAuE;AACvE,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAU9B;AAED,gCAAgC;AAChC,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,oBAAoB,GAAG,aAAa,EAAE,CAEnF"}
|