@fased/fased 0.1.60 → 0.1.62

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 (275) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/acp/client.js +2 -2
  3. package/dist/acp/secret-file.js +2 -2
  4. package/dist/agents/agent-scope.js +2 -2
  5. package/dist/agents/apply-patch.js +8 -8
  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/openai-codex-app-server.js +5 -5
  15. package/dist/agents/pi-embedded-subscribe.raw-stream.js +3 -3
  16. package/dist/agents/pi-extensions/compaction-safeguard.js +3 -3
  17. package/dist/agents/pi-model-discovery.js +6 -6
  18. package/dist/agents/pi-project-settings.js +3 -3
  19. package/dist/agents/sandbox/fs-bridge.js +2 -2
  20. package/dist/agents/session-dirs.js +4 -4
  21. package/dist/agents/session-write-lock.js +13 -13
  22. package/dist/agents/shell-utils.js +5 -5
  23. package/dist/agents/skills/bundled-dir.js +4 -4
  24. package/dist/agents/skills/local-loader.js +6 -6
  25. package/dist/agents/skills/plugin-skills.js +2 -2
  26. package/dist/agents/skills/workspace.js +13 -13
  27. package/dist/agents/skills-install-download.js +7 -7
  28. package/dist/agents/skills-install-plan.js +2 -2
  29. package/dist/agents/skills-install.js +2 -2
  30. package/dist/agents/skills-status.js +2 -2
  31. package/dist/agents/subagent-depth.js +2 -2
  32. package/dist/agents/system-prompt-params.js +2 -2
  33. package/dist/agents/workspace.js +22 -22
  34. package/dist/auto-reply/reply/agent-runner-execution.js +2 -2
  35. package/dist/auto-reply/reply/agent-runner.js +2 -2
  36. package/dist/auto-reply/reply/commands-export-session.js +7 -7
  37. package/dist/auto-reply/reply/post-compaction-audit.js +3 -3
  38. package/dist/auto-reply/reply/post-compaction-context.js +3 -3
  39. package/dist/auto-reply/reply/session.js +3 -3
  40. package/dist/auto-reply/skill-commands.js +3 -3
  41. package/dist/auto-reply/status.js +6 -6
  42. package/dist/brand.js +1 -1
  43. package/dist/browser/chrome.executables.js +3 -3
  44. package/dist/browser/chrome.js +3 -3
  45. package/dist/browser/chrome.profile-decoration.js +6 -6
  46. package/dist/browser/profiles-service.js +2 -2
  47. package/dist/browser/server-context.js +2 -2
  48. package/dist/browser/trash.js +4 -4
  49. package/dist/build-info.json +3 -3
  50. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  51. package/dist/canvas-host/server.js +4 -4
  52. package/dist/capabilities/catalog.js +3 -3
  53. package/dist/channels/plugins/catalog.js +3 -3
  54. package/dist/cli/browser-cli-extension.js +6 -6
  55. package/dist/cli/command-format.js +2 -2
  56. package/dist/cli/cron-cli/register.cron-simple.js +2 -2
  57. package/dist/cli/dns-cli.js +9 -9
  58. package/dist/cli/gateway-cli/dev.js +5 -5
  59. package/dist/cli/gateway-cli/run.js +2 -2
  60. package/dist/cli/hooks-cli.js +5 -5
  61. package/dist/cli/lightweight/gateway-runtime-probe.js +2 -2
  62. package/dist/cli/memory-cli.js +7 -7
  63. package/dist/cli/nodes-media-utils.js +2 -2
  64. package/dist/cli/plugins-cli.js +2 -2
  65. package/dist/cli/secrets-cli.js +3 -3
  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/control-ui/assets/{app-CqF4Tc9n.js → app-DLil9VO1.js} +3 -3
  93. package/dist/control-ui/assets/{index-DYggPSfy.js → index-DdE_NIXo.js} +3 -3
  94. package/dist/control-ui/index.html +1 -1
  95. package/dist/control-ui/version.json +1 -1
  96. package/dist/cron/service/store.js +2 -2
  97. package/dist/cron/store.js +6 -6
  98. package/dist/daemon/systemd-system.js +5 -5
  99. package/dist/discord/monitor/thread-bindings.state.js +2 -2
  100. package/dist/extensions/sat-mining/src/sat-bond-layout.js +9 -9
  101. package/dist/gateway/control-ui-boot-check.js +6 -6
  102. package/dist/gateway/control-ui-login.js +7 -7
  103. package/dist/gateway/control-ui.js +9 -9
  104. package/dist/gateway/hooks-mapping.js +4 -4
  105. package/dist/gateway/server-discovery.js +2 -2
  106. package/dist/gateway/server-http.js +4 -4
  107. package/dist/gateway/server-methods/chat.js +3 -3
  108. package/dist/gateway/server-methods/sessions.js +6 -6
  109. package/dist/gateway/server-methods/usage.js +2 -2
  110. package/dist/gateway/server.impl.js +3 -3
  111. package/dist/gateway/session-compaction-checkpoints.js +4 -4
  112. package/dist/gateway/session-utils.fs.js +24 -24
  113. package/dist/gateway/session-utils.js +6 -6
  114. package/dist/hooks/bundled-dir.js +4 -4
  115. package/dist/hooks/gmail-setup-utils.js +6 -6
  116. package/dist/hooks/import-url.js +2 -2
  117. package/dist/hooks/loader.js +4 -4
  118. package/dist/hooks/workspace.js +7 -7
  119. package/dist/infra/archive.js +17 -17
  120. package/dist/infra/boundary-file-read.js +2 -2
  121. package/dist/infra/boundary-path.js +15 -15
  122. package/dist/infra/brew.js +2 -2
  123. package/dist/infra/control-ui-assets.js +14 -14
  124. package/dist/infra/device-auth-store.js +8 -8
  125. package/dist/infra/device-identity.js +8 -8
  126. package/dist/infra/dotenv.js +2 -2
  127. package/dist/infra/exec-approvals.js +8 -8
  128. package/dist/infra/exec-command-resolution.js +4 -4
  129. package/dist/infra/exec-safe-bin-trust.js +2 -2
  130. package/dist/infra/fased-root.js +5 -5
  131. package/dist/infra/fs-safe.js +14 -14
  132. package/dist/infra/gateway-lock.js +11 -11
  133. package/dist/infra/git-commit.js +5 -5
  134. package/dist/infra/git-root.js +4 -4
  135. package/dist/infra/hosted-runtime-artifact.js +3 -3
  136. package/dist/infra/is-main.js +2 -2
  137. package/dist/infra/json-file.js +7 -7
  138. package/dist/infra/managed-runtime-bootstrap.js +6 -6
  139. package/dist/infra/outbound/delivery-queue.js +16 -16
  140. package/dist/infra/path-env.js +3 -3
  141. package/dist/infra/ports-lsof.js +4 -4
  142. package/dist/infra/provider-usage.auth.js +3 -3
  143. package/dist/infra/safe-open-sync.js +2 -2
  144. package/dist/infra/session-cost-usage.js +9 -9
  145. package/dist/infra/shell-env.js +2 -2
  146. package/dist/infra/state-migrations.fs.js +6 -6
  147. package/dist/infra/state-migrations.js +23 -23
  148. package/dist/infra/tmp-fased-dir.js +6 -6
  149. package/dist/infra/widearea-dns.js +3 -3
  150. package/dist/infra/wsl.js +2 -2
  151. package/dist/line/accounts.js +2 -2
  152. package/dist/line/download.js +2 -2
  153. package/dist/logging/config.js +3 -3
  154. package/dist/logging/logger.js +7 -7
  155. package/dist/managed/federation.js +3 -3
  156. package/dist/managed/tunnel.js +3 -3
  157. package/dist/media/store.js +13 -13
  158. package/dist/media-understanding/runner.js +3 -3
  159. package/dist/memory/embeddings.js +2 -2
  160. package/dist/memory/internal.js +10 -10
  161. package/dist/memory/manager-sync-ops.js +7 -7
  162. package/dist/memory/repair-executor.js +17 -17
  163. package/dist/node-host/invoke-system-run-plan.js +8 -8
  164. package/dist/node-host/invoke.js +2 -2
  165. package/dist/node-host/runner.js +3 -3
  166. package/dist/pairing/pairing-store.js +3 -3
  167. package/dist/plugin-sdk/{audio-preflight-C2QXh5Ml.js → audio-preflight-Bwi2Oq03.js} +2 -2
  168. package/dist/plugin-sdk/channel-plugin-common.d.ts +2 -2
  169. package/dist/plugin-sdk/{chunk-items-3ZyiGiff.js → chunk-items-DzT4L4Ty.js} +1 -1
  170. package/dist/plugin-sdk/command-status.js +2 -2
  171. package/dist/plugin-sdk/{config-schema-C9tx1Lyz.js → config-schema-BrkmtFxB.js} +16 -16
  172. package/dist/plugin-sdk/device-pair.d.ts +1 -1
  173. package/dist/plugin-sdk/discord.d.ts +4 -4
  174. package/dist/plugin-sdk/index.d.ts +20 -20
  175. package/dist/plugin-sdk/index.js +2 -2
  176. package/dist/plugin-sdk/json-store.js +6 -6
  177. package/dist/plugin-sdk/{monitor-Xgx6vGcg.js → monitor-M_ta2lMc.js} +4 -4
  178. package/dist/plugin-sdk/{monitor-XbunF2-r.js → monitor-wYVncM9w.js} +6 -6
  179. package/dist/plugin-sdk/{openresponses-http-BRUr0JLE.js → openresponses-http-B2GmeSt4.js} +2 -2
  180. package/dist/plugin-sdk/{pairing-message-C403mq4K.d.ts → pairing-message-B3bHYGaw.d.ts} +1 -1
  181. package/dist/plugin-sdk/provider-web-search-config-contract.d.ts +1 -1
  182. package/dist/plugin-sdk/{pw-ai-BzV0f18N.js → pw-ai-AFUqn-tQ.js} +1 -1
  183. package/dist/plugin-sdk/{runtime-dependency-Ch7J9a0d.js → runtime-dependency-DLDmB94f.js} +9 -9
  184. package/dist/plugin-sdk/sat-runtime.d.ts +2 -2
  185. package/dist/plugin-sdk/sat-runtime.js +2 -2
  186. package/dist/plugin-sdk/{slack-BzJfCWjq.js → slack-CxE1mfzj.js} +4 -4
  187. package/dist/plugin-sdk/slack.d.ts +4 -4
  188. package/dist/plugin-sdk/{sticker-cache-Dex-XpRj.js → sticker-cache-CGzGWu00.js} +2 -2
  189. package/dist/plugin-sdk/{telegram-actions-DoFTGX4z.js → telegram-actions-DaEcYQ8r.js} +3 -3
  190. package/dist/plugin-sdk/telegram.d.ts +4 -4
  191. package/dist/plugin-sdk/{tmp-fased-dir-Ouj58axY.d.ts → tmp-fased-dir-CS6zsYEE.d.ts} +1 -1
  192. package/dist/plugin-sdk/{types-B4hj6HgR.d.ts → types-DFAW-n1J.d.ts} +1 -1
  193. package/dist/plugin-sdk/{types-dWZFX1fk.d.ts → types-vcJrC_uv.d.ts} +2 -2
  194. package/dist/plugin-sdk/{web--wC3ZfVl.js → web-CInY-lCv.js} +2 -2
  195. package/dist/plugin-sdk/whatsapp.d.ts +13 -13
  196. package/dist/plugin-sdk/{zod-schema.providers-core-FaYR6KdD.d.ts → zod-schema.providers-core-BEbNizPe.d.ts} +78 -78
  197. package/dist/plugins/bundled-dir.js +3 -3
  198. package/dist/plugins/discovery.js +11 -11
  199. package/dist/plugins/loader.js +13 -13
  200. package/dist/plugins/manifest-registry.js +2 -2
  201. package/dist/plugins/manifest.js +4 -4
  202. package/dist/plugins/path-safety.js +3 -3
  203. package/dist/plugins/status-cache.js +9 -9
  204. package/dist/plugins/update.js +3 -3
  205. package/dist/plugins/web-search-install-catalog.js +3 -3
  206. package/dist/secrets/apply.js +16 -16
  207. package/dist/secrets/audit.js +11 -11
  208. package/dist/secrets/shared.js +9 -9
  209. package/dist/security/scan-paths.js +2 -2
  210. package/dist/shared/config-eval.js +2 -2
  211. package/dist/shared/pid-alive.js +2 -2
  212. package/dist/tasks/standing-orders.js +5 -5
  213. package/dist/tasks/task-flow-registry.js +5 -5
  214. package/dist/tasks/task-registry.js +5 -5
  215. package/dist/tasks/workflow-definitions.js +6 -6
  216. package/dist/telegram/token.js +5 -5
  217. package/dist/utils.js +5 -5
  218. package/dist/wallet/local-socket-signer-broker.js +16 -16
  219. package/dist/wallet/providers/embedded-keystore-adapter.js +5 -5
  220. package/dist/wallet/providers/local-socket-signer-adapter.js +2 -2
  221. package/dist/wallet/wallet-approval-auth.js +5 -5
  222. package/dist/wallet/wallet-audit-log.js +5 -5
  223. package/dist/wallet/wallet-custody.js +21 -21
  224. package/dist/wallet/wallet-inbound-events.js +5 -5
  225. package/dist/wallet/wallet-observability.js +5 -5
  226. package/dist/wallet/wallet-policy.js +9 -9
  227. package/dist/wallet/wallet-provider-registry.js +7 -7
  228. package/dist/wallet/wallet-runtime-config.js +3 -3
  229. package/dist/wallet/wallet-secrets-store.js +22 -22
  230. package/dist/wallet/wallet-send-approvals.js +5 -5
  231. package/dist/wallet/wallet-settlement-links.js +5 -5
  232. package/dist/web/accounts.js +3 -3
  233. package/dist/web/auth-store.js +18 -18
  234. package/dist/web/session.js +4 -4
  235. package/dist/wizard/host-security-capability.js +2 -2
  236. package/dist/wizard/onboarding.host-security.js +7 -7
  237. package/dist/wizard/onboarding.js +11 -28
  238. package/dist/wizard/onboarding.wallet.js +132 -85
  239. package/extensions/acpx/package.json +1 -1
  240. package/extensions/bluebubbles/package.json +1 -1
  241. package/extensions/copilot-proxy/package.json +1 -1
  242. package/extensions/diagnostics-otel/package.json +1 -1
  243. package/extensions/fased-federation/package.json +1 -1
  244. package/extensions/google-gemini-cli-auth/package.json +1 -1
  245. package/extensions/imessage/package.json +1 -1
  246. package/extensions/irc/package.json +1 -1
  247. package/extensions/line/package.json +1 -1
  248. package/extensions/llm-task/package.json +1 -1
  249. package/extensions/lobster/package.json +1 -1
  250. package/extensions/matrix/CHANGELOG.md +12 -0
  251. package/extensions/matrix/package.json +1 -1
  252. package/extensions/mattermost/package.json +1 -1
  253. package/extensions/memory-core/package.json +2 -2
  254. package/extensions/memory-lancedb/package.json +1 -1
  255. package/extensions/minimax-portal-auth/package.json +1 -1
  256. package/extensions/msteams/CHANGELOG.md +12 -0
  257. package/extensions/msteams/package.json +1 -1
  258. package/extensions/nextcloud-talk/package.json +1 -1
  259. package/extensions/nostr/CHANGELOG.md +12 -0
  260. package/extensions/nostr/package.json +1 -1
  261. package/extensions/open-prose/package.json +1 -1
  262. package/extensions/sat-mining/package.json +1 -1
  263. package/extensions/signal/package.json +1 -1
  264. package/extensions/synology-chat/package.json +1 -1
  265. package/extensions/tlon/package.json +1 -1
  266. package/extensions/twitch/CHANGELOG.md +12 -0
  267. package/extensions/twitch/package.json +1 -1
  268. package/extensions/voice-call/CHANGELOG.md +12 -0
  269. package/extensions/voice-call/package.json +1 -1
  270. package/extensions/zalo/CHANGELOG.md +12 -0
  271. package/extensions/zalo/package.json +1 -1
  272. package/extensions/zalouser/CHANGELOG.md +12 -0
  273. package/extensions/zalouser/package.json +1 -1
  274. package/package.json +2 -1
  275. package/scripts/install-fased-signerd.sh +142 -0
@@ -2,7 +2,7 @@ import { ensureWalletStateDir, resolveWalletRuntimeConfig } from "./wallet-runti
2
2
  import { readWalletProviderRegistry, resolveWalletUserRole } from "./wallet-provider-registry.js";
3
3
  import { assertValidSolanaAddress } from "./solana-address.js";
4
4
  import { tryResolveSatRuntimeIds } from "../config/sat-runtime-ids.js";
5
- import fs from "node:fs";
5
+ import syncFs from "node:fs";
6
6
  import path from "node:path";
7
7
 
8
8
  //#region src/wallet/wallet-policy.ts
@@ -51,11 +51,11 @@ function normalizeWalletUsageBucket(raw) {
51
51
  }
52
52
  function loadLedger(paths) {
53
53
  const fallback = defaultWalletUsageLedger();
54
- if (!fs.existsSync(paths.dailyUsagePath)) {
54
+ if (!syncFs.existsSync(paths.dailyUsagePath)) {
55
55
  return fallback;
56
56
  }
57
57
  try {
58
- const raw = fs.readFileSync(paths.dailyUsagePath, "utf8");
58
+ const raw = syncFs.readFileSync(paths.dailyUsagePath, "utf8");
59
59
  const parsed = JSON.parse(raw);
60
60
  if (parsed && parsed.version === 2 && typeof parsed.date === "string") {
61
61
  const walletsRaw = parsed.wallets && typeof parsed.wallets === "object" && !Array.isArray(parsed.wallets) ? parsed.wallets : {};
@@ -87,9 +87,9 @@ function loadLedger(paths) {
87
87
  return fallback;
88
88
  }
89
89
  function writeLedger(paths, ledger) {
90
- fs.writeFileSync(paths.dailyUsagePath, `${JSON.stringify(ledger, null, 2)}\n`, { mode: 384 });
90
+ syncFs.writeFileSync(paths.dailyUsagePath, `${JSON.stringify(ledger, null, 2)}\n`, { mode: 384 });
91
91
  try {
92
- fs.chmodSync(paths.dailyUsagePath, 384);
92
+ syncFs.chmodSync(paths.dailyUsagePath, 384);
93
93
  } catch {}
94
94
  }
95
95
  function resolveWalletUsageBucket(ledger, walletId) {
@@ -344,11 +344,11 @@ function readWalletPolicyState(env = process.env) {
344
344
  updatedAt: nowIso(),
345
345
  wallets: {}
346
346
  };
347
- if (!fs.existsSync(statePath)) {
347
+ if (!syncFs.existsSync(statePath)) {
348
348
  return fallback;
349
349
  }
350
350
  try {
351
- const raw = fs.readFileSync(statePath, "utf8");
351
+ const raw = syncFs.readFileSync(statePath, "utf8");
352
352
  const parsed = JSON.parse(raw);
353
353
  if (parsed.version !== 1) {
354
354
  return fallback;
@@ -374,9 +374,9 @@ function readWalletPolicyState(env = process.env) {
374
374
  function writeWalletPolicyState(state, env = process.env) {
375
375
  const paths = ensureWalletStateDir(env);
376
376
  const statePath = resolveWalletPolicyStatePath(paths);
377
- fs.writeFileSync(statePath, `${JSON.stringify(state, null, 2)}\n`, { mode: 384 });
377
+ syncFs.writeFileSync(statePath, `${JSON.stringify(state, null, 2)}\n`, { mode: 384 });
378
378
  try {
379
- fs.chmodSync(statePath, 384);
379
+ syncFs.chmodSync(statePath, 384);
380
380
  } catch {}
381
381
  }
382
382
  function buildResolvedPolicyFromDefaults(defaults) {
@@ -1,6 +1,6 @@
1
1
  import { resolveStateDir } from "../config/paths.js";
2
2
  import { ensureWalletStateDir } from "./wallet-runtime-config.js";
3
- import fs from "node:fs";
3
+ import syncFs from "node:fs";
4
4
  import path from "node:path";
5
5
  import { randomBytes } from "node:crypto";
6
6
 
@@ -159,12 +159,12 @@ function buildMiningDeleteBlockedMessage(details) {
159
159
  }
160
160
  function readSatMiningRuntimeDeletionDetails(walletId, env) {
161
161
  const runtimeStorePath = path.join(resolveStateDir(env), "sat-mining", "wallets", normalizeSatWalletStateKey(walletId), "runtime-store.json");
162
- if (!fs.existsSync(runtimeStorePath)) {
162
+ if (!syncFs.existsSync(runtimeStorePath)) {
163
163
  return null;
164
164
  }
165
165
  let parsed;
166
166
  try {
167
- parsed = JSON.parse(fs.readFileSync(runtimeStorePath, "utf8"));
167
+ parsed = JSON.parse(syncFs.readFileSync(runtimeStorePath, "utf8"));
168
168
  } catch {
169
169
  return null;
170
170
  }
@@ -383,11 +383,11 @@ function normalizeRegistry(raw) {
383
383
  }
384
384
  function readWalletProviderRegistry(env = process.env) {
385
385
  const file = registryPath(env);
386
- if (!fs.existsSync(file)) {
386
+ if (!syncFs.existsSync(file)) {
387
387
  return makeDefaultRegistry();
388
388
  }
389
389
  try {
390
- const parsed = JSON.parse(fs.readFileSync(file, "utf8"));
390
+ const parsed = JSON.parse(syncFs.readFileSync(file, "utf8"));
391
391
  const normalized = normalizeRegistry(parsed);
392
392
  if (normalized.changed) {
393
393
  writeWalletProviderRegistry(normalized.registry, env);
@@ -404,12 +404,12 @@ function writeWalletProviderRegistry(registry, env = process.env) {
404
404
  version: 1,
405
405
  updatedAt: nowIso()
406
406
  };
407
- fs.writeFileSync(file, `${JSON.stringify(payload, null, 2)}\n`, {
407
+ syncFs.writeFileSync(file, `${JSON.stringify(payload, null, 2)}\n`, {
408
408
  encoding: "utf8",
409
409
  mode: REGISTRY_FILE_MODE
410
410
  });
411
411
  try {
412
- fs.chmodSync(file, REGISTRY_FILE_MODE);
412
+ syncFs.chmodSync(file, REGISTRY_FILE_MODE);
413
413
  } catch {}
414
414
  }
415
415
  function setWalletProviderEnabled(params) {
@@ -1,5 +1,5 @@
1
1
  import { resolveStateDir } from "../config/paths.js";
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/wallet/wallet-runtime-config.ts
@@ -94,12 +94,12 @@ function resolveWalletStatePaths(env = process.env) {
94
94
  }
95
95
  function ensureWalletStateDir(env = process.env) {
96
96
  const paths = resolveWalletStatePaths(env);
97
- fs.mkdirSync(paths.rootDir, {
97
+ syncFs.mkdirSync(paths.rootDir, {
98
98
  recursive: true,
99
99
  mode: 448
100
100
  });
101
101
  try {
102
- fs.chmodSync(paths.rootDir, 448);
102
+ syncFs.chmodSync(paths.rootDir, 448);
103
103
  } catch {}
104
104
  return paths;
105
105
  }
@@ -1,5 +1,5 @@
1
1
  import { resolveStateDir } from "../config/paths.js";
2
- import fs from "node:fs";
2
+ import syncFs from "node:fs";
3
3
  import path from "node:path";
4
4
  import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
5
5
 
@@ -12,12 +12,12 @@ const WALLET_RPC_SECRET_FILENAME = "wallet-rpc.v1.enc.json";
12
12
  const MASTER_KEY_FILENAME = "master.key";
13
13
  function ensureSecretsDir(env = process.env) {
14
14
  const dir = path.join(resolveStateDir(env), "secrets");
15
- fs.mkdirSync(dir, {
15
+ syncFs.mkdirSync(dir, {
16
16
  recursive: true,
17
17
  mode: SECRETS_DIR_MODE
18
18
  });
19
19
  try {
20
- fs.chmodSync(dir, SECRETS_DIR_MODE);
20
+ syncFs.chmodSync(dir, SECRETS_DIR_MODE);
21
21
  } catch {}
22
22
  return dir;
23
23
  }
@@ -37,20 +37,20 @@ function resolveWalletProviderSecretPath(providerId, env = process.env) {
37
37
  }
38
38
  function readOrCreateMasterKey(env = process.env) {
39
39
  const keyPath = resolveMasterKeyPath(env);
40
- if (fs.existsSync(keyPath)) {
41
- const raw = fs.readFileSync(keyPath, "utf8").trim();
40
+ if (syncFs.existsSync(keyPath)) {
41
+ const raw = syncFs.readFileSync(keyPath, "utf8").trim();
42
42
  const parsed = Buffer.from(raw, "hex");
43
43
  if (parsed.length === MASTER_KEY_BYTES) {
44
44
  return parsed;
45
45
  }
46
46
  }
47
47
  const key = randomBytes(MASTER_KEY_BYTES);
48
- fs.writeFileSync(keyPath, `${key.toString("hex")}\n`, {
48
+ syncFs.writeFileSync(keyPath, `${key.toString("hex")}\n`, {
49
49
  mode: SECRET_FILE_MODE,
50
50
  encoding: "utf8"
51
51
  });
52
52
  try {
53
- fs.chmodSync(keyPath, SECRET_FILE_MODE);
53
+ syncFs.chmodSync(keyPath, SECRET_FILE_MODE);
54
54
  } catch {}
55
55
  return key;
56
56
  }
@@ -197,12 +197,12 @@ function saveWalletRpcSecret(input, env = process.env) {
197
197
  };
198
198
  const encrypted = encryptPayload(record, env);
199
199
  const secretPath = resolveWalletRpcSecretPath(env, input.providerId);
200
- fs.writeFileSync(secretPath, `${JSON.stringify(encrypted, null, 2)}\n`, {
200
+ syncFs.writeFileSync(secretPath, `${JSON.stringify(encrypted, null, 2)}\n`, {
201
201
  mode: SECRET_FILE_MODE,
202
202
  encoding: "utf8"
203
203
  });
204
204
  try {
205
- fs.chmodSync(secretPath, SECRET_FILE_MODE);
205
+ syncFs.chmodSync(secretPath, SECRET_FILE_MODE);
206
206
  } catch {}
207
207
  return record;
208
208
  }
@@ -230,23 +230,23 @@ function saveWalletProviderSecret(input, env = process.env) {
230
230
  };
231
231
  const encrypted = encryptProviderPayload(record, env);
232
232
  const secretPath = resolveWalletProviderSecretPath(providerId, env);
233
- fs.writeFileSync(secretPath, `${JSON.stringify(encrypted, null, 2)}\n`, {
233
+ syncFs.writeFileSync(secretPath, `${JSON.stringify(encrypted, null, 2)}\n`, {
234
234
  mode: SECRET_FILE_MODE,
235
235
  encoding: "utf8"
236
236
  });
237
237
  try {
238
- fs.chmodSync(secretPath, SECRET_FILE_MODE);
238
+ syncFs.chmodSync(secretPath, SECRET_FILE_MODE);
239
239
  } catch {}
240
240
  return record;
241
241
  }
242
242
  function loadWalletRpcSecret(env = process.env, options) {
243
243
  const candidatePaths = options?.providerId ? [resolveWalletRpcSecretPath(env, options.providerId), resolveWalletRpcSecretPath(env)] : [resolveWalletRpcSecretPath(env)];
244
244
  for (const secretPath of candidatePaths) {
245
- if (!fs.existsSync(secretPath)) {
245
+ if (!syncFs.existsSync(secretPath)) {
246
246
  continue;
247
247
  }
248
248
  try {
249
- const parsed = JSON.parse(fs.readFileSync(secretPath, "utf8"));
249
+ const parsed = JSON.parse(syncFs.readFileSync(secretPath, "utf8"));
250
250
  const decrypted = decryptPayload(parsed, env);
251
251
  if (decrypted) {
252
252
  return decrypted;
@@ -257,11 +257,11 @@ function loadWalletRpcSecret(env = process.env, options) {
257
257
  }
258
258
  function loadWalletProviderSecret(providerId, env = process.env) {
259
259
  const secretPath = resolveWalletProviderSecretPath(providerId, env);
260
- if (!fs.existsSync(secretPath)) {
260
+ if (!syncFs.existsSync(secretPath)) {
261
261
  return null;
262
262
  }
263
263
  try {
264
- const parsed = JSON.parse(fs.readFileSync(secretPath, "utf8"));
264
+ const parsed = JSON.parse(syncFs.readFileSync(secretPath, "utf8"));
265
265
  const value = decryptProviderPayload(parsed, env);
266
266
  if (!value || value.providerId !== providerId) {
267
267
  return null;
@@ -274,13 +274,13 @@ function loadWalletProviderSecret(providerId, env = process.env) {
274
274
  function deleteWalletRpcSecret(env = process.env) {
275
275
  const dir = ensureSecretsDir(env);
276
276
  const legacyPath = resolveWalletRpcSecretPath(env);
277
- const candidatePaths = [legacyPath, ...fs.readdirSync(dir, { withFileTypes: true }).filter((entry) => entry.isFile() && /^wallet-rpc-[a-z0-9-]+\.v1\.enc\.json$/i.test(entry.name)).map((entry) => path.join(dir, entry.name))];
277
+ const candidatePaths = [legacyPath, ...syncFs.readdirSync(dir, { withFileTypes: true }).filter((entry) => entry.isFile() && /^wallet-rpc-[a-z0-9-]+\.v1\.enc\.json$/i.test(entry.name)).map((entry) => path.join(dir, entry.name))];
278
278
  const removedPaths = [];
279
279
  for (const secretPath of candidatePaths) {
280
- if (!fs.existsSync(secretPath)) {
280
+ if (!syncFs.existsSync(secretPath)) {
281
281
  continue;
282
282
  }
283
- fs.rmSync(secretPath, { force: true });
283
+ syncFs.rmSync(secretPath, { force: true });
284
284
  removedPaths.push(secretPath);
285
285
  }
286
286
  return {
@@ -291,13 +291,13 @@ function deleteWalletRpcSecret(env = process.env) {
291
291
  }
292
292
  function deleteWalletRpcSecretForProvider(providerId, env = process.env) {
293
293
  const secretPath = resolveWalletRpcSecretPath(env, providerId);
294
- if (!fs.existsSync(secretPath)) {
294
+ if (!syncFs.existsSync(secretPath)) {
295
295
  return {
296
296
  removed: false,
297
297
  path: secretPath
298
298
  };
299
299
  }
300
- fs.rmSync(secretPath, { force: true });
300
+ syncFs.rmSync(secretPath, { force: true });
301
301
  return {
302
302
  removed: true,
303
303
  path: secretPath
@@ -305,13 +305,13 @@ function deleteWalletRpcSecretForProvider(providerId, env = process.env) {
305
305
  }
306
306
  function deleteWalletProviderSecret(providerId, env = process.env) {
307
307
  const secretPath = resolveWalletProviderSecretPath(providerId, env);
308
- if (!fs.existsSync(secretPath)) {
308
+ if (!syncFs.existsSync(secretPath)) {
309
309
  return {
310
310
  removed: false,
311
311
  path: secretPath
312
312
  };
313
313
  }
314
- fs.rmSync(secretPath, { force: true });
314
+ syncFs.rmSync(secretPath, { force: true });
315
315
  return {
316
316
  removed: true,
317
317
  path: secretPath
@@ -16,7 +16,7 @@ import { enforceWalletCustodyForAutonomousSend, withWalletCustodySigningMaterial
16
16
  import { simulateWalletPolicy } from "./wallet-policy-simulation.js";
17
17
  import { getWalletSettlementLinkByRequestId, markWalletSettlementLinkOutcome, upsertWalletSettlementLink } from "./wallet-settlement-links.js";
18
18
  import { syncWalletApprovalTask, walletApprovalTaskId } from "./wallet-task-ledger.js";
19
- import fs from "node:fs";
19
+ import syncFs from "node:fs";
20
20
  import { randomBytes } from "node:crypto";
21
21
  import { setTimeout } from "node:timers/promises";
22
22
 
@@ -316,14 +316,14 @@ async function executeWalletSendWithRetry(params) {
316
316
  }
317
317
  function loadFile(env = process.env) {
318
318
  const paths = ensureWalletStateDir(env);
319
- if (!fs.existsSync(paths.sendApprovalsPath)) {
319
+ if (!syncFs.existsSync(paths.sendApprovalsPath)) {
320
320
  return {
321
321
  version: 1,
322
322
  requests: []
323
323
  };
324
324
  }
325
325
  try {
326
- const parsed = JSON.parse(fs.readFileSync(paths.sendApprovalsPath, "utf8"));
326
+ const parsed = JSON.parse(syncFs.readFileSync(paths.sendApprovalsPath, "utf8"));
327
327
  if (parsed?.version === 1 && Array.isArray(parsed.requests)) {
328
328
  return {
329
329
  version: 1,
@@ -338,12 +338,12 @@ function loadFile(env = process.env) {
338
338
  }
339
339
  function saveFile(file, env = process.env) {
340
340
  const paths = ensureWalletStateDir(env);
341
- fs.writeFileSync(paths.sendApprovalsPath, `${JSON.stringify(file, null, 2)}\n`, {
341
+ syncFs.writeFileSync(paths.sendApprovalsPath, `${JSON.stringify(file, null, 2)}\n`, {
342
342
  encoding: "utf8",
343
343
  mode: 384
344
344
  });
345
345
  try {
346
- fs.chmodSync(paths.sendApprovalsPath, 384);
346
+ syncFs.chmodSync(paths.sendApprovalsPath, 384);
347
347
  } catch {}
348
348
  }
349
349
  function markExpired(file) {
@@ -1,5 +1,5 @@
1
1
  import { ensureWalletStateDir } from "./wallet-runtime-config.js";
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/wallet/wallet-settlement-links.ts
@@ -8,14 +8,14 @@ function linksFilePath(env = process.env) {
8
8
  }
9
9
  function loadFile(env = process.env) {
10
10
  const filePath = linksFilePath(env);
11
- if (!fs.existsSync(filePath)) {
11
+ if (!syncFs.existsSync(filePath)) {
12
12
  return {
13
13
  version: 1,
14
14
  links: []
15
15
  };
16
16
  }
17
17
  try {
18
- const parsed = JSON.parse(fs.readFileSync(filePath, "utf8"));
18
+ const parsed = JSON.parse(syncFs.readFileSync(filePath, "utf8"));
19
19
  if (parsed?.version === 1 && Array.isArray(parsed.links)) {
20
20
  return {
21
21
  version: 1,
@@ -30,12 +30,12 @@ function loadFile(env = process.env) {
30
30
  }
31
31
  function saveFile(file, env = process.env) {
32
32
  const filePath = linksFilePath(env);
33
- fs.writeFileSync(filePath, `${JSON.stringify(file, null, 2)}\n`, {
33
+ syncFs.writeFileSync(filePath, `${JSON.stringify(file, null, 2)}\n`, {
34
34
  encoding: "utf8",
35
35
  mode: 384
36
36
  });
37
37
  try {
38
- fs.chmodSync(filePath, 384);
38
+ syncFs.chmodSync(filePath, 384);
39
39
  } catch {}
40
40
  }
41
41
  function upsertWalletSettlementLink(params) {
@@ -5,7 +5,7 @@ import "../routing/session-key.js";
5
5
  import { resolveAccountEntry } from "../routing/account-lookup.js";
6
6
  import { createAccountListHelpers } from "../channels/plugins/account-helpers.js";
7
7
  import { hasWebCredsSync } from "./auth-store.js";
8
- import fs from "node:fs";
8
+ import syncFs from "node:fs";
9
9
  import path from "node:path";
10
10
 
11
11
  //#region src/web/accounts.ts
@@ -24,7 +24,7 @@ function listWhatsAppAuthDirs(cfg) {
24
24
  }).authDir);
25
25
  }
26
26
  try {
27
- const entries = fs.readdirSync(whatsappDir, { withFileTypes: true });
27
+ const entries = syncFs.readdirSync(whatsappDir, { withFileTypes: true });
28
28
  for (const entry of entries) {
29
29
  if (!entry.isDirectory()) {
30
30
  continue;
@@ -48,7 +48,7 @@ function resolveLegacyAuthDir() {
48
48
  }
49
49
  function legacyAuthExists(authDir) {
50
50
  try {
51
- return fs.existsSync(path.join(authDir, "creds.json"));
51
+ return syncFs.existsSync(path.join(authDir, "creds.json"));
52
52
  } catch {
53
53
  return false;
54
54
  }
@@ -4,10 +4,10 @@ import { info, success } from "../globals.js";
4
4
  import { defaultRuntime } from "../runtime.js";
5
5
  import { formatCliCommand } from "../cli/command-format.js";
6
6
  import "../logging.js";
7
- import fs from "node:fs";
7
+ import syncFs from "node:fs";
8
8
  import os from "node:os";
9
9
  import path from "node:path";
10
- import fs$1 from "node:fs/promises";
10
+ import fs from "node:fs/promises";
11
11
 
12
12
  //#region src/web/auth-store.ts
13
13
  const DEFAULT_WEB_AUTH_ACCOUNT_ID = "default";
@@ -65,7 +65,7 @@ function readAuthStoreLidReverseMapping(lid, opts) {
65
65
  for (const dir of dirs) {
66
66
  const mappingPath = path.join(dir, mappingFilename);
67
67
  try {
68
- const data = fs.readFileSync(mappingPath, "utf8");
68
+ const data = syncFs.readFileSync(mappingPath, "utf8");
69
69
  const phone = JSON.parse(data);
70
70
  if (phone !== null && phone !== undefined) {
71
71
  return normalizeAuthStoreE164(String(phone));
@@ -97,7 +97,7 @@ function resolveWebCredsBackupPath(authDir) {
97
97
  }
98
98
  function hasWebCredsSync(authDir) {
99
99
  try {
100
- const stats = fs.statSync(resolveWebCredsPath(authDir));
100
+ const stats = syncFs.statSync(resolveWebCredsPath(authDir));
101
101
  return stats.isFile() && stats.size > 1;
102
102
  } catch {
103
103
  return false;
@@ -105,14 +105,14 @@ function hasWebCredsSync(authDir) {
105
105
  }
106
106
  function readCredsJsonRaw(filePath) {
107
107
  try {
108
- if (!fs.existsSync(filePath)) {
108
+ if (!syncFs.existsSync(filePath)) {
109
109
  return null;
110
110
  }
111
- const stats = fs.statSync(filePath);
111
+ const stats = syncFs.statSync(filePath);
112
112
  if (!stats.isFile() || stats.size <= 1) {
113
113
  return null;
114
114
  }
115
- return fs.readFileSync(filePath, "utf-8");
115
+ return syncFs.readFileSync(filePath, "utf-8");
116
116
  } catch {
117
117
  return null;
118
118
  }
@@ -132,9 +132,9 @@ function maybeRestoreCredsFromBackup(authDir) {
132
132
  return;
133
133
  }
134
134
  JSON.parse(backupRaw);
135
- fs.copyFileSync(backupPath, credsPath);
135
+ syncFs.copyFileSync(backupPath, credsPath);
136
136
  try {
137
- fs.chmodSync(credsPath, 384);
137
+ syncFs.chmodSync(credsPath, 384);
138
138
  } catch {}
139
139
  logger.warn({ credsPath }, "restored corrupted WhatsApp creds.json from backup");
140
140
  } catch {}
@@ -144,16 +144,16 @@ async function webAuthExists(authDir = resolveDefaultWebAuthDir()) {
144
144
  maybeRestoreCredsFromBackup(resolvedAuthDir);
145
145
  const credsPath = resolveWebCredsPath(resolvedAuthDir);
146
146
  try {
147
- await fs$1.access(resolvedAuthDir);
147
+ await fs.access(resolvedAuthDir);
148
148
  } catch {
149
149
  return false;
150
150
  }
151
151
  try {
152
- const stats = await fs$1.stat(credsPath);
152
+ const stats = await fs.stat(credsPath);
153
153
  if (!stats.isFile() || stats.size <= 1) {
154
154
  return false;
155
155
  }
156
- const raw = await fs$1.readFile(credsPath, "utf-8");
156
+ const raw = await fs.readFile(credsPath, "utf-8");
157
157
  JSON.parse(raw);
158
158
  return true;
159
159
  } catch {
@@ -161,7 +161,7 @@ async function webAuthExists(authDir = resolveDefaultWebAuthDir()) {
161
161
  }
162
162
  }
163
163
  async function clearLegacyBaileysAuthState(authDir) {
164
- const entries = await fs$1.readdir(authDir, { withFileTypes: true });
164
+ const entries = await fs.readdir(authDir, { withFileTypes: true });
165
165
  const shouldDelete = (name) => {
166
166
  if (name === "oauth.json") {
167
167
  return false;
@@ -181,7 +181,7 @@ async function clearLegacyBaileysAuthState(authDir) {
181
181
  if (!shouldDelete(entry.name)) {
182
182
  return;
183
183
  }
184
- await fs$1.rm(path.join(authDir, entry.name), { force: true });
184
+ await fs.rm(path.join(authDir, entry.name), { force: true });
185
185
  }));
186
186
  }
187
187
  async function logoutWeb(params) {
@@ -195,7 +195,7 @@ async function logoutWeb(params) {
195
195
  if (params.isLegacyAuthDir) {
196
196
  await clearLegacyBaileysAuthState(resolvedAuthDir);
197
197
  } else {
198
- await fs$1.rm(resolvedAuthDir, {
198
+ await fs.rm(resolvedAuthDir, {
199
199
  recursive: true,
200
200
  force: true
201
201
  });
@@ -206,13 +206,13 @@ async function logoutWeb(params) {
206
206
  function readWebSelfId(authDir = resolveDefaultWebAuthDir()) {
207
207
  try {
208
208
  const credsPath = resolveWebCredsPath(resolveAuthStoreUserPath(authDir));
209
- if (!fs.existsSync(credsPath)) {
209
+ if (!syncFs.existsSync(credsPath)) {
210
210
  return {
211
211
  e164: null,
212
212
  jid: null
213
213
  };
214
214
  }
215
- const raw = fs.readFileSync(credsPath, "utf-8");
215
+ const raw = syncFs.readFileSync(credsPath, "utf-8");
216
216
  const parsed = JSON.parse(raw);
217
217
  const jid = parsed?.me?.id ?? null;
218
218
  const e164 = jid ? jidToE164ForAuthStore(jid, { authDir }) : null;
@@ -233,7 +233,7 @@ function readWebSelfId(authDir = resolveDefaultWebAuthDir()) {
233
233
  */
234
234
  function getWebAuthAgeMs(authDir = resolveDefaultWebAuthDir()) {
235
235
  try {
236
- const stats = fs.statSync(resolveWebCredsPath(resolveAuthStoreUserPath(authDir)));
236
+ const stats = syncFs.statSync(resolveWebCredsPath(resolveAuthStoreUserPath(authDir)));
237
237
  return Date.now() - stats.mtimeMs;
238
238
  } catch {
239
239
  return null;
@@ -7,7 +7,7 @@ import { redactSensitiveText } from "../logging/redact.js";
7
7
  import "../logging.js";
8
8
  import { WA_WEB_AUTH_DIR, getWebAuthAgeMs, logWebSelfId, logoutWeb, maybeRestoreCredsFromBackup, pickWebChannel, readCredsJsonRaw, readWebSelfId, resolveDefaultWebAuthDir, resolveWebCredsBackupPath, resolveWebCredsPath, webAuthExists } from "./auth-store.js";
9
9
  import { redactSensitiveUrlLikeString } from "../shared/net/redact-sensitive-url.js";
10
- import fs from "node:fs";
10
+ import syncFs from "node:fs";
11
11
  import { randomUUID } from "node:crypto";
12
12
  import { DisconnectReason, fetchLatestBaileysVersion, makeCacheableSignalKeyStore, makeWASocket, useMultiFileAuthState } from "@whiskeysockets/baileys";
13
13
  import qrcode from "qrcode-terminal";
@@ -27,9 +27,9 @@ async function safeSaveCreds(authDir, saveCreds, logger) {
27
27
  if (raw) {
28
28
  try {
29
29
  JSON.parse(raw);
30
- fs.copyFileSync(credsPath, backupPath);
30
+ syncFs.copyFileSync(credsPath, backupPath);
31
31
  try {
32
- fs.chmodSync(backupPath, 384);
32
+ syncFs.chmodSync(backupPath, 384);
33
33
  } catch {}
34
34
  } catch {}
35
35
  }
@@ -37,7 +37,7 @@ async function safeSaveCreds(authDir, saveCreds, logger) {
37
37
  try {
38
38
  await Promise.resolve(saveCreds());
39
39
  try {
40
- fs.chmodSync(resolveWebCredsPath(authDir), 384);
40
+ syncFs.chmodSync(resolveWebCredsPath(authDir), 384);
41
41
  } catch {}
42
42
  } catch (err) {
43
43
  logger.warn({ error: formatError(err) }, "failed saving WhatsApp creds");
@@ -1,4 +1,4 @@
1
- import fs from "node:fs";
1
+ import syncFs from "node:fs";
2
2
  import os from "node:os";
3
3
  import path from "node:path";
4
4
  import { spawnSync } from "node:child_process";
@@ -24,7 +24,7 @@ function isHostedSecurityCapableSession(explicitFlag = false) {
24
24
  const currentUser = currentUserName();
25
25
  if (currentUser) {
26
26
  const sudoersPath = path.join("/etc/sudoers.d", `fased-host-maintenance-${currentUser}`);
27
- if (fs.existsSync(sudoersPath)) {
27
+ if (syncFs.existsSync(sudoersPath)) {
28
28
  return true;
29
29
  }
30
30
  }
@@ -2,7 +2,7 @@ import { redactSensitiveText } from "../logging/redact.js";
2
2
  import { redactSensitiveUrlLikeString } from "../shared/net/redact-sensitive-url.js";
3
3
  import { noteCommands, noteHeading, noteStep, noteWarn } from "./onboarding-note-format.js";
4
4
  import { isHostingProfile } from "./onboarding.types.js";
5
- import fs from "node:fs";
5
+ import syncFs from "node:fs";
6
6
  import os from "node:os";
7
7
  import path from "node:path";
8
8
  import { spawn, spawnSync } from "node:child_process";
@@ -12,7 +12,7 @@ import { Buffer } from "node:buffer";
12
12
  function resolveHostSecurityLogPath() {
13
13
  const home = process.env.HOME?.trim() || os.homedir();
14
14
  const logDir = path.join(home, ".fased", "logs");
15
- fs.mkdirSync(logDir, {
15
+ syncFs.mkdirSync(logDir, {
16
16
  recursive: true,
17
17
  mode: 448
18
18
  });
@@ -26,7 +26,7 @@ function appendHostSecurityLog(logPath, title, detail) {
26
26
  sanitizedDetail?.trim() || "(no output)",
27
27
  ""
28
28
  ].join("\n");
29
- fs.appendFileSync(logPath, body, "utf8");
29
+ syncFs.appendFileSync(logPath, body, "utf8");
30
30
  }
31
31
  function resolveTailnetSshConfirmationPath() {
32
32
  const stateDir = process.env.FASED_STATE_DIR?.trim() || process.env.FASED_CONFIG_DIR?.trim() || path.join(process.env.HOME?.trim() || os.homedir(), ".fased");
@@ -34,7 +34,7 @@ function resolveTailnetSshConfirmationPath() {
34
34
  }
35
35
  function hasStoredTailnetSshConfirmation(target) {
36
36
  try {
37
- const raw = fs.readFileSync(resolveTailnetSshConfirmationPath(), "utf8");
37
+ const raw = syncFs.readFileSync(resolveTailnetSshConfirmationPath(), "utf8");
38
38
  const parsed = JSON.parse(raw);
39
39
  return parsed.user === target.user && parsed.repoDir === target.repoDir;
40
40
  } catch {
@@ -43,11 +43,11 @@ function hasStoredTailnetSshConfirmation(target) {
43
43
  }
44
44
  function writeTailnetSshConfirmation(target) {
45
45
  const markerPath = resolveTailnetSshConfirmationPath();
46
- fs.mkdirSync(path.dirname(markerPath), {
46
+ syncFs.mkdirSync(path.dirname(markerPath), {
47
47
  recursive: true,
48
48
  mode: 448
49
49
  });
50
- fs.writeFileSync(markerPath, `${JSON.stringify({
50
+ syncFs.writeFileSync(markerPath, `${JSON.stringify({
51
51
  confirmedAt: new Date().toISOString(),
52
52
  user: target.user,
53
53
  host: target.host,
@@ -75,7 +75,7 @@ const HOST_MAINTENANCE_HELPER = "/usr/local/sbin/fased-host-maintenance";
75
75
  function detectTotalMemoryMb() {
76
76
  if (process.platform === "linux") {
77
77
  try {
78
- const meminfo = fs.readFileSync("/proc/meminfo", "utf8");
78
+ const meminfo = syncFs.readFileSync("/proc/meminfo", "utf8");
79
79
  const match = meminfo.match(/^MemTotal:\s+(\d+)\s+kB/m);
80
80
  if (match?.[1]) {
81
81
  return Math.floor(Number.parseInt(match[1], 10) / 1024);