@fased/fased 0.1.49 → 0.1.51

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 (337) hide show
  1. package/dist/acp/client.js +2 -2
  2. package/dist/acp/secret-file.js +2 -2
  3. package/dist/agents/agent-scope.js +2 -2
  4. package/dist/agents/apply-patch.js +8 -8
  5. package/dist/agents/auth-profiles/paths.js +2 -2
  6. package/dist/agents/auth-profiles/store.js +2 -2
  7. package/dist/agents/bash-tools.shared.js +2 -2
  8. package/dist/agents/cli-credentials.js +4 -4
  9. package/dist/agents/current-model-catalog.js +45 -0
  10. package/dist/agents/docs-path.js +3 -3
  11. package/dist/agents/embedded-pi-mcp.js +4 -4
  12. package/dist/agents/identity-avatar.js +3 -3
  13. package/dist/agents/identity-file.js +2 -2
  14. package/dist/agents/model-catalog-source.js +28 -3
  15. package/dist/agents/pi-embedded-subscribe.raw-stream.js +3 -3
  16. package/dist/agents/pi-extensions/compaction-safeguard.js +3 -3
  17. package/dist/agents/pi-model-discovery.js +6 -6
  18. package/dist/agents/pi-project-settings.js +3 -3
  19. package/dist/agents/provider-id.js +1 -1
  20. package/dist/agents/sandbox/fs-bridge.js +2 -2
  21. package/dist/agents/session-dirs.js +4 -4
  22. package/dist/agents/session-write-lock.js +13 -13
  23. package/dist/agents/shell-utils.js +5 -5
  24. package/dist/agents/skills/bundled-dir.js +4 -4
  25. package/dist/agents/skills/local-loader.js +6 -6
  26. package/dist/agents/skills/plugin-skills.js +2 -2
  27. package/dist/agents/skills/workspace.js +13 -13
  28. package/dist/agents/skills-install-download.js +7 -7
  29. package/dist/agents/skills-install-plan.js +2 -2
  30. package/dist/agents/skills-install.js +2 -2
  31. package/dist/agents/skills-status.js +2 -2
  32. package/dist/agents/subagent-depth.js +2 -2
  33. package/dist/agents/system-prompt-params.js +2 -2
  34. package/dist/agents/workspace.js +22 -22
  35. package/dist/auto-reply/reply/agent-runner-execution.js +2 -2
  36. package/dist/auto-reply/reply/agent-runner.js +2 -2
  37. package/dist/auto-reply/reply/commands-export-session.js +7 -7
  38. package/dist/auto-reply/reply/post-compaction-audit.js +3 -3
  39. package/dist/auto-reply/reply/post-compaction-context.js +3 -3
  40. package/dist/auto-reply/reply/session.js +3 -3
  41. package/dist/auto-reply/skill-commands.js +3 -3
  42. package/dist/auto-reply/status.js +6 -6
  43. package/dist/brand.js +1 -1
  44. package/dist/browser/chrome.executables.js +3 -3
  45. package/dist/browser/chrome.js +3 -3
  46. package/dist/browser/chrome.profile-decoration.js +6 -6
  47. package/dist/browser/profiles-service.js +2 -2
  48. package/dist/browser/server-context.js +2 -2
  49. package/dist/browser/trash.js +4 -4
  50. package/dist/build-info.json +3 -3
  51. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  52. package/dist/canvas-host/server.js +4 -4
  53. package/dist/capabilities/catalog.js +3 -3
  54. package/dist/channels/plugins/catalog.js +3 -3
  55. package/dist/cli/browser-cli-extension.js +6 -6
  56. package/dist/cli/command-format.js +2 -2
  57. package/dist/cli/cron-cli/register.cron-simple.js +2 -2
  58. package/dist/cli/dns-cli.js +9 -9
  59. package/dist/cli/gateway-cli/dev.js +5 -5
  60. package/dist/cli/gateway-cli/run.js +2 -2
  61. package/dist/cli/hooks-cli.js +5 -5
  62. package/dist/cli/lightweight/gateway-runtime-probe.js +50 -0
  63. package/dist/cli/memory-cli.js +7 -7
  64. package/dist/cli/nodes-media-utils.js +2 -2
  65. package/dist/cli/plugins-cli.js +2 -2
  66. package/dist/cli/secrets-cli.js +3 -3
  67. package/dist/cli/update-cli/update-command.js +120 -0
  68. package/dist/cli/windows-argv.js +2 -2
  69. package/dist/commands/dashboard-link.js +3 -3
  70. package/dist/commands/doctor-install.js +5 -5
  71. package/dist/commands/doctor-memory-search.js +2 -2
  72. package/dist/commands/doctor-platform-notes.js +2 -2
  73. package/dist/commands/doctor-sandbox.js +2 -2
  74. package/dist/commands/doctor-state-integrity.js +23 -23
  75. package/dist/commands/doctor-workspace.js +3 -3
  76. package/dist/commands/doctor.js +3 -3
  77. package/dist/commands/managed-up.js +2 -2
  78. package/dist/commands/onboard-auth.credentials.js +3 -3
  79. package/dist/commands/onboarding/plugin-install.js +2 -2
  80. package/dist/commands/sessions-cleanup.js +2 -2
  81. package/dist/commands/signal-install.js +6 -6
  82. package/dist/commands/status-all/channels.js +2 -2
  83. package/dist/commands/wallet.js +47 -47
  84. package/dist/config/cache-utils.js +2 -2
  85. package/dist/config/includes.js +5 -5
  86. package/dist/config/io.js +2 -2
  87. package/dist/config/paths.js +3 -3
  88. package/dist/config/sat-runtime-ids.js +3 -3
  89. package/dist/config/sessions/disk-budget.js +6 -6
  90. package/dist/config/sessions/paths.js +2 -2
  91. package/dist/config/sessions/store.js +17 -17
  92. package/dist/config/sessions/transcript.js +4 -4
  93. package/dist/config/talk.js +2 -2
  94. package/dist/control-ui/assets/{app-6iCry787.js → app-wJm5kuje.js} +4 -4
  95. package/dist/control-ui/assets/{chat-model-ref-C6CFR-GR.js → chat-model-ref-Cs2TTOtF.js} +2 -2
  96. package/dist/control-ui/assets/{index-CNFgocD9.js → index-vTDTf5Zv.js} +3 -3
  97. package/dist/control-ui/assets/{providers-WTJ1kMKy.js → providers-C0DEXi8e.js} +2 -2
  98. package/dist/control-ui/index.html +1 -1
  99. package/dist/cron/service/store.js +2 -2
  100. package/dist/cron/store.js +6 -6
  101. package/dist/daemon/systemd-system.js +5 -5
  102. package/dist/discord/monitor/thread-bindings.state.js +2 -2
  103. package/dist/extensions/sat-mining/src/sat-bond-layout.js +9 -9
  104. package/dist/gateway/control-ui-boot-check.js +6 -6
  105. package/dist/gateway/control-ui-login.js +7 -7
  106. package/dist/gateway/control-ui.js +9 -9
  107. package/dist/gateway/hooks-mapping.js +4 -4
  108. package/dist/gateway/probe-payload.js +14 -0
  109. package/dist/gateway/probe.js +8 -4
  110. package/dist/gateway/server-discovery.js +2 -2
  111. package/dist/gateway/server-http-lazy.js +2 -4
  112. package/dist/gateway/server-http.js +6 -8
  113. package/dist/gateway/server-methods/chat.js +3 -3
  114. package/dist/gateway/server-methods/models.js +3 -2
  115. package/dist/gateway/server-methods/sessions.js +6 -6
  116. package/dist/gateway/server-methods/usage.js +2 -2
  117. package/dist/gateway/server.impl.js +3 -3
  118. package/dist/gateway/session-compaction-checkpoints.js +4 -4
  119. package/dist/gateway/session-utils.fs.js +24 -24
  120. package/dist/gateway/session-utils.js +6 -6
  121. package/dist/hooks/bundled-dir.js +4 -4
  122. package/dist/hooks/gmail-setup-utils.js +6 -6
  123. package/dist/hooks/import-url.js +2 -2
  124. package/dist/hooks/loader.js +4 -4
  125. package/dist/hooks/workspace.js +7 -7
  126. package/dist/infra/archive.js +17 -17
  127. package/dist/infra/boundary-file-read.js +2 -2
  128. package/dist/infra/boundary-path.js +15 -15
  129. package/dist/infra/brew.js +2 -2
  130. package/dist/infra/control-ui-assets.js +14 -14
  131. package/dist/infra/device-auth-store.js +8 -8
  132. package/dist/infra/device-identity.js +8 -8
  133. package/dist/infra/dotenv.js +2 -2
  134. package/dist/infra/exec-approvals.js +8 -8
  135. package/dist/infra/exec-command-resolution.js +4 -4
  136. package/dist/infra/exec-safe-bin-trust.js +2 -2
  137. package/dist/infra/fased-root.js +5 -5
  138. package/dist/infra/fs-safe.js +14 -14
  139. package/dist/infra/gateway-lock.js +11 -11
  140. package/dist/infra/git-commit.js +5 -5
  141. package/dist/infra/git-root.js +4 -4
  142. package/dist/infra/hosted-runtime-artifact.js +3 -3
  143. package/dist/infra/is-main.js +2 -2
  144. package/dist/infra/json-file.js +7 -7
  145. package/dist/infra/outbound/delivery-queue.js +16 -16
  146. package/dist/infra/path-env.js +3 -3
  147. package/dist/infra/ports-lsof.js +4 -4
  148. package/dist/infra/provider-usage.auth.js +3 -3
  149. package/dist/infra/safe-open-sync.js +2 -2
  150. package/dist/infra/session-cost-usage.js +9 -9
  151. package/dist/infra/shell-env.js +2 -2
  152. package/dist/infra/state-migrations.fs.js +6 -6
  153. package/dist/infra/state-migrations.js +23 -23
  154. package/dist/infra/tmp-fased-dir.js +6 -6
  155. package/dist/infra/widearea-dns.js +3 -3
  156. package/dist/infra/wsl.js +2 -2
  157. package/dist/light-update-precheck.js +1 -1
  158. package/dist/light-update-status.js +1 -1
  159. package/dist/line/accounts.js +2 -2
  160. package/dist/line/download.js +2 -2
  161. package/dist/logging/config.js +3 -3
  162. package/dist/logging/logger.js +7 -7
  163. package/dist/managed/federation.js +3 -3
  164. package/dist/managed/tunnel.js +3 -3
  165. package/dist/media/store.js +13 -13
  166. package/dist/media-understanding/runner.js +3 -3
  167. package/dist/memory/embeddings.js +2 -2
  168. package/dist/memory/internal.js +10 -10
  169. package/dist/memory/manager-sync-ops.js +7 -7
  170. package/dist/memory/repair-executor.js +17 -17
  171. package/dist/node-host/invoke-system-run-plan.js +8 -8
  172. package/dist/node-host/invoke.js +2 -2
  173. package/dist/node-host/runner.js +3 -3
  174. package/dist/pairing/pairing-store.js +3 -3
  175. package/dist/plugin-sdk/{accounts-B5fY9hZy.js → accounts-BfdIB9Ud.js} +1 -1
  176. package/dist/plugin-sdk/{actions-D-9SsSEy.js → actions-DHN_x97P.js} +2 -2
  177. package/dist/plugin-sdk/{active-listener-BH7rDR47.js → active-listener-CIP_Ht8d.js} +1 -1
  178. package/dist/plugin-sdk/{audio-preflight-4faayz5S.js → audio-preflight-CKGhXtyV.js} +26 -26
  179. package/dist/plugin-sdk/{audit-BQfsboqd.js → audit-Cmg38KPG.js} +1 -1
  180. package/dist/plugin-sdk/{channel-access-CDZ-cJPq.js → channel-access-JHDguu4T.js} +1 -1
  181. package/dist/plugin-sdk/{channel-access-configure-DlpuhlH6.js → channel-access-configure-B8mwKp-Z.js} +1 -1
  182. package/dist/plugin-sdk/channel-plugin-common.d.ts +2 -2
  183. package/dist/plugin-sdk/channel-plugin-common.js +4 -4
  184. package/dist/plugin-sdk/{chunk-items-Cyc4Kl6A.js → chunk-items-iKdlZyWZ.js} +1 -1
  185. package/dist/plugin-sdk/{chunk-CZuCyS7k.js → chunk-oJRyTNTL.js} +1 -1
  186. package/dist/plugin-sdk/command-status.js +26 -26
  187. package/dist/plugin-sdk/{commands-registry-COIbIjGO.js → commands-registry-Cjo7OjIf.js} +2 -2
  188. package/dist/plugin-sdk/{common-LMHJe8KW.js → common-Dx4sUa9f.js} +1 -1
  189. package/dist/plugin-sdk/{config-ZMbTT0kM.js → config-DdS0zHiU.js} +79 -3
  190. package/dist/plugin-sdk/{config-schema-Cku0a8Tm.js → config-schema-BJQEjMPz.js} +2001 -449
  191. package/dist/plugin-sdk/device-pair.d.ts +1 -1
  192. package/dist/plugin-sdk/discord.d.ts +4 -4
  193. package/dist/plugin-sdk/discord.js +19 -19
  194. package/dist/plugin-sdk/{handle-action-C8ZZfORB.js → handle-action-wR0x9b0c.js} +13 -13
  195. package/dist/plugin-sdk/{helpers-vfzH9tBn.js → helpers-DkauqZNP.js} +1 -1
  196. package/dist/plugin-sdk/{image-ops-BnOmQA5d.js → image-ops-DmSjpAeh.js} +1 -1
  197. package/dist/plugin-sdk/index.d.ts +18 -18
  198. package/dist/plugin-sdk/index.js +28 -28
  199. package/dist/plugin-sdk/json-store.js +6 -6
  200. package/dist/plugin-sdk/{login-C73Wpiw8.js → login-DB9LIbi8.js} +3 -3
  201. package/dist/plugin-sdk/{login-qr-CRKHA7i8.js → login-qr-CDhMa-c7.js} +3 -3
  202. package/dist/plugin-sdk/{manager-CHYhpKHn.js → manager-DGZsMQWR.js} +2 -2
  203. package/dist/plugin-sdk/{markdown-tables-B84dPWNG.js → markdown-tables-BX7JXDUV.js} +1 -1
  204. package/dist/plugin-sdk/{media-4daDcNER.js → media-DyzsScOp.js} +2 -2
  205. package/dist/plugin-sdk/{monitor-DJhU-J5u.js → monitor-B91PZ2mD.js} +31 -31
  206. package/dist/plugin-sdk/{monitor-CChc6bQV.js → monitor-BH9rTJFq.js} +30 -30
  207. package/dist/plugin-sdk/{openresponses-http-Dvyczr35.js → openresponses-http-CmBLZ9bH.js} +26 -26
  208. package/dist/plugin-sdk/{optional-runtime-dependency-BFpqaCzp.js → optional-runtime-dependency-DaMkPVe_.js} +1 -1
  209. package/dist/plugin-sdk/{outbound-C1xBxfNb.js → outbound-X-m2mBZn.js} +6 -6
  210. package/dist/plugin-sdk/{outbound-attachment-DvcxPP7b.js → outbound-attachment-M0NCUSG-.js} +2 -2
  211. package/dist/plugin-sdk/{pairing-message-DWXHX-jt.d.ts → pairing-message-BaQiXKLE.d.ts} +1 -1
  212. package/dist/plugin-sdk/{pairing-message-DpYT614h.js → pairing-message-hnmpJlW2.js} +1 -1
  213. package/dist/plugin-sdk/{pairing-store-CprpGco9.js → pairing-store-DyghUm9G.js} +2 -2
  214. package/dist/plugin-sdk/{pi-model-discovery-BQ6fFRBA.js → pi-model-discovery-ReorOh7W.js} +1 -1
  215. package/dist/plugin-sdk/{pi-model-discovery-runtime-BF_89lVj.js → pi-model-discovery-runtime-C-CHZo03.js} +2 -2
  216. package/dist/plugin-sdk/provider-web-search-config-contract.d.ts +1 -1
  217. package/dist/plugin-sdk/{pw-ai-xgpIbHOr.js → pw-ai-D_gli3_r.js} +3 -3
  218. package/dist/plugin-sdk/{replies-AzJ6U6Ut.js → replies-Djyehmcu.js} +2 -2
  219. package/dist/plugin-sdk/{resolve-outbound-target-COo_TR7B.js → resolve-outbound-target-Chznq8rS.js} +1 -1
  220. package/dist/plugin-sdk/{resolve-route-CZFzHOIe.js → resolve-route-Ce08Fx-G.js} +1 -1
  221. package/dist/plugin-sdk/{retry-policy-BSdqqXsI.js → retry-policy-eS25atAo.js} +1 -1
  222. package/dist/plugin-sdk/{runtime-CeoGffDi.js → runtime-Cv3gX3Wc.js} +3 -3
  223. package/dist/plugin-sdk/{runtime-dependency-Cvbs0GXf.js → runtime-dependency-p_iKbESf.js} +2 -2
  224. package/dist/plugin-sdk/sat-runtime.d.ts +2 -2
  225. package/dist/plugin-sdk/sat-runtime.js +5 -5
  226. package/dist/plugin-sdk/{send-B_-UtG9F.js → send-B3RAELvw.js} +6 -6
  227. package/dist/plugin-sdk/{send-C0Q1u7N1.js → send-BuPGxx3-.js} +8 -8
  228. package/dist/plugin-sdk/{send-CGE7OgsA.js → send-C-jaxZJG.js} +5 -5
  229. package/dist/plugin-sdk/{send-DCxAv7bV.js → send-CSob7dn9.js} +6 -6
  230. package/dist/plugin-sdk/{send-DVpCBUuL.js → send-CsLJsIvv.js} +7 -7
  231. package/dist/plugin-sdk/{session-ETYBbhLn.js → session-DKJGakm1.js} +2 -2
  232. package/dist/plugin-sdk/{skill-commands-BQL6TBIv.js → skill-commands-BqpZG5nW.js} +2 -2
  233. package/dist/plugin-sdk/{slack-Bs_4uivd.js → slack-CQqN9uBH.js} +38 -38
  234. package/dist/plugin-sdk/{slack-actions-CBPZkfTS.js → slack-actions-DlbVH5SS.js} +11 -11
  235. package/dist/plugin-sdk/slack.d.ts +4 -4
  236. package/dist/plugin-sdk/slack.js +9 -9
  237. package/dist/plugin-sdk/{sticker-cache-BBZMp-oQ.js → sticker-cache-CDyt2ZMh.js} +3 -3
  238. package/dist/plugin-sdk/{tables-B-G7Bb0l.js → tables-Cij4iAXw.js} +1 -1
  239. package/dist/plugin-sdk/{targets-D8UaoWHd.js → targets-VrYeAmeT.js} +1 -1
  240. package/dist/plugin-sdk/{telegram-actions-BARLx9zc.js → telegram-actions-ZwUBOkwa.js} +29 -29
  241. package/dist/plugin-sdk/telegram.d.ts +4 -4
  242. package/dist/plugin-sdk/telegram.js +8 -8
  243. package/dist/plugin-sdk/{thread-bindings.lifecycle-DwYKCLLq.js → thread-bindings.lifecycle-BWIzwpPM.js} +3 -3
  244. package/dist/plugin-sdk/{thread-bindings.state-BNWfHA0f.js → thread-bindings.state-CpAQrGco.js} +2 -2
  245. package/dist/plugin-sdk/{tmp-fased-dir-Be1wBhVz.d.ts → tmp-fased-dir-DLba1ePP.d.ts} +1 -1
  246. package/dist/plugin-sdk/{types-CXLEOrJX.d.ts → types-CKR2Lvsa.d.ts} +1 -1
  247. package/dist/plugin-sdk/{types-CJGVZX6j.d.ts → types-NR-f-rw-.d.ts} +3 -3
  248. package/dist/plugin-sdk/{wallet-status-Coekn_SJ.js → wallet-status-ClmXigGN.js} +3 -3
  249. package/dist/plugin-sdk/{web-BwolzGVF.js → web-BK2j9z6c.js} +31 -31
  250. package/dist/plugin-sdk/{whatsapp-actions-CSvf6eev.js → whatsapp-actions-CaenMy79.js} +13 -13
  251. package/dist/plugin-sdk/{whatsapp-heartbeat-Bw7OtTe6.js → whatsapp-heartbeat-Cr9K5Sil.js} +2 -2
  252. package/dist/plugin-sdk/whatsapp.d.ts +9 -9
  253. package/dist/plugin-sdk/whatsapp.js +12 -12
  254. package/dist/plugin-sdk/{wsl-By1Mc-oS.js → wsl-D_I-iL4U.js} +3 -3
  255. package/dist/plugin-sdk/{zod-schema.providers-core-TI6sL-6B.d.ts → zod-schema.providers-core-CIzCjXH9.d.ts} +75 -75
  256. package/dist/plugins/bundled-dir.js +3 -3
  257. package/dist/plugins/discovery.js +11 -11
  258. package/dist/plugins/loader.js +13 -13
  259. package/dist/plugins/manifest-registry.js +2 -2
  260. package/dist/plugins/manifest.js +4 -4
  261. package/dist/plugins/path-safety.js +3 -3
  262. package/dist/plugins/status-cache.js +10 -10
  263. package/dist/plugins/update.js +3 -3
  264. package/dist/plugins/web-search-install-catalog.js +3 -3
  265. package/dist/providers/refresh.js +1 -1
  266. package/dist/providers/refreshed-model-capabilities.js +1935 -406
  267. package/dist/providers/registry.js +13 -2
  268. package/dist/secrets/apply.js +16 -16
  269. package/dist/secrets/audit.js +11 -11
  270. package/dist/secrets/shared.js +9 -9
  271. package/dist/security/scan-paths.js +2 -2
  272. package/dist/shared/config-eval.js +2 -2
  273. package/dist/shared/pid-alive.js +2 -2
  274. package/dist/tasks/standing-orders.js +5 -5
  275. package/dist/tasks/task-flow-registry.js +5 -5
  276. package/dist/tasks/task-registry.js +5 -5
  277. package/dist/tasks/workflow-definitions.js +6 -6
  278. package/dist/telegram/token.js +5 -5
  279. package/dist/utils.js +5 -5
  280. package/dist/wallet/local-socket-signer-broker.js +16 -16
  281. package/dist/wallet/providers/embedded-keystore-adapter.js +5 -5
  282. package/dist/wallet/providers/local-socket-signer-adapter.js +2 -2
  283. package/dist/wallet/wallet-approval-auth.js +5 -5
  284. package/dist/wallet/wallet-audit-log.js +5 -5
  285. package/dist/wallet/wallet-custody.js +21 -21
  286. package/dist/wallet/wallet-inbound-events.js +5 -5
  287. package/dist/wallet/wallet-observability.js +5 -5
  288. package/dist/wallet/wallet-policy.js +9 -9
  289. package/dist/wallet/wallet-provider-registry.js +7 -7
  290. package/dist/wallet/wallet-runtime-config.js +3 -3
  291. package/dist/wallet/wallet-secrets-store.js +22 -22
  292. package/dist/wallet/wallet-send-approvals.js +5 -5
  293. package/dist/wallet/wallet-settlement-links.js +5 -5
  294. package/dist/web/accounts.js +3 -3
  295. package/dist/web/auth-store.js +18 -18
  296. package/dist/web/session.js +4 -4
  297. package/dist/wizard/host-security-capability.js +2 -2
  298. package/dist/wizard/onboarding.host-security.js +7 -7
  299. package/dist/wizard/onboarding.js +7 -7
  300. package/dist/wizard/onboarding.wallet.js +44 -44
  301. package/extensions/acpx/package.json +1 -1
  302. package/extensions/bluebubbles/package.json +1 -1
  303. package/extensions/copilot-proxy/package.json +1 -1
  304. package/extensions/diagnostics-otel/package.json +1 -1
  305. package/extensions/fased-federation/package.json +1 -1
  306. package/extensions/google-gemini-cli-auth/package.json +1 -1
  307. package/extensions/imessage/package.json +1 -1
  308. package/extensions/irc/package.json +1 -1
  309. package/extensions/line/package.json +1 -1
  310. package/extensions/llm-task/package.json +1 -1
  311. package/extensions/lobster/package.json +1 -1
  312. package/extensions/matrix/CHANGELOG.md +12 -0
  313. package/extensions/matrix/package.json +1 -1
  314. package/extensions/mattermost/package.json +1 -1
  315. package/extensions/memory-core/package.json +2 -2
  316. package/extensions/memory-lancedb/package.json +1 -1
  317. package/extensions/minimax-portal-auth/package.json +1 -1
  318. package/extensions/msteams/CHANGELOG.md +12 -0
  319. package/extensions/msteams/package.json +1 -1
  320. package/extensions/nextcloud-talk/package.json +1 -1
  321. package/extensions/nostr/CHANGELOG.md +12 -0
  322. package/extensions/nostr/package.json +1 -1
  323. package/extensions/open-prose/package.json +1 -1
  324. package/extensions/sat-mining/package.json +1 -1
  325. package/extensions/signal/package.json +1 -1
  326. package/extensions/synology-chat/package.json +1 -1
  327. package/extensions/tlon/package.json +1 -1
  328. package/extensions/twitch/CHANGELOG.md +12 -0
  329. package/extensions/twitch/package.json +1 -1
  330. package/extensions/voice-call/CHANGELOG.md +12 -0
  331. package/extensions/voice-call/package.json +1 -1
  332. package/extensions/zalo/CHANGELOG.md +12 -0
  333. package/extensions/zalo/package.json +1 -1
  334. package/extensions/zalouser/CHANGELOG.md +12 -0
  335. package/extensions/zalouser/package.json +1 -1
  336. package/package.json +1 -1
  337. package/scripts/start-managed.sh +14 -0
@@ -7,7 +7,7 @@ import { resolveControlUiRootSync } from "../infra/control-ui-assets.js";
7
7
  import { DEFAULT_ASSISTANT_IDENTITY, resolveAssistantIdentity } from "./assistant-identity.js";
8
8
  import { CONTROL_UI_BOOTSTRAP_CONFIG_PATH } from "./control-ui-contract.js";
9
9
  import { buildControlUiCspHeader } from "./control-ui-csp.js";
10
- import syncFs from "node:fs";
10
+ import fs from "node:fs";
11
11
  import path from "node:path";
12
12
 
13
13
  //#region src/gateway/control-ui.ts
@@ -151,10 +151,10 @@ function handleControlUiAvatarRequest(req, res, opts) {
151
151
  res.end();
152
152
  return true;
153
153
  }
154
- serveResolvedFile(res, safeAvatar.path, syncFs.readFileSync(safeAvatar.fd));
154
+ serveResolvedFile(res, safeAvatar.path, fs.readFileSync(safeAvatar.fd));
155
155
  return true;
156
156
  } finally {
157
- syncFs.closeSync(safeAvatar.fd);
157
+ fs.closeSync(safeAvatar.fd);
158
158
  }
159
159
  }
160
160
  function respondNotFound(res) {
@@ -316,7 +316,7 @@ function handleControlUiHttpRequest(req, res, opts) {
316
316
  }
317
317
  const rootReal = (() => {
318
318
  try {
319
- return syncFs.realpathSync(root);
319
+ return fs.realpathSync(root);
320
320
  } catch (error) {
321
321
  if (isExpectedSafePathError(error)) {
322
322
  return null;
@@ -362,13 +362,13 @@ function handleControlUiHttpRequest(req, res, opts) {
362
362
  return true;
363
363
  }
364
364
  if (path.basename(safeFile.path) === "index.html") {
365
- serveResolvedIndexHtml(res, syncFs.readFileSync(safeFile.fd, "utf8"));
365
+ serveResolvedIndexHtml(res, fs.readFileSync(safeFile.fd, "utf8"));
366
366
  return true;
367
367
  }
368
- serveResolvedFile(res, safeFile.path, syncFs.readFileSync(safeFile.fd));
368
+ serveResolvedFile(res, safeFile.path, fs.readFileSync(safeFile.fd));
369
369
  return true;
370
370
  } finally {
371
- syncFs.closeSync(safeFile.fd);
371
+ fs.closeSync(safeFile.fd);
372
372
  }
373
373
  }
374
374
  if (STATIC_ASSET_EXTENSIONS.has(path.extname(fileRel).toLowerCase())) {
@@ -385,10 +385,10 @@ function handleControlUiHttpRequest(req, res, opts) {
385
385
  res.end();
386
386
  return true;
387
387
  }
388
- serveResolvedIndexHtml(res, syncFs.readFileSync(safeIndex.fd, "utf8"));
388
+ serveResolvedIndexHtml(res, fs.readFileSync(safeIndex.fd, "utf8"));
389
389
  return true;
390
390
  } finally {
391
- syncFs.closeSync(safeIndex.fd);
391
+ fs.closeSync(safeIndex.fd);
392
392
  }
393
393
  }
394
394
  respondNotFound(res);
@@ -1,7 +1,7 @@
1
1
  import { CONFIG_PATH } from "../config/paths.js";
2
2
  import "../config/config.js";
3
3
  import { importFileModule, resolveFunctionModuleExport } from "../hooks/module-loader.js";
4
- import syncFs from "node:fs";
4
+ import fs from "node:fs";
5
5
  import path from "node:path";
6
6
 
7
7
  //#region src/gateway/hooks-mapping.ts
@@ -301,8 +301,8 @@ function escapesBase(baseDir, candidate) {
301
301
  }
302
302
  function safeRealpathSync(candidate) {
303
303
  try {
304
- const nativeRealpath = syncFs.realpathSync.native;
305
- return nativeRealpath ? nativeRealpath(candidate) : syncFs.realpathSync(candidate);
304
+ const nativeRealpath = fs.realpathSync.native;
305
+ return nativeRealpath ? nativeRealpath(candidate) : fs.realpathSync(candidate);
306
306
  } catch {
307
307
  return null;
308
308
  }
@@ -310,7 +310,7 @@ function safeRealpathSync(candidate) {
310
310
  function resolveExistingAncestor(candidate) {
311
311
  let current = path.resolve(candidate);
312
312
  while (true) {
313
- if (syncFs.existsSync(current)) {
313
+ if (fs.existsSync(current)) {
314
314
  return current;
315
315
  }
316
316
  const parent = path.dirname(current);
@@ -0,0 +1,14 @@
1
+ import { resolveRuntimeServiceVersion, resolveRuntimeSource } from "../version.js";
2
+
3
+ //#region src/gateway/probe-payload.ts
4
+ function buildGatewayProbePayload(status) {
5
+ return {
6
+ ok: true,
7
+ status,
8
+ version: resolveRuntimeServiceVersion(process.env, "dev"),
9
+ runtimeSource: resolveRuntimeSource(process.env)
10
+ };
11
+ }
12
+
13
+ //#endregion
14
+ export { buildGatewayProbePayload };
@@ -44,7 +44,8 @@ async function probeGateway(opts) {
44
44
  reason
45
45
  };
46
46
  },
47
- onHelloOk: async () => {
47
+ tlsFingerprint: opts.tlsFingerprint,
48
+ onHelloOk: async (hello) => {
48
49
  connectLatencyMs = Date.now() - startedAt;
49
50
  try {
50
51
  const [health, status, presence, configSnapshot] = await Promise.all([
@@ -61,7 +62,8 @@ async function probeGateway(opts) {
61
62
  health,
62
63
  status,
63
64
  presence: Array.isArray(presence) ? presence : null,
64
- configSnapshot
65
+ configSnapshot,
66
+ server: hello.server
65
67
  });
66
68
  } catch (err) {
67
69
  settle({
@@ -72,7 +74,8 @@ async function probeGateway(opts) {
72
74
  health: null,
73
75
  status: null,
74
76
  presence: null,
75
- configSnapshot: null
77
+ configSnapshot: null,
78
+ server: hello.server
76
79
  });
77
80
  }
78
81
  }
@@ -86,7 +89,8 @@ async function probeGateway(opts) {
86
89
  health: null,
87
90
  status: null,
88
91
  presence: null,
89
- configSnapshot: null
92
+ configSnapshot: null,
93
+ server: null
90
94
  });
91
95
  }, Math.max(250, opts.timeoutMs));
92
96
  client.start();
@@ -1,6 +1,6 @@
1
1
  import { runExec } from "../process/exec.js";
2
2
  import { getTailnetHostname } from "../infra/tailscale.js";
3
- import syncFs from "node:fs";
3
+ import fs from "node:fs";
4
4
  import path from "node:path";
5
5
 
6
6
  //#region src/gateway/server-discovery.ts
@@ -20,7 +20,7 @@ function resolveBonjourCliPath(opts = {}) {
20
20
  if (envPath) {
21
21
  return envPath;
22
22
  }
23
- const statSync = opts.statSync ?? syncFs.statSync;
23
+ const statSync = opts.statSync ?? fs.statSync;
24
24
  const isFile = (candidate) => {
25
25
  try {
26
26
  return statSync(candidate).isFile();
@@ -1,3 +1,4 @@
1
+ import { buildGatewayProbePayload } from "./probe-payload.js";
1
2
  import { createServer } from "node:http";
2
3
  import { createServer as createServer$1 } from "node:https";
3
4
 
@@ -35,10 +36,7 @@ function handleGatewayProbeRequest(req, res, opts) {
35
36
  return true;
36
37
  }
37
38
  res.statusCode = 200;
38
- res.end(method === "HEAD" ? undefined : JSON.stringify({
39
- ok: true,
40
- status
41
- }));
39
+ res.end(method === "HEAD" ? undefined : JSON.stringify(buildGatewayProbePayload(status)));
42
40
  return true;
43
41
  }
44
42
  function createGatewayHttpServer(opts) {
@@ -47,10 +47,11 @@ import { extractHookToken, getHookAgentPolicyError, getHookChannelError, isHookA
47
47
  import { sendGatewayAuthFailure, setDefaultSecurityHeaders } from "./http-common.js";
48
48
  import { getBearerToken, getHeader } from "./http-utils.js";
49
49
  import { handleOpenAiHttpRequest } from "./openai-http.js";
50
+ import { buildGatewayProbePayload } from "./probe-payload.js";
50
51
  import { canonicalizePathVariant } from "./security-path.js";
51
52
  import { handleToolsInvokeHttpRequest } from "./tools-invoke-http.js";
52
53
  import { authorizeGatewayConnect, isLocalDirectRequest } from "./auth.js";
53
- import syncFs from "node:fs";
54
+ import fs from "node:fs";
54
55
  import path from "node:path";
55
56
  import { createServer } from "node:http";
56
57
  import { createServer as createServer$1 } from "node:https";
@@ -2101,7 +2102,7 @@ async function readLocalFederationStatus(env = process.env, fetchImpl = fetch) {
2101
2102
  const sourcePath = path.join(resolveStateDir(env), "federation", "access-token.json");
2102
2103
  const managed = (env.FASED_GATEWAY_MODE ?? "").trim().toLowerCase() === "managed";
2103
2104
  const configured = resolveConfiguredFederationStatus(env);
2104
- if (!syncFs.existsSync(sourcePath)) {
2105
+ if (!fs.existsSync(sourcePath)) {
2105
2106
  return {
2106
2107
  managed,
2107
2108
  sourcePath,
@@ -2113,7 +2114,7 @@ async function readLocalFederationStatus(env = process.env, fetchImpl = fetch) {
2113
2114
  }
2114
2115
  let rawText = "";
2115
2116
  try {
2116
- rawText = syncFs.readFileSync(sourcePath, "utf-8");
2117
+ rawText = fs.readFileSync(sourcePath, "utf-8");
2117
2118
  } catch {
2118
2119
  return {
2119
2120
  managed,
@@ -2162,7 +2163,7 @@ async function readLocalFederationStatus(env = process.env, fetchImpl = fetch) {
2162
2163
  const lifecycle = Number.isFinite(expiresAtMs) ? expiresAtMs > Date.now() ? "active" : "expired" : "invalid";
2163
2164
  let fileUpdatedAt;
2164
2165
  try {
2165
- fileUpdatedAt = syncFs.statSync(sourcePath).mtime.toISOString();
2166
+ fileUpdatedAt = fs.statSync(sourcePath).mtime.toISOString();
2166
2167
  } catch {
2167
2168
  fileUpdatedAt = undefined;
2168
2169
  }
@@ -2649,10 +2650,7 @@ async function handleGatewayProbeRequest(params) {
2649
2650
  } : { ready: false });
2650
2651
  }
2651
2652
  } else {
2652
- body = JSON.stringify({
2653
- ok: true,
2654
- status
2655
- });
2653
+ body = JSON.stringify(buildGatewayProbePayload(status));
2656
2654
  }
2657
2655
  params.res.statusCode = statusCode;
2658
2656
  params.res.end(method === "HEAD" ? undefined : body);
@@ -30,7 +30,7 @@ import { parseMessageWithAttachments } from "../chat-attachments.js";
30
30
  import { injectTimestamp, timestampOptsFromConfig } from "./agent-timestamp.js";
31
31
  import { normalizeRpcAttachmentsToChatAttachments } from "./attachment-normalize.js";
32
32
  import { appendInjectedAssistantMessageToTranscript } from "./chat-transcript-inject.js";
33
- import syncFs from "node:fs";
33
+ import fs from "node:fs";
34
34
  import path from "node:path";
35
35
 
36
36
  //#region src/gateway/server-methods/chat.ts
@@ -321,7 +321,7 @@ function resolveTranscriptPath(params) {
321
321
  }
322
322
  function transcriptHasIdempotencyKey(transcriptPath, idempotencyKey) {
323
323
  try {
324
- const lines = syncFs.readFileSync(transcriptPath, "utf-8").split(/\r?\n/);
324
+ const lines = fs.readFileSync(transcriptPath, "utf-8").split(/\r?\n/);
325
325
  for (const line of lines) {
326
326
  if (!line.trim()) {
327
327
  continue;
@@ -349,7 +349,7 @@ function appendAssistantTranscriptMessage(params) {
349
349
  error: "transcript path not resolved"
350
350
  };
351
351
  }
352
- if (!syncFs.existsSync(transcriptPath)) {
352
+ if (!fs.existsSync(transcriptPath)) {
353
353
  if (!params.createIfMissing) {
354
354
  return {
355
355
  ok: false,
@@ -1,6 +1,6 @@
1
1
  import { defaultRuntime } from "../../runtime.js";
2
2
  import { resolveAgentDir, resolveDefaultAgentId, resolveSessionAgentId } from "../../agents/agent-scope.js";
3
- import { listProviderBrandManifests } from "../../providers/registry.js";
3
+ import { isStandardProviderCatalogEntry, listProviderBrandManifests } from "../../providers/registry.js";
4
4
  import { DEFAULT_PROVIDER } from "../../agents/defaults.js";
5
5
  import { normalizeSecretInput } from "../../utils/normalize-secret-input.js";
6
6
  import { normalizeProviderId } from "../../agents/provider-id.js";
@@ -862,7 +862,8 @@ const modelsHandlers = {
862
862
  });
863
863
  const providerFilter = typeof params.provider === "string" && params.provider.trim() ? normalizeProviderId(params.provider) : "";
864
864
  const modelSource = params.all === true ? usableCatalog : allowedCatalog.length > 0 ? allowedCatalog : usableCatalog;
865
- const models = providerFilter ? modelSource.filter((model) => normalizeProviderId(model.provider) === providerFilter) : modelSource;
865
+ const curatedModelSource = params.all === true ? modelSource : modelSource.filter((model) => model.catalogSource === "configured" || isStandardProviderCatalogEntry(model));
866
+ const models = providerFilter ? curatedModelSource.filter((model) => normalizeProviderId(model.provider) === providerFilter) : curatedModelSource;
866
867
  const payloadModels = params.includeMetadata === true ? models.map((model) => ({
867
868
  ...model,
868
869
  metadata: model.metadata ?? deriveModelMetadata({
@@ -30,7 +30,7 @@ import { clearCheckpointBranchIsolationFields } from "../session-compaction-isol
30
30
  import { applySessionsPatchToStore } from "../sessions-patch.js";
31
31
  import { resolveSessionKeyFromResolveParams } from "../sessions-resolve.js";
32
32
  import { assertValidParams } from "./validation.js";
33
- import syncFs from "node:fs";
33
+ import fs from "node:fs";
34
34
  import path from "node:path";
35
35
  import { randomUUID } from "node:crypto";
36
36
  import { SessionManager } from "@mariozechner/pi-coding-agent";
@@ -196,7 +196,7 @@ function resolveCheckpointSnapshotFile(params) {
196
196
  return null;
197
197
  }
198
198
  try {
199
- if (!syncFs.statSync(filePath).isFile()) {
199
+ if (!fs.statSync(filePath).isFile()) {
200
200
  return null;
201
201
  }
202
202
  } catch {
@@ -543,7 +543,7 @@ const sessionsHandlers = {
543
543
  }
544
544
  const cleanupRestoredFile = () => {
545
545
  try {
546
- syncFs.rmSync(sessionFile, { force: true });
546
+ fs.rmSync(sessionFile, { force: true });
547
547
  } catch {}
548
548
  };
549
549
  const cleanupError = await ensureSessionRuntimeCleanup({
@@ -1068,7 +1068,7 @@ const sessionsHandlers = {
1068
1068
  }, undefined);
1069
1069
  return;
1070
1070
  }
1071
- const filePath = resolveSessionTranscriptCandidates(sessionId, storePath, entry?.sessionFile, target.agentId).find((candidate) => syncFs.existsSync(candidate));
1071
+ const filePath = resolveSessionTranscriptCandidates(sessionId, storePath, entry?.sessionFile, target.agentId).find((candidate) => fs.existsSync(candidate));
1072
1072
  if (!filePath) {
1073
1073
  respond(true, {
1074
1074
  ok: true,
@@ -1078,7 +1078,7 @@ const sessionsHandlers = {
1078
1078
  }, undefined);
1079
1079
  return;
1080
1080
  }
1081
- const raw = syncFs.readFileSync(filePath, "utf-8");
1081
+ const raw = fs.readFileSync(filePath, "utf-8");
1082
1082
  const lines = raw.split(/\r?\n/).filter((l) => l.trim().length > 0);
1083
1083
  if (lines.length <= maxLines) {
1084
1084
  respond(true, {
@@ -1096,7 +1096,7 @@ const sessionsHandlers = {
1096
1096
  const archived = archiveFileOnDisk(filePath, "bak");
1097
1097
  const keptLines = lines.slice(-maxLines);
1098
1098
  try {
1099
- syncFs.writeFileSync(filePath, `${keptLines.join("\n")}\n`, "utf-8");
1099
+ fs.writeFileSync(filePath, `${keptLines.join("\n")}\n`, "utf-8");
1100
1100
  } catch (error) {
1101
1101
  if (preCompactionSnapshot) {
1102
1102
  cleanupSessionCompactionSnapshot(preCompactionSnapshot);
@@ -12,7 +12,7 @@ import { readCronRunLogEntriesPageAll } from "../../cron/run-log.js";
12
12
  import { loadCronStore, resolveCronStorePath } from "../../cron/store.js";
13
13
  import { discoverAllSessions, loadCostUsageSummary, loadSessionCostSummary, loadSessionUsageTimeSeries } from "../../infra/session-cost-usage.js";
14
14
  import { buildUsageAggregateTail } from "../../shared/usage-aggregates.js";
15
- import syncFs from "node:fs";
15
+ import fs from "node:fs";
16
16
 
17
17
  //#region src/gateway/server-methods/usage.ts
18
18
  const COST_USAGE_CACHE_TTL_MS = 3e4;
@@ -662,7 +662,7 @@ const usageHandlers = {
662
662
  return;
663
663
  }
664
664
  try {
665
- const stats = syncFs.statSync(sessionFile);
665
+ const stats = fs.statSync(sessionFile);
666
666
  if (stats.isFile()) {
667
667
  mergedEntries.push({
668
668
  key: resolvedStoreKey,
@@ -68,7 +68,7 @@ import { createWizardSessionTracker } from "./server-wizard-sessions.js";
68
68
  import { attachGatewayWsHandlers } from "./server-ws-runtime.js";
69
69
  import { loadGatewayTlsRuntime } from "./server/tls.js";
70
70
  import { createSessionEventSubscriberRegistry, createSessionMessageSubscriberRegistry } from "./session-event-subscribers.js";
71
- import syncFs from "node:fs";
71
+ import fs from "node:fs";
72
72
  import path from "node:path";
73
73
 
74
74
  //#region src/gateway/server.impl.ts
@@ -99,10 +99,10 @@ function hasConfiguredLocalSignerKeystoreMaterial(env) {
99
99
  }
100
100
  try {
101
101
  const materialDir = resolveLocalSignerMaterialRootDir(env);
102
- if (!syncFs.existsSync(materialDir)) {
102
+ if (!fs.existsSync(materialDir)) {
103
103
  return false;
104
104
  }
105
- return syncFs.readdirSync(materialDir, { withFileTypes: true }).some((entry) => entry.isFile() && /^keystore-solana(?:-.+)?\.v1\.enc$/i.test(entry.name));
105
+ return fs.readdirSync(materialDir, { withFileTypes: true }).some((entry) => entry.isFile() && /^keystore-solana(?:-.+)?\.v1\.enc$/i.test(entry.name));
106
106
  } catch {
107
107
  return false;
108
108
  }
@@ -1,6 +1,6 @@
1
1
  import { isSessionCompactionCheckpointArtifactName } from "../config/sessions/artifacts.js";
2
2
  import "../config/sessions.js";
3
- import syncFs from "node:fs";
3
+ import fs from "node:fs";
4
4
  import path from "node:path";
5
5
  import { randomUUID } from "node:crypto";
6
6
 
@@ -88,7 +88,7 @@ function deleteCheckpointSnapshotIfSafe(filePath, expectedDir) {
88
88
  return;
89
89
  }
90
90
  try {
91
- syncFs.unlinkSync(resolved);
91
+ fs.unlinkSync(resolved);
92
92
  } catch {}
93
93
  }
94
94
  function cleanupSessionCompactionSnapshot(reference) {
@@ -105,7 +105,7 @@ function captureSessionCompactionSnapshot(params) {
105
105
  const resolved = path.resolve(sessionFile);
106
106
  let stat;
107
107
  try {
108
- stat = syncFs.statSync(resolved);
108
+ stat = fs.statSync(resolved);
109
109
  } catch {
110
110
  return null;
111
111
  }
@@ -123,7 +123,7 @@ function captureSessionCompactionSnapshot(params) {
123
123
  const base = path.basename(resolved, ".jsonl");
124
124
  const snapshotFile = path.join(dir, `${base}.checkpoint.${randomUUID()}.jsonl`);
125
125
  try {
126
- syncFs.copyFileSync(resolved, snapshotFile);
126
+ fs.copyFileSync(resolved, snapshotFile);
127
127
  } catch {
128
128
  return null;
129
129
  }
@@ -7,7 +7,7 @@ import { extractToolCallNames, hasToolCall } from "../utils/transcript-tools.js"
7
7
  import { stripEnvelope } from "../shared/chat-envelope.js";
8
8
  import "./chat-sanitize.js";
9
9
  import "../config/sessions.js";
10
- import syncFs from "node:fs";
10
+ import fs from "node:fs";
11
11
  import os from "node:os";
12
12
  import path from "node:path";
13
13
 
@@ -50,11 +50,11 @@ function setCachedSessionTitleFields(cacheKey, stat, value) {
50
50
  }
51
51
  function readSessionMessages(sessionId, storePath, sessionFile) {
52
52
  const candidates = resolveSessionTranscriptCandidates(sessionId, storePath, sessionFile);
53
- const filePath = candidates.find((p) => syncFs.existsSync(p));
53
+ const filePath = candidates.find((p) => fs.existsSync(p));
54
54
  if (!filePath) {
55
55
  return [];
56
56
  }
57
- const lines = syncFs.readFileSync(filePath, "utf-8").split(/\r?\n/);
57
+ const lines = fs.readFileSync(filePath, "utf-8").split(/\r?\n/);
58
58
  const messages = [];
59
59
  for (const line of lines) {
60
60
  if (!line.trim()) {
@@ -123,7 +123,7 @@ function resolveSessionTranscriptCandidates(sessionId, storePath, sessionFile, a
123
123
  function canonicalizePathForComparison(filePath) {
124
124
  const resolved = path.resolve(filePath);
125
125
  try {
126
- return syncFs.realpathSync(resolved);
126
+ return fs.realpathSync(resolved);
127
127
  } catch {
128
128
  return resolved;
129
129
  }
@@ -131,7 +131,7 @@ function canonicalizePathForComparison(filePath) {
131
131
  function archiveFileOnDisk(filePath, reason) {
132
132
  const ts = formatSessionArchiveTimestamp();
133
133
  const archived = `${filePath}.${reason}.${ts}`;
134
- syncFs.renameSync(filePath, archived);
134
+ fs.renameSync(filePath, archived);
135
135
  return archived;
136
136
  }
137
137
  /**
@@ -149,7 +149,7 @@ function archiveSessionTranscripts(opts) {
149
149
  continue;
150
150
  }
151
151
  }
152
- if (!syncFs.existsSync(candidatePath)) {
152
+ if (!fs.existsSync(candidatePath)) {
153
153
  continue;
154
154
  }
155
155
  try {
@@ -171,7 +171,7 @@ async function cleanupArchivedSessionTranscripts(opts) {
171
171
  let removed = 0;
172
172
  let scanned = 0;
173
173
  for (const dir of directories) {
174
- const entries = await syncFs.promises.readdir(dir).catch(() => []);
174
+ const entries = await fs.promises.readdir(dir).catch(() => []);
175
175
  for (const entry of entries) {
176
176
  const timestamp = parseSessionArchiveTimestamp(entry, reason);
177
177
  if (timestamp == null) {
@@ -182,11 +182,11 @@ async function cleanupArchivedSessionTranscripts(opts) {
182
182
  continue;
183
183
  }
184
184
  const fullPath = path.join(dir, entry);
185
- const stat = await syncFs.promises.stat(fullPath).catch(() => null);
185
+ const stat = await fs.promises.stat(fullPath).catch(() => null);
186
186
  if (!stat?.isFile()) {
187
187
  continue;
188
188
  }
189
- await syncFs.promises.rm(fullPath).catch(() => undefined);
189
+ await fs.promises.rm(fullPath).catch(() => undefined);
190
190
  removed += 1;
191
191
  }
192
192
  }
@@ -225,7 +225,7 @@ function capArrayByJsonBytes(items, maxBytes) {
225
225
  const MAX_LINES_TO_SCAN = 10;
226
226
  function readSessionTitleFieldsFromTranscript(sessionId, storePath, sessionFile, agentId, opts) {
227
227
  const candidates = resolveSessionTranscriptCandidates(sessionId, storePath, sessionFile, agentId);
228
- const filePath = candidates.find((p) => syncFs.existsSync(p));
228
+ const filePath = candidates.find((p) => fs.existsSync(p));
229
229
  if (!filePath) {
230
230
  return {
231
231
  firstUserMessage: null,
@@ -234,7 +234,7 @@ function readSessionTitleFieldsFromTranscript(sessionId, storePath, sessionFile,
234
234
  }
235
235
  let stat;
236
236
  try {
237
- stat = syncFs.statSync(filePath);
237
+ stat = fs.statSync(filePath);
238
238
  } catch {
239
239
  return {
240
240
  firstUserMessage: null,
@@ -256,7 +256,7 @@ function readSessionTitleFieldsFromTranscript(sessionId, storePath, sessionFile,
256
256
  }
257
257
  let fd = null;
258
258
  try {
259
- fd = syncFs.openSync(filePath, "r");
259
+ fd = fs.openSync(filePath, "r");
260
260
  const size = stat.size;
261
261
  let firstUserMessage = null;
262
262
  try {
@@ -286,7 +286,7 @@ function readSessionTitleFieldsFromTranscript(sessionId, storePath, sessionFile,
286
286
  } finally {
287
287
  if (fd !== null) {
288
288
  try {
289
- syncFs.closeSync(fd);
289
+ fs.closeSync(fd);
290
290
  } catch {}
291
291
  }
292
292
  }
@@ -314,7 +314,7 @@ function extractTextFromContent(content) {
314
314
  }
315
315
  function readTranscriptHeadChunk(fd, maxBytes = 8192) {
316
316
  const buf = Buffer.alloc(maxBytes);
317
- const bytesRead = syncFs.readSync(fd, buf, 0, buf.length, 0);
317
+ const bytesRead = fs.readSync(fd, buf, 0, buf.length, 0);
318
318
  if (bytesRead <= 0) {
319
319
  return null;
320
320
  }
@@ -345,16 +345,16 @@ function extractFirstUserMessageFromTranscriptChunk(chunk, opts) {
345
345
  }
346
346
  function findExistingTranscriptPath(sessionId, storePath, sessionFile, agentId) {
347
347
  const candidates = resolveSessionTranscriptCandidates(sessionId, storePath, sessionFile, agentId);
348
- return candidates.find((p) => syncFs.existsSync(p)) ?? null;
348
+ return candidates.find((p) => fs.existsSync(p)) ?? null;
349
349
  }
350
350
  function withOpenTranscriptFd(filePath, read) {
351
351
  let fd = null;
352
352
  try {
353
- fd = syncFs.openSync(filePath, "r");
353
+ fd = fs.openSync(filePath, "r");
354
354
  return read(fd);
355
355
  } catch {} finally {
356
356
  if (fd !== null) {
357
- syncFs.closeSync(fd);
357
+ fs.closeSync(fd);
358
358
  }
359
359
  }
360
360
  return null;
@@ -378,7 +378,7 @@ function readLastMessagePreviewFromOpenTranscript(params) {
378
378
  const readStart = Math.max(0, params.size - LAST_MSG_MAX_BYTES);
379
379
  const readLen = Math.min(params.size, LAST_MSG_MAX_BYTES);
380
380
  const buf = Buffer.alloc(readLen);
381
- syncFs.readSync(params.fd, buf, 0, readLen, readStart);
381
+ fs.readSync(params.fd, buf, 0, readLen, readStart);
382
382
  const chunk = buf.toString("utf-8");
383
383
  const lines = chunk.split(/\r?\n/).filter((l) => l.trim());
384
384
  const tailLines = lines.slice(-LAST_MSG_MAX_LINES);
@@ -404,7 +404,7 @@ function readLastMessagePreviewFromTranscript(sessionId, storePath, sessionFile,
404
404
  return null;
405
405
  }
406
406
  return withOpenTranscriptFd(filePath, (fd) => {
407
- const stat = syncFs.fstatSync(fd);
407
+ const stat = fs.fstatSync(fd);
408
408
  const size = stat.size;
409
409
  if (size === 0) {
410
410
  return null;
@@ -522,8 +522,8 @@ function buildPreviewItems(messages, maxItems, maxChars) {
522
522
  function readRecentMessagesFromTranscript(filePath, maxMessages, readBytes) {
523
523
  let fd = null;
524
524
  try {
525
- fd = syncFs.openSync(filePath, "r");
526
- const stat = syncFs.fstatSync(fd);
525
+ fd = fs.openSync(filePath, "r");
526
+ const stat = fs.fstatSync(fd);
527
527
  const size = stat.size;
528
528
  if (size === 0) {
529
529
  return [];
@@ -531,7 +531,7 @@ function readRecentMessagesFromTranscript(filePath, maxMessages, readBytes) {
531
531
  const readStart = Math.max(0, size - readBytes);
532
532
  const readLen = Math.min(size, readBytes);
533
533
  const buf = Buffer.alloc(readLen);
534
- syncFs.readSync(fd, buf, 0, readLen, readStart);
534
+ fs.readSync(fd, buf, 0, readLen, readStart);
535
535
  const chunk = buf.toString("utf-8");
536
536
  const lines = chunk.split(/\r?\n/).filter((l) => l.trim());
537
537
  const tailLines = lines.slice(-PREVIEW_MAX_LINES);
@@ -554,13 +554,13 @@ function readRecentMessagesFromTranscript(filePath, maxMessages, readBytes) {
554
554
  return [];
555
555
  } finally {
556
556
  if (fd !== null) {
557
- syncFs.closeSync(fd);
557
+ fs.closeSync(fd);
558
558
  }
559
559
  }
560
560
  }
561
561
  function readSessionPreviewItemsFromTranscript(sessionId, storePath, sessionFile, agentId, maxItems, maxChars) {
562
562
  const candidates = resolveSessionTranscriptCandidates(sessionId, storePath, sessionFile, agentId);
563
- const filePath = candidates.find((p) => syncFs.existsSync(p));
563
+ const filePath = candidates.find((p) => fs.existsSync(p));
564
564
  if (!filePath) {
565
565
  return [];
566
566
  }
@@ -19,7 +19,7 @@ import { loadSessionStore } from "../config/sessions/store.js";
19
19
  import "../config/sessions.js";
20
20
  import { lookupContextTokens } from "../agents/context.js";
21
21
  import { listSessionCompactionCheckpoints } from "./session-compaction-checkpoints.js";
22
- import syncFs from "node:fs";
22
+ import fs from "node:fs";
23
23
  import path from "node:path";
24
24
 
25
25
  //#region src/gateway/session-utils.ts
@@ -41,7 +41,7 @@ function isCombinedSessionStoreCacheFresh(entry) {
41
41
  }
42
42
  function readSessionStoreSignature(storePath) {
43
43
  try {
44
- const stat = syncFs.statSync(storePath);
44
+ const stat = fs.statSync(storePath);
45
45
  return {
46
46
  storePath,
47
47
  exists: true,
@@ -94,7 +94,7 @@ function clearCombinedSessionStoreCacheForTest() {
94
94
  }
95
95
  function tryResolveExistingPath(value) {
96
96
  try {
97
- return syncFs.realpathSync(value);
97
+ return fs.realpathSync(value);
98
98
  } catch {
99
99
  return null;
100
100
  }
@@ -132,11 +132,11 @@ function resolveIdentityAvatarUrl(cfg, agentId, avatar) {
132
132
  return undefined;
133
133
  }
134
134
  try {
135
- const buffer = syncFs.readFileSync(opened.fd);
135
+ const buffer = fs.readFileSync(opened.fd);
136
136
  const mime = resolveAvatarMime(resolvedCandidate);
137
137
  return `data:${mime};base64,${buffer.toString("base64")}`;
138
138
  } finally {
139
- syncFs.closeSync(opened.fd);
139
+ fs.closeSync(opened.fd);
140
140
  }
141
141
  } catch {
142
142
  return undefined;
@@ -304,7 +304,7 @@ function listExistingAgentIdsFromDisk() {
304
304
  const root = resolveStateDir();
305
305
  const agentsDir = path.join(root, "agents");
306
306
  try {
307
- const entries = syncFs.readdirSync(agentsDir, { withFileTypes: true });
307
+ const entries = fs.readdirSync(agentsDir, { withFileTypes: true });
308
308
  return entries.filter((entry) => entry.isDirectory()).map((entry) => normalizeAgentId(entry.name)).filter(Boolean);
309
309
  } catch {
310
310
  return [];