@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
@@ -17,10 +17,10 @@ import { formatDocsLink } from "../terminal/links.js";
17
17
  import { withManager } from "./cli-utils.js";
18
18
  import { formatHelpExamples } from "./help-format.js";
19
19
  import { withProgress, withProgressTotals } from "./progress.js";
20
- import syncFs from "node:fs";
20
+ import fs from "node:fs";
21
21
  import os from "node:os";
22
22
  import path from "node:path";
23
- import fs from "node:fs/promises";
23
+ import fs$1 from "node:fs/promises";
24
24
 
25
25
  //#region src/cli/memory-cli.ts
26
26
  function formatSourceLabel(source, workspaceDir, agentId) {
@@ -74,7 +74,7 @@ async function withMemoryManagerForAgent(params) {
74
74
  }
75
75
  async function checkReadableFile(pathname) {
76
76
  try {
77
- await fs.access(pathname, syncFs.constants.R_OK);
77
+ await fs$1.access(pathname, fs.constants.R_OK);
78
78
  return { exists: true };
79
79
  } catch (err) {
80
80
  const code = err.code;
@@ -91,7 +91,7 @@ async function scanSessionFiles(agentId) {
91
91
  const issues = [];
92
92
  const sessionsDir = resolveSessionTranscriptsDirForAgent(agentId);
93
93
  try {
94
- const entries = await fs.readdir(sessionsDir, { withFileTypes: true });
94
+ const entries = await fs$1.readdir(sessionsDir, { withFileTypes: true });
95
95
  const totalFiles = entries.filter((entry) => entry.isFile() && entry.name.endsWith(".jsonl")).length;
96
96
  return {
97
97
  source: "sessions",
@@ -132,7 +132,7 @@ async function scanMemoryFiles(workspaceDir, extraPaths = []) {
132
132
  const resolvedExtraPaths = normalizeExtraMemoryPaths(workspaceDir, extraPaths);
133
133
  for (const extraPath of resolvedExtraPaths) {
134
134
  try {
135
- const stat = await fs.lstat(extraPath);
135
+ const stat = await fs$1.lstat(extraPath);
136
136
  if (stat.isSymbolicLink()) {
137
137
  continue;
138
138
  }
@@ -151,7 +151,7 @@ async function scanMemoryFiles(workspaceDir, extraPaths = []) {
151
151
  }
152
152
  let dirReadable = null;
153
153
  try {
154
- await fs.access(memoryDir, syncFs.constants.R_OK);
154
+ await fs$1.access(memoryDir, fs.constants.R_OK);
155
155
  dirReadable = true;
156
156
  } catch (err) {
157
157
  const code = err.code;
@@ -210,7 +210,7 @@ async function summarizeQmdIndexArtifact(manager) {
210
210
  }
211
211
  let stat;
212
212
  try {
213
- stat = await fs.stat(dbPath);
213
+ stat = await fs$1.stat(dbPath);
214
214
  } catch (err) {
215
215
  const code = err.code;
216
216
  if (code === "ENOENT") {
@@ -1,5 +1,5 @@
1
1
  import { resolvePreferredFasedAgentTmpDir } from "../infra/tmp-fased-dir.js";
2
- import syncFs from "node:fs";
2
+ import fs from "node:fs";
3
3
  import { randomUUID } from "node:crypto";
4
4
 
5
5
  //#region src/cli/nodes-media-utils.ts
@@ -18,7 +18,7 @@ function asBoolean(value) {
18
18
  function resolveTempPathParts(opts) {
19
19
  const tmpDir = opts.tmpDir ?? resolvePreferredFasedAgentTmpDir();
20
20
  if (!opts.tmpDir) {
21
- syncFs.mkdirSync(tmpDir, {
21
+ fs.mkdirSync(tmpDir, {
22
22
  recursive: true,
23
23
  mode: 448
24
24
  });
@@ -22,7 +22,7 @@ import "./plugins-config.js";
22
22
  import { pluginDoctorCommand } from "./plugins-doctor-cli.js";
23
23
  import { pluginInfoCommand } from "./plugins-info-cli.js";
24
24
  import "./plugins-status-cli.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
 
@@ -428,7 +428,7 @@ function registerPluginsCli(program) {
428
428
  const normalized = fileSpec && fileSpec.ok ? fileSpec.path : raw;
429
429
  const resolved = resolveUserPath(normalized);
430
430
  const cfg = loadConfig();
431
- if (syncFs.existsSync(resolved)) {
431
+ if (fs.existsSync(resolved)) {
432
432
  if (opts.link) {
433
433
  const probe = await installPluginFromPath({
434
434
  path: resolved,
@@ -7,12 +7,12 @@ import { isSecretsApplyPlan } from "../secrets/plan.js";
7
7
  import { runSecretsApply } from "../secrets/apply.js";
8
8
  import { resolveSecretsAuditExitCode, runSecretsAudit } from "../secrets/audit.js";
9
9
  import { runSecretsConfigureInteractive } from "../secrets/configure.js";
10
- import syncFs from "node:fs";
10
+ import fs from "node:fs";
11
11
  import { confirm } from "@clack/prompts";
12
12
 
13
13
  //#region src/cli/secrets-cli.ts
14
14
  function readPlanFile(pathname) {
15
- const raw = syncFs.readFileSync(pathname, "utf8");
15
+ const raw = fs.readFileSync(pathname, "utf8");
16
16
  const parsed = JSON.parse(raw);
17
17
  if (!isSecretsApplyPlan(parsed)) {
18
18
  throw new Error(`Invalid secrets plan file: ${pathname}`);
@@ -71,7 +71,7 @@ function registerSecretsCli(program) {
71
71
  skipProviderSetup: Boolean(opts.skipProviderSetup)
72
72
  });
73
73
  if (opts.planOut) {
74
- syncFs.writeFileSync(opts.planOut, `${JSON.stringify(configured.plan, null, 2)}\n`, "utf8");
74
+ fs.writeFileSync(opts.planOut, `${JSON.stringify(configured.plan, null, 2)}\n`, "utf8");
75
75
  }
76
76
  if (opts.json) {
77
77
  defaultRuntime.log(JSON.stringify({
@@ -1,5 +1,4 @@
1
1
  import { resolveStateDir } from "../../config/paths.js";
2
- import { theme } from "../../terminal/theme.js";
3
2
  import { pathExists } from "../../utils.js";
4
3
  import { defaultRuntime } from "../../runtime.js";
5
4
  import { runCommandWithTimeout } from "../../process/exec.js";
@@ -12,7 +11,6 @@ import { readPackageName, readPackageVersion } from "../../infra/package-json.js
12
11
  import os from "node:os";
13
12
  import path from "node:path";
14
13
  import fs from "node:fs/promises";
15
- import { spawnSync } from "node:child_process";
16
14
 
17
15
  //#region src/cli/update-cli/shared.ts
18
16
  const INVALID_TIMEOUT_ERROR = "--timeout must be a positive integer (seconds)";
@@ -195,32 +193,6 @@ async function resolveGlobalManager(params) {
195
193
  const byPresence = await detectGlobalInstallManagerByPresence(runCommand, params.timeoutMs);
196
194
  return byPresence ?? "npm";
197
195
  }
198
- async function tryWriteCompletionCache(root, jsonMode) {
199
- const binPath = path.join(root, "fased.mjs");
200
- if (!await pathExists(binPath)) {
201
- return;
202
- }
203
- const result = spawnSync(resolveNodeRunner(), [
204
- binPath,
205
- "completion",
206
- "--write-state"
207
- ], {
208
- cwd: root,
209
- env: process.env,
210
- encoding: "utf-8"
211
- });
212
- if (result.error) {
213
- if (!jsonMode) {
214
- defaultRuntime.log(theme.warn(`Completion cache update failed: ${String(result.error)}`));
215
- }
216
- return;
217
- }
218
- if (result.status !== 0 && !jsonMode) {
219
- const stderr = (result.stderr ?? "").toString().trim();
220
- const detail = stderr ? ` (${stderr})` : "";
221
- defaultRuntime.log(theme.warn(`Completion cache update failed${detail}.`));
222
- }
223
- }
224
196
  function createGlobalCommandRunner() {
225
197
  return async (argv, options) => {
226
198
  const res = await runCommandWithTimeout(argv, options);
@@ -233,4 +205,4 @@ function createGlobalCommandRunner() {
233
205
  }
234
206
 
235
207
  //#endregion
236
- export { DEFAULT_PACKAGE_NAME, createGlobalCommandRunner, ensureGitCheckout, isEmptyDir, isGitCheckout, normalizeTag, parseTimeoutMsOrExit, resolveGitInstallDir, resolveGlobalManager, resolveNodeRunner, resolveTargetVersion, resolveUpdateRoot, runUpdateStep, tryWriteCompletionCache };
208
+ export { DEFAULT_PACKAGE_NAME, createGlobalCommandRunner, ensureGitCheckout, isEmptyDir, isGitCheckout, normalizeTag, parseTimeoutMsOrExit, resolveGitInstallDir, resolveGlobalManager, resolveNodeRunner, resolveTargetVersion, resolveUpdateRoot, runUpdateStep };
@@ -23,7 +23,7 @@ import { finalizeUpdateTransaction, rollbackUpdateTransaction, runGatewayUpdate
23
23
  import { checkShellCompletionStatus, ensureCompletionCacheExists } from "../../commands/doctor-completion.js";
24
24
  import { runPostUpdateDoctorRepair } from "../../commands/doctor-update.js";
25
25
  import { doctorCommand } from "../../commands/doctor.js";
26
- import { DEFAULT_PACKAGE_NAME, createGlobalCommandRunner, ensureGitCheckout, normalizeTag, parseTimeoutMsOrExit, resolveGitInstallDir, resolveGlobalManager, resolveNodeRunner, resolveTargetVersion, resolveUpdateRoot, runUpdateStep, tryWriteCompletionCache } from "./shared.js";
26
+ import { DEFAULT_PACKAGE_NAME, createGlobalCommandRunner, ensureGitCheckout, normalizeTag, parseTimeoutMsOrExit, resolveGitInstallDir, resolveGlobalManager, resolveNodeRunner, resolveTargetVersion, resolveUpdateRoot, runUpdateStep } from "./shared.js";
27
27
  import { createUpdateProgress, printResult } from "./progress.js";
28
28
  import { prepareRestartScript, runRestartScript } from "./restart-helper.js";
29
29
  import { resolveUpdateGatewayServiceTarget } from "./service-target.js";
@@ -536,22 +536,15 @@ async function maybeRestartService(params) {
536
536
  defaultRuntime.log(theme.warn(`Found stale gateway process(es) after restart: ${health.staleGatewayPids.join(", ")}. Cleaning up...`));
537
537
  }
538
538
  await measureUpdateStage(timings, "stale process cleanup", () => terminateStaleGatewayPids(health.staleGatewayPids));
539
- health = await measureUpdateStage(timings, "gateway health after cleanup", () => waitForGatewayHealthyRestart({
539
+ await measureUpdateStage(timings, "service recovery restart", () => params.serviceTarget.service.restart({
540
+ env: process.env,
541
+ stdout: process.stdout
542
+ }));
543
+ health = await measureUpdateStage(timings, "gateway recovery verification", () => waitForGatewayHealthyRestart({
540
544
  service: params.serviceTarget.service,
541
545
  port: params.gatewayPort,
542
546
  rpc: params.rpc
543
547
  }));
544
- if (!health.healthy) {
545
- await measureUpdateStage(timings, "service recovery restart", () => params.serviceTarget.service.restart({
546
- env: process.env,
547
- stdout: process.stdout
548
- }));
549
- health = await measureUpdateStage(timings, "gateway recovery verification", () => waitForGatewayHealthyRestart({
550
- service: params.serviceTarget.service,
551
- port: params.gatewayPort,
552
- rpc: params.rpc
553
- }));
554
- }
555
548
  }
556
549
  if (health.healthy) {
557
550
  if (!params.opts.json) {
@@ -610,6 +603,7 @@ async function maybeRestartService(params) {
610
603
  };
611
604
  }
612
605
  async function updateCommand(opts) {
606
+ const commandStartedAt = Date.now();
613
607
  suppressDeprecations();
614
608
  const timeoutMs = parseTimeoutMsOrExit(opts.timeout);
615
609
  const shouldRestart = opts.restart !== false;
@@ -842,7 +836,7 @@ async function updateCommand(opts) {
842
836
  token: gatewayConfig?.auth?.token,
843
837
  password: gatewayConfig?.auth?.password,
844
838
  tlsFingerprint: tlsRuntime.enabled ? tlsRuntime.fingerprintSha256 : undefined,
845
- timeoutMs: 5e3
839
+ timeoutMs: 1500
846
840
  };
847
841
  const restartResult = await maybeRestartService({
848
842
  shouldRestart,
@@ -895,11 +889,14 @@ async function updateCommand(opts) {
895
889
  timing.name = "plugin update check (none installed)";
896
890
  }
897
891
  }
898
- await measureUpdateStage(lifecycleTimings, "completion cache", () => tryWriteCompletionCache(root, Boolean(opts.json)));
899
892
  await measureUpdateStage(lifecycleTimings, "shell completion", () => tryInstallShellCompletion({
900
893
  jsonMode: Boolean(opts.json),
901
894
  skipPrompt: Boolean(opts.yes)
902
895
  }));
896
+ lifecycleTimings.push({
897
+ name: "total command wall time",
898
+ durationMs: Date.now() - commandStartedAt
899
+ });
903
900
  printUpdateLifecycleTimings(lifecycleTimings, Boolean(opts.json));
904
901
  if (!opts.json && !restartResult.partial) {
905
902
  defaultRuntime.log(theme.muted(pickUpdateQuip()));
@@ -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/cli/windows-argv.ts
@@ -33,7 +33,7 @@ function normalizeWindowsArgv(argv) {
33
33
  return false;
34
34
  }
35
35
  const lower = normalized.toLowerCase();
36
- return lower === execPathLower || path.basename(lower) === execBase || lower.endsWith("\\node.exe") || lower.endsWith("/node.exe") || lower.includes("node.exe") || path.basename(lower) === "node.exe" && syncFs.existsSync(normalized);
36
+ return lower === execPathLower || path.basename(lower) === execBase || lower.endsWith("\\node.exe") || lower.endsWith("/node.exe") || lower.includes("node.exe") || path.basename(lower) === "node.exe" && fs.existsSync(normalized);
37
37
  };
38
38
  const next = [...argv];
39
39
  for (let i = 1; i <= 3 && i < next.length;) {
@@ -4,7 +4,7 @@ import { parseDurationMs } from "../cli/parse-duration.js";
4
4
  import { readConfigFileSnapshot } from "../config/io.js";
5
5
  import "../config/config.js";
6
6
  import { CONTROL_UI_LOGIN_DEFAULT_GRANT_TTL_MS, createLoginGrant, normalizePublicHost } from "../gateway/control-ui-login.js";
7
- import syncFs from "node:fs";
7
+ import fs from "node:fs";
8
8
  import path from "node:path";
9
9
 
10
10
  //#region src/commands/dashboard-link.ts
@@ -12,10 +12,10 @@ const AGENT_DOMAIN_SUFFIX = ".agents.fased.app";
12
12
  function readStateGatewayToken(env = process.env) {
13
13
  try {
14
14
  const filePath = path.join(resolveStateDir(env), "gateway-secret");
15
- if (!syncFs.existsSync(filePath)) {
15
+ if (!fs.existsSync(filePath)) {
16
16
  return "";
17
17
  }
18
- return syncFs.readFileSync(filePath, "utf8").trim();
18
+ return fs.readFileSync(filePath, "utf8").trim();
19
19
  } catch {
20
20
  return "";
21
21
  }
@@ -1,5 +1,5 @@
1
1
  import { note } from "../terminal/note.js";
2
- import syncFs from "node:fs";
2
+ import fs from "node:fs";
3
3
  import path from "node:path";
4
4
 
5
5
  //#region src/commands/doctor-install.ts
@@ -8,7 +8,7 @@ function noteSourceInstallIssues(root) {
8
8
  return;
9
9
  }
10
10
  const workspaceMarker = path.join(root, "pnpm-workspace.yaml");
11
- if (!syncFs.existsSync(workspaceMarker)) {
11
+ if (!fs.existsSync(workspaceMarker)) {
12
12
  return;
13
13
  }
14
14
  const warnings = [];
@@ -16,13 +16,13 @@ function noteSourceInstallIssues(root) {
16
16
  const pnpmStore = path.join(nodeModules, ".pnpm");
17
17
  const tsxBin = path.join(nodeModules, ".bin", "tsx");
18
18
  const srcEntry = path.join(root, "src", "entry.ts");
19
- if (syncFs.existsSync(nodeModules) && !syncFs.existsSync(pnpmStore)) {
19
+ if (fs.existsSync(nodeModules) && !fs.existsSync(pnpmStore)) {
20
20
  warnings.push("- node_modules was not installed by pnpm (missing node_modules/.pnpm). Run: pnpm install");
21
21
  }
22
- if (syncFs.existsSync(path.join(root, "package-lock.json"))) {
22
+ if (fs.existsSync(path.join(root, "package-lock.json"))) {
23
23
  warnings.push("- package-lock.json present in a pnpm workspace. If you ran npm install, remove it and reinstall with pnpm.");
24
24
  }
25
- if (syncFs.existsSync(srcEntry) && !syncFs.existsSync(tsxBin)) {
25
+ if (fs.existsSync(srcEntry) && !fs.existsSync(tsxBin)) {
26
26
  warnings.push("- tsx binary is missing for source runs. Run: pnpm install");
27
27
  }
28
28
  if (warnings.length > 0) {
@@ -5,7 +5,7 @@ import { resolveApiKeyForProvider } from "../agents/model-auth.js";
5
5
  import { resolveMemoryBackendConfig } from "../memory/backend-config.js";
6
6
  import { resolveMemorySearchConfig } from "../agents/memory-search.js";
7
7
  import { note } from "../terminal/note.js";
8
- import syncFs from "node:fs";
8
+ import fs from "node:fs";
9
9
 
10
10
  //#region src/commands/doctor-memory-search.ts
11
11
  /**
@@ -126,7 +126,7 @@ function hasLocalEmbeddings(local) {
126
126
  }
127
127
  const resolved = resolveUserPath(modelPath);
128
128
  try {
129
- return syncFs.statSync(resolved).isFile();
129
+ return fs.statSync(resolved).isFile();
130
130
  } catch {
131
131
  return false;
132
132
  }
@@ -1,6 +1,6 @@
1
1
  import { shortenHomePath } from "../utils.js";
2
2
  import { note } from "../terminal/note.js";
3
- import syncFs from "node:fs";
3
+ import fs from "node:fs";
4
4
  import os from "node:os";
5
5
  import path from "node:path";
6
6
  import { promisify } from "node:util";
@@ -17,7 +17,7 @@ async function noteMacLaunchAgentOverrides() {
17
17
  }
18
18
  const home = resolveHomeDir();
19
19
  const markerCandidates = [path.join(home, ".fased", "disable-launchagent")];
20
- const markerPath = markerCandidates.find((candidate) => syncFs.existsSync(candidate));
20
+ const markerPath = markerCandidates.find((candidate) => fs.existsSync(candidate));
21
21
  if (!markerPath) {
22
22
  return;
23
23
  }
@@ -3,7 +3,7 @@ import { DEFAULT_SANDBOX_BROWSER_IMAGE, DEFAULT_SANDBOX_COMMON_IMAGE, DEFAULT_SA
3
3
  import { resolveSandboxScope } from "../agents/sandbox/config.js";
4
4
  import "../agents/sandbox.js";
5
5
  import { note } from "../terminal/note.js";
6
- import syncFs from "node:fs";
6
+ import fs from "node:fs";
7
7
  import path from "node:path";
8
8
 
9
9
  //#region src/commands/doctor-sandbox.ts
@@ -18,7 +18,7 @@ function resolveSandboxScript(scriptRel) {
18
18
  }
19
19
  for (const root of candidates) {
20
20
  const scriptPath = path.join(root, scriptRel);
21
- if (syncFs.existsSync(scriptPath)) {
21
+ if (fs.existsSync(scriptPath)) {
22
22
  return {
23
23
  scriptPath,
24
24
  cwd: root
@@ -10,28 +10,28 @@ import { resolveSessionFilePath, resolveSessionFilePathOptions, resolveSessionTr
10
10
  import { loadSessionStore } from "../config/sessions/store.js";
11
11
  import "../config/sessions.js";
12
12
  import { note } from "../terminal/note.js";
13
- import syncFs from "node:fs";
13
+ import fs from "node:fs";
14
14
  import os from "node:os";
15
15
  import path from "node:path";
16
16
 
17
17
  //#region src/commands/doctor-state-integrity.ts
18
18
  function existsDir(dir) {
19
19
  try {
20
- return syncFs.existsSync(dir) && syncFs.statSync(dir).isDirectory();
20
+ return fs.existsSync(dir) && fs.statSync(dir).isDirectory();
21
21
  } catch {
22
22
  return false;
23
23
  }
24
24
  }
25
25
  function existsFile(filePath) {
26
26
  try {
27
- return syncFs.existsSync(filePath) && syncFs.statSync(filePath).isFile();
27
+ return fs.existsSync(filePath) && fs.statSync(filePath).isFile();
28
28
  } catch {
29
29
  return false;
30
30
  }
31
31
  }
32
32
  function canWriteDir(dir) {
33
33
  try {
34
- syncFs.accessSync(dir, syncFs.constants.W_OK);
34
+ fs.accessSync(dir, fs.constants.W_OK);
35
35
  return true;
36
36
  } catch {
37
37
  return false;
@@ -39,7 +39,7 @@ function canWriteDir(dir) {
39
39
  }
40
40
  function ensureDir(dir) {
41
41
  try {
42
- syncFs.mkdirSync(dir, { recursive: true });
42
+ fs.mkdirSync(dir, { recursive: true });
43
43
  return { ok: true };
44
44
  } catch (err) {
45
45
  return {
@@ -52,7 +52,7 @@ function dirPermissionHint(dir) {
52
52
  const uid = typeof process.getuid === "function" ? process.getuid() : null;
53
53
  const gid = typeof process.getgid === "function" ? process.getgid() : null;
54
54
  try {
55
- const stat = syncFs.statSync(dir);
55
+ const stat = fs.statSync(dir);
56
56
  if (uid !== null && stat.uid !== uid) {
57
57
  return `Owner mismatch (uid ${stat.uid}). Run: sudo chown -R $USER "${dir}"`;
58
58
  }
@@ -70,7 +70,7 @@ function addUserRwx(mode) {
70
70
  }
71
71
  function countJsonlLines(filePath) {
72
72
  try {
73
- const raw = syncFs.readFileSync(filePath, "utf-8");
73
+ const raw = fs.readFileSync(filePath, "utf-8");
74
74
  if (!raw) {
75
75
  return 0;
76
76
  }
@@ -95,7 +95,7 @@ function findOtherStateDirs(stateDir) {
95
95
  for (const root of roots) {
96
96
  let entries = [];
97
97
  try {
98
- entries = syncFs.readdirSync(root, { withFileTypes: true });
98
+ entries = fs.readdirSync(root, { withFileTypes: true });
99
99
  } catch {
100
100
  continue;
101
101
  }
@@ -225,9 +225,9 @@ async function noteStateIntegrity(cfg, prompter, configPath) {
225
225
  });
226
226
  if (repair) {
227
227
  try {
228
- const stat = syncFs.statSync(stateDir);
228
+ const stat = fs.statSync(stateDir);
229
229
  const target = addUserRwx(stat.mode);
230
- syncFs.chmodSync(stateDir, target);
230
+ fs.chmodSync(stateDir, target);
231
231
  changes.push(`- Repaired permissions on ${displayStateDir}`);
232
232
  } catch (err) {
233
233
  warnings.push(`- Failed to repair ${displayStateDir}: ${String(err)}`);
@@ -236,10 +236,10 @@ async function noteStateIntegrity(cfg, prompter, configPath) {
236
236
  }
237
237
  if (stateDirExists && process.platform !== "win32") {
238
238
  try {
239
- const dirLstat = syncFs.lstatSync(stateDir);
239
+ const dirLstat = fs.lstatSync(stateDir);
240
240
  const isDirSymlink = dirLstat.isSymbolicLink();
241
- const stat = isDirSymlink ? syncFs.statSync(stateDir) : dirLstat;
242
- const resolvedDir = isDirSymlink ? syncFs.realpathSync(stateDir) : stateDir;
241
+ const stat = isDirSymlink ? fs.statSync(stateDir) : dirLstat;
242
+ const resolvedDir = isDirSymlink ? fs.realpathSync(stateDir) : stateDir;
243
243
  const isImmutableStore = resolvedDir.startsWith("/nix/store/");
244
244
  if (!isImmutableStore && (stat.mode & 63) !== 0) {
245
245
  warnings.push(`- State directory permissions are too open (${displayStateDir}). Recommend chmod 700.`);
@@ -248,7 +248,7 @@ async function noteStateIntegrity(cfg, prompter, configPath) {
248
248
  initialValue: true
249
249
  });
250
250
  if (tighten) {
251
- syncFs.chmodSync(stateDir, 448);
251
+ fs.chmodSync(stateDir, 448);
252
252
  changes.push(`- Tightened permissions on ${displayStateDir} to 700`);
253
253
  }
254
254
  }
@@ -258,10 +258,10 @@ async function noteStateIntegrity(cfg, prompter, configPath) {
258
258
  }
259
259
  if (configPath && existsFile(configPath) && process.platform !== "win32") {
260
260
  try {
261
- const configLstat = syncFs.lstatSync(configPath);
261
+ const configLstat = fs.lstatSync(configPath);
262
262
  const isSymlink = configLstat.isSymbolicLink();
263
- const stat = isSymlink ? syncFs.statSync(configPath) : configLstat;
264
- const resolvedConfig = isSymlink ? syncFs.realpathSync(configPath) : configPath;
263
+ const stat = isSymlink ? fs.statSync(configPath) : configLstat;
264
+ const resolvedConfig = isSymlink ? fs.realpathSync(configPath) : configPath;
265
265
  const isImmutableConfig = resolvedConfig.startsWith("/nix/store/");
266
266
  if (!isImmutableConfig && (stat.mode & 63) !== 0) {
267
267
  warnings.push(`- Config file is group/world readable (${displayConfigPath ?? configPath}). Recommend chmod 600.`);
@@ -270,7 +270,7 @@ async function noteStateIntegrity(cfg, prompter, configPath) {
270
270
  initialValue: true
271
271
  });
272
272
  if (tighten) {
273
- syncFs.chmodSync(configPath, 384);
273
+ fs.chmodSync(configPath, 384);
274
274
  changes.push(`- Tightened permissions on ${displayConfigPath ?? configPath} to 600`);
275
275
  }
276
276
  }
@@ -329,9 +329,9 @@ async function noteStateIntegrity(cfg, prompter, configPath) {
329
329
  });
330
330
  if (repair) {
331
331
  try {
332
- const stat = syncFs.statSync(dir);
332
+ const stat = fs.statSync(dir);
333
333
  const target = addUserRwx(stat.mode);
334
- syncFs.chmodSync(dir, target);
334
+ fs.chmodSync(dir, target);
335
335
  changes.push(`- Repaired permissions on ${label}: ${displayDir}`);
336
336
  } catch (err) {
337
337
  warnings.push(`- Failed to repair ${displayDir}: ${String(err)}`);
@@ -409,7 +409,7 @@ async function noteStateIntegrity(cfg, prompter, configPath) {
409
409
  referencedTranscriptPaths.add(path.resolve(resolveSessionFilePath(entry.sessionId, entry, sessionPathOpts)));
410
410
  } catch {}
411
411
  }
412
- const sessionDirEntries = syncFs.readdirSync(sessionsDir, { withFileTypes: true });
412
+ const sessionDirEntries = fs.readdirSync(sessionsDir, { withFileTypes: true });
413
413
  const orphanTranscriptPaths = sessionDirEntries.filter((entry) => entry.isFile() && isPrimarySessionTranscriptFileName(entry.name)).map((entry) => path.resolve(path.join(sessionsDir, entry.name))).filter((filePath) => !referencedTranscriptPaths.has(filePath));
414
414
  if (orphanTranscriptPaths.length > 0) {
415
415
  warnings.push(`- Found ${orphanTranscriptPaths.length} orphan transcript file(s) in ${displaySessionsDir}. They are not referenced by sessions.json and can consume disk over time.`);
@@ -423,7 +423,7 @@ async function noteStateIntegrity(cfg, prompter, configPath) {
423
423
  for (const orphanPath of orphanTranscriptPaths) {
424
424
  const archivedPath = `${orphanPath}.deleted.${archivedAt}`;
425
425
  try {
426
- syncFs.renameSync(orphanPath, archivedPath);
426
+ fs.renameSync(orphanPath, archivedPath);
427
427
  archived += 1;
428
428
  } catch (err) {
429
429
  warnings.push(`- Failed to archive orphan transcript ${shortenHomePath(orphanPath)}: ${String(err)}`);
@@ -447,7 +447,7 @@ function noteWorkspaceBackupTip(workspaceDir) {
447
447
  return;
448
448
  }
449
449
  const gitMarker = path.join(workspaceDir, ".git");
450
- if (syncFs.existsSync(gitMarker)) {
450
+ if (fs.existsSync(gitMarker)) {
451
451
  return;
452
452
  }
453
453
  note([
@@ -1,6 +1,6 @@
1
1
  import { shortenHomePath } from "../utils.js";
2
2
  import { DEFAULT_AGENTS_FILENAME } from "../agents/workspace.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/commands/doctor-workspace.ts
@@ -16,13 +16,13 @@ async function shouldSuggestMemorySystem(workspaceDir) {
16
16
  const memoryPaths = [path.join(workspaceDir, "MEMORY.md"), path.join(workspaceDir, "memory.md")];
17
17
  for (const memoryPath of memoryPaths) {
18
18
  try {
19
- await syncFs.promises.access(memoryPath);
19
+ await fs.promises.access(memoryPath);
20
20
  return false;
21
21
  } catch {}
22
22
  }
23
23
  const agentsPath = path.join(workspaceDir, DEFAULT_AGENTS_FILENAME);
24
24
  try {
25
- const content = await syncFs.promises.readFile(agentsPath, "utf-8");
25
+ const content = await fs.promises.readFile(agentsPath, "utf-8");
26
26
  if (/memory\.md/i.test(content)) {
27
27
  return false;
28
28
  }
@@ -37,7 +37,7 @@ import { maybeRepairUiProtocolFreshness } from "./doctor-ui.js";
37
37
  import { maybeOfferUpdateBeforeDoctor } from "./doctor-update.js";
38
38
  import { MEMORY_SYSTEM_PROMPT, shouldSuggestMemorySystem } from "./doctor-workspace.js";
39
39
  import { noteWorkspaceStatus } from "./doctor-workspace-status.js";
40
- import syncFs from "node:fs";
40
+ import fs from "node:fs";
41
41
  import { intro, outro } from "@clack/prompts";
42
42
 
43
43
  //#region src/commands/doctor.ts
@@ -83,7 +83,7 @@ async function doctorCommand(runtime = defaultRuntime, options = {}) {
83
83
  `Fix: run ${formatCliCommand("fased configure")} and set Gateway mode (local/remote).`,
84
84
  `Or set directly: ${formatCliCommand("fased config set gateway.mode local")}`
85
85
  ];
86
- if (!syncFs.existsSync(configPath)) {
86
+ if (!fs.existsSync(configPath)) {
87
87
  lines.push(`Missing config: run ${formatCliCommand("fased setup")} first.`);
88
88
  }
89
89
  note$1(lines.join("\n"), "Gateway");
@@ -233,7 +233,7 @@ async function doctorCommand(runtime = defaultRuntime, options = {}) {
233
233
  await writeConfigFile(cfg);
234
234
  logConfigUpdated(runtime);
235
235
  const backupPath = `${CONFIG_PATH}.bak`;
236
- if (syncFs.existsSync(backupPath)) {
236
+ if (fs.existsSync(backupPath)) {
237
237
  runtime.log(`Backup: ${shortenHomePath(backupPath)}`);
238
238
  }
239
239
  } else if (configResult.hasPendingChanges) {
@@ -2,7 +2,7 @@ import { defaultRuntime } from "../runtime.js";
2
2
  import { readManagedFederationTokenSummary } from "../managed/federation.js";
3
3
  import { readManagedReservationSummaries } from "../managed/tunnel.js";
4
4
  import { fileURLToPath } from "node:url";
5
- import syncFs from "node:fs";
5
+ import fs from "node:fs";
6
6
  import path from "node:path";
7
7
  import { spawn } from "node:child_process";
8
8
 
@@ -44,7 +44,7 @@ function resolveManagedScriptPath() {
44
44
  candidates.push(cwdCandidate);
45
45
  }
46
46
  for (const candidate of candidates) {
47
- if (syncFs.existsSync(candidate)) {
47
+ if (fs.existsSync(candidate)) {
48
48
  return candidate;
49
49
  }
50
50
  }
@@ -12,7 +12,7 @@ import { upsertAuthProfile } from "../agents/auth-profiles/profiles.js";
12
12
  import "../agents/auth-profiles.js";
13
13
  import { PROVIDER_ENV_VARS } from "../secrets/provider-env-vars.js";
14
14
  import { MISTRAL_DEFAULT_MODEL_REF, XAI_DEFAULT_MODEL_REF } from "./onboard-auth.models.js";
15
- import syncFs from "node:fs";
15
+ import fs from "node:fs";
16
16
  import path from "node:path";
17
17
 
18
18
  //#region src/commands/onboard-auth.credentials.ts
@@ -75,7 +75,7 @@ function buildApiKeyCredential(provider, input, metadata, options) {
75
75
  /** Resolve real path, returning null if the target doesn't exist. */
76
76
  function safeRealpathSync(dir) {
77
77
  try {
78
- return syncFs.realpathSync(path.resolve(dir));
78
+ return fs.realpathSync(path.resolve(dir));
79
79
  } catch {
80
80
  return null;
81
81
  }
@@ -88,7 +88,7 @@ function resolveSiblingAgentDirs(primaryAgentDir) {
88
88
  const agentsRoot = looksLikeStandardLayout ? candidateAgentsRoot : path.join(resolveStateDir(), "agents");
89
89
  const entries = (() => {
90
90
  try {
91
- return syncFs.readdirSync(agentsRoot, { withFileTypes: true });
91
+ return fs.readdirSync(agentsRoot, { withFileTypes: true });
92
92
  } catch {
93
93
  return [];
94
94
  }
@@ -7,7 +7,7 @@ import { resolveChannelPluginExpectedPluginIds } from "../../channels/plugins/ca
7
7
  import { loadFasedAgentPlugins } from "../../plugins/loader.js";
8
8
  import { buildNpmResolutionInstallFields } from "../../plugins/installs.js";
9
9
  import { finalizeInstalledPluginConfig } from "../../plugins/lifecycle.js";
10
- import syncFs from "node:fs";
10
+ import fs from "node:fs";
11
11
  import path from "node:path";
12
12
 
13
13
  //#region src/commands/onboarding/plugin-install.ts
@@ -29,7 +29,7 @@ function resolveLocalPath(entry, workspaceDir) {
29
29
  candidates.add(path.resolve(packageRoot, raw));
30
30
  }
31
31
  for (const candidate of candidates) {
32
- if (syncFs.existsSync(candidate)) {
32
+ if (fs.existsSync(candidate)) {
33
33
  return candidate;
34
34
  }
35
35
  }