@cortexkit/opencode-antigravity-auth 2.2.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (957) hide show
  1. package/README.md +95 -89
  2. package/dist/cli.js +18469 -810
  3. package/dist/cli.js.map +4 -4
  4. package/dist/cli.meta.json +4079 -0
  5. package/dist/index.js +40923 -16450
  6. package/dist/index.js.map +4 -4
  7. package/dist/index.meta.json +6949 -0
  8. package/dist/server.js +50948 -0
  9. package/dist/server.js.map +7 -0
  10. package/dist/server.meta.json +7284 -0
  11. package/dist/src/cli.d.ts +46 -1
  12. package/dist/src/cli.d.ts.map +1 -1
  13. package/dist/src/cli.js +207 -2
  14. package/dist/src/cli.js.map +1 -1
  15. package/dist/src/common-auth-embedded/NOTICE.txt +21 -0
  16. package/dist/src/common-auth-embedded/auth-menu/accounts.d.ts +97 -0
  17. package/dist/src/common-auth-embedded/auth-menu/accounts.js +387 -0
  18. package/dist/src/common-auth-embedded/auth-menu/ansi.d.ts +26 -0
  19. package/dist/src/common-auth-embedded/auth-menu/ansi.js +98 -0
  20. package/dist/src/common-auth-embedded/auth-menu/confirm.d.ts +7 -0
  21. package/dist/src/common-auth-embedded/auth-menu/confirm.js +21 -0
  22. package/dist/src/common-auth-embedded/auth-menu/doctor.d.ts +52 -0
  23. package/dist/src/common-auth-embedded/auth-menu/doctor.js +81 -0
  24. package/dist/src/common-auth-embedded/auth-menu/index.d.ts +17 -0
  25. package/dist/src/common-auth-embedded/auth-menu/index.js +12 -0
  26. package/dist/src/common-auth-embedded/auth-menu/login.d.ts +55 -0
  27. package/dist/src/common-auth-embedded/auth-menu/login.js +83 -0
  28. package/dist/src/common-auth-embedded/auth-menu/menu.d.ts +59 -0
  29. package/dist/src/common-auth-embedded/auth-menu/menu.js +73 -0
  30. package/dist/src/common-auth-embedded/auth-menu/opencode-v1.d.ts +49 -0
  31. package/dist/src/common-auth-embedded/auth-menu/opencode-v1.js +47 -0
  32. package/dist/src/common-auth-embedded/auth-menu/select.d.ts +21 -0
  33. package/dist/src/common-auth-embedded/auth-menu/select.js +159 -0
  34. package/dist/src/common-auth-embedded/auth-menu/terminal.d.ts +43 -0
  35. package/dist/src/common-auth-embedded/auth-menu/terminal.js +19 -0
  36. package/dist/src/common-auth-embedded/claustrum/consumer.d.ts +102 -0
  37. package/dist/src/common-auth-embedded/claustrum/consumer.js +298 -0
  38. package/dist/src/common-auth-embedded/claustrum/custody.d.ts +175 -0
  39. package/dist/src/common-auth-embedded/claustrum/custody.js +354 -0
  40. package/dist/src/common-auth-embedded/claustrum/enrollment.d.ts +158 -0
  41. package/dist/src/common-auth-embedded/claustrum/enrollment.js +759 -0
  42. package/dist/src/common-auth-embedded/claustrum/errors.d.ts +16 -0
  43. package/dist/src/common-auth-embedded/claustrum/errors.js +8 -0
  44. package/dist/src/common-auth-embedded/claustrum/host-slot.d.ts +39 -0
  45. package/dist/src/common-auth-embedded/claustrum/host-slot.js +72 -0
  46. package/dist/src/common-auth-embedded/claustrum/index.d.ts +18 -0
  47. package/dist/src/common-auth-embedded/claustrum/index.js +22 -0
  48. package/dist/src/common-auth-embedded/claustrum/interlock.d.ts +27 -0
  49. package/dist/src/common-auth-embedded/claustrum/interlock.js +29 -0
  50. package/dist/src/common-auth-embedded/claustrum/roster.d.ts +208 -0
  51. package/dist/src/common-auth-embedded/claustrum/roster.js +536 -0
  52. package/dist/src/common-auth-embedded/commands/builtins.d.ts +71 -0
  53. package/dist/src/common-auth-embedded/commands/builtins.js +534 -0
  54. package/dist/src/common-auth-embedded/commands/index.d.ts +10 -0
  55. package/dist/src/common-auth-embedded/commands/index.js +5 -0
  56. package/dist/src/common-auth-embedded/commands/menu.d.ts +61 -0
  57. package/dist/src/common-auth-embedded/commands/menu.js +300 -0
  58. package/dist/src/common-auth-embedded/commands/model.d.ts +238 -0
  59. package/dist/src/common-auth-embedded/commands/model.js +16 -0
  60. package/dist/src/common-auth-embedded/commands/pi.d.ts +23 -0
  61. package/dist/src/common-auth-embedded/commands/pi.js +206 -0
  62. package/dist/src/common-auth-embedded/commands/seam.d.ts +72 -0
  63. package/dist/src/common-auth-embedded/commands/seam.js +301 -0
  64. package/dist/src/common-auth-embedded/fs/atomic-write.d.ts +20 -0
  65. package/dist/src/common-auth-embedded/fs/atomic-write.js +80 -0
  66. package/dist/src/common-auth-embedded/fs/index.d.ts +7 -0
  67. package/dist/src/common-auth-embedded/fs/index.js +6 -0
  68. package/dist/src/common-auth-embedded/fs/lock-constants.d.ts +14 -0
  69. package/dist/src/common-auth-embedded/fs/lock-constants.js +14 -0
  70. package/dist/src/common-auth-embedded/fs/refresh-file-lock.d.ts +33 -0
  71. package/dist/src/common-auth-embedded/fs/refresh-file-lock.js +501 -0
  72. package/dist/src/common-auth-embedded/fs/with-lock.d.ts +33 -0
  73. package/dist/src/common-auth-embedded/fs/with-lock.js +48 -0
  74. package/dist/src/common-auth-embedded/logger/capture-sink.d.ts +14 -0
  75. package/dist/src/common-auth-embedded/logger/capture-sink.js +13 -0
  76. package/dist/src/common-auth-embedded/logger/engine.d.ts +100 -0
  77. package/dist/src/common-auth-embedded/logger/engine.js +246 -0
  78. package/dist/src/common-auth-embedded/logger/index.d.ts +6 -0
  79. package/dist/src/common-auth-embedded/logger/index.js +3 -0
  80. package/dist/src/common-auth-embedded/logger/redact.d.ts +11 -0
  81. package/dist/src/common-auth-embedded/logger/redact.js +83 -0
  82. package/dist/src/common-auth-embedded/opencode2/errors.d.ts +25 -0
  83. package/dist/src/common-auth-embedded/opencode2/errors.js +15 -0
  84. package/dist/src/common-auth-embedded/opencode2/index.d.ts +8 -0
  85. package/dist/src/common-auth-embedded/opencode2/index.js +4 -0
  86. package/dist/src/common-auth-embedded/opencode2/install.d.ts +55 -0
  87. package/dist/src/common-auth-embedded/opencode2/install.js +886 -0
  88. package/dist/src/common-auth-embedded/opencode2/integration.d.ts +112 -0
  89. package/dist/src/common-auth-embedded/opencode2/integration.js +143 -0
  90. package/dist/src/common-auth-embedded/opencode2/sse.d.ts +12 -0
  91. package/dist/src/common-auth-embedded/opencode2/sse.js +60 -0
  92. package/dist/src/common-auth-embedded/opencode2/types.d.ts +413 -0
  93. package/dist/src/common-auth-embedded/pi-slot/index.d.ts +3 -0
  94. package/dist/src/common-auth-embedded/pi-slot/index.js +2 -0
  95. package/dist/src/common-auth-embedded/pi-slot/lock.js +212 -0
  96. package/dist/src/common-auth-embedded/pi-slot/slot.d.ts +49 -0
  97. package/dist/src/common-auth-embedded/pi-slot/slot.js +383 -0
  98. package/dist/src/common-auth-embedded/quota/codec.d.ts +11 -0
  99. package/dist/src/common-auth-embedded/quota/codec.js +12 -0
  100. package/dist/src/common-auth-embedded/quota/format.d.ts +46 -0
  101. package/dist/src/common-auth-embedded/quota/format.js +138 -0
  102. package/dist/src/common-auth-embedded/quota/index.d.ts +10 -0
  103. package/dist/src/common-auth-embedded/quota/index.js +5 -0
  104. package/dist/src/common-auth-embedded/quota/map.d.ts +63 -0
  105. package/dist/src/common-auth-embedded/quota/map.js +105 -0
  106. package/dist/src/common-auth-embedded/quota/merge.d.ts +48 -0
  107. package/dist/src/common-auth-embedded/quota/merge.js +162 -0
  108. package/dist/src/common-auth-embedded/quota/projection.d.ts +64 -0
  109. package/dist/src/common-auth-embedded/quota/projection.js +134 -0
  110. package/dist/src/common-auth-embedded/routing/admission.d.ts +93 -0
  111. package/dist/src/common-auth-embedded/routing/admission.js +142 -0
  112. package/dist/src/common-auth-embedded/routing/index.d.ts +8 -0
  113. package/dist/src/common-auth-embedded/routing/index.js +4 -0
  114. package/dist/src/common-auth-embedded/routing/ordered.d.ts +47 -0
  115. package/dist/src/common-auth-embedded/routing/ordered.js +58 -0
  116. package/dist/src/common-auth-embedded/routing/pins.d.ts +22 -0
  117. package/dist/src/common-auth-embedded/routing/pins.js +34 -0
  118. package/dist/src/common-auth-embedded/routing/sticky.d.ts +158 -0
  119. package/dist/src/common-auth-embedded/routing/sticky.js +339 -0
  120. package/dist/src/common-auth-embedded/rpc/client.d.ts +3 -0
  121. package/dist/src/common-auth-embedded/rpc/client.js +2 -0
  122. package/dist/src/common-auth-embedded/rpc/index.d.ts +10 -0
  123. package/dist/src/common-auth-embedded/rpc/index.js +5 -0
  124. package/dist/src/common-auth-embedded/rpc/notifications.d.ts +73 -0
  125. package/dist/src/common-auth-embedded/rpc/notifications.js +100 -0
  126. package/dist/src/common-auth-embedded/rpc/port-file.d.ts +33 -0
  127. package/dist/src/common-auth-embedded/rpc/port-file.js +217 -0
  128. package/dist/src/common-auth-embedded/rpc/rpc-client.d.ts +30 -0
  129. package/dist/src/common-auth-embedded/rpc/rpc-client.js +253 -0
  130. package/dist/src/common-auth-embedded/rpc/rpc-server.d.ts +58 -0
  131. package/dist/src/common-auth-embedded/rpc/rpc-server.js +311 -0
  132. package/dist/src/common-auth-embedded/rpc/server-registry.d.ts +11 -0
  133. package/dist/src/common-auth-embedded/rpc/server-registry.js +47 -0
  134. package/dist/src/common-auth-embedded/source-output.json +1326 -0
  135. package/dist/src/common-auth-embedded/store/attribution.d.ts +28 -0
  136. package/dist/src/common-auth-embedded/store/attribution.js +60 -0
  137. package/dist/src/common-auth-embedded/store/errors.d.ts +55 -0
  138. package/dist/src/common-auth-embedded/store/errors.js +38 -0
  139. package/dist/src/common-auth-embedded/store/hooks.d.ts +12 -0
  140. package/dist/src/common-auth-embedded/store/hooks.js +34 -0
  141. package/dist/src/common-auth-embedded/store/identity.d.ts +39 -0
  142. package/dist/src/common-auth-embedded/store/identity.js +79 -0
  143. package/dist/src/common-auth-embedded/store/index.d.ts +21 -0
  144. package/dist/src/common-auth-embedded/store/index.js +7 -0
  145. package/dist/src/common-auth-embedded/store/mutate.d.ts +189 -0
  146. package/dist/src/common-auth-embedded/store/mutate.js +500 -0
  147. package/dist/src/common-auth-embedded/store/pool.d.ts +196 -0
  148. package/dist/src/common-auth-embedded/store/pool.js +120 -0
  149. package/dist/src/common-auth-embedded/store/provider-state.d.ts +131 -0
  150. package/dist/src/common-auth-embedded/store/provider-state.js +226 -0
  151. package/dist/src/common-auth-embedded/store/publication.d.ts +47 -0
  152. package/dist/src/common-auth-embedded/store/publication.js +304 -0
  153. package/dist/src/common-auth-embedded/store/pull.d.ts +36 -0
  154. package/dist/src/common-auth-embedded/store/pull.js +143 -0
  155. package/dist/src/common-auth-embedded/store/refresh-lock.d.ts +63 -0
  156. package/dist/src/common-auth-embedded/store/refresh-lock.js +136 -0
  157. package/dist/src/common-auth-embedded/store/refresh.d.ts +72 -0
  158. package/dist/src/common-auth-embedded/store/refresh.js +225 -0
  159. package/dist/src/common-auth-embedded/store/reserved.js +13 -0
  160. package/dist/src/common-auth-embedded/store/rows.d.ts +313 -0
  161. package/dist/src/common-auth-embedded/store/rows.js +1258 -0
  162. package/dist/src/common-auth-embedded/store/runtime.d.ts +36 -0
  163. package/dist/src/common-auth-embedded/store/runtime.js +68 -0
  164. package/dist/src/common-auth-embedded/store/schema.d.ts +443 -0
  165. package/dist/src/common-auth-embedded/store/schema.js +754 -0
  166. package/dist/src/common-auth-embedded/store/settings.d.ts +63 -0
  167. package/dist/src/common-auth-embedded/store/settings.js +120 -0
  168. package/dist/src/common-auth-embedded/store/torn.d.ts +78 -0
  169. package/dist/src/common-auth-embedded/store/torn.js +294 -0
  170. package/dist/src/common-auth-embedded/tui/index.d.ts +8 -0
  171. package/dist/src/common-auth-embedded/tui/index.js +21 -0
  172. package/dist/src/common-auth-embedded/util/any-signal.js +42 -0
  173. package/dist/src/constants.d.ts +1 -0
  174. package/dist/src/constants.d.ts.map +1 -1
  175. package/dist/src/constants.js +4 -0
  176. package/dist/src/constants.js.map +1 -1
  177. package/dist/src/ga/proxy-guard.d.ts +120 -0
  178. package/dist/src/ga/proxy-guard.d.ts.map +1 -0
  179. package/dist/src/ga/proxy-guard.js +269 -0
  180. package/dist/src/ga/proxy-guard.js.map +1 -0
  181. package/dist/src/ga/rpc/protocol.d.ts +504 -0
  182. package/dist/src/ga/rpc/protocol.d.ts.map +1 -0
  183. package/dist/src/ga/rpc/protocol.js +1278 -0
  184. package/dist/src/ga/rpc/protocol.js.map +1 -0
  185. package/dist/src/ga/server/auth.d.ts +9 -0
  186. package/dist/src/ga/server/auth.d.ts.map +1 -0
  187. package/dist/src/ga/server/auth.js +37 -0
  188. package/dist/src/ga/server/auth.js.map +1 -0
  189. package/dist/src/ga/server/index.d.ts +576 -0
  190. package/dist/src/ga/server/index.d.ts.map +1 -0
  191. package/dist/src/ga/server/index.js +1012 -0
  192. package/dist/src/ga/server/index.js.map +1 -0
  193. package/dist/src/ga/tui/host-ga.d.ts +350 -0
  194. package/dist/src/ga/tui/host-ga.d.ts.map +1 -0
  195. package/dist/src/ga/tui/host-ga.js +1242 -0
  196. package/dist/src/ga/tui/host-ga.js.map +1 -0
  197. package/dist/src/logging/provider-key-policy.d.ts +9 -0
  198. package/dist/src/logging/provider-key-policy.d.ts.map +1 -0
  199. package/dist/src/logging/provider-key-policy.js +11 -0
  200. package/dist/src/logging/provider-key-policy.js.map +1 -0
  201. package/dist/src/plugin/account-access.d.ts +130 -15
  202. package/dist/src/plugin/account-access.d.ts.map +1 -1
  203. package/dist/src/plugin/account-access.js +331 -129
  204. package/dist/src/plugin/account-access.js.map +1 -1
  205. package/dist/src/plugin/account-blocks.d.ts +102 -0
  206. package/dist/src/plugin/account-blocks.d.ts.map +1 -0
  207. package/dist/src/plugin/account-blocks.js +196 -0
  208. package/dist/src/plugin/account-blocks.js.map +1 -0
  209. package/dist/src/plugin/accounts.d.ts +85 -1
  210. package/dist/src/plugin/accounts.d.ts.map +1 -1
  211. package/dist/src/plugin/accounts.js +127 -3
  212. package/dist/src/plugin/accounts.js.map +1 -1
  213. package/dist/src/plugin/auth-loader.d.ts +69 -5
  214. package/dist/src/plugin/auth-loader.d.ts.map +1 -1
  215. package/dist/src/plugin/auth-loader.js +355 -52
  216. package/dist/src/plugin/auth-loader.js.map +1 -1
  217. package/dist/src/plugin/background-quota-refresh.d.ts +54 -8
  218. package/dist/src/plugin/background-quota-refresh.d.ts.map +1 -1
  219. package/dist/src/plugin/background-quota-refresh.js +81 -24
  220. package/dist/src/plugin/background-quota-refresh.js.map +1 -1
  221. package/dist/src/plugin/cache/index.d.ts +1 -1
  222. package/dist/src/plugin/cache/index.d.ts.map +1 -1
  223. package/dist/src/plugin/cache/index.js +1 -1
  224. package/dist/src/plugin/cache/index.js.map +1 -1
  225. package/dist/src/plugin/cache/signature-cache.d.ts +55 -10
  226. package/dist/src/plugin/cache/signature-cache.d.ts.map +1 -1
  227. package/dist/src/plugin/cache/signature-cache.js +100 -41
  228. package/dist/src/plugin/cache/signature-cache.js.map +1 -1
  229. package/dist/src/plugin/cache.d.ts +80 -16
  230. package/dist/src/plugin/cache.d.ts.map +1 -1
  231. package/dist/src/plugin/cache.js +339 -200
  232. package/dist/src/plugin/cache.js.map +1 -1
  233. package/dist/src/plugin/catalog.d.ts +4 -18
  234. package/dist/src/plugin/catalog.d.ts.map +1 -1
  235. package/dist/src/plugin/catalog.js +11 -41
  236. package/dist/src/plugin/catalog.js.map +1 -1
  237. package/dist/src/plugin/command-apply.d.ts +58 -0
  238. package/dist/src/plugin/command-apply.d.ts.map +1 -0
  239. package/dist/src/plugin/command-apply.js +168 -0
  240. package/dist/src/plugin/command-apply.js.map +1 -0
  241. package/dist/src/plugin/command-data.d.ts +1 -0
  242. package/dist/src/plugin/command-data.d.ts.map +1 -1
  243. package/dist/src/plugin/command-data.js +2 -0
  244. package/dist/src/plugin/command-data.js.map +1 -1
  245. package/dist/src/plugin/commands.d.ts +142 -132
  246. package/dist/src/plugin/commands.d.ts.map +1 -1
  247. package/dist/src/plugin/commands.js +214 -686
  248. package/dist/src/plugin/commands.js.map +1 -1
  249. package/dist/src/plugin/config/index.d.ts +1 -1
  250. package/dist/src/plugin/config/index.d.ts.map +1 -1
  251. package/dist/src/plugin/config/index.js +1 -1
  252. package/dist/src/plugin/config/index.js.map +1 -1
  253. package/dist/src/plugin/config/loader.d.ts +37 -1
  254. package/dist/src/plugin/config/loader.d.ts.map +1 -1
  255. package/dist/src/plugin/config/loader.js +64 -9
  256. package/dist/src/plugin/config/loader.js.map +1 -1
  257. package/dist/src/plugin/config/operator-settings-schema.d.ts +2 -2
  258. package/dist/src/plugin/config/schema.d.ts +2 -2
  259. package/dist/src/plugin/config/writer.d.ts +7 -0
  260. package/dist/src/plugin/config/writer.d.ts.map +1 -1
  261. package/dist/src/plugin/config/writer.js +10 -1
  262. package/dist/src/plugin/config/writer.js.map +1 -1
  263. package/dist/src/plugin/debug.d.ts +72 -29
  264. package/dist/src/plugin/debug.d.ts.map +1 -1
  265. package/dist/src/plugin/debug.js +353 -239
  266. package/dist/src/plugin/debug.js.map +1 -1
  267. package/dist/src/plugin/fetch/retry-state.d.ts +1 -1
  268. package/dist/src/plugin/fetch/retry-state.d.ts.map +1 -1
  269. package/dist/src/plugin/fetch/retry-state.js.map +1 -1
  270. package/dist/src/plugin/fetch-interceptor.d.ts +66 -11
  271. package/dist/src/plugin/fetch-interceptor.d.ts.map +1 -1
  272. package/dist/src/plugin/fetch-interceptor.js +228 -1347
  273. package/dist/src/plugin/fetch-interceptor.js.map +1 -1
  274. package/dist/src/plugin/fetch-routing.d.ts +7 -2
  275. package/dist/src/plugin/fetch-routing.d.ts.map +1 -1
  276. package/dist/src/plugin/fetch-routing.js +7 -4
  277. package/dist/src/plugin/fetch-routing.js.map +1 -1
  278. package/dist/src/plugin/ga-location-services.d.ts +389 -0
  279. package/dist/src/plugin/ga-location-services.d.ts.map +1 -0
  280. package/dist/src/plugin/ga-location-services.js +1838 -0
  281. package/dist/src/plugin/ga-location-services.js.map +1 -0
  282. package/dist/src/plugin/gemini-dump.d.ts +37 -12
  283. package/dist/src/plugin/gemini-dump.d.ts.map +1 -1
  284. package/dist/src/plugin/gemini-dump.js +42 -21
  285. package/dist/src/plugin/gemini-dump.js.map +1 -1
  286. package/dist/src/plugin/google-search-tool.d.ts +2 -1
  287. package/dist/src/plugin/google-search-tool.d.ts.map +1 -1
  288. package/dist/src/plugin/google-search-tool.js +4 -1
  289. package/dist/src/plugin/google-search-tool.js.map +1 -1
  290. package/dist/src/plugin/index.d.ts.map +1 -1
  291. package/dist/src/plugin/index.js +505 -141
  292. package/dist/src/plugin/index.js.map +1 -1
  293. package/dist/src/plugin/killswitch.d.ts +1 -2
  294. package/dist/src/plugin/killswitch.d.ts.map +1 -1
  295. package/dist/src/plugin/lifecycle.d.ts +24 -1
  296. package/dist/src/plugin/lifecycle.d.ts.map +1 -1
  297. package/dist/src/plugin/lifecycle.js +95 -8
  298. package/dist/src/plugin/lifecycle.js.map +1 -1
  299. package/dist/src/plugin/logger.d.ts +61 -10
  300. package/dist/src/plugin/logger.d.ts.map +1 -1
  301. package/dist/src/plugin/logger.js +134 -63
  302. package/dist/src/plugin/logger.js.map +1 -1
  303. package/dist/src/plugin/neutral-types.d.ts +42 -0
  304. package/dist/src/plugin/neutral-types.d.ts.map +1 -0
  305. package/dist/src/plugin/neutral-types.js +12 -0
  306. package/dist/src/plugin/neutral-types.js.map +1 -0
  307. package/dist/src/plugin/oauth-methods.d.ts +2 -1
  308. package/dist/src/plugin/oauth-methods.d.ts.map +1 -1
  309. package/dist/src/plugin/oauth-methods.js +173 -88
  310. package/dist/src/plugin/oauth-methods.js.map +1 -1
  311. package/dist/src/plugin/operator-settings.d.ts +34 -0
  312. package/dist/src/plugin/operator-settings.d.ts.map +1 -1
  313. package/dist/src/plugin/operator-settings.js +105 -2
  314. package/dist/src/plugin/operator-settings.js.map +1 -1
  315. package/dist/src/plugin/persist-account-pool.d.ts +63 -2
  316. package/dist/src/plugin/persist-account-pool.d.ts.map +1 -1
  317. package/dist/src/plugin/persist-account-pool.js +125 -2
  318. package/dist/src/plugin/persist-account-pool.js.map +1 -1
  319. package/dist/src/plugin/quota.d.ts +335 -35
  320. package/dist/src/plugin/quota.d.ts.map +1 -1
  321. package/dist/src/plugin/quota.js +825 -95
  322. package/dist/src/plugin/quota.js.map +1 -1
  323. package/dist/src/plugin/refresh-queue.d.ts +35 -5
  324. package/dist/src/plugin/refresh-queue.d.ts.map +1 -1
  325. package/dist/src/plugin/refresh-queue.js +50 -16
  326. package/dist/src/plugin/refresh-queue.js.map +1 -1
  327. package/dist/src/plugin/request-helpers.d.ts +30 -5
  328. package/dist/src/plugin/request-helpers.d.ts.map +1 -1
  329. package/dist/src/plugin/request-helpers.js +82 -17
  330. package/dist/src/plugin/request-helpers.js.map +1 -1
  331. package/dist/src/plugin/request.d.ts +63 -15
  332. package/dist/src/plugin/request.d.ts.map +1 -1
  333. package/dist/src/plugin/request.js +190 -60
  334. package/dist/src/plugin/request.js.map +1 -1
  335. package/dist/src/plugin/session-context.d.ts.map +1 -1
  336. package/dist/src/plugin/session-context.js +5 -2
  337. package/dist/src/plugin/session-context.js.map +1 -1
  338. package/dist/src/plugin/shared/local-grant.d.ts +26 -0
  339. package/dist/src/plugin/shared/local-grant.d.ts.map +1 -0
  340. package/dist/src/plugin/shared/local-grant.js +19 -0
  341. package/dist/src/plugin/shared/local-grant.js.map +1 -0
  342. package/dist/src/plugin/shared/request-cancellation.d.ts +12 -0
  343. package/dist/src/plugin/shared/request-cancellation.d.ts.map +1 -0
  344. package/dist/src/plugin/shared/request-cancellation.js +118 -0
  345. package/dist/src/plugin/shared/request-cancellation.js.map +1 -0
  346. package/dist/src/plugin/shared/request-services.d.ts +375 -0
  347. package/dist/src/plugin/shared/request-services.d.ts.map +1 -0
  348. package/dist/src/plugin/shared/request-services.js +1743 -0
  349. package/dist/src/plugin/shared/request-services.js.map +1 -0
  350. package/dist/src/plugin/shared/runtime.d.ts +217 -0
  351. package/dist/src/plugin/shared/runtime.d.ts.map +1 -0
  352. package/dist/src/plugin/shared/runtime.js +345 -0
  353. package/dist/src/plugin/shared/runtime.js.map +1 -0
  354. package/dist/src/plugin/shared/source-sidebar.d.ts +15 -0
  355. package/dist/src/plugin/shared/source-sidebar.d.ts.map +1 -0
  356. package/dist/src/plugin/shared/source-sidebar.js +41 -0
  357. package/dist/src/plugin/shared/source-sidebar.js.map +1 -0
  358. package/dist/src/plugin/shared/vault-menu.d.ts +5 -0
  359. package/dist/src/plugin/shared/vault-menu.d.ts.map +1 -0
  360. package/dist/src/plugin/shared/vault-menu.js +49 -0
  361. package/dist/src/plugin/shared/vault-menu.js.map +1 -0
  362. package/dist/src/plugin/shared/vault-request-credentials.d.ts +168 -0
  363. package/dist/src/plugin/shared/vault-request-credentials.d.ts.map +1 -0
  364. package/dist/src/plugin/shared/vault-request-credentials.js +485 -0
  365. package/dist/src/plugin/shared/vault-request-credentials.js.map +1 -0
  366. package/dist/src/plugin/storage.d.ts +127 -1
  367. package/dist/src/plugin/storage.d.ts.map +1 -1
  368. package/dist/src/plugin/storage.js +188 -3
  369. package/dist/src/plugin/storage.js.map +1 -1
  370. package/dist/src/plugin/token.d.ts +23 -1
  371. package/dist/src/plugin/token.d.ts.map +1 -1
  372. package/dist/src/plugin/token.js +117 -58
  373. package/dist/src/plugin/token.js.map +1 -1
  374. package/dist/src/plugin/ui/quota-status.d.ts +1 -10
  375. package/dist/src/plugin/ui/quota-status.d.ts.map +1 -1
  376. package/dist/src/plugin/ui/quota-status.js +6 -42
  377. package/dist/src/plugin/ui/quota-status.js.map +1 -1
  378. package/dist/src/plugin/vault-activation.d.ts +11 -0
  379. package/dist/src/plugin/vault-activation.d.ts.map +1 -0
  380. package/dist/src/plugin/vault-activation.js +53 -0
  381. package/dist/src/plugin/vault-activation.js.map +1 -0
  382. package/dist/src/plugin/vault-custody.d.ts +131 -0
  383. package/dist/src/plugin/vault-custody.d.ts.map +1 -0
  384. package/dist/src/plugin/vault-custody.js +381 -0
  385. package/dist/src/plugin/vault-custody.js.map +1 -0
  386. package/dist/src/quota-presentation.d.ts +18 -0
  387. package/dist/src/quota-presentation.d.ts.map +1 -0
  388. package/dist/src/quota-presentation.js +58 -0
  389. package/dist/src/quota-presentation.js.map +1 -0
  390. package/dist/src/rpc/notifications.d.ts +2 -2
  391. package/dist/src/rpc/notifications.d.ts.map +1 -1
  392. package/dist/src/rpc/notifications.js +1 -1
  393. package/dist/src/rpc/notifications.js.map +1 -1
  394. package/dist/src/rpc/port-file.d.ts +2 -12
  395. package/dist/src/rpc/port-file.d.ts.map +1 -1
  396. package/dist/src/rpc/port-file.js +5 -107
  397. package/dist/src/rpc/port-file.js.map +1 -1
  398. package/dist/src/rpc/protocol.d.ts +47 -16
  399. package/dist/src/rpc/protocol.d.ts.map +1 -1
  400. package/dist/src/rpc/rpc-client.d.ts +27 -3
  401. package/dist/src/rpc/rpc-client.d.ts.map +1 -1
  402. package/dist/src/rpc/rpc-client.js +55 -45
  403. package/dist/src/rpc/rpc-client.js.map +1 -1
  404. package/dist/src/rpc/rpc-server.d.ts +13 -2
  405. package/dist/src/rpc/rpc-server.d.ts.map +1 -1
  406. package/dist/src/rpc/rpc-server.js +38 -212
  407. package/dist/src/rpc/rpc-server.js.map +1 -1
  408. package/dist/src/server.d.ts +30 -0
  409. package/dist/src/server.d.ts.map +1 -0
  410. package/dist/src/server.js +29 -0
  411. package/dist/src/server.js.map +1 -0
  412. package/dist/src/sidebar-projection.d.ts +102 -0
  413. package/dist/src/sidebar-projection.d.ts.map +1 -0
  414. package/dist/src/sidebar-projection.js +146 -0
  415. package/dist/src/sidebar-projection.js.map +1 -0
  416. package/dist/src/sidebar-state.d.ts +13 -5
  417. package/dist/src/sidebar-state.d.ts.map +1 -1
  418. package/dist/src/sidebar-state.js +49 -16
  419. package/dist/src/sidebar-state.js.map +1 -1
  420. package/dist/src/tui/command-dialogs.d.ts +58 -52
  421. package/dist/src/tui/command-dialogs.d.ts.map +1 -1
  422. package/dist/src/tui/command-dialogs.js +379 -571
  423. package/dist/src/tui/command-dialogs.js.map +1 -1
  424. package/dist/src/tui/file-logger.d.ts +2 -3
  425. package/dist/src/tui/file-logger.d.ts.map +1 -1
  426. package/dist/src/tui/file-logger.js +21 -7
  427. package/dist/src/tui/file-logger.js.map +1 -1
  428. package/dist/src/tui/host-api.d.ts +196 -0
  429. package/dist/src/tui/host-api.d.ts.map +1 -0
  430. package/dist/src/tui/host-api.js +357 -0
  431. package/dist/src/tui/host-api.js.map +1 -0
  432. package/dist/src/tui/host-v1.d.ts +60 -0
  433. package/dist/src/tui/host-v1.d.ts.map +1 -0
  434. package/dist/src/tui/host-v1.js +147 -0
  435. package/dist/src/tui/host-v1.js.map +1 -0
  436. package/dist/src/tui/vault-setup.d.ts +98 -0
  437. package/dist/src/tui/vault-setup.d.ts.map +1 -0
  438. package/dist/src/tui/vault-setup.js +198 -0
  439. package/dist/src/tui/vault-setup.js.map +1 -0
  440. package/dist/src/tui.d.ts +4 -11
  441. package/dist/src/tui.d.ts.map +1 -1
  442. package/dist/src/tui.js +33 -75
  443. package/dist/src/tui.js.map +1 -1
  444. package/dist/tui-build-map.json +380 -0
  445. package/dist/tui-ga-build-map.json +187 -0
  446. package/dist/types/src/antigravity/oauth.d.ts +2 -0
  447. package/dist/types/src/antigravity/oauth.d.ts.map +1 -0
  448. package/dist/types/src/cli.d.ts +66 -0
  449. package/dist/types/src/cli.d.ts.map +1 -0
  450. package/dist/types/src/common-auth-embedded/commands/builtins.d.ts +71 -0
  451. package/dist/types/src/common-auth-embedded/commands/index.d.ts +10 -0
  452. package/dist/types/src/common-auth-embedded/commands/menu.d.ts +61 -0
  453. package/dist/types/src/common-auth-embedded/commands/model.d.ts +238 -0
  454. package/dist/types/src/common-auth-embedded/commands/pi.d.ts +23 -0
  455. package/dist/types/src/common-auth-embedded/commands/seam.d.ts +72 -0
  456. package/dist/types/src/common-auth-embedded/fs/refresh-file-lock.d.ts +33 -0
  457. package/dist/types/src/common-auth-embedded/logger/capture-sink.d.ts +14 -0
  458. package/dist/types/src/common-auth-embedded/logger/engine.d.ts +100 -0
  459. package/dist/types/src/common-auth-embedded/logger/index.d.ts +6 -0
  460. package/dist/types/src/common-auth-embedded/logger/redact.d.ts +11 -0
  461. package/dist/types/src/common-auth-embedded/quota/codec.d.ts +11 -0
  462. package/dist/types/src/common-auth-embedded/quota/format.d.ts +46 -0
  463. package/dist/types/src/common-auth-embedded/quota/index.d.ts +10 -0
  464. package/dist/types/src/common-auth-embedded/quota/map.d.ts +63 -0
  465. package/dist/types/src/common-auth-embedded/quota/merge.d.ts +48 -0
  466. package/dist/types/src/common-auth-embedded/quota/projection.d.ts +64 -0
  467. package/dist/types/src/common-auth-embedded/store/attribution.d.ts +28 -0
  468. package/dist/types/src/common-auth-embedded/store/errors.d.ts +55 -0
  469. package/dist/types/src/common-auth-embedded/store/hooks.d.ts +12 -0
  470. package/dist/types/src/common-auth-embedded/store/identity.d.ts +39 -0
  471. package/dist/types/src/common-auth-embedded/store/index.d.ts +21 -0
  472. package/dist/types/src/common-auth-embedded/store/mutate.d.ts +189 -0
  473. package/dist/types/src/common-auth-embedded/store/pool.d.ts +196 -0
  474. package/dist/types/src/common-auth-embedded/store/provider-state.d.ts +131 -0
  475. package/dist/types/src/common-auth-embedded/store/publication.d.ts +47 -0
  476. package/dist/types/src/common-auth-embedded/store/pull.d.ts +36 -0
  477. package/dist/types/src/common-auth-embedded/store/refresh-lock.d.ts +63 -0
  478. package/dist/types/src/common-auth-embedded/store/refresh.d.ts +72 -0
  479. package/dist/types/src/common-auth-embedded/store/rows.d.ts +313 -0
  480. package/dist/types/src/common-auth-embedded/store/runtime.d.ts +36 -0
  481. package/dist/types/src/common-auth-embedded/store/schema.d.ts +443 -0
  482. package/dist/types/src/common-auth-embedded/store/settings.d.ts +63 -0
  483. package/dist/types/src/common-auth-embedded/store/torn.d.ts +78 -0
  484. package/dist/types/src/constants.d.ts +3 -0
  485. package/dist/types/src/constants.d.ts.map +1 -0
  486. package/dist/types/src/ga/proxy-guard.d.ts +120 -0
  487. package/dist/types/src/ga/proxy-guard.d.ts.map +1 -0
  488. package/dist/types/src/ga/rpc/protocol.d.ts +504 -0
  489. package/dist/types/src/ga/rpc/protocol.d.ts.map +1 -0
  490. package/dist/types/src/ga/server/auth.d.ts +9 -0
  491. package/dist/types/src/ga/server/auth.d.ts.map +1 -0
  492. package/dist/types/src/ga/server/index.d.ts +576 -0
  493. package/dist/types/src/ga/server/index.d.ts.map +1 -0
  494. package/dist/types/src/hooks/auto-update-checker/cache.d.ts +3 -0
  495. package/dist/types/src/hooks/auto-update-checker/cache.d.ts.map +1 -0
  496. package/dist/types/src/hooks/auto-update-checker/checker.d.ts +16 -0
  497. package/dist/types/src/hooks/auto-update-checker/checker.d.ts.map +1 -0
  498. package/dist/types/src/hooks/auto-update-checker/constants.d.ts +9 -0
  499. package/dist/types/src/hooks/auto-update-checker/constants.d.ts.map +1 -0
  500. package/dist/types/src/hooks/auto-update-checker/index.d.ts +34 -0
  501. package/dist/types/src/hooks/auto-update-checker/index.d.ts.map +1 -0
  502. package/dist/types/src/hooks/auto-update-checker/logging.d.ts +3 -0
  503. package/dist/types/src/hooks/auto-update-checker/logging.d.ts.map +1 -0
  504. package/dist/types/src/hooks/auto-update-checker/types.d.ts +25 -0
  505. package/dist/types/src/hooks/auto-update-checker/types.d.ts.map +1 -0
  506. package/dist/types/src/logging/provider-key-policy.d.ts +9 -0
  507. package/dist/types/src/logging/provider-key-policy.d.ts.map +1 -0
  508. package/dist/types/src/plugin/account-access.d.ts +214 -0
  509. package/dist/types/src/plugin/account-access.d.ts.map +1 -0
  510. package/dist/types/src/plugin/account-blocks.d.ts +102 -0
  511. package/dist/types/src/plugin/account-blocks.d.ts.map +1 -0
  512. package/dist/types/src/plugin/account-command-oauth.d.ts +34 -0
  513. package/dist/types/src/plugin/account-command-oauth.d.ts.map +1 -0
  514. package/dist/types/src/plugin/accounts.d.ts +94 -0
  515. package/dist/types/src/plugin/accounts.d.ts.map +1 -0
  516. package/dist/types/src/plugin/agy-request-metadata.d.ts +2 -0
  517. package/dist/types/src/plugin/agy-request-metadata.d.ts.map +1 -0
  518. package/dist/types/src/plugin/agy-transport.d.ts +2 -0
  519. package/dist/types/src/plugin/agy-transport.d.ts.map +1 -0
  520. package/dist/types/src/plugin/auth-doctor.d.ts +30 -0
  521. package/dist/types/src/plugin/auth-doctor.d.ts.map +1 -0
  522. package/dist/types/src/plugin/auth-drift.d.ts +13 -0
  523. package/dist/types/src/plugin/auth-drift.d.ts.map +1 -0
  524. package/dist/types/src/plugin/auth-loader.d.ts +114 -0
  525. package/dist/types/src/plugin/auth-loader.d.ts.map +1 -0
  526. package/dist/types/src/plugin/auth.d.ts +2 -0
  527. package/dist/types/src/plugin/auth.d.ts.map +1 -0
  528. package/dist/types/src/plugin/background-quota-refresh.d.ts +192 -0
  529. package/dist/types/src/plugin/background-quota-refresh.d.ts.map +1 -0
  530. package/dist/types/src/plugin/cache/signature-cache.d.ts +156 -0
  531. package/dist/types/src/plugin/cache/signature-cache.d.ts.map +1 -0
  532. package/dist/types/src/plugin/cache.d.ts +109 -0
  533. package/dist/types/src/plugin/cache.d.ts.map +1 -0
  534. package/dist/types/src/plugin/catalog.d.ts +9 -0
  535. package/dist/types/src/plugin/catalog.d.ts.map +1 -0
  536. package/dist/types/src/plugin/cli.d.ts +44 -0
  537. package/dist/types/src/plugin/cli.d.ts.map +1 -0
  538. package/dist/types/src/plugin/command-apply.d.ts +58 -0
  539. package/dist/types/src/plugin/command-apply.d.ts.map +1 -0
  540. package/dist/types/src/plugin/command-data.d.ts +330 -0
  541. package/dist/types/src/plugin/command-data.d.ts.map +1 -0
  542. package/dist/types/src/plugin/commands.d.ts +164 -0
  543. package/dist/types/src/plugin/commands.d.ts.map +1 -0
  544. package/dist/types/src/plugin/config/index.d.ts +16 -0
  545. package/dist/types/src/plugin/config/index.d.ts.map +1 -0
  546. package/dist/types/src/plugin/config/loader.d.ts +72 -0
  547. package/dist/types/src/plugin/config/loader.d.ts.map +1 -0
  548. package/dist/types/src/plugin/config/models.d.ts +3 -0
  549. package/dist/types/src/plugin/config/models.d.ts.map +1 -0
  550. package/dist/types/src/plugin/config/operator-settings-schema.d.ts +29 -0
  551. package/dist/types/src/plugin/config/operator-settings-schema.d.ts.map +1 -0
  552. package/dist/types/src/plugin/config/schema.d.ts +162 -0
  553. package/dist/types/src/plugin/config/schema.d.ts.map +1 -0
  554. package/dist/types/src/plugin/config/updater.d.ts +55 -0
  555. package/dist/types/src/plugin/config/updater.d.ts.map +1 -0
  556. package/dist/types/src/plugin/config/writer.d.ts +41 -0
  557. package/dist/types/src/plugin/config/writer.d.ts.map +1 -0
  558. package/dist/types/src/plugin/core/streaming/index.d.ts +3 -0
  559. package/dist/types/src/plugin/core/streaming/index.d.ts.map +1 -0
  560. package/dist/types/src/plugin/core/streaming/transformer.d.ts +12 -0
  561. package/dist/types/src/plugin/core/streaming/transformer.d.ts.map +1 -0
  562. package/dist/types/src/plugin/core/streaming/types.d.ts +34 -0
  563. package/dist/types/src/plugin/core/streaming/types.d.ts.map +1 -0
  564. package/dist/types/src/plugin/debug.d.ts +144 -0
  565. package/dist/types/src/plugin/debug.d.ts.map +1 -0
  566. package/dist/types/src/plugin/dependencies.d.ts +129 -0
  567. package/dist/types/src/plugin/dependencies.d.ts.map +1 -0
  568. package/dist/types/src/plugin/errors.d.ts +55 -0
  569. package/dist/types/src/plugin/errors.d.ts.map +1 -0
  570. package/dist/types/src/plugin/event-handler.d.ts +53 -0
  571. package/dist/types/src/plugin/event-handler.d.ts.map +1 -0
  572. package/dist/types/src/plugin/fetch/retry-state.d.ts +61 -0
  573. package/dist/types/src/plugin/fetch/retry-state.d.ts.map +1 -0
  574. package/dist/types/src/plugin/fetch/warmup.d.ts +30 -0
  575. package/dist/types/src/plugin/fetch/warmup.d.ts.map +1 -0
  576. package/dist/types/src/plugin/fetch-interceptor.d.ts +114 -0
  577. package/dist/types/src/plugin/fetch-interceptor.d.ts.map +1 -0
  578. package/dist/types/src/plugin/fetch-routing.d.ts +31 -0
  579. package/dist/types/src/plugin/fetch-routing.d.ts.map +1 -0
  580. package/dist/types/src/plugin/fingerprint.d.ts +2 -0
  581. package/dist/types/src/plugin/fingerprint.d.ts.map +1 -0
  582. package/dist/types/src/plugin/ga-location-services.d.ts +389 -0
  583. package/dist/types/src/plugin/ga-location-services.d.ts.map +1 -0
  584. package/dist/types/src/plugin/gemini-dump.d.ts +72 -0
  585. package/dist/types/src/plugin/gemini-dump.d.ts.map +1 -0
  586. package/dist/types/src/plugin/google-search-tool.d.ts +10 -0
  587. package/dist/types/src/plugin/google-search-tool.d.ts.map +1 -0
  588. package/dist/types/src/plugin/image-saver.d.ts +6 -0
  589. package/dist/types/src/plugin/image-saver.d.ts.map +1 -0
  590. package/dist/types/src/plugin/index.d.ts +30 -0
  591. package/dist/types/src/plugin/index.d.ts.map +1 -0
  592. package/dist/types/src/plugin/killswitch.d.ts +93 -0
  593. package/dist/types/src/plugin/killswitch.d.ts.map +1 -0
  594. package/dist/types/src/plugin/lifecycle.d.ts +63 -0
  595. package/dist/types/src/plugin/lifecycle.d.ts.map +1 -0
  596. package/dist/types/src/plugin/logger.d.ts +83 -0
  597. package/dist/types/src/plugin/logger.d.ts.map +1 -0
  598. package/dist/types/src/plugin/logging-utils.d.ts +57 -0
  599. package/dist/types/src/plugin/logging-utils.d.ts.map +1 -0
  600. package/dist/types/src/plugin/model-registry.d.ts +2 -0
  601. package/dist/types/src/plugin/model-registry.d.ts.map +1 -0
  602. package/dist/types/src/plugin/neutral-types.d.ts +42 -0
  603. package/dist/types/src/plugin/neutral-types.d.ts.map +1 -0
  604. package/dist/types/src/plugin/oauth-login.d.ts +22 -0
  605. package/dist/types/src/plugin/oauth-login.d.ts.map +1 -0
  606. package/dist/types/src/plugin/oauth-methods.d.ts +43 -0
  607. package/dist/types/src/plugin/oauth-methods.d.ts.map +1 -0
  608. package/dist/types/src/plugin/operator-settings.d.ts +74 -0
  609. package/dist/types/src/plugin/operator-settings.d.ts.map +1 -0
  610. package/dist/types/src/plugin/persist-account-pool.d.ts +98 -0
  611. package/dist/types/src/plugin/persist-account-pool.d.ts.map +1 -0
  612. package/dist/types/src/plugin/project.d.ts +2 -0
  613. package/dist/types/src/plugin/project.d.ts.map +1 -0
  614. package/dist/types/src/plugin/prompt-context.d.ts +18 -0
  615. package/dist/types/src/plugin/prompt-context.d.ts.map +1 -0
  616. package/dist/types/src/plugin/quota.d.ts +441 -0
  617. package/dist/types/src/plugin/quota.d.ts.map +1 -0
  618. package/dist/types/src/plugin/recovery/constants.d.ts +22 -0
  619. package/dist/types/src/plugin/recovery/constants.d.ts.map +1 -0
  620. package/dist/types/src/plugin/recovery/storage.d.ts +24 -0
  621. package/dist/types/src/plugin/recovery/storage.d.ts.map +1 -0
  622. package/dist/types/src/plugin/recovery/types.d.ts +116 -0
  623. package/dist/types/src/plugin/recovery/types.d.ts.map +1 -0
  624. package/dist/types/src/plugin/recovery.d.ts +61 -0
  625. package/dist/types/src/plugin/recovery.d.ts.map +1 -0
  626. package/dist/types/src/plugin/refresh-queue.d.ts +133 -0
  627. package/dist/types/src/plugin/refresh-queue.d.ts.map +1 -0
  628. package/dist/types/src/plugin/request-helpers.d.ts +304 -0
  629. package/dist/types/src/plugin/request-helpers.d.ts.map +1 -0
  630. package/dist/types/src/plugin/request.d.ts +161 -0
  631. package/dist/types/src/plugin/request.d.ts.map +1 -0
  632. package/dist/types/src/plugin/rotation.d.ts +2 -0
  633. package/dist/types/src/plugin/rotation.d.ts.map +1 -0
  634. package/dist/types/src/plugin/search.d.ts +25 -0
  635. package/dist/types/src/plugin/search.d.ts.map +1 -0
  636. package/dist/types/src/plugin/server.d.ts +23 -0
  637. package/dist/types/src/plugin/server.d.ts.map +1 -0
  638. package/dist/types/src/plugin/session-context.d.ts +22 -0
  639. package/dist/types/src/plugin/session-context.d.ts.map +1 -0
  640. package/dist/types/src/plugin/shared/local-grant.d.ts +26 -0
  641. package/dist/types/src/plugin/shared/local-grant.d.ts.map +1 -0
  642. package/dist/types/src/plugin/shared/request-cancellation.d.ts +12 -0
  643. package/dist/types/src/plugin/shared/request-cancellation.d.ts.map +1 -0
  644. package/dist/types/src/plugin/shared/request-services.d.ts +375 -0
  645. package/dist/types/src/plugin/shared/request-services.d.ts.map +1 -0
  646. package/dist/types/src/plugin/shared/runtime.d.ts +217 -0
  647. package/dist/types/src/plugin/shared/runtime.d.ts.map +1 -0
  648. package/dist/types/src/plugin/shared/source-sidebar.d.ts +15 -0
  649. package/dist/types/src/plugin/shared/source-sidebar.d.ts.map +1 -0
  650. package/dist/types/src/plugin/shared/vault-menu.d.ts +5 -0
  651. package/dist/types/src/plugin/shared/vault-menu.d.ts.map +1 -0
  652. package/dist/types/src/plugin/shared/vault-request-credentials.d.ts +168 -0
  653. package/dist/types/src/plugin/shared/vault-request-credentials.d.ts.map +1 -0
  654. package/dist/types/src/plugin/storage.d.ts +221 -0
  655. package/dist/types/src/plugin/storage.d.ts.map +1 -0
  656. package/dist/types/src/plugin/stores/signature-store.d.ts +5 -0
  657. package/dist/types/src/plugin/stores/signature-store.d.ts.map +1 -0
  658. package/dist/types/src/plugin/thinking-recovery.d.ts +90 -0
  659. package/dist/types/src/plugin/thinking-recovery.d.ts.map +1 -0
  660. package/dist/types/src/plugin/token.d.ts +41 -0
  661. package/dist/types/src/plugin/token.d.ts.map +1 -0
  662. package/dist/types/src/plugin/transform/cross-model-sanitizer.d.ts +2 -0
  663. package/dist/types/src/plugin/transform/cross-model-sanitizer.d.ts.map +1 -0
  664. package/dist/types/src/plugin/transform/index.d.ts +2 -0
  665. package/dist/types/src/plugin/transform/index.d.ts.map +1 -0
  666. package/dist/types/src/plugin/transform/model-resolver.d.ts +2 -0
  667. package/dist/types/src/plugin/transform/model-resolver.d.ts.map +1 -0
  668. package/dist/types/src/plugin/transform/types.d.ts +2 -0
  669. package/dist/types/src/plugin/transform/types.d.ts.map +1 -0
  670. package/dist/types/src/plugin/types.d.ts +36 -0
  671. package/dist/types/src/plugin/types.d.ts.map +1 -0
  672. package/dist/types/src/plugin/ui/ansi.d.ts +32 -0
  673. package/dist/types/src/plugin/ui/ansi.d.ts.map +1 -0
  674. package/dist/types/src/plugin/ui/auth-menu.d.ts +59 -0
  675. package/dist/types/src/plugin/ui/auth-menu.d.ts.map +1 -0
  676. package/dist/types/src/plugin/ui/confirm.d.ts +2 -0
  677. package/dist/types/src/plugin/ui/confirm.d.ts.map +1 -0
  678. package/dist/types/src/plugin/ui/quota-status.d.ts +73 -0
  679. package/dist/types/src/plugin/ui/quota-status.d.ts.map +1 -0
  680. package/dist/types/src/plugin/ui/select.d.ts +23 -0
  681. package/dist/types/src/plugin/ui/select.d.ts.map +1 -0
  682. package/dist/types/src/plugin/vault-activation.d.ts +11 -0
  683. package/dist/types/src/plugin/vault-activation.d.ts.map +1 -0
  684. package/dist/types/src/plugin/vault-custody.d.ts +131 -0
  685. package/dist/types/src/plugin/vault-custody.d.ts.map +1 -0
  686. package/dist/types/src/plugin/version.d.ts +2 -0
  687. package/dist/types/src/plugin/version.d.ts.map +1 -0
  688. package/dist/types/src/quota-presentation.d.ts +18 -0
  689. package/dist/types/src/quota-presentation.d.ts.map +1 -0
  690. package/dist/types/src/rpc/notifications.d.ts +6 -0
  691. package/dist/types/src/rpc/notifications.d.ts.map +1 -0
  692. package/dist/types/src/rpc/protocol.d.ts +53 -0
  693. package/dist/types/src/rpc/protocol.d.ts.map +1 -0
  694. package/dist/types/src/rpc/rpc-dir.d.ts +4 -0
  695. package/dist/types/src/rpc/rpc-dir.d.ts.map +1 -0
  696. package/dist/types/src/rpc/rpc-server.d.ts +24 -0
  697. package/dist/types/src/rpc/rpc-server.d.ts.map +1 -0
  698. package/dist/types/src/server.d.ts +30 -0
  699. package/dist/types/src/server.d.ts.map +1 -0
  700. package/dist/types/src/sidebar-state.d.ts +365 -0
  701. package/dist/types/src/sidebar-state.d.ts.map +1 -0
  702. package/dist/types/src/tui/host-api.d.ts +196 -0
  703. package/dist/types/src/tui/host-api.d.ts.map +1 -0
  704. package/package.json +45 -18
  705. package/server.js +6 -0
  706. package/src/common-auth-embedded/NOTICE.txt +21 -0
  707. package/src/common-auth-embedded/auth-menu/accounts.d.ts +97 -0
  708. package/src/common-auth-embedded/auth-menu/accounts.js +387 -0
  709. package/src/common-auth-embedded/auth-menu/ansi.d.ts +26 -0
  710. package/src/common-auth-embedded/auth-menu/ansi.js +98 -0
  711. package/src/common-auth-embedded/auth-menu/confirm.d.ts +7 -0
  712. package/src/common-auth-embedded/auth-menu/confirm.js +21 -0
  713. package/src/common-auth-embedded/auth-menu/doctor.d.ts +52 -0
  714. package/src/common-auth-embedded/auth-menu/doctor.js +81 -0
  715. package/src/common-auth-embedded/auth-menu/index.d.ts +17 -0
  716. package/src/common-auth-embedded/auth-menu/index.js +12 -0
  717. package/src/common-auth-embedded/auth-menu/login.d.ts +55 -0
  718. package/src/common-auth-embedded/auth-menu/login.js +83 -0
  719. package/src/common-auth-embedded/auth-menu/menu.d.ts +59 -0
  720. package/src/common-auth-embedded/auth-menu/menu.js +73 -0
  721. package/src/common-auth-embedded/auth-menu/opencode-v1.d.ts +49 -0
  722. package/src/common-auth-embedded/auth-menu/opencode-v1.js +47 -0
  723. package/src/common-auth-embedded/auth-menu/select.d.ts +21 -0
  724. package/src/common-auth-embedded/auth-menu/select.js +159 -0
  725. package/src/common-auth-embedded/auth-menu/terminal.d.ts +43 -0
  726. package/src/common-auth-embedded/auth-menu/terminal.js +19 -0
  727. package/src/common-auth-embedded/claustrum/consumer.d.ts +102 -0
  728. package/src/common-auth-embedded/claustrum/consumer.js +298 -0
  729. package/src/common-auth-embedded/claustrum/custody.d.ts +175 -0
  730. package/src/common-auth-embedded/claustrum/custody.js +354 -0
  731. package/src/common-auth-embedded/claustrum/enrollment.d.ts +158 -0
  732. package/src/common-auth-embedded/claustrum/enrollment.js +759 -0
  733. package/src/common-auth-embedded/claustrum/errors.d.ts +16 -0
  734. package/src/common-auth-embedded/claustrum/errors.js +8 -0
  735. package/src/common-auth-embedded/claustrum/host-slot.d.ts +39 -0
  736. package/src/common-auth-embedded/claustrum/host-slot.js +72 -0
  737. package/src/common-auth-embedded/claustrum/index.d.ts +18 -0
  738. package/src/common-auth-embedded/claustrum/index.js +22 -0
  739. package/src/common-auth-embedded/claustrum/interlock.d.ts +27 -0
  740. package/src/common-auth-embedded/claustrum/interlock.js +29 -0
  741. package/src/common-auth-embedded/claustrum/roster.d.ts +208 -0
  742. package/src/common-auth-embedded/claustrum/roster.js +536 -0
  743. package/src/common-auth-embedded/commands/builtins.d.ts +71 -0
  744. package/src/common-auth-embedded/commands/builtins.js +534 -0
  745. package/src/common-auth-embedded/commands/index.d.ts +10 -0
  746. package/src/common-auth-embedded/commands/index.js +5 -0
  747. package/src/common-auth-embedded/commands/menu.d.ts +61 -0
  748. package/src/common-auth-embedded/commands/menu.js +300 -0
  749. package/src/common-auth-embedded/commands/model.d.ts +238 -0
  750. package/src/common-auth-embedded/commands/model.js +16 -0
  751. package/src/common-auth-embedded/commands/pi.d.ts +23 -0
  752. package/src/common-auth-embedded/commands/pi.js +206 -0
  753. package/src/common-auth-embedded/commands/seam.d.ts +72 -0
  754. package/src/common-auth-embedded/commands/seam.js +301 -0
  755. package/src/common-auth-embedded/fs/atomic-write.d.ts +20 -0
  756. package/src/common-auth-embedded/fs/atomic-write.js +80 -0
  757. package/src/common-auth-embedded/fs/index.d.ts +7 -0
  758. package/src/common-auth-embedded/fs/index.js +6 -0
  759. package/src/common-auth-embedded/fs/lock-constants.d.ts +14 -0
  760. package/src/common-auth-embedded/fs/lock-constants.js +14 -0
  761. package/src/common-auth-embedded/fs/refresh-file-lock.d.ts +33 -0
  762. package/src/common-auth-embedded/fs/refresh-file-lock.js +501 -0
  763. package/src/common-auth-embedded/fs/with-lock.d.ts +33 -0
  764. package/src/common-auth-embedded/fs/with-lock.js +48 -0
  765. package/src/common-auth-embedded/logger/capture-sink.d.ts +14 -0
  766. package/src/common-auth-embedded/logger/capture-sink.js +13 -0
  767. package/src/common-auth-embedded/logger/engine.d.ts +100 -0
  768. package/src/common-auth-embedded/logger/engine.js +246 -0
  769. package/src/common-auth-embedded/logger/index.d.ts +6 -0
  770. package/src/common-auth-embedded/logger/index.js +3 -0
  771. package/src/common-auth-embedded/logger/redact.d.ts +11 -0
  772. package/src/common-auth-embedded/logger/redact.js +83 -0
  773. package/src/common-auth-embedded/opencode2/errors.d.ts +25 -0
  774. package/src/common-auth-embedded/opencode2/errors.js +15 -0
  775. package/src/common-auth-embedded/opencode2/index.d.ts +8 -0
  776. package/src/common-auth-embedded/opencode2/index.js +4 -0
  777. package/src/common-auth-embedded/opencode2/install.d.ts +55 -0
  778. package/src/common-auth-embedded/opencode2/install.js +886 -0
  779. package/src/common-auth-embedded/opencode2/integration.d.ts +112 -0
  780. package/src/common-auth-embedded/opencode2/integration.js +143 -0
  781. package/src/common-auth-embedded/opencode2/sse.d.ts +12 -0
  782. package/src/common-auth-embedded/opencode2/sse.js +60 -0
  783. package/src/common-auth-embedded/opencode2/types.d.ts +413 -0
  784. package/src/common-auth-embedded/pi-slot/index.d.ts +3 -0
  785. package/src/common-auth-embedded/pi-slot/index.js +2 -0
  786. package/src/common-auth-embedded/pi-slot/lock.js +212 -0
  787. package/src/common-auth-embedded/pi-slot/slot.d.ts +49 -0
  788. package/src/common-auth-embedded/pi-slot/slot.js +383 -0
  789. package/src/common-auth-embedded/quota/codec.d.ts +11 -0
  790. package/src/common-auth-embedded/quota/codec.js +12 -0
  791. package/src/common-auth-embedded/quota/format.d.ts +46 -0
  792. package/src/common-auth-embedded/quota/format.js +138 -0
  793. package/src/common-auth-embedded/quota/index.d.ts +10 -0
  794. package/src/common-auth-embedded/quota/index.js +5 -0
  795. package/src/common-auth-embedded/quota/map.d.ts +63 -0
  796. package/src/common-auth-embedded/quota/map.js +105 -0
  797. package/src/common-auth-embedded/quota/merge.d.ts +48 -0
  798. package/src/common-auth-embedded/quota/merge.js +162 -0
  799. package/src/common-auth-embedded/quota/projection.d.ts +64 -0
  800. package/src/common-auth-embedded/quota/projection.js +134 -0
  801. package/src/common-auth-embedded/routing/admission.d.ts +93 -0
  802. package/src/common-auth-embedded/routing/admission.js +142 -0
  803. package/src/common-auth-embedded/routing/index.d.ts +8 -0
  804. package/src/common-auth-embedded/routing/index.js +4 -0
  805. package/src/common-auth-embedded/routing/ordered.d.ts +47 -0
  806. package/src/common-auth-embedded/routing/ordered.js +58 -0
  807. package/src/common-auth-embedded/routing/pins.d.ts +22 -0
  808. package/src/common-auth-embedded/routing/pins.js +34 -0
  809. package/src/common-auth-embedded/routing/sticky.d.ts +158 -0
  810. package/src/common-auth-embedded/routing/sticky.js +339 -0
  811. package/src/common-auth-embedded/rpc/client.d.ts +3 -0
  812. package/src/common-auth-embedded/rpc/client.js +2 -0
  813. package/src/common-auth-embedded/rpc/index.d.ts +10 -0
  814. package/src/common-auth-embedded/rpc/index.js +5 -0
  815. package/src/common-auth-embedded/rpc/notifications.d.ts +73 -0
  816. package/src/common-auth-embedded/rpc/notifications.js +100 -0
  817. package/src/common-auth-embedded/rpc/port-file.d.ts +33 -0
  818. package/src/common-auth-embedded/rpc/port-file.js +217 -0
  819. package/src/common-auth-embedded/rpc/rpc-client.d.ts +30 -0
  820. package/src/common-auth-embedded/rpc/rpc-client.js +253 -0
  821. package/src/common-auth-embedded/rpc/rpc-server.d.ts +58 -0
  822. package/src/common-auth-embedded/rpc/rpc-server.js +311 -0
  823. package/src/common-auth-embedded/rpc/server-registry.d.ts +11 -0
  824. package/src/common-auth-embedded/rpc/server-registry.js +47 -0
  825. package/src/common-auth-embedded/source-output.json +1326 -0
  826. package/src/common-auth-embedded/store/attribution.d.ts +28 -0
  827. package/src/common-auth-embedded/store/attribution.js +60 -0
  828. package/src/common-auth-embedded/store/errors.d.ts +55 -0
  829. package/src/common-auth-embedded/store/errors.js +38 -0
  830. package/src/common-auth-embedded/store/hooks.d.ts +12 -0
  831. package/src/common-auth-embedded/store/hooks.js +34 -0
  832. package/src/common-auth-embedded/store/identity.d.ts +39 -0
  833. package/src/common-auth-embedded/store/identity.js +79 -0
  834. package/src/common-auth-embedded/store/index.d.ts +21 -0
  835. package/src/common-auth-embedded/store/index.js +7 -0
  836. package/src/common-auth-embedded/store/mutate.d.ts +189 -0
  837. package/src/common-auth-embedded/store/mutate.js +500 -0
  838. package/src/common-auth-embedded/store/pool.d.ts +196 -0
  839. package/src/common-auth-embedded/store/pool.js +120 -0
  840. package/src/common-auth-embedded/store/provider-state.d.ts +131 -0
  841. package/src/common-auth-embedded/store/provider-state.js +226 -0
  842. package/src/common-auth-embedded/store/publication.d.ts +47 -0
  843. package/src/common-auth-embedded/store/publication.js +304 -0
  844. package/src/common-auth-embedded/store/pull.d.ts +36 -0
  845. package/src/common-auth-embedded/store/pull.js +143 -0
  846. package/src/common-auth-embedded/store/refresh-lock.d.ts +63 -0
  847. package/src/common-auth-embedded/store/refresh-lock.js +136 -0
  848. package/src/common-auth-embedded/store/refresh.d.ts +72 -0
  849. package/src/common-auth-embedded/store/refresh.js +225 -0
  850. package/src/common-auth-embedded/store/reserved.js +13 -0
  851. package/src/common-auth-embedded/store/rows.d.ts +313 -0
  852. package/src/common-auth-embedded/store/rows.js +1258 -0
  853. package/src/common-auth-embedded/store/runtime.d.ts +36 -0
  854. package/src/common-auth-embedded/store/runtime.js +68 -0
  855. package/src/common-auth-embedded/store/schema.d.ts +443 -0
  856. package/src/common-auth-embedded/store/schema.js +754 -0
  857. package/src/common-auth-embedded/store/settings.d.ts +63 -0
  858. package/src/common-auth-embedded/store/settings.js +120 -0
  859. package/src/common-auth-embedded/store/torn.d.ts +78 -0
  860. package/src/common-auth-embedded/store/torn.js +294 -0
  861. package/src/common-auth-embedded/tui/index.d.ts +8 -0
  862. package/src/common-auth-embedded/tui/index.js +21 -0
  863. package/src/common-auth-embedded/util/any-signal.js +42 -0
  864. package/src/plugin/command-data.ts +3 -0
  865. package/src/rpc/port-file.ts +6 -140
  866. package/src/rpc/protocol.ts +59 -24
  867. package/src/rpc/rpc-client.ts +101 -71
  868. package/src/sidebar-state.ts +82 -24
  869. package/src/tui/command-dialogs.tsx +412 -776
  870. package/src/tui/entry.d.mts +17 -0
  871. package/src/tui/entry.mjs +34 -66
  872. package/src/tui/file-logger.ts +22 -7
  873. package/src/tui-compiled/common-auth-embedded/logger/capture-sink.js +13 -0
  874. package/src/tui-compiled/common-auth-embedded/logger/engine.js +246 -0
  875. package/src/tui-compiled/common-auth-embedded/logger/index.js +3 -0
  876. package/src/tui-compiled/common-auth-embedded/logger/redact.js +83 -0
  877. package/src/tui-compiled/common-auth-embedded/quota/codec.js +12 -0
  878. package/src/tui-compiled/common-auth-embedded/quota/format.js +138 -0
  879. package/src/tui-compiled/common-auth-embedded/quota/index.js +5 -0
  880. package/src/tui-compiled/common-auth-embedded/quota/map.js +105 -0
  881. package/src/tui-compiled/common-auth-embedded/quota/merge.js +162 -0
  882. package/src/tui-compiled/common-auth-embedded/quota/projection.js +134 -0
  883. package/src/tui-compiled/common-auth-embedded/rpc/client.js +2 -0
  884. package/src/tui-compiled/common-auth-embedded/rpc/port-file.js +217 -0
  885. package/src/tui-compiled/common-auth-embedded/rpc/rpc-client.js +253 -0
  886. package/src/tui-compiled/logging/provider-key-policy.js +3 -0
  887. package/src/tui-compiled/quota-presentation.js +42 -0
  888. package/src/tui-compiled/rpc/rpc-client.js +35 -0
  889. package/src/tui-compiled/rpc/rpc-dir.js +13 -0
  890. package/src/tui-compiled/selector.js +21 -0
  891. package/src/tui-compiled/sidebar-state.js +401 -0
  892. package/src/tui-compiled/tui/command-dialogs.js +424 -0
  893. package/src/tui-compiled/tui/file-logger.js +73 -0
  894. package/src/tui-compiled/tui/host-api.js +269 -0
  895. package/src/tui-compiled/tui/host-v1.js +228 -0
  896. package/src/tui-compiled/tui-preferences.js +230 -0
  897. package/src/tui-compiled/{tui.tsx → tui.js} +140 -231
  898. package/src/tui-ga-compiled/host-ga.js +1304 -0
  899. package/src/tui-ga-compiled/selector.js +21 -0
  900. package/src/tui-ga-compiled/shared/07365a7d2ccade4c-host-api.js +269 -0
  901. package/src/tui-ga-compiled/shared/0e19a88ff3535906-command-dialogs.js +424 -0
  902. package/src/tui-ga-compiled/shared/1ff34afa7c42d196-projection.js +134 -0
  903. package/src/tui-ga-compiled/shared/77138df80c7ae006-map.js +105 -0
  904. package/src/tui-ga-compiled/shared/8ae1927e5910ea81-sidebar-projection.js +112 -0
  905. package/src/tui-ga-compiled/shared/98cc0c186c46c42d-quota-presentation.js +42 -0
  906. package/src/tui-ga-compiled/shared/aef2402f8fc342f0-format.js +138 -0
  907. package/src/tui-ga-compiled/shared/bf17cbee28e58197-index.js +5 -0
  908. package/src/tui-ga-compiled/shared/ca21dc417b36dc5d-codec.js +12 -0
  909. package/src/tui-ga-compiled/shared/ecc214300932dfb6-merge.js +162 -0
  910. package/src/tui-ga-raw/host-ga.tsx +1740 -0
  911. package/src/tui-ga-raw/selector.js +21 -0
  912. package/src/tui-ga-raw/shared/07365a7d2ccade4c-host-api.js +269 -0
  913. package/src/tui-ga-raw/shared/0e19a88ff3535906-command-dialogs.tsx +468 -0
  914. package/src/tui-ga-raw/shared/1ff34afa7c42d196-projection.js +134 -0
  915. package/src/tui-ga-raw/shared/77138df80c7ae006-map.js +105 -0
  916. package/src/tui-ga-raw/shared/8ae1927e5910ea81-sidebar-projection.js +112 -0
  917. package/src/tui-ga-raw/shared/98cc0c186c46c42d-quota-presentation.js +42 -0
  918. package/src/tui-ga-raw/shared/aef2402f8fc342f0-format.js +138 -0
  919. package/src/tui-ga-raw/shared/bf17cbee28e58197-index.js +5 -0
  920. package/src/tui-ga-raw/shared/ca21dc417b36dc5d-codec.js +12 -0
  921. package/src/tui-ga-raw/shared/ecc214300932dfb6-merge.js +162 -0
  922. package/src/tui-raw/common-auth-embedded/logger/capture-sink.js +13 -0
  923. package/src/tui-raw/common-auth-embedded/logger/engine.js +246 -0
  924. package/src/tui-raw/common-auth-embedded/logger/index.js +3 -0
  925. package/src/tui-raw/common-auth-embedded/logger/redact.js +83 -0
  926. package/src/tui-raw/common-auth-embedded/quota/codec.js +12 -0
  927. package/src/tui-raw/common-auth-embedded/quota/format.js +138 -0
  928. package/src/tui-raw/common-auth-embedded/quota/index.js +5 -0
  929. package/src/tui-raw/common-auth-embedded/quota/map.js +105 -0
  930. package/src/tui-raw/common-auth-embedded/quota/merge.js +162 -0
  931. package/src/tui-raw/common-auth-embedded/quota/projection.js +134 -0
  932. package/src/tui-raw/common-auth-embedded/rpc/client.js +2 -0
  933. package/src/tui-raw/common-auth-embedded/rpc/port-file.js +217 -0
  934. package/src/tui-raw/common-auth-embedded/rpc/rpc-client.js +253 -0
  935. package/src/tui-raw/logging/provider-key-policy.js +3 -0
  936. package/src/tui-raw/quota-presentation.js +42 -0
  937. package/src/tui-raw/rpc/rpc-client.js +35 -0
  938. package/src/tui-raw/rpc/rpc-dir.js +13 -0
  939. package/src/tui-raw/selector.js +21 -0
  940. package/src/tui-raw/sidebar-state.js +401 -0
  941. package/src/tui-raw/tui/command-dialogs.tsx +468 -0
  942. package/src/tui-raw/tui/file-logger.js +73 -0
  943. package/src/tui-raw/tui/host-api.js +269 -0
  944. package/src/tui-raw/tui/host-v1.tsx +249 -0
  945. package/src/tui-raw/tui-preferences.js +230 -0
  946. package/src/tui-raw/tui.tsx +1088 -0
  947. package/src/tui.tsx +58 -141
  948. package/tui.js +6 -0
  949. package/src/tui-compiled/plugin/command-data.ts +0 -931
  950. package/src/tui-compiled/rpc/port-file.ts +0 -143
  951. package/src/tui-compiled/rpc/protocol.ts +0 -31
  952. package/src/tui-compiled/rpc/rpc-client.ts +0 -102
  953. package/src/tui-compiled/rpc/rpc-dir.ts +0 -24
  954. package/src/tui-compiled/sidebar-state.ts +0 -991
  955. package/src/tui-compiled/tui/command-dialogs.tsx +0 -779
  956. package/src/tui-compiled/tui/file-logger.ts +0 -145
  957. package/src/tui-compiled/tui-preferences.ts +0 -416
@@ -0,0 +1,102 @@
1
+ import type { ClaustrumReporterSource } from '@cortexkit/claustrum-client';
2
+ import type { QuotaObservation } from '../quota/index.js';
3
+ import type { RoutingRow } from '../routing/index.js';
4
+ import { type ClaustrumFamily, type ClaustrumScopedAttempt, type ClaustrumScopedClient, type IdentityParser } from './custody.js';
5
+ import { type ClaustrumLogger } from './errors.js';
6
+ import { type AccountMapper, type QuotaReceipt, type VaultRosterFile } from './roster.js';
7
+ export interface ClaustrumConsumerOptions {
8
+ /**
9
+ * The roster file: one row per vault account (route id, credential id,
10
+ * account identity, state, quota), plus the accounts the user declined. It
11
+ * never holds a token.
12
+ */
13
+ rosterPath: string;
14
+ /** This host's enrollment token, written by setup. */
15
+ tokenPath: string;
16
+ family: ClaustrumFamily;
17
+ connect: () => Promise<ClaustrumScopedClient>;
18
+ /**
19
+ * Whether the plugin currently takes its accounts from the vault (custody
20
+ * mode) rather than from local logins. Checked before every discovery,
21
+ * commit and dispatch; false closes the vault connection and refuses sends.
22
+ */
23
+ isCustodyActive?: () => boolean | Promise<boolean>;
24
+ /** Ids of the plugin's local pool rows; no vault route id may equal one. */
25
+ reservedRouteIds?: () => Iterable<string>;
26
+ routePrefix?: string;
27
+ mapAccount?: AccountMapper;
28
+ parseIdentity?: IdentityParser;
29
+ /**
30
+ * Issue a receipt only when the vault's served reply itself names the
31
+ * credential id and the roster's account identity (see
32
+ * `ClaustrumScopedCustody`). Set it for providers whose tokens do not reveal
33
+ * their account; leave it unset to accept a reply that asserts no identity.
34
+ */
35
+ requireAssertion?: boolean;
36
+ /**
37
+ * Fired once per change of the vault's view cursor, including the first
38
+ * roster. A poll that sees the same view does not fire, and neither does a
39
+ * routine token refresh, which never moves the view.
40
+ */
41
+ onRoster?: (roster: VaultRosterFile) => void;
42
+ onError?: (error: unknown) => void;
43
+ pollIntervalMs?: number;
44
+ setTimeoutImpl?: typeof setTimeout;
45
+ clearTimeoutImpl?: typeof clearTimeout;
46
+ now?: () => number;
47
+ logger?: ClaustrumLogger;
48
+ }
49
+ export interface SendOptions {
50
+ /**
51
+ * What kind of request this is (for example `model`, `quota`, `profile`),
52
+ * recorded in the 401 retry log line so a retry can be traced to its caller.
53
+ */
54
+ site: string;
55
+ signal?: AbortSignal;
56
+ reporterSource?: ClaustrumReporterSource;
57
+ }
58
+ /**
59
+ * One plugin host's view of its vault accounts. It turns vault credentials
60
+ * into rows for `/routing`, authorizes each physical send with the vault, and
61
+ * reports a 401 against the exact record version that send used. Metadata
62
+ * (the connection and discovery) is shared and coalesced; credential reads
63
+ * never are. It never enrolls: a missing token is an error here, and setup
64
+ * is where enrollment happens.
65
+ */
66
+ export declare class ClaustrumConsumer {
67
+ #private;
68
+ constructor(options: ClaustrumConsumerOptions);
69
+ /** The last committed roster this instance saw, without any I/O. */
70
+ snapshot(): VaultRosterFile | undefined;
71
+ /** Rows for `/routing`, from the last committed roster. */
72
+ routingRows(): RoutingRow[];
73
+ refresh(): Promise<VaultRosterFile | undefined>;
74
+ start(): void;
75
+ /**
76
+ * Authorize one physical send on a vault route. The roster file is re-read
77
+ * first, so a decline committed by another process applies before the next
78
+ * poll, and a route whose credential or account changed is refused.
79
+ */
80
+ authorize(routeId: string, signal?: AbortSignal): Promise<ClaustrumScopedAttempt>;
81
+ reportFailure(attempt: ClaustrumScopedAttempt, status: number, source: ClaustrumReporterSource): Promise<void>;
82
+ /**
83
+ * Send on a vault route. `dispatch` builds and sends the request with the
84
+ * receipt's token and may be called twice, so it must be able to rebuild
85
+ * its body. A 401 is retried once, and only when the vault now serves a new
86
+ * record version of the same credential and account; the final 401 is
87
+ * reported against the version that send actually used. Each call to
88
+ * `dispatch` gets its own receipt.
89
+ */
90
+ send(routeId: string, dispatch: (attempt: ClaustrumScopedAttempt, signal?: AbortSignal) => Promise<Response>, options: SendOptions): Promise<Response>;
91
+ /** Decline a vault account: it stays listed and never routes until accepted. */
92
+ decline(routeId: string): Promise<void>;
93
+ accept(routeId: string): Promise<void>;
94
+ /**
95
+ * Store a quota or profile observation for a vault route. The receipt the
96
+ * reading was taken with is required: the observation lands only while the
97
+ * route still holds the credential and account that receipt was served for
98
+ * (see `recordVaultQuota`), so a reading for a replaced account is dropped.
99
+ */
100
+ recordQuota(routeId: string, observation: QuotaObservation, attempt: QuotaReceipt): Promise<boolean>;
101
+ close(): void;
102
+ }
@@ -0,0 +1,298 @@
1
+ import { createLogger } from '../logger/index.js';
2
+ import { combineAbortSignals } from '../util/any-signal.js';
3
+ import { ClaustrumScopedCustody, decideScopedRetryAfter401, } from './custody.js';
4
+ import { ClaustrumConsumerError } from './errors.js';
5
+ import { acceptVaultRoute, declineVaultRoute, readVaultRoster, recordVaultQuota, refreshVaultRoster, vaultRoutingRows, } from './roster.js';
6
+ /**
7
+ * One plugin host's view of its vault accounts. It turns vault credentials
8
+ * into rows for `/routing`, authorizes each physical send with the vault, and
9
+ * reports a 401 against the exact record version that send used. Metadata
10
+ * (the connection and discovery) is shared and coalesced; credential reads
11
+ * never are. It never enrolls: a missing token is an error here, and setup
12
+ * is where enrollment happens.
13
+ */
14
+ export class ClaustrumConsumer {
15
+ #options;
16
+ #shutdown = new AbortController();
17
+ #logger;
18
+ #custody;
19
+ #connecting;
20
+ #refreshing;
21
+ #roster;
22
+ #timer;
23
+ #started = false;
24
+ constructor(options) {
25
+ this.#options = options;
26
+ this.#logger = options.logger ?? createLogger('claustrum');
27
+ }
28
+ #assertOpen(signal) {
29
+ this.#shutdown.signal.throwIfAborted();
30
+ signal?.throwIfAborted();
31
+ }
32
+ async #active() {
33
+ return (await this.#options.isCustodyActive?.()) ?? true;
34
+ }
35
+ #wait(pending, signal) {
36
+ const combined = combineAbortSignals([
37
+ this.#shutdown.signal,
38
+ ...(signal ? [signal] : []),
39
+ ]);
40
+ return new Promise((resolve, reject) => {
41
+ const cleanup = () => {
42
+ combined.signal.removeEventListener('abort', abort);
43
+ combined.dispose();
44
+ };
45
+ const abort = () => {
46
+ cleanup();
47
+ reject(combined.signal.reason);
48
+ };
49
+ combined.signal.addEventListener('abort', abort, { once: true });
50
+ // Observe the operation even after cancellation: shared metadata work may
51
+ // finish for other callers, and a late connection must still be closed.
52
+ pending.then((value) => {
53
+ cleanup();
54
+ if (combined.signal.aborted)
55
+ reject(combined.signal.reason);
56
+ else
57
+ resolve(value);
58
+ }, (error) => {
59
+ cleanup();
60
+ reject(error);
61
+ });
62
+ if (combined.signal.aborted)
63
+ abort();
64
+ });
65
+ }
66
+ async #getCustody() {
67
+ this.#assertOpen();
68
+ if (this.#custody)
69
+ return this.#custody;
70
+ if (!this.#connecting) {
71
+ this.#connecting = this.#options
72
+ .connect()
73
+ .then((client) => {
74
+ if (this.#shutdown.signal.aborted) {
75
+ client.close();
76
+ this.#assertOpen();
77
+ }
78
+ this.#custody = new ClaustrumScopedCustody({
79
+ client,
80
+ family: this.#options.family,
81
+ tokenPath: this.#options.tokenPath,
82
+ parseIdentity: this.#options.parseIdentity,
83
+ requireAssertion: this.#options.requireAssertion,
84
+ now: this.#options.now,
85
+ logger: this.#logger,
86
+ });
87
+ return this.#custody;
88
+ })
89
+ .finally(() => {
90
+ this.#connecting = undefined;
91
+ });
92
+ }
93
+ return this.#wait(this.#connecting);
94
+ }
95
+ /** The last committed roster this instance saw, without any I/O. */
96
+ snapshot() {
97
+ return this.#roster;
98
+ }
99
+ /** Rows for `/routing`, from the last committed roster. */
100
+ routingRows() {
101
+ return vaultRoutingRows(this.#roster);
102
+ }
103
+ refresh() {
104
+ this.#assertOpen();
105
+ if (this.#refreshing)
106
+ return this.#refreshing;
107
+ this.#refreshing = (async () => {
108
+ if (!(await this.#active())) {
109
+ this.#roster = undefined;
110
+ this.#custody?.close();
111
+ this.#custody = undefined;
112
+ return undefined;
113
+ }
114
+ const custody = await this.#getCustody();
115
+ const roster = await refreshVaultRoster({
116
+ path: this.#options.rosterPath,
117
+ custody,
118
+ isActive: () => this.#active(),
119
+ signal: this.#shutdown.signal,
120
+ projection: () => ({
121
+ reservedRouteIds: new Set(this.#options.reservedRouteIds?.() ?? []),
122
+ routePrefix: this.#options.routePrefix,
123
+ mapAccount: this.#options.mapAccount,
124
+ now: (this.#options.now ?? Date.now)(),
125
+ }),
126
+ });
127
+ this.#assertOpen();
128
+ const changed = roster?.view !== this.#roster?.view;
129
+ this.#roster = roster;
130
+ // Notify on view changes only: subscribers rewrite shared state on each
131
+ // notification, and the poll runs every few seconds.
132
+ if (roster && changed)
133
+ this.#options.onRoster?.(roster);
134
+ return roster;
135
+ })().finally(() => {
136
+ this.#refreshing = undefined;
137
+ });
138
+ return this.#refreshing;
139
+ }
140
+ start() {
141
+ if (this.#started)
142
+ return;
143
+ this.#assertOpen();
144
+ this.#started = true;
145
+ const tick = async () => {
146
+ try {
147
+ await this.refresh();
148
+ }
149
+ catch (error) {
150
+ if (!this.#shutdown.signal.aborted)
151
+ this.#options.onError?.(error);
152
+ }
153
+ if (this.#shutdown.signal.aborted)
154
+ return;
155
+ const delay = this.#options.pollIntervalMs ?? 5_000;
156
+ if (delay <= 0)
157
+ return;
158
+ this.#timer = (this.#options.setTimeoutImpl ?? setTimeout)(() => {
159
+ this.#timer = undefined;
160
+ void tick();
161
+ }, delay);
162
+ this.#timer.unref?.();
163
+ };
164
+ void tick();
165
+ }
166
+ /**
167
+ * Authorize one physical send on a vault route. The roster file is re-read
168
+ * first, so a decline committed by another process applies before the next
169
+ * poll, and a route whose credential or account changed is refused.
170
+ */
171
+ async authorize(routeId, signal) {
172
+ this.#assertOpen(signal);
173
+ const roster = this.#roster ?? (await this.#wait(this.refresh(), signal));
174
+ if (!roster || !(await this.#active()))
175
+ throw new ClaustrumConsumerError('not-active', 'Claustrum scoped custody is not active');
176
+ const current = await readVaultRoster(this.#options.rosterPath);
177
+ this.#assertOpen(signal);
178
+ const observed = roster.rows.find((row) => row.routeId === routeId);
179
+ const configured = current?.rows.find((row) => row.routeId === routeId);
180
+ if (configured && !configured.enabled)
181
+ throw new ClaustrumConsumerError('route-declined', 'Claustrum route is disabled');
182
+ if (!observed ||
183
+ !configured ||
184
+ configured.state !== 'active' ||
185
+ configured.credentialId !== observed.credentialId ||
186
+ configured.accountIdentity !== observed.accountIdentity)
187
+ throw new ClaustrumConsumerError('route-unavailable', 'Claustrum route is disabled, removed or changed');
188
+ const custody = await this.#wait(this.#getCustody(), signal);
189
+ const combined = combineAbortSignals([
190
+ this.#shutdown.signal,
191
+ ...(signal ? [signal] : []),
192
+ ]);
193
+ try {
194
+ return await custody.authorize({
195
+ credentialId: configured.credentialId,
196
+ credentialType: configured.credentialType,
197
+ ...(configured.accountIdentity !== undefined && {
198
+ accountIdentity: configured.accountIdentity,
199
+ }),
200
+ }, combined.signal);
201
+ }
202
+ finally {
203
+ combined.dispose();
204
+ }
205
+ }
206
+ async reportFailure(attempt, status, source) {
207
+ this.#assertOpen();
208
+ if (!this.#custody)
209
+ throw new ClaustrumConsumerError('no-receipt', 'Claustrum dispatch receipt has no active owner');
210
+ await this.#custody.reportFailure(attempt, status, source);
211
+ }
212
+ /**
213
+ * Send on a vault route. `dispatch` builds and sends the request with the
214
+ * receipt's token and may be called twice, so it must be able to rebuild
215
+ * its body. A 401 is retried once, and only when the vault now serves a new
216
+ * record version of the same credential and account; the final 401 is
217
+ * reported against the version that send actually used. Each call to
218
+ * `dispatch` gets its own receipt.
219
+ */
220
+ async send(routeId, dispatch, options) {
221
+ const signal = options.signal;
222
+ let served = await this.authorize(routeId, signal);
223
+ let response = await dispatch(served, signal);
224
+ if (response.status === 401 && !signal?.aborted) {
225
+ let current;
226
+ try {
227
+ current = await this.authorize(routeId, signal);
228
+ }
229
+ catch {
230
+ // Re-authorization failed: keep this 401 and report it against the
231
+ // receipt (served record version) this request was sent with.
232
+ }
233
+ if (decideScopedRetryAfter401(options.site, served, current, this.#logger)) {
234
+ await response.body?.cancel().catch(() => { });
235
+ served = current;
236
+ response = await dispatch(current, signal);
237
+ }
238
+ }
239
+ if (response.status === 401) {
240
+ await this.reportFailure(served, 401, options.reporterSource ?? 'direct').catch((error) => this.#options.onError?.(error));
241
+ // After the report the vault may mark the account as needing a new
242
+ // login; refresh now so routing drops it without waiting for the next poll. Deferred so a consumer closed in
243
+ // the meantime reports to onError instead of throwing from this send.
244
+ Promise.resolve()
245
+ .then(() => this.refresh())
246
+ .catch((error) => {
247
+ if (!this.#shutdown.signal.aborted)
248
+ this.#options.onError?.(error);
249
+ });
250
+ }
251
+ return response;
252
+ }
253
+ /** Decline a vault account: it stays listed and never routes until accepted. */
254
+ async decline(routeId) {
255
+ this.#assertOpen();
256
+ await declineVaultRoute(this.#options.rosterPath, routeId);
257
+ this.#roster = await readVaultRoster(this.#options.rosterPath);
258
+ }
259
+ async accept(routeId) {
260
+ this.#assertOpen();
261
+ await acceptVaultRoute(this.#options.rosterPath, routeId);
262
+ this.#roster = await readVaultRoster(this.#options.rosterPath);
263
+ }
264
+ /**
265
+ * Store a quota or profile observation for a vault route. The receipt the
266
+ * reading was taken with is required: the observation lands only while the
267
+ * route still holds the credential and account that receipt was served for
268
+ * (see `recordVaultQuota`), so a reading for a replaced account is dropped.
269
+ */
270
+ async recordQuota(routeId, observation, attempt) {
271
+ this.#assertOpen();
272
+ const kept = await recordVaultQuota(this.#options.rosterPath, {
273
+ routeId,
274
+ observation,
275
+ credentialId: attempt.credentialId,
276
+ accountIdentitySource: attempt.accountIdentitySource,
277
+ ...(attempt.accountIdentity !== undefined && {
278
+ accountIdentity: attempt.accountIdentity,
279
+ }),
280
+ ...(attempt.expectedAccountIdentity !== undefined && {
281
+ expectedAccountIdentity: attempt.expectedAccountIdentity,
282
+ }),
283
+ });
284
+ if (kept)
285
+ this.#roster = await readVaultRoster(this.#options.rosterPath);
286
+ return kept;
287
+ }
288
+ close() {
289
+ if (this.#shutdown.signal.aborted)
290
+ return;
291
+ this.#shutdown.abort(new ClaustrumConsumerError('closed', 'Claustrum consumer is closed'));
292
+ if (this.#timer)
293
+ (this.#options.clearTimeoutImpl ?? clearTimeout)(this.#timer);
294
+ this.#timer = undefined;
295
+ this.#custody?.close();
296
+ this.#roster = undefined;
297
+ }
298
+ }
@@ -0,0 +1,175 @@
1
+ import { type ClaustrumClient, type ClaustrumReporterSource, type EnrollmentTokenFile } from '@cortexkit/claustrum-client';
2
+ import { type ClaustrumLogger } from './errors.js';
3
+ export type ClaustrumScopedClient = Pick<ClaustrumClient, 'listScoped' | 'getScoped' | 'reportAuthFailureScoped' | 'close'>;
4
+ /** The two credential types a plugin's family can hold; routing differs by type. */
5
+ export type VaultCredentialType = 'oauth' | 'api_key';
6
+ /**
7
+ * Which vault rows belong to this plugin. `refreshAdapter` classifies an OAuth
8
+ * row by the protocol it speaks; `category` is the grant that authorizes this
9
+ * consumer to read it. Static API keys carry no refresh adapter, so they are
10
+ * admitted only when `apiKeys` is set and only by category.
11
+ */
12
+ export interface ClaustrumFamily {
13
+ refreshAdapter: string;
14
+ category: string;
15
+ apiKeys?: boolean;
16
+ }
17
+ /** One vault credential this consumer may serve. Never carries bearer material. */
18
+ export interface VaultCredential {
19
+ readonly credentialId: string;
20
+ readonly credentialType: VaultCredentialType;
21
+ /**
22
+ * The provider account the credential logs into, when the vault's adapter
23
+ * claims one. Absent means the adapter makes no claim, not a mismatch.
24
+ */
25
+ readonly accountIdentity?: string;
26
+ readonly state: string;
27
+ readonly email?: string;
28
+ readonly orgName?: string;
29
+ }
30
+ /**
31
+ * Why a listed vault record could not be used. A closed set of fixed codes, so
32
+ * a log line or a roster file that carries one never echoes vault data.
33
+ */
34
+ export type SkippedVaultReason = 'empty credential id' | 'duplicate credential id' | 'blank account identity' | 'empty state';
35
+ /**
36
+ * A vault record this consumer could not use. `credentialId` is absent when
37
+ * the record's id itself was unusable, so nothing can say which account the
38
+ * record was.
39
+ */
40
+ export interface SkippedVaultRecord {
41
+ readonly credentialId?: string;
42
+ readonly reason: SkippedVaultReason;
43
+ }
44
+ export interface VaultInventory {
45
+ /**
46
+ * The vault's change cursor: a digest over exactly what this consumer can see
47
+ * (ids, grants, state, identity), never over record versions, so a routine
48
+ * token refresh does not move it. Only equality is meaningful.
49
+ */
50
+ readonly view: string;
51
+ readonly credentials: readonly VaultCredential[];
52
+ readonly skipped: readonly SkippedVaultRecord[];
53
+ }
54
+ export interface ClaustrumScopedIdentity {
55
+ readonly credentialId: string;
56
+ readonly credentialType: VaultCredentialType;
57
+ readonly accountIdentity?: string;
58
+ }
59
+ /**
60
+ * Where a receipt's `accountIdentity` came from: the vault asserted it in the
61
+ * served reply, the plugin's `parseIdentity` read it from the served token, or
62
+ * neither did and it is only the roster's expectation (`none`: no identity at
63
+ * all).
64
+ */
65
+ export type AccountIdentitySource = 'asserted' | 'parsed' | 'expected' | 'none';
66
+ /**
67
+ * A receipt: what the vault served for one physical send. Each attempt gets
68
+ * its own. It records the exact record version served, because a 401 for
69
+ * this send is reported to the vault against that version.
70
+ */
71
+ export interface ClaustrumScopedAttempt {
72
+ readonly credentialId: string;
73
+ readonly credentialType: VaultCredentialType;
74
+ /**
75
+ * The account this receipt is bound to: the vault's assertion, else the
76
+ * plugin's parse of the token, else the roster's expectation. Check
77
+ * `accountIdentitySource` before treating it as proof.
78
+ */
79
+ readonly accountIdentity?: string;
80
+ readonly accountIdentitySource: AccountIdentitySource;
81
+ /** The account the roster row named when this receipt was requested. */
82
+ readonly expectedAccountIdentity?: string;
83
+ /** The credential id the vault itself put in the served reply, if any. */
84
+ readonly assertedCredentialId?: string;
85
+ /**
86
+ * The account the vault itself put in the served reply, if any. Never filled
87
+ * in from the roster or from a token parse.
88
+ */
89
+ readonly assertedAccountIdentity?: string;
90
+ /**
91
+ * The non-secret Google Cloud project id the vault served in get_scoped for
92
+ * this attempt, if any. Never filled in from list_scoped, the roster or a
93
+ * token parse. A project change in the vault takes effect on the next send.
94
+ */
95
+ readonly projectId?: string;
96
+ /**
97
+ * Kept in memory only and hidden from JSON.stringify and object spreads, so
98
+ * logging a receipt never leaks it. Authorize again for every dispatch and retry.
99
+ */
100
+ readonly accessToken: string;
101
+ readonly recordVersion: number;
102
+ readonly expiresAtMs: number | null;
103
+ }
104
+ /** Reads the provider identity a served token executes under, when the plugin can tell. */
105
+ export type IdentityParser = (accessToken: string) => string | undefined;
106
+ /** Only a new version of the same account may replace an in-flight 401. */
107
+ export declare function isScopedCredentialRotation(served: ClaustrumScopedAttempt, current: ClaustrumScopedAttempt | undefined): current is ClaustrumScopedAttempt;
108
+ /** Why a scoped 401 did or did not retry. Never carries credential material. */
109
+ export type ScopedRetryReason = 'rotated' | 'reauthorize-failed' | 'credential-changed' | 'account-changed' | 'version-unchanged';
110
+ /**
111
+ * Decide whether a request that got a 401 should retry with the freshly
112
+ * re-authorized receipt, and log the decision. The vault can refresh a
113
+ * credential between the send and the 401; the log line lets that refresh be
114
+ * matched against the consumer's retry. `site` names the kind of request.
115
+ */
116
+ export declare function decideScopedRetryAfter401(site: string, served: ClaustrumScopedAttempt, current: ClaustrumScopedAttempt | undefined, logger?: ClaustrumLogger): current is ClaustrumScopedAttempt;
117
+ /**
118
+ * How long a served OAuth token must stay valid after the vault hands it out,
119
+ * so it cannot expire while a long request is still using it.
120
+ */
121
+ export declare const SERVING_MARGIN_MS = 300000;
122
+ /**
123
+ * Reads this consumer's vault credentials (list, fetch, 401 report), with the
124
+ * enrollment token as authorization. Used by every host of a plugin. There is
125
+ * deliberately no credential cache and no single-flight of credential reads:
126
+ * each physical send is authorized by the vault, so a revoked enrollment or a
127
+ * changed record takes effect on the next send. The enrollment token is
128
+ * re-read per operation so an operator's reissue on disk is picked up.
129
+ */
130
+ export declare class ClaustrumScopedCustody {
131
+ #private;
132
+ constructor(options: {
133
+ client: ClaustrumScopedClient;
134
+ family: ClaustrumFamily;
135
+ tokenPath?: string;
136
+ readToken?: () => Promise<EnrollmentTokenFile>;
137
+ parseIdentity?: IdentityParser;
138
+ /**
139
+ * Issue a receipt only when the vault's served reply itself names the
140
+ * requested credential id and the roster's (known) account identity. For
141
+ * providers whose tokens are opaque, where nothing else can prove which
142
+ * account a token belongs to. Off by default: then an absent assertion is
143
+ * no claim, and the receipt says where its identity came from.
144
+ */
145
+ requireAssertion?: boolean;
146
+ now?: () => number;
147
+ logger?: ClaustrumLogger;
148
+ });
149
+ /**
150
+ * List this consumer's credentials. A record that cannot be used is skipped
151
+ * and warned about rather than failing the whole list, so one bad record
152
+ * never hides every other account. Records outside the family are not
153
+ * skipped records: they simply are not this consumer's.
154
+ */
155
+ discover(signal?: AbortSignal): Promise<VaultInventory>;
156
+ /**
157
+ * Fetch the credential for one physical send and wrap it in a fresh receipt.
158
+ * The vault's served identity (or, without one, the plugin's parse of the
159
+ * token) must equal the roster's when both are present. Without
160
+ * `requireAssertion`, absence on either side proves nothing and does not
161
+ * refuse; the receipt records what the vault asserted separately from what
162
+ * the roster expected. With it, a reply that does not itself name the
163
+ * credential id and the expected account is refused.
164
+ */
165
+ authorize(identity: ClaustrumScopedIdentity, signal?: AbortSignal): Promise<ClaustrumScopedAttempt>;
166
+ /**
167
+ * Report that a send this consumer actually made was rejected. Only a 401
168
+ * is reported (the vault refuses 429, 402 and 5xx reports), addressed by
169
+ * credential id with the exact record version that send was served, and
170
+ * signed with the enrollment token that authorized it. A receipt this
171
+ * custody did not issue is refused rather than reported.
172
+ */
173
+ reportFailure(attempt: ClaustrumScopedAttempt, status: number, reporterSource: ClaustrumReporterSource): Promise<void>;
174
+ close(): void;
175
+ }