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
@@ -0,0 +1,784 @@
1
+ # aegiscode — the terminal host
2
+
3
+ `aegiscode` in your shell — the command-line version of AEGIS Desktop. The same
4
+ tool surface the Claude Code plugin exposes over MCP, plus a terminal instead of
5
+ an editor — built on the same two shared pieces and no others:
6
+
7
+ | Shared piece | What it is |
8
+ |---|---|
9
+ | `client/aegis.js` | The thin transport. Holds the API key, speaks HTTP/SSE. No brain logic. |
10
+ | `mcp/tools.js` | The tool registry — names, JSON schemas, result formatting. |
11
+ | `desktop/renderer/usage.js` | The token-usage → number mapping, shared with the GUI so the two can never disagree. |
12
+ | `desktop/lib/local/` | The agent-loop engine — persistent-shell exec, read/write/edit/glob/grep, Task subagents. The CLI runs the same loop the GUI does, scoped to the AEGIS class. |
13
+
14
+ Routing, model tiers, memory and billing all stay behind aegiscloud.org.
15
+
16
+ ## Quick start
17
+
18
+ Four steps, in order. Everything past this section is the fuller reference for
19
+ each one.
20
+
21
+ **1. Install** — requires Node 22+.
22
+
23
+ ```bash
24
+ npm install -g aegiscode
25
+ ```
26
+
27
+ **2. Log in** — get a key at <https://aegiscloud.org> if you don't have one.
28
+
29
+ ```bash
30
+ aegiscode login # prompts, no echo
31
+ aegiscode key status # verify: masked key + which source is in use
32
+ ```
33
+
34
+ **3. (Optional) Bring your own key** — skip this if you're happy on the
35
+ pooled AEGIS Cloud route (the default). Use your own OpenAI/Anthropic/etc. key
36
+ instead, at a flat handling fee instead of the pooled margin — see [Bring your
37
+ own key](#bring-your-own-key).
38
+
39
+ ```bash
40
+ /byok # list providers and which are already set
41
+ /byok-key openai # save a key on this machine, prompts, no echo
42
+ /class byok # switch the session to run on it
43
+ ```
44
+
45
+ **4. Use it.**
46
+
47
+ ```bash
48
+ aegiscode # interactive session
49
+ aegiscode "why is the sky blue" # one-shot, prints the answer and the tokens
50
+ ```
51
+
52
+ ## Names: one name, `aegiscode`
53
+
54
+ This host and the CLI used to be two names for two packages. They are one
55
+ product, so they are one name now:
56
+
57
+ | Name | Status |
58
+ |---|---|
59
+ | `aegiscode` | **this host**, v6.0.0. Installs a single binary, `aegiscode`. |
60
+ | `aegis-terminal` | deprecated — the 0.1.x spelling of this package, folded into `aegiscode`. |
61
+ | `aegiscode-cli` | 4.0.3, an earlier name of this CLI's predecessor line. Untouched. |
62
+ | `aegis-cli` | 0.4.8 (unrelated). |
63
+ | `aegis` (bin) | claimed **twice already** — by `aegiscode-cli` (→ `bin/cli.js`) and by `aegis-desktop` (→ `bin/aegis.js`). Pre-existing; whichever installs last wins. |
64
+
65
+ Publishing this host as `aegiscode` moves the `latest` dist-tag for that name
66
+ onto it. The previous line (`aegiscode@5.x`, the earlier agent build) is
67
+ still installable and immutable on the registry — pin `aegiscode@5` for it.
68
+
69
+ ## Installation
70
+
71
+ ```bash
72
+ npm install -g aegiscode
73
+ # or, from a source checkout — no install needed:
74
+ node cli/bin/aegiscode.js
75
+ ```
76
+
77
+ Requires Node 22+. Save your key once — it goes to `~/.aegiscode/credentials.json`
78
+ (mode `0600`) and is then picked up by every later launch, script and shell:
79
+
80
+ ```bash
81
+ aegiscode login # prompts, no echo
82
+ aegiscode login "aegis_..." # or inline
83
+ aegiscode key status # masked key + which source is in use
84
+ aegiscode logout # remove it
85
+ ```
86
+
87
+ `AEGIS_API_KEY` still works and still wins (useful in CI, or for a one-off);
88
+ `aegiscode --key <key>` applies to a single run and is never saved. A key an
89
+ older AEGIS CLI left in `~/.aegiscode/config.json` is picked up and copied into
90
+ the 0600 store automatically — `/cloud status` says so if the plaintext copy is
91
+ still there.
92
+
93
+ ## One file for every key
94
+
95
+ `~/.aegiscode/.env` is read into the environment once at startup by the CLI, the
96
+ desktop app and the MCP server. It is the shortest way to configure the account
97
+ key *and* every BYOK provider at the same time:
98
+
99
+ ```bash
100
+ # ~/.aegiscode/.env
101
+ AEGIS_API_KEY=aegis_...
102
+ ANTHROPIC_API_KEY=sk-ant-...
103
+ OPENAI_API_KEY=sk-...
104
+ DEEPSEEK_API_KEY=sk-...
105
+ ```
106
+
107
+ That file alone is enough — no `login`, no `/byok-key <provider>` prompt per
108
+ provider. Both resolution paths already read these names out of the environment;
109
+ the file is just what fills it. `AEGIS_API_KEY` is entry one in the credential
110
+ order below, and a BYOK provider resolves `<PROVIDER>_API_KEY` (upper snake case,
111
+ with a short alias table for the ids that would spell it differently — `google`
112
+ and `gemini` → `GEMINI_API_KEY`, `xai` → `XAI_API_KEY`, `huggingface` →
113
+ `HF_TOKEN`).
114
+
115
+ Two rules it obeys: a variable **already exported in the launching shell always
116
+ wins**, so a stale file can never shadow `AEGIS_API_KEY=… aegiscode` in CI; and
117
+ the loader only ever reads. If the file is group- or world-readable you are told,
118
+ not silently fixed — the 0600 store stays the only secret this repo writes.
119
+
120
+ That one file is shared: the MCP plugin and AEGIS Desktop read the same store and
121
+ the same `.env`, so signing in here signs you in everywhere (see [One memory,
122
+ shared with AEGIS Desktop](#one-memory-shared-with-aegis-desktop)).
123
+
124
+ ## Launch options
125
+
126
+ ```bash
127
+ aegiscode # interactive session
128
+ aegiscode --continue # skip onboarding, resume the last session
129
+ aegiscode "why is the sky blue" # one-shot, prints the answer and the tokens
130
+ aegiscode -p "..." --json # machine-readable
131
+ echo "q" | aegiscode -p - # prompt on stdin
132
+ aegiscode -m deepseek/deepseek-v4-flash -p "..." # pin a model
133
+ aegiscode --terminal # print the resolved terminal capabilities
134
+ aegiscode --ascii # force the ASCII mark (legacy consoles)
135
+ aegiscode --width 100 # pin the frame width
136
+ ```
137
+
138
+ ## One look on every terminal
139
+
140
+ The welcome screen, the palette and the glyph set are resolved from what the
141
+ terminal *can actually draw*, not from `process.platform`. PowerShell inside
142
+ Windows Terminal sets `WT_SESSION`/`TERM_PROGRAM`, so it renders the **same
143
+ byte-identical frame** as zsh: `unicode` mark, `native` star, 24-bit colour. The
144
+ host OS is only a fallback hint; the environment wins.
145
+
146
+ `cli/src/caps.js` resolves one capability object — mark (`unicode`/`ascii`), face
147
+ (`native`/`edges`), star (`native`/`narrow`), colour depth (24/8/4/0), control
148
+ (`ansi`/`plain`), size and EOL — and everything that draws goes through it.
149
+ `theme.js` builds its palettes and glyph table via `caps.rgb()`/`caps.bg()`, so a
150
+ 16-colour console is painted in colours it has instead of literal escape text,
151
+ and `art.js` applies composable stencils (`ascii`, `edges`, `star`) rather than a
152
+ per-platform art table.
153
+
154
+ Only a **legacy** Windows console degrades — and it says why:
155
+
156
+ | host | mark | star | colour | reason |
157
+ | --- | --- | --- | --- | --- |
158
+ | any host, no override | `unicode` | `native` | truecolor | uniform default: nothing about the host is inferred |
159
+ | win32 legacy conhost | `ascii` | `narrow` | 16 | reported by `--terminal`; set `AEGIS_ART=ascii` to act on it |
160
+ | …requested | `ascii` | `narrow` | 16 | `AEGIS_ART=ascii` / `--ascii` |
161
+
162
+ The rendering is **uniform**: `process.platform`, `TERM`, `TERM_PROGRAM`,
163
+ `WT_SESSION` and the locale's character set are probed and reported
164
+ (`aegiscode --terminal`) but never change a byte that is drawn, because a font
165
+ that lacks a glyph is something only the person looking at the screen can
166
+ settle. Only an explicit switch changes the output, and every switch is spelled
167
+ the same way on every platform.
168
+
169
+ The one thing read from the terminal about *itself* is its background
170
+ brightness, and it is used for one decision only: which of the two legible
171
+ palettes `/theme`'s **Auto (match terminal)** row resolves to. The dark
172
+ palette's body text is white, so on a light terminal the wrong answer is an
173
+ invisible one — and the failure is symmetric: the *light* palette's body text is
174
+ near-black, so restoring it on a dark terminal is invisible too.
175
+
176
+ At startup, on a real terminal, `aegiscode` **asks** — an OSC 11 query
177
+ (`ESC ] 11 ; ? BEL`) that the terminal answers with its own background, e.g.
178
+ `rgb:1e1e/1e1e/2e2e`. That is the only signal that is neither an environment
179
+ variable nor a guess, and it is the one that matters: Alacritty, for instance,
180
+ sets no `COLORFGBG` and no `TERM_BACKGROUND`, so the palette used to be chosen
181
+ from silence. The environment is still read first and wins when set —
182
+ `COLORFGBG` (the background's ANSI index, as xterm, rxvt, Konsole and VTE
183
+ report it), `TERM_BACKGROUND=dark|light` (kitty, WezTerm), or
184
+ `AEGIS_BACKGROUND=dark|light` — and in that case nothing is asked at all. A
185
+ pipe, a CI run and `--print` never probe.
186
+
187
+ What the answer is *for*: a stored `/theme` row that cannot be read on the
188
+ terminal it is being restored on is corrected to the same palette family at the
189
+ other brightness (so "colorblind-friendly" survives, and the light/dark choice
190
+ inside it changes), saved, and announced once. A terminal that reports nothing
191
+ changes nothing — the dark default is not evidence, so a preference is never
192
+ overridden on the strength of it. `/terminal probe` asks again mid-session (for
193
+ a terminal whose theme changed after launch), and `/terminal background
194
+ dark|light` pins it outright without asking. None of this ever moves the mark,
195
+ the colour depth, the control sequences or the line ending.
196
+
197
+ Overrides, at launch — `--ascii`, `--unicode`, `--no-color`, `--color`,
198
+ `--width <cols>`, `--terminal` (print the report) — and in-session via
199
+ `/terminal ascii|unicode|color|no-color|background <dark|light>|probe|star <native|narrow>|width <cols>|auto|status`.
200
+ `/terminal auto` re-probes rather than restoring launch flags. `/terminal width`
201
+ pins the frame, so resizes are ignored until `/terminal auto`; every other
202
+ `/terminal` switch leaves resize handling intact — the background probe is
203
+ deliberately not routed through the code path that pins a frame, so asking about
204
+ the background can never freeze the width.
205
+
206
+ The same axes are settable by environment for scripts and CI: `AEGIS_ART`,
207
+ `AEGIS_ASCII`, `AEGIS_UNICODE`, `AEGIS_STAR`, `AEGIS_COLOR`, `AEGIS_VT`,
208
+ `AEGIS_WIDTH`, `AEGIS_WIDE_RUNES`, `AEGIS_BACKGROUND` (and `TERM_BACKGROUND`,
209
+ which the terminals that set it write themselves), plus `AEGIS_BACKGROUND_PROBE=0`
210
+ to skip the query while still honouring those variables. `NO_COLOR` is honoured
211
+ to the letter — "present and not an empty string, regardless of its value".
212
+
213
+ ## First run
214
+
215
+ A genuine first run walks the reference's onboarding before the session starts —
216
+ the order is the reference's:
217
+
218
+ ```
219
+ ────────────────────────────────────────────────────────────────────────────────
220
+ Accessing workspace:
221
+ /home/you/project
222
+
223
+ Quick safety check: Is this a project you created or one you trust? …
224
+ AEGIS Code will be able to read, edit, and execute files here.
225
+
226
+ Security guide
227
+
228
+ ❯ 1.Yes, I trust this folder
229
+ 2.No, exit
230
+
231
+ Enter to confirm · Esc to cancel
232
+ ```
233
+
234
+ then the theme picker (the reference's 7 rows — Auto, Dark/Light, plus
235
+ colourblind-friendly and ANSI-only variants, each previewed as a real diff in
236
+ that palette), then the welcome screen with the mark, a **Tips for getting
237
+ started** box and a **What's new** box. The chosen row is written to
238
+ `~/.aegiscode/config.json`, so `Welcome back!` is what you get next time and the
239
+ picker never reappears.
240
+
241
+ Declining the trust check **ends the process** rather than continuing — the
242
+ folder you just refused to vouch for is not read, edited or executed in.
243
+ `--continue` skips onboarding entirely.
244
+
245
+ Preferences survive a restart: model, effort, theme and vim mode are restored on
246
+ launch, and an explicit flag (`-m`, `--light`) always outranks the stored value.
247
+
248
+ ## Commands
249
+
250
+ In a session, plain text is a prompt. `/help` lists commands, grouped by
251
+ category, the way the reference does. The registry is that client's, ported
252
+ command for command — 87 entries across nine categories:
253
+
254
+ | Category | Commands |
255
+ |---|---|
256
+ | Session & context | `/schedule` `/clear` `/compact` `/context` `/todos` `/config` `/exit` `/recap` `/resume` `/rewind` `/agents` `/status` `/teleport` `/version` `/new` `/skills` `/multiyolo` `/multi` `/research` `/debate` |
257
+ | Workspace | `/run` `/build` `/cd` `/init` `/clone` |
258
+ | Model & behavior | `/ping` `/effort` `/model` `/models` `/model-add` `/model-rm` `/theme` `/terminal` `/vim` `/permissions` `/hooks` `/credentials` `/install-github-app` `/thinking` `/mcp` `/memory` `/memory-deep` `/confirm` `/automode` *(alias `/yolo`)* `/router` `/class` |
259
+ | Data | `/copy` `/cost` `/export` `/tokens` `/sync` |
260
+ | Auth | `/login` `/logout` `/key` `/byok` `/byok-set` `/byok-rm` `/byok-key` `/byok-rm-key` |
261
+ | Support | `/help` `/doctor` `/upgrade` `/troubleshooting` `/feedback` `/bug` `/issue` `/onboarding` `/shell-completion` `/terminal-setup` `/pr-comments` `/prs` `/review` `/benchmark` `/billing` `/topup` `/cloud` `/gmail` `/release-notes` |
262
+ | Fun | `/radio` `/waifu` |
263
+ | Aegis plugin | `/aegis-status` `/aegis-ask` `/aegis-recall` `/aegis-remember` `/aegis-council` `/aegis-print` `/aegis-multi` `/tool` `/aegis-import` |
264
+
265
+ The table above is generated from `cli/src/commands.js` (`COMMANDS` +
266
+ `CATEGORIES`), which is the only authority on what exists — a hand-kept copy is
267
+ how it came to claim 75 entries while the code held 84 before this port.
268
+
269
+ `/help` shows the live list with hints; aliases are searchable in the `/`
270
+ palette exactly as they are there (`/ask` → `/aegis-ask`, `?` → `/help`,
271
+ `quit` → `/exit`, `tok` → `/tokens`, …).
272
+
273
+ Every command that talks to AEGIS names a tool from `mcp/tools.js`, and the test
274
+ suite asserts both directions: no command points at a tool that does not exist,
275
+ and no tool is unreachable from the prompt. Everything else is a real local
276
+ handler — `/run` detects and drives this project's dev command, `/init` sniffs
277
+ the project and writes `AEGIS.md`, `/export` writes the transcript out,
278
+ `/resume` and `/rewind` read the session store, `/cd` moves the working
279
+ directory, `/doctor` runs diagnostics.
280
+
281
+ ## Model selection
282
+
283
+ Three layers, from broadest to narrowest. You only need the first one.
284
+
285
+ **1. The class — which route the turn takes.**
286
+
287
+ ```bash
288
+ /class # show the picker
289
+ /class aegis # pooled AEGIS Cloud (the default)
290
+ /class byok # your own provider key, relayed by AEGIS
291
+ /class local # a model on your own machine or network (free)
292
+ ```
293
+
294
+ A class is *whose credential pays and who talks to the vendor*, not a model.
295
+ Switching applies to your **next** turn and leaves the conversation intact. The
296
+ choice is written to `~/.aegiscode/config.json` (`modelClass`), so it survives a
297
+ restart.
298
+
299
+ | Class | Route | Who pays |
300
+ |---|---|---|
301
+ | `aegis` *(default)* | the AEGIS pool — one id, `nexus-brain` (alias `aegis-brain`), auto-routed server-side across whichever providers are live | your AEGIS account balance |
302
+ | `byok` | your provider key, relayed via `POST /api/v1/byok/chat/completions` | your provider direct, **plus** a small AEGIS handling fee on your account |
303
+ | `local` | a model on your own machine or network — your Ollama daemon at `http://localhost:11434` by default, keyless; any OpenAI-compatible server on that box works | nobody — free; there is no vendor to bill |
304
+
305
+ `local` never leaves your own network: it dials a model on your machine or your
306
+ LAN, and is refused fail-closed if the endpoint is not local — the check runs
307
+ when the base URL is saved and again before a request is dialled
308
+ (`desktop/lib/local/local.js` → `remoteRefusal`). The generic *remote*
309
+ custom-endpoint lanes (an arbitrary remote OpenAI- or Anthropic-compatible URL)
310
+ do not exist here; any OpenAI-compatible server on that box — llama.cpp, LM
311
+ Studio, vLLM — works by pointing the base URL at it.
312
+
313
+ **2. The model id — what to pin.**
314
+
315
+ ```bash
316
+ /models # what you can pin, for the class you are on
317
+ /model # open the picker
318
+ /model nexus-brain # pin it
319
+ /model - # clear the pin, back to the class default
320
+ ```
321
+
322
+ `/models` is class-aware: it answers from the pool catalogue under `aegis`, and
323
+ from the models your saved keys actually unlock under `byok`. A pin is
324
+ **cleared with a reason** if you switch to a class it does not belong to,
325
+ instead of failing later at the route.
326
+
327
+ Under `byok` every id is compound — `provider:model`:
328
+
329
+ ```bash
330
+ /models # e.g. anthropic:claude-sonnet-4-5
331
+ /model anthropic:claude-sonnet-4-5
332
+ ```
333
+
334
+ The `byok` list also carries the pooled **Nexus** row, marked *pooled lane —
335
+ /class aegis*. The two id spaces are disjoint, so without it a session sitting
336
+ on `byok` had a correct list with no way back to the pooled route in it.
337
+ Selecting it switches the class to `aegis` first (this is the one row that is
338
+ not a `provider:model` id); pinning it *without* switching is not offered,
339
+ because the relay would read `nexus-brain` as a provider name.
340
+
341
+ **3. Adding a model nobody has released yet.**
342
+
343
+ Vendors ship models faster than any client can be updated, and the BYOK relay is
344
+ a pass-through: your own vendor key authenticates upstream and AEGIS forwards the
345
+ model string it is handed. So an id your provider serves is callable the moment
346
+ your machine offers it as a row — which is what these do:
347
+
348
+ ```bash
349
+ /model-add deepseek deepseek-v4.2-preview # offer it on this machine
350
+ /model-rm deepseek deepseek-v4.2-preview # forget it
351
+ /model-add deepseek # prompt for the id instead
352
+ ```
353
+
354
+ `/model-add` resolves the provider against the relay's catalogue first, so a
355
+ provider the relay takes no key for is **refused** rather than stored — a
356
+ declaration for a slug the relay does not accept would appear in no picker at
357
+ all, and the failure would land on your first turn. The id itself is shape
358
+ checked (no spaces, no colon — `provider:model` is the id a pin uses) but never
359
+ checked against a vendor list: reaching a model the catalogue has not caught up
360
+ with is the entire point.
361
+
362
+ The declaration lives in **`~/.aegiscode/models.json`** (`$AEGISCODE_HOME` if you
363
+ set it), which is also the file the desktop's Settings pane writes and reads. Add
364
+ a model in the terminal and it is in the window's picker on its next refresh,
365
+ with no restart; add one in the window and `/models` shows it immediately. The
366
+ file is plain JSON and 0600, so a bulk edit is an editor away:
367
+
368
+ ```json
369
+ {
370
+ "deepseek": ["deepseek-v4.2-preview"],
371
+ "anthropic": ["claude-opus-9-1"]
372
+ }
373
+ ```
374
+
375
+ Nothing here is validated against a vendor on read, so a hand-typed row that the
376
+ vendor does not serve will 404 on your first turn — that is the one cost of the
377
+ escape hatch, and it is why the commands validate what they store.
378
+
379
+ ```bash
380
+ aegiscode -m nexus-brain -p "…" # pin at launch
381
+ aegiscode -m anthropic:claude-sonnet-4-5 -p "…" # a BYOK id at launch
382
+ ```
383
+
384
+ **3. Effort — how hard it reasons.**
385
+
386
+ ```bash
387
+ /effort # show
388
+ /effort low|medium|high
389
+ ```
390
+
391
+ Effort scales the token budget the provider is given, so it is the dial that
392
+ actually changes reasoning depth on a reasoning model (see the root README for
393
+ the per-provider mechanics).
394
+
395
+ > **A `byok` turn is single-shot.** The relay takes no `tools` parameter, so the
396
+ > agentic tool loop is off by construction — no file edits, no shell, no
397
+ > subagents, no approval cards. `/class` says so rather than letting you discover
398
+ > it mid-task.
399
+
400
+ ## Bring your own key
401
+
402
+ Two lanes. The one people mix up is which key goes where, so state it plainly:
403
+ **`/byok-set` stores on your AEGIS account; `/byok-key` stores on this machine.**
404
+
405
+ | | `/byok-set <provider>` | `/byok-key <provider>` |
406
+ |---|---|---|
407
+ | Key lives | on your AEGIS account, encrypted server-side | in `~/.aegiscode/settings.json` (mode `0600`) |
408
+ | Follows you to other machines | yes | no |
409
+ | Reaches the vendor via | AEGIS, server-side | AEGIS's BYOK relay |
410
+ | Needed for `/class byok`? | no | **yes** — this is the one the relay reads |
411
+
412
+ ### Save a key on this machine
413
+
414
+ ```bash
415
+ /byok # list every provider, and which are already set
416
+ /byok-key openai # prompts, no echo, never enters history
417
+ /byok-key openai sk-… # scriptable form
418
+ /byok-rm-key openai # forget it
419
+ ```
420
+
421
+ The first command is the one to run when you don't know a provider id. The
422
+ catalogue is server-side and grows, so `/byok` is the authority — each row names
423
+ the provider, the models its key unlocks, where the vendor issues it, and the
424
+ prefix a valid key starts with. A typo'd or wrong-vendor key is caught before it
425
+ is stored.
426
+
427
+ ### Save a key on your account
428
+
429
+ ```bash
430
+ /byok-set anthropic # prompts, no echo
431
+ /byok-rm anthropic # remove it
432
+ ```
433
+
434
+ ### What a BYOK turn costs
435
+
436
+ Bringing your own key does not make the turn free, and it is not meant to. AEGIS
437
+ pays the vendor nothing on this lane, so there is no provider cost to take a
438
+ margin on — the account is charged a flat **handling fee** per 1k tokens
439
+ instead, for the routing, prompt assembly, caching, tool bridging and uptime
440
+ that still happen server-side. It is deliberately well under the pooled price
441
+ for the same traffic, so BYOK stays the cheaper lane; it just is not the free
442
+ one.
443
+
444
+ The figure is published by the server (`GET /api/v1/byok/providers` returns
445
+ `fee`) and never hardcoded in this client, so what you see is what is charged.
446
+ Two consequences worth knowing:
447
+
448
+ - A BYOK turn needs an **AEGIS account key** as well as your provider key — that
449
+ is where the fee is billed. Without one the relay refuses up front and says so,
450
+ rather than running the turn and dropping the charge.
451
+ - If a fee is ever configured to zero the lane is genuinely free, and nothing in
452
+ this client needs to change to reflect that.
453
+
454
+ Removing a key is the only thing that stops the key being sent; unsetting
455
+ `/class byok` switches the route but leaves the key on disk.
456
+
457
+ ## Command manual
458
+
459
+ Copy-paste, in the order you actually need them.
460
+
461
+ ### Install and sign in
462
+
463
+ ```bash
464
+ npm install -g aegiscode # requires Node 22+
465
+ aegiscode login # prompts for your AEGIS key, no echo
466
+ aegiscode key status # verify: masked key + which source is in use
467
+ aegiscode # start a session
468
+ ```
469
+
470
+ No AEGIS key yet? Get one at <https://aegiscloud.org>. To run entirely on your
471
+ own provider key instead, skip `login` and see
472
+ [Bring your own key](#bring-your-own-key) — note that lane still bills its fee to
473
+ an AEGIS account.
474
+
475
+ ### Day one in a repo
476
+
477
+ ```bash
478
+ cd ~/my-project
479
+ aegiscode # first run asks you to trust the folder
480
+ /init # sniff the project, write AEGIS.md
481
+ /status # key, class, model, effort, cwd — one panel
482
+ ```
483
+
484
+ Then just type. Plain text is a prompt.
485
+
486
+ ### Ask one question and leave
487
+
488
+ ```bash
489
+ aegiscode "explain this stack trace"
490
+ aegiscode -p "summarise docs/design.md" --json
491
+ echo "why is the sky blue" | aegiscode -p -
492
+ ```
493
+
494
+ `--json` emits the answer plus the usage object, token total and balance.
495
+
496
+ ### Switch how you're paying
497
+
498
+ ```bash
499
+ /class # see every route and who pays
500
+ /class byok # use your own key
501
+ /byok-key openai # …save one first if it says you have none
502
+ /models # what that key unlocks
503
+ /model openai:gpt-4o # pin one
504
+ /class aegis # back to the pool
505
+ ```
506
+
507
+ ### Control the budget
508
+
509
+ ```bash
510
+ /effort low # cheaper, shallower
511
+ /effort high # deeper reasoning
512
+ /cost # this session
513
+ /balance # tokens beside € on every ledger row
514
+ /billing # spend and plan
515
+ ```
516
+
517
+ ### Keep the work
518
+
519
+ ```bash
520
+ /compact # shrink the context, keep the thread
521
+ /export markdown ~/notes/session.md
522
+ /resume # pick up a saved session
523
+ /rewind 3 # back up three turns
524
+ /sync # push pending, then pull
525
+ ```
526
+
527
+ ### When something is wrong
528
+
529
+ ```bash
530
+ /doctor # diagnostics, in one panel
531
+ /status # key + class + model actually in effect
532
+ /byok # which provider keys are set
533
+ /troubleshooting
534
+ ```
535
+
536
+ ### Settings and the reply-ready alert
537
+
538
+ ```bash
539
+ /config # every setting, and which store holds it
540
+ /config effort high # set one, typed (true/false/null, numbers, JSON, text)
541
+ /config reset themeIndex # back to the shipped value
542
+ ```
543
+
544
+ `/config` writes through the same split every other surface uses: the keys in
545
+ `SHARED_PREF_KEYS` go to `preferences.json`, the file AEGIS Desktop's settings
546
+ window reads and writes too, and this shell's own keys (`lastCwd`,
547
+ `updateCheck`) stay in `config.json`. It never writes a file directly, so it
548
+ cannot leave the window and the shell holding two answers to one question.
549
+
550
+ ```bash
551
+ /ping # show the state and the vocabulary
552
+ /ping bell # channel: off | bell | notify | both
553
+ /ping notify 120 # only turns longer than two minutes
554
+ /ping test # fire one now, to check this terminal
555
+ ```
556
+
557
+ `/ping` is the terminal's half of the desktop's "reply ready" notification: a
558
+ turn that outlasted `pingMinSeconds` raises an OSC 9 / OSC 777 notification and
559
+ rings the bell, so you can stop watching a long turn. A turn you pressed Escape
560
+ on never pings — you were demonstrably looking at the screen — and neither does
561
+ a piped or headless run, which has no one to notify. `notify` needs a terminal
562
+ that implements those sequences (iTerm2, WezTerm, kitty, GNOME Terminal, Windows
563
+ Terminal); `/ping test` tells you whether yours does, and `/ping bell` is the
564
+ fallback every terminal has.
565
+
566
+ ```bash
567
+ /todos # list
568
+ /todos add ship the retry fix # add one
569
+ /todos done 1 # by number, or by a unique text prefix
570
+ /todos clear
571
+ ```
572
+
573
+ The list lives in `$AEGISCODE_HOME/todos.json` and survives compaction, so a
574
+ plan you wrote out mid-session is still there after the context is shrunk.
575
+
576
+ ### Unattended work
577
+
578
+ ```bash
579
+ aegiscode autonomous add "fix the flaky retry test" --cwd ~/repo
580
+ aegiscode autonomous list
581
+ aegiscode autonomous proceed --commit
582
+ ```
583
+
584
+ Queued tasks always run on the pooled brain (`nexus-brain`); a task naming
585
+ another model is refused where you can still see it. `--commit` commits only the
586
+ paths that task's own tool layer wrote.
587
+
588
+ ## Account key and cloud sync
589
+
590
+ Three ways in, one store: `aegiscode login <key>`, `/key <api_key>` (or a bare
591
+ `/key` to paste it echo-off), and `$AEGIS_API_KEY`. The first two persist;
592
+ the env var outranks the store and needs no persistence. `/login` used to be an
593
+ unavailable Claude Code auth-loop command pointing at `/byok-set` — which stores
594
+ a *provider* key, so that advice sent the AEGIS key into the wrong slot. It is
595
+ now the in-band way to set the account key, and `/logout` removes it.
596
+
597
+ Conversation sync is the same `conversationSyncPush/Pull` surface the desktop
598
+ uses, over the sessions this host keeps in `~/.aegiscode/history.jsonl`:
599
+
600
+ ```bash
601
+ /sync # push what is pending, then pull — the one you want
602
+ /sync status # local / pending / in-sync counts, last push and pull
603
+ /sync on | off # auto-push after each turn (off by default)
604
+ /cloud # key + sync state in one panel
605
+ /cloud activate # turn on cloud memory for the account
606
+ ```
607
+
608
+ Sync is **off by default** on purpose: the server charges a push for the growth
609
+ of a session against the plan's synced-token ceiling, so nothing is uploaded
610
+ until you ask. A refusal (HTTP 402) is reported as a quota refusal with the way
611
+ out, not as "sync failed". Imported remote sessions land in the same store
612
+ `/resume` reads, and are marked `imported` with estimated token counts — never
613
+ passed off as measured here.
614
+
615
+ ## One memory, shared with AEGIS Desktop
616
+
617
+ `~/.aegiscode/` is the data dir for **every** AEGIS host — this CLI, AEGIS
618
+ Desktop and the MCP plugin built on the same account:
619
+
620
+ | File | What it holds | Written by |
621
+ |---|---|---|
622
+ | `credentials.json` | the account key, mode 0600 | `aegiscode login`, `/key`, the desktop's Settings pane |
623
+ | `sessions.json` | every conversation, one record per session | both hosts, live |
624
+ | `history.jsonl` | this host's per-exchange ledger (feeds `/cost`) | the CLI |
625
+ | `config.json` | preferences, permissions | the CLI |
626
+
627
+ Sign in once and every face is signed in: they resolve the key with the
628
+ same precedence (`$AEGIS_API_KEY` → `credentials.json` → an older `config.json`),
629
+ and when two faces hold a key the **most recently saved one wins** — so rotating
630
+ it from the terminal does not leave the app 401-ing on a stale string.
631
+
632
+ Sessions are shared too, and not only through the cloud. `/resume` lists a
633
+ thread typed in the desktop, and the desktop's session list shows a thread typed
634
+ here — same file, no sync and no network. An upgrade adopts a desktop install's
635
+ private `sessions.json` into the shared store once, so no existing conversation
636
+ is lost. Records carry `origin`, and terminal sessions are **not** enrolled in
637
+ the desktop's push queue (that would spend the account's synced-token quota as a
638
+ side effect of typing in a shell); this host's own `/sync` covers them.
639
+
640
+ There are currently **no** `unavailable` commands: every entry in the registry
641
+ either runs or is a real handler that says honestly what it cannot do.
642
+
643
+ ## The chatflow
644
+
645
+ The session is the reference's loop, ported rather than approximated: an
646
+ alternate-screen frame of header rule, transcript viewport, spinner/effort line,
647
+ input line and status line, driven by a raw key stream.
648
+
649
+ ```
650
+ ╭───────────────────────────── AEGIS Code v6.3.0 ─────────────────────────────╮
651
+ ❯ summarise what changed in the token accounting
652
+ ● Three things changed, and one of them was costing you money:
653
+
654
+ - the pool merges worker usage instead of overwriting it
655
+ - cache reads and writes are billed, not ignored
656
+ - a zero-token call no longer refunds its reservation
657
+
658
+ ● Running 1 shell command…
659
+ ⎿ $ git log --oneline -3
660
+ Ran 1 shell command
661
+ ✻ Worked for 6s
662
+ ⎿ nexus-brain · 1,562 tok · 1,250/312 · €0.0007 · 4.2s
663
+ ● high · /effort
664
+ ────────────────────────────────────────────────────────────────────────────────
665
+ ❯ Try "edit <filepath> to..."
666
+ ────────────────────────────────────────────────────────────────────────────────
667
+ ⏸ manual mode on · ? for shortcuts · ← for agents
668
+ ```
669
+
670
+ What the loop does, in the order a turn happens:
671
+
672
+ - **You type.** The input line has history (`↑`/`↓`), tab completion for `/…`,
673
+ word motions, a rotating suggestion when empty, horizontal scrolling for a
674
+ long line, and a collapsed one-line preview for a multi-line paste (the full
675
+ text is still what gets submitted).
676
+ - **The turn starts.** A random verb from the reference set shimmers in coral
677
+ beside the spinner, with elapsed time and a live token estimate.
678
+ - **The answer streams into a row**, markdown-rendered, opening with `●` — one
679
+ marker, whatever the answer's length, so the glyph does not multiply when the
680
+ text wraps.
681
+ - **Tool calls become rows.** `● Running 1 shell command… · 3s` resolves to
682
+ `Ran 1 shell command` when the call returns — paired by tool-call id, so
683
+ parallel same-name calls and nested subagent rows stay separate, and the
684
+ plural is right.
685
+ - **The turn ends** with `✻ Churned for Ns` (no tools) or `✻ Worked for Ns`
686
+ (tools), then an accounting row: `⎿ nexus-brain · 1,562 tok · 1,250/312 ·
687
+ €0.0007 · 4.2s`.
688
+ - **Esc interrupts.** The abort reaches the transport through an
689
+ `AbortSignal`, so the in-flight provider call is genuinely cancelled — it
690
+ does not keep running and billing behind a "stopped" label — and whatever had
691
+ already streamed is kept, marked `(stopped)`.
692
+ - **Keys work mid-turn.** Esc/Ctrl-C abort; PgUp/PgDn and the wheel scroll the
693
+ transcript live (and scrolling up is anchored to an absolute line index, so an
694
+ arriving delta does not drag the reader back to the bottom); everything else
695
+ you type is replayed into the input line afterwards.
696
+ - **Overlays**: `/` the palette (fuzzy-ranked, with `Tab` to complete to the
697
+ highlighted command), `alt+p` the model picker, `/effort` the effort picker,
698
+ `/resume` the session list, `?` the shortcut grid, `ctrl+o` permissions, and a
699
+ centred Yes/No dialog when a mutating tool needs approval. `Esc` closes an
700
+ overlay, and clears the input line when nothing is open.
701
+ - **Every turn is persisted** to `~/.aegiscode/history.jsonl` and mirrored into
702
+ the shared `~/.aegiscode/sessions.json`, with a transcript checkpoint alongside
703
+ them, so `/resume`, `/cost`, `/clear` and `/rewind` all have something real to
704
+ read — and the desktop app sees the same conversations. On exit the session
705
+ prints how to come back to it.
706
+
707
+ Anything that is not a real terminal — a pipe, `-p`, a CI run — stays a linear
708
+ transcript written once to scrollback, so output remains pipeable and
709
+ scriptable.
710
+
711
+ Render it yourself, with no key and no network:
712
+
713
+ ```bash
714
+ node cli/scripts/demo.mjs # from a source checkout
715
+ # --light, --width 100, --plain also work
716
+ ```
717
+
718
+ ## Design notes
719
+
720
+ **It looks like the reference on purpose.** The gold/coral/lavender palette,
721
+ the `✦`-studded welcome mark (mascot, crescent moon and diving whale), the `❯`
722
+ prompt, the `⎿` hook rows and the `✻` spinner line are the reference's
723
+ design system, adopted wholesale rather than approximated: the palette, glyphs,
724
+ welcome art, working verbs and command vocabulary all come from it, and
725
+ `test/cli-conformance.test.mjs` pins every RGB triple, glyph, spinner frame, verb
726
+ and art row to that source so the two hosts cannot drift apart. (An earlier
727
+ revision of this CLI was a deliberate divergence — a violet/cyan "Signal" theme
728
+ with a test asserting it. That direction is gone.)
729
+
730
+ **A full-screen chatflow on a terminal, a linear transcript everywhere else.**
731
+ On a TTY the session is the reference's loop: alternate screen, header rule,
732
+ transcript viewport, spinner, effort line, input line, status line, overlays.
733
+ Anywhere else — a pipe, `-p`, CI — turns are written once to the scrollback
734
+ instead, so output stays selectable, searchable and pipeable. A tool you script
735
+ should not become un-scriptable because the interactive mode got nicer.
736
+
737
+ **The command registry is the reference's, ported.** Names, aliases,
738
+ categories, the palette grouping and the handlers themselves come from it, with
739
+ `test/cli-commands.test.mjs` asserting the full name list so a silent drop
740
+ fails the build. Local capability that the reference has — a dev-server runner,
741
+ project sniffing, an export path, a session store, checkpoints, permission
742
+ rules, subagent presets — was ported with it rather than stubbed.
743
+
744
+ **Tokens beside money, always.** A turn prints what it consumed and what it
745
+ settled at, in the same line: `1,562 tok ∙ 1,250/312 ∙ €0.0007`. Sub-cent
746
+ amounts keep four decimals, because a €0.0007 call rendered at 2dp reads as
747
+ free usage next to a token count.
748
+
749
+ **Esc really stops the call.** The interrupt travels as an `AbortSignal` into
750
+ the transport, and the engine does not re-dispatch after an abort — a cancelled
751
+ turn used to fire a second billed provider request ("the model said nothing"
752
+ recovery, triggered by the empty result an abort produces) and stream the
753
+ partial answer twice. `test/local-engine.test.mjs` pins the dispatch count.
754
+
755
+ ## Tests
756
+
757
+ ```bash
758
+ node ../test/cli-chatflow.test.mjs # the session loop, driven with a synthetic key stream
759
+ node ../test/cli-commands.test.mjs # the full command table, aliases, dispatch contract
760
+ node ../test/cli-panels.test.mjs # every panel builder, defensive against missing data
761
+ node ../test/cli-support.test.mjs # config/history/tokens/agents/export/checkpoints
762
+ node ../test/cli-conformance.test.mjs # the design guard: palette, glyphs, art, verbs
763
+ node ../test/cli-terminal-caps.test.mjs # capability resolution: PowerShell and zsh agree
764
+ node ../test/cli-render.test.mjs # width safety, accounting, live region
765
+ node ../test/cli-overlays.test.mjs # the / palette, model + effort pickers, resume list
766
+ node ../test/cli-fuzzy.test.mjs # palette ranking and match positions
767
+ node ../test/cli-ping-todos.test.mjs # /ping's four properties, /todos, /config's store routing
768
+ node ../test/cli-markdown.test.mjs # span-line markdown, cell widths
769
+ node ../test/cli-tools.test.mjs # registry parity with the MCP host + dispatch
770
+ node ../test/cli-run.test.mjs # the real binary against a real backend
771
+ node ../test/cli-package.test.mjs # the published layout, isolated from the repo
772
+ npm test # all of the above
773
+ ```
774
+
775
+ The chatflow test drives `runSession` for real: a synthetic key stream, stdout
776
+ captured, and the app entered exactly as `bin/aegiscode.js` enters it. It covers
777
+ the turn lifecycle, tool-row pairing, the interrupt reaching the transport, the
778
+ viewport anchor, the input line's cell maths and an abort that must not
779
+ re-dispatch.
780
+
781
+ `npm run predist` stages `client/`, `mcp/tools.js` and the desktop's `usage.js`,
782
+ `local/engine.js` and `local/agents.js` into `cli/vendor/` (gitignored) so the
783
+ published package resolves its own modules. `test/cli-package.test.mjs` copies
784
+ that tree somewhere with no repo around it and runs the binary there.