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,208 +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
- * hud.js — the level HUD: XP bar, next unlock, and the honest held state.
10
- *
11
- * The HUD is a *renderer*: it draws a projection main handed it and derives
12
- * nothing. That is not a stylistic preference — §1.5 of the plan says a level is
13
- * written by main because "a renderer-held counter is a suggestion, not a fact",
14
- * so `hudModel` has no branch that turns XP into a level. It reads `level`,
15
- * `progress`, `tier` and `held` off the projection, and when there is no
16
- * projection it says exactly that:
17
- *
18
- * known: false, percent: null, readout: "level unknown — …"
19
- *
20
- * The tempting alternative — treat a missing projection as `level 1, 0 XP` —
21
- * would be a fabricated number on a screen about the user's own progress, and on
22
- * a real install (main landed, level 12) it would be a lie, not a default. The
23
- * unknown state costs a line of text and cannot be wrong.
24
- *
25
- * The three honesty rules the tests hold it to:
26
- *
27
- * 1. **Unknown is not zero.** No projection ⇒ no percentage, no bar fill, and
28
- * a readout that says so.
29
- * 2. **Held is labelled.** §1.4: a level never silently regresses while the
30
- * user watches. When `projection.held` is set the HUD says
31
- * `level held · reshuffling` and marks the bar, and the next-unlock line
32
- * says it is waiting for the ledger to settle — because unlocks follow the
33
- * *settled* level, and claiming a unlock the ledger does not support is the
34
- * same class of lie as a level that ticks down unannounced.
35
- * 3. **Every number has a text twin.** The SVG is `aria-hidden`, so the
36
- * readout below it must carry the whole state as a sentence.
37
- *
38
- * Pure (a model) plus one small DOM writer. No timers, no storage.
39
- */
40
-
41
- const pkg = typeof window !== 'undefined' && window.AegisAvatarParts
42
- ? {
43
- parts: window.AegisAvatarParts,
44
- level: window.AegisAvatarLevel || null,
45
- }
46
- : typeof module !== 'undefined' && module.exports
47
- ? {
48
- parts: require('./parts.js'),
49
- level: require('../../lib/avatar/level.js'),
50
- }
51
- : { parts: null, level: null };
52
-
53
- if (!pkg.parts) throw new Error('avatar/hud.js: avatar/parts.js must be loaded first');
54
-
55
- function num(v, fallback) {
56
- return typeof v === 'number' && Number.isFinite(v) ? v : fallback;
57
- }
58
-
59
- /** `Headphones`, `Seasonal set · pack` — a paid cosmetic says so on the tin. */
60
- function unlockText(unlock) {
61
- return unlock.unlocks
62
- .map((u) => (u.paid ? `${u.label} · pack` : u.label))
63
- .join(', ');
64
- }
65
-
66
- /**
67
- * Build the view model.
68
- *
69
- * @param {object} input
70
- * @param {object} [input.persona] validated persona (for the name)
71
- * @param {object} [input.projection] `xp.evaluate()` output, as main reports it
72
- * @param {object} [input.capabilities] `level.capabilities()` output, for the
73
- * cosmetics gate (which packs the pane may offer)
74
- * @param {string} [input.expression] current expression id
75
- * @param {string} [input.expressionLabel] its human label
76
- * @param {string} [input.reason] why there is no projection, shown verbatim
77
- */
78
- function hudModel(input = {}) {
79
- const persona = input.persona && typeof input.persona === 'object' ? input.persona : pkg.parts.defaultPersona();
80
- const name = (persona.identity && persona.identity.name) || 'Aegis';
81
- const projection = input.projection && typeof input.projection === 'object' ? input.projection : null;
82
- const levelNo = projection ? num(projection.level, null) : null;
83
- const known = levelNo !== null;
84
-
85
- const expressionLabel = String(input.expressionLabel || input.expression || 'neutral');
86
- const expressionNote = `expression: ${expressionLabel}`;
87
-
88
- if (!known) {
89
- const reason = String(input.reason || 'main has not published a level yet');
90
- return {
91
- known: false,
92
- name,
93
- level: null,
94
- tier: null,
95
- xpIntoLevel: null,
96
- xpForNext: null,
97
- percent: null,
98
- held: false,
99
- heldNote: '',
100
- nextUnlock: null,
101
- nextUnlockText: '',
102
- unlockNote: '',
103
- expression: input.expression || 'neutral',
104
- expressionLabel,
105
- readout: `${name} · level unknown — ${reason} · ${expressionNote}`,
106
- ariaLive: 'polite',
107
- };
108
- }
109
-
110
- const held = projection.held === true;
111
- const settled = num(projection.settledLevel, levelNo);
112
- const tier = projection.tier || call(() => pkg.level.tierFor(levelNo).name, null) || null;
113
- const xpIntoLevel = num(projection.xpIntoLevel, null);
114
- const xpForNext = num(projection.xpForNext, null);
115
- // The bar shows the projection's own progress — never a number this file
116
- // computed. Clamped only so a malformed projection cannot draw outside the
117
- // track; the held case is labelled in the readout instead of fudged here.
118
- const percent = Math.round(Math.min(1, Math.max(0, num(projection.progress, 0))) * 100);
119
-
120
- // Unlocks follow the settled level, never the held one.
121
- const unlockLevel = held ? settled : levelNo;
122
- let next = null;
123
- try {
124
- next = pkg.level ? pkg.level.nextUnlock(unlockLevel) : null;
125
- } catch {
126
- next = null;
127
- }
128
- const nextUnlockText = next ? `next at level ${next.level}: ${unlockText(next)}` : 'every unlock is yours';
129
-
130
- const parts = [];
131
- parts.push(`${name} · level ${levelNo}`);
132
- if (tier) parts.push(tier);
133
- if (held) parts.push('level held · reshuffling');
134
- if (!held && xpForNext !== null && xpIntoLevel !== null) {
135
- parts.push(`${xpIntoLevel} / ${xpForNext} XP to level ${levelNo + 1}`);
136
- }
137
- parts.push(nextUnlockText);
138
- parts.push(expressionNote);
139
-
140
- return {
141
- known: true,
142
- name,
143
- level: levelNo,
144
- tier,
145
- xpIntoLevel,
146
- xpForNext,
147
- percent,
148
- held,
149
- heldNote: held ? 'level held · reshuffling' : '',
150
- nextUnlock: next,
151
- nextUnlockText,
152
- // The held state makes the unlock line provisional; say so where it is read.
153
- unlockNote: held ? `held — applies after the ledger settles (level ${settled})` : '',
154
- expression: input.expression || 'neutral',
155
- expressionLabel,
156
- readout: parts.join(' · '),
157
- ariaLive: 'polite',
158
- cosmetics: input.capabilities && Array.isArray(input.capabilities.cosmeticsUnlocked)
159
- ? input.capabilities.cosmeticsUnlocked.slice()
160
- : null,
161
- };
162
- }
163
-
164
- function call(fn, fallback) {
165
- try {
166
- return fn();
167
- } catch {
168
- return fallback;
169
- }
170
- }
171
-
172
- /** Write a model into DOM handles. Missing handles are skipped, never thrown on. */
173
- function renderHud(els, model) {
174
- const e = els || {};
175
- const set = (node, value) => {
176
- if (node && typeof value === 'string') node.textContent = value;
177
- };
178
- const width = model.percent === null ? '' : `${model.percent}%`;
179
- if (e.root) {
180
- e.root.setAttribute('data-known', model.known ? 'true' : 'false');
181
- e.root.setAttribute('data-held', model.held ? 'true' : 'false');
182
- }
183
- set(e.level, model.known ? `L${model.level}` : 'L—');
184
- set(e.tier, model.tier || '—');
185
- set(e.readout, model.readout);
186
- set(e.nextUnlock, model.nextUnlockText);
187
- set(e.unlockNote, model.unlockNote);
188
- set(e.expression, model.expressionLabel);
189
- if (e.fill) {
190
- e.fill.style.width = width;
191
- if (e.fill.setAttribute) e.fill.setAttribute('data-held', model.held ? 'true' : 'false');
192
- }
193
- if (e.bar) {
194
- // The bar is decorative: its text twin is the readout, so it is hidden from
195
- // assistive tech rather than announced twice with different words.
196
- e.bar.setAttribute('aria-hidden', 'true');
197
- }
198
- if (e.heldBadge) {
199
- e.heldBadge.textContent = model.heldNote;
200
- e.heldBadge.hidden = !model.held;
201
- }
202
- return model;
203
- }
204
-
205
- const API = Object.freeze({ hudModel, renderHud, unlockText });
206
-
207
- if (typeof module !== 'undefined' && module.exports) module.exports = API;
208
- else if (typeof globalThis !== 'undefined') globalThis.AegisAvatarHud = API;
3
+ "use strict";const pkg="undefined"!=typeof window&&window.AegisAvatarParts?{parts:window.AegisAvatarParts,level:window.AegisAvatarLevel||null}:"undefined"!=typeof module&&module.exports?{parts:require("./parts.js"),level:require("../../lib/avatar/level.js")}:{parts:null,level:null};if(!pkg.parts)throw new Error("avatar/hud.js: avatar/parts.js must be loaded first");function num(e,l){return"number"==typeof e&&Number.isFinite(e)?e:l}function unlockText(e){return e.unlocks.map((e=>e.paid?`${e.label} · pack`:e.label)).join(", ")}function hudModel(e={}){const l=e.persona&&"object"==typeof e.persona?e.persona:pkg.parts.defaultPersona(),t=l.identity&&l.identity.name||"Aegis",n=e.projection&&"object"==typeof e.projection?e.projection:null,o=n?num(n.level,null):null,r=null!==o,u=String(e.expressionLabel||e.expression||"neutral"),s=`expression: ${u}`;if(!r){const l=String(e.reason||"main has not published a level yet");return{known:!1,name:t,level:null,tier:null,xpIntoLevel:null,xpForNext:null,percent:null,held:!1,heldNote:"",nextUnlock:null,nextUnlockText:"",unlockNote:"",expression:e.expression||"neutral",expressionLabel:u,readout:`${t} · level unknown — ${l} · ${s}`,ariaLive:"polite"}}const i=!0===n.held,a=num(n.settledLevel,o),d=n.tier||call((()=>pkg.level.tierFor(o).name),null)||null,p=num(n.xpIntoLevel,null),c=num(n.xpForNext,null),h=Math.round(100*Math.min(1,Math.max(0,num(n.progress,0)))),x=i?a:o;let v=null;try{v=pkg.level?pkg.level.nextUnlock(x):null}catch{v=null}const f=v?`next at level ${v.level}: ${unlockText(v)}`:"every unlock is yours",k=[];return k.push(`${t} · level ${o}`),d&&k.push(d),i&&k.push("level held · reshuffling"),i||null===c||null===p||k.push(`${p} / ${c} XP to level ${o+1}`),k.push(f),k.push(s),{known:!0,name:t,level:o,tier:d,xpIntoLevel:p,xpForNext:c,percent:h,held:i,heldNote:i?"level held · reshuffling":"",nextUnlock:v,nextUnlockText:f,unlockNote:i?`held — applies after the ledger settles (level ${a})`:"",expression:e.expression||"neutral",expressionLabel:u,readout:k.join(" · "),ariaLive:"polite",cosmetics:e.capabilities&&Array.isArray(e.capabilities.cosmeticsUnlocked)?e.capabilities.cosmeticsUnlocked.slice():null}}function call(e,l){try{return e()}catch{return l}}function renderHud(e,l){const t=e||{},n=(e,l)=>{e&&"string"==typeof l&&(e.textContent=l)},o=null===l.percent?"":`${l.percent}%`;return t.root&&(t.root.setAttribute("data-known",l.known?"true":"false"),t.root.setAttribute("data-held",l.held?"true":"false")),n(t.level,l.known?`L${l.level}`:"L—"),n(t.tier,l.tier||"—"),n(t.readout,l.readout),n(t.nextUnlock,l.nextUnlockText),n(t.unlockNote,l.unlockNote),n(t.expression,l.expressionLabel),t.fill&&(t.fill.style.width=o,t.fill.setAttribute&&t.fill.setAttribute("data-held",l.held?"true":"false")),t.bar&&t.bar.setAttribute("aria-hidden","true"),t.heldBadge&&(t.heldBadge.textContent=l.heldNote,t.heldBadge.hidden=!l.held),l}const API=Object.freeze({hudModel:hudModel,renderHud:renderHud,unlockText:unlockText});"undefined"!=typeof module&&module.exports?module.exports=API:"undefined"!=typeof globalThis&&(globalThis.AegisAvatarHud=API);
@@ -1,215 +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
- * machine.js — the avatar's face, driven by the engine's real signals.
10
- *
11
- * The state machine itself is NOT re-implemented here. `lib/avatar/events.js`
12
- * is a pure module with no timers and no DOM, and index.html loads that same
13
- * file into the renderer (its UMD tail publishes `AegisAvatarEvents`), so the
14
- * face follows the *exact* table the engine's events are described by — not a
15
- * copy of it that can drift. What this file adds is the only thing the pure
16
- * module deliberately refuses to know: which real renderer event in this app
17
- * means which signal.
18
- *
19
- * The mapping is the interesting part, and it is one table, testable in
20
- * isolation:
21
- *
22
- * send / setBusy(true) → turn.start
23
- * a streamed delta → turn.stream
24
- * setBusy(false) → turn.end {green}
25
- * a tool frame → tool.read | tool.write | tool.run (by NAME)
26
- * the approval card → approval.card / approval.decided
27
- * queue progress → queue.progress
28
- * connection state → sync.error / sync.ok
29
- * typing in the composer → poke
30
- *
31
- * `signalForTool` is deliberately conservative: a tool this table has never
32
- * heard of (a new tool, a commissioned pack, an MCP server's verb) reads as
33
- * `tool.run` — "the agent is doing something" — rather than being mapped to
34
- * `reading`, which would understate what is happening on the user's machine.
35
- * Understating activity on the face of the thing doing it is the wrong way to
36
- * be wrong.
37
- *
38
- * Nothing here throws on an unknown signal: `events.js` made unknown signals
39
- * no-ops precisely so that tomorrow's feature cannot crash the avatar, and the
40
- * wrapper below preserves that.
41
- */
42
-
43
- 'use strict';
44
-
45
- const pkg = typeof window !== 'undefined' && window.AegisAvatarEvents
46
- ? { events: window.AegisAvatarEvents, parts: window.AegisAvatarParts || null }
47
- : typeof module !== 'undefined' && module.exports
48
- ? { events: require('../../lib/avatar/events.js'), parts: require('./parts.js') }
49
- : { events: null, parts: null };
50
-
51
- if (!pkg.events) throw new Error('avatar/machine.js: lib/avatar/events.js must be loaded first');
52
-
53
- /** Tool names → the signal the face shows. Order matters: first match wins. */
54
- const TOOL_SIGNALS = Object.freeze([
55
- Object.freeze({
56
- signal: 'tool.write',
57
- re: /^(write|edit|apply|patch|create|mkdir|append|save|delete|remove|move|rename|memorysave|memory_save)/i,
58
- }),
59
- Object.freeze({
60
- signal: 'tool.read',
61
- re: /^(read|open|list|ls|glob|grep|search|find|cat|stat|memorysearch|memory_search|memorylist|recall)/i,
62
- }),
63
- Object.freeze({
64
- signal: 'tool.run',
65
- re: /^(run|shell|bash|exec|spawn|test|build|npm|node|python|fetch|http|curl|websearch|browser)/i,
66
- }),
67
- ]);
68
-
69
- /** The tool name a frame is about, whichever shape the frame arrived in. */
70
- function toolName(tool) {
71
- if (!tool) return '';
72
- if (typeof tool === 'string') return tool;
73
- return String(tool.name || tool.tool || tool.id || '');
74
- }
75
-
76
- /**
77
- * Which signal a tool call is worth. Unknown verbs are `tool.run` — see header.
78
- * A read frame is the ONLY thing that may say "reading".
79
- */
80
- function signalForTool(tool) {
81
- const name = toolName(tool);
82
- for (const row of TOOL_SIGNALS) if (row.re.test(name)) return row.signal;
83
- return 'tool.run';
84
- }
85
-
86
- /**
87
- * Wrap the shared machine with the app's vocabulary.
88
- *
89
- * @param {object} [opts]
90
- * @param {object} [opts.machine] an `events.createMachine()` instance (tests inject one)
91
- * @param {number} [opts.idleTimeoutMs] silence before `dozing`
92
- * @param {function} [opts.onChange] called with `{ state, expression, label, signal }`
93
- */
94
- function createAvatarSignals(opts = {}) {
95
- const machine = opts.machine || pkg.events.createMachine({
96
- state: opts.state,
97
- now: opts.now,
98
- idleTimeoutMs: opts.idleTimeoutMs,
99
- });
100
- const listeners = new Set();
101
- let lastSent = null;
102
-
103
- function labelFor(expression) {
104
- const table = pkg.parts && pkg.parts.EXPRESSIONS;
105
- return (table && table[expression] && table[expression].label) || expression;
106
- }
107
-
108
- function announce(signal) {
109
- const payload = {
110
- state: machine.state,
111
- expression: machine.expression,
112
- label: labelFor(machine.expression),
113
- signal: signal == null ? null : String(signal),
114
- };
115
- for (const fn of listeners) {
116
- try {
117
- fn(payload);
118
- } catch {
119
- // A listener that throws must not take the turn with it: app.js calls
120
- // this from the chat delta path.
121
- }
122
- }
123
- return payload;
124
- }
125
-
126
- function send(signal, meta) {
127
- lastSent = String(signal);
128
- machine.send(signal, meta);
129
- return announce(signal);
130
- }
131
-
132
- const api = {
133
- machine,
134
- get state() {
135
- return machine.state;
136
- },
137
- get expression() {
138
- return machine.expression;
139
- },
140
- get label() {
141
- return labelFor(machine.expression);
142
- },
143
- get lastSignal() {
144
- return lastSent;
145
- },
146
- signal: send,
147
- /** turn.start / turn.stream / turn.end — the chat path, in order. */
148
- turnStart(meta) {
149
- return send('turn.start', meta);
150
- },
151
- stream() {
152
- return send('turn.stream');
153
- },
154
- turnEnd(meta) {
155
- return send('turn.end', meta);
156
- },
157
- /** A tool frame: the signal is picked from the tool's name. */
158
- tool(tool) {
159
- return send(signalForTool(tool), { tool: toolName(tool) });
160
- },
161
- approvalCard() {
162
- return send('approval.card');
163
- },
164
- approvalDecided() {
165
- return send('approval.decided');
166
- },
167
- /** Queue progress frames; the machine treats them as activity. */
168
- queue() {
169
- return send('queue.progress');
170
- },
171
- syncOk() {
172
- return send('sync.ok');
173
- },
174
- syncError(meta) {
175
- return send('sync.error', meta);
176
- },
177
- poke() {
178
- return send('poke');
179
- },
180
- celebrateDone() {
181
- return send('celebrate.done');
182
- },
183
- reset() {
184
- return send('reset');
185
- },
186
- /** The caller owns the clock — see events.js's "NO TIMERS INSIDE". */
187
- tick(now) {
188
- const out = machine.tick(now);
189
- if (out.changed) announce('idle.timeout');
190
- return out;
191
- },
192
- on(fn) {
193
- listeners.add(fn);
194
- return () => listeners.delete(fn);
195
- },
196
- off(fn) {
197
- return listeners.delete(fn);
198
- },
199
- };
200
- return api;
201
- }
202
-
203
- const API = Object.freeze({
204
- createAvatarSignals,
205
- signalForTool,
206
- toolName,
207
- TOOL_SIGNALS,
208
- STATES: pkg.events.STATES,
209
- SIGNALS: pkg.events.SIGNALS,
210
- EXPRESSIONS: pkg.events.EXPRESSIONS,
211
- expressionFor: pkg.events.expressionFor,
212
- });
213
-
214
- if (typeof module !== 'undefined' && module.exports) module.exports = API;
215
- else if (typeof globalThis !== 'undefined') globalThis.AegisAvatarMachine = API;
3
+ "use strict";const pkg="undefined"!=typeof window&&window.AegisAvatarEvents?{events:window.AegisAvatarEvents,parts:window.AegisAvatarParts||null}:"undefined"!=typeof module&&module.exports?{events:require("../../lib/avatar/events.js"),parts:require("./parts.js")}:{events:null,parts:null};if(!pkg.events)throw new Error("avatar/machine.js: lib/avatar/events.js must be loaded first");const TOOL_SIGNALS=Object.freeze([Object.freeze({signal:"tool.write",re:/^(write|edit|apply|patch|create|mkdir|append|save|delete|remove|move|rename|memorysave|memory_save)/i}),Object.freeze({signal:"tool.read",re:/^(read|open|list|ls|glob|grep|search|find|cat|stat|memorysearch|memory_search|memorylist|recall)/i}),Object.freeze({signal:"tool.run",re:/^(run|shell|bash|exec|spawn|test|build|npm|node|python|fetch|http|curl|websearch|browser)/i})]);function toolName(e){return e?"string"==typeof e?e:String(e.name||e.tool||e.id||""):""}function signalForTool(e){const t=toolName(e);for(const e of TOOL_SIGNALS)if(e.re.test(t))return e.signal;return"tool.run"}function createAvatarSignals(e={}){const t=e.machine||pkg.events.createMachine({state:e.state,now:e.now,idleTimeoutMs:e.idleTimeoutMs}),r=new Set;let n=null;function o(e){const t=pkg.parts&&pkg.parts.EXPRESSIONS;return t&&t[e]&&t[e].label||e}function s(e){const n={state:t.state,expression:t.expression,label:o(t.expression),signal:null==e?null:String(e)};for(const e of r)try{e(n)}catch{}return n}function a(e,r){return n=String(e),t.send(e,r),s(e)}return{machine:t,get state(){return t.state},get expression(){return t.expression},get label(){return o(t.expression)},get lastSignal(){return n},signal:a,turnStart:e=>a("turn.start",e),stream:()=>a("turn.stream"),turnEnd:e=>a("turn.end",e),tool:e=>a(signalForTool(e),{tool:toolName(e)}),approvalCard:()=>a("approval.card"),approvalDecided:()=>a("approval.decided"),queue:()=>a("queue.progress"),syncOk:()=>a("sync.ok"),syncError:e=>a("sync.error",e),poke:()=>a("poke"),celebrateDone:()=>a("celebrate.done"),reset:()=>a("reset"),tick(e){const r=t.tick(e);return r.changed&&s("idle.timeout"),r},on:e=>(r.add(e),()=>r.delete(e)),off:e=>r.delete(e)}}const API=Object.freeze({createAvatarSignals:createAvatarSignals,signalForTool:signalForTool,toolName:toolName,TOOL_SIGNALS:TOOL_SIGNALS,STATES:pkg.events.STATES,SIGNALS:pkg.events.SIGNALS,EXPRESSIONS:pkg.events.EXPRESSIONS,expressionFor:pkg.events.expressionFor});"undefined"!=typeof module&&module.exports?module.exports=API:"undefined"!=typeof globalThis&&(globalThis.AegisAvatarMachine=API);