@fased/fased 0.1.61 → 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 (273) hide show
  1. package/CHANGELOG.md +11 -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-BXA4gPvN.js → app-DLil9VO1.js} +3 -3
  93. package/dist/control-ui/assets/{index-D2QbJhVg.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-Bv0hUOWL.js → audio-preflight-Bwi2Oq03.js} +1 -1
  168. package/dist/plugin-sdk/channel-plugin-common.d.ts +2 -2
  169. package/dist/plugin-sdk/{chunk-items-Bk--NU3E.js → chunk-items-DzT4L4Ty.js} +1 -1
  170. package/dist/plugin-sdk/command-status.js +1 -1
  171. package/dist/plugin-sdk/{config-schema-CGW6J3Pv.js → config-schema-BrkmtFxB.js} +7 -7
  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 +17 -17
  175. package/dist/plugin-sdk/index.js +1 -1
  176. package/dist/plugin-sdk/json-store.js +6 -6
  177. package/dist/plugin-sdk/{monitor-B9Cmt_Je.js → monitor-M_ta2lMc.js} +3 -3
  178. package/dist/plugin-sdk/{monitor-B71iwAgC.js → monitor-wYVncM9w.js} +3 -3
  179. package/dist/plugin-sdk/{openresponses-http-Du4GMmwo.js → openresponses-http-B2GmeSt4.js} +1 -1
  180. package/dist/plugin-sdk/{pairing-message-BMkkS038.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/sat-runtime.d.ts +2 -2
  183. package/dist/plugin-sdk/sat-runtime.js +1 -1
  184. package/dist/plugin-sdk/{slack-D_bbE6Yd.js → slack-CxE1mfzj.js} +3 -3
  185. package/dist/plugin-sdk/slack.d.ts +4 -4
  186. package/dist/plugin-sdk/{sticker-cache-Dqo9nRhi.js → sticker-cache-CGzGWu00.js} +2 -2
  187. package/dist/plugin-sdk/{telegram-actions-Cnag7JTH.js → telegram-actions-DaEcYQ8r.js} +2 -2
  188. package/dist/plugin-sdk/telegram.d.ts +4 -4
  189. package/dist/plugin-sdk/{tmp-fased-dir-BdFQvrvw.d.ts → tmp-fased-dir-CS6zsYEE.d.ts} +1 -1
  190. package/dist/plugin-sdk/{types-BYDL6dQj.d.ts → types-DFAW-n1J.d.ts} +1 -1
  191. package/dist/plugin-sdk/{types-CLIvQaVg.d.ts → types-vcJrC_uv.d.ts} +1 -1
  192. package/dist/plugin-sdk/{web-BInKQkc4.js → web-CInY-lCv.js} +1 -1
  193. package/dist/plugin-sdk/whatsapp.d.ts +11 -11
  194. package/dist/plugin-sdk/{zod-schema.providers-core-CIzCjXH9.d.ts → zod-schema.providers-core-BEbNizPe.d.ts} +61 -61
  195. package/dist/plugins/bundled-dir.js +3 -3
  196. package/dist/plugins/discovery.js +11 -11
  197. package/dist/plugins/loader.js +13 -13
  198. package/dist/plugins/manifest-registry.js +2 -2
  199. package/dist/plugins/manifest.js +4 -4
  200. package/dist/plugins/path-safety.js +3 -3
  201. package/dist/plugins/status-cache.js +9 -9
  202. package/dist/plugins/update.js +3 -3
  203. package/dist/plugins/web-search-install-catalog.js +3 -3
  204. package/dist/secrets/apply.js +16 -16
  205. package/dist/secrets/audit.js +11 -11
  206. package/dist/secrets/shared.js +9 -9
  207. package/dist/security/scan-paths.js +2 -2
  208. package/dist/shared/config-eval.js +2 -2
  209. package/dist/shared/pid-alive.js +2 -2
  210. package/dist/tasks/standing-orders.js +5 -5
  211. package/dist/tasks/task-flow-registry.js +5 -5
  212. package/dist/tasks/task-registry.js +5 -5
  213. package/dist/tasks/workflow-definitions.js +6 -6
  214. package/dist/telegram/token.js +5 -5
  215. package/dist/utils.js +5 -5
  216. package/dist/wallet/local-socket-signer-broker.js +16 -16
  217. package/dist/wallet/providers/embedded-keystore-adapter.js +5 -5
  218. package/dist/wallet/providers/local-socket-signer-adapter.js +2 -2
  219. package/dist/wallet/wallet-approval-auth.js +5 -5
  220. package/dist/wallet/wallet-audit-log.js +5 -5
  221. package/dist/wallet/wallet-custody.js +21 -21
  222. package/dist/wallet/wallet-inbound-events.js +5 -5
  223. package/dist/wallet/wallet-observability.js +5 -5
  224. package/dist/wallet/wallet-policy.js +9 -9
  225. package/dist/wallet/wallet-provider-registry.js +7 -7
  226. package/dist/wallet/wallet-runtime-config.js +3 -3
  227. package/dist/wallet/wallet-secrets-store.js +22 -22
  228. package/dist/wallet/wallet-send-approvals.js +5 -5
  229. package/dist/wallet/wallet-settlement-links.js +5 -5
  230. package/dist/web/accounts.js +3 -3
  231. package/dist/web/auth-store.js +18 -18
  232. package/dist/web/session.js +4 -4
  233. package/dist/wizard/host-security-capability.js +2 -2
  234. package/dist/wizard/onboarding.host-security.js +7 -7
  235. package/dist/wizard/onboarding.js +11 -28
  236. package/dist/wizard/onboarding.wallet.js +132 -85
  237. package/extensions/acpx/package.json +1 -1
  238. package/extensions/bluebubbles/package.json +1 -1
  239. package/extensions/copilot-proxy/package.json +1 -1
  240. package/extensions/diagnostics-otel/package.json +1 -1
  241. package/extensions/fased-federation/package.json +1 -1
  242. package/extensions/google-gemini-cli-auth/package.json +1 -1
  243. package/extensions/imessage/package.json +1 -1
  244. package/extensions/irc/package.json +1 -1
  245. package/extensions/line/package.json +1 -1
  246. package/extensions/llm-task/package.json +1 -1
  247. package/extensions/lobster/package.json +1 -1
  248. package/extensions/matrix/CHANGELOG.md +6 -0
  249. package/extensions/matrix/package.json +1 -1
  250. package/extensions/mattermost/package.json +1 -1
  251. package/extensions/memory-core/package.json +2 -2
  252. package/extensions/memory-lancedb/package.json +1 -1
  253. package/extensions/minimax-portal-auth/package.json +1 -1
  254. package/extensions/msteams/CHANGELOG.md +6 -0
  255. package/extensions/msteams/package.json +1 -1
  256. package/extensions/nextcloud-talk/package.json +1 -1
  257. package/extensions/nostr/CHANGELOG.md +6 -0
  258. package/extensions/nostr/package.json +1 -1
  259. package/extensions/open-prose/package.json +1 -1
  260. package/extensions/sat-mining/package.json +1 -1
  261. package/extensions/signal/package.json +1 -1
  262. package/extensions/synology-chat/package.json +1 -1
  263. package/extensions/tlon/package.json +1 -1
  264. package/extensions/twitch/CHANGELOG.md +6 -0
  265. package/extensions/twitch/package.json +1 -1
  266. package/extensions/voice-call/CHANGELOG.md +6 -0
  267. package/extensions/voice-call/package.json +1 -1
  268. package/extensions/zalo/CHANGELOG.md +6 -0
  269. package/extensions/zalo/package.json +1 -1
  270. package/extensions/zalouser/CHANGELOG.md +6 -0
  271. package/extensions/zalouser/package.json +1 -1
  272. package/package.json +2 -1
  273. package/scripts/install-fased-signerd.sh +142 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,17 @@ This changelog starts with the public Fased Agent release line. Required
4
4
  third-party and copied-code notices are kept in [LICENSE](./LICENSE) and
5
5
  [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md).
6
6
 
7
+ ## 0.1.62
8
+
9
+ - Install a version-matched, checksum-verified local wallet signer automatically
10
+ when first-time wallet setup selects the local socket signer path; normal
11
+ installs no longer require Go.
12
+ - Show automatic signer installation in both Local and Hosting QuickStart while
13
+ keeping the redundant wallet-backend prompt hidden in the hosting profile.
14
+ - Publish static Linux and macOS signer assets for x64 and arm64 with release
15
+ checksums, module-relative installer resolution, and clear WSL2 guidance for
16
+ Windows users.
17
+
7
18
  ## 0.1.61
8
19
 
9
20
  - Harden local Docker deployments with loopback-only published ports, dropped
@@ -2,7 +2,7 @@ import { isKnownCoreToolId } from "../agents/tool-catalog.js";
2
2
  import { DANGEROUS_ACP_TOOLS } from "../security/dangerous-tools.js";
3
3
  import { ensureFasedAgentCliOnPath } from "../infra/path-env.js";
4
4
  import { fileURLToPath } from "node:url";
5
- import fs from "node:fs";
5
+ import syncFs from "node:fs";
6
6
  import { homedir } from "node:os";
7
7
  import path from "node:path";
8
8
  import { spawn } from "node:child_process";
@@ -269,7 +269,7 @@ function resolveSelfEntryPath() {
269
269
  try {
270
270
  const here = fileURLToPath(import.meta.url);
271
271
  const candidate = path.resolve(path.dirname(here), "..", "entry.js");
272
- if (fs.existsSync(candidate)) {
272
+ if (syncFs.existsSync(candidate)) {
273
273
  return candidate;
274
274
  }
275
275
  } catch {}
@@ -1,5 +1,5 @@
1
1
  import { resolveUserPath } from "../utils.js";
2
- import fs from "node:fs";
2
+ import syncFs from "node:fs";
3
3
 
4
4
  //#region src/acp/secret-file.ts
5
5
  function readSecretFromFile(filePath, label) {
@@ -9,7 +9,7 @@ function readSecretFromFile(filePath, label) {
9
9
  }
10
10
  let raw = "";
11
11
  try {
12
- raw = fs.readFileSync(resolvedPath, "utf8");
12
+ raw = syncFs.readFileSync(resolvedPath, "utf8");
13
13
  } catch (err) {
14
14
  throw new Error(`Failed to read ${label} file at ${resolvedPath}: ${String(err)}`, { cause: err });
15
15
  }
@@ -6,7 +6,7 @@ import { parseAgentSessionKey } from "../sessions/session-key-utils.js";
6
6
  import { DEFAULT_AGENT_ID, normalizeAgentId, resolveAgentIdFromSessionKey } from "../routing/session-key.js";
7
7
  import { resolveEffectiveAgentSkillFilter } from "./skills/agent-filter.js";
8
8
  import { resolveDefaultAgentWorkspaceDir } from "./workspace.js";
9
- import fs from "node:fs";
9
+ import syncFs from "node:fs";
10
10
  import path from "node:path";
11
11
 
12
12
  //#region src/agents/agent-scope.ts
@@ -245,7 +245,7 @@ function normalizePathForComparison(input) {
245
245
  const resolved = path.resolve(stripNullBytes(resolveUserPath(input)));
246
246
  let normalized = resolved;
247
247
  try {
248
- normalized = fs.realpathSync.native(resolved);
248
+ normalized = syncFs.realpathSync.native(resolved);
249
249
  } catch {}
250
250
  if (process.platform === "win32") {
251
251
  return normalized.toLowerCase();
@@ -3,9 +3,9 @@ import { PATH_ALIAS_POLICIES } from "../infra/path-alias-guards.js";
3
3
  import { writeFileWithinRoot } from "../infra/fs-safe.js";
4
4
  import { applyUpdateHunk } from "./apply-patch-update.js";
5
5
  import { assertSandboxPath, resolveSandboxInputPath } from "./sandbox-paths.js";
6
- import fs from "node:fs";
6
+ import syncFs from "node:fs";
7
7
  import path from "node:path";
8
- import fs$1 from "node:fs/promises";
8
+ import fs from "node:fs/promises";
9
9
  import { Type } from "@sinclair/typebox";
10
10
 
11
11
  //#region src/agents/apply-patch.ts
@@ -159,7 +159,7 @@ function resolvePatchFileOps(options) {
159
159
  return {
160
160
  readFile: async (filePath) => {
161
161
  if (!workspaceOnly) {
162
- return await fs$1.readFile(filePath, "utf8");
162
+ return await fs.readFile(filePath, "utf8");
163
163
  }
164
164
  const opened = await openBoundaryFile({
165
165
  absolutePath: filePath,
@@ -168,14 +168,14 @@ function resolvePatchFileOps(options) {
168
168
  });
169
169
  assertBoundaryRead(opened, filePath);
170
170
  try {
171
- return fs.readFileSync(opened.fd, "utf8");
171
+ return syncFs.readFileSync(opened.fd, "utf8");
172
172
  } finally {
173
- fs.closeSync(opened.fd);
173
+ syncFs.closeSync(opened.fd);
174
174
  }
175
175
  },
176
176
  writeFile: async (filePath, content) => {
177
177
  if (!workspaceOnly) {
178
- await fs$1.writeFile(filePath, content, "utf8");
178
+ await fs.writeFile(filePath, content, "utf8");
179
179
  return;
180
180
  }
181
181
  const relative = toRelativeWorkspacePath(options.cwd, filePath);
@@ -186,8 +186,8 @@ function resolvePatchFileOps(options) {
186
186
  encoding: "utf8"
187
187
  });
188
188
  },
189
- remove: (filePath) => fs$1.rm(filePath),
190
- mkdirp: (dir) => fs$1.mkdir(dir, { recursive: true }).then(() => {})
189
+ remove: (filePath) => fs.rm(filePath),
190
+ mkdirp: (dir) => fs.mkdir(dir, { recursive: true }).then(() => {})
191
191
  };
192
192
  }
193
193
  async function ensureDir(filePath, ops) {
@@ -2,7 +2,7 @@ import { resolveUserPath } from "../../utils.js";
2
2
  import { saveJsonFile } from "../../infra/json-file.js";
3
3
  import { AUTH_PROFILE_FILENAME, AUTH_STORE_VERSION, LEGACY_AUTH_FILENAME } from "./constants.js";
4
4
  import { resolveFasedAgentAgentDir } from "../agent-paths.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/agents/auth-profiles/paths.ts
@@ -19,7 +19,7 @@ function resolveAuthStorePathForDisplay(agentDir) {
19
19
  return pathname.startsWith("~") ? pathname : resolveUserPath(pathname);
20
20
  }
21
21
  function ensureAuthStoreFile(pathname) {
22
- if (fs.existsSync(pathname)) {
22
+ if (syncFs.existsSync(pathname)) {
23
23
  return;
24
24
  }
25
25
  const payload = {
@@ -5,7 +5,7 @@ import { withFileLock } from "../../plugin-sdk/file-lock.js";
5
5
  import "../../infra/file-lock.js";
6
6
  import { syncExternalCliCredentials } from "./external-cli-sync.js";
7
7
  import { ensureAuthStoreFile, resolveAuthStorePath, resolveLegacyAuthStorePath } from "./paths.js";
8
- import fs from "node:fs";
8
+ import syncFs from "node:fs";
9
9
 
10
10
  //#region src/agents/auth-profiles/store.ts
11
11
  const AUTH_PROFILE_TYPES = new Set([
@@ -361,7 +361,7 @@ function loadAuthProfileStoreForAgent(agentDir, options) {
361
361
  if (shouldWrite && legacy !== null) {
362
362
  const legacyPath = resolveLegacyAuthStorePath(agentDir);
363
363
  try {
364
- fs.unlinkSync(legacyPath);
364
+ syncFs.unlinkSync(legacyPath);
365
365
  } catch (err) {
366
366
  if (err?.code !== "ENOENT") {
367
367
  log.warn("failed to delete legacy auth.json after migration", {
@@ -3,7 +3,7 @@ import { assertSandboxPath } from "./sandbox-paths.js";
3
3
  import { existsSync, statSync } from "node:fs";
4
4
  import { homedir } from "node:os";
5
5
  import path from "node:path";
6
- import fs$1 from "node:fs/promises";
6
+ import fs from "node:fs/promises";
7
7
 
8
8
  //#region src/agents/bash-tools.shared.ts
9
9
  const CHUNK_LIMIT = 8 * 1024;
@@ -67,7 +67,7 @@ async function resolveSandboxWorkdir(params) {
67
67
  cwd: process.cwd(),
68
68
  root: params.sandbox.workspaceDir
69
69
  });
70
- const stats = await fs$1.stat(resolved.resolved);
70
+ const stats = await fs.stat(resolved.resolved);
71
71
  if (!stats.isDirectory()) {
72
72
  throw new Error("workdir is not a directory");
73
73
  }
@@ -1,7 +1,7 @@
1
1
  import { resolveUserPath } from "../utils.js";
2
2
  import { createSubsystemLogger } from "../logging/subsystem.js";
3
3
  import { loadJsonFile, saveJsonFile } from "../infra/json-file.js";
4
- import fs from "node:fs";
4
+ import syncFs from "node:fs";
5
5
  import path from "node:path";
6
6
  import { execFileSync, execSync } from "node:child_process";
7
7
  import { createHash } from "node:crypto";
@@ -61,7 +61,7 @@ function resolveCodexHomePath() {
61
61
  const configured = process.env.CODEX_HOME;
62
62
  const home = configured ? resolveUserPath(configured) : resolveUserPath("~/.codex");
63
63
  try {
64
- return fs.realpathSync.native(home);
64
+ return syncFs.realpathSync.native(home);
65
65
  } catch {
66
66
  return home;
67
67
  }
@@ -264,7 +264,7 @@ function writeClaudeCliKeychainCredentials(newCredentials, options) {
264
264
  }
265
265
  function writeClaudeCliFileCredentials(newCredentials, options) {
266
266
  const credPath = resolveClaudeCliCredentialsPath(options?.homeDir);
267
- if (!fs.existsSync(credPath)) {
267
+ if (!syncFs.existsSync(credPath)) {
268
268
  return false;
269
269
  }
270
270
  try {
@@ -331,7 +331,7 @@ function readCodexCliCredentials(options) {
331
331
  }
332
332
  let expires;
333
333
  try {
334
- const stat = fs.statSync(authPath);
334
+ const stat = syncFs.statSync(authPath);
335
335
  expires = stat.mtimeMs + 60 * 60 * 1e3;
336
336
  } catch {
337
337
  expires = Date.now() + 60 * 60 * 1e3;
@@ -1,5 +1,5 @@
1
1
  import { resolveFasedAgentPackageRoot } from "../infra/fased-root.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/agents/docs-path.ts
@@ -7,7 +7,7 @@ async function resolveFasedAgentDocsPath(params) {
7
7
  const workspaceDir = params.workspaceDir?.trim();
8
8
  if (workspaceDir) {
9
9
  const workspaceDocs = path.join(workspaceDir, "docs");
10
- if (fs.existsSync(workspaceDocs)) {
10
+ if (syncFs.existsSync(workspaceDocs)) {
11
11
  return workspaceDocs;
12
12
  }
13
13
  }
@@ -20,7 +20,7 @@ async function resolveFasedAgentDocsPath(params) {
20
20
  return null;
21
21
  }
22
22
  const packageDocs = path.join(packageRoot, "docs");
23
- return fs.existsSync(packageDocs) ? packageDocs : null;
23
+ return syncFs.existsSync(packageDocs) ? packageDocs : null;
24
24
  }
25
25
 
26
26
  //#endregion
@@ -1,6 +1,6 @@
1
1
  import { STATE_DIR } from "../config/paths.js";
2
2
  import { isRecord, resolveUserPath } from "../utils.js";
3
- import fs from "node:fs";
3
+ import syncFs from "node:fs";
4
4
  import path from "node:path";
5
5
 
6
6
  //#region src/agents/embedded-pi-mcp.ts
@@ -66,10 +66,10 @@ function readBundleMcpFile(params) {
66
66
  if (relative.startsWith("..") || path.isAbsolute(relative)) {
67
67
  return {};
68
68
  }
69
- if (!fs.existsSync(filePath)) {
69
+ if (!syncFs.existsSync(filePath)) {
70
70
  return {};
71
71
  }
72
- const raw = JSON.parse(fs.readFileSync(filePath, "utf-8"));
72
+ const raw = JSON.parse(syncFs.readFileSync(filePath, "utf-8"));
73
73
  const servers = extractMcpServerMap(raw);
74
74
  const baseDir = path.dirname(filePath);
75
75
  return Object.fromEntries(Object.entries(servers).map(([serverName, server]) => [serverName, absolutizeBundleMcpServer({
@@ -99,7 +99,7 @@ function loadEnabledBundleMcpConfig(params) {
99
99
  cfg: params.cfg,
100
100
  pluginId
101
101
  })) {
102
- if (!fs.existsSync(rootDir)) {
102
+ if (!syncFs.existsSync(rootDir)) {
103
103
  continue;
104
104
  }
105
105
  for (const fileName of BUNDLE_MCP_FILENAMES) {
@@ -3,7 +3,7 @@ import { resolveAgentWorkspaceDir } from "./agent-scope.js";
3
3
  import { AVATAR_MAX_BYTES, isAvatarDataUrl, isAvatarHttpUrl, isPathWithinRoot, isSupportedLocalAvatarExtension } from "../shared/avatar-policy.js";
4
4
  import { resolveAgentIdentity } from "./identity.js";
5
5
  import { loadAgentIdentityFromWorkspace } from "./identity-file.js";
6
- import fs from "node:fs";
6
+ import syncFs from "node:fs";
7
7
  import path from "node:path";
8
8
 
9
9
  //#region src/agents/identity-avatar.ts
@@ -28,7 +28,7 @@ function resolveAvatarSource(cfg, agentId, opts) {
28
28
  }
29
29
  function resolveExistingPath(value) {
30
30
  try {
31
- return fs.realpathSync(value);
31
+ return syncFs.realpathSync(value);
32
32
  } catch {
33
33
  return path.resolve(value);
34
34
  }
@@ -51,7 +51,7 @@ function resolveLocalAvatarPath(params) {
51
51
  };
52
52
  }
53
53
  try {
54
- const stat = fs.statSync(realPath);
54
+ const stat = syncFs.statSync(realPath);
55
55
  if (!stat.isFile()) {
56
56
  return {
57
57
  ok: false,
@@ -1,5 +1,5 @@
1
1
  import { DEFAULT_IDENTITY_FILENAME } from "./workspace.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/agents/identity-file.ts
@@ -67,7 +67,7 @@ function identityHasValues(identity) {
67
67
  }
68
68
  function loadIdentityFromFile(identityPath) {
69
69
  try {
70
- const content = fs.readFileSync(identityPath, "utf-8");
70
+ const content = syncFs.readFileSync(identityPath, "utf-8");
71
71
  const parsed = parseIdentityMarkdown(content);
72
72
  if (!identityHasValues(parsed)) {
73
73
  return null;
@@ -1,6 +1,6 @@
1
1
  import { resolveFasedAgentPackageRootSync } from "../infra/fased-root.js";
2
2
  import { resolvePluginInstallDir } from "../plugins/install.js";
3
- import fs from "node:fs";
3
+ import syncFs from "node:fs";
4
4
  import os from "node:os";
5
5
  import path from "node:path";
6
6
  import { spawn } from "node:child_process";
@@ -60,17 +60,17 @@ function resolveOpenAICodexExecutable() {
60
60
  const explicitlyConfigured = process.env.FASED_CODEX_BIN?.trim();
61
61
  for (const candidate of codexExecutableCandidates()) {
62
62
  try {
63
- if (!fs.statSync(candidate).isFile()) {
63
+ if (!syncFs.statSync(candidate).isFile()) {
64
64
  continue;
65
65
  }
66
66
  if (explicitlyConfigured && candidate === explicitlyConfigured) {
67
67
  return candidate;
68
68
  }
69
- const resolved = fs.realpathSync(candidate);
69
+ const resolved = syncFs.realpathSync(candidate);
70
70
  let current = path.dirname(resolved);
71
71
  for (let depth = 0; depth < 6; depth += 1) {
72
72
  try {
73
- const parsed = JSON.parse(fs.readFileSync(path.join(current, "package.json"), "utf8"));
73
+ const parsed = JSON.parse(syncFs.readFileSync(path.join(current, "package.json"), "utf8"));
74
74
  if (parsed.name === "@openai/codex") {
75
75
  if (parsed.version === OPENAI_CODEX_APP_SERVER_VERSION) {
76
76
  return candidate;
@@ -90,7 +90,7 @@ function resolveOpenAICodexExecutable() {
90
90
  }
91
91
  function managedCodexHome() {
92
92
  const directory = path.join(stateDir(), "runtime", "openai-codex");
93
- fs.mkdirSync(directory, {
93
+ syncFs.mkdirSync(directory, {
94
94
  recursive: true,
95
95
  mode: 448
96
96
  });
@@ -1,6 +1,6 @@
1
1
  import { resolveStateDir } from "../config/paths.js";
2
2
  import { isTruthyEnvValue } from "../infra/env.js";
3
- import fs from "node:fs";
3
+ import syncFs from "node:fs";
4
4
  import path from "node:path";
5
5
 
6
6
  //#region src/agents/pi-embedded-subscribe.raw-stream.ts
@@ -14,11 +14,11 @@ function appendRawStream(payload) {
14
14
  if (!rawStreamReady) {
15
15
  rawStreamReady = true;
16
16
  try {
17
- fs.mkdirSync(path.dirname(RAW_STREAM_PATH), { recursive: true });
17
+ syncFs.mkdirSync(path.dirname(RAW_STREAM_PATH), { recursive: true });
18
18
  } catch {}
19
19
  }
20
20
  try {
21
- void fs.promises.appendFile(RAW_STREAM_PATH, `${JSON.stringify(payload)}\n`);
21
+ void syncFs.promises.appendFile(RAW_STREAM_PATH, `${JSON.stringify(payload)}\n`);
22
22
  } catch {}
23
23
  }
24
24
 
@@ -3,7 +3,7 @@ import { getCompactionSafeguardRuntime } from "./compaction-safeguard-runtime.js
3
3
  import { extractSections } from "../../auto-reply/reply/post-compaction-context.js";
4
4
  import { BASE_CHUNK_RATIO, MIN_CHUNK_RATIO, SAFETY_MARGIN, SUMMARIZATION_OVERHEAD_TOKENS, computeAdaptiveChunkRatio, estimateMessagesTokens, isOversizedForSummary, pruneHistoryForContextShare, resolveContextWindowTokens, summarizeInStages } from "../compaction.js";
5
5
  import { collectTextContentBlocks } from "../content-blocks.js";
6
- import fs from "node:fs";
6
+ import syncFs from "node:fs";
7
7
  import path from "node:path";
8
8
 
9
9
  //#region src/agents/pi-extensions/compaction-safeguard.ts
@@ -122,10 +122,10 @@ async function readWorkspaceContextForSummary() {
122
122
  const workspaceDir = process.cwd();
123
123
  const agentsPath = path.join(workspaceDir, "AGENTS.md");
124
124
  try {
125
- if (!fs.existsSync(agentsPath)) {
125
+ if (!syncFs.existsSync(agentsPath)) {
126
126
  return "";
127
127
  }
128
- const content = await fs.promises.readFile(agentsPath, "utf-8");
128
+ const content = await syncFs.promises.readFile(agentsPath, "utf-8");
129
129
  const sections = extractSections(content, ["Session Startup", "Red Lines"]);
130
130
  if (sections.length === 0) {
131
131
  return "";
@@ -1,7 +1,7 @@
1
1
  import { ensureAuthProfileStore } from "./auth-profiles/store.js";
2
2
  import "./auth-profiles.js";
3
3
  import { resolvePiCredentialMapFromStore } from "./pi-auth-credentials.js";
4
- import fs from "node:fs";
4
+ import syncFs from "node:fs";
5
5
  import path from "node:path";
6
6
  import * as PiCodingAgent from "@mariozechner/pi-coding-agent";
7
7
 
@@ -25,12 +25,12 @@ function scrubLegacyStaticAuthJsonEntries(pathname) {
25
25
  if (process.env.FASED_AUTH_STORE_READONLY === "1") {
26
26
  return;
27
27
  }
28
- if (!fs.existsSync(pathname)) {
28
+ if (!syncFs.existsSync(pathname)) {
29
29
  return;
30
30
  }
31
31
  let parsed;
32
32
  try {
33
- parsed = JSON.parse(fs.readFileSync(pathname, "utf8"));
33
+ parsed = JSON.parse(syncFs.readFileSync(pathname, "utf8"));
34
34
  } catch {
35
35
  return;
36
36
  }
@@ -52,11 +52,11 @@ function scrubLegacyStaticAuthJsonEntries(pathname) {
52
52
  return;
53
53
  }
54
54
  if (Object.keys(parsed).length === 0) {
55
- fs.rmSync(pathname, { force: true });
55
+ syncFs.rmSync(pathname, { force: true });
56
56
  return;
57
57
  }
58
- fs.writeFileSync(pathname, `${JSON.stringify(parsed, null, 2)}\n`, "utf8");
59
- fs.chmodSync(pathname, 384);
58
+ syncFs.writeFileSync(pathname, `${JSON.stringify(parsed, null, 2)}\n`, "utf8");
59
+ syncFs.chmodSync(pathname, 384);
60
60
  }
61
61
  function createAuthStorage(AuthStorageLike, path, creds) {
62
62
  const withInMemory = AuthStorageLike;
@@ -1,6 +1,6 @@
1
1
  import { applyMergePatch } from "../config/merge-patch.js";
2
2
  import { applyPiCompactionSettingsFromConfig } from "./pi-settings.js";
3
- import fs from "node:fs";
3
+ import syncFs from "node:fs";
4
4
  import path from "node:path";
5
5
  import { SettingsManager } from "@mariozechner/pi-coding-agent";
6
6
 
@@ -28,7 +28,7 @@ function buildEmbeddedPiSettingsSnapshot(params) {
28
28
  }
29
29
  function readJsonFile(filePath) {
30
30
  try {
31
- const raw = fs.readFileSync(filePath, "utf8");
31
+ const raw = syncFs.readFileSync(filePath, "utf8");
32
32
  const parsed = JSON.parse(raw);
33
33
  return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
34
34
  } catch {
@@ -49,7 +49,7 @@ function loadEnabledBundlePiSettingsSnapshot(params) {
49
49
  const servers = mcp.mcpServers && typeof mcp.mcpServers === "object" && !Array.isArray(mcp.mcpServers) ? mcp.mcpServers : undefined;
50
50
  if (servers) {
51
51
  const resolvedServers = {};
52
- const resolvedRoot = fs.realpathSync.native?.(pluginRoot) ?? fs.realpathSync(pluginRoot);
52
+ const resolvedRoot = syncFs.realpathSync.native?.(pluginRoot) ?? syncFs.realpathSync(pluginRoot);
53
53
  for (const [name, server] of Object.entries(servers)) {
54
54
  if (!server || typeof server !== "object" || Array.isArray(server)) {
55
55
  resolvedServers[name] = server;
@@ -3,7 +3,7 @@ import { PATH_ALIAS_POLICIES } from "../../infra/path-alias-guards.js";
3
3
  import { execDockerRaw } from "./docker.js";
4
4
  import { isPathInsideContainerRoot, normalizeContainerPath } from "./path-utils.js";
5
5
  import { buildSandboxFsMounts, resolveSandboxFsPathWithMounts } from "./fs-paths.js";
6
- import fs from "node:fs";
6
+ import syncFs from "node:fs";
7
7
 
8
8
  //#region src/agents/sandbox/fs-bridge.ts
9
9
  function createSandboxFsBridge(params) {
@@ -160,7 +160,7 @@ var SandboxFsBridgeImpl = class {
160
160
  throw guarded.error instanceof Error ? guarded.error : new Error(`Sandbox boundary checks failed; cannot ${options.action}: ${target.containerPath}`);
161
161
  }
162
162
  } else {
163
- fs.closeSync(guarded.fd);
163
+ syncFs.closeSync(guarded.fd);
164
164
  }
165
165
  const canonicalContainerPath = await this.resolveCanonicalContainerPath({
166
166
  containerPath: target.containerPath,
@@ -1,6 +1,6 @@
1
- import fs from "node:fs";
1
+ import syncFs from "node:fs";
2
2
  import path from "node:path";
3
- import fs$1 from "node:fs/promises";
3
+ import fs from "node:fs/promises";
4
4
 
5
5
  //#region src/agents/session-dirs.ts
6
6
  function mapAgentSessionDirs(agentsDir, entries) {
@@ -9,7 +9,7 @@ function mapAgentSessionDirs(agentsDir, entries) {
9
9
  async function resolveAgentSessionDirsFromAgentsDir(agentsDir) {
10
10
  let entries = [];
11
11
  try {
12
- entries = await fs$1.readdir(agentsDir, { withFileTypes: true });
12
+ entries = await fs.readdir(agentsDir, { withFileTypes: true });
13
13
  } catch (err) {
14
14
  const code = err.code;
15
15
  if (code === "ENOENT") {
@@ -22,7 +22,7 @@ async function resolveAgentSessionDirsFromAgentsDir(agentsDir) {
22
22
  function resolveAgentSessionDirsFromAgentsDirSync(agentsDir) {
23
23
  let entries = [];
24
24
  try {
25
- entries = fs.readdirSync(agentsDir, { withFileTypes: true });
25
+ entries = syncFs.readdirSync(agentsDir, { withFileTypes: true });
26
26
  } catch (err) {
27
27
  const code = err.code;
28
28
  if (code === "ENOENT") {
@@ -1,8 +1,8 @@
1
1
  import { isPidAlive } from "../shared/pid-alive.js";
2
2
  import { resolveProcessScopedMap } from "../shared/process-scoped-map.js";
3
- import fs from "node:fs";
3
+ import syncFs from "node:fs";
4
4
  import path from "node:path";
5
- import fs$1 from "node:fs/promises";
5
+ import fs from "node:fs/promises";
6
6
 
7
7
  //#region src/agents/session-write-lock.ts
8
8
  const CLEANUP_SIGNALS = [
@@ -84,7 +84,7 @@ async function releaseHeldLock(normalizedSessionFile, held, opts = {}) {
84
84
  await held.handle.close();
85
85
  } catch {}
86
86
  try {
87
- await fs$1.rm(held.lockPath, { force: true });
87
+ await fs.rm(held.lockPath, { force: true });
88
88
  } catch {}
89
89
  })();
90
90
  try {
@@ -106,7 +106,7 @@ function releaseAllLocksSync() {
106
106
  }
107
107
  } catch {}
108
108
  try {
109
- fs.rmSync(held.lockPath, { force: true });
109
+ syncFs.rmSync(held.lockPath, { force: true });
110
110
  } catch {}
111
111
  HELD_LOCKS.delete(sessionFile);
112
112
  }
@@ -175,7 +175,7 @@ function registerCleanupHandlers() {
175
175
  }
176
176
  async function readLockPayload(lockPath) {
177
177
  try {
178
- const raw = await fs$1.readFile(lockPath, "utf8");
178
+ const raw = await fs.readFile(lockPath, "utf8");
179
179
  const parsed = JSON.parse(raw);
180
180
  const payload = {};
181
181
  if (typeof parsed.pid === "number") {
@@ -226,7 +226,7 @@ async function shouldReclaimContendedLockFile(lockPath, details, staleMs, nowMs)
226
226
  return true;
227
227
  }
228
228
  try {
229
- const stat = await fs$1.stat(lockPath);
229
+ const stat = await fs.stat(lockPath);
230
230
  const ageMs = Math.max(0, nowMs - stat.mtimeMs);
231
231
  return ageMs > staleMs;
232
232
  } catch (error) {
@@ -241,7 +241,7 @@ async function cleanStaleLockFiles(params) {
241
241
  const nowMs = params.nowMs ?? Date.now();
242
242
  let entries = [];
243
243
  try {
244
- entries = await fs$1.readdir(sessionsDir, { withFileTypes: true });
244
+ entries = await fs.readdir(sessionsDir, { withFileTypes: true });
245
245
  } catch (err) {
246
246
  const code = err.code;
247
247
  if (code === "ENOENT") {
@@ -265,7 +265,7 @@ async function cleanStaleLockFiles(params) {
265
265
  removed: false
266
266
  };
267
267
  if (lockInfo.stale && removeStale) {
268
- await fs$1.rm(lockPath, { force: true });
268
+ await fs.rm(lockPath, { force: true });
269
269
  lockInfo.removed = true;
270
270
  cleaned.push(lockInfo);
271
271
  params.log?.warn?.(`removed stale session lock: ${lockPath} (${lockInfo.staleReasons.join(", ") || "unknown"})`);
@@ -284,10 +284,10 @@ async function acquireSessionWriteLock(params) {
284
284
  const maxHoldMs = resolvePositiveMs(params.maxHoldMs, DEFAULT_MAX_HOLD_MS);
285
285
  const sessionFile = path.resolve(params.sessionFile);
286
286
  const sessionDir = path.dirname(sessionFile);
287
- await fs$1.mkdir(sessionDir, { recursive: true });
287
+ await fs.mkdir(sessionDir, { recursive: true });
288
288
  let normalizedDir = sessionDir;
289
289
  try {
290
- normalizedDir = await fs$1.realpath(sessionDir);
290
+ normalizedDir = await fs.realpath(sessionDir);
291
291
  } catch {}
292
292
  const normalizedSessionFile = path.join(normalizedDir, path.basename(sessionFile));
293
293
  const lockPath = `${normalizedSessionFile}.lock`;
@@ -305,7 +305,7 @@ async function acquireSessionWriteLock(params) {
305
305
  attempt += 1;
306
306
  let handle = null;
307
307
  try {
308
- handle = await fs$1.open(lockPath, "wx");
308
+ handle = await fs.open(lockPath, "wx");
309
309
  const createdAt = new Date().toISOString();
310
310
  await handle.writeFile(JSON.stringify({
311
311
  pid: process.pid,
@@ -328,7 +328,7 @@ async function acquireSessionWriteLock(params) {
328
328
  await handle.close();
329
329
  } catch {}
330
330
  try {
331
- await fs$1.rm(lockPath, { force: true });
331
+ await fs.rm(lockPath, { force: true });
332
332
  } catch {}
333
333
  }
334
334
  const code = err.code;
@@ -339,7 +339,7 @@ async function acquireSessionWriteLock(params) {
339
339
  const nowMs = Date.now();
340
340
  const inspected = inspectLockPayload(payload, staleMs, nowMs);
341
341
  if (await shouldReclaimContendedLockFile(lockPath, inspected, staleMs, nowMs)) {
342
- await fs$1.rm(lockPath, { force: true });
342
+ await fs.rm(lockPath, { force: true });
343
343
  continue;
344
344
  }
345
345
  const delay = Math.min(1e3, 50 * attempt);
@@ -1,4 +1,4 @@
1
- import fs from "node:fs";
1
+ import syncFs from "node:fs";
2
2
  import path from "node:path";
3
3
  import { spawn } from "node:child_process";
4
4
 
@@ -6,13 +6,13 @@ import { spawn } from "node:child_process";
6
6
  function resolvePowerShellPath() {
7
7
  const programFiles = process.env.ProgramFiles || process.env.PROGRAMFILES || "C:\\Program Files";
8
8
  const pwsh7 = path.join(programFiles, "PowerShell", "7", "pwsh.exe");
9
- if (fs.existsSync(pwsh7)) {
9
+ if (syncFs.existsSync(pwsh7)) {
10
10
  return pwsh7;
11
11
  }
12
12
  const programW6432 = process.env.ProgramW6432;
13
13
  if (programW6432 && programW6432 !== programFiles) {
14
14
  const pwsh7Alt = path.join(programW6432, "PowerShell", "7", "pwsh.exe");
15
- if (fs.existsSync(pwsh7Alt)) {
15
+ if (syncFs.existsSync(pwsh7Alt)) {
16
16
  return pwsh7Alt;
17
17
  }
18
18
  }
@@ -23,7 +23,7 @@ function resolvePowerShellPath() {
23
23
  const systemRoot = process.env.SystemRoot || process.env.WINDIR;
24
24
  if (systemRoot) {
25
25
  const candidate = path.join(systemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe");
26
- if (fs.existsSync(candidate)) {
26
+ if (syncFs.existsSync(candidate)) {
27
27
  return candidate;
28
28
  }
29
29
  }
@@ -73,7 +73,7 @@ function resolveShellFromPath(name) {
73
73
  for (const entry of entries) {
74
74
  const candidate = path.join(entry, name);
75
75
  try {
76
- fs.accessSync(candidate, fs.constants.X_OK);
76
+ syncFs.accessSync(candidate, syncFs.constants.X_OK);
77
77
  return candidate;
78
78
  } catch {}
79
79
  }