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,999 @@
|
|
|
1
|
+
import os from "node:os";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { ASK_USER_HEADLESS_MESSAGE, askUserAnswerValue, askUserChoiceQuestion, createId, credentialRefSchema, deriveProjectId, EVENT_VERSIONS, HarnessError, parseTypedChoice, providerIdSchema, ProviderFailure, } from "../contracts/index.js";
|
|
4
|
+
import { SYNORCH_VERSION } from "../../domain/product.js";
|
|
5
|
+
import { authProviderFor, CLAUDE_BRIDGE_NOTICE, createCredentialStore, ProfileStateStore, } from "../auth/index.js";
|
|
6
|
+
import { createCompactor, createContextBuilder, createSkillContextRegistry, createSkillLoadCallback, createSourceReader, } from "../context/index.js";
|
|
7
|
+
import { createAgentDriver, recoverSession } from "../core/index.js";
|
|
8
|
+
import { buildProposal, createMemoryStore, readGitBranch, resolveMemoryRoot } from "../memory/index.js";
|
|
9
|
+
import { createBudgetGateSlot, createCoordinator, createDelegationSlot, createModelPlanner, createReportSlot, createWorkerFactory, delegationCallbacks, pruneOrphanedAttempts, reportCallbacks, } from "../orchestration/index.js";
|
|
10
|
+
import { classifyCommand, classifyVerificationCommand, createHeadlessApprovalBroker, createPolicyEngine, createWorkspaceTrustStore } from "../policy/index.js";
|
|
11
|
+
import { createAnthropicMessagesAdapter, createClaudeCodeAdapter, createModelRouter, createOpenAIChatGPTAdapter, createOpenAIResponsesAdapter, createScriptedAdapter, buildModelCatalog, bridgeEnvironment, CHATGPT_CODEX_BASE_URL, createWebSearchRunner, fetchCodexModels, findOnPath, pickCrossProviderReviewer, requestedEffort, resolveEffort, SEARCH_KEY_ENV, SYNORCH_ORIGINATOR, } from "../providers/index.js";
|
|
12
|
+
import { createMcpOAuthStore, McpManager } from "../mcp/index.js";
|
|
13
|
+
import { isProjectFolder } from "./project-scope.js";
|
|
14
|
+
import { createBlobStore, createSessionStore } from "../store/index.js";
|
|
15
|
+
import { BackgroundProcessManager, createRedactor, createSandboxRunner, createToolGateway, createToolRegistry, createWebSession, probeSandbox } from "../tools/index.js";
|
|
16
|
+
import { createClaudeNativeApprovals } from "./claude-native-approvals.js";
|
|
17
|
+
import { createCommandGrantStore } from "./command-grants.js";
|
|
18
|
+
import { loadCanonicalStructure } from "./canonical.js";
|
|
19
|
+
import { checkEndpoint, DEFAULT_ADAPTER_FOR_PROVIDER, isSynorchHome, loadRuntimeConfig, resolveHome } from "./config.js";
|
|
20
|
+
import { claudeHome as resolveClaudeHome, createExtensions, gatewayHooks, nativeToolPreHook, personaModelTier, PERSONA_INSTRUCTIONS_LIMIT, renderPersonaHint } from "./extensions/index.js";
|
|
21
|
+
import { withRoleDefinitions } from "./role-policy.js";
|
|
22
|
+
import { plannerHint, renderProfileBlock, startProjectProfile, within } from "./project-profile.js";
|
|
23
|
+
import { createOrchestrateSlot, createOrchestrateTool, createRunControlTools } from "./orchestrate-tool.js";
|
|
24
|
+
import { loadScript } from "./scripted-script.js";
|
|
25
|
+
import { recordTrustDecision } from "./trust.js";
|
|
26
|
+
const SCRIPTED_PROVIDER = "scripted";
|
|
27
|
+
const HOSTED_ALLOW = "Allow for this session";
|
|
28
|
+
/**
|
|
29
|
+
* K4.1: what each `web_search` backend needs, from the logged-in identities (never a model request
|
|
30
|
+
* to decide): subscription / API-key headers, the Claude Code bridge, and user search keys from the
|
|
31
|
+
* credential store or the environment. Every resolved secret joins the gateway's redaction set.
|
|
32
|
+
*/
|
|
33
|
+
function webSearchSources(deps) {
|
|
34
|
+
const headersFor = async (provider, method, signal) => {
|
|
35
|
+
const auth = deps.authProvider(provider, method, "default");
|
|
36
|
+
if (auth === undefined)
|
|
37
|
+
return undefined;
|
|
38
|
+
const status = await auth.status(signal).catch(() => undefined);
|
|
39
|
+
if (status?.state !== "connected" && status?.state !== "expired")
|
|
40
|
+
return undefined;
|
|
41
|
+
const credential = await auth.resolve(signal);
|
|
42
|
+
for (const value of credential.redactionValues())
|
|
43
|
+
deps.redactionValues.add(value);
|
|
44
|
+
const headers = new Headers();
|
|
45
|
+
credential.applyTo(headers);
|
|
46
|
+
return headers;
|
|
47
|
+
};
|
|
48
|
+
return {
|
|
49
|
+
fetch: deps.fetch ?? ((input, init) => fetch(input, init)),
|
|
50
|
+
chatgpt: (signal) => headersFor("openai", "oauth-subscription", signal),
|
|
51
|
+
openaiApi: (signal) => headersFor("openai", "api-key", signal),
|
|
52
|
+
anthropicApi: (signal) => headersFor("anthropic", "api-key", signal),
|
|
53
|
+
async claudeCode() {
|
|
54
|
+
if (!(await bridgeEnabled(deps.home)))
|
|
55
|
+
return undefined;
|
|
56
|
+
const found = await findOnPath("claude", bridgeEnvironment(deps.env, {}, deps.platform), deps.platform);
|
|
57
|
+
return found === undefined ? undefined : { executable: { command: found }, env: deps.env, cwd: deps.workspaceRoot, platform: deps.platform };
|
|
58
|
+
},
|
|
59
|
+
async searchKey(backend) {
|
|
60
|
+
const fromEnv = deps.env[SEARCH_KEY_ENV[backend]]?.trim();
|
|
61
|
+
let key = fromEnv === undefined || fromEnv === "" ? undefined : fromEnv;
|
|
62
|
+
if (key === undefined) {
|
|
63
|
+
const secret = await deps
|
|
64
|
+
.credentialStore()
|
|
65
|
+
.get({ provider_id: providerIdSchema.parse(backend), method: "api-key", profile: "default" })
|
|
66
|
+
.catch(() => undefined);
|
|
67
|
+
key = secret?.method === "api-key" ? secret.api_key : undefined;
|
|
68
|
+
}
|
|
69
|
+
if (key !== undefined)
|
|
70
|
+
deps.redactionValues.add(key);
|
|
71
|
+
return key;
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function platformName(platform) {
|
|
76
|
+
return platform === "win32" || platform === "darwin" || platform === "linux" ? platform : "other";
|
|
77
|
+
}
|
|
78
|
+
function configError(message) {
|
|
79
|
+
return new HarnessError({ code: "config_invalid", message, workspace_effect: "none", retry_safe: false });
|
|
80
|
+
}
|
|
81
|
+
async function bridgeEnabled(home) {
|
|
82
|
+
const ref = credentialRefSchema.parse({ provider_id: "anthropic", method: "cli-bridge", profile: "default" });
|
|
83
|
+
return new ProfileStateStore(home).isAcknowledged(CLAUDE_BRIDGE_NOTICE.id, ref).catch(() => false);
|
|
84
|
+
}
|
|
85
|
+
async function buildAdapter(entry, fetch, env, home, claude, web) {
|
|
86
|
+
if (entry.source !== "user")
|
|
87
|
+
throw configError(`adapter ${entry.id} comes from the ${entry.source} layer; only the user configuration declares adapters`);
|
|
88
|
+
if (entry.baseUrl !== undefined && entry.kind === "openai-chatgpt") {
|
|
89
|
+
const refused = checkEndpoint(entry.kind, entry.baseUrl, false);
|
|
90
|
+
if (refused !== undefined)
|
|
91
|
+
throw configError(`adapter ${entry.id}: ${refused}`);
|
|
92
|
+
}
|
|
93
|
+
const common = { ...(fetch === undefined ? {} : { fetch }), ...(entry.baseUrl === undefined ? {} : { baseUrl: entry.baseUrl }) };
|
|
94
|
+
const hosted = web === undefined ? {} : { hostedWebSearch: web.hostedWebSearch, onHostedSearch: web.onHostedSearch };
|
|
95
|
+
switch (entry.kind) {
|
|
96
|
+
case "openai-chatgpt":
|
|
97
|
+
return withId(createOpenAIChatGPTAdapter({ ...common, ...hosted }), entry.id);
|
|
98
|
+
case "openai-responses":
|
|
99
|
+
return withId(createOpenAIResponsesAdapter({ ...common, ...hosted }), entry.id);
|
|
100
|
+
case "anthropic-messages":
|
|
101
|
+
return withId(createAnthropicMessagesAdapter(common), entry.id);
|
|
102
|
+
case "claude-code":
|
|
103
|
+
return createClaudeCodeAdapter({
|
|
104
|
+
experimental: await bridgeEnabled(home),
|
|
105
|
+
env,
|
|
106
|
+
allowNonSubscriptionAuth: entry.allowNonSubscriptionAuth === true,
|
|
107
|
+
mode: claude.mode,
|
|
108
|
+
mcpServers: claude.mcpServers,
|
|
109
|
+
permissionMode: claude.permissionMode,
|
|
110
|
+
onWebContentRead: claude.onWebContentRead,
|
|
111
|
+
});
|
|
112
|
+
case "scripted":
|
|
113
|
+
return createScriptedAdapter(await loadScript(entry.script ?? ""), {
|
|
114
|
+
adapterId: entry.id,
|
|
115
|
+
providerId: entry.provider ?? SCRIPTED_PROVIDER,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/** A configured id for a built-in adapter kind keeps the adapter's behaviour under the chosen id. */
|
|
120
|
+
function withId(adapter, id) {
|
|
121
|
+
if (adapter.adapterId === id || adapter.kind !== "model")
|
|
122
|
+
return adapter;
|
|
123
|
+
return {
|
|
124
|
+
kind: "model",
|
|
125
|
+
adapterId: id,
|
|
126
|
+
providerId: adapter.providerId,
|
|
127
|
+
authMethod: adapter.authMethod,
|
|
128
|
+
discoverCapabilities: async (signal) => ({ ...(await adapter.discoverCapabilities(signal)), adapter_id: id }),
|
|
129
|
+
prepare: (request, capabilities) => adapter.prepare(request, capabilities),
|
|
130
|
+
stream: (request, credential, signal) => adapter.stream(request, credential, signal),
|
|
131
|
+
health: (signal) => adapter.health(signal),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
const IMPLICIT_ADAPTERS = {
|
|
135
|
+
"openai-chatgpt": "openai-chatgpt",
|
|
136
|
+
"openai-responses": "openai-responses",
|
|
137
|
+
"anthropic-messages": "anthropic-messages",
|
|
138
|
+
"claude-code": "claude-code",
|
|
139
|
+
};
|
|
140
|
+
async function buildAdapters(config, overrides, env, home, claude, web) {
|
|
141
|
+
const injected = new Map((overrides.adapters ?? []).map((adapter) => [adapter.adapterId, adapter]));
|
|
142
|
+
const built = new Map();
|
|
143
|
+
for (const entry of config.adapters) {
|
|
144
|
+
if (!injected.has(entry.id))
|
|
145
|
+
built.set(entry.id, await buildAdapter(entry, overrides.fetch, env, home, claude, web));
|
|
146
|
+
}
|
|
147
|
+
for (const rule of config.router.rules) {
|
|
148
|
+
const id = rule.route.adapter_id;
|
|
149
|
+
if (built.has(id) || injected.has(id))
|
|
150
|
+
continue;
|
|
151
|
+
const kind = IMPLICIT_ADAPTERS[id];
|
|
152
|
+
if (kind === undefined) {
|
|
153
|
+
const hint = DEFAULT_ADAPTER_FOR_PROVIDER[rule.route.provider_id] === id ? " (declare it under adapters)" : "";
|
|
154
|
+
throw configError(`route for ${rule.tier} uses adapter ${id}, which is neither built in nor configured${hint}`);
|
|
155
|
+
}
|
|
156
|
+
built.set(id, await buildAdapter({ id, kind, script: undefined, provider: undefined, baseUrl: undefined, source: "user" }, overrides.fetch, env, home, claude, web));
|
|
157
|
+
}
|
|
158
|
+
return [...built.values(), ...injected.values()];
|
|
159
|
+
}
|
|
160
|
+
/** A non-secret credential for the scripted test provider, which sends nothing anywhere. */
|
|
161
|
+
function scriptedCredential(profile) {
|
|
162
|
+
const credential = {
|
|
163
|
+
providerId: providerIdSchema.parse(SCRIPTED_PROVIDER),
|
|
164
|
+
method: "api-key",
|
|
165
|
+
profile,
|
|
166
|
+
expiresAt: undefined,
|
|
167
|
+
applyTo: () => undefined,
|
|
168
|
+
redactionValues: () => [],
|
|
169
|
+
toJSON: () => "[redacted]",
|
|
170
|
+
};
|
|
171
|
+
return Object.freeze(credential);
|
|
172
|
+
}
|
|
173
|
+
function observedStore(store, emit, onClose) {
|
|
174
|
+
return {
|
|
175
|
+
get sessionId() {
|
|
176
|
+
return store.sessionId;
|
|
177
|
+
},
|
|
178
|
+
get lastSeq() {
|
|
179
|
+
return store.lastSeq;
|
|
180
|
+
},
|
|
181
|
+
get quarantinedTail() {
|
|
182
|
+
return store.quarantinedTail;
|
|
183
|
+
},
|
|
184
|
+
async append(draft) {
|
|
185
|
+
const event = await store.append(draft);
|
|
186
|
+
emit(event);
|
|
187
|
+
return event;
|
|
188
|
+
},
|
|
189
|
+
read: (fromSeq, toSeq) => store.read(fromSeq, toSeq),
|
|
190
|
+
async close() {
|
|
191
|
+
onClose();
|
|
192
|
+
await store.close();
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
export async function createRuntime(options) {
|
|
197
|
+
const overrides = options.overrides ?? {};
|
|
198
|
+
const env = options.env;
|
|
199
|
+
const platform = overrides.platform ?? process.platform;
|
|
200
|
+
const home = overrides.home ?? resolveHome(env);
|
|
201
|
+
const workspaceRoot = path.resolve(options.workspaceRoot);
|
|
202
|
+
const config = await loadRuntimeConfig(home, workspaceRoot, options.routes ?? [], {
|
|
203
|
+
platform,
|
|
204
|
+
...(overrides.configCeiling === undefined ? {} : { ceiling: overrides.configCeiling }),
|
|
205
|
+
});
|
|
206
|
+
// K4.1: the OpenAI adapters ask these (filled in below, once the permission mode and logs exist).
|
|
207
|
+
const webHooksState = {
|
|
208
|
+
gate: async () => false,
|
|
209
|
+
observe: () => undefined,
|
|
210
|
+
contentRead: () => undefined,
|
|
211
|
+
};
|
|
212
|
+
const webHooks = { hostedWebSearch: (request, signal) => webHooksState.gate(request, signal), onHostedSearch: (observed) => webHooksState.observe(observed) };
|
|
213
|
+
// K3: the MCP manager exists once the registry does; Claude Code native mode reads its servers at each process start.
|
|
214
|
+
const mcpHolder = { current: undefined };
|
|
215
|
+
// Read at every Claude process start, so a mode change (Shift+Tab, /permissions) applies to the next step.
|
|
216
|
+
const claude = {
|
|
217
|
+
mode: config.claudeCodeMode ?? "native",
|
|
218
|
+
mcpServers: () => mcpHolder.current?.claudeServers() ?? {},
|
|
219
|
+
permissionMode: () => permission,
|
|
220
|
+
// K4.1: a native WebSearch/WebFetch result arrived; the prompt-injection shield applies to this turn.
|
|
221
|
+
onWebContentRead: () => webHooksState.contentRead(),
|
|
222
|
+
};
|
|
223
|
+
const adapters = await buildAdapters(config, overrides, env, home, claude, webHooks);
|
|
224
|
+
// K3 cross-provider review: the best logged-in model on another provider (catalog, no paid call), cached for a few minutes.
|
|
225
|
+
const crossReviewerCache = new Map();
|
|
226
|
+
const crossProviderReviewer = async (request, signal) => {
|
|
227
|
+
const key = `${request.excludeProvider}|${request.tier}`;
|
|
228
|
+
const cached = crossReviewerCache.get(key);
|
|
229
|
+
if (cached !== undefined && Date.now() - cached.at < 5 * 60_000)
|
|
230
|
+
return cached.binding;
|
|
231
|
+
const pick = pickCrossProviderReviewer(await runtime.modelCatalog(signal), request.excludeProvider, request.tier);
|
|
232
|
+
let binding;
|
|
233
|
+
if (pick !== undefined) {
|
|
234
|
+
const adapter = await implicitAdapter(pick.adapterId).catch(() => undefined);
|
|
235
|
+
if (adapter !== undefined) {
|
|
236
|
+
if (!baseRouter.hasAdapter(adapter.adapterId))
|
|
237
|
+
baseRouter.addAdapter(adapter);
|
|
238
|
+
if (!adapters.includes(adapter))
|
|
239
|
+
adapters.push(adapter);
|
|
240
|
+
binding = { provider_id: pick.provider, model_id: pick.model, adapter_id: adapter.adapterId };
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
crossReviewerCache.set(key, { at: Date.now(), binding });
|
|
244
|
+
return binding;
|
|
245
|
+
};
|
|
246
|
+
const baseRouter = createModelRouter({
|
|
247
|
+
rules: config.router.rules,
|
|
248
|
+
...(config.preferDifferentProvider === undefined ? {} : { preferDifferentProvider: config.preferDifferentProvider }),
|
|
249
|
+
...(config.reviewCrossProvider === undefined ? {} : { reviewCrossProvider: config.reviewCrossProvider }),
|
|
250
|
+
crossProviderReviewer,
|
|
251
|
+
}, adapters);
|
|
252
|
+
/** An adapter for a built-in kind the configuration did not need yet (a provider first picked in `/model`). */
|
|
253
|
+
const implicitAdapter = async (id) => {
|
|
254
|
+
const existing = adapters.find((adapter) => adapter.adapterId === id);
|
|
255
|
+
if (existing !== undefined)
|
|
256
|
+
return existing;
|
|
257
|
+
const kind = IMPLICIT_ADAPTERS[id];
|
|
258
|
+
if (kind === undefined)
|
|
259
|
+
return undefined;
|
|
260
|
+
return buildAdapter({ id, kind, script: undefined, provider: undefined, baseUrl: undefined, source: "user" }, overrides.fetch, env, home, claude, webHooks);
|
|
261
|
+
};
|
|
262
|
+
const listeners = new Set();
|
|
263
|
+
const emit = (event) => {
|
|
264
|
+
for (const listener of listeners) {
|
|
265
|
+
try {
|
|
266
|
+
listener(event);
|
|
267
|
+
}
|
|
268
|
+
catch {
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
const projectId = deriveProjectId(workspaceRoot, platform);
|
|
274
|
+
const gitBranch = await readGitBranch(workspaceRoot);
|
|
275
|
+
const rawSessions = createSessionStore(home);
|
|
276
|
+
const blobs = createBlobStore(home);
|
|
277
|
+
const writers = new Map();
|
|
278
|
+
const wrap = (store) => {
|
|
279
|
+
const observed = observedStore(store, (event) => emit({ kind: "session-event", event }), () => writers.delete(store.sessionId));
|
|
280
|
+
writers.set(store.sessionId, observed);
|
|
281
|
+
return observed;
|
|
282
|
+
};
|
|
283
|
+
const configIgnored = config.warnings.slice(0, 32).map((warning) => ({ layer: warning.layer, path: warning.path, key: warning.key }));
|
|
284
|
+
const opened = async (store, parent, root) => {
|
|
285
|
+
const observed = wrap(store);
|
|
286
|
+
await observed.append({
|
|
287
|
+
type: "session/opened",
|
|
288
|
+
event_version: EVENT_VERSIONS["session/opened"],
|
|
289
|
+
actor: { kind: "system" },
|
|
290
|
+
data: {
|
|
291
|
+
writer: { name: "synorch", version: SYNORCH_VERSION },
|
|
292
|
+
project_id: projectId,
|
|
293
|
+
workspace_root: root,
|
|
294
|
+
cwd: workspaceRoot,
|
|
295
|
+
platform: platformName(platform),
|
|
296
|
+
git: gitBranch === undefined ? null : { branch: gitBranch },
|
|
297
|
+
policy_mode: options.policyMode,
|
|
298
|
+
...(parent === undefined ? {} : { parent }),
|
|
299
|
+
...(configIgnored.length === 0 ? {} : { config_ignored: configIgnored }),
|
|
300
|
+
},
|
|
301
|
+
});
|
|
302
|
+
return observed;
|
|
303
|
+
};
|
|
304
|
+
const sessions = {
|
|
305
|
+
create: async (manifest) => opened(await rawSessions.create(manifest), manifest.parent, manifest.workspace_root),
|
|
306
|
+
openForWrite: async (sessionId) => wrap(await rawSessions.openForWrite(sessionId)),
|
|
307
|
+
openForRead: (sessionId) => rawSessions.openForRead(sessionId),
|
|
308
|
+
fork: async (sessionId, upToSeq, forkOptions) => opened(await rawSessions.fork(sessionId, upToSeq, forkOptions), { session_id: sessionId, up_to_seq: upToSeq }, workspaceRoot),
|
|
309
|
+
list: (id) => rawSessions.list(id),
|
|
310
|
+
};
|
|
311
|
+
const wrappedAdapters = new Map();
|
|
312
|
+
const router = {
|
|
313
|
+
resolve: (request, signal) => baseRouter.resolve(request, signal),
|
|
314
|
+
reportFailure: (route, error) => baseRouter.reportFailure(route, error),
|
|
315
|
+
proposeProviderChange: (failure, context) => baseRouter.proposeProviderChange(failure, context),
|
|
316
|
+
applyProviderChange: (decision) => baseRouter.applyProviderChange(decision),
|
|
317
|
+
adapterFor(route) {
|
|
318
|
+
const adapter = baseRouter.adapterFor(route);
|
|
319
|
+
if (adapter.kind !== "model")
|
|
320
|
+
return adapter;
|
|
321
|
+
const cached = wrappedAdapters.get(adapter.adapterId);
|
|
322
|
+
if (cached !== undefined)
|
|
323
|
+
return cached;
|
|
324
|
+
const observed = {
|
|
325
|
+
kind: "model",
|
|
326
|
+
adapterId: adapter.adapterId,
|
|
327
|
+
providerId: adapter.providerId,
|
|
328
|
+
authMethod: adapter.authMethod,
|
|
329
|
+
discoverCapabilities: (signal) => adapter.discoverCapabilities(signal),
|
|
330
|
+
prepare: (request, capabilities) => adapter.prepare(request, capabilities),
|
|
331
|
+
health: (signal) => adapter.health(signal),
|
|
332
|
+
stream: (request, credential, signal) => (async function* () {
|
|
333
|
+
for await (const event of adapter.stream(request, credential, signal)) {
|
|
334
|
+
if (event.type === "error" && event.error.code === "quota_exhausted")
|
|
335
|
+
baseRouter.reportFailure(request.route, event.error);
|
|
336
|
+
emit({ kind: "stream", requestId: request.request_id, event });
|
|
337
|
+
yield event;
|
|
338
|
+
}
|
|
339
|
+
})(),
|
|
340
|
+
};
|
|
341
|
+
wrappedAdapters.set(adapter.adapterId, observed);
|
|
342
|
+
return observed;
|
|
343
|
+
},
|
|
344
|
+
};
|
|
345
|
+
let store;
|
|
346
|
+
const credentialStore = () => {
|
|
347
|
+
store ??= (overrides.credentialStore ?? ((root, variables) => createCredentialStore(root, { env: variables })))(home, env);
|
|
348
|
+
return store;
|
|
349
|
+
};
|
|
350
|
+
const authOptions = {
|
|
351
|
+
...(overrides.authOptions ?? {}),
|
|
352
|
+
...(overrides.fetch === undefined ? {} : { fetch: overrides.fetch }),
|
|
353
|
+
env,
|
|
354
|
+
};
|
|
355
|
+
const authProviders = new Map();
|
|
356
|
+
const authProvider = (providerId, method, profile) => {
|
|
357
|
+
const key = `${providerId}|${method}|${profile}`;
|
|
358
|
+
if (!authProviders.has(key)) {
|
|
359
|
+
const ref = credentialRefSchema.parse({ provider_id: providerId, method, profile });
|
|
360
|
+
authProviders.set(key, authProviderFor(credentialStore(), ref, authOptions));
|
|
361
|
+
}
|
|
362
|
+
return authProviders.get(key);
|
|
363
|
+
};
|
|
364
|
+
/** Whether an identity is usable, from its auth status only (store / env / opt-in; never a model request). */
|
|
365
|
+
const identityOf = async (provider, method, profile, signal) => {
|
|
366
|
+
if (provider === SCRIPTED_PROVIDER)
|
|
367
|
+
return { connected: true, hint: "" };
|
|
368
|
+
const scripted = adapters.find((adapter) => adapter.providerId === provider && adapter.authMethod === method && adapter.scripted === true);
|
|
369
|
+
if (scripted !== undefined)
|
|
370
|
+
return { connected: true, hint: "" };
|
|
371
|
+
const auth = authProvider(provider, method, profile);
|
|
372
|
+
if (auth === undefined)
|
|
373
|
+
return { connected: false, hint: `${provider} does not support ${method}` };
|
|
374
|
+
const status = await auth.status(signal).catch(() => undefined);
|
|
375
|
+
const state = status?.state;
|
|
376
|
+
const connected = method === "cli-bridge" ? state === "unknown" || state === "connected" : state === "connected" || state === "expired";
|
|
377
|
+
const login = method === "cli-bridge" ? `syn login ${provider} --method cli-bridge` : method === "api-key" ? `syn login ${provider} --method api-key` : `syn login ${provider}`;
|
|
378
|
+
return { connected, hint: connected ? "" : `${status?.detail ?? state ?? "not logged in"}; run ${login}` };
|
|
379
|
+
};
|
|
380
|
+
const redactionValues = new Set();
|
|
381
|
+
const credentials = async (route, signal, resolveOptions) => {
|
|
382
|
+
if (route.provider_id === SCRIPTED_PROVIDER ||
|
|
383
|
+
adapters.some((adapter) => adapter.adapterId === route.adapter_id && (adapter.providerId === SCRIPTED_PROVIDER || adapter.scripted === true))) {
|
|
384
|
+
return scriptedCredential(route.profile);
|
|
385
|
+
}
|
|
386
|
+
const auth = authProvider(route.provider_id, route.auth_method, route.profile);
|
|
387
|
+
if (auth === undefined) {
|
|
388
|
+
throw new ProviderFailure({
|
|
389
|
+
code: "unauthenticated",
|
|
390
|
+
message: `no auth provider supports ${route.provider_id} ${route.auth_method} (profile ${route.profile}); run syn login ${route.provider_id}`,
|
|
391
|
+
retryable: false,
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
const credential = await auth.resolve(signal, resolveOptions);
|
|
395
|
+
for (const value of credential.redactionValues())
|
|
396
|
+
redactionValues.add(value);
|
|
397
|
+
return credential;
|
|
398
|
+
};
|
|
399
|
+
const canonical = await loadCanonicalStructure(workspaceRoot);
|
|
400
|
+
// Never awaited here: the first token must not wait for a cold detection (cached profiles load in ms).
|
|
401
|
+
const profile = startProjectProfile(home, projectId, workspaceRoot);
|
|
402
|
+
const profileText = async () => {
|
|
403
|
+
const known = profile.current() ?? (await within(profile.ready, 1_500));
|
|
404
|
+
return known === undefined ? undefined : renderProfileBlock(known);
|
|
405
|
+
};
|
|
406
|
+
const trustStore = createWorkspaceTrustStore(home, { platform });
|
|
407
|
+
const stored = trustStore.status(workspaceRoot);
|
|
408
|
+
let trustState = !stored.trusted && options.trustWorkspace === true ? { ...stored, trusted: true, source: "flag", reason: undefined } : stored;
|
|
409
|
+
let permission = options.permissionMode;
|
|
410
|
+
let gitPushApproved = false;
|
|
411
|
+
// Full access and auto (owner revision 3) imply trust for this runtime only, never saved; leaving them returns to the recorded trust.
|
|
412
|
+
const effectiveTrust = () => trustState.trusted || (permission !== "full" && permission !== "auto") ? trustState : { ...trustState, trusted: true, source: "session", reason: undefined };
|
|
413
|
+
const trust = {
|
|
414
|
+
file: trustStore.file,
|
|
415
|
+
state: effectiveTrust,
|
|
416
|
+
recorded: () => trustState,
|
|
417
|
+
async grant(source) {
|
|
418
|
+
const granted = await trustStore.grant(workspaceRoot, source);
|
|
419
|
+
if (granted.trusted) {
|
|
420
|
+
trustState = granted;
|
|
421
|
+
await recordTrustDecision(home, workspaceRoot, platform, "trust/granted", granted, source);
|
|
422
|
+
}
|
|
423
|
+
return granted;
|
|
424
|
+
},
|
|
425
|
+
grantSession() {
|
|
426
|
+
if (!trustState.trusted)
|
|
427
|
+
trustState = { ...trustState, trusted: true, source: "session", reason: undefined };
|
|
428
|
+
return trustState;
|
|
429
|
+
},
|
|
430
|
+
};
|
|
431
|
+
// Started in the home folder (or a folder that is no project): the user's own ~/.mcp.json, ~/.claude/skills are not a repository's.
|
|
432
|
+
const projectScope = isProjectFolder(workspaceRoot, env.HOME ?? env.USERPROFILE ?? os.homedir(), platform);
|
|
433
|
+
// K7: skills, commands and plugins; repository items follow the live trust state.
|
|
434
|
+
const extensions = await createExtensions({
|
|
435
|
+
home,
|
|
436
|
+
workspaceRoot,
|
|
437
|
+
env,
|
|
438
|
+
platform,
|
|
439
|
+
claudeHome: overrides.claudeHome ?? (overrides.home === undefined ? resolveClaudeHome(env) : undefined),
|
|
440
|
+
settings: config.extensions,
|
|
441
|
+
trusted: () => effectiveTrust().trusted,
|
|
442
|
+
canonicalCatalog: canonical.skills,
|
|
443
|
+
canonical: { origin: canonical.origin, skills: canonical.skillEntries },
|
|
444
|
+
skipProjectSynorch: isSynorchHome(path.join(workspaceRoot, ".synorch"), home, platform),
|
|
445
|
+
skipProjectScope: !projectScope,
|
|
446
|
+
});
|
|
447
|
+
const webSession = createWebSession({ home });
|
|
448
|
+
webHooksState.contentRead = () => webSession.markContentRead();
|
|
449
|
+
const policy = withRoleDefinitions(createPolicyEngine({
|
|
450
|
+
synorchHome: home,
|
|
451
|
+
workspaceTrusted: () => effectiveTrust().trusted,
|
|
452
|
+
permissionMode: () => permission,
|
|
453
|
+
webDomains: () => webSession.domains(),
|
|
454
|
+
webContentRead: () => webSession.contentRead(),
|
|
455
|
+
gitPushApproved: () => gitPushApproved,
|
|
456
|
+
}), canonical.roles);
|
|
457
|
+
const webSearch = createWebSearchRunner({
|
|
458
|
+
provider: () => config.web.searchProvider,
|
|
459
|
+
model: () => config.web.searchModel,
|
|
460
|
+
sources: webSearchSources({ env, home, workspaceRoot, platform, fetch: overrides.fetch, authProvider, credentialStore, redactionValues }),
|
|
461
|
+
});
|
|
462
|
+
const sandbox = overrides.sandbox ?? (await probeSandbox({ platform }));
|
|
463
|
+
const runner = createSandboxRunner(sandbox, { untrustedRoots: [workspaceRoot, home] });
|
|
464
|
+
const userConfig = config.userPolicy === undefined ? undefined : { policy: config.userPolicy };
|
|
465
|
+
const workspaceConfig = config.workspacePolicy === undefined ? undefined : { policy: config.workspacePolicy };
|
|
466
|
+
const memoryRoot = config.memory?.root !== undefined ? resolveMemoryRoot(config.memory, projectId, os.homedir()) : path.join(home, "memory", projectId);
|
|
467
|
+
const memory = createMemoryStore(memoryRoot, { workspaceRoot });
|
|
468
|
+
const delegation = createDelegationSlot();
|
|
469
|
+
const reports = createReportSlot();
|
|
470
|
+
const skillContext = createSkillContextRegistry();
|
|
471
|
+
let userPrompt;
|
|
472
|
+
let userChoice;
|
|
473
|
+
const askUserQuestions = async (questions, signal) => {
|
|
474
|
+
const prompt = userPrompt;
|
|
475
|
+
if (prompt === undefined)
|
|
476
|
+
return { kind: "unavailable" };
|
|
477
|
+
const choose = userChoice;
|
|
478
|
+
const answers = {};
|
|
479
|
+
for (const question of questions) {
|
|
480
|
+
const choice = askUserChoiceQuestion(question);
|
|
481
|
+
let answer;
|
|
482
|
+
if (choose !== undefined)
|
|
483
|
+
answer = await choose(choice, signal);
|
|
484
|
+
else
|
|
485
|
+
answer = parseTypedChoice(choice, await prompt(question.question, question.options.map((option) => option.label), signal));
|
|
486
|
+
if (answer === undefined)
|
|
487
|
+
return { kind: "dismissed" };
|
|
488
|
+
answers[question.question] = askUserAnswerValue(answer);
|
|
489
|
+
}
|
|
490
|
+
return { kind: "answered", answers: { answers } };
|
|
491
|
+
};
|
|
492
|
+
const processes = new BackgroundProcessManager();
|
|
493
|
+
const registry = createToolRegistry({
|
|
494
|
+
processes,
|
|
495
|
+
classifyCommand: (argv, scope) => classifyCommand(argv, scope),
|
|
496
|
+
web: { session: webSession, search: webSearch, transport: { allowPrivate: config.web.allowPrivate } },
|
|
497
|
+
control: {
|
|
498
|
+
...delegationCallbacks(delegation),
|
|
499
|
+
...reportCallbacks(reports),
|
|
500
|
+
// Only catalog skills the caller's role may use (never widening a read scope to .ai/**); a skill
|
|
501
|
+
// already in the caller's context is not served again (ADR-20). One registry is shared with the
|
|
502
|
+
// ContextBuilder, which records what each build injected.
|
|
503
|
+
loadSkill: createSkillLoadCallback({ skills: extensions.skills, registry: skillContext }),
|
|
504
|
+
async askUser(input, context) {
|
|
505
|
+
if ((context.role !== "orchestrator" && context.role !== "session") || userPrompt === undefined) {
|
|
506
|
+
return { status: "error", text: "", truncated: false, redactions: 0, error: { code: "approval_unavailable", message: ASK_USER_HEADLESS_MESSAGE } };
|
|
507
|
+
}
|
|
508
|
+
const outcome = await askUserQuestions(input.questions, context.signal);
|
|
509
|
+
if (outcome.kind === "unavailable") {
|
|
510
|
+
return { status: "error", text: "", truncated: false, redactions: 0, error: { code: "approval_unavailable", message: ASK_USER_HEADLESS_MESSAGE } };
|
|
511
|
+
}
|
|
512
|
+
if (outcome.kind === "dismissed") {
|
|
513
|
+
return {
|
|
514
|
+
status: "error",
|
|
515
|
+
text: "",
|
|
516
|
+
truncated: false,
|
|
517
|
+
redactions: 0,
|
|
518
|
+
error: { code: "approval_rejected", message: "the user dismissed the question without answering; do not assume an answer: continue with what you can decide safely, or ask again in plain text" },
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
return { status: "ok", text: `The user answered: ${JSON.stringify(outcome.answers)}`.slice(0, 16 * 1024), truncated: false, redactions: 0 };
|
|
522
|
+
},
|
|
523
|
+
async memoryPropose(input, context) {
|
|
524
|
+
// K2 decision desk: `{ kind, title, body }` is enough; a conversation turn (no run) proposes as `session`.
|
|
525
|
+
const parsed = buildProposal(input, { projectId, branch: gitBranch, runId: context.runId, taskId: context.taskId, role: context.role, toolCallId: context.toolCallId, now: new Date() });
|
|
526
|
+
if (!parsed.ok) {
|
|
527
|
+
return { status: "error", text: "", truncated: false, redactions: 0, error: { code: "invalid_arguments", message: parsed.message } };
|
|
528
|
+
}
|
|
529
|
+
await memory.propose(parsed.proposal);
|
|
530
|
+
return { status: "ok", text: `proposal ${parsed.proposal.proposal_id} queued for the user's review (/memory review); it is not memory until accepted`, truncated: false, redactions: 0 };
|
|
531
|
+
},
|
|
532
|
+
},
|
|
533
|
+
});
|
|
534
|
+
const orchestrate = createOrchestrateSlot();
|
|
535
|
+
registry.register(createOrchestrateTool(orchestrate));
|
|
536
|
+
for (const tool of createRunControlTools(orchestrate))
|
|
537
|
+
registry.register(tool);
|
|
538
|
+
// K3 MCP client: servers are resolved now (no process starts); sessions call startSession().
|
|
539
|
+
const mcp = new McpManager({
|
|
540
|
+
home,
|
|
541
|
+
workspaceRoot,
|
|
542
|
+
workspaceKey: trustState.root,
|
|
543
|
+
environment: env,
|
|
544
|
+
registry,
|
|
545
|
+
clientVersion: SYNORCH_VERSION,
|
|
546
|
+
user: { config: config.mcp.user, file: config.mcp.userFile },
|
|
547
|
+
project: { config: config.mcp.project, file: config.mcp.projectFile },
|
|
548
|
+
platform,
|
|
549
|
+
// MCP results are untrusted like web content: the outward-action shield applies for the rest of the turn.
|
|
550
|
+
onUntrustedContent: () => webSession.markContentRead(),
|
|
551
|
+
addRedaction: (value) => redactionValues.add(value),
|
|
552
|
+
plugins: () => extensions.mcpServers(),
|
|
553
|
+
oauth: createMcpOAuthStore(credentialStore),
|
|
554
|
+
projectScope,
|
|
555
|
+
});
|
|
556
|
+
await mcp.load();
|
|
557
|
+
mcpHolder.current = mcp;
|
|
558
|
+
// K4.1 native OpenAI search: on in auto/full/plan, one question per session in ask, headless only with web.openai_hosted: true.
|
|
559
|
+
let hostedConsent;
|
|
560
|
+
webHooksState.gate = async (_request, signal) => {
|
|
561
|
+
const setting = config.web.openaiHosted;
|
|
562
|
+
if (setting === false)
|
|
563
|
+
return false;
|
|
564
|
+
if (permission === undefined)
|
|
565
|
+
return setting === true;
|
|
566
|
+
if (permission !== "ask")
|
|
567
|
+
return true;
|
|
568
|
+
if (hostedConsent !== undefined)
|
|
569
|
+
return hostedConsent;
|
|
570
|
+
const prompt = userPrompt;
|
|
571
|
+
if (prompt === undefined)
|
|
572
|
+
return false;
|
|
573
|
+
const answer = await prompt("Let the OpenAI model search the web natively during this session? (Otherwise Synorch's web_search asks you at every search.)", [HOSTED_ALLOW, "Not now"], signal).catch(() => "");
|
|
574
|
+
hostedConsent = answer.trim() === HOSTED_ALLOW;
|
|
575
|
+
return hostedConsent;
|
|
576
|
+
};
|
|
577
|
+
const requestSessions = new Map();
|
|
578
|
+
webHooksState.observe = (observed) => {
|
|
579
|
+
webSession.markContentRead();
|
|
580
|
+
const sessionId = requestSessions.get(observed.requestId);
|
|
581
|
+
const writer = sessionId === undefined ? undefined : writers.get(sessionId);
|
|
582
|
+
if (writer === undefined)
|
|
583
|
+
return;
|
|
584
|
+
for (const query of observed.queries.slice(0, 16)) {
|
|
585
|
+
void writer
|
|
586
|
+
.append({
|
|
587
|
+
type: "web/searched",
|
|
588
|
+
event_version: EVENT_VERSIONS["web/searched"],
|
|
589
|
+
actor: { kind: "system" },
|
|
590
|
+
data: { provider: "openai-hosted", query: query.slice(0, 500), sources: Math.min(1000, observed.sources.length), request_id: observed.requestId },
|
|
591
|
+
})
|
|
592
|
+
.catch(() => undefined);
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
// K4.1 bookkeeping from the session events: turn boundaries (shield), URLs the user typed (robots.txt), request → log, domain grants.
|
|
596
|
+
const approvalHosts = new Map();
|
|
597
|
+
listeners.add((event) => {
|
|
598
|
+
if (event.kind !== "session-event")
|
|
599
|
+
return;
|
|
600
|
+
const recorded = event.event;
|
|
601
|
+
const conversation = recorded.run_id === undefined && recorded.attempt_id === undefined;
|
|
602
|
+
if (recorded.type === "turn/started" && conversation)
|
|
603
|
+
webSession.startTurn();
|
|
604
|
+
else if (recorded.type === "message/recorded" && conversation && recorded.data.message?.role === "user") {
|
|
605
|
+
for (const part of recorded.data.message.content)
|
|
606
|
+
if (part.type === "text")
|
|
607
|
+
webSession.noteUserText(part.text);
|
|
608
|
+
}
|
|
609
|
+
else if (recorded.type === "model/request_prepared") {
|
|
610
|
+
requestSessions.set(recorded.data.request_id, recorded.session_id);
|
|
611
|
+
if (requestSessions.size > 256)
|
|
612
|
+
requestSessions.delete(requestSessions.keys().next().value ?? "");
|
|
613
|
+
}
|
|
614
|
+
else if (recorded.type === "approval/requested" && recorded.data.request.hosts !== undefined) {
|
|
615
|
+
approvalHosts.set(recorded.data.request.approval_id, recorded.data.request.hosts);
|
|
616
|
+
}
|
|
617
|
+
else if (recorded.type === "approval/decided") {
|
|
618
|
+
const hosts = approvalHosts.get(recorded.data.decision.approval_id);
|
|
619
|
+
approvalHosts.delete(recorded.data.decision.approval_id);
|
|
620
|
+
if (hosts === undefined || recorded.data.decision.decided_by !== "user" || recorded.data.decision.outcome !== "allowed-for-scope")
|
|
621
|
+
return;
|
|
622
|
+
const writer = writers.get(recorded.session_id);
|
|
623
|
+
for (const host of hosts) {
|
|
624
|
+
void webSession
|
|
625
|
+
.allowDomain(host)
|
|
626
|
+
.then((added) => added && writer !== undefined
|
|
627
|
+
? writer.append({ type: "network/host_allowed", event_version: EVENT_VERSIONS["network/host_allowed"], actor: { kind: "user" }, data: { host, scope: "global" } })
|
|
628
|
+
: undefined)
|
|
629
|
+
.catch(() => undefined);
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
const budgetGate = createBudgetGateSlot();
|
|
634
|
+
const context = createContextBuilder({
|
|
635
|
+
readSession: async (sessionId) => writers.get(sessionId) ?? (await rawSessions.openForRead(sessionId)),
|
|
636
|
+
blobs,
|
|
637
|
+
tools: registry,
|
|
638
|
+
sources: createSourceReader(workspaceRoot),
|
|
639
|
+
instructions: canonical.instructions,
|
|
640
|
+
skills: extensions.skills,
|
|
641
|
+
skillContext,
|
|
642
|
+
// K7: Claude Code native routes load Claude's own skills themselves.
|
|
643
|
+
claudeNativeRoute: (route) => route.adapter_kind === "agent-backend" && (config.claudeCodeMode ?? "native") === "native",
|
|
644
|
+
memory: { store: memory, projectId, branch: gitBranch },
|
|
645
|
+
budget: budgetGate,
|
|
646
|
+
compactor: createCompactor({ blobs, writerFor: (sessionId) => writers.get(sessionId) }),
|
|
647
|
+
platform,
|
|
648
|
+
projectProfile: profileText,
|
|
649
|
+
});
|
|
650
|
+
/**
|
|
651
|
+
* ADR-18 D1 / review R4: the harness runs a packet's verification commands itself after the
|
|
652
|
+
* worker's turn, as a system call through the tool gateway into the attempt's session log: the
|
|
653
|
+
* same pipeline as any `exec` (normalization, the credential-in-arguments check, the policy
|
|
654
|
+
* engine with the packet's exact verification commands, workspace trust and dependency-link
|
|
655
|
+
* rules, the sandbox runner, redaction) and the same `tool/*` audit events, with `actor.kind:
|
|
656
|
+
* system` and no short ref. A command the policy does not allow outright is not run (a system
|
|
657
|
+
* call never asks): `not-run` + reason. The class (`classifyVerificationCommand`) says whether a
|
|
658
|
+
* passed run can prove behaviour (review R1/R2).
|
|
659
|
+
*/
|
|
660
|
+
const verificationGateways = new WeakMap();
|
|
661
|
+
const verificationBroker = createHeadlessApprovalBroker({ mode: options.policyMode });
|
|
662
|
+
const verification = async (request) => {
|
|
663
|
+
const started = Date.now();
|
|
664
|
+
const commandClass = classifyVerificationCommand(request.argv);
|
|
665
|
+
const notRun = (reason) => ({ status: "not-run", commandClass, exitCode: null, output: "", durationMs: Date.now() - started, reason: reason.slice(0, 500) });
|
|
666
|
+
const events = request.events;
|
|
667
|
+
if (events === undefined)
|
|
668
|
+
return notRun("no attempt log is open to record the run");
|
|
669
|
+
let gateway = verificationGateways.get(events);
|
|
670
|
+
if (gateway === undefined) {
|
|
671
|
+
gateway = createToolGateway({ events, blobs, registry, policy, approvals: verificationBroker, sandbox: runner, redactionValues: () => [...redactionValues], platform });
|
|
672
|
+
verificationGateways.set(events, gateway);
|
|
673
|
+
}
|
|
674
|
+
try {
|
|
675
|
+
const toolCallId = createId("toolCall");
|
|
676
|
+
const outcome = await gateway.invoke({ tool_call_id: toolCallId, provider_call_id: `harness-verification-${toolCallId}`, tool_name: "exec", arguments: { argv: [...request.argv] } }, { runId: request.runId, taskId: request.taskId, attemptId: request.attemptId, role: request.role, policy: request.policy, actor: "system" }, request.signal);
|
|
677
|
+
const result = outcome.result;
|
|
678
|
+
if (result.exit_code === undefined && (outcome.state === "denied" || (outcome.state === "cancelled" && outcome.decision?.decision !== "allow"))) {
|
|
679
|
+
return notRun(`${outcome.state === "denied" ? "refused" : "cancelled"}: ${result.error?.message ?? "the gateway did not run it"}`);
|
|
680
|
+
}
|
|
681
|
+
let full = result.text;
|
|
682
|
+
if (result.blob !== undefined && result.blob.media_type.startsWith("text/")) {
|
|
683
|
+
full = await blobs.get(result.blob.digest).then((bytes) => Buffer.from(bytes).toString("utf8"), () => result.text);
|
|
684
|
+
}
|
|
685
|
+
const output = `${full}${result.error === undefined ? "" : `\n${result.error.message}`}`;
|
|
686
|
+
const termination = result.exit_code !== undefined ? "exited" : result.error?.code === "timeout" ? "timeout" : result.error?.code === "cancelled" ? "cancelled" : "spawn-failed";
|
|
687
|
+
const exitCode = result.exit_code ?? null;
|
|
688
|
+
const passed = termination === "exited" && exitCode === 0;
|
|
689
|
+
return { status: passed ? "passed" : "failed", commandClass, termination, exitCode, output, durationMs: Date.now() - started };
|
|
690
|
+
}
|
|
691
|
+
catch (error) {
|
|
692
|
+
return notRun(`the harness could not run it: ${error instanceof Error ? error.message : String(error)}`);
|
|
693
|
+
}
|
|
694
|
+
};
|
|
695
|
+
// Claude Code native mode: its permission prompts go to the same broker as the gateway's (ADR-08 revision 2026-09-24).
|
|
696
|
+
const redactText = createRedactor(() => [...redactionValues]);
|
|
697
|
+
const backendRedact = (text) => redactText(text).text;
|
|
698
|
+
// K7 hooks: PreToolUse / PostToolUse on the gateway; on Claude native built-ins only Synorch's own hooks (Claude runs its plugins' hooks itself).
|
|
699
|
+
const hookNotice = (message) => emit({ kind: "notice", level: "warning", message: backendRedact(message) });
|
|
700
|
+
const toolHooks = gatewayHooks(extensions.hooks, { workspaceRoot, permissionMode: () => permission, notify: hookNotice });
|
|
701
|
+
const backendApprovals = (broker) => {
|
|
702
|
+
const native = createClaudeNativeApprovals({
|
|
703
|
+
broker,
|
|
704
|
+
permissionMode: () => permission,
|
|
705
|
+
commandGrants: () => createCommandGrantStore(home, effectiveTrust().root).list(),
|
|
706
|
+
redact: backendRedact,
|
|
707
|
+
web: { domains: () => webSession.domains(), environment: env },
|
|
708
|
+
askUser: (questions, signal) => askUserQuestions(questions, signal),
|
|
709
|
+
});
|
|
710
|
+
return async (toolName, input, context, signal) => {
|
|
711
|
+
const denied = await nativeToolPreHook(extensions.hooks, { toolName, toolInput: input, sessionId: context.runId ?? "session", workspaceRoot, permissionMode: permission, notify: hookNotice }, signal).catch(() => undefined);
|
|
712
|
+
if (denied !== undefined)
|
|
713
|
+
return { allow: false, reason: `PreToolUse hook: ${denied}`.slice(0, 1000) };
|
|
714
|
+
return native(toolName, input, context, signal);
|
|
715
|
+
};
|
|
716
|
+
};
|
|
717
|
+
// K6 reasoning effort: session levels (`/effort`, `--effort <tier>=`) > `--effort <level>` > config role > config tier.
|
|
718
|
+
const sessionEfforts = new Map();
|
|
719
|
+
for (const entry of options.efforts ?? [])
|
|
720
|
+
if (entry.tier !== undefined)
|
|
721
|
+
sessionEfforts.set(entry.tier, entry.level);
|
|
722
|
+
const flagEffort = options.efforts?.find((entry) => entry.tier === undefined)?.level;
|
|
723
|
+
const effortNotices = new Set();
|
|
724
|
+
const configuredEffort = { ...config.effort };
|
|
725
|
+
const effortFor = (tier, role, route, hint) => {
|
|
726
|
+
// The conversation (role session) may run on the orchestrator route: its own `session` level comes first.
|
|
727
|
+
const conversation = role === "session";
|
|
728
|
+
const requested = requestedEffort({
|
|
729
|
+
session: (conversation ? sessionEfforts.get("session") : undefined) ?? sessionEfforts.get(tier),
|
|
730
|
+
flag: flagEffort,
|
|
731
|
+
role: role === undefined || role === "orchestrator" ? undefined : configuredEffort[role],
|
|
732
|
+
tier: configuredEffort[tier],
|
|
733
|
+
hint,
|
|
734
|
+
});
|
|
735
|
+
return resolveEffort(requested, { provider: route.provider_id, model: route.model_id, adapterId: route.adapter_id });
|
|
736
|
+
};
|
|
737
|
+
const stepEffort = (input) => {
|
|
738
|
+
const tier = input.route.tier ?? (input.role === "session" ? "session" : input.role === "orchestrator" ? "orchestrator" : "complex_worker");
|
|
739
|
+
// K6: the orchestrator's per-task hint fills in only where the user set nothing.
|
|
740
|
+
const hint = input.packet?.effort;
|
|
741
|
+
const resolution = effortFor(tier, input.role, input.route, hint);
|
|
742
|
+
// A clamp is said once per level and model, never silently (a clamped task hint is not the user's setting: no notice).
|
|
743
|
+
if (resolution.notice !== undefined && resolution.requested !== hint && !effortNotices.has(resolution.notice)) {
|
|
744
|
+
effortNotices.add(resolution.notice);
|
|
745
|
+
emit({ kind: "notice", level: "info", message: resolution.notice });
|
|
746
|
+
}
|
|
747
|
+
return resolution.effective;
|
|
748
|
+
};
|
|
749
|
+
const createDriver = (broker) => (events) => createAgentDriver({
|
|
750
|
+
events,
|
|
751
|
+
blobs,
|
|
752
|
+
router,
|
|
753
|
+
context,
|
|
754
|
+
tools: registry,
|
|
755
|
+
gateway: createToolGateway({ events, blobs, registry, policy, approvals: broker, sandbox: runner, redactionValues: () => [...redactionValues], hooks: toolHooks }),
|
|
756
|
+
credentials,
|
|
757
|
+
backendApprovals: backendApprovals(broker),
|
|
758
|
+
backendRedact,
|
|
759
|
+
reasoningEffort: stepEffort,
|
|
760
|
+
});
|
|
761
|
+
const runtime = {
|
|
762
|
+
home,
|
|
763
|
+
workspaceRoot,
|
|
764
|
+
projectId,
|
|
765
|
+
platform,
|
|
766
|
+
policyMode: options.policyMode,
|
|
767
|
+
config,
|
|
768
|
+
canonical,
|
|
769
|
+
profile,
|
|
770
|
+
sessions,
|
|
771
|
+
blobs,
|
|
772
|
+
router,
|
|
773
|
+
adapters,
|
|
774
|
+
policy,
|
|
775
|
+
registry,
|
|
776
|
+
processes,
|
|
777
|
+
sandbox,
|
|
778
|
+
trust,
|
|
779
|
+
memory,
|
|
780
|
+
memoryRoot,
|
|
781
|
+
gitBranch,
|
|
782
|
+
context,
|
|
783
|
+
budgetGate,
|
|
784
|
+
credentials,
|
|
785
|
+
orchestrate,
|
|
786
|
+
web: webSession,
|
|
787
|
+
mcp,
|
|
788
|
+
extensions,
|
|
789
|
+
credentialStore,
|
|
790
|
+
authProvider,
|
|
791
|
+
subscribe(listener) {
|
|
792
|
+
listeners.add(listener);
|
|
793
|
+
return () => listeners.delete(listener);
|
|
794
|
+
},
|
|
795
|
+
bindUserPrompt(prompt, choose) {
|
|
796
|
+
userPrompt = prompt;
|
|
797
|
+
userChoice = choose;
|
|
798
|
+
return () => {
|
|
799
|
+
if (userPrompt === prompt) {
|
|
800
|
+
userPrompt = undefined;
|
|
801
|
+
userChoice = undefined;
|
|
802
|
+
}
|
|
803
|
+
};
|
|
804
|
+
},
|
|
805
|
+
askUserQuestions,
|
|
806
|
+
brokerFor(interactive) {
|
|
807
|
+
// Workers follow the session's permission mode (ADR-08 revision 3): what asks in auto/full (outward writes, destructive commands) reaches the user.
|
|
808
|
+
if ((options.policyMode === "ask" || permission !== undefined) && interactive !== undefined && interactive.availability !== "headless")
|
|
809
|
+
return interactive;
|
|
810
|
+
return createHeadlessApprovalBroker({ mode: options.policyMode });
|
|
811
|
+
},
|
|
812
|
+
createDriver,
|
|
813
|
+
createSessionDriver(broker, events, wrap) {
|
|
814
|
+
return createAgentDriver({
|
|
815
|
+
events,
|
|
816
|
+
blobs,
|
|
817
|
+
router,
|
|
818
|
+
context,
|
|
819
|
+
tools: registry,
|
|
820
|
+
gateway: wrap(createToolGateway({ events, blobs, registry, policy, approvals: broker, sandbox: runner, redactionValues: () => [...redactionValues], platform, hooks: toolHooks })),
|
|
821
|
+
credentials,
|
|
822
|
+
backendApprovals: backendApprovals(broker),
|
|
823
|
+
backendRedact,
|
|
824
|
+
reasoningEffort: stepEffort,
|
|
825
|
+
});
|
|
826
|
+
},
|
|
827
|
+
sessionPolicy(commandGrants) {
|
|
828
|
+
return policy.compute({
|
|
829
|
+
mode: options.policyMode,
|
|
830
|
+
role: "session",
|
|
831
|
+
runId: undefined,
|
|
832
|
+
taskId: undefined,
|
|
833
|
+
workspaceRoot,
|
|
834
|
+
taskScope: undefined,
|
|
835
|
+
userConfig,
|
|
836
|
+
workspaceConfig,
|
|
837
|
+
sandbox,
|
|
838
|
+
grants: [],
|
|
839
|
+
commandGrants,
|
|
840
|
+
...(permission === undefined ? {} : { permissionMode: permission }),
|
|
841
|
+
});
|
|
842
|
+
},
|
|
843
|
+
permissionMode: () => permission,
|
|
844
|
+
setPermissionMode(mode) {
|
|
845
|
+
permission = mode;
|
|
846
|
+
},
|
|
847
|
+
approveGitPushForSession() {
|
|
848
|
+
gitPushApproved = true;
|
|
849
|
+
},
|
|
850
|
+
createCoordinator(broker) {
|
|
851
|
+
const driverFor = createDriver(broker);
|
|
852
|
+
return createCoordinator({
|
|
853
|
+
sessions,
|
|
854
|
+
blobs,
|
|
855
|
+
router,
|
|
856
|
+
policy,
|
|
857
|
+
approvals: broker,
|
|
858
|
+
planner: createModelPlanner({
|
|
859
|
+
createDriver: driverFor,
|
|
860
|
+
blobs,
|
|
861
|
+
projectHint: () => {
|
|
862
|
+
const known = profile.current();
|
|
863
|
+
return known === undefined ? undefined : plannerHint(known);
|
|
864
|
+
},
|
|
865
|
+
personaHint: () => renderPersonaHint(extensions.personas.list()),
|
|
866
|
+
personaTier: (agent) => personaModelTier(extensions.personas.find(agent)?.model),
|
|
867
|
+
}),
|
|
868
|
+
personas: (id) => {
|
|
869
|
+
const agent = extensions.personas.find(id);
|
|
870
|
+
return agent === undefined ? undefined : { id: agent.id, instructions: agent.body.slice(0, PERSONA_INSTRUCTIONS_LIMIT) };
|
|
871
|
+
},
|
|
872
|
+
sandbox,
|
|
873
|
+
createWorkers: createWorkerFactory({
|
|
874
|
+
sessions,
|
|
875
|
+
blobs,
|
|
876
|
+
router,
|
|
877
|
+
policy,
|
|
878
|
+
createDriver: driverFor,
|
|
879
|
+
sandbox,
|
|
880
|
+
worktreesRoot: path.join(home, "worktrees"),
|
|
881
|
+
userConfig,
|
|
882
|
+
workspaceConfig,
|
|
883
|
+
platform,
|
|
884
|
+
verification,
|
|
885
|
+
reports,
|
|
886
|
+
}),
|
|
887
|
+
budgetGate,
|
|
888
|
+
delegation,
|
|
889
|
+
userConfig,
|
|
890
|
+
workspaceConfig,
|
|
891
|
+
platform,
|
|
892
|
+
workspaceTrust: effectiveTrust,
|
|
893
|
+
...(overrides.limits === undefined ? {} : { limits: overrides.limits }),
|
|
894
|
+
});
|
|
895
|
+
},
|
|
896
|
+
routeRules: () => baseRouter.rules(),
|
|
897
|
+
async setSessionRoute(tier, role, binding) {
|
|
898
|
+
const adapter = await implicitAdapter(binding.adapter_id);
|
|
899
|
+
if (adapter === undefined)
|
|
900
|
+
throw configError(`adapter ${binding.adapter_id} is neither built in nor configured`);
|
|
901
|
+
if (adapter.providerId !== binding.provider_id)
|
|
902
|
+
throw configError(`adapter ${adapter.adapterId} belongs to ${adapter.providerId}, not ${binding.provider_id}`);
|
|
903
|
+
const identity = await identityOf(adapter.providerId, adapter.authMethod, binding.profile ?? "default", new AbortController().signal);
|
|
904
|
+
if (!identity.connected)
|
|
905
|
+
throw configError(`${adapter.providerId} (${adapter.authMethod}) is not logged in: ${identity.hint}`);
|
|
906
|
+
if (!baseRouter.hasAdapter(adapter.adapterId)) {
|
|
907
|
+
baseRouter.addAdapter(adapter);
|
|
908
|
+
if (!adapters.includes(adapter))
|
|
909
|
+
adapters.push(adapter);
|
|
910
|
+
}
|
|
911
|
+
return baseRouter.setSessionRule(tier, role, binding);
|
|
912
|
+
},
|
|
913
|
+
clearSessionRoute: (tier, role) => baseRouter.clearSessionRule(tier, role),
|
|
914
|
+
effortFor,
|
|
915
|
+
setSessionEffort(tier, level) {
|
|
916
|
+
if (level === undefined)
|
|
917
|
+
sessionEfforts.delete(tier);
|
|
918
|
+
else
|
|
919
|
+
sessionEfforts.set(tier, level);
|
|
920
|
+
},
|
|
921
|
+
setConfiguredEffort(slot, level) {
|
|
922
|
+
if (level === undefined)
|
|
923
|
+
delete configuredEffort[slot];
|
|
924
|
+
else
|
|
925
|
+
configuredEffort[slot] = level;
|
|
926
|
+
},
|
|
927
|
+
async modelCatalog(signal, catalogOptions = {}) {
|
|
928
|
+
const pool = [...adapters];
|
|
929
|
+
for (const id of Object.keys(IMPLICIT_ADAPTERS)) {
|
|
930
|
+
if (pool.some((adapter) => adapter.adapterId === id))
|
|
931
|
+
continue;
|
|
932
|
+
const built = await implicitAdapter(id).catch(() => undefined);
|
|
933
|
+
if (built !== undefined)
|
|
934
|
+
pool.push(built);
|
|
935
|
+
}
|
|
936
|
+
return buildModelCatalog({
|
|
937
|
+
adapters: pool,
|
|
938
|
+
rules: baseRouter.rules(),
|
|
939
|
+
identity: (provider, method) => identityOf(provider, method, "default", signal),
|
|
940
|
+
...(catalogOptions.listing === true
|
|
941
|
+
? {
|
|
942
|
+
listed: async (adapter) => {
|
|
943
|
+
if (adapter.kind !== "model" || adapter.authMethod !== "oauth-subscription" || adapter.providerId !== "openai")
|
|
944
|
+
return undefined;
|
|
945
|
+
const auth = authProvider("openai", "oauth-subscription", "default");
|
|
946
|
+
if (auth === undefined)
|
|
947
|
+
return undefined;
|
|
948
|
+
const credential = await auth.resolve(signal);
|
|
949
|
+
const headers = new Headers({ accept: "application/json", originator: SYNORCH_ORIGINATOR });
|
|
950
|
+
credential.applyTo(headers);
|
|
951
|
+
return fetchCodexModels(overrides.fetch ?? fetch, headers, signal, CHATGPT_CODEX_BASE_URL);
|
|
952
|
+
},
|
|
953
|
+
}
|
|
954
|
+
: {}),
|
|
955
|
+
});
|
|
956
|
+
},
|
|
957
|
+
async recover(sessionId) {
|
|
958
|
+
const isIdempotent = (name) => registry.get(name)?.metadata.idempotent ?? false;
|
|
959
|
+
const reports = [];
|
|
960
|
+
const log = await sessions.openForWrite(sessionId);
|
|
961
|
+
const attemptSessions = [];
|
|
962
|
+
try {
|
|
963
|
+
reports.push(await recoverSession(log, { isIdempotent }));
|
|
964
|
+
for await (const item of log.read()) {
|
|
965
|
+
if (item.status === "ok" && item.event.type === "attempt/started" && item.event.data.session_id !== undefined) {
|
|
966
|
+
attemptSessions.push(item.event.data.session_id);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
finally {
|
|
971
|
+
await log.close();
|
|
972
|
+
}
|
|
973
|
+
for (const attempt of attemptSessions) {
|
|
974
|
+
const events = await sessions.openForWrite(attempt).catch(() => undefined);
|
|
975
|
+
if (events === undefined)
|
|
976
|
+
continue;
|
|
977
|
+
try {
|
|
978
|
+
let last;
|
|
979
|
+
for await (const item of events.read())
|
|
980
|
+
if (item.status === "ok")
|
|
981
|
+
last = item.event;
|
|
982
|
+
if (last?.type === "turn/ended" && events.quarantinedTail === undefined)
|
|
983
|
+
continue;
|
|
984
|
+
if (last?.type === "session/resumed")
|
|
985
|
+
continue;
|
|
986
|
+
reports.push(await recoverSession(events, { isIdempotent }));
|
|
987
|
+
}
|
|
988
|
+
finally {
|
|
989
|
+
await events.close();
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
// SEC-M3: crashed attempts leave worktrees and scoped-dir writes behind; only orphans whose owner process is gone are touched.
|
|
993
|
+
await pruneOrphanedAttempts({ worktreesRoot: path.join(home, "worktrees"), projectId, workspaceRoot, platform }).catch(() => undefined);
|
|
994
|
+
return reports;
|
|
995
|
+
},
|
|
996
|
+
};
|
|
997
|
+
return runtime;
|
|
998
|
+
}
|
|
999
|
+
//# sourceMappingURL=runtime.js.map
|