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,325 +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
- * google-connect.js — the desktop's Google identity + Drive flow.
10
- *
11
- * Two distinct steps, run in this order because the second depends on the
12
- * first having actually landed:
13
- *
14
- * 1. Sign in with Google (`client/google-signin.js`'s local round-trip) —
15
- * replaces this machine's saved AEGIS key with the one tied to that
16
- * Google identity, exactly as `aegiscode connect` already does for the
17
- * CLI (cli/src/connect.js). Desktop never had this wiring before this
18
- * file; the only Google sign-in that existed anywhere in this product
19
- * was the CLI's.
20
- * 2. Connect Drive (`client/drive-connect.js`, which opens `/connect/drive`
21
- * in the system browser and polls `/api/drive/token`) — grants the
22
- * `drive.file` scope to WHICHEVER Google identity that browser's
23
- * consent screen uses. That is only the SAME account as step 1 if step
24
- * 1 ran first on this machine: `/connect/drive`'s callback resolves an
25
- * account purely by Google identity, with no notion of "the account
26
- * this machine's API key already belongs to" — so connecting Drive
27
- * before signing in attaches the tokens to a DIFFERENT account than the
28
- * one this machine will poll, and the poll just times out.
29
- *
30
- * "Signed in with Google" is NOT "has an API key". Every install
31
- * auto-provisions an anonymous device key, so a key always exists and an
32
- * `!apiKey` guard never fires. The only honest source for the real
33
- * question is the server's `google_linked` (users.google_id), carried on
34
- * `/api/drive/token` and surfaced as `status().googleLinked` — so
35
- * `connectDrive` refuses on that, and the renderer disables the button
36
- * from the same flag.
37
- *
38
- * Electron-free and fully injected — same shape as `account-key.js` next to
39
- * it — so the whole flow runs under a test with a stub `aegis` client, a
40
- * stub `googleSignIn`/`driveConnect`/`driveUpload`, and no browser, window or
41
- * network.
42
- */
43
-
44
- function createGoogleConnect({
45
- aegis,
46
- credentials,
47
- persistKey,
48
- openUrl,
49
- googleSignIn,
50
- driveConnect,
51
- driveUpload,
52
- conversationExport,
53
- getSession,
54
- getAuthor,
55
- onAccountChange,
56
- }) {
57
- let signInInFlight = null;
58
- let connectInFlight = null;
59
- let lastSyncAt = null;
60
- let lastSyncError = null;
61
- // Did a Google round-trip complete in THIS process? That is first-hand
62
- // evidence of a linked account and does not depend on the server reporting
63
- // it — which older servers do not (see `status`).
64
- let signedInViaGoogle = false;
65
-
66
- /** Sign this machine in with Google, replacing whatever key it had. */
67
- function signInWithGoogle() {
68
- if (!signInInFlight) {
69
- signInInFlight = (async () => {
70
- try {
71
- // Everything from here on (binding the local callback server,
72
- // opening the browser, waiting for the round-trip) can fail, and
73
- // every caller of this module — the IPC handler in main.js chief
74
- // among them — is promised `{ ok, … }`/`{ ok: false, error }`,
75
- // never a rejection. One try covers the whole flow instead of only
76
- // the `session.wait()` half of it.
77
- let session;
78
- try {
79
- session = await googleSignIn.startGoogleSignIn({ apiBase: aegis.apiBase });
80
- } catch (e) {
81
- return { ok: false, error: `could not start the local sign-in server — ${(e && e.message) || e}` };
82
- }
83
- const opened = Boolean(openUrl(session.url));
84
- let result;
85
- try {
86
- result = await session.wait();
87
- } catch (e) {
88
- return { ok: false, opened, url: session.url, error: (e && e.message) || String(e) };
89
- }
90
- // Live client first: the very next call this process makes (e.g.
91
- // the renderer asking for drive status right after this resolves)
92
- // must see the new identity, not whatever key this process started
93
- // with.
94
- aegis.setApiKey(result.apiKey);
95
- persistKey(result.apiKey);
96
- if (result.memoryToken && credentials && typeof credentials.saveMemoryToken === 'function') {
97
- try {
98
- credentials.saveMemoryToken(result.memoryToken);
99
- } catch {
100
- /* best-effort — the account key itself is already saved */
101
- }
102
- }
103
- // Before the notification, which is what makes the renderer re-read
104
- // `status()` — otherwise that refresh races this assignment and
105
- // reports the sign-in as not having happened.
106
- signedInViaGoogle = true;
107
- if (typeof onAccountChange === 'function') onAccountChange();
108
- return { ok: true, opened, url: session.url, username: result.username || null };
109
- } finally {
110
- signInInFlight = null;
111
- }
112
- })();
113
- }
114
- return signInInFlight;
115
- }
116
-
117
- /** Open `/connect/drive` and wait for this account to show connected. */
118
- async function connectDrive() {
119
- if (!aegis.apiKey) {
120
- return {
121
- ok: false,
122
- error: 'sign in with Google first — this device has no AEGIS account key yet',
123
- };
124
- }
125
- if (!connectInFlight) {
126
- connectInFlight = (async () => {
127
- try {
128
- // The key exists but may be an anonymous device key. Ask the server
129
- // whether this account is actually tied to a Google identity before
130
- // opening a consent screen that would attach the tokens elsewhere.
131
- // Inside the in-flight promise so a double click cannot open two
132
- // consent tabs. If the status call fails, fall through: a transport
133
- // blip must not be reported as "not signed in with Google".
134
- let linked = true;
135
- try {
136
- const st = await driveConnect.driveStatus(aegis);
137
- // Refuse only on a definite "not linked". A server that predates
138
- // `google_linked` answers the same shape as an unlinked account,
139
- // and refusing on that would make a real Google sign-in unable to
140
- // ever connect Drive — the exact dead end this guard exists to
141
- // prevent, only inverted.
142
- linked = !(st.googleLinkedKnown && !st.googleLinked);
143
- } catch {
144
- /* unknown — let the flow try rather than misreport the reason */
145
- }
146
- if (!linked) {
147
- return {
148
- ok: false,
149
- error: 'sign in with Google first — this account is not linked to a Google identity yet, '
150
- + 'and connecting Drive now would attach it to a different account',
151
- };
152
- }
153
- const url = driveConnect.driveConnectUrl(aegis.apiBase);
154
- const opened = Boolean(openUrl(url));
155
- try {
156
- const status = await driveConnect.waitForDriveConnected(aegis);
157
- return { ok: true, opened, url, connected: status.connected, email: status.email };
158
- } catch (e) {
159
- return { ok: false, opened, url, error: (e && e.message) || String(e) };
160
- }
161
- } finally {
162
- connectInFlight = null;
163
- }
164
- })();
165
- }
166
- return connectInFlight;
167
- }
168
-
169
- /**
170
- * A one-shot read: signed in with Google, and if so, is Drive connected.
171
- *
172
- * `signedIn` is the server's `google_linked`, not "has an API key" — see
173
- * the header. The old `apiKey ? true` form reported every anonymous
174
- * auto-provisioned device as signed in, which both mislabelled the card
175
- * ("signed in · Drive not connected yet" on a machine that never touched
176
- * Google) and enabled Connect Drive ahead of the sign-in it depends on.
177
- */
178
- async function status() {
179
- if (!aegis.apiKey) {
180
- return { signedIn: false, googleLinked: false, googleLinkedKnown: true, connected: false, email: null };
181
- }
182
- const s = await driveConnect.driveStatus(aegis);
183
- // A completed round-trip outranks a server that cannot answer: without
184
- // this, signing in against a server that predates `google_linked` leaves
185
- // the card reading "not signed in" forever, because the sign-in that just
186
- // succeeded is the one thing the flag was supposed to prove.
187
- const signedIn = s.googleLinked === true || signedInViaGoogle;
188
- return {
189
- signedIn,
190
- ...s,
191
- googleLinked: s.googleLinked === true || signedIn,
192
- googleLinkedKnown: s.googleLinkedKnown || signedIn,
193
- };
194
- }
195
-
196
- /** Pull this account's AEGIS cloud memory and back it up to Drive. */
197
- async function syncMemoryNow() {
198
- try {
199
- const tokenInfo = await aegis.driveToken();
200
- if (!tokenInfo || !tokenInfo.connected || !tokenInfo.access_token) {
201
- throw new Error('Google Drive is not connected yet');
202
- }
203
- const pulled = await aegis.memoryPull(0);
204
- const entries = (pulled && pulled.entries) || [];
205
- const exportedAt = new Date().toISOString();
206
- // The authorship stamp goes on the file itself, not just beside it: this
207
- // export leaves the machine, and a copy in Drive that cannot say whose
208
- // writing it is has to be taken on faith. `memoryMarkdown` is a no-op
209
- // wrapper when there is no export module, so an older wiring still syncs.
210
- const body = JSON.stringify({ exportedAt, entries }, null, 2);
211
- const author = readAuthor();
212
- const content = conversationExport && typeof conversationExport.memoryMarkdown === 'function'
213
- ? conversationExport.memoryMarkdown(body, {
214
- keyFingerprint: author.keyFingerprint,
215
- email: tokenInfo.email || null,
216
- exportedAt,
217
- count: entries.length,
218
- })
219
- : body;
220
- const result = await driveUpload.uploadMemoryBackup(tokenInfo.access_token, content, {
221
- fileName: conversationExport ? 'aegis-memory-backup.md' : undefined,
222
- mimeType: conversationExport ? 'text/markdown' : undefined,
223
- });
224
- lastSyncAt = Date.now();
225
- lastSyncError = null;
226
- return {
227
- ok: true,
228
- count: entries.length,
229
- fileId: result.fileId,
230
- webViewLink: result.webViewLink,
231
- updated: result.updated,
232
- author: authorText(author),
233
- lastSyncAt,
234
- };
235
- } catch (e) {
236
- lastSyncError = (e && e.message) || String(e);
237
- return { ok: false, error: lastSyncError, lastSyncAt };
238
- }
239
- }
240
-
241
- /** What the stamp will say about the key — never the key itself. */
242
- function readAuthor() {
243
- try {
244
- const a = typeof getAuthor === 'function' ? getAuthor() : null;
245
- return { keyFingerprint: (a && a.keyFingerprint) || null };
246
- } catch {
247
- return { keyFingerprint: null };
248
- }
249
- }
250
-
251
- function authorText(author) {
252
- if (!conversationExport || typeof conversationExport.authorLine !== 'function') return null;
253
- return conversationExport.authorLine(author && author.keyFingerprint);
254
- }
255
-
256
- /**
257
- * Save ONE conversation to Drive — the other of the two backups.
258
- *
259
- * Refusals are plain sentences, not exceptions, for the three things a person
260
- * can actually do wrong here: Drive not connected, no conversation open, or an
261
- * open conversation that has not been saved yet (nothing to export).
262
- *
263
- * The file is a NEW `.md` every call, named with its own timestamp — see
264
- * `uploadConversation`'s header for why this scope never overwrites.
265
- */
266
- async function backupConversation({ sessionId } = {}) {
267
- try {
268
- if (!conversationExport || typeof conversationExport.conversationMarkdown !== 'function') {
269
- return { ok: false, error: 'this build cannot export a conversation — the export module is missing' };
270
- }
271
- const tokenInfo = await aegis.driveToken();
272
- if (!tokenInfo || !tokenInfo.connected || !tokenInfo.access_token) {
273
- return { ok: false, error: 'connect Google Drive first — no Drive access token yet' };
274
- }
275
- if (!sessionId) {
276
- return { ok: false, error: 'start a conversation first — there is nothing to save yet' };
277
- }
278
- const session = typeof getSession === 'function' ? getSession(sessionId) : null;
279
- if (!session) {
280
- return { ok: false, error: 'that conversation is not in the session store yet — send one message, then save' };
281
- }
282
- const messages = (session.messages || session.transcript || []);
283
- if (Array.isArray(messages) && messages.length === 0) {
284
- return { ok: false, error: 'that conversation has no messages yet — nothing to save' };
285
- }
286
-
287
- const exportedAt = new Date().toISOString();
288
- const author = readAuthor();
289
- const transcript = typeof conversationExport.toTranscript === 'function'
290
- ? conversationExport.toTranscript(session)
291
- : (session.markdown || '');
292
- const content = conversationExport.conversationMarkdown(session, {
293
- transcript,
294
- keyFingerprint: author.keyFingerprint,
295
- email: tokenInfo.email || null,
296
- exportedAt,
297
- count: Array.isArray(messages) ? messages.length : null,
298
- });
299
- const name = conversationExport.conversationFileName(session, exportedAt);
300
-
301
- const result = await driveUpload.uploadConversation(tokenInfo.access_token, { name, content });
302
- return {
303
- ok: true,
304
- fileId: result.fileId,
305
- webViewLink: result.webViewLink,
306
- file: result.path || name,
307
- title: (session.title || session.id) || null,
308
- author: authorText(author),
309
- };
310
- } catch (e) {
311
- return { ok: false, error: (e && e.message) || String(e) };
312
- }
313
- }
314
-
315
- return {
316
- signInWithGoogle,
317
- connectDrive,
318
- status,
319
- syncMemoryNow,
320
- backupConversation,
321
- state: () => ({ lastSyncAt, lastSyncError }),
322
- };
323
- }
324
-
325
- module.exports = { createGoogleConnect };
3
+ "use strict";function createGoogleConnect({aegis:e,credentials:n,persistKey:t,openUrl:o,googleSignIn:r,driveConnect:i,driveUpload:a,conversationExport:s,getSession:c,getAuthor:l,onAccountChange:u}){let g=null,y=null,d=null,k=null,p=!1;function f(){try{const e="function"==typeof l?l():null;return{keyFingerprint:e&&e.keyFingerprint||null}}catch{return{keyFingerprint:null}}}function m(e){return s&&"function"==typeof s.authorLine?s.authorLine(e&&e.keyFingerprint):null}return{signInWithGoogle:function(){return g||(g=(async()=>{try{let i;try{i=await r.startGoogleSignIn({apiBase:e.apiBase})}catch(e){return{ok:!1,error:`could not start the local sign-in server — ${e&&e.message||e}`}}const a=Boolean(o(i.url));let s;try{s=await i.wait()}catch(e){return{ok:!1,opened:a,url:i.url,error:e&&e.message||String(e)}}if(e.setApiKey(s.apiKey),t(s.apiKey),s.memoryToken&&n&&"function"==typeof n.saveMemoryToken)try{n.saveMemoryToken(s.memoryToken)}catch{}return p=!0,"function"==typeof u&&u(),{ok:!0,opened:a,url:i.url,username:s.username||null}}finally{g=null}})()),g},connectDrive:async function(){return e.apiKey?(y||(y=(async()=>{try{let n=!0;try{const t=await i.driveStatus(e);n=!(t.googleLinkedKnown&&!t.googleLinked)}catch{}if(!n)return{ok:!1,error:"sign in with Google first — this account is not linked to a Google identity yet, and connecting Drive now would attach it to a different account"};const t=i.driveConnectUrl(e.apiBase),r=Boolean(o(t));try{const n=await i.waitForDriveConnected(e);return{ok:!0,opened:r,url:t,connected:n.connected,email:n.email}}catch(e){return{ok:!1,opened:r,url:t,error:e&&e.message||String(e)}}}finally{y=null}})()),y):{ok:!1,error:"sign in with Google first — this device has no AEGIS account key yet"}},status:async function(){if(!e.apiKey)return{signedIn:!1,googleLinked:!1,googleLinkedKnown:!0,connected:!1,email:null};const n=await i.driveStatus(e),t=!0===n.googleLinked||p;return{signedIn:t,...n,googleLinked:!0===n.googleLinked||t,googleLinkedKnown:n.googleLinkedKnown||t}},syncMemoryNow:async function(){try{const n=await e.driveToken();if(!n||!n.connected||!n.access_token)throw new Error("Google Drive is not connected yet");const t=await e.memoryPull(0),o=t&&t.entries||[],r=(new Date).toISOString(),i=JSON.stringify({exportedAt:r,entries:o},null,2),c=f(),l=s&&"function"==typeof s.memoryMarkdown?s.memoryMarkdown(i,{keyFingerprint:c.keyFingerprint,email:n.email||null,exportedAt:r,count:o.length}):i,u=await a.uploadMemoryBackup(n.access_token,l,{fileName:s?"aegis-memory-backup.md":void 0,mimeType:s?"text/markdown":void 0});return d=Date.now(),k=null,{ok:!0,count:o.length,fileId:u.fileId,webViewLink:u.webViewLink,updated:u.updated,author:m(c),lastSyncAt:d}}catch(e){return k=e&&e.message||String(e),{ok:!1,error:k,lastSyncAt:d}}},backupConversation:async function({sessionId:n}={}){try{if(!s||"function"!=typeof s.conversationMarkdown)return{ok:!1,error:"this build cannot export a conversation — the export module is missing"};const t=await e.driveToken();if(!t||!t.connected||!t.access_token)return{ok:!1,error:"connect Google Drive first — no Drive access token yet"};if(!n)return{ok:!1,error:"start a conversation first — there is nothing to save yet"};const o="function"==typeof c?c(n):null;if(!o)return{ok:!1,error:"that conversation is not in the session store yet — send one message, then save"};const r=o.messages||o.transcript||[];if(Array.isArray(r)&&0===r.length)return{ok:!1,error:"that conversation has no messages yet — nothing to save"};const i=(new Date).toISOString(),l=f(),u="function"==typeof s.toTranscript?s.toTranscript(o):o.markdown||"",g=s.conversationMarkdown(o,{transcript:u,keyFingerprint:l.keyFingerprint,email:t.email||null,exportedAt:i,count:Array.isArray(r)?r.length:null}),y=s.conversationFileName(o,i),d=await a.uploadConversation(t.access_token,{name:y,content:g});return{ok:!0,fileId:d.fileId,webViewLink:d.webViewLink,file:d.path||y,title:o.title||o.id||null,author:m(l)}}catch(e){return{ok:!1,error:e&&e.message||String(e)}}},state:()=>({lastSyncAt:d,lastSyncError:k})}}module.exports={createGoogleConnect:createGoogleConnect};
@@ -1,107 +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
- * agents.js — subagent prompt presets for the desktop `task` tool, ported
10
- * from the upstream engine reference (same roles, same synthesis presets).
11
- * A preset is a system prompt: `task` runs it through the normal engine.chat
12
- * loop as a nested turn (its own tool rounds, same model class), not a
13
- * separate runtime, so the presets are pure prompt composition.
14
- *
15
- * Text is adapted to the desktop's own tool vocabulary (readFile/writeFile/
16
- * editFile/listDir/glob/grep/exec/task — see tools.js) so a subagent's
17
- * instructions never name a tool the desktop doesn't actually advertise.
18
- */
19
-
20
- /** Role → system prompt. */
21
- const AGENT_PRESETS = {
22
- synthesizer: `You are a senior technical lead. Given analysis from multiple specialist agents, synthesize their findings into a clear, actionable summary.
23
- Structure your response as: key findings, recommended approach, top action items.
24
- Be direct, concrete, and avoid repeating everything the agents said.
25
- Focus on delivering a decision-ready synthesis.`,
26
-
27
- architect: `You are a System Architect. Design the new application architecture.
28
- Define: project structure, tech stack, directory layout, key modules, data flow, API design.
29
- Consider: scalability, maintainability, testing strategy, deployment.
30
- Output a concrete file tree and architecture decisions log. Be specific.`,
31
-
32
- scaffolder: `You are a Project Scaffolder. Build the complete application from scratch.
33
-
34
- YOUR JOB IS TO CREATE ALL PROJECT FILES - not just describe them.
35
-
36
- Use writeFile to create: package.json, tsconfig.json, source files, configs, tests.
37
- Generate COMPLETE, WORKING code - not stubs or placeholders.
38
- Set up build scripts, lint config, and any necessary tooling.
39
-
40
- After creating files, use exec to run: npm/pnpm install, then build/compile.
41
- Fix any errors until the project builds successfully.
42
-
43
- Be thorough - a real, runnable project is the goal.`,
44
-
45
- planner: `You are a Refactoring Planner. Given the analyzer findings, create a step-by-step plan.
46
- Each step: file path, what to change, why, risk level (LOW/MEDIUM/HIGH).
47
- Include before/after snippets. Order by impact. Be concrete.`,
48
-
49
- implementer: `You are an Implementation Engineer. Execute the refactoring plan.
50
- Use editFile and writeFile to make actual code changes.
51
- After each change, use readFile to verify correctness. Keep existing code style.
52
- Run build commands with exec to ensure nothing is broken.`,
53
-
54
- reviewer: `You are a Code Reviewer. Review the approach and code.
55
- Check: logic errors, type safety, error handling, performance, security.
56
- Be critical but constructive. Report specific issues with file paths.`,
57
-
58
- debugger: `You are a Debugging Specialist. Analyze potential issues and edge cases.
59
- Identify: failure modes, error handling gaps, testing considerations.
60
- Think about what could go wrong and how to prevent it.`,
61
-
62
- scanner: `You are a Security Vulnerability Scanner.
63
- Scan for: hardcoded API keys/secrets, SQL injection, XSS, unsafe eval/exec, path traversal.
64
- Use grep with targeted patterns. Report every finding with: file path, severity (CRITICAL/HIGH/MEDIUM/LOW), line number.`,
65
-
66
- analyzer: `You are a Code Analyzer. Find refactoring opportunities.
67
- Look for: duplicated code, long functions (>20 lines), complex conditionals, unused imports,
68
- circular dependencies, inconsistent patterns. Report with file paths and line numbers.`,
69
- };
70
-
71
- /** System prompt for a `general` (or unrecognized) subagent type. */
72
- const GENERAL_AGENT_PROMPT =
73
- 'You are a capable autonomous coding subagent. Complete the assigned task end to end using ' +
74
- 'the available tools (exec, readFile, writeFile, editFile, listDir, glob, grep). Work in the ' +
75
- 'current repository, verify your work, and finish with a concise report of what you did and ' +
76
- 'what you found. You cannot ask follow-up questions — make reasonable assumptions and proceed. ' +
77
- 'When a large sub-task is better handled by a focused specialist, delegate it with the task tool.';
78
-
79
- /** Human-readable role label for a preset id (falls back to the id). */
80
- function agentRoleLabel(role) {
81
- const labels = {
82
- synthesizer: 'Technical Lead', architect: 'System Architect',
83
- scaffolder: 'Project Scaffolder', planner: 'Refactoring Planner',
84
- implementer: 'Implementation Engineer', reviewer: 'Code Reviewer',
85
- debugger: 'Debugging Specialist', scanner: 'Vulnerability Scanner',
86
- analyzer: 'Code Analyzer', general: 'General',
87
- };
88
- return labels[role] || role;
89
- }
90
-
91
- /** Every preset id, in palette order (excludes the 'general' fallback). */
92
- function agentRoles() {
93
- return Object.keys(AGENT_PRESETS);
94
- }
95
-
96
- /** Resolve a subagent_type to its system prompt (unknown/absent → general). */
97
- function agentSystemPrompt(role) {
98
- return AGENT_PRESETS[role] || GENERAL_AGENT_PROMPT;
99
- }
100
-
101
- module.exports = {
102
- AGENT_PRESETS,
103
- GENERAL_AGENT_PROMPT,
104
- agentRoleLabel,
105
- agentRoles,
106
- agentSystemPrompt,
107
- };
3
+ "use strict";const AGENT_PRESETS={synthesizer:"You are a senior technical lead. Given analysis from multiple specialist agents, synthesize their findings into a clear, actionable summary.\nStructure your response as: key findings, recommended approach, top action items.\nBe direct, concrete, and avoid repeating everything the agents said.\nFocus on delivering a decision-ready synthesis.",architect:"You are a System Architect. Design the new application architecture.\nDefine: project structure, tech stack, directory layout, key modules, data flow, API design.\nConsider: scalability, maintainability, testing strategy, deployment.\nOutput a concrete file tree and architecture decisions log. Be specific.",scaffolder:"You are a Project Scaffolder. Build the complete application from scratch.\n\nYOUR JOB IS TO CREATE ALL PROJECT FILES - not just describe them.\n\nUse writeFile to create: package.json, tsconfig.json, source files, configs, tests.\nGenerate COMPLETE, WORKING code - not stubs or placeholders.\nSet up build scripts, lint config, and any necessary tooling.\n\nAfter creating files, use exec to run: npm/pnpm install, then build/compile.\nFix any errors until the project builds successfully.\n\nBe thorough - a real, runnable project is the goal.",planner:"You are a Refactoring Planner. Given the analyzer findings, create a step-by-step plan.\nEach step: file path, what to change, why, risk level (LOW/MEDIUM/HIGH).\nInclude before/after snippets. Order by impact. Be concrete.",implementer:"You are an Implementation Engineer. Execute the refactoring plan.\nUse editFile and writeFile to make actual code changes.\nAfter each change, use readFile to verify correctness. Keep existing code style.\nRun build commands with exec to ensure nothing is broken.",reviewer:"You are a Code Reviewer. Review the approach and code.\nCheck: logic errors, type safety, error handling, performance, security.\nBe critical but constructive. Report specific issues with file paths.",debugger:"You are a Debugging Specialist. Analyze potential issues and edge cases.\nIdentify: failure modes, error handling gaps, testing considerations.\nThink about what could go wrong and how to prevent it.",scanner:"You are a Security Vulnerability Scanner.\nScan for: hardcoded API keys/secrets, SQL injection, XSS, unsafe eval/exec, path traversal.\nUse grep with targeted patterns. Report every finding with: file path, severity (CRITICAL/HIGH/MEDIUM/LOW), line number.",analyzer:"You are a Code Analyzer. Find refactoring opportunities.\nLook for: duplicated code, long functions (>20 lines), complex conditionals, unused imports,\ncircular dependencies, inconsistent patterns. Report with file paths and line numbers."},GENERAL_AGENT_PROMPT="You are a capable autonomous coding subagent. Complete the assigned task end to end using the available tools (exec, readFile, writeFile, editFile, listDir, glob, grep). Work in the current repository, verify your work, and finish with a concise report of what you did and what you found. You cannot ask follow-up questions — make reasonable assumptions and proceed. When a large sub-task is better handled by a focused specialist, delegate it with the task tool.";function agentRoleLabel(e){return{synthesizer:"Technical Lead",architect:"System Architect",scaffolder:"Project Scaffolder",planner:"Refactoring Planner",implementer:"Implementation Engineer",reviewer:"Code Reviewer",debugger:"Debugging Specialist",scanner:"Vulnerability Scanner",analyzer:"Code Analyzer",general:"General"}[e]||e}function agentRoles(){return Object.keys(AGENT_PRESETS)}function agentSystemPrompt(e){return AGENT_PRESETS[e]||GENERAL_AGENT_PROMPT}module.exports={AGENT_PRESETS:AGENT_PRESETS,GENERAL_AGENT_PROMPT:GENERAL_AGENT_PROMPT,agentRoleLabel:agentRoleLabel,agentRoles:agentRoles,agentSystemPrompt:agentSystemPrompt};