synorch 0.2.0 → 0.4.0-beta.0
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/CHANGELOG.md +55 -1
- package/README.md +338 -28
- package/dist/application/doctor-service.d.ts +16 -0
- package/dist/application/doctor-service.d.ts.map +1 -1
- package/dist/application/doctor-service.js +230 -32
- package/dist/application/doctor-service.js.map +1 -1
- package/dist/application/generated-skill-doctor.d.ts +9 -0
- package/dist/application/generated-skill-doctor.d.ts.map +1 -0
- package/dist/application/generated-skill-doctor.js +433 -0
- package/dist/application/generated-skill-doctor.js.map +1 -0
- package/dist/application/project-discovery.d.ts +26 -1
- package/dist/application/project-discovery.d.ts.map +1 -1
- package/dist/application/project-discovery.js +99 -6
- package/dist/application/project-discovery.js.map +1 -1
- package/dist/application/safe-path.d.ts +19 -0
- package/dist/application/safe-path.d.ts.map +1 -0
- package/dist/application/safe-path.js +35 -0
- package/dist/application/safe-path.js.map +1 -0
- package/dist/application/size-ceiling.d.ts +15 -0
- package/dist/application/size-ceiling.d.ts.map +1 -0
- package/dist/application/size-ceiling.js +32 -0
- package/dist/application/size-ceiling.js.map +1 -0
- package/dist/application/structure-service.d.ts.map +1 -1
- package/dist/application/structure-service.js +10 -1
- package/dist/application/structure-service.js.map +1 -1
- package/dist/build-info.json +4 -0
- package/dist/cli.js +135 -18
- package/dist/cli.js.map +1 -1
- package/dist/domain/canonical-contracts.d.ts +69 -0
- package/dist/domain/canonical-contracts.d.ts.map +1 -0
- package/dist/domain/canonical-contracts.js +92 -0
- package/dist/domain/canonical-contracts.js.map +1 -0
- package/dist/domain/generated-skill.d.ts +55 -0
- package/dist/domain/generated-skill.d.ts.map +1 -0
- package/dist/domain/generated-skill.js +90 -0
- package/dist/domain/generated-skill.js.map +1 -0
- package/dist/domain/generation.d.ts +15 -2
- package/dist/domain/generation.d.ts.map +1 -1
- package/dist/domain/observation-ledger.d.ts +118 -0
- package/dist/domain/observation-ledger.d.ts.map +1 -0
- package/dist/domain/observation-ledger.js +183 -0
- package/dist/domain/observation-ledger.js.map +1 -0
- package/dist/domain/product.d.ts +1 -1
- package/dist/domain/product.d.ts.map +1 -1
- package/dist/domain/product.js +1 -1
- package/dist/domain/product.js.map +1 -1
- package/dist/domain/relative-path.d.ts +21 -0
- package/dist/domain/relative-path.d.ts.map +1 -0
- package/dist/domain/relative-path.js +43 -0
- package/dist/domain/relative-path.js.map +1 -0
- package/dist/domain/skill-packs.d.ts.map +1 -1
- package/dist/domain/skill-packs.js +1 -0
- package/dist/domain/skill-packs.js.map +1 -1
- package/dist/domain/suggest.d.ts +5 -0
- package/dist/domain/suggest.d.ts.map +1 -0
- package/dist/domain/suggest.js +32 -0
- package/dist/domain/suggest.js.map +1 -0
- package/dist/domain/zod-issues.d.ts +21 -0
- package/dist/domain/zod-issues.d.ts.map +1 -0
- package/dist/domain/zod-issues.js +27 -0
- package/dist/domain/zod-issues.js.map +1 -0
- package/dist/harness/auth/api-key.d.ts +13 -0
- package/dist/harness/auth/api-key.d.ts.map +1 -0
- package/dist/harness/auth/api-key.js +87 -0
- package/dist/harness/auth/api-key.js.map +1 -0
- package/dist/harness/auth/claude-bridge.d.ts +22 -0
- package/dist/harness/auth/claude-bridge.d.ts.map +1 -0
- package/dist/harness/auth/claude-bridge.js +92 -0
- package/dist/harness/auth/claude-bridge.js.map +1 -0
- package/dist/harness/auth/command.d.ts +17 -0
- package/dist/harness/auth/command.d.ts.map +1 -0
- package/dist/harness/auth/command.js +223 -0
- package/dist/harness/auth/command.js.map +1 -0
- package/dist/harness/auth/credential-store.d.ts +30 -0
- package/dist/harness/auth/credential-store.d.ts.map +1 -0
- package/dist/harness/auth/credential-store.js +270 -0
- package/dist/harness/auth/credential-store.js.map +1 -0
- package/dist/harness/auth/index.d.ts +13 -0
- package/dist/harness/auth/index.d.ts.map +1 -0
- package/dist/harness/auth/index.js +10 -0
- package/dist/harness/auth/index.js.map +1 -0
- package/dist/harness/auth/json-file.d.ts +8 -0
- package/dist/harness/auth/json-file.d.ts.map +1 -0
- package/dist/harness/auth/json-file.js +57 -0
- package/dist/harness/auth/json-file.js.map +1 -0
- package/dist/harness/auth/jwt.d.ts +11 -0
- package/dist/harness/auth/jwt.d.ts.map +1 -0
- package/dist/harness/auth/jwt.js +37 -0
- package/dist/harness/auth/jwt.js.map +1 -0
- package/dist/harness/auth/keychain.d.ts +39 -0
- package/dist/harness/auth/keychain.d.ts.map +1 -0
- package/dist/harness/auth/keychain.js +191 -0
- package/dist/harness/auth/keychain.js.map +1 -0
- package/dist/harness/auth/locks.d.ts +19 -0
- package/dist/harness/auth/locks.d.ts.map +1 -0
- package/dist/harness/auth/locks.js +102 -0
- package/dist/harness/auth/locks.js.map +1 -0
- package/dist/harness/auth/notices.d.ts +6 -0
- package/dist/harness/auth/notices.d.ts.map +1 -0
- package/dist/harness/auth/notices.js +29 -0
- package/dist/harness/auth/notices.js.map +1 -0
- package/dist/harness/auth/openai-chatgpt.d.ts +32 -0
- package/dist/harness/auth/openai-chatgpt.d.ts.map +1 -0
- package/dist/harness/auth/openai-chatgpt.js +446 -0
- package/dist/harness/auth/openai-chatgpt.js.map +1 -0
- package/dist/harness/auth/profile-state.d.ts +25 -0
- package/dist/harness/auth/profile-state.d.ts.map +1 -0
- package/dist/harness/auth/profile-state.js +77 -0
- package/dist/harness/auth/profile-state.js.map +1 -0
- package/dist/harness/auth/providers.d.ts +27 -0
- package/dist/harness/auth/providers.d.ts.map +1 -0
- package/dist/harness/auth/providers.js +66 -0
- package/dist/harness/auth/providers.js.map +1 -0
- package/dist/harness/auth/resolved-credential.d.ts +11 -0
- package/dist/harness/auth/resolved-credential.d.ts.map +1 -0
- package/dist/harness/auth/resolved-credential.js +35 -0
- package/dist/harness/auth/resolved-credential.js.map +1 -0
- package/dist/harness/cli/appearance.d.ts +28 -0
- package/dist/harness/cli/appearance.d.ts.map +1 -0
- package/dist/harness/cli/appearance.js +123 -0
- package/dist/harness/cli/appearance.js.map +1 -0
- package/dist/harness/cli/args.d.ts +429 -0
- package/dist/harness/cli/args.d.ts.map +1 -0
- package/dist/harness/cli/args.js +372 -0
- package/dist/harness/cli/args.js.map +1 -0
- package/dist/harness/cli/attachments.d.ts +44 -0
- package/dist/harness/cli/attachments.d.ts.map +1 -0
- package/dist/harness/cli/attachments.js +176 -0
- package/dist/harness/cli/attachments.js.map +1 -0
- package/dist/harness/cli/canonical.d.ts +64 -0
- package/dist/harness/cli/canonical.d.ts.map +1 -0
- package/dist/harness/cli/canonical.js +455 -0
- package/dist/harness/cli/canonical.js.map +1 -0
- package/dist/harness/cli/claude-native-approvals.d.ts +45 -0
- package/dist/harness/cli/claude-native-approvals.d.ts.map +1 -0
- package/dist/harness/cli/claude-native-approvals.js +183 -0
- package/dist/harness/cli/claude-native-approvals.js.map +1 -0
- package/dist/harness/cli/command-grants.d.ts +23 -0
- package/dist/harness/cli/command-grants.d.ts.map +1 -0
- package/dist/harness/cli/command-grants.js +76 -0
- package/dist/harness/cli/command-grants.js.map +1 -0
- package/dist/harness/cli/config-command.d.ts +98 -0
- package/dist/harness/cli/config-command.d.ts.map +1 -0
- package/dist/harness/cli/config-command.js +561 -0
- package/dist/harness/cli/config-command.js.map +1 -0
- package/dist/harness/cli/config.d.ts +429 -0
- package/dist/harness/cli/config.d.ts.map +1 -0
- package/dist/harness/cli/config.js +504 -0
- package/dist/harness/cli/config.js.map +1 -0
- package/dist/harness/cli/conversation.d.ts +35 -0
- package/dist/harness/cli/conversation.d.ts.map +1 -0
- package/dist/harness/cli/conversation.js +3755 -0
- package/dist/harness/cli/conversation.js.map +1 -0
- package/dist/harness/cli/doctor.d.ts +32 -0
- package/dist/harness/cli/doctor.d.ts.map +1 -0
- package/dist/harness/cli/doctor.js +329 -0
- package/dist/harness/cli/doctor.js.map +1 -0
- package/dist/harness/cli/effort-command.d.ts +41 -0
- package/dist/harness/cli/effort-command.d.ts.map +1 -0
- package/dist/harness/cli/effort-command.js +133 -0
- package/dist/harness/cli/effort-command.js.map +1 -0
- package/dist/harness/cli/extensions/agents.d.ts +40 -0
- package/dist/harness/cli/extensions/agents.d.ts.map +1 -0
- package/dist/harness/cli/extensions/agents.js +66 -0
- package/dist/harness/cli/extensions/agents.js.map +1 -0
- package/dist/harness/cli/extensions/catalog.d.ts +134 -0
- package/dist/harness/cli/extensions/catalog.d.ts.map +1 -0
- package/dist/harness/cli/extensions/catalog.js +213 -0
- package/dist/harness/cli/extensions/catalog.js.map +1 -0
- package/dist/harness/cli/extensions/claude-home.d.ts +33 -0
- package/dist/harness/cli/extensions/claude-home.d.ts.map +1 -0
- package/dist/harness/cli/extensions/claude-home.js +78 -0
- package/dist/harness/cli/extensions/claude-home.js.map +1 -0
- package/dist/harness/cli/extensions/controller.d.ts +51 -0
- package/dist/harness/cli/extensions/controller.d.ts.map +1 -0
- package/dist/harness/cli/extensions/controller.js +67 -0
- package/dist/harness/cli/extensions/controller.js.map +1 -0
- package/dist/harness/cli/extensions/hooks.d.ts +164 -0
- package/dist/harness/cli/extensions/hooks.d.ts.map +1 -0
- package/dist/harness/cli/extensions/hooks.js +442 -0
- package/dist/harness/cli/extensions/hooks.js.map +1 -0
- package/dist/harness/cli/extensions/index.d.ts +10 -0
- package/dist/harness/cli/extensions/index.d.ts.map +1 -0
- package/dist/harness/cli/extensions/index.js +10 -0
- package/dist/harness/cli/extensions/index.js.map +1 -0
- package/dist/harness/cli/extensions/markdown.d.ts +46 -0
- package/dist/harness/cli/extensions/markdown.d.ts.map +1 -0
- package/dist/harness/cli/extensions/markdown.js +139 -0
- package/dist/harness/cli/extensions/markdown.js.map +1 -0
- package/dist/harness/cli/extensions/plugins.d.ts +160 -0
- package/dist/harness/cli/extensions/plugins.d.ts.map +1 -0
- package/dist/harness/cli/extensions/plugins.js +645 -0
- package/dist/harness/cli/extensions/plugins.js.map +1 -0
- package/dist/harness/cli/extensions/tool-hooks.d.ts +28 -0
- package/dist/harness/cli/extensions/tool-hooks.d.ts.map +1 -0
- package/dist/harness/cli/extensions/tool-hooks.js +63 -0
- package/dist/harness/cli/extensions/tool-hooks.js.map +1 -0
- package/dist/harness/cli/extensions-command.d.ts +64 -0
- package/dist/harness/cli/extensions-command.d.ts.map +1 -0
- package/dist/harness/cli/extensions-command.js +639 -0
- package/dist/harness/cli/extensions-command.js.map +1 -0
- package/dist/harness/cli/help.d.ts +9 -0
- package/dist/harness/cli/help.d.ts.map +1 -0
- package/dist/harness/cli/help.js +191 -0
- package/dist/harness/cli/help.js.map +1 -0
- package/dist/harness/cli/index.d.ts +52 -0
- package/dist/harness/cli/index.d.ts.map +1 -0
- package/dist/harness/cli/index.js +297 -0
- package/dist/harness/cli/index.js.map +1 -0
- package/dist/harness/cli/inspect.d.ts +40 -0
- package/dist/harness/cli/inspect.d.ts.map +1 -0
- package/dist/harness/cli/inspect.js +185 -0
- package/dist/harness/cli/inspect.js.map +1 -0
- package/dist/harness/cli/mcp-command.d.ts +61 -0
- package/dist/harness/cli/mcp-command.d.ts.map +1 -0
- package/dist/harness/cli/mcp-command.js +519 -0
- package/dist/harness/cli/mcp-command.js.map +1 -0
- package/dist/harness/cli/memory-desk.d.ts +28 -0
- package/dist/harness/cli/memory-desk.d.ts.map +1 -0
- package/dist/harness/cli/memory-desk.js +275 -0
- package/dist/harness/cli/memory-desk.js.map +1 -0
- package/dist/harness/cli/model-picker.d.ts +44 -0
- package/dist/harness/cli/model-picker.d.ts.map +1 -0
- package/dist/harness/cli/model-picker.js +267 -0
- package/dist/harness/cli/model-picker.js.map +1 -0
- package/dist/harness/cli/onboarding.d.ts +29 -0
- package/dist/harness/cli/onboarding.d.ts.map +1 -0
- package/dist/harness/cli/onboarding.js +101 -0
- package/dist/harness/cli/onboarding.js.map +1 -0
- package/dist/harness/cli/orchestrate-tool.d.ts +60 -0
- package/dist/harness/cli/orchestrate-tool.d.ts.map +1 -0
- package/dist/harness/cli/orchestrate-tool.js +167 -0
- package/dist/harness/cli/orchestrate-tool.js.map +1 -0
- package/dist/harness/cli/orchestration-view.d.ts +57 -0
- package/dist/harness/cli/orchestration-view.d.ts.map +1 -0
- package/dist/harness/cli/orchestration-view.js +371 -0
- package/dist/harness/cli/orchestration-view.js.map +1 -0
- package/dist/harness/cli/outcome.d.ts +11 -0
- package/dist/harness/cli/outcome.d.ts.map +1 -0
- package/dist/harness/cli/outcome.js +70 -0
- package/dist/harness/cli/outcome.js.map +1 -0
- package/dist/harness/cli/panels/common.d.ts +30 -0
- package/dist/harness/cli/panels/common.d.ts.map +1 -0
- package/dist/harness/cli/panels/common.js +143 -0
- package/dist/harness/cli/panels/common.js.map +1 -0
- package/dist/harness/cli/panels/mcp.d.ts +18 -0
- package/dist/harness/cli/panels/mcp.d.ts.map +1 -0
- package/dist/harness/cli/panels/mcp.js +132 -0
- package/dist/harness/cli/panels/mcp.js.map +1 -0
- package/dist/harness/cli/panels/plugins.d.ts +8 -0
- package/dist/harness/cli/panels/plugins.d.ts.map +1 -0
- package/dist/harness/cli/panels/plugins.js +114 -0
- package/dist/harness/cli/panels/plugins.js.map +1 -0
- package/dist/harness/cli/panels/session.d.ts +54 -0
- package/dist/harness/cli/panels/session.d.ts.map +1 -0
- package/dist/harness/cli/panels/session.js +221 -0
- package/dist/harness/cli/panels/session.js.map +1 -0
- package/dist/harness/cli/panels/skills.d.ts +16 -0
- package/dist/harness/cli/panels/skills.d.ts.map +1 -0
- package/dist/harness/cli/panels/skills.js +146 -0
- package/dist/harness/cli/panels/skills.js.map +1 -0
- package/dist/harness/cli/project-profile.d.ts +87 -0
- package/dist/harness/cli/project-profile.d.ts.map +1 -0
- package/dist/harness/cli/project-profile.js +709 -0
- package/dist/harness/cli/project-profile.js.map +1 -0
- package/dist/harness/cli/project-scope.d.ts +2 -0
- package/dist/harness/cli/project-scope.d.ts.map +1 -0
- package/dist/harness/cli/project-scope.js +55 -0
- package/dist/harness/cli/project-scope.js.map +1 -0
- package/dist/harness/cli/renderers.d.ts +75 -0
- package/dist/harness/cli/renderers.d.ts.map +1 -0
- package/dist/harness/cli/renderers.js +162 -0
- package/dist/harness/cli/renderers.js.map +1 -0
- package/dist/harness/cli/rewind.d.ts +54 -0
- package/dist/harness/cli/rewind.d.ts.map +1 -0
- package/dist/harness/cli/rewind.js +80 -0
- package/dist/harness/cli/rewind.js.map +1 -0
- package/dist/harness/cli/role-policy.d.ts +8 -0
- package/dist/harness/cli/role-policy.d.ts.map +1 -0
- package/dist/harness/cli/role-policy.js +53 -0
- package/dist/harness/cli/role-policy.js.map +1 -0
- package/dist/harness/cli/run-summary.d.ts +16 -0
- package/dist/harness/cli/run-summary.d.ts.map +1 -0
- package/dist/harness/cli/run-summary.js +105 -0
- package/dist/harness/cli/run-summary.js.map +1 -0
- package/dist/harness/cli/runtime.d.ts +182 -0
- package/dist/harness/cli/runtime.d.ts.map +1 -0
- package/dist/harness/cli/runtime.js +999 -0
- package/dist/harness/cli/runtime.js.map +1 -0
- package/dist/harness/cli/scripted-script.d.ts +50 -0
- package/dist/harness/cli/scripted-script.d.ts.map +1 -0
- package/dist/harness/cli/scripted-script.js +110 -0
- package/dist/harness/cli/scripted-script.js.map +1 -0
- package/dist/harness/cli/session-git.d.ts +76 -0
- package/dist/harness/cli/session-git.d.ts.map +1 -0
- package/dist/harness/cli/session-git.js +146 -0
- package/dist/harness/cli/session-git.js.map +1 -0
- package/dist/harness/cli/session.d.ts +22 -0
- package/dist/harness/cli/session.d.ts.map +1 -0
- package/dist/harness/cli/session.js +203 -0
- package/dist/harness/cli/session.js.map +1 -0
- package/dist/harness/cli/slash-commands.d.ts +85 -0
- package/dist/harness/cli/slash-commands.d.ts.map +1 -0
- package/dist/harness/cli/slash-commands.js +114 -0
- package/dist/harness/cli/slash-commands.js.map +1 -0
- package/dist/harness/cli/startup-notices.d.ts +32 -0
- package/dist/harness/cli/startup-notices.d.ts.map +1 -0
- package/dist/harness/cli/startup-notices.js +93 -0
- package/dist/harness/cli/startup-notices.js.map +1 -0
- package/dist/harness/cli/terminal.d.ts +32 -0
- package/dist/harness/cli/terminal.d.ts.map +1 -0
- package/dist/harness/cli/terminal.js +21 -0
- package/dist/harness/cli/terminal.js.map +1 -0
- package/dist/harness/cli/transparency.d.ts +39 -0
- package/dist/harness/cli/transparency.d.ts.map +1 -0
- package/dist/harness/cli/transparency.js +491 -0
- package/dist/harness/cli/transparency.js.map +1 -0
- package/dist/harness/cli/trust.d.ts +40 -0
- package/dist/harness/cli/trust.d.ts.map +1 -0
- package/dist/harness/cli/trust.js +133 -0
- package/dist/harness/cli/trust.js.map +1 -0
- package/dist/harness/cli/usage-stats.d.ts +57 -0
- package/dist/harness/cli/usage-stats.d.ts.map +1 -0
- package/dist/harness/cli/usage-stats.js +341 -0
- package/dist/harness/cli/usage-stats.js.map +1 -0
- package/dist/harness/context/compaction.d.ts +69 -0
- package/dist/harness/context/compaction.d.ts.map +1 -0
- package/dist/harness/context/compaction.js +149 -0
- package/dist/harness/context/compaction.js.map +1 -0
- package/dist/harness/context/context-builder.d.ts +76 -0
- package/dist/harness/context/context-builder.d.ts.map +1 -0
- package/dist/harness/context/context-builder.js +367 -0
- package/dist/harness/context/context-builder.js.map +1 -0
- package/dist/harness/context/history.d.ts +31 -0
- package/dist/harness/context/history.d.ts.map +1 -0
- package/dist/harness/context/history.js +105 -0
- package/dist/harness/context/history.js.map +1 -0
- package/dist/harness/context/index.d.ts +11 -0
- package/dist/harness/context/index.d.ts.map +1 -0
- package/dist/harness/context/index.js +9 -0
- package/dist/harness/context/index.js.map +1 -0
- package/dist/harness/context/instructions.d.ts +30 -0
- package/dist/harness/context/instructions.d.ts.map +1 -0
- package/dist/harness/context/instructions.js +82 -0
- package/dist/harness/context/instructions.js.map +1 -0
- package/dist/harness/context/model-view.d.ts +46 -0
- package/dist/harness/context/model-view.d.ts.map +1 -0
- package/dist/harness/context/model-view.js +136 -0
- package/dist/harness/context/model-view.js.map +1 -0
- package/dist/harness/context/scope.d.ts +9 -0
- package/dist/harness/context/scope.d.ts.map +1 -0
- package/dist/harness/context/scope.js +50 -0
- package/dist/harness/context/scope.js.map +1 -0
- package/dist/harness/context/skills.d.ts +75 -0
- package/dist/harness/context/skills.d.ts.map +1 -0
- package/dist/harness/context/skills.js +109 -0
- package/dist/harness/context/skills.js.map +1 -0
- package/dist/harness/context/tokens.d.ts +10 -0
- package/dist/harness/context/tokens.d.ts.map +1 -0
- package/dist/harness/context/tokens.js +39 -0
- package/dist/harness/context/tokens.js.map +1 -0
- package/dist/harness/contracts/auth.d.ts +214 -0
- package/dist/harness/contracts/auth.d.ts.map +1 -0
- package/dist/harness/contracts/auth.js +120 -0
- package/dist/harness/contracts/auth.js.map +1 -0
- package/dist/harness/contracts/choice.d.ts +115 -0
- package/dist/harness/contracts/choice.d.ts.map +1 -0
- package/dist/harness/contracts/choice.js +115 -0
- package/dist/harness/contracts/choice.js.map +1 -0
- package/dist/harness/contracts/common.d.ts +119 -0
- package/dist/harness/contracts/common.d.ts.map +1 -0
- package/dist/harness/contracts/common.js +66 -0
- package/dist/harness/contracts/common.js.map +1 -0
- package/dist/harness/contracts/digest.d.ts +59 -0
- package/dist/harness/contracts/digest.d.ts.map +1 -0
- package/dist/harness/contracts/digest.js +88 -0
- package/dist/harness/contracts/digest.js.map +1 -0
- package/dist/harness/contracts/errors.d.ts +70 -0
- package/dist/harness/contracts/errors.d.ts.map +1 -0
- package/dist/harness/contracts/errors.js +87 -0
- package/dist/harness/contracts/errors.js.map +1 -0
- package/dist/harness/contracts/events.d.ts +3094 -0
- package/dist/harness/contracts/events.d.ts.map +1 -0
- package/dist/harness/contracts/events.js +426 -0
- package/dist/harness/contracts/events.js.map +1 -0
- package/dist/harness/contracts/evidence.d.ts +286 -0
- package/dist/harness/contracts/evidence.d.ts.map +1 -0
- package/dist/harness/contracts/evidence.js +234 -0
- package/dist/harness/contracts/evidence.js.map +1 -0
- package/dist/harness/contracts/ids.d.ts +77 -0
- package/dist/harness/contracts/ids.d.ts.map +1 -0
- package/dist/harness/contracts/ids.js +126 -0
- package/dist/harness/contracts/ids.js.map +1 -0
- package/dist/harness/contracts/index.d.ts +23 -0
- package/dist/harness/contracts/index.d.ts.map +1 -0
- package/dist/harness/contracts/index.js +23 -0
- package/dist/harness/contracts/index.js.map +1 -0
- package/dist/harness/contracts/jsonl.d.ts +3386 -0
- package/dist/harness/contracts/jsonl.d.ts.map +1 -0
- package/dist/harness/contracts/jsonl.js +87 -0
- package/dist/harness/contracts/jsonl.js.map +1 -0
- package/dist/harness/contracts/memory.d.ts +271 -0
- package/dist/harness/contracts/memory.d.ts.map +1 -0
- package/dist/harness/contracts/memory.js +152 -0
- package/dist/harness/contracts/memory.js.map +1 -0
- package/dist/harness/contracts/model.d.ts +1201 -0
- package/dist/harness/contracts/model.d.ts.map +1 -0
- package/dist/harness/contracts/model.js +386 -0
- package/dist/harness/contracts/model.js.map +1 -0
- package/dist/harness/contracts/packets.d.ts +945 -0
- package/dist/harness/contracts/packets.d.ts.map +1 -0
- package/dist/harness/contracts/packets.js +535 -0
- package/dist/harness/contracts/packets.js.map +1 -0
- package/dist/harness/contracts/panel.d.ts +140 -0
- package/dist/harness/contracts/panel.d.ts.map +1 -0
- package/dist/harness/contracts/panel.js +19 -0
- package/dist/harness/contracts/panel.js.map +1 -0
- package/dist/harness/contracts/paths.d.ts +58 -0
- package/dist/harness/contracts/paths.d.ts.map +1 -0
- package/dist/harness/contracts/paths.js +204 -0
- package/dist/harness/contracts/paths.js.map +1 -0
- package/dist/harness/contracts/policy.d.ts +459 -0
- package/dist/harness/contracts/policy.d.ts.map +1 -0
- package/dist/harness/contracts/policy.js +338 -0
- package/dist/harness/contracts/policy.js.map +1 -0
- package/dist/harness/contracts/projection.d.ts +111 -0
- package/dist/harness/contracts/projection.d.ts.map +1 -0
- package/dist/harness/contracts/projection.js +2 -0
- package/dist/harness/contracts/projection.js.map +1 -0
- package/dist/harness/contracts/renderer.d.ts +291 -0
- package/dist/harness/contracts/renderer.d.ts.map +1 -0
- package/dist/harness/contracts/renderer.js +36 -0
- package/dist/harness/contracts/renderer.js.map +1 -0
- package/dist/harness/contracts/roles.d.ts +28 -0
- package/dist/harness/contracts/roles.d.ts.map +1 -0
- package/dist/harness/contracts/roles.js +36 -0
- package/dist/harness/contracts/roles.js.map +1 -0
- package/dist/harness/contracts/runtime.d.ts +283 -0
- package/dist/harness/contracts/runtime.d.ts.map +1 -0
- package/dist/harness/contracts/runtime.js +13 -0
- package/dist/harness/contracts/runtime.js.map +1 -0
- package/dist/harness/contracts/state.d.ts +124 -0
- package/dist/harness/contracts/state.d.ts.map +1 -0
- package/dist/harness/contracts/state.js +172 -0
- package/dist/harness/contracts/state.js.map +1 -0
- package/dist/harness/contracts/store.d.ts +117 -0
- package/dist/harness/contracts/store.d.ts.map +1 -0
- package/dist/harness/contracts/store.js +54 -0
- package/dist/harness/contracts/store.js.map +1 -0
- package/dist/harness/contracts/tools.d.ts +296 -0
- package/dist/harness/contracts/tools.d.ts.map +1 -0
- package/dist/harness/contracts/tools.js +117 -0
- package/dist/harness/contracts/tools.js.map +1 -0
- package/dist/harness/contracts/views.d.ts +468 -0
- package/dist/harness/contracts/views.d.ts.map +1 -0
- package/dist/harness/contracts/views.js +2 -0
- package/dist/harness/contracts/views.js.map +1 -0
- package/dist/harness/core/driver.d.ts +53 -0
- package/dist/harness/core/driver.d.ts.map +1 -0
- package/dist/harness/core/driver.js +566 -0
- package/dist/harness/core/driver.js.map +1 -0
- package/dist/harness/core/envelope.d.ts +11 -0
- package/dist/harness/core/envelope.d.ts.map +1 -0
- package/dist/harness/core/envelope.js +35 -0
- package/dist/harness/core/envelope.js.map +1 -0
- package/dist/harness/core/index.d.ts +7 -0
- package/dist/harness/core/index.d.ts.map +1 -0
- package/dist/harness/core/index.js +5 -0
- package/dist/harness/core/index.js.map +1 -0
- package/dist/harness/core/projection.d.ts +10 -0
- package/dist/harness/core/projection.d.ts.map +1 -0
- package/dist/harness/core/projection.js +268 -0
- package/dist/harness/core/projection.js.map +1 -0
- package/dist/harness/core/recovery.d.ts +14 -0
- package/dist/harness/core/recovery.d.ts.map +1 -0
- package/dist/harness/core/recovery.js +115 -0
- package/dist/harness/core/recovery.js.map +1 -0
- package/dist/harness/core/stream.d.ts +23 -0
- package/dist/harness/core/stream.d.ts.map +1 -0
- package/dist/harness/core/stream.js +102 -0
- package/dist/harness/core/stream.js.map +1 -0
- package/dist/harness/core/testing.d.ts +80 -0
- package/dist/harness/core/testing.d.ts.map +1 -0
- package/dist/harness/core/testing.js +258 -0
- package/dist/harness/core/testing.js.map +1 -0
- package/dist/harness/mcp/approvals.d.ts +14 -0
- package/dist/harness/mcp/approvals.d.ts.map +1 -0
- package/dist/harness/mcp/approvals.js +60 -0
- package/dist/harness/mcp/approvals.js.map +1 -0
- package/dist/harness/mcp/client.d.ts +74 -0
- package/dist/harness/mcp/client.d.ts.map +1 -0
- package/dist/harness/mcp/client.js +214 -0
- package/dist/harness/mcp/client.js.map +1 -0
- package/dist/harness/mcp/config.d.ts +156 -0
- package/dist/harness/mcp/config.d.ts.map +1 -0
- package/dist/harness/mcp/config.js +180 -0
- package/dist/harness/mcp/config.js.map +1 -0
- package/dist/harness/mcp/errors.d.ts +24 -0
- package/dist/harness/mcp/errors.d.ts.map +1 -0
- package/dist/harness/mcp/errors.js +67 -0
- package/dist/harness/mcp/errors.js.map +1 -0
- package/dist/harness/mcp/index.d.ts +9 -0
- package/dist/harness/mcp/index.d.ts.map +1 -0
- package/dist/harness/mcp/index.js +9 -0
- package/dist/harness/mcp/index.js.map +1 -0
- package/dist/harness/mcp/manager.d.ts +115 -0
- package/dist/harness/mcp/manager.d.ts.map +1 -0
- package/dist/harness/mcp/manager.js +361 -0
- package/dist/harness/mcp/manager.js.map +1 -0
- package/dist/harness/mcp/oauth.d.ts +54 -0
- package/dist/harness/mcp/oauth.d.ts.map +1 -0
- package/dist/harness/mcp/oauth.js +253 -0
- package/dist/harness/mcp/oauth.js.map +1 -0
- package/dist/harness/mcp/tools.d.ts +24 -0
- package/dist/harness/mcp/tools.d.ts.map +1 -0
- package/dist/harness/mcp/tools.js +142 -0
- package/dist/harness/mcp/tools.js.map +1 -0
- package/dist/harness/memory/bootstrap.d.ts +55 -0
- package/dist/harness/memory/bootstrap.d.ts.map +1 -0
- package/dist/harness/memory/bootstrap.js +124 -0
- package/dist/harness/memory/bootstrap.js.map +1 -0
- package/dist/harness/memory/desk.d.ts +74 -0
- package/dist/harness/memory/desk.d.ts.map +1 -0
- package/dist/harness/memory/desk.js +211 -0
- package/dist/harness/memory/desk.js.map +1 -0
- package/dist/harness/memory/graph.d.ts +24 -0
- package/dist/harness/memory/graph.d.ts.map +1 -0
- package/dist/harness/memory/graph.js +92 -0
- package/dist/harness/memory/graph.js.map +1 -0
- package/dist/harness/memory/index.d.ts +12 -0
- package/dist/harness/memory/index.d.ts.map +1 -0
- package/dist/harness/memory/index.js +10 -0
- package/dist/harness/memory/index.js.map +1 -0
- package/dist/harness/memory/markdown-memory-store.d.ts +122 -0
- package/dist/harness/memory/markdown-memory-store.d.ts.map +1 -0
- package/dist/harness/memory/markdown-memory-store.js +419 -0
- package/dist/harness/memory/markdown-memory-store.js.map +1 -0
- package/dist/harness/memory/memory-command.d.ts +22 -0
- package/dist/harness/memory/memory-command.d.ts.map +1 -0
- package/dist/harness/memory/memory-command.js +335 -0
- package/dist/harness/memory/memory-command.js.map +1 -0
- package/dist/harness/memory/memory-index.d.ts +71 -0
- package/dist/harness/memory/memory-index.d.ts.map +1 -0
- package/dist/harness/memory/memory-index.js +206 -0
- package/dist/harness/memory/memory-index.js.map +1 -0
- package/dist/harness/memory/note-format.d.ts +20 -0
- package/dist/harness/memory/note-format.d.ts.map +1 -0
- package/dist/harness/memory/note-format.js +69 -0
- package/dist/harness/memory/note-format.js.map +1 -0
- package/dist/harness/memory/obsidian.d.ts +14 -0
- package/dist/harness/memory/obsidian.d.ts.map +1 -0
- package/dist/harness/memory/obsidian.js +64 -0
- package/dist/harness/memory/obsidian.js.map +1 -0
- package/dist/harness/memory/redaction.d.ts +15 -0
- package/dist/harness/memory/redaction.d.ts.map +1 -0
- package/dist/harness/memory/redaction.js +64 -0
- package/dist/harness/memory/redaction.js.map +1 -0
- package/dist/harness/memory/relations.d.ts +29 -0
- package/dist/harness/memory/relations.d.ts.map +1 -0
- package/dist/harness/memory/relations.js +117 -0
- package/dist/harness/memory/relations.js.map +1 -0
- package/dist/harness/memory/vault.d.ts +35 -0
- package/dist/harness/memory/vault.d.ts.map +1 -0
- package/dist/harness/memory/vault.js +194 -0
- package/dist/harness/memory/vault.js.map +1 -0
- package/dist/harness/orchestration/approval.d.ts +29 -0
- package/dist/harness/orchestration/approval.d.ts.map +1 -0
- package/dist/harness/orchestration/approval.js +86 -0
- package/dist/harness/orchestration/approval.js.map +1 -0
- package/dist/harness/orchestration/artifact-review.d.ts +219 -0
- package/dist/harness/orchestration/artifact-review.d.ts.map +1 -0
- package/dist/harness/orchestration/artifact-review.js +319 -0
- package/dist/harness/orchestration/artifact-review.js.map +1 -0
- package/dist/harness/orchestration/attempt-log.d.ts +53 -0
- package/dist/harness/orchestration/attempt-log.d.ts.map +1 -0
- package/dist/harness/orchestration/attempt-log.js +138 -0
- package/dist/harness/orchestration/attempt-log.js.map +1 -0
- package/dist/harness/orchestration/budget.d.ts +110 -0
- package/dist/harness/orchestration/budget.d.ts.map +1 -0
- package/dist/harness/orchestration/budget.js +197 -0
- package/dist/harness/orchestration/budget.js.map +1 -0
- package/dist/harness/orchestration/capabilities.d.ts +6 -0
- package/dist/harness/orchestration/capabilities.d.ts.map +1 -0
- package/dist/harness/orchestration/capabilities.js +80 -0
- package/dist/harness/orchestration/capabilities.js.map +1 -0
- package/dist/harness/orchestration/claims.d.ts +148 -0
- package/dist/harness/orchestration/claims.d.ts.map +1 -0
- package/dist/harness/orchestration/claims.js +64 -0
- package/dist/harness/orchestration/claims.js.map +1 -0
- package/dist/harness/orchestration/control-plane.d.ts +18 -0
- package/dist/harness/orchestration/control-plane.d.ts.map +1 -0
- package/dist/harness/orchestration/control-plane.js +74 -0
- package/dist/harness/orchestration/control-plane.js.map +1 -0
- package/dist/harness/orchestration/coordinator.d.ts +132 -0
- package/dist/harness/orchestration/coordinator.d.ts.map +1 -0
- package/dist/harness/orchestration/coordinator.js +1628 -0
- package/dist/harness/orchestration/coordinator.js.map +1 -0
- package/dist/harness/orchestration/delegation.d.ts +80 -0
- package/dist/harness/orchestration/delegation.d.ts.map +1 -0
- package/dist/harness/orchestration/delegation.js +81 -0
- package/dist/harness/orchestration/delegation.js.map +1 -0
- package/dist/harness/orchestration/evidence.d.ts +124 -0
- package/dist/harness/orchestration/evidence.d.ts.map +1 -0
- package/dist/harness/orchestration/evidence.js +576 -0
- package/dist/harness/orchestration/evidence.js.map +1 -0
- package/dist/harness/orchestration/factories.d.ts +13 -0
- package/dist/harness/orchestration/factories.d.ts.map +1 -0
- package/dist/harness/orchestration/factories.js +20 -0
- package/dist/harness/orchestration/factories.js.map +1 -0
- package/dist/harness/orchestration/git.d.ts +77 -0
- package/dist/harness/orchestration/git.d.ts.map +1 -0
- package/dist/harness/orchestration/git.js +214 -0
- package/dist/harness/orchestration/git.js.map +1 -0
- package/dist/harness/orchestration/index.d.ts +25 -0
- package/dist/harness/orchestration/index.d.ts.map +1 -0
- package/dist/harness/orchestration/index.js +23 -0
- package/dist/harness/orchestration/index.js.map +1 -0
- package/dist/harness/orchestration/isolation.d.ts +181 -0
- package/dist/harness/orchestration/isolation.d.ts.map +1 -0
- package/dist/harness/orchestration/isolation.js +1357 -0
- package/dist/harness/orchestration/isolation.js.map +1 -0
- package/dist/harness/orchestration/paths.d.ts +18 -0
- package/dist/harness/orchestration/paths.d.ts.map +1 -0
- package/dist/harness/orchestration/paths.js +56 -0
- package/dist/harness/orchestration/paths.js.map +1 -0
- package/dist/harness/orchestration/plan.d.ts +219 -0
- package/dist/harness/orchestration/plan.d.ts.map +1 -0
- package/dist/harness/orchestration/plan.js +537 -0
- package/dist/harness/orchestration/plan.js.map +1 -0
- package/dist/harness/orchestration/planner.d.ts +137 -0
- package/dist/harness/orchestration/planner.d.ts.map +1 -0
- package/dist/harness/orchestration/planner.js +162 -0
- package/dist/harness/orchestration/planner.js.map +1 -0
- package/dist/harness/orchestration/recorder.d.ts +23 -0
- package/dist/harness/orchestration/recorder.d.ts.map +1 -0
- package/dist/harness/orchestration/recorder.js +50 -0
- package/dist/harness/orchestration/recorder.js.map +1 -0
- package/dist/harness/orchestration/scheduler.d.ts +40 -0
- package/dist/harness/orchestration/scheduler.d.ts.map +1 -0
- package/dist/harness/orchestration/scheduler.js +157 -0
- package/dist/harness/orchestration/scheduler.js.map +1 -0
- package/dist/harness/orchestration/testing.d.ts +233 -0
- package/dist/harness/orchestration/testing.d.ts.map +1 -0
- package/dist/harness/orchestration/testing.js +734 -0
- package/dist/harness/orchestration/testing.js.map +1 -0
- package/dist/harness/orchestration/verification-preflight.d.ts +46 -0
- package/dist/harness/orchestration/verification-preflight.d.ts.map +1 -0
- package/dist/harness/orchestration/verification-preflight.js +104 -0
- package/dist/harness/orchestration/verification-preflight.js.map +1 -0
- package/dist/harness/orchestration/worker-control.d.ts +64 -0
- package/dist/harness/orchestration/worker-control.d.ts.map +1 -0
- package/dist/harness/orchestration/worker-control.js +199 -0
- package/dist/harness/orchestration/worker-control.js.map +1 -0
- package/dist/harness/orchestration/worker-manager.d.ts +225 -0
- package/dist/harness/orchestration/worker-manager.d.ts.map +1 -0
- package/dist/harness/orchestration/worker-manager.js +1347 -0
- package/dist/harness/orchestration/worker-manager.js.map +1 -0
- package/dist/harness/orchestration/workspace-digest.d.ts +39 -0
- package/dist/harness/orchestration/workspace-digest.d.ts.map +1 -0
- package/dist/harness/orchestration/workspace-digest.js +147 -0
- package/dist/harness/orchestration/workspace-digest.js.map +1 -0
- package/dist/harness/policy/approval-broker.d.ts +13 -0
- package/dist/harness/policy/approval-broker.d.ts.map +1 -0
- package/dist/harness/policy/approval-broker.js +26 -0
- package/dist/harness/policy/approval-broker.js.map +1 -0
- package/dist/harness/policy/command-classifier.d.ts +29 -0
- package/dist/harness/policy/command-classifier.d.ts.map +1 -0
- package/dist/harness/policy/command-classifier.js +459 -0
- package/dist/harness/policy/command-classifier.js.map +1 -0
- package/dist/harness/policy/command-rules.d.ts +56 -0
- package/dist/harness/policy/command-rules.d.ts.map +1 -0
- package/dist/harness/policy/command-rules.js +588 -0
- package/dist/harness/policy/command-rules.js.map +1 -0
- package/dist/harness/policy/config.d.ts +27 -0
- package/dist/harness/policy/config.d.ts.map +1 -0
- package/dist/harness/policy/config.js +37 -0
- package/dist/harness/policy/config.js.map +1 -0
- package/dist/harness/policy/engine.d.ts +67 -0
- package/dist/harness/policy/engine.d.ts.map +1 -0
- package/dist/harness/policy/engine.js +483 -0
- package/dist/harness/policy/engine.js.map +1 -0
- package/dist/harness/policy/exec-allowlist.d.ts +66 -0
- package/dist/harness/policy/exec-allowlist.d.ts.map +1 -0
- package/dist/harness/policy/exec-allowlist.js +449 -0
- package/dist/harness/policy/exec-allowlist.js.map +1 -0
- package/dist/harness/policy/index.d.ts +10 -0
- package/dist/harness/policy/index.d.ts.map +1 -0
- package/dist/harness/policy/index.js +8 -0
- package/dist/harness/policy/index.js.map +1 -0
- package/dist/harness/policy/secret-patterns.d.ts +12 -0
- package/dist/harness/policy/secret-patterns.d.ts.map +1 -0
- package/dist/harness/policy/secret-patterns.js +48 -0
- package/dist/harness/policy/secret-patterns.js.map +1 -0
- package/dist/harness/policy/shell-parser.d.ts +40 -0
- package/dist/harness/policy/shell-parser.d.ts.map +1 -0
- package/dist/harness/policy/shell-parser.js +278 -0
- package/dist/harness/policy/shell-parser.js.map +1 -0
- package/dist/harness/policy/workspace-trust.d.ts +37 -0
- package/dist/harness/policy/workspace-trust.d.ts.map +1 -0
- package/dist/harness/policy/workspace-trust.js +164 -0
- package/dist/harness/policy/workspace-trust.js.map +1 -0
- package/dist/harness/providers/anthropic-messages.d.ts +48 -0
- package/dist/harness/providers/anthropic-messages.d.ts.map +1 -0
- package/dist/harness/providers/anthropic-messages.js +360 -0
- package/dist/harness/providers/anthropic-messages.js.map +1 -0
- package/dist/harness/providers/assembler.d.ts +29 -0
- package/dist/harness/providers/assembler.d.ts.map +1 -0
- package/dist/harness/providers/assembler.js +130 -0
- package/dist/harness/providers/assembler.js.map +1 -0
- package/dist/harness/providers/authenticated-stream.d.ts +9 -0
- package/dist/harness/providers/authenticated-stream.d.ts.map +1 -0
- package/dist/harness/providers/authenticated-stream.js +81 -0
- package/dist/harness/providers/authenticated-stream.js.map +1 -0
- package/dist/harness/providers/catalog.d.ts +75 -0
- package/dist/harness/providers/catalog.d.ts.map +1 -0
- package/dist/harness/providers/catalog.js +124 -0
- package/dist/harness/providers/catalog.js.map +1 -0
- package/dist/harness/providers/claude-code/adapter.d.ts +96 -0
- package/dist/harness/providers/claude-code/adapter.d.ts.map +1 -0
- package/dist/harness/providers/claude-code/adapter.js +863 -0
- package/dist/harness/providers/claude-code/adapter.js.map +1 -0
- package/dist/harness/providers/claude-code/mcp-relay.d.ts +2 -0
- package/dist/harness/providers/claude-code/mcp-relay.d.ts.map +1 -0
- package/dist/harness/providers/claude-code/mcp-relay.js +27 -0
- package/dist/harness/providers/claude-code/mcp-relay.js.map +1 -0
- package/dist/harness/providers/claude-code/mcp-server.d.ts +40 -0
- package/dist/harness/providers/claude-code/mcp-server.d.ts.map +1 -0
- package/dist/harness/providers/claude-code/mcp-server.js +171 -0
- package/dist/harness/providers/claude-code/mcp-server.js.map +1 -0
- package/dist/harness/providers/claude-code/native.d.ts +36 -0
- package/dist/harness/providers/claude-code/native.d.ts.map +1 -0
- package/dist/harness/providers/claude-code/native.js +153 -0
- package/dist/harness/providers/claude-code/native.js.map +1 -0
- package/dist/harness/providers/claude-code/process.d.ts +48 -0
- package/dist/harness/providers/claude-code/process.d.ts.map +1 -0
- package/dist/harness/providers/claude-code/process.js +128 -0
- package/dist/harness/providers/claude-code/process.js.map +1 -0
- package/dist/harness/providers/codex-app-server.d.ts +8 -0
- package/dist/harness/providers/codex-app-server.d.ts.map +1 -0
- package/dist/harness/providers/codex-app-server.js +45 -0
- package/dist/harness/providers/codex-app-server.js.map +1 -0
- package/dist/harness/providers/effort.d.ts +51 -0
- package/dist/harness/providers/effort.d.ts.map +1 -0
- package/dist/harness/providers/effort.js +108 -0
- package/dist/harness/providers/effort.js.map +1 -0
- package/dist/harness/providers/errors.d.ts +34 -0
- package/dist/harness/providers/errors.d.ts.map +1 -0
- package/dist/harness/providers/errors.js +143 -0
- package/dist/harness/providers/errors.js.map +1 -0
- package/dist/harness/providers/grammar.d.ts +17 -0
- package/dist/harness/providers/grammar.d.ts.map +1 -0
- package/dist/harness/providers/grammar.js +89 -0
- package/dist/harness/providers/grammar.js.map +1 -0
- package/dist/harness/providers/http-stream.d.ts +40 -0
- package/dist/harness/providers/http-stream.d.ts.map +1 -0
- package/dist/harness/providers/http-stream.js +134 -0
- package/dist/harness/providers/http-stream.js.map +1 -0
- package/dist/harness/providers/index.d.ts +20 -0
- package/dist/harness/providers/index.d.ts.map +1 -0
- package/dist/harness/providers/index.js +17 -0
- package/dist/harness/providers/index.js.map +1 -0
- package/dist/harness/providers/responses.d.ts +36 -0
- package/dist/harness/providers/responses.d.ts.map +1 -0
- package/dist/harness/providers/responses.js +435 -0
- package/dist/harness/providers/responses.js.map +1 -0
- package/dist/harness/providers/reviewer-route.d.ts +14 -0
- package/dist/harness/providers/reviewer-route.d.ts.map +1 -0
- package/dist/harness/providers/reviewer-route.js +31 -0
- package/dist/harness/providers/reviewer-route.js.map +1 -0
- package/dist/harness/providers/router.d.ts +50 -0
- package/dist/harness/providers/router.d.ts.map +1 -0
- package/dist/harness/providers/router.js +295 -0
- package/dist/harness/providers/router.js.map +1 -0
- package/dist/harness/providers/scripted.d.ts +22 -0
- package/dist/harness/providers/scripted.d.ts.map +1 -0
- package/dist/harness/providers/scripted.js +111 -0
- package/dist/harness/providers/scripted.js.map +1 -0
- package/dist/harness/providers/sse.d.ts +13 -0
- package/dist/harness/providers/sse.d.ts.map +1 -0
- package/dist/harness/providers/sse.js +82 -0
- package/dist/harness/providers/sse.js.map +1 -0
- package/dist/harness/providers/testing.d.ts +35 -0
- package/dist/harness/providers/testing.d.ts.map +1 -0
- package/dist/harness/providers/testing.js +93 -0
- package/dist/harness/providers/testing.js.map +1 -0
- package/dist/harness/providers/web-search.d.ts +110 -0
- package/dist/harness/providers/web-search.d.ts.map +1 -0
- package/dist/harness/providers/web-search.js +476 -0
- package/dist/harness/providers/web-search.js.map +1 -0
- package/dist/harness/store/blob-store.d.ts +4 -0
- package/dist/harness/store/blob-store.d.ts.map +1 -0
- package/dist/harness/store/blob-store.js +79 -0
- package/dist/harness/store/blob-store.js.map +1 -0
- package/dist/harness/store/durable-file.d.ts +17 -0
- package/dist/harness/store/durable-file.d.ts.map +1 -0
- package/dist/harness/store/durable-file.js +84 -0
- package/dist/harness/store/durable-file.js.map +1 -0
- package/dist/harness/store/event-store.d.ts +56 -0
- package/dist/harness/store/event-store.d.ts.map +1 -0
- package/dist/harness/store/event-store.js +210 -0
- package/dist/harness/store/event-store.js.map +1 -0
- package/dist/harness/store/index.d.ts +8 -0
- package/dist/harness/store/index.d.ts.map +1 -0
- package/dist/harness/store/index.js +4 -0
- package/dist/harness/store/index.js.map +1 -0
- package/dist/harness/store/layout.d.ts +12 -0
- package/dist/harness/store/layout.d.ts.map +1 -0
- package/dist/harness/store/layout.js +27 -0
- package/dist/harness/store/layout.js.map +1 -0
- package/dist/harness/store/lease.d.ts +37 -0
- package/dist/harness/store/lease.d.ts.map +1 -0
- package/dist/harness/store/lease.js +326 -0
- package/dist/harness/store/lease.js.map +1 -0
- package/dist/harness/store/segments.d.ts +49 -0
- package/dist/harness/store/segments.d.ts.map +1 -0
- package/dist/harness/store/segments.js +216 -0
- package/dist/harness/store/segments.js.map +1 -0
- package/dist/harness/store/session-store.d.ts +18 -0
- package/dist/harness/store/session-store.d.ts.map +1 -0
- package/dist/harness/store/session-store.js +319 -0
- package/dist/harness/store/session-store.js.map +1 -0
- package/dist/harness/tools/builtin/control-tools.d.ts +57 -0
- package/dist/harness/tools/builtin/control-tools.d.ts.map +1 -0
- package/dist/harness/tools/builtin/control-tools.js +72 -0
- package/dist/harness/tools/builtin/control-tools.js.map +1 -0
- package/dist/harness/tools/builtin/glob.d.ts +15 -0
- package/dist/harness/tools/builtin/glob.d.ts.map +1 -0
- package/dist/harness/tools/builtin/glob.js +164 -0
- package/dist/harness/tools/builtin/glob.js.map +1 -0
- package/dist/harness/tools/builtin/process-bg.d.ts +72 -0
- package/dist/harness/tools/builtin/process-bg.d.ts.map +1 -0
- package/dist/harness/tools/builtin/process-bg.js +360 -0
- package/dist/harness/tools/builtin/process-bg.js.map +1 -0
- package/dist/harness/tools/builtin/process-tools.d.ts +46 -0
- package/dist/harness/tools/builtin/process-tools.d.ts.map +1 -0
- package/dist/harness/tools/builtin/process-tools.js +263 -0
- package/dist/harness/tools/builtin/process-tools.js.map +1 -0
- package/dist/harness/tools/builtin/read-media.d.ts +10 -0
- package/dist/harness/tools/builtin/read-media.d.ts.map +1 -0
- package/dist/harness/tools/builtin/read-media.js +128 -0
- package/dist/harness/tools/builtin/read-media.js.map +1 -0
- package/dist/harness/tools/builtin/read-tools.d.ts +29 -0
- package/dist/harness/tools/builtin/read-tools.d.ts.map +1 -0
- package/dist/harness/tools/builtin/read-tools.js +329 -0
- package/dist/harness/tools/builtin/read-tools.js.map +1 -0
- package/dist/harness/tools/builtin/shared.d.ts +47 -0
- package/dist/harness/tools/builtin/shared.d.ts.map +1 -0
- package/dist/harness/tools/builtin/shared.js +94 -0
- package/dist/harness/tools/builtin/shared.js.map +1 -0
- package/dist/harness/tools/builtin/todo.d.ts +38 -0
- package/dist/harness/tools/builtin/todo.d.ts.map +1 -0
- package/dist/harness/tools/builtin/todo.js +55 -0
- package/dist/harness/tools/builtin/todo.js.map +1 -0
- package/dist/harness/tools/builtin/web-common.d.ts +18 -0
- package/dist/harness/tools/builtin/web-common.d.ts.map +1 -0
- package/dist/harness/tools/builtin/web-common.js +53 -0
- package/dist/harness/tools/builtin/web-common.js.map +1 -0
- package/dist/harness/tools/builtin/web-fetch.d.ts +33 -0
- package/dist/harness/tools/builtin/web-fetch.d.ts.map +1 -0
- package/dist/harness/tools/builtin/web-fetch.js +173 -0
- package/dist/harness/tools/builtin/web-fetch.js.map +1 -0
- package/dist/harness/tools/builtin/web-html.d.ts +14 -0
- package/dist/harness/tools/builtin/web-html.d.ts.map +1 -0
- package/dist/harness/tools/builtin/web-html.js +314 -0
- package/dist/harness/tools/builtin/web-html.js.map +1 -0
- package/dist/harness/tools/builtin/web-net.d.ts +59 -0
- package/dist/harness/tools/builtin/web-net.d.ts.map +1 -0
- package/dist/harness/tools/builtin/web-net.js +347 -0
- package/dist/harness/tools/builtin/web-net.js.map +1 -0
- package/dist/harness/tools/builtin/web-search.d.ts +40 -0
- package/dist/harness/tools/builtin/web-search.d.ts.map +1 -0
- package/dist/harness/tools/builtin/web-search.js +60 -0
- package/dist/harness/tools/builtin/web-search.js.map +1 -0
- package/dist/harness/tools/builtin/web-state.d.ts +67 -0
- package/dist/harness/tools/builtin/web-state.d.ts.map +1 -0
- package/dist/harness/tools/builtin/web-state.js +227 -0
- package/dist/harness/tools/builtin/web-state.js.map +1 -0
- package/dist/harness/tools/builtin/write-tools.d.ts +18 -0
- package/dist/harness/tools/builtin/write-tools.d.ts.map +1 -0
- package/dist/harness/tools/builtin/write-tools.js +335 -0
- package/dist/harness/tools/builtin/write-tools.js.map +1 -0
- package/dist/harness/tools/environment.d.ts +9 -0
- package/dist/harness/tools/environment.d.ts.map +1 -0
- package/dist/harness/tools/environment.js +59 -0
- package/dist/harness/tools/environment.js.map +1 -0
- package/dist/harness/tools/file-ledger.d.ts +9 -0
- package/dist/harness/tools/file-ledger.d.ts.map +1 -0
- package/dist/harness/tools/file-ledger.js +26 -0
- package/dist/harness/tools/file-ledger.js.map +1 -0
- package/dist/harness/tools/gateway.d.ts +52 -0
- package/dist/harness/tools/gateway.d.ts.map +1 -0
- package/dist/harness/tools/gateway.js +435 -0
- package/dist/harness/tools/gateway.js.map +1 -0
- package/dist/harness/tools/index.d.ts +20 -0
- package/dist/harness/tools/index.d.ts.map +1 -0
- package/dist/harness/tools/index.js +17 -0
- package/dist/harness/tools/index.js.map +1 -0
- package/dist/harness/tools/patch.d.ts +51 -0
- package/dist/harness/tools/patch.d.ts.map +1 -0
- package/dist/harness/tools/patch.js +450 -0
- package/dist/harness/tools/patch.js.map +1 -0
- package/dist/harness/tools/process.d.ts +28 -0
- package/dist/harness/tools/process.d.ts.map +1 -0
- package/dist/harness/tools/process.js +263 -0
- package/dist/harness/tools/process.js.map +1 -0
- package/dist/harness/tools/redaction.d.ts +26 -0
- package/dist/harness/tools/redaction.d.ts.map +1 -0
- package/dist/harness/tools/redaction.js +77 -0
- package/dist/harness/tools/redaction.js.map +1 -0
- package/dist/harness/tools/registry.d.ts +26 -0
- package/dist/harness/tools/registry.d.ts.map +1 -0
- package/dist/harness/tools/registry.js +57 -0
- package/dist/harness/tools/registry.js.map +1 -0
- package/dist/harness/tools/sandbox.d.ts +23 -0
- package/dist/harness/tools/sandbox.d.ts.map +1 -0
- package/dist/harness/tools/sandbox.js +117 -0
- package/dist/harness/tools/sandbox.js.map +1 -0
- package/dist/harness/tools/testing.d.ts +42 -0
- package/dist/harness/tools/testing.d.ts.map +1 -0
- package/dist/harness/tools/testing.js +143 -0
- package/dist/harness/tools/testing.js.map +1 -0
- package/dist/harness/tools/text-file.d.ts +38 -0
- package/dist/harness/tools/text-file.d.ts.map +1 -0
- package/dist/harness/tools/text-file.js +90 -0
- package/dist/harness/tools/text-file.js.map +1 -0
- package/dist/harness/tools/windows-launch.d.ts +52 -0
- package/dist/harness/tools/windows-launch.d.ts.map +1 -0
- package/dist/harness/tools/windows-launch.js +261 -0
- package/dist/harness/tools/windows-launch.js.map +1 -0
- package/dist/harness/tools/workspace-path.d.ts +34 -0
- package/dist/harness/tools/workspace-path.d.ts.map +1 -0
- package/dist/harness/tools/workspace-path.js +133 -0
- package/dist/harness/tools/workspace-path.js.map +1 -0
- package/dist/harness/tui/approvals.d.ts +44 -0
- package/dist/harness/tui/approvals.d.ts.map +1 -0
- package/dist/harness/tui/approvals.js +127 -0
- package/dist/harness/tui/approvals.js.map +1 -0
- package/dist/harness/tui/auth-interaction.d.ts +36 -0
- package/dist/harness/tui/auth-interaction.d.ts.map +1 -0
- package/dist/harness/tui/auth-interaction.js +76 -0
- package/dist/harness/tui/auth-interaction.js.map +1 -0
- package/dist/harness/tui/choice-modal.d.ts +58 -0
- package/dist/harness/tui/choice-modal.d.ts.map +1 -0
- package/dist/harness/tui/choice-modal.js +244 -0
- package/dist/harness/tui/choice-modal.js.map +1 -0
- package/dist/harness/tui/conversation-view.d.ts +250 -0
- package/dist/harness/tui/conversation-view.d.ts.map +1 -0
- package/dist/harness/tui/conversation-view.js +1115 -0
- package/dist/harness/tui/conversation-view.js.map +1 -0
- package/dist/harness/tui/describe.d.ts +21 -0
- package/dist/harness/tui/describe.d.ts.map +1 -0
- package/dist/harness/tui/describe.js +110 -0
- package/dist/harness/tui/describe.js.map +1 -0
- package/dist/harness/tui/index.d.ts +30 -0
- package/dist/harness/tui/index.d.ts.map +1 -0
- package/dist/harness/tui/index.js +26 -0
- package/dist/harness/tui/index.js.map +1 -0
- package/dist/harness/tui/input/attachments.d.ts +20 -0
- package/dist/harness/tui/input/attachments.d.ts.map +1 -0
- package/dist/harness/tui/input/attachments.js +100 -0
- package/dist/harness/tui/input/attachments.js.map +1 -0
- package/dist/harness/tui/input/autocomplete.d.ts +41 -0
- package/dist/harness/tui/input/autocomplete.d.ts.map +1 -0
- package/dist/harness/tui/input/autocomplete.js +85 -0
- package/dist/harness/tui/input/autocomplete.js.map +1 -0
- package/dist/harness/tui/input/clipboard.d.ts +44 -0
- package/dist/harness/tui/input/clipboard.d.ts.map +1 -0
- package/dist/harness/tui/input/clipboard.js +181 -0
- package/dist/harness/tui/input/clipboard.js.map +1 -0
- package/dist/harness/tui/input/commands.d.ts +23 -0
- package/dist/harness/tui/input/commands.d.ts.map +1 -0
- package/dist/harness/tui/input/commands.js +71 -0
- package/dist/harness/tui/input/commands.js.map +1 -0
- package/dist/harness/tui/input/file-index.d.ts +49 -0
- package/dist/harness/tui/input/file-index.d.ts.map +1 -0
- package/dist/harness/tui/input/file-index.js +170 -0
- package/dist/harness/tui/input/file-index.js.map +1 -0
- package/dist/harness/tui/input/index.d.ts +8 -0
- package/dist/harness/tui/input/index.d.ts.map +1 -0
- package/dist/harness/tui/input/index.js +8 -0
- package/dist/harness/tui/input/index.js.map +1 -0
- package/dist/harness/tui/input/mouse.d.ts +68 -0
- package/dist/harness/tui/input/mouse.d.ts.map +1 -0
- package/dist/harness/tui/input/mouse.js +141 -0
- package/dist/harness/tui/input/mouse.js.map +1 -0
- package/dist/harness/tui/interrupt.d.ts +25 -0
- package/dist/harness/tui/interrupt.d.ts.map +1 -0
- package/dist/harness/tui/interrupt.js +49 -0
- package/dist/harness/tui/interrupt.js.map +1 -0
- package/dist/harness/tui/jsonl-renderer.d.ts +68 -0
- package/dist/harness/tui/jsonl-renderer.d.ts.map +1 -0
- package/dist/harness/tui/jsonl-renderer.js +172 -0
- package/dist/harness/tui/jsonl-renderer.js.map +1 -0
- package/dist/harness/tui/line-source.d.ts +39 -0
- package/dist/harness/tui/line-source.d.ts.map +1 -0
- package/dist/harness/tui/line-source.js +137 -0
- package/dist/harness/tui/line-source.js.map +1 -0
- package/dist/harness/tui/logo-art.d.ts +9 -0
- package/dist/harness/tui/logo-art.d.ts.map +1 -0
- package/dist/harness/tui/logo-art.js +24 -0
- package/dist/harness/tui/logo-art.js.map +1 -0
- package/dist/harness/tui/logo.d.ts +28 -0
- package/dist/harness/tui/logo.d.ts.map +1 -0
- package/dist/harness/tui/logo.js +88 -0
- package/dist/harness/tui/logo.js.map +1 -0
- package/dist/harness/tui/open-browser.d.ts +17 -0
- package/dist/harness/tui/open-browser.d.ts.map +1 -0
- package/dist/harness/tui/open-browser.js +45 -0
- package/dist/harness/tui/open-browser.js.map +1 -0
- package/dist/harness/tui/output-chunks.d.ts +8 -0
- package/dist/harness/tui/output-chunks.d.ts.map +1 -0
- package/dist/harness/tui/output-chunks.js +48 -0
- package/dist/harness/tui/output-chunks.js.map +1 -0
- package/dist/harness/tui/panels/index.d.ts +2 -0
- package/dist/harness/tui/panels/index.d.ts.map +1 -0
- package/dist/harness/tui/panels/index.js +2 -0
- package/dist/harness/tui/panels/index.js.map +1 -0
- package/dist/harness/tui/panels/panel-view.d.ts +98 -0
- package/dist/harness/tui/panels/panel-view.d.ts.map +1 -0
- package/dist/harness/tui/panels/panel-view.js +596 -0
- package/dist/harness/tui/panels/panel-view.js.map +1 -0
- package/dist/harness/tui/pi-tui-renderer.d.ts +363 -0
- package/dist/harness/tui/pi-tui-renderer.d.ts.map +1 -0
- package/dist/harness/tui/pi-tui-renderer.js +2696 -0
- package/dist/harness/tui/pi-tui-renderer.js.map +1 -0
- package/dist/harness/tui/plain-line-renderer.d.ts +102 -0
- package/dist/harness/tui/plain-line-renderer.d.ts.map +1 -0
- package/dist/harness/tui/plain-line-renderer.js +491 -0
- package/dist/harness/tui/plain-line-renderer.js.map +1 -0
- package/dist/harness/tui/render-queue.d.ts +34 -0
- package/dist/harness/tui/render-queue.d.ts.map +1 -0
- package/dist/harness/tui/render-queue.js +92 -0
- package/dist/harness/tui/render-queue.js.map +1 -0
- package/dist/harness/tui/sanitize.d.ts +9 -0
- package/dist/harness/tui/sanitize.d.ts.map +1 -0
- package/dist/harness/tui/sanitize.js +31 -0
- package/dist/harness/tui/sanitize.js.map +1 -0
- package/dist/harness/tui/style.d.ts +54 -0
- package/dist/harness/tui/style.d.ts.map +1 -0
- package/dist/harness/tui/style.js +64 -0
- package/dist/harness/tui/style.js.map +1 -0
- package/dist/harness/tui/terminal-lifecycle.d.ts +49 -0
- package/dist/harness/tui/terminal-lifecycle.d.ts.map +1 -0
- package/dist/harness/tui/terminal-lifecycle.js +100 -0
- package/dist/harness/tui/terminal-lifecycle.js.map +1 -0
- package/dist/harness/tui/theme.d.ts +77 -0
- package/dist/harness/tui/theme.d.ts.map +1 -0
- package/dist/harness/tui/theme.js +501 -0
- package/dist/harness/tui/theme.js.map +1 -0
- package/dist/harness/tui/tool-cards.d.ts +35 -0
- package/dist/harness/tui/tool-cards.d.ts.map +1 -0
- package/dist/harness/tui/tool-cards.js +122 -0
- package/dist/harness/tui/tool-cards.js.map +1 -0
- package/dist/harness/tui/tool-row.d.ts +51 -0
- package/dist/harness/tui/tool-row.d.ts.map +1 -0
- package/dist/harness/tui/tool-row.js +98 -0
- package/dist/harness/tui/tool-row.js.map +1 -0
- package/dist/harness/tui/views/board.d.ts +49 -0
- package/dist/harness/tui/views/board.d.ts.map +1 -0
- package/dist/harness/tui/views/board.js +293 -0
- package/dist/harness/tui/views/board.js.map +1 -0
- package/dist/harness/tui/views/cards.d.ts +8 -0
- package/dist/harness/tui/views/cards.d.ts.map +1 -0
- package/dist/harness/tui/views/cards.js +206 -0
- package/dist/harness/tui/views/cards.js.map +1 -0
- package/dist/harness/tui/views/components.d.ts +101 -0
- package/dist/harness/tui/views/components.d.ts.map +1 -0
- package/dist/harness/tui/views/components.js +186 -0
- package/dist/harness/tui/views/components.js.map +1 -0
- package/dist/harness/tui/views/diff.d.ts +11 -0
- package/dist/harness/tui/views/diff.d.ts.map +1 -0
- package/dist/harness/tui/views/diff.js +150 -0
- package/dist/harness/tui/views/diff.js.map +1 -0
- package/dist/harness/tui/views/graph.d.ts +49 -0
- package/dist/harness/tui/views/graph.d.ts.map +1 -0
- package/dist/harness/tui/views/graph.js +361 -0
- package/dist/harness/tui/views/graph.js.map +1 -0
- package/dist/harness/tui/views/index.d.ts +15 -0
- package/dist/harness/tui/views/index.d.ts.map +1 -0
- package/dist/harness/tui/views/index.js +15 -0
- package/dist/harness/tui/views/index.js.map +1 -0
- package/dist/harness/tui/views/kit.d.ts +112 -0
- package/dist/harness/tui/views/kit.d.ts.map +1 -0
- package/dist/harness/tui/views/kit.js +282 -0
- package/dist/harness/tui/views/kit.js.map +1 -0
- package/dist/harness/tui/views/trust-cards.d.ts +27 -0
- package/dist/harness/tui/views/trust-cards.d.ts.map +1 -0
- package/dist/harness/tui/views/trust-cards.js +181 -0
- package/dist/harness/tui/views/trust-cards.js.map +1 -0
- package/dist/harness/tui/views/usage.d.ts +4 -0
- package/dist/harness/tui/views/usage.d.ts.map +1 -0
- package/dist/harness/tui/views/usage.js +182 -0
- package/dist/harness/tui/views/usage.js.map +1 -0
- package/dist/harness/tui/views/worker.d.ts +47 -0
- package/dist/harness/tui/views/worker.d.ts.map +1 -0
- package/dist/harness/tui/views/worker.js +221 -0
- package/dist/harness/tui/views/worker.js.map +1 -0
- package/dist/harness/tui/welcome.d.ts +97 -0
- package/dist/harness/tui/welcome.d.ts.map +1 -0
- package/dist/harness/tui/welcome.js +271 -0
- package/dist/harness/tui/welcome.js.map +1 -0
- package/dist/harness/tui/wrap.d.ts +26 -0
- package/dist/harness/tui/wrap.d.ts.map +1 -0
- package/dist/harness/tui/wrap.js +38 -0
- package/dist/harness/tui/wrap.js.map +1 -0
- package/dist/infrastructure/build-info.d.ts +5 -0
- package/dist/infrastructure/build-info.d.ts.map +1 -0
- package/dist/infrastructure/build-info.js +21 -0
- package/dist/infrastructure/build-info.js.map +1 -0
- package/dist/infrastructure/frontmatter.d.ts +25 -0
- package/dist/infrastructure/frontmatter.d.ts.map +1 -0
- package/dist/infrastructure/frontmatter.js +75 -0
- package/dist/infrastructure/frontmatter.js.map +1 -0
- package/dist/templates/agent-manifests.d.ts +19 -0
- package/dist/templates/agent-manifests.d.ts.map +1 -0
- package/dist/templates/agent-manifests.js +302 -0
- package/dist/templates/agent-manifests.js.map +1 -0
- package/dist/templates/base-skills.d.ts +23 -0
- package/dist/templates/base-skills.d.ts.map +1 -0
- package/dist/templates/base-skills.js +477 -0
- package/dist/templates/base-skills.js.map +1 -0
- package/dist/templates/skill-creator-skill.d.ts +23 -0
- package/dist/templates/skill-creator-skill.d.ts.map +1 -0
- package/dist/templates/skill-creator-skill.js +235 -0
- package/dist/templates/skill-creator-skill.js.map +1 -0
- package/dist/templates/skill-references.d.ts +13 -0
- package/dist/templates/skill-references.d.ts.map +1 -0
- package/dist/templates/skill-references.js +280 -0
- package/dist/templates/skill-references.js.map +1 -0
- package/dist/templates/structure-templates.d.ts.map +1 -1
- package/dist/templates/structure-templates.js +20 -144
- package/dist/templates/structure-templates.js.map +1 -1
- package/dist/templates/task-conductor-skill.d.ts +1 -1
- package/dist/templates/task-conductor-skill.d.ts.map +1 -1
- package/dist/templates/task-conductor-skill.js +50 -22
- package/dist/templates/task-conductor-skill.js.map +1 -1
- package/package.json +8 -2
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP start failures in words a person reads at a glance. The raw error (protocol text, JSON-RPC
|
|
3
|
+
* bodies, stderr) goes to the server's log and the `/mcp` detail view, never to the first screen.
|
|
4
|
+
*/
|
|
5
|
+
export class McpStartError extends Error {
|
|
6
|
+
kind;
|
|
7
|
+
/** Short, human text: "command not found (npx)", "needs sign-in". */
|
|
8
|
+
friendly;
|
|
9
|
+
/** Everything known (raw message, status, stderr tail), for `/mcp <name>` and the log. */
|
|
10
|
+
detail;
|
|
11
|
+
constructor(server, kind, friendly, detail) {
|
|
12
|
+
super(`${server}: ${friendly}`);
|
|
13
|
+
this.name = "McpStartError";
|
|
14
|
+
this.kind = kind;
|
|
15
|
+
this.friendly = friendly;
|
|
16
|
+
this.detail = detail;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const AUTH_PATTERN = /\b401\b|unauthori[sz]ed|authentication required|not authenticated|invalid[_ ]token|missing (?:bearer|access) token|sign[- ]?in required|login required|McpSignInRequiredError|needs sign-in/i;
|
|
20
|
+
/** True when a start failure means "the server wants credentials" rather than "it is broken". */
|
|
21
|
+
export function isAuthFailure(error) {
|
|
22
|
+
if (typeof error === "object" && error !== null) {
|
|
23
|
+
const code = error.code;
|
|
24
|
+
if (code === 401)
|
|
25
|
+
return true;
|
|
26
|
+
const name = error.name;
|
|
27
|
+
if (name === "UnauthorizedError" || name === "McpSignInRequiredError")
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
const text = error instanceof Error ? `${error.name} ${error.message}` : String(error);
|
|
31
|
+
return AUTH_PATTERN.test(text);
|
|
32
|
+
}
|
|
33
|
+
/** One short reason for a failure that is not about sign-in. */
|
|
34
|
+
export function friendlyFailure(error, context) {
|
|
35
|
+
if (context.timedOut)
|
|
36
|
+
return `did not start within ${Math.round(context.timeoutMs / 1000)} s`;
|
|
37
|
+
const code = typeof error === "object" && error !== null ? error.code : undefined;
|
|
38
|
+
const text = error instanceof Error ? error.message : String(error);
|
|
39
|
+
const host = hostOf(context.url);
|
|
40
|
+
if (code === "ENOENT" || /\bENOENT\b|not recognized as an internal or external command|command not found/i.test(text))
|
|
41
|
+
return `command not found${context.command === undefined ? "" : ` (${context.command})`}`;
|
|
42
|
+
if (code === 401 || isAuthFailure(error))
|
|
43
|
+
return context.configuredCredentials ? "rejected the configured credentials" : "needs sign-in";
|
|
44
|
+
if (code === 403 || /\b403\b|forbidden/i.test(text))
|
|
45
|
+
return "access denied (403)";
|
|
46
|
+
if (code === 404 || /\b404\b|not found/i.test(text))
|
|
47
|
+
return `endpoint not found${host === undefined ? "" : ` at ${host}`} (404)`;
|
|
48
|
+
if (typeof code === "number" && code >= 500)
|
|
49
|
+
return `the server had an error (${code})`;
|
|
50
|
+
if (/ECONNREFUSED|ENOTFOUND|EAI_AGAIN|ETIMEDOUT|ECONNRESET|fetch failed|network/i.test(text))
|
|
51
|
+
return `could not reach ${host ?? "the server"}`;
|
|
52
|
+
if (/connection closed|closed the connection|exited|EPIPE/i.test(text))
|
|
53
|
+
return "the server exited while starting";
|
|
54
|
+
const first = text.split(/\r?\n/)[0]?.replace(/\{.*$/, "").replace(/:\s*$/, "").trim() ?? "";
|
|
55
|
+
return first === "" ? "could not start" : first.length > 70 ? `${first.slice(0, 67)}...` : first;
|
|
56
|
+
}
|
|
57
|
+
function hostOf(url) {
|
|
58
|
+
if (url === undefined)
|
|
59
|
+
return undefined;
|
|
60
|
+
try {
|
|
61
|
+
return new URL(url).host;
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/harness/mcp/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtB,IAAI,CAAiB;IACrC,qEAAqE;IACrD,QAAQ,CAAS;IACjC,0FAA0F;IAC1E,MAAM,CAAS;IAE/B,YAAmB,MAAc,EAAE,IAAoB,EAAE,QAAgB,EAAE,MAAc;QACvF,KAAK,CAAC,GAAG,MAAM,KAAK,QAAQ,EAAE,CAAC,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAED,MAAM,YAAY,GAAG,8LAA8L,CAAC;AAEpN,iGAAiG;AACjG,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,MAAM,IAAI,GAAI,KAA4B,CAAC,IAAI,CAAC;QAChD,IAAI,IAAI,KAAK,GAAG;YAAE,OAAO,IAAI,CAAC;QAC9B,MAAM,IAAI,GAAI,KAA4B,CAAC,IAAI,CAAC;QAChD,IAAI,IAAI,KAAK,mBAAmB,IAAI,IAAI,KAAK,wBAAwB;YAAE,OAAO,IAAI,CAAC;IACrF,CAAC;IACD,MAAM,IAAI,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,IAAI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AS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,QAAQ,CAAC;IACjI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,IAAI,GAAG;QAAE,OAAO,4BAA4B,IAAI,GAAG,CAAC;IACxF,IAAI,6EAA6E,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,mBAAmB,IAAI,IAAI,YAAY,EAAE,CAAC;IAC/I,IAAI,uDAAuD,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,kCAAkC,CAAC;IAClH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;IAC7F,OAAO,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AACnG,CAAC;AAED,SAAS,MAAM,CAAC,GAAuB;IACrC,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** K3 — MCP client: external MCP servers (stdio, streamable HTTP) as gateway-governed tools. */
|
|
2
|
+
export { createMcpApprovalStore, MCP_APPROVALS_FILE, type McpApprovalStore } from "./approvals.ts";
|
|
3
|
+
export { McpConnection, mcpLogFile, type McpCallResult, type McpToolInfo } from "./client.ts";
|
|
4
|
+
export { defaultMcpRoles, expandVariables, MCP_SERVER_NAME_PATTERN, MCP_STARTUP_MODES, MCP_TRUST_LEVELS, mcpConfigSchema, mcpServerEntrySchema, mergeServers, modelToolName, parseMcpServerEntry, readMcpJson, toDefinition, type McpConfig, type McpServerDefinition, type McpServerEntry, type McpSource, type McpTrust, } from "./config.ts";
|
|
5
|
+
export { friendlyFailure, isAuthFailure, McpStartError, type McpFailureKind } from "./errors.ts";
|
|
6
|
+
export { McpManager, type McpManagerOptions, type McpServerState, type McpServerStatus } from "./manager.ts";
|
|
7
|
+
export { createMcpOAuthStore, loginMcpServer, mcpOAuthRef, McpSignInRequiredError, type McpLoginDependencies, type McpOAuthRecord, type McpOAuthStore } from "./oauth.ts";
|
|
8
|
+
export { createMcpTool, modelSchema, untrustedMcpEnvelope } from "./tools.ts";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/harness/mcp/index.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC9F,OAAO,EACL,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,QAAQ,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AACjG,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAC7G,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,WAAW,EAAE,sBAAsB,EAAE,KAAK,oBAAoB,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1K,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** K3 — MCP client: external MCP servers (stdio, streamable HTTP) as gateway-governed tools. */
|
|
2
|
+
export { createMcpApprovalStore, MCP_APPROVALS_FILE } from "./approvals.js";
|
|
3
|
+
export { McpConnection, mcpLogFile } from "./client.js";
|
|
4
|
+
export { defaultMcpRoles, expandVariables, MCP_SERVER_NAME_PATTERN, MCP_STARTUP_MODES, MCP_TRUST_LEVELS, mcpConfigSchema, mcpServerEntrySchema, mergeServers, modelToolName, parseMcpServerEntry, readMcpJson, toDefinition, } from "./config.js";
|
|
5
|
+
export { friendlyFailure, isAuthFailure, McpStartError } from "./errors.js";
|
|
6
|
+
export { McpManager } from "./manager.js";
|
|
7
|
+
export { createMcpOAuthStore, loginMcpServer, mcpOAuthRef, McpSignInRequiredError } from "./oauth.js";
|
|
8
|
+
export { createMcpTool, modelSchema, untrustedMcpEnvelope } from "./tools.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/harness/mcp/index.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAyB,MAAM,gBAAgB,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAwC,MAAM,aAAa,CAAC;AAC9F,OAAO,EACL,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,YAAY,GAMb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAuB,MAAM,aAAa,CAAC;AACjG,OAAO,EAAE,UAAU,EAAqE,MAAM,cAAc,CAAC;AAC7G,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,WAAW,EAAE,sBAAsB,EAAsE,MAAM,YAAY,CAAC;AAC1K,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { ToolRegistry } from "../contracts/index.ts";
|
|
2
|
+
import { type McpApprovalStore } from "./approvals.ts";
|
|
3
|
+
import { McpConnection, type McpToolInfo } from "./client.ts";
|
|
4
|
+
import { type McpConfig, type McpConfigProblem, type McpServerDefinition } from "./config.ts";
|
|
5
|
+
import { type McpLoginDependencies, type McpOAuthStore } from "./oauth.ts";
|
|
6
|
+
/**
|
|
7
|
+
* K3 MCP client: the servers of one runtime. It resolves the configured servers (user, project,
|
|
8
|
+
* `.mcp.json`), enforces the project approval gate, connects lazily or at session start, registers
|
|
9
|
+
* each server's tools in the ToolRegistry as `mcp__<server>__<tool>` and removes them again when a
|
|
10
|
+
* server is disabled or reconnected. Every server process ends with the session.
|
|
11
|
+
*/
|
|
12
|
+
export type McpServerState = "disabled" | "needs-approval" | "needs-auth" | "idle" | "starting" | "connected" | "failed";
|
|
13
|
+
export interface McpServerStatus {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly source: McpServerDefinition["source"];
|
|
16
|
+
readonly file: string;
|
|
17
|
+
readonly transport: McpServerDefinition["transport"];
|
|
18
|
+
readonly target: string;
|
|
19
|
+
readonly trust: McpServerDefinition["trust"];
|
|
20
|
+
readonly startup: McpServerDefinition["startup"];
|
|
21
|
+
readonly state: McpServerState;
|
|
22
|
+
/** Model-visible tool names (registered now). */
|
|
23
|
+
readonly tools: readonly string[];
|
|
24
|
+
/** Short, human reason ("needs sign-in", "command not found (npx)"). */
|
|
25
|
+
readonly error: string | undefined;
|
|
26
|
+
/** The raw failure (protocol text, stderr tail) for the /mcp detail view. */
|
|
27
|
+
readonly detail: string | undefined;
|
|
28
|
+
readonly logFile: string;
|
|
29
|
+
readonly missingVariables: readonly string[];
|
|
30
|
+
}
|
|
31
|
+
export interface McpManagerOptions {
|
|
32
|
+
readonly home: string;
|
|
33
|
+
readonly workspaceRoot: string;
|
|
34
|
+
/** Canonical workspace root (the trust store's form): project approvals bind to it. */
|
|
35
|
+
readonly workspaceKey: string;
|
|
36
|
+
readonly environment: Readonly<Record<string, string | undefined>>;
|
|
37
|
+
readonly registry: ToolRegistry;
|
|
38
|
+
readonly clientVersion: string;
|
|
39
|
+
readonly user: {
|
|
40
|
+
readonly config: McpConfig | undefined;
|
|
41
|
+
readonly file: string;
|
|
42
|
+
};
|
|
43
|
+
readonly project: {
|
|
44
|
+
readonly config: McpConfig | undefined;
|
|
45
|
+
readonly file: string;
|
|
46
|
+
};
|
|
47
|
+
readonly platform?: NodeJS.Platform;
|
|
48
|
+
/** An MCP result reached the model: untrusted content entered the turn. */
|
|
49
|
+
readonly onUntrustedContent?: () => void;
|
|
50
|
+
/** Secret-looking values from expanded env/headers join the gateway's redaction set. */
|
|
51
|
+
readonly addRedaction?: (value: string) => void;
|
|
52
|
+
readonly approvals?: McpApprovalStore;
|
|
53
|
+
/** K7: servers of enabled plugins (installed by the user or enabled in Claude Code): trusted like user servers. */
|
|
54
|
+
readonly plugins?: () => readonly McpServerDefinition[];
|
|
55
|
+
/** MCP OAuth sign-ins (Synorch's credential store); without it remote servers never use OAuth. */
|
|
56
|
+
readonly oauth?: McpOAuthStore;
|
|
57
|
+
/** False when the folder is not a project (the home folder, no git, no markers): project servers are not read. */
|
|
58
|
+
readonly projectScope?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export declare class McpManager {
|
|
61
|
+
private readonly options;
|
|
62
|
+
private readonly approvals;
|
|
63
|
+
private readonly logDirectory;
|
|
64
|
+
private readonly cacheDirectory;
|
|
65
|
+
private slots;
|
|
66
|
+
private loadProblems;
|
|
67
|
+
private loaded;
|
|
68
|
+
private closed;
|
|
69
|
+
constructor(options: McpManagerOptions);
|
|
70
|
+
/** Reads `.mcp.json` and resolves every server definition (no process is started). */
|
|
71
|
+
load(): Promise<void>;
|
|
72
|
+
get problems(): readonly McpConfigProblem[];
|
|
73
|
+
has(name: string): boolean;
|
|
74
|
+
definitions(): readonly McpServerDefinition[];
|
|
75
|
+
/** Project servers waiting for the user's one-time approval. */
|
|
76
|
+
pendingApprovals(): readonly McpServerDefinition[];
|
|
77
|
+
/**
|
|
78
|
+
* Session start: every enabled, approved server either connects now (`startup: session`, or no
|
|
79
|
+
* cached tool list yet) or registers its cached tools and connects at first use. Never throws;
|
|
80
|
+
* failures are kept for `/mcp`. Resolves when every eager connection settled.
|
|
81
|
+
*/
|
|
82
|
+
startSession(): Promise<void>;
|
|
83
|
+
status(): McpServerStatus[];
|
|
84
|
+
/** The server's tools as the server names them (connected servers only). */
|
|
85
|
+
serverTools(name: string): readonly McpToolInfo[];
|
|
86
|
+
/** The live connection for a tool call: connects (or reconnects after a crash) on demand. */
|
|
87
|
+
connection(name: string, signal?: AbortSignal): Promise<McpConnection>;
|
|
88
|
+
reconnect(name: string): Promise<McpServerStatus | undefined>;
|
|
89
|
+
/** `/mcp login <name>`: MCP OAuth in the browser, then a fresh start with the stored sign-in. */
|
|
90
|
+
login(name: string, deps: Omit<McpLoginDependencies, "store">): Promise<McpServerStatus | undefined>;
|
|
91
|
+
/** `/mcp logout <name>`: forgets the stored sign-in and stops the server. */
|
|
92
|
+
logout(name: string): Promise<boolean>;
|
|
93
|
+
/** Session-scoped enable/disable (the CLI also persists it for user servers). */
|
|
94
|
+
setEnabled(name: string, enabled: boolean): Promise<boolean>;
|
|
95
|
+
/** Approves a project server's current definition for this workspace (user scope) and starts it. */
|
|
96
|
+
approve(name: string, start?: boolean): Promise<boolean>;
|
|
97
|
+
revoke(name: string): Promise<boolean>;
|
|
98
|
+
/**
|
|
99
|
+
* Claude Code native mode: the servers Claude should run itself (`--mcp-config`), in Claude's
|
|
100
|
+
* format; only enabled and approved ones. Claude's own permission prompts reach Synorch's broker.
|
|
101
|
+
*/
|
|
102
|
+
claudeServers(): Record<string, Record<string, unknown>>;
|
|
103
|
+
close(): Promise<void>;
|
|
104
|
+
killAllSync(): void;
|
|
105
|
+
private needsApproval;
|
|
106
|
+
private usable;
|
|
107
|
+
private stateOf;
|
|
108
|
+
private connect;
|
|
109
|
+
private register;
|
|
110
|
+
private stop;
|
|
111
|
+
private cacheFile;
|
|
112
|
+
private readCache;
|
|
113
|
+
private writeCache;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/harness/mcp/manager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAc,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAA4C,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAExI,OAAO,EAAuC,KAAK,oBAAoB,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhH;;;;;GAKG;AAEH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,gBAAgB,GAAG,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEzH,MAAM,WAAW,eAAe;IAC9B,QAAQ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B,OAAO,CAAC,SAAS;YAUH,UAAU;CASzB"}
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { createMcpApprovalStore } from "./approvals.js";
|
|
6
|
+
import { McpConnection, mcpLogFile } from "./client.js";
|
|
7
|
+
import { mergeServers, modelToolName, readMcpJson } from "./config.js";
|
|
8
|
+
import { McpStartError } from "./errors.js";
|
|
9
|
+
import { loginMcpServer, sessionAuthProvider } from "./oauth.js";
|
|
10
|
+
import { createMcpTool } from "./tools.js";
|
|
11
|
+
const cacheSchema = z.strictObject({
|
|
12
|
+
digest: z.string(),
|
|
13
|
+
tools: z.array(z.strictObject({ name: z.string(), description: z.string().optional(), inputSchema: z.record(z.string(), z.unknown()), annotations: z.record(z.string(), z.unknown()).optional() })),
|
|
14
|
+
});
|
|
15
|
+
const SECRET_NAME = /(?:KEY|TOKEN|SECRET|PASSWORD|PASSWD|CREDENTIAL|COOKIE|AUTH)/i;
|
|
16
|
+
export class McpManager {
|
|
17
|
+
options;
|
|
18
|
+
approvals;
|
|
19
|
+
logDirectory;
|
|
20
|
+
cacheDirectory;
|
|
21
|
+
slots = new Map();
|
|
22
|
+
loadProblems = [];
|
|
23
|
+
loaded = false;
|
|
24
|
+
closed = false;
|
|
25
|
+
constructor(options) {
|
|
26
|
+
this.options = options;
|
|
27
|
+
this.approvals = options.approvals ?? createMcpApprovalStore(options.home);
|
|
28
|
+
this.logDirectory = path.join(options.home, "logs", "mcp");
|
|
29
|
+
this.cacheDirectory = path.join(options.home, "mcp", "cache");
|
|
30
|
+
}
|
|
31
|
+
/** Reads `.mcp.json` and resolves every server definition (no process is started). */
|
|
32
|
+
async load() {
|
|
33
|
+
const projectScope = this.options.projectScope !== false;
|
|
34
|
+
const mcpJson = projectScope ? await readMcpJson(this.options.workspaceRoot, this.options.environment) : { servers: [], problems: [] };
|
|
35
|
+
const merged = mergeServers(this.options.user.config, this.options.user.file, projectScope ? this.options.project.config : undefined, this.options.project.file, mcpJson, this.options.environment, this.options.workspaceRoot, this.options.plugins?.() ?? []);
|
|
36
|
+
this.loadProblems = [...merged.problems];
|
|
37
|
+
const next = new Map();
|
|
38
|
+
for (const definition of merged.servers) {
|
|
39
|
+
const previous = this.slots.get(definition.name);
|
|
40
|
+
next.set(definition.name, previous !== undefined && previous.definition.digest === definition.digest ? { ...previous, definition } : { definition, sessionDisabled: false, connection: undefined, connecting: undefined, registered: [], error: undefined, detail: undefined, needsAuth: false });
|
|
41
|
+
for (const value of [...Object.entries(definition.env), ...Object.entries(definition.headers)]) {
|
|
42
|
+
if (SECRET_NAME.test(value[0]) && value[1].length >= 8)
|
|
43
|
+
this.options.addRedaction?.(value[1]);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
for (const [name, slot] of this.slots)
|
|
47
|
+
if (next.get(name) !== slot)
|
|
48
|
+
await this.stop(slot);
|
|
49
|
+
this.slots = next;
|
|
50
|
+
this.loaded = true;
|
|
51
|
+
}
|
|
52
|
+
get problems() {
|
|
53
|
+
return this.loadProblems;
|
|
54
|
+
}
|
|
55
|
+
has(name) {
|
|
56
|
+
return this.slots.has(name);
|
|
57
|
+
}
|
|
58
|
+
definitions() {
|
|
59
|
+
return [...this.slots.values()].map((slot) => slot.definition);
|
|
60
|
+
}
|
|
61
|
+
/** Project servers waiting for the user's one-time approval. */
|
|
62
|
+
pendingApprovals() {
|
|
63
|
+
return [...this.slots.values()].filter((slot) => slot.definition.enabled && this.needsApproval(slot.definition)).map((slot) => slot.definition);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Session start: every enabled, approved server either connects now (`startup: session`, or no
|
|
67
|
+
* cached tool list yet) or registers its cached tools and connects at first use. Never throws;
|
|
68
|
+
* failures are kept for `/mcp`. Resolves when every eager connection settled.
|
|
69
|
+
*/
|
|
70
|
+
async startSession() {
|
|
71
|
+
if (!this.loaded)
|
|
72
|
+
await this.load();
|
|
73
|
+
const eager = [];
|
|
74
|
+
for (const slot of this.slots.values()) {
|
|
75
|
+
if (!this.usable(slot))
|
|
76
|
+
continue;
|
|
77
|
+
const cached = slot.definition.startup === "lazy" ? this.readCache(slot.definition) : undefined;
|
|
78
|
+
if (cached !== undefined) {
|
|
79
|
+
this.register(slot, cached);
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
eager.push(this.connect(slot).catch(() => undefined));
|
|
83
|
+
}
|
|
84
|
+
await Promise.all(eager);
|
|
85
|
+
}
|
|
86
|
+
status() {
|
|
87
|
+
return [...this.slots.values()].map((slot) => {
|
|
88
|
+
const definition = slot.definition;
|
|
89
|
+
return {
|
|
90
|
+
name: definition.name,
|
|
91
|
+
source: definition.source,
|
|
92
|
+
file: definition.file,
|
|
93
|
+
transport: definition.transport,
|
|
94
|
+
target: definition.transport === "stdio" ? [definition.command ?? "", ...definition.args].join(" ") : (definition.url ?? ""),
|
|
95
|
+
trust: definition.trust,
|
|
96
|
+
startup: definition.startup,
|
|
97
|
+
state: this.stateOf(slot),
|
|
98
|
+
tools: [...slot.registered],
|
|
99
|
+
error: slot.error,
|
|
100
|
+
detail: slot.detail,
|
|
101
|
+
logFile: mcpLogFile(this.logDirectory, definition.name),
|
|
102
|
+
missingVariables: definition.missingVariables,
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/** The server's tools as the server names them (connected servers only). */
|
|
107
|
+
serverTools(name) {
|
|
108
|
+
return this.slots.get(name)?.connection?.tools ?? [];
|
|
109
|
+
}
|
|
110
|
+
/** The live connection for a tool call: connects (or reconnects after a crash) on demand. */
|
|
111
|
+
async connection(name, signal) {
|
|
112
|
+
const slot = this.slots.get(name);
|
|
113
|
+
if (slot === undefined)
|
|
114
|
+
throw new Error(`no MCP server named ${name}`);
|
|
115
|
+
if (!slot.definition.enabled || slot.sessionDisabled)
|
|
116
|
+
throw new Error(`${name} is disabled (/mcp enable ${name})`);
|
|
117
|
+
if (this.needsApproval(slot.definition))
|
|
118
|
+
throw new Error(`${name} is a project server that has not been approved (/mcp approve ${name})`);
|
|
119
|
+
if (slot.needsAuth && slot.connecting === undefined)
|
|
120
|
+
throw new Error(`${name} needs sign-in (/mcp login ${name})`);
|
|
121
|
+
if (slot.connection !== undefined && !slot.connection.isClosed)
|
|
122
|
+
return slot.connection;
|
|
123
|
+
const pending = this.connect(slot);
|
|
124
|
+
if (signal === undefined)
|
|
125
|
+
return pending;
|
|
126
|
+
return Promise.race([
|
|
127
|
+
pending,
|
|
128
|
+
new Promise((_resolve, reject) => {
|
|
129
|
+
if (signal.aborted)
|
|
130
|
+
reject(new Error("cancelled"));
|
|
131
|
+
signal.addEventListener("abort", () => reject(new Error("cancelled")), { once: true });
|
|
132
|
+
}),
|
|
133
|
+
]);
|
|
134
|
+
}
|
|
135
|
+
async reconnect(name) {
|
|
136
|
+
const slot = this.slots.get(name);
|
|
137
|
+
if (slot === undefined)
|
|
138
|
+
return undefined;
|
|
139
|
+
await this.stop(slot);
|
|
140
|
+
slot.error = undefined;
|
|
141
|
+
slot.detail = undefined;
|
|
142
|
+
slot.needsAuth = false;
|
|
143
|
+
if (this.usable(slot))
|
|
144
|
+
await this.connect(slot).catch(() => undefined);
|
|
145
|
+
return this.status().find((entry) => entry.name === name);
|
|
146
|
+
}
|
|
147
|
+
/** `/mcp login <name>`: MCP OAuth in the browser, then a fresh start with the stored sign-in. */
|
|
148
|
+
async login(name, deps) {
|
|
149
|
+
const slot = this.slots.get(name);
|
|
150
|
+
if (slot === undefined)
|
|
151
|
+
return undefined;
|
|
152
|
+
const store = this.options.oauth;
|
|
153
|
+
if (store === undefined)
|
|
154
|
+
throw new Error("sign-in is not available here (no credential store)");
|
|
155
|
+
await loginMcpServer(slot.definition, { ...deps, store });
|
|
156
|
+
return this.reconnect(name);
|
|
157
|
+
}
|
|
158
|
+
/** `/mcp logout <name>`: forgets the stored sign-in and stops the server. */
|
|
159
|
+
async logout(name) {
|
|
160
|
+
const slot = this.slots.get(name);
|
|
161
|
+
const removed = (await this.options.oauth?.remove(name).catch(() => false)) ?? false;
|
|
162
|
+
if (slot !== undefined) {
|
|
163
|
+
await this.stop(slot);
|
|
164
|
+
slot.error = undefined;
|
|
165
|
+
slot.detail = undefined;
|
|
166
|
+
slot.needsAuth = false;
|
|
167
|
+
}
|
|
168
|
+
return removed;
|
|
169
|
+
}
|
|
170
|
+
/** Session-scoped enable/disable (the CLI also persists it for user servers). */
|
|
171
|
+
async setEnabled(name, enabled) {
|
|
172
|
+
const slot = this.slots.get(name);
|
|
173
|
+
if (slot === undefined)
|
|
174
|
+
return false;
|
|
175
|
+
slot.sessionDisabled = !enabled;
|
|
176
|
+
if (!enabled) {
|
|
177
|
+
await this.stop(slot);
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
if (!slot.definition.enabled)
|
|
181
|
+
slot.definition = { ...slot.definition, enabled: true };
|
|
182
|
+
if (this.usable(slot) && slot.registered.length === 0)
|
|
183
|
+
await this.connect(slot).catch(() => undefined);
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
/** Approves a project server's current definition for this workspace (user scope) and starts it. */
|
|
187
|
+
async approve(name, start = true) {
|
|
188
|
+
const slot = this.slots.get(name);
|
|
189
|
+
if (slot === undefined || slot.definition.source === "user" || slot.definition.source === "plugin" || slot.definition.source === "claude-plugin")
|
|
190
|
+
return false;
|
|
191
|
+
await this.approvals.approve(this.options.workspaceKey, name, slot.definition.digest);
|
|
192
|
+
if (start && this.usable(slot) && !this.closed)
|
|
193
|
+
await this.connect(slot).catch(() => undefined);
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
async revoke(name) {
|
|
197
|
+
const slot = this.slots.get(name);
|
|
198
|
+
const removed = await this.approvals.revoke(this.options.workspaceKey, name);
|
|
199
|
+
if (slot !== undefined)
|
|
200
|
+
await this.stop(slot);
|
|
201
|
+
return removed;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Claude Code native mode: the servers Claude should run itself (`--mcp-config`), in Claude's
|
|
205
|
+
* format; only enabled and approved ones. Claude's own permission prompts reach Synorch's broker.
|
|
206
|
+
*/
|
|
207
|
+
claudeServers() {
|
|
208
|
+
const servers = {};
|
|
209
|
+
for (const slot of this.slots.values()) {
|
|
210
|
+
if (!this.usable(slot))
|
|
211
|
+
continue;
|
|
212
|
+
const definition = slot.definition;
|
|
213
|
+
// K7 (verified on 2.1.282): under `--strict-mcp-config` Claude does NOT load its enabled plugins' MCP servers,
|
|
214
|
+
// so they are passed here under Claude's own name (`plugin:<plugin>:<server>`): same tool names and permission rules, no duplicate.
|
|
215
|
+
servers[definition.claudeName ?? definition.name] =
|
|
216
|
+
definition.transport === "stdio"
|
|
217
|
+
? { type: "stdio", command: definition.command, args: [...definition.args], env: { ...definition.env } }
|
|
218
|
+
: { type: definition.transport, url: definition.url, headers: { ...definition.headers } };
|
|
219
|
+
}
|
|
220
|
+
return servers;
|
|
221
|
+
}
|
|
222
|
+
async close() {
|
|
223
|
+
this.closed = true;
|
|
224
|
+
await Promise.all([...this.slots.values()].map((slot) => this.stop(slot, false)));
|
|
225
|
+
}
|
|
226
|
+
killAllSync() {
|
|
227
|
+
for (const slot of this.slots.values())
|
|
228
|
+
slot.connection?.killSync();
|
|
229
|
+
}
|
|
230
|
+
needsApproval(definition) {
|
|
231
|
+
// A user server, or one from a plugin the user installed or enabled in Claude Code, is the user's own choice.
|
|
232
|
+
if (definition.source === "user" || definition.source === "plugin" || definition.source === "claude-plugin")
|
|
233
|
+
return false;
|
|
234
|
+
return !this.approvals.isApproved(this.options.workspaceKey, definition.name, definition.digest);
|
|
235
|
+
}
|
|
236
|
+
usable(slot) {
|
|
237
|
+
return slot.definition.enabled && !slot.sessionDisabled && !this.needsApproval(slot.definition);
|
|
238
|
+
}
|
|
239
|
+
stateOf(slot) {
|
|
240
|
+
if (!slot.definition.enabled || slot.sessionDisabled)
|
|
241
|
+
return "disabled";
|
|
242
|
+
if (this.needsApproval(slot.definition))
|
|
243
|
+
return "needs-approval";
|
|
244
|
+
if (slot.connecting !== undefined)
|
|
245
|
+
return "starting";
|
|
246
|
+
if (slot.connection !== undefined && !slot.connection.isClosed)
|
|
247
|
+
return "connected";
|
|
248
|
+
if (slot.needsAuth)
|
|
249
|
+
return "needs-auth";
|
|
250
|
+
if (slot.error !== undefined)
|
|
251
|
+
return "failed";
|
|
252
|
+
return "idle";
|
|
253
|
+
}
|
|
254
|
+
connect(slot) {
|
|
255
|
+
if (this.closed)
|
|
256
|
+
return Promise.reject(new Error("the session is closing"));
|
|
257
|
+
if (slot.connecting !== undefined)
|
|
258
|
+
return slot.connecting;
|
|
259
|
+
const definition = slot.definition;
|
|
260
|
+
const attempt = sessionAuthProvider(definition, this.options.oauth).then((authProvider) => McpConnection.connect(definition, {
|
|
261
|
+
workspaceRoot: this.options.workspaceRoot,
|
|
262
|
+
logDirectory: this.logDirectory,
|
|
263
|
+
clientVersion: this.options.clientVersion,
|
|
264
|
+
environment: this.options.environment,
|
|
265
|
+
...(this.options.platform === undefined ? {} : { platform: this.options.platform }),
|
|
266
|
+
...(authProvider === undefined ? {} : { authProvider }),
|
|
267
|
+
})).then(async (connection) => {
|
|
268
|
+
slot.connecting = undefined;
|
|
269
|
+
if (this.closed || slot.definition !== definition || slot.sessionDisabled) {
|
|
270
|
+
await connection.close();
|
|
271
|
+
throw new Error(`${definition.name} was stopped while it started`);
|
|
272
|
+
}
|
|
273
|
+
slot.connection = connection;
|
|
274
|
+
slot.error = undefined;
|
|
275
|
+
slot.detail = undefined;
|
|
276
|
+
slot.needsAuth = false;
|
|
277
|
+
connection.onClose((reason) => {
|
|
278
|
+
if (slot.connection === connection)
|
|
279
|
+
slot.error = `stopped: ${reason}${connection.lastStderr.trim() === "" ? "" : ` (${connection.lastStderr.trim().split(/\r?\n/).at(-1)?.slice(0, 300) ?? ""})`}`;
|
|
280
|
+
});
|
|
281
|
+
this.register(slot, connection.tools);
|
|
282
|
+
void this.writeCache(definition, connection.tools);
|
|
283
|
+
return connection;
|
|
284
|
+
}, (error) => {
|
|
285
|
+
slot.connecting = undefined;
|
|
286
|
+
if (error instanceof McpStartError) {
|
|
287
|
+
slot.error = error.friendly;
|
|
288
|
+
slot.detail = error.detail;
|
|
289
|
+
slot.needsAuth = error.kind === "needs-auth";
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
slot.error = error instanceof Error ? error.message : String(error);
|
|
293
|
+
slot.detail = slot.error;
|
|
294
|
+
slot.needsAuth = false;
|
|
295
|
+
}
|
|
296
|
+
throw error;
|
|
297
|
+
});
|
|
298
|
+
slot.connecting = attempt;
|
|
299
|
+
return attempt;
|
|
300
|
+
}
|
|
301
|
+
register(slot, tools) {
|
|
302
|
+
const registry = this.options.registry;
|
|
303
|
+
const wanted = new Map();
|
|
304
|
+
for (const tool of tools) {
|
|
305
|
+
const name = modelToolName(slot.definition.name, tool.name);
|
|
306
|
+
if (!wanted.has(name))
|
|
307
|
+
wanted.set(name, tool);
|
|
308
|
+
}
|
|
309
|
+
for (const name of slot.registered)
|
|
310
|
+
registry.unregister?.(name);
|
|
311
|
+
slot.registered = [];
|
|
312
|
+
for (const [name, tool] of wanted) {
|
|
313
|
+
if (registry.get(name) !== undefined)
|
|
314
|
+
continue;
|
|
315
|
+
try {
|
|
316
|
+
registry.register(createMcpTool(slot.definition, tool, name, { connection: (server, signal) => this.connection(server, signal), onUntrustedContent: () => this.options.onUntrustedContent?.() }));
|
|
317
|
+
slot.registered.push(name);
|
|
318
|
+
}
|
|
319
|
+
catch {
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
async stop(slot, wait = true) {
|
|
325
|
+
// A start in flight settles first, so its connection is closed here instead of leaking (at
|
|
326
|
+
// session close it is not awaited: the closed flag makes the start close its own connection).
|
|
327
|
+
if (wait)
|
|
328
|
+
await slot.connecting?.catch(() => undefined);
|
|
329
|
+
for (const name of slot.registered)
|
|
330
|
+
this.options.registry.unregister?.(name);
|
|
331
|
+
slot.registered = [];
|
|
332
|
+
const connection = slot.connection;
|
|
333
|
+
slot.connection = undefined;
|
|
334
|
+
await connection?.close().catch(() => undefined);
|
|
335
|
+
}
|
|
336
|
+
cacheFile(definition) {
|
|
337
|
+
return path.join(this.cacheDirectory, `${definition.name}.json`);
|
|
338
|
+
}
|
|
339
|
+
readCache(definition) {
|
|
340
|
+
try {
|
|
341
|
+
const parsed = cacheSchema.safeParse(JSON.parse(readFileSync(this.cacheFile(definition), "utf8")));
|
|
342
|
+
if (!parsed.success || parsed.data.digest !== definition.digest || parsed.data.tools.length === 0)
|
|
343
|
+
return undefined;
|
|
344
|
+
return parsed.data.tools.map((tool) => ({ name: tool.name, description: tool.description, inputSchema: tool.inputSchema, annotations: tool.annotations }));
|
|
345
|
+
}
|
|
346
|
+
catch {
|
|
347
|
+
return undefined;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
async writeCache(definition, tools) {
|
|
351
|
+
try {
|
|
352
|
+
await mkdir(this.cacheDirectory, { recursive: true });
|
|
353
|
+
const data = { digest: definition.digest, tools: tools.map((tool) => ({ name: tool.name, ...(tool.description === undefined ? {} : { description: tool.description }), inputSchema: tool.inputSchema, ...(tool.annotations === undefined ? {} : { annotations: tool.annotations }) })) };
|
|
354
|
+
await writeFile(this.cacheFile(definition), JSON.stringify(data), "utf8");
|
|
355
|
+
}
|
|
356
|
+
catch {
|
|
357
|
+
// The cache is a convenience.
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
//# sourceMappingURL=manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../../src/harness/mcp/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAA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