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,330 +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
- * voice.js — the companion's voice: present, optional, local, and OFF.
10
- *
11
- * Four rules, in the order they matter.
12
- *
13
- * 1. **OFF BY DEFAULT, AND THE DEFAULT IS THE PERSONA'S, NOT THIS FILE'S.**
14
- * `persona.js` ships `voice: { enabled: false, engine: 'none', id: null }`.
15
- * `resolveVoice()` therefore needs an explicit `enabled: true` in the
16
- * persona to say anything at all, and `AEGIS_VOICE` can only ever *lower*
17
- * that — an env var may select an engine or force voice off for
18
- * automation/CI, but it can never be the thing that starts speaking in a
19
- * user's room. (Compare level.js's env overrides, which are allowed to widen
20
- * recall: recall is a knob, audio output is not.)
21
- *
22
- * 2. **NEVER A CLONE OF A REAL PERSON.** Spec §6 non-goal, verbatim: "no voice
23
- * cloning of real people; voice ships only as licensed/local models".
24
- * `assertNotClone()` refuses any voice id that reads like a person — a
25
- * name-shaped id, a `voiceprint`, a recording — and there is no code path
26
- * here that takes an audio sample as input, because the way to guarantee no
27
- * cloning is to have nowhere to put the sample. `persona.js` already refuses
28
- * clone-ish ids at the storage boundary; this is the speech path's own check,
29
- * for a persona that arrived some other way (import, sync, hand-edit while
30
- * the app runs).
31
- *
32
- * 3. **LOCAL, AND ONLY LOCAL.** Every engine in `ENGINES` is an installed local
33
- * binary driven with `shell: false`, and `speakPlan()` returns a plan whose
34
- * text is delivered on argv or stdin — never fetched, never uploaded. The
35
- * test asserts the serialized plan contains no URL and no network flag, so
36
- * "voice never leaves the device" is a property of the artifact the host
37
- * executes rather than a claim in a doc.
38
- *
39
- * 4. **IT IS NOT A SHELL TOOL.** Speaking spawns an allowlisted binary with
40
- * arguments built here from a fixed template; the user's text is the only
41
- * variable, and it arrives as one argv entry (or on stdin). Nothing in this
42
- * file can run a second command, expand a glob, or reach a path the user
43
- * named — which is what keeps voice out of the `shell: ask` blast radius
44
- * while the approval carve-outs stay exactly as level.js froze them.
45
- *
46
- * Pure: `resolveVoice`/`spokenText`/`speakPlan` take injected inputs; only
47
- * `detectEngine()` touches the process (and takes its probe injected in tests).
48
- */
49
-
50
- /** `none` is the shipped default and means "no audio, ever". */
51
- const ENGINES = Object.freeze(['none', 'local', 'system']);
52
-
53
- /**
54
- * The bundled synthetic voices. Deliberately ROLE names, not people: a pack, a
55
- * doc page and a test can all point at `aegis-neutral` without any of them
56
- * naming a human being, which is also what makes the clone refusal in rule 2 a
57
- * one-line check instead of a database of celebrities.
58
- */
59
- const BUILTIN_VOICES = Object.freeze([
60
- Object.freeze({ id: 'aegis-neutral', label: 'Neutral', engine: 'local', consent: 'synthetic', note: 'bundled synthetic model' }),
61
- Object.freeze({ id: 'aegis-warm', label: 'Warm', engine: 'local', consent: 'synthetic', note: 'bundled synthetic model' }),
62
- Object.freeze({ id: 'system-default', label: 'System voice', engine: 'system', consent: 'synthetic', note: 'the OS speech engine' }),
63
- ]);
64
-
65
- /**
66
- * Everything that reads like a real person's voice. Conservative on purpose: a
67
- * false positive costs a user one relabelled voice, a false negative is the
68
- * non-goal the spec calls out by name.
69
- */
70
- const CLONE_MARKERS = /clone|voiceprint|clon(ing|e)|imitat|impersonat|deepfake|replica|mimic|soundalike|sound-alike|likeness|my-?own-?voice|friend|colleague|celebrity|actor|actress|president|narrator-|real-?person|consent-?less/i;
71
-
72
- /**
73
- * Local engines, in preference order. `piper` first because it is the one a
74
- * packaged Linux/macOS install can carry; `espeak-ng`/`spd-say`/`say` are the
75
- * "already on the machine" fallbacks. Each entry builds its own argv — never a
76
- * string that gets split.
77
- */
78
- const LOCAL_ENGINES = Object.freeze({
79
- piper: Object.freeze({
80
- bin: 'piper',
81
- // piper reads the sentence on stdin and writes WAV — no temp file, no path.
82
- args: (o) => ['--model', String(o.model || 'en_US-amy-low'), '--output_file', '-'],
83
- stdin: true,
84
- }),
85
- 'espeak-ng': Object.freeze({ bin: 'espeak-ng', args: (o) => ['-s', String(Math.round(175 * o.rate))], stdin: false }),
86
- espeak: Object.freeze({ bin: 'espeak', args: (o) => ['-s', String(Math.round(175 * o.rate))], stdin: false }),
87
- say: Object.freeze({ bin: 'say', args: (o) => ['-r', String(Math.round(200 * o.rate))], stdin: false, platforms: ['darwin'] }),
88
- 'spd-say': Object.freeze({ bin: 'spd-say', args: (o) => ['-r', String(Math.round((o.rate - 1) * 100))], stdin: false }),
89
- });
90
-
91
- /** A deliberate ceiling: one answer read aloud, not a whole transcript. */
92
- const MAX_SPEAK_CHARS = 600;
93
-
94
- function isPlainObject(value) {
95
- return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
96
- }
97
-
98
- /** Is this id/name something that could be a real person's voice? */
99
- function looksCloned(value) {
100
- if (typeof value !== 'string' || !value.trim()) return false;
101
- return CLONE_MARKERS.test(value);
102
- }
103
-
104
- /**
105
- * Refuse a cloned voice. Returns the reason instead of throwing so a caller can
106
- * report it in a status line; the persona validator and this function are two
107
- * independent gates on the same non-goal.
108
- */
109
- function assertNotClone(id) {
110
- if (id === null || id === undefined || id === '') return null;
111
- if (looksCloned(id)) {
112
- return `refusing voice ${JSON.stringify(id)} — voices are synthetic only; this product does not clone real people`;
113
- }
114
- return null;
115
- }
116
-
117
- /** Every voice a build knows about: the bundled three plus packaged ones. */
118
- function listVoices(packs) {
119
- const seen = new Set(BUILTIN_VOICES.map((v) => v.id));
120
- const out = BUILTIN_VOICES.slice();
121
- for (const pack of Array.isArray(packs) ? packs : []) {
122
- if (!isPlainObject(pack) || pack.kind !== 'voice') continue;
123
- for (const item of pack.items || []) {
124
- if (!item || seen.has(item.id)) continue;
125
- seen.add(item.id);
126
- out.push({
127
- id: item.id,
128
- label: item.label || item.id,
129
- engine: item.engine,
130
- consent: item.consent,
131
- note: `from pack ${pack.id}`,
132
- });
133
- }
134
- }
135
- return out;
136
- }
137
-
138
- /** The voice registry entry behind an id, or null. */
139
- function findVoice(id, packs) {
140
- if (!id) return null;
141
- return listVoices(packs).find((v) => v.id === id) || null;
142
- }
143
-
144
- /**
145
- * Which local binary this machine actually has. `probe(bin) → boolean` is
146
- * injected (main passes a PATH lookup; tests pass a stub), so nothing here needs
147
- * to touch the filesystem to be testable.
148
- *
149
- * @returns {{ engine: string, bin: string }|null}
150
- */
151
- function detectEngine(opts = {}) {
152
- const probe = typeof opts.probe === 'function' ? opts.probe : () => false;
153
- const platform = opts.platform || process.platform;
154
- for (const [name, spec] of Object.entries(LOCAL_ENGINES)) {
155
- if (spec.platforms && !spec.platforms.includes(platform)) continue;
156
- if (probe(spec.bin)) return { engine: name, bin: spec.bin };
157
- }
158
- return null;
159
- }
160
-
161
- /**
162
- * The ONE decision about whether the companion may speak.
163
- *
164
- * Order matters: persona opt-in, then the level gate, then the clone refusal,
165
- * then whether an engine exists. Returning a reason at each step is what lets
166
- * the pane say "voice unlocks at level 10" instead of a checkbox that silently
167
- * does nothing.
168
- *
169
- * @param {object} persona validated persona (`persona.load()`); read-only here
170
- * @param {object} [caps] `level.capabilities()` output. Omitted ⇒ NO gating, the
171
- * same convention `renderer/avatar/pane.js` uses (unknown capabilities never
172
- * lock anything).
173
- * @param {object} [opts]
174
- * @param {'none'|'local'|'system'} [opts.envEngine] `AEGIS_VOICE`, lower-cased.
175
- * May only lower: `none` forces silence, `local`/`system` pick an engine for a
176
- * user who already opted in, and anything else is ignored.
177
- * @param {function} [opts.probe] PATH probe for `detectEngine`
178
- * @param {object[]} [opts.packs] loaded cosmetics packs (voice packs add voices)
179
- * @returns {{ enabled: boolean, engine: string, id: string|null, rate: number,
180
- * voice: object|null, offDevice: false, reason: string }}
181
- */
182
- function resolveVoice(persona, caps, opts = {}) {
183
- const p = isPlainObject(persona) ? persona : {};
184
- const rawVoice = isPlainObject(p.voice) ? p.voice : {};
185
- const rate = typeof rawVoice.rate === 'number' && Number.isFinite(rawVoice.rate)
186
- ? Math.min(2, Math.max(0.5, rawVoice.rate))
187
- : 1.0;
188
-
189
- const off = (reason, engine) => ({
190
- enabled: false,
191
- engine: engine || 'none',
192
- id: null,
193
- rate,
194
- voice: null,
195
- offDevice: false,
196
- reason,
197
- });
198
-
199
- // Rule 1: opt-in first. Everything below can only take away.
200
- if (rawVoice.enabled !== true) return off('voice is off (opt-in, default off)');
201
-
202
- // Rule 1 continued: the env may force silence, never audio.
203
- if (opts.envEngine === 'none') return off('AEGIS_VOICE=none forces voice off');
204
-
205
- // The level gate (spec §4.5: voice is L10+). No caps ⇒ no gating.
206
- if (caps && isPlainObject(caps.companion) && caps.companion.voice !== true) {
207
- return off('voice unlocks at level 10');
208
- }
209
-
210
- const want = ENGINES.includes(rawVoice.engine) && rawVoice.engine !== 'none'
211
- ? rawVoice.engine
212
- : (ENGINES.includes(opts.envEngine) && opts.envEngine !== 'none' ? opts.envEngine : 'local');
213
- const engine = opts.envEngine === 'local' || opts.envEngine === 'system' ? opts.envEngine : want;
214
-
215
- // Rule 2: the non-goal, enforced on the speech path itself.
216
- const clone = assertNotClone(rawVoice.id);
217
- if (clone) return off(clone, engine);
218
-
219
- if (engine === 'system') {
220
- return {
221
- enabled: true,
222
- engine,
223
- id: rawVoice.id || 'system-default',
224
- rate,
225
- voice: findVoice(rawVoice.id || 'system-default', opts.packs) || null,
226
- offDevice: false,
227
- reason: 'system speech engine (local)',
228
- };
229
- }
230
-
231
- const found = opts.detected || detectEngine(opts);
232
- const id = rawVoice.id || (found ? 'aegis-neutral' : null);
233
- if (!found) {
234
- return off('no local speech engine installed — voice stays off rather than phoning home', 'local');
235
- }
236
- return {
237
- enabled: true,
238
- engine: 'local',
239
- id,
240
- rate,
241
- voice: findVoice(id, opts.packs) || null,
242
- localEngine: found.engine,
243
- offDevice: false,
244
- reason: `local engine ${found.engine}`,
245
- };
246
- }
247
-
248
- /** One-click mute, in the patch shape the customization pane already speaks. */
249
- function mutePatch() {
250
- return { voice: { enabled: false, engine: 'none', id: null } };
251
- }
252
-
253
- /**
254
- * Turn an answer into something worth hearing. A voice that reads `**Run
255
- * \`npm test\`**` aloud is worse than no voice, so fenced code, inline code,
256
- * URLs, markdown emphasis and link syntax are stripped before anything is
257
- * spoken — and the result is capped at MAX_SPEAK_CHARS.
258
- */
259
- function spokenText(text, max = MAX_SPEAK_CHARS) {
260
- if (typeof text !== 'string') return '';
261
- const flat = text
262
- .replace(/```[\s\S]*?```/g, ' code block ')
263
- .replace(/`[^`]*`/g, ' code ')
264
- .replace(/!?\[([^\]]*)\]\([^)]*\)/g, '$1')
265
- .replace(/https?:\/\/\S+/gi, ' link ')
266
- .replace(/^\s{0,3}#{1,6}\s+/gm, '')
267
- .replace(/[*_~]{1,3}/g, '')
268
- .replace(/[\u0000-\u001f\u007f]+/g, ' ')
269
- .replace(/\s+/g, ' ')
270
- .trim();
271
- return flat.slice(0, Math.max(0, max));
272
- }
273
-
274
- /**
275
- * The exact command the host may run to say one sentence.
276
- *
277
- * @returns {{ ok: boolean, cmd?: string, args?: string[], stdin?: boolean, shell: false,
278
- * offDevice: false, text?: string, reason?: string }}
279
- * `ok: false` when there is nothing to say or nothing local to say it with.
280
- * `shell: false` is part of the contract, not a default: it is what makes the
281
- * text an argument instead of a command.
282
- */
283
- function speakPlan(text, opts = {}) {
284
- const clean = spokenText(text, opts.max);
285
- if (!clean) return { ok: false, reason: 'nothing to say after stripping code and markdown', shell: false, offDevice: false };
286
-
287
- const engine = opts.engine === 'system' ? 'system' : 'local';
288
- if (engine === 'system') {
289
- const platform = opts.platform || process.platform;
290
- if (platform === 'darwin') {
291
- return { ok: true, cmd: 'say', args: ['-r', String(Math.round(200 * (opts.rate || 1))), clean], shell: false, offDevice: false, text: clean, localEngine: 'say' };
292
- }
293
- return { ok: true, cmd: 'spd-say', args: ['-r', String(Math.round(((opts.rate || 1) - 1) * 100))], stdin: false, text: clean, shell: false, offDevice: false, localEngine: 'spd-say' };
294
- }
295
-
296
- // `opts.localEngine` is the NAME from detectEngine's probe; the argv template
297
- // comes from LOCAL_ENGINES, so the caller cannot inject one.
298
- const name = opts.localEngine && LOCAL_ENGINES[opts.localEngine] ? opts.localEngine : 'piper';
299
- const spec = LOCAL_ENGINES[name];
300
- const rate = typeof opts.rate === 'number' && Number.isFinite(opts.rate) ? opts.rate : 1;
301
- const args = spec.args({ rate, model: opts.model }).slice();
302
- if (!spec.stdin) args.push(clean);
303
- return {
304
- ok: true,
305
- cmd: spec.bin,
306
- args,
307
- stdin: Boolean(spec.stdin),
308
- text: spec.stdin ? clean : undefined,
309
- shell: false,
310
- offDevice: false,
311
- localEngine: name,
312
- };
313
- }
314
-
315
- module.exports = {
316
- ENGINES,
317
- BUILTIN_VOICES,
318
- CLONE_MARKERS,
319
- LOCAL_ENGINES,
320
- MAX_SPEAK_CHARS,
321
- looksCloned,
322
- assertNotClone,
323
- listVoices,
324
- findVoice,
325
- detectEngine,
326
- resolveVoice,
327
- mutePatch,
328
- spokenText,
329
- speakPlan,
330
- };
3
+ "use strict";const ENGINES=Object.freeze(["none","local","system"]),BUILTIN_VOICES=Object.freeze([Object.freeze({id:"aegis-neutral",label:"Neutral",engine:"local",consent:"synthetic",note:"bundled synthetic model"}),Object.freeze({id:"aegis-warm",label:"Warm",engine:"local",consent:"synthetic",note:"bundled synthetic model"}),Object.freeze({id:"system-default",label:"System voice",engine:"system",consent:"synthetic",note:"the OS speech engine"})]),CLONE_MARKERS=/clone|voiceprint|clon(ing|e)|imitat|impersonat|deepfake|replica|mimic|soundalike|sound-alike|likeness|my-?own-?voice|friend|colleague|celebrity|actor|actress|president|narrator-|real-?person|consent-?less/i,LOCAL_ENGINES=Object.freeze({piper:Object.freeze({bin:"piper",args:e=>["--model",String(e.model||"en_US-amy-low"),"--output_file","-"],stdin:!0}),"espeak-ng":Object.freeze({bin:"espeak-ng",args:e=>["-s",String(Math.round(175*e.rate))],stdin:!1}),espeak:Object.freeze({bin:"espeak",args:e=>["-s",String(Math.round(175*e.rate))],stdin:!1}),say:Object.freeze({bin:"say",args:e=>["-r",String(Math.round(200*e.rate))],stdin:!1,platforms:["darwin"]}),"spd-say":Object.freeze({bin:"spd-say",args:e=>["-r",String(Math.round(100*(e.rate-1)))],stdin:!1})}),MAX_SPEAK_CHARS=600;function isPlainObject(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)}function looksCloned(e){return!("string"!=typeof e||!e.trim())&&CLONE_MARKERS.test(e)}function assertNotClone(e){return null==e||""===e?null:looksCloned(e)?`refusing voice ${JSON.stringify(e)} — voices are synthetic only; this product does not clone real people`:null}function listVoices(e){const n=new Set(BUILTIN_VOICES.map((e=>e.id))),t=BUILTIN_VOICES.slice();for(const i of Array.isArray(e)?e:[])if(isPlainObject(i)&&"voice"===i.kind)for(const e of i.items||[])e&&!n.has(e.id)&&(n.add(e.id),t.push({id:e.id,label:e.label||e.id,engine:e.engine,consent:e.consent,note:`from pack ${i.id}`}));return t}function findVoice(e,n){return e&&listVoices(n).find((n=>n.id===e))||null}function detectEngine(e={}){const n="function"==typeof e.probe?e.probe:()=>!1,t=e.platform||process.platform;for(const[e,i]of Object.entries(LOCAL_ENGINES))if((!i.platforms||i.platforms.includes(t))&&n(i.bin))return{engine:e,bin:i.bin};return null}function resolveVoice(e,n,t={}){const i=isPlainObject(e)?e:{},o=isPlainObject(i.voice)?i.voice:{},s="number"==typeof o.rate&&Number.isFinite(o.rate)?Math.min(2,Math.max(.5,o.rate)):1,r=(e,n)=>({enabled:!1,engine:n||"none",id:null,rate:s,voice:null,offDevice:!1,reason:e});if(!0!==o.enabled)return r("voice is off (opt-in, default off)");if("none"===t.envEngine)return r("AEGIS_VOICE=none forces voice off");if(n&&isPlainObject(n.companion)&&!0!==n.companion.voice)return r("voice unlocks at level 10");const l=ENGINES.includes(o.engine)&&"none"!==o.engine?o.engine:ENGINES.includes(t.envEngine)&&"none"!==t.envEngine?t.envEngine:"local",a="local"===t.envEngine||"system"===t.envEngine?t.envEngine:l,c=assertNotClone(o.id);if(c)return r(c,a);if("system"===a)return{enabled:!0,engine:a,id:o.id||"system-default",rate:s,voice:findVoice(o.id||"system-default",t.packs)||null,offDevice:!1,reason:"system speech engine (local)"};const d=t.detected||detectEngine(t),f=o.id||(d?"aegis-neutral":null);return d?{enabled:!0,engine:"local",id:f,rate:s,voice:findVoice(f,t.packs)||null,localEngine:d.engine,offDevice:!1,reason:`local engine ${d.engine}`}:r("no local speech engine installed — voice stays off rather than phoning home","local")}function mutePatch(){return{voice:{enabled:!1,engine:"none",id:null}}}function spokenText(e,n=MAX_SPEAK_CHARS){return"string"!=typeof e?"":e.replace(/```[\s\S]*?```/g," code block ").replace(/`[^`]*`/g," code ").replace(/!?\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/https?:\/\/\S+/gi," link ").replace(/^\s{0,3}#{1,6}\s+/gm,"").replace(/[*_~]{1,3}/g,"").replace(/[\u0000-\u001f\u007f]+/g," ").replace(/\s+/g," ").trim().slice(0,Math.max(0,n))}function speakPlan(e,n={}){const t=spokenText(e,n.max);if(!t)return{ok:!1,reason:"nothing to say after stripping code and markdown",shell:!1,offDevice:!1};if("system"==("system"===n.engine?"system":"local"))return"darwin"===(n.platform||process.platform)?{ok:!0,cmd:"say",args:["-r",String(Math.round(200*(n.rate||1))),t],shell:!1,offDevice:!1,text:t,localEngine:"say"}:{ok:!0,cmd:"spd-say",args:["-r",String(Math.round(100*((n.rate||1)-1)))],stdin:!1,text:t,shell:!1,offDevice:!1,localEngine:"spd-say"};const i=n.localEngine&&LOCAL_ENGINES[n.localEngine]?n.localEngine:"piper",o=LOCAL_ENGINES[i],s="number"==typeof n.rate&&Number.isFinite(n.rate)?n.rate:1,r=o.args({rate:s,model:n.model}).slice();return o.stdin||r.push(t),{ok:!0,cmd:o.bin,args:r,stdin:Boolean(o.stdin),text:o.stdin?t:void 0,shell:!1,offDevice:!1,localEngine:i}}module.exports={ENGINES:ENGINES,BUILTIN_VOICES:BUILTIN_VOICES,CLONE_MARKERS:CLONE_MARKERS,LOCAL_ENGINES:LOCAL_ENGINES,MAX_SPEAK_CHARS:MAX_SPEAK_CHARS,looksCloned:looksCloned,assertNotClone:assertNotClone,listVoices:listVoices,findVoice:findVoice,detectEngine:detectEngine,resolveVoice:resolveVoice,mutePatch:mutePatch,spokenText:spokenText,speakPlan:speakPlan};