@openllmsh/sdk 2.10.12-alpha.1 → 2.10.12

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 (634) hide show
  1. package/README.md +27 -7
  2. package/dist/client/chat.d.ts +38 -0
  3. package/dist/client/chat.js +77 -0
  4. package/dist/client/devices.d.ts +70 -0
  5. package/dist/client/devices.js +172 -0
  6. package/dist/client/http.d.ts +24 -0
  7. package/dist/client/http.js +34 -0
  8. package/dist/client/index.d.ts +43 -0
  9. package/dist/client/index.js +57 -0
  10. package/dist/client/relay-mux.d.ts +71 -0
  11. package/dist/client/relay-mux.js +394 -0
  12. package/dist/client/types.d.ts +47 -0
  13. package/dist/client/types.js +5 -0
  14. package/dist/client/vault.d.ts +68 -0
  15. package/dist/client/vault.js +113 -0
  16. package/dist/connect/chat.d.ts +24 -0
  17. package/dist/connect/chat.js +25 -0
  18. package/dist/connect/client.d.ts +50 -0
  19. package/dist/connect/client.js +141 -0
  20. package/dist/connect/config.d.ts +22 -0
  21. package/dist/connect/config.js +22 -0
  22. package/dist/connect/errors.d.ts +32 -0
  23. package/dist/connect/errors.js +85 -0
  24. package/{connect/index.ts → dist/connect/index.d.ts} +7 -7
  25. package/dist/connect/index.js +23 -0
  26. package/dist/connect/oauth.d.ts +51 -0
  27. package/dist/connect/oauth.js +150 -0
  28. package/dist/connect/routes.d.ts +38 -0
  29. package/dist/connect/routes.js +175 -0
  30. package/dist/connect/store.d.ts +26 -0
  31. package/dist/connect/store.js +65 -0
  32. package/dist/mcp/handle.d.ts +6 -0
  33. package/dist/mcp/handle.js +6 -0
  34. package/dist/mcp/index.d.ts +15 -0
  35. package/dist/mcp/index.js +10 -0
  36. package/dist/mcp/server.d.ts +84 -0
  37. package/dist/mcp/server.js +168 -0
  38. package/dist/mcp/tools/marketplace.d.ts +94 -0
  39. package/dist/mcp/tools/marketplace.js +303 -0
  40. package/dist/mcp/tools/memory-client.d.ts +109 -0
  41. package/dist/mcp/tools/memory-client.js +200 -0
  42. package/dist/mcp/tools/memory-config.d.ts +29 -0
  43. package/dist/mcp/tools/memory-config.js +12 -0
  44. package/dist/mcp/tools/memory.d.ts +92 -0
  45. package/dist/mcp/tools/memory.js +312 -0
  46. package/dist/mcp/tools/model-priority.d.ts +16 -0
  47. package/dist/mcp/tools/model-priority.js +87 -0
  48. package/dist/mcp/tools/openllm.d.ts +75 -0
  49. package/dist/mcp/tools/openllm.js +715 -0
  50. package/dist/mcp/types.d.ts +25 -0
  51. package/dist/mcp/types.js +7 -0
  52. package/dist/openapi/call.d.ts +26 -0
  53. package/dist/openapi/call.js +56 -0
  54. package/dist/openapi/index.d.ts +2 -0
  55. package/dist/openapi/index.js +2 -0
  56. package/dist/openapi/openapi.json +80213 -0
  57. package/dist/openapi/operations.d.ts +14 -0
  58. package/dist/openapi/operations.js +2060 -0
  59. package/dist/protocol/access.d.ts +81 -0
  60. package/dist/protocol/access.js +125 -0
  61. package/dist/protocol/agent-prompt-text.d.ts +15 -0
  62. package/{protocol/agent-prompt-text.ts → dist/protocol/agent-prompt-text.js} +9 -14
  63. package/dist/protocol/agent.d.ts +1487 -0
  64. package/dist/protocol/agent.js +787 -0
  65. package/dist/protocol/api-key-syntax.d.ts +58 -0
  66. package/dist/protocol/api-key-syntax.js +73 -0
  67. package/dist/protocol/audio.d.ts +18 -0
  68. package/dist/protocol/audio.js +21 -0
  69. package/dist/protocol/auth.d.ts +126 -0
  70. package/dist/protocol/auth.js +119 -0
  71. package/dist/protocol/changelog.d.ts +69 -0
  72. package/dist/protocol/changelog.js +107 -0
  73. package/dist/protocol/chat.d.ts +789 -0
  74. package/dist/protocol/chat.js +394 -0
  75. package/dist/protocol/client-registry.d.ts +151 -0
  76. package/dist/protocol/client-registry.js +238 -0
  77. package/dist/protocol/config.d.ts +508 -0
  78. package/dist/protocol/config.js +289 -0
  79. package/dist/protocol/control-channel.d.ts +102 -0
  80. package/{protocol/control-channel.ts → dist/protocol/control-channel.js} +33 -61
  81. package/dist/protocol/cooldown-reason.d.ts +30 -0
  82. package/dist/protocol/cooldown-reason.js +44 -0
  83. package/dist/protocol/cost.d.ts +9 -0
  84. package/dist/protocol/cost.js +8 -0
  85. package/dist/protocol/daemon-port.d.ts +2 -0
  86. package/dist/protocol/daemon-port.js +28 -0
  87. package/dist/protocol/daemon.d.ts +2034 -0
  88. package/dist/protocol/daemon.js +1286 -0
  89. package/dist/protocol/default-chains.d.ts +15 -0
  90. package/dist/protocol/default-chains.js +21 -0
  91. package/dist/protocol/device-state.d.ts +223 -0
  92. package/dist/protocol/device-state.js +52 -0
  93. package/dist/protocol/doctor-report-local.d.ts +105 -0
  94. package/{protocol/doctor-report-local.ts → dist/protocol/doctor-report-local.js} +92 -196
  95. package/dist/protocol/doctor-report-policy.d.ts +62 -0
  96. package/{protocol/doctor-report-policy.ts → dist/protocol/doctor-report-policy.js} +23 -76
  97. package/dist/protocol/doctor-report.d.ts +406 -0
  98. package/dist/protocol/doctor-report.js +645 -0
  99. package/dist/protocol/errors.d.ts +17 -0
  100. package/dist/protocol/errors.js +10 -0
  101. package/dist/protocol/execution-selection.d.ts +92 -0
  102. package/{protocol/execution-selection.ts → dist/protocol/execution-selection.js} +38 -63
  103. package/dist/protocol/hop-grant.d.ts +28 -0
  104. package/{protocol/hop-grant.ts → dist/protocol/hop-grant.js} +7 -13
  105. package/dist/protocol/image-edit-parse.d.ts +25 -0
  106. package/dist/protocol/image-edit-parse.js +196 -0
  107. package/dist/protocol/images.d.ts +288 -0
  108. package/dist/protocol/images.js +229 -0
  109. package/dist/protocol/index.d.ts +69 -0
  110. package/dist/protocol/index.js +74 -0
  111. package/dist/protocol/inference-headers.d.ts +3 -0
  112. package/dist/protocol/keepalive.d.ts +36 -0
  113. package/dist/protocol/keepalive.js +51 -0
  114. package/dist/protocol/local-auth.d.ts +125 -0
  115. package/dist/protocol/local-auth.js +227 -0
  116. package/dist/protocol/local-device-control.d.ts +108 -0
  117. package/{protocol/local-device-control.ts → dist/protocol/local-device-control.js} +40 -70
  118. package/dist/protocol/local-provider.d.ts +105 -0
  119. package/dist/protocol/local-provider.js +213 -0
  120. package/dist/protocol/local-session.d.ts +70 -0
  121. package/dist/protocol/local-session.js +87 -0
  122. package/dist/protocol/marketplace.d.ts +190 -0
  123. package/dist/protocol/marketplace.js +140 -0
  124. package/{protocol/media-attempt.ts → dist/protocol/media-attempt.d.ts} +11 -50
  125. package/dist/protocol/media-attempt.js +50 -0
  126. package/dist/protocol/media-bytes.d.ts +8 -0
  127. package/dist/protocol/media-bytes.js +21 -0
  128. package/dist/protocol/media-default.d.ts +56 -0
  129. package/dist/protocol/media-default.js +302 -0
  130. package/{protocol/media-dimensions.ts → dist/protocol/media-dimensions.d.ts} +11 -78
  131. package/dist/protocol/media-dimensions.js +90 -0
  132. package/dist/protocol/media-input.d.ts +20 -0
  133. package/dist/protocol/media-input.js +29 -0
  134. package/dist/protocol/media-model.d.ts +77 -0
  135. package/dist/protocol/media-model.js +89 -0
  136. package/{protocol/media-option-issue.ts → dist/protocol/media-option-issue.d.ts} +25 -53
  137. package/dist/protocol/media-option-issue.js +50 -0
  138. package/dist/protocol/media-types.d.ts +14 -0
  139. package/dist/protocol/media-types.js +61 -0
  140. package/dist/protocol/model-match.d.ts +254 -0
  141. package/dist/protocol/model-match.js +760 -0
  142. package/dist/protocol/model-settings.d.ts +153 -0
  143. package/dist/protocol/model-settings.js +246 -0
  144. package/dist/protocol/models.d.ts +1065 -0
  145. package/dist/protocol/models.js +638 -0
  146. package/dist/protocol/mux.d.ts +350 -0
  147. package/dist/protocol/mux.js +595 -0
  148. package/{protocol/plan-surface.ts → dist/protocol/plan-surface.d.ts} +12 -26
  149. package/dist/protocol/plan-surface.js +39 -0
  150. package/dist/protocol/provider-models.d.ts +8 -0
  151. package/{protocol/provider-models.ts → dist/protocol/provider-models.js} +7 -9
  152. package/dist/protocol/provider-status.d.ts +59 -0
  153. package/dist/protocol/provider-status.js +142 -0
  154. package/dist/protocol/provider-tier.d.ts +34 -0
  155. package/{protocol/provider-tier.ts → dist/protocol/provider-tier.js} +9 -34
  156. package/dist/protocol/provider-usage.d.ts +230 -0
  157. package/dist/protocol/provider-usage.js +214 -0
  158. package/dist/protocol/providers.d.ts +2496 -0
  159. package/dist/protocol/providers.js +723 -0
  160. package/dist/protocol/public-usage-index.d.ts +449 -0
  161. package/dist/protocol/public-usage-index.js +279 -0
  162. package/dist/protocol/realtime-generated.d.ts +29 -0
  163. package/{protocol/realtime-generated.ts → dist/protocol/realtime-generated.js} +3 -5
  164. package/dist/protocol/realtime.d.ts +241 -0
  165. package/{protocol/realtime.ts → dist/protocol/realtime.js} +88 -155
  166. package/dist/protocol/registry-pointer.d.ts +24 -0
  167. package/dist/protocol/registry-pointer.js +78 -0
  168. package/dist/protocol/relay.d.ts +1152 -0
  169. package/{protocol/relay.ts → dist/protocol/relay.js} +237 -370
  170. package/dist/protocol/replay-session.d.ts +4 -0
  171. package/{protocol/replay-session.ts → dist/protocol/replay-session.js} +1 -8
  172. package/dist/protocol/responses.d.ts +303 -0
  173. package/dist/protocol/responses.js +240 -0
  174. package/dist/protocol/semver.d.ts +59 -0
  175. package/dist/protocol/semver.js +171 -0
  176. package/{protocol/setup-mode.ts → dist/protocol/setup-mode.d.ts} +4 -12
  177. package/dist/protocol/setup-mode.js +18 -0
  178. package/dist/protocol/sha256-hex.d.ts +2 -0
  179. package/dist/protocol/sha256-hex.js +93 -0
  180. package/dist/protocol/stats.d.ts +711 -0
  181. package/dist/protocol/stats.js +353 -0
  182. package/dist/protocol/streaming.d.ts +16 -0
  183. package/dist/protocol/streaming.js +15 -0
  184. package/{protocol/subscription-daemon-floors.ts → dist/protocol/subscription-daemon-floors.d.ts} +8 -14
  185. package/dist/protocol/subscription-daemon-floors.js +4 -0
  186. package/dist/protocol/subscription-provider-compat.d.ts +44 -0
  187. package/dist/protocol/subscription-provider-compat.js +67 -0
  188. package/dist/protocol/subscription-provider.d.ts +15 -0
  189. package/dist/protocol/subscription-provider.js +17 -0
  190. package/dist/protocol/team-grant.d.ts +14 -0
  191. package/{protocol/team-grant.ts → dist/protocol/team-grant.js} +0 -3
  192. package/dist/protocol/team-shareable.d.ts +6 -0
  193. package/{protocol/team-shareable.ts → dist/protocol/team-shareable.js} +29 -33
  194. package/dist/protocol/transcription-encoding.d.ts +25 -0
  195. package/dist/protocol/transcription-encoding.js +47 -0
  196. package/{protocol/url-locality-dns.ts → dist/protocol/url-locality-dns.d.ts} +1 -23
  197. package/dist/protocol/url-locality-dns.js +33 -0
  198. package/dist/protocol/url-locality.d.ts +45 -0
  199. package/dist/protocol/url-locality.js +288 -0
  200. package/dist/protocol/usage-snapshots.d.ts +8 -0
  201. package/{protocol/usage-snapshots.ts → dist/protocol/usage-snapshots.js} +1 -2
  202. package/dist/protocol/vendor-cli-install.d.ts +20 -0
  203. package/{protocol/vendor-cli-install.ts → dist/protocol/vendor-cli-install.js} +10 -15
  204. package/dist/protocol/video-job-plan.d.ts +18 -0
  205. package/dist/protocol/video-job-plan.js +44 -0
  206. package/dist/protocol/videos.d.ts +107 -0
  207. package/dist/protocol/videos.js +154 -0
  208. package/dist/tunnel/channel-envelope.d.ts +53 -0
  209. package/dist/tunnel/channel-envelope.js +100 -0
  210. package/dist/tunnel/codec.d.ts +71 -0
  211. package/dist/tunnel/codec.js +151 -0
  212. package/dist/tunnel/device-anchor.d.ts +62 -0
  213. package/dist/tunnel/device-anchor.js +168 -0
  214. package/dist/tunnel/device-control.d.ts +50 -0
  215. package/dist/tunnel/device-control.js +88 -0
  216. package/dist/tunnel/device-grant.d.ts +91 -0
  217. package/dist/tunnel/device-grant.js +105 -0
  218. package/dist/tunnel/fleet.d.ts +28 -0
  219. package/dist/tunnel/fleet.js +41 -0
  220. package/dist/tunnel/index.d.ts +22 -0
  221. package/dist/tunnel/index.js +22 -0
  222. package/dist/tunnel/mux.d.ts +64 -0
  223. package/dist/tunnel/mux.js +449 -0
  224. package/dist/tunnel/peer-link.d.ts +88 -0
  225. package/dist/tunnel/peer-link.js +271 -0
  226. package/dist/tunnel/rtc-auth.d.ts +159 -0
  227. package/dist/tunnel/rtc-auth.js +340 -0
  228. package/dist/tunnel/rtc-duplex.d.ts +52 -0
  229. package/dist/tunnel/rtc-duplex.js +148 -0
  230. package/dist/tunnel/rtc-ice.d.ts +55 -0
  231. package/dist/tunnel/rtc-ice.js +100 -0
  232. package/dist/tunnel/secure.d.ts +179 -0
  233. package/dist/tunnel/secure.js +936 -0
  234. package/dist/tunnel/stream-reset-error.d.ts +6 -0
  235. package/dist/tunnel/stream-reset-error.js +9 -0
  236. package/dist/tunnel/streams.d.ts +244 -0
  237. package/dist/tunnel/streams.js +1071 -0
  238. package/dist/tunnel/team-grant.d.ts +90 -0
  239. package/dist/tunnel/team-grant.js +226 -0
  240. package/dist/tunnel/wire-bytes.d.ts +32 -0
  241. package/dist/tunnel/wire-bytes.js +90 -0
  242. package/dist/vault/api-key.d.ts +71 -0
  243. package/dist/vault/api-key.js +130 -0
  244. package/{vault/argon2.ts → dist/vault/argon2.d.ts} +18 -53
  245. package/dist/vault/argon2.js +82 -0
  246. package/dist/vault/cli-auth-seal.d.ts +35 -0
  247. package/dist/vault/cli-auth-seal.js +78 -0
  248. package/dist/vault/cred-seal.d.ts +18 -0
  249. package/dist/vault/cred-seal.js +86 -0
  250. package/dist/vault/credential.d.ts +21 -0
  251. package/dist/vault/credential.js +26 -0
  252. package/dist/vault/crypto.d.ts +51 -0
  253. package/dist/vault/crypto.js +156 -0
  254. package/dist/vault/daemon-attest.d.ts +68 -0
  255. package/dist/vault/daemon-attest.js +147 -0
  256. package/dist/vault/derive.d.ts +34 -0
  257. package/dist/vault/derive.js +84 -0
  258. package/dist/vault/device-access.d.ts +17 -0
  259. package/dist/vault/device-access.js +77 -0
  260. package/dist/vault/device-anchor.d.ts +42 -0
  261. package/dist/vault/device-anchor.js +90 -0
  262. package/dist/vault/device-control.d.ts +80 -0
  263. package/{vault/device-control.ts → dist/vault/device-control.js} +46 -104
  264. package/dist/vault/handoff.d.ts +102 -0
  265. package/dist/vault/handoff.js +236 -0
  266. package/dist/vault/index.d.ts +21 -0
  267. package/dist/vault/index.js +21 -0
  268. package/dist/vault/passkey.d.ts +82 -0
  269. package/{vault/passkey.ts → dist/vault/passkey.js} +63 -153
  270. package/dist/vault/phrase.d.ts +40 -0
  271. package/{vault/phrase.ts → dist/vault/phrase.js} +17 -23
  272. package/dist/vault/pin.d.ts +46 -0
  273. package/dist/vault/pin.js +92 -0
  274. package/dist/vault/public-key-seal.d.ts +17 -0
  275. package/dist/vault/public-key-seal.js +59 -0
  276. package/dist/vault/seed.d.ts +96 -0
  277. package/dist/vault/seed.js +179 -0
  278. package/dist/vault/team.d.ts +134 -0
  279. package/dist/vault/team.js +217 -0
  280. package/dist/vault/vault-item.d.ts +45 -0
  281. package/dist/vault/vault-item.js +62 -0
  282. package/dist/vault/vault-migrate-digest.d.ts +10 -0
  283. package/dist/vault/vault-migrate-digest.js +22 -0
  284. package/dist/vault/wrapped.d.ts +19 -0
  285. package/dist/vault/wrapped.js +52 -0
  286. package/dist/wire/adapters/messages/anthropic-map.d.ts +8 -0
  287. package/dist/wire/adapters/messages/anthropic-map.js +32 -0
  288. package/dist/wire/adapters/messages/index.d.ts +7 -0
  289. package/dist/wire/adapters/messages/index.js +7 -0
  290. package/dist/wire/adapters/messages/reasoning-from-items.d.ts +14 -0
  291. package/dist/wire/adapters/messages/reasoning-from-items.js +39 -0
  292. package/dist/wire/adapters/messages/reasoning-signature.d.ts +81 -0
  293. package/dist/wire/adapters/messages/reasoning-signature.js +180 -0
  294. package/dist/wire/adapters/messages/request.d.ts +28 -0
  295. package/dist/wire/adapters/messages/request.js +490 -0
  296. package/dist/wire/adapters/messages/response.d.ts +10 -0
  297. package/dist/wire/adapters/messages/response.js +177 -0
  298. package/dist/wire/adapters/messages/streaming.d.ts +134 -0
  299. package/dist/wire/adapters/messages/streaming.js +791 -0
  300. package/dist/wire/adapters/messages/usage.d.ts +20 -0
  301. package/dist/wire/adapters/messages/usage.js +10 -0
  302. package/dist/wire/adapters/responses/index.d.ts +3 -0
  303. package/dist/wire/adapters/responses/index.js +3 -0
  304. package/dist/wire/adapters/responses/request.d.ts +2 -0
  305. package/dist/wire/adapters/responses/request.js +287 -0
  306. package/dist/wire/adapters/responses/response.d.ts +11 -0
  307. package/dist/wire/adapters/responses/response.js +69 -0
  308. package/dist/wire/adapters/responses/streaming.d.ts +2 -0
  309. package/dist/wire/adapters/responses/streaming.js +267 -0
  310. package/dist/wire/features/account-rank.d.ts +61 -0
  311. package/dist/wire/features/account-rank.js +109 -0
  312. package/dist/wire/features/compaction/compact-request.d.ts +69 -0
  313. package/dist/wire/features/compaction/compact-request.js +667 -0
  314. package/dist/wire/features/compaction/compaction-text.d.ts +17 -0
  315. package/dist/wire/features/compaction/compaction-text.js +29 -0
  316. package/dist/wire/features/context-demote.d.ts +15 -0
  317. package/dist/wire/features/context-demote.js +45 -0
  318. package/dist/wire/features/context-overflow-strategy.d.ts +12 -0
  319. package/dist/wire/features/context-overflow-strategy.js +8 -0
  320. package/dist/wire/features/context-skip.d.ts +120 -0
  321. package/{wire/features/context-skip.ts → dist/wire/features/context-skip.js} +23 -57
  322. package/dist/wire/features/conversation-affinity.d.ts +49 -0
  323. package/dist/wire/features/conversation-affinity.js +121 -0
  324. package/dist/wire/features/max-tokens-backfill.d.ts +50 -0
  325. package/dist/wire/features/max-tokens-backfill.js +118 -0
  326. package/dist/wire/features/model-caps.d.ts +7 -0
  327. package/dist/wire/features/model-caps.js +40 -0
  328. package/dist/wire/features/model-settings.d.ts +3 -0
  329. package/dist/wire/features/model-settings.js +13 -0
  330. package/dist/wire/features/output-limit-clamp.d.ts +14 -0
  331. package/dist/wire/features/output-limit-clamp.js +36 -0
  332. package/dist/wire/features/quota-gate.d.ts +16 -0
  333. package/dist/wire/features/quota-gate.js +48 -0
  334. package/dist/wire/index.d.ts +44 -0
  335. package/dist/wire/index.js +44 -0
  336. package/dist/wire/lib/attempt-outcome.d.ts +19 -0
  337. package/dist/wire/lib/attempt-outcome.js +18 -0
  338. package/{wire/lib/canonical/content-part.ts → dist/wire/lib/canonical/content-part.d.ts} +12 -18
  339. package/dist/wire/lib/canonical/content-part.js +11 -0
  340. package/dist/wire/lib/canonical/count-tokens-capability.d.ts +52 -0
  341. package/dist/wire/lib/canonical/count-tokens-capability.js +109 -0
  342. package/{wire/lib/canonical/encoding-select.ts → dist/wire/lib/canonical/encoding-select.d.ts} +7 -24
  343. package/dist/wire/lib/canonical/encoding-select.js +26 -0
  344. package/dist/wire/lib/canonical/image-signature.d.ts +20 -0
  345. package/dist/wire/lib/canonical/image-signature.js +184 -0
  346. package/dist/wire/lib/canonical/image-sse.d.ts +88 -0
  347. package/dist/wire/lib/canonical/image-sse.js +173 -0
  348. package/{wire/lib/canonical/message.ts → dist/wire/lib/canonical/message.d.ts} +2 -20
  349. package/dist/wire/lib/canonical/message.js +31 -0
  350. package/dist/wire/lib/canonical/token-estimate.d.ts +98 -0
  351. package/dist/wire/lib/canonical/token-estimate.js +230 -0
  352. package/dist/wire/lib/encrypted-content.d.ts +22 -0
  353. package/dist/wire/lib/encrypted-content.js +55 -0
  354. package/dist/wire/lib/error-class.d.ts +57 -0
  355. package/dist/wire/lib/error-class.js +97 -0
  356. package/dist/wire/lib/error-envelope.d.ts +20 -0
  357. package/dist/wire/lib/error-envelope.js +53 -0
  358. package/dist/wire/lib/forwarded-headers.d.ts +16 -0
  359. package/{wire/lib/forwarded-headers.ts → dist/wire/lib/forwarded-headers.js} +62 -72
  360. package/dist/wire/lib/provider-error-rules.d.ts +21 -0
  361. package/dist/wire/lib/provider-error-rules.js +20 -0
  362. package/{wire/lib/refusal.ts → dist/wire/lib/refusal.d.ts} +3 -13
  363. package/dist/wire/lib/refusal.js +27 -0
  364. package/dist/wire/lib/responses-apply-patch.d.ts +57 -0
  365. package/dist/wire/lib/responses-apply-patch.js +81 -0
  366. package/dist/wire/lib/responses-namespace.d.ts +27 -0
  367. package/{wire/lib/responses-namespace.ts → dist/wire/lib/responses-namespace.js} +16 -32
  368. package/dist/wire/lib/secret-scrub.d.ts +23 -0
  369. package/dist/wire/lib/secret-scrub.js +72 -0
  370. package/dist/wire/lib/streaming/accumulate.d.ts +12 -0
  371. package/dist/wire/lib/streaming/accumulate.js +187 -0
  372. package/dist/wire/lib/streaming/finish-reason.d.ts +20 -0
  373. package/dist/wire/lib/streaming/finish-reason.js +15 -0
  374. package/{wire/lib/streaming/peek.ts → dist/wire/lib/streaming/peek.d.ts} +13 -82
  375. package/dist/wire/lib/streaming/peek.js +100 -0
  376. package/dist/wire/lib/streaming/provider-decode.d.ts +57 -0
  377. package/dist/wire/lib/streaming/provider-decode.js +210 -0
  378. package/dist/wire/lib/streaming/response-stream.d.ts +16 -0
  379. package/dist/wire/lib/streaming/response-stream.js +64 -0
  380. package/dist/wire/lib/streaming/sse.d.ts +130 -0
  381. package/dist/wire/lib/streaming/sse.js +600 -0
  382. package/dist/wire/lib/streaming/strip-tool-calls.d.ts +14 -0
  383. package/dist/wire/lib/streaming/strip-tool-calls.js +75 -0
  384. package/dist/wire/lib/streaming/upstream-error.d.ts +32 -0
  385. package/dist/wire/lib/streaming/upstream-error.js +45 -0
  386. package/dist/wire/lib/strip-subagent-isolation.d.ts +16 -0
  387. package/dist/wire/lib/strip-subagent-isolation.js +240 -0
  388. package/dist/wire/lib/thinking-signature.d.ts +56 -0
  389. package/{wire/lib/thinking-signature.ts → dist/wire/lib/thinking-signature.js} +77 -84
  390. package/dist/wire/lib/token-ruler/bpe-core.d.ts +105 -0
  391. package/dist/wire/lib/token-ruler/bpe-core.js +398 -0
  392. package/dist/wire/lib/token-ruler/index.d.ts +2 -0
  393. package/dist/wire/lib/token-ruler/index.js +2 -0
  394. package/dist/wire/lib/token-ruler/ruler.d.ts +36 -0
  395. package/dist/wire/lib/token-ruler/ruler.js +50 -0
  396. package/dist/wire/lib/token-ruler/vocab/claude-ranks.d.ts +14 -0
  397. package/dist/wire/lib/token-ruler/vocab/claude-ranks.js +16 -0
  398. package/{wire/lib/token-ruler/vocab/claude.ts → dist/wire/lib/token-ruler/vocab/claude.d.ts} +2 -12
  399. package/dist/wire/lib/token-ruler/vocab/claude.js +8 -0
  400. package/dist/wire/lib/token-ruler/vocab/o200k-ranks.d.ts +3 -0
  401. package/dist/wire/lib/token-ruler/vocab/o200k-ranks.js +18 -0
  402. package/dist/wire/lib/token-ruler/vocab/o200k.d.ts +11 -0
  403. package/dist/wire/lib/token-ruler/vocab/o200k.js +6 -0
  404. package/dist/wire/lib/tool-name-map.d.ts +44 -0
  405. package/dist/wire/lib/tool-name-map.js +186 -0
  406. package/dist/wire/lib/tool-schema.d.ts +15 -0
  407. package/dist/wire/lib/tool-schema.js +307 -0
  408. package/dist/wire/lib/usage-observer.d.ts +9 -0
  409. package/dist/wire/lib/usage-observer.js +108 -0
  410. package/dist/wire/providers/anthropic/adaptive-thinking.d.ts +125 -0
  411. package/dist/wire/providers/anthropic/adaptive-thinking.js +221 -0
  412. package/dist/wire/providers/anthropic/beta-headers.d.ts +44 -0
  413. package/{wire/providers/anthropic/beta-headers.ts → dist/wire/providers/anthropic/beta-headers.js} +57 -79
  414. package/dist/wire/providers/anthropic/index.d.ts +6 -0
  415. package/{wire/providers/anthropic/index.ts → dist/wire/providers/anthropic/index.js} +6 -6
  416. package/dist/wire/providers/anthropic/request.d.ts +12 -0
  417. package/dist/wire/providers/anthropic/request.js +456 -0
  418. package/dist/wire/providers/anthropic/response.d.ts +3 -0
  419. package/dist/wire/providers/anthropic/response.js +126 -0
  420. package/dist/wire/providers/anthropic/streaming.d.ts +28 -0
  421. package/dist/wire/providers/anthropic/streaming.js +268 -0
  422. package/dist/wire/providers/anthropic/web-search-domains.d.ts +7 -0
  423. package/dist/wire/providers/anthropic/web-search-domains.js +36 -0
  424. package/dist/wire/providers/chatgpt/common.d.ts +27 -0
  425. package/{wire/providers/chatgpt/common.ts → dist/wire/providers/chatgpt/common.js} +69 -89
  426. package/dist/wire/providers/chatgpt/index.d.ts +4 -0
  427. package/{wire/providers/chatgpt/index.ts → dist/wire/providers/chatgpt/index.js} +4 -4
  428. package/dist/wire/providers/chatgpt/request.d.ts +132 -0
  429. package/dist/wire/providers/chatgpt/request.js +696 -0
  430. package/dist/wire/providers/chatgpt/streaming.d.ts +69 -0
  431. package/dist/wire/providers/chatgpt/streaming.js +761 -0
  432. package/dist/wire/providers/chatgpt/web-search.d.ts +19 -0
  433. package/dist/wire/providers/chatgpt/web-search.js +55 -0
  434. package/dist/wire/providers/grok/web-search.d.ts +23 -0
  435. package/dist/wire/providers/grok/web-search.js +74 -0
  436. package/dist/wire/providers/kimi/web-search.d.ts +48 -0
  437. package/dist/wire/providers/kimi/web-search.js +106 -0
  438. package/dist/wire/providers/upstream-deny.d.ts +61 -0
  439. package/dist/wire/providers/upstream-deny.js +293 -0
  440. package/dist/wire/providers/upstream-request.d.ts +104 -0
  441. package/dist/wire/providers/upstream-request.js +411 -0
  442. package/package.json +105 -23
  443. package/ARCHITECTURE.md +0 -43
  444. package/client/chat.ts +0 -140
  445. package/client/devices.ts +0 -269
  446. package/client/http.ts +0 -72
  447. package/client/index.ts +0 -129
  448. package/client/relay-mux.ts +0 -547
  449. package/client/types.ts +0 -51
  450. package/client/vault.ts +0 -239
  451. package/connect/chat.ts +0 -58
  452. package/connect/client.ts +0 -240
  453. package/connect/config.ts +0 -47
  454. package/connect/errors.ts +0 -121
  455. package/connect/oauth.ts +0 -265
  456. package/connect/routes.ts +0 -234
  457. package/connect/store.ts +0 -107
  458. package/mcp/handle.ts +0 -24
  459. package/mcp/index.ts +0 -76
  460. package/mcp/server.ts +0 -319
  461. package/mcp/tools/marketplace.ts +0 -439
  462. package/mcp/tools/memory-client.ts +0 -297
  463. package/mcp/tools/memory-config.ts +0 -32
  464. package/mcp/tools/memory.ts +0 -369
  465. package/mcp/tools/model-priority.ts +0 -88
  466. package/mcp/tools/openllm.ts +0 -883
  467. package/mcp/types.ts +0 -28
  468. package/openapi/call.ts +0 -90
  469. package/openapi/index.ts +0 -8
  470. package/openapi/openapi.json +0 -80213
  471. package/openapi/operations.ts +0 -2075
  472. package/protocol/CONTRIBUTING.md +0 -21
  473. package/protocol/README.md +0 -134
  474. package/protocol/access.ts +0 -186
  475. package/protocol/agent.ts +0 -991
  476. package/protocol/api-key-syntax.ts +0 -105
  477. package/protocol/assets/openllm-light.svg +0 -18
  478. package/protocol/assets/openllm.svg +0 -18
  479. package/protocol/audio.ts +0 -29
  480. package/protocol/auth.ts +0 -142
  481. package/protocol/changelog.ts +0 -155
  482. package/protocol/chat.ts +0 -458
  483. package/protocol/client-registry.ts +0 -356
  484. package/protocol/config.ts +0 -345
  485. package/protocol/cooldown-reason.ts +0 -78
  486. package/protocol/cost.ts +0 -10
  487. package/protocol/daemon-port.ts +0 -31
  488. package/protocol/daemon.ts +0 -1524
  489. package/protocol/default-chains.ts +0 -66
  490. package/protocol/device-state.ts +0 -85
  491. package/protocol/doctor-report.ts +0 -947
  492. package/protocol/errors.ts +0 -14
  493. package/protocol/image-edit-parse.ts +0 -263
  494. package/protocol/images.ts +0 -298
  495. package/protocol/index.ts +0 -74
  496. package/protocol/keepalive.ts +0 -69
  497. package/protocol/local-auth.ts +0 -300
  498. package/protocol/local-provider.ts +0 -288
  499. package/protocol/local-session.ts +0 -118
  500. package/protocol/marketplace.ts +0 -187
  501. package/protocol/media-bytes.ts +0 -28
  502. package/protocol/media-default.ts +0 -357
  503. package/protocol/media-input.ts +0 -61
  504. package/protocol/media-model.ts +0 -142
  505. package/protocol/media-types.ts +0 -70
  506. package/protocol/model-match.ts +0 -1051
  507. package/protocol/model-settings.ts +0 -327
  508. package/protocol/models.ts +0 -767
  509. package/protocol/mux.ts +0 -722
  510. package/protocol/provider-status.ts +0 -206
  511. package/protocol/provider-usage.ts +0 -263
  512. package/protocol/providers.ts +0 -901
  513. package/protocol/public-usage-index.ts +0 -354
  514. package/protocol/registry-pointer.ts +0 -118
  515. package/protocol/responses.ts +0 -280
  516. package/protocol/semver.ts +0 -182
  517. package/protocol/sha256-hex.ts +0 -98
  518. package/protocol/stats.ts +0 -406
  519. package/protocol/streaming.ts +0 -19
  520. package/protocol/subscription-provider-compat.ts +0 -104
  521. package/protocol/subscription-provider.ts +0 -32
  522. package/protocol/transcription-encoding.ts +0 -76
  523. package/protocol/url-locality.ts +0 -288
  524. package/protocol/video-job-plan.ts +0 -50
  525. package/protocol/videos.ts +0 -227
  526. package/tsconfig.json +0 -14
  527. package/tunnel/ARCHITECTURE.md +0 -111
  528. package/tunnel/assets/openllm-light.svg +0 -18
  529. package/tunnel/assets/openllm.svg +0 -18
  530. package/tunnel/channel-envelope.ts +0 -139
  531. package/tunnel/codec.ts +0 -191
  532. package/tunnel/device-anchor.ts +0 -229
  533. package/tunnel/device-control.ts +0 -118
  534. package/tunnel/device-grant.ts +0 -173
  535. package/tunnel/fleet.ts +0 -77
  536. package/tunnel/index.ts +0 -22
  537. package/tunnel/mux.ts +0 -580
  538. package/tunnel/peer-link.ts +0 -390
  539. package/tunnel/rtc-auth.ts +0 -415
  540. package/tunnel/rtc-duplex.ts +0 -187
  541. package/tunnel/rtc-ice.ts +0 -136
  542. package/tunnel/secure.ts +0 -1298
  543. package/tunnel/stream-reset-error.ts +0 -14
  544. package/tunnel/streams.ts +0 -1430
  545. package/tunnel/team-grant.ts +0 -302
  546. package/tunnel/wire-bytes.ts +0 -102
  547. package/vault/ARCHITECTURE.md +0 -470
  548. package/vault/api-key.ts +0 -190
  549. package/vault/cli-auth-seal.ts +0 -157
  550. package/vault/cred-seal.ts +0 -146
  551. package/vault/credential.ts +0 -55
  552. package/vault/crypto.ts +0 -210
  553. package/vault/daemon-attest.ts +0 -229
  554. package/vault/derive.ts +0 -113
  555. package/vault/device-access.ts +0 -87
  556. package/vault/device-anchor.ts +0 -185
  557. package/vault/handoff.ts +0 -396
  558. package/vault/index.ts +0 -21
  559. package/vault/pin.ts +0 -153
  560. package/vault/public-key-seal.ts +0 -131
  561. package/vault/seed.ts +0 -272
  562. package/vault/team.ts +0 -355
  563. package/vault/vault-item.ts +0 -131
  564. package/vault/vault-migrate-digest.ts +0 -29
  565. package/vault/wrapped.ts +0 -77
  566. package/wire/ARCHITECTURE.md +0 -90
  567. package/wire/CONTRIBUTING.md +0 -19
  568. package/wire/adapters/messages/anthropic-map.ts +0 -37
  569. package/wire/adapters/messages/index.ts +0 -7
  570. package/wire/adapters/messages/reasoning-from-items.ts +0 -38
  571. package/wire/adapters/messages/reasoning-signature.ts +0 -243
  572. package/wire/adapters/messages/request.ts +0 -574
  573. package/wire/adapters/messages/response.ts +0 -215
  574. package/wire/adapters/messages/streaming.ts +0 -1027
  575. package/wire/adapters/messages/usage.ts +0 -43
  576. package/wire/adapters/responses/index.ts +0 -3
  577. package/wire/adapters/responses/request.ts +0 -395
  578. package/wire/adapters/responses/response.ts +0 -88
  579. package/wire/adapters/responses/streaming.ts +0 -344
  580. package/wire/assets/openllm-light.svg +0 -18
  581. package/wire/assets/openllm.svg +0 -18
  582. package/wire/features/account-rank.ts +0 -166
  583. package/wire/features/compaction/compact-request.ts +0 -862
  584. package/wire/features/compaction/compaction-text.ts +0 -43
  585. package/wire/features/context-demote.ts +0 -47
  586. package/wire/features/context-overflow-strategy.ts +0 -26
  587. package/wire/features/conversation-affinity.ts +0 -144
  588. package/wire/features/max-tokens-backfill.ts +0 -141
  589. package/wire/features/model-caps.ts +0 -53
  590. package/wire/features/model-settings.ts +0 -24
  591. package/wire/features/output-limit-clamp.ts +0 -64
  592. package/wire/features/quota-gate.ts +0 -85
  593. package/wire/index.ts +0 -44
  594. package/wire/lib/attempt-outcome.ts +0 -43
  595. package/wire/lib/canonical/count-tokens-capability.ts +0 -138
  596. package/wire/lib/canonical/image-signature.ts +0 -202
  597. package/wire/lib/canonical/image-sse.ts +0 -216
  598. package/wire/lib/canonical/token-estimate.ts +0 -266
  599. package/wire/lib/encrypted-content.ts +0 -66
  600. package/wire/lib/error-class.ts +0 -154
  601. package/wire/lib/error-envelope.ts +0 -56
  602. package/wire/lib/provider-error-rules.ts +0 -48
  603. package/wire/lib/responses-apply-patch.ts +0 -104
  604. package/wire/lib/secret-scrub.ts +0 -101
  605. package/wire/lib/streaming/accumulate.ts +0 -221
  606. package/wire/lib/streaming/finish-reason.ts +0 -33
  607. package/wire/lib/streaming/provider-decode.ts +0 -259
  608. package/wire/lib/streaming/response-stream.ts +0 -71
  609. package/wire/lib/streaming/sse.ts +0 -699
  610. package/wire/lib/streaming/strip-tool-calls.ts +0 -95
  611. package/wire/lib/streaming/upstream-error.ts +0 -58
  612. package/wire/lib/strip-subagent-isolation.ts +0 -284
  613. package/wire/lib/token-ruler/bpe-core.ts +0 -426
  614. package/wire/lib/token-ruler/index.ts +0 -2
  615. package/wire/lib/token-ruler/ruler.ts +0 -79
  616. package/wire/lib/token-ruler/vocab/claude-ranks.ts +0 -16
  617. package/wire/lib/token-ruler/vocab/o200k-ranks.ts +0 -18
  618. package/wire/lib/token-ruler/vocab/o200k.ts +0 -19
  619. package/wire/lib/tool-name-map.ts +0 -271
  620. package/wire/lib/tool-schema.ts +0 -353
  621. package/wire/lib/usage-observer.ts +0 -125
  622. package/wire/providers/anthropic/adaptive-thinking.ts +0 -291
  623. package/wire/providers/anthropic/request.ts +0 -607
  624. package/wire/providers/anthropic/response.ts +0 -155
  625. package/wire/providers/anthropic/streaming.ts +0 -315
  626. package/wire/providers/anthropic/web-search-domains.ts +0 -49
  627. package/wire/providers/chatgpt/request.ts +0 -959
  628. package/wire/providers/chatgpt/streaming.ts +0 -1007
  629. package/wire/providers/chatgpt/web-search.ts +0 -63
  630. package/wire/providers/grok/web-search.ts +0 -87
  631. package/wire/providers/kimi/web-search.ts +0 -145
  632. package/wire/providers/upstream-deny.ts +0 -355
  633. package/wire/providers/upstream-request.ts +0 -619
  634. /package/{protocol/inference-headers.ts → dist/protocol/inference-headers.js} +0 -0
@@ -0,0 +1,2034 @@
1
+ import { Schema as S } from "effect";
2
+ import type { TContextOverflowStrategy } from "./config.js";
3
+ export declare const DaemonCatalogEntry: S.Struct<{
4
+ readonly settings: S.optional<S.Struct<{
5
+ readonly service_tier: S.optional<S.Struct<{
6
+ readonly label: S.String;
7
+ readonly description: S.String;
8
+ readonly options: S.$Array<S.Struct<{
9
+ readonly value: S.Literals<readonly ["auto", "default", "flex", "priority"]>;
10
+ readonly label: S.String;
11
+ }>>;
12
+ readonly default: S.optional<S.Literals<readonly ["auto", "default", "flex", "priority"]>>;
13
+ readonly inherit_to_successors: S.optional<S.Boolean>;
14
+ }>>;
15
+ readonly input_token_limit: S.optional<S.Struct<{
16
+ readonly label: S.String;
17
+ readonly description: S.String;
18
+ readonly options: S.$Array<S.Struct<{
19
+ readonly value: S.Int;
20
+ readonly label: S.String;
21
+ }>>;
22
+ readonly reported: S.optional<S.Int>;
23
+ }>>;
24
+ readonly min_reasoning_effort: S.optional<S.Struct<{
25
+ readonly label: S.String;
26
+ readonly description: S.String;
27
+ readonly options: S.$Array<S.Struct<{
28
+ readonly value: S.Literals<readonly ["low", "medium", "high", "xhigh"]>;
29
+ readonly label: S.String;
30
+ }>>;
31
+ }>>;
32
+ }>>;
33
+ readonly model_id: S.String;
34
+ readonly provider: S.String;
35
+ readonly provider_model_id: S.String;
36
+ readonly input_token_limit: S.NullOr<S.Number>;
37
+ readonly output_token_limit: S.NullOr<S.Number>;
38
+ readonly subscription_meter: S.optional<S.Struct<{
39
+ readonly meter_id: S.String;
40
+ readonly aliases: S.optional<S.$Array<S.String>>;
41
+ }>>;
42
+ /**
43
+ * Catalog capabilities for this model. Optional so older clouds keep
44
+ * bootstrapping newer daemons. Absent / empty = unknown (never treated
45
+ * as known-non-vision). The walker vision gate reads this on each hop.
46
+ *
47
+ * Open string array: unknown future literals (e.g. `image_editing`,
48
+ * `realtime`) must not fail the whole bootstrap. Older compiled daemons
49
+ * still decode a closed `ModelCapability` set — cloud encoders should
50
+ * send {@link toBootstrapSafeCapabilities} until those binaries are
51
+ * replaced.
52
+ */
53
+ readonly capabilities: S.optional<S.$Array<S.String>>;
54
+ /** Catalog-declared final outbound-body constraints for this model. */
55
+ readonly caps: S.optional<S.Struct<{
56
+ readonly deniedParams: S.optional<S.$Array<S.String>>;
57
+ readonly maxTokensField: S.optional<S.Literals<readonly ["max_tokens", "max_completion_tokens"]>>;
58
+ readonly temperature: S.optional<S.Literals<readonly ["only-1", "clamp-0-1", "drop"]>>;
59
+ readonly thinkingModes: S.optional<S.$Array<S.Literals<readonly ["enabled", "adaptive", "disabled"]>>>;
60
+ readonly reasoningContexts: S.optional<S.$Array<S.Literals<readonly ["auto", "current_turn", "all_turns"]>>>;
61
+ readonly inlineToolAdditions: S.optional<S.Boolean>;
62
+ readonly inlineSystemMessages: S.optional<S.Boolean>;
63
+ readonly upstreamAcceptsResponseFormat: S.optional<S.Boolean>;
64
+ readonly upstreamAcceptsStream: S.optional<S.Boolean>;
65
+ readonly supportsStyle: S.optional<S.Boolean>;
66
+ readonly supportsGptImageOutputOptions: S.optional<S.Boolean>;
67
+ readonly alwaysReturnsBase64: S.optional<S.Boolean>;
68
+ readonly nativeProgressiveImages: S.optional<S.Boolean>;
69
+ readonly maxNativePartialImages: S.optional<S.Number>;
70
+ readonly nativeWire: S.optional<S.Literals<readonly ["generateContent", "predict"]>>;
71
+ readonly videoResolutions: S.optional<S.$Array<S.String>>;
72
+ readonly mediaVideoDurationsSeconds: S.optional<S.$Array<S.Number>>;
73
+ readonly mediaVideoDurationRange: S.optional<S.Struct<{
74
+ readonly min: S.Number;
75
+ readonly max: S.Number;
76
+ }>>;
77
+ readonly mediaVideoDurationWithReferences: S.optional<S.Number>;
78
+ readonly mediaVideoAspectRatios: S.optional<S.$Array<S.String>>;
79
+ readonly mediaVideoMaxReferenceImages: S.optional<S.Number>;
80
+ readonly mediaVideoMaxReferenceVoices: S.optional<S.Number>;
81
+ readonly mediaVideoReferenceType: S.optional<S.String>;
82
+ readonly mediaVideoStartingImageExclusiveWithReferences: S.optional<S.Boolean>;
83
+ readonly mediaImageAspectRatios: S.optional<S.$Array<S.String>>;
84
+ readonly mediaImageResolutions: S.optional<S.$Array<S.String>>;
85
+ readonly mediaImageResolutionTiers: S.optional<S.$Array<S.Struct<{
86
+ readonly resolution: S.String;
87
+ readonly longEdge: S.Number;
88
+ }>>>;
89
+ readonly mediaImageDefaultResolution: S.optional<S.String>;
90
+ readonly mediaImageSizeAspectRatios: S.optional<S.$Record<S.String, S.String>>;
91
+ readonly mediaImageCountRange: S.optional<S.Struct<{
92
+ readonly min: S.Number;
93
+ readonly max: S.Number;
94
+ }>>;
95
+ readonly tokenizer: S.optional<S.Literals<readonly ["claude", "o200k"]>>;
96
+ }>>;
97
+ /**
98
+ * Catalog-declared audio support (input/output formats, voices,
99
+ * realtime ops). The daemon's audio walker currently re-derives these
100
+ * from the provider slug while the catalog already declares them per
101
+ * model, so the card is the correction channel.
102
+ *
103
+ * Optional, like `caps`: an older cloud omits it and a newer daemon
104
+ * reads absent as UNKNOWN, keeping today's provider-derived defaults.
105
+ * Delivered over the AUTHENTICATED bootstrap, never the signed plan —
106
+ * that payload covers only plan/pmids/origin, so anything appended
107
+ * there would be caller-controllable and unsigned.
108
+ */
109
+ readonly audio_support: S.optional<S.Struct<{
110
+ readonly input_formats: S.optional<S.$Array<S.String>>;
111
+ readonly output_formats: S.optional<S.$Array<S.String>>;
112
+ readonly voices: S.optional<S.$Array<S.String>>;
113
+ readonly realtime_operations: S.optional<S.$Array<S.String>>;
114
+ }>>;
115
+ /** Optional so older clouds keep bootstrapping newer daemons. */
116
+ readonly strip_subagent_isolation: S.optional<S.Boolean>;
117
+ }>;
118
+ export type TDaemonCatalogEntry = S.Schema.Type<typeof DaemonCatalogEntry>;
119
+ export declare const DaemonBootstrap: S.Struct<{
120
+ readonly catalog: S.$Array<S.Struct<{
121
+ readonly settings: S.optional<S.Struct<{
122
+ readonly service_tier: S.optional<S.Struct<{
123
+ readonly label: S.String;
124
+ readonly description: S.String;
125
+ readonly options: S.$Array<S.Struct<{
126
+ readonly value: S.Literals<readonly ["auto", "default", "flex", "priority"]>;
127
+ readonly label: S.String;
128
+ }>>;
129
+ readonly default: S.optional<S.Literals<readonly ["auto", "default", "flex", "priority"]>>;
130
+ readonly inherit_to_successors: S.optional<S.Boolean>;
131
+ }>>;
132
+ readonly input_token_limit: S.optional<S.Struct<{
133
+ readonly label: S.String;
134
+ readonly description: S.String;
135
+ readonly options: S.$Array<S.Struct<{
136
+ readonly value: S.Int;
137
+ readonly label: S.String;
138
+ }>>;
139
+ readonly reported: S.optional<S.Int>;
140
+ }>>;
141
+ readonly min_reasoning_effort: S.optional<S.Struct<{
142
+ readonly label: S.String;
143
+ readonly description: S.String;
144
+ readonly options: S.$Array<S.Struct<{
145
+ readonly value: S.Literals<readonly ["low", "medium", "high", "xhigh"]>;
146
+ readonly label: S.String;
147
+ }>>;
148
+ }>>;
149
+ }>>;
150
+ readonly model_id: S.String;
151
+ readonly provider: S.String;
152
+ readonly provider_model_id: S.String;
153
+ readonly input_token_limit: S.NullOr<S.Number>;
154
+ readonly output_token_limit: S.NullOr<S.Number>;
155
+ readonly subscription_meter: S.optional<S.Struct<{
156
+ readonly meter_id: S.String;
157
+ readonly aliases: S.optional<S.$Array<S.String>>;
158
+ }>>;
159
+ /**
160
+ * Catalog capabilities for this model. Optional so older clouds keep
161
+ * bootstrapping newer daemons. Absent / empty = unknown (never treated
162
+ * as known-non-vision). The walker vision gate reads this on each hop.
163
+ *
164
+ * Open string array: unknown future literals (e.g. `image_editing`,
165
+ * `realtime`) must not fail the whole bootstrap. Older compiled daemons
166
+ * still decode a closed `ModelCapability` set — cloud encoders should
167
+ * send {@link toBootstrapSafeCapabilities} until those binaries are
168
+ * replaced.
169
+ */
170
+ readonly capabilities: S.optional<S.$Array<S.String>>;
171
+ /** Catalog-declared final outbound-body constraints for this model. */
172
+ readonly caps: S.optional<S.Struct<{
173
+ readonly deniedParams: S.optional<S.$Array<S.String>>;
174
+ readonly maxTokensField: S.optional<S.Literals<readonly ["max_tokens", "max_completion_tokens"]>>;
175
+ readonly temperature: S.optional<S.Literals<readonly ["only-1", "clamp-0-1", "drop"]>>;
176
+ readonly thinkingModes: S.optional<S.$Array<S.Literals<readonly ["enabled", "adaptive", "disabled"]>>>;
177
+ readonly reasoningContexts: S.optional<S.$Array<S.Literals<readonly ["auto", "current_turn", "all_turns"]>>>;
178
+ readonly inlineToolAdditions: S.optional<S.Boolean>;
179
+ readonly inlineSystemMessages: S.optional<S.Boolean>;
180
+ readonly upstreamAcceptsResponseFormat: S.optional<S.Boolean>;
181
+ readonly upstreamAcceptsStream: S.optional<S.Boolean>;
182
+ readonly supportsStyle: S.optional<S.Boolean>;
183
+ readonly supportsGptImageOutputOptions: S.optional<S.Boolean>;
184
+ readonly alwaysReturnsBase64: S.optional<S.Boolean>;
185
+ readonly nativeProgressiveImages: S.optional<S.Boolean>;
186
+ readonly maxNativePartialImages: S.optional<S.Number>;
187
+ readonly nativeWire: S.optional<S.Literals<readonly ["generateContent", "predict"]>>;
188
+ readonly videoResolutions: S.optional<S.$Array<S.String>>;
189
+ readonly mediaVideoDurationsSeconds: S.optional<S.$Array<S.Number>>;
190
+ readonly mediaVideoDurationRange: S.optional<S.Struct<{
191
+ readonly min: S.Number;
192
+ readonly max: S.Number;
193
+ }>>;
194
+ readonly mediaVideoDurationWithReferences: S.optional<S.Number>;
195
+ readonly mediaVideoAspectRatios: S.optional<S.$Array<S.String>>;
196
+ readonly mediaVideoMaxReferenceImages: S.optional<S.Number>;
197
+ readonly mediaVideoMaxReferenceVoices: S.optional<S.Number>;
198
+ readonly mediaVideoReferenceType: S.optional<S.String>;
199
+ readonly mediaVideoStartingImageExclusiveWithReferences: S.optional<S.Boolean>;
200
+ readonly mediaImageAspectRatios: S.optional<S.$Array<S.String>>;
201
+ readonly mediaImageResolutions: S.optional<S.$Array<S.String>>;
202
+ readonly mediaImageResolutionTiers: S.optional<S.$Array<S.Struct<{
203
+ readonly resolution: S.String;
204
+ readonly longEdge: S.Number;
205
+ }>>>;
206
+ readonly mediaImageDefaultResolution: S.optional<S.String>;
207
+ readonly mediaImageSizeAspectRatios: S.optional<S.$Record<S.String, S.String>>;
208
+ readonly mediaImageCountRange: S.optional<S.Struct<{
209
+ readonly min: S.Number;
210
+ readonly max: S.Number;
211
+ }>>;
212
+ readonly tokenizer: S.optional<S.Literals<readonly ["claude", "o200k"]>>;
213
+ }>>;
214
+ /**
215
+ * Catalog-declared audio support (input/output formats, voices,
216
+ * realtime ops). The daemon's audio walker currently re-derives these
217
+ * from the provider slug while the catalog already declares them per
218
+ * model, so the card is the correction channel.
219
+ *
220
+ * Optional, like `caps`: an older cloud omits it and a newer daemon
221
+ * reads absent as UNKNOWN, keeping today's provider-derived defaults.
222
+ * Delivered over the AUTHENTICATED bootstrap, never the signed plan —
223
+ * that payload covers only plan/pmids/origin, so anything appended
224
+ * there would be caller-controllable and unsigned.
225
+ */
226
+ readonly audio_support: S.optional<S.Struct<{
227
+ readonly input_formats: S.optional<S.$Array<S.String>>;
228
+ readonly output_formats: S.optional<S.$Array<S.String>>;
229
+ readonly voices: S.optional<S.$Array<S.String>>;
230
+ readonly realtime_operations: S.optional<S.$Array<S.String>>;
231
+ }>>;
232
+ /** Optional so older clouds keep bootstrapping newer daemons. */
233
+ readonly strip_subagent_isolation: S.optional<S.Boolean>;
234
+ }>>;
235
+ readonly provider_prefixes: S.$Array<S.String>;
236
+ /**
237
+ * Catalog-owned caps DEFAULTS for models with no catalog row. The
238
+ * daemon runs the SAME `resolveDefaultModelCaps` matcher the cloud
239
+ * does, so an un-catalogued id resolves identically on both paths and
240
+ * the two cannot drift.
241
+ *
242
+ * Optional: an older cloud omits it and the daemon simply resolves no
243
+ * defaults (absent = unknown = permissive, today's behaviour). Rules
244
+ * are DATA on the authenticated bootstrap — never the signed plan.
245
+ */
246
+ readonly caps_defaults: S.optional<S.$Array<S.Struct<{
247
+ readonly provider: S.String;
248
+ readonly pattern: S.String;
249
+ readonly caps: S.Struct<{
250
+ readonly deniedParams: S.optional<S.$Array<S.String>>;
251
+ readonly maxTokensField: S.optional<S.Literals<readonly ["max_tokens", "max_completion_tokens"]>>;
252
+ readonly temperature: S.optional<S.Literals<readonly ["only-1", "clamp-0-1", "drop"]>>;
253
+ readonly thinkingModes: S.optional<S.$Array<S.Literals<readonly ["enabled", "adaptive", "disabled"]>>>;
254
+ readonly reasoningContexts: S.optional<S.$Array<S.Literals<readonly ["auto", "current_turn", "all_turns"]>>>;
255
+ readonly inlineToolAdditions: S.optional<S.Boolean>;
256
+ readonly inlineSystemMessages: S.optional<S.Boolean>;
257
+ readonly upstreamAcceptsResponseFormat: S.optional<S.Boolean>;
258
+ readonly upstreamAcceptsStream: S.optional<S.Boolean>;
259
+ readonly supportsStyle: S.optional<S.Boolean>;
260
+ readonly supportsGptImageOutputOptions: S.optional<S.Boolean>;
261
+ readonly alwaysReturnsBase64: S.optional<S.Boolean>;
262
+ readonly nativeProgressiveImages: S.optional<S.Boolean>;
263
+ readonly maxNativePartialImages: S.optional<S.Number>;
264
+ readonly nativeWire: S.optional<S.Literals<readonly ["generateContent", "predict"]>>;
265
+ readonly videoResolutions: S.optional<S.$Array<S.String>>;
266
+ readonly mediaVideoDurationsSeconds: S.optional<S.$Array<S.Number>>;
267
+ readonly mediaVideoDurationRange: S.optional<S.Struct<{
268
+ readonly min: S.Number;
269
+ readonly max: S.Number;
270
+ }>>;
271
+ readonly mediaVideoDurationWithReferences: S.optional<S.Number>;
272
+ readonly mediaVideoAspectRatios: S.optional<S.$Array<S.String>>;
273
+ readonly mediaVideoMaxReferenceImages: S.optional<S.Number>;
274
+ readonly mediaVideoMaxReferenceVoices: S.optional<S.Number>;
275
+ readonly mediaVideoReferenceType: S.optional<S.String>;
276
+ readonly mediaVideoStartingImageExclusiveWithReferences: S.optional<S.Boolean>;
277
+ readonly mediaImageAspectRatios: S.optional<S.$Array<S.String>>;
278
+ readonly mediaImageResolutions: S.optional<S.$Array<S.String>>;
279
+ readonly mediaImageResolutionTiers: S.optional<S.$Array<S.Struct<{
280
+ readonly resolution: S.String;
281
+ readonly longEdge: S.Number;
282
+ }>>>;
283
+ readonly mediaImageDefaultResolution: S.optional<S.String>;
284
+ readonly mediaImageSizeAspectRatios: S.optional<S.$Record<S.String, S.String>>;
285
+ readonly mediaImageCountRange: S.optional<S.Struct<{
286
+ readonly min: S.Number;
287
+ readonly max: S.Number;
288
+ }>>;
289
+ readonly tokenizer: S.optional<S.Literals<readonly ["claude", "o200k"]>>;
290
+ }>;
291
+ }>>>;
292
+ readonly user_fallback_groups: S.$Array<S.Struct<{
293
+ readonly name: S.String;
294
+ readonly models: S.$Array<S.String>;
295
+ }>>;
296
+ readonly user_model_fallback_bindings: S.$Array<S.Tuple<readonly [S.String, S.$Array<S.String>]>>;
297
+ readonly model_settings: S.optional<S.$Record<S.String, S.Struct<{
298
+ readonly service_tier: S.optional<S.Literals<readonly ["auto", "default", "flex", "priority"]>>;
299
+ readonly input_token_limit: S.optional<S.Int>;
300
+ readonly min_reasoning_effort: S.optional<S.Literals<readonly ["low", "medium", "high", "xhigh"]>>;
301
+ }>>>;
302
+ /** Per-user context-window overflow routing preference. Absent means the
303
+ * historical hop-to-larger-context behaviour. */
304
+ readonly context_overflow_strategy: S.optional<S.Literals<readonly ["hop_to_larger_context", "compact_in_place"]>>;
305
+ /**
306
+ * Per-user HMAC key the daemon uses to VERIFY the plan `/api/daemon/plan`
307
+ * returns (the cloud signs with the same key). Lets the daemon reject
308
+ * a plan forged by another local process. Null when the cloud has no
309
+ * signing secret configured (dev) — the daemon then accepts unsigned
310
+ * plans. See `docs/proposals/coreless-daemon-passthrough.md` §9.
311
+ */
312
+ readonly plan_signing_key: S.optional<S.NullOr<S.String>>;
313
+ /**
314
+ * Authenticated account id for this bootstrap. Optional/additive so older
315
+ * clouds keep bootstrapping; newer daemons use it to compare relay-stamped
316
+ * `peer_user_id` on `channel_open` (cross-user → require a team grant).
317
+ */
318
+ readonly user_id: S.optional<S.String>;
319
+ /**
320
+ * Per-contributor HMAC key for verifying team device grants (same key
321
+ * origin uses to sign for this user). Null/absent when
322
+ * `NEON_AUTH_COOKIE_SECRET` is unset — team device routing is then off
323
+ * (`team_device_unavailable`); the daemon refuses team traffic.
324
+ * See `docs/plan/2026-10-26-teams.md` §16.2.
325
+ */
326
+ readonly team_grant_key: S.optional<S.NullOr<S.String>>;
327
+ /**
328
+ * The daemon binary version the cloud currently publishes (bare semver, no
329
+ * leading `v` — matches the daemon's compiled `DAEMON_VERSION`). The daemon
330
+ * compares it against its own and SELF-UPDATES when they differ (converge to
331
+ * published — the cloud is the source of truth, so republishing an older tag
332
+ * rolls daemons back). Null/absent when no release is published yet (or the
333
+ * cloud is too old to advertise it) — the daemon then never self-updates.
334
+ * See `packages/cli/daemon/src/self-update.ts`.
335
+ */
336
+ readonly latest_version: S.optional<S.NullOr<S.String>>;
337
+ /**
338
+ * The `openllmc` CLI version the cloud currently publishes (bare semver, no
339
+ * leading `v`). The daemon converges the INSTALLED CLI binary at
340
+ * `~/.openllm/bin/openllmc` to it on the same auto-update tick (and under
341
+ * the same opt-out toggle) as its own self-update — one flow, one toggle.
342
+ * The daemon never installs the CLI: an absent binary is skipped. Null/
343
+ * absent when no CLI release is published yet (or the cloud is too old to
344
+ * advertise it) — the daemon then never touches the CLI.
345
+ * One binary is both CLI and daemon now, so this is the release the daemon
346
+ * converges `~/.openllm/bin/openllm` to. See
347
+ * `packages/cli/daemon/src/updater.ts`.
348
+ */
349
+ readonly latest_cli_version: S.optional<S.NullOr<S.String>>;
350
+ /**
351
+ * The cloud's resolved `ACTIVE_SUB_METHOD` global preference — a named
352
+ * execution variant (`stream-json` / `sdk-facade` / `acp` / `app-server` /
353
+ * `msp` / `agent-sdk`, optionally `-capture`) or `handrolled`; see
354
+ * `./execution-selection`. Null = no preference: each hop uses its
355
+ * provider's registry default. Sampled once per request from the cached
356
+ * bootstrap snapshot.
357
+ */
358
+ readonly execution_selection: S.optional<S.NullOr<S.Union<readonly [S.Struct<{
359
+ readonly kind: S.Literal<"handrolled">;
360
+ }>, S.Struct<{
361
+ readonly kind: S.Literal<"bridge">;
362
+ readonly variant: S.Literals<readonly ["stream-json", "agent-sdk", "sdk-facade", "acp", "app-server", "msp"]>;
363
+ readonly capture: S.Boolean;
364
+ }>]>>>;
365
+ /**
366
+ * Per-provider overrides layered on top of `execution_selection`
367
+ * (`provider:method` entries of the same env). String-keyed so a newer
368
+ * cloud advertising a slug this daemon predates never fails bootstrap
369
+ * decode.
370
+ */
371
+ readonly execution_selections: S.optional<S.NullOr<S.$Record<S.String, S.Union<readonly [S.Struct<{
372
+ readonly kind: S.Literal<"handrolled">;
373
+ }>, S.Struct<{
374
+ readonly kind: S.Literal<"bridge">;
375
+ readonly variant: S.Literals<readonly ["stream-json", "agent-sdk", "sdk-facade", "acp", "app-server", "msp"]>;
376
+ readonly capture: S.Boolean;
377
+ }>]>>>>;
378
+ /**
379
+ * Cloud-controlled toggle for the daemon's SIGNED-PLAN CACHE
380
+ * (`DAEMON_PLAN_CACHE` on the cloud, default ON — an explicit `0`/`false`
381
+ * disables): when true, a `/v1/*` request that reaches the daemon
382
+ * directly may be served against the most recent
383
+ * cloud-signed plan tuple for the same model alias within a short TTL,
384
+ * skipping the per-request cloud round trip. The signature is still
385
+ * verified per request (the cached tuple is exactly what the cloud
386
+ * signed); staleness is bounded by the TTL. False → the daemon requires
387
+ * a plan on every request; ABSENT (a cloud predating the field) → the
388
+ * daemon also keeps the cache off (the cloud is the one authority). See
389
+ * docs/proposals/sub-method-simplified-execution.md §4.
390
+ */
391
+ readonly plan_cache: S.optional<S.Boolean>;
392
+ /**
393
+ * The user's FLEET subscription servers: for each subscription provider
394
+ * connected on some ONLINE daemon of this user, the serving daemon's
395
+ * key id. Computed cloud-side from `api_key_activity` presence + status
396
+ * (serve-by-default policy — every online device qualifies). A consuming
397
+ * daemon with no local credential for a subscription hop tunnels the
398
+ * request to `key_id` over the relay
399
+ * (`docs/features/sub-tunnel-and-chat-sessions.md` §1). String-keyed
400
+ * provider so newer slugs never fail an older daemon's decode; optional
401
+ * so older clouds keep bootstrapping newer daemons.
402
+ */
403
+ readonly fleet_subscriptions: S.optional<S.$Array<S.Struct<{
404
+ readonly provider: S.String;
405
+ readonly key_id: S.String;
406
+ /** Serving daemon X25519 SPKI, absent for pre-pubkey peers. */
407
+ readonly pubkey: S.optional<S.String>;
408
+ }>>>;
409
+ /**
410
+ * SPKI DER (base64) of the account DEVICE-CONTROL public key (Ed25519,
411
+ * derived in the browser from the recovery phrase — never from the DEK, so
412
+ * the cloud cannot sign with it). The daemon first-use pins it UNANCHORED
413
+ * (tunnel only), follows signed rotations, and anchors only from a local
414
+ * root (install anchor / loopback); it verifies
415
+ * browser-signed device grants against it. The
416
+ * field name is historical: before `device_access_kind: "control"` it carried
417
+ * a per-key DEK-derived key ("legacy"). Null when the key is un-provisioned or
418
+ * the caller is session-only / watcher (no owning key). Optional so older
419
+ * clouds keep bootstrapping newer daemons.
420
+ */
421
+ readonly device_access_pubkey: S.optional<S.NullOr<S.String>>;
422
+ /**
423
+ * `"control"` when {@link device_access_pubkey} is the account control key.
424
+ * Absent = legacy per-key value (the daemon then never upgrades a pin to it
425
+ * and refuses agent sessions with `device_not_anchored`).
426
+ */
427
+ readonly device_access_kind: S.optional<S.Literal<"control">>;
428
+ /**
429
+ * The control key's generation (`users.device_control_version`, the vault
430
+ * generation it was derived under). A signed rotation must carry a greater
431
+ * `cv` than the daemon's pinned version. Null/absent when unknown.
432
+ */
433
+ readonly device_access_version: S.optional<S.NullOr<S.Number>>;
434
+ /**
435
+ * Control-key rotation statements, oldest first (base64 JSON, signed by the
436
+ * PREVIOUS control key — see `@openllmsh/sdk/tunnel` `device-control.ts`). The
437
+ * daemon walks the chain from its own pin to {@link device_access_pubkey}.
438
+ * The cloud cannot forge a step: each is signed by a key only a browser
439
+ * holding the recovery phrase ever derived.
440
+ */
441
+ readonly device_access_rotations: S.optional<S.$Array<S.String>>;
442
+ /**
443
+ * Optional reporting policy. Absent on old clouds = off. Expired or
444
+ * `enabled: false` means no upload. See `doctor-report-policy.ts`.
445
+ */
446
+ readonly reporting_policy: S.optional<S.Struct<{
447
+ readonly enabled: S.Boolean;
448
+ readonly generation: S.String;
449
+ readonly expires_at_ms: S.Number;
450
+ readonly schema_version: S.Literal<1>;
451
+ }>>;
452
+ /**
453
+ * Revision of the authenticating key's access policy (models, routes,
454
+ * caps). The daemon drops every cached plan when it changes, so a plan
455
+ * cached under an older policy is never replayed. Null for a session
456
+ * caller with no key. When absent, retain the daemon's known revision.
457
+ */
458
+ readonly key_policy_rev: S.optional<S.NullOr<S.String>>;
459
+ }>;
460
+ export type TDaemonBootstrap = S.Schema.Type<typeof DaemonBootstrap>;
461
+ export declare const DaemonRecordRequest: S.Struct<{
462
+ readonly model: S.String;
463
+ readonly provider: S.String;
464
+ readonly status: S.Literals<readonly ["success", "error", "timeout", "rate_limited"]>;
465
+ /** Canonical prompt tokens — INCLUDES the two cache fields below. */
466
+ readonly tokens_in: S.Number;
467
+ readonly tokens_out: S.Number;
468
+ readonly cached_tokens: S.optional<S.Number>;
469
+ readonly cache_creation_tokens: S.optional<S.Number>;
470
+ readonly latency_ms: S.Number;
471
+ readonly idempotency_key: S.optional<S.NullOr<S.String>>;
472
+ readonly error: S.optional<S.NullOr<S.String>>;
473
+ readonly endpoint: S.optional<S.NullOr<S.String>>;
474
+ /** Obscured vendor-account identity of the credential that SERVED this
475
+ * hop — the same `sha256("openllm-account-v1:<provider>:<id>")` digest
476
+ * the status frame reports, computed from the token that ran the
477
+ * request. Lets the usage-calibration estimator attribute this row's
478
+ * cost to the right meter series when a provider has several accounts.
479
+ * Optional so daemons predating the field still record (the cloud
480
+ * stores null → the estimator's conservative null pool). */
481
+ readonly account_hash: S.optional<S.String>;
482
+ /**
483
+ * Origin-signed team grant echoed on team hops so the cloud attributes
484
+ * the row to the consumer and settles `team_usage_counters`. Same-user
485
+ * records omit it. Bounded like the mux forward header.
486
+ */
487
+ readonly team_grant: S.optional<S.String>;
488
+ /**
489
+ * Cap hold this request ran under. Only the hold's TERMINAL record carries
490
+ * it; that record settles the hold at `tokens_in + tokens_out` (may be 0).
491
+ * Accepted only from the device key the hold is bound to.
492
+ */
493
+ readonly hold_nonce: S.optional<S.String>;
494
+ /**
495
+ * With `hold_nonce`: tokens reported by this request's earlier attempts
496
+ * (retries, sibling accounts, fallbacks), added to this record's tokens.
497
+ */
498
+ readonly hold_prior_tokens: S.optional<S.Number>;
499
+ /**
500
+ * With `hold_nonce`: sends of this request with no usage evidence. The
501
+ * cloud charges each one the hold's full reservation.
502
+ */
503
+ readonly hold_unknown_attempts: S.optional<S.Number>;
504
+ readonly cooldown_reason: S.optional<S.Literals<readonly ["network", "timeout", "rate_limit", "quota_exhausted", "server_error", "auth", "payment", "not_found", "payload_too_large", "unprocessable", "request_invalid", "accepted_unreadable", "context_overflow", "content_filter", "upstream_rejection"]>>;
505
+ /** Reset instant for reset-aware TTL cap; optional so old daemons omit. */
506
+ readonly reset_at_ms: S.optional<S.Number>;
507
+ }>;
508
+ export type TDaemonRecordRequest = S.Schema.Type<typeof DaemonRecordRequest>;
509
+ export declare const DaemonModelReportEntry: S.Struct<{
510
+ readonly provider: S.String;
511
+ readonly models: S.$Array<S.Struct<{
512
+ readonly provider_model_id: S.String;
513
+ readonly display_name: S.optional<S.String>;
514
+ readonly created: S.optional<S.Number>;
515
+ readonly context_window: S.optional<S.Number>;
516
+ readonly max_output_tokens: S.optional<S.Number>;
517
+ }>>;
518
+ /** Vendor CLI version (bare semver) that OBSERVED this list. Some
519
+ * vendors gate model visibility by client version (Codex does), so
520
+ * the cloud uses this to refuse a write that would replace a fresh
521
+ * row produced by a NEWER CLI on another device. Optional so daemons
522
+ * built before the field still report (their writes stay permissive). */
523
+ readonly cli_version: S.optional<S.String>;
524
+ }>;
525
+ export type TDaemonModelReportEntry = S.Schema.Type<typeof DaemonModelReportEntry>;
526
+ export declare const DaemonModelReport: S.Struct<{
527
+ readonly entries: S.$Array<S.Struct<{
528
+ readonly provider: S.String;
529
+ readonly models: S.$Array<S.Struct<{
530
+ readonly provider_model_id: S.String;
531
+ readonly display_name: S.optional<S.String>;
532
+ readonly created: S.optional<S.Number>;
533
+ readonly context_window: S.optional<S.Number>;
534
+ readonly max_output_tokens: S.optional<S.Number>;
535
+ }>>;
536
+ /** Vendor CLI version (bare semver) that OBSERVED this list. Some
537
+ * vendors gate model visibility by client version (Codex does), so
538
+ * the cloud uses this to refuse a write that would replace a fresh
539
+ * row produced by a NEWER CLI on another device. Optional so daemons
540
+ * built before the field still report (their writes stay permissive). */
541
+ readonly cli_version: S.optional<S.String>;
542
+ }>>;
543
+ /**
544
+ * Device-discovered local model-server lists, keyed by `local_*` /
545
+ * `local_port_*` provider. Separate from `entries` so an oauth-only
546
+ * maxItems(32) bound cannot crowd out local rows (and vice versa).
547
+ * Absent on older daemons.
548
+ */
549
+ readonly local_entries: S.optional<S.$Array<S.Struct<{
550
+ readonly provider: S.String;
551
+ readonly models: S.$Array<S.Struct<{
552
+ readonly provider_model_id: S.String;
553
+ readonly display_name: S.optional<S.String>;
554
+ readonly created: S.optional<S.Number>;
555
+ readonly context_window: S.optional<S.Number>;
556
+ readonly max_output_tokens: S.optional<S.Number>;
557
+ }>>;
558
+ /** Vendor CLI version (bare semver) that OBSERVED this list. Some
559
+ * vendors gate model visibility by client version (Codex does), so
560
+ * the cloud uses this to refuse a write that would replace a fresh
561
+ * row produced by a NEWER CLI on another device. Optional so daemons
562
+ * built before the field still report (their writes stay permissive). */
563
+ readonly cli_version: S.optional<S.String>;
564
+ }>>>;
565
+ }>;
566
+ export type TDaemonModelReport = S.Schema.Type<typeof DaemonModelReport>;
567
+ /** Probe outcome for one local model server on the daemon's machine. */
568
+ export declare const LocalServerStatus: S.Literals<readonly ["ok", "needs_key", "unreachable"]>;
569
+ export type TLocalServerStatus = S.Schema.Type<typeof LocalServerStatus>;
570
+ /**
571
+ * Live local-server discovery state pushed on `DaemonStatus` (no keys —
572
+ * only `has_key`). Also the result shape of a `local_rescan` command.
573
+ */
574
+ export declare const LocalServerState: S.Struct<{
575
+ /** Preset slug (`local_ollama`, …) or `local_port_<port>` fallback. */
576
+ readonly slug: S.String;
577
+ readonly port: S.Number;
578
+ readonly base_url: S.String;
579
+ readonly status: S.Literals<readonly ["ok", "needs_key", "unreachable"]>;
580
+ readonly has_key: S.Boolean;
581
+ readonly models: S.$Array<S.Struct<{
582
+ readonly provider_model_id: S.String;
583
+ readonly display_name: S.optional<S.String>;
584
+ readonly created: S.optional<S.Number>;
585
+ readonly context_window: S.optional<S.Number>;
586
+ readonly max_output_tokens: S.optional<S.Number>;
587
+ }>>;
588
+ }>;
589
+ export type TLocalServerState = S.Schema.Type<typeof LocalServerState>;
590
+ export type { TSubscriptionProviderSlug } from "./subscription-provider.js";
591
+ export { SubscriptionProviderSlug } from "./subscription-provider.js";
592
+ export declare const DaemonSessionLost: S.Struct<{
593
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
594
+ readonly account_hash: S.optional<S.String>;
595
+ /** Bounded, non-secret classifier of `conn.detail` — never the raw string. */
596
+ readonly diagnostic_code: S.optional<S.Literals<readonly ["credential_absent", "cli_unavailable", "store_unreadable", "keychain_unavailable", "probe_timeout", "vendor_revoked_unknown", "unclassified"]>>;
597
+ }>;
598
+ export type TDaemonSessionLost = S.Schema.Type<typeof DaemonSessionLost>;
599
+ export declare const DaemonQuotaStatusReached: S.Struct<{
600
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
601
+ readonly status: S.Literals<readonly ["allowed_warning", "rejected"]>;
602
+ readonly account_hash: S.optional<S.String>;
603
+ readonly plan: S.optional<S.String>;
604
+ /**
605
+ * Sustaining quota-window reset epoch (unix ms). Optional so older daemons
606
+ * omit it; cloud then falls back to account:status + 24h cooldown.
607
+ */
608
+ readonly reset_at_ms: S.optional<S.Number>;
609
+ /**
610
+ * The quota snapshot that produced this transition — display-only, it lets
611
+ * the email list every limit with its usage and reset. Optional so older
612
+ * daemons omit it. The cloud decodes it apart from the fields above and
613
+ * falls back to the plain notice when it is missing, undecodable, not a
614
+ * quota snapshot, or disagrees with `status`.
615
+ */
616
+ readonly usage: S.optional<S.Union<readonly [S.Struct<{
617
+ readonly kind: S.Literal<"quota">;
618
+ readonly status: S.Literals<readonly ["allowed", "allowed_warning", "rejected"]>;
619
+ readonly plan: S.optional<S.String>;
620
+ readonly plan_source: S.optional<S.String>;
621
+ readonly windows: S.$Array<S.Struct<{
622
+ readonly label: S.String;
623
+ readonly meter_id: S.optional<S.String>;
624
+ readonly percent_used: S.Number;
625
+ readonly reset_at_ms: S.NullOr<S.Number>;
626
+ readonly window_ms: S.optional<S.Number>;
627
+ }>>;
628
+ readonly note: S.String;
629
+ readonly as_of_ms: S.optional<S.Number>;
630
+ readonly stale: S.optional<S.Boolean>;
631
+ readonly refresh_failure: S.optional<S.Struct<{
632
+ readonly reason: S.Literals<readonly ["credential_expired", "account_changed", "rate_limited", "authorization_failed", "subscription_inactive", "fetch_failed"]>;
633
+ readonly at_ms: S.optional<S.Number>;
634
+ }>>;
635
+ readonly extra_pools: S.optional<S.$Array<S.Struct<{
636
+ readonly label: S.String;
637
+ readonly meter_id: S.optional<S.String>;
638
+ readonly percent_used: S.Number;
639
+ readonly reset_at_ms: S.NullOr<S.Number>;
640
+ readonly window_ms: S.optional<S.Number>;
641
+ }>>>;
642
+ readonly credits: S.optional<S.Struct<{
643
+ readonly balance: S.String;
644
+ readonly unlimited: S.optional<S.Boolean>;
645
+ readonly reset_credits: S.optional<S.Number>;
646
+ }>>;
647
+ }>, S.Struct<{
648
+ readonly kind: S.Literal<"plan">;
649
+ readonly plan: S.String;
650
+ readonly note: S.String;
651
+ }>, S.Struct<{
652
+ readonly kind: S.Literal<"unavailable">;
653
+ readonly reason: S.String;
654
+ readonly link: S.optional<S.String>;
655
+ }>]>>;
656
+ }>;
657
+ export type TDaemonQuotaStatusReached = S.Schema.Type<typeof DaemonQuotaStatusReached>;
658
+ /** Optional user-visible device-session label (open frames + presence). */
659
+ export declare const SessionTitleField: S.String;
660
+ export type TSessionTitleField = S.Schema.Type<typeof SessionTitleField>;
661
+ /**
662
+ * CLIs the device PTY surface can host: OpenLLM session clients with local
663
+ * history + resume wiring (Claude / Codex / Grok / OpenCode / Hermes), plus a
664
+ * direct login shell. Keep `SubscriptionProviderSlug` for credentials/usage;
665
+ * session frames use this set, while the local-session list uses its narrower
666
+ * canonical set. Kimi and Cursor stay subscription-only for now.
667
+ */
668
+ export declare const DeviceSessionCli: S.Literals<readonly ["claude_code", "chatgpt", "grok", "opencode", "hermes", "shell"]>;
669
+ export type TDeviceSessionCli = S.Schema.Type<typeof DeviceSessionCli>;
670
+ /**
671
+ * CLIs for which `openllm -d <client>` (skip approvals) is meaningful.
672
+ * Canonical set — the picker, session-host, and any consumer import THIS
673
+ * rather than re-declaring their own membership list.
674
+ */
675
+ export declare const DANGEROUS_SESSION_CLIS: ReadonlySet<TDeviceSessionCli>;
676
+ /** CLIs with a local history reader on the daemon (v1). Canonical set. */
677
+ export declare const LISTABLE_SESSION_CLIS: ReadonlySet<TDeviceSessionCli>;
678
+ export declare const supportsDangerousSession: (cli: string) => boolean;
679
+ export declare const isListableSessionCli: (cli: string) => boolean;
680
+ /**
681
+ * One row from the daemon's local session index (vendor history +
682
+ * `~/.openllm/run/<client>/<pid>/live.json` + in-memory device PTYs).
683
+ * Used by `list_local_sessions` so the picker can attach / cold-resume
684
+ * without scanning disk in the browser.
685
+ */
686
+ export declare const LocalCliSession: S.Struct<{
687
+ /** Vendor session id when known; otherwise a synthetic live-run key. */
688
+ readonly id: S.String;
689
+ readonly title: S.String;
690
+ readonly cwd: S.NullOr<S.String>;
691
+ readonly updated_at_ms: S.Number;
692
+ readonly cli: S.Literals<readonly ["claude_code", "chatgpt", "grok", "opencode", "hermes", "shell"]>;
693
+ readonly live: S.Boolean;
694
+ /** Where the live process is hosted, when `live`. */
695
+ readonly host: S.optional<S.NullOr<S.Literals<readonly ["local", "device"]>>>;
696
+ /** OpenLLM device session id when the PTY is already hosted by the daemon. */
697
+ readonly openllm_session_id: S.optional<S.NullOr<S.String>>;
698
+ /** True when the browser can `mode:"attach"` without spawning a second CLI. */
699
+ readonly attachable: S.Boolean;
700
+ }>;
701
+ export type TLocalCliSession = S.Schema.Type<typeof LocalCliSession>;
702
+ /** Payload for `list_local_sessions`. */
703
+ export declare const ListLocalSessionsPayload: S.Struct<{
704
+ readonly cli: S.Literals<readonly ["claude_code", "chatgpt", "grok", "opencode", "hermes", "shell"]>;
705
+ /** Max rows (default 30 server-side; hard cap 100). */
706
+ readonly limit: S.optional<S.Number>;
707
+ }>;
708
+ export type TListLocalSessionsPayload = S.Schema.Type<typeof ListLocalSessionsPayload>;
709
+ /** Result blob for `list_local_sessions` (command ack / lifecycle.result). */
710
+ export declare const ListLocalSessionsResult: S.Struct<{
711
+ readonly sessions: S.$Array<S.Struct<{
712
+ /** Vendor session id when known; otherwise a synthetic live-run key. */
713
+ readonly id: S.String;
714
+ readonly title: S.String;
715
+ readonly cwd: S.NullOr<S.String>;
716
+ readonly updated_at_ms: S.Number;
717
+ readonly cli: S.Literals<readonly ["claude_code", "chatgpt", "grok", "opencode", "hermes", "shell"]>;
718
+ readonly live: S.Boolean;
719
+ /** Where the live process is hosted, when `live`. */
720
+ readonly host: S.optional<S.NullOr<S.Literals<readonly ["local", "device"]>>>;
721
+ /** OpenLLM device session id when the PTY is already hosted by the daemon. */
722
+ readonly openllm_session_id: S.optional<S.NullOr<S.String>>;
723
+ /** True when the browser can `mode:"attach"` without spawning a second CLI. */
724
+ readonly attachable: S.Boolean;
725
+ }>>;
726
+ }>;
727
+ export type TListLocalSessionsResult = S.Schema.Type<typeof ListLocalSessionsResult>;
728
+ /**
729
+ * Result blob for `refresh_models_due` (command ack / lifecycle.result).
730
+ * Always rides a `done` lifecycle — automatic discovery never surfaces as
731
+ * a user-facing command error. `attempted: false` + `reported: 0` is a
732
+ * quiet TTL/credential skip; `reported: 0` + `failed: true` is a total
733
+ * failure. The dashboard refetches `/v1/models` on `reported > 0`
734
+ * (including partial writes) and also on quiet skips (`failed === false`)
735
+ * so a cached query can pick up a catalog another trigger already POSTed.
736
+ */
737
+ export declare const RefreshModelsDueResult: S.Struct<{
738
+ readonly attempted: S.Boolean;
739
+ readonly reported: S.Number;
740
+ readonly failed: S.Boolean;
741
+ readonly error: S.optional<S.String>;
742
+ }>;
743
+ export type TRefreshModelsDueResult = S.Schema.Type<typeof RefreshModelsDueResult>;
744
+ /** Terminal exit reason retained for a dead but resumable device session. */
745
+ export declare const SessionExitReason: S.Literals<readonly ["evicted", "reaped", "done", "killed"]>;
746
+ export type TSessionExitReason = S.Schema.Type<typeof SessionExitReason>;
747
+ /** The closed set of install-time gateway modes: which base URL a client
748
+ * setup bakes — the local daemon (`local`, the default) or the cloud
749
+ * origin. ONE schema for every wire field and TS union that carries it. */
750
+ export declare const GatewayMode: S.Literals<readonly ["local", "cloud"]>;
751
+ export type TGatewayMode = S.Schema.Type<typeof GatewayMode>;
752
+ /** Device-local account slot of a subscription provider (multi-account,
753
+ * `docs/plan/multi-account-subscriptions.md`). Absent ⇒ 0, today's single
754
+ * account. Old daemons strip the field on decode and act on account 0, so
755
+ * senders must only set it when the daemon advertises
756
+ * `features.multi_account`. */
757
+ export declare const AccountIndex: S.Number;
758
+ export type TAccountIndex = S.Schema.Type<typeof AccountIndex>;
759
+ /** Team ids name the daemon's `team-keys/<id>.json`, so the wire admits only
760
+ * a path-safe id (the cloud mints UUIDs). */
761
+ export declare const TEAM_KEY_ID_PATTERN: RegExp;
762
+ /** One `openllm auth …` request run on the device by the same handler the CLI
763
+ * and MCP reach over loopback (`/local/auth`), so every surface shares one
764
+ * contract and one reply. The paste-back code never travels in clear:
765
+ * `sealed_code` is an X25519 sealed box to the daemon's pubkey. The daemon
766
+ * re-validates the opened request with `parseLocalAuthRequest`. */
767
+ declare const AuthPayload: S.Struct<{
768
+ readonly operation: S.Literals<["add-account" | "cancel" | "login" | "logout" | "pin-account" | "providers" | "refresh" | "remove-account" | "status" | "submit-code" | "unpin-account" | "usage", ...("add-account" | "cancel" | "login" | "logout" | "pin-account" | "providers" | "refresh" | "remove-account" | "status" | "submit-code" | "unpin-account" | "usage")[]]>;
769
+ readonly provider: S.optional<S.String>;
770
+ readonly method: S.optional<S.Literals<readonly ["browser", "device"]>>;
771
+ readonly flow_id: S.optional<S.String>;
772
+ readonly account: S.optional<S.Number>;
773
+ readonly label: S.optional<S.String>;
774
+ readonly since: S.optional<S.String>;
775
+ readonly wait_ms: S.optional<S.Int>;
776
+ readonly sealed_code: S.optional<S.String>;
777
+ }>;
778
+ export type TAuthPayload = S.Schema.Type<typeof AuthPayload>;
779
+ /** Decoding strips unknown keys, so enqueue boundaries also refuse any raw
780
+ * key outside this set — a plaintext `code` never transits the relay. */
781
+ export declare const AUTH_PAYLOAD_KEYS: ReadonlySet<string>;
782
+ export declare const authPayloadKeysAllowed: (payload: unknown) => boolean;
783
+ /** The bare `{ kind, payload }` vocabulary — what an enqueue boundary (the
784
+ * relay's watcher `enqueue` frame, `enqueueCommand` in `packages/api`)
785
+ * validates before writing a `daemon_commands` row. */
786
+ export declare const DaemonCommandBody: S.Union<readonly [S.Struct<{
787
+ readonly kind: S.Literals<readonly ["auth"]>;
788
+ readonly payload: S.Struct<{
789
+ readonly operation: S.Literals<["add-account" | "cancel" | "login" | "logout" | "pin-account" | "providers" | "refresh" | "remove-account" | "status" | "submit-code" | "unpin-account" | "usage", ...("add-account" | "cancel" | "login" | "logout" | "pin-account" | "providers" | "refresh" | "remove-account" | "status" | "submit-code" | "unpin-account" | "usage")[]]>;
790
+ readonly provider: S.optional<S.String>;
791
+ readonly method: S.optional<S.Literals<readonly ["browser", "device"]>>;
792
+ readonly flow_id: S.optional<S.String>;
793
+ readonly account: S.optional<S.Number>;
794
+ readonly label: S.optional<S.String>;
795
+ readonly since: S.optional<S.String>;
796
+ readonly wait_ms: S.optional<S.Int>;
797
+ readonly sealed_code: S.optional<S.String>;
798
+ }>;
799
+ }>, S.Struct<{
800
+ readonly kind: S.Literals<readonly ["connect"]>;
801
+ readonly payload: S.Struct<{
802
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
803
+ readonly account_index: S.optional<S.Number>;
804
+ }>;
805
+ }>, S.Struct<{
806
+ readonly kind: S.Literals<readonly ["connect_device_code"]>;
807
+ readonly payload: S.Struct<{
808
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
809
+ readonly account_index: S.optional<S.Number>;
810
+ }>;
811
+ }>, S.Struct<{
812
+ readonly kind: S.Literals<readonly ["cancel_connect"]>;
813
+ readonly payload: S.Struct<{
814
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
815
+ readonly account_index: S.optional<S.Number>;
816
+ readonly flow_id: S.optional<S.String>;
817
+ }>;
818
+ }>, S.Struct<{
819
+ readonly kind: S.Literals<readonly ["logout"]>;
820
+ readonly payload: S.Struct<{
821
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
822
+ readonly account_index: S.optional<S.Number>;
823
+ }>;
824
+ }>, S.Struct<{
825
+ readonly kind: S.Literals<readonly ["submit_login_code"]>;
826
+ readonly payload: S.Struct<{
827
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
828
+ readonly account_index: S.optional<S.Number>;
829
+ readonly sealed: S.String;
830
+ }>;
831
+ }>, S.Struct<{
832
+ readonly kind: S.Literals<readonly ["add_account"]>;
833
+ readonly payload: S.Struct<{
834
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
835
+ readonly label: S.optional<S.String>;
836
+ }>;
837
+ }>, S.Struct<{
838
+ readonly kind: S.Literals<readonly ["remove_account"]>;
839
+ readonly payload: S.Struct<{
840
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
841
+ readonly account_index: S.Number;
842
+ }>;
843
+ }>, S.Struct<{
844
+ readonly kind: S.Literals<readonly ["pin_account"]>;
845
+ readonly payload: S.Struct<{
846
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
847
+ readonly account_index: S.NullOr<S.Number>;
848
+ }>;
849
+ }>, S.Struct<{
850
+ readonly kind: S.Literals<readonly ["set_auto_update"]>;
851
+ readonly payload: S.Struct<{
852
+ readonly enabled: S.Boolean;
853
+ }>;
854
+ }>, S.Struct<{
855
+ readonly kind: S.Literals<readonly ["refresh"]>;
856
+ readonly payload: S.optional<S.Struct<{
857
+ readonly slug: S.optional<S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>>;
858
+ readonly account_index: S.optional<S.Number>;
859
+ readonly manual: S.optional<S.Boolean>;
860
+ }>>;
861
+ }>, S.Struct<{
862
+ readonly kind: S.Literals<readonly ["status"]>;
863
+ readonly payload: S.optional<S.Struct<{}>>;
864
+ }>, S.Struct<{
865
+ readonly kind: S.Literals<readonly ["update"]>;
866
+ readonly payload: S.optional<S.Struct<{}>>;
867
+ }>, S.Struct<{
868
+ readonly kind: S.Literals<readonly ["bust_plan_cache"]>;
869
+ readonly payload: S.optional<S.Struct<{}>>;
870
+ }>, S.Struct<{
871
+ readonly kind: S.Literals<readonly ["refresh_models"]>;
872
+ readonly payload: S.optional<S.Struct<{}>>;
873
+ }>, S.Struct<{
874
+ readonly kind: S.Literals<readonly ["refresh_models_due"]>;
875
+ readonly payload: S.optional<S.Struct<{}>>;
876
+ }>, S.Struct<{
877
+ readonly kind: S.Literals<readonly ["list_local_sessions"]>;
878
+ readonly payload: S.Struct<{
879
+ readonly cli: S.Literals<readonly ["claude_code", "chatgpt", "grok", "opencode", "hermes", "shell"]>;
880
+ /** Max rows (default 30 server-side; hard cap 100). */
881
+ readonly limit: S.optional<S.Number>;
882
+ }>;
883
+ }>, S.Struct<{
884
+ readonly kind: S.Literals<readonly ["local_rescan"]>;
885
+ readonly payload: S.optional<S.Struct<{}>>;
886
+ }>, S.Struct<{
887
+ readonly kind: S.Literals<readonly ["set_local_key"]>;
888
+ readonly payload: S.Struct<{
889
+ readonly port: S.Number;
890
+ readonly sealed: S.Union<readonly [S.String, S.Literal<"">]>;
891
+ }>;
892
+ }>, S.Struct<{
893
+ readonly kind: S.Literals<readonly ["set_provider_key"]>;
894
+ readonly payload: S.Struct<{
895
+ readonly slug: S.Literals<readonly ["opencode_go", "zai_coding", "minimax_coding"]>;
896
+ readonly account_index: S.optional<S.Number>;
897
+ readonly sealed: S.Union<readonly [S.String, S.Literal<"">]>;
898
+ readonly label: S.optional<S.String>;
899
+ }>;
900
+ }>, S.Struct<{
901
+ readonly kind: S.Literals<readonly ["set_team_key"]>;
902
+ readonly payload: S.Struct<{
903
+ readonly team_id: S.String;
904
+ readonly epoch: S.Int;
905
+ readonly sealed: S.String;
906
+ }>;
907
+ }>, S.Struct<{
908
+ readonly kind: S.Literals<readonly ["delete_team_key"]>;
909
+ readonly payload: S.Struct<{
910
+ readonly team_id: S.String;
911
+ }>;
912
+ }>, S.Struct<{
913
+ readonly kind: S.Literals<readonly ["set_device_sessions"]>;
914
+ readonly payload: S.Struct<{
915
+ readonly statement: S.String;
916
+ }>;
917
+ }>]>;
918
+ export type TDaemonCommandBody = S.Schema.Type<typeof DaemonCommandBody>;
919
+ /** Every kind in the closed vocabulary (the union's discriminants). */
920
+ export type TDaemonCommandKind = TDaemonCommandBody["kind"];
921
+ /** Runtime literal of the closed command vocabulary — the discriminant only,
922
+ * no payload. Used by `control-channel.ts`'s `CommandLifecycle` to echo which
923
+ * command a lifecycle frame is reporting on. The `_kindDriftGuard` below makes
924
+ * this fail to compile if it ever drifts from the `commandVariants` union, so
925
+ * the two stay in lockstep without duplicating the payload mapping. */
926
+ export declare const DaemonCommandKind: S.Literals<readonly ["auth", "connect", "connect_device_code", "cancel_connect", "logout", "submit_login_code", "add_account", "remove_account", "pin_account", "set_auto_update", "refresh", "status", "update", "bust_plan_cache", "refresh_models", "refresh_models_due", "list_local_sessions", "local_rescan", "set_local_key", "set_provider_key", "set_team_key", "delete_team_key", "set_device_sessions"]>;
927
+ /** One control command delivered to the daemon over its relay socket.
928
+ * `id` is `daemon_commands.id` (bigserial), stringified for the wire. */
929
+ export declare const DaemonCommand: S.Union<readonly [S.Struct<{
930
+ id: S.String;
931
+ replay_session_id: S.optional<S.String>;
932
+ } & {
933
+ readonly kind: S.Literals<readonly ["auth"]>;
934
+ readonly payload: S.Struct<{
935
+ readonly operation: S.Literals<["add-account" | "cancel" | "login" | "logout" | "pin-account" | "providers" | "refresh" | "remove-account" | "status" | "submit-code" | "unpin-account" | "usage", ...("add-account" | "cancel" | "login" | "logout" | "pin-account" | "providers" | "refresh" | "remove-account" | "status" | "submit-code" | "unpin-account" | "usage")[]]>;
936
+ readonly provider: S.optional<S.String>;
937
+ readonly method: S.optional<S.Literals<readonly ["browser", "device"]>>;
938
+ readonly flow_id: S.optional<S.String>;
939
+ readonly account: S.optional<S.Number>;
940
+ readonly label: S.optional<S.String>;
941
+ readonly since: S.optional<S.String>;
942
+ readonly wait_ms: S.optional<S.Int>;
943
+ readonly sealed_code: S.optional<S.String>;
944
+ }>;
945
+ }>, S.Struct<{
946
+ id: S.String;
947
+ replay_session_id: S.optional<S.String>;
948
+ } & {
949
+ readonly kind: S.Literals<readonly ["connect"]>;
950
+ readonly payload: S.Struct<{
951
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
952
+ readonly account_index: S.optional<S.Number>;
953
+ }>;
954
+ }>, S.Struct<{
955
+ id: S.String;
956
+ replay_session_id: S.optional<S.String>;
957
+ } & {
958
+ readonly kind: S.Literals<readonly ["connect_device_code"]>;
959
+ readonly payload: S.Struct<{
960
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
961
+ readonly account_index: S.optional<S.Number>;
962
+ }>;
963
+ }>, S.Struct<{
964
+ id: S.String;
965
+ replay_session_id: S.optional<S.String>;
966
+ } & {
967
+ readonly kind: S.Literals<readonly ["cancel_connect"]>;
968
+ readonly payload: S.Struct<{
969
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
970
+ readonly account_index: S.optional<S.Number>;
971
+ readonly flow_id: S.optional<S.String>;
972
+ }>;
973
+ }>, S.Struct<{
974
+ id: S.String;
975
+ replay_session_id: S.optional<S.String>;
976
+ } & {
977
+ readonly kind: S.Literals<readonly ["logout"]>;
978
+ readonly payload: S.Struct<{
979
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
980
+ readonly account_index: S.optional<S.Number>;
981
+ }>;
982
+ }>, S.Struct<{
983
+ id: S.String;
984
+ replay_session_id: S.optional<S.String>;
985
+ } & {
986
+ readonly kind: S.Literals<readonly ["submit_login_code"]>;
987
+ readonly payload: S.Struct<{
988
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
989
+ readonly account_index: S.optional<S.Number>;
990
+ readonly sealed: S.String;
991
+ }>;
992
+ }>, S.Struct<{
993
+ id: S.String;
994
+ replay_session_id: S.optional<S.String>;
995
+ } & {
996
+ readonly kind: S.Literals<readonly ["add_account"]>;
997
+ readonly payload: S.Struct<{
998
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
999
+ readonly label: S.optional<S.String>;
1000
+ }>;
1001
+ }>, S.Struct<{
1002
+ id: S.String;
1003
+ replay_session_id: S.optional<S.String>;
1004
+ } & {
1005
+ readonly kind: S.Literals<readonly ["remove_account"]>;
1006
+ readonly payload: S.Struct<{
1007
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
1008
+ readonly account_index: S.Number;
1009
+ }>;
1010
+ }>, S.Struct<{
1011
+ id: S.String;
1012
+ replay_session_id: S.optional<S.String>;
1013
+ } & {
1014
+ readonly kind: S.Literals<readonly ["pin_account"]>;
1015
+ readonly payload: S.Struct<{
1016
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
1017
+ readonly account_index: S.NullOr<S.Number>;
1018
+ }>;
1019
+ }>, S.Struct<{
1020
+ id: S.String;
1021
+ replay_session_id: S.optional<S.String>;
1022
+ } & {
1023
+ readonly kind: S.Literals<readonly ["set_auto_update"]>;
1024
+ readonly payload: S.Struct<{
1025
+ readonly enabled: S.Boolean;
1026
+ }>;
1027
+ }>, S.Struct<{
1028
+ id: S.String;
1029
+ replay_session_id: S.optional<S.String>;
1030
+ } & {
1031
+ readonly kind: S.Literals<readonly ["refresh"]>;
1032
+ readonly payload: S.optional<S.Struct<{
1033
+ readonly slug: S.optional<S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>>;
1034
+ readonly account_index: S.optional<S.Number>;
1035
+ readonly manual: S.optional<S.Boolean>;
1036
+ }>>;
1037
+ }>, S.Struct<{
1038
+ id: S.String;
1039
+ replay_session_id: S.optional<S.String>;
1040
+ } & {
1041
+ readonly kind: S.Literals<readonly ["status"]>;
1042
+ readonly payload: S.optional<S.Struct<{}>>;
1043
+ }>, S.Struct<{
1044
+ id: S.String;
1045
+ replay_session_id: S.optional<S.String>;
1046
+ } & {
1047
+ readonly kind: S.Literals<readonly ["update"]>;
1048
+ readonly payload: S.optional<S.Struct<{}>>;
1049
+ }>, S.Struct<{
1050
+ id: S.String;
1051
+ replay_session_id: S.optional<S.String>;
1052
+ } & {
1053
+ readonly kind: S.Literals<readonly ["bust_plan_cache"]>;
1054
+ readonly payload: S.optional<S.Struct<{}>>;
1055
+ }>, S.Struct<{
1056
+ id: S.String;
1057
+ replay_session_id: S.optional<S.String>;
1058
+ } & {
1059
+ readonly kind: S.Literals<readonly ["refresh_models"]>;
1060
+ readonly payload: S.optional<S.Struct<{}>>;
1061
+ }>, S.Struct<{
1062
+ id: S.String;
1063
+ replay_session_id: S.optional<S.String>;
1064
+ } & {
1065
+ readonly kind: S.Literals<readonly ["refresh_models_due"]>;
1066
+ readonly payload: S.optional<S.Struct<{}>>;
1067
+ }>, S.Struct<{
1068
+ id: S.String;
1069
+ replay_session_id: S.optional<S.String>;
1070
+ } & {
1071
+ readonly kind: S.Literals<readonly ["list_local_sessions"]>;
1072
+ readonly payload: S.Struct<{
1073
+ readonly cli: S.Literals<readonly ["claude_code", "chatgpt", "grok", "opencode", "hermes", "shell"]>;
1074
+ /** Max rows (default 30 server-side; hard cap 100). */
1075
+ readonly limit: S.optional<S.Number>;
1076
+ }>;
1077
+ }>, S.Struct<{
1078
+ id: S.String;
1079
+ replay_session_id: S.optional<S.String>;
1080
+ } & {
1081
+ readonly kind: S.Literals<readonly ["local_rescan"]>;
1082
+ readonly payload: S.optional<S.Struct<{}>>;
1083
+ }>, S.Struct<{
1084
+ id: S.String;
1085
+ replay_session_id: S.optional<S.String>;
1086
+ } & {
1087
+ readonly kind: S.Literals<readonly ["set_local_key"]>;
1088
+ readonly payload: S.Struct<{
1089
+ readonly port: S.Number;
1090
+ readonly sealed: S.Union<readonly [S.String, S.Literal<"">]>;
1091
+ }>;
1092
+ }>, S.Struct<{
1093
+ id: S.String;
1094
+ replay_session_id: S.optional<S.String>;
1095
+ } & {
1096
+ readonly kind: S.Literals<readonly ["set_provider_key"]>;
1097
+ readonly payload: S.Struct<{
1098
+ readonly slug: S.Literals<readonly ["opencode_go", "zai_coding", "minimax_coding"]>;
1099
+ readonly account_index: S.optional<S.Number>;
1100
+ readonly sealed: S.Union<readonly [S.String, S.Literal<"">]>;
1101
+ readonly label: S.optional<S.String>;
1102
+ }>;
1103
+ }>, S.Struct<{
1104
+ id: S.String;
1105
+ replay_session_id: S.optional<S.String>;
1106
+ } & {
1107
+ readonly kind: S.Literals<readonly ["set_team_key"]>;
1108
+ readonly payload: S.Struct<{
1109
+ readonly team_id: S.String;
1110
+ readonly epoch: S.Int;
1111
+ readonly sealed: S.String;
1112
+ }>;
1113
+ }>, S.Struct<{
1114
+ id: S.String;
1115
+ replay_session_id: S.optional<S.String>;
1116
+ } & {
1117
+ readonly kind: S.Literals<readonly ["delete_team_key"]>;
1118
+ readonly payload: S.Struct<{
1119
+ readonly team_id: S.String;
1120
+ }>;
1121
+ }>, S.Struct<{
1122
+ id: S.String;
1123
+ replay_session_id: S.optional<S.String>;
1124
+ } & {
1125
+ readonly kind: S.Literals<readonly ["set_device_sessions"]>;
1126
+ readonly payload: S.Struct<{
1127
+ readonly statement: S.String;
1128
+ }>;
1129
+ }>]>;
1130
+ export type TDaemonCommand = S.Schema.Type<typeof DaemonCommand>;
1131
+ /** POST /api/daemon/cmd (dashboard → cloud) — enqueue for a target key
1132
+ * (`key_id` must belong to the session user). */
1133
+ export declare const DaemonCmdRequest: S.Union<readonly [S.Struct<{
1134
+ key_id: S.String;
1135
+ } & {
1136
+ readonly kind: S.Literals<readonly ["auth"]>;
1137
+ readonly payload: S.Struct<{
1138
+ readonly operation: S.Literals<["add-account" | "cancel" | "login" | "logout" | "pin-account" | "providers" | "refresh" | "remove-account" | "status" | "submit-code" | "unpin-account" | "usage", ...("add-account" | "cancel" | "login" | "logout" | "pin-account" | "providers" | "refresh" | "remove-account" | "status" | "submit-code" | "unpin-account" | "usage")[]]>;
1139
+ readonly provider: S.optional<S.String>;
1140
+ readonly method: S.optional<S.Literals<readonly ["browser", "device"]>>;
1141
+ readonly flow_id: S.optional<S.String>;
1142
+ readonly account: S.optional<S.Number>;
1143
+ readonly label: S.optional<S.String>;
1144
+ readonly since: S.optional<S.String>;
1145
+ readonly wait_ms: S.optional<S.Int>;
1146
+ readonly sealed_code: S.optional<S.String>;
1147
+ }>;
1148
+ }>, S.Struct<{
1149
+ key_id: S.String;
1150
+ } & {
1151
+ readonly kind: S.Literals<readonly ["connect"]>;
1152
+ readonly payload: S.Struct<{
1153
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
1154
+ readonly account_index: S.optional<S.Number>;
1155
+ }>;
1156
+ }>, S.Struct<{
1157
+ key_id: S.String;
1158
+ } & {
1159
+ readonly kind: S.Literals<readonly ["connect_device_code"]>;
1160
+ readonly payload: S.Struct<{
1161
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
1162
+ readonly account_index: S.optional<S.Number>;
1163
+ }>;
1164
+ }>, S.Struct<{
1165
+ key_id: S.String;
1166
+ } & {
1167
+ readonly kind: S.Literals<readonly ["cancel_connect"]>;
1168
+ readonly payload: S.Struct<{
1169
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
1170
+ readonly account_index: S.optional<S.Number>;
1171
+ readonly flow_id: S.optional<S.String>;
1172
+ }>;
1173
+ }>, S.Struct<{
1174
+ key_id: S.String;
1175
+ } & {
1176
+ readonly kind: S.Literals<readonly ["logout"]>;
1177
+ readonly payload: S.Struct<{
1178
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
1179
+ readonly account_index: S.optional<S.Number>;
1180
+ }>;
1181
+ }>, S.Struct<{
1182
+ key_id: S.String;
1183
+ } & {
1184
+ readonly kind: S.Literals<readonly ["submit_login_code"]>;
1185
+ readonly payload: S.Struct<{
1186
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
1187
+ readonly account_index: S.optional<S.Number>;
1188
+ readonly sealed: S.String;
1189
+ }>;
1190
+ }>, S.Struct<{
1191
+ key_id: S.String;
1192
+ } & {
1193
+ readonly kind: S.Literals<readonly ["add_account"]>;
1194
+ readonly payload: S.Struct<{
1195
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
1196
+ readonly label: S.optional<S.String>;
1197
+ }>;
1198
+ }>, S.Struct<{
1199
+ key_id: S.String;
1200
+ } & {
1201
+ readonly kind: S.Literals<readonly ["remove_account"]>;
1202
+ readonly payload: S.Struct<{
1203
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
1204
+ readonly account_index: S.Number;
1205
+ }>;
1206
+ }>, S.Struct<{
1207
+ key_id: S.String;
1208
+ } & {
1209
+ readonly kind: S.Literals<readonly ["pin_account"]>;
1210
+ readonly payload: S.Struct<{
1211
+ readonly slug: S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>;
1212
+ readonly account_index: S.NullOr<S.Number>;
1213
+ }>;
1214
+ }>, S.Struct<{
1215
+ key_id: S.String;
1216
+ } & {
1217
+ readonly kind: S.Literals<readonly ["set_auto_update"]>;
1218
+ readonly payload: S.Struct<{
1219
+ readonly enabled: S.Boolean;
1220
+ }>;
1221
+ }>, S.Struct<{
1222
+ key_id: S.String;
1223
+ } & {
1224
+ readonly kind: S.Literals<readonly ["refresh"]>;
1225
+ readonly payload: S.optional<S.Struct<{
1226
+ readonly slug: S.optional<S.Literals<readonly ["claude_code", "chatgpt", "kimi_code", "grok", "cursor", "muse", "antigravity"]>>;
1227
+ readonly account_index: S.optional<S.Number>;
1228
+ readonly manual: S.optional<S.Boolean>;
1229
+ }>>;
1230
+ }>, S.Struct<{
1231
+ key_id: S.String;
1232
+ } & {
1233
+ readonly kind: S.Literals<readonly ["status"]>;
1234
+ readonly payload: S.optional<S.Struct<{}>>;
1235
+ }>, S.Struct<{
1236
+ key_id: S.String;
1237
+ } & {
1238
+ readonly kind: S.Literals<readonly ["update"]>;
1239
+ readonly payload: S.optional<S.Struct<{}>>;
1240
+ }>, S.Struct<{
1241
+ key_id: S.String;
1242
+ } & {
1243
+ readonly kind: S.Literals<readonly ["bust_plan_cache"]>;
1244
+ readonly payload: S.optional<S.Struct<{}>>;
1245
+ }>, S.Struct<{
1246
+ key_id: S.String;
1247
+ } & {
1248
+ readonly kind: S.Literals<readonly ["refresh_models"]>;
1249
+ readonly payload: S.optional<S.Struct<{}>>;
1250
+ }>, S.Struct<{
1251
+ key_id: S.String;
1252
+ } & {
1253
+ readonly kind: S.Literals<readonly ["refresh_models_due"]>;
1254
+ readonly payload: S.optional<S.Struct<{}>>;
1255
+ }>, S.Struct<{
1256
+ key_id: S.String;
1257
+ } & {
1258
+ readonly kind: S.Literals<readonly ["list_local_sessions"]>;
1259
+ readonly payload: S.Struct<{
1260
+ readonly cli: S.Literals<readonly ["claude_code", "chatgpt", "grok", "opencode", "hermes", "shell"]>;
1261
+ /** Max rows (default 30 server-side; hard cap 100). */
1262
+ readonly limit: S.optional<S.Number>;
1263
+ }>;
1264
+ }>, S.Struct<{
1265
+ key_id: S.String;
1266
+ } & {
1267
+ readonly kind: S.Literals<readonly ["local_rescan"]>;
1268
+ readonly payload: S.optional<S.Struct<{}>>;
1269
+ }>, S.Struct<{
1270
+ key_id: S.String;
1271
+ } & {
1272
+ readonly kind: S.Literals<readonly ["set_local_key"]>;
1273
+ readonly payload: S.Struct<{
1274
+ readonly port: S.Number;
1275
+ readonly sealed: S.Union<readonly [S.String, S.Literal<"">]>;
1276
+ }>;
1277
+ }>, S.Struct<{
1278
+ key_id: S.String;
1279
+ } & {
1280
+ readonly kind: S.Literals<readonly ["set_provider_key"]>;
1281
+ readonly payload: S.Struct<{
1282
+ readonly slug: S.Literals<readonly ["opencode_go", "zai_coding", "minimax_coding"]>;
1283
+ readonly account_index: S.optional<S.Number>;
1284
+ readonly sealed: S.Union<readonly [S.String, S.Literal<"">]>;
1285
+ readonly label: S.optional<S.String>;
1286
+ }>;
1287
+ }>, S.Struct<{
1288
+ key_id: S.String;
1289
+ } & {
1290
+ readonly kind: S.Literals<readonly ["set_team_key"]>;
1291
+ readonly payload: S.Struct<{
1292
+ readonly team_id: S.String;
1293
+ readonly epoch: S.Int;
1294
+ readonly sealed: S.String;
1295
+ }>;
1296
+ }>, S.Struct<{
1297
+ key_id: S.String;
1298
+ } & {
1299
+ readonly kind: S.Literals<readonly ["delete_team_key"]>;
1300
+ readonly payload: S.Struct<{
1301
+ readonly team_id: S.String;
1302
+ }>;
1303
+ }>, S.Struct<{
1304
+ key_id: S.String;
1305
+ } & {
1306
+ readonly kind: S.Literals<readonly ["set_device_sessions"]>;
1307
+ readonly payload: S.Struct<{
1308
+ readonly statement: S.String;
1309
+ }>;
1310
+ }>]>;
1311
+ export type TDaemonCmdRequest = S.Schema.Type<typeof DaemonCmdRequest>;
1312
+ /** A command result the daemon reports back over its relay socket (the
1313
+ * `ack`/`status` frames in `relay.ts` carry these). */
1314
+ export declare const DaemonCommandAck: S.Struct<{
1315
+ readonly id: S.String;
1316
+ /** `ack` confirms that the daemon dequeued the command. Terminal outcomes
1317
+ * retain the previous ack shape for older relay binaries. */
1318
+ readonly status: S.Literals<readonly ["ack", "done", "not_done", "error"]>;
1319
+ readonly result: S.optional<S.Unknown>;
1320
+ }>;
1321
+ export type TDaemonCommandAck = S.Schema.Type<typeof DaemonCommandAck>;
1322
+ /** Per-provider auth-status on the daemon wire.
1323
+ * `connected` = signed in; `disconnected` = unexpected loss; `signed_out` =
1324
+ * user-initiated logout (sticky until the next successful login). */
1325
+ export declare const DaemonProviderAuthStatus: S.Literals<readonly ["connected", "disconnected", "signed_out"]>;
1326
+ export type TDaemonProviderAuthStatus = S.Schema.Type<typeof DaemonProviderAuthStatus>;
1327
+ /** Latest model-list outcome for a connected oauth provider (UI live signal). */
1328
+ export declare const DaemonModelsStatus: S.Literals<readonly ["ok", "unavailable"]>;
1329
+ export type TDaemonModelsStatus = S.Schema.Type<typeof DaemonModelsStatus>;
1330
+ /**
1331
+ * Closed reasons for `models_status: "unavailable"`. Matches the daemon's
1332
+ * listModels null tokens; unknown `http_*` collapses to `http_error` on the
1333
+ * wire. Never paths, bodies, or headers.
1334
+ */
1335
+ export declare const DaemonModelsReason: S.Literals<readonly ["token_unavailable", "version_unresolved", "empty_after_filter", "error", "http_401", "http_403", "http_404", "http_429", "http_500", "http_502", "http_503", "http_error"]>;
1336
+ export type TDaemonModelsReason = S.Schema.Type<typeof DaemonModelsReason>;
1337
+ export declare const DaemonProviderConnection: S.Struct<{
1338
+ readonly provider: S.String;
1339
+ /**
1340
+ * Auth-status literal — the single source of truth.
1341
+ * `connected` = signed in; `disconnected` = unexpected loss;
1342
+ * `signed_out` = user-initiated logout (sticky until the next login).
1343
+ */
1344
+ readonly status: S.Literals<readonly ["connected", "disconnected", "signed_out"]>;
1345
+ /**
1346
+ * Typed observation. Optional so old daemons and persisted blobs remain
1347
+ * valid. When present it wins over legacy `status` / `detail` classifiers.
1348
+ * `unknown` is never logout and never proven serviceability.
1349
+ */
1350
+ readonly observation: S.optional<S.Literals<readonly ["connected", "signed_out", "disconnected", "unknown"]>>;
1351
+ /** Machine-readable cause for a non-connected observation. Display copy stays on `detail`. */
1352
+ readonly reason_code: S.optional<S.Literals<readonly ["probe_timeout", "probe_failed", "keychain_unavailable", "store_unreadable", "cli_unavailable", "cli_runtime_missing", "credential_absent"]>>;
1353
+ /** The vendor CLI the daemon runs is installed on the machine. The daemon
1354
+ * never installs it — installs are user-run (the daemon install script or by
1355
+ * hand); the daemon lazily auto-links its isolated run-view
1356
+ * (~/.openllm/cli/<provider>/) to the host binary. When false the dashboard
1357
+ * prompts the user to (re-)run the daemon installer. Absent means a status
1358
+ * probe failed before it could determine installation state; consumers must
1359
+ * not treat absence as not installed. */
1360
+ readonly cli_installed: S.optional<S.Boolean>;
1361
+ /** Progress of an OpenLLM-started background vendor installer. Independent
1362
+ * of authentication and CLI presence; absent on older daemons or externally
1363
+ * managed installations. Contains no logs, process identity or host paths. */
1364
+ readonly cli_install: S.optional<S.Struct<{
1365
+ readonly attempt_id: S.String;
1366
+ readonly stage: S.Literals<readonly ["installing", "awaiting_detection", "failed", "interrupted"]>;
1367
+ readonly started_at_ms: S.Int;
1368
+ readonly updated_at_ms: S.Int;
1369
+ readonly reason: S.optional<S.Literals<readonly ["installer_failed", "interrupted", "detection_timeout"]>>;
1370
+ }>>;
1371
+ /** Version of the isolated CLI, when installed + readable. */
1372
+ readonly cli_version: S.optional<S.String>;
1373
+ /** The user appears signed in to this vendor's CLI in their OWN home on the
1374
+ * daemon's machine (e.g. `~/.codex/auth.json` holds a ChatGPT login). A
1375
+ * read-only, secret-free presence hint so onboarding can put that provider
1376
+ * first with a one-tap Connect. It is never a connection: the daemon does
1377
+ * not copy, import or use that credential, and Connect still runs the
1378
+ * vendor login inside the daemon's isolated home. Absent = unknown (an
1379
+ * older daemon, a provider whose host store sits in an OS keychain the
1380
+ * daemon will not touch, or an unreadable store); consumers must not read
1381
+ * absence as signed out. */
1382
+ readonly host_signed_in: S.optional<S.Boolean>;
1383
+ readonly detail: S.optional<S.String>;
1384
+ readonly last_login_at_ms: S.optional<S.NullOr<S.Number>>;
1385
+ /** A LIVE device-code flow awaiting the user (codex/kimi on a remote box):
1386
+ * the verification URL + one-time code to surface so the dashboard can
1387
+ * render a synced "open this link, enter this code" panel. Present only
1388
+ * while a flow is pending; cleared the moment the credential lands. The
1389
+ * card flips to Connected automatically on the next status push.
1390
+ *
1391
+ * The actionable `url`/`code` are OPTIONAL because the relay REDACTS them
1392
+ * from the broadcast + persisted status for every dashboard EXCEPT the one
1393
+ * that started the login (issue #3 — otherwise the OAuth secret fans out to
1394
+ * every same-user browser). A redacted / marker snapshot is the non-secret
1395
+ * owner shape `{ pending: true, flow_id?, started_at_ms?, cancel_requested?,
1396
+ * mode? }` with no url/code — not a new `mode` value. The initiating
1397
+ * dashboard receives `{ url, code, mode? }` on `auth.login.prompt` only.
1398
+ * UIs must treat a missing/empty `url` as non-actionable (never auto-open).
1399
+ * A cached HTTP/DB marker is unconfirmed until a current-session ordered
1400
+ * live `status_push` is applied; TTL does not evict that live owner. */
1401
+ readonly pending_auth: S.optional<S.NullOr<S.Struct<{
1402
+ readonly url: S.optional<S.String>;
1403
+ readonly code: S.optional<S.String>;
1404
+ /** True on a REDACTED snapshot (non-origin watcher / persisted row):
1405
+ * a login is in progress but the actionable url/code were stripped. */
1406
+ readonly pending: S.optional<S.Boolean>;
1407
+ /** `device_code` (codex/kimi: surface URL + one-time code to enter in
1408
+ * the browser, then poll) or `paste_code` (claude headless login:
1409
+ * surface URL, then a paste-back input for the code the hosted
1410
+ * callback page displays). Absent ⇒ `device_code`. */
1411
+ readonly mode: S.optional<S.Literals<readonly ["device_code", "paste_code"]>>;
1412
+ /** Relay command id of the login that produced this snapshot (same
1413
+ * value as `auth.login.*` `flow_id`). The browser `req_id` lives on
1414
+ * `command_lifecycle`, not here. Absent on daemons predating auth
1415
+ * events. */
1416
+ readonly flow_id: S.optional<S.String>;
1417
+ /** Epoch ms when this pending flow was created. Carried on both the
1418
+ * actionable and the REDACTED snapshot so every consumer can expire a
1419
+ * STALE entry (older than {@link PENDING_AUTH_TTL_MS}) without needing
1420
+ * the daemon to re-push. The daemon persists its whole status snapshot
1421
+ * to `api_key_activity.daemon_status_json`; an abandoned/never-completed
1422
+ * login (or a daemon restart that drops the live child) would otherwise
1423
+ * leave a dead `pending_auth` in that row forever, and the dashboard
1424
+ * would re-surface + auto-open a sign-in flow that no longer exists on
1425
+ * every cold load. Absent on daemons predating this field. */
1426
+ readonly started_at_ms: S.optional<S.Number>;
1427
+ /** Slot-derived: cancel was accepted but the owner is still
1428
+ * contained. Additive; older decoders ignore it. Not a new mode. */
1429
+ readonly cancel_requested: S.optional<S.Boolean>;
1430
+ }>>>;
1431
+ /** Metadata-only usage snapshot for a CONNECTED provider, read locally by
1432
+ * the daemon and pushed with its status. Absent when not connected or the
1433
+ * read failed. */
1434
+ readonly usage: S.optional<S.NullOr<S.Union<readonly [S.Struct<{
1435
+ readonly kind: S.Literal<"quota">;
1436
+ readonly status: S.Literals<readonly ["allowed", "allowed_warning", "rejected"]>;
1437
+ readonly plan: S.optional<S.String>;
1438
+ readonly plan_source: S.optional<S.String>;
1439
+ readonly windows: S.$Array<S.Struct<{
1440
+ readonly label: S.String;
1441
+ readonly meter_id: S.optional<S.String>;
1442
+ readonly percent_used: S.Number;
1443
+ readonly reset_at_ms: S.NullOr<S.Number>;
1444
+ readonly window_ms: S.optional<S.Number>;
1445
+ }>>;
1446
+ readonly note: S.String;
1447
+ readonly as_of_ms: S.optional<S.Number>;
1448
+ readonly stale: S.optional<S.Boolean>;
1449
+ readonly refresh_failure: S.optional<S.Struct<{
1450
+ readonly reason: S.Literals<readonly ["credential_expired", "account_changed", "rate_limited", "authorization_failed", "subscription_inactive", "fetch_failed"]>;
1451
+ readonly at_ms: S.optional<S.Number>;
1452
+ }>>;
1453
+ readonly extra_pools: S.optional<S.$Array<S.Struct<{
1454
+ readonly label: S.String;
1455
+ readonly meter_id: S.optional<S.String>;
1456
+ readonly percent_used: S.Number;
1457
+ readonly reset_at_ms: S.NullOr<S.Number>;
1458
+ readonly window_ms: S.optional<S.Number>;
1459
+ }>>>;
1460
+ readonly credits: S.optional<S.Struct<{
1461
+ readonly balance: S.String;
1462
+ readonly unlimited: S.optional<S.Boolean>;
1463
+ readonly reset_credits: S.optional<S.Number>;
1464
+ }>>;
1465
+ }>, S.Struct<{
1466
+ readonly kind: S.Literal<"plan">;
1467
+ readonly plan: S.String;
1468
+ readonly note: S.String;
1469
+ }>, S.Struct<{
1470
+ readonly kind: S.Literal<"unavailable">;
1471
+ readonly reason: S.String;
1472
+ readonly link: S.optional<S.String>;
1473
+ }>]>>>;
1474
+ /**
1475
+ * Live local hop cooldown with reason `auth` (any model of this provider).
1476
+ * Visibility only — does not change `status` / `observation` / `reason_code`.
1477
+ * Transient; not remembered as last-known.
1478
+ */
1479
+ readonly upstream_auth_cooldown: S.optional<S.Struct<{
1480
+ readonly until_ms: S.Number;
1481
+ readonly model_id: S.String;
1482
+ readonly reason_code: S.optional<S.Literals<readonly ["refresh_abandoned", "refresh_failed"]>>;
1483
+ }>>;
1484
+ /** Obscured vendor-account identity for a CONNECTED provider:
1485
+ * sha256("openllm-account-v1:<provider>:<stable-account-id>") over the
1486
+ * stable account id the vendor CLI stores locally (Anthropic's
1487
+ * accountUuid, ChatGPT's account_id, Kimi's user_id, Grok's user_id).
1488
+ * Lets the cloud key usage-meter series per ACCOUNT — two devices on the
1489
+ * same account share the hash; a second account on the same provider gets
1490
+ * its own — without ever shipping the raw vendor id off-box. Absent when
1491
+ * not connected or unreadable, and on daemons predating it. See
1492
+ * docs/proposals/inferred-subscription-usage-calibration.md §10. */
1493
+ readonly account_hash: S.optional<S.String>;
1494
+ /** Device-local account slot this row describes (multi-account). Several
1495
+ * rows may share one `provider` with distinct indexes. Absent ⇒ 0. */
1496
+ readonly account_index: S.optional<S.Number>;
1497
+ /** User label for the account slot, when set. */
1498
+ readonly account_label: S.optional<S.String>;
1499
+ /** True on the slot the user pinned first in routing for this provider. */
1500
+ readonly account_pinned: S.optional<S.Boolean>;
1501
+ /** `local_key` slots only: the last four characters of the stored key, so
1502
+ * the user can tell keys apart. Never more of the secret. */
1503
+ readonly key_hint: S.optional<S.String>;
1504
+ /**
1505
+ * Latest live model-list / discover outcome for this provider (UI signal for
1506
+ * "Connected, but this device hasn't reported models yet"). Optional +
1507
+ * omitted when never attempted so older daemons and older clients stay
1508
+ * compatible. Mirror of how {@link LocalServerState} carries models.
1509
+ */
1510
+ readonly models_status: S.optional<S.Literals<readonly ["ok", "unavailable"]>>;
1511
+ /** Closed null-reason when `models_status` is `unavailable`. Omitted on `ok`. */
1512
+ readonly models_reason: S.optional<S.Literals<readonly ["token_unavailable", "version_unresolved", "empty_after_filter", "error", "http_401", "http_403", "http_404", "http_429", "http_500", "http_502", "http_503", "http_error"]>>;
1513
+ }>;
1514
+ export type TDaemonProviderConnection = S.Schema.Type<typeof DaemonProviderConnection>;
1515
+ /** `control_caps` entry: the daemon understands `account_index` on auth
1516
+ * commands and the `add_account` / `remove_account` / `pin_account` kinds.
1517
+ * Senders must not address account n >= 1 without it (old daemons strip the
1518
+ * field and would act on account 0). */
1519
+ export declare const MULTI_ACCOUNT_CONTROL_CAP = "multi_account";
1520
+ /** Control cap: the daemon runs the unified `auth` command (kind `"auth"`).
1521
+ * Older daemons drop an unknown kind silently; the browser must refuse with
1522
+ * `daemon_outdated` when this cap is absent rather than waiting out a timeout. */
1523
+ export declare const AUTH_CONTROL_CAP = "auth";
1524
+ /** Control cap: the daemon stores `local_key` provider keys
1525
+ * (`set_provider_key`) and reports each slot as a `connections` row. */
1526
+ export declare const LOCAL_KEY_PROVIDERS_CONTROL_CAP = "local_key_providers_v1";
1527
+ /** Control cap: the daemon executes the signed `set_device_sessions` disable. */
1528
+ export declare const DEVICE_SESSIONS_CONTROL_CAP = "device_sessions_v1";
1529
+ /** Control cap: the daemon holds team keys (`set_team_key` /
1530
+ * `delete_team_key`) and reports them in `team_psk`. */
1531
+ export declare const TEAM_KEY_CUSTODY_CONTROL_CAP = "team_key_custody_v1";
1532
+ /** One team key this device holds — the epoch only, never the key. */
1533
+ export declare const DaemonTeamKeyEpoch: S.Struct<{
1534
+ readonly team_id: S.String;
1535
+ readonly epoch: S.Int;
1536
+ }>;
1537
+ export type TDaemonTeamKeyEpoch = S.Schema.Type<typeof DaemonTeamKeyEpoch>;
1538
+ /**
1539
+ * A `pending_auth` self-expires after this **on cached / unconfirmed
1540
+ * snapshots**. The login ceiling (`DEFAULT_LOGIN_TIMEOUT_MS`, 5 min) reaps
1541
+ * the live child and matching-flow finalization clears the marker; this TTL
1542
+ * is the BACKSTOP for abandoned HTTP/DB rows. A current-session live marker
1543
+ * beats its age — replacement Connect stays forbidden while ownership is
1544
+ * confirmed. Shared by the daemon (in-memory expiry) and the browser. */
1545
+ export declare const PENDING_AUTH_TTL_MS: number;
1546
+ export declare const DaemonCloudState: S.Literals<readonly ["ok", "no_key", "invalid_key", "unreachable", "connecting"]>;
1547
+ export type TDaemonCloudState = S.Schema.Type<typeof DaemonCloudState>;
1548
+ /**
1549
+ * The openllm CLI's presence on this box, as the daemon already knows it from
1550
+ * its device-state probe (`device-state.ts`) — no probe scripts, no per-client
1551
+ * walk. This is the ONLY install state the dashboard needs now: clients are
1552
+ * configured at RUN time by `openllm <client>`, so there is nothing per-client
1553
+ * to install, stamp, or diverge.
1554
+ */
1555
+ export declare const DaemonCliState: S.Struct<{
1556
+ readonly installed: S.Boolean;
1557
+ /** Version the installed binary reports; absent when it can't be read. */
1558
+ readonly version: S.optional<S.NullOr<S.String>>;
1559
+ }>;
1560
+ export type TDaemonCliState = S.Schema.Type<typeof DaemonCliState>;
1561
+ /**
1562
+ * An update replacing the `openllm` binary right now — the body of the
1563
+ * cross-process update lease (`packages/cli/src/update-lease.ts`, which a
1564
+ * parity test pins to this shape). `source` is who is updating (`app` = the
1565
+ * desktop app), `received`/`total` the download bytes when known.
1566
+ */
1567
+ export declare const DaemonUpdateState: S.Struct<{
1568
+ readonly pid: S.Number;
1569
+ readonly source: S.Literals<readonly ["daemon", "cli", "installer", "app"]>;
1570
+ readonly version: S.NullOr<S.String>;
1571
+ readonly phase: S.Literals<readonly ["download", "verify", "install", "restart"]>;
1572
+ readonly received: S.NullOr<S.Number>;
1573
+ readonly total: S.NullOr<S.Number>;
1574
+ readonly started_at: S.Number;
1575
+ readonly updated_at: S.Number;
1576
+ }>;
1577
+ export type TDaemonUpdateState = S.Schema.Type<typeof DaemonUpdateState>;
1578
+ export declare const DaemonStatus: S.Struct<{
1579
+ /** The RUNNING daemon's version. The dashboard shows this. */
1580
+ readonly daemon_version: S.String;
1581
+ /** The installed binary's version on disk. One binary is both CLI and
1582
+ * daemon, and a swap whose daemon code is unchanged does not restart the
1583
+ * daemon, so this can be ahead of `daemon_version` until the next restart.
1584
+ * Absent on daemons too old to report it. */
1585
+ readonly installed_version: S.optional<S.NullOr<S.String>>;
1586
+ /** Whether an sk-llm key is set (the daemon installs keyless). */
1587
+ readonly key_configured: S.Boolean;
1588
+ /** Whether automatic self-update is enabled (OPT-OUT, default on). Drives the
1589
+ * dashboard's auto-update switch; toggled via the `set_auto_update` command.
1590
+ * Absent on daemons too old to report it — those always self-updated, so the
1591
+ * switch then reads as on. See `packages/cli/daemon/src/auto-update-pref.ts`. */
1592
+ readonly auto_update: S.optional<S.Boolean>;
1593
+ /** Result of the last bootstrap — see `DaemonCloudState`. */
1594
+ readonly cloud_state: S.Literals<readonly ["ok", "no_key", "invalid_key", "unreachable", "connecting"]>;
1595
+ /** This daemon's X25519 public key (SPKI DER, base64). Lets ANOTHER of the
1596
+ * user's daemons SEAL a Claude setup-token to it for cross-machine copy
1597
+ * (`/api/daemon/relay-credential`) — the cloud only ever relays ciphertext.
1598
+ * Absent on daemons too old to publish one. */
1599
+ readonly pubkey: S.optional<S.String>;
1600
+ /** True when the cloud's immutable daemon X25519 pin differs from this
1601
+ * daemon's local key. A browser session must reset the pin before RTC can
1602
+ * connect; absent on daemons that have not observed this conflict. */
1603
+ readonly identity_conflict: S.optional<S.Boolean>;
1604
+ /** The device-control pin this daemon verifies grants against: `fp` is the
1605
+ * key's fingerprint (`keyFingerprint` in `@openllmsh/sdk/tunnel`), `via` the
1606
+ * path that set it. Whether it is agent-eligible is reported once, in
1607
+ * `device_sessions.anchored`. Absent when unpinned or on older daemons. */
1608
+ readonly device_access_pin: S.optional<S.Struct<{
1609
+ readonly fp: S.String;
1610
+ readonly kind: S.Literals<readonly ["control", "legacy"]>;
1611
+ readonly via: S.optional<S.Literals<readonly ["anchor", "tofu", "local", "rotation"]>>;
1612
+ }>>;
1613
+ /** Device sessions readiness + the dpk proof (`DeviceSessionsReport`).
1614
+ * `anchored` == sessions on (env-file trust anchor present). Absent on
1615
+ * daemons too old to anchor — treat as not anchored. */
1616
+ readonly device_sessions: S.optional<S.Struct<{
1617
+ readonly anchored: S.Boolean;
1618
+ readonly dpk_proof: S.optional<S.String>;
1619
+ }>>;
1620
+ /** The loopback port this daemon's `/v1/*` + `/whoami` surface listens on
1621
+ * (`OPENLLM_DAEMON_PORT`, default 8787). Reported in `daemon_status_json`
1622
+ * for display; routing never uses it (origin reaches devices over the
1623
+ * relay, not loopback). Absent on daemons too old to publish it. */
1624
+ readonly port: S.optional<S.Number>;
1625
+ /** The OS-sandbox posture this daemon booted with (`sandbox/landlock.ts`):
1626
+ * `enforced` (Landlock active), `off` (kill switch / dev opt-out),
1627
+ * `unsupported` (non-Linux, or a kernel without Landlock — the systemd
1628
+ * unit hardening may still confine the service), `error` (setup failed —
1629
+ * fail-open, surfaced so an unconfined daemon is visible, not silent).
1630
+ * Absent on daemons too old to report it. */
1631
+ readonly sandbox: S.optional<S.Literals<readonly ["enforced", "off", "unsupported", "error"]>>;
1632
+ readonly connections: S.$Array<S.Struct<{
1633
+ readonly provider: S.String;
1634
+ /**
1635
+ * Auth-status literal — the single source of truth.
1636
+ * `connected` = signed in; `disconnected` = unexpected loss;
1637
+ * `signed_out` = user-initiated logout (sticky until the next login).
1638
+ */
1639
+ readonly status: S.Literals<readonly ["connected", "disconnected", "signed_out"]>;
1640
+ /**
1641
+ * Typed observation. Optional so old daemons and persisted blobs remain
1642
+ * valid. When present it wins over legacy `status` / `detail` classifiers.
1643
+ * `unknown` is never logout and never proven serviceability.
1644
+ */
1645
+ readonly observation: S.optional<S.Literals<readonly ["connected", "signed_out", "disconnected", "unknown"]>>;
1646
+ /** Machine-readable cause for a non-connected observation. Display copy stays on `detail`. */
1647
+ readonly reason_code: S.optional<S.Literals<readonly ["probe_timeout", "probe_failed", "keychain_unavailable", "store_unreadable", "cli_unavailable", "cli_runtime_missing", "credential_absent"]>>;
1648
+ /** The vendor CLI the daemon runs is installed on the machine. The daemon
1649
+ * never installs it — installs are user-run (the daemon install script or by
1650
+ * hand); the daemon lazily auto-links its isolated run-view
1651
+ * (~/.openllm/cli/<provider>/) to the host binary. When false the dashboard
1652
+ * prompts the user to (re-)run the daemon installer. Absent means a status
1653
+ * probe failed before it could determine installation state; consumers must
1654
+ * not treat absence as not installed. */
1655
+ readonly cli_installed: S.optional<S.Boolean>;
1656
+ /** Progress of an OpenLLM-started background vendor installer. Independent
1657
+ * of authentication and CLI presence; absent on older daemons or externally
1658
+ * managed installations. Contains no logs, process identity or host paths. */
1659
+ readonly cli_install: S.optional<S.Struct<{
1660
+ readonly attempt_id: S.String;
1661
+ readonly stage: S.Literals<readonly ["installing", "awaiting_detection", "failed", "interrupted"]>;
1662
+ readonly started_at_ms: S.Int;
1663
+ readonly updated_at_ms: S.Int;
1664
+ readonly reason: S.optional<S.Literals<readonly ["installer_failed", "interrupted", "detection_timeout"]>>;
1665
+ }>>;
1666
+ /** Version of the isolated CLI, when installed + readable. */
1667
+ readonly cli_version: S.optional<S.String>;
1668
+ /** The user appears signed in to this vendor's CLI in their OWN home on the
1669
+ * daemon's machine (e.g. `~/.codex/auth.json` holds a ChatGPT login). A
1670
+ * read-only, secret-free presence hint so onboarding can put that provider
1671
+ * first with a one-tap Connect. It is never a connection: the daemon does
1672
+ * not copy, import or use that credential, and Connect still runs the
1673
+ * vendor login inside the daemon's isolated home. Absent = unknown (an
1674
+ * older daemon, a provider whose host store sits in an OS keychain the
1675
+ * daemon will not touch, or an unreadable store); consumers must not read
1676
+ * absence as signed out. */
1677
+ readonly host_signed_in: S.optional<S.Boolean>;
1678
+ readonly detail: S.optional<S.String>;
1679
+ readonly last_login_at_ms: S.optional<S.NullOr<S.Number>>;
1680
+ /** A LIVE device-code flow awaiting the user (codex/kimi on a remote box):
1681
+ * the verification URL + one-time code to surface so the dashboard can
1682
+ * render a synced "open this link, enter this code" panel. Present only
1683
+ * while a flow is pending; cleared the moment the credential lands. The
1684
+ * card flips to Connected automatically on the next status push.
1685
+ *
1686
+ * The actionable `url`/`code` are OPTIONAL because the relay REDACTS them
1687
+ * from the broadcast + persisted status for every dashboard EXCEPT the one
1688
+ * that started the login (issue #3 — otherwise the OAuth secret fans out to
1689
+ * every same-user browser). A redacted / marker snapshot is the non-secret
1690
+ * owner shape `{ pending: true, flow_id?, started_at_ms?, cancel_requested?,
1691
+ * mode? }` with no url/code — not a new `mode` value. The initiating
1692
+ * dashboard receives `{ url, code, mode? }` on `auth.login.prompt` only.
1693
+ * UIs must treat a missing/empty `url` as non-actionable (never auto-open).
1694
+ * A cached HTTP/DB marker is unconfirmed until a current-session ordered
1695
+ * live `status_push` is applied; TTL does not evict that live owner. */
1696
+ readonly pending_auth: S.optional<S.NullOr<S.Struct<{
1697
+ readonly url: S.optional<S.String>;
1698
+ readonly code: S.optional<S.String>;
1699
+ /** True on a REDACTED snapshot (non-origin watcher / persisted row):
1700
+ * a login is in progress but the actionable url/code were stripped. */
1701
+ readonly pending: S.optional<S.Boolean>;
1702
+ /** `device_code` (codex/kimi: surface URL + one-time code to enter in
1703
+ * the browser, then poll) or `paste_code` (claude headless login:
1704
+ * surface URL, then a paste-back input for the code the hosted
1705
+ * callback page displays). Absent ⇒ `device_code`. */
1706
+ readonly mode: S.optional<S.Literals<readonly ["device_code", "paste_code"]>>;
1707
+ /** Relay command id of the login that produced this snapshot (same
1708
+ * value as `auth.login.*` `flow_id`). The browser `req_id` lives on
1709
+ * `command_lifecycle`, not here. Absent on daemons predating auth
1710
+ * events. */
1711
+ readonly flow_id: S.optional<S.String>;
1712
+ /** Epoch ms when this pending flow was created. Carried on both the
1713
+ * actionable and the REDACTED snapshot so every consumer can expire a
1714
+ * STALE entry (older than {@link PENDING_AUTH_TTL_MS}) without needing
1715
+ * the daemon to re-push. The daemon persists its whole status snapshot
1716
+ * to `api_key_activity.daemon_status_json`; an abandoned/never-completed
1717
+ * login (or a daemon restart that drops the live child) would otherwise
1718
+ * leave a dead `pending_auth` in that row forever, and the dashboard
1719
+ * would re-surface + auto-open a sign-in flow that no longer exists on
1720
+ * every cold load. Absent on daemons predating this field. */
1721
+ readonly started_at_ms: S.optional<S.Number>;
1722
+ /** Slot-derived: cancel was accepted but the owner is still
1723
+ * contained. Additive; older decoders ignore it. Not a new mode. */
1724
+ readonly cancel_requested: S.optional<S.Boolean>;
1725
+ }>>>;
1726
+ /** Metadata-only usage snapshot for a CONNECTED provider, read locally by
1727
+ * the daemon and pushed with its status. Absent when not connected or the
1728
+ * read failed. */
1729
+ readonly usage: S.optional<S.NullOr<S.Union<readonly [S.Struct<{
1730
+ readonly kind: S.Literal<"quota">;
1731
+ readonly status: S.Literals<readonly ["allowed", "allowed_warning", "rejected"]>;
1732
+ readonly plan: S.optional<S.String>;
1733
+ readonly plan_source: S.optional<S.String>;
1734
+ readonly windows: S.$Array<S.Struct<{
1735
+ readonly label: S.String;
1736
+ readonly meter_id: S.optional<S.String>;
1737
+ readonly percent_used: S.Number;
1738
+ readonly reset_at_ms: S.NullOr<S.Number>;
1739
+ readonly window_ms: S.optional<S.Number>;
1740
+ }>>;
1741
+ readonly note: S.String;
1742
+ readonly as_of_ms: S.optional<S.Number>;
1743
+ readonly stale: S.optional<S.Boolean>;
1744
+ readonly refresh_failure: S.optional<S.Struct<{
1745
+ readonly reason: S.Literals<readonly ["credential_expired", "account_changed", "rate_limited", "authorization_failed", "subscription_inactive", "fetch_failed"]>;
1746
+ readonly at_ms: S.optional<S.Number>;
1747
+ }>>;
1748
+ readonly extra_pools: S.optional<S.$Array<S.Struct<{
1749
+ readonly label: S.String;
1750
+ readonly meter_id: S.optional<S.String>;
1751
+ readonly percent_used: S.Number;
1752
+ readonly reset_at_ms: S.NullOr<S.Number>;
1753
+ readonly window_ms: S.optional<S.Number>;
1754
+ }>>>;
1755
+ readonly credits: S.optional<S.Struct<{
1756
+ readonly balance: S.String;
1757
+ readonly unlimited: S.optional<S.Boolean>;
1758
+ readonly reset_credits: S.optional<S.Number>;
1759
+ }>>;
1760
+ }>, S.Struct<{
1761
+ readonly kind: S.Literal<"plan">;
1762
+ readonly plan: S.String;
1763
+ readonly note: S.String;
1764
+ }>, S.Struct<{
1765
+ readonly kind: S.Literal<"unavailable">;
1766
+ readonly reason: S.String;
1767
+ readonly link: S.optional<S.String>;
1768
+ }>]>>>;
1769
+ /**
1770
+ * Live local hop cooldown with reason `auth` (any model of this provider).
1771
+ * Visibility only — does not change `status` / `observation` / `reason_code`.
1772
+ * Transient; not remembered as last-known.
1773
+ */
1774
+ readonly upstream_auth_cooldown: S.optional<S.Struct<{
1775
+ readonly until_ms: S.Number;
1776
+ readonly model_id: S.String;
1777
+ readonly reason_code: S.optional<S.Literals<readonly ["refresh_abandoned", "refresh_failed"]>>;
1778
+ }>>;
1779
+ /** Obscured vendor-account identity for a CONNECTED provider:
1780
+ * sha256("openllm-account-v1:<provider>:<stable-account-id>") over the
1781
+ * stable account id the vendor CLI stores locally (Anthropic's
1782
+ * accountUuid, ChatGPT's account_id, Kimi's user_id, Grok's user_id).
1783
+ * Lets the cloud key usage-meter series per ACCOUNT — two devices on the
1784
+ * same account share the hash; a second account on the same provider gets
1785
+ * its own — without ever shipping the raw vendor id off-box. Absent when
1786
+ * not connected or unreadable, and on daemons predating it. See
1787
+ * docs/proposals/inferred-subscription-usage-calibration.md §10. */
1788
+ readonly account_hash: S.optional<S.String>;
1789
+ /** Device-local account slot this row describes (multi-account). Several
1790
+ * rows may share one `provider` with distinct indexes. Absent ⇒ 0. */
1791
+ readonly account_index: S.optional<S.Number>;
1792
+ /** User label for the account slot, when set. */
1793
+ readonly account_label: S.optional<S.String>;
1794
+ /** True on the slot the user pinned first in routing for this provider. */
1795
+ readonly account_pinned: S.optional<S.Boolean>;
1796
+ /** `local_key` slots only: the last four characters of the stored key, so
1797
+ * the user can tell keys apart. Never more of the secret. */
1798
+ readonly key_hint: S.optional<S.String>;
1799
+ /**
1800
+ * Latest live model-list / discover outcome for this provider (UI signal for
1801
+ * "Connected, but this device hasn't reported models yet"). Optional +
1802
+ * omitted when never attempted so older daemons and older clients stay
1803
+ * compatible. Mirror of how {@link LocalServerState} carries models.
1804
+ */
1805
+ readonly models_status: S.optional<S.Literals<readonly ["ok", "unavailable"]>>;
1806
+ /** Closed null-reason when `models_status` is `unavailable`. Omitted on `ok`. */
1807
+ readonly models_reason: S.optional<S.Literals<readonly ["token_unavailable", "version_unresolved", "empty_after_filter", "error", "http_401", "http_403", "http_404", "http_429", "http_500", "http_502", "http_503", "http_error"]>>;
1808
+ }>>;
1809
+ /** Team keys this device holds for team tunnels' PSK handshake, so the
1810
+ * browser can tell which teams still need T sealed here. Absent on daemons
1811
+ * without `TEAM_KEY_CUSTODY_CONTROL_CAP`. */
1812
+ readonly team_psk: S.optional<S.$Array<S.Struct<{
1813
+ readonly team_id: S.String;
1814
+ readonly epoch: S.Int;
1815
+ }>>>;
1816
+ /** The openllm CLI on this box. Absent on daemons too old to report it. */
1817
+ readonly cli: S.optional<S.Struct<{
1818
+ readonly installed: S.Boolean;
1819
+ /** Version the installed binary reports; absent when it can't be read. */
1820
+ readonly version: S.optional<S.NullOr<S.String>>;
1821
+ }>>;
1822
+ /** The update replacing the binary right now, or null when none is.
1823
+ * Absent on daemons too old to report it. */
1824
+ readonly update: S.optional<S.NullOr<S.Struct<{
1825
+ readonly pid: S.Number;
1826
+ readonly source: S.Literals<readonly ["daemon", "cli", "installer", "app"]>;
1827
+ readonly version: S.NullOr<S.String>;
1828
+ readonly phase: S.Literals<readonly ["download", "verify", "install", "restart"]>;
1829
+ readonly received: S.NullOr<S.Number>;
1830
+ readonly total: S.NullOr<S.Number>;
1831
+ readonly started_at: S.Number;
1832
+ readonly updated_at: S.Number;
1833
+ }>>>;
1834
+ /** Advertised transport capabilities, retained in fleet status telemetry. */
1835
+ readonly caps: S.optional<S.$Array<S.String>>;
1836
+ /** Current and maximum concurrently-served tunneled requests. Optional for
1837
+ * older daemons; origin uses it only as an additive target-ranking signal. */
1838
+ readonly served_tunnels: S.optional<S.Struct<{
1839
+ readonly active: S.Number;
1840
+ readonly capacity: S.Number;
1841
+ }>>;
1842
+ /**
1843
+ * Control-plane capabilities this daemon implements (distinct from
1844
+ * mux/RTC `caps`). Open strings so a future daemon can advertise an
1845
+ * extra cap without the cloud rejecting the whole status. Optional so
1846
+ * older daemons omit it; the dashboard sends `refresh_models_due` only
1847
+ * when this array includes that exact literal. Command vocabulary stays
1848
+ * closed independently of this list.
1849
+ */
1850
+ readonly control_caps: S.optional<S.$Array<S.String>>;
1851
+ /** Whether this daemon can host device chat sessions (PTY — POSIX only;
1852
+ * false on win32). Absent on daemons too old to report it — the
1853
+ * dashboard then hides the device variant for this box. */
1854
+ readonly pty_supported: S.optional<S.Boolean>;
1855
+ /** Live/dormant device sessions hosted on this box (feature §2.2) —
1856
+ * lets the dashboard mark which sessions can `attach` vs `continue`. */
1857
+ readonly sessions: S.optional<S.$Array<S.Struct<{
1858
+ /** Local daemon session id; independent of the mux SessionId validator. */
1859
+ readonly id: S.String;
1860
+ readonly cli: S.Literals<readonly ["claude_code", "chatgpt", "grok", "opencode", "hermes", "shell"]>;
1861
+ readonly started_at_ms: S.Number;
1862
+ /** A consumer channel is currently bound. */
1863
+ readonly attached: S.Boolean;
1864
+ /** The PTY is still running (attach re-binds; false → continue). */
1865
+ readonly live: S.Boolean;
1866
+ /** Best-effort process-tree activity signal for dormant sessions. */
1867
+ readonly busy: S.optional<S.Boolean>;
1868
+ /** User-visible session label, bounded for presence snapshots. */
1869
+ readonly title: S.optional<S.String>;
1870
+ /** Terminal reason retained for a dead resumable session. */
1871
+ readonly last_exit_reason: S.optional<S.Literals<readonly ["evicted", "reaped", "done", "killed"]>>;
1872
+ /** Vendor resume id when known (local history / resume spawn). */
1873
+ readonly vendor_session_id: S.optional<S.NullOr<S.String>>;
1874
+ }>>>;
1875
+ /**
1876
+ * Local model servers discovered on this device (no key material —
1877
+ * `has_key` only). Absent on daemons too old to probe. Bounded so a
1878
+ * noisy scan cannot bloat fleet status.
1879
+ */
1880
+ readonly local_servers: S.optional<S.$Array<S.Struct<{
1881
+ /** Preset slug (`local_ollama`, …) or `local_port_<port>` fallback. */
1882
+ readonly slug: S.String;
1883
+ readonly port: S.Number;
1884
+ readonly base_url: S.String;
1885
+ readonly status: S.Literals<readonly ["ok", "needs_key", "unreachable"]>;
1886
+ readonly has_key: S.Boolean;
1887
+ readonly models: S.$Array<S.Struct<{
1888
+ readonly provider_model_id: S.String;
1889
+ readonly display_name: S.optional<S.String>;
1890
+ readonly created: S.optional<S.Number>;
1891
+ readonly context_window: S.optional<S.Number>;
1892
+ readonly max_output_tokens: S.optional<S.Number>;
1893
+ }>>;
1894
+ }>>>;
1895
+ }>;
1896
+ export type TDaemonStatus = S.Schema.Type<typeof DaemonStatus>;
1897
+ /**
1898
+ * Canonical payload the cloud HMAC-signs for a daemon plan
1899
+ * (`/api/daemon/plan`), and the daemon re-derives to verify it. Order +
1900
+ * separators are load-bearing — both sides MUST assemble it identically, so
1901
+ * it lives here, shared. Covers: the ordered `plan` (provider/model ids), the
1902
+ * parallel `pmids` (concrete upstream `provider_model_id`s, so the daemon
1903
+ * serves catalog-free), and the `origin` (the deployment that issued the
1904
+ * plan, so the daemon forwards +
1905
+ * records back to it). Signing the lot makes the upstream ids and the
1906
+ * forward/record target tamper-evident.
1907
+ */
1908
+ export declare const daemonPlanSigningPayload: (plan: string, providerModelIds: string, origin: string, contextOverflowStrategy?: TContextOverflowStrategy | null, holdNonce?: string | null, maxOutputTokens?: number | null) => string;
1909
+ export declare const DaemonPlanResponse: S.Struct<{
1910
+ /** Comma-joined ordered `provider/model` chain. */
1911
+ readonly plan: S.String;
1912
+ /** Parallel concrete `provider_model_id`s. */
1913
+ readonly pmids: S.String;
1914
+ /** The issuing deployment's origin. */
1915
+ readonly origin: S.String;
1916
+ /** Context-overflow strategy for this plan. Absent means hop-to-larger-context. */
1917
+ readonly context_overflow_strategy: S.optional<S.Literals<readonly ["hop_to_larger_context", "compact_in_place"]>>;
1918
+ /** Reservation for a capped one-hop plan, included in the signed payload. */
1919
+ readonly hold_nonce: S.optional<S.String>;
1920
+ /** Largest output the hold allows (held plans only; signed). The daemon
1921
+ * lowers the request's output limit to it before dispatch. */
1922
+ readonly max_output_tokens: S.optional<S.Number>;
1923
+ /** Revision of the key's access policy this plan was built under; a
1924
+ * change drops the daemon's plan cache (see bootstrap `key_policy_rev`).
1925
+ * Optional so a plan from a cloud that predates it still decodes; absent
1926
+ * keeps the revision the daemon already knows. */
1927
+ readonly policy_rev: S.optional<S.String>;
1928
+ /** HMAC over the canonical payload; null when the cloud has no signing
1929
+ * secret configured (dev) — the daemon then treats it as unsigned. */
1930
+ readonly sig: S.NullOr<S.String>;
1931
+ }>;
1932
+ export type TDaemonPlanResponse = S.Schema.Type<typeof DaemonPlanResponse>;
1933
+ /** Header that carries the opaque held-tool continuation between client turns. */
1934
+ export declare const TOOL_SESSION_HEADER = "x-openllm-tool-session";
1935
+ /** Headers the daemon stamps on EVERY cloud control call (poll/status/bootstrap
1936
+ * /requests/relay/search) so the cloud can record which device a key's daemon
1937
+ * runs on — `api_key_activity.device_id`/`device_label`. The id is the daemon's
1938
+ * stable opaque per-machine UUID (`OPENLLM_DEVICE_ID` in `~/.openllm/.env`); the label is the
1939
+ * host's `os.hostname()` for the dashboard to show. Both metadata-only (no
1940
+ * token, no content). Lets the dashboard tell two daemons behind one NAT apart
1941
+ * — device code + IP, not IP alone. See
1942
+ * `docs/proposals/daemon-device-aware-this-machine.md`. */
1943
+ export declare const DAEMON_DEVICE_ID_HEADER = "x-openllm-device-id";
1944
+ export declare const DAEMON_DEVICE_LABEL_HEADER = "x-openllm-device-label";
1945
+ /**
1946
+ * Optional OS platform the daemon reports on control-plane calls
1947
+ * (`process.platform`: `darwin` / `linux` / `win32` / `freebsd` /
1948
+ * `openbsd` / `android` / `aix` / `sunos`). Metadata only —
1949
+ * used for `daemon_connected` analytics. Absent on older binaries.
1950
+ */
1951
+ export declare const DAEMON_PLATFORM_HEADER = "x-openllm-platform";
1952
+ /**
1953
+ * Header a daemon sends on control-plane calls (chiefly
1954
+ * `GET /api/daemon/bootstrap`) listing the open-vocabulary decode
1955
+ * capabilities it supports — e.g. `MODEL_CAPABILITIES_OPEN_CAP` from
1956
+ * `./models`. Comma-joined; absent/empty on an old compiled daemon, which
1957
+ * the bootstrap encoder MUST treat as "closed literal decoder only" —
1958
+ * never inferred from a version string, which an unbumped daemon build
1959
+ * would leave stale.
1960
+ */
1961
+ export declare const DAEMON_BOOTSTRAP_CAPS_HEADER = "x-openllm-daemon-caps";
1962
+ /**
1963
+ * Parse the comma-joined {@link DAEMON_BOOTSTRAP_CAPS_HEADER} value into a
1964
+ * capability list. A null/empty header (old daemon, or the header simply
1965
+ * absent) decodes to an empty list — no negotiated capability.
1966
+ */
1967
+ export declare const parseDaemonBootstrapCapsHeader: (value: string | null) => string[];
1968
+ export declare const DaemonSetApiKeyRequest: S.Struct<{
1969
+ readonly api_key: S.String;
1970
+ }>;
1971
+ export type TDaemonSetApiKeyRequest = S.Schema.Type<typeof DaemonSetApiKeyRequest>;
1972
+ export declare const DaemonSetApiKeyResponse: S.Struct<{
1973
+ readonly key_configured: S.Boolean;
1974
+ readonly cloud_state: S.Literals<readonly ["ok", "no_key", "invalid_key", "unreachable", "connecting"]>;
1975
+ }>;
1976
+ export type TDaemonSetApiKeyResponse = S.Schema.Type<typeof DaemonSetApiKeyResponse>;
1977
+ export declare const DaemonConnectResponse: S.Struct<{
1978
+ readonly provider: S.String;
1979
+ readonly connected: S.Boolean;
1980
+ readonly detail: S.optional<S.String>;
1981
+ /**
1982
+ * True when `connect` kicked off an async flow that hasn't finished yet
1983
+ * (Kimi's device-code login: browser opened, daemon polling in the
1984
+ * background). `detail` is then INFORMATIONAL guidance, not an error —
1985
+ * the UI renders it neutrally and the status stream flips to connected
1986
+ * when the flow completes. Absent/false on terminal results.
1987
+ */
1988
+ readonly pending: S.optional<S.Boolean>;
1989
+ }>;
1990
+ export type TDaemonConnectResponse = S.Schema.Type<typeof DaemonConnectResponse>;
1991
+ export declare const DaemonUsageResponse: S.Struct<{
1992
+ readonly provider: S.String;
1993
+ readonly snapshot: S.Union<readonly [S.Struct<{
1994
+ readonly kind: S.Literal<"quota">;
1995
+ readonly status: S.Literals<readonly ["allowed", "allowed_warning", "rejected"]>;
1996
+ readonly plan: S.optional<S.String>;
1997
+ readonly plan_source: S.optional<S.String>;
1998
+ readonly windows: S.$Array<S.Struct<{
1999
+ readonly label: S.String;
2000
+ readonly meter_id: S.optional<S.String>;
2001
+ readonly percent_used: S.Number;
2002
+ readonly reset_at_ms: S.NullOr<S.Number>;
2003
+ readonly window_ms: S.optional<S.Number>;
2004
+ }>>;
2005
+ readonly note: S.String;
2006
+ readonly as_of_ms: S.optional<S.Number>;
2007
+ readonly stale: S.optional<S.Boolean>;
2008
+ readonly refresh_failure: S.optional<S.Struct<{
2009
+ readonly reason: S.Literals<readonly ["credential_expired", "account_changed", "rate_limited", "authorization_failed", "subscription_inactive", "fetch_failed"]>;
2010
+ readonly at_ms: S.optional<S.Number>;
2011
+ }>>;
2012
+ readonly extra_pools: S.optional<S.$Array<S.Struct<{
2013
+ readonly label: S.String;
2014
+ readonly meter_id: S.optional<S.String>;
2015
+ readonly percent_used: S.Number;
2016
+ readonly reset_at_ms: S.NullOr<S.Number>;
2017
+ readonly window_ms: S.optional<S.Number>;
2018
+ }>>>;
2019
+ readonly credits: S.optional<S.Struct<{
2020
+ readonly balance: S.String;
2021
+ readonly unlimited: S.optional<S.Boolean>;
2022
+ readonly reset_credits: S.optional<S.Number>;
2023
+ }>>;
2024
+ }>, S.Struct<{
2025
+ readonly kind: S.Literal<"plan">;
2026
+ readonly plan: S.String;
2027
+ readonly note: S.String;
2028
+ }>, S.Struct<{
2029
+ readonly kind: S.Literal<"unavailable">;
2030
+ readonly reason: S.String;
2031
+ readonly link: S.optional<S.String>;
2032
+ }>]>;
2033
+ }>;
2034
+ export type TDaemonUsageResponse = S.Schema.Type<typeof DaemonUsageResponse>;