@kya-os/cli 1.7.0 → 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 (390) 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 +32 -0
  10. package/dist/commands/checkpoint-init.d.ts.map +1 -0
  11. package/dist/commands/checkpoint-init.js +521 -0
  12. package/dist/commands/checkpoint-init.js.map +1 -0
  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 +62 -11
  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 +86 -0
  210. package/dist/utils/checkpoint-api.d.ts.map +1 -0
  211. package/dist/utils/checkpoint-api.js +196 -0
  212. package/dist/utils/checkpoint-api.js.map +1 -0
  213. package/dist/utils/checkpoint-env.d.ts +23 -0
  214. package/dist/utils/checkpoint-env.d.ts.map +1 -0
  215. package/dist/utils/checkpoint-env.js +59 -0
  216. package/dist/utils/checkpoint-env.js.map +1 -0
  217. package/dist/utils/checkpoint-scaffold.d.ts +61 -0
  218. package/dist/utils/checkpoint-scaffold.d.ts.map +1 -0
  219. package/dist/utils/checkpoint-scaffold.js +268 -0
  220. package/dist/utils/checkpoint-scaffold.js.map +1 -0
  221. package/dist/utils/cli-kit/browser.d.ts +24 -0
  222. package/dist/utils/cli-kit/browser.d.ts.map +1 -0
  223. package/dist/utils/cli-kit/browser.js +58 -0
  224. package/dist/utils/cli-kit/browser.js.map +1 -0
  225. package/dist/utils/cli-kit/claim-polling.d.ts +18 -0
  226. package/dist/utils/cli-kit/claim-polling.d.ts.map +1 -0
  227. package/dist/utils/{claim-polling.js → cli-kit/claim-polling.js} +19 -26
  228. package/dist/utils/cli-kit/claim-polling.js.map +1 -0
  229. package/dist/utils/cli-kit/diagnostics.d.ts +9 -0
  230. package/dist/utils/cli-kit/diagnostics.d.ts.map +1 -0
  231. package/dist/utils/cli-kit/diagnostics.js +11 -0
  232. package/dist/utils/cli-kit/diagnostics.js.map +1 -0
  233. package/dist/utils/cli-kit/fs-safe.d.ts +14 -0
  234. package/dist/utils/cli-kit/fs-safe.d.ts.map +1 -0
  235. package/dist/utils/cli-kit/fs-safe.js +20 -0
  236. package/dist/utils/cli-kit/fs-safe.js.map +1 -0
  237. package/dist/utils/cli-kit/index.d.ts +15 -0
  238. package/dist/utils/cli-kit/index.d.ts.map +1 -0
  239. package/dist/utils/cli-kit/index.js +10 -0
  240. package/dist/utils/cli-kit/index.js.map +1 -0
  241. package/dist/utils/cli-kit/json-file.d.ts +21 -0
  242. package/dist/utils/cli-kit/json-file.d.ts.map +1 -0
  243. package/dist/utils/cli-kit/json-file.js +51 -0
  244. package/dist/utils/cli-kit/json-file.js.map +1 -0
  245. package/dist/utils/cli-kit/marker-block.d.ts +26 -0
  246. package/dist/utils/cli-kit/marker-block.d.ts.map +1 -0
  247. package/dist/utils/cli-kit/marker-block.js +61 -0
  248. package/dist/utils/cli-kit/marker-block.js.map +1 -0
  249. package/dist/utils/cli-kit/paths.d.ts +15 -0
  250. package/dist/utils/cli-kit/paths.d.ts.map +1 -0
  251. package/dist/utils/cli-kit/paths.js +21 -0
  252. package/dist/utils/cli-kit/paths.js.map +1 -0
  253. package/dist/utils/cli-kit/secure-storage.d.ts +14 -0
  254. package/dist/utils/cli-kit/secure-storage.d.ts.map +1 -0
  255. package/dist/utils/cli-kit/secure-storage.js +20 -0
  256. package/dist/utils/cli-kit/secure-storage.js.map +1 -0
  257. package/dist/utils/cli-kit/step-report.d.ts +16 -0
  258. package/dist/utils/cli-kit/step-report.d.ts.map +1 -0
  259. package/dist/utils/cli-kit/step-report.js +36 -0
  260. package/dist/utils/cli-kit/step-report.js.map +1 -0
  261. package/dist/utils/dco/agent-metadata.d.ts +1 -1
  262. package/dist/utils/dco/agent-metadata.js +1 -1
  263. package/dist/utils/dco/agent-metadata.js.map +1 -1
  264. package/dist/utils/dco/claude-config.d.ts +18 -8
  265. package/dist/utils/dco/claude-config.d.ts.map +1 -1
  266. package/dist/utils/dco/claude-config.js +33 -79
  267. package/dist/utils/dco/claude-config.js.map +1 -1
  268. package/dist/utils/dco/dispatch.d.ts +134 -0
  269. package/dist/utils/dco/dispatch.d.ts.map +1 -0
  270. package/dist/utils/dco/dispatch.js +399 -0
  271. package/dist/utils/dco/dispatch.js.map +1 -0
  272. package/dist/utils/dco/fix.d.ts +122 -0
  273. package/dist/utils/dco/fix.d.ts.map +1 -0
  274. package/dist/utils/dco/fix.js +560 -0
  275. package/dist/utils/dco/fix.js.map +1 -0
  276. package/dist/utils/dco/git-config.d.ts.map +1 -1
  277. package/dist/utils/dco/git-config.js +5 -3
  278. package/dist/utils/dco/git-config.js.map +1 -1
  279. package/dist/utils/dco/github.d.ts +101 -0
  280. package/dist/utils/dco/github.d.ts.map +1 -1
  281. package/dist/utils/dco/github.js +133 -0
  282. package/dist/utils/dco/github.js.map +1 -1
  283. package/dist/utils/dco/paths.d.ts +1 -8
  284. package/dist/utils/dco/paths.d.ts.map +1 -1
  285. package/dist/utils/dco/paths.js +3 -12
  286. package/dist/utils/dco/paths.js.map +1 -1
  287. package/dist/utils/dco/render.d.ts +1 -1
  288. package/dist/utils/dco/render.d.ts.map +1 -1
  289. package/dist/utils/dco/render.js +4 -21
  290. package/dist/utils/dco/render.js.map +1 -1
  291. package/dist/utils/dco/resolve-agent.d.ts +54 -0
  292. package/dist/utils/dco/resolve-agent.d.ts.map +1 -0
  293. package/dist/utils/dco/resolve-agent.js +164 -0
  294. package/dist/utils/dco/resolve-agent.js.map +1 -0
  295. package/dist/utils/dco/setup.d.ts +10 -7
  296. package/dist/utils/dco/setup.d.ts.map +1 -1
  297. package/dist/utils/dco/setup.js +264 -199
  298. package/dist/utils/dco/setup.js.map +1 -1
  299. package/dist/utils/dco/signing-key-writer.d.ts +40 -0
  300. package/dist/utils/dco/signing-key-writer.d.ts.map +1 -0
  301. package/dist/utils/dco/signing-key-writer.js +76 -0
  302. package/dist/utils/dco/signing-key-writer.js.map +1 -0
  303. package/dist/utils/dco/ssh-key.d.ts +50 -0
  304. package/dist/utils/dco/ssh-key.d.ts.map +1 -1
  305. package/dist/utils/dco/ssh-key.js +129 -8
  306. package/dist/utils/dco/ssh-key.js.map +1 -1
  307. package/dist/utils/dco/status.d.ts +1 -1
  308. package/dist/utils/dco/status.d.ts.map +1 -1
  309. package/dist/utils/dco/status.js +3 -3
  310. package/dist/utils/dco/status.js.map +1 -1
  311. package/dist/utils/dco/verify.d.ts +170 -0
  312. package/dist/utils/dco/verify.d.ts.map +1 -0
  313. package/dist/utils/dco/verify.js +550 -0
  314. package/dist/utils/dco/verify.js.map +1 -0
  315. package/dist/utils/dependency-installer.d.ts +37 -0
  316. package/dist/utils/dependency-installer.d.ts.map +1 -0
  317. package/dist/utils/dependency-installer.js +32 -0
  318. package/dist/utils/dependency-installer.js.map +1 -0
  319. package/dist/utils/github-credential-stage.d.ts +87 -0
  320. package/dist/utils/github-credential-stage.d.ts.map +1 -0
  321. package/dist/utils/github-credential-stage.js +168 -0
  322. package/dist/utils/github-credential-stage.js.map +1 -0
  323. package/dist/utils/github-credential.d.ts +160 -0
  324. package/dist/utils/github-credential.d.ts.map +1 -0
  325. package/dist/utils/github-credential.js +308 -0
  326. package/dist/utils/github-credential.js.map +1 -0
  327. package/dist/utils/gitignore.d.ts +17 -0
  328. package/dist/utils/gitignore.d.ts.map +1 -0
  329. package/dist/utils/gitignore.js +40 -0
  330. package/dist/utils/gitignore.js.map +1 -0
  331. package/dist/utils/hub-config.d.ts +21 -0
  332. package/dist/utils/hub-config.d.ts.map +1 -0
  333. package/dist/utils/hub-config.js +28 -0
  334. package/dist/utils/hub-config.js.map +1 -0
  335. package/dist/utils/identity-heal.d.ts +16 -0
  336. package/dist/utils/identity-heal.d.ts.map +1 -0
  337. package/dist/utils/identity-heal.js +37 -0
  338. package/dist/utils/identity-heal.js.map +1 -0
  339. package/dist/utils/init/pipeline.d.ts +74 -0
  340. package/dist/utils/init/pipeline.d.ts.map +1 -0
  341. package/dist/utils/init/pipeline.js +96 -0
  342. package/dist/utils/init/pipeline.js.map +1 -0
  343. package/dist/utils/poll.d.ts +64 -0
  344. package/dist/utils/poll.d.ts.map +1 -0
  345. package/dist/utils/poll.js +76 -0
  346. package/dist/utils/poll.js.map +1 -0
  347. package/dist/utils/register-agent-identity.d.ts +67 -0
  348. package/dist/utils/register-agent-identity.d.ts.map +1 -0
  349. package/dist/utils/register-agent-identity.js +34 -0
  350. package/dist/utils/register-agent-identity.js.map +1 -0
  351. package/dist/utils/review/did-web-key.d.ts +34 -0
  352. package/dist/utils/review/did-web-key.d.ts.map +1 -0
  353. package/dist/utils/review/did-web-key.js +104 -0
  354. package/dist/utils/review/did-web-key.js.map +1 -0
  355. package/dist/utils/review/load-registry.d.ts +33 -0
  356. package/dist/utils/review/load-registry.d.ts.map +1 -0
  357. package/dist/utils/review/load-registry.js +62 -0
  358. package/dist/utils/review/load-registry.js.map +1 -0
  359. package/dist/utils/review/verdict-verify.d.ts +43 -0
  360. package/dist/utils/review/verdict-verify.d.ts.map +1 -0
  361. package/dist/utils/review/verdict-verify.js +53 -0
  362. package/dist/utils/review/verdict-verify.js.map +1 -0
  363. package/dist/utils/review-registry-writer.d.ts +52 -0
  364. package/dist/utils/review-registry-writer.d.ts.map +1 -0
  365. package/dist/utils/review-registry-writer.js +79 -0
  366. package/dist/utils/review-registry-writer.js.map +1 -0
  367. package/dist/utils/should-install-dependency.d.ts +17 -0
  368. package/dist/utils/should-install-dependency.d.ts.map +1 -0
  369. package/dist/utils/should-install-dependency.js +25 -0
  370. package/dist/utils/should-install-dependency.js.map +1 -0
  371. package/dist/utils/tool-readiness.d.ts +57 -0
  372. package/dist/utils/tool-readiness.d.ts.map +1 -0
  373. package/dist/utils/tool-readiness.js +114 -0
  374. package/dist/utils/tool-readiness.js.map +1 -0
  375. package/dist/utils/which.d.ts +2 -0
  376. package/dist/utils/which.d.ts.map +1 -0
  377. package/dist/utils/which.js +22 -0
  378. package/dist/utils/which.js.map +1 -0
  379. package/dist/version.d.ts +15 -0
  380. package/dist/version.d.ts.map +1 -0
  381. package/dist/version.js +29 -0
  382. package/dist/version.js.map +1 -0
  383. package/package.json +19 -6
  384. package/dist/utils/claim-polling.d.ts +0 -21
  385. package/dist/utils/claim-polling.d.ts.map +0 -1
  386. package/dist/utils/claim-polling.js.map +0 -1
  387. package/dist/utils/dco/fs-safe.d.ts +0 -14
  388. package/dist/utils/dco/fs-safe.d.ts.map +0 -1
  389. package/dist/utils/dco/fs-safe.js +0 -20
  390. package/dist/utils/dco/fs-safe.js.map +0 -1
@@ -0,0 +1,170 @@
1
+ /**
2
+ * Verifies that a pull request's attribution byline names an agent identity
3
+ * that actually resolves.
4
+ *
5
+ * `dco setup` only ever *instructs* the harness to write the byline —
6
+ * the PR body is composed by a model at PR time and can be edited by anyone
7
+ * with write access to the branch. So an `Agent DID:` line is a claim, not
8
+ * evidence, until the DID document behind it is fetched and checked. Every
9
+ * failure mode below exists because some way of "resolving" a DID would
10
+ * otherwise let an unverified claim read as verified.
11
+ */
12
+ export type VerifyFailure = "no-did" | "unsupported-method" | "unresolvable" | "did-mismatch" | "blocked-host";
13
+ export interface AttributionVerification {
14
+ ok: boolean;
15
+ /** The DID claimed by the PR body, when exactly one valid claim is present. */
16
+ did?: string;
17
+ /** Where the DID document was fetched from. */
18
+ documentUrl?: string;
19
+ /** The agent's registry page, taken from the document's service entry. */
20
+ agentUrl?: string;
21
+ reason?: VerifyFailure;
22
+ detail?: string;
23
+ }
24
+ export type FetchLike = (url: string, init?: {
25
+ signal?: AbortSignal;
26
+ redirect?: RequestInit["redirect"];
27
+ }) => Promise<Response>;
28
+ /**
29
+ * Resolve a hostname to every address it answers to. Injectable for the same
30
+ * reason `FetchLike` is: production wants the real resolver, tests want a
31
+ * fixed answer instead of a live DNS lookup.
32
+ */
33
+ export type LookupLike = (hostname: string) => Promise<string[]>;
34
+ /**
35
+ * Exported (review-loop P9 commit 3) so `review verify`'s did:web
36
+ * resolution (`../review/did-web-key.ts`) can pass the real resolver
37
+ * through to {@link checkDocumentHostIsSafe} without redefining it — same
38
+ * reasoning as that export.
39
+ */
40
+ export declare const defaultLookup: LookupLike;
41
+ /**
42
+ * The document host is chosen by the DID, which comes from a PR body we do
43
+ * not control. Without a deadline a hostile or merely unreachable host hangs
44
+ * the command for as long as it cares to hold the socket open — tolerable
45
+ * when a human can interrupt it, not when this runs unattended in CI.
46
+ */
47
+ export declare const RESOLVE_TIMEOUT_MS = 10000;
48
+ /**
49
+ * Pull the claimed DID out of a PR body.
50
+ *
51
+ * Returns null when the body claims two *different* DIDs. Taking the first
52
+ * match would mean an appended line could never change the verdict, but it
53
+ * would also mean a forged line prepended above the real one silently wins.
54
+ * Ambiguous attribution is a failure, not a tie to be broken.
55
+ */
56
+ export declare function extractAgentDid(prBody: string): string | null;
57
+ /**
58
+ * Whether a piece of text already carries an `Agent DID:` attribution line
59
+ * that `extractAgentDid` would pick up. Uses the exact same line pattern and
60
+ * backtick/whitespace handling, so a caller (notably `dco dispatch`, which
61
+ * appends its own authoritative line) can reject a description that would
62
+ * otherwise put a second, conflicting DID into the PR body. Matches the
63
+ * managed CLAUDE.md block's backticked, mid-line form, not just a line-start
64
+ * one.
65
+ */
66
+ export declare function hasAgentDidClaim(text: string): boolean;
67
+ /**
68
+ * Map a `did:web` to the HTTPS URL its document must be served from, per the
69
+ * did:web method spec: the identifier's colon-separated segments *are* the
70
+ * path, and a bare domain resolves under `/.well-known/`.
71
+ *
72
+ * Segments are validated AFTER percent-decoding. `DID_PATTERN` permits `%`,
73
+ * so a crafted `%2F` would otherwise smuggle a path separator through and
74
+ * point resolution at an attacker-chosen URL on the same host.
75
+ */
76
+ export declare function didWebToHttpsUrl(did: string): string | null;
77
+ /**
78
+ * Cheap, synchronous first line of defense against the exact literals an
79
+ * attacker would put directly in a did:web host: `localhost`, or an IPv4
80
+ * literal in a private, loopback, link-local, or otherwise reserved range.
81
+ *
82
+ * Takes the hostname `new URL()` produces, not the raw did:web segment.
83
+ * `URL` canonicalizes decimal/hex/octal IPv4 shorthand (`2130706433` and
84
+ * `0x7f000001` both become `127.0.0.1`) before `fetch` ever sees it, so
85
+ * checking the pre-parse segment would miss exactly the encodings an
86
+ * attacker would reach for to slip past a naive dotted-quad check. The
87
+ * trailing dot is stripped first for the same reason: `new URL()` preserves
88
+ * a root-zone dot (`"localhost."` stays `"localhost."`), and DNS treats it
89
+ * as identical to `"localhost"` — an unstripped compare would let that
90
+ * single character walk straight past an exact-match or `endsWith` check.
91
+ *
92
+ * This is a fast-path, not the actual guarantee: it only catches literals,
93
+ * so it cannot see a normal-looking hostname whose A/AAAA record happens to
94
+ * point at an internal address. `hostResolvesToBlockedAddress` below is
95
+ * what actually closes that gap, by checking where the name resolves to
96
+ * rather than how it's spelled.
97
+ */
98
+ export declare function isBlockedResolutionHost(hostname: string): boolean;
99
+ /**
100
+ * The actual guarantee `isBlockedResolutionHost` can't provide on its own:
101
+ * resolve the hostname and check every address it answers to, not just
102
+ * whether the hostname string itself looks like one of the blocked
103
+ * literals. A domain an attacker controls can point an A/AAAA record at
104
+ * 169.254.169.254 (or loopback, or an RFC1918 address) just as easily as a
105
+ * did:web host can spell the address out directly — DNS is the attacker's
106
+ * to shape here just as much as the PR body text is, since the DID names
107
+ * whatever host they choose.
108
+ *
109
+ * Deliberately does not catch a lookup failure: that is "no evidence
110
+ * either way", the same as a failed fetch, and the caller already has a
111
+ * reason for that (`unresolvable`) that this must not collide with —
112
+ * mislabeling a plain NXDOMAIN as "blocked-host" would tell the CLI's user
113
+ * they hit a private address when they actually just mistyped a domain.
114
+ */
115
+ export declare function hostResolvesToBlockedAddress(hostname: string, lookupImpl?: LookupLike): Promise<boolean>;
116
+ export type HostSafetyCheck = {
117
+ safe: true;
118
+ } | {
119
+ safe: false;
120
+ reason: "unresolvable" | "blocked-host";
121
+ detail: string;
122
+ };
123
+ /**
124
+ * Everything that has to be true about `documentUrl`'s host before it is
125
+ * worth spending a request on: it must parse, it must not be one of the
126
+ * literals `isBlockedResolutionHost` recognizes, and it must not resolve to
127
+ * one either. Pulled out on its own so `verifyPrAttribution` reads as one
128
+ * linear pipeline instead of three nested guard clauses doing the same kind
129
+ * of check.
130
+ *
131
+ * Exported (review-loop P9 commit 3): `review verify`'s did:web resolution
132
+ * fetches a DIFFERENT document (an agent's DID document, not a PR-body
133
+ * claim) from an equally untrusted, wire-supplied host, and needs the exact
134
+ * same SSRF defense before spending a request on it. Reusing this function
135
+ * keeps that defense in ONE place rather than re-deriving the blocked-range
136
+ * checks a second time.
137
+ */
138
+ export declare function checkDocumentHostIsSafe(documentUrl: string, lookupImpl: LookupLike): Promise<HostSafetyCheck>;
139
+ /**
140
+ * Resolve the DID claimed by a PR body and confirm the document describes
141
+ * that same DID.
142
+ */
143
+ export declare function verifyPrAttribution(prBody: string, fetchImpl?: FetchLike, lookupImpl?: LookupLike): Promise<AttributionVerification>;
144
+ export type KeyResolutionFailure = Exclude<VerifyFailure, "no-did"> | "no-ed25519-key";
145
+ export interface AgentPublicKeyResolution {
146
+ ok: boolean;
147
+ did: string;
148
+ /** Raw 32-byte Ed25519 public key, present only when `ok`. */
149
+ publicKeyRaw?: Buffer;
150
+ documentUrl?: string;
151
+ reason?: KeyResolutionFailure;
152
+ detail?: string;
153
+ }
154
+ /**
155
+ * Resolve an agent DID to its raw 32-byte Ed25519 public key, for verifying
156
+ * a signature it produced (a review verdict's or fix attestation's
157
+ * `proof`). This is `kya-os agent verify`'s "key resolution v1": scoped to
158
+ * `did:web` only, since every reviewer/maker DID in this feature is
159
+ * `did:web:knowthat.ai:agents:<slug>` — a `did:key` or other method fails
160
+ * closed with `unsupported-method` rather than half-supporting it (state
161
+ * that scope in the command's `--help`, per this feature's design doc).
162
+ *
163
+ * The DID here is read off a PR review or comment — the same
164
+ * untrusted-input shape `verifyPrAttribution` already handles — so it goes
165
+ * through the identical SSRF-hardened resolution path
166
+ * (`resolveDidWebDocument`) before this function ever looks at the document
167
+ * for a key.
168
+ */
169
+ export declare function resolveAgentEd25519PublicKey(did: string, fetchImpl?: FetchLike, lookupImpl?: LookupLike): Promise<AgentPublicKeyResolution>;
170
+ //# sourceMappingURL=verify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/utils/dco/verify.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,oBAAoB,GACpB,cAAc,GACd,cAAc,GACd,cAAc,CAAC;AAEnB,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,OAAO,CAAC;IACZ,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,SAAS,GAAG,CACtB,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAA;CAAE,KAChE,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEvB;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAEjE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,UAG3B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,QAAS,CAAC;AAWzC;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAY7D;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQtD;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqC3D;AA0ED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAIjE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,MAAM,EAChB,UAAU,GAAE,UAA0B,GACrC,OAAO,CAAC,OAAO,CAAC,CAGlB;AAED,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GACd;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7E;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,eAAe,CAAC,CA0C1B;AA8HD;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,SAAS,GAAE,SAA2C,EACtD,UAAU,GAAE,UAA0B,GACrC,OAAO,CAAC,uBAAuB,CAAC,CAqBlC;AA4GD,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,GAAG,gBAAgB,CAAC;AAEvF,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,OAAO,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,4BAA4B,CAChD,GAAG,EAAE,MAAM,EACX,SAAS,GAAE,SAA2C,EACtD,UAAU,GAAE,UAA0B,GACrC,OAAO,CAAC,wBAAwB,CAAC,CAwBnC"}