@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.
Files changed (385) hide show
  1. package/dist/commands/agent.d.ts +35 -0
  2. package/dist/commands/agent.d.ts.map +1 -0
  3. package/dist/commands/agent.js +321 -0
  4. package/dist/commands/agent.js.map +1 -0
  5. package/dist/commands/build.js +2 -2
  6. package/dist/commands/build.js.map +1 -1
  7. package/dist/commands/check.js +3 -3
  8. package/dist/commands/check.js.map +1 -1
  9. package/dist/commands/checkpoint-init.d.ts +1 -1
  10. package/dist/commands/checkpoint-init.d.ts.map +1 -1
  11. package/dist/commands/checkpoint-init.js +8 -41
  12. package/dist/commands/checkpoint-init.js.map +1 -1
  13. package/dist/commands/claim.js +2 -2
  14. package/dist/commands/claim.js.map +1 -1
  15. package/dist/commands/dco.d.ts +59 -0
  16. package/dist/commands/dco.d.ts.map +1 -1
  17. package/dist/commands/dco.js +280 -5
  18. package/dist/commands/dco.js.map +1 -1
  19. package/dist/commands/dev.js +1 -1
  20. package/dist/commands/dev.js.map +1 -1
  21. package/dist/commands/doctor.d.ts.map +1 -1
  22. package/dist/commands/doctor.js +18 -24
  23. package/dist/commands/doctor.js.map +1 -1
  24. package/dist/commands/env.js +6 -6
  25. package/dist/commands/env.js.map +1 -1
  26. package/dist/commands/identity.js +3 -3
  27. package/dist/commands/identity.js.map +1 -1
  28. package/dist/commands/init-stages.d.ts +141 -0
  29. package/dist/commands/init-stages.d.ts.map +1 -0
  30. package/dist/commands/init-stages.js +684 -0
  31. package/dist/commands/init-stages.js.map +1 -0
  32. package/dist/commands/init.d.ts +46 -16
  33. package/dist/commands/init.d.ts.map +1 -1
  34. package/dist/commands/init.js +229 -279
  35. package/dist/commands/init.js.map +1 -1
  36. package/dist/commands/orchestrator.d.ts +18 -0
  37. package/dist/commands/orchestrator.d.ts.map +1 -0
  38. package/dist/commands/orchestrator.js +251 -0
  39. package/dist/commands/orchestrator.js.map +1 -0
  40. package/dist/commands/register.d.ts +1 -1
  41. package/dist/commands/register.d.ts.map +1 -1
  42. package/dist/commands/register.js +35 -7
  43. package/dist/commands/register.js.map +1 -1
  44. package/dist/commands/review.d.ts +48 -0
  45. package/dist/commands/review.d.ts.map +1 -0
  46. package/dist/commands/review.js +220 -0
  47. package/dist/commands/review.js.map +1 -0
  48. package/dist/commands/rotate.js +4 -4
  49. package/dist/commands/rotate.js.map +1 -1
  50. package/dist/commands/score.d.ts +15 -0
  51. package/dist/commands/score.d.ts.map +1 -0
  52. package/dist/commands/score.js +471 -0
  53. package/dist/commands/score.js.map +1 -0
  54. package/dist/commands/start.js +3 -3
  55. package/dist/commands/start.js.map +1 -1
  56. package/dist/commands/status.js +1 -1
  57. package/dist/commands/status.js.map +1 -1
  58. package/dist/commands/verify.js +6 -6
  59. package/dist/commands/verify.js.map +1 -1
  60. package/dist/dco.d.ts +4 -0
  61. package/dist/dco.d.ts.map +1 -0
  62. package/dist/dco.js +23 -0
  63. package/dist/dco.js.map +1 -0
  64. package/dist/index.js +52 -9
  65. package/dist/orchestrator/daemon.d.ts +137 -0
  66. package/dist/orchestrator/daemon.d.ts.map +1 -0
  67. package/dist/orchestrator/daemon.js +242 -0
  68. package/dist/orchestrator/daemon.js.map +1 -0
  69. package/dist/orchestrator/db/dispatches.d.ts +108 -0
  70. package/dist/orchestrator/db/dispatches.d.ts.map +1 -0
  71. package/dist/orchestrator/db/dispatches.js +122 -0
  72. package/dist/orchestrator/db/dispatches.js.map +1 -0
  73. package/dist/orchestrator/db/index.d.ts +50 -0
  74. package/dist/orchestrator/db/index.d.ts.map +1 -0
  75. package/dist/orchestrator/db/index.js +116 -0
  76. package/dist/orchestrator/db/index.js.map +1 -0
  77. package/dist/orchestrator/db/journal.d.ts +93 -0
  78. package/dist/orchestrator/db/journal.d.ts.map +1 -0
  79. package/dist/orchestrator/db/journal.js +91 -0
  80. package/dist/orchestrator/db/journal.js.map +1 -0
  81. package/dist/orchestrator/db/liveness.d.ts +97 -0
  82. package/dist/orchestrator/db/liveness.d.ts.map +1 -0
  83. package/dist/orchestrator/db/liveness.js +105 -0
  84. package/dist/orchestrator/db/liveness.js.map +1 -0
  85. package/dist/orchestrator/db/mission.d.ts +78 -0
  86. package/dist/orchestrator/db/mission.d.ts.map +1 -0
  87. package/dist/orchestrator/db/mission.js +99 -0
  88. package/dist/orchestrator/db/mission.js.map +1 -0
  89. package/dist/orchestrator/db/schema.d.ts +14 -0
  90. package/dist/orchestrator/db/schema.d.ts.map +1 -0
  91. package/dist/orchestrator/db/schema.js +169 -0
  92. package/dist/orchestrator/db/schema.js.map +1 -0
  93. package/dist/orchestrator/db/tickets.d.ts +147 -0
  94. package/dist/orchestrator/db/tickets.d.ts.map +1 -0
  95. package/dist/orchestrator/db/tickets.js +238 -0
  96. package/dist/orchestrator/db/tickets.js.map +1 -0
  97. package/dist/orchestrator/db/verdicts.d.ts +187 -0
  98. package/dist/orchestrator/db/verdicts.d.ts.map +1 -0
  99. package/dist/orchestrator/db/verdicts.js +197 -0
  100. package/dist/orchestrator/db/verdicts.js.map +1 -0
  101. package/dist/orchestrator/events.d.ts +69 -0
  102. package/dist/orchestrator/events.d.ts.map +1 -0
  103. package/dist/orchestrator/events.js +20 -0
  104. package/dist/orchestrator/events.js.map +1 -0
  105. package/dist/orchestrator/github-credential-anchor-sender.d.ts +159 -0
  106. package/dist/orchestrator/github-credential-anchor-sender.d.ts.map +1 -0
  107. package/dist/orchestrator/github-credential-anchor-sender.js +313 -0
  108. package/dist/orchestrator/github-credential-anchor-sender.js.map +1 -0
  109. package/dist/orchestrator/hub-dispatch.d.ts +120 -0
  110. package/dist/orchestrator/hub-dispatch.d.ts.map +1 -0
  111. package/dist/orchestrator/hub-dispatch.js +257 -0
  112. package/dist/orchestrator/hub-dispatch.js.map +1 -0
  113. package/dist/orchestrator/hub-observer.d.ts +201 -0
  114. package/dist/orchestrator/hub-observer.d.ts.map +1 -0
  115. package/dist/orchestrator/hub-observer.js +474 -0
  116. package/dist/orchestrator/hub-observer.js.map +1 -0
  117. package/dist/orchestrator/journal-writer.d.ts +80 -0
  118. package/dist/orchestrator/journal-writer.d.ts.map +1 -0
  119. package/dist/orchestrator/journal-writer.js +113 -0
  120. package/dist/orchestrator/journal-writer.js.map +1 -0
  121. package/dist/orchestrator/mcp/server.d.ts +136 -0
  122. package/dist/orchestrator/mcp/server.d.ts.map +1 -0
  123. package/dist/orchestrator/mcp/server.js +582 -0
  124. package/dist/orchestrator/mcp/server.js.map +1 -0
  125. package/dist/orchestrator/mcp/stdio.d.ts +22 -0
  126. package/dist/orchestrator/mcp/stdio.d.ts.map +1 -0
  127. package/dist/orchestrator/mcp/stdio.js +51 -0
  128. package/dist/orchestrator/mcp/stdio.js.map +1 -0
  129. package/dist/orchestrator/review.d.ts +131 -0
  130. package/dist/orchestrator/review.d.ts.map +1 -0
  131. package/dist/orchestrator/review.js +322 -0
  132. package/dist/orchestrator/review.js.map +1 -0
  133. package/dist/tui/app.d.ts +33 -0
  134. package/dist/tui/app.d.ts.map +1 -0
  135. package/dist/tui/app.js +71 -0
  136. package/dist/tui/app.js.map +1 -0
  137. package/dist/tui/components.d.ts +110 -0
  138. package/dist/tui/components.d.ts.map +1 -0
  139. package/dist/tui/components.js +118 -0
  140. package/dist/tui/components.js.map +1 -0
  141. package/dist/tui/index.d.ts +30 -0
  142. package/dist/tui/index.d.ts.map +1 -0
  143. package/dist/tui/index.js +95 -0
  144. package/dist/tui/index.js.map +1 -0
  145. package/dist/tui/keymap.d.ts +33 -0
  146. package/dist/tui/keymap.d.ts.map +1 -0
  147. package/dist/tui/keymap.js +49 -0
  148. package/dist/tui/keymap.js.map +1 -0
  149. package/dist/tui/nav.d.ts +29 -0
  150. package/dist/tui/nav.d.ts.map +1 -0
  151. package/dist/tui/nav.js +39 -0
  152. package/dist/tui/nav.js.map +1 -0
  153. package/dist/tui/sanitize.d.ts +25 -0
  154. package/dist/tui/sanitize.d.ts.map +1 -0
  155. package/dist/tui/sanitize.js +36 -0
  156. package/dist/tui/sanitize.js.map +1 -0
  157. package/dist/tui/theme.d.ts +32 -0
  158. package/dist/tui/theme.d.ts.map +1 -0
  159. package/dist/tui/theme.js +63 -0
  160. package/dist/tui/theme.js.map +1 -0
  161. package/dist/tui/views/agents.d.ts +67 -0
  162. package/dist/tui/views/agents.d.ts.map +1 -0
  163. package/dist/tui/views/agents.js +231 -0
  164. package/dist/tui/views/agents.js.map +1 -0
  165. package/dist/tui/views/index.d.ts +93 -0
  166. package/dist/tui/views/index.d.ts.map +1 -0
  167. package/dist/tui/views/index.js +150 -0
  168. package/dist/tui/views/index.js.map +1 -0
  169. package/dist/tui/views/registry.d.ts +22 -0
  170. package/dist/tui/views/registry.d.ts.map +1 -0
  171. package/dist/tui/views/registry.js +110 -0
  172. package/dist/tui/views/registry.js.map +1 -0
  173. package/dist/utils/agent/backoff.d.ts +31 -0
  174. package/dist/utils/agent/backoff.d.ts.map +1 -0
  175. package/dist/utils/agent/backoff.js +51 -0
  176. package/dist/utils/agent/backoff.js.map +1 -0
  177. package/dist/utils/agent/markers.d.ts +87 -0
  178. package/dist/utils/agent/markers.d.ts.map +1 -0
  179. package/dist/utils/agent/markers.js +147 -0
  180. package/dist/utils/agent/markers.js.map +1 -0
  181. package/dist/utils/agent/review.d.ts +67 -0
  182. package/dist/utils/agent/review.d.ts.map +1 -0
  183. package/dist/utils/agent/review.js +305 -0
  184. package/dist/utils/agent/review.js.map +1 -0
  185. package/dist/utils/agent/spawn-agent.d.ts +117 -0
  186. package/dist/utils/agent/spawn-agent.d.ts.map +1 -0
  187. package/dist/utils/agent/spawn-agent.js +177 -0
  188. package/dist/utils/agent/spawn-agent.js.map +1 -0
  189. package/dist/utils/agent/task.d.ts +101 -0
  190. package/dist/utils/agent/task.d.ts.map +1 -0
  191. package/dist/utils/agent/task.js +357 -0
  192. package/dist/utils/agent/task.js.map +1 -0
  193. package/dist/utils/agent/verify.d.ts +47 -0
  194. package/dist/utils/agent/verify.d.ts.map +1 -0
  195. package/dist/utils/agent/verify.js +144 -0
  196. package/dist/utils/agent/verify.js.map +1 -0
  197. package/dist/utils/agent-detector.d.ts +48 -0
  198. package/dist/utils/agent-detector.d.ts.map +1 -0
  199. package/dist/utils/agent-detector.js +74 -0
  200. package/dist/utils/agent-detector.js.map +1 -0
  201. package/dist/utils/agent-profile-stage.d.ts +70 -0
  202. package/dist/utils/agent-profile-stage.d.ts.map +1 -0
  203. package/dist/utils/agent-profile-stage.js +153 -0
  204. package/dist/utils/agent-profile-stage.js.map +1 -0
  205. package/dist/utils/agent-profiles.d.ts +27 -0
  206. package/dist/utils/agent-profiles.d.ts.map +1 -0
  207. package/dist/utils/agent-profiles.js +61 -0
  208. package/dist/utils/agent-profiles.js.map +1 -0
  209. package/dist/utils/checkpoint-api.d.ts +1 -1
  210. package/dist/utils/checkpoint-api.js +1 -1
  211. package/dist/utils/checkpoint-env.d.ts +1 -1
  212. package/dist/utils/checkpoint-env.js +2 -2
  213. package/dist/utils/checkpoint-env.js.map +1 -1
  214. package/dist/utils/checkpoint-scaffold.d.ts +1 -1
  215. package/dist/utils/checkpoint-scaffold.js +1 -1
  216. package/dist/utils/cli-kit/browser.d.ts +24 -0
  217. package/dist/utils/cli-kit/browser.d.ts.map +1 -0
  218. package/dist/utils/cli-kit/browser.js +58 -0
  219. package/dist/utils/cli-kit/browser.js.map +1 -0
  220. package/dist/utils/cli-kit/claim-polling.d.ts +18 -0
  221. package/dist/utils/cli-kit/claim-polling.d.ts.map +1 -0
  222. package/dist/utils/{claim-polling.js → cli-kit/claim-polling.js} +19 -26
  223. package/dist/utils/cli-kit/claim-polling.js.map +1 -0
  224. package/dist/utils/cli-kit/diagnostics.d.ts +9 -0
  225. package/dist/utils/cli-kit/diagnostics.d.ts.map +1 -0
  226. package/dist/utils/cli-kit/diagnostics.js +11 -0
  227. package/dist/utils/cli-kit/diagnostics.js.map +1 -0
  228. package/dist/utils/cli-kit/fs-safe.d.ts +14 -0
  229. package/dist/utils/cli-kit/fs-safe.d.ts.map +1 -0
  230. package/dist/utils/cli-kit/fs-safe.js +20 -0
  231. package/dist/utils/cli-kit/fs-safe.js.map +1 -0
  232. package/dist/utils/cli-kit/index.d.ts +15 -0
  233. package/dist/utils/cli-kit/index.d.ts.map +1 -0
  234. package/dist/utils/cli-kit/index.js +10 -0
  235. package/dist/utils/cli-kit/index.js.map +1 -0
  236. package/dist/utils/cli-kit/json-file.d.ts +21 -0
  237. package/dist/utils/cli-kit/json-file.d.ts.map +1 -0
  238. package/dist/utils/cli-kit/json-file.js +51 -0
  239. package/dist/utils/cli-kit/json-file.js.map +1 -0
  240. package/dist/utils/cli-kit/marker-block.d.ts +26 -0
  241. package/dist/utils/cli-kit/marker-block.d.ts.map +1 -0
  242. package/dist/utils/cli-kit/marker-block.js +61 -0
  243. package/dist/utils/cli-kit/marker-block.js.map +1 -0
  244. package/dist/utils/cli-kit/paths.d.ts +15 -0
  245. package/dist/utils/cli-kit/paths.d.ts.map +1 -0
  246. package/dist/utils/cli-kit/paths.js +21 -0
  247. package/dist/utils/cli-kit/paths.js.map +1 -0
  248. package/dist/utils/cli-kit/secure-storage.d.ts +14 -0
  249. package/dist/utils/cli-kit/secure-storage.d.ts.map +1 -0
  250. package/dist/utils/cli-kit/secure-storage.js +20 -0
  251. package/dist/utils/cli-kit/secure-storage.js.map +1 -0
  252. package/dist/utils/cli-kit/step-report.d.ts +16 -0
  253. package/dist/utils/cli-kit/step-report.d.ts.map +1 -0
  254. package/dist/utils/cli-kit/step-report.js +36 -0
  255. package/dist/utils/cli-kit/step-report.js.map +1 -0
  256. package/dist/utils/dco/agent-metadata.d.ts +1 -1
  257. package/dist/utils/dco/agent-metadata.js +1 -1
  258. package/dist/utils/dco/agent-metadata.js.map +1 -1
  259. package/dist/utils/dco/claude-config.d.ts +18 -14
  260. package/dist/utils/dco/claude-config.d.ts.map +1 -1
  261. package/dist/utils/dco/claude-config.js +31 -97
  262. package/dist/utils/dco/claude-config.js.map +1 -1
  263. package/dist/utils/dco/dispatch.d.ts +134 -0
  264. package/dist/utils/dco/dispatch.d.ts.map +1 -0
  265. package/dist/utils/dco/dispatch.js +399 -0
  266. package/dist/utils/dco/dispatch.js.map +1 -0
  267. package/dist/utils/dco/fix.d.ts +122 -0
  268. package/dist/utils/dco/fix.d.ts.map +1 -0
  269. package/dist/utils/dco/fix.js +560 -0
  270. package/dist/utils/dco/fix.js.map +1 -0
  271. package/dist/utils/dco/git-config.d.ts.map +1 -1
  272. package/dist/utils/dco/git-config.js +5 -3
  273. package/dist/utils/dco/git-config.js.map +1 -1
  274. package/dist/utils/dco/github.d.ts +101 -0
  275. package/dist/utils/dco/github.d.ts.map +1 -1
  276. package/dist/utils/dco/github.js +133 -0
  277. package/dist/utils/dco/github.js.map +1 -1
  278. package/dist/utils/dco/paths.d.ts +1 -8
  279. package/dist/utils/dco/paths.d.ts.map +1 -1
  280. package/dist/utils/dco/paths.js +3 -12
  281. package/dist/utils/dco/paths.js.map +1 -1
  282. package/dist/utils/dco/render.d.ts +1 -1
  283. package/dist/utils/dco/render.d.ts.map +1 -1
  284. package/dist/utils/dco/render.js +4 -21
  285. package/dist/utils/dco/render.js.map +1 -1
  286. package/dist/utils/dco/resolve-agent.d.ts +54 -0
  287. package/dist/utils/dco/resolve-agent.d.ts.map +1 -0
  288. package/dist/utils/dco/resolve-agent.js +164 -0
  289. package/dist/utils/dco/resolve-agent.js.map +1 -0
  290. package/dist/utils/dco/setup.d.ts +10 -7
  291. package/dist/utils/dco/setup.d.ts.map +1 -1
  292. package/dist/utils/dco/setup.js +264 -200
  293. package/dist/utils/dco/setup.js.map +1 -1
  294. package/dist/utils/dco/signing-key-writer.d.ts +40 -0
  295. package/dist/utils/dco/signing-key-writer.d.ts.map +1 -0
  296. package/dist/utils/dco/signing-key-writer.js +76 -0
  297. package/dist/utils/dco/signing-key-writer.js.map +1 -0
  298. package/dist/utils/dco/ssh-key.d.ts +50 -0
  299. package/dist/utils/dco/ssh-key.d.ts.map +1 -1
  300. package/dist/utils/dco/ssh-key.js +129 -8
  301. package/dist/utils/dco/ssh-key.js.map +1 -1
  302. package/dist/utils/dco/status.d.ts +1 -1
  303. package/dist/utils/dco/status.d.ts.map +1 -1
  304. package/dist/utils/dco/status.js +3 -3
  305. package/dist/utils/dco/status.js.map +1 -1
  306. package/dist/utils/dco/verify.d.ts +170 -0
  307. package/dist/utils/dco/verify.d.ts.map +1 -0
  308. package/dist/utils/dco/verify.js +550 -0
  309. package/dist/utils/dco/verify.js.map +1 -0
  310. package/dist/utils/dependency-installer.d.ts +37 -0
  311. package/dist/utils/dependency-installer.d.ts.map +1 -0
  312. package/dist/utils/dependency-installer.js +32 -0
  313. package/dist/utils/dependency-installer.js.map +1 -0
  314. package/dist/utils/github-credential-stage.d.ts +87 -0
  315. package/dist/utils/github-credential-stage.d.ts.map +1 -0
  316. package/dist/utils/github-credential-stage.js +168 -0
  317. package/dist/utils/github-credential-stage.js.map +1 -0
  318. package/dist/utils/github-credential.d.ts +160 -0
  319. package/dist/utils/github-credential.d.ts.map +1 -0
  320. package/dist/utils/github-credential.js +308 -0
  321. package/dist/utils/github-credential.js.map +1 -0
  322. package/dist/utils/gitignore.d.ts +17 -0
  323. package/dist/utils/gitignore.d.ts.map +1 -0
  324. package/dist/utils/gitignore.js +40 -0
  325. package/dist/utils/gitignore.js.map +1 -0
  326. package/dist/utils/hub-config.d.ts +21 -0
  327. package/dist/utils/hub-config.d.ts.map +1 -0
  328. package/dist/utils/hub-config.js +28 -0
  329. package/dist/utils/hub-config.js.map +1 -0
  330. package/dist/utils/identity-heal.d.ts +16 -0
  331. package/dist/utils/identity-heal.d.ts.map +1 -0
  332. package/dist/utils/identity-heal.js +37 -0
  333. package/dist/utils/identity-heal.js.map +1 -0
  334. package/dist/utils/init/pipeline.d.ts +74 -0
  335. package/dist/utils/init/pipeline.d.ts.map +1 -0
  336. package/dist/utils/init/pipeline.js +96 -0
  337. package/dist/utils/init/pipeline.js.map +1 -0
  338. package/dist/utils/poll.d.ts +15 -1
  339. package/dist/utils/poll.d.ts.map +1 -1
  340. package/dist/utils/poll.js +6 -3
  341. package/dist/utils/poll.js.map +1 -1
  342. package/dist/utils/register-agent-identity.d.ts +67 -0
  343. package/dist/utils/register-agent-identity.d.ts.map +1 -0
  344. package/dist/utils/register-agent-identity.js +34 -0
  345. package/dist/utils/register-agent-identity.js.map +1 -0
  346. package/dist/utils/review/did-web-key.d.ts +34 -0
  347. package/dist/utils/review/did-web-key.d.ts.map +1 -0
  348. package/dist/utils/review/did-web-key.js +104 -0
  349. package/dist/utils/review/did-web-key.js.map +1 -0
  350. package/dist/utils/review/load-registry.d.ts +33 -0
  351. package/dist/utils/review/load-registry.d.ts.map +1 -0
  352. package/dist/utils/review/load-registry.js +62 -0
  353. package/dist/utils/review/load-registry.js.map +1 -0
  354. package/dist/utils/review/verdict-verify.d.ts +43 -0
  355. package/dist/utils/review/verdict-verify.d.ts.map +1 -0
  356. package/dist/utils/review/verdict-verify.js +53 -0
  357. package/dist/utils/review/verdict-verify.js.map +1 -0
  358. package/dist/utils/review-registry-writer.d.ts +52 -0
  359. package/dist/utils/review-registry-writer.d.ts.map +1 -0
  360. package/dist/utils/review-registry-writer.js +79 -0
  361. package/dist/utils/review-registry-writer.js.map +1 -0
  362. package/dist/utils/should-install-dependency.d.ts +17 -0
  363. package/dist/utils/should-install-dependency.d.ts.map +1 -0
  364. package/dist/utils/should-install-dependency.js +25 -0
  365. package/dist/utils/should-install-dependency.js.map +1 -0
  366. package/dist/utils/tool-readiness.d.ts +57 -0
  367. package/dist/utils/tool-readiness.d.ts.map +1 -0
  368. package/dist/utils/tool-readiness.js +114 -0
  369. package/dist/utils/tool-readiness.js.map +1 -0
  370. package/dist/utils/which.d.ts +2 -0
  371. package/dist/utils/which.d.ts.map +1 -0
  372. package/dist/utils/which.js +22 -0
  373. package/dist/utils/which.js.map +1 -0
  374. package/dist/version.d.ts +15 -0
  375. package/dist/version.d.ts.map +1 -0
  376. package/dist/version.js +29 -0
  377. package/dist/version.js.map +1 -0
  378. package/package.json +19 -6
  379. package/dist/utils/claim-polling.d.ts +0 -21
  380. package/dist/utils/claim-polling.d.ts.map +0 -1
  381. package/dist/utils/claim-polling.js.map +0 -1
  382. package/dist/utils/dco/fs-safe.d.ts +0 -14
  383. package/dist/utils/dco/fs-safe.d.ts.map +0 -1
  384. package/dist/utils/dco/fs-safe.js +0 -20
  385. 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 function buildAttributionBlock(params: AttributionBlockParams): string;
32
- export type UpsertResult = "created" | "updated" | "unchanged" | "would-change";
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 = "created" | "updated" | "unchanged" | "skipped-invalid" | "would-change";
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":"AAIA;;;;;;;;GAQG;AAEH,eAAO,MAAM,eAAe,4BAA4B,CAAC;AACzD,eAAO,MAAM,aAAa,0BAA0B,CAAC;AAErD,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AA6BD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,CA4B5E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G,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 { writeFileAtomicSafe } from "./fs-safe.js";
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, so a well-formed DID can neither break out
28
- // of the surrounding code span nor smuggle the literal end marker that
29
- // upsertClaudeMdBlock's indexOf() scan looks for. An attacker-influenceable
30
- // value that doesn't match is rejected outright rather than sanitized, since
31
- // clamping a corrupt DID to "look single-line" would still let a crafted
32
- // value through by construction. The length cap keeps a hostile/corrupt DID
33
- // from bloating CLAUDE.md and every PR body generated from it.
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 `mcpi dco setup`)",
39
+ "## Agent attribution (managed by `dco setup`)",
46
40
  "",
47
- agentDid
48
- ? "- When creating pull requests, end the PR description with exactly these two lines:"
49
- : "- When creating pull requests, end the PR description with exactly this byline:",
50
- ` \`Generated with [${agentName}](${agentUrl})\``,
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:", ` \`Signed-off-by: ${singleLine(params.humanName ?? "")} <${singleLine(params.humanEmail ?? "")}>\``, ` \`Co-authored-by: ${agentName} <${singleLine(params.agentEmail ?? "")}>\``);
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
- const path = join(cwd, "CLAUDE.md");
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 dir = join(cwd, ".claude");
100
- const path = join(dir, "settings.json");
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,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,yBAAyB,CAAC;AACzD,MAAM,CAAC,MAAM,aAAa,GAAG,uBAAuB,CAAC;AAsBrD;;;;;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,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,uEAAuE;AACvE,4EAA4E;AAC5E,6EAA6E;AAC7E,yEAAyE;AACzE,4EAA4E;AAC5E,+DAA+D;AAC/D,MAAM,WAAW,GAAG,oCAAoC,CAAC;AACzD,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK,CAAC,MAAM,IAAI,cAAc,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,MAA8B;IAClE,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,MAAM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AAoC;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;IAC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