@fased/fased 0.1.48 → 0.1.49

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 (330) 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-health.js +11 -5
  6. package/dist/agents/auth-profiles/paths.js +2 -2
  7. package/dist/agents/auth-profiles/store.js +2 -2
  8. package/dist/agents/bash-tools.shared.js +2 -2
  9. package/dist/agents/cli-credentials.js +4 -4
  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/pi-embedded-subscribe.raw-stream.js +3 -3
  15. package/dist/agents/pi-extensions/compaction-safeguard.js +3 -3
  16. package/dist/agents/pi-model-discovery.js +6 -6
  17. package/dist/agents/pi-project-settings.js +3 -3
  18. package/dist/agents/sandbox/fs-bridge.js +2 -2
  19. package/dist/agents/session-dirs.js +4 -4
  20. package/dist/agents/session-write-lock.js +13 -13
  21. package/dist/agents/shell-utils.js +5 -5
  22. package/dist/agents/skills/bundled-dir.js +4 -4
  23. package/dist/agents/skills/local-loader.js +6 -6
  24. package/dist/agents/skills/plugin-skills.js +2 -2
  25. package/dist/agents/skills/workspace.js +13 -13
  26. package/dist/agents/skills-install-download.js +7 -7
  27. package/dist/agents/skills-install-plan.js +2 -2
  28. package/dist/agents/skills-install.js +2 -2
  29. package/dist/agents/skills-status.js +2 -2
  30. package/dist/agents/subagent-depth.js +2 -2
  31. package/dist/agents/system-prompt-params.js +2 -2
  32. package/dist/agents/workspace.js +22 -22
  33. package/dist/auto-reply/reply/agent-runner-execution.js +2 -2
  34. package/dist/auto-reply/reply/agent-runner.js +2 -2
  35. package/dist/auto-reply/reply/commands-export-session.js +7 -7
  36. package/dist/auto-reply/reply/post-compaction-audit.js +3 -3
  37. package/dist/auto-reply/reply/post-compaction-context.js +3 -3
  38. package/dist/auto-reply/reply/session.js +3 -3
  39. package/dist/auto-reply/skill-commands.js +3 -3
  40. package/dist/auto-reply/status.js +6 -6
  41. package/dist/brand.js +1 -1
  42. package/dist/browser/chrome.executables.js +3 -3
  43. package/dist/browser/chrome.js +3 -3
  44. package/dist/browser/chrome.profile-decoration.js +6 -6
  45. package/dist/browser/profiles-service.js +2 -2
  46. package/dist/browser/server-context.js +2 -2
  47. package/dist/browser/trash.js +4 -4
  48. package/dist/build-info.json +3 -3
  49. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  50. package/dist/canvas-host/server.js +4 -4
  51. package/dist/capabilities/catalog.js +3 -3
  52. package/dist/channels/plugins/catalog.js +3 -3
  53. package/dist/cli/browser-cli-extension.js +6 -6
  54. package/dist/cli/command-format.js +2 -2
  55. package/dist/cli/cron-cli/register.cron-simple.js +2 -2
  56. package/dist/cli/dns-cli.js +9 -9
  57. package/dist/cli/gateway-cli/dev.js +5 -5
  58. package/dist/cli/gateway-cli/run.js +2 -2
  59. package/dist/cli/hooks-cli.js +5 -5
  60. package/dist/cli/memory-cli.js +7 -7
  61. package/dist/cli/nodes-media-utils.js +2 -2
  62. package/dist/cli/plugins-cli.js +2 -2
  63. package/dist/cli/secrets-cli.js +3 -3
  64. package/dist/cli/windows-argv.js +2 -2
  65. package/dist/commands/dashboard-link.js +3 -3
  66. package/dist/commands/doctor-install.js +5 -5
  67. package/dist/commands/doctor-memory-search.js +2 -2
  68. package/dist/commands/doctor-platform-notes.js +2 -2
  69. package/dist/commands/doctor-sandbox.js +2 -2
  70. package/dist/commands/doctor-state-integrity.js +48 -25
  71. package/dist/commands/doctor-workspace.js +3 -3
  72. package/dist/commands/doctor.js +3 -3
  73. package/dist/commands/managed-up.js +2 -2
  74. package/dist/commands/onboard-auth.credentials.js +3 -3
  75. package/dist/commands/onboarding/plugin-install.js +2 -2
  76. package/dist/commands/sessions-cleanup.js +2 -2
  77. package/dist/commands/signal-install.js +6 -6
  78. package/dist/commands/status-all/channels.js +2 -2
  79. package/dist/commands/wallet.js +47 -47
  80. package/dist/config/cache-utils.js +2 -2
  81. package/dist/config/includes.js +5 -5
  82. package/dist/config/io.js +2 -2
  83. package/dist/config/paths.js +3 -3
  84. package/dist/config/sat-runtime-ids.js +3 -3
  85. package/dist/config/sessions/disk-budget.js +6 -6
  86. package/dist/config/sessions/paths.js +2 -2
  87. package/dist/config/sessions/store.js +17 -17
  88. package/dist/config/sessions/transcript.js +32 -18
  89. package/dist/config/sessions.js +2 -2
  90. package/dist/config/talk.js +2 -2
  91. package/dist/control-ui/assets/{app-CHqTx3P_.js → app-6iCry787.js} +1274 -1259
  92. package/dist/control-ui/assets/{chat-model-ref-BbrdMKjQ.js → chat-model-ref-C6CFR-GR.js} +2 -2
  93. package/dist/control-ui/assets/{config-FFZLTSLS.js → config-CU5Zi8Dh.js} +2 -2
  94. package/dist/control-ui/assets/{index-CFHfNlLv.js → index-CNFgocD9.js} +3 -3
  95. package/dist/control-ui/assets/{mining-D_VAMFMY.js → mining-BdhMn18r.js} +3 -3
  96. package/dist/control-ui/assets/{providers-DqFL6WrJ.js → providers-WTJ1kMKy.js} +14 -3
  97. package/dist/control-ui/index.html +1 -1
  98. package/dist/cron/service/store.js +2 -2
  99. package/dist/cron/store.js +6 -6
  100. package/dist/daemon/systemd-system.js +5 -5
  101. package/dist/discord/monitor/thread-bindings.state.js +2 -2
  102. package/dist/extensions/sat-mining/src/sat-bond-layout.js +9 -9
  103. package/dist/gateway/control-ui-boot-check.js +6 -6
  104. package/dist/gateway/control-ui-login.js +7 -7
  105. package/dist/gateway/control-ui.js +9 -9
  106. package/dist/gateway/hooks-mapping.js +4 -4
  107. package/dist/gateway/protocol/schema/agents-models-skills.js +1 -0
  108. package/dist/gateway/protocol/schema/frames.js +5 -0
  109. package/dist/gateway/protocol/schema/snapshot.js +1 -0
  110. package/dist/gateway/server/ws-connection/message-handler.js +2 -1
  111. package/dist/gateway/server-discovery.js +2 -2
  112. package/dist/gateway/server-http.js +5 -4
  113. package/dist/gateway/server-methods/chat.js +7 -32
  114. package/dist/gateway/server-methods/sessions.js +6 -6
  115. package/dist/gateway/server-methods/usage.js +2 -2
  116. package/dist/gateway/server.impl.js +3 -3
  117. package/dist/gateway/session-compaction-checkpoints.js +4 -4
  118. package/dist/gateway/session-utils.fs.js +24 -24
  119. package/dist/gateway/session-utils.js +6 -6
  120. package/dist/hooks/bundled-dir.js +4 -4
  121. package/dist/hooks/gmail-setup-utils.js +6 -6
  122. package/dist/hooks/import-url.js +2 -2
  123. package/dist/hooks/loader.js +4 -4
  124. package/dist/hooks/workspace.js +7 -7
  125. package/dist/infra/archive.js +17 -17
  126. package/dist/infra/boundary-file-read.js +2 -2
  127. package/dist/infra/boundary-path.js +15 -15
  128. package/dist/infra/brew.js +2 -2
  129. package/dist/infra/control-ui-assets.js +14 -14
  130. package/dist/infra/device-auth-store.js +8 -8
  131. package/dist/infra/device-identity.js +8 -8
  132. package/dist/infra/dotenv.js +2 -2
  133. package/dist/infra/exec-approvals.js +8 -8
  134. package/dist/infra/exec-command-resolution.js +4 -4
  135. package/dist/infra/exec-safe-bin-trust.js +2 -2
  136. package/dist/infra/fased-root.js +5 -5
  137. package/dist/infra/fs-safe.js +14 -14
  138. package/dist/infra/gateway-lock.js +11 -11
  139. package/dist/infra/git-commit.js +5 -5
  140. package/dist/infra/git-root.js +4 -4
  141. package/dist/infra/hosted-runtime-artifact.js +3 -3
  142. package/dist/infra/is-main.js +2 -2
  143. package/dist/infra/json-file.js +7 -7
  144. package/dist/infra/outbound/delivery-queue.js +16 -16
  145. package/dist/infra/path-env.js +3 -3
  146. package/dist/infra/ports-lsof.js +4 -4
  147. package/dist/infra/provider-usage.auth.js +3 -3
  148. package/dist/infra/safe-open-sync.js +2 -2
  149. package/dist/infra/session-cost-usage.js +9 -9
  150. package/dist/infra/shell-env.js +2 -2
  151. package/dist/infra/state-migrations.fs.js +6 -6
  152. package/dist/infra/state-migrations.js +23 -23
  153. package/dist/infra/system-presence.js +4 -2
  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-status.js +1 -1
  158. package/dist/line/accounts.js +2 -2
  159. package/dist/line/download.js +2 -2
  160. package/dist/logging/config.js +3 -3
  161. package/dist/logging/logger.js +7 -7
  162. package/dist/managed/federation.js +3 -3
  163. package/dist/managed/tunnel.js +3 -3
  164. package/dist/media/store.js +13 -13
  165. package/dist/media-understanding/runner.js +3 -3
  166. package/dist/memory/embeddings.js +2 -2
  167. package/dist/memory/internal.js +10 -10
  168. package/dist/memory/inventory.js +19 -0
  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-DI5226U8.js → accounts-B5fY9hZy.js} +1 -1
  176. package/dist/plugin-sdk/{actions-CEj4gOU2.js → actions-D-9SsSEy.js} +2 -2
  177. package/dist/plugin-sdk/{active-listener-Ss4UKXZb.js → active-listener-BH7rDR47.js} +1 -1
  178. package/dist/plugin-sdk/{audio-preflight-Cu4alGjb.js → audio-preflight-4faayz5S.js} +26 -26
  179. package/dist/plugin-sdk/{audit-BTskqjJ_.js → audit-BQfsboqd.js} +1 -1
  180. package/dist/plugin-sdk/{channel-access-B1KciKmw.js → channel-access-CDZ-cJPq.js} +1 -1
  181. package/dist/plugin-sdk/{channel-access-configure-Y91FLOJc.js → channel-access-configure-DlpuhlH6.js} +1 -1
  182. package/dist/plugin-sdk/channel-plugin-common.js +4 -4
  183. package/dist/plugin-sdk/{chunk-CSUjIQSx.js → chunk-CZuCyS7k.js} +1 -1
  184. package/dist/plugin-sdk/{chunk-items-Q8HhMuSe.js → chunk-items-Cyc4Kl6A.js} +1 -1
  185. package/dist/plugin-sdk/command-status.js +26 -26
  186. package/dist/plugin-sdk/{commands-registry-DJ0pfCcY.js → commands-registry-COIbIjGO.js} +2 -2
  187. package/dist/plugin-sdk/{common-Cjm8psuW.js → common-LMHJe8KW.js} +1 -1
  188. package/dist/plugin-sdk/{config-DutIeFge.js → config-ZMbTT0kM.js} +1 -1
  189. package/dist/plugin-sdk/{config-schema-Cg6PYSHR.js → config-schema-Cku0a8Tm.js} +75 -60
  190. package/dist/plugin-sdk/discord.d.ts +1 -1
  191. package/dist/plugin-sdk/discord.js +19 -19
  192. package/dist/plugin-sdk/{handle-action-Dp2741iu.js → handle-action-C8ZZfORB.js} +13 -13
  193. package/dist/plugin-sdk/{helpers-BCZ9d3fl.js → helpers-vfzH9tBn.js} +1 -1
  194. package/dist/plugin-sdk/{image-ops-B-QR_M9Z.js → image-ops-BnOmQA5d.js} +1 -1
  195. package/dist/plugin-sdk/index.d.ts +13 -13
  196. package/dist/plugin-sdk/index.js +28 -28
  197. package/dist/plugin-sdk/json-store.js +6 -6
  198. package/dist/plugin-sdk/{login-BFvQxf9o.js → login-C73Wpiw8.js} +3 -3
  199. package/dist/plugin-sdk/{login-qr-CERTe_nD.js → login-qr-CRKHA7i8.js} +3 -3
  200. package/dist/plugin-sdk/{manager-Dhq3SXpO.js → manager-CHYhpKHn.js} +2 -2
  201. package/dist/plugin-sdk/{markdown-tables-B1Tx7c77.js → markdown-tables-B84dPWNG.js} +1 -1
  202. package/dist/plugin-sdk/{media-BwsqooWC.js → media-4daDcNER.js} +2 -2
  203. package/dist/plugin-sdk/{monitor-CJiacqtR.js → monitor-CChc6bQV.js} +30 -30
  204. package/dist/plugin-sdk/{monitor-BYzN5Qr4.js → monitor-DJhU-J5u.js} +31 -31
  205. package/dist/plugin-sdk/{openresponses-http-VLSSqCZZ.js → openresponses-http-Dvyczr35.js} +26 -26
  206. package/dist/plugin-sdk/{optional-runtime-dependency-BEBP4VFJ.js → optional-runtime-dependency-BFpqaCzp.js} +1 -1
  207. package/dist/plugin-sdk/{outbound-BqWgaC5M.js → outbound-C1xBxfNb.js} +6 -6
  208. package/dist/plugin-sdk/{outbound-attachment-L1q40kiu.js → outbound-attachment-DvcxPP7b.js} +2 -2
  209. package/dist/plugin-sdk/{pairing-message-CZBahREg.js → pairing-message-DpYT614h.js} +1 -1
  210. package/dist/plugin-sdk/{pairing-store-D7I1Qmiw.js → pairing-store-CprpGco9.js} +2 -2
  211. package/dist/plugin-sdk/{pi-model-discovery-C5klknQZ.js → pi-model-discovery-BQ6fFRBA.js} +1 -1
  212. package/dist/plugin-sdk/{pi-model-discovery-runtime-DIEMhCZ5.js → pi-model-discovery-runtime-BF_89lVj.js} +2 -2
  213. package/dist/plugin-sdk/{pw-ai-Bv-q25gY.js → pw-ai-xgpIbHOr.js} +3 -3
  214. package/dist/plugin-sdk/{replies-Bd9ktEkq.js → replies-AzJ6U6Ut.js} +2 -2
  215. package/dist/plugin-sdk/{resolve-outbound-target-CCIyBb5H.js → resolve-outbound-target-COo_TR7B.js} +1 -1
  216. package/dist/plugin-sdk/{resolve-route-B7vZ3nKp.js → resolve-route-CZFzHOIe.js} +1 -1
  217. package/dist/plugin-sdk/{retry-policy-ChC3G4lv.js → retry-policy-BSdqqXsI.js} +1 -1
  218. package/dist/plugin-sdk/{runtime-BLknHFGz.js → runtime-CeoGffDi.js} +31 -18
  219. package/dist/plugin-sdk/{runtime-dependency-C5rJfC0u.js → runtime-dependency-Cvbs0GXf.js} +2 -2
  220. package/dist/plugin-sdk/sat-runtime.js +5 -5
  221. package/dist/plugin-sdk/{send-Bd3Z-jAd.js → send-B_-UtG9F.js} +6 -6
  222. package/dist/plugin-sdk/{send-Bmtz9ICm.js → send-C0Q1u7N1.js} +8 -8
  223. package/dist/plugin-sdk/{send-mkyZzhCO.js → send-CGE7OgsA.js} +5 -5
  224. package/dist/plugin-sdk/{send-CUGEhiUa.js → send-DCxAv7bV.js} +6 -6
  225. package/dist/plugin-sdk/{send-CMoWt-EX.js → send-DVpCBUuL.js} +7 -7
  226. package/dist/plugin-sdk/{session-D2zmelOL.js → session-ETYBbhLn.js} +2 -2
  227. package/dist/plugin-sdk/{skill-commands-BybEjJ1_.js → skill-commands-BQL6TBIv.js} +2 -2
  228. package/dist/plugin-sdk/{slack-DogXvGG3.js → slack-Bs_4uivd.js} +38 -38
  229. package/dist/plugin-sdk/{slack-actions-uXb55QWW.js → slack-actions-CBPZkfTS.js} +11 -11
  230. package/dist/plugin-sdk/slack.d.ts +1 -1
  231. package/dist/plugin-sdk/slack.js +9 -9
  232. package/dist/plugin-sdk/{sticker-cache-BuPw7fTf.js → sticker-cache-BBZMp-oQ.js} +3 -3
  233. package/dist/plugin-sdk/{tables-CVDOT5dX.js → tables-B-G7Bb0l.js} +1 -1
  234. package/dist/plugin-sdk/{targets-DskkhJAp.js → targets-D8UaoWHd.js} +1 -1
  235. package/dist/plugin-sdk/{telegram-actions-_KQPbjpI.js → telegram-actions-BARLx9zc.js} +29 -29
  236. package/dist/plugin-sdk/telegram.d.ts +1 -1
  237. package/dist/plugin-sdk/telegram.js +8 -8
  238. package/dist/plugin-sdk/{thread-bindings.lifecycle-CrhQXYEU.js → thread-bindings.lifecycle-DwYKCLLq.js} +3 -3
  239. package/dist/plugin-sdk/{thread-bindings.state-ssxdG7xV.js → thread-bindings.state-BNWfHA0f.js} +2 -2
  240. package/dist/plugin-sdk/{wallet-status-CQI89c_6.js → wallet-status-Coekn_SJ.js} +10 -3
  241. package/dist/plugin-sdk/{web-C8DwA0eO.js → web-BwolzGVF.js} +31 -31
  242. package/dist/plugin-sdk/{whatsapp-actions-DfvM-mlZ.js → whatsapp-actions-CSvf6eev.js} +13 -13
  243. package/dist/plugin-sdk/{whatsapp-heartbeat-DyJasLDB.js → whatsapp-heartbeat-Bw7OtTe6.js} +2 -2
  244. package/dist/plugin-sdk/whatsapp.d.ts +10 -10
  245. package/dist/plugin-sdk/whatsapp.js +12 -12
  246. package/dist/plugin-sdk/{wsl-JwmI6Zu8.js → wsl-By1Mc-oS.js} +3 -3
  247. package/dist/plugin-sdk/{zod-schema.providers-core-BE_5DNhj.d.ts → zod-schema.providers-core-TI6sL-6B.d.ts} +82 -82
  248. package/dist/plugins/bundled-dir.js +3 -3
  249. package/dist/plugins/discovery.js +11 -11
  250. package/dist/plugins/loader.js +13 -13
  251. package/dist/plugins/manifest-registry.js +2 -2
  252. package/dist/plugins/manifest.js +4 -4
  253. package/dist/plugins/path-safety.js +3 -3
  254. package/dist/plugins/status-cache.js +9 -9
  255. package/dist/plugins/update.js +3 -3
  256. package/dist/plugins/web-search-install-catalog.js +3 -3
  257. package/dist/providers/registry.js +1 -1
  258. package/dist/secrets/apply.js +16 -16
  259. package/dist/secrets/audit.js +11 -11
  260. package/dist/secrets/shared.js +9 -9
  261. package/dist/security/scan-paths.js +2 -2
  262. package/dist/shared/config-eval.js +2 -2
  263. package/dist/shared/pid-alive.js +2 -2
  264. package/dist/tasks/standing-orders.js +5 -5
  265. package/dist/tasks/task-flow-registry.js +5 -5
  266. package/dist/tasks/task-registry.js +5 -5
  267. package/dist/tasks/workflow-definitions.js +6 -6
  268. package/dist/telegram/token.js +5 -5
  269. package/dist/utils.js +5 -5
  270. package/dist/version.js +11 -1
  271. package/dist/wallet/local-socket-signer-broker.js +16 -16
  272. package/dist/wallet/providers/embedded-keystore-adapter.js +5 -5
  273. package/dist/wallet/providers/local-socket-signer-adapter.js +2 -2
  274. package/dist/wallet/wallet-approval-auth.js +5 -5
  275. package/dist/wallet/wallet-audit-log.js +5 -5
  276. package/dist/wallet/wallet-custody.js +21 -21
  277. package/dist/wallet/wallet-inbound-events.js +5 -5
  278. package/dist/wallet/wallet-observability.js +5 -5
  279. package/dist/wallet/wallet-policy.js +9 -9
  280. package/dist/wallet/wallet-provider-registry.js +7 -7
  281. package/dist/wallet/wallet-runtime-config.js +3 -3
  282. package/dist/wallet/wallet-secrets-store.js +22 -22
  283. package/dist/wallet/wallet-send-approvals.js +5 -5
  284. package/dist/wallet/wallet-settlement-links.js +5 -5
  285. package/dist/web/accounts.js +3 -3
  286. package/dist/web/auth-store.js +18 -18
  287. package/dist/web/session.js +4 -4
  288. package/dist/wizard/host-security-capability.js +2 -2
  289. package/dist/wizard/onboarding.host-security.js +7 -7
  290. package/dist/wizard/onboarding.js +7 -7
  291. package/dist/wizard/onboarding.wallet.js +44 -44
  292. package/extensions/acpx/package.json +1 -1
  293. package/extensions/bluebubbles/package.json +1 -1
  294. package/extensions/copilot-proxy/package.json +1 -1
  295. package/extensions/diagnostics-otel/package.json +1 -1
  296. package/extensions/fased-federation/package.json +1 -1
  297. package/extensions/google-gemini-cli-auth/package.json +1 -1
  298. package/extensions/imessage/package.json +1 -1
  299. package/extensions/irc/package.json +1 -1
  300. package/extensions/line/package.json +1 -1
  301. package/extensions/llm-task/package.json +1 -1
  302. package/extensions/lobster/package.json +1 -1
  303. package/extensions/matrix/CHANGELOG.md +6 -0
  304. package/extensions/matrix/package.json +1 -1
  305. package/extensions/mattermost/package.json +1 -1
  306. package/extensions/memory-core/package.json +2 -2
  307. package/extensions/memory-lancedb/package.json +1 -1
  308. package/extensions/minimax-portal-auth/package.json +1 -1
  309. package/extensions/msteams/CHANGELOG.md +6 -0
  310. package/extensions/msteams/package.json +1 -1
  311. package/extensions/nextcloud-talk/package.json +1 -1
  312. package/extensions/nostr/CHANGELOG.md +6 -0
  313. package/extensions/nostr/package.json +1 -1
  314. package/extensions/open-prose/package.json +1 -1
  315. package/extensions/sat-mining/index.ts +121 -12
  316. package/extensions/sat-mining/package.json +1 -1
  317. package/extensions/sat-mining/src/runtime.ts +9 -3
  318. package/extensions/signal/package.json +1 -1
  319. package/extensions/synology-chat/package.json +1 -1
  320. package/extensions/tlon/package.json +1 -1
  321. package/extensions/twitch/CHANGELOG.md +6 -0
  322. package/extensions/twitch/package.json +1 -1
  323. package/extensions/voice-call/CHANGELOG.md +6 -0
  324. package/extensions/voice-call/package.json +1 -1
  325. package/extensions/zalo/CHANGELOG.md +6 -0
  326. package/extensions/zalo/package.json +1 -1
  327. package/extensions/zalouser/CHANGELOG.md +6 -0
  328. package/extensions/zalouser/package.json +1 -1
  329. package/package.json +1 -1
  330. package/scripts/start-managed.sh +21 -1
@@ -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 fs from "node:fs";
4
+ import syncFs 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 = fs.realpathSync.native;
305
- return nativeRealpath ? nativeRealpath(candidate) : fs.realpathSync(candidate);
304
+ const nativeRealpath = syncFs.realpathSync.native;
305
+ return nativeRealpath ? nativeRealpath(candidate) : syncFs.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 (fs.existsSync(current)) {
313
+ if (syncFs.existsSync(current)) {
314
314
  return current;
315
315
  }
316
316
  const parent = path.dirname(current);
@@ -303,6 +303,7 @@ const ModelsAuthStatusParamsSchema = Type.Object({}, { additionalProperties: fal
303
303
  const ModelsAuthStatusKindSchema = Type.Union([
304
304
  Type.Literal("ok"),
305
305
  Type.Literal("expiring"),
306
+ Type.Literal("refresh-required"),
306
307
  Type.Literal("expired"),
307
308
  Type.Literal("missing"),
308
309
  Type.Literal("static")
@@ -47,6 +47,11 @@ const HelloOkSchema = Type.Object({
47
47
  protocol: Type.Integer({ minimum: 1 }),
48
48
  server: Type.Object({
49
49
  version: NonEmptyString,
50
+ runtimeSource: Type.Optional(Type.Union([
51
+ Type.Literal("source-checkout"),
52
+ Type.Literal("managed-package"),
53
+ Type.Literal("packaged-runtime")
54
+ ])),
50
55
  connId: NonEmptyString
51
56
  }, { additionalProperties: false }),
52
57
  features: Type.Object({
@@ -6,6 +6,7 @@ const PresenceEntrySchema = Type.Object({
6
6
  host: Type.Optional(NonEmptyString),
7
7
  ip: Type.Optional(NonEmptyString),
8
8
  version: Type.Optional(NonEmptyString),
9
+ runtimeSource: Type.Optional(NonEmptyString),
9
10
  platform: Type.Optional(NonEmptyString),
10
11
  deviceFamily: Type.Optional(NonEmptyString),
11
12
  modelIdentifier: Type.Optional(NonEmptyString),
@@ -1,4 +1,4 @@
1
- import { resolveRuntimeServiceVersion } from "../../../version.js";
1
+ import { resolveRuntimeServiceVersion, resolveRuntimeSource } from "../../../version.js";
2
2
  import { loadConfig } from "../../../config/io.js";
3
3
  import "../../../config/config.js";
4
4
  import { GATEWAY_CLIENT_IDS } from "../../protocol/client-info.js";
@@ -744,6 +744,7 @@ function attachGatewayWsMessageHandler(params) {
744
744
  protocol: PROTOCOL_VERSION,
745
745
  server: {
746
746
  version: resolveRuntimeServiceVersion(process.env, "dev"),
747
+ runtimeSource: resolveRuntimeSource(process.env),
747
748
  connId
748
749
  },
749
750
  features: {
@@ -1,6 +1,6 @@
1
1
  import { runExec } from "../process/exec.js";
2
2
  import { getTailnetHostname } from "../infra/tailscale.js";
3
- import fs from "node:fs";
3
+ import syncFs 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 ?? fs.statSync;
23
+ const statSync = opts.statSync ?? syncFs.statSync;
24
24
  const isFile = (candidate) => {
25
25
  try {
26
26
  return statSync(candidate).isFile();
@@ -50,7 +50,7 @@ import { handleOpenAiHttpRequest } from "./openai-http.js";
50
50
  import { canonicalizePathVariant } from "./security-path.js";
51
51
  import { handleToolsInvokeHttpRequest } from "./tools-invoke-http.js";
52
52
  import { authorizeGatewayConnect, isLocalDirectRequest } from "./auth.js";
53
- import fs from "node:fs";
53
+ import syncFs from "node:fs";
54
54
  import path from "node:path";
55
55
  import { createServer } from "node:http";
56
56
  import { createServer as createServer$1 } from "node:https";
@@ -2101,7 +2101,7 @@ async function readLocalFederationStatus(env = process.env, fetchImpl = fetch) {
2101
2101
  const sourcePath = path.join(resolveStateDir(env), "federation", "access-token.json");
2102
2102
  const managed = (env.FASED_GATEWAY_MODE ?? "").trim().toLowerCase() === "managed";
2103
2103
  const configured = resolveConfiguredFederationStatus(env);
2104
- if (!fs.existsSync(sourcePath)) {
2104
+ if (!syncFs.existsSync(sourcePath)) {
2105
2105
  return {
2106
2106
  managed,
2107
2107
  sourcePath,
@@ -2113,7 +2113,7 @@ async function readLocalFederationStatus(env = process.env, fetchImpl = fetch) {
2113
2113
  }
2114
2114
  let rawText = "";
2115
2115
  try {
2116
- rawText = fs.readFileSync(sourcePath, "utf-8");
2116
+ rawText = syncFs.readFileSync(sourcePath, "utf-8");
2117
2117
  } catch {
2118
2118
  return {
2119
2119
  managed,
@@ -2162,7 +2162,7 @@ async function readLocalFederationStatus(env = process.env, fetchImpl = fetch) {
2162
2162
  const lifecycle = Number.isFinite(expiresAtMs) ? expiresAtMs > Date.now() ? "active" : "expired" : "invalid";
2163
2163
  let fileUpdatedAt;
2164
2164
  try {
2165
- fileUpdatedAt = fs.statSync(sourcePath).mtime.toISOString();
2165
+ fileUpdatedAt = syncFs.statSync(sourcePath).mtime.toISOString();
2166
2166
  } catch {
2167
2167
  fileUpdatedAt = undefined;
2168
2168
  }
@@ -5693,6 +5693,7 @@ function createGatewayHttpServer(opts) {
5693
5693
  "yes"
5694
5694
  ].includes(String(parsedUrl.searchParams.get("forceFresh") ?? "").trim().toLowerCase());
5695
5695
  const result = await callSatMiningGateway("sat.getMiningStatus", {
5696
+ statusMode: "ui",
5696
5697
  responsive: true,
5697
5698
  ...forceFresh ? { forceFresh: true } : {}
5698
5699
  }, { timeoutMs: 6e4 });
@@ -10,6 +10,7 @@ import { stripEnvelopeFromMessage, stripEnvelopeFromMessages } from "../chat-san
10
10
  import { capArrayByJsonBytes, readSessionMessages } from "../session-utils.fs.js";
11
11
  import { loadSessionStore } from "../../config/sessions/store.js";
12
12
  import { emitSessionTranscriptUpdate } from "../../sessions/transcript-events.js";
13
+ import { ensureSessionTranscriptHeader } from "../../config/sessions/transcript.js";
13
14
  import "../../config/sessions.js";
14
15
  import { loadSessionEntry, resolveGatewaySessionStoreTarget, resolveSessionModelRef } from "../session-utils.js";
15
16
  import { GATEWAY_CLIENT_CAPS, hasGatewayClientCap } from "../protocol/client-info.js";
@@ -29,9 +30,8 @@ import { parseMessageWithAttachments } from "../chat-attachments.js";
29
30
  import { injectTimestamp, timestampOptsFromConfig } from "./agent-timestamp.js";
30
31
  import { normalizeRpcAttachmentsToChatAttachments } from "./attachment-normalize.js";
31
32
  import { appendInjectedAssistantMessageToTranscript } from "./chat-transcript-inject.js";
32
- import fs from "node:fs";
33
+ import syncFs from "node:fs";
33
34
  import path from "node:path";
34
- import { CURRENT_SESSION_VERSION } from "@mariozechner/pi-coding-agent";
35
35
 
36
36
  //#region src/gateway/server-methods/chat.ts
37
37
  const CHAT_HISTORY_TEXT_MAX_CHARS = 12e3;
@@ -319,34 +319,9 @@ function resolveTranscriptPath(params) {
319
319
  return null;
320
320
  }
321
321
  }
322
- function ensureTranscriptFile(params) {
323
- if (fs.existsSync(params.transcriptPath)) {
324
- return { ok: true };
325
- }
326
- try {
327
- fs.mkdirSync(path.dirname(params.transcriptPath), { recursive: true });
328
- const header = {
329
- type: "session",
330
- version: CURRENT_SESSION_VERSION,
331
- id: params.sessionId,
332
- timestamp: new Date().toISOString(),
333
- cwd: process.cwd()
334
- };
335
- fs.writeFileSync(params.transcriptPath, `${JSON.stringify(header)}\n`, {
336
- encoding: "utf-8",
337
- mode: 384
338
- });
339
- return { ok: true };
340
- } catch (err) {
341
- return {
342
- ok: false,
343
- error: err instanceof Error ? err.message : String(err)
344
- };
345
- }
346
- }
347
322
  function transcriptHasIdempotencyKey(transcriptPath, idempotencyKey) {
348
323
  try {
349
- const lines = fs.readFileSync(transcriptPath, "utf-8").split(/\r?\n/);
324
+ const lines = syncFs.readFileSync(transcriptPath, "utf-8").split(/\r?\n/);
350
325
  for (const line of lines) {
351
326
  if (!line.trim()) {
352
327
  continue;
@@ -374,18 +349,18 @@ function appendAssistantTranscriptMessage(params) {
374
349
  error: "transcript path not resolved"
375
350
  };
376
351
  }
377
- if (!fs.existsSync(transcriptPath)) {
352
+ if (!syncFs.existsSync(transcriptPath)) {
378
353
  if (!params.createIfMissing) {
379
354
  return {
380
355
  ok: false,
381
356
  error: "transcript file not found"
382
357
  };
383
358
  }
384
- const ensured = ensureTranscriptFile({
385
- transcriptPath,
359
+ const ensured = ensureSessionTranscriptHeader({
360
+ sessionFile: transcriptPath,
386
361
  sessionId: params.sessionId
387
362
  });
388
- if (!ensured.ok) {
363
+ if (ensured.error) {
389
364
  return {
390
365
  ok: false,
391
366
  error: ensured.error ?? "failed to create transcript file"
@@ -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 fs from "node:fs";
33
+ import syncFs 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 (!fs.statSync(filePath).isFile()) {
199
+ if (!syncFs.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
- fs.rmSync(sessionFile, { force: true });
546
+ syncFs.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) => fs.existsSync(candidate));
1071
+ const filePath = resolveSessionTranscriptCandidates(sessionId, storePath, entry?.sessionFile, target.agentId).find((candidate) => syncFs.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 = fs.readFileSync(filePath, "utf-8");
1081
+ const raw = syncFs.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
- fs.writeFileSync(filePath, `${keptLines.join("\n")}\n`, "utf-8");
1099
+ syncFs.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 fs from "node:fs";
15
+ import syncFs 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 = fs.statSync(sessionFile);
665
+ const stats = syncFs.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 fs from "node:fs";
71
+ import syncFs 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 (!fs.existsSync(materialDir)) {
102
+ if (!syncFs.existsSync(materialDir)) {
103
103
  return false;
104
104
  }
105
- return fs.readdirSync(materialDir, { withFileTypes: true }).some((entry) => entry.isFile() && /^keystore-solana(?:-.+)?\.v1\.enc$/i.test(entry.name));
105
+ return syncFs.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 fs from "node:fs";
3
+ import syncFs 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
- fs.unlinkSync(resolved);
91
+ syncFs.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 = fs.statSync(resolved);
108
+ stat = syncFs.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
- fs.copyFileSync(resolved, snapshotFile);
126
+ syncFs.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 fs from "node:fs";
10
+ import syncFs 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) => fs.existsSync(p));
53
+ const filePath = candidates.find((p) => syncFs.existsSync(p));
54
54
  if (!filePath) {
55
55
  return [];
56
56
  }
57
- const lines = fs.readFileSync(filePath, "utf-8").split(/\r?\n/);
57
+ const lines = syncFs.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 fs.realpathSync(resolved);
126
+ return syncFs.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
- fs.renameSync(filePath, archived);
134
+ syncFs.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 (!fs.existsSync(candidatePath)) {
152
+ if (!syncFs.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 fs.promises.readdir(dir).catch(() => []);
174
+ const entries = await syncFs.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 fs.promises.stat(fullPath).catch(() => null);
185
+ const stat = await syncFs.promises.stat(fullPath).catch(() => null);
186
186
  if (!stat?.isFile()) {
187
187
  continue;
188
188
  }
189
- await fs.promises.rm(fullPath).catch(() => undefined);
189
+ await syncFs.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) => fs.existsSync(p));
228
+ const filePath = candidates.find((p) => syncFs.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 = fs.statSync(filePath);
237
+ stat = syncFs.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 = fs.openSync(filePath, "r");
259
+ fd = syncFs.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
- fs.closeSync(fd);
289
+ syncFs.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 = fs.readSync(fd, buf, 0, buf.length, 0);
317
+ const bytesRead = syncFs.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) => fs.existsSync(p)) ?? null;
348
+ return candidates.find((p) => syncFs.existsSync(p)) ?? null;
349
349
  }
350
350
  function withOpenTranscriptFd(filePath, read) {
351
351
  let fd = null;
352
352
  try {
353
- fd = fs.openSync(filePath, "r");
353
+ fd = syncFs.openSync(filePath, "r");
354
354
  return read(fd);
355
355
  } catch {} finally {
356
356
  if (fd !== null) {
357
- fs.closeSync(fd);
357
+ syncFs.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
- fs.readSync(params.fd, buf, 0, readLen, readStart);
381
+ syncFs.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 = fs.fstatSync(fd);
407
+ const stat = syncFs.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 = fs.openSync(filePath, "r");
526
- const stat = fs.fstatSync(fd);
525
+ fd = syncFs.openSync(filePath, "r");
526
+ const stat = syncFs.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
- fs.readSync(fd, buf, 0, readLen, readStart);
534
+ syncFs.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
- fs.closeSync(fd);
557
+ syncFs.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) => fs.existsSync(p));
563
+ const filePath = candidates.find((p) => syncFs.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 fs from "node:fs";
22
+ import syncFs 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 = fs.statSync(storePath);
44
+ const stat = syncFs.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 fs.realpathSync(value);
97
+ return syncFs.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 = fs.readFileSync(opened.fd);
135
+ const buffer = syncFs.readFileSync(opened.fd);
136
136
  const mime = resolveAvatarMime(resolvedCandidate);
137
137
  return `data:${mime};base64,${buffer.toString("base64")}`;
138
138
  } finally {
139
- fs.closeSync(opened.fd);
139
+ syncFs.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 = fs.readdirSync(agentsDir, { withFileTypes: true });
307
+ const entries = syncFs.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 [];
@@ -1,5 +1,5 @@
1
1
  import { fileURLToPath } from "node:url";
2
- import fs from "node:fs";
2
+ import syncFs from "node:fs";
3
3
  import path from "node:path";
4
4
 
5
5
  //#region src/hooks/bundled-dir.ts
@@ -11,14 +11,14 @@ function resolveBundledHooksDir() {
11
11
  try {
12
12
  const execDir = path.dirname(process.execPath);
13
13
  const sibling = path.join(execDir, "hooks", "bundled");
14
- if (fs.existsSync(sibling)) {
14
+ if (syncFs.existsSync(sibling)) {
15
15
  return sibling;
16
16
  }
17
17
  } catch {}
18
18
  try {
19
19
  const moduleDir = path.dirname(fileURLToPath(import.meta.url));
20
20
  const distBundled = path.join(moduleDir, "bundled");
21
- if (fs.existsSync(distBundled)) {
21
+ if (syncFs.existsSync(distBundled)) {
22
22
  return distBundled;
23
23
  }
24
24
  } catch {}
@@ -26,7 +26,7 @@ function resolveBundledHooksDir() {
26
26
  const moduleDir = path.dirname(fileURLToPath(import.meta.url));
27
27
  const root = path.resolve(moduleDir, "..", "..");
28
28
  const srcBundled = path.join(root, "src", "hooks", "bundled");
29
- if (fs.existsSync(srcBundled)) {
29
+ if (syncFs.existsSync(srcBundled)) {
30
30
  return srcBundled;
31
31
  }
32
32
  } catch {}
@@ -3,7 +3,7 @@ import { runCommandWithTimeout } from "../process/exec.js";
3
3
  import { hasBinary } from "../shared/config-eval.js";
4
4
  import "../agents/skills.js";
5
5
  import { normalizeServePath } from "./gmail.js";
6
- import fs from "node:fs";
6
+ import syncFs from "node:fs";
7
7
  import path from "node:path";
8
8
 
9
9
  //#region src/hooks/gmail-setup-utils.ts
@@ -71,7 +71,7 @@ function findExecutablesOnPath(bins) {
71
71
  continue;
72
72
  }
73
73
  try {
74
- fs.accessSync(candidate, fs.constants.X_OK);
74
+ syncFs.accessSync(candidate, syncFs.constants.X_OK);
75
75
  matches.push(candidate);
76
76
  seen.add(candidate);
77
77
  } catch {}
@@ -100,7 +100,7 @@ function ensureGcloudOnPath() {
100
100
  ];
101
101
  for (const candidate of candidates) {
102
102
  try {
103
- fs.accessSync(candidate, fs.constants.X_OK);
103
+ syncFs.accessSync(candidate, syncFs.constants.X_OK);
104
104
  ensurePathIncludes(path.dirname(candidate), "append");
105
105
  return true;
106
106
  } catch {}
@@ -126,7 +126,7 @@ async function resolvePythonExecutablePath() {
126
126
  continue;
127
127
  }
128
128
  try {
129
- fs.accessSync(resolved, fs.constants.X_OK);
129
+ syncFs.accessSync(resolved, syncFs.constants.X_OK);
130
130
  cachedPythonPath = resolved;
131
131
  return resolved;
132
132
  } catch {}
@@ -303,11 +303,11 @@ async function ensureTailscaleEndpoint(params) {
303
303
  async function resolveProjectIdFromGogCredentials() {
304
304
  const candidates = gogCredentialsPaths();
305
305
  for (const candidate of candidates) {
306
- if (!fs.existsSync(candidate)) {
306
+ if (!syncFs.existsSync(candidate)) {
307
307
  continue;
308
308
  }
309
309
  try {
310
- const raw = fs.readFileSync(candidate, "utf-8");
310
+ const raw = syncFs.readFileSync(candidate, "utf-8");
311
311
  const parsed = JSON.parse(raw);
312
312
  const clientId = extractGogClientId(parsed);
313
313
  const projectNumber = extractProjectNumber(clientId);