@kya-os/cli 1.8.1 → 1.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/agent.d.ts +35 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +321 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/build.js +2 -2
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/check.js +3 -3
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/checkpoint-init.d.ts +1 -1
- package/dist/commands/checkpoint-init.d.ts.map +1 -1
- package/dist/commands/checkpoint-init.js +8 -41
- package/dist/commands/checkpoint-init.js.map +1 -1
- package/dist/commands/claim.js +2 -2
- package/dist/commands/claim.js.map +1 -1
- package/dist/commands/dco.d.ts +59 -0
- package/dist/commands/dco.d.ts.map +1 -1
- package/dist/commands/dco.js +280 -5
- package/dist/commands/dco.js.map +1 -1
- package/dist/commands/dev.js +1 -1
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +18 -24
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/env.js +6 -6
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/identity.js +3 -3
- package/dist/commands/identity.js.map +1 -1
- package/dist/commands/init-stages.d.ts +141 -0
- package/dist/commands/init-stages.d.ts.map +1 -0
- package/dist/commands/init-stages.js +684 -0
- package/dist/commands/init-stages.js.map +1 -0
- package/dist/commands/init.d.ts +46 -16
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +229 -279
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/orchestrator.d.ts +18 -0
- package/dist/commands/orchestrator.d.ts.map +1 -0
- package/dist/commands/orchestrator.js +251 -0
- package/dist/commands/orchestrator.js.map +1 -0
- package/dist/commands/register.d.ts +1 -1
- package/dist/commands/register.d.ts.map +1 -1
- package/dist/commands/register.js +35 -7
- package/dist/commands/register.js.map +1 -1
- package/dist/commands/review.d.ts +48 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +220 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/rotate.js +4 -4
- package/dist/commands/rotate.js.map +1 -1
- package/dist/commands/score.d.ts +15 -0
- package/dist/commands/score.d.ts.map +1 -0
- package/dist/commands/score.js +471 -0
- package/dist/commands/score.js.map +1 -0
- package/dist/commands/start.js +3 -3
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/verify.js +6 -6
- package/dist/commands/verify.js.map +1 -1
- package/dist/dco.d.ts +4 -0
- package/dist/dco.d.ts.map +1 -0
- package/dist/dco.js +23 -0
- package/dist/dco.js.map +1 -0
- package/dist/index.js +52 -9
- package/dist/orchestrator/daemon.d.ts +137 -0
- package/dist/orchestrator/daemon.d.ts.map +1 -0
- package/dist/orchestrator/daemon.js +242 -0
- package/dist/orchestrator/daemon.js.map +1 -0
- package/dist/orchestrator/db/dispatches.d.ts +108 -0
- package/dist/orchestrator/db/dispatches.d.ts.map +1 -0
- package/dist/orchestrator/db/dispatches.js +122 -0
- package/dist/orchestrator/db/dispatches.js.map +1 -0
- package/dist/orchestrator/db/index.d.ts +50 -0
- package/dist/orchestrator/db/index.d.ts.map +1 -0
- package/dist/orchestrator/db/index.js +116 -0
- package/dist/orchestrator/db/index.js.map +1 -0
- package/dist/orchestrator/db/journal.d.ts +93 -0
- package/dist/orchestrator/db/journal.d.ts.map +1 -0
- package/dist/orchestrator/db/journal.js +91 -0
- package/dist/orchestrator/db/journal.js.map +1 -0
- package/dist/orchestrator/db/liveness.d.ts +97 -0
- package/dist/orchestrator/db/liveness.d.ts.map +1 -0
- package/dist/orchestrator/db/liveness.js +105 -0
- package/dist/orchestrator/db/liveness.js.map +1 -0
- package/dist/orchestrator/db/mission.d.ts +78 -0
- package/dist/orchestrator/db/mission.d.ts.map +1 -0
- package/dist/orchestrator/db/mission.js +99 -0
- package/dist/orchestrator/db/mission.js.map +1 -0
- package/dist/orchestrator/db/schema.d.ts +14 -0
- package/dist/orchestrator/db/schema.d.ts.map +1 -0
- package/dist/orchestrator/db/schema.js +169 -0
- package/dist/orchestrator/db/schema.js.map +1 -0
- package/dist/orchestrator/db/tickets.d.ts +147 -0
- package/dist/orchestrator/db/tickets.d.ts.map +1 -0
- package/dist/orchestrator/db/tickets.js +238 -0
- package/dist/orchestrator/db/tickets.js.map +1 -0
- package/dist/orchestrator/db/verdicts.d.ts +187 -0
- package/dist/orchestrator/db/verdicts.d.ts.map +1 -0
- package/dist/orchestrator/db/verdicts.js +197 -0
- package/dist/orchestrator/db/verdicts.js.map +1 -0
- package/dist/orchestrator/events.d.ts +69 -0
- package/dist/orchestrator/events.d.ts.map +1 -0
- package/dist/orchestrator/events.js +20 -0
- package/dist/orchestrator/events.js.map +1 -0
- package/dist/orchestrator/github-credential-anchor-sender.d.ts +159 -0
- package/dist/orchestrator/github-credential-anchor-sender.d.ts.map +1 -0
- package/dist/orchestrator/github-credential-anchor-sender.js +313 -0
- package/dist/orchestrator/github-credential-anchor-sender.js.map +1 -0
- package/dist/orchestrator/hub-dispatch.d.ts +120 -0
- package/dist/orchestrator/hub-dispatch.d.ts.map +1 -0
- package/dist/orchestrator/hub-dispatch.js +257 -0
- package/dist/orchestrator/hub-dispatch.js.map +1 -0
- package/dist/orchestrator/hub-observer.d.ts +201 -0
- package/dist/orchestrator/hub-observer.d.ts.map +1 -0
- package/dist/orchestrator/hub-observer.js +474 -0
- package/dist/orchestrator/hub-observer.js.map +1 -0
- package/dist/orchestrator/journal-writer.d.ts +80 -0
- package/dist/orchestrator/journal-writer.d.ts.map +1 -0
- package/dist/orchestrator/journal-writer.js +113 -0
- package/dist/orchestrator/journal-writer.js.map +1 -0
- package/dist/orchestrator/mcp/server.d.ts +136 -0
- package/dist/orchestrator/mcp/server.d.ts.map +1 -0
- package/dist/orchestrator/mcp/server.js +582 -0
- package/dist/orchestrator/mcp/server.js.map +1 -0
- package/dist/orchestrator/mcp/stdio.d.ts +22 -0
- package/dist/orchestrator/mcp/stdio.d.ts.map +1 -0
- package/dist/orchestrator/mcp/stdio.js +51 -0
- package/dist/orchestrator/mcp/stdio.js.map +1 -0
- package/dist/orchestrator/review.d.ts +131 -0
- package/dist/orchestrator/review.d.ts.map +1 -0
- package/dist/orchestrator/review.js +322 -0
- package/dist/orchestrator/review.js.map +1 -0
- package/dist/tui/app.d.ts +33 -0
- package/dist/tui/app.d.ts.map +1 -0
- package/dist/tui/app.js +71 -0
- package/dist/tui/app.js.map +1 -0
- package/dist/tui/components.d.ts +110 -0
- package/dist/tui/components.d.ts.map +1 -0
- package/dist/tui/components.js +118 -0
- package/dist/tui/components.js.map +1 -0
- package/dist/tui/index.d.ts +30 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +95 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/keymap.d.ts +33 -0
- package/dist/tui/keymap.d.ts.map +1 -0
- package/dist/tui/keymap.js +49 -0
- package/dist/tui/keymap.js.map +1 -0
- package/dist/tui/nav.d.ts +29 -0
- package/dist/tui/nav.d.ts.map +1 -0
- package/dist/tui/nav.js +39 -0
- package/dist/tui/nav.js.map +1 -0
- package/dist/tui/sanitize.d.ts +25 -0
- package/dist/tui/sanitize.d.ts.map +1 -0
- package/dist/tui/sanitize.js +36 -0
- package/dist/tui/sanitize.js.map +1 -0
- package/dist/tui/theme.d.ts +32 -0
- package/dist/tui/theme.d.ts.map +1 -0
- package/dist/tui/theme.js +63 -0
- package/dist/tui/theme.js.map +1 -0
- package/dist/tui/views/agents.d.ts +67 -0
- package/dist/tui/views/agents.d.ts.map +1 -0
- package/dist/tui/views/agents.js +231 -0
- package/dist/tui/views/agents.js.map +1 -0
- package/dist/tui/views/index.d.ts +93 -0
- package/dist/tui/views/index.d.ts.map +1 -0
- package/dist/tui/views/index.js +150 -0
- package/dist/tui/views/index.js.map +1 -0
- package/dist/tui/views/registry.d.ts +22 -0
- package/dist/tui/views/registry.d.ts.map +1 -0
- package/dist/tui/views/registry.js +110 -0
- package/dist/tui/views/registry.js.map +1 -0
- package/dist/utils/agent/backoff.d.ts +31 -0
- package/dist/utils/agent/backoff.d.ts.map +1 -0
- package/dist/utils/agent/backoff.js +51 -0
- package/dist/utils/agent/backoff.js.map +1 -0
- package/dist/utils/agent/markers.d.ts +87 -0
- package/dist/utils/agent/markers.d.ts.map +1 -0
- package/dist/utils/agent/markers.js +147 -0
- package/dist/utils/agent/markers.js.map +1 -0
- package/dist/utils/agent/review.d.ts +67 -0
- package/dist/utils/agent/review.d.ts.map +1 -0
- package/dist/utils/agent/review.js +305 -0
- package/dist/utils/agent/review.js.map +1 -0
- package/dist/utils/agent/spawn-agent.d.ts +117 -0
- package/dist/utils/agent/spawn-agent.d.ts.map +1 -0
- package/dist/utils/agent/spawn-agent.js +177 -0
- package/dist/utils/agent/spawn-agent.js.map +1 -0
- package/dist/utils/agent/task.d.ts +101 -0
- package/dist/utils/agent/task.d.ts.map +1 -0
- package/dist/utils/agent/task.js +357 -0
- package/dist/utils/agent/task.js.map +1 -0
- package/dist/utils/agent/verify.d.ts +47 -0
- package/dist/utils/agent/verify.d.ts.map +1 -0
- package/dist/utils/agent/verify.js +144 -0
- package/dist/utils/agent/verify.js.map +1 -0
- package/dist/utils/agent-detector.d.ts +48 -0
- package/dist/utils/agent-detector.d.ts.map +1 -0
- package/dist/utils/agent-detector.js +74 -0
- package/dist/utils/agent-detector.js.map +1 -0
- package/dist/utils/agent-profile-stage.d.ts +70 -0
- package/dist/utils/agent-profile-stage.d.ts.map +1 -0
- package/dist/utils/agent-profile-stage.js +153 -0
- package/dist/utils/agent-profile-stage.js.map +1 -0
- package/dist/utils/agent-profiles.d.ts +27 -0
- package/dist/utils/agent-profiles.d.ts.map +1 -0
- package/dist/utils/agent-profiles.js +61 -0
- package/dist/utils/agent-profiles.js.map +1 -0
- package/dist/utils/checkpoint-api.d.ts +1 -1
- package/dist/utils/checkpoint-api.js +1 -1
- package/dist/utils/checkpoint-env.d.ts +1 -1
- package/dist/utils/checkpoint-env.js +2 -2
- package/dist/utils/checkpoint-env.js.map +1 -1
- package/dist/utils/checkpoint-scaffold.d.ts +1 -1
- package/dist/utils/checkpoint-scaffold.js +1 -1
- package/dist/utils/cli-kit/browser.d.ts +24 -0
- package/dist/utils/cli-kit/browser.d.ts.map +1 -0
- package/dist/utils/cli-kit/browser.js +58 -0
- package/dist/utils/cli-kit/browser.js.map +1 -0
- package/dist/utils/cli-kit/claim-polling.d.ts +18 -0
- package/dist/utils/cli-kit/claim-polling.d.ts.map +1 -0
- package/dist/utils/{claim-polling.js → cli-kit/claim-polling.js} +19 -26
- package/dist/utils/cli-kit/claim-polling.js.map +1 -0
- package/dist/utils/cli-kit/diagnostics.d.ts +9 -0
- package/dist/utils/cli-kit/diagnostics.d.ts.map +1 -0
- package/dist/utils/cli-kit/diagnostics.js +11 -0
- package/dist/utils/cli-kit/diagnostics.js.map +1 -0
- package/dist/utils/cli-kit/fs-safe.d.ts +14 -0
- package/dist/utils/cli-kit/fs-safe.d.ts.map +1 -0
- package/dist/utils/cli-kit/fs-safe.js +20 -0
- package/dist/utils/cli-kit/fs-safe.js.map +1 -0
- package/dist/utils/cli-kit/index.d.ts +15 -0
- package/dist/utils/cli-kit/index.d.ts.map +1 -0
- package/dist/utils/cli-kit/index.js +10 -0
- package/dist/utils/cli-kit/index.js.map +1 -0
- package/dist/utils/cli-kit/json-file.d.ts +21 -0
- package/dist/utils/cli-kit/json-file.d.ts.map +1 -0
- package/dist/utils/cli-kit/json-file.js +51 -0
- package/dist/utils/cli-kit/json-file.js.map +1 -0
- package/dist/utils/cli-kit/marker-block.d.ts +26 -0
- package/dist/utils/cli-kit/marker-block.d.ts.map +1 -0
- package/dist/utils/cli-kit/marker-block.js +61 -0
- package/dist/utils/cli-kit/marker-block.js.map +1 -0
- package/dist/utils/cli-kit/paths.d.ts +15 -0
- package/dist/utils/cli-kit/paths.d.ts.map +1 -0
- package/dist/utils/cli-kit/paths.js +21 -0
- package/dist/utils/cli-kit/paths.js.map +1 -0
- package/dist/utils/cli-kit/secure-storage.d.ts +14 -0
- package/dist/utils/cli-kit/secure-storage.d.ts.map +1 -0
- package/dist/utils/cli-kit/secure-storage.js +20 -0
- package/dist/utils/cli-kit/secure-storage.js.map +1 -0
- package/dist/utils/cli-kit/step-report.d.ts +16 -0
- package/dist/utils/cli-kit/step-report.d.ts.map +1 -0
- package/dist/utils/cli-kit/step-report.js +36 -0
- package/dist/utils/cli-kit/step-report.js.map +1 -0
- package/dist/utils/dco/agent-metadata.d.ts +1 -1
- package/dist/utils/dco/agent-metadata.js +1 -1
- package/dist/utils/dco/agent-metadata.js.map +1 -1
- package/dist/utils/dco/claude-config.d.ts +18 -14
- package/dist/utils/dco/claude-config.d.ts.map +1 -1
- package/dist/utils/dco/claude-config.js +31 -97
- package/dist/utils/dco/claude-config.js.map +1 -1
- package/dist/utils/dco/dispatch.d.ts +134 -0
- package/dist/utils/dco/dispatch.d.ts.map +1 -0
- package/dist/utils/dco/dispatch.js +399 -0
- package/dist/utils/dco/dispatch.js.map +1 -0
- package/dist/utils/dco/fix.d.ts +122 -0
- package/dist/utils/dco/fix.d.ts.map +1 -0
- package/dist/utils/dco/fix.js +560 -0
- package/dist/utils/dco/fix.js.map +1 -0
- package/dist/utils/dco/git-config.d.ts.map +1 -1
- package/dist/utils/dco/git-config.js +5 -3
- package/dist/utils/dco/git-config.js.map +1 -1
- package/dist/utils/dco/github.d.ts +101 -0
- package/dist/utils/dco/github.d.ts.map +1 -1
- package/dist/utils/dco/github.js +133 -0
- package/dist/utils/dco/github.js.map +1 -1
- package/dist/utils/dco/paths.d.ts +1 -8
- package/dist/utils/dco/paths.d.ts.map +1 -1
- package/dist/utils/dco/paths.js +3 -12
- package/dist/utils/dco/paths.js.map +1 -1
- package/dist/utils/dco/render.d.ts +1 -1
- package/dist/utils/dco/render.d.ts.map +1 -1
- package/dist/utils/dco/render.js +4 -21
- package/dist/utils/dco/render.js.map +1 -1
- package/dist/utils/dco/resolve-agent.d.ts +54 -0
- package/dist/utils/dco/resolve-agent.d.ts.map +1 -0
- package/dist/utils/dco/resolve-agent.js +164 -0
- package/dist/utils/dco/resolve-agent.js.map +1 -0
- package/dist/utils/dco/setup.d.ts +10 -7
- package/dist/utils/dco/setup.d.ts.map +1 -1
- package/dist/utils/dco/setup.js +264 -200
- package/dist/utils/dco/setup.js.map +1 -1
- package/dist/utils/dco/signing-key-writer.d.ts +40 -0
- package/dist/utils/dco/signing-key-writer.d.ts.map +1 -0
- package/dist/utils/dco/signing-key-writer.js +76 -0
- package/dist/utils/dco/signing-key-writer.js.map +1 -0
- package/dist/utils/dco/ssh-key.d.ts +50 -0
- package/dist/utils/dco/ssh-key.d.ts.map +1 -1
- package/dist/utils/dco/ssh-key.js +129 -8
- package/dist/utils/dco/ssh-key.js.map +1 -1
- package/dist/utils/dco/status.d.ts +1 -1
- package/dist/utils/dco/status.d.ts.map +1 -1
- package/dist/utils/dco/status.js +3 -3
- package/dist/utils/dco/status.js.map +1 -1
- package/dist/utils/dco/verify.d.ts +170 -0
- package/dist/utils/dco/verify.d.ts.map +1 -0
- package/dist/utils/dco/verify.js +550 -0
- package/dist/utils/dco/verify.js.map +1 -0
- package/dist/utils/dependency-installer.d.ts +37 -0
- package/dist/utils/dependency-installer.d.ts.map +1 -0
- package/dist/utils/dependency-installer.js +32 -0
- package/dist/utils/dependency-installer.js.map +1 -0
- package/dist/utils/github-credential-stage.d.ts +87 -0
- package/dist/utils/github-credential-stage.d.ts.map +1 -0
- package/dist/utils/github-credential-stage.js +168 -0
- package/dist/utils/github-credential-stage.js.map +1 -0
- package/dist/utils/github-credential.d.ts +160 -0
- package/dist/utils/github-credential.d.ts.map +1 -0
- package/dist/utils/github-credential.js +308 -0
- package/dist/utils/github-credential.js.map +1 -0
- package/dist/utils/gitignore.d.ts +17 -0
- package/dist/utils/gitignore.d.ts.map +1 -0
- package/dist/utils/gitignore.js +40 -0
- package/dist/utils/gitignore.js.map +1 -0
- package/dist/utils/hub-config.d.ts +21 -0
- package/dist/utils/hub-config.d.ts.map +1 -0
- package/dist/utils/hub-config.js +28 -0
- package/dist/utils/hub-config.js.map +1 -0
- package/dist/utils/identity-heal.d.ts +16 -0
- package/dist/utils/identity-heal.d.ts.map +1 -0
- package/dist/utils/identity-heal.js +37 -0
- package/dist/utils/identity-heal.js.map +1 -0
- package/dist/utils/init/pipeline.d.ts +74 -0
- package/dist/utils/init/pipeline.d.ts.map +1 -0
- package/dist/utils/init/pipeline.js +96 -0
- package/dist/utils/init/pipeline.js.map +1 -0
- package/dist/utils/poll.d.ts +15 -1
- package/dist/utils/poll.d.ts.map +1 -1
- package/dist/utils/poll.js +6 -3
- package/dist/utils/poll.js.map +1 -1
- package/dist/utils/register-agent-identity.d.ts +67 -0
- package/dist/utils/register-agent-identity.d.ts.map +1 -0
- package/dist/utils/register-agent-identity.js +34 -0
- package/dist/utils/register-agent-identity.js.map +1 -0
- package/dist/utils/review/did-web-key.d.ts +34 -0
- package/dist/utils/review/did-web-key.d.ts.map +1 -0
- package/dist/utils/review/did-web-key.js +104 -0
- package/dist/utils/review/did-web-key.js.map +1 -0
- package/dist/utils/review/load-registry.d.ts +33 -0
- package/dist/utils/review/load-registry.d.ts.map +1 -0
- package/dist/utils/review/load-registry.js +62 -0
- package/dist/utils/review/load-registry.js.map +1 -0
- package/dist/utils/review/verdict-verify.d.ts +43 -0
- package/dist/utils/review/verdict-verify.d.ts.map +1 -0
- package/dist/utils/review/verdict-verify.js +53 -0
- package/dist/utils/review/verdict-verify.js.map +1 -0
- package/dist/utils/review-registry-writer.d.ts +52 -0
- package/dist/utils/review-registry-writer.d.ts.map +1 -0
- package/dist/utils/review-registry-writer.js +79 -0
- package/dist/utils/review-registry-writer.js.map +1 -0
- package/dist/utils/should-install-dependency.d.ts +17 -0
- package/dist/utils/should-install-dependency.d.ts.map +1 -0
- package/dist/utils/should-install-dependency.js +25 -0
- package/dist/utils/should-install-dependency.js.map +1 -0
- package/dist/utils/tool-readiness.d.ts +57 -0
- package/dist/utils/tool-readiness.d.ts.map +1 -0
- package/dist/utils/tool-readiness.js +114 -0
- package/dist/utils/tool-readiness.js.map +1 -0
- package/dist/utils/which.d.ts +2 -0
- package/dist/utils/which.d.ts.map +1 -0
- package/dist/utils/which.js +22 -0
- package/dist/utils/which.js.map +1 -0
- package/dist/version.d.ts +15 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +29 -0
- package/dist/version.js.map +1 -0
- package/package.json +19 -6
- package/dist/utils/claim-polling.d.ts +0 -21
- package/dist/utils/claim-polling.d.ts.map +0 -1
- package/dist/utils/claim-polling.js.map +0 -1
- package/dist/utils/dco/fs-safe.d.ts +0 -14
- package/dist/utils/dco/fs-safe.d.ts.map +0 -1
- package/dist/utils/dco/fs-safe.js +0 -20
- package/dist/utils/dco/fs-safe.js.map +0 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verifies that a pull request's attribution byline names an agent identity
|
|
3
|
+
* that actually resolves.
|
|
4
|
+
*
|
|
5
|
+
* `dco setup` only ever *instructs* the harness to write the byline —
|
|
6
|
+
* the PR body is composed by a model at PR time and can be edited by anyone
|
|
7
|
+
* with write access to the branch. So an `Agent DID:` line is a claim, not
|
|
8
|
+
* evidence, until the DID document behind it is fetched and checked. Every
|
|
9
|
+
* failure mode below exists because some way of "resolving" a DID would
|
|
10
|
+
* otherwise let an unverified claim read as verified.
|
|
11
|
+
*/
|
|
12
|
+
export type VerifyFailure = "no-did" | "unsupported-method" | "unresolvable" | "did-mismatch" | "blocked-host";
|
|
13
|
+
export interface AttributionVerification {
|
|
14
|
+
ok: boolean;
|
|
15
|
+
/** The DID claimed by the PR body, when exactly one valid claim is present. */
|
|
16
|
+
did?: string;
|
|
17
|
+
/** Where the DID document was fetched from. */
|
|
18
|
+
documentUrl?: string;
|
|
19
|
+
/** The agent's registry page, taken from the document's service entry. */
|
|
20
|
+
agentUrl?: string;
|
|
21
|
+
reason?: VerifyFailure;
|
|
22
|
+
detail?: string;
|
|
23
|
+
}
|
|
24
|
+
export type FetchLike = (url: string, init?: {
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
redirect?: RequestInit["redirect"];
|
|
27
|
+
}) => Promise<Response>;
|
|
28
|
+
/**
|
|
29
|
+
* Resolve a hostname to every address it answers to. Injectable for the same
|
|
30
|
+
* reason `FetchLike` is: production wants the real resolver, tests want a
|
|
31
|
+
* fixed answer instead of a live DNS lookup.
|
|
32
|
+
*/
|
|
33
|
+
export type LookupLike = (hostname: string) => Promise<string[]>;
|
|
34
|
+
/**
|
|
35
|
+
* Exported (review-loop P9 commit 3) so `review verify`'s did:web
|
|
36
|
+
* resolution (`../review/did-web-key.ts`) can pass the real resolver
|
|
37
|
+
* through to {@link checkDocumentHostIsSafe} without redefining it — same
|
|
38
|
+
* reasoning as that export.
|
|
39
|
+
*/
|
|
40
|
+
export declare const defaultLookup: LookupLike;
|
|
41
|
+
/**
|
|
42
|
+
* The document host is chosen by the DID, which comes from a PR body we do
|
|
43
|
+
* not control. Without a deadline a hostile or merely unreachable host hangs
|
|
44
|
+
* the command for as long as it cares to hold the socket open — tolerable
|
|
45
|
+
* when a human can interrupt it, not when this runs unattended in CI.
|
|
46
|
+
*/
|
|
47
|
+
export declare const RESOLVE_TIMEOUT_MS = 10000;
|
|
48
|
+
/**
|
|
49
|
+
* Pull the claimed DID out of a PR body.
|
|
50
|
+
*
|
|
51
|
+
* Returns null when the body claims two *different* DIDs. Taking the first
|
|
52
|
+
* match would mean an appended line could never change the verdict, but it
|
|
53
|
+
* would also mean a forged line prepended above the real one silently wins.
|
|
54
|
+
* Ambiguous attribution is a failure, not a tie to be broken.
|
|
55
|
+
*/
|
|
56
|
+
export declare function extractAgentDid(prBody: string): string | null;
|
|
57
|
+
/**
|
|
58
|
+
* Whether a piece of text already carries an `Agent DID:` attribution line
|
|
59
|
+
* that `extractAgentDid` would pick up. Uses the exact same line pattern and
|
|
60
|
+
* backtick/whitespace handling, so a caller (notably `dco dispatch`, which
|
|
61
|
+
* appends its own authoritative line) can reject a description that would
|
|
62
|
+
* otherwise put a second, conflicting DID into the PR body. Matches the
|
|
63
|
+
* managed CLAUDE.md block's backticked, mid-line form, not just a line-start
|
|
64
|
+
* one.
|
|
65
|
+
*/
|
|
66
|
+
export declare function hasAgentDidClaim(text: string): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Map a `did:web` to the HTTPS URL its document must be served from, per the
|
|
69
|
+
* did:web method spec: the identifier's colon-separated segments *are* the
|
|
70
|
+
* path, and a bare domain resolves under `/.well-known/`.
|
|
71
|
+
*
|
|
72
|
+
* Segments are validated AFTER percent-decoding. `DID_PATTERN` permits `%`,
|
|
73
|
+
* so a crafted `%2F` would otherwise smuggle a path separator through and
|
|
74
|
+
* point resolution at an attacker-chosen URL on the same host.
|
|
75
|
+
*/
|
|
76
|
+
export declare function didWebToHttpsUrl(did: string): string | null;
|
|
77
|
+
/**
|
|
78
|
+
* Cheap, synchronous first line of defense against the exact literals an
|
|
79
|
+
* attacker would put directly in a did:web host: `localhost`, or an IPv4
|
|
80
|
+
* literal in a private, loopback, link-local, or otherwise reserved range.
|
|
81
|
+
*
|
|
82
|
+
* Takes the hostname `new URL()` produces, not the raw did:web segment.
|
|
83
|
+
* `URL` canonicalizes decimal/hex/octal IPv4 shorthand (`2130706433` and
|
|
84
|
+
* `0x7f000001` both become `127.0.0.1`) before `fetch` ever sees it, so
|
|
85
|
+
* checking the pre-parse segment would miss exactly the encodings an
|
|
86
|
+
* attacker would reach for to slip past a naive dotted-quad check. The
|
|
87
|
+
* trailing dot is stripped first for the same reason: `new URL()` preserves
|
|
88
|
+
* a root-zone dot (`"localhost."` stays `"localhost."`), and DNS treats it
|
|
89
|
+
* as identical to `"localhost"` — an unstripped compare would let that
|
|
90
|
+
* single character walk straight past an exact-match or `endsWith` check.
|
|
91
|
+
*
|
|
92
|
+
* This is a fast-path, not the actual guarantee: it only catches literals,
|
|
93
|
+
* so it cannot see a normal-looking hostname whose A/AAAA record happens to
|
|
94
|
+
* point at an internal address. `hostResolvesToBlockedAddress` below is
|
|
95
|
+
* what actually closes that gap, by checking where the name resolves to
|
|
96
|
+
* rather than how it's spelled.
|
|
97
|
+
*/
|
|
98
|
+
export declare function isBlockedResolutionHost(hostname: string): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* The actual guarantee `isBlockedResolutionHost` can't provide on its own:
|
|
101
|
+
* resolve the hostname and check every address it answers to, not just
|
|
102
|
+
* whether the hostname string itself looks like one of the blocked
|
|
103
|
+
* literals. A domain an attacker controls can point an A/AAAA record at
|
|
104
|
+
* 169.254.169.254 (or loopback, or an RFC1918 address) just as easily as a
|
|
105
|
+
* did:web host can spell the address out directly — DNS is the attacker's
|
|
106
|
+
* to shape here just as much as the PR body text is, since the DID names
|
|
107
|
+
* whatever host they choose.
|
|
108
|
+
*
|
|
109
|
+
* Deliberately does not catch a lookup failure: that is "no evidence
|
|
110
|
+
* either way", the same as a failed fetch, and the caller already has a
|
|
111
|
+
* reason for that (`unresolvable`) that this must not collide with —
|
|
112
|
+
* mislabeling a plain NXDOMAIN as "blocked-host" would tell the CLI's user
|
|
113
|
+
* they hit a private address when they actually just mistyped a domain.
|
|
114
|
+
*/
|
|
115
|
+
export declare function hostResolvesToBlockedAddress(hostname: string, lookupImpl?: LookupLike): Promise<boolean>;
|
|
116
|
+
export type HostSafetyCheck = {
|
|
117
|
+
safe: true;
|
|
118
|
+
} | {
|
|
119
|
+
safe: false;
|
|
120
|
+
reason: "unresolvable" | "blocked-host";
|
|
121
|
+
detail: string;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Everything that has to be true about `documentUrl`'s host before it is
|
|
125
|
+
* worth spending a request on: it must parse, it must not be one of the
|
|
126
|
+
* literals `isBlockedResolutionHost` recognizes, and it must not resolve to
|
|
127
|
+
* one either. Pulled out on its own so `verifyPrAttribution` reads as one
|
|
128
|
+
* linear pipeline instead of three nested guard clauses doing the same kind
|
|
129
|
+
* of check.
|
|
130
|
+
*
|
|
131
|
+
* Exported (review-loop P9 commit 3): `review verify`'s did:web resolution
|
|
132
|
+
* fetches a DIFFERENT document (an agent's DID document, not a PR-body
|
|
133
|
+
* claim) from an equally untrusted, wire-supplied host, and needs the exact
|
|
134
|
+
* same SSRF defense before spending a request on it. Reusing this function
|
|
135
|
+
* keeps that defense in ONE place rather than re-deriving the blocked-range
|
|
136
|
+
* checks a second time.
|
|
137
|
+
*/
|
|
138
|
+
export declare function checkDocumentHostIsSafe(documentUrl: string, lookupImpl: LookupLike): Promise<HostSafetyCheck>;
|
|
139
|
+
/**
|
|
140
|
+
* Resolve the DID claimed by a PR body and confirm the document describes
|
|
141
|
+
* that same DID.
|
|
142
|
+
*/
|
|
143
|
+
export declare function verifyPrAttribution(prBody: string, fetchImpl?: FetchLike, lookupImpl?: LookupLike): Promise<AttributionVerification>;
|
|
144
|
+
export type KeyResolutionFailure = Exclude<VerifyFailure, "no-did"> | "no-ed25519-key";
|
|
145
|
+
export interface AgentPublicKeyResolution {
|
|
146
|
+
ok: boolean;
|
|
147
|
+
did: string;
|
|
148
|
+
/** Raw 32-byte Ed25519 public key, present only when `ok`. */
|
|
149
|
+
publicKeyRaw?: Buffer;
|
|
150
|
+
documentUrl?: string;
|
|
151
|
+
reason?: KeyResolutionFailure;
|
|
152
|
+
detail?: string;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Resolve an agent DID to its raw 32-byte Ed25519 public key, for verifying
|
|
156
|
+
* a signature it produced (a review verdict's or fix attestation's
|
|
157
|
+
* `proof`). This is `kya-os agent verify`'s "key resolution v1": scoped to
|
|
158
|
+
* `did:web` only, since every reviewer/maker DID in this feature is
|
|
159
|
+
* `did:web:knowthat.ai:agents:<slug>` — a `did:key` or other method fails
|
|
160
|
+
* closed with `unsupported-method` rather than half-supporting it (state
|
|
161
|
+
* that scope in the command's `--help`, per this feature's design doc).
|
|
162
|
+
*
|
|
163
|
+
* The DID here is read off a PR review or comment — the same
|
|
164
|
+
* untrusted-input shape `verifyPrAttribution` already handles — so it goes
|
|
165
|
+
* through the identical SSRF-hardened resolution path
|
|
166
|
+
* (`resolveDidWebDocument`) before this function ever looks at the document
|
|
167
|
+
* for a key.
|
|
168
|
+
*/
|
|
169
|
+
export declare function resolveAgentEd25519PublicKey(did: string, fetchImpl?: FetchLike, lookupImpl?: LookupLike): Promise<AgentPublicKeyResolution>;
|
|
170
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/utils/dco/verify.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,oBAAoB,GACpB,cAAc,GACd,cAAc,GACd,cAAc,CAAC;AAEnB,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,OAAO,CAAC;IACZ,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,SAAS,GAAG,CACtB,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAA;CAAE,KAChE,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEvB;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAEjE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,UAG3B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,QAAS,CAAC;AAWzC;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAY7D;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQtD;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqC3D;AA0ED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAIjE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,MAAM,EAChB,UAAU,GAAE,UAA0B,GACrC,OAAO,CAAC,OAAO,CAAC,CAGlB;AAED,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GACd;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7E;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,eAAe,CAAC,CA0C1B;AA8HD;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,SAAS,GAAE,SAA2C,EACtD,UAAU,GAAE,UAA0B,GACrC,OAAO,CAAC,uBAAuB,CAAC,CAqBlC;AA4GD,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,GAAG,gBAAgB,CAAC;AAEvF,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,OAAO,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,4BAA4B,CAChD,GAAG,EAAE,MAAM,EACX,SAAS,GAAE,SAA2C,EACtD,UAAU,GAAE,UAA0B,GACrC,OAAO,CAAC,wBAAwB,CAAC,CAwBnC"}
|