aegisone 1.0.34 → 1.0.37

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 (372) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +1 -1
  3. package/SOURCE-OFFER.txt +9 -0
  4. package/bin/aegis.js +1 -322
  5. package/package.json +4 -5
  6. package/scripts/bump.mjs +1 -211
  7. package/scripts/bundle.js +1 -129
  8. package/scripts/predist.mjs +1 -976
  9. package/src/child.js +1 -285
  10. package/src/dispatch.js +1 -269
  11. package/src/doctor.js +1 -639
  12. package/src/host.js +1 -111
  13. package/src/iface/paths.js +3 -0
  14. package/src/iface/pty.js +3 -0
  15. package/src/iface/update.js +3 -0
  16. package/src/iface/window.js +3 -0
  17. package/src/permissions.js +1 -383
  18. package/src/probes.js +1 -159
  19. package/src/protocol.js +3 -0
  20. package/src/release.js +1 -409
  21. package/src/selfhost.js +3 -0
  22. package/vendor/cli/package.json +3 -7
  23. package/vendor/cli/scripts/check.mjs +1 -52
  24. package/vendor/cli/scripts/demo.mjs +1 -94
  25. package/vendor/cli/scripts/predist.mjs +1 -75
  26. package/vendor/cli/scripts/runtests.mjs +1 -56
  27. package/vendor/cli/scripts/seal-gate.mjs +1 -74
  28. package/vendor/cli/src/agents.js +1 -139
  29. package/vendor/cli/src/app.js +1 -2957
  30. package/vendor/cli/src/art.js +1 -289
  31. package/vendor/cli/src/chatflow.js +1 -3023
  32. package/vendor/cli/src/checkpoint.js +1 -90
  33. package/vendor/cli/src/clipboard.js +1 -424
  34. package/vendor/cli/src/cloudsync.js +1 -528
  35. package/vendor/cli/src/commands.js +1 -4089
  36. package/vendor/cli/src/config.js +1 -581
  37. package/vendor/cli/src/connect.js +1 -349
  38. package/vendor/cli/src/credentials.js +1 -33
  39. package/vendor/cli/src/deps.js +1 -232
  40. package/vendor/cli/src/devrun.js +1 -187
  41. package/vendor/cli/src/diff.js +1 -333
  42. package/vendor/cli/src/diffview.js +1 -296
  43. package/vendor/cli/src/engine.js +1 -297
  44. package/vendor/cli/src/entitlement.js +1 -355
  45. package/vendor/cli/src/events.js +1 -707
  46. package/vendor/cli/src/export.js +1 -67
  47. package/vendor/cli/src/filepreview.js +1 -153
  48. package/vendor/cli/src/fingerprint.js +1 -592
  49. package/vendor/cli/src/format.js +1 -259
  50. package/vendor/cli/src/fuzzy.js +1 -119
  51. package/vendor/cli/src/history.js +1 -423
  52. package/vendor/cli/src/init.js +1 -175
  53. package/vendor/cli/src/input.js +1 -139
  54. package/vendor/cli/src/keys.js +1 -183
  55. package/vendor/cli/src/markdown.js +1 -306
  56. package/vendor/cli/src/models.js +1 -507
  57. package/vendor/cli/src/naming.js +1 -57
  58. package/vendor/cli/src/overlays.js +1 -462
  59. package/vendor/cli/src/panels.js +1 -1418
  60. package/vendor/cli/src/ping.js +1 -226
  61. package/vendor/cli/src/presence.js +1 -238
  62. package/vendor/cli/src/render.js +1 -516
  63. package/vendor/cli/src/screen.js +1 -518
  64. package/vendor/cli/src/screens.js +1 -896
  65. package/vendor/cli/src/secret.js +1 -59
  66. package/vendor/cli/src/securefs.js +1 -359
  67. package/vendor/cli/src/settings.js +1 -155
  68. package/vendor/cli/src/shared.js +1 -52
  69. package/vendor/cli/src/sharedpaths.js +1 -53
  70. package/vendor/cli/src/signup.js +1 -156
  71. package/vendor/cli/src/summarize.js +1 -95
  72. package/vendor/cli/src/sysdiag.js +1 -585
  73. package/vendor/cli/src/system.js +1 -40
  74. package/vendor/cli/src/theme.js +1 -570
  75. package/vendor/cli/src/title.js +1 -220
  76. package/vendor/cli/src/todos.js +1 -115
  77. package/vendor/cli/src/tokens.js +1 -263
  78. package/vendor/cli/src/topup.js +1 -210
  79. package/vendor/cli/src/update.js +1 -191
  80. package/vendor/cli/vendor/client/aegis.js +1 -2441
  81. package/vendor/cli/vendor/client/attest.js +1 -518
  82. package/vendor/cli/vendor/client/authorship-key.js +1 -410
  83. package/vendor/cli/vendor/client/auto-provision.js +1 -134
  84. package/vendor/cli/vendor/client/brain-catalog.js +1 -268
  85. package/vendor/cli/vendor/client/byok-catalog.js +1 -199
  86. package/vendor/cli/vendor/client/catalog-client.js +1 -487
  87. package/vendor/cli/vendor/client/conversation-export.js +1 -177
  88. package/vendor/cli/vendor/client/credentials.js +1 -494
  89. package/vendor/cli/vendor/client/device-fingerprint.js +1 -141
  90. package/vendor/cli/vendor/client/drive-connect.js +1 -110
  91. package/vendor/cli/vendor/client/drive-upload.js +1 -234
  92. package/vendor/cli/vendor/client/env-file.js +1 -1273
  93. package/vendor/cli/vendor/client/fingerprint.js +1 -1064
  94. package/vendor/cli/vendor/client/foreign-memory.js +1 -669
  95. package/vendor/cli/vendor/client/google-signin.js +1 -133
  96. package/vendor/cli/vendor/client/hooks.js +1 -430
  97. package/vendor/cli/vendor/client/model-discovery.js +1 -373
  98. package/vendor/cli/vendor/client/naming.js +1 -283
  99. package/vendor/cli/vendor/client/platform.js +1 -937
  100. package/vendor/cli/vendor/client/prefs.js +1 -351
  101. package/vendor/cli/vendor/client/presence-constants.js +1 -107
  102. package/vendor/cli/vendor/client/presence.js +1 -438
  103. package/vendor/cli/vendor/client/record-vault.js +3 -1055
  104. package/vendor/cli/vendor/client/session-store.js +1 -575
  105. package/vendor/cli/vendor/client/topup.js +1 -297
  106. package/vendor/cli/vendor/client/touch.js +1 -458
  107. package/vendor/cli/vendor/client/update.js +1 -763
  108. package/vendor/cli/vendor/client/user-models.js +1 -381
  109. package/vendor/cli/vendor/desktop/lib/local/agents.js +1 -105
  110. package/vendor/cli/vendor/desktop/lib/local/attachments.js +1 -276
  111. package/vendor/cli/vendor/desktop/lib/local/autonomous.js +1 -1045
  112. package/vendor/cli/vendor/desktop/lib/local/claude-pro.js +1 -1028
  113. package/vendor/cli/vendor/desktop/lib/local/context.js +1 -125
  114. package/vendor/cli/vendor/desktop/lib/local/engine.js +1 -3666
  115. package/vendor/cli/vendor/desktop/lib/local/entitlement.js +1 -660
  116. package/vendor/cli/vendor/desktop/lib/local/git-scope.js +1 -228
  117. package/vendor/cli/vendor/desktop/lib/local/integrity.js +1 -1
  118. package/vendor/cli/vendor/desktop/lib/local/local.js +1 -2145
  119. package/vendor/cli/vendor/desktop/lib/local/prompt.js +1 -280
  120. package/vendor/cli/vendor/desktop/lib/local/queue.js +1 -560
  121. package/vendor/cli/vendor/desktop/lib/local/session-rounds.js +1 -238
  122. package/vendor/cli/vendor/desktop/lib/local/spill.js +1 -75
  123. package/vendor/cli/vendor/desktop/lib/local/turn-guard.js +1 -300
  124. package/vendor/cli/vendor/desktop/lib/local/worktree-lock.js +1 -235
  125. package/vendor/cli/vendor/desktop/lib/settings.js +1 -890
  126. package/vendor/cli/vendor/desktop/main.js +67 -1
  127. package/vendor/cli/vendor/desktop/renderer/usage.js +1 -1239
  128. package/vendor/cli/vendor/hosts/install.js +1 -638
  129. package/vendor/cli/vendor/hosts/openai-shim.js +1 -515
  130. package/vendor/cli/vendor/hosts/spec.js +1 -164
  131. package/vendor/cli/vendor/hosts/targets.js +1 -346
  132. package/vendor/cli/vendor/mcp/server.js +1 -221
  133. package/vendor/cli/vendor/mcp/tools.js +1 -408
  134. package/vendor/cli/vendor/one/src/child.js +1 -285
  135. package/vendor/cli/vendor/one/src/permissions.js +1 -383
  136. package/vendor/cli/vendor/one/src/selfhost.js +3 -0
  137. package/vendor/desktop/bin/aegis.js +1 -32
  138. package/vendor/desktop/lib/account-key.js +1 -56
  139. package/vendor/desktop/lib/auto.js +1 -461
  140. package/vendor/desktop/lib/avatar/companion.js +1 -698
  141. package/vendor/desktop/lib/avatar/cosmetics.js +1 -532
  142. package/vendor/desktop/lib/avatar/events.js +1 -344
  143. package/vendor/desktop/lib/avatar/holder-turn.js +1 -350
  144. package/vendor/desktop/lib/avatar/holders.js +1 -612
  145. package/vendor/desktop/lib/avatar/identity.js +1 -641
  146. package/vendor/desktop/lib/avatar/level.js +1 -368
  147. package/vendor/desktop/lib/avatar/mirror.js +1 -524
  148. package/vendor/desktop/lib/avatar/persona.js +1 -388
  149. package/vendor/desktop/lib/avatar/profile.js +1 -977
  150. package/vendor/desktop/lib/avatar/register.js +1 -307
  151. package/vendor/desktop/lib/avatar/store.js +1 -472
  152. package/vendor/desktop/lib/avatar/tiers.js +1 -38
  153. package/vendor/desktop/lib/avatar/transfer.js +1 -415
  154. package/vendor/desktop/lib/avatar/turn.js +1 -216
  155. package/vendor/desktop/lib/avatar/voice.js +1 -328
  156. package/vendor/desktop/lib/avatar/xp.js +1 -404
  157. package/vendor/desktop/lib/deep-link.js +1 -120
  158. package/vendor/desktop/lib/fingerprint.js +2 -347
  159. package/vendor/desktop/lib/google-connect.js +1 -323
  160. package/vendor/desktop/lib/local/agents.js +1 -105
  161. package/vendor/desktop/lib/local/attachments.js +1 -276
  162. package/vendor/desktop/lib/local/autonomous.js +1 -1045
  163. package/vendor/desktop/lib/local/claude-pro.js +1 -1028
  164. package/vendor/desktop/lib/local/context.js +1 -125
  165. package/vendor/desktop/lib/local/engine.js +1 -3666
  166. package/vendor/desktop/lib/local/entitlement.js +1 -660
  167. package/vendor/desktop/lib/local/git-scope.js +1 -228
  168. package/vendor/desktop/lib/local/integrity.js +1 -1
  169. package/vendor/desktop/lib/local/local.js +1 -2145
  170. package/vendor/desktop/lib/local/prompt.js +1 -280
  171. package/vendor/desktop/lib/local/queue.js +1 -560
  172. package/vendor/desktop/lib/local/session-rounds.js +1 -238
  173. package/vendor/desktop/lib/local/spill.js +1 -75
  174. package/vendor/desktop/lib/local/telemetry.js +1 -470
  175. package/vendor/desktop/lib/local/turn-guard.js +1 -300
  176. package/vendor/desktop/lib/local/worktree-lock.js +1 -235
  177. package/vendor/desktop/lib/provider-key-mirror.js +1 -252
  178. package/vendor/desktop/lib/quick-launcher.js +1 -84
  179. package/vendor/desktop/lib/settings.js +1 -890
  180. package/vendor/desktop/lib/sync/memory-queue.js +1 -60
  181. package/vendor/desktop/lib/sync/persist-gate.js +1 -148
  182. package/vendor/desktop/lib/sync/sessions.js +1 -106
  183. package/vendor/desktop/lib/window-state.js +1 -66
  184. package/vendor/desktop/main.js +67 -1
  185. package/vendor/desktop/package.json +3 -5
  186. package/vendor/desktop/preload.js +1 -679
  187. package/vendor/desktop/renderer/app.js +1 -7250
  188. package/vendor/desktop/renderer/avatar/assemble.js +1 -335
  189. package/vendor/desktop/renderer/avatar/avatar.js +1 -380
  190. package/vendor/desktop/renderer/avatar/cards.js +1 -141
  191. package/vendor/desktop/renderer/avatar/hud.js +1 -206
  192. package/vendor/desktop/renderer/avatar/machine.js +1 -213
  193. package/vendor/desktop/renderer/avatar/pane.js +1 -439
  194. package/vendor/desktop/renderer/avatar/parts.js +1 -437
  195. package/vendor/desktop/renderer/budget.js +1 -172
  196. package/vendor/desktop/renderer/companion.js +1 -223
  197. package/vendor/desktop/renderer/diff.js +1 -359
  198. package/vendor/desktop/renderer/diffview.js +1 -336
  199. package/vendor/desktop/renderer/filepreview.js +1 -211
  200. package/vendor/desktop/renderer/fingerprint.js +3 -789
  201. package/vendor/desktop/renderer/markdown.js +1 -168
  202. package/vendor/desktop/renderer/provider-mark.js +1 -311
  203. package/vendor/desktop/renderer/provider-toolbar.js +1 -134
  204. package/vendor/desktop/renderer/providers.js +1 -259
  205. package/vendor/desktop/renderer/quick.js +1 -285
  206. package/vendor/desktop/renderer/stream-policy.js +1 -387
  207. package/vendor/desktop/renderer/transcript-view.js +1 -323
  208. package/vendor/desktop/renderer/usage.js +1 -1239
  209. package/vendor/desktop/vendor/aegis.js +1 -2441
  210. package/vendor/desktop/vendor/attest.js +1 -518
  211. package/vendor/desktop/vendor/authorship-key.js +1 -410
  212. package/vendor/desktop/vendor/auto-provision.js +1 -134
  213. package/vendor/desktop/vendor/brain-catalog.js +1 -268
  214. package/vendor/desktop/vendor/byok-catalog.js +1 -199
  215. package/vendor/desktop/vendor/catalog-client.js +1 -487
  216. package/vendor/desktop/vendor/conversation-export.js +1 -177
  217. package/vendor/desktop/vendor/credentials.js +1 -494
  218. package/vendor/desktop/vendor/device-fingerprint.js +1 -141
  219. package/vendor/desktop/vendor/drive-connect.js +1 -110
  220. package/vendor/desktop/vendor/drive-upload.js +1 -234
  221. package/vendor/desktop/vendor/env-file.js +1 -1273
  222. package/vendor/desktop/vendor/faces/cli/LICENSE +661 -0
  223. package/vendor/desktop/vendor/faces/cli/README.md +784 -0
  224. package/vendor/desktop/vendor/faces/cli/bin/aegiscode.js +20 -0
  225. package/vendor/desktop/vendor/faces/cli/package.json +44 -0
  226. package/vendor/desktop/vendor/faces/cli/scripts/check.mjs +4 -0
  227. package/vendor/desktop/vendor/faces/cli/scripts/demo.mjs +4 -0
  228. package/vendor/desktop/vendor/faces/cli/scripts/predist.mjs +4 -0
  229. package/vendor/desktop/vendor/faces/cli/scripts/runtests.mjs +4 -0
  230. package/vendor/desktop/vendor/faces/cli/scripts/seal-gate.mjs +3 -0
  231. package/vendor/desktop/vendor/faces/cli/src/agents.js +3 -0
  232. package/vendor/desktop/vendor/faces/cli/src/app.js +3 -0
  233. package/vendor/desktop/vendor/faces/cli/src/art.js +3 -0
  234. package/vendor/desktop/vendor/faces/cli/src/autonomous.js +3 -0
  235. package/vendor/desktop/vendor/faces/cli/src/caps.js +3 -0
  236. package/vendor/desktop/vendor/faces/cli/src/chatflow.js +3 -0
  237. package/vendor/desktop/vendor/faces/cli/src/checkpoint.js +3 -0
  238. package/vendor/desktop/vendor/faces/cli/src/clipboard.js +3 -0
  239. package/vendor/desktop/vendor/faces/cli/src/cloudsync.js +3 -0
  240. package/vendor/desktop/vendor/faces/cli/src/commands.js +3 -0
  241. package/vendor/desktop/vendor/faces/cli/src/config.js +3 -0
  242. package/vendor/desktop/vendor/faces/cli/src/connect.js +3 -0
  243. package/vendor/desktop/vendor/faces/cli/src/credentials.js +3 -0
  244. package/vendor/desktop/vendor/faces/cli/src/deps.js +3 -0
  245. package/vendor/desktop/vendor/faces/cli/src/devrun.js +3 -0
  246. package/vendor/desktop/vendor/faces/cli/src/diff.js +3 -0
  247. package/vendor/desktop/vendor/faces/cli/src/diffview.js +3 -0
  248. package/vendor/desktop/vendor/faces/cli/src/engine.js +3 -0
  249. package/vendor/desktop/vendor/faces/cli/src/entitlement.js +3 -0
  250. package/vendor/desktop/vendor/faces/cli/src/events.js +3 -0
  251. package/vendor/desktop/vendor/faces/cli/src/export.js +3 -0
  252. package/vendor/desktop/vendor/faces/cli/src/filepreview.js +3 -0
  253. package/vendor/desktop/vendor/faces/cli/src/fingerprint.js +3 -0
  254. package/vendor/desktop/vendor/faces/cli/src/format.js +3 -0
  255. package/vendor/desktop/vendor/faces/cli/src/fuzzy.js +3 -0
  256. package/vendor/desktop/vendor/faces/cli/src/gate.js +3 -0
  257. package/vendor/desktop/vendor/faces/cli/src/history.js +3 -0
  258. package/vendor/desktop/vendor/faces/cli/src/init.js +3 -0
  259. package/vendor/desktop/vendor/faces/cli/src/input.js +3 -0
  260. package/vendor/desktop/vendor/faces/cli/src/keys.js +3 -0
  261. package/vendor/desktop/vendor/faces/cli/src/limits.js +3 -0
  262. package/vendor/desktop/vendor/faces/cli/src/markdown.js +3 -0
  263. package/vendor/desktop/vendor/faces/cli/src/mcp.js +3 -0
  264. package/vendor/desktop/vendor/faces/cli/src/models.js +3 -0
  265. package/vendor/desktop/vendor/faces/cli/src/naming.js +3 -0
  266. package/vendor/desktop/vendor/faces/cli/src/overlays.js +3 -0
  267. package/vendor/desktop/vendor/faces/cli/src/panels.js +3 -0
  268. package/vendor/desktop/vendor/faces/cli/src/permissions.js +3 -0
  269. package/vendor/desktop/vendor/faces/cli/src/ping.js +3 -0
  270. package/vendor/desktop/vendor/faces/cli/src/presence.js +3 -0
  271. package/vendor/desktop/vendor/faces/cli/src/provenance.js +58 -0
  272. package/vendor/desktop/vendor/faces/cli/src/provenance.lock.json +36 -0
  273. package/vendor/desktop/vendor/faces/cli/src/render.js +3 -0
  274. package/vendor/desktop/vendor/faces/cli/src/screen.js +3 -0
  275. package/vendor/desktop/vendor/faces/cli/src/screens.js +3 -0
  276. package/vendor/desktop/vendor/faces/cli/src/secret.js +3 -0
  277. package/vendor/desktop/vendor/faces/cli/src/securefs.js +3 -0
  278. package/vendor/desktop/vendor/faces/cli/src/settings.js +3 -0
  279. package/vendor/desktop/vendor/faces/cli/src/shared.js +3 -0
  280. package/vendor/desktop/vendor/faces/cli/src/sharedpaths.js +3 -0
  281. package/vendor/desktop/vendor/faces/cli/src/signup.js +3 -0
  282. package/vendor/desktop/vendor/faces/cli/src/summarize.js +3 -0
  283. package/vendor/desktop/vendor/faces/cli/src/sysdiag.js +3 -0
  284. package/vendor/desktop/vendor/faces/cli/src/system.js +3 -0
  285. package/vendor/desktop/vendor/faces/cli/src/theme.js +3 -0
  286. package/vendor/desktop/vendor/faces/cli/src/title.js +3 -0
  287. package/vendor/desktop/vendor/faces/cli/src/todos.js +3 -0
  288. package/vendor/desktop/vendor/faces/cli/src/tokens.js +3 -0
  289. package/vendor/desktop/vendor/faces/cli/src/topup.js +3 -0
  290. package/vendor/desktop/vendor/faces/cli/src/update.js +3 -0
  291. package/vendor/desktop/vendor/faces/cli/vendor/client/aegis.js +4 -0
  292. package/vendor/desktop/vendor/faces/cli/vendor/client/attest.js +3 -0
  293. package/vendor/desktop/vendor/faces/cli/vendor/client/authorship-key.js +3 -0
  294. package/vendor/desktop/vendor/faces/cli/vendor/client/auto-provision.js +3 -0
  295. package/vendor/desktop/vendor/faces/cli/vendor/client/brain-catalog.js +3 -0
  296. package/vendor/desktop/vendor/faces/cli/vendor/client/byok-catalog.js +3 -0
  297. package/vendor/desktop/vendor/faces/cli/vendor/client/catalog-client.js +3 -0
  298. package/vendor/desktop/vendor/faces/cli/vendor/client/conversation-export.js +3 -0
  299. package/vendor/desktop/vendor/faces/cli/vendor/client/credentials.js +3 -0
  300. package/vendor/desktop/vendor/faces/cli/vendor/client/device-fingerprint.js +3 -0
  301. package/vendor/desktop/vendor/faces/cli/vendor/client/drive-connect.js +3 -0
  302. package/vendor/desktop/vendor/faces/cli/vendor/client/drive-upload.js +3 -0
  303. package/vendor/desktop/vendor/faces/cli/vendor/client/env-file.js +3 -0
  304. package/vendor/desktop/vendor/faces/cli/vendor/client/fingerprint.js +3 -0
  305. package/vendor/desktop/vendor/faces/cli/vendor/client/foreign-memory.js +3 -0
  306. package/vendor/desktop/vendor/faces/cli/vendor/client/google-signin.js +3 -0
  307. package/vendor/desktop/vendor/faces/cli/vendor/client/hooks.js +3 -0
  308. package/vendor/desktop/vendor/faces/cli/vendor/client/model-discovery.js +3 -0
  309. package/vendor/desktop/vendor/faces/cli/vendor/client/naming.js +3 -0
  310. package/vendor/desktop/vendor/faces/cli/vendor/client/platform.js +3 -0
  311. package/vendor/desktop/vendor/faces/cli/vendor/client/prefs.js +3 -0
  312. package/vendor/desktop/vendor/faces/cli/vendor/client/presence-constants.js +3 -0
  313. package/vendor/desktop/vendor/faces/cli/vendor/client/presence.js +3 -0
  314. package/vendor/desktop/vendor/faces/cli/vendor/client/record-vault.js +105 -0
  315. package/vendor/desktop/vendor/faces/cli/vendor/client/session-store.js +3 -0
  316. package/vendor/desktop/vendor/faces/cli/vendor/client/topup.js +3 -0
  317. package/vendor/desktop/vendor/faces/cli/vendor/client/touch.js +3 -0
  318. package/vendor/desktop/vendor/faces/cli/vendor/client/update.js +3 -0
  319. package/vendor/desktop/vendor/faces/cli/vendor/client/user-models.js +3 -0
  320. package/vendor/desktop/vendor/faces/cli/vendor/covenant/README.md +21 -0
  321. package/vendor/desktop/vendor/faces/cli/vendor/covenant/aegis.seal +177 -0
  322. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/aegis-seal.mjs +241 -0
  323. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/agents.js +3 -0
  324. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/attachments.js +3 -0
  325. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/autonomous.js +3 -0
  326. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/claude-pro.js +3 -0
  327. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/context.js +3 -0
  328. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/covenant.js +567 -0
  329. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/engine.js +3 -0
  330. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/entitlement.js +3 -0
  331. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/exec-plan.js +3 -0
  332. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/git-scope.js +3 -0
  333. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/integrity.js +3 -0
  334. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/local.js +3 -0
  335. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/prompt.js +3 -0
  336. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/queue.js +3 -0
  337. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/session-rounds.js +3 -0
  338. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/shell.js +3 -0
  339. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/spill.js +3 -0
  340. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/tools.js +3 -0
  341. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/turn-guard.js +3 -0
  342. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/worktree-lock.js +3 -0
  343. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/settings.js +3 -0
  344. package/vendor/desktop/vendor/faces/cli/vendor/desktop/main.js +4 -0
  345. package/vendor/desktop/vendor/faces/cli/vendor/desktop/renderer/usage.js +3 -0
  346. package/vendor/desktop/vendor/faces/cli/vendor/hosts/install.js +1 -0
  347. package/vendor/desktop/vendor/faces/cli/vendor/hosts/openai-shim.js +2 -0
  348. package/vendor/desktop/vendor/faces/cli/vendor/hosts/spec.js +1 -0
  349. package/vendor/desktop/vendor/faces/cli/vendor/hosts/targets.js +1 -0
  350. package/vendor/desktop/vendor/faces/cli/vendor/mcp/server.js +4 -0
  351. package/vendor/desktop/vendor/faces/cli/vendor/mcp/tools.js +3 -0
  352. package/vendor/desktop/vendor/faces/cli/vendor/one/src/child.js +3 -0
  353. package/vendor/desktop/vendor/faces/cli/vendor/one/src/permissions.js +3 -0
  354. package/vendor/desktop/vendor/faces/cli/vendor/one/src/selfhost.js +3 -0
  355. package/vendor/desktop/vendor/faces/cli/vendor/tools/agent-gate.mjs +1203 -0
  356. package/vendor/desktop/vendor/fingerprint.js +1 -1064
  357. package/vendor/desktop/vendor/foreign-memory.js +1 -669
  358. package/vendor/desktop/vendor/google-signin.js +1 -133
  359. package/vendor/desktop/vendor/hooks.js +1 -430
  360. package/vendor/desktop/vendor/model-discovery.js +1 -373
  361. package/vendor/desktop/vendor/naming.js +1 -283
  362. package/vendor/desktop/vendor/platform.js +1 -937
  363. package/vendor/desktop/vendor/prefs.js +1 -351
  364. package/vendor/desktop/vendor/presence-constants.js +1 -107
  365. package/vendor/desktop/vendor/presence.js +1 -438
  366. package/vendor/desktop/vendor/record-vault.js +3 -1055
  367. package/vendor/desktop/vendor/selfhost.js +3 -0
  368. package/vendor/desktop/vendor/session-store.js +1 -575
  369. package/vendor/desktop/vendor/topup.js +1 -297
  370. package/vendor/desktop/vendor/touch.js +1 -458
  371. package/vendor/desktop/vendor/update.js +1 -763
  372. package/vendor/desktop/vendor/user-models.js +1 -381
@@ -1,261 +1,3 @@
1
1
  // SPDX-License-Identifier: AGPL-3.0-or-later
2
2
  // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
- // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
4
- // Conveying a modified copy, or running one as a network service, owes the
5
- // corresponding source under this licence (§5/§13) — see LICENSING.md.
6
- 'use strict';
7
-
8
- /**
9
- * providers.js — one flat list of every provider and every model this build can
10
- * address, each with the URL a turn to it actually goes to.
11
- *
12
- * WHY THIS EXISTS. The Model card answers "what is selected"; it never answers
13
- * "what can I select, and where does that go". Those are different questions,
14
- * and the second one had no surface at all: a user could see four provider
15
- * classes and one model dropdown, and still have no way to learn that
16
- * `byok:anthropic:claude-sonnet-5` is sent to the relay, that `local:llama3.2`
17
- * goes to localhost, or that `pro` is not a URL at all but a child process.
18
- *
19
- * TWO DELIBERATE OMISSIONS, and they are the point of the file's shape:
20
- *
21
- * - No φ(α) seal row. The authorship panel is not a provider; it publishes a
22
- * record of a repo, and putting it in a provider table would invite the
23
- * reader to think a turn can be addressed to it.
24
- * - No autonomous-box row. The fan-out is a *property of a turn* on the
25
- * Aegis Cloud class (engine.js AUTONOMOUS_CLASS), not an endpoint — it
26
- * reaches no route the pooled row does not already name. It already has its
27
- * own toggle in the Model card, next to the class that has it at all.
28
- *
29
- * Both omissions are asserted in test/renderer-providers.test.mjs so a later
30
- * "why is this missing" pass cannot quietly re-add them.
31
- *
32
- * The URLS ARE READ OFF THE TRANSPORT, not guessed:
33
- * - pooled : vendor/aegis.js -> '/api/v1/chat/completions', under
34
- * DEFAULT_API_BASE ('https://aegiscloud.org')
35
- * - byok : vendor/aegis.js -> '/api/v1/byok/chat/completions', same base,
36
- * with a per-request X-Provider-Key
37
- * - local : lib/local/local.js -> `${base}/v1/chat/completions`, base
38
- * DEFAULT_BASE ('http://localhost:11434')
39
- * - pro : no route — a `claude` child process (claude-pro.js PRO_MODELS
40
- * are CLI aliases, not wire ids), so `url` is null and the row
41
- * says so instead of printing a plausible-looking URL.
42
- *
43
- * Pure: no DOM, no Electron, no fetch. Takes the engine's own listClasses /
44
- * listModels payloads and returns data; the toolbar paints it.
45
- */
46
-
47
- /** Paths, as the transport spells them. Not templates — literal strings. */
48
- const POOLED_PATH = '/api/v1/chat/completions';
49
- const BYOK_PATH = '/api/v1/byok/chat/completions';
50
- const LOCAL_PATH = '/v1/chat/completions';
51
- const DEFAULT_CLOUD_BASE = 'https://aegiscloud.org';
52
- const DEFAULT_LOCAL_BASE = 'http://localhost:11434';
53
-
54
- /** Join a base and a path without doubling or dropping the separator. */
55
- function joinUrl(base, suffix) {
56
- const b = typeof base === 'string' ? base.trim() : '';
57
- const p = typeof suffix === 'string' ? suffix.trim() : '';
58
- if (!b) return '';
59
- // An absolute URL in the path slot wins: a deployment may publish a full
60
- // base, and prefixing that with another base produces a URL that resolves to
61
- // nothing while looking correct on screen.
62
- if (/^https?:\/\//i.test(p)) return p;
63
- if (!p) return b.replace(/\/+$/, '');
64
- return `${b.replace(/\/+$/, '')}/${p.replace(/^\/+/, '')}`;
65
- }
66
-
67
- /**
68
- * The billing line for a row. Read from what the engine already reported rather
69
- * than assumed: a byok row's fee note only exists when the server publishes one
70
- * (`fee.require_balance`), and saying "funded balance required" on a
71
- * deployment that does not gate that way is the same lie pointing the other
72
- * way (see engine.listModels' byok branch).
73
- */
74
- function billingFor(cls, classRow, modelRow, listPayload) {
75
- if (cls === 'pro') {
76
- return 'Claude Code subscription — no AEGIS tokens spent';
77
- }
78
- if (cls === 'local') {
79
- return 'free — runs on this machine';
80
- }
81
- if (cls === 'byok') {
82
- const fee = (listPayload && listPayload.fee) || null;
83
- if (fee && fee.require_balance) {
84
- return 'your provider key pays the vendor; an AEGIS key and a funded balance pay the handling fee';
85
- }
86
- return 'your provider key pays the vendor; an AEGIS key attributes the handling fee';
87
- }
88
- // aegis (pooled): the account pays. No claim is made about which plan covers
89
- // it — `configured` already says whether a key is present, and the Status
90
- // card is where plan and balance actually live.
91
- return 'billed to your AEGIS account';
92
- }
93
-
94
- /**
95
- * Why a row cannot be used, or null when it can. Deliberately one short reason
96
- * per row: the Model card's hint already carries the full remedy for the
97
- * selected class, and duplicating that copy per row makes the list unreadable.
98
- */
99
- function blockedReason(cls, classRow, modelRow, listPayload) {
100
- if (cls === 'aegis' && listPayload && listPayload.needsKey) {
101
- return 'no AEGIS API key on this machine';
102
- }
103
- if (cls === 'local' && listPayload && listPayload.needsDaemon) {
104
- return 'no model server listening';
105
- }
106
- if (cls === 'local' && listPayload && listPayload.listed === false) {
107
- return 'server answered but lists no models';
108
- }
109
- if (cls === 'byok' && modelRow && modelRow.configured === false) {
110
- // The precise reason when the env file REFUSED a value it was given, rather
111
- // than never having been given one — that distinction is the difference
112
- // between "add a key" and "the key you added was rejected".
113
- return modelRow.keyRejected
114
- ? `provider key rejected: ${modelRow.keyRejected}`
115
- : 'no key saved for this provider';
116
- }
117
- if (cls === 'pro' && classRow && classRow.configured === false) {
118
- return 'not signed in to Claude Code';
119
- }
120
- return null;
121
- }
122
-
123
- /**
124
- * One row per addressable model, in class order, plus a placeholder row for a
125
- * class that offers no model list but is still a target (a pooled turn with no
126
- * model pinned, a local daemon with nothing pulled yet).
127
- *
128
- * `rows` is `[{ class, classLabel, classConfigured, list }]`, where `list` is
129
- * whatever `models.listModels(cls)` resolved to — including its error/state
130
- * shape, so a class that failed to list still gets a row that says why.
131
- */
132
- function buildProviderPaths(rows) {
133
- const out = [];
134
- const input = Array.isArray(rows) ? rows : [];
135
- for (const r of input) {
136
- if (!r || typeof r.class !== 'string') continue;
137
- const cls = r.class;
138
- const classRow = { configured: r.classConfigured !== false };
139
- const list = r.list && typeof r.list === 'object' ? r.list : null;
140
- const models = Array.isArray(list && list.models) ? list.models : [];
141
- const cloudBase = (list && (list.apiBase || list.baseURL)) || DEFAULT_CLOUD_BASE;
142
- const localBase = (list && list.baseURL) || DEFAULT_LOCAL_BASE;
143
-
144
- if (!models.length) {
145
- // No model row still means a real destination for two classes: the pooled
146
- // class runs the server's default when nothing is pinned, and a local
147
- // daemon with nothing pulled still answers on the same route once a tag
148
- // is typed (engine.listModels' local branch). For byok and pro an empty
149
- // list is genuinely "nothing to address", so only the reason is shown.
150
- const placeholderOk = cls === 'aegis' || cls === 'local';
151
- out.push({
152
- class: cls,
153
- classLabel: r.classLabel || cls,
154
- model: '',
155
- modelLabel:
156
- cls === 'aegis'
157
- ? 'server default (auto)'
158
- : cls === 'local'
159
- ? 'type a model tag in the Model card'
160
- : '—',
161
- provider: '',
162
- uniqueModel: cls,
163
- group: r.classLabel || cls,
164
- url: placeholderOk
165
- ? joinUrl(cls === 'local' ? localBase : cloudBase, cls === 'local' ? LOCAL_PATH : POOLED_PATH)
166
- : null,
167
- method: placeholderOk ? 'POST' : null,
168
- billing: billingFor(cls, classRow, null, list),
169
- blocked: blockedReason(cls, classRow, null, list),
170
- // A row with no model id is not a selectable target: it is the class's
171
- // own state, printed where its models would have gone.
172
- selectable: false,
173
- });
174
- continue;
175
- }
176
-
177
- for (const m of models) {
178
- if (!m || !m.id) continue;
179
- const provider = typeof m.provider === 'string' && m.provider ? m.provider : cls;
180
- let url = null;
181
- let method = null;
182
- if (cls === 'aegis') {
183
- url = joinUrl(cloudBase, POOLED_PATH);
184
- method = 'POST';
185
- } else if (cls === 'byok') {
186
- // The relay's route, INCLUDING for provider `custom`. That row looks
187
- // like an exception and is not: this app never dials the user's own
188
- // endpoint. It posts to the relay with `base_url` in the body and the
189
- // server makes the outbound call (client/aegis.js byokChatCompletion,
190
- // aegis1 `_byok_custom_base_url`). Printing the endpoint here would
191
- // describe a connection no part of this client opens.
192
- url = joinUrl(cloudBase, BYOK_PATH);
193
- method = 'POST';
194
- } else if (cls === 'local') {
195
- url = joinUrl(localBase, LOCAL_PATH);
196
- method = 'POST';
197
- }
198
- // cls === 'pro' leaves both null: it is a child process, not a route.
199
- out.push({
200
- class: cls,
201
- classLabel: r.classLabel || cls,
202
- model: m.id,
203
- modelLabel: m.label || m.id,
204
- provider,
205
- uniqueModel: `${cls}:${m.id}`,
206
- group: r.classLabel || cls,
207
- url,
208
- method,
209
- billing: billingFor(cls, classRow, m, list),
210
- blocked: blockedReason(cls, classRow, m, list),
211
- selectable: true,
212
- });
213
- }
214
- }
215
- return out;
216
- }
217
-
218
- /**
219
- * Case-insensitive substring match across everything a user might type: the
220
- * model id, its label, the provider, the class, and the URL's host+path.
221
- * Multi-term: every whitespace-separated term must match somewhere, so
222
- * "anthropic sonnet" narrows instead of returning nothing.
223
- */
224
- function filterEntries(entries, query) {
225
- const list = Array.isArray(entries) ? entries : [];
226
- const q = String(query == null ? '' : query).trim().toLowerCase();
227
- if (!q) return list.slice();
228
- const terms = q.split(/\s+/).filter(Boolean);
229
- return list.filter((e) => {
230
- const hay = [e.model, e.modelLabel, e.provider, e.class, e.classLabel, e.url || '']
231
- .join('\n')
232
- .toLowerCase();
233
- return terms.every((t) => hay.includes(t));
234
- });
235
- }
236
-
237
- /**
238
- * The selection a row would produce, in the shape the Model card's own controls
239
- * take: `{ class, model }` for the two <select>s. `model` is '' for a class
240
- * whose picker offers the "auto" entry, which is exactly what selecting that
241
- * option means today.
242
- */
243
- function selectionFor(entry) {
244
- if (!entry) return null;
245
- return {
246
- class: entry.class,
247
- model: entry.class === 'aegis' && !entry.model ? '' : entry.model,
248
- };
249
- }
250
-
251
- if (typeof module !== 'undefined' && module.exports) {
252
- module.exports = {
253
- buildProviderPaths,
254
- filterEntries,
255
- selectionFor,
256
- joinUrl,
257
- POOLED_PATH,
258
- BYOK_PATH,
259
- LOCAL_PATH,
260
- };
261
- }
3
+ "use strict";const POOLED_PATH="/api/v1/chat/completions",BYOK_PATH="/api/v1/byok/chat/completions",LOCAL_PATH="/v1/chat/completions",DEFAULT_CLOUD_BASE="https://aegiscloud.org",DEFAULT_LOCAL_BASE="http://localhost:11434";function joinUrl(e,l){const o="string"==typeof e?e.trim():"",r="string"==typeof l?l.trim():"";return o?/^https?:\/\//i.test(r)?r:r?`${o.replace(/\/+$/,"")}/${r.replace(/^\/+/,"")}`:o.replace(/\/+$/,""):""}function billingFor(e,l,o,r){if("pro"===e)return"Claude Code subscription — no AEGIS tokens spent";if("local"===e)return"free — runs on this machine";if("byok"===e){const e=r&&r.fee||null;return e&&e.require_balance?"your provider key pays the vendor; an AEGIS key and a funded balance pay the handling fee":"your provider key pays the vendor; an AEGIS key attributes the handling fee"}return"billed to your AEGIS account"}function blockedReason(e,l,o,r){return"aegis"===e&&r&&r.needsKey?"no AEGIS API key on this machine":"local"===e&&r&&r.needsDaemon?"no model server listening":"local"===e&&r&&!1===r.listed?"server answered but lists no models":"byok"===e&&o&&!1===o.configured?o.keyRejected?`provider key rejected: ${o.keyRejected}`:"no key saved for this provider":"pro"===e&&l&&!1===l.configured?"not signed in to Claude Code":null}function buildProviderPaths(e){const l=[],o=Array.isArray(e)?e:[];for(const e of o){if(!e||"string"!=typeof e.class)continue;const o=e.class,r={configured:!1!==e.classConfigured},n=e.list&&"object"==typeof e.list?e.list:null,s=Array.isArray(n&&n.models)?n.models:[],i=n&&(n.apiBase||n.baseURL)||DEFAULT_CLOUD_BASE,t=n&&n.baseURL||DEFAULT_LOCAL_BASE;if(s.length)for(const a of s){if(!a||!a.id)continue;const s="string"==typeof a.provider&&a.provider?a.provider:o;let c=null,d=null;"aegis"===o?(c=joinUrl(i,POOLED_PATH),d="POST"):"byok"===o?(c=joinUrl(i,BYOK_PATH),d="POST"):"local"===o&&(c=joinUrl(t,LOCAL_PATH),d="POST"),l.push({class:o,classLabel:e.classLabel||o,model:a.id,modelLabel:a.label||a.id,provider:s,uniqueModel:`${o}:${a.id}`,group:e.classLabel||o,url:c,method:d,billing:billingFor(o,r,a,n),blocked:blockedReason(o,r,a,n),selectable:!0})}else{const s="aegis"===o||"local"===o;l.push({class:o,classLabel:e.classLabel||o,model:"",modelLabel:"aegis"===o?"server default (auto)":"local"===o?"type a model tag in the Model card":"—",provider:"",uniqueModel:o,group:e.classLabel||o,url:s?joinUrl("local"===o?t:i,"local"===o?LOCAL_PATH:POOLED_PATH):null,method:s?"POST":null,billing:billingFor(o,r,null,n),blocked:blockedReason(o,r,null,n),selectable:!1})}}return l}function filterEntries(e,l){const o=Array.isArray(e)?e:[],r=String(null==l?"":l).trim().toLowerCase();if(!r)return o.slice();const n=r.split(/\s+/).filter(Boolean);return o.filter((e=>{const l=[e.model,e.modelLabel,e.provider,e.class,e.classLabel,e.url||""].join("\n").toLowerCase();return n.every((e=>l.includes(e)))}))}function selectionFor(e){return e?{class:e.class,model:"aegis"!==e.class||e.model?e.model:""}:null}"undefined"!=typeof module&&module.exports&&(module.exports={buildProviderPaths:buildProviderPaths,filterEntries:filterEntries,selectionFor:selectionFor,joinUrl:joinUrl,POOLED_PATH:POOLED_PATH,BYOK_PATH:BYOK_PATH,LOCAL_PATH:LOCAL_PATH});
@@ -1,287 +1,3 @@
1
1
  // SPDX-License-Identifier: AGPL-3.0-or-later
2
2
  // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
- // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
4
- // Conveying a modified copy, or running one as a network service, owes the
5
- // corresponding source under this licence (§5/§13) — see LICENSING.md.
6
- 'use strict';
7
-
8
- /**
9
- * AEGIS Quick Launcher renderer — a one-shot prompt over window.models.chat
10
- * (the same LocalEngine transport the main window's chat uses), with the
11
- * agent loop's tool calling turned off (`tools: false`): a small always-
12
- * on-top popup is the wrong place for a tool-approval card to pop up in.
13
- *
14
- * Wired to the BYOK class, not the pooled Aegis Cloud one. The launcher is the
15
- * surface a user reaches for with a key they already own and have already
16
- * configured; defaulting it to the pooled class quietly spent the account's
17
- * balance on a hotkey press. BYOK is the class that spends the caller's own
18
- * provider key, so it is what this window asks for, and the model picker lists
19
- * the BYOK catalog — every provider's models, one row each — instead of the
20
- * account catalog it used to show.
21
- *
22
- * Two states the old launcher had no vocabulary for, both now named on screen
23
- * rather than surfacing as a raw 401 on send:
24
- * - `needsProviderKey` — the catalog arrived but not one row has a usable
25
- * key, so the answer is a key (or `~/.aegiscode/.env`), not a retry.
26
- * - `needsAegisKey` — BYOK still attributes the handling fee to an AEGIS
27
- * account (engine.js requires the account key before a BYOK turn goes
28
- * out). Said here, before the user types, because the send would otherwise
29
- * fail on a model row that looks perfectly configured.
30
- * - `providersFailed` — the catalog itself did not arrive. Distinct from an
31
- * empty one: offline wants a retry, a server error wants the status.
32
- *
33
- * Same contextIsolation/sandbox posture as renderer/app.js — talks only to
34
- * window.models / window.quickLauncher, both whitelisted by preload.js.
35
- */
36
-
37
- (function () {
38
- if (!window.models || !window.quickLauncher) {
39
- document.body.textContent =
40
- 'This page must run inside the AEGIS Electron host (window.models/window.quickLauncher missing).';
41
- throw new Error('window.models/window.quickLauncher unavailable — not running under Electron');
42
- }
43
-
44
- const models = window.models;
45
- const quickLauncher = window.quickLauncher;
46
-
47
- // BYOK: the class that spends the caller's own provider key. See the header.
48
- const CLASS = 'byok';
49
- // Bumped from 'quick-launcher-model': the stored value used to be an Aegis
50
- // Cloud id (`nexus-…`), and restoring one against a BYOK list would either be
51
- // silently ignored or, worse, pin a foreign id. A new key starts clean.
52
- const MODEL_KEY = 'quick-launcher-byok-model';
53
- const IDLE_HINT = 'Enter to ask · Esc to close';
54
-
55
- const els = {
56
- form: document.getElementById('ql-form'),
57
- prompt: document.getElementById('ql-prompt'),
58
- response: document.getElementById('ql-response'),
59
- modelLabel: document.getElementById('ql-model-label'),
60
- modelSelect: document.getElementById('ql-model-select'),
61
- stopBtn: document.getElementById('ql-stop'),
62
- pushBtn: document.getElementById('ql-push'),
63
- status: document.getElementById('ql-status'),
64
- };
65
-
66
- let busy = false;
67
- let sessionId = null;
68
- let lastPrompt = '';
69
- let lastResponse = '';
70
- let hasResult = false;
71
- // Set by loadModel() so ask() can refuse with the reason the picker already
72
- // shows, instead of letting the engine's 401 arrive as "Error: …".
73
- let blockedReason = null;
74
-
75
- function setStatus(text) {
76
- els.status.textContent = text;
77
- }
78
-
79
- function setBusy(next) {
80
- busy = next;
81
- els.stopBtn.hidden = !next;
82
- els.prompt.disabled = next;
83
- }
84
-
85
- /** The one-line reason a BYOK turn cannot go out, or null when it can. Order
86
- * follows what the user can act on: an unreachable catalog first (nothing
87
- * else is knowable), then the provider key, then the account key. */
88
- function blockReasonFor(data, list) {
89
- if (data && data.providersFailed) {
90
- const why = (data && data.providersError) || 'catalog unreachable';
91
- return `BYOK catalog unavailable — ${why}`;
92
- }
93
- if (!list.length) return 'No BYOK models — add a provider key in Settings › Provider';
94
- if (data && data.needsProviderKey) {
95
- return 'No provider key saved — add one in Settings › Provider';
96
- }
97
- if (data && data.needsAegisKey) {
98
- return 'BYOK also needs your AEGIS key — connect it in Settings';
99
- }
100
- return null;
101
- }
102
-
103
- /** Populate the model picker for BYOK. Every row carries `provider` and
104
- * `configured`; a row with no usable key is shown but disabled, so the user
105
- * can see the model exists and what (a key) unblocks it, rather than having
106
- * it silently absent from a list they were told was the catalog. */
107
- async function loadModel() {
108
- try {
109
- const classes = (await models.listClasses()) || [];
110
- const byokClass = classes.find((c) => c.class === CLASS);
111
- // The class row itself can say "not configured" while a single provider
112
- // row is — listClasses() reports provider rows only from the store, and
113
- // an env-file key is not one. So this is a label hint, never a gate: the
114
- // catalog below is authoritative and is asked unconditionally.
115
- const data = await models.listModels(CLASS);
116
- const list = ((data && data.models) || []).slice();
117
- // Configured first, then by provider then model, so the rows a user can
118
- // actually send on are at the top of a list that can run to dozens.
119
- list.sort((a, b) => {
120
- const ca = a.configured ? 0 : 1;
121
- const cb = b.configured ? 0 : 1;
122
- if (ca !== cb) return ca - cb;
123
- const pa = String(a.provider || '');
124
- const pb = String(b.provider || '');
125
- if (pa !== pb) return pa < pb ? -1 : 1;
126
- const ia = String(a.id || '');
127
- const ib = String(b.id || '');
128
- return ia < ib ? -1 : ia > ib ? 1 : 0;
129
- });
130
-
131
- els.modelSelect.innerHTML = '';
132
- for (const m of list) {
133
- const opt = document.createElement('option');
134
- opt.value = m.id;
135
- // The label the engine built is already `Provider — model`; a keyless
136
- // row says why it is unselectable on the same line.
137
- opt.textContent = m.configured ? m.label || m.id : `${m.label || m.id} (no key)`;
138
- opt.disabled = !m.configured;
139
- if (!m.configured) opt.title = 'No key saved for this provider yet.';
140
- els.modelSelect.appendChild(opt);
141
- }
142
-
143
- const saved = localStorage.getItem(MODEL_KEY);
144
- if (saved && list.some((m) => m.id === saved && m.configured)) {
145
- els.modelSelect.value = saved;
146
- } else {
147
- // Land the picker on a sendable row, not on list[0] by accident — the
148
- // sort puts configured rows first, but a disabled first row would make
149
- // the select look empty and read as "nothing configured".
150
- const firstUsable = list.find((m) => m.configured);
151
- if (firstUsable) els.modelSelect.value = firstUsable.id;
152
- }
153
-
154
- els.modelSelect.hidden = list.length <= 1;
155
- const sendable = list.filter((m) => m.configured).length;
156
- els.modelLabel.textContent = list.length <= 1 && list[0]
157
- ? list[0].label || list[0].id
158
- : `BYOK · ${sendable}/${list.length}`;
159
-
160
- blockedReason = blockReasonFor(data, list);
161
- if (blockedReason) {
162
- els.modelSelect.hidden = list.length <= 1;
163
- setStatus(blockedReason);
164
- } else if (!byokClass) {
165
- // Should not happen (DESKTOP_CLASSES always ships 'byok'), but a picker
166
- // that lies about which class it is asking would be worse than a note.
167
- setStatus('BYOK is not offered by this build');
168
- }
169
- } catch (err) {
170
- els.modelLabel.textContent = 'BYOK — unavailable';
171
- els.modelSelect.hidden = true;
172
- blockedReason = `BYOK unavailable — ${err && err.message ? err.message : err}`;
173
- setStatus(blockedReason);
174
- }
175
- }
176
-
177
- els.modelSelect.addEventListener('change', () => {
178
- localStorage.setItem(MODEL_KEY, els.modelSelect.value);
179
- });
180
-
181
- async function ask(prompt) {
182
- if (!prompt || busy) return;
183
- if (blockedReason) {
184
- setStatus(blockedReason);
185
- return;
186
- }
187
- hasResult = false;
188
- els.pushBtn.hidden = true;
189
- els.response.textContent = '';
190
- setBusy(true);
191
- setStatus('thinking…');
192
- sessionId = `quick-${Date.now()}-${Math.random().toString(36).slice(2)}`;
193
- let text = '';
194
- try {
195
- const res = await models.chat(
196
- {
197
- class: CLASS,
198
- model: els.modelSelect.value || undefined,
199
- prompt,
200
- tools: false,
201
- sessionId,
202
- },
203
- (chunk) => {
204
- if (chunk && typeof chunk.delta === 'string' && chunk.delta) {
205
- text += chunk.delta;
206
- els.response.textContent = text;
207
- els.response.scrollTop = els.response.scrollHeight;
208
- }
209
- }
210
- );
211
- const msg = res && res.choices && res.choices[0] && res.choices[0].message;
212
- const finalText = text || (msg && msg.content) || '';
213
- els.response.textContent = finalText;
214
- lastPrompt = prompt;
215
- lastResponse = finalText;
216
- hasResult = Boolean(finalText);
217
- els.pushBtn.hidden = !hasResult;
218
- setStatus(hasResult ? '⌘/Ctrl+⏎ to add this to the main chat' : 'no answer');
219
- } catch (err) {
220
- els.response.textContent = `Error: ${err && err.message ? err.message : err}`;
221
- setStatus('failed');
222
- } finally {
223
- setBusy(false);
224
- sessionId = null;
225
- }
226
- }
227
-
228
- function stop() {
229
- if (sessionId) models.cancel(sessionId).catch(() => {});
230
- }
231
-
232
- function pushToMain() {
233
- if (!hasResult) return;
234
- quickLauncher
235
- .pushToMain({
236
- prompt: lastPrompt,
237
- response: lastResponse,
238
- model: els.modelSelect.value || null,
239
- // The class travels with the model so the main chat does not attribute
240
- // a BYOK answer to the pooled one it used to assume.
241
- class: CLASS,
242
- })
243
- .catch(() => {});
244
- }
245
-
246
- els.form.addEventListener('submit', (e) => {
247
- e.preventDefault();
248
- ask(els.prompt.value.trim());
249
- });
250
-
251
- els.prompt.addEventListener('keydown', (e) => {
252
- if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) {
253
- e.preventDefault();
254
- pushToMain();
255
- return;
256
- }
257
- if (e.key === 'Enter' && !e.shiftKey) {
258
- e.preventDefault();
259
- ask(els.prompt.value.trim());
260
- }
261
- });
262
-
263
- els.stopBtn.addEventListener('click', stop);
264
- els.pushBtn.addEventListener('click', pushToMain);
265
-
266
- // The window is shown/hidden, not reloaded, on every shortcut press (see
267
- // main.js toggleQuickLauncher) — so each time it regains focus is a fresh
268
- // "session" from the user's point of view and should start clean, unless a
269
- // stream from the previous session is still running in the background.
270
- window.addEventListener('focus', () => {
271
- if (busy) {
272
- els.prompt.focus();
273
- return;
274
- }
275
- els.prompt.value = '';
276
- els.response.textContent = '';
277
- els.pushBtn.hidden = true;
278
- hasResult = false;
279
- // A blocked launcher must keep saying why on focus — resetting to the idle
280
- // hint would erase the one line that explains why Enter does nothing.
281
- setStatus(blockedReason || IDLE_HINT);
282
- els.prompt.focus();
283
- });
284
-
285
- loadModel();
286
- els.prompt.focus();
287
- })();
3
+ "use strict";!function(){if(!window.models||!window.quickLauncher)throw document.body.textContent="This page must run inside the AEGIS Electron host (window.models/window.quickLauncher missing).",new Error("window.models/window.quickLauncher unavailable — not running under Electron");const e=window.models,t=window.quickLauncher,n="byok",o="quick-launcher-byok-model",l={form:document.getElementById("ql-form"),prompt:document.getElementById("ql-prompt"),response:document.getElementById("ql-response"),modelLabel:document.getElementById("ql-model-label"),modelSelect:document.getElementById("ql-model-select"),stopBtn:document.getElementById("ql-stop"),pushBtn:document.getElementById("ql-push"),status:document.getElementById("ql-status")};let d=!1,i=null,s="",r="",c=!1,a=null;function u(e){l.status.textContent=e}function m(e){d=e,l.stopBtn.hidden=!e,l.prompt.disabled=e}async function p(t){if(!t||d)return;if(a)return void u(a);c=!1,l.pushBtn.hidden=!0,l.response.textContent="",m(!0),u("thinking…"),i=`quick-${Date.now()}-${Math.random().toString(36).slice(2)}`;let o="";try{const d=await e.chat({class:n,model:l.modelSelect.value||void 0,prompt:t,tools:!1,sessionId:i},(e=>{e&&"string"==typeof e.delta&&e.delta&&(o+=e.delta,l.response.textContent=o,l.response.scrollTop=l.response.scrollHeight)})),a=d&&d.choices&&d.choices[0]&&d.choices[0].message,m=o||a&&a.content||"";l.response.textContent=m,s=t,r=m,c=Boolean(m),l.pushBtn.hidden=!c,u(c?"⌘/Ctrl+⏎ to add this to the main chat":"no answer")}catch(e){l.response.textContent=`Error: ${e&&e.message?e.message:e}`,u("failed")}finally{m(!1),i=null}}function h(){c&&t.pushToMain({prompt:s,response:r,model:l.modelSelect.value||null,class:n}).catch((()=>{}))}l.modelSelect.addEventListener("change",(()=>{localStorage.setItem(o,l.modelSelect.value)})),l.form.addEventListener("submit",(e=>{e.preventDefault(),p(l.prompt.value.trim())})),l.prompt.addEventListener("keydown",(e=>{if("Enter"===e.key&&(e.metaKey||e.ctrlKey))return e.preventDefault(),void h();"Enter"!==e.key||e.shiftKey||(e.preventDefault(),p(l.prompt.value.trim()))})),l.stopBtn.addEventListener("click",(function(){i&&e.cancel(i).catch((()=>{}))})),l.pushBtn.addEventListener("click",h),window.addEventListener("focus",(()=>{d||(l.prompt.value="",l.response.textContent="",l.pushBtn.hidden=!0,c=!1,u(a||"Enter to ask · Esc to close")),l.prompt.focus()})),async function(){try{const t=(await e.listClasses()||[]).find((e=>e.class===n)),d=await e.listModels(n),i=(d&&d.models||[]).slice();i.sort(((e,t)=>{const n=e.configured?0:1,o=t.configured?0:1;if(n!==o)return n-o;const l=String(e.provider||""),d=String(t.provider||"");if(l!==d)return l<d?-1:1;const i=String(e.id||""),s=String(t.id||"");return i<s?-1:i>s?1:0})),l.modelSelect.innerHTML="";for(const e of i){const t=document.createElement("option");t.value=e.id,t.textContent=e.configured?e.label||e.id:`${e.label||e.id} (no key)`,t.disabled=!e.configured,e.configured||(t.title="No key saved for this provider yet."),l.modelSelect.appendChild(t)}const s=localStorage.getItem(o);if(s&&i.some((e=>e.id===s&&e.configured)))l.modelSelect.value=s;else{const e=i.find((e=>e.configured));e&&(l.modelSelect.value=e.id)}l.modelSelect.hidden=i.length<=1;const r=i.filter((e=>e.configured)).length;l.modelLabel.textContent=i.length<=1&&i[0]?i[0].label||i[0].id:`BYOK · ${r}/${i.length}`,a=function(e,t){return e&&e.providersFailed?`BYOK catalog unavailable — ${e&&e.providersError||"catalog unreachable"}`:t.length?e&&e.needsProviderKey?"No provider key saved — add one in Settings › Provider":e&&e.needsAegisKey?"BYOK also needs your AEGIS key — connect it in Settings":null:"No BYOK models — add a provider key in Settings › Provider"}(d,i),a?(l.modelSelect.hidden=i.length<=1,u(a)):t||u("BYOK is not offered by this build")}catch(e){l.modelLabel.textContent="BYOK — unavailable",l.modelSelect.hidden=!0,a=`BYOK unavailable — ${e&&e.message?e.message:e}`,u(a)}}(),l.prompt.focus()}();