approval-md 0.0.1 → 0.2.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/LICENSE +176 -0
- package/NOTICE +5 -0
- package/README.md +940 -4
- package/SPEC.md +476 -34
- package/cli.js +29 -3
- package/dist/src/adapters/agentmail.d.ts +426 -0
- package/dist/src/adapters/agentmail.js +1200 -0
- package/dist/src/adapters/agentmail.js.map +1 -0
- package/dist/src/adapters/conformance.d.ts +149 -0
- package/dist/src/adapters/conformance.js +461 -0
- package/dist/src/adapters/conformance.js.map +1 -0
- package/dist/src/adapters/contract.d.ts +628 -0
- package/dist/src/adapters/contract.js +1035 -0
- package/dist/src/adapters/contract.js.map +1 -0
- package/dist/src/adapters/email.d.ts +324 -0
- package/dist/src/adapters/email.js +749 -0
- package/dist/src/adapters/email.js.map +1 -0
- package/dist/src/adapters/env-passphrase.d.ts +93 -0
- package/dist/src/adapters/env-passphrase.js +132 -0
- package/dist/src/adapters/env-passphrase.js.map +1 -0
- package/dist/src/adapters/public.d.ts +11 -0
- package/dist/src/adapters/public.js +11 -0
- package/dist/src/adapters/public.js.map +1 -0
- package/dist/src/adapters/registry.d.ts +59 -0
- package/dist/src/adapters/registry.js +77 -0
- package/dist/src/adapters/registry.js.map +1 -0
- package/dist/src/adapters/smtp.d.ts +213 -0
- package/dist/src/adapters/smtp.js +499 -0
- package/dist/src/adapters/smtp.js.map +1 -0
- package/dist/src/adapters/vault-provider.d.ts +114 -0
- package/dist/src/adapters/vault-provider.js +161 -0
- package/dist/src/adapters/vault-provider.js.map +1 -0
- package/dist/src/adapters/zzz.d.ts +66 -0
- package/dist/src/adapters/zzz.js +299 -0
- package/dist/src/adapters/zzz.js.map +1 -0
- package/dist/src/channels/batch.d.ts +109 -0
- package/dist/src/channels/batch.js +121 -0
- package/dist/src/channels/batch.js.map +1 -0
- package/dist/src/channels/cli.d.ts +193 -0
- package/dist/src/channels/cli.js +468 -0
- package/dist/src/channels/cli.js.map +1 -0
- package/dist/src/channels/conformance.d.ts +92 -0
- package/dist/src/channels/conformance.js +445 -0
- package/dist/src/channels/conformance.js.map +1 -0
- package/dist/src/channels/contract.d.ts +623 -0
- package/dist/src/channels/contract.js +494 -0
- package/dist/src/channels/contract.js.map +1 -0
- package/dist/src/channels/payload-view.d.ts +35 -0
- package/dist/src/channels/payload-view.js +43 -0
- package/dist/src/channels/payload-view.js.map +1 -0
- package/dist/src/channels/render-queue.d.ts +149 -0
- package/dist/src/channels/render-queue.js +564 -0
- package/dist/src/channels/render-queue.js.map +1 -0
- package/dist/src/channels/tagging.d.ts +196 -0
- package/dist/src/channels/tagging.js +723 -0
- package/dist/src/channels/tagging.js.map +1 -0
- package/dist/src/channels/telegram.d.ts +1832 -0
- package/dist/src/channels/telegram.js +3190 -0
- package/dist/src/channels/telegram.js.map +1 -0
- package/dist/src/channels/web.d.ts +341 -0
- package/dist/src/channels/web.js +903 -0
- package/dist/src/channels/web.js.map +1 -0
- package/dist/src/cli/adapter.d.ts +90 -0
- package/dist/src/cli/adapter.js +288 -0
- package/dist/src/cli/adapter.js.map +1 -0
- package/dist/src/cli/amend.d.ts +59 -0
- package/dist/src/cli/amend.js +2171 -0
- package/dist/src/cli/amend.js.map +1 -0
- package/dist/src/cli/args.d.ts +43 -0
- package/dist/src/cli/args.js +86 -0
- package/dist/src/cli/args.js.map +1 -0
- package/dist/src/cli/attest.d.ts +41 -0
- package/dist/src/cli/attest.js +307 -0
- package/dist/src/cli/attest.js.map +1 -0
- package/dist/src/cli/audit-card.d.ts +62 -0
- package/dist/src/cli/audit-card.js +201 -0
- package/dist/src/cli/audit-card.js.map +1 -0
- package/dist/src/cli/audit.d.ts +59 -0
- package/dist/src/cli/audit.js +460 -0
- package/dist/src/cli/audit.js.map +1 -0
- package/dist/src/cli/channel-telegram.d.ts +806 -0
- package/dist/src/cli/channel-telegram.js +2063 -0
- package/dist/src/cli/channel-telegram.js.map +1 -0
- package/dist/src/cli/channel-web.d.ts +131 -0
- package/dist/src/cli/channel-web.js +357 -0
- package/dist/src/cli/channel-web.js.map +1 -0
- package/dist/src/cli/channel.d.ts +71 -0
- package/dist/src/cli/channel.js +438 -0
- package/dist/src/cli/channel.js.map +1 -0
- package/dist/src/cli/checkpoint-tap.d.ts +169 -0
- package/dist/src/cli/checkpoint-tap.js +238 -0
- package/dist/src/cli/checkpoint-tap.js.map +1 -0
- package/dist/src/cli/codex.d.ts +2 -0
- package/dist/src/cli/codex.js +172 -0
- package/dist/src/cli/codex.js.map +1 -0
- package/dist/src/cli/coverage.d.ts +61 -0
- package/dist/src/cli/coverage.js +343 -0
- package/dist/src/cli/coverage.js.map +1 -0
- package/dist/src/cli/daemon.d.ts +120 -0
- package/dist/src/cli/daemon.js +631 -0
- package/dist/src/cli/daemon.js.map +1 -0
- package/dist/src/cli/doctor.d.ts +129 -0
- package/dist/src/cli/doctor.js +2762 -0
- package/dist/src/cli/doctor.js.map +1 -0
- package/dist/src/cli/env.d.ts +65 -0
- package/dist/src/cli/env.js +302 -0
- package/dist/src/cli/env.js.map +1 -0
- package/dist/src/cli/execute.d.ts +202 -0
- package/dist/src/cli/execute.js +1682 -0
- package/dist/src/cli/execute.js.map +1 -0
- package/dist/src/cli/exit-codes.d.ts +73 -0
- package/dist/src/cli/exit-codes.js +82 -0
- package/dist/src/cli/exit-codes.js.map +1 -0
- package/dist/src/cli/feedback.d.ts +60 -0
- package/dist/src/cli/feedback.js +205 -0
- package/dist/src/cli/feedback.js.map +1 -0
- package/dist/src/cli/gate-window.d.ts +40 -0
- package/dist/src/cli/gate-window.js +294 -0
- package/dist/src/cli/gate-window.js.map +1 -0
- package/dist/src/cli/gate.d.ts +68 -0
- package/dist/src/cli/gate.js +557 -0
- package/dist/src/cli/gate.js.map +1 -0
- package/dist/src/cli/git-scope.d.ts +190 -0
- package/dist/src/cli/git-scope.js +295 -0
- package/dist/src/cli/git-scope.js.map +1 -0
- package/dist/src/cli/gloss-attach.d.ts +85 -0
- package/dist/src/cli/gloss-attach.js +107 -0
- package/dist/src/cli/gloss-attach.js.map +1 -0
- package/dist/src/cli/gloss-codex-child.d.ts +9 -0
- package/dist/src/cli/gloss-codex-child.js +149 -0
- package/dist/src/cli/gloss-codex-child.js.map +1 -0
- package/dist/src/cli/gloss-codex.d.ts +24 -0
- package/dist/src/cli/gloss-codex.js +255 -0
- package/dist/src/cli/gloss-codex.js.map +1 -0
- package/dist/src/cli/gloss-options.d.ts +42 -0
- package/dist/src/cli/gloss-options.js +79 -0
- package/dist/src/cli/gloss-options.js.map +1 -0
- package/dist/src/cli/gloss.d.ts +265 -0
- package/dist/src/cli/gloss.js +362 -0
- package/dist/src/cli/gloss.js.map +1 -0
- package/dist/src/cli/help.d.ts +103 -0
- package/dist/src/cli/help.js +2339 -0
- package/dist/src/cli/help.js.map +1 -0
- package/dist/src/cli/hook-codex.d.ts +78 -0
- package/dist/src/cli/hook-codex.js +167 -0
- package/dist/src/cli/hook-codex.js.map +1 -0
- package/dist/src/cli/hook.d.ts +331 -0
- package/dist/src/cli/hook.js +2849 -0
- package/dist/src/cli/hook.js.map +1 -0
- package/dist/src/cli/import.d.ts +35 -0
- package/dist/src/cli/import.js +175 -0
- package/dist/src/cli/import.js.map +1 -0
- package/dist/src/cli/init.d.ts +84 -0
- package/dist/src/cli/init.js +336 -0
- package/dist/src/cli/init.js.map +1 -0
- package/dist/src/cli/instructions.d.ts +23 -0
- package/dist/src/cli/instructions.js +262 -0
- package/dist/src/cli/instructions.js.map +1 -0
- package/dist/src/cli/journal.d.ts +41 -0
- package/dist/src/cli/journal.js +238 -0
- package/dist/src/cli/journal.js.map +1 -0
- package/dist/src/cli/log-advance.d.ts +287 -0
- package/dist/src/cli/log-advance.js +840 -0
- package/dist/src/cli/log-advance.js.map +1 -0
- package/dist/src/cli/log-anchor.d.ts +176 -0
- package/dist/src/cli/log-anchor.js +387 -0
- package/dist/src/cli/log-anchor.js.map +1 -0
- package/dist/src/cli/log-checkpoint.d.ts +22 -0
- package/dist/src/cli/log-checkpoint.js +128 -0
- package/dist/src/cli/log-checkpoint.js.map +1 -0
- package/dist/src/cli/log-sync.d.ts +243 -0
- package/dist/src/cli/log-sync.js +849 -0
- package/dist/src/cli/log-sync.js.map +1 -0
- package/dist/src/cli/log-verbs.d.ts +16 -0
- package/dist/src/cli/log-verbs.js +360 -0
- package/dist/src/cli/log-verbs.js.map +1 -0
- package/dist/src/cli/long-help.d.ts +70 -0
- package/dist/src/cli/long-help.js +148 -0
- package/dist/src/cli/long-help.js.map +1 -0
- package/dist/src/cli/main.d.ts +77 -0
- package/dist/src/cli/main.js +1206 -0
- package/dist/src/cli/main.js.map +1 -0
- package/dist/src/cli/mcp.d.ts +52 -0
- package/dist/src/cli/mcp.js +306 -0
- package/dist/src/cli/mcp.js.map +1 -0
- package/dist/src/cli/paths.d.ts +56 -0
- package/dist/src/cli/paths.js +79 -0
- package/dist/src/cli/paths.js.map +1 -0
- package/dist/src/cli/payload.d.ts +58 -0
- package/dist/src/cli/payload.js +253 -0
- package/dist/src/cli/payload.js.map +1 -0
- package/dist/src/cli/policy.d.ts +43 -0
- package/dist/src/cli/policy.js +229 -0
- package/dist/src/cli/policy.js.map +1 -0
- package/dist/src/cli/preflight.d.ts +363 -0
- package/dist/src/cli/preflight.js +1175 -0
- package/dist/src/cli/preflight.js.map +1 -0
- package/dist/src/cli/progress.d.ts +78 -0
- package/dist/src/cli/progress.js +112 -0
- package/dist/src/cli/progress.js.map +1 -0
- package/dist/src/cli/prompt.d.ts +209 -0
- package/dist/src/cli/prompt.js +312 -0
- package/dist/src/cli/prompt.js.map +1 -0
- package/dist/src/cli/quickstart.d.ts +46 -0
- package/dist/src/cli/quickstart.js +297 -0
- package/dist/src/cli/quickstart.js.map +1 -0
- package/dist/src/cli/records.d.ts +34 -0
- package/dist/src/cli/records.js +66 -0
- package/dist/src/cli/records.js.map +1 -0
- package/dist/src/cli/render.d.ts +22 -0
- package/dist/src/cli/render.js +132 -0
- package/dist/src/cli/render.js.map +1 -0
- package/dist/src/cli/sandbox.d.ts +51 -0
- package/dist/src/cli/sandbox.js +150 -0
- package/dist/src/cli/sandbox.js.map +1 -0
- package/dist/src/cli/scaffold.d.ts +79 -0
- package/dist/src/cli/scaffold.js +137 -0
- package/dist/src/cli/scaffold.js.map +1 -0
- package/dist/src/cli/setup-adapter.d.ts +137 -0
- package/dist/src/cli/setup-adapter.js +509 -0
- package/dist/src/cli/setup-adapter.js.map +1 -0
- package/dist/src/cli/setup-channel.d.ts +117 -0
- package/dist/src/cli/setup-channel.js +635 -0
- package/dist/src/cli/setup-channel.js.map +1 -0
- package/dist/src/cli/setup-checkpoint.d.ts +57 -0
- package/dist/src/cli/setup-checkpoint.js +196 -0
- package/dist/src/cli/setup-checkpoint.js.map +1 -0
- package/dist/src/cli/setup-common.d.ts +275 -0
- package/dist/src/cli/setup-common.js +376 -0
- package/dist/src/cli/setup-common.js.map +1 -0
- package/dist/src/cli/setup-flow.d.ts +287 -0
- package/dist/src/cli/setup-flow.js +476 -0
- package/dist/src/cli/setup-flow.js.map +1 -0
- package/dist/src/cli/setup-service.d.ts +96 -0
- package/dist/src/cli/setup-service.js +308 -0
- package/dist/src/cli/setup-service.js.map +1 -0
- package/dist/src/cli/setup.d.ts +202 -0
- package/dist/src/cli/setup.js +473 -0
- package/dist/src/cli/setup.js.map +1 -0
- package/dist/src/cli/style.d.ts +320 -0
- package/dist/src/cli/style.js +469 -0
- package/dist/src/cli/style.js.map +1 -0
- package/dist/src/cli/token.d.ts +39 -0
- package/dist/src/cli/token.js +274 -0
- package/dist/src/cli/token.js.map +1 -0
- package/dist/src/cli/up.d.ts +155 -0
- package/dist/src/cli/up.js +849 -0
- package/dist/src/cli/up.js.map +1 -0
- package/dist/src/cli/usage.d.ts +37 -0
- package/dist/src/cli/usage.js +91 -0
- package/dist/src/cli/usage.js.map +1 -0
- package/dist/src/cli/values.d.ts +40 -0
- package/dist/src/cli/values.js +189 -0
- package/dist/src/cli/values.js.map +1 -0
- package/dist/src/cli/vault.d.ts +59 -0
- package/dist/src/cli/vault.js +362 -0
- package/dist/src/cli/vault.js.map +1 -0
- package/dist/src/cli/verb-registry.d.ts +76 -0
- package/dist/src/cli/verb-registry.js +2341 -0
- package/dist/src/cli/verb-registry.js.map +1 -0
- package/dist/src/cli/wordmark.d.ts +31 -0
- package/dist/src/cli/wordmark.js +52 -0
- package/dist/src/cli/wordmark.js.map +1 -0
- package/dist/src/codex/doctor.d.ts +13 -0
- package/dist/src/codex/doctor.js +41 -0
- package/dist/src/codex/doctor.js.map +1 -0
- package/dist/src/codex/manifest.d.ts +49 -0
- package/dist/src/codex/manifest.js +103 -0
- package/dist/src/codex/manifest.js.map +1 -0
- package/dist/src/codex/templates.d.ts +41 -0
- package/dist/src/codex/templates.js +319 -0
- package/dist/src/codex/templates.js.map +1 -0
- package/dist/src/codex/trust.d.ts +19 -0
- package/dist/src/codex/trust.js +183 -0
- package/dist/src/codex/trust.js.map +1 -0
- package/dist/src/codex/workspace-plan.d.ts +131 -0
- package/dist/src/codex/workspace-plan.js +561 -0
- package/dist/src/codex/workspace-plan.js.map +1 -0
- package/dist/src/core/actor.d.ts +2 -0
- package/dist/src/core/actor.js +5 -0
- package/dist/src/core/actor.js.map +1 -0
- package/dist/src/core/advance-cycle.d.ts +170 -0
- package/dist/src/core/advance-cycle.js +200 -0
- package/dist/src/core/advance-cycle.js.map +1 -0
- package/dist/src/core/agents-md.d.ts +276 -0
- package/dist/src/core/agents-md.js +747 -0
- package/dist/src/core/agents-md.js.map +1 -0
- package/dist/src/core/apply-patch.d.ts +49 -0
- package/dist/src/core/apply-patch.js +266 -0
- package/dist/src/core/apply-patch.js.map +1 -0
- package/dist/src/core/attest.d.ts +420 -0
- package/dist/src/core/attest.js +589 -0
- package/dist/src/core/attest.js.map +1 -0
- package/dist/src/core/audit.d.ts +492 -0
- package/dist/src/core/audit.js +882 -0
- package/dist/src/core/audit.js.map +1 -0
- package/dist/src/core/budgets.d.ts +238 -0
- package/dist/src/core/budgets.js +449 -0
- package/dist/src/core/budgets.js.map +1 -0
- package/dist/src/core/checkpoint.d.ts +500 -0
- package/dist/src/core/checkpoint.js +738 -0
- package/dist/src/core/checkpoint.js.map +1 -0
- package/dist/src/core/child-env.d.ts +88 -0
- package/dist/src/core/child-env.js +86 -0
- package/dist/src/core/child-env.js.map +1 -0
- package/dist/src/core/clock.d.ts +52 -0
- package/dist/src/core/clock.js +43 -0
- package/dist/src/core/clock.js.map +1 -0
- package/dist/src/core/command-class.d.ts +543 -0
- package/dist/src/core/command-class.js +2356 -0
- package/dist/src/core/command-class.js.map +1 -0
- package/dist/src/core/coverage-sources/adapter.d.ts +40 -0
- package/dist/src/core/coverage-sources/adapter.js +71 -0
- package/dist/src/core/coverage-sources/adapter.js.map +1 -0
- package/dist/src/core/coverage-sources/gh.d.ts +48 -0
- package/dist/src/core/coverage-sources/gh.js +136 -0
- package/dist/src/core/coverage-sources/gh.js.map +1 -0
- package/dist/src/core/coverage-sources/git.d.ts +101 -0
- package/dist/src/core/coverage-sources/git.js +269 -0
- package/dist/src/core/coverage-sources/git.js.map +1 -0
- package/dist/src/core/coverage.d.ts +217 -0
- package/dist/src/core/coverage.js +337 -0
- package/dist/src/core/coverage.js.map +1 -0
- package/dist/src/core/credential-spec.d.ts +72 -0
- package/dist/src/core/credential-spec.js +23 -0
- package/dist/src/core/credential-spec.js.map +1 -0
- package/dist/src/core/dark-session.d.ts +331 -0
- package/dist/src/core/dark-session.js +714 -0
- package/dist/src/core/dark-session.js.map +1 -0
- package/dist/src/core/decision-refusal.d.ts +185 -0
- package/dist/src/core/decision-refusal.js +265 -0
- package/dist/src/core/decision-refusal.js.map +1 -0
- package/dist/src/core/env-file.d.ts +450 -0
- package/dist/src/core/env-file.js +837 -0
- package/dist/src/core/env-file.js.map +1 -0
- package/dist/src/core/execute.d.ts +858 -0
- package/dist/src/core/execute.js +1271 -0
- package/dist/src/core/execute.js.map +1 -0
- package/dist/src/core/frontmatter.d.ts +78 -0
- package/dist/src/core/frontmatter.js +100 -0
- package/dist/src/core/frontmatter.js.map +1 -0
- package/dist/src/core/gate-window.d.ts +312 -0
- package/dist/src/core/gate-window.js +506 -0
- package/dist/src/core/gate-window.js.map +1 -0
- package/dist/src/core/gate.d.ts +1364 -0
- package/dist/src/core/gate.js +3002 -0
- package/dist/src/core/gate.js.map +1 -0
- package/dist/src/core/git-run.d.ts +73 -0
- package/dist/src/core/git-run.js +93 -0
- package/dist/src/core/git-run.js.map +1 -0
- package/dist/src/core/harness-version.d.ts +157 -0
- package/dist/src/core/harness-version.js +211 -0
- package/dist/src/core/harness-version.js.map +1 -0
- package/dist/src/core/harness-wait.d.ts +55 -0
- package/dist/src/core/harness-wait.js +58 -0
- package/dist/src/core/harness-wait.js.map +1 -0
- package/dist/src/core/head-retry.d.ts +107 -0
- package/dist/src/core/head-retry.js +121 -0
- package/dist/src/core/head-retry.js.map +1 -0
- package/dist/src/core/instance.d.ts +253 -0
- package/dist/src/core/instance.js +319 -0
- package/dist/src/core/instance.js.map +1 -0
- package/dist/src/core/intake-limits.d.ts +247 -0
- package/dist/src/core/intake-limits.js +350 -0
- package/dist/src/core/intake-limits.js.map +1 -0
- package/dist/src/core/jcs.d.ts +52 -0
- package/dist/src/core/jcs.js +132 -0
- package/dist/src/core/jcs.js.map +1 -0
- package/dist/src/core/journal.d.ts +144 -0
- package/dist/src/core/journal.js +200 -0
- package/dist/src/core/journal.js.map +1 -0
- package/dist/src/core/live-draw.d.ts +436 -0
- package/dist/src/core/live-draw.js +703 -0
- package/dist/src/core/live-draw.js.map +1 -0
- package/dist/src/core/log-reconcile.d.ts +89 -0
- package/dist/src/core/log-reconcile.js +136 -0
- package/dist/src/core/log-reconcile.js.map +1 -0
- package/dist/src/core/log-subscribe.d.ts +36 -0
- package/dist/src/core/log-subscribe.js +162 -0
- package/dist/src/core/log-subscribe.js.map +1 -0
- package/dist/src/core/log.d.ts +278 -0
- package/dist/src/core/log.js +546 -0
- package/dist/src/core/log.js.map +1 -0
- package/dist/src/core/loop.d.ts +274 -0
- package/dist/src/core/loop.js +487 -0
- package/dist/src/core/loop.js.map +1 -0
- package/dist/src/core/md-fence.d.ts +41 -0
- package/dist/src/core/md-fence.js +74 -0
- package/dist/src/core/md-fence.js.map +1 -0
- package/dist/src/core/money.d.ts +147 -0
- package/dist/src/core/money.js +195 -0
- package/dist/src/core/money.js.map +1 -0
- package/dist/src/core/payload-census.d.ts +74 -0
- package/dist/src/core/payload-census.js +146 -0
- package/dist/src/core/payload-census.js.map +1 -0
- package/dist/src/core/payload-store.d.ts +175 -0
- package/dist/src/core/payload-store.js +340 -0
- package/dist/src/core/payload-store.js.map +1 -0
- package/dist/src/core/payload.d.ts +71 -0
- package/dist/src/core/payload.js +80 -0
- package/dist/src/core/payload.js.map +1 -0
- package/dist/src/core/policy-diff.d.ts +292 -0
- package/dist/src/core/policy-diff.js +588 -0
- package/dist/src/core/policy-diff.js.map +1 -0
- package/dist/src/core/policy-expectations.d.ts +199 -0
- package/dist/src/core/policy-expectations.js +394 -0
- package/dist/src/core/policy-expectations.js.map +1 -0
- package/dist/src/core/policy-explain.d.ts +150 -0
- package/dist/src/core/policy-explain.js +258 -0
- package/dist/src/core/policy-explain.js.map +1 -0
- package/dist/src/core/policy-load.d.ts +527 -0
- package/dist/src/core/policy-load.js +536 -0
- package/dist/src/core/policy-load.js.map +1 -0
- package/dist/src/core/policy-match.d.ts +281 -0
- package/dist/src/core/policy-match.js +478 -0
- package/dist/src/core/policy-match.js.map +1 -0
- package/dist/src/core/policy-proposal.d.ts +265 -0
- package/dist/src/core/policy-proposal.js +458 -0
- package/dist/src/core/policy-proposal.js.map +1 -0
- package/dist/src/core/prompt-layout.d.ts +221 -0
- package/dist/src/core/prompt-layout.js +422 -0
- package/dist/src/core/prompt-layout.js.map +1 -0
- package/dist/src/core/protected-path-guard.d.ts +453 -0
- package/dist/src/core/protected-path-guard.js +1566 -0
- package/dist/src/core/protected-path-guard.js.map +1 -0
- package/dist/src/core/registration.d.ts +25 -0
- package/dist/src/core/registration.js +39 -0
- package/dist/src/core/registration.js.map +1 -0
- package/dist/src/core/reindex.d.ts +99 -0
- package/dist/src/core/reindex.js +336 -0
- package/dist/src/core/reindex.js.map +1 -0
- package/dist/src/core/sampler.d.ts +313 -0
- package/dist/src/core/sampler.js +388 -0
- package/dist/src/core/sampler.js.map +1 -0
- package/dist/src/core/sandbox.d.ts +290 -0
- package/dist/src/core/sandbox.js +424 -0
- package/dist/src/core/sandbox.js.map +1 -0
- package/dist/src/core/seal.d.ts +165 -0
- package/dist/src/core/seal.js +290 -0
- package/dist/src/core/seal.js.map +1 -0
- package/dist/src/core/state.d.ts +505 -0
- package/dist/src/core/state.js +1009 -0
- package/dist/src/core/state.js.map +1 -0
- package/dist/src/core/task-file.d.ts +185 -0
- package/dist/src/core/task-file.js +464 -0
- package/dist/src/core/task-file.js.map +1 -0
- package/dist/src/core/telegram-config.d.ts +93 -0
- package/dist/src/core/telegram-config.js +114 -0
- package/dist/src/core/telegram-config.js.map +1 -0
- package/dist/src/core/token.d.ts +409 -0
- package/dist/src/core/token.js +561 -0
- package/dist/src/core/token.js.map +1 -0
- package/dist/src/core/validate.d.ts +138 -0
- package/dist/src/core/validate.js +0 -0
- package/dist/src/core/validate.js.map +1 -0
- package/dist/src/core/values.d.ts +137 -0
- package/dist/src/core/values.js +153 -0
- package/dist/src/core/values.js.map +1 -0
- package/dist/src/core/vault.d.ts +291 -0
- package/dist/src/core/vault.js +612 -0
- package/dist/src/core/vault.js.map +1 -0
- package/dist/src/core/verified-snapshot.d.ts +204 -0
- package/dist/src/core/verified-snapshot.js +506 -0
- package/dist/src/core/verified-snapshot.js.map +1 -0
- package/dist/src/core/verify.d.ts +336 -0
- package/dist/src/core/verify.js +549 -0
- package/dist/src/core/verify.js.map +1 -0
- package/dist/src/core/version.d.ts +8 -0
- package/dist/src/core/version.js +9 -0
- package/dist/src/core/version.js.map +1 -0
- package/dist/src/core/wysiwys.d.ts +370 -0
- package/dist/src/core/wysiwys.js +728 -0
- package/dist/src/core/wysiwys.js.map +1 -0
- package/dist/src/daemon/advance-child.d.ts +39 -0
- package/dist/src/daemon/advance-child.js +78 -0
- package/dist/src/daemon/advance-child.js.map +1 -0
- package/dist/src/daemon/advance.d.ts +466 -0
- package/dist/src/daemon/advance.js +849 -0
- package/dist/src/daemon/advance.js.map +1 -0
- package/dist/src/daemon/audit.d.ts +87 -0
- package/dist/src/daemon/audit.js +90 -0
- package/dist/src/daemon/audit.js.map +1 -0
- package/dist/src/daemon/daemon.d.ts +1180 -0
- package/dist/src/daemon/daemon.js +1988 -0
- package/dist/src/daemon/daemon.js.map +1 -0
- package/dist/src/daemon/dark-session.d.ts +64 -0
- package/dist/src/daemon/dark-session.js +119 -0
- package/dist/src/daemon/dark-session.js.map +1 -0
- package/dist/src/daemon/draw-child.d.ts +36 -0
- package/dist/src/daemon/draw-child.js +132 -0
- package/dist/src/daemon/draw-child.js.map +1 -0
- package/dist/src/daemon/draw.d.ts +154 -0
- package/dist/src/daemon/draw.js +458 -0
- package/dist/src/daemon/draw.js.map +1 -0
- package/dist/src/daemon/git-evidence.d.ts +173 -0
- package/dist/src/daemon/git-evidence.js +345 -0
- package/dist/src/daemon/git-evidence.js.map +1 -0
- package/dist/src/daemon/projection.d.ts +180 -0
- package/dist/src/daemon/projection.js +233 -0
- package/dist/src/daemon/projection.js.map +1 -0
- package/dist/src/daemon/prune.d.ts +207 -0
- package/dist/src/daemon/prune.js +376 -0
- package/dist/src/daemon/prune.js.map +1 -0
- package/dist/src/mcp/http.d.ts +113 -0
- package/dist/src/mcp/http.js +343 -0
- package/dist/src/mcp/http.js.map +1 -0
- package/dist/src/mcp/server.d.ts +265 -0
- package/dist/src/mcp/server.js +602 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/docs/adapter-api.md +106 -0
- package/docs/cli-reference.md +5716 -0
- package/docs/codex-enforced-session.md +30 -0
- package/package.json +53 -4
- package/schema/.gitkeep +0 -0
- package/schema/LICENSE +117 -0
- package/schema/codex-instance.schema.json +82 -0
- package/schema/envelope.schema.json +137 -0
- package/schema/event.schema.json +1811 -0
- package/schema/fixtures/codex-instance/invalid/unpinned-codex-version.json +40 -0
- package/schema/fixtures/codex-instance/valid/canonical.json +40 -0
- package/schema/fixtures/envelope/invalid/action-missing-idempotency-key.json +15 -0
- package/schema/fixtures/envelope/invalid/action-unknown-class-format.json +14 -0
- package/schema/fixtures/envelope/invalid/confidence-out-of-range.json +11 -0
- package/schema/fixtures/envelope/invalid/est-cost-bare-number.json +14 -0
- package/schema/fixtures/envelope/invalid/est-cost-noncanonical-string.json +14 -0
- package/schema/fixtures/envelope/invalid/malformed-assignee.json +10 -0
- package/schema/fixtures/envelope/invalid/malformed-created-by.json +7 -0
- package/schema/fixtures/envelope/invalid/malformed-max-latency.json +11 -0
- package/schema/fixtures/envelope/invalid/malformed-payload-hash.json +14 -0
- package/schema/fixtures/envelope/invalid/max-cost-bare-number.json +11 -0
- package/schema/fixtures/envelope/invalid/missing-origin.json +3 -0
- package/schema/fixtures/envelope/invalid/negative-est-cost.json +14 -0
- package/schema/fixtures/envelope/invalid/unknown-state.json +7 -0
- package/schema/fixtures/envelope/invalid/unknown-top-level-field.json +8 -0
- package/schema/fixtures/envelope/valid/action-payload-hash.json +17 -0
- package/schema/fixtures/envelope/valid/actions-without-budget.json +18 -0
- package/schema/fixtures/envelope/valid/canonical.json +25 -0
- package/schema/fixtures/envelope/valid/minimal.json +7 -0
- package/schema/fixtures/envelope/valid/multi-action-executed.json +30 -0
- package/schema/fixtures/envelope/valid/record-write-stage.json +22 -0
- package/schema/fixtures/event/invalid/approval-granted-agent-actor.json +15 -0
- package/schema/fixtures/event/invalid/approval-granted-empty-batch-delivery-id.json +17 -0
- package/schema/fixtures/event/invalid/approval-granted-fifth-reaction.json +16 -0
- package/schema/fixtures/event/invalid/approval-granted-missing-actor.json +14 -0
- package/schema/fixtures/event/invalid/approval-requested-missing-action-key.json +14 -0
- package/schema/fixtures/event/invalid/approval-withdrawn-agent-policy-drift.json +15 -0
- package/schema/fixtures/event/invalid/approval-withdrawn-missing-reason.json +15 -0
- package/schema/fixtures/event/invalid/approval-withdrawn-system-actor.json +15 -0
- package/schema/fixtures/event/invalid/audit-decision-refused-human-actor.json +17 -0
- package/schema/fixtures/event/invalid/audit-decision-refused-missing-code.json +16 -0
- package/schema/fixtures/event/invalid/audit-reviewed-agent-actor.json +15 -0
- package/schema/fixtures/event/invalid/audit-reviewed-loved-no-note.json +16 -0
- package/schema/fixtures/event/invalid/audit-reviewed-system-actor.json +15 -0
- package/schema/fixtures/event/invalid/bad-actor-prefix.json +15 -0
- package/schema/fixtures/event/invalid/est-cost-bare-number.json +17 -0
- package/schema/fixtures/event/invalid/execution-completed-fabricated-exit-code.json +16 -0
- package/schema/fixtures/event/invalid/execution-completed-provider-ref-empty-id.json +18 -0
- package/schema/fixtures/event/invalid/execution-completed-provider-ref-extra-field.json +19 -0
- package/schema/fixtures/event/invalid/execution-completed-provider-ref-id-not-string.json +18 -0
- package/schema/fixtures/event/invalid/execution-completed-provider-ref-missing-adapter.json +17 -0
- package/schema/fixtures/event/invalid/execution-failed-open-reported-by.json +16 -0
- package/schema/fixtures/event/invalid/execution-indeterminate-open-reason.json +14 -0
- package/schema/fixtures/event/invalid/execution-reconciled-agent-actor.json +17 -0
- package/schema/fixtures/event/invalid/execution-started-negative-env-stripped.json +16 -0
- package/schema/fixtures/event/invalid/gate-bypassed-missing-opened-seq.json +15 -0
- package/schema/fixtures/event/invalid/gate-closed-non-integer-opened-seq.json +13 -0
- package/schema/fixtures/event/invalid/gate-opened-agent-actor.json +16 -0
- package/schema/fixtures/event/invalid/gate-organ-attested-absolute-path.json +14 -0
- package/schema/fixtures/event/invalid/gate-organ-attested-agent-actor.json +14 -0
- package/schema/fixtures/event/invalid/gate-organ-attested-missing-organ-path.json +13 -0
- package/schema/fixtures/event/invalid/harness-unknown-kind.json +18 -0
- package/schema/fixtures/event/invalid/harness-version-multiline.json +16 -0
- package/schema/fixtures/event/invalid/log-checkpoint-agent-actor.json +17 -0
- package/schema/fixtures/event/invalid/log-checkpoint-missing-signature.json +16 -0
- package/schema/fixtures/event/invalid/log-checkpoint-short-signed-hash.json +17 -0
- package/schema/fixtures/event/invalid/log-checkpoint-unknown-signature-alg.json +17 -0
- package/schema/fixtures/event/invalid/malformed-ts.json +15 -0
- package/schema/fixtures/event/invalid/missing-alg.json +14 -0
- package/schema/fixtures/event/invalid/missing-hash.json +14 -0
- package/schema/fixtures/event/invalid/non-integer-seq.json +15 -0
- package/schema/fixtures/event/invalid/payload-pruned-human-actor.json +14 -0
- package/schema/fixtures/event/invalid/payload-pruned-missing-hash.json +14 -0
- package/schema/fixtures/event/invalid/policy-declined-agent-actor.json +15 -0
- package/schema/fixtures/event/invalid/policy-proposed-missing-diff.json +19 -0
- package/schema/fixtures/event/invalid/policy-proposed-system-actor.json +26 -0
- package/schema/fixtures/event/invalid/short-hash.json +15 -0
- package/schema/fixtures/event/invalid/unknown-alg.json +15 -0
- package/schema/fixtures/event/invalid/unknown-event-type.json +15 -0
- package/schema/fixtures/event/invalid/unknown-top-level-field.json +16 -0
- package/schema/fixtures/event/valid/approval-expired.json +15 -0
- package/schema/fixtures/event/valid/approval-granted-batch.json +19 -0
- package/schema/fixtures/event/valid/approval-granted-reaction.json +16 -0
- package/schema/fixtures/event/valid/approval-granted.json +15 -0
- package/schema/fixtures/event/valid/approval-rejected.json +15 -0
- package/schema/fixtures/event/valid/approval-requested.json +19 -0
- package/schema/fixtures/event/valid/approval-revoked.json +15 -0
- package/schema/fixtures/event/valid/approval-withdrawn-policy-drift.json +17 -0
- package/schema/fixtures/event/valid/approval-withdrawn.json +16 -0
- package/schema/fixtures/event/valid/audit-decision-refused.json +20 -0
- package/schema/fixtures/event/valid/audit-reviewed-reaction.json +17 -0
- package/schema/fixtures/event/valid/audit-reviewed.json +15 -0
- package/schema/fixtures/event/valid/audit-sampled.json +14 -0
- package/schema/fixtures/event/valid/budget-exceeded.json +21 -0
- package/schema/fixtures/event/valid/envelope-drift.json +16 -0
- package/schema/fixtures/event/valid/execution-completed-harness-report.json +16 -0
- package/schema/fixtures/event/valid/execution-completed-provider-ref.json +18 -0
- package/schema/fixtures/event/valid/execution-completed.json +15 -0
- package/schema/fixtures/event/valid/execution-failed-harness-report.json +16 -0
- package/schema/fixtures/event/valid/execution-failed.json +15 -0
- package/schema/fixtures/event/valid/execution-indeterminate.json +15 -0
- package/schema/fixtures/event/valid/execution-reconciled.json +17 -0
- package/schema/fixtures/event/valid/execution-started-env-stripped.json +17 -0
- package/schema/fixtures/event/valid/execution-started.json +14 -0
- package/schema/fixtures/event/valid/gate-bypassed-harness-version.json +18 -0
- package/schema/fixtures/event/valid/gate-bypassed.json +19 -0
- package/schema/fixtures/event/valid/gate-closed.json +14 -0
- package/schema/fixtures/event/valid/gate-opened.json +16 -0
- package/schema/fixtures/event/valid/gate-organ-attested.json +14 -0
- package/schema/fixtures/event/valid/genesis-null-prev.json +14 -0
- package/schema/fixtures/event/valid/log-checkpoint.json +17 -0
- package/schema/fixtures/event/valid/payload-pruned-orphan.json +13 -0
- package/schema/fixtures/event/valid/payload-pruned.json +17 -0
- package/schema/fixtures/event/valid/policy-declined.json +16 -0
- package/schema/fixtures/event/valid/policy-proposed.json +35 -0
- package/schema/fixtures/event/valid/policy-updated.json +14 -0
- package/schema/fixtures/event/valid/reconciliation-required.json +18 -0
- package/schema/fixtures/event/valid/reconciliation-satisfied.json +17 -0
- package/schema/fixtures/event/valid/route-accepted.json +15 -0
- package/schema/fixtures/event/valid/route-proposed.json +16 -0
- package/schema/fixtures/event/valid/spec-example.json +15 -0
- package/schema/fixtures/event/valid/task-registered-harness-version.json +23 -0
- package/schema/fixtures/event/valid/task-registered.json +14 -0
- package/schema/fixtures/hash/known-answer-pre-121.json +74 -0
- package/schema/fixtures/hash/known-answer.json +74 -0
- package/schema/fixtures/policy/invalid/bad-approval-ttl.json +7 -0
- package/schema/fixtures/policy/invalid/bad-web-port.json +4 -0
- package/schema/fixtures/policy/invalid/checkpoint-key-not-base64.json +6 -0
- package/schema/fixtures/policy/invalid/class-rule-missing-autonomy.json +9 -0
- package/schema/fixtures/policy/invalid/empty-class-key.json +6 -0
- package/schema/fixtures/policy/invalid/live-rate-on-human-only.json +7 -0
- package/schema/fixtures/policy/invalid/malformed-class-key.json +6 -0
- package/schema/fixtures/policy/invalid/missing-version.json +8 -0
- package/schema/fixtures/policy/invalid/negative-limit.json +9 -0
- package/schema/fixtures/policy/invalid/non-numeric-limit.json +9 -0
- package/schema/fixtures/policy/invalid/non-positive-max-pending.json +9 -0
- package/schema/fixtures/policy/invalid/on-expiry-grant.json +8 -0
- package/schema/fixtures/policy/invalid/payload-retention-bare-number.json +4 -0
- package/schema/fixtures/policy/invalid/payload-retention-compound.json +4 -0
- package/schema/fixtures/policy/invalid/payload-retention-fractional.json +4 -0
- package/schema/fixtures/policy/invalid/payload-retention-zero.json +4 -0
- package/schema/fixtures/policy/invalid/protected-paths-escape.json +4 -0
- package/schema/fixtures/policy/invalid/protected-paths-glob.json +4 -0
- package/schema/fixtures/policy/invalid/retro-rate-on-human-only.json +7 -0
- package/schema/fixtures/policy/invalid/retro-rate-on-manual.json +7 -0
- package/schema/fixtures/policy/invalid/retro-rate-zero.json +7 -0
- package/schema/fixtures/policy/invalid/sample-rate-too-high.json +5 -0
- package/schema/fixtures/policy/invalid/sampling-secret-env-empty.json +7 -0
- package/schema/fixtures/policy/invalid/sampling-secret-env-not-string.json +6 -0
- package/schema/fixtures/policy/invalid/skew-tolerance-compound.json +6 -0
- package/schema/fixtures/policy/invalid/unknown-autonomy.json +7 -0
- package/schema/fixtures/policy/invalid/unknown-class-rule-key.json +6 -0
- package/schema/fixtures/policy/invalid/unknown-top-level-key.json +7 -0
- package/schema/fixtures/policy/invalid/vault-passphrase-env-empty.json +6 -0
- package/schema/fixtures/policy/invalid/vault-passphrase-literal.json +6 -0
- package/schema/fixtures/policy/invalid/version-not-string.json +4 -0
- package/schema/fixtures/policy/valid/canonical.json +47 -0
- package/schema/fixtures/policy/valid/checkpoint-keys.json +18 -0
- package/schema/fixtures/policy/valid/class-approvers-limits.json +25 -0
- package/schema/fixtures/policy/valid/class-retro-rate.json +17 -0
- package/schema/fixtures/policy/valid/global-budgets.json +19 -0
- package/schema/fixtures/policy/valid/human-only.json +9 -0
- package/schema/fixtures/policy/valid/minimal.json +6 -0
- package/schema/fixtures/policy/valid/protected-paths.json +10 -0
- package/schema/fixtures/policy/valid/record-namespace.json +13 -0
- package/schema/fixtures/policy/valid/request-volume-limits.json +26 -0
- package/schema/fixtures/policy/valid/retention-and-sampling-secret.json +16 -0
- package/schema/fixtures/policy/valid/skew-tolerance.json +15 -0
- package/schema/fixtures/policy/valid/vault-passphrase-env.json +14 -0
- package/schema/fixtures/policy/valid/wildcards.json +15 -0
- package/schema/fixtures/policy-md/invalid/alias-bomb.md +15 -0
- package/schema/fixtures/policy-md/invalid/no-fence.md +7 -0
- package/schema/fixtures/policy-md/invalid/protected-route-not-a-subclass.md +16 -0
- package/schema/fixtures/policy-md/invalid/schema-invalid-autonomy.md +16 -0
- package/schema/fixtures/policy-md/invalid/schema-invalid-read-proof.md +17 -0
- package/schema/fixtures/policy-md/invalid/two-fences.md +19 -0
- package/schema/fixtures/policy-md/invalid/unclosed-fence.md +11 -0
- package/schema/fixtures/policy-md/invalid/wrong-info-string.md +11 -0
- package/schema/fixtures/policy-md/invalid/yaml-syntax-error.md +13 -0
- package/schema/fixtures/policy-md/precedence/both/APPROVAL.md +7 -0
- package/schema/fixtures/policy-md/precedence/both/APPROVALS.md +7 -0
- package/schema/fixtures/policy-md/precedence/fallback-only/APPROVALS.md +7 -0
- package/schema/fixtures/policy-md/valid/canonical.md +50 -0
- package/schema/fixtures/policy-md/valid/daemon-read-proof.md +18 -0
- package/schema/fixtures/policy-md/valid/minimal.md +3 -0
- package/schema/fixtures/policy-md/valid/prose-lookalikes.md +54 -0
- package/schema/fixtures/policy-md/valid/routed-protected-paths.md +49 -0
- package/schema/fixtures/policy-md/valid/with-values.md +79 -0
- package/schema/fixtures/sample-record/invalid/bad-date-time.json +4 -0
- package/schema/fixtures/sample-record/invalid/missing-required-field.json +3 -0
- package/schema/fixtures/sample-record/invalid/unknown-top-level-field.json +5 -0
- package/schema/fixtures/sample-record/invalid/wrong-type.json +4 -0
- package/schema/fixtures/sample-record/valid/minimal.json +4 -0
- package/schema/fixtures/sample-record/valid/with-note.json +5 -0
- package/schema/fixtures/values/invalid/class-shaped.json +9 -0
- package/schema/fixtures/values/invalid/duplicate-entry.json +4 -0
- package/schema/fixtures/values/invalid/non-string-item.json +4 -0
- package/schema/fixtures/values/invalid/over-cap.json +26 -0
- package/schema/fixtures/values/invalid/unknown-key.json +5 -0
- package/schema/fixtures/values/invalid/version-string.json +1 -0
- package/schema/fixtures/values/valid/empty-lists.json +7 -0
- package/schema/fixtures/values/valid/full.json +20 -0
- package/schema/fixtures/values/valid/minimal.json +1 -0
- package/schema/fixtures/values-md/invalid/schema-invalid.md +62 -0
- package/schema/fixtures/values-md/invalid/two-blocks.md +69 -0
- package/schema/fixtures/values-md/invalid/unterminated.md +61 -0
- package/schema/fixtures/values-md/invalid/yaml-error.md +63 -0
- package/schema/fixtures/values-md/valid/absent.md +50 -0
- package/schema/fixtures/values-md/valid/with-values.md +79 -0
- package/schema/policy.schema.json +501 -0
- package/schema/sample-record.schema.json +26 -0
- package/schema/values.schema.json +55 -0
- package/templates/codex/README.md +9 -0
|
@@ -0,0 +1,602 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The MCP wrapper of SPEC.md §10.5 — the same verbs as tools, over the CLI's
|
|
3
|
+
* own code paths (APRV-87).
|
|
4
|
+
*
|
|
5
|
+
* §10.5 asks for "a thin MCP server exposing the same verbs as tools … for
|
|
6
|
+
* clients where MCP is more ergonomic than shelling out", and says plainly that
|
|
7
|
+
* "it shares the CLI's code paths". Both halves of that sentence are load-
|
|
8
|
+
* bearing here, and the second one is the whole design: **there is no second
|
|
9
|
+
* implementation of any verb in this file.** A tool call builds an argv, hands
|
|
10
|
+
* it to the function `src/cli/main.ts` dispatches to, captures the `--json`
|
|
11
|
+
* object the CLI would have printed, and returns it. A refusal is the refusal
|
|
12
|
+
* the CLI prints, with the same machine-readable `error.code`.
|
|
13
|
+
*
|
|
14
|
+
* ## The scoping decision: agent-facing only
|
|
15
|
+
*
|
|
16
|
+
* SPEC.md §11 names the agent the **untrusted policy** and the human the
|
|
17
|
+
* **trusted, expensive overseer**. An MCP client is an agent's harness. Offering
|
|
18
|
+
* `grant` to it hands the untrusted policy the overseer's pen, and no amount of
|
|
19
|
+
* care inside the tool implementation would undo that. So the tool list is
|
|
20
|
+
* exactly {@link VERB_REGISTRY} filtered by `human_only === false`, minus the
|
|
21
|
+
* transport exclusions in {@link EXCLUDED_VERBS}, and the registry's `human_only`
|
|
22
|
+
* marker — not a list kept here — is what decides. `verb-registry.ts` says it in
|
|
23
|
+
* its own header: the marker "exists so a wrapper does not offer an agent a door
|
|
24
|
+
* the runtime will only slam".
|
|
25
|
+
*
|
|
26
|
+
* The runtime would slam it anyway (the CLI layer refuses, core refuses again,
|
|
27
|
+
* and the event schema refuses a third time). Publishing the door would still be
|
|
28
|
+
* wrong: a tool list is a statement about what this surface is for.
|
|
29
|
+
*
|
|
30
|
+
* ## Identity is the server's, and a tool call cannot change it
|
|
31
|
+
*
|
|
32
|
+
* The server runs AS one agent identity, fixed when the operator starts it
|
|
33
|
+
* (`--as agent:<id>`, or `APPROVAL_AGENT`). `human:` and `system:` are refused at
|
|
34
|
+
* startup. Every tool whose verb accepts `--as` gets the server's identity
|
|
35
|
+
* appended LAST, after anything the caller supplied, and `--as` is removed from
|
|
36
|
+
* every published input schema so that a client sending it is refused by the
|
|
37
|
+
* schema rather than quietly ignored. Two mechanisms for one rule, because the
|
|
38
|
+
* rule is the reason this server is safe to run at all.
|
|
39
|
+
*
|
|
40
|
+
* ## Guest mode narrows, and never widens (APRV-175)
|
|
41
|
+
*
|
|
42
|
+
* A server built with `guest: true` publishes {@link GUEST_VERBS} INTERSECTED
|
|
43
|
+
* with the list above, refuses anything else at call time with
|
|
44
|
+
* `mcp-guest-restricted` even when a client crafted the name itself, clamps
|
|
45
|
+
* `wait` to {@link GUEST_WAIT_TIMEOUT_MS}, and says all of that in
|
|
46
|
+
* {@link GUEST_INSTRUCTIONS}. Two properties are worth stating plainly: the
|
|
47
|
+
* intersection means guest mode can only ever take tools away, so no name the
|
|
48
|
+
* full server withholds becomes reachable by turning it on; and the refusal
|
|
49
|
+
* lives at CALL time, so `tools/list` describes the boundary rather than being
|
|
50
|
+
* it. The human-only arm is unchanged and is checked first, because "no session
|
|
51
|
+
* on any transport may do this" outranks "this session may not".
|
|
52
|
+
*
|
|
53
|
+
* ## What this server does NOT do
|
|
54
|
+
*
|
|
55
|
+
* - It reads no `.approval/env` (SPEC.md §11.1 invariant 7). The environment a
|
|
56
|
+
* gate operation runs under is the one the operator launched this process
|
|
57
|
+
* with, exactly as for any other `approval` invocation.
|
|
58
|
+
* - It maps nothing onto the MCP tasks/elicitation extension. §10.5 says the
|
|
59
|
+
* tasks extension MAY be mapped onto `awaiting` "when client support
|
|
60
|
+
* stabilizes"; that is post-v1, and until then `wait` blocks and answers.
|
|
61
|
+
* - It appends nothing of its own. `tools/list` touches no file.
|
|
62
|
+
*/
|
|
63
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
64
|
+
import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError, } from "@modelcontextprotocol/sdk/types.js";
|
|
65
|
+
import { commandAdapter } from "../cli/adapter.js";
|
|
66
|
+
import { commandChannel } from "../cli/channel.js";
|
|
67
|
+
import { commandPayload } from "../cli/payload.js";
|
|
68
|
+
import { commandDoctor } from "../cli/doctor.js";
|
|
69
|
+
import { commandRun } from "../cli/execute.js";
|
|
70
|
+
import { main } from "../cli/main.js";
|
|
71
|
+
import { VERB_REGISTRY, verbLabel, } from "../cli/verb-registry.js";
|
|
72
|
+
import { parseDuration } from "../core/policy-load.js";
|
|
73
|
+
import { SPEC_VERSION } from "../core/version.js";
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
// The tool list
|
|
76
|
+
// ---------------------------------------------------------------------------
|
|
77
|
+
/**
|
|
78
|
+
* Agent-facing verbs that are still not tools, each for a reason that is about
|
|
79
|
+
* the TRANSPORT or the verb's role rather than about authority. Anything
|
|
80
|
+
* excluded for authority reasons is `human_only` in the registry instead, which
|
|
81
|
+
* is where that judgment belongs.
|
|
82
|
+
*/
|
|
83
|
+
export const EXCLUDED_VERBS = new Map([
|
|
84
|
+
[
|
|
85
|
+
"consume",
|
|
86
|
+
"internal plumbing: its own purpose says so. `run` wraps it and is published instead, so a client that reached for `consume` would be spending a token outside the verb that records the outcome.",
|
|
87
|
+
],
|
|
88
|
+
[
|
|
89
|
+
"log follow",
|
|
90
|
+
"it is an unbounded foreground stream. MCP tool calls share a finite request queue and return one finite result, so publishing this verb would occupy that queue indefinitely; MCP clients can poll log verify or use the CLI stream as a separate process.",
|
|
91
|
+
],
|
|
92
|
+
[
|
|
93
|
+
"hook claude-code",
|
|
94
|
+
"it reads one PreToolUse event from STDIN and its registry input schema has nowhere to put that event. On a stdio server, stdin is the JSON-RPC stream: a tool that read it would eat the protocol. It is also the wrong shape for MCP — a harness that can call tools calls `request` and `wait` directly.",
|
|
95
|
+
],
|
|
96
|
+
[
|
|
97
|
+
"hook cursor",
|
|
98
|
+
"it reads one Cursor preToolUse event from STDIN and its registry input schema has nowhere to put that event. On a stdio server, stdin is the JSON-RPC stream: a tool that read it would eat the protocol. It is also the wrong shape for MCP — a harness that can call tools calls `request` and `wait` directly.",
|
|
99
|
+
],
|
|
100
|
+
[
|
|
101
|
+
"hook codex",
|
|
102
|
+
"it reads one Codex PreToolUse or PostToolUse event from STDIN and its registry input schema has nowhere to put that event. On a stdio server, stdin is the JSON-RPC stream: a tool that read it would eat the protocol. It is also the wrong shape for MCP — a harness that can call tools calls `request` and `wait` directly.",
|
|
103
|
+
],
|
|
104
|
+
]);
|
|
105
|
+
/**
|
|
106
|
+
* The verbs a GUEST session may call (APRV-175), as registry labels.
|
|
107
|
+
*
|
|
108
|
+
* A POSITIVE allowlist, and the direction is the whole point. Guest mode exists
|
|
109
|
+
* so strangers can drive a gate over the network without executing anything on
|
|
110
|
+
* the host, and the two verbs that make that dangerous are not the only ones:
|
|
111
|
+
* `run` spawns argv on the server machine, an `adapter <name>` spends vault
|
|
112
|
+
* credentials, `token` hands out spend material, `journal write` writes a local
|
|
113
|
+
* file the operator reads. A deny list would have to name each of those and
|
|
114
|
+
* every one that lands next; this list names what a guest MAY do, so a verb
|
|
115
|
+
* added tomorrow is absent until someone decides otherwise. Fail closed, per
|
|
116
|
+
* SPEC.md §11.
|
|
117
|
+
*
|
|
118
|
+
* The list is the demo's shape: read the guide (`instructions`), declare and
|
|
119
|
+
* ask (`register`, `request`), watch (`wait`, `status`, `queue`), and inspect
|
|
120
|
+
* (`log verify`, `policy check`, `policy test`). Nothing here executes a side
|
|
121
|
+
* effect, and nothing here is a human's authority — those are `human_only` in
|
|
122
|
+
* the registry and were never published on any transport.
|
|
123
|
+
*
|
|
124
|
+
* This narrows and never widens: {@link publishedVerbs} intersects it with the
|
|
125
|
+
* ordinary filter, so a name the full server does not publish cannot become a
|
|
126
|
+
* tool by turning guest mode on.
|
|
127
|
+
*/
|
|
128
|
+
export const GUEST_VERBS = new Set([
|
|
129
|
+
"instructions",
|
|
130
|
+
"register",
|
|
131
|
+
"request",
|
|
132
|
+
"wait",
|
|
133
|
+
"status",
|
|
134
|
+
"queue",
|
|
135
|
+
"log verify",
|
|
136
|
+
"policy check",
|
|
137
|
+
"policy test",
|
|
138
|
+
]);
|
|
139
|
+
/** Guest `wait` never blocks the shared queue for longer than this. */
|
|
140
|
+
export const GUEST_WAIT_TIMEOUT_MS = 5_000;
|
|
141
|
+
/** `<name>_<subcommand words>` — `log_verify`, `channel_telegram_health`. */
|
|
142
|
+
export function toolName(spec) {
|
|
143
|
+
const words = spec.subcommand === undefined ? [] : spec.subcommand.split(" ");
|
|
144
|
+
return [spec.name, ...words].join("_");
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* The verbs this server publishes, in registry order.
|
|
148
|
+
*
|
|
149
|
+
* Under `guest`, the ordinary filter is INTERSECTED with {@link GUEST_VERBS}:
|
|
150
|
+
* guest mode subtracts and can never add.
|
|
151
|
+
*/
|
|
152
|
+
export function publishedVerbs(guest = false) {
|
|
153
|
+
return VERB_REGISTRY.filter((spec) => !spec.human_only &&
|
|
154
|
+
!EXCLUDED_VERBS.has(verbLabel(spec)) &&
|
|
155
|
+
(!guest || GUEST_VERBS.has(verbLabel(spec))));
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* The input schema for one tool: the registry's input schema, with the single
|
|
159
|
+
* documented deletion of `--as`.
|
|
160
|
+
*
|
|
161
|
+
* Nothing else is translated, reshaped or regenerated. The registry's schemas
|
|
162
|
+
* are already `{type:"object", properties:{positionals, flags, trailing?}}` with
|
|
163
|
+
* `additionalProperties:false` throughout, which is exactly what MCP wants a
|
|
164
|
+
* tool `inputSchema` to be, so the SDK's low-level {@link Server} is used rather
|
|
165
|
+
* than `McpServer`: `McpServer.registerTool` takes Zod, and translating JSON
|
|
166
|
+
* Schema into Zod so the SDK can translate it back would put a lossy round trip
|
|
167
|
+
* between the one source and the published contract.
|
|
168
|
+
*
|
|
169
|
+
* `additionalProperties:false` is also what refuses `{"as":"human:carter"}`:
|
|
170
|
+
* there is no such property, at any level, on any published tool.
|
|
171
|
+
*/
|
|
172
|
+
export function toolInputSchema(spec) {
|
|
173
|
+
const schema = structuredClone(spec.input);
|
|
174
|
+
const flagProperties = schema.properties?.flags?.properties;
|
|
175
|
+
if (flagProperties !== undefined)
|
|
176
|
+
delete flagProperties["--as"];
|
|
177
|
+
return schema;
|
|
178
|
+
}
|
|
179
|
+
/** The `tools/list` answer, derived entirely from the registry. */
|
|
180
|
+
export function toolDefinitions(guest = false) {
|
|
181
|
+
return publishedVerbs(guest).map((spec) => ({
|
|
182
|
+
name: toolName(spec),
|
|
183
|
+
title: `approval ${verbLabel(spec)}`,
|
|
184
|
+
description: spec.purpose,
|
|
185
|
+
inputSchema: toolInputSchema(spec),
|
|
186
|
+
}));
|
|
187
|
+
}
|
|
188
|
+
// ---------------------------------------------------------------------------
|
|
189
|
+
// Identity
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
/** The environment variable an operator may use instead of `--as`. */
|
|
192
|
+
export const AGENT_ACTOR_ENV = "APPROVAL_AGENT";
|
|
193
|
+
/** `agent:<id>` and nothing else. */
|
|
194
|
+
const AGENT_ACTOR = /^agent:.+/u;
|
|
195
|
+
/**
|
|
196
|
+
* Resolve and validate the identity this server acts as.
|
|
197
|
+
*
|
|
198
|
+
* A `human:` value is refused rather than accepted-and-downgraded: an operator
|
|
199
|
+
* who typed one meant something, and the something they meant is not available
|
|
200
|
+
* here. `system:` is refused for the same reason `expire` takes no identity —
|
|
201
|
+
* the runtime's own actor is not a thing a caller supplies.
|
|
202
|
+
*/
|
|
203
|
+
export function resolveAgentActor(flag, env = process.env) {
|
|
204
|
+
const raw = flag ?? env[AGENT_ACTOR_ENV] ?? null;
|
|
205
|
+
if (raw === null || raw.trim().length === 0) {
|
|
206
|
+
return {
|
|
207
|
+
ok: false,
|
|
208
|
+
message: `no agent identity: pass --as agent:<id> or set ${AGENT_ACTOR_ENV}=agent:<id>. The MCP server runs as ONE agent and every tool call is recorded under that identity`,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
if (!AGENT_ACTOR.test(raw)) {
|
|
212
|
+
return {
|
|
213
|
+
ok: false,
|
|
214
|
+
// APRV-102: no SPEC citation on an error line. The reason this server is
|
|
215
|
+
// agent-facing by construction is in `MCP_HELP` and in this file's header,
|
|
216
|
+
// which are the two places APRV-91 put rationale.
|
|
217
|
+
message: `--as expects agent:<id>, got ${JSON.stringify(raw)}. This server is agent-facing by construction, so it refuses to act as a human or as the system`,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
return { ok: true, actor: raw };
|
|
221
|
+
}
|
|
222
|
+
/** The flag names one verb accepts, from its registry input schema. */
|
|
223
|
+
function flagNamesOf(spec) {
|
|
224
|
+
const input = spec.input;
|
|
225
|
+
return new Set(Object.keys(input.properties?.flags?.properties ?? {}));
|
|
226
|
+
}
|
|
227
|
+
function acceptsTrailing(spec) {
|
|
228
|
+
const input = spec.input;
|
|
229
|
+
return (input.properties ?? {})["trailing"] !== undefined;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* The `--timeout` a guest's `wait` actually runs with (APRV-175).
|
|
233
|
+
*
|
|
234
|
+
* A clamp rather than an override: a caller asking for less than the ceiling
|
|
235
|
+
* gets what they asked for, and anything larger, unparseable or absent becomes
|
|
236
|
+
* {@link GUEST_WAIT_TIMEOUT_MS}. It is appended LAST, the same mechanism that
|
|
237
|
+
* pins `--as`, so the caller's own value loses without being rejected.
|
|
238
|
+
*
|
|
239
|
+
* The ceiling is not politeness. `wait` blocks the event loop (`Atomics.wait`)
|
|
240
|
+
* and every HTTP session shares one invoke queue, so an unbounded `wait` is one
|
|
241
|
+
* stranger stalling every other session and the listener with them.
|
|
242
|
+
*/
|
|
243
|
+
export function guestWaitTimeout(rawFlags) {
|
|
244
|
+
const flags = (rawFlags ?? {});
|
|
245
|
+
const asked = typeof flags["--timeout"] === "string" ? parseDuration(flags["--timeout"]) : null;
|
|
246
|
+
const ms = asked === null ? GUEST_WAIT_TIMEOUT_MS : Math.min(asked, GUEST_WAIT_TIMEOUT_MS);
|
|
247
|
+
return `${ms}ms`;
|
|
248
|
+
}
|
|
249
|
+
function refuse(code, message) {
|
|
250
|
+
return { ok: false, code, message };
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Map one tool call's arguments onto the argv the CLI would have been given.
|
|
254
|
+
*
|
|
255
|
+
* Validation here is deliberate rather than delegated: the low-level MCP
|
|
256
|
+
* {@link Server} does not validate `arguments` against a tool's `inputSchema`,
|
|
257
|
+
* and "the schema said additionalProperties:false" has to be enforced by
|
|
258
|
+
* something. So an unknown top-level key, an unknown flag, or a non-string
|
|
259
|
+
* argument is refused, which is what makes `{"as":"human:carter"}` a refusal
|
|
260
|
+
* instead of a silently dropped field.
|
|
261
|
+
*/
|
|
262
|
+
export function buildArgv(spec, rawArgs, options) {
|
|
263
|
+
const args = (rawArgs ?? {});
|
|
264
|
+
if (typeof args !== "object" || Array.isArray(args)) {
|
|
265
|
+
return refuse("mcp-invalid-arguments", "arguments must be a JSON object");
|
|
266
|
+
}
|
|
267
|
+
const allowedKeys = new Set(["positionals", "flags"]);
|
|
268
|
+
if (acceptsTrailing(spec))
|
|
269
|
+
allowedKeys.add("trailing");
|
|
270
|
+
for (const key of Object.keys(args)) {
|
|
271
|
+
if (allowedKeys.has(key))
|
|
272
|
+
continue;
|
|
273
|
+
return refuse("mcp-unknown-property", `unknown property ${JSON.stringify(key)}; \`${verbLabel(spec)}\` accepts ${[...allowedKeys]
|
|
274
|
+
.map((name) => JSON.stringify(name))
|
|
275
|
+
.join(", ")} and nothing else. Identity in particular is NOT an argument: this server acts as ${options.actor}, fixed when it was started, and no tool call can change it`);
|
|
276
|
+
}
|
|
277
|
+
const positionals = [];
|
|
278
|
+
const rawPositionals = args["positionals"];
|
|
279
|
+
if (rawPositionals !== undefined) {
|
|
280
|
+
if (!Array.isArray(rawPositionals)) {
|
|
281
|
+
return refuse("mcp-invalid-arguments", "positionals must be an array of strings");
|
|
282
|
+
}
|
|
283
|
+
for (const value of rawPositionals) {
|
|
284
|
+
if (typeof value !== "string") {
|
|
285
|
+
return refuse("mcp-invalid-arguments", "every positional must be a string");
|
|
286
|
+
}
|
|
287
|
+
positionals.push(value);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
const flagArgv = [];
|
|
291
|
+
const accepted = flagNamesOf(spec);
|
|
292
|
+
const rawFlags = args["flags"];
|
|
293
|
+
if (rawFlags !== undefined) {
|
|
294
|
+
if (typeof rawFlags !== "object" || rawFlags === null || Array.isArray(rawFlags)) {
|
|
295
|
+
return refuse("mcp-invalid-arguments", "flags must be an object");
|
|
296
|
+
}
|
|
297
|
+
for (const [flag, value] of Object.entries(rawFlags)) {
|
|
298
|
+
if (flag === "--as") {
|
|
299
|
+
return refuse("mcp-identity-fixed", `--as is not accepted from a tool call. This server acts as ${options.actor}, chosen by the operator who started it; an identity a caller could name would be an identity the caller could escalate (SPEC.md §11)`);
|
|
300
|
+
}
|
|
301
|
+
if (!accepted.has(flag)) {
|
|
302
|
+
return refuse("mcp-unknown-flag", `unknown flag ${JSON.stringify(flag)} for \`${verbLabel(spec)}\``);
|
|
303
|
+
}
|
|
304
|
+
if (typeof value === "boolean") {
|
|
305
|
+
if (value)
|
|
306
|
+
flagArgv.push(flag);
|
|
307
|
+
continue;
|
|
308
|
+
}
|
|
309
|
+
if (typeof value !== "string") {
|
|
310
|
+
return refuse("mcp-invalid-arguments", `flag ${JSON.stringify(flag)} expects a string or a boolean`);
|
|
311
|
+
}
|
|
312
|
+
flagArgv.push(flag, value);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
const trailing = [];
|
|
316
|
+
const rawTrailing = args["trailing"];
|
|
317
|
+
if (rawTrailing !== undefined) {
|
|
318
|
+
if (!acceptsTrailing(spec)) {
|
|
319
|
+
return refuse("mcp-unknown-property", `\`${verbLabel(spec)}\` takes no trailing argv`);
|
|
320
|
+
}
|
|
321
|
+
if (!Array.isArray(rawTrailing) || rawTrailing.length === 0) {
|
|
322
|
+
return refuse("mcp-invalid-arguments", "trailing must be a non-empty array of strings");
|
|
323
|
+
}
|
|
324
|
+
for (const value of rawTrailing) {
|
|
325
|
+
if (typeof value !== "string") {
|
|
326
|
+
return refuse("mcp-invalid-arguments", "every trailing argument must be a string");
|
|
327
|
+
}
|
|
328
|
+
trailing.push(value);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
// `-` means "read it from stdin" everywhere in this CLI, and on a stdio
|
|
332
|
+
// server stdin is the JSON-RPC stream. Reading it would deadlock the
|
|
333
|
+
// connection and steal the client's next request, so it is refused with a
|
|
334
|
+
// code that says what to do instead.
|
|
335
|
+
for (const value of [...positionals, ...flagArgv]) {
|
|
336
|
+
if (value !== "-")
|
|
337
|
+
continue;
|
|
338
|
+
return refuse("mcp-stdin-unavailable", "`-` (read from stdin) is not available over MCP: stdin is the JSON-RPC transport. Write the bytes to a file and pass its path");
|
|
339
|
+
}
|
|
340
|
+
// Injected LAST so the operator's pins and the server's identity win over
|
|
341
|
+
// anything the caller supplied: `parseFlags` keeps the last occurrence.
|
|
342
|
+
const injected = [];
|
|
343
|
+
if (options.guest === true && verbLabel(spec) === "wait") {
|
|
344
|
+
injected.push("--timeout", guestWaitTimeout(rawFlags));
|
|
345
|
+
}
|
|
346
|
+
if (options.log !== undefined && accepted.has("--log"))
|
|
347
|
+
injected.push("--log", options.log);
|
|
348
|
+
if (options.policy !== undefined && accepted.has("--policy")) {
|
|
349
|
+
injected.push("--policy", options.policy);
|
|
350
|
+
}
|
|
351
|
+
if (accepted.has("--as"))
|
|
352
|
+
injected.push("--as", options.actor);
|
|
353
|
+
if (accepted.has("--json"))
|
|
354
|
+
injected.push("--json");
|
|
355
|
+
return {
|
|
356
|
+
ok: true,
|
|
357
|
+
argv: [
|
|
358
|
+
...positionals,
|
|
359
|
+
...flagArgv,
|
|
360
|
+
...injected,
|
|
361
|
+
...(trailing.length === 0 ? [] : ["--", ...trailing]),
|
|
362
|
+
],
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
function collector() {
|
|
366
|
+
const out = [];
|
|
367
|
+
const err = [];
|
|
368
|
+
return {
|
|
369
|
+
streams: { out: (text) => out.push(text), err: (text) => err.push(text) },
|
|
370
|
+
out,
|
|
371
|
+
err,
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Run one verb.
|
|
376
|
+
*
|
|
377
|
+
* The default arm is `main()` itself — the CLI's real dispatch, so a verb whose
|
|
378
|
+
* argv handling changes changes here too, with nothing to keep in step. The
|
|
379
|
+
* three exceptions each have a reason that is about this transport:
|
|
380
|
+
*
|
|
381
|
+
* - `run` spawns a child, and `stdio: "inherit"` would hand that child the
|
|
382
|
+
* JSON-RPC pipe. It is called through the `childIo` seam `execute.ts` exposes
|
|
383
|
+
* for exactly this, which pipes the child's output back as tool content.
|
|
384
|
+
* - `doctor` and every `adapter <name>` are asynchronous, and `main()` drops their
|
|
385
|
+
* promise into `process.exitCode` rather than returning it. Awaiting the
|
|
386
|
+
* command function is the only way to get the code.
|
|
387
|
+
*
|
|
388
|
+
* `channel telegram health` goes through `commandChannel` for the same reason:
|
|
389
|
+
* its dispatch arm in `main()` is the promise-unwrapping one.
|
|
390
|
+
*/
|
|
391
|
+
async function invoke(spec, argv, options) {
|
|
392
|
+
const sink = collector();
|
|
393
|
+
const { streams } = sink;
|
|
394
|
+
const cwd = options.cwd;
|
|
395
|
+
const label = verbLabel(spec);
|
|
396
|
+
let code;
|
|
397
|
+
let child;
|
|
398
|
+
if (label === "run") {
|
|
399
|
+
let captured;
|
|
400
|
+
code = commandRun(argv, streams, cwd, {
|
|
401
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
402
|
+
onOutput: (output) => {
|
|
403
|
+
captured = output;
|
|
404
|
+
},
|
|
405
|
+
});
|
|
406
|
+
child = captured;
|
|
407
|
+
}
|
|
408
|
+
else if (label === "doctor") {
|
|
409
|
+
code = await commandDoctor(argv, streams, cwd);
|
|
410
|
+
}
|
|
411
|
+
else if (spec.name === "adapter") {
|
|
412
|
+
// Every `adapter <name>`, not the one that shipped first (APRV-221): the
|
|
413
|
+
// reason this arm exists is the promise `main()` drops, and that is true of
|
|
414
|
+
// the verb rather than of any adapter behind it.
|
|
415
|
+
const words = spec.subcommand === undefined ? [] : spec.subcommand.split(" ");
|
|
416
|
+
code = await commandAdapter([...words, ...argv], streams, cwd);
|
|
417
|
+
}
|
|
418
|
+
else if (spec.name === "channel") {
|
|
419
|
+
const words = spec.subcommand === undefined ? [] : spec.subcommand.split(" ");
|
|
420
|
+
code = await commandChannel([...words, ...argv], streams, cwd);
|
|
421
|
+
}
|
|
422
|
+
else if (spec.name === "payload") {
|
|
423
|
+
// `payload agentmail-draft` reads a draft over HTTPS (APRV-223), so this
|
|
424
|
+
// verb family joined the promise-unwrapping arm of `main()`. `payload hash`
|
|
425
|
+
// still answers synchronously, and `await` on a number is a number.
|
|
426
|
+
const words = spec.subcommand === undefined ? [] : spec.subcommand.split(" ");
|
|
427
|
+
code = await commandPayload([...words, ...argv], streams, cwd);
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
const words = spec.subcommand === undefined ? [] : spec.subcommand.split(" ");
|
|
431
|
+
// `main()` is asynchronous since APRV-209 (every verb is loaded on demand),
|
|
432
|
+
// so the default arm awaits it. `main()` now awaits the asynchronous verbs
|
|
433
|
+
// too, so the arms above no longer HAVE to exist for the promise's sake;
|
|
434
|
+
// they are kept because calling the command function is the more direct
|
|
435
|
+
// route and `run`'s `childIo` seam needs it regardless.
|
|
436
|
+
code = await main([spec.name, ...words, ...argv], { streams, cwd });
|
|
437
|
+
}
|
|
438
|
+
return {
|
|
439
|
+
code,
|
|
440
|
+
stdout: sink.out.join(""),
|
|
441
|
+
stderr: sink.err.join(""),
|
|
442
|
+
...(child === undefined ? {} : { child }),
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
// ---------------------------------------------------------------------------
|
|
446
|
+
// Invocation -> CallToolResult
|
|
447
|
+
// ---------------------------------------------------------------------------
|
|
448
|
+
/** The last line of `text` that parses as a JSON object, or null. */
|
|
449
|
+
function lastJsonObject(text) {
|
|
450
|
+
const lines = text.split("\n");
|
|
451
|
+
for (let index = lines.length - 1; index >= 0; index -= 1) {
|
|
452
|
+
const line = (lines[index] ?? "").trim();
|
|
453
|
+
if (line.length === 0 || !line.startsWith("{"))
|
|
454
|
+
continue;
|
|
455
|
+
try {
|
|
456
|
+
const value = JSON.parse(line);
|
|
457
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
458
|
+
return value;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
catch {
|
|
462
|
+
// Not JSON; keep walking backwards.
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
return null;
|
|
466
|
+
}
|
|
467
|
+
/** The `_meta` key prefix this server stamps its out-of-band facts under. */
|
|
468
|
+
export const META_PREFIX = "approval.md/";
|
|
469
|
+
/**
|
|
470
|
+
* Shape one invocation into a tool result.
|
|
471
|
+
*
|
|
472
|
+
* A gate refusal is a RESULT, never a thrown JSON-RPC error: the command was
|
|
473
|
+
* well-formed and the runtime's answer was no, which is a fact the caller must
|
|
474
|
+
* be able to read as data. It comes back as `isError: true` carrying the same
|
|
475
|
+
* `{"error":{"code","message"}}` object the CLI prints, so a client branches on
|
|
476
|
+
* `error.code` exactly as it would on the CLI's stderr.
|
|
477
|
+
*
|
|
478
|
+
* A non-zero exit that carries a SUCCESS-shaped object is not an error: `wait`
|
|
479
|
+
* exits 1 on a rejection and 6 on a timeout, `status` exits 1 when something
|
|
480
|
+
* needs attention, `log verify` exits 3 on a torn tail. Those are answers. The
|
|
481
|
+
* exit code always travels in `_meta` so nothing is lost either way.
|
|
482
|
+
*/
|
|
483
|
+
export function toolResult(result) {
|
|
484
|
+
// stdout first, then stderr: `run` prints its summary on stderr because
|
|
485
|
+
// stdout belongs to the child, and every refusal goes to stderr too.
|
|
486
|
+
const payload = lastJsonObject(result.stdout) ?? lastJsonObject(result.stderr);
|
|
487
|
+
const isError = payload === null ? result.code !== 0 : payload["error"] !== undefined;
|
|
488
|
+
const content = [
|
|
489
|
+
{
|
|
490
|
+
type: "text",
|
|
491
|
+
text: payload === null
|
|
492
|
+
? `${result.stdout}${result.stderr}`.trim() ||
|
|
493
|
+
`the command produced no output and exited ${result.code}`
|
|
494
|
+
: JSON.stringify(payload),
|
|
495
|
+
},
|
|
496
|
+
];
|
|
497
|
+
if (result.child !== undefined) {
|
|
498
|
+
if (result.child.stdout.length > 0) {
|
|
499
|
+
content.push({ type: "text", text: `child stdout:\n${result.child.stdout}` });
|
|
500
|
+
}
|
|
501
|
+
if (result.child.stderr.length > 0) {
|
|
502
|
+
content.push({ type: "text", text: `child stderr:\n${result.child.stderr}` });
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
return {
|
|
506
|
+
content,
|
|
507
|
+
...(payload === null ? {} : { structuredContent: payload }),
|
|
508
|
+
...(isError ? { isError: true } : {}),
|
|
509
|
+
_meta: {
|
|
510
|
+
[`${META_PREFIX}exit_code`]: result.code,
|
|
511
|
+
...(result.child === undefined ? {} : { [`${META_PREFIX}child`]: result.child }),
|
|
512
|
+
},
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
// ---------------------------------------------------------------------------
|
|
516
|
+
// The server
|
|
517
|
+
// ---------------------------------------------------------------------------
|
|
518
|
+
/**
|
|
519
|
+
* Serialize everything.
|
|
520
|
+
*
|
|
521
|
+
* Two reasons, and only the first is about this process. In-process, several
|
|
522
|
+
* verbs are synchronous and blocking (`wait` sleeps with `Atomics.wait`, `run`
|
|
523
|
+
* uses `spawnSync`), so overlapping them buys nothing and interleaves their
|
|
524
|
+
* captured output. Across processes, an append still goes through
|
|
525
|
+
* `core/log.ts`'s lockfile and compare-and-append, so a CLI running beside this
|
|
526
|
+
* server is safe whatever this queue does — the queue is politeness, the
|
|
527
|
+
* lockfile is the guarantee.
|
|
528
|
+
*
|
|
529
|
+
* APRV-174: over HTTP one process serves many sessions, and the first reason
|
|
530
|
+
* above is about the process. `ServerOptions.serialize` therefore lets the HTTP
|
|
531
|
+
* listener hand every session the SAME queue; stdio passes nothing and gets a
|
|
532
|
+
* fresh one, exactly as before.
|
|
533
|
+
*/
|
|
534
|
+
export function serializer() {
|
|
535
|
+
let tail = Promise.resolve();
|
|
536
|
+
return (work) => {
|
|
537
|
+
const next = tail.then(work, work);
|
|
538
|
+
tail = next.then(() => undefined, () => undefined);
|
|
539
|
+
return next;
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* What a GUEST session is told at connect time (APRV-175).
|
|
544
|
+
*
|
|
545
|
+
* Distinct from the full text because the situation is distinct, and the two
|
|
546
|
+
* facts a guest most needs are the two a full client never needs: `wait` comes
|
|
547
|
+
* back fast, and a granted request executes NOWHERE. Saying the second one
|
|
548
|
+
* plainly matters more than it looks. A stranger who saw their action granted
|
|
549
|
+
* and assumed an email went out has learned the wrong thing about this system;
|
|
550
|
+
* what they are driving is the approval flow itself.
|
|
551
|
+
*/
|
|
552
|
+
export const GUEST_INSTRUCTIONS = "approval.md gates agent actions that touch the world, and you are connected to it as a GUEST. The tools here are a narrow slice of the agent surface: read the guide (`instructions`), declare an action in a task envelope and register it (`register`), ask for it (`request`), then watch (`wait`, `status`, `queue`) and inspect (`log_verify`, `policy_check`, `policy_test`). Calling anything else is refused `mcp-guest-restricted` whether or not it is listed, because everything else executes on, or spends the credentials of, the machine hosting this gate. Two things to expect. `wait` returns FAST: a guest's timeout is clamped to five seconds server-side, so treat it as a poll and call `status` again rather than asking for a longer one. And NOTHING YOU ARE GRANTED EXECUTES ANYWHERE: there is no `run` here, no adapter, and no side effect at the end of the flow. What you are driving is the approval flow itself — a real request, a real human decision, a real hash-chained record of both. Your identity is this session's alone (`agent:guest-<id>`, chosen by the server), and everything you do is recorded under it.";
|
|
553
|
+
/** Build the MCP server. Nothing is connected until {@link Server.connect}. */
|
|
554
|
+
export function createApprovalMcpServer(options) {
|
|
555
|
+
const server = new Server({ name: "approval-md", version: SPEC_VERSION }, {
|
|
556
|
+
capabilities: { tools: {} },
|
|
557
|
+
instructions: options.guest === true
|
|
558
|
+
? GUEST_INSTRUCTIONS
|
|
559
|
+
: "approval.md gates agent actions that touch the world. The tools here are the AGENT surface only: declare an action in a task envelope, register it, request it, wait for a decision, then run it. There is deliberately no grant, reject, revoke, attest or vault tool — those record a human's authority and are not available to a client of this server (SPEC.md §11). One tool is not gated at all: `journal_write` appends free text to a local file, is never classified or routed through policy, can be neither approved nor denied, and writes no event — it is there so you can say what an exit code cannot (that you are complying and think this is wrong, that something reads as odd, that you are stuck). The operator reads it; nothing written there changes any verdict. One tool runs the other way: `values` prints the operator's stated preferences from APPROVAL.md, which is guidance rather than policy — it grants nothing and changes no verdict — and reading it before you start is how you know what they value. `feedback` is that channel in the other direction: what the operator said about work that already happened, human-authored GUIDANCE that is not policy: it grants nothing, forbids nothing, and changes no verdict, sampling probability or budget. Call `instructions` first; it prints the full guide.",
|
|
560
|
+
});
|
|
561
|
+
const guest = options.guest === true;
|
|
562
|
+
const byName = new Map(publishedVerbs(guest).map((spec) => [toolName(spec), spec]));
|
|
563
|
+
const serialize = options.serialize ?? serializer();
|
|
564
|
+
server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: toolDefinitions(guest) }));
|
|
565
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
566
|
+
const name = request.params.name;
|
|
567
|
+
const spec = byName.get(name);
|
|
568
|
+
if (spec === undefined) {
|
|
569
|
+
const human = VERB_REGISTRY.find((candidate) => toolName(candidate) === name && candidate.human_only);
|
|
570
|
+
if (human !== undefined) {
|
|
571
|
+
// Checked FIRST, and the same answer for a guest as for anyone else:
|
|
572
|
+
// this verb records a human's authority, which is true of no session on
|
|
573
|
+
// any transport. Invariant 9 is not a guest-mode feature.
|
|
574
|
+
throw new McpError(ErrorCode.InvalidParams, `unknown tool ${JSON.stringify(name)}: \`approval ${verbLabel(human)}\` records or establishes a human's authority and this server publishes no tool for it. An MCP client is an agent's harness, and SPEC.md §11 makes the agent the untrusted policy; the human decides at their own surface (\`approval channel cli\`, the web page, or Telegram)`);
|
|
575
|
+
}
|
|
576
|
+
// The advertised list is NEVER the enforcement (APRV-175). A guest who
|
|
577
|
+
// crafted the request name reaches this arm, which is the same defence in
|
|
578
|
+
// depth `mcp-identity-fixed` is: the refusal is here, at call time, and
|
|
579
|
+
// `tools/list` merely describes it.
|
|
580
|
+
const withheld = guest
|
|
581
|
+
? publishedVerbs().find((candidate) => toolName(candidate) === name)
|
|
582
|
+
: undefined;
|
|
583
|
+
if (withheld !== undefined) {
|
|
584
|
+
throw new McpError(ErrorCode.InvalidParams, `mcp-guest-restricted: \`approval ${verbLabel(withheld)}\` is not available to a guest session. This server runs in GUEST mode, where a session may call only ${[...byName.keys()].join(", ")} — the verbs that declare, ask and observe. Everything else executes on, or spends the credentials of, the machine hosting this gate, which is not what a guest connected to`);
|
|
585
|
+
}
|
|
586
|
+
throw new McpError(ErrorCode.InvalidParams, `unknown tool ${JSON.stringify(name)}`);
|
|
587
|
+
}
|
|
588
|
+
const built = buildArgv(spec, request.params.arguments, options);
|
|
589
|
+
if (!built.ok) {
|
|
590
|
+
throw new McpError(ErrorCode.InvalidParams, `${built.code}: ${built.message}`);
|
|
591
|
+
}
|
|
592
|
+
return toolResult(await serialize(() => invoke(spec, built.argv, options)));
|
|
593
|
+
});
|
|
594
|
+
return server;
|
|
595
|
+
}
|
|
596
|
+
/** Build the server and connect it to `transport`. Resolves once connected. */
|
|
597
|
+
export async function serveApprovalMcp(options, transport) {
|
|
598
|
+
const server = createApprovalMcpServer(options);
|
|
599
|
+
await server.connect(transport);
|
|
600
|
+
return server;
|
|
601
|
+
}
|
|
602
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAEnE,OAAO,EACL,qBAAqB,EACrB,SAAS,EACT,sBAAsB,EACtB,QAAQ,GAGT,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,M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