@kya-os/cli 1.7.0 → 2.0.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.
Files changed (161) hide show
  1. package/dist/commands/build.js +2 -2
  2. package/dist/commands/build.js.map +1 -1
  3. package/dist/commands/check.js +3 -3
  4. package/dist/commands/check.js.map +1 -1
  5. package/dist/commands/checkpoint-init.d.ts +32 -0
  6. package/dist/commands/checkpoint-init.d.ts.map +1 -0
  7. package/dist/commands/checkpoint-init.js +521 -0
  8. package/dist/commands/checkpoint-init.js.map +1 -0
  9. package/dist/commands/claim.js +2 -2
  10. package/dist/commands/claim.js.map +1 -1
  11. package/dist/commands/dco.d.ts +38 -1
  12. package/dist/commands/dco.d.ts.map +1 -1
  13. package/dist/commands/dco.js +180 -7
  14. package/dist/commands/dco.js.map +1 -1
  15. package/dist/commands/dev.js +1 -1
  16. package/dist/commands/dev.js.map +1 -1
  17. package/dist/commands/doctor.d.ts.map +1 -1
  18. package/dist/commands/doctor.js +18 -24
  19. package/dist/commands/doctor.js.map +1 -1
  20. package/dist/commands/env.js +6 -6
  21. package/dist/commands/env.js.map +1 -1
  22. package/dist/commands/identity.js +3 -3
  23. package/dist/commands/identity.js.map +1 -1
  24. package/dist/commands/init.d.ts.map +1 -1
  25. package/dist/commands/init.js +103 -65
  26. package/dist/commands/init.js.map +1 -1
  27. package/dist/commands/register.d.ts +1 -1
  28. package/dist/commands/register.d.ts.map +1 -1
  29. package/dist/commands/register.js +35 -7
  30. package/dist/commands/register.js.map +1 -1
  31. package/dist/commands/rotate.js +4 -4
  32. package/dist/commands/rotate.js.map +1 -1
  33. package/dist/commands/start.js +3 -3
  34. package/dist/commands/start.js.map +1 -1
  35. package/dist/commands/status.js +1 -1
  36. package/dist/commands/status.js.map +1 -1
  37. package/dist/commands/verify.js +6 -6
  38. package/dist/commands/verify.js.map +1 -1
  39. package/dist/dco.d.ts +4 -0
  40. package/dist/dco.d.ts.map +1 -0
  41. package/dist/dco.js +21 -0
  42. package/dist/dco.js.map +1 -0
  43. package/dist/index.js +18 -15
  44. package/dist/utils/checkpoint-api.d.ts +86 -0
  45. package/dist/utils/checkpoint-api.d.ts.map +1 -0
  46. package/dist/utils/checkpoint-api.js +196 -0
  47. package/dist/utils/checkpoint-api.js.map +1 -0
  48. package/dist/utils/checkpoint-env.d.ts +23 -0
  49. package/dist/utils/checkpoint-env.d.ts.map +1 -0
  50. package/dist/utils/checkpoint-env.js +59 -0
  51. package/dist/utils/checkpoint-env.js.map +1 -0
  52. package/dist/utils/checkpoint-scaffold.d.ts +61 -0
  53. package/dist/utils/checkpoint-scaffold.d.ts.map +1 -0
  54. package/dist/utils/checkpoint-scaffold.js +268 -0
  55. package/dist/utils/checkpoint-scaffold.js.map +1 -0
  56. package/dist/utils/cli-kit/browser.d.ts +24 -0
  57. package/dist/utils/cli-kit/browser.d.ts.map +1 -0
  58. package/dist/utils/cli-kit/browser.js +58 -0
  59. package/dist/utils/cli-kit/browser.js.map +1 -0
  60. package/dist/utils/cli-kit/claim-polling.d.ts +18 -0
  61. package/dist/utils/cli-kit/claim-polling.d.ts.map +1 -0
  62. package/dist/utils/{claim-polling.js → cli-kit/claim-polling.js} +19 -26
  63. package/dist/utils/cli-kit/claim-polling.js.map +1 -0
  64. package/dist/utils/cli-kit/diagnostics.d.ts +9 -0
  65. package/dist/utils/cli-kit/diagnostics.d.ts.map +1 -0
  66. package/dist/utils/cli-kit/diagnostics.js +11 -0
  67. package/dist/utils/cli-kit/diagnostics.js.map +1 -0
  68. package/dist/utils/cli-kit/fs-safe.d.ts +14 -0
  69. package/dist/utils/cli-kit/fs-safe.d.ts.map +1 -0
  70. package/dist/utils/cli-kit/fs-safe.js +20 -0
  71. package/dist/utils/cli-kit/fs-safe.js.map +1 -0
  72. package/dist/utils/cli-kit/index.d.ts +15 -0
  73. package/dist/utils/cli-kit/index.d.ts.map +1 -0
  74. package/dist/utils/cli-kit/index.js +10 -0
  75. package/dist/utils/cli-kit/index.js.map +1 -0
  76. package/dist/utils/cli-kit/json-file.d.ts +21 -0
  77. package/dist/utils/cli-kit/json-file.d.ts.map +1 -0
  78. package/dist/utils/cli-kit/json-file.js +51 -0
  79. package/dist/utils/cli-kit/json-file.js.map +1 -0
  80. package/dist/utils/cli-kit/marker-block.d.ts +26 -0
  81. package/dist/utils/cli-kit/marker-block.d.ts.map +1 -0
  82. package/dist/utils/cli-kit/marker-block.js +61 -0
  83. package/dist/utils/cli-kit/marker-block.js.map +1 -0
  84. package/dist/utils/cli-kit/paths.d.ts +15 -0
  85. package/dist/utils/cli-kit/paths.d.ts.map +1 -0
  86. package/dist/utils/cli-kit/paths.js +21 -0
  87. package/dist/utils/cli-kit/paths.js.map +1 -0
  88. package/dist/utils/cli-kit/secure-storage.d.ts +14 -0
  89. package/dist/utils/cli-kit/secure-storage.d.ts.map +1 -0
  90. package/dist/utils/cli-kit/secure-storage.js +20 -0
  91. package/dist/utils/cli-kit/secure-storage.js.map +1 -0
  92. package/dist/utils/cli-kit/step-report.d.ts +16 -0
  93. package/dist/utils/cli-kit/step-report.d.ts.map +1 -0
  94. package/dist/utils/cli-kit/step-report.js +36 -0
  95. package/dist/utils/cli-kit/step-report.js.map +1 -0
  96. package/dist/utils/dco/agent-metadata.d.ts +1 -1
  97. package/dist/utils/dco/agent-metadata.js +1 -1
  98. package/dist/utils/dco/agent-metadata.js.map +1 -1
  99. package/dist/utils/dco/claude-config.d.ts +18 -8
  100. package/dist/utils/dco/claude-config.d.ts.map +1 -1
  101. package/dist/utils/dco/claude-config.js +33 -79
  102. package/dist/utils/dco/claude-config.js.map +1 -1
  103. package/dist/utils/dco/dispatch.d.ts +59 -0
  104. package/dist/utils/dco/dispatch.d.ts.map +1 -0
  105. package/dist/utils/dco/dispatch.js +332 -0
  106. package/dist/utils/dco/dispatch.js.map +1 -0
  107. package/dist/utils/dco/git-config.d.ts.map +1 -1
  108. package/dist/utils/dco/git-config.js +5 -3
  109. package/dist/utils/dco/git-config.js.map +1 -1
  110. package/dist/utils/dco/github.d.ts +8 -0
  111. package/dist/utils/dco/github.d.ts.map +1 -1
  112. package/dist/utils/dco/github.js +11 -0
  113. package/dist/utils/dco/github.js.map +1 -1
  114. package/dist/utils/dco/paths.d.ts +1 -8
  115. package/dist/utils/dco/paths.d.ts.map +1 -1
  116. package/dist/utils/dco/paths.js +3 -12
  117. package/dist/utils/dco/paths.js.map +1 -1
  118. package/dist/utils/dco/render.d.ts +1 -1
  119. package/dist/utils/dco/render.d.ts.map +1 -1
  120. package/dist/utils/dco/render.js +4 -21
  121. package/dist/utils/dco/render.js.map +1 -1
  122. package/dist/utils/dco/resolve-agent.d.ts +54 -0
  123. package/dist/utils/dco/resolve-agent.d.ts.map +1 -0
  124. package/dist/utils/dco/resolve-agent.js +164 -0
  125. package/dist/utils/dco/resolve-agent.js.map +1 -0
  126. package/dist/utils/dco/setup.d.ts +10 -7
  127. package/dist/utils/dco/setup.d.ts.map +1 -1
  128. package/dist/utils/dco/setup.js +304 -202
  129. package/dist/utils/dco/setup.js.map +1 -1
  130. package/dist/utils/dco/ssh-key.d.ts +13 -0
  131. package/dist/utils/dco/ssh-key.d.ts.map +1 -1
  132. package/dist/utils/dco/ssh-key.js +21 -0
  133. package/dist/utils/dco/ssh-key.js.map +1 -1
  134. package/dist/utils/dco/status.d.ts +1 -1
  135. package/dist/utils/dco/status.d.ts.map +1 -1
  136. package/dist/utils/dco/status.js +3 -3
  137. package/dist/utils/dco/status.js.map +1 -1
  138. package/dist/utils/dco/verify.d.ts +114 -0
  139. package/dist/utils/dco/verify.d.ts.map +1 -0
  140. package/dist/utils/dco/verify.js +383 -0
  141. package/dist/utils/dco/verify.js.map +1 -0
  142. package/dist/utils/gitignore.d.ts +17 -0
  143. package/dist/utils/gitignore.d.ts.map +1 -0
  144. package/dist/utils/gitignore.js +40 -0
  145. package/dist/utils/gitignore.js.map +1 -0
  146. package/dist/utils/identity-heal.d.ts +16 -0
  147. package/dist/utils/identity-heal.d.ts.map +1 -0
  148. package/dist/utils/identity-heal.js +37 -0
  149. package/dist/utils/identity-heal.js.map +1 -0
  150. package/dist/utils/poll.d.ts +50 -0
  151. package/dist/utils/poll.d.ts.map +1 -0
  152. package/dist/utils/poll.js +73 -0
  153. package/dist/utils/poll.js.map +1 -0
  154. package/package.json +4 -3
  155. package/dist/utils/claim-polling.d.ts +0 -21
  156. package/dist/utils/claim-polling.d.ts.map +0 -1
  157. package/dist/utils/claim-polling.js.map +0 -1
  158. package/dist/utils/dco/fs-safe.d.ts +0 -14
  159. package/dist/utils/dco/fs-safe.d.ts.map +0 -1
  160. package/dist/utils/dco/fs-safe.js +0 -20
  161. package/dist/utils/dco/fs-safe.js.map +0 -1
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Read-only view of "which agent identity is configured in THIS checkout
3
+ * right now", surfaced by `dco whoami`.
4
+ *
5
+ * This exists because `dco setup` used to bake an agent's name/URL/DID
6
+ * as literal strings into the CLAUDE.md instructions it writes. That file is
7
+ * committed, so the literal values only ever reflected whichever agent
8
+ * happened to run `dco setup` first. Any other agent later working in the
9
+ * same repo (the common case for a repo that receives dispatched work from
10
+ * multiple agents) would have its PRs and commit trailers falsely attributed
11
+ * to that first agent. `resolveAgentIdentity` gives CLAUDE.md's instructions
12
+ * something to point at instead of a value: "run this, use its output",
13
+ * so the byline is always whichever identity is actually active locally.
14
+ */
15
+ export interface ResolvedAgentIdentity {
16
+ /**
17
+ * Canonical `did:web:knowthat.ai:agents:<slug>` derived from the validated
18
+ * slug, NOT `.mcpi/identity.json`'s stored value verbatim. A checkout
19
+ * registered before the registration-time heal (init.ts/register.ts patch
20
+ * identity.json's `did` in place at registration) can still hold the
21
+ * unresolvable placeholder minted at `kya-os init` time
22
+ * (`did:web:localhost:3000:agents:<8hex>`); this is what actually resolves,
23
+ * matching the derivation `dco dispatch <slug>` uses.
24
+ */
25
+ did: string;
26
+ name: string;
27
+ slug: string;
28
+ url: string;
29
+ email: string;
30
+ }
31
+ /**
32
+ * Resolves the current agent identity from local, gitignored `.mcpi/` state.
33
+ * Returns null when there is nothing complete and trustworthy to report.
34
+ * Callers (notably `dco whoami`) must treat that as "no agent
35
+ * identity configured here", not as an error, since it's the ordinary state
36
+ * for a checkout that never ran `kya-os register`.
37
+ *
38
+ * Deliberately independent of `runDcoSetup`'s own identity resolution in
39
+ * setup.ts: that function additionally prompts, persists, and throws on a
40
+ * DID mismatch to steer a human through fixing local config, none of which
41
+ * is safe here: this is invoked live, mid-task, by an LLM composing a PR
42
+ * or commit, and must always degrade to null rather than prompt or throw.
43
+ * The whole body runs under a catch-all for exactly that reason: every
44
+ * individual step is written to fail closed already, but the guarantee that
45
+ * matters to callers is "never throws", not "every input we thought of is
46
+ * handled". A caller relying on the latter is one overlooked shape away
47
+ * from `dco whoami --json` crashing instead of printing
48
+ * `{"configured": false}`.
49
+ *
50
+ * The returned `did` is the canonical slug-derived value, not identity.json's
51
+ * stored `did` verbatim — see `ResolvedAgentIdentity.did`.
52
+ */
53
+ export declare function resolveAgentIdentity(cwd: string): Promise<ResolvedAgentIdentity | null>;
54
+ //# sourceMappingURL=resolve-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-agent.d.ts","sourceRoot":"","sources":["../../../src/utils/dco/resolve-agent.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;;OAQG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAiGD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAuDvC"}
@@ -0,0 +1,164 @@
1
+ import { execFile } from "child_process";
2
+ import { existsSync, readFileSync } from "fs";
3
+ import { join } from "path";
4
+ import { promisify } from "util";
5
+ import { readAgentMetadata } from "./agent-metadata.js";
6
+ import { isValidSlug } from "./paths.js";
7
+ const execFileAsync = promisify(execFile);
8
+ const MAX_FIELD_LENGTH = 200;
9
+ const DID_PATTERN = /^did:[a-z0-9]+:[A-Za-z0-9.\-_:%]+$/;
10
+ /**
11
+ * Strip control characters (including CR/LF) and collapse whitespace. Values
12
+ * read here end up printed to stdout and copied verbatim into a PR
13
+ * description or commit trailer by an LLM, so a crafted value with embedded
14
+ * newlines must not be able to smuggle extra instructions into that text.
15
+ */
16
+ function singleLine(value) {
17
+ // eslint-disable-next-line no-control-regex
18
+ return value.replace(/[\u0000-\u001f\u007f]+/g, " ").trim();
19
+ }
20
+ /**
21
+ * `readAgentMetadata` only type-asserts its JSON.parse result as
22
+ * `AgentMetadata`; nothing enforces at runtime that `name`/`slug`/`url` are
23
+ * actually strings. A field that's a truthy non-string (an array has
24
+ * `.length` too) would otherwise reach `singleLine`'s `.replace()` call and
25
+ * throw, which violates this module's whole contract of degrading to null
26
+ * instead of throwing. Takes `unknown` rather than `string` so every call
27
+ * site is forced through this runtime check before treating a field as text,
28
+ * not just past a compile-time type it was never validated against.
29
+ */
30
+ function isSaneField(value) {
31
+ return (typeof value === "string" && value.length > 0 && value.length <= MAX_FIELD_LENGTH);
32
+ }
33
+ function isValidDid(value) {
34
+ return value.length <= MAX_FIELD_LENGTH && DID_PATTERN.test(value);
35
+ }
36
+ /**
37
+ * The PR byline links to the agent's registry page, so its host must be the
38
+ * trusted registry. A url from .mcpi/agent.json in an untrusted repo could
39
+ * otherwise point the byline at an arbitrary off-site (phishing) link.
40
+ * Mirrors the identical check `dco setup` applies before persisting
41
+ * agent.json in the first place (packages/cli/src/utils/dco/setup.ts).
42
+ */
43
+ function isTrustedAgentUrl(value) {
44
+ try {
45
+ const url = new URL(value);
46
+ if (url.protocol !== "https:") {
47
+ return false;
48
+ }
49
+ const host = url.hostname.toLowerCase();
50
+ return host === "knowthat.ai" || host.endsWith(".knowthat.ai");
51
+ }
52
+ catch {
53
+ return false;
54
+ }
55
+ }
56
+ /**
57
+ * `dco setup` refuses a `.mcpi/identity.json` that's tracked by git,
58
+ * because a cloned repo could ship one to make signing use a key its author
59
+ * controls (see setup.ts's `isIdentityTrackedByGit`). The same threat
60
+ * applies here for the same reason `ensureGitignored` was added to
61
+ * `register.ts`: gitignoring `.mcpi/` after the fact does not untrack a
62
+ * file that was already committed. Without this check, a hostile committed
63
+ * `.mcpi/identity.json` + `agent.json` pair would resolve as a trustworthy
64
+ * identity and get echoed into every PR/commit trailer an agent composes
65
+ * from this repo.
66
+ */
67
+ async function isMcpiTrackedByGit(cwd) {
68
+ try {
69
+ const { stdout } = await execFileAsync("git", ["ls-files", "--", ".mcpi/identity.json", ".mcpi/agent.json"], { cwd, encoding: "utf8" });
70
+ return stdout.trim().length > 0;
71
+ }
72
+ catch {
73
+ return false;
74
+ }
75
+ }
76
+ function readIdentityDid(cwd) {
77
+ const path = join(cwd, ".mcpi", "identity.json");
78
+ if (!existsSync(path)) {
79
+ return undefined;
80
+ }
81
+ try {
82
+ const parsed = JSON.parse(readFileSync(path, "utf-8"));
83
+ const did = parsed && typeof parsed === "object" && typeof parsed.did === "string"
84
+ ? parsed.did
85
+ : undefined;
86
+ return did && isValidDid(did) ? did : undefined;
87
+ }
88
+ catch {
89
+ return undefined;
90
+ }
91
+ }
92
+ /**
93
+ * Resolves the current agent identity from local, gitignored `.mcpi/` state.
94
+ * Returns null when there is nothing complete and trustworthy to report.
95
+ * Callers (notably `dco whoami`) must treat that as "no agent
96
+ * identity configured here", not as an error, since it's the ordinary state
97
+ * for a checkout that never ran `kya-os register`.
98
+ *
99
+ * Deliberately independent of `runDcoSetup`'s own identity resolution in
100
+ * setup.ts: that function additionally prompts, persists, and throws on a
101
+ * DID mismatch to steer a human through fixing local config, none of which
102
+ * is safe here: this is invoked live, mid-task, by an LLM composing a PR
103
+ * or commit, and must always degrade to null rather than prompt or throw.
104
+ * The whole body runs under a catch-all for exactly that reason: every
105
+ * individual step is written to fail closed already, but the guarantee that
106
+ * matters to callers is "never throws", not "every input we thought of is
107
+ * handled". A caller relying on the latter is one overlooked shape away
108
+ * from `dco whoami --json` crashing instead of printing
109
+ * `{"configured": false}`.
110
+ *
111
+ * The returned `did` is the canonical slug-derived value, not identity.json's
112
+ * stored `did` verbatim — see `ResolvedAgentIdentity.did`.
113
+ */
114
+ export async function resolveAgentIdentity(cwd) {
115
+ try {
116
+ const did = readIdentityDid(cwd);
117
+ if (!did) {
118
+ return null;
119
+ }
120
+ if (await isMcpiTrackedByGit(cwd)) {
121
+ return null;
122
+ }
123
+ const metadata = readAgentMetadata(cwd);
124
+ // Only trust agent.json when it's cryptographically bound to this
125
+ // identity (same rule setup.ts uses before persisting it) and shaped
126
+ // like a real slug (same rule signingKeyPath enforces). Unbound or
127
+ // malformed metadata could be planted in an untrusted repo and must not
128
+ // be allowed to spoof the reported name/slug/url, or to break out of
129
+ // the markdown link syntax CLAUDE.md tells an agent to build from these
130
+ // fields. isSaneField is a real runtime type guard (not just a length
131
+ // check) because metadata.name/slug/url are only type-asserted as
132
+ // strings by readAgentMetadata, never validated as one.
133
+ if (!metadata ||
134
+ metadata.did !== did ||
135
+ !isSaneField(metadata.name) ||
136
+ !isSaneField(metadata.slug) ||
137
+ !isValidSlug(metadata.slug)) {
138
+ return null;
139
+ }
140
+ const name = singleLine(metadata.name);
141
+ const slug = metadata.slug;
142
+ const url = isSaneField(metadata.url) && isTrustedAgentUrl(metadata.url)
143
+ ? singleLine(metadata.url)
144
+ : `https://knowthat.ai/agents/${slug}`;
145
+ // Returned did is the canonical did:web derived from the validated slug,
146
+ // not identity.json's `did` verbatim: a checkout registered before the
147
+ // write-time heal (init.ts/register.ts) can still hold the unresolvable
148
+ // placeholder minted at `kya-os init` time. `did` above is still the trust
149
+ // anchor that binds metadata.did to identity.json (proves this checkout
150
+ // came from `kya-os register`), just not what gets reported to a caller
151
+ // about to embed it in a PR description or commit trailer.
152
+ return {
153
+ did: `did:web:knowthat.ai:agents:${slug}`,
154
+ name,
155
+ slug,
156
+ url,
157
+ email: `${slug}@agents.knowthat.ai`,
158
+ };
159
+ }
160
+ catch {
161
+ return null;
162
+ }
163
+ }
164
+ //# sourceMappingURL=resolve-agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-agent.js","sourceRoot":"","sources":["../../../src/utils/dco/resolve-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAiC1C,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,WAAW,GAAG,oCAAoC,CAAC;AAEzD;;;;;GAKG;AACH,SAAS,UAAU,CAAC,KAAa;IAC/B,4CAA4C;IAC5C,OAAO,KAAK,CAAC,OAAO,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9D,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,gBAAgB,CAClF,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK,CAAC,MAAM,IAAI,gBAAgB,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;GAMG;A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;YAC1D,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;YAC1B,CAAC,CAAC,8BAA8B,IAAI,EAAE,CAAC;QAE3C,yEAAyE;QACzE,uEAAuE;QACvE,wEAAwE;QACxE,2EAA2E;QAC3E,wEAAwE;QACxE,wEAAwE;QACxE,2DAA2D;QAC3D,OAAO;YACL,GAAG,EAAE,8BAA8B,IAAI,EAAE;YACzC,IAAI;YACJ,IAAI;YACJ,GAAG;YACH,KAAK,EAAE,GAAG,IAAI,qBAAqB;SACpC,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -1,11 +1,6 @@
1
+ import { type StepResult, type StepStatus } from "../cli-kit/index.js";
1
2
  import { type GitIdentity } from "./git-config.js";
2
- export type StepStatus = "done" | "skipped" | "failed" | "action-required" | "would-change";
3
- export interface StepResult {
4
- id: string;
5
- title: string;
6
- status: StepStatus;
7
- detail?: string;
8
- }
3
+ export type { StepStatus, StepResult };
9
4
  export interface DcoAgentInfo {
10
5
  did: string;
11
6
  name: string;
@@ -25,6 +20,14 @@ export interface DcoSetupOptions {
25
20
  force?: boolean;
26
21
  /** Allow interactive prompts (agent name fallback, scope refresh). */
27
22
  interactive?: boolean;
23
+ /**
24
+ * Wire signing for this EXISTING registered agent instead of resolving
25
+ * identity from this checkout's `.mcpi/`. Skips the identity.json preflight
26
+ * entirely and requires the key to already exist at `signingKeyPath(agent)`
27
+ * (never generated or converted in this mode). See `dco dispatch <slug>`,
28
+ * which derives the same did:web/url/email from the slug.
29
+ */
30
+ agent?: string;
28
31
  }
29
32
  export interface DcoSetupResult {
30
33
  ok: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/utils/dco/setup.ts"],"names":[],"mappings":"AAmBA,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AAmBzB,MAAM,MAAM,UAAU,GAClB,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