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,62 +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
- * memory-queue.js — local retry queue for cloud memory saves (plan P3 §7).
10
- * When `aegis.memorySave()` fails (no key configured, offline), the entry is
11
- * appended to <dir>/memory-queue.json instead of being dropped, so a later
12
- * "Sync now" or heartbeat retry can flush it once the cloud is reachable.
13
- * Pure Node + injectable dir, mirrors desktop/lib/sync/sessions.js.
14
- */
15
-
16
- const fs = require('node:fs');
17
- const path = require('node:path');
18
-
19
- function queueFile(dir) {
20
- return path.join(dir, 'memory-queue.json');
21
- }
22
-
23
- function load(dir) {
24
- try {
25
- const data = JSON.parse(fs.readFileSync(queueFile(dir), 'utf8'));
26
- return Array.isArray(data) ? data : [];
27
- } catch {
28
- return [];
29
- }
30
- }
31
-
32
- function atomicWrite(file, data) {
33
- fs.mkdirSync(path.dirname(file), { recursive: true });
34
- const tmp = `${file}.tmp-${process.pid}`;
35
- fs.writeFileSync(tmp, JSON.stringify(data, null, 2));
36
- fs.renameSync(tmp, file);
37
- }
38
-
39
- function save(dir, entries) {
40
- atomicWrite(queueFile(dir), entries);
41
- }
42
-
43
- /** Queue a memory entry that a cloud save couldn't reach right now. */
44
- function enqueue(dir, entry) {
45
- const entries = load(dir);
46
- const queued = { ...entry, queuedAt: Date.now() };
47
- entries.push(queued);
48
- save(dir, entries);
49
- return queued;
50
- }
51
-
52
- function listQueued(dir) {
53
- return load(dir);
54
- }
55
-
56
- module.exports = {
57
- queueFile,
58
- load,
59
- save,
60
- enqueue,
61
- listQueued,
62
- };
3
+ "use strict";const fs=require("node:fs"),path=require("node:path");function queueFile(e){return path.join(e,"memory-queue.json")}function load(e){try{const u=JSON.parse(fs.readFileSync(queueFile(e),"utf8"));return Array.isArray(u)?u:[]}catch{return[]}}function atomicWrite(e,u){fs.mkdirSync(path.dirname(e),{recursive:!0});const n=`${e}.tmp-${process.pid}`;fs.writeFileSync(n,JSON.stringify(u,null,2)),fs.renameSync(n,e)}function save(e,u){atomicWrite(queueFile(e),u)}function enqueue(e,u){const n=load(e),t={...u,queuedAt:Date.now()};return n.push(t),save(e,n),t}function listQueued(e){return load(e)}module.exports={queueFile:queueFile,load:load,save:save,enqueue:enqueue,listQueued:listQueued};
@@ -1,150 +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
- * persist-gate.js — the desktop half of "persisting memory for every account".
10
- *
11
- * `cli/` stores the preference in the shared non-secret store as `memoryPersist`
12
- * (`cli/src/config.js`, migrated off the legacy `cloudSync` key). Since AEGIS
13
- * ONE D5 that store is `$AEGISCODE_HOME/preferences.json` (`client/prefs.js`),
14
- * which the shell and the window both write — so this gate reads the SAME value
15
- * the Settings pane writes, and there is no second copy to disagree with.
16
- *
17
- * Two reasons the gate is not taken from the renderer:
18
- *
19
- * 1. The decision has to be enforceable in the main process whatever the
20
- * renderer believes. A renderer-held flag is a suggestion; the process
21
- * that opens the socket decides.
22
- * 2. `createSyncDispatch()` / createAutoPush() are unit-tested in plain Node,
23
- * where no renderer and no Electron exist.
24
- *
25
- * Default is ON, matching cli/. `source` keeps "the user turned this off" and
26
- * "nobody has been asked yet" tellable apart — the whole point of shipping a
27
- * default is that the absence of a stored key is not the same as a stored no.
28
- *
29
- * A pre-D5 `<userData>/settings.json` `__memoryPersist` namespace is still read
30
- * as a FALLBACK (`readSettings` below, `source: 'config'`) so a gate that runs
31
- * before adoption lands cannot read "default" over a user's explicit `false`.
32
- * It is never written: the store retires it on the first write.
33
- */
34
-
35
- const fs = require('node:fs');
36
- const path = require('node:path');
37
-
38
- const { MEMORY_PERSIST_NAMESPACE, SETTINGS_FILE } = require('../settings.js');
39
-
40
- // The shared, non-secret preference store (D5), resolved the same two ways the
41
- // other cross-host modules are: in-repo `client/*.js`, packaged `vendor/*.js`.
42
- const prefs = (() => {
43
- try {
44
- return require('../../../client/prefs.js');
45
- } catch {
46
- return require('../../vendor/prefs.js');
47
- }
48
- })();
49
-
50
- /** The settings file the store writes (`createSettingsStore` uses the same
51
- * `path.join(dir, SETTINGS_FILE)`, so both agree on one source of truth).
52
- * A caller that already holds the file path may pass it directly. */
53
- function settingsFile(dir) {
54
- const p = dir || '';
55
- return p.endsWith(SETTINGS_FILE) ? p : path.join(p, SETTINGS_FILE);
56
- }
57
-
58
- function readSettings(dir) {
59
- try {
60
- const data = JSON.parse(fs.readFileSync(settingsFile(dir), 'utf8'));
61
- return data && typeof data === 'object' ? data : {};
62
- } catch {
63
- return {};
64
- }
65
- }
66
-
67
- /**
68
- * `{ enabled, source }`, read from the SHARED store the Settings pane writes.
69
- *
70
- * `source` is 'config' only when a file actually carries an explicit value — an
71
- * explicit `false` survives, an absent preference is ON. `dir` is the legacy
72
- * settings directory (Electron's `<userData>`), consulted only when the shared
73
- * store has no opinion; `opts.prefsDir`/`opts.env` locate the shared store for
74
- * callers that hold their own seam (tests).
75
- */
76
- function gateState(dir, opts) {
77
- const o = opts || {};
78
- const shared = prefs.load({ dir: o.prefsDir, env: o.env });
79
- if (typeof shared.memoryPersist === 'boolean') {
80
- return { enabled: shared.memoryPersist, source: 'config' };
81
- }
82
- const cfg = readSettings(dir)[MEMORY_PERSIST_NAMESPACE];
83
- if (!cfg || cfg.enabled === undefined) return { enabled: true, source: 'default' };
84
- return { enabled: Boolean(cfg.enabled), source: 'config' };
85
- }
86
-
87
- /**
88
- * The post-turn push, gated.
89
- *
90
- * `push` is `createSyncDispatch`'s own drain, so this inherits the queue
91
- * fallback for free: a push flushes `memory-queue.json` before it touches the
92
- * session list, which is exactly the "offline now, sync later" behaviour the
93
- * manual button had and the automatic path must not lose.
94
- *
95
- * Coalesced: a turn that ends while a drain is still in flight does not open a
96
- * second one. `push()` snapshots `sessions.listPending(dir)`, so a concurrent
97
- * call would race the same rows; the newest session instead goes out on the
98
- * next trigger (the following turn's auto push, or "Sync now"). One turn of
99
- * delay is the correct trade against two writers marking the same session
100
- * synced.
101
- */
102
- function createAutoPush({ push, dir, gate, prefsDir, env } = {}) {
103
- if (typeof push !== 'function') throw new Error('createAutoPush requires a push()');
104
- const readGate = typeof gate === 'function' ? gate : () => gateState(dir, { prefsDir, env });
105
- let inFlight = null;
106
-
107
- async function run() {
108
- const state = readGate();
109
- if (!state.enabled) {
110
- return {
111
- ok: true,
112
- skipped: true,
113
- gate: state,
114
- reason: 'persisting memory is off',
115
- };
116
- }
117
- try {
118
- const result = await push();
119
- return Object.assign({}, result, { skipped: false, gate: state });
120
- } catch (err) {
121
- // A chat turn must never fail because a background push did. `push()`
122
- // already resolves `{ ok:false, … }` for its expected failures; this
123
- // catches the unexpected so the caller's fire-and-forget cannot become
124
- // an unhandled rejection.
125
- return {
126
- ok: false,
127
- skipped: false,
128
- gate: state,
129
- reason: (err && err.message) || String(err),
130
- };
131
- }
132
- }
133
-
134
- function auto() {
135
- if (inFlight) return inFlight;
136
- inFlight = run().finally(() => {
137
- inFlight = null;
138
- });
139
- return inFlight;
140
- }
141
-
142
- return { auto, gate: () => readGate(), state: () => readGate() };
143
- }
144
-
145
- module.exports = {
146
- settingsFile,
147
- readSettings,
148
- gateState,
149
- createAutoPush,
150
- };
3
+ "use strict";const fs=require("node:fs"),path=require("node:path"),{MEMORY_PERSIST_NAMESPACE:MEMORY_PERSIST_NAMESPACE,SETTINGS_FILE:SETTINGS_FILE}=require("../settings.js"),prefs=(()=>{try{return require("../../../client/prefs.js")}catch{return require("../../vendor/prefs.js")}})();function settingsFile(e){const t=e||"";return t.endsWith(SETTINGS_FILE)?t:path.join(t,SETTINGS_FILE)}function readSettings(e){try{const t=JSON.parse(fs.readFileSync(settingsFile(e),"utf8"));return t&&"object"==typeof t?t:{}}catch{return{}}}function gateState(e,t){const r=t||{},n=prefs.load({dir:r.prefsDir,env:r.env});if("boolean"==typeof n.memoryPersist)return{enabled:n.memoryPersist,source:"config"};const s=readSettings(e)[MEMORY_PERSIST_NAMESPACE];return s&&void 0!==s.enabled?{enabled:Boolean(s.enabled),source:"config"}:{enabled:!0,source:"default"}}function createAutoPush({push:e,dir:t,gate:r,prefsDir:n,env:s}={}){if("function"!=typeof e)throw new Error("createAutoPush requires a push()");const i="function"==typeof r?r:()=>gateState(t,{prefsDir:n,env:s});let o=null;return{auto:function(){return o||(o=async function(){const t=i();if(!t.enabled)return{ok:!0,skipped:!0,gate:t,reason:"persisting memory is off"};try{const r=await e();return Object.assign({},r,{skipped:!1,gate:t})}catch(e){return{ok:!1,skipped:!1,gate:t,reason:e&&e.message||String(e)}}}().finally((()=>{o=null})),o)},gate:()=>i(),state:()=>i()}}module.exports={settingsFile:settingsFile,readSettings:readSettings,gateState:gateState,createAutoPush:createAutoPush};
@@ -1,108 +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
- * sessions.js — the desktop's session store, now a thin binding over the
10
- * SHARED store in `client/session-store.js`.
11
- *
12
- * This file used to be the implementation. It was the desktop's private
13
- * `sessions.json`, while the terminal host kept `~/.aegiscode/history.jsonl`
14
- * and the MCP plugin could see neither — three hosts, one account, three
15
- * disjoint views of the conversation. The implementation now lives in
16
- * `client/session-store.js`, which is the tree every host already bundles,
17
- * and every call here forwards to it.
18
- *
19
- * Two things that matter are deliberately unchanged:
20
- *
21
- * * the public API and its argument order (`(dir, …)` first) — `main.js`, the
22
- * sync dispatch and `test/sync-sessions.test.mjs` call it by those names;
23
- * * the record shape — `pending`, `seq`, `updatedAt`, `remoteId`,
24
- * `lastSyncedAt`, `__seq` all keep their meaning, because cloud sync and
25
- * the renderer's session list read them.
26
- *
27
- * The only real change is *where* `dir` points: main.js now passes the shared
28
- * data dir (see `resolveStoreDir`), so a session typed in the terminal appears
29
- * in the desktop's list without a network round trip.
30
- *
31
- * Resolution mirrors main.js's own pattern for the shared client: `client/` in
32
- * a source checkout, `vendor/` in the packaged app (electron-builder cannot
33
- * reach outside the app dir, so predist.mjs stages the file).
34
- */
35
-
36
- const shared = (() => {
37
- try {
38
- return require('../../../client/session-store.js');
39
- } catch {
40
- return require('../../vendor/session-store.js');
41
- }
42
- })();
43
-
44
- const credentials = (() => {
45
- try {
46
- return require('../../../client/credentials.js');
47
- } catch {
48
- return require('../../vendor/credentials.js');
49
- }
50
- })();
51
-
52
- /**
53
- * The directory the shared store lives in: `$AEGISCODE_HOME` or `~/.aegiscode`.
54
- * `legacyDir` (Electron's userData) is only used to adopt a pre-unification
55
- * store, never to read sessions from afterwards.
56
- */
57
- function resolveStoreDir(legacyDir) {
58
- const dir = credentials.aegisHome();
59
- if (legacyDir && legacyDir !== dir) adopt(dir, legacyDir);
60
- return dir;
61
- }
62
-
63
- const {
64
- storeFile,
65
- load,
66
- save,
67
- upsertSession,
68
- appendMessage,
69
- recordExchange,
70
- listSessions,
71
- getSession,
72
- deleteSession,
73
- markSynced,
74
- markPending,
75
- listPending,
76
- mergeRemoteSessions,
77
- listSummaries,
78
- readTranscript,
79
- adopt,
80
- toMarkdown,
81
- toJson,
82
- } = shared;
83
-
84
- /** Kept under its old name — main.js and the tests call `sessionsFile`. */
85
- const sessionsFile = storeFile;
86
-
87
- module.exports = {
88
- sessionsFile,
89
- storeFile,
90
- resolveStoreDir,
91
- load,
92
- save,
93
- upsertSession,
94
- appendMessage,
95
- recordExchange,
96
- listSessions,
97
- getSession,
98
- deleteSession,
99
- markSynced,
100
- markPending,
101
- listPending,
102
- mergeRemoteSessions,
103
- listSummaries,
104
- readTranscript,
105
- adopt,
106
- toMarkdown,
107
- toJson,
108
- };
3
+ "use strict";const shared=(()=>{try{return require("../../../client/session-store.js")}catch{return require("../../vendor/session-store.js")}})(),credentials=(()=>{try{return require("../../../client/credentials.js")}catch{return require("../../vendor/credentials.js")}})();function resolveStoreDir(e){const s=credentials.aegisHome();return e&&e!==s&&adopt(s,e),s}const{storeFile:storeFile,load:load,save:save,upsertSession:upsertSession,appendMessage:appendMessage,recordExchange:recordExchange,listSessions:listSessions,getSession:getSession,deleteSession:deleteSession,markSynced:markSynced,markPending:markPending,listPending:listPending,mergeRemoteSessions:mergeRemoteSessions,listSummaries:listSummaries,readTranscript:readTranscript,adopt:adopt,toMarkdown:toMarkdown,toJson:toJson}=shared,sessionsFile=storeFile;module.exports={sessionsFile:sessionsFile,storeFile:storeFile,resolveStoreDir:resolveStoreDir,load:load,save:save,upsertSession:upsertSession,appendMessage:appendMessage,recordExchange:recordExchange,listSessions:listSessions,getSession:getSession,deleteSession:deleteSession,markSynced:markSynced,markPending:markPending,listPending:listPending,mergeRemoteSessions:mergeRemoteSessions,listSummaries:listSummaries,readTranscript:readTranscript,adopt:adopt,toMarkdown:toMarkdown,toJson:toJson};
@@ -1,68 +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
- * window-state.js — persisted BrowserWindow bounds (native desktop plumbing).
10
- * Pure Node + injectable dir, mirrors desktop/lib/sync/memory-queue.js: reads
11
- * and writes <dir>/window-state.json, no Electron import, so it unit-tests
12
- * without the Electron binary.
13
- */
14
-
15
- const fs = require('node:fs');
16
- const path = require('node:path');
17
-
18
- function stateFile(dir) {
19
- return path.join(dir, 'window-state.json');
20
- }
21
-
22
- function load(dir) {
23
- try {
24
- const data = JSON.parse(fs.readFileSync(stateFile(dir), 'utf8'));
25
- return data && typeof data === 'object' ? data : null;
26
- } catch {
27
- return null;
28
- }
29
- }
30
-
31
- function save(dir, state) {
32
- const file = stateFile(dir);
33
- fs.mkdirSync(path.dirname(file), { recursive: true });
34
- const tmp = `${file}.tmp-${process.pid}`;
35
- fs.writeFileSync(tmp, JSON.stringify(state, null, 2));
36
- fs.renameSync(tmp, file);
37
- }
38
-
39
- /**
40
- * Clamp a saved rectangle so it always intersects at least one connected
41
- * display's work area. A saved position from a monitor that has since been
42
- * unplugged, or from a resolution that shrank, would otherwise place the
43
- * window off every visible screen — it "opens" but is unreachable. `displays`
44
- * takes plain `{ workArea: {x,y,width,height} }` objects (electron.screen's
45
- * shape) so this stays pure and Electron-free for testing.
46
- */
47
- function clampToDisplay(bounds, displays, fallback) {
48
- if (!bounds || typeof bounds !== 'object') return { ...fallback };
49
- const { x, y, width, height } = bounds;
50
- if (![x, y, width, height].every((n) => Number.isFinite(n))) return { ...fallback };
51
-
52
- const w = Math.max(1, width);
53
- const h = Math.max(1, height);
54
- const list = Array.isArray(displays) ? displays : [];
55
-
56
- const visible = list.some((d) => {
57
- const wa = d && d.workArea;
58
- if (!wa) return false;
59
- return x < wa.x + wa.width && x + w > wa.x && y < wa.y + wa.height && y + h > wa.y;
60
- });
61
-
62
- if (visible) return { x, y, width: w, height: h };
63
- // Position is off every screen: keep the saved size but drop x/y so the
64
- // caller's default centering (no x/y passed to BrowserWindow) takes over.
65
- return { ...fallback, width: w, height: h };
66
- }
67
-
68
- module.exports = { stateFile, load, save, clampToDisplay };
3
+ "use strict";const fs=require("node:fs"),path=require("node:path");function stateFile(t){return path.join(t,"window-state.json")}function load(t){try{const e=JSON.parse(fs.readFileSync(stateFile(t),"utf8"));return e&&"object"==typeof e?e:null}catch{return null}}function save(t,e){const i=stateFile(t);fs.mkdirSync(path.dirname(i),{recursive:!0});const r=`${i}.tmp-${process.pid}`;fs.writeFileSync(r,JSON.stringify(e,null,2)),fs.renameSync(r,i)}function clampToDisplay(t,e,i){if(!t||"object"!=typeof t)return{...i};const{x:r,y:n,width:s,height:a}=t;if(![r,n,s,a].every((t=>Number.isFinite(t))))return{...i};const o=Math.max(1,s),c=Math.max(1,a);return(Array.isArray(e)?e:[]).some((t=>{const e=t&&t.workArea;return!!e&&r<e.x+e.width&&r+o>e.x&&n<e.y+e.height&&n+c>e.y}))?{x:r,y:n,width:o,height:c}:{...i,width:o,height:c}}module.exports={stateFile:stateFile,load:load,save:save,clampToDisplay:clampToDisplay};
@@ -1486,7 +1486,10 @@ function registerQuickLauncherIpc(ipcMain, dispatch) {
1486
1486
  /**
1487
1487
  * Resolve the per-user data directory for settings + sessions. Electron gives
1488
1488
  * us app.getPath('userData'); outside Electron (headless smoke tests) fall back
1489
- * to ~/.aegiscode so the pure functions can still be exercised.
1489
+ * to the platform's own state root via `one/src/iface/paths.js`, so this host
1490
+ * does not keep a second, divergent answer to "where is this OS's data dir".
1491
+ * (It previously hard-coded `~/.aegiscode`, which is a POSIX answer written in
1492
+ * a file that also runs on Windows.)
1490
1493
  */
1491
1494
  function resolveUserDataDir(app) {
1492
1495
  if (app && typeof app.getPath === 'function') {
@@ -1496,6 +1499,13 @@ function resolveUserDataDir(app) {
1496
1499
  /* fall through */
1497
1500
  }
1498
1501
  }
1502
+ try {
1503
+ const PATHS = require('../one/src/iface/paths.js');
1504
+ const planned = PATHS.plan({ platform: process.platform, env: process.env });
1505
+ if (planned && planned.ok) return planned.state;
1506
+ } catch {
1507
+ /* the one/ tree is not shipped beside a standalone desktop build */
1508
+ }
1499
1509
  return path.join(os.homedir(), '.aegiscode');
1500
1510
  }
1501
1511
 
@@ -3783,6 +3793,62 @@ function bootstrap() {
3783
3793
 
3784
3794
  const { app, BrowserWindow, ipcMain, safeStorage, shell, Menu, Notification, screen, dialog, globalShortcut } = electron;
3785
3795
 
3796
+ // ── one artifact, two faces (one/src/selfhost.js) ────────────────────────
3797
+ //
3798
+ // A PACKAGED launch may have been asked for the terminal face: `aegiscode`,
3799
+ // `aegis --tui`, `aegis code`. The packaged app carries both faces in
3800
+ // `resources/faces/`, and Electron embeds Node — so re-entering ourselves with
3801
+ // ELECTRON_RUN_AS_NODE=1 runs the terminal face with no Node on the user's
3802
+ // PATH. That is the one case both installers currently have to apologise for.
3803
+ //
3804
+ // This runs BEFORE the GPU switches below, deliberately: a terminal session
3805
+ // must never initialise Chromium, let alone crash-loop its GPU process on a
3806
+ // headless box (the failure the block below exists to survive).
3807
+ //
3808
+ // `plan()` returns null for every other case — including every window request,
3809
+ // because in that case THIS process is the window and spawning a second one
3810
+ // would race the single-instance lock below. Null means "carry on", never
3811
+ // "do nothing".
3812
+ try {
3813
+ // Two layouts, same reason every other staged module has two: in a checkout
3814
+ // it is a sibling of `desktop/`, and packaged electron-builder cannot reach
3815
+ // outside the app dir, so predist stages it FLAT as `vendor/selfhost.js`
3816
+ // (one MANIFEST row, two shapes).
3817
+ let selfhost;
3818
+ try {
3819
+ selfhost = require('./vendor/selfhost.js');
3820
+ } catch {
3821
+ selfhost = require('../one/src/selfhost.js');
3822
+ }
3823
+ const planned = selfhost.plan({
3824
+ packaged: app.isPackaged,
3825
+ execPath: process.execPath,
3826
+ resourcesPath: process.resourcesPath,
3827
+ argv: process.argv.slice(1),
3828
+ invokedAs: path.basename(process.argv[1] || process.execPath),
3829
+ });
3830
+ if (planned) {
3831
+ // Synchronous on purpose: the terminal face owns the tty, and its exit
3832
+ // code IS ours — a detached `aegis code` that returns 0 while the child
3833
+ // failed tells a script nothing true.
3834
+ const opts = selfhost.spawnOptions(planned, process.env);
3835
+ const res = require('node:child_process').spawnSync(opts.exec, opts.args, {
3836
+ stdio: 'inherit',
3837
+ env: opts.env,
3838
+ });
3839
+ const code = typeof res.status === 'number' ? res.status : 1;
3840
+ app.exit(code);
3841
+ return;
3842
+ }
3843
+ } catch (err) {
3844
+ // A missing selfhost module is not fatal: it means this build predates the
3845
+ // packaged terminal face, and a window is still the right answer. Printed
3846
+ // rather than swallowed so a genuinely broken staging step is visible.
3847
+ if (app.isPackaged && !/MODULE_NOT_FOUND/.test(String(err && err.message))) {
3848
+ process.stderr.write(`aegis: terminal face hand-off failed: ${(err && err.message) || err}\n`);
3849
+ }
3850
+ }
3851
+
3786
3852
  // A container/CI/headless server with no usable GPU crashes Chromium's GPU
3787
3853
  // process in a retry loop that ends in a FATAL exit ("GPU process isn't
3788
3854
  // usable. Goodbye.") — and that happens BEFORE app.whenReady() ever fires,
@@ -2,7 +2,7 @@
2
2
  "name": "aegis-desktop",
3
3
  "productName": "AEGIS Desktop",
4
4
  "desktopName": "aegis-desktop",
5
- "version": "1.0.26",
5
+ "version": "1.0.29",
6
6
  "description": "Thin Electron host for AEGIS — a local chat UI over the shared client/aegis.js transport. Ships transport + UI only; engine logic stays server-side.",
7
7
  "author": {
8
8
  "name": "AEGIS Code",
@@ -22,13 +22,11 @@
22
22
  "vendor",
23
23
  "bin",
24
24
  "build",
25
- "docs"
25
+ "docs",
26
+ "SOURCE-OFFER.txt"
26
27
  ],
27
28
  "scripts": {
28
29
  "start": "electron .",
29
- "predist": "node scripts/predist.mjs",
30
- "prepack": "node scripts/predist.mjs --quiet",
31
- "prepublishOnly": "npm run predist",
32
30
  "icon": "node scripts/generate-icon.mjs",
33
31
  "shots": "node scripts/capture-marketing-shots.mjs",
34
32
  "demo": "node scripts/record-demo-gif.mjs",