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,572 +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
- * Design tokens — the upstream engine design system, adopted wholesale, and
10
- * resolved through the terminal's capabilities (`caps.js`) rather than the
11
- * platform the process happens to run on.
12
- *
13
- * Every colour value below is copied verbatim from the upstream engine's theme,
14
- * which extracted them from the live ANSI stream of Claude Code: gold 255,193,7
15
- * · coral 215,119,87 · lavender 177,185,249 · blue 120,160,250 · green 78,186,101
16
- * · red 220,90,90 · gray 153,153,153 · dim 80,80,80. `test/cli-conformance.test.mjs`
17
- * pins them to the upstream engine's source and reads them back out of a truecolor
18
- * SGR prefix, so the design cannot drift.
19
- *
20
- * What DOES change per terminal is how those triples reach the screen:
21
- *
22
- * · `RGB()`/`BG()` go through `caps.rgb()/caps.bg()`, which emit 24-bit SGR,
23
- * the 256-colour cube, the 16 ANSI slots, or nothing at all. Truecolor is
24
- * the default on every platform, because the terminals we ship to all pass
25
- * 24-bit SGR through and a terminal that cannot downsamples it itself —
26
- * which is the correct authority for the decision. Narrowing the palette is
27
- * an explicit request (`AEGIS_COLOR=1|2`, `FORCE_COLOR`, `NO_COLOR`,
28
- * `AEGIS_FORCE_TRUECOLOR=0`), never an inference from `TERM` or the OS.
29
- * · `glyphsFor()` is a function of the resolved capabilities, so every host
30
- * gets the same ❯ ⎿ ✻ ✦ set; the ASCII stand-ins appear only when the user
31
- * asks for them (`AEGIS_ART=ascii`, `--ascii`).
32
- *
33
- * Both are re-materialised when the capabilities change (`onCapsChange`), so
34
- * `aegiscode --ascii`, `--no-color` and the `/terminal` command take effect on
35
- * the palette and glyph table of a *running* session — the exported objects are
36
- * mutated in place rather than replaced, because renderers hold references to
37
- * them (`const { C } = require('./theme.js')`).
38
- *
39
- * Zero dependencies: SGR escapes are hand-built, like the rest of this repo.
40
- */
41
-
42
- const { caps, detect, onCapsChange, rgb, bg } = require('./caps.js');
43
-
44
- // The stencil is the mark's single source of truth for its own runes — this
45
- // file resolves `star` through it rather than restating the platform rule.
46
- // `art.js` requires only `caps.js`, so this import cannot cycle.
47
- const { STAR, stencilGlyph } = require('./art.js');
48
-
49
- const RESET = '\x1b[0m';
50
- const BOLD = '\x1b[1m';
51
- const DIM = '\x1b[2m';
52
- const ITALIC = '\x1b[3m';
53
- const UNDER = '\x1b[4m';
54
- const BOLD_OFF = '\x1b[22m';
55
- const ITALIC_OFF = '\x1b[23m';
56
- const UNDER_OFF = '\x1b[24m';
57
- const RESET_FG = '\x1b[39m';
58
- const RESET_BG = '\x1b[49m';
59
-
60
- /** Truecolour foreground SGR (or the best the terminal can do — see caps.js). */
61
- const RGB = (r, g, b) => rgb(r, g, b);
62
- /** Truecolour background SGR (or the best the terminal can do). */
63
- const BG = (r, g, b) => bg(r, g, b);
64
-
65
- // ── the palettes ─────────────────────────────────────────────────────────────
66
- // Built by functions and written into stable objects: `Object.assign` on every
67
- // capability change keeps the key set identical (the conformance guard pins
68
- // `Object.keys(C)`) while the escapes follow the new depth.
69
-
70
- /** The dark palette. Role names match the upstream engine exactly. */
71
- const C = {};
72
- /** Light-theme approximations, true to the dark palette's hue mapping. */
73
- const LIGHT = {};
74
- /** The colourblind-friendly dark/light variants. */
75
- const CB_DARK = {};
76
- const CB_LIGHT = {};
77
- /** The 16-colour ANSI-only variants. */
78
- const ANSI_DARK = {};
79
- const ANSI_LIGHT = {};
80
-
81
- function buildDark() {
82
- return {
83
- gold: RGB(255, 193, 7), // header line, accents, welcome frame
84
- coral: RGB(215, 119, 87), // "Welcome to ..." title
85
- lavender: RGB(177, 185, 249), // selection cursor ❯, links, focused option
86
- blue: RGB(120, 160, 250), // selected palette row
87
- green: RGB(78, 186, 101), // checkmarks, success, diff additions
88
- red: RGB(220, 90, 90), // diff removals, errors
89
- gray: RGB(153, 153, 153), // secondary text, menu numbers, hints
90
- dim: RGB(80, 80, 80), // ╌ divider lines
91
- white: RGB(255, 255, 255), // primary text, spinner glyphs
92
- black: RGB(30, 30, 30), // code-block background
93
- darkBg: RGB(20, 20, 20), // theme card background
94
- };
95
- }
96
-
97
- function buildLight() {
98
- return {
99
- gold: RGB(180, 130, 0),
100
- coral: RGB(190, 100, 70),
101
- lavender: RGB(120, 130, 220),
102
- blue: RGB(70, 110, 220),
103
- green: RGB(60, 150, 80),
104
- red: RGB(200, 60, 60),
105
- gray: RGB(110, 110, 110),
106
- dim: RGB(170, 170, 170),
107
- white: RGB(40, 40, 40),
108
- black: RGB(245, 245, 245),
109
- darkBg: RGB(255, 255, 255),
110
- };
111
- }
112
-
113
- function buildCbDark() {
114
- return {
115
- ...buildDark(),
116
- // The red/green pair — the one that carries meaning in diffs and errors —
117
- // is remapped to the blue/orange axis, which stays distinguishable under
118
- // deuteranopia and protanopia.
119
- green: RGB(86, 182, 194),
120
- red: RGB(255, 146, 43),
121
- gold: RGB(255, 203, 71),
122
- };
123
- }
124
-
125
- function buildCbLight() {
126
- return {
127
- ...buildLight(),
128
- green: RGB(30, 130, 145),
129
- red: RGB(200, 100, 20),
130
- gold: RGB(150, 110, 0),
131
- };
132
- }
133
-
134
- // 16-colour SGR foregrounds. Written as escape strings rather than RGB triples
135
- // because the variant exists precisely to hand the decision to the terminal.
136
- const A = (n) => (caps().color ? `\x1b[${n}m` : '');
137
-
138
- function buildAnsiDark() {
139
- return {
140
- gold: A(93), coral: A(91), lavender: A(94), blue: A(94), green: A(92),
141
- red: A(91), gray: A(90), dim: A(90), white: A(97), black: A(40),
142
- darkBg: caps().color ? '\x1b[48;5;236m' : '',
143
- };
144
- }
145
-
146
- function buildAnsiLight() {
147
- return {
148
- gold: A(33), coral: A(31), lavender: A(34), blue: A(34), green: A(32),
149
- red: A(31), gray: A(90), dim: A(37), white: A(30), black: A(47),
150
- darkBg: caps().color ? '\x1b[48;5;254m' : '',
151
- };
152
- }
153
-
154
- /**
155
- * Diff palette for edit blocks in the transcript — Monokai Extended, taken
156
- * verbatim from the theme picker's preview (also `renderDiffPreview` in
157
- * the upstream engine's markdown renderer) so the two can never drift apart: dim
158
- * red/green backgrounds per row, the bright variant for the token that
159
- * actually changed inside the row, and the monokai syntax colors for the code
160
- * itself.
161
- *
162
- * A SEPARATE export, not keys added to `C`/`LIGHT`: `test/cli-conformance.test.mjs`
163
- * pins `Object.keys(C)` to exactly the eleven DEV_DARK role names, so a diff
164
- * entry folded into the palette would fail the conformance guard. This is the
165
- * same reason `DIFF` is its own object in the engine.
166
- */
167
- const DIFF = {};
168
- const DIFF_LIGHT = {};
169
-
170
- function buildDiff() {
171
- return {
172
- delFg: RGB(220, 90, 90),
173
- delBg: BG(61, 1, 0),
174
- delHiFg: RGB(248, 248, 242),
175
- delHiBg: BG(92, 2, 0),
176
- addFg: RGB(80, 200, 80),
177
- addBg: BG(2, 40, 0),
178
- addHiFg: RGB(255, 255, 255),
179
- addHiBg: BG(4, 71, 0),
180
- codeFg: RGB(248, 248, 242),
181
- gutter: RGB(120, 120, 120),
182
- kw: RGB(102, 217, 239),
183
- fn: RGB(166, 226, 46),
184
- str: RGB(230, 219, 116),
185
- num: RGB(174, 129, 255),
186
- comment: RGB(117, 113, 94),
187
- };
188
- }
189
-
190
- /**
191
- * The light-theme diff palette. Monokai's dark backgrounds on a light terminal
192
- * are unreadable, so the row backgrounds invert to a pale tint and the code
193
- * keeps its hue mapping from the dark set — the same relationship `LIGHT`
194
- * already has to `C`.
195
- */
196
- function buildDiffLight() {
197
- return {
198
- delFg: RGB(160, 40, 40),
199
- delBg: BG(255, 235, 233),
200
- delHiFg: RGB(90, 0, 0),
201
- delHiBg: BG(255, 205, 200),
202
- addFg: RGB(30, 130, 40),
203
- addBg: BG(232, 250, 232),
204
- addHiFg: RGB(0, 80, 0),
205
- addHiBg: BG(195, 240, 195),
206
- codeFg: RGB(40, 40, 40),
207
- gutter: RGB(150, 150, 150),
208
- kw: RGB(0, 120, 160),
209
- fn: RGB(80, 140, 0),
210
- str: RGB(150, 110, 0),
211
- num: RGB(120, 60, 200),
212
- comment: RGB(140, 140, 130),
213
- };
214
- }
215
-
216
- const THEMES = { dark: C, light: LIGHT };
217
-
218
- /**
219
- * The two extra palette families the reference's theme picker offers.
220
- *
221
- * `cb` is the colourblind-friendly variant (see `buildCbDark`). `ansi` uses
222
- * the terminal's own 16-colour table, for terminals whose truecolour output is
223
- * remapped anyway — the whole point being that the *terminal* decides, not us.
224
- */
225
- /**
226
- * The theme picker's table, copied from the upstream engine's screens THEMES
227
- * (names and notes verbatim). `light` is the flag the reference sets on commit
228
- * (`ctx.light = sel === 2 || sel === 4 || sel === 6`); `palette` is what this
229
- * client resolves the row to.
230
- *
231
- * Row 0 carries the reference's own note — "(match terminal)" — and now does
232
- * what it says: `terminalIsLight()` reads the background the terminal reports
233
- * about itself (`caps().background`, from `COLORFGBG`/`TERM_BACKGROUND`, see
234
- * `caps.js`) and resolves the row to `LIGHT` or `C` accordingly. Its `light`
235
- * field is therefore the *fallback* used when nothing is reported, not the
236
- * answer; `themeIsLight()` is the function that decides.
237
- */
238
- const THEME_TABLE = [
239
- { name: 'Auto', note: '(match terminal)', light: false, palette: C },
240
- { name: 'Dark mode', note: '', light: false, palette: C },
241
- { name: 'Light mode', note: '', light: true, palette: LIGHT },
242
- { name: 'Dark mode', note: '(colorblind-friendly)', light: false, palette: CB_DARK },
243
- { name: 'Light mode', note: '(colorblind-friendly)', light: true, palette: CB_LIGHT },
244
- { name: 'Dark mode', note: '(ANSI colors only)', light: false, palette: ANSI_DARK },
245
- { name: 'Light mode', note: '(ANSI colors only)', light: true, palette: ANSI_LIGHT },
246
- ];
247
-
248
- /** The picker row that means "match terminal" rather than "be dark/light". */
249
- const AUTO_THEME_INDEX = 0;
250
-
251
- /**
252
- * True when the terminal's own background is light.
253
- *
254
- * The dark palette's primary text is `RGB(255,255,255)`: drawn over a light
255
- * terminal it is white-on-white, which is a blank screen rather than a
256
- * mis-styled one. So this is the one probe that decides between two *legible*
257
- * palettes — it never changes the mark, the glyph set, the colour depth or the
258
- * control sequences, and it is never inferred from `process.platform`.
259
- *
260
- * @param {object} [c] a caps object; defaults to the live process's
261
- */
262
- function terminalIsLight(c = caps()) {
263
- return c.background === 'light';
264
- }
265
-
266
- /**
267
- * Resolve a picker row to the palette family it should draw with — the single
268
- * place "is this row light?" is answered, so a ctx whose `light` flag was
269
- * seeded from the row index can never disagree with the palette `themeOf` picks.
270
- *
271
- * Explicit rows answer from their own flag; row 0 (Auto) asks the terminal; an
272
- * index outside the table falls back to dark, which is what `themeOf` did with
273
- * an unknown index before this existed.
274
- *
275
- * @param {number} themeIndex a row index from THEME_TABLE
276
- * @param {object} [c] a caps object; defaults to the live process's
277
- */
278
- function themeIsLight(themeIndex, c = caps()) {
279
- const row = THEME_TABLE[themeIndex];
280
- if (!row) return false;
281
- if (themeIndex === AUTO_THEME_INDEX) return terminalIsLight(c);
282
- return !!row.light;
283
- }
284
-
285
- /**
286
- * The sibling row: the same palette family at the other brightness.
287
- *
288
- * Row 0 (Auto) has no sibling — it is not a brightness, it is a question. The
289
- * pairs are the picker's own (`Dark mode`/`Light mode`, and the colorblind and
290
- * ANSI families likewise), so a blind choice of "colorblind-friendly" survives
291
- * a correction and only its brightness changes.
292
- */
293
- const SIBLING_THEME_INDEX = [0, 2, 1, 4, 3, 6, 5];
294
-
295
- /** True when a picker row's brightness is the opposite of the terminal's. */
296
- function themeContradicts(themeIndex, c = caps()) {
297
- const row = THEME_TABLE[themeIndex];
298
- if (!row || themeIndex === AUTO_THEME_INDEX) return false;
299
- // Without a report there is nothing to contradict. `background` is then the
300
- // dark default and the stored row stands: overriding a preference on the
301
- // strength of a *default* would be the same class of bug as reading a
302
- // guessed background as if it were evidence.
303
- if (!c || !c.backgroundKnown) return false;
304
- return !!row.light !== (c.background === 'light');
305
- }
306
-
307
- /**
308
- * A stored (or just-picked) theme row, corrected when the terminal it will be
309
- * drawn on cannot show it.
310
- *
311
- * This is the other half of `themeIsLight`. That function answers "is row 0
312
- * light?" — but rows 2, 4 and 6 are *explicitly* light, and an explicit row
313
- * whose text cannot be read is not a preference. The recorded bug: a terminal
314
- * background of `#1e1e2e` with `themeIndex: 2` in the config drew the light
315
- * palette's primary text `RGB(40,40,40)` over it — a 1.11:1 contrast ratio,
316
- * i.e. a body of text that is present and unreadable. The stored row had been
317
- * chosen on a light terminal and outlived it, and nothing ever checked it
318
- * against the terminal that was actually on screen.
319
- *
320
- * The correction keeps the user's family and flips only the brightness, so
321
- * "colorblind-friendly" or "ANSI colors only" survives: the answer is the same
322
- * palette at the brightness this terminal can display. `changed` is reported
323
- * rather than acted on silently — a preference that was overridden is something
324
- * the user is told about, and the stored value is left alone, so moving back to
325
- * a light terminal restores the original choice by itself.
326
- *
327
- * @param {number} themeIndex the stored/selected row
328
- * @param {object} [c] a caps object; defaults to the live process's
329
- * @returns {{index: number, changed: boolean, reason: string, from: object|null}}
330
- */
331
- function reconcileThemeIndex(themeIndex, c = caps()) {
332
- const row = THEME_TABLE[themeIndex];
333
- if (!themeContradicts(themeIndex, c)) return { index: themeIndex, changed: false, reason: '', from: row || null };
334
- const index = SIBLING_THEME_INDEX[themeIndex];
335
- const to = THEME_TABLE[index];
336
- const label = (r) => `${r.name}${r.note ? ' ' + r.note : ''}`;
337
- return {
338
- index,
339
- changed: true,
340
- from: row,
341
- reason:
342
- `saved theme "${label(row)}" is unreadable on this ${c.background} terminal ` +
343
- `(${c.reasons.background}) — using "${label(to)}" instead`,
344
- };
345
- }
346
-
347
- /** The palette object for a theme-picker row index (out-of-range → dark). */
348
- function themeForIndex(i) {
349
- const row = THEME_TABLE[i];
350
- return row ? row.palette : C;
351
- }
352
-
353
- /**
354
- * The palette object for a context. Colours are always derived from one of the
355
- * theme objects — never typed inline.
356
- *
357
- * The light flag alone decides for the three default-brightness rows (indices
358
- * 0–2), which keeps `themeOf({light:true}) === LIGHT` and `themeOf({}) === C`
359
- * exactly as before — except for row 0, which is "Auto (match terminal)" and so
360
- * asks the terminal instead of assuming dark. The colourblind and ANSI families
361
- * are only consulted when `themeIndex` actually names one of them (3–6), so an
362
- * app that seeds `themeIndex` to 0/1 for light/dark is unaffected (it is not
363
- * seeding 0 unless it means Auto).
364
- *
365
- * The *depth* is deliberately not consulted here: `C` is already built from
366
- * `RGB()`, which is depth-aware, so a 16-colour console gets a 16-colour dark
367
- * palette rather than being silently switched to the ANSI picker row — the
368
- * picker row must keep meaning "use the terminal's own table", not
369
- * "your terminal is too old".
370
- */
371
- function themeOf(ctx) {
372
- if (ctx && typeof ctx.themeIndex === 'number' && ctx.themeIndex >= 3 && ctx.themeIndex <= 6) {
373
- return themeForIndex(ctx.themeIndex);
374
- }
375
- // Row 0 is "Auto (match terminal)": the terminal's own background decides,
376
- // not a hardcoded dark. Without this branch the one row whose job is to match
377
- // the terminal was the one row that could not, and a light terminal drew the
378
- // dark palette's `RGB(255,255,255)` body text over its own white background.
379
- if (ctx && ctx.themeIndex === AUTO_THEME_INDEX) return terminalIsLight() ? LIGHT : C;
380
- return ctx && ctx.light ? LIGHT : C;
381
- }
382
-
383
- /**
384
- * The diff palette for a context — the exact companion of `themeOf`, so a
385
- * caller never has to ask "which palette did the rows use?" separately from
386
- * "which diff colors go with it?". `themeIndex` 3–6 are the four picker rows
387
- * whose brightness is named by their own `light` flag; anything else falls
388
- * back to the ctx's `light` flag, exactly as `themeOf` does.
389
- */
390
- function diffOf(ctx) {
391
- const light = ctx && typeof ctx.themeIndex === 'number' && ctx.themeIndex >= 3 && ctx.themeIndex <= 6
392
- ? !!THEME_TABLE[ctx.themeIndex].light
393
- : ctx && ctx.themeIndex === AUTO_THEME_INDEX
394
- ? terminalIsLight()
395
- : !!(ctx && ctx.light);
396
- return light ? DIFF_LIGHT : DIFF;
397
- }
398
-
399
- // ── glyphs ───────────────────────────────────────────────────────────────────
400
-
401
- /**
402
- * The glyph table for a terminal, resolved from its capabilities.
403
- *
404
- * A few of the reference's glyphs are missing from some terminal fonts
405
- * (⎿ U+23BF, ⏸ U+23F8, ✔ U+2714, ▸ U+25B8) or render as double-width emoji
406
- * (✦ U+2726, ✻/✢/✽/✶), which breaks row alignment exactly like the welcome art.
407
- * The capability classes in `caps.js` decide the set, and the host is not one of
408
- * them — see the policy at the top of that file:
409
- *
410
- * · `glyphs: 'ascii'` — no Unicode claim at all, requested with
411
- * `AEGIS_ART=ascii` / `--ascii`. Every mark becomes a single-column ASCII
412
- * stand-in, so the layout is identical but nothing is mis-rendered by a font
413
- * that lacks the glyph.
414
- * · `face: 'edges'` — the quartile edges and the typographic marks (⎿, ⏸,
415
- * ✔) are swapped; reachable today only through the ASCII pass, and kept
416
- * because `AEGIS_ART=unicode` on a font without the edges must be
417
- * expressible.
418
- * · native — the default everywhere: the reference's own set.
419
- *
420
- * `star` is NOT restated here: it is resolved through `art.js`'s stencil, the
421
- * single source of truth for the mark's runes, so the glyph table and the art
422
- * can never disagree about the same character.
423
- *
424
- * @param {string|object} [target] a `process.platform` name (accepted for
425
- * tests, ignored by the policy), or a caps object, or nothing at all for the
426
- * live process's resolved capabilities.
427
- */
428
- function glyphsFor(target = null) {
429
- const c = !target
430
- ? caps()
431
- : typeof target === 'string'
432
- ? detect(process.env, process.stdout, target)
433
- : target;
434
- const ascii = c.glyphs === 'ascii';
435
- const edges = ascii || c.face === 'edges';
436
-
437
- if (ascii) {
438
- return {
439
- cursor: '>', // menu selection marker, prompt prefix
440
- check: '+', // selected / completed
441
- divider: '-', // menu separators
442
- bullet: '.', // inline separators
443
- hint: '>', // "Try ..." suggestion marker
444
- pause: '||', // bottom status line (manual mode)
445
- star: stencilGlyph(STAR, c), // own-session marker, decorations
446
- rightarrow: '->', // the manual ⇄ auto mode switch
447
- pointer: '>', // tips list bullets
448
- hook: '_|', // inline command / tip rows
449
- block: '*', // streaming cursor / assistant answer marker
450
- bloom: '*', // "done" spinner glyph (✻ Brewed for 2s)
451
- spin: ['|', '/', '-', '\\', '*', '-'], // working spinner
452
- ellipse: '...',
453
- err: 'x', // failed check
454
- warn: '!', // warning mark
455
- rule: '-', // ruled section headers
456
- ruleHeavy: '=', // the welcome banner's frame rule
457
- };
458
- }
459
-
460
- const base = {
461
- cursor: '❯', // menu selection marker, prompt prefix
462
- check: '✔', // selected / completed
463
- divider: '╌', // menu separators
464
- bullet: '·', // inline separators
465
- hint: '❯', // "Try ..." suggestion marker
466
- pause: edges ? '❚❚' : '⏸', // bottom status line (manual mode)
467
- star: stencilGlyph(STAR, c), // own-session marker, decorations
468
- rightarrow: '→', // the manual ⇄ auto mode switch, advertised on the status line
469
- pointer: '▸', // tips list bullets
470
- hook: edges ? '_|' : '⎿', // inline command / tip rows (tool commands, usage hints)
471
- block: '●', // streaming cursor / assistant answer marker
472
- bloom: '✻', // "done" spinner glyph (✻ Brewed for 2s)
473
- spin: ['✢', '·', '✻', '*', '✽', '✶'], // working spinner
474
- ellipse: '…',
475
- err: '✗', // failed check (render.js's notice marks live here too)
476
- warn: '⚠', // warning mark
477
- rule: '─', // ruled section headers
478
- ruleHeavy: '━', // the welcome banner's frame rule
479
- };
480
-
481
- if (edges) {
482
- // ⏸ U+23F8 and ⎿ U+23BF are the two the font stacks in this class lack;
483
- // ✻ U+273B has an emoji presentation on them as well.
484
- return { ...base, bloom: '*', spin: ['|', '/', '-', '\\', '*', '-'] };
485
- }
486
- return base;
487
- }
488
-
489
- /** The live glyph table — re-materialised whenever the capabilities change. */
490
- const GLYPH = glyphsFor();
491
-
492
- /** Working-line verbs, verbatim from the capture-backed table. */
493
- const VERBS = [
494
- 'Incubating',
495
- 'Tempering',
496
- 'Determining',
497
- 'Beboppin\'',
498
- 'Julienning',
499
- 'Inferring',
500
- 'Simmering',
501
- 'Twisting',
502
- 'Fermenting',
503
- 'Fiddle-faddling',
504
- 'Orbiting',
505
- 'Prestidigitating',
506
- ];
507
-
508
- /** Completion verbs: "✻ Churned for 3s" after a chat turn, "✻ Worked for 3s"
509
- * after one that used tools. */
510
- const DONE_VERBS = ['Churned', 'Worked'];
511
-
512
- // ── materialisation ──────────────────────────────────────────────────────────
513
-
514
- /**
515
- * Rebuild every palette and the glyph table for the current capabilities.
516
- * Mutates in place: renderers, screens and panels capture these objects at
517
- * require time, and swapping the object would leave them drawing the previous
518
- * terminal's colours after `--ascii` or `/terminal`.
519
- */
520
- function rematerialize() {
521
- Object.assign(C, buildDark());
522
- Object.assign(LIGHT, buildLight());
523
- Object.assign(CB_DARK, buildCbDark());
524
- Object.assign(CB_LIGHT, buildCbLight());
525
- Object.assign(ANSI_DARK, buildAnsiDark());
526
- Object.assign(ANSI_LIGHT, buildAnsiLight());
527
- Object.assign(DIFF, buildDiff());
528
- Object.assign(DIFF_LIGHT, buildDiffLight());
529
- Object.assign(GLYPH, glyphsFor());
530
- }
531
-
532
- rematerialize();
533
- onCapsChange(rematerialize);
534
-
535
- module.exports = {
536
- RGB,
537
- BG,
538
- RESET,
539
- BOLD,
540
- DIM,
541
- ITALIC,
542
- UNDER,
543
- BOLD_OFF,
544
- ITALIC_OFF,
545
- UNDER_OFF,
546
- RESET_FG,
547
- RESET_BG,
548
- C,
549
- LIGHT,
550
- DIFF,
551
- DIFF_LIGHT,
552
- diffOf,
553
- CB_DARK,
554
- CB_LIGHT,
555
- ANSI_DARK,
556
- ANSI_LIGHT,
557
- THEMES,
558
- THEME_TABLE,
559
- AUTO_THEME_INDEX,
560
- themeIsLight,
561
- terminalIsLight,
562
- themeForIndex,
563
- themeContradicts,
564
- reconcileThemeIndex,
565
- SIBLING_THEME_INDEX,
566
- GLYPH,
567
- glyphsFor,
568
- VERBS,
569
- DONE_VERBS,
570
- themeOf,
571
- rematerialize,
572
- };
3
+ "use strict";const{caps:caps,detect:detect,onCapsChange:onCapsChange,rgb:rgb,bg:bg}=require("./caps.js"),{STAR:STAR,stencilGlyph:stencilGlyph}=require("./art.js"),RESET="",BOLD="",DIM="",ITALIC="",UNDER="",BOLD_OFF="",ITALIC_OFF="",UNDER_OFF="",RESET_FG="",RESET_BG="",RGB=(e,t,n)=>rgb(e,t,n),BG=(e,t,n)=>bg(e,t,n),C={},LIGHT={},CB_DARK={},CB_LIGHT={},ANSI_DARK={},ANSI_LIGHT={};function buildDark(){return{gold:RGB(255,193,7),coral:RGB(215,119,87),lavender:RGB(177,185,249),blue:RGB(120,160,250),green:RGB(78,186,101),red:RGB(220,90,90),gray:RGB(153,153,153),dim:RGB(80,80,80),white:RGB(255,255,255),black:RGB(30,30,30),darkBg:RGB(20,20,20)}}function buildLight(){return{gold:RGB(180,130,0),coral:RGB(190,100,70),lavender:RGB(120,130,220),blue:RGB(70,110,220),green:RGB(60,150,80),red:RGB(200,60,60),gray:RGB(110,110,110),dim:RGB(170,170,170),white:RGB(40,40,40),black:RGB(245,245,245),darkBg:RGB(255,255,255)}}function buildCbDark(){return{...buildDark(),green:RGB(86,182,194),red:RGB(255,146,43),gold:RGB(255,203,71)}}function buildCbLight(){return{...buildLight(),green:RGB(30,130,145),red:RGB(200,100,20),gold:RGB(150,110,0)}}const A=e=>caps().color?`[${e}m`:"";function buildAnsiDark(){return{gold:A(93),coral:A(91),lavender:A(94),blue:A(94),green:A(92),red:A(91),gray:A(90),dim:A(90),white:A(97),black:A(40),darkBg:caps().color?"":""}}function buildAnsiLight(){return{gold:A(33),coral:A(31),lavender:A(34),blue:A(34),green:A(32),red:A(31),gray:A(90),dim:A(37),white:A(30),black:A(47),darkBg:caps().color?"":""}}const DIFF={},DIFF_LIGHT={};function buildDiff(){return{delFg:RGB(220,90,90),delBg:BG(61,1,0),delHiFg:RGB(248,248,242),delHiBg:BG(92,2,0),addFg:RGB(80,200,80),addBg:BG(2,40,0),addHiFg:RGB(255,255,255),addHiBg:BG(4,71,0),codeFg:RGB(248,248,242),gutter:RGB(120,120,120),kw:RGB(102,217,239),fn:RGB(166,226,46),str:RGB(230,219,116),num:RGB(174,129,255),comment:RGB(117,113,94)}}function buildDiffLight(){return{delFg:RGB(160,40,40),delBg:BG(255,235,233),delHiFg:RGB(90,0,0),delHiBg:BG(255,205,200),addFg:RGB(30,130,40),addBg:BG(232,250,232),addHiFg:RGB(0,80,0),addHiBg:BG(195,240,195),codeFg:RGB(40,40,40),gutter:RGB(150,150,150),kw:RGB(0,120,160),fn:RGB(80,140,0),str:RGB(150,110,0),num:RGB(120,60,200),comment:RGB(140,140,130)}}const THEMES={dark:C,light:LIGHT},THEME_TABLE=[{name:"Auto",note:"(match terminal)",light:!1,palette:C},{name:"Dark mode",note:"",light:!1,palette:C},{name:"Light mode",note:"",light:!0,palette:LIGHT},{name:"Dark mode",note:"(colorblind-friendly)",light:!1,palette:CB_DARK},{name:"Light mode",note:"(colorblind-friendly)",light:!0,palette:CB_LIGHT},{name:"Dark mode",note:"(ANSI colors only)",light:!1,palette:ANSI_DARK},{name:"Light mode",note:"(ANSI colors only)",light:!0,palette:ANSI_LIGHT}],AUTO_THEME_INDEX=0;function terminalIsLight(e=caps()){return"light"===e.background}function themeIsLight(e,t=caps()){const n=THEME_TABLE[e];return!!n&&(e===AUTO_THEME_INDEX?terminalIsLight(t):!!n.light)}const SIBLING_THEME_INDEX=[0,2,1,4,3,6,5];function themeContradicts(e,t=caps()){const n=THEME_TABLE[e];return!(!n||e===AUTO_THEME_INDEX||!t||!t.backgroundKnown||!!n.light==("light"===t.background))}function reconcileThemeIndex(e,t=caps()){const n=THEME_TABLE[e];if(!themeContradicts(e,t))return{index:e,changed:!1,reason:"",from:n||null};const i=SIBLING_THEME_INDEX[e],r=THEME_TABLE[i],l=e=>`${e.name}${e.note?" "+e.note:""}`;return{index:i,changed:!0,from:n,reason:`saved theme "${l(n)}" is unreadable on this ${t.background} terminal (${t.reasons.background}) — using "${l(r)}" instead`}}function themeForIndex(e){const t=THEME_TABLE[e];return t?t.palette:C}function themeOf(e){return e&&"number"==typeof e.themeIndex&&e.themeIndex>=3&&e.themeIndex<=6?themeForIndex(e.themeIndex):e&&e.themeIndex===AUTO_THEME_INDEX?terminalIsLight()?LIGHT:C:e&&e.light?LIGHT:C}function diffOf(e){return(e&&"number"==typeof e.themeIndex&&e.themeIndex>=3&&e.themeIndex<=6?THEME_TABLE[e.themeIndex].light:e&&e.themeIndex===AUTO_THEME_INDEX?terminalIsLight():e&&e.light)?DIFF_LIGHT:DIFF}function glyphsFor(e=null){const t=e?"string"==typeof e?detect(process.env,process.stdout,e):e:caps(),n="ascii"===t.glyphs,i=n||"edges"===t.face;if(n)return{cursor:">",check:"+",divider:"-",bullet:".",hint:">",pause:"||",star:stencilGlyph(STAR,t),rightarrow:"->",pointer:">",hook:"_|",block:"*",bloom:"*",spin:["|","/","-","\\","*","-"],ellipse:"...",err:"x",warn:"!",rule:"-",ruleHeavy:"="};const r={cursor:"❯",check:"✔",divider:"╌",bullet:"·",hint:"❯",pause:i?"❚❚":"⏸",star:stencilGlyph(STAR,t),rightarrow:"→",pointer:"▸",hook:i?"_|":"⎿",block:"●",bloom:"✻",spin:["✢","·","✻","*","✽","✶"],ellipse:"…",err:"✗",warn:"⚠",rule:"─",ruleHeavy:"━"};return i?{...r,bloom:"*",spin:["|","/","-","\\","*","-"]}:r}const GLYPH=glyphsFor(),VERBS=["Incubating","Tempering","Determining","Beboppin'","Julienning","Inferring","Simmering","Twisting","Fermenting","Fiddle-faddling","Orbiting","Prestidigitating"],DONE_VERBS=["Churned","Worked"];function rematerialize(){Object.assign(C,buildDark()),Object.assign(LIGHT,buildLight()),Object.assign(CB_DARK,buildCbDark()),Object.assign(CB_LIGHT,buildCbLight()),Object.assign(ANSI_DARK,buildAnsiDark()),Object.assign(ANSI_LIGHT,buildAnsiLight()),Object.assign(DIFF,buildDiff()),Object.assign(DIFF_LIGHT,buildDiffLight()),Object.assign(GLYPH,glyphsFor())}rematerialize(),onCapsChange(rematerialize),module.exports={RGB:RGB,BG:BG,RESET:RESET,BOLD:BOLD,DIM:DIM,ITALIC:"",UNDER:UNDER,BOLD_OFF:"",ITALIC_OFF:"",UNDER_OFF:"",RESET_FG:"",RESET_BG:"",C:C,LIGHT:LIGHT,DIFF:DIFF,DIFF_LIGHT:DIFF_LIGHT,diffOf:diffOf,CB_DARK:CB_DARK,CB_LIGHT:CB_LIGHT,ANSI_DARK:ANSI_DARK,ANSI_LIGHT:ANSI_LIGHT,THEMES:THEMES,THEME_TABLE:THEME_TABLE,AUTO_THEME_INDEX:AUTO_THEME_INDEX,themeIsLight:themeIsLight,terminalIsLight:terminalIsLight,themeForIndex:themeForIndex,themeContradicts:themeContradicts,reconcileThemeIndex:reconcileThemeIndex,SIBLING_THEME_INDEX:SIBLING_THEME_INDEX,GLYPH:GLYPH,glyphsFor:glyphsFor,VERBS:VERBS,DONE_VERBS:DONE_VERBS,themeOf:themeOf,rematerialize:rematerialize};