@sentropic/h2a-cli 0.74.0 → 0.78.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 (346) hide show
  1. package/dist/index.d.ts +1 -36
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +2 -40
  4. package/dist/index.js.map +1 -1
  5. package/package.json +4 -15
  6. package/dist/bin.d.ts +0 -3
  7. package/dist/bin.d.ts.map +0 -1
  8. package/dist/bin.js +0 -83
  9. package/dist/bin.js.map +0 -1
  10. package/dist/cli-contract.d.ts +0 -62
  11. package/dist/cli-contract.d.ts.map +0 -1
  12. package/dist/cli-contract.js +0 -729
  13. package/dist/cli-contract.js.map +0 -1
  14. package/dist/cli.d.ts +0 -254
  15. package/dist/cli.d.ts.map +0 -1
  16. package/dist/cli.js +0 -4530
  17. package/dist/cli.js.map +0 -1
  18. package/dist/hosts/agy.d.ts +0 -14
  19. package/dist/hosts/agy.d.ts.map +0 -1
  20. package/dist/hosts/agy.js +0 -47
  21. package/dist/hosts/agy.js.map +0 -1
  22. package/dist/hosts/claude.d.ts +0 -12
  23. package/dist/hosts/claude.d.ts.map +0 -1
  24. package/dist/hosts/claude.js +0 -46
  25. package/dist/hosts/claude.js.map +0 -1
  26. package/dist/hosts/codex.d.ts +0 -65
  27. package/dist/hosts/codex.d.ts.map +0 -1
  28. package/dist/hosts/codex.js +0 -45
  29. package/dist/hosts/codex.js.map +0 -1
  30. package/dist/hosts/gemini.d.ts +0 -12
  31. package/dist/hosts/gemini.d.ts.map +0 -1
  32. package/dist/hosts/gemini.js +0 -46
  33. package/dist/hosts/gemini.js.map +0 -1
  34. package/dist/hosts/plugin.d.ts +0 -151
  35. package/dist/hosts/plugin.d.ts.map +0 -1
  36. package/dist/hosts/plugin.js +0 -188
  37. package/dist/hosts/plugin.js.map +0 -1
  38. package/dist/mcp.d.ts +0 -2
  39. package/dist/mcp.d.ts.map +0 -1
  40. package/dist/mcp.js +0 -32
  41. package/dist/mcp.js.map +0 -1
  42. package/dist/runtime/blockage/index.d.ts +0 -3
  43. package/dist/runtime/blockage/index.d.ts.map +0 -1
  44. package/dist/runtime/blockage/index.js +0 -3
  45. package/dist/runtime/blockage/index.js.map +0 -1
  46. package/dist/runtime/blockage/notifiers.d.ts +0 -52
  47. package/dist/runtime/blockage/notifiers.d.ts.map +0 -1
  48. package/dist/runtime/blockage/notifiers.js +0 -74
  49. package/dist/runtime/blockage/notifiers.js.map +0 -1
  50. package/dist/runtime/blockage/registry.d.ts +0 -30
  51. package/dist/runtime/blockage/registry.d.ts.map +0 -1
  52. package/dist/runtime/blockage/registry.js +0 -86
  53. package/dist/runtime/blockage/registry.js.map +0 -1
  54. package/dist/runtime/deploy/k8s-sidecar.d.ts +0 -92
  55. package/dist/runtime/deploy/k8s-sidecar.d.ts.map +0 -1
  56. package/dist/runtime/deploy/k8s-sidecar.js +0 -166
  57. package/dist/runtime/deploy/k8s-sidecar.js.map +0 -1
  58. package/dist/runtime/deploy/k8s-tenant.d.ts +0 -86
  59. package/dist/runtime/deploy/k8s-tenant.d.ts.map +0 -1
  60. package/dist/runtime/deploy/k8s-tenant.js +0 -255
  61. package/dist/runtime/deploy/k8s-tenant.js.map +0 -1
  62. package/dist/runtime/drive/inbox-wake.d.ts +0 -36
  63. package/dist/runtime/drive/inbox-wake.d.ts.map +0 -1
  64. package/dist/runtime/drive/inbox-wake.js +0 -50
  65. package/dist/runtime/drive/inbox-wake.js.map +0 -1
  66. package/dist/runtime/drive/index.d.ts +0 -173
  67. package/dist/runtime/drive/index.d.ts.map +0 -1
  68. package/dist/runtime/drive/index.js +0 -503
  69. package/dist/runtime/drive/index.js.map +0 -1
  70. package/dist/runtime/drumbeat/deciders.d.ts +0 -32
  71. package/dist/runtime/drumbeat/deciders.d.ts.map +0 -1
  72. package/dist/runtime/drumbeat/deciders.js +0 -65
  73. package/dist/runtime/drumbeat/deciders.js.map +0 -1
  74. package/dist/runtime/drumbeat/decisions.d.ts +0 -19
  75. package/dist/runtime/drumbeat/decisions.d.ts.map +0 -1
  76. package/dist/runtime/drumbeat/decisions.js +0 -34
  77. package/dist/runtime/drumbeat/decisions.js.map +0 -1
  78. package/dist/runtime/drumbeat/inbox-relance.d.ts +0 -29
  79. package/dist/runtime/drumbeat/inbox-relance.d.ts.map +0 -1
  80. package/dist/runtime/drumbeat/inbox-relance.js +0 -101
  81. package/dist/runtime/drumbeat/inbox-relance.js.map +0 -1
  82. package/dist/runtime/drumbeat/index.d.ts +0 -8
  83. package/dist/runtime/drumbeat/index.d.ts.map +0 -1
  84. package/dist/runtime/drumbeat/index.js +0 -8
  85. package/dist/runtime/drumbeat/index.js.map +0 -1
  86. package/dist/runtime/drumbeat/registry.d.ts +0 -60
  87. package/dist/runtime/drumbeat/registry.d.ts.map +0 -1
  88. package/dist/runtime/drumbeat/registry.js +0 -115
  89. package/dist/runtime/drumbeat/registry.js.map +0 -1
  90. package/dist/runtime/drumbeat/relaunchers.d.ts +0 -111
  91. package/dist/runtime/drumbeat/relaunchers.d.ts.map +0 -1
  92. package/dist/runtime/drumbeat/relaunchers.js +0 -242
  93. package/dist/runtime/drumbeat/relaunchers.js.map +0 -1
  94. package/dist/runtime/drumbeat/scan.d.ts +0 -36
  95. package/dist/runtime/drumbeat/scan.d.ts.map +0 -1
  96. package/dist/runtime/drumbeat/scan.js +0 -41
  97. package/dist/runtime/drumbeat/scan.js.map +0 -1
  98. package/dist/runtime/drumbeat/watch.d.ts +0 -74
  99. package/dist/runtime/drumbeat/watch.d.ts.map +0 -1
  100. package/dist/runtime/drumbeat/watch.js +0 -216
  101. package/dist/runtime/drumbeat/watch.js.map +0 -1
  102. package/dist/runtime/escalation/index.d.ts +0 -2
  103. package/dist/runtime/escalation/index.d.ts.map +0 -1
  104. package/dist/runtime/escalation/index.js +0 -2
  105. package/dist/runtime/escalation/index.js.map +0 -1
  106. package/dist/runtime/escalation/registry.d.ts +0 -44
  107. package/dist/runtime/escalation/registry.d.ts.map +0 -1
  108. package/dist/runtime/escalation/registry.js +0 -79
  109. package/dist/runtime/escalation/registry.js.map +0 -1
  110. package/dist/runtime/governance/claims.d.ts +0 -43
  111. package/dist/runtime/governance/claims.d.ts.map +0 -1
  112. package/dist/runtime/governance/claims.js +0 -93
  113. package/dist/runtime/governance/claims.js.map +0 -1
  114. package/dist/runtime/governance/conductor.d.ts +0 -79
  115. package/dist/runtime/governance/conductor.d.ts.map +0 -1
  116. package/dist/runtime/governance/conductor.js +0 -106
  117. package/dist/runtime/governance/conductor.js.map +0 -1
  118. package/dist/runtime/governance/index.d.ts +0 -5
  119. package/dist/runtime/governance/index.d.ts.map +0 -1
  120. package/dist/runtime/governance/index.js +0 -5
  121. package/dist/runtime/governance/index.js.map +0 -1
  122. package/dist/runtime/governance/launch-check.d.ts +0 -93
  123. package/dist/runtime/governance/launch-check.d.ts.map +0 -1
  124. package/dist/runtime/governance/launch-check.js +0 -113
  125. package/dist/runtime/governance/launch-check.js.map +0 -1
  126. package/dist/runtime/governance/spawns.d.ts +0 -50
  127. package/dist/runtime/governance/spawns.d.ts.map +0 -1
  128. package/dist/runtime/governance/spawns.js +0 -91
  129. package/dist/runtime/governance/spawns.js.map +0 -1
  130. package/dist/runtime/identity/bindings.d.ts +0 -84
  131. package/dist/runtime/identity/bindings.d.ts.map +0 -1
  132. package/dist/runtime/identity/bindings.js +0 -112
  133. package/dist/runtime/identity/bindings.js.map +0 -1
  134. package/dist/runtime/identity/index.d.ts +0 -11
  135. package/dist/runtime/identity/index.d.ts.map +0 -1
  136. package/dist/runtime/identity/index.js +0 -6
  137. package/dist/runtime/identity/index.js.map +0 -1
  138. package/dist/runtime/identity/live.d.ts +0 -26
  139. package/dist/runtime/identity/live.d.ts.map +0 -1
  140. package/dist/runtime/identity/live.js +0 -232
  141. package/dist/runtime/identity/live.js.map +0 -1
  142. package/dist/runtime/identity/migration.d.ts +0 -55
  143. package/dist/runtime/identity/migration.d.ts.map +0 -1
  144. package/dist/runtime/identity/migration.js +0 -100
  145. package/dist/runtime/identity/migration.js.map +0 -1
  146. package/dist/runtime/identity/readers.d.ts +0 -42
  147. package/dist/runtime/identity/readers.d.ts.map +0 -1
  148. package/dist/runtime/identity/readers.js +0 -248
  149. package/dist/runtime/identity/readers.js.map +0 -1
  150. package/dist/runtime/identity/resolver.d.ts +0 -50
  151. package/dist/runtime/identity/resolver.d.ts.map +0 -1
  152. package/dist/runtime/identity/resolver.js +0 -61
  153. package/dist/runtime/identity/resolver.js.map +0 -1
  154. package/dist/runtime/identity/workspace-id.d.ts +0 -43
  155. package/dist/runtime/identity/workspace-id.d.ts.map +0 -1
  156. package/dist/runtime/identity/workspace-id.js +0 -138
  157. package/dist/runtime/identity/workspace-id.js.map +0 -1
  158. package/dist/runtime/local-files/index.d.ts +0 -8
  159. package/dist/runtime/local-files/index.d.ts.map +0 -1
  160. package/dist/runtime/local-files/index.js +0 -8
  161. package/dist/runtime/local-files/index.js.map +0 -1
  162. package/dist/runtime/local-files/lease.d.ts +0 -62
  163. package/dist/runtime/local-files/lease.d.ts.map +0 -1
  164. package/dist/runtime/local-files/lease.js +0 -249
  165. package/dist/runtime/local-files/lease.js.map +0 -1
  166. package/dist/runtime/local-files/locks.d.ts +0 -43
  167. package/dist/runtime/local-files/locks.d.ts.map +0 -1
  168. package/dist/runtime/local-files/locks.js +0 -197
  169. package/dist/runtime/local-files/locks.js.map +0 -1
  170. package/dist/runtime/local-files/migrate.d.ts +0 -31
  171. package/dist/runtime/local-files/migrate.d.ts.map +0 -1
  172. package/dist/runtime/local-files/migrate.js +0 -104
  173. package/dist/runtime/local-files/migrate.js.map +0 -1
  174. package/dist/runtime/local-files/paths.d.ts +0 -146
  175. package/dist/runtime/local-files/paths.d.ts.map +0 -1
  176. package/dist/runtime/local-files/paths.js +0 -233
  177. package/dist/runtime/local-files/paths.js.map +0 -1
  178. package/dist/runtime/local-files/presence.d.ts +0 -80
  179. package/dist/runtime/local-files/presence.d.ts.map +0 -1
  180. package/dist/runtime/local-files/presence.js +0 -250
  181. package/dist/runtime/local-files/presence.js.map +0 -1
  182. package/dist/runtime/local-files/schema.d.ts +0 -47
  183. package/dist/runtime/local-files/schema.d.ts.map +0 -1
  184. package/dist/runtime/local-files/schema.js +0 -77
  185. package/dist/runtime/local-files/schema.js.map +0 -1
  186. package/dist/runtime/local-files/store.d.ts +0 -132
  187. package/dist/runtime/local-files/store.d.ts.map +0 -1
  188. package/dist/runtime/local-files/store.js +0 -997
  189. package/dist/runtime/local-files/store.js.map +0 -1
  190. package/dist/runtime/mcp/handlers.d.ts +0 -196
  191. package/dist/runtime/mcp/handlers.d.ts.map +0 -1
  192. package/dist/runtime/mcp/handlers.js +0 -1025
  193. package/dist/runtime/mcp/handlers.js.map +0 -1
  194. package/dist/runtime/mcp/index.d.ts +0 -7
  195. package/dist/runtime/mcp/index.d.ts.map +0 -1
  196. package/dist/runtime/mcp/index.js +0 -7
  197. package/dist/runtime/mcp/index.js.map +0 -1
  198. package/dist/runtime/mcp/notifications.d.ts +0 -47
  199. package/dist/runtime/mcp/notifications.d.ts.map +0 -1
  200. package/dist/runtime/mcp/notifications.js +0 -204
  201. package/dist/runtime/mcp/notifications.js.map +0 -1
  202. package/dist/runtime/mcp/server.d.ts +0 -45
  203. package/dist/runtime/mcp/server.d.ts.map +0 -1
  204. package/dist/runtime/mcp/server.js +0 -94
  205. package/dist/runtime/mcp/server.js.map +0 -1
  206. package/dist/runtime/mcp/sessions.d.ts +0 -68
  207. package/dist/runtime/mcp/sessions.d.ts.map +0 -1
  208. package/dist/runtime/mcp/sessions.js +0 -152
  209. package/dist/runtime/mcp/sessions.js.map +0 -1
  210. package/dist/runtime/mcp/stdio.d.ts +0 -72
  211. package/dist/runtime/mcp/stdio.d.ts.map +0 -1
  212. package/dist/runtime/mcp/stdio.js +0 -274
  213. package/dist/runtime/mcp/stdio.js.map +0 -1
  214. package/dist/runtime/mcp/tools.d.ts +0 -19
  215. package/dist/runtime/mcp/tools.d.ts.map +0 -1
  216. package/dist/runtime/mcp/tools.js +0 -525
  217. package/dist/runtime/mcp/tools.js.map +0 -1
  218. package/dist/runtime/mcp-http/app.d.ts +0 -33
  219. package/dist/runtime/mcp-http/app.d.ts.map +0 -1
  220. package/dist/runtime/mcp-http/app.js +0 -162
  221. package/dist/runtime/mcp-http/app.js.map +0 -1
  222. package/dist/runtime/mcp-http/hosted-mcp-server.d.ts +0 -14
  223. package/dist/runtime/mcp-http/hosted-mcp-server.d.ts.map +0 -1
  224. package/dist/runtime/mcp-http/hosted-mcp-server.js +0 -38
  225. package/dist/runtime/mcp-http/hosted-mcp-server.js.map +0 -1
  226. package/dist/runtime/mcp-http/index.d.ts +0 -18
  227. package/dist/runtime/mcp-http/index.d.ts.map +0 -1
  228. package/dist/runtime/mcp-http/index.js +0 -18
  229. package/dist/runtime/mcp-http/index.js.map +0 -1
  230. package/dist/runtime/mcp-http/main.d.ts +0 -2
  231. package/dist/runtime/mcp-http/main.d.ts.map +0 -1
  232. package/dist/runtime/mcp-http/main.js +0 -14
  233. package/dist/runtime/mcp-http/main.js.map +0 -1
  234. package/dist/runtime/mcp-http/oauth/broker-login.d.ts +0 -50
  235. package/dist/runtime/mcp-http/oauth/broker-login.d.ts.map +0 -1
  236. package/dist/runtime/mcp-http/oauth/broker-login.js +0 -41
  237. package/dist/runtime/mcp-http/oauth/broker-login.js.map +0 -1
  238. package/dist/runtime/mcp-http/oauth/broker-routes.d.ts +0 -45
  239. package/dist/runtime/mcp-http/oauth/broker-routes.d.ts.map +0 -1
  240. package/dist/runtime/mcp-http/oauth/broker-routes.js +0 -54
  241. package/dist/runtime/mcp-http/oauth/broker-routes.js.map +0 -1
  242. package/dist/runtime/mcp-http/oauth/config.d.ts +0 -49
  243. package/dist/runtime/mcp-http/oauth/config.d.ts.map +0 -1
  244. package/dist/runtime/mcp-http/oauth/config.js +0 -69
  245. package/dist/runtime/mcp-http/oauth/config.js.map +0 -1
  246. package/dist/runtime/mcp-http/oauth/crypto.d.ts +0 -14
  247. package/dist/runtime/mcp-http/oauth/crypto.d.ts.map +0 -1
  248. package/dist/runtime/mcp-http/oauth/crypto.js +0 -29
  249. package/dist/runtime/mcp-http/oauth/crypto.js.map +0 -1
  250. package/dist/runtime/mcp-http/oauth/file-store.d.ts +0 -48
  251. package/dist/runtime/mcp-http/oauth/file-store.d.ts.map +0 -1
  252. package/dist/runtime/mcp-http/oauth/file-store.js +0 -101
  253. package/dist/runtime/mcp-http/oauth/file-store.js.map +0 -1
  254. package/dist/runtime/mcp-http/oauth/hono-oauth-router.d.ts +0 -5
  255. package/dist/runtime/mcp-http/oauth/hono-oauth-router.d.ts.map +0 -1
  256. package/dist/runtime/mcp-http/oauth/hono-oauth-router.js +0 -92
  257. package/dist/runtime/mcp-http/oauth/hono-oauth-router.js.map +0 -1
  258. package/dist/runtime/mcp-http/oauth/oidc-rp.d.ts +0 -56
  259. package/dist/runtime/mcp-http/oauth/oidc-rp.d.ts.map +0 -1
  260. package/dist/runtime/mcp-http/oauth/oidc-rp.js +0 -63
  261. package/dist/runtime/mcp-http/oauth/oidc-rp.js.map +0 -1
  262. package/dist/runtime/mcp-http/oauth/redirect-uri.d.ts +0 -11
  263. package/dist/runtime/mcp-http/oauth/redirect-uri.d.ts.map +0 -1
  264. package/dist/runtime/mcp-http/oauth/redirect-uri.js +0 -29
  265. package/dist/runtime/mcp-http/oauth/redirect-uri.js.map +0 -1
  266. package/dist/runtime/mcp-http/oauth/single-tenant-provider.d.ts +0 -70
  267. package/dist/runtime/mcp-http/oauth/single-tenant-provider.d.ts.map +0 -1
  268. package/dist/runtime/mcp-http/oauth/single-tenant-provider.js +0 -247
  269. package/dist/runtime/mcp-http/oauth/single-tenant-provider.js.map +0 -1
  270. package/dist/runtime/mcp-http/oauth/tenancy.d.ts +0 -3
  271. package/dist/runtime/mcp-http/oauth/tenancy.d.ts.map +0 -1
  272. package/dist/runtime/mcp-http/oauth/tenancy.js +0 -18
  273. package/dist/runtime/mcp-http/oauth/tenancy.js.map +0 -1
  274. package/dist/runtime/mcp-http/readonly-allowlist.d.ts +0 -24
  275. package/dist/runtime/mcp-http/readonly-allowlist.d.ts.map +0 -1
  276. package/dist/runtime/mcp-http/readonly-allowlist.js +0 -43
  277. package/dist/runtime/mcp-http/readonly-allowlist.js.map +0 -1
  278. package/dist/runtime/mcp-http/serve.d.ts +0 -39
  279. package/dist/runtime/mcp-http/serve.d.ts.map +0 -1
  280. package/dist/runtime/mcp-http/serve.js +0 -100
  281. package/dist/runtime/mcp-http/serve.js.map +0 -1
  282. package/dist/runtime/mirror/accept.d.ts +0 -57
  283. package/dist/runtime/mirror/accept.d.ts.map +0 -1
  284. package/dist/runtime/mirror/accept.js +0 -70
  285. package/dist/runtime/mirror/accept.js.map +0 -1
  286. package/dist/runtime/mirror/build.d.ts +0 -44
  287. package/dist/runtime/mirror/build.d.ts.map +0 -1
  288. package/dist/runtime/mirror/build.js +0 -37
  289. package/dist/runtime/mirror/build.js.map +0 -1
  290. package/dist/runtime/mirror/index.d.ts +0 -9
  291. package/dist/runtime/mirror/index.d.ts.map +0 -1
  292. package/dist/runtime/mirror/index.js +0 -9
  293. package/dist/runtime/mirror/index.js.map +0 -1
  294. package/dist/runtime/mirror/serve.d.ts +0 -21
  295. package/dist/runtime/mirror/serve.d.ts.map +0 -1
  296. package/dist/runtime/mirror/serve.js +0 -141
  297. package/dist/runtime/mirror/serve.js.map +0 -1
  298. package/dist/runtime/nhi.d.ts +0 -15
  299. package/dist/runtime/nhi.d.ts.map +0 -1
  300. package/dist/runtime/nhi.js +0 -26
  301. package/dist/runtime/nhi.js.map +0 -1
  302. package/dist/runtime/remote/accept.d.ts +0 -50
  303. package/dist/runtime/remote/accept.d.ts.map +0 -1
  304. package/dist/runtime/remote/accept.js +0 -54
  305. package/dist/runtime/remote/accept.js.map +0 -1
  306. package/dist/runtime/remote/client.d.ts +0 -27
  307. package/dist/runtime/remote/client.d.ts.map +0 -1
  308. package/dist/runtime/remote/client.js +0 -34
  309. package/dist/runtime/remote/client.js.map +0 -1
  310. package/dist/runtime/remote/index.d.ts +0 -5
  311. package/dist/runtime/remote/index.d.ts.map +0 -1
  312. package/dist/runtime/remote/index.js +0 -5
  313. package/dist/runtime/remote/index.js.map +0 -1
  314. package/dist/runtime/remote/serve.d.ts +0 -27
  315. package/dist/runtime/remote/serve.d.ts.map +0 -1
  316. package/dist/runtime/remote/serve.js +0 -26
  317. package/dist/runtime/remote/serve.js.map +0 -1
  318. package/dist/runtime/remote/server.d.ts +0 -36
  319. package/dist/runtime/remote/server.d.ts.map +0 -1
  320. package/dist/runtime/remote/server.js +0 -100
  321. package/dist/runtime/remote/server.js.map +0 -1
  322. package/dist/runtime/sysml/client.d.ts +0 -44
  323. package/dist/runtime/sysml/client.d.ts.map +0 -1
  324. package/dist/runtime/sysml/client.js +0 -52
  325. package/dist/runtime/sysml/client.js.map +0 -1
  326. package/dist/runtime/sysml/disclosure.d.ts +0 -23
  327. package/dist/runtime/sysml/disclosure.d.ts.map +0 -1
  328. package/dist/runtime/sysml/disclosure.js +0 -53
  329. package/dist/runtime/sysml/disclosure.js.map +0 -1
  330. package/dist/runtime/sysml/index.d.ts +0 -4
  331. package/dist/runtime/sysml/index.d.ts.map +0 -1
  332. package/dist/runtime/sysml/index.js +0 -4
  333. package/dist/runtime/sysml/index.js.map +0 -1
  334. package/dist/runtime/sysml/verify.d.ts +0 -32
  335. package/dist/runtime/sysml/verify.d.ts.map +0 -1
  336. package/dist/runtime/sysml/verify.js +0 -67
  337. package/dist/runtime/sysml/verify.js.map +0 -1
  338. package/dist/runtime/upgrade/index.d.ts +0 -96
  339. package/dist/runtime/upgrade/index.d.ts.map +0 -1
  340. package/dist/runtime/upgrade/index.js +0 -185
  341. package/dist/runtime/upgrade/index.js.map +0 -1
  342. package/dist/runtime/version/agent-version.d.ts +0 -15
  343. package/dist/runtime/version/agent-version.d.ts.map +0 -1
  344. package/dist/runtime/version/agent-version.js +0 -53
  345. package/dist/runtime/version/agent-version.js.map +0 -1
  346. package/skills/h2a/SKILL.md +0 -345
@@ -1,113 +0,0 @@
1
- /**
2
- * Governance D3 — Conductor Launch Check (DRY-RUN, read-only).
3
- *
4
- * h2a polls `track workspace-activity` and RECOMMENDS launching a conductor
5
- * where work is durably stalled and no conductor is live.
6
- *
7
- * The module has two layers:
8
- *
9
- * 1. `recommendConductorLaunch` — pure function, no I/O. Derives the
10
- * recommendation from two booleans: whether a conductor is already live and
11
- * how many stalled items were found.
12
- *
13
- * 2. `conductorLaunchCheck` — the I/O gatherer. Calls `track
14
- * workspace-activity`, calls `conductorFor`, computes the recommendation,
15
- * and returns a single result object. Never writes, never spawns.
16
- *
17
- * IMPORTANT — DRY-RUN policy
18
- * --------------------------
19
- * h2a does NOT spawn anything. A `recommendation === "launch"` output is
20
- * purely advisory. The actual conductor launch is **parked** pending a
21
- * spawn-policy decision and remote-trigger support.
22
- */
23
- import { execFileSync } from "node:child_process";
24
- import { conductorFor } from "./conductor.js";
25
- /**
26
- * Pure function: derive a conductor-launch recommendation from pre-gathered
27
- * facts. No I/O.
28
- *
29
- * Rules (in precedence order):
30
- * 1. conductorLive === true → none (a live conductor already owns the workspace).
31
- * 2. conductorLive === false AND stalledCount > 0 → launch.
32
- * 3. else → none (no stalled work detected).
33
- */
34
- export function recommendConductorLaunch(opts) {
35
- const { conductorLive, stalledCount } = opts;
36
- if (conductorLive) {
37
- return {
38
- recommendation: "none",
39
- reason: "a live conductor already owns this workspace"
40
- };
41
- }
42
- if (stalledCount > 0) {
43
- return {
44
- recommendation: "launch",
45
- reason: `${stalledCount} stalled item(s) and no live conductor`,
46
- suggestedHosts: ["claude", "codex", "agy"]
47
- };
48
- }
49
- return {
50
- recommendation: "none",
51
- reason: "no stalled work"
52
- };
53
- }
54
- /**
55
- * Default implementation: run the `track` binary and parse the JSON output.
56
- * Returns `undefined` on any error (track absent, non-zero exit, invalid JSON).
57
- * Never throws.
58
- */
59
- function defaultRunTrackActivity(workspaceId, idleMs) {
60
- try {
61
- const out = execFileSync("track", [
62
- "workspace-activity",
63
- "--workspace",
64
- workspaceId,
65
- "--idle-ms",
66
- String(idleMs),
67
- "--format",
68
- "json"
69
- ], { encoding: "utf8" });
70
- return JSON.parse(out);
71
- }
72
- catch {
73
- return undefined;
74
- }
75
- }
76
- /**
77
- * Gather all facts and derive a conductor-launch recommendation.
78
- *
79
- * Read-only: no writes, no spawns.
80
- */
81
- export function conductorLaunchCheck(opts) {
82
- const { root, workspaceId, idleMs = 86_400_000, now, runTrackActivity = defaultRunTrackActivity } = opts;
83
- // 1. Gather track activity (graceful — track may not be installed in CI).
84
- const activityRaw = runTrackActivity(workspaceId, idleMs);
85
- const trackAvailable = activityRaw !== undefined;
86
- const activity = activityRaw ?? { pending: 0, stalled: [] };
87
- // 2. Resolve the live conductor.
88
- const resolution = conductorFor({
89
- root,
90
- workspaceId,
91
- ...(now !== undefined ? { now: now() } : {})
92
- });
93
- const conductor = resolution.conductor;
94
- const conductorLive = conductor !== null;
95
- // 3. Compute recommendation.
96
- const rec = recommendConductorLaunch({
97
- conductorLive,
98
- stalledCount: activity.stalled.length
99
- });
100
- return {
101
- workspaceId,
102
- trackAvailable,
103
- conductor,
104
- conductorLive,
105
- pending: activity.pending,
106
- stalled: activity.stalled,
107
- ...(activity.latestEventAt !== undefined ? { latestEventAt: activity.latestEventAt } : {}),
108
- recommendation: rec.recommendation,
109
- reason: rec.reason,
110
- ...(rec.suggestedHosts !== undefined ? { suggestedHosts: rec.suggestedHosts } : {})
111
- };
112
- }
113
- //# sourceMappingURL=launch-check.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"launch-check.js","sourceRoot":"","sources":["../../../src/runtime/governance/launch-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAsB9C;;;;;;;;GAQG;AACH,MAAM,UAAU,wBAAwB,CACtC,IAAkC;IAElC,MA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C,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAE5D,iCAAiC;IACjC,MAAM,UAAU,GAAG,YAAY,CAAC;QAC9B,IAAI;QACJ,WAAW;QACX,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC7C,CAAC,CAAC;IACH,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;IACvC,MAAM,aAAa,GAAG,SAAS,KAAK,IAAI,CAAC;IAEzC,6BAA6B;IAC7B,MAAM,GAAG,GAAG,wBAAwB,CAAC;QACnC,aAAa;QACb,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM;KACtC,CAAC,CAAC;IAEH,OAAO;QACL,WAAW;QACX,cAAc;QACd,SAAS;QACT,aAAa;QACb,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,GAAG,CAAC,QAAQ,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1F,cAAc,EAAE,GAAG,CAAC,cAAc;QAClC,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,GAAG,CAAC,GAAG,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpF,CAAC;AACJ,CAAC"}
@@ -1,50 +0,0 @@
1
- /**
2
- * Governance D3 — Conductor-spawn request store (append-only).
3
- *
4
- * Records each time h2a emits a conductor-launch-request envelope to a remote
5
- * agent, so the cap/cooldown guard can suppress duplicate requests within the
6
- * 30-minute window.
7
- *
8
- * File: `<root>/.h2a/governance/conductor-spawns.jsonl`
9
- * Event shape: `{ workspaceId: string, at: string, to?: string }`
10
- *
11
- * API mirrors claims.ts — append-only, no deletion, no enforcement.
12
- */
13
- export interface SpawnRequestEvent {
14
- readonly workspaceId: string;
15
- /** ISO 8601 timestamp when the request was emitted. */
16
- readonly at: string;
17
- /** The remote instance that received the request, if known. */
18
- readonly to?: string;
19
- }
20
- /**
21
- * Append a conductor-spawn request event to the JSONL store.
22
- * Creates the governance directory if it does not exist.
23
- */
24
- export declare function recordSpawnRequest(root: string, event: SpawnRequestEvent): void;
25
- /**
26
- * Return the `at` timestamp of the most recent spawn request for a workspace,
27
- * or `undefined` if none has been recorded.
28
- *
29
- * Uses canonical comparison so the workspace id is case-fold and slug-stable.
30
- */
31
- export declare function lastSpawnRequestAt(root: string, workspaceId: string): string | undefined;
32
- export interface SpawnAllowedOpts {
33
- /** ISO 8601 timestamp of the last recorded spawn request, or undefined. */
34
- readonly lastSpawnAt?: string;
35
- /** Reference instant in ms (Date.now()). */
36
- readonly now: number;
37
- /** Cooldown window in ms (default 1 800 000 = 30 min). */
38
- readonly cooldownMs?: number;
39
- }
40
- /**
41
- * Pure helper: return true iff emitting a new spawn request is allowed.
42
- *
43
- * Rules:
44
- * - No previous request → always allowed.
45
- * - Previous request exists → allowed only if `now - Date.parse(lastSpawnAt) >= cooldownMs`.
46
- *
47
- * Default cooldown is 30 minutes (1 800 000 ms).
48
- */
49
- export declare function spawnAllowed(opts: SpawnAllowedOpts): boolean;
50
- //# sourceMappingURL=spawns.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spawns.d.ts","sourceRoot":"","sources":["../../../src/runtime/governance/spawns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,uDAAuD;IACvD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;CACtB;AAkBD;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,iBAAiB,GACvB,IAAI,CAIN;AA0BD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIxF;AAMD,MAAM,WAAW,gBAAgB;IAC/B,2EAA2E;IAC3E,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,4CAA4C;IAC5C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAK5D"}
@@ -1,91 +0,0 @@
1
- /**
2
- * Governance D3 — Conductor-spawn request store (append-only).
3
- *
4
- * Records each time h2a emits a conductor-launch-request envelope to a remote
5
- * agent, so the cap/cooldown guard can suppress duplicate requests within the
6
- * 30-minute window.
7
- *
8
- * File: `<root>/.h2a/governance/conductor-spawns.jsonl`
9
- * Event shape: `{ workspaceId: string, at: string, to?: string }`
10
- *
11
- * API mirrors claims.ts — append-only, no deletion, no enforcement.
12
- */
13
- import { appendFileSync, existsSync, mkdirSync, readFileSync } from "node:fs";
14
- import { join } from "node:path";
15
- import { canonicalAddress, localStorePaths } from "../local-files/index.js";
16
- // ---------------------------------------------------------------------------
17
- // Paths
18
- // ---------------------------------------------------------------------------
19
- function governanceDir(root) {
20
- return join(localStorePaths(root).root, "governance");
21
- }
22
- function spawnsFile(root) {
23
- return join(governanceDir(root), "conductor-spawns.jsonl");
24
- }
25
- // ---------------------------------------------------------------------------
26
- // Store operations
27
- // ---------------------------------------------------------------------------
28
- /**
29
- * Append a conductor-spawn request event to the JSONL store.
30
- * Creates the governance directory if it does not exist.
31
- */
32
- export function recordSpawnRequest(root, event) {
33
- const dir = governanceDir(root);
34
- mkdirSync(dir, { recursive: true });
35
- appendFileSync(spawnsFile(root), `${JSON.stringify(event)}\n`, "utf8");
36
- }
37
- /**
38
- * Return all spawn request events for a workspace, sorted ascending by `at`.
39
- * Skips malformed lines. Returns an empty array if the file does not exist.
40
- */
41
- function listSpawnRequests(root, workspaceId) {
42
- const file = spawnsFile(root);
43
- if (!existsSync(file))
44
- return [];
45
- const wantWs = canonicalAddress(workspaceId);
46
- const out = [];
47
- for (const line of readFileSync(file, "utf8").split("\n")) {
48
- if (!line.trim())
49
- continue;
50
- try {
51
- const ev = JSON.parse(line);
52
- if (canonicalAddress(ev.workspaceId) === wantWs) {
53
- out.push(ev);
54
- }
55
- }
56
- catch {
57
- // skip malformed line
58
- }
59
- }
60
- out.sort((a, b) => a.at.localeCompare(b.at));
61
- return out;
62
- }
63
- /**
64
- * Return the `at` timestamp of the most recent spawn request for a workspace,
65
- * or `undefined` if none has been recorded.
66
- *
67
- * Uses canonical comparison so the workspace id is case-fold and slug-stable.
68
- */
69
- export function lastSpawnRequestAt(root, workspaceId) {
70
- const events = listSpawnRequests(root, workspaceId);
71
- if (events.length === 0)
72
- return undefined;
73
- return events[events.length - 1].at;
74
- }
75
- /**
76
- * Pure helper: return true iff emitting a new spawn request is allowed.
77
- *
78
- * Rules:
79
- * - No previous request → always allowed.
80
- * - Previous request exists → allowed only if `now - Date.parse(lastSpawnAt) >= cooldownMs`.
81
- *
82
- * Default cooldown is 30 minutes (1 800 000 ms).
83
- */
84
- export function spawnAllowed(opts) {
85
- const { lastSpawnAt, now, cooldownMs = 1_800_000 } = opts;
86
- if (lastSpawnAt === undefined)
87
- return true;
88
- const elapsed = now - Date.parse(lastSpawnAt);
89
- return elapsed >= cooldownMs;
90
- }
91
- //# sourceMappingURL=spawns.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spawns.js","sourceRoot":"","sources":["../../../src/runtime/governance/spawns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,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es the per-workspace choice).
4
- *
5
- * Reconnect de-collision binds the perennial identity to its stability unit
6
- * `(host, providerSessionId)` — the provider **conversation UUID**
7
- * (`CLAUDE_CODE_SESSION_ID`, the Codex session id, …). One identity per live
8
- * conversation: two concurrent conversations in the SAME workspace now get
9
- * DISTINCT ids (no shared inbox — the collision this re-anchor removes), and a
10
- * resume of the same conversation reclaims its id (the UUID survives resume).
11
- * `workspaceId` is recorded as metadata only — NOT the match key. Keying on it
12
- * (the prior design) collapsed concurrent agents in one repo onto one inbox; the
13
- * per-session granularity is intended now, with dead ids reaped via presence TTL
14
- * + discover=live-only rather than prevented. An agent with no readable
15
- * conversation UUID is given a per-workspace fallback id
16
- * (`fallback:<host>:<workspaceId>` by the caller), so that degenerate case keeps
17
- * the old per-workspace behavior.
18
- *
19
- * **RECLAIM requires proof-of-possession**: the connector must sign a fresh
20
- * nonce with the ed25519 key already bound to that identity (verified against
21
- * the instance's active keys). The provider session id is a spoofable *routing
22
- * hint* — never the authenticator. No valid signature → **MINT** a fresh
23
- * identity (so a process presenting a victim's id, without the key, gets a new
24
- * identity, not the victim's inbox). The read → decide → append runs in ONE lock
25
- * (no reclaim/mint race, F3).
26
- */
27
- import { type H2ASignature } from "@sentropic/h2a";
28
- export interface H2AIdentityBinding {
29
- readonly host: string;
30
- readonly providerSessionId: string;
31
- readonly workspaceId: string;
32
- /** The addressable handle `host:label:uuid12` — what the keyring + addressing key on. */
33
- readonly instance: string;
34
- /** The perennial agent UUID (its first 12 hex form `uuid12` in the instance). */
35
- readonly agentUuid: string;
36
- readonly at: string;
37
- }
38
- export interface IdentityBindingKey {
39
- readonly host: string;
40
- readonly providerSessionId: string;
41
- readonly workspaceId: string;
42
- }
43
- export declare function listBindings(root: string): H2AIdentityBinding[];
44
- /**
45
- * The latest binding for the identity's stability unit
46
- * `(host, providerSessionId)` (append-only → last wins), or undefined.
47
- *
48
- * The match is the provider **conversation UUID** (`CLAUDE_CODE_SESSION_ID`, the
49
- * Codex session id, or a `fallback:<host>:<workspaceId>` when none is readable).
50
- * `workspaceId` is recorded on the binding for audit but is NOT part of the
51
- * match: keying on it collapsed two concurrent conversations in one repo onto a
52
- * single id + inbox (the BR25 collision). Two conversations → two ids; a resumed
53
- * conversation reclaims its id (same UUID), still gated by proof-of-possession in
54
- * `reclaimOrMint`.
55
- */
56
- export declare function findBinding(root: string, key: IdentityBindingKey): H2AIdentityBinding | undefined;
57
- /**
58
- * Verify a reclaim proof: `signature` over `nonce` must verify against ANY of
59
- * the agent's active public keys. Total — never throws.
60
- */
61
- export declare function verifyReclaimProof(nonce: string, signature: H2ASignature, publicKeys: readonly string[]): boolean;
62
- export interface ReclaimOrMintDeps {
63
- /** PoP: true iff the connector proved possession of the bound instance's key. */
64
- verifyProof(binding: H2AIdentityBinding): boolean;
65
- /** Mint a fresh identity (new uuid + derived instance) when no reclaim. */
66
- mint(): {
67
- instance: string;
68
- agentUuid: string;
69
- };
70
- now(): number;
71
- }
72
- export interface ReclaimOrMintResult {
73
- readonly action: "reclaim" | "mint";
74
- readonly instance: string;
75
- readonly agentUuid: string;
76
- }
77
- /**
78
- * Atomically (one lock) reclaim the existing binding iff it exists AND
79
- * proof-of-possession passes; otherwise mint a fresh identity and record the new
80
- * binding. Spoofing the id without the key → mint (a new identity), never a
81
- * reclaim of someone else's.
82
- */
83
- export declare function reclaimOrMint(root: string, key: IdentityBindingKey, deps: ReclaimOrMintDeps): ReclaimOrMintResult;
84
- //# sourceMappingURL=bindings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bindings.d.ts","sourceRoot":"","sources":["../../../src/runtime/identity/bindings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAKH,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAIpE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;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iBAAiB,GACtB,mBAAmB,CAerB"}
@@ -1,112 +0,0 @@
1
- /**
2
- * Identity binding registry + proof-of-possession (DEC-116 F1 security core;
3
- * stability unit RE-ANCHORED 2026-06-07 — supersedes the per-workspace choice).
4
- *
5
- * Reconnect de-collision binds the perennial identity to its stability unit
6
- * `(host, providerSessionId)` — the provider **conversation UUID**
7
- * (`CLAUDE_CODE_SESSION_ID`, the Codex session id, …). One identity per live
8
- * conversation: two concurrent conversations in the SAME workspace now get
9
- * DISTINCT ids (no shared inbox — the collision this re-anchor removes), and a
10
- * resume of the same conversation reclaims its id (the UUID survives resume).
11
- * `workspaceId` is recorded as metadata only — NOT the match key. Keying on it
12
- * (the prior design) collapsed concurrent agents in one repo onto one inbox; the
13
- * per-session granularity is intended now, with dead ids reaped via presence TTL
14
- * + discover=live-only rather than prevented. An agent with no readable
15
- * conversation UUID is given a per-workspace fallback id
16
- * (`fallback:<host>:<workspaceId>` by the caller), so that degenerate case keeps
17
- * the old per-workspace behavior.
18
- *
19
- * **RECLAIM requires proof-of-possession**: the connector must sign a fresh
20
- * nonce with the ed25519 key already bound to that identity (verified against
21
- * the instance's active keys). The provider session id is a spoofable *routing
22
- * hint* — never the authenticator. No valid signature → **MINT** a fresh
23
- * identity (so a process presenting a victim's id, without the key, gets a new
24
- * identity, not the victim's inbox). The read → decide → append runs in ONE lock
25
- * (no reclaim/mint race, F3).
26
- */
27
- import { appendFileSync, existsSync, mkdirSync, readFileSync } from "node:fs";
28
- import { join } from "node:path";
29
- import { verifyCanonical } from "@sentropic/h2a";
30
- import { localStorePaths, withLockSync } from "../local-files/index.js";
31
- function identityDir(root) {
32
- return join(localStorePaths(root).root, "identity");
33
- }
34
- function bindingsFile(root) {
35
- return join(identityDir(root), "bindings.jsonl");
36
- }
37
- function bindingsLock(root) {
38
- return join(identityDir(root), ".lock");
39
- }
40
- export function listBindings(root) {
41
- const f = bindingsFile(root);
42
- if (!existsSync(f))
43
- return [];
44
- const out = [];
45
- for (const line of readFileSync(f, "utf8").split("\n")) {
46
- if (!line.trim())
47
- continue;
48
- try {
49
- out.push(JSON.parse(line));
50
- }
51
- catch {
52
- // skip malformed
53
- }
54
- }
55
- return out;
56
- }
57
- /**
58
- * The latest binding for the identity's stability unit
59
- * `(host, providerSessionId)` (append-only → last wins), or undefined.
60
- *
61
- * The match is the provider **conversation UUID** (`CLAUDE_CODE_SESSION_ID`, the
62
- * Codex session id, or a `fallback:<host>:<workspaceId>` when none is readable).
63
- * `workspaceId` is recorded on the binding for audit but is NOT part of the
64
- * match: keying on it collapsed two concurrent conversations in one repo onto a
65
- * single id + inbox (the BR25 collision). Two conversations → two ids; a resumed
66
- * conversation reclaims its id (same UUID), still gated by proof-of-possession in
67
- * `reclaimOrMint`.
68
- */
69
- export function findBinding(root, key) {
70
- let found;
71
- for (const b of listBindings(root)) {
72
- if (b.host === key.host && b.providerSessionId === key.providerSessionId) {
73
- found = b;
74
- }
75
- }
76
- return found;
77
- }
78
- /**
79
- * Verify a reclaim proof: `signature` over `nonce` must verify against ANY of
80
- * the agent's active public keys. Total — never throws.
81
- */
82
- export function verifyReclaimProof(nonce, signature, publicKeys) {
83
- for (const pem of publicKeys) {
84
- try {
85
- if (verifyCanonical(nonce, signature, pem))
86
- return true;
87
- }
88
- catch {
89
- // try the next active key
90
- }
91
- }
92
- return false;
93
- }
94
- /**
95
- * Atomically (one lock) reclaim the existing binding iff it exists AND
96
- * proof-of-possession passes; otherwise mint a fresh identity and record the new
97
- * binding. Spoofing the id without the key → mint (a new identity), never a
98
- * reclaim of someone else's.
99
- */
100
- export function reclaimOrMint(root, key, deps) {
101
- mkdirSync(identityDir(root), { recursive: true });
102
- return withLockSync(bindingsLock(root), () => {
103
- const existing = findBinding(root, key);
104
- if (existing && deps.verifyProof(existing)) {
105
- return { action: "reclaim", instance: existing.instance, agentUuid: existing.agentUuid };
106
- }
107
- const minted = deps.mint();
108
- appendFileSync(bindingsFile(root), `${JSON.stringify({ ...key, instance: minted.instance, agentUuid: minted.agentUuid, at: new Date(deps.now()).toISOString() })}\n`, "utf8");
109
- return { action: "mint", instance: minted.instance, agentUuid: minted.agentUuid };
110
- });
111
- }
112
- //# sourceMappingURL=bindings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bindings.js","sourceRoot":"","sources":["../../../src/runtime/identity/bindings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAqB,MAAM,gBAAgB,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAmBxE,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AACtD,CAAC;AACD,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC,CAAC;AACnD,CAAC;AACD,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC;IAC9B,MAAM,GAAG,GAAyB,EAAE,CAAC;IACrC,KAAK,MAAM,IAAI,IAAI,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACvD,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAAE,SAAS;QAC3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CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC3C,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;QAC3F,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC3B,cAAc,CACZ,YAAY,CAAC,IAAI,CAAC,EAClB,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,EAAE,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,WAAW,EAAE,EAA+B,CAAC,IAAI,EAC9J,MAAM,CACP,CAAC;QACF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC;IACpF,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,11 +0,0 @@
1
- export { resolveProviderSession } from "./resolver.js";
2
- export type { ProviderSession, ProviderSessionReaders, ProviderSessionSource, ResolveProviderSessionInput } from "./resolver.js";
3
- export { defaultProviderSessionReaders, readHostSessionName } from "./readers.js";
4
- export type { HostNameReaders } from "./readers.js";
5
- export { listBindings, findBinding, verifyReclaimProof, reclaimOrMint } from "./bindings.js";
6
- export type { H2AIdentityBinding, IdentityBindingKey, ReclaimOrMintDeps, ReclaimOrMintResult } from "./bindings.js";
7
- export { mergeInboxDedup, decideLegacyAdoption, listIdentityAliases, legacyAliasAlreadyAdopted, recordIdentityAlias } from "./migration.js";
8
- export type { H2AIdentityAlias, LegacyAdoptionInput, LegacyAdoptionDecision } from "./migration.js";
9
- export { resolveLiveIdentity } from "./live.js";
10
- export type { ResolveLiveIdentityInput, ResolvedLiveIdentity } from "./live.js";
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/identity/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,YAAY,EACV,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAClF,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,YAAY,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
@@ -1,6 +0,0 @@
1
- export { resolveProviderSession } from "./resolver.js";
2
- export { defaultProviderSessionReaders, readHostSessionName } from "./readers.js";
3
- export { listBindings, findBinding, verifyReclaimProof, reclaimOrMint } from "./bindings.js";
4
- export { mergeInboxDedup, decideLegacyAdoption, listIdentityAliases, legacyAliasAlreadyAdopted, recordIdentityAlias } from "./migration.js";
5
- export { resolveLiveIdentity } from "./live.js";
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/identity/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAOvD,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAElF,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,aAAa,EACd,MAAM,eAAe,CAAC;AAOvB,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AAMxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC"}
@@ -1,26 +0,0 @@
1
- import { type H2AWorkspaceRef } from "@sentropic/h2a";
2
- import { type ProviderSessionReaders } from "./resolver.js";
3
- export interface ResolveLiveIdentityInput {
4
- readonly root: string;
5
- readonly host: string;
6
- readonly cwd: string;
7
- readonly explicitInstance?: string;
8
- readonly name?: string;
9
- readonly scopes?: readonly string[];
10
- readonly readers?: ProviderSessionReaders;
11
- readonly now?: () => number;
12
- }
13
- export interface ResolvedLiveIdentity {
14
- readonly instance: string;
15
- readonly host: string;
16
- readonly workspace?: H2AWorkspaceRef;
17
- readonly name?: string;
18
- readonly legacyInstance?: string;
19
- readonly action: "override" | "reclaim" | "mint";
20
- readonly providerSessionSource?: string;
21
- readonly privateKeyPath?: string;
22
- readonly publicKeyPath?: string;
23
- readonly migrationNotice?: string;
24
- }
25
- export declare function resolveLiveIdentity(input: ResolveLiveIdentityInput): ResolvedLiveIdentity;
26
- //# sourceMappingURL=live.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../../../src/runtime/identity/live.ts"],"names":[],"mappings":"AAYA,OAAO,EAML,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AAUxB,OAAO,EAA0B,KAAK,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAGpF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IA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