@fased/fased 0.1.42 → 0.1.43

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 (273) 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/docs-path.js +3 -3
  10. package/dist/agents/embedded-pi-mcp.js +4 -4
  11. package/dist/agents/identity-avatar.js +3 -3
  12. package/dist/agents/identity-file.js +2 -2
  13. package/dist/agents/pi-embedded-subscribe.raw-stream.js +3 -3
  14. package/dist/agents/pi-extensions/compaction-safeguard.js +3 -3
  15. package/dist/agents/pi-model-discovery.js +6 -6
  16. package/dist/agents/pi-project-settings.js +3 -3
  17. package/dist/agents/sandbox/fs-bridge.js +2 -2
  18. package/dist/agents/session-dirs.js +4 -4
  19. package/dist/agents/session-write-lock.js +13 -13
  20. package/dist/agents/shell-utils.js +5 -5
  21. package/dist/agents/skills/bundled-dir.js +4 -4
  22. package/dist/agents/skills/local-loader.js +6 -6
  23. package/dist/agents/skills/plugin-skills.js +2 -2
  24. package/dist/agents/skills/workspace.js +13 -13
  25. package/dist/agents/skills-install-download.js +7 -7
  26. package/dist/agents/skills-install-plan.js +2 -2
  27. package/dist/agents/skills-install.js +2 -2
  28. package/dist/agents/skills-status.js +2 -2
  29. package/dist/agents/subagent-depth.js +2 -2
  30. package/dist/agents/system-prompt-params.js +2 -2
  31. package/dist/agents/workspace.js +22 -22
  32. package/dist/auto-reply/reply/agent-runner-execution.js +2 -2
  33. package/dist/auto-reply/reply/agent-runner.js +2 -2
  34. package/dist/auto-reply/reply/commands-export-session.js +7 -7
  35. package/dist/auto-reply/reply/post-compaction-audit.js +3 -3
  36. package/dist/auto-reply/reply/post-compaction-context.js +3 -3
  37. package/dist/auto-reply/reply/session.js +3 -3
  38. package/dist/auto-reply/skill-commands.js +3 -3
  39. package/dist/auto-reply/status.js +6 -6
  40. package/dist/brand.js +1 -1
  41. package/dist/browser/chrome.executables.js +3 -3
  42. package/dist/browser/chrome.js +3 -3
  43. package/dist/browser/chrome.profile-decoration.js +6 -6
  44. package/dist/browser/profiles-service.js +2 -2
  45. package/dist/browser/server-context.js +2 -2
  46. package/dist/browser/trash.js +4 -4
  47. package/dist/build-info.json +3 -3
  48. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  49. package/dist/canvas-host/server.js +4 -4
  50. package/dist/capabilities/catalog.js +3 -3
  51. package/dist/channels/plugins/catalog.js +3 -3
  52. package/dist/cli/browser-cli-extension.js +6 -6
  53. package/dist/cli/command-format.js +2 -2
  54. package/dist/cli/cron-cli/register.cron-simple.js +2 -2
  55. package/dist/cli/daemon-cli/restart-health.js +49 -13
  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/update-cli/shared.js +1 -29
  65. package/dist/cli/update-cli/update-command.js +12 -15
  66. package/dist/cli/windows-argv.js +2 -2
  67. package/dist/commands/dashboard-link.js +3 -3
  68. package/dist/commands/doctor-install.js +5 -5
  69. package/dist/commands/doctor-memory-search.js +2 -2
  70. package/dist/commands/doctor-platform-notes.js +2 -2
  71. package/dist/commands/doctor-sandbox.js +2 -2
  72. package/dist/commands/doctor-state-integrity.js +23 -23
  73. package/dist/commands/doctor-workspace.js +3 -3
  74. package/dist/commands/doctor.js +3 -3
  75. package/dist/commands/managed-up.js +2 -2
  76. package/dist/commands/onboard-auth.credentials.js +3 -3
  77. package/dist/commands/onboarding/plugin-install.js +2 -2
  78. package/dist/commands/sessions-cleanup.js +2 -2
  79. package/dist/commands/signal-install.js +6 -6
  80. package/dist/commands/status-all/channels.js +2 -2
  81. package/dist/commands/wallet.js +47 -47
  82. package/dist/config/cache-utils.js +2 -2
  83. package/dist/config/includes.js +5 -5
  84. package/dist/config/io.js +2 -2
  85. package/dist/config/paths.js +3 -3
  86. package/dist/config/sat-runtime-ids.js +3 -3
  87. package/dist/config/sessions/disk-budget.js +6 -6
  88. package/dist/config/sessions/paths.js +2 -2
  89. package/dist/config/sessions/store.js +17 -17
  90. package/dist/config/sessions/transcript.js +4 -4
  91. package/dist/config/talk.js +2 -2
  92. package/dist/cron/service/store.js +2 -2
  93. package/dist/cron/store.js +6 -6
  94. package/dist/daemon/systemd-system.js +5 -5
  95. package/dist/discord/monitor/thread-bindings.state.js +2 -2
  96. package/dist/extensions/sat-mining/src/sat-bond-layout.js +9 -9
  97. package/dist/gateway/control-ui-boot-check.js +6 -6
  98. package/dist/gateway/control-ui-login.js +7 -7
  99. package/dist/gateway/control-ui.js +9 -9
  100. package/dist/gateway/hooks-mapping.js +4 -4
  101. package/dist/gateway/server-discovery.js +2 -2
  102. package/dist/gateway/server-http.js +4 -4
  103. package/dist/gateway/server-methods/chat.js +6 -6
  104. package/dist/gateway/server-methods/sessions.js +6 -6
  105. package/dist/gateway/server-methods/usage.js +2 -2
  106. package/dist/gateway/server.impl.js +3 -3
  107. package/dist/gateway/session-compaction-checkpoints.js +4 -4
  108. package/dist/gateway/session-utils.fs.js +24 -24
  109. package/dist/gateway/session-utils.js +6 -6
  110. package/dist/hooks/bundled-dir.js +4 -4
  111. package/dist/hooks/gmail-setup-utils.js +6 -6
  112. package/dist/hooks/import-url.js +2 -2
  113. package/dist/hooks/loader.js +4 -4
  114. package/dist/hooks/workspace.js +7 -7
  115. package/dist/infra/archive.js +17 -17
  116. package/dist/infra/boundary-file-read.js +2 -2
  117. package/dist/infra/boundary-path.js +15 -15
  118. package/dist/infra/brew.js +2 -2
  119. package/dist/infra/control-ui-assets.js +14 -14
  120. package/dist/infra/device-auth-store.js +8 -8
  121. package/dist/infra/device-identity.js +8 -8
  122. package/dist/infra/dotenv.js +2 -2
  123. package/dist/infra/exec-approvals.js +8 -8
  124. package/dist/infra/exec-command-resolution.js +4 -4
  125. package/dist/infra/exec-safe-bin-trust.js +2 -2
  126. package/dist/infra/fased-root.js +5 -5
  127. package/dist/infra/fs-safe.js +14 -14
  128. package/dist/infra/gateway-lock.js +11 -11
  129. package/dist/infra/git-commit.js +5 -5
  130. package/dist/infra/git-root.js +4 -4
  131. package/dist/infra/hosted-runtime-artifact.js +3 -3
  132. package/dist/infra/is-main.js +2 -2
  133. package/dist/infra/json-file.js +7 -7
  134. package/dist/infra/outbound/delivery-queue.js +16 -16
  135. package/dist/infra/path-env.js +3 -3
  136. package/dist/infra/ports-lsof.js +4 -4
  137. package/dist/infra/provider-usage.auth.js +3 -3
  138. package/dist/infra/safe-open-sync.js +2 -2
  139. package/dist/infra/session-cost-usage.js +9 -9
  140. package/dist/infra/shell-env.js +2 -2
  141. package/dist/infra/state-migrations.fs.js +6 -6
  142. package/dist/infra/state-migrations.js +23 -23
  143. package/dist/infra/tmp-fased-dir.js +6 -6
  144. package/dist/infra/update-global.js +1 -0
  145. package/dist/infra/update-runner.js +111 -64
  146. package/dist/infra/widearea-dns.js +3 -3
  147. package/dist/infra/wsl.js +2 -2
  148. package/dist/light-update-status.js +1 -1
  149. package/dist/line/accounts.js +2 -2
  150. package/dist/line/download.js +2 -2
  151. package/dist/logging/config.js +3 -3
  152. package/dist/logging/logger.js +7 -7
  153. package/dist/managed/federation.js +3 -3
  154. package/dist/managed/tunnel.js +3 -3
  155. package/dist/media/store.js +13 -13
  156. package/dist/media-understanding/runner.js +3 -3
  157. package/dist/memory/embeddings.js +2 -2
  158. package/dist/memory/internal.js +10 -10
  159. package/dist/memory/manager-sync-ops.js +7 -7
  160. package/dist/memory/repair-executor.js +17 -17
  161. package/dist/node-host/invoke-system-run-plan.js +8 -8
  162. package/dist/node-host/invoke.js +2 -2
  163. package/dist/node-host/runner.js +3 -3
  164. package/dist/pairing/pairing-store.js +3 -3
  165. package/dist/plugin-sdk/{audio-preflight-XJNZUuhw.js → audio-preflight-CzG6BjAn.js} +3 -3
  166. package/dist/plugin-sdk/channel-plugin-common.d.ts +2 -2
  167. package/dist/plugin-sdk/{chunk-items-me0j1xjK.js → chunk-items-CxRDAM7m.js} +1 -1
  168. package/dist/plugin-sdk/command-status.js +3 -3
  169. package/dist/plugin-sdk/device-pair.d.ts +1 -1
  170. package/dist/plugin-sdk/discord.d.ts +4 -4
  171. package/dist/plugin-sdk/index.d.ts +20 -20
  172. package/dist/plugin-sdk/index.js +5 -4
  173. package/dist/plugin-sdk/json-store.js +6 -6
  174. package/dist/plugin-sdk/{monitor-C7si_bKw.js → monitor-B1PUtkd6.js} +5 -5
  175. package/dist/plugin-sdk/{monitor-DUyt6cCK.js → monitor-BrxWsb7H.js} +7 -7
  176. package/dist/plugin-sdk/{openresponses-http-sYsdEjGP.js → openresponses-http-DJ2lfMja.js} +3 -3
  177. package/dist/plugin-sdk/{pairing-message-C5m-8Evp.d.ts → pairing-message-DWXHX-jt.d.ts} +1 -1
  178. package/dist/plugin-sdk/{pi-embedded-runner-C6HkZJ5E.js → pi-embedded-runner-DMfkIj60.js} +12 -12
  179. package/dist/plugin-sdk/provider-web-search-config-contract.d.ts +1 -1
  180. package/dist/plugin-sdk/{pw-ai-BFHYmEIx.js → pw-ai-BgsJH_P8.js} +1 -1
  181. package/dist/plugin-sdk/{runtime-dependency-B5Fut2tT.js → runtime-dependency-pUwxUAJp.js} +9 -9
  182. package/dist/plugin-sdk/sat-runtime.d.ts +2 -2
  183. package/dist/plugin-sdk/sat-runtime.js +1 -1
  184. package/dist/plugin-sdk/{slack-CEoLScM7.js → slack-B6lIY1Jk.js} +5 -5
  185. package/dist/plugin-sdk/slack.d.ts +4 -4
  186. package/dist/plugin-sdk/{sticker-cache-PRfvBRnv.js → sticker-cache-D4Ljzv1P.js} +2 -2
  187. package/dist/plugin-sdk/{telegram-actions-D4PNLPEZ.js → telegram-actions-tOhBd6st.js} +4 -4
  188. package/dist/plugin-sdk/telegram.d.ts +4 -4
  189. package/dist/plugin-sdk/{tmp-fased-dir-B-AAdaCr.d.ts → tmp-fased-dir-Be1wBhVz.d.ts} +1 -1
  190. package/dist/plugin-sdk/{types-ZT0DGnls.d.ts → types-CJGVZX6j.d.ts} +2 -2
  191. package/dist/plugin-sdk/{types-56R2vXgt.d.ts → types-CXLEOrJX.d.ts} +1 -1
  192. package/dist/plugin-sdk/{wallet-status-D9UVH6k9.js → wallet-status-CdxTkLWz.js} +4 -4
  193. package/dist/plugin-sdk/{web-CSpyzE3P.js → web-CX12Rpz1.js} +3 -3
  194. package/dist/plugin-sdk/whatsapp.d.ts +13 -13
  195. package/dist/plugin-sdk/{zod-schema.providers-core-FaYR6KdD.d.ts → zod-schema.providers-core-BEbNizPe.d.ts} +78 -78
  196. package/dist/plugins/bundled-dir.js +3 -3
  197. package/dist/plugins/discovery.js +11 -11
  198. package/dist/plugins/loader.js +13 -13
  199. package/dist/plugins/manifest-registry.js +2 -2
  200. package/dist/plugins/manifest.js +4 -4
  201. package/dist/plugins/path-safety.js +3 -3
  202. package/dist/plugins/status-cache.js +9 -9
  203. package/dist/plugins/update.js +3 -3
  204. package/dist/plugins/web-search-install-catalog.js +3 -3
  205. package/dist/secrets/apply.js +16 -16
  206. package/dist/secrets/audit.js +11 -11
  207. package/dist/secrets/shared.js +9 -9
  208. package/dist/security/scan-paths.js +2 -2
  209. package/dist/shared/config-eval.js +2 -2
  210. package/dist/shared/pid-alive.js +2 -2
  211. package/dist/tasks/standing-orders.js +5 -5
  212. package/dist/tasks/task-flow-registry.js +5 -5
  213. package/dist/tasks/task-registry.js +5 -5
  214. package/dist/tasks/workflow-definitions.js +6 -6
  215. package/dist/telegram/token.js +5 -5
  216. package/dist/utils.js +5 -5
  217. package/dist/wallet/local-socket-signer-broker.js +16 -16
  218. package/dist/wallet/providers/embedded-keystore-adapter.js +5 -5
  219. package/dist/wallet/providers/local-socket-signer-adapter.js +2 -2
  220. package/dist/wallet/wallet-approval-auth.js +5 -5
  221. package/dist/wallet/wallet-audit-log.js +5 -5
  222. package/dist/wallet/wallet-custody.js +21 -21
  223. package/dist/wallet/wallet-inbound-events.js +5 -5
  224. package/dist/wallet/wallet-observability.js +5 -5
  225. package/dist/wallet/wallet-policy.js +9 -9
  226. package/dist/wallet/wallet-provider-registry.js +7 -7
  227. package/dist/wallet/wallet-runtime-config.js +3 -3
  228. package/dist/wallet/wallet-secrets-store.js +22 -22
  229. package/dist/wallet/wallet-send-approvals.js +5 -5
  230. package/dist/wallet/wallet-settlement-links.js +5 -5
  231. package/dist/web/accounts.js +3 -3
  232. package/dist/web/auth-store.js +18 -18
  233. package/dist/web/session.js +4 -4
  234. package/dist/wizard/host-security-capability.js +2 -2
  235. package/dist/wizard/onboarding.host-security.js +7 -7
  236. package/dist/wizard/onboarding.js +7 -7
  237. package/dist/wizard/onboarding.wallet.js +44 -44
  238. package/extensions/acpx/package.json +1 -1
  239. package/extensions/bluebubbles/package.json +1 -1
  240. package/extensions/copilot-proxy/package.json +1 -1
  241. package/extensions/diagnostics-otel/package.json +1 -1
  242. package/extensions/fased-federation/package.json +1 -1
  243. package/extensions/google-gemini-cli-auth/package.json +1 -1
  244. package/extensions/imessage/package.json +1 -1
  245. package/extensions/irc/package.json +1 -1
  246. package/extensions/line/package.json +1 -1
  247. package/extensions/llm-task/package.json +1 -1
  248. package/extensions/lobster/package.json +1 -1
  249. package/extensions/matrix/CHANGELOG.md +6 -0
  250. package/extensions/matrix/package.json +1 -1
  251. package/extensions/mattermost/package.json +1 -1
  252. package/extensions/memory-core/package.json +2 -2
  253. package/extensions/memory-lancedb/package.json +1 -1
  254. package/extensions/minimax-portal-auth/package.json +1 -1
  255. package/extensions/msteams/CHANGELOG.md +6 -0
  256. package/extensions/msteams/package.json +1 -1
  257. package/extensions/nextcloud-talk/package.json +1 -1
  258. package/extensions/nostr/CHANGELOG.md +6 -0
  259. package/extensions/nostr/package.json +1 -1
  260. package/extensions/open-prose/package.json +1 -1
  261. package/extensions/sat-mining/package.json +1 -1
  262. package/extensions/signal/package.json +1 -1
  263. package/extensions/synology-chat/package.json +1 -1
  264. package/extensions/tlon/package.json +1 -1
  265. package/extensions/twitch/CHANGELOG.md +6 -0
  266. package/extensions/twitch/package.json +1 -1
  267. package/extensions/voice-call/CHANGELOG.md +6 -0
  268. package/extensions/voice-call/package.json +1 -1
  269. package/extensions/zalo/CHANGELOG.md +6 -0
  270. package/extensions/zalo/package.json +1 -1
  271. package/extensions/zalouser/CHANGELOG.md +6 -0
  272. package/extensions/zalouser/package.json +1 -1
  273. package/package.json +1 -1
@@ -7,7 +7,7 @@ import { capEntryCount, loadSessionStore, pruneStaleEntries, resolveMaintenanceC
7
7
  import "../config/sessions.js";
8
8
  import { resolveSessionStoreTargets } from "./session-store-targets.js";
9
9
  import { SESSION_AGE_PAD, SESSION_KEY_PAD, SESSION_MODEL_PAD, formatSessionAgeCell, formatSessionFlagsCell, formatSessionKeyCell, formatSessionModelCell, resolveSessionDisplayDefaults, resolveSessionDisplayModel, toSessionDisplayRows } from "./sessions-table.js";
10
- import syncFs from "node:fs";
10
+ import fs from "node:fs";
11
11
 
12
12
  //#region src/commands/sessions-cleanup.ts
13
13
  const ACTION_PAD = 12;
@@ -65,7 +65,7 @@ function pruneMissingTranscriptEntries(params) {
65
65
  continue;
66
66
  }
67
67
  const transcriptPath = resolveSessionFilePath(entry.sessionId, entry, sessionPathOpts);
68
- if (!syncFs.existsSync(transcriptPath)) {
68
+ if (!fs.existsSync(transcriptPath)) {
69
69
  delete params.store[key];
70
70
  removed += 1;
71
71
  params.onPruned?.(key);
@@ -5,7 +5,7 @@ import { resolveBrewExecutable } from "../infra/brew.js";
5
5
  import { createWriteStream } from "node:fs";
6
6
  import os from "node:os";
7
7
  import path from "node:path";
8
- import fs from "node:fs/promises";
8
+ import fs$1 from "node:fs/promises";
9
9
  import { pipeline } from "node:stream/promises";
10
10
  import { request } from "node:https";
11
11
 
@@ -79,7 +79,7 @@ async function findSignalCliBinary(root) {
79
79
  if (depth > 3) {
80
80
  return;
81
81
  }
82
- const entries = await fs.readdir(dir, { withFileTypes: true }).catch(() => []);
82
+ const entries = await fs$1.readdir(dir, { withFileTypes: true }).catch(() => []);
83
83
  for (const entry of entries) {
84
84
  const full = path.join(dir, entry.name);
85
85
  if (entry.isDirectory()) {
@@ -103,7 +103,7 @@ async function resolveBrewSignalCliPath(brewExe) {
103
103
  const prefix = result.stdout.trim();
104
104
  const candidate = path.join(prefix, "bin", "signal-cli");
105
105
  try {
106
- await fs.access(candidate);
106
+ await fs$1.access(candidate);
107
107
  return candidate;
108
108
  } catch {
109
109
  return findSignalCliBinary(prefix);
@@ -172,12 +172,12 @@ async function installSignalCliFromRelease(runtime) {
172
172
  error: "No compatible release asset found for this platform."
173
173
  };
174
174
  }
175
- const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "fased-signal-"));
175
+ const tmpDir = await fs$1.mkdtemp(path.join(os.tmpdir(), "fased-signal-"));
176
176
  const archivePath = path.join(tmpDir, asset.name);
177
177
  runtime.log(`Downloading signal-cli ${version} (${asset.name})…`);
178
178
  await downloadToFile(asset.browser_download_url, archivePath);
179
179
  const installRoot = path.join(CONFIG_DIR, "tools", "signal-cli", version);
180
- await fs.mkdir(installRoot, { recursive: true });
180
+ await fs$1.mkdir(installRoot, { recursive: true });
181
181
  if (!looksLikeArchive(asset.name.toLowerCase())) {
182
182
  return {
183
183
  ok: false,
@@ -200,7 +200,7 @@ async function installSignalCliFromRelease(runtime) {
200
200
  error: `signal-cli binary not found after extracting ${asset.name}`
201
201
  };
202
202
  }
203
- await fs.chmod(cliPath, 493).catch(() => {});
203
+ await fs$1.chmod(cliPath, 493).catch(() => {});
204
204
  return {
205
205
  ok: true,
206
206
  cliPath,
@@ -4,7 +4,7 @@ import { formatTimeAgo } from "../../infra/format-time/format-relative.js";
4
4
  import { buildChannelAccountSnapshot, formatChannelAllowFrom } from "../../channels/account-summary.js";
5
5
  import { resolveChannelDefaultAccountId } from "../../channels/plugins/helpers.js";
6
6
  import "./format.js";
7
- import syncFs from "node:fs";
7
+ import fs from "node:fs";
8
8
 
9
9
  //#region src/commands/status-all/channels.ts
10
10
  const asRecord = (value) => value && typeof value === "object" ? value : {};
@@ -27,7 +27,7 @@ function existsSyncMaybe(p) {
27
27
  return null;
28
28
  }
29
29
  try {
30
- return syncFs.existsSync(path);
30
+ return fs.existsSync(path);
31
31
  } catch {
32
32
  return null;
33
33
  }
@@ -14,7 +14,7 @@ import { startLocalSocketSignerBroker } from "../wallet/local-socket-signer-brok
14
14
  import { listWalletInboundEvents, pollWalletInboundEvents, reconcileWalletInboundEvents } from "../wallet/wallet-inbound-events.js";
15
15
  import { buildWalletCanaryReport, runWalletProviderCanaryReport } from "../wallet/wallet-canary.js";
16
16
  import { resolveSignerdBinaryPath, restartLocalSocketSigner } from "../wizard/onboarding.wallet.js";
17
- import syncFs from "node:fs";
17
+ import fs from "node:fs";
18
18
  import path from "node:path";
19
19
  import { createCipheriv, createDecipheriv, createPrivateKey, createPublicKey, randomBytes, scryptSync } from "node:crypto";
20
20
  import { createInterface } from "node:readline/promises";
@@ -675,12 +675,12 @@ function resolveKeystorePassphrase(optionsPassphrase, env) {
675
675
  return optionsPassphrase.trim();
676
676
  }
677
677
  const file = String(env.FASED_WALLET_PASSPHRASE_FILE ?? "").trim();
678
- if (file && syncFs.existsSync(file)) {
679
- return syncFs.readFileSync(file, "utf8").trim();
678
+ if (file && fs.existsSync(file)) {
679
+ return fs.readFileSync(file, "utf8").trim();
680
680
  }
681
681
  const managedFile = path.join(resolveLocalSignerMaterialRootDir(env), "passphrase");
682
- if (syncFs.existsSync(managedFile)) {
683
- return syncFs.readFileSync(managedFile, "utf8").trim();
682
+ if (fs.existsSync(managedFile)) {
683
+ return fs.readFileSync(managedFile, "utf8").trim();
684
684
  }
685
685
  return String(env.FASED_WALLET_PASSPHRASE ?? "").trim();
686
686
  }
@@ -696,7 +696,7 @@ function resolveLocalSignerPassphraseSource(env) {
696
696
  const candidates = [configuredFile ? path.resolve(configuredFile) : "", path.join(resolveLocalSignerMaterialRootDir(env), "passphrase")].filter(Boolean);
697
697
  for (const candidate of candidates) {
698
698
  try {
699
- const value = syncFs.readFileSync(candidate, "utf8").trim();
699
+ const value = fs.readFileSync(candidate, "utf8").trim();
700
700
  if (value) {
701
701
  return {
702
702
  kind: "file",
@@ -774,16 +774,16 @@ function ensureLocalSignerPassphraseFileForCustodyDisable(params) {
774
774
  };
775
775
  }
776
776
  function writePassphraseFile(filePath, passphrase) {
777
- syncFs.mkdirSync(path.dirname(filePath), {
777
+ fs.mkdirSync(path.dirname(filePath), {
778
778
  recursive: true,
779
779
  mode: 448
780
780
  });
781
- syncFs.writeFileSync(filePath, `${passphrase}\n`, {
781
+ fs.writeFileSync(filePath, `${passphrase}\n`, {
782
782
  encoding: "utf8",
783
783
  mode: 384
784
784
  });
785
785
  try {
786
- syncFs.chmodSync(filePath, 384);
786
+ fs.chmodSync(filePath, 384);
787
787
  } catch {}
788
788
  }
789
789
  function walletIdsMatchForEnvSuffix(left, right) {
@@ -823,7 +823,7 @@ function collectLocalSignerKeystoreTargets(cfg, env) {
823
823
  return;
824
824
  }
825
825
  const resolved = path.resolve(candidate);
826
- if (!syncFs.existsSync(resolved)) {
826
+ if (!fs.existsSync(resolved)) {
827
827
  return;
828
828
  }
829
829
  const existing = targets.get(resolved);
@@ -850,8 +850,8 @@ function collectLocalSignerKeystoreTargets(cfg, env) {
850
850
  addTarget("solana", value, key.slice("FASED_WALLET_SOLANA_KEYSTORE_PATH__".length).toLowerCase());
851
851
  }
852
852
  }
853
- if (syncFs.existsSync(materialRoot)) {
854
- for (const entry of syncFs.readdirSync(materialRoot, { withFileTypes: true })) {
853
+ if (fs.existsSync(materialRoot)) {
854
+ for (const entry of fs.readdirSync(materialRoot, { withFileTypes: true })) {
855
855
  if (!entry.isFile()) {
856
856
  continue;
857
857
  }
@@ -871,7 +871,7 @@ function collectLocalSignerKeystoreTargets(cfg, env) {
871
871
  return [...targets.values()].toSorted((left, right) => left.label.localeCompare(right.label));
872
872
  }
873
873
  async function reencryptLocalSignerKeystore(params) {
874
- const raw = syncFs.readFileSync(params.target.path, "utf8");
874
+ const raw = fs.readFileSync(params.target.path, "utf8");
875
875
  const detected = detectEmbeddedKeystoreType(raw);
876
876
  if (detected === "solana-envelope") {
877
877
  const envelope = parseSolanaKeystoreEnvelope(raw);
@@ -884,7 +884,7 @@ async function reencryptLocalSignerKeystore(params) {
884
884
  passphrase: params.newPassphrase,
885
885
  publicKey: envelope.publicKey
886
886
  });
887
- syncFs.writeFileSync(params.target.path, `${JSON.stringify(nextEnvelope, null, 2)}\n`, {
887
+ fs.writeFileSync(params.target.path, `${JSON.stringify(nextEnvelope, null, 2)}\n`, {
888
888
  encoding: "utf8",
889
889
  mode: 384
890
890
  });
@@ -905,13 +905,13 @@ function removeLocalSignerPassphraseFileIfManaged(env) {
905
905
  const resolved = path.resolve(configured);
906
906
  const materialRoot = resolveLocalSignerMaterialRootDir(env);
907
907
  const withinMaterialRoot = resolved === materialRoot || resolved.startsWith(`${materialRoot}${path.sep}`);
908
- if (!withinMaterialRoot || !syncFs.existsSync(resolved)) {
908
+ if (!withinMaterialRoot || !fs.existsSync(resolved)) {
909
909
  return {
910
910
  removed: false,
911
911
  path: resolved
912
912
  };
913
913
  }
914
- syncFs.rmSync(resolved, { force: true });
914
+ fs.rmSync(resolved, { force: true });
915
915
  return {
916
916
  removed: true,
917
917
  path: resolved
@@ -949,11 +949,11 @@ function writeLocalSignerEnvFile(cfg, env) {
949
949
  "",
950
950
  `"${signerBinPath}" --socket "\${FASED_WALLET_LOCAL_SIGNER_BACKEND_SOCKET:-$FASED_WALLET_LOCAL_SIGNER_SOCKET}"`
951
951
  ];
952
- syncFs.mkdirSync(path.dirname(signerEnvPath), {
952
+ fs.mkdirSync(path.dirname(signerEnvPath), {
953
953
  recursive: true,
954
954
  mode: 448
955
955
  });
956
- syncFs.writeFileSync(signerEnvPath, `${signerEnvLines.join("\n")}\n`, {
956
+ fs.writeFileSync(signerEnvPath, `${signerEnvLines.join("\n")}\n`, {
957
957
  encoding: "utf8",
958
958
  mode: 384
959
959
  });
@@ -1051,11 +1051,11 @@ async function configureLocalSignerMode(runtime, options, env) {
1051
1051
  "",
1052
1052
  `"${signerBinPath}" --socket "\${FASED_WALLET_LOCAL_SIGNER_BACKEND_SOCKET:-$FASED_WALLET_LOCAL_SIGNER_SOCKET}"`
1053
1053
  ];
1054
- syncFs.mkdirSync(path.dirname(signerEnvPath), {
1054
+ fs.mkdirSync(path.dirname(signerEnvPath), {
1055
1055
  recursive: true,
1056
1056
  mode: 448
1057
1057
  });
1058
- syncFs.writeFileSync(signerEnvPath, `${signerEnvLines.join("\n")}\n`, {
1058
+ fs.writeFileSync(signerEnvPath, `${signerEnvLines.join("\n")}\n`, {
1059
1059
  encoding: "utf8",
1060
1060
  mode: 384
1061
1061
  });
@@ -1499,10 +1499,10 @@ async function walletKeystoreInitCommand(runtime = defaultRuntime, options = {})
1499
1499
  }
1500
1500
  const chain = options.chain ?? "solana";
1501
1501
  const outPath = resolveEmbeddedKeystorePathForChain(env, chain, options.out, options.walletId);
1502
- if (syncFs.existsSync(outPath) && !options.force) {
1502
+ if (fs.existsSync(outPath) && !options.force) {
1503
1503
  throw new Error(`Keystore already exists: ${outPath}`);
1504
1504
  }
1505
- syncFs.mkdirSync(path.dirname(outPath), {
1505
+ fs.mkdirSync(path.dirname(outPath), {
1506
1506
  recursive: true,
1507
1507
  mode: 448
1508
1508
  });
@@ -1517,14 +1517,14 @@ async function walletKeystoreInitCommand(runtime = defaultRuntime, options = {})
1517
1517
  passphrase,
1518
1518
  publicKey
1519
1519
  });
1520
- syncFs.writeFileSync(outPath, `${JSON.stringify(envelope, null, 2)}\n`, {
1520
+ fs.writeFileSync(outPath, `${JSON.stringify(envelope, null, 2)}\n`, {
1521
1521
  encoding: "utf8",
1522
1522
  mode: 384
1523
1523
  });
1524
1524
  addressOut = publicKey;
1525
1525
  privateKeyOut = Buffer.from(secretKey).toString("base64");
1526
1526
  try {
1527
- syncFs.chmodSync(outPath, 384);
1527
+ fs.chmodSync(outPath, 384);
1528
1528
  } catch {}
1529
1529
  const cfg = options.skipProviderConfig ? ensureWalletMaterialConfig(loadConfig(), {
1530
1530
  keystorePath: outPath,
@@ -1599,10 +1599,10 @@ async function walletKeystoreImportCommand(runtime = defaultRuntime, options = {
1599
1599
  throw new Error("Missing private key. Pass --private-key or set FASED_WALLET_PRIVATE_KEY.");
1600
1600
  }
1601
1601
  const outPath = resolveEmbeddedKeystorePathForChain(env, chain, options.out, options.walletId);
1602
- if (syncFs.existsSync(outPath) && !options.force) {
1602
+ if (fs.existsSync(outPath) && !options.force) {
1603
1603
  throw new Error(`Keystore already exists: ${outPath}`);
1604
1604
  }
1605
- syncFs.mkdirSync(path.dirname(outPath), {
1605
+ fs.mkdirSync(path.dirname(outPath), {
1606
1606
  recursive: true,
1607
1607
  mode: 448
1608
1608
  });
@@ -1614,13 +1614,13 @@ async function walletKeystoreImportCommand(runtime = defaultRuntime, options = {
1614
1614
  passphrase,
1615
1615
  publicKey
1616
1616
  });
1617
- syncFs.writeFileSync(outPath, `${JSON.stringify(envelope, null, 2)}\n`, {
1617
+ fs.writeFileSync(outPath, `${JSON.stringify(envelope, null, 2)}\n`, {
1618
1618
  encoding: "utf8",
1619
1619
  mode: 384
1620
1620
  });
1621
1621
  addressOut = publicKey;
1622
1622
  try {
1623
- syncFs.chmodSync(outPath, 384);
1623
+ fs.chmodSync(outPath, 384);
1624
1624
  } catch {}
1625
1625
  const cfg = options.skipProviderConfig ? ensureWalletMaterialConfig(loadConfig(), {
1626
1626
  keystorePath: outPath,
@@ -1682,7 +1682,7 @@ async function walletKeystoreStatusCommand(runtime = defaultRuntime, options = {
1682
1682
  const cfg = loadConfig();
1683
1683
  const chain = options.chain ?? "solana";
1684
1684
  const keystorePath = resolveEmbeddedKeystorePathForChain(env, chain, cfg.wallet?.keystore?.path, options.walletId);
1685
- const exists = syncFs.existsSync(keystorePath);
1685
+ const exists = fs.existsSync(keystorePath);
1686
1686
  const providerId = cfg.wallet?.provider?.id;
1687
1687
  let address;
1688
1688
  let unlocked = false;
@@ -1690,7 +1690,7 @@ async function walletKeystoreStatusCommand(runtime = defaultRuntime, options = {
1690
1690
  let detectedType = "missing";
1691
1691
  if (exists) {
1692
1692
  const passphrase = resolveKeystorePassphrase(undefined, env);
1693
- const raw = syncFs.readFileSync(keystorePath, "utf8");
1693
+ const raw = fs.readFileSync(keystorePath, "utf8");
1694
1694
  detectedType = detectEmbeddedKeystoreType(raw);
1695
1695
  if (passphrase) {
1696
1696
  try {
@@ -1755,14 +1755,14 @@ async function walletKeystoreValidateCommand(runtime = defaultRuntime, options =
1755
1755
  };
1756
1756
  let raw = "";
1757
1757
  let detectedType = "missing";
1758
- if (!syncFs.existsSync(keystorePath)) {
1758
+ if (!fs.existsSync(keystorePath)) {
1759
1759
  result.checks.push({
1760
1760
  id: "keystore.exists",
1761
1761
  ok: false,
1762
1762
  message: `missing: ${keystorePath}`
1763
1763
  });
1764
1764
  } else {
1765
- raw = syncFs.readFileSync(keystorePath, "utf8");
1765
+ raw = fs.readFileSync(keystorePath, "utf8");
1766
1766
  detectedType = detectEmbeddedKeystoreType(raw);
1767
1767
  result.checks.push({
1768
1768
  id: "keystore.exists",
@@ -1864,7 +1864,7 @@ async function walletKeystoreValidateCommand(runtime = defaultRuntime, options =
1864
1864
  async function walletKeystorePassphraseInitCommand(runtime = defaultRuntime, options = {}) {
1865
1865
  const env = process.env ?? process.env;
1866
1866
  const outPath = resolvePassphraseFilePath(env, options.out);
1867
- if (syncFs.existsSync(outPath) && !options.force) {
1867
+ if (fs.existsSync(outPath) && !options.force) {
1868
1868
  throw new Error(`Passphrase file already exists: ${outPath} (use --force to overwrite)`);
1869
1869
  }
1870
1870
  const bytes = typeof options.length === "number" && Number.isFinite(options.length) && options.length >= 16 ? Math.floor(options.length) : 24;
@@ -1886,15 +1886,15 @@ async function walletKeystorePassphraseRotateCommand(runtime = defaultRuntime, o
1886
1886
  const cfg = loadConfig();
1887
1887
  const keystorePath = resolveEmbeddedKeystorePath(env, cfg.wallet?.keystore?.path);
1888
1888
  const passphraseFile = resolvePassphraseFilePath(env, options.file);
1889
- if (!syncFs.existsSync(keystorePath)) {
1889
+ if (!fs.existsSync(keystorePath)) {
1890
1890
  throw new Error(`Keystore missing: ${keystorePath}`);
1891
1891
  }
1892
- const oldPassphrase = (options.oldPassphrase ?? (syncFs.existsSync(passphraseFile) ? syncFs.readFileSync(passphraseFile, "utf8") : "")).trim() || String(env.FASED_WALLET_PASSPHRASE ?? "").trim();
1892
+ const oldPassphrase = (options.oldPassphrase ?? (fs.existsSync(passphraseFile) ? fs.readFileSync(passphraseFile, "utf8") : "")).trim() || String(env.FASED_WALLET_PASSPHRASE ?? "").trim();
1893
1893
  if (!oldPassphrase) {
1894
1894
  throw new Error("Missing old passphrase. Provide --old-passphrase or configure passphrase file/env.");
1895
1895
  }
1896
1896
  const newPassphrase = (options.newPassphrase ?? "").trim() || randomBytes(24).toString("base64url");
1897
- const raw = syncFs.readFileSync(keystorePath, "utf8");
1897
+ const raw = fs.readFileSync(keystorePath, "utf8");
1898
1898
  const detected = detectEmbeddedKeystoreType(raw);
1899
1899
  if (detected === "solana-envelope") {
1900
1900
  const envelope = parseSolanaKeystoreEnvelope(raw);
@@ -1907,7 +1907,7 @@ async function walletKeystorePassphraseRotateCommand(runtime = defaultRuntime, o
1907
1907
  passphrase: newPassphrase,
1908
1908
  publicKey: envelope.publicKey
1909
1909
  });
1910
- syncFs.writeFileSync(keystorePath, `${JSON.stringify(nextEnvelope, null, 2)}\n`, {
1910
+ fs.writeFileSync(keystorePath, `${JSON.stringify(nextEnvelope, null, 2)}\n`, {
1911
1911
  encoding: "utf8",
1912
1912
  mode: 384
1913
1913
  });
@@ -1932,10 +1932,10 @@ async function walletKeystoreExportCommand(runtime = defaultRuntime, options = {
1932
1932
  const env = process.env ?? process.env;
1933
1933
  const cfg = loadConfig();
1934
1934
  const keystorePath = resolveEmbeddedKeystorePath(env, cfg.wallet?.keystore?.path);
1935
- if (!syncFs.existsSync(keystorePath)) {
1935
+ if (!fs.existsSync(keystorePath)) {
1936
1936
  throw new Error(`Keystore missing: ${keystorePath}`);
1937
1937
  }
1938
- const raw = syncFs.readFileSync(keystorePath, "utf8");
1938
+ const raw = fs.readFileSync(keystorePath, "utf8");
1939
1939
  const detected = detectEmbeddedKeystoreType(raw);
1940
1940
  const outPath = options.out?.trim() ? path.resolve(options.out.trim()) : undefined;
1941
1941
  const payload = {
@@ -1948,11 +1948,11 @@ async function walletKeystoreExportCommand(runtime = defaultRuntime, options = {
1948
1948
  payload.keystore = raw;
1949
1949
  }
1950
1950
  if (outPath) {
1951
- syncFs.mkdirSync(path.dirname(outPath), {
1951
+ fs.mkdirSync(path.dirname(outPath), {
1952
1952
  recursive: true,
1953
1953
  mode: 448
1954
1954
  });
1955
- syncFs.writeFileSync(outPath, raw, {
1955
+ fs.writeFileSync(outPath, raw, {
1956
1956
  encoding: "utf8",
1957
1957
  mode: 384
1958
1958
  });
@@ -2138,7 +2138,7 @@ async function collectWalletSignerDoctorReport(env = process.env, options = {})
2138
2138
  const isNotFoundError = (err) => err?.code === "ENOENT";
2139
2139
  if (isLocalSigner) {
2140
2140
  try {
2141
- const st = syncFs.statSync(socketPath);
2141
+ const st = fs.statSync(socketPath);
2142
2142
  push("socket.exists", st.isSocket?.() ?? true, socketPath);
2143
2143
  try {
2144
2144
  const mode = st.mode & 511;
@@ -2148,7 +2148,7 @@ async function collectWalletSignerDoctorReport(env = process.env, options = {})
2148
2148
  push("socket.exists", localSignerSetupPending && isNotFoundError(err), localSignerSetupPending && isNotFoundError(err) ? "Configure" : String(err));
2149
2149
  }
2150
2150
  try {
2151
- const pidRaw = syncFs.readFileSync(pidPath, "utf8").trim();
2151
+ const pidRaw = fs.readFileSync(pidPath, "utf8").trim();
2152
2152
  const pid = Number.parseInt(pidRaw, 10);
2153
2153
  if (Number.isFinite(pid) && pid > 1) {
2154
2154
  try {
@@ -2164,7 +2164,7 @@ async function collectWalletSignerDoctorReport(env = process.env, options = {})
2164
2164
  push("pid.alive", localSignerSetupPending && isNotFoundError(err), localSignerSetupPending && isNotFoundError(err) ? "Configure" : String(err));
2165
2165
  }
2166
2166
  try {
2167
- const st = syncFs.statSync(auditPath);
2167
+ const st = fs.statSync(auditPath);
2168
2168
  push("audit.exists", true, `bytes=${st.size}`);
2169
2169
  } catch (err) {
2170
2170
  push("audit.exists", localSignerSetupPending && isNotFoundError(err), localSignerSetupPending && isNotFoundError(err) ? "Configure" : String(err));
@@ -2192,14 +2192,14 @@ async function collectWalletSignerDoctorReport(env = process.env, options = {})
2192
2192
  return "";
2193
2193
  }
2194
2194
  try {
2195
- return syncFs.readFileSync(p, "utf8").trim();
2195
+ return fs.readFileSync(p, "utf8").trim();
2196
2196
  } catch {
2197
2197
  return "";
2198
2198
  }
2199
2199
  })();
2200
2200
  const inspectKeystore = (label, keystorePath) => {
2201
2201
  try {
2202
- const raw = syncFs.readFileSync(keystorePath, "utf8");
2202
+ const raw = fs.readFileSync(keystorePath, "utf8");
2203
2203
  const kind = detectEmbeddedKeystoreType(raw);
2204
2204
  if (kind === "unknown") {
2205
2205
  push(`keystore.file.${label}`, false, `${keystorePath} type=unknown (expected fased-solana-keypair envelope)`);
@@ -2256,7 +2256,7 @@ async function collectWalletSignerDoctorReport(env = process.env, options = {})
2256
2256
  return true;
2257
2257
  }
2258
2258
  const defaultPath = resolveEmbeddedKeystorePathForChain(effectiveEnv, "solana");
2259
- if (syncFs.existsSync(defaultPath)) {
2259
+ if (fs.existsSync(defaultPath)) {
2260
2260
  return true;
2261
2261
  }
2262
2262
  if (providerDefaultWallet?.addresses?.solana) {
@@ -1,4 +1,4 @@
1
- import syncFs from "node:fs";
1
+ import fs from "node:fs";
2
2
 
3
3
  //#region src/config/cache-utils.ts
4
4
  function resolveCacheTtlMs(params) {
@@ -16,7 +16,7 @@ function isCacheEnabled(ttlMs) {
16
16
  }
17
17
  function getFileMtimeMs(filePath) {
18
18
  try {
19
- return syncFs.statSync(filePath).mtimeMs;
19
+ return fs.statSync(filePath).mtimeMs;
20
20
  } catch {
21
21
  return undefined;
22
22
  }
@@ -4,7 +4,7 @@ import { isBlockedObjectKey } from "../infra/prototype-keys.js";
4
4
  import { canUseBoundaryFileOpen, openBoundaryFileSync } from "../infra/boundary-file-read.js";
5
5
  import { isPathInside } from "../security/scan-paths.js";
6
6
  import "./prototype-keys.js";
7
- import syncFs from "node:fs";
7
+ import fs from "node:fs";
8
8
  import path from "node:path";
9
9
  import JSON5 from "json5";
10
10
 
@@ -130,7 +130,7 @@ var IncludeProcessor = class IncludeProcessor {
130
130
  throw new ConfigIncludeError(`Include path escapes config directory: ${includePath} (root: ${this.rootDir})`, includePath);
131
131
  }
132
132
  try {
133
- const real = syncFs.realpathSync(normalized);
133
+ const real = fs.realpathSync(normalized);
134
134
  if (!isPathInside(this.rootRealDir, real)) {
135
135
  throw new ConfigIncludeError(`Include path resolves outside config directory (symlink): ${includePath} (root: ${this.rootDir})`, includePath);
136
136
  }
@@ -184,13 +184,13 @@ var IncludeProcessor = class IncludeProcessor {
184
184
  };
185
185
  function safeRealpath(target) {
186
186
  try {
187
- return syncFs.realpathSync(target);
187
+ return fs.realpathSync(target);
188
188
  } catch {
189
189
  return target;
190
190
  }
191
191
  }
192
192
  function readConfigIncludeFileWithGuards(params) {
193
- const ioFs = params.ioFs ?? syncFs;
193
+ const ioFs = params.ioFs ?? fs;
194
194
  const maxBytes = params.maxBytes ?? MAX_INCLUDE_FILE_BYTES;
195
195
  if (!canUseBoundaryFileOpen(ioFs)) {
196
196
  return ioFs.readFileSync(params.resolvedPath, "utf-8");
@@ -217,7 +217,7 @@ function readConfigIncludeFileWithGuards(params) {
217
217
  }
218
218
  }
219
219
  const defaultResolver = {
220
- readFile: (p) => syncFs.readFileSync(p, "utf-8"),
220
+ readFile: (p) => fs.readFileSync(p, "utf-8"),
221
221
  readFileWithGuards: ({ includePath, resolvedPath, rootRealDir }) => readConfigIncludeFileWithGuards({
222
222
  includePath,
223
223
  resolvedPath,
package/dist/config/io.js CHANGED
@@ -22,7 +22,7 @@ import { repairInstalledPluginAllowlist } from "./plugins-allowlist.js";
22
22
  import { applyConfigOverrides } from "./runtime-overrides.js";
23
23
  import { validateConfigObjectRawWithPlugins, validateConfigObjectWithPlugins } from "./validation.js";
24
24
  import { compareFasedAgentVersions } from "./version.js";
25
- import syncFs from "node:fs";
25
+ import fs from "node:fs";
26
26
  import os from "node:os";
27
27
  import path from "node:path";
28
28
  import JSON5 from "json5";
@@ -477,7 +477,7 @@ function resolveConfigPathForDeps(deps) {
477
477
  }
478
478
  function normalizeDeps(overrides = {}) {
479
479
  return {
480
- fs: overrides.fs ?? syncFs,
480
+ fs: overrides.fs ?? fs,
481
481
  json5: overrides.json5 ?? JSON5,
482
482
  env: overrides.env ?? process.env,
483
483
  homedir: overrides.homedir ?? (() => resolveRequiredHomeDir(overrides.env ?? process.env, os.homedir)),
@@ -1,5 +1,5 @@
1
1
  import { expandHomePrefix, resolveRequiredHomeDir } from "../infra/home-dir.js";
2
- import syncFs from "node:fs";
2
+ import fs from "node:fs";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
5
 
@@ -86,7 +86,7 @@ function resolveConfigPathCandidate(env = process.env, homedir = envHomedir(env)
86
86
  const candidates = resolveDefaultConfigCandidates(env, homedir);
87
87
  const existing = candidates.find((candidate) => {
88
88
  try {
89
- return syncFs.existsSync(candidate);
89
+ return fs.existsSync(candidate);
90
90
  } catch {
91
91
  return false;
92
92
  }
@@ -108,7 +108,7 @@ function resolveConfigPath(env = process.env, stateDir = resolveStateDir(env, en
108
108
  const candidates = [path.join(stateDir, CONFIG_FILENAME)];
109
109
  const existing = candidates.find((candidate) => {
110
110
  try {
111
- return syncFs.existsSync(candidate);
111
+ return fs.existsSync(candidate);
112
112
  } catch {
113
113
  return false;
114
114
  }
@@ -1,4 +1,4 @@
1
- import syncFs from "node:fs";
1
+ import fs from "node:fs";
2
2
  import path from "node:path";
3
3
 
4
4
  //#region src/config/sat-runtime-ids.ts
@@ -63,7 +63,7 @@ function resolveSatRuntimeDefaultsFile(env = process.env) {
63
63
  path.resolve(import.meta.dirname, "..", "..", "..", "config", "sat-runtime.env")
64
64
  ];
65
65
  for (const candidate of candidates) {
66
- if (candidate && syncFs.existsSync(candidate)) {
66
+ if (candidate && fs.existsSync(candidate)) {
67
67
  return candidate;
68
68
  }
69
69
  }
@@ -82,7 +82,7 @@ function loadSatRuntimeDefaults(env = process.env) {
82
82
  if (!file) {
83
83
  return null;
84
84
  }
85
- const parsed = parseEnvFile(syncFs.readFileSync(file, "utf8"));
85
+ const parsed = parseEnvFile(fs.readFileSync(file, "utf8"));
86
86
  if (!parsed.programId || !parsed.bondProgramId || !parsed.mintAddress || !parsed.mintProgramId) {
87
87
  return null;
88
88
  }
@@ -1,6 +1,6 @@
1
1
  import { isPrimarySessionTranscriptFileName, isSessionArchiveArtifactName } from "./artifacts.js";
2
2
  import { resolveSessionFilePath } from "./paths.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/config/sessions/disk-budget.ts
@@ -11,7 +11,7 @@ const NOOP_LOGGER = {
11
11
  function canonicalizePathForComparison(filePath) {
12
12
  const resolved = path.resolve(filePath);
13
13
  try {
14
- return syncFs.realpathSync(resolved);
14
+ return fs.realpathSync(resolved);
15
15
  } catch {
16
16
  return resolved;
17
17
  }
@@ -83,14 +83,14 @@ function resolveReferencedSessionTranscriptPaths(params) {
83
83
  return referenced;
84
84
  }
85
85
  async function readSessionsDirFiles(sessionsDir) {
86
- const dirEntries = await syncFs.promises.readdir(sessionsDir, { withFileTypes: true }).catch(() => []);
86
+ const dirEntries = await fs.promises.readdir(sessionsDir, { withFileTypes: true }).catch(() => []);
87
87
  const files = [];
88
88
  for (const dirent of dirEntries) {
89
89
  if (!dirent.isFile()) {
90
90
  continue;
91
91
  }
92
92
  const filePath = path.join(sessionsDir, dirent.name);
93
- const stat = await syncFs.promises.stat(filePath).catch(() => null);
93
+ const stat = await fs.promises.stat(filePath).catch(() => null);
94
94
  if (!stat?.isFile()) {
95
95
  continue;
96
96
  }
@@ -105,11 +105,11 @@ async function readSessionsDirFiles(sessionsDir) {
105
105
  return files;
106
106
  }
107
107
  async function removeFileIfExists(filePath) {
108
- const stat = await syncFs.promises.stat(filePath).catch(() => null);
108
+ const stat = await fs.promises.stat(filePath).catch(() => null);
109
109
  if (!stat?.isFile()) {
110
110
  return 0;
111
111
  }
112
- await syncFs.promises.rm(filePath, { force: true }).catch(() => undefined);
112
+ await fs.promises.rm(filePath, { force: true }).catch(() => undefined);
113
113
  return stat.size;
114
114
  }
115
115
  async function removeFileForBudget(params) {
@@ -1,7 +1,7 @@
1
1
  import { expandHomePrefix, resolveRequiredHomeDir } from "../../infra/home-dir.js";
2
2
  import { resolveStateDir } from "../paths.js";
3
3
  import { DEFAULT_AGENT_ID, normalizeAgentId } from "../../routing/session-key.js";
4
- import syncFs from "node:fs";
4
+ import fs from "node:fs";
5
5
  import os from "node:os";
6
6
  import path from "node:path";
7
7
 
@@ -112,7 +112,7 @@ function resolveStructuralSessionFallbackPath(candidateAbsPath, expectedAgentId)
112
112
  }
113
113
  function safeRealpathSync(filePath) {
114
114
  try {
115
- return syncFs.realpathSync(filePath);
115
+ return fs.realpathSync(filePath);
116
116
  } catch {
117
117
  return undefined;
118
118
  }