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
package/src/host.js CHANGED
@@ -1,113 +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
- * host.js — the ONE place in `one/` that asks the host which OS it is.
10
- *
11
- * Why this file exists (plan ON6 step 5, and the standing Phase 30.1 rule that
12
- * nothing in `one/` reads `process.*` at module scope):
13
- *
14
- * before ON6 the platform answer in `one/` was a bare `process.platform` read
15
- * inside `probes.js`. That is a second answer to a question this repo already
16
- * has exactly one owner for — `client/platform.js`, whose header says it in as
17
- * many words ("the ONE place in this repo that knows which OS it is running
18
- * on"), and which the stager already ships in both emitted shapes. A second
19
- * read is how the two answers drift; a grep in `one/test/one-compat.test.mjs`
20
- * now keeps them from drifting (`process.platform` must not appear in `one/`
21
- * outside `one/vendor/`, which is generated).
22
- *
23
- * So every OS branch in `one/` (the Electron probe's display rule, the doctor's
24
- * platform input, the installer's bundle target) resolves through here, and
25
- * here resolves through `client/platform.js`. Two layouts are tried, in the
26
- * order the two copies actually appear:
27
- *
28
- * 1. `../../client/platform.js` — a checkout of this repo, faces as siblings
29
- * of `one/`;
30
- * 2. `../vendor/desktop/vendor/platform.js` — inside the published tarball,
31
- * where the stager emits the flattened desktop shape (plan D6).
32
- *
33
- * A third candidate covers the mirrored shape (`../vendor/cli/vendor/client/
34
- * platform.js`) so a future bundle shape cannot silently lose the seam.
35
- *
36
- * `os.platform()` is the last-resort fallback, and it is deliberately *not*
37
- * `process.platform`: this file is the seam, so it must be readable as "here is
38
- * the one read" rather than "here is a read, and also the other files have
39
- * their own". It is only reachable when neither staged copy is beside this
40
- * module, which no shipped shape does — and that case is what the grep proves
41
- * cannot silently return to the call sites.
42
- */
43
-
44
- const fs = require('node:fs');
45
- const path = require('node:path');
46
-
47
- /** Candidate locations of the platform seam, nearest-to-furthest. */
48
- function seamCandidates(dir) {
49
- const from = dir || __dirname; // one/src in every shipped shape
50
- return [
51
- path.join(from, '..', '..', 'client', 'platform.js'),
52
- path.join(from, '..', 'vendor', 'desktop', 'vendor', 'platform.js'),
53
- path.join(from, '..', 'vendor', 'cli', 'vendor', 'client', 'platform.js')
54
- ];
55
- }
56
-
57
- /**
58
- * Load the platform seam, or `null` when no copy is beside this module.
59
- *
60
- * @param {object} [deps] injected for tests: { dir, exists, load }
61
- * @returns {object|null} the `client/platform.js` module object
62
- */
63
- function platformSeam(deps) {
64
- const d = deps || {};
65
- const exists = d.exists || fs.existsSync;
66
- const load = d.load || require;
67
- for (const candidate of seamCandidates(d.dir)) {
68
- if (!exists(candidate)) continue;
69
- try {
70
- const mod = load(candidate);
71
- // The function, not the file, is the contract: a copy that loaded but
72
- // exposes no `seams()` would answer nothing and must not be accepted as
73
- // an answer to the OS question.
74
- if (mod && typeof mod.seams === 'function') return mod;
75
- } catch {
76
- /* try the next layout */
77
- }
78
- }
79
- return null;
80
- }
81
-
82
- /**
83
- * The host OS, as `client/platform.js` reports it (`'linux' | 'darwin' | …`).
84
- *
85
- * @param {object} [deps] injected for tests: { dir, exists, load }
86
- * @returns {string}
87
- */
88
- function hostPlatform(deps) {
89
- const d = deps || {};
90
- const seam = platformSeam(d);
91
- if (seam) return seam.seams(d.options || {}).platform;
92
- return require('node:os').platform();
93
- }
94
-
95
- /**
96
- * The platform facts `client/platform.js` derives, so a caller branches on the
97
- * seam's vocabulary (`win32`) instead of comparing strings a second time.
98
- *
99
- * @param {object} [deps] injected for tests: { dir, exists, load, platform }
100
- * @returns {{platform: string, win32: boolean}}
101
- */
102
- function hostSeams(deps) {
103
- const d = deps || {};
104
- const seam = platformSeam(d);
105
- if (seam) {
106
- const facts = seam.seams({ platform: d.platform });
107
- return { platform: facts.platform, win32: Boolean(facts.win32) };
108
- }
109
- const platform = d.platform || require('node:os').platform();
110
- return { platform, win32: platform === 'win32' };
111
- }
112
-
113
- module.exports = { seamCandidates, platformSeam, hostPlatform, hostSeams };
3
+ "use strict";const fs=require("node:fs"),path=require("node:path");function seamCandidates(t){const o=t||__dirname;return[path.join(o,"..","..","client","platform.js"),path.join(o,"..","vendor","desktop","vendor","platform.js"),path.join(o,"..","vendor","cli","vendor","client","platform.js")]}function platformSeam(t){const o=t||{},e=o.exists||fs.existsSync,a=o.load||require;for(const t of seamCandidates(o.dir))if(e(t))try{const o=a(t);if(o&&"function"==typeof o.seams)return o}catch{}return null}function hostPlatform(t){const o=t||{},e=platformSeam(o);return e?e.seams(o.options||{}).platform:require("node:os").platform()}function hostSeams(t){const o=t||{},e=platformSeam(o);if(e){const t=e.seams({platform:o.platform});return{platform:t.platform,win32:Boolean(t.win32)}}const a=o.platform||require("node:os").platform();return{platform:a,win32:"win32"===a}}module.exports={seamCandidates:seamCandidates,platformSeam:platformSeam,hostPlatform:hostPlatform,hostSeams:hostSeams};
@@ -0,0 +1,3 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
+ "use strict";const path=require("node:path"),APP="aegiscode",CODE=Object.freeze({BAD_INPUT:"bad_input",UNSUPPORTED:"unsupported"});function homeFrom(t,o){const n=o||{};return String("win32"===t?n.USERPROFILE||n.HOME||"":n.HOME||"")}function bases(t){const o=t||{},n=String(o.platform||""),r=o.env||{};if(!n)return{ok:!1,code:CODE.BAD_INPUT,msg:"platform is required (pass host.hostPlatform())"};const a=String(o.home||homeFrom(n,r)),e=()=>a?null:{ok:!1,code:CODE.BAD_INPUT,msg:`no home directory for ${n}: neither HOME nor USERPROFILE is set`};if("win32"===n){const t=e();if(t)return t;const o=String(r.APPDATA||path.join(a,"AppData","Roaming")),n=String(r.LOCALAPPDATA||path.join(a,"AppData","Local"));return{ok:!0,config:o,state:n,cache:n}}if("darwin"===n){return e()||{ok:!0,config:String(r.XDG_CONFIG_HOME||path.join(a,"Library","Application Support")),state:String(r.XDG_STATE_HOME||path.join(a,"Library","Application Support")),cache:String(r.XDG_CACHE_HOME||path.join(a,"Library","Caches"))}}if("linux"===n){return e()||{ok:!0,config:String(r.XDG_CONFIG_HOME||path.join(a,".config")),state:String(r.XDG_STATE_HOME||path.join(a,".local","state")),cache:String(r.XDG_CACHE_HOME||path.join(a,".cache"))}}return{ok:!1,code:CODE.UNSUPPORTED,msg:`no directory layout for platform: ${n}`}}function plan(t){const o=bases(t);return o.ok?{ok:!0,config:path.join(o.config,APP),state:path.join(o.state,APP),cache:path.join(o.cache,APP)}:o}function at(t,o,n){if(!t||!t.ok)return{ok:!1,code:t&&t.code||CODE.BAD_INPUT,msg:t&&t.msg||"no usable directory plan"};if(!Object.prototype.hasOwnProperty.call(t,o)||"ok"===o)return{ok:!1,code:CODE.BAD_INPUT,msg:`unknown root: ${String(o)}`};const r=Array.isArray(n)?n.map(String):[];return{ok:!0,path:path.join(t[o],...r)}}module.exports={APP:APP,CODE:CODE,homeFrom:homeFrom,bases:bases,plan:plan,at:at};
@@ -0,0 +1,3 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
+ "use strict";const path=require("node:path"),KIND=Object.freeze({PTY:"pty",PIPE:"pipe"}),CAP="pty",CODE=Object.freeze({UNSUPPORTED:"unsupported",NO_SPAWN:"no_spawn",BAD_DESC:"bad_desc"});function plan(n){const e=n||{};return"wasm"===e.target?{ok:!1,code:CODE.UNSUPPORTED,msg:"this target has no child processes: a WASM core cannot run exec"}:e.nativePty?{ok:!0,kind:KIND.PTY,cap:CAP,reason:"a PTY backend is available, so the child gets a real terminal"}:{ok:!0,kind:KIND.PIPE,cap:null,reason:"no PTY backend: stdio works, but resize, signals and line discipline do not"}}function caps(n){return n&&n.ok&&n.cap?[n.cap]:[]}function spawn(n,e,a){const s=a||{};if(!n||!n.ok)return{ok:!1,code:n&&n.code||CODE.UNSUPPORTED,msg:n&&n.msg||"no usable process plan"};const o=e||{},t=Array.isArray(o.argv)?o.argv.map(String):[];if(!t.length)return{ok:!1,code:CODE.BAD_DESC,msg:"exec needs a non-empty argv"};const c={cwd:o.cwd,env:o.env,cols:o.cols,rows:o.rows};return n.kind===KIND.PTY?"function"!=typeof s.spawnPty?{ok:!1,code:CODE.NO_SPAWN,msg:"pty was negotiated but no PTY spawner was injected"}:{ok:!0,kind:KIND.PTY,handle:s.spawnPty(t,c)}:"function"!=typeof s.spawnChild?{ok:!1,code:CODE.NO_SPAWN,msg:"no child-process spawner was injected"}:{ok:!0,kind:KIND.PIPE,handle:s.spawnChild(t,c)}}function sameCommand(n,e){return path.basename(String(n||""))===path.basename(String(e||""))}module.exports={KIND:KIND,CAP:CAP,CODE:CODE,plan:plan,caps:caps,spawn:spawn,sameCommand:sameCommand};
@@ -0,0 +1,3 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
+ "use strict";const CHANNEL=Object.freeze({NPM:"npm",APPIMAGE:"appimage",CHECKOUT:"checkout"}),CODE=Object.freeze({NO_CHANNEL:"no_channel",UNKNOWN_CHANNEL:"unknown_channel",NO_APPROACH:"no_approach",BAD_INPUT:"bad_input"});function plan(e){const n=e||{};return(n.env||{}).APPIMAGE?{ok:!0,channel:CHANNEL.APPIMAGE,selfUpdate:!0,reason:"running from an AppImage, which can replace its own file"}:n.packaged?{ok:!0,channel:CHANNEL.NPM,selfUpdate:!1,reason:"a packaged build is replaced by its installer; it only reports"}:{ok:!1,code:CODE.NO_CHANNEL,msg:"this copy is a source checkout: updating it means `git pull`, not a self-update"}}function check(e,n,o){if(!e||!e.ok)return{ok:!1,code:e&&e.code||CODE.BAD_INPUT,msg:e&&e.msg||"no usable update plan"};const t=o&&o.approach;if("function"!=typeof t)return{ok:!1,code:CODE.NO_APPROACH,msg:"no approach function was injected, so no update can be discovered"};const a=t(String(n||""));if(!a||!a.latest)return{ok:!1,code:CODE.NO_APPROACH,msg:"the approach step returned no version to compare against"};const c="function"==typeof(o&&o.compare)?o.compare:null;return{ok:!0,update:c?Boolean(c(String(n),String(a.latest))):null,current:String(n||""),latest:String(a.latest),url:String(a.url||"")}}function apply(e,n,o){if(!e||!e.ok)return{ok:!1,code:e&&e.code||CODE.BAD_INPUT,msg:e&&e.msg||"no usable update plan"};if(!e.selfUpdate)return{ok:!1,code:CODE.NO_CHANNEL,msg:`the ${e.channel} channel is not self-updating: ${e.reason}`};if(!n||!n.ok||!0!==n.update)return{ok:!1,code:CODE.BAD_INPUT,msg:"nothing to apply: no newer version was established"};const t=o&&o.replace;return"function"!=typeof t?{ok:!1,code:CODE.NO_APPROACH,msg:"no replace step was injected"}:(t(n),{ok:!0,applied:!0})}module.exports={CHANNEL:CHANNEL,CODE:CODE,plan:plan,check:check,apply:apply};
@@ -0,0 +1,3 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
+ "use strict";const KIND=Object.freeze({ELECTRON:"electron"}),CODE=Object.freeze({UNSUPPORTED:"unsupported",BAD_DECISION:"bad_decision"});function plan(n){const e=n||{};return e.decision&&"gui"===e.decision.face?"wasm"===e.target?null:e.electron?{ok:!0,kind:KIND.ELECTRON,cap:null,reason:"an Electron runtime is loadable, so it draws the window"}:null:null}function open(n,e,o){if(!n)return null;if(!n.ok)return{ok:!1,code:n.code||CODE.UNSUPPORTED,msg:n.msg||"no usable window plan"};if(n.kind!==KIND.ELECTRON)return{ok:!1,code:CODE.UNSUPPORTED,msg:`no adapter for kind: ${n.kind}`};const t=o&&o.openElectron;return"function"!=typeof t?{ok:!1,code:CODE.UNSUPPORTED,msg:"window plan needs an Electron opener, and none was injected"}:{ok:!0,kind:KIND.ELECTRON,handle:t(e||{})}}module.exports={KIND:KIND,CODE:CODE,plan:plan,open:open};
@@ -1,385 +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
- * permissions.js — ONE permission posture (AEGISONE, decision D8).
10
- *
11
- * Four permission surfaces used to live in this tree and none of them
12
- * negotiated (see the plan's D8 table): the CLI's rule file + `evalPermission`,
13
- * the desktop's `confirmModeEnabled()` gate, the avatar's level gate, and — out
14
- * of process — the Claude Code child, which runs its own permission system
15
- * whose prompts land on *its* stdin where neither a GUI card nor the CLI's
16
- * prompt loop can answer them. In `-p` mode an unanswered prompt is not a
17
- * refusal, it is a hang.
18
- *
19
- * This module is the product's half of the fix: it resolves the posture ONCE,
20
- * from the facts a caller already has, into a FROZEN decision record that
21
- * everything downstream reads instead of re-deciding for itself.
22
- *
23
- * ## What it is not
24
- *
25
- * * It is not a second rule engine. Rule matching is `evalPermission()`,
26
- * imported from `cli/src/permissions.js` (D8 rule 1: "evalPermission()
27
- * stays the only rule engine"). `loadEvaluator()` below resolves that
28
- * module in both layouts — a checkout and the published bundle — and a
29
- * missing evaluator is a thrown error, never a local re-implementation:
30
- * a rules engine that can silently become a *different* rules engine is the
31
- * drift this phase exists to remove.
32
- * * It is not a switch that reaches the two floors of D8 rule 2. The ÆGIS
33
- * covenant's `preActionAssert` and the avatar's `LEVEL_INDEPENDENT_
34
- * APPROVALS` (`write`/`shell`/`network`/`offDevice`, always `'ask'`) are not
35
- * represented here as skippable at all — `FROZEN_CLASSES` is exported so a
36
- * test can assert it is the SAME set the avatar freezes, and `gateFor()`
37
- * only ever downgrades an `'ask'` verdict, never an explicit `'deny'`.
38
- * * It reads no `process.*` at module scope, and nothing at all in its
39
- * functions: `env`, `interactive`, `skip` and `rules` all arrive as
40
- * arguments. That is the standing seam rule for `one/`, and it is why the
41
- * rule-5 case below can be asserted rather than hoped for.
42
- *
43
- * ## The record
44
- *
45
- * `resolvePosture({ rules, skip, interactive, childKind, env, flag })` returns
46
- * an object that is frozen at every level. Frozen matters: the record is
47
- * produced once per invocation and consumed by (a) this product's gate report,
48
- * (b) the Claude child's argv builder, and (c) the run log. A record a later
49
- * stage can mutate is a second decision, which is the bug D8 names.
50
- *
51
- * ## Rule 3's report
52
- *
53
- * `skipReport(record)` is the one stderr line rule 3 demands — "a flag whose
54
- * blast radius is invisible is how a footgun ships" — and it names both what
55
- * was skipped and, in as many words, what was not.
56
- */
57
-
58
- const path = require('node:path');
59
-
60
- /** The two children D8 rule 4 distinguishes. */
61
- const CHILD_KINDS = Object.freeze({ HEADLESS: 'headless', INTERACTIVE: 'interactive' });
62
-
63
- /**
64
- * What `--dangerously-skip-permissions` skips in THIS product: the configurable
65
- * confirmation gates, i.e. the desktop card / CLI ask for the mutating tools.
66
- * The classes are named the way the gate and the tool registry name them, so
67
- * the report line says exactly which calls stop asking.
68
- */
69
- const CONFIGURABLE_CLASSES = Object.freeze(['exec', 'writeFile', 'editFile']);
70
-
71
- /** The product flag's spelling (D8 rule 3), named once for both the bin and tests. */
72
- const SKIP_FLAG = '--dangerously-skip-permissions';
73
-
74
- /**
75
- * The four classes no setting, flag or env var may auto-approve (D8 rule 2).
76
- * The values are the avatar's, and `test/permissions.test.mjs` asserts this set
77
- * is identical to `LEVEL_INDEPENDENT_APPROVALS`'s keys — so a phase that adds a
78
- * fifth frozen class cannot land here silently.
79
- */
80
- const FROZEN_CLASSES = Object.freeze(['write', 'shell', 'network', 'offDevice']);
81
-
82
- /** D8 rule 4's explicit passthrough values — recorded, never inferred. */
83
- const PERMISSION_MODES = Object.freeze([
84
- 'acceptEdits',
85
- 'auto',
86
- 'bypassPermissions',
87
- 'manual',
88
- 'dontAsk',
89
- 'plan',
90
- ]);
91
-
92
- let cachedEvaluator = null;
93
- let cachedConfig = null;
94
-
95
- /**
96
- * The ONE rule engine, resolved in the three layouts that ship:
97
- *
98
- * 1. `one/src/…` in a checkout → `../../cli/src/permissions.js`
99
- * 2. `one/vendor/cli/src/…` in the published AEGISONE bundle → `../vendor/cli/src/…`
100
- * 3. `vendor/one/src/…` in the published `aegiscode` package → `../../../src/permissions.js`
101
- *
102
- * Candidate 3 is the one that was missing, and its absence was not a missing
103
- * file: `predist` mirrors `one/src` into the CLI package as
104
- * `aegiscode/vendor/one/src/`, while the CLI's own evaluator sits at
105
- * `aegiscode/src/permissions.js`. Candidates 1 and 2 both look for a `cli/`
106
- * directory that does not exist there, so the published product threw "the one
107
- * rule evaluator is missing" while the file was three levels up, and every
108
- * Claude-Pro turn through `claude-pro.js` → `loadSeam()` → `resolvePosture()`
109
- * failed. The lookup was right to refuse a second engine; it was wrong about
110
- * where the one engine lives.
111
- *
112
- * @returns {{evalPermission: Function, resolveSkip: Function, SKIP: object}}
113
- */
114
- function loadEvaluator(injected) {
115
- if (injected) return injected;
116
- if (cachedEvaluator) return cachedEvaluator;
117
- const candidates = [
118
- path.join(__dirname, '..', '..', 'cli', 'src', 'permissions.js'),
119
- path.join(__dirname, '..', 'vendor', 'cli', 'src', 'permissions.js'),
120
- path.join(__dirname, '..', '..', '..', 'src', 'permissions.js'),
121
- ];
122
- for (const candidate of candidates) {
123
- try {
124
- const mod = require(candidate);
125
- if (mod && typeof mod.evalPermission === 'function' && typeof mod.resolveSkip === 'function') {
126
- cachedEvaluator = mod;
127
- return mod;
128
- }
129
- } catch {
130
- /* try the next layout */
131
- }
132
- }
133
- throw new Error(
134
- 'aegis: the one rule evaluator (cli/src/permissions.js) is missing from this install — ' +
135
- 'refusing to resolve a permission posture from a second, unshared rule engine.'
136
- );
137
- }
138
-
139
- /**
140
- * The faces' OWN posture module, resolved in both layouts, exactly as the
141
- * evaluator above is:
142
- *
143
- * 1. `one/src/…` in a checkout → `../../cli/src/config.js`
144
- * 2. `one/vendor/cli/src/…` in the published AEGISONE bundle → `../vendor/cli/src/…`
145
- * 3. `vendor/one/src/…` in the published `aegiscode` package → `../../../src/config.js`
146
- *
147
- * This is deliberately the CLI's module and not a new reader. `confirmPosture()`
148
- * in there is the ONE read of the shared `confirmMode` key both faces write —
149
- * the desktop's *Confirm before running tools* switch and the shell's
150
- * `/automode` (alias `/yolo`) — and reading the store here a second way would
151
- * be the split brain ON8 removed. NotFound is `null`, never a throw: a store
152
- * that cannot be read must leave the gate UP, not blow up a launch.
153
- *
154
- * @returns {object|null}
155
- */
156
- function loadConfigStore(injected) {
157
- if (injected) return injected;
158
- if (cachedConfig) return cachedConfig;
159
- const candidates = [
160
- path.join(__dirname, '..', '..', 'cli', 'src', 'config.js'),
161
- path.join(__dirname, '..', 'vendor', 'cli', 'src', 'config.js'),
162
- path.join(__dirname, '..', '..', '..', 'src', 'config.js'),
163
- ];
164
- for (const candidate of candidates) {
165
- try {
166
- const mod = require(candidate);
167
- if (mod && typeof mod.confirmPosture === 'function') {
168
- cachedConfig = mod;
169
- return mod;
170
- }
171
- } catch {
172
- /* try the next layout */
173
- }
174
- }
175
- return null;
176
- }
177
-
178
- /**
179
- * What the SHARED stores say — the same two facts `one/bin/aegis.js` used to
180
- * pass as `undefined`.
181
- *
182
- * `confirmationsOn` is `confirmPosture().enabled`, i.e. the store's own answer
183
- * with its polarity already resolved (true = the gate is UP, the user is asked
184
- * before mutating tools). `rules` is the CLI's rule set verbatim, which is what
185
- * rule 4's `--allowedTools`/`--disallowedTools` were always meant to be built
186
- * from — the seam shipped with `rules: d.rules`, and nothing ever set `d.rules`
187
- * in production, so the child was handed our rules by nobody.
188
- *
189
- * An unreadable store answers `undefined` for both, never a guess: "no stored
190
- * posture" must mean "exactly as before", not "confirmations off".
191
- *
192
- * @returns {{confirmationsOn: boolean|undefined, rules: object|undefined, source: string}}
193
- */
194
- function storedPermissionFacts(opts = {}) {
195
- const config = loadConfigStore(opts.config);
196
- if (!config) return { confirmationsOn: undefined, rules: undefined, source: 'unavailable' };
197
- try {
198
- const gate = config.confirmPosture();
199
- let rules;
200
- try {
201
- rules = config.loadPermissions();
202
- } catch {
203
- rules = undefined;
204
- }
205
- return {
206
- confirmationsOn: gate && typeof gate.enabled === 'boolean' ? gate.enabled : undefined,
207
- rules,
208
- source: (gate && gate.source) || 'unavailable',
209
- };
210
- } catch {
211
- return { confirmationsOn: undefined, rules: undefined, source: 'unavailable' };
212
- }
213
- }
214
-
215
- /** The CLI's rule shape, verbatim (D8 rule 1: not a new schema). */
216
- function normalizeRules(rules) {
217
- const r = rules && typeof rules === 'object' ? rules : {};
218
- const list = (v) => (Array.isArray(v) ? v.map(String) : []);
219
- return Object.freeze({
220
- defaultMode: r.defaultMode === 'allow' || r.defaultMode === 'deny' ? r.defaultMode : 'ask',
221
- allow: Object.freeze(list(r.allow)),
222
- deny: Object.freeze(list(r.deny)),
223
- ask: Object.freeze(list(r.ask)),
224
- // Only an explicitly written `defaultMode: 'ask'` prompts on the residual;
225
- // the file-free default must not (cli/src/permissions.js's scope note).
226
- explicitAsk: r.explicitAsk === true || r.defaultMode === 'ask',
227
- });
228
- }
229
-
230
- /**
231
- * Resolve the posture ONCE.
232
- *
233
- * @param {object} [input]
234
- * @param {object} [input.rules] the shared rule set (CLI shape)
235
- * @param {boolean} [input.flag] `--dangerously-skip-permissions` was passed
236
- * @param {object} [input.env] environment (read, never mutated)
237
- * @param {boolean} [input.interactive] both stdio ends are a terminal
238
- * @param {string} [input.childKind] 'headless' | 'interactive'
239
- * @param {boolean} [input.gate] the STORE's confirmation posture:
240
- * `false` means the user already turned
241
- * the gates off (`/automode`, or the
242
- * desktop switch). Resolved by the caller
243
- * (`storedPermissionFacts()`), never read
244
- * from `process.*` here — the standing
245
- * seam rule for `one/`.
246
- * @param {object} [opts]
247
- * @param {object} [opts.evaluator] injectable, for tests only
248
- * @returns frozen decision record
249
- */
250
- function resolvePosture(input = {}, opts = {}) {
251
- const evaluator = loadEvaluator(opts.evaluator);
252
- const rules = normalizeRules(input.rules);
253
- const interactive = input.interactive === true;
254
- const childKind = input.childKind === CHILD_KINDS.INTERACTIVE ? CHILD_KINDS.INTERACTIVE : CHILD_KINDS.HEADLESS;
255
- const skip = evaluator.resolveSkip({ flag: input.flag === true, env: input.env, interactive });
256
- // ── the second, already-resolved answer ──────────────────────────────────
257
- //
258
- // `--dangerously-skip-permissions` is not the only way this product can be
259
- // running with the gates down. Since ON8 there is a stored posture, written
260
- // by `/automode` (alias `/yolo`), by `/confirm`, by `/multiyolo` and by the
261
- // desktop's switch, that the faces read on every tool round. This resolver
262
- // read the flag and the environment and nothing else, so a session whose user
263
- // had already said "stop asking" handed the Claude child NO permission flag:
264
- // headless, the child then asked a question nobody could answer — the hang
265
- // rule 4 exists to prevent — while the terminal face beside it ran ungated.
266
- // Two faces, one posture, one of them still asking is precisely the drift D8
267
- // names, so the stored answer is folded in HERE, at the one place that
268
- // produces the record, and never re-derived downstream.
269
- //
270
- // It cannot reach either floor. `skip` only ever downgrades an `'ask'`
271
- // verdict in `gateFor()`, an explicit `deny` still wins, and the covenant's
272
- // `preActionAssert` plus the avatar's `LEVEL_INDEPENDENT_APPROVALS`
273
- // (`write`/`shell`/`network`/`offDevice`) are the same frozen four as before:
274
- // the store is the *configurable* half of rule 2 by definition — it is what
275
- // the confirmation gate itself reads — so honoring it here widens nothing.
276
- const storedOff = input.gate === false;
277
- const effectiveSkip = skip.skip || storedOff;
278
- const skipSource = skip.skip ? skip.source : storedOff ? 'posture' : skip.source;
279
-
280
- const isInteractiveChild = childKind === CHILD_KINDS.INTERACTIVE;
281
- return Object.freeze({
282
- version: 1,
283
- rules,
284
- interactive,
285
- childKind,
286
- // Rule 5 already applied: `skip` is the product's answer, not the raw env.
287
- skip: effectiveSkip,
288
- skipSource,
289
- // Which of the two produced it. The run-log line and the rule-3 report are
290
- // silent for a stored posture on purpose: the report exists because "a flag
291
- // whose blast radius is invisible is how a footgun ships", and a flag typed
292
- // for one run is that. A posture is a setting the user can see in both
293
- // faces' own UI and turn back, and printing a skip banner on every launch
294
- // of a deliberately-ungated install is noise that teaches scrolling — but
295
- // the child's argv is still recorded by `childRecordLine`, so the decision
296
- // remains accountable.
297
- skipFromFlag: skip.skip,
298
- envVarSet: skip.envSet,
299
- // The store's answer, recorded rather than inferred (three states: true,
300
- // false, and `null` for "there was no stored posture to read").
301
- storedGate: input.gate === undefined || input.gate === null ? null : Boolean(input.gate),
302
- warned: skip.warned,
303
- warning: skip.warning || null,
304
- // What a skip covers, and what it cannot touch. Both are frozen lists so a
305
- // caller cannot widen either one in place.
306
- skipped: Object.freeze(effectiveSkip ? CONFIGURABLE_CLASSES : []),
307
- frozen: FROZEN_CLASSES,
308
- // The child's variant, derived here so no spawn site re-derives it (rule 4).
309
- child: Object.freeze({
310
- kind: childKind,
311
- skip: effectiveSkip,
312
- flag: !effectiveSkip
313
- ? null
314
- : isInteractiveChild
315
- ? '--allow-dangerously-skip-permissions'
316
- : '--dangerously-skip-permissions',
317
- why: !effectiveSkip
318
- ? 'no skip was asked for, so no permission flag is passed to the child'
319
- : isInteractiveChild
320
- ? 'the interactive variant offers the bypass as an option (the child still asks; a human is there)'
321
- : 'the headless variant takes the bypass as a default, because no one can answer the child\'s prompt',
322
- }),
323
- });
324
- }
325
-
326
- /**
327
- * The verdict for one tool call, from the ONE evaluator.
328
- *
329
- * Precedence, and each step is load-bearing:
330
- *
331
- * 1. `'deny'` stays `'deny'` — an explicit deny rule is a rule, not a
332
- * confirmation gate, so a skip must not be able to turn it into an allow.
333
- * 2. `'allow'` stays `'allow'`.
334
- * 3. `'ask'` becomes `'allow'` only when the posture says skip. That is
335
- * exactly "this product's confirmation gates", the configurable half.
336
- *
337
- * The frozen four never reach a different answer through this function: their
338
- * floors are the covenant assert and the avatar caps, which read neither this
339
- * record nor the store.
340
- */
341
- function gateFor(posture, tool, args, opts = {}) {
342
- const evaluator = loadEvaluator(opts.evaluator);
343
- const rules = posture && posture.rules ? posture.rules : normalizeRules({});
344
- const verdict = evaluator.evalPermission(tool, args, rules);
345
- if (verdict === 'deny') return 'deny';
346
- if (verdict === 'allow') return 'allow';
347
- return posture && posture.skip ? 'allow' : 'ask';
348
- }
349
-
350
- /** The one-line "what was skipped" report (D8 rule 3). */
351
- function skipReport(posture) {
352
- if (!posture || !posture.skip) return null;
353
- const childClause = posture.child.flag
354
- ? `; the ${posture.child.kind} Claude child is passed ${posture.child.flag}`
355
- : '';
356
- // Named by its actual source, never as a flag the user did not type: a stored
357
- // posture (`/automode`, the desktop switch) is reported for what it is, since
358
- // printing `--dangerously-skip-permissions` for a setting would be the same
359
- // kind of small lie as eating the flag.
360
- const what =
361
- posture.skipSource === 'posture'
362
- ? 'automode (the stored confirmation posture both faces share)'
363
- : '--dangerously-skip-permissions';
364
- return (
365
- `aegis: ${what} (via ${posture.skipSource}) — skipping the configurable ` +
366
- `confirmation gates (${CONFIGURABLE_CLASSES.join(', ')})${childClause}. NOT skipped, and not ` +
367
- `reachable by any setting, flag or env var: the ÆGIS covenant pre-action assert and the ` +
368
- `${FROZEN_CLASSES.join('|')} approvals (always 'ask'), plus any explicit deny rule.`
369
- );
370
- }
371
-
372
- module.exports = {
373
- CHILD_KINDS,
374
- CONFIGURABLE_CLASSES,
375
- FROZEN_CLASSES,
376
- PERMISSION_MODES,
377
- SKIP_FLAG,
378
- loadEvaluator,
379
- loadConfigStore,
380
- storedPermissionFacts,
381
- normalizeRules,
382
- resolvePosture,
383
- gateFor,
384
- skipReport,
385
- };
3
+ "use strict";const path=require("node:path"),CHILD_KINDS=Object.freeze({HEADLESS:"headless",INTERACTIVE:"interactive"}),CONFIGURABLE_CLASSES=Object.freeze(["exec","writeFile","editFile"]),SKIP_FLAG="--dangerously-skip-permissions",FROZEN_CLASSES=Object.freeze(["write","shell","network","offDevice"]),PERMISSION_MODES=Object.freeze(["acceptEdits","auto","bypassPermissions","manual","dontAsk","plan"]);let cachedEvaluator=null,cachedConfig=null;function loadEvaluator(e){if(e)return e;if(cachedEvaluator)return cachedEvaluator;const o=[path.join(__dirname,"..","..","cli","src","permissions.js"),path.join(__dirname,"..","vendor","cli","src","permissions.js"),path.join(__dirname,"..","..","..","src","permissions.js")];for(const e of o)try{const o=require(e);if(o&&"function"==typeof o.evalPermission&&"function"==typeof o.resolveSkip)return cachedEvaluator=o,o}catch{}throw new Error("aegis: the one rule evaluator (cli/src/permissions.js) is missing from this install — refusing to resolve a permission posture from a second, unshared rule engine.")}function loadConfigStore(e){if(e)return e;if(cachedConfig)return cachedConfig;const o=[path.join(__dirname,"..","..","cli","src","config.js"),path.join(__dirname,"..","vendor","cli","src","config.js"),path.join(__dirname,"..","..","..","src","config.js")];for(const e of o)try{const o=require(e);if(o&&"function"==typeof o.confirmPosture)return cachedConfig=o,o}catch{}return null}function storedPermissionFacts(e={}){const o=loadConfigStore(e.config);if(!o)return{confirmationsOn:void 0,rules:void 0,source:"unavailable"};try{const e=o.confirmPosture();let r;try{r=o.loadPermissions()}catch{r=void 0}return{confirmationsOn:e&&"boolean"==typeof e.enabled?e.enabled:void 0,rules:r,source:e&&e.source||"unavailable"}}catch{return{confirmationsOn:void 0,rules:void 0,source:"unavailable"}}}function normalizeRules(e){const o=e&&"object"==typeof e?e:{},r=e=>Array.isArray(e)?e.map(String):[];return Object.freeze({defaultMode:"allow"===o.defaultMode||"deny"===o.defaultMode?o.defaultMode:"ask",allow:Object.freeze(r(o.allow)),deny:Object.freeze(r(o.deny)),ask:Object.freeze(r(o.ask)),explicitAsk:!0===o.explicitAsk||"ask"===o.defaultMode})}function resolvePosture(e={},o={}){const r=loadEvaluator(o.evaluator),s=normalizeRules(e.rules),i=!0===e.interactive,n=e.childKind===CHILD_KINDS.INTERACTIVE?CHILD_KINDS.INTERACTIVE:CHILD_KINDS.HEADLESS,a=r.resolveSkip({flag:!0===e.flag,env:e.env,interactive:i}),t=!1===e.gate,l=a.skip||t,c=a.skip?a.source:t?"posture":a.source,u=n===CHILD_KINDS.INTERACTIVE;return Object.freeze({version:1,rules:s,interactive:i,childKind:n,skip:l,skipSource:c,skipFromFlag:a.skip,envVarSet:a.envSet,storedGate:void 0===e.gate||null===e.gate?null:Boolean(e.gate),warned:a.warned,warning:a.warning||null,skipped:Object.freeze(l?CONFIGURABLE_CLASSES:[]),frozen:FROZEN_CLASSES,child:Object.freeze({kind:n,skip:l,flag:l?u?"--allow-dangerously-skip-permissions":"--dangerously-skip-permissions":null,why:l?u?"the interactive variant offers the bypass as an option (the child still asks; a human is there)":"the headless variant takes the bypass as a default, because no one can answer the child's prompt":"no skip was asked for, so no permission flag is passed to the child"})})}function gateFor(e,o,r,s={}){const i=loadEvaluator(s.evaluator),n=e&&e.rules?e.rules:normalizeRules({}),a=i.evalPermission(o,r,n);return"deny"===a?"deny":"allow"===a||e&&e.skip?"allow":"ask"}function skipReport(e){if(!e||!e.skip)return null;const o=e.child.flag?`; the ${e.child.kind} Claude child is passed ${e.child.flag}`:"";return`aegis: ${"posture"===e.skipSource?"automode (the stored confirmation posture both faces share)":"--dangerously-skip-permissions"} (via ${e.skipSource}) — skipping the configurable confirmation gates (${CONFIGURABLE_CLASSES.join(", ")})${o}. NOT skipped, and not reachable by any setting, flag or env var: the ÆGIS covenant pre-action assert and the ${FROZEN_CLASSES.join("|")} approvals (always 'ask'), plus any explicit deny rule.`}module.exports={CHILD_KINDS:CHILD_KINDS,CONFIGURABLE_CLASSES:CONFIGURABLE_CLASSES,FROZEN_CLASSES:FROZEN_CLASSES,PERMISSION_MODES:PERMISSION_MODES,SKIP_FLAG:SKIP_FLAG,loadEvaluator:loadEvaluator,loadConfigStore:loadConfigStore,storedPermissionFacts:storedPermissionFacts,normalizeRules:normalizeRules,resolvePosture:resolvePosture,gateFor:gateFor,skipReport:skipReport};