@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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type MergeJsonResult, type UpsertResult as CliKitUpsertResult } from "../cli-kit/index.js";
|
|
1
2
|
/**
|
|
2
3
|
* Claude Code integration: a managed block in CLAUDE.md instructs the agent
|
|
3
4
|
* harness to attribute PRs to the registered agent, and .claude/settings.json
|
|
@@ -6,37 +7,40 @@
|
|
|
6
7
|
* The PR byline can only be influenced through instructions because the PR
|
|
7
8
|
* body is composed by the model at PR time; commit trailers are enforced
|
|
8
9
|
* mechanically by the git hook instead (see git-config.ts).
|
|
10
|
+
*
|
|
11
|
+
* The block used to interpolate a specific agent's name/URL/DID as literal
|
|
12
|
+
* strings. That was wrong for any repo that receives dispatched work from
|
|
13
|
+
* more than one agent: CLAUDE.md is committed, so the literal values only
|
|
14
|
+
* ever reflected whichever agent happened to run `dco setup` first, and
|
|
15
|
+
* every other agent's PRs in that repo would carry a false attribution with
|
|
16
|
+
* no way to correct it short of re-running `dco setup` (which a dispatch
|
|
17
|
+
* flow generally can't do per task). The block below is agent-agnostic
|
|
18
|
+
* instead: it tells the agent to run `dco whoami` and use whatever
|
|
19
|
+
* that reports, so the byline is always whichever identity is actually
|
|
20
|
+
* configured in the current checkout. See resolve-agent.ts.
|
|
9
21
|
*/
|
|
10
22
|
export declare const CLAUDE_MD_START = "<!-- mcpi:dco:start -->";
|
|
11
23
|
export declare const CLAUDE_MD_END = "<!-- mcpi:dco:end -->";
|
|
12
24
|
export interface AttributionBlockParams {
|
|
13
|
-
agentName: string;
|
|
14
|
-
agentUrl: string;
|
|
15
|
-
/**
|
|
16
|
-
* The agent's DID (e.g. `did:key:z6Mk...`). Included as a machine-readable
|
|
17
|
-
* companion to the human-readable byline so PR metadata resolves back to a
|
|
18
|
-
* specific KYA-OS registered agent identity, not just a display name.
|
|
19
|
-
*/
|
|
20
|
-
agentDid?: string;
|
|
21
25
|
/**
|
|
22
26
|
* When the git hook could not be installed (foreign hook, unsafe
|
|
23
27
|
* core.hooksPath, or install failure), trailer duty falls back to
|
|
24
28
|
* instructions.
|
|
25
29
|
*/
|
|
26
30
|
includeTrailerInstructions?: boolean;
|
|
27
|
-
humanName?: string;
|
|
28
|
-
humanEmail?: string;
|
|
29
|
-
agentEmail?: string;
|
|
30
31
|
}
|
|
31
|
-
export declare
|
|
32
|
-
export
|
|
32
|
+
export declare const DID_PATTERN: RegExp;
|
|
33
|
+
export declare const MAX_DID_LENGTH = 200;
|
|
34
|
+
export declare function isValidDid(value: string): boolean;
|
|
35
|
+
export declare function buildAttributionBlock(params?: AttributionBlockParams): string;
|
|
36
|
+
export type UpsertResult = CliKitUpsertResult;
|
|
33
37
|
export declare function upsertClaudeMdBlock(cwd: string, block: string, options?: {
|
|
34
38
|
dryRun?: boolean;
|
|
35
39
|
}): {
|
|
36
40
|
result: UpsertResult;
|
|
37
41
|
path: string;
|
|
38
42
|
};
|
|
39
|
-
export type SettingsResult =
|
|
43
|
+
export type SettingsResult = MergeJsonResult;
|
|
40
44
|
/**
|
|
41
45
|
* Set includeCoAuthoredBy: false in .claude/settings.json, preserving every
|
|
42
46
|
* other key. A file we cannot parse is left untouched: clobbering a user's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-config.d.ts","sourceRoot":"","sources":["../../../src/utils/dco/claude-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude-config.d.ts","sourceRoot":"","sources":["../../../src/utils/dco/claude-config.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,YAAY,IAAI,kBAAkB,EACxC,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,eAAO,MAAM,eAAe,4BAA4B,CAAC;AACzD,eAAO,MAAM,aAAa,0BAA0B,CAAC;AAErD,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACtC;AAQD,eAAO,MAAM,WAAW,QAAuC,CAAC;AAChE,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,wBAAgB,qBAAqB,CAAC,MAAM,GAAE,sBAA2B,GAAG,MAAM,CAqBjF;AAED,MAAM,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAE9C,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACjC;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CASxC;AAED,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACjC;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAG1C"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readFileSync } from "fs";
|
|
2
1
|
import { join } from "path";
|
|
3
|
-
import {
|
|
2
|
+
import { mergeJsonFile, upsertMarkerBlock, } from "../cli-kit/index.js";
|
|
4
3
|
/**
|
|
5
4
|
* Claude Code integration: a managed block in CLAUDE.md instructs the agent
|
|
6
5
|
* harness to attribute PRs to the registered agent, and .claude/settings.json
|
|
@@ -9,86 +8,51 @@ import { writeFileAtomicSafe } from "./fs-safe.js";
|
|
|
9
8
|
* The PR byline can only be influenced through instructions because the PR
|
|
10
9
|
* body is composed by the model at PR time; commit trailers are enforced
|
|
11
10
|
* mechanically by the git hook instead (see git-config.ts).
|
|
11
|
+
*
|
|
12
|
+
* The block used to interpolate a specific agent's name/URL/DID as literal
|
|
13
|
+
* strings. That was wrong for any repo that receives dispatched work from
|
|
14
|
+
* more than one agent: CLAUDE.md is committed, so the literal values only
|
|
15
|
+
* ever reflected whichever agent happened to run `dco setup` first, and
|
|
16
|
+
* every other agent's PRs in that repo would carry a false attribution with
|
|
17
|
+
* no way to correct it short of re-running `dco setup` (which a dispatch
|
|
18
|
+
* flow generally can't do per task). The block below is agent-agnostic
|
|
19
|
+
* instead: it tells the agent to run `dco whoami` and use whatever
|
|
20
|
+
* that reports, so the byline is always whichever identity is actually
|
|
21
|
+
* configured in the current checkout. See resolve-agent.ts.
|
|
12
22
|
*/
|
|
13
23
|
export const CLAUDE_MD_START = "<!-- mcpi:dco:start -->";
|
|
14
24
|
export const CLAUDE_MD_END = "<!-- mcpi:dco:end -->";
|
|
15
|
-
/**
|
|
16
|
-
* Values interpolated into the managed block come from .mcpi/agent.json and
|
|
17
|
-
* git config, both attacker-influenceable in a cloned repo. Clamp everything
|
|
18
|
-
* to a single line with no control characters so crafted metadata cannot
|
|
19
|
-
* inject extra instructions into a block the harness treats as trusted.
|
|
20
|
-
*/
|
|
21
|
-
function singleLine(value) {
|
|
22
|
-
// eslint-disable-next-line no-control-regex
|
|
23
|
-
return value.replace(/[\u0000-\u001f\u007f]+/g, " ").trim();
|
|
24
|
-
}
|
|
25
25
|
// did:key / did:web / etc: a lowercase method name, then method-specific-id
|
|
26
26
|
// drawn from the DID spec's idchar set. No backtick, "<", "!", or whitespace
|
|
27
|
-
// can appear in a matching value
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const DID_PATTERN = /^did:[a-z0-9]+:[A-Za-z0-9.\-_:%]+$/;
|
|
35
|
-
const MAX_DID_LENGTH = 200;
|
|
36
|
-
function isValidDid(value) {
|
|
27
|
+
// can appear in a matching value. Exported for verify.ts, which validates a
|
|
28
|
+
// DID claimed in a PR body against this same shape before ever resolving
|
|
29
|
+
// it, and for resolve-agent.ts, which validates the DID read from
|
|
30
|
+
// .mcpi/identity.json before it's ever printed by `dco whoami`.
|
|
31
|
+
export const DID_PATTERN = /^did:[a-z0-9]+:[A-Za-z0-9.\-_:%]+$/;
|
|
32
|
+
export const MAX_DID_LENGTH = 200;
|
|
33
|
+
export function isValidDid(value) {
|
|
37
34
|
return value.length <= MAX_DID_LENGTH && DID_PATTERN.test(value);
|
|
38
35
|
}
|
|
39
|
-
export function buildAttributionBlock(params) {
|
|
40
|
-
const agentName = singleLine(params.agentName);
|
|
41
|
-
const agentUrl = singleLine(params.agentUrl);
|
|
42
|
-
const agentDid = params.agentDid && isValidDid(params.agentDid) ? params.agentDid : undefined;
|
|
36
|
+
export function buildAttributionBlock(params = {}) {
|
|
43
37
|
const lines = [
|
|
44
38
|
CLAUDE_MD_START,
|
|
45
|
-
"## Agent attribution (managed by `
|
|
39
|
+
"## Agent attribution (managed by `dco setup`)",
|
|
46
40
|
"",
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
`
|
|
41
|
+
"- Before creating a pull request, run `dco whoami --json` in this repo to find the agent identity configured in this checkout.",
|
|
42
|
+
'- If it reports `"configured": true`, end the PR description with exactly these two lines, filled in from that command\'s `name`, `url`, and `did` fields (curly braces mark what to fill in; every other character, including the square/round brackets and the angle brackets around the DID line, is literal):',
|
|
43
|
+
" `Generated with [{name}]({url})`",
|
|
44
|
+
" `Agent DID: {did}`",
|
|
45
|
+
'- If it reports `"configured": false`, do not add a "Generated with" or "Agent DID" line at all.',
|
|
46
|
+
'- Never add "Generated with Claude Code" or any other tool byline to PR descriptions or commit messages.',
|
|
51
47
|
];
|
|
52
|
-
if (agentDid) {
|
|
53
|
-
lines.push(` \`Agent DID: ${agentDid}\``);
|
|
54
|
-
}
|
|
55
|
-
lines.push('- Never add "Generated with Claude Code" or any other tool byline to PR descriptions or commit messages.');
|
|
56
48
|
if (params.includeTrailerInstructions) {
|
|
57
|
-
lines.push("- End every commit message with these trailers:", `
|
|
49
|
+
lines.push("- End every commit message with these trailers. Resolve the first line from `git config user.name` / `git config user.email`, and the second from `dco whoami --json`'s `name` and `email` fields (omit this line entirely if `configured` is false). Curly braces mark what to fill in; the angle brackets around each email are literal characters git trailers require, keep them:", " `Signed-off-by: {your name} <{your email}>`", " `Co-authored-by: {agent name} <{agent email}>`");
|
|
58
50
|
}
|
|
59
51
|
lines.push(CLAUDE_MD_END);
|
|
60
52
|
return lines.join("\n");
|
|
61
53
|
}
|
|
62
54
|
export function upsertClaudeMdBlock(cwd, block, options = {}) {
|
|
63
|
-
|
|
64
|
-
if (!existsSync(path)) {
|
|
65
|
-
if (options.dryRun) {
|
|
66
|
-
return { result: "would-change", path };
|
|
67
|
-
}
|
|
68
|
-
writeFileAtomicSafe(path, block + "\n");
|
|
69
|
-
return { result: "created", path };
|
|
70
|
-
}
|
|
71
|
-
const existing = readFileSync(path, "utf-8");
|
|
72
|
-
const startIdx = existing.indexOf(CLAUDE_MD_START);
|
|
73
|
-
const endIdx = existing.indexOf(CLAUDE_MD_END);
|
|
74
|
-
let next;
|
|
75
|
-
if (startIdx !== -1 && endIdx !== -1 && endIdx > startIdx) {
|
|
76
|
-
const before = existing.slice(0, startIdx);
|
|
77
|
-
const after = existing.slice(endIdx + CLAUDE_MD_END.length);
|
|
78
|
-
next = before + block + after;
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
const separator = existing.endsWith("\n") ? "\n" : "\n\n";
|
|
82
|
-
next = existing + separator + block + "\n";
|
|
83
|
-
}
|
|
84
|
-
if (next === existing) {
|
|
85
|
-
return { result: "unchanged", path };
|
|
86
|
-
}
|
|
87
|
-
if (options.dryRun) {
|
|
88
|
-
return { result: "would-change", path };
|
|
89
|
-
}
|
|
90
|
-
writeFileAtomicSafe(path, next);
|
|
91
|
-
return { result: "updated", path };
|
|
55
|
+
return upsertMarkerBlock(cwd, "CLAUDE.md", CLAUDE_MD_START, CLAUDE_MD_END, block, options);
|
|
92
56
|
}
|
|
93
57
|
/**
|
|
94
58
|
* Set includeCoAuthoredBy: false in .claude/settings.json, preserving every
|
|
@@ -96,37 +60,7 @@ export function upsertClaudeMdBlock(cwd, block, options = {}) {
|
|
|
96
60
|
* settings is worse than leaving the stock byline on.
|
|
97
61
|
*/
|
|
98
62
|
export function updateClaudeSettings(cwd, options = {}) {
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
let settings = {};
|
|
102
|
-
if (existsSync(path)) {
|
|
103
|
-
try {
|
|
104
|
-
const parsed = JSON.parse(readFileSync(path, "utf-8"));
|
|
105
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
106
|
-
return { result: "skipped-invalid", path };
|
|
107
|
-
}
|
|
108
|
-
settings = parsed;
|
|
109
|
-
}
|
|
110
|
-
catch {
|
|
111
|
-
return { result: "skipped-invalid", path };
|
|
112
|
-
}
|
|
113
|
-
if (settings.includeCoAuthoredBy === false) {
|
|
114
|
-
return { result: "unchanged", path };
|
|
115
|
-
}
|
|
116
|
-
if (options.dryRun) {
|
|
117
|
-
return { result: "would-change", path };
|
|
118
|
-
}
|
|
119
|
-
settings.includeCoAuthoredBy = false;
|
|
120
|
-
writeFileAtomicSafe(path, JSON.stringify(settings, null, 2) + "\n");
|
|
121
|
-
return { result: "updated", path };
|
|
122
|
-
}
|
|
123
|
-
if (options.dryRun) {
|
|
124
|
-
return { result: "would-change", path };
|
|
125
|
-
}
|
|
126
|
-
if (!existsSync(dir)) {
|
|
127
|
-
mkdirSync(dir, { recursive: true });
|
|
128
|
-
}
|
|
129
|
-
writeFileAtomicSafe(path, JSON.stringify({ includeCoAuthoredBy: false }, null, 2) + "\n");
|
|
130
|
-
return { result: "created", path };
|
|
63
|
+
const path = join(cwd, ".claude", "settings.json");
|
|
64
|
+
return mergeJsonFile(path, { includeCoAuthoredBy: false }, options);
|
|
131
65
|
}
|
|
132
66
|
//# sourceMappingURL=claude-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-config.js","sourceRoot":"","sources":["../../../src/utils/dco/claude-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"claude-config.js","sourceRoot":"","sources":["../../../src/utils/dco/claude-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EACL,aAAa,EACb,iBAAiB,GAGlB,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,yBAAyB,CAAC;AACzD,MAAM,CAAC,MAAM,aAAa,GAAG,uBAAuB,CAAC;AAWrD,4EAA4E;AAC5E,6EAA6E;AAC7E,4EAA4E;AAC5E,yEAAyE;AACzE,kEAAkE;AAClE,gEAAgE;AAChE,MAAM,CAAC,MAAM,WAAW,GAAG,oCAAoC,CAAC;AAChE,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAElC,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,KAAK,CAAC,MAAM,IAAI,cAAc,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,SAAiC,EAAE;IACvE,MAAM,KAAK,GAAG;QACZ,eAAe;QACf,+CAA+C;QAC/C,EAAE;QACF,gIAAgI;QAChI,mTAAmT;QACnT,oCAAoC;QACpC,sBAAsB;QACtB,kGAAkG;QAClG,0GAA0G;KAC3G,CAAC;IACF,IAAI,MAAM,CAAC,0BAA0B,EAAE,CAAC;QACtC,KAAK,CAAC,IAAI,CACR,uXAAuX,EACvX,+CAA+C,EAC/C,kDAAkD,CACnD,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC1B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAID,MAAM,UAAU,mBAAmB,CACjC,GAAW,EACX,KAAa,EACb,UAAgC,EAAE;IAElC,OAAO,iBAAiB,CACtB,GAAG,EACH,WAAW,EACX,eAAe,EACf,aAAa,EACb,KAAK,EACL,OAAO,CACR,CAAC;AACJ,CAAC;AAID;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,GAAW,EACX,UAAgC,EAAE;IAElC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;IACnD,OAAO,aAAa,CAAC,IAAI,EAAE,EAAE,mBAAmB,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `dco dispatch` — ship a real, agent-signed PR in one command: branch,
|
|
3
|
+
* signed commit, push, `gh pr create` with an `Agent DID:` line, then verify
|
|
4
|
+
* the attribution the same way `dco verify` would.
|
|
5
|
+
*
|
|
6
|
+
* This is the command form of the quickstart runbook's Step 2 block
|
|
7
|
+
* (docs/runbook-mcpi-dco-quickstart.md), including its cold-start
|
|
8
|
+
* self-heal: a repo with no commits gets an initial commit, a repo with
|
|
9
|
+
* no `origin` gets a private GitHub repo created for it.
|
|
10
|
+
*/
|
|
11
|
+
export interface DcoDispatchResult {
|
|
12
|
+
ok: boolean;
|
|
13
|
+
/** Human-readable description of the step that failed, when !ok. */
|
|
14
|
+
failure?: string;
|
|
15
|
+
agent?: {
|
|
16
|
+
name: string;
|
|
17
|
+
slug: string;
|
|
18
|
+
};
|
|
19
|
+
did?: string;
|
|
20
|
+
/** PR title (and commit-subject source); echoed back for --json callers. */
|
|
21
|
+
title?: string;
|
|
22
|
+
branch?: string;
|
|
23
|
+
commitSha?: string;
|
|
24
|
+
signed?: boolean;
|
|
25
|
+
/** Set when the cold-start self-heal had to create a GitHub repo. */
|
|
26
|
+
createdRemote?: string;
|
|
27
|
+
prUrl?: string;
|
|
28
|
+
verified?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface DcoDispatchOptions {
|
|
31
|
+
/**
|
|
32
|
+
* Dispatch as this existing agent instead of the checkout's `.mcpi/`
|
|
33
|
+
* identity: sign with `~/.mcpi/keys/<slug>` via per-invocation git config,
|
|
34
|
+
* so it works from any repo and ignores conflicting repo signing config.
|
|
35
|
+
*/
|
|
36
|
+
agent?: string;
|
|
37
|
+
/**
|
|
38
|
+
* PR title (and the source for the commit subject). Defaults to the
|
|
39
|
+
* description's first line, truncated to MAX_TITLE_LENGTH.
|
|
40
|
+
*/
|
|
41
|
+
title?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Resolve the PR title: the explicit `--title`, or the description's first
|
|
45
|
+
* NON-EMPTY line when omitted (a description that opens with a blank line,
|
|
46
|
+
* e.g. "\n\nActual title", must not yield an empty title). Either way it's
|
|
47
|
+
* truncated to a safe length, since the title also seeds the commit subject
|
|
48
|
+
* and a raw description can run long.
|
|
49
|
+
*/
|
|
50
|
+
export declare function deriveDispatchTitle(description: string, explicitTitle?: string): string;
|
|
51
|
+
/**
|
|
52
|
+
* Lowercase subject on purpose: commitlint `subject-case` hooks reject an
|
|
53
|
+
* uppercase one, and lowercase passes everywhere. Truncated separately from
|
|
54
|
+
* the title (after the "docs: " prefix) so a title near MAX_TITLE_LENGTH
|
|
55
|
+
* still yields a commit subject well inside commitlint's own length rule.
|
|
56
|
+
*/
|
|
57
|
+
export declare function buildDispatchCommitSubject(title: string): string;
|
|
58
|
+
/**
|
|
59
|
+
* Whether `rawCommit` (the raw `git cat-file commit HEAD` output) carries a
|
|
60
|
+
* `gpgsig` header — the reliable signed-commit check (`git log
|
|
61
|
+
* --show-signature` needs `gpg.ssh.allowedSignersFile` locally and
|
|
62
|
+
* misreports otherwise). Exported so `dispatch.ts` and `fix.ts` share the
|
|
63
|
+
* exact same check rather than each re-deriving it: a raw commit object is
|
|
64
|
+
* headers, then ONE blank line, then the free-text commit message, and a
|
|
65
|
+
* naive `/^gpgsig /m.test(rawCommit)` over the WHOLE string false-positives
|
|
66
|
+
* on an unsigned commit whose message body happens to contain a line
|
|
67
|
+
* starting with "gpgsig " (an agent-composed `-m`/`--message` value is
|
|
68
|
+
* exactly that kind of free text). Splitting off the header section before
|
|
69
|
+
* testing closes that gap: git's object format guarantees no blank line
|
|
70
|
+
* appears within the headers themselves, including a multi-line `gpgsig`
|
|
71
|
+
* value's space-prefixed continuation lines, so the first `\n\n` reliably
|
|
72
|
+
* marks the header/message boundary.
|
|
73
|
+
*/
|
|
74
|
+
export declare function isCommitSigned(rawCommit: string): boolean;
|
|
75
|
+
export interface ResolvedSigningIdentity {
|
|
76
|
+
agent: {
|
|
77
|
+
name: string;
|
|
78
|
+
slug: string;
|
|
79
|
+
url: string;
|
|
80
|
+
};
|
|
81
|
+
/** Slug-derived `did:web:knowthat.ai:agents:<slug>`; see the inline comment at its computation below. */
|
|
82
|
+
did: string;
|
|
83
|
+
signingConfig: string[];
|
|
84
|
+
/** Path to the converted OpenSSH signing key backing `signingConfig`, e.g. for `dco fix`'s attestation signing (`fix.ts`). */
|
|
85
|
+
keyPath: string;
|
|
86
|
+
}
|
|
87
|
+
export type ResolveSigningIdentityResult = {
|
|
88
|
+
ok: true;
|
|
89
|
+
identity: ResolvedSigningIdentity;
|
|
90
|
+
} | {
|
|
91
|
+
ok: false;
|
|
92
|
+
failure: string;
|
|
93
|
+
/** Populated only once agent/DID resolution got far enough to know them (a DID-preflight failure). */
|
|
94
|
+
agent?: {
|
|
95
|
+
name: string;
|
|
96
|
+
slug: string;
|
|
97
|
+
};
|
|
98
|
+
did?: string;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Resolve the agent identity, slug-derived DID, and per-invocation git
|
|
102
|
+
* signing config for a dispatch-style operation: either an explicit
|
|
103
|
+
* `--agent <slug>` (signs with `~/.mcpi/keys/<slug>`, works from any repo
|
|
104
|
+
* and ignores conflicting repo signing config) or the checkout's own
|
|
105
|
+
* `.mcpi/` identity. Fails closed, in order, BEFORE any git or GitHub side
|
|
106
|
+
* effects: invalid/missing slug, missing signing key, then DID preflight
|
|
107
|
+
* (`resolveDidPreflight`) so an unclaimed agent never reaches a git or `gh`
|
|
108
|
+
* call.
|
|
109
|
+
*
|
|
110
|
+
* `runDcoDispatch` below and `runDcoFix` (`fix.ts`) both call this instead
|
|
111
|
+
* of re-deriving the same agent/DID/signing-key logic: a second
|
|
112
|
+
* implementation that drifted from this one could sign a commit with a
|
|
113
|
+
* different key than the one an `Agent DID:`/attestation line claims.
|
|
114
|
+
*/
|
|
115
|
+
export declare function resolveSigningIdentity(cwd: string, agentSlug: string | undefined): Promise<ResolveSigningIdentityResult>;
|
|
116
|
+
export interface ColdStartResult {
|
|
117
|
+
/** Set when no `origin` remote existed and one was created. */
|
|
118
|
+
createdRemote?: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The cold-start self-heal `runDcoDispatch` performs on `cwd` before its own
|
|
122
|
+
* demo commit: `git init` if `cwd` isn't a work tree yet, a signed initial
|
|
123
|
+
* commit if there's no `HEAD` yet, and a fresh private GitHub repo if there's
|
|
124
|
+
* no `origin` remote yet. Factored out so `kya-os agent task`
|
|
125
|
+
* (`utils/agent/task.ts`) reuses the exact same self-heal instead of a
|
|
126
|
+
* second copy that could drift on ordering or on which commit ends up
|
|
127
|
+
* signed — see this feature's design doc ("create or reuse a scratch repo
|
|
128
|
+
* the way `runDcoDispatch` cold-start does"). `agent task` runs this
|
|
129
|
+
* against a throwaway temp directory it creates itself, not the caller's own
|
|
130
|
+
* cwd, unlike `runDcoDispatch`'s in-place self-heal.
|
|
131
|
+
*/
|
|
132
|
+
export declare function ensureColdStartRepo(cwd: string, signingConfig: string[]): Promise<ColdStartResult>;
|
|
133
|
+
export declare function runDcoDispatch(cwd: string, description: string, options?: DcoDispatchOptions): Promise<DcoDispatchResult>;
|
|
134
|
+
//# sourceMappingURL=dispatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../../src/utils/dco/dispatch.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,OAAO,CAAC;IACZ,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA8BD,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAYD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EACnB,aAAa,CAAC,EAAE,MAAM,GACrB,MAAM,CASR;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhE;AAmBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAGzD;AAmCD,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,yGAAyG;IACzG,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,8HAA8H;IAC9H,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,4BAA4B,GACpC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,uBAAuB,CAAA;CAAE,GAC/C;IACE,EAAE,EAAE,KAAK,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;IAChB,sGAAsG;IACtG,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEN;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,OAAO,CAAC,4BAA4B,CAAC,CA8EvC;AAED,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CA+CxG;AAED,wBAAsB,cAAc,CAClC,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CA8I5B"}
|