wednesdayai 0.5.1-dev.36 → 0.5.1-dev.37
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.
- package/dist/{agent-scope-cTY4-zRz.js → agent-scope-CoIdVzmg.js} +3 -3
- package/dist/{agent-turn-runner-JxDS9bU_.js → agent-turn-runner-CiEPY6RO.js} +2 -2
- package/dist/{agent-turn-runner-7LQU6Fut.js → agent-turn-runner-DKwd_tAc.js} +6 -6
- package/dist/{api-key-rotation-BCh_J5f6.js → api-key-rotation-CoKWzuyV.js} +2 -2
- package/dist/{audio-preflight-C9EHsVrE.js → audio-preflight-BV83ctbI.js} +23 -23
- package/dist/{audio-preflight-Cxyte-N3.js → audio-preflight-CKFGJslr.js} +3 -3
- package/dist/{audio-transcription-runner-CoyogVcx.js → audio-transcription-runner-B-MEt_yD.js} +1 -1
- package/dist/{audio-transcription-runner-DXlkPfwW.js → audio-transcription-runner-DRUTJgZh.js} +25 -25
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +50 -50
- package/dist/bundled/bootstrap-extra-files/handler.js +5 -5
- package/dist/bundled/command-logger/handler.js +2 -2
- package/dist/bundled/session-journal/handler.js +50 -50
- package/dist/bundled/session-memory/handler.js +50 -50
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{chat-content-Cafge7N8.js → chat-content-01nUeO9I.js} +3 -3
- package/dist/{chat-content-Csm95kDY.js → chat-content-B2kNxQ3a.js} +39 -39
- package/dist/{chrome-H5-7mQ4m.js → chrome-DgDNUC2A.js} +4 -4
- package/dist/{chrome-D-DfD0Cv.js → chrome-kwiyU0Mr.js} +31 -31
- package/dist/{chunk-zortZzCP.js → chunk-BRJHaAd6.js} +3 -3
- package/dist/{command-queue-DfL4YmGb.js → command-queue-CRm1AADE.js} +1 -1
- package/dist/{commands-registry-Vo5C1XbD.js → commands-registry-D3lOVOa7.js} +2 -2
- package/dist/{deliver-BKt_OVTK.js → deliver-BoOCdGXY.js} +28 -28
- package/dist/{deliver-x22mTRDq.js → deliver-CgFkiA4Z.js} +1 -1
- package/dist/{diagnostic-8jsvSbYs.js → diagnostic-BSnQ1U_E.js} +3 -3
- package/dist/{errors-muW4vMSB.js → errors-CgPgYfWg.js} +1 -1
- package/dist/extensionAPI.js +6 -6
- package/dist/{fetch-Ciq99DHJ.js → fetch-BBi5dEoV.js} +8 -8
- package/dist/{fetch-B9Tca1cY.js → fetch-BrwJHFZR.js} +1 -1
- package/dist/{fetch-guard-DaJwMbcY.js → fetch-guard-BcLYPGi1.js} +2 -2
- package/dist/{frontmatter-BzlMEBkz.js → frontmatter-DQTIIgFI.js} +5 -5
- package/dist/{fs-safe-CDfp5e8Q.js → fs-safe-CRbowDkj.js} +26 -26
- package/dist/{ir-BczXO28b.js → ir-D___VWlp.js} +4 -4
- package/dist/{json-files-CNVg1Wi5.js → json-files-CurKd8gy.js} +28 -28
- package/dist/{legacy-names-CRCLZarD.js → legacy-names-D7ywm6_7.js} +1 -1
- package/dist/llm-slug-generator.js +50 -50
- package/dist/{manager-ywiQQ5nv.js → manager-yAtdyPwQ.js} +18 -18
- package/dist/{markdown-tables-CmGUH7Wy.js → markdown-tables-DfqPFbkZ.js} +2 -2
- package/dist/{model-selection-BJZFC8fA.js → model-selection-B7FYf8Fo.js} +83 -83
- package/dist/{outbound-attachment-BXAhY7Q6.js → outbound-attachment-BJq1brbB.js} +2 -2
- package/dist/{outbound-message-hooks-CjfNIFcN.js → outbound-message-hooks-Dl2zci3u.js} +5 -5
- package/dist/{path-alias-guards-BV6CR8H3.js → path-alias-guards-nWrE5acE.js} +1 -1
- package/dist/{pi-embedded-BzjQS2tl.js → pi-embedded-BAKd4NmP.js} +18 -18
- package/dist/{pi-embedded-D6Ti_RiY.js → pi-embedded-_YhHvi3M.js} +258 -258
- package/dist/{pi-model-discovery-PH-bhX7g.js → pi-model-discovery-CusLASy5.js} +7 -7
- package/dist/plugin-sdk/provider-media-understanding.js +7 -7
- package/dist/{proxy-env-DXcKRnns.js → proxy-env-DrmTb0QW.js} +1 -1
- package/dist/{pw-ai-ByUzz5o2.js → pw-ai-BKN66RLi.js} +13 -13
- package/dist/{pw-ai-qlENNDHC.js → pw-ai-CPIjXEgJ.js} +1 -1
- package/dist/{qmd-manager-CPPURYfg.js → qmd-manager-BYC9bX-E.js} +12 -12
- package/dist/{qmd-scope-dd_YbPG-.js → qmd-scope-D6tMcgqR.js} +1 -1
- package/dist/{query-expansion-0S2l-J2-.js → query-expansion-CnQI0IeV.js} +13 -13
- package/dist/{recorder-CrrhLZt5.js → recorder-B7dhxQ62.js} +2 -2
- package/dist/{redact-BkE4uRXu.js → redact-CysJDryP.js} +1 -1
- package/dist/{replies-j6q2EArA.js → replies-CP8xbTSR.js} +5 -5
- package/dist/{reply-prefix-BCu_i91I.js → reply-prefix-C7r81KLS.js} +1 -1
- package/dist/{resolve-route-WUZ7lH6L.js → resolve-route-BvD1w4_v.js} +4 -4
- package/dist/{send-lY0a6iA2.js → send-4WdiWuFu.js} +8 -8
- package/dist/{send-CFG2EYja.js → send-BZv91SjC.js} +6 -6
- package/dist/{send-80rMjd6V.js → send-CjR30q4U.js} +8 -8
- package/dist/{send-D1aXT71a.js → send-bmlVFiBl.js} +7 -7
- package/dist/{session-meta-BjRAI6ON.js → session-meta-BeqTuIFU.js} +1 -1
- package/dist/{sessions-B6iaKddN.js → sessions-BjSGNjb0.js} +5 -5
- package/dist/{skill-commands-BG0ravVA.js → skill-commands-CcrQquVr.js} +8 -8
- package/dist/{store-BXWb__DD.js → store-DniD8E6a.js} +7 -7
- package/dist/{tables-CBpS5G91.js → tables-BbmkAuhA.js} +1 -1
- package/dist/{tokens-Q7TMdIpT.js → tokens-C2ll8wSq.js} +1 -1
- package/dist/{tool-loop-detection-CVIDnpv_.js → tool-loop-detection-B0Jj6y2H.js} +2 -2
- package/dist/{user-run-recording-DNsWtMOn.js → user-run-recording-COpooN64.js} +2 -2
- package/dist/{workspace-D8z8s1Xz.js → workspace-xnzx7wEV.js} +26 -26
- package/extensions/acpx/package.json +1 -1
- package/extensions/anthropic/package.json +1 -1
- package/extensions/bifrost/package.json +1 -1
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/deepgram/package.json +1 -1
- package/extensions/deepinfra/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/diffs/package.json +1 -1
- package/extensions/discord/package.json +1 -1
- package/extensions/dream-cycle/package.json +1 -1
- package/extensions/elevenlabs/package.json +1 -1
- package/extensions/feishu/package.json +1 -1
- package/extensions/gemini-search/package.json +1 -1
- package/extensions/google/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/googlechat/package.json +1 -1
- package/extensions/grok-search/package.json +1 -1
- package/extensions/groq/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/kimi-search/package.json +1 -1
- package/extensions/kokoro/package.json +1 -1
- package/extensions/learning-core/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +1 -1
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +1 -1
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/mistral/package.json +1 -1
- package/extensions/moonshot/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +1 -1
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +1 -1
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/openai/package.json +1 -1
- package/extensions/openai-realtime/package.json +1 -1
- package/extensions/openrouter/package.json +1 -1
- package/extensions/perplexity-search/package.json +1 -1
- package/extensions/searxng-search/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/slack/package.json +1 -1
- package/extensions/synology-chat/package.json +1 -1
- package/extensions/telegram/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +1 -1
- package/extensions/twitch/package.json +1 -1
- package/extensions/ui-surfaces/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +1 -1
- package/extensions/voice-call/package.json +1 -1
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zai/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +1 -1
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +1 -1
- package/extensions/zalouser/package.json +1 -1
- package/package.json +1 -1
- package/dist/github-copilot-token-DrVydgnY.js +0 -106
- package/dist/paths-BIDPYPVC.js +0 -233
- package/dist/subsystem-BOg9wqSC.js +0 -2777
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { _ as toAgentModelListLike, a as resolveAgentEffectiveModelPrimary, c as resolveAgentWorkspaceDir, g as resolveAgentModelPrimaryValue, l as resolveDefaultAgentId, n as listAgentIds, r as resolveAgentConfig } from "./agent-scope-
|
|
3
|
-
import { c as resolveOAuthPath, f as resolveRequiredHomeDir, i as resolveDefaultConfigCandidates, l as resolveStateDir, r as resolveConfigPath, s as resolveOAuthDir, t as DEFAULT_GATEWAY_PORT, u as expandHomePrefix } from "./paths-
|
|
4
|
-
import { A as resolveConfigIncludes, D as ConfigIncludeError, E as normalizeConfigPaths, F as openBoundaryFileSync, G as applyConfigEnvVars, H as isPathInside$2, J as MissingEnvVarError, M as isPathInside$1, O as INCLUDE_KEY, X as resolveConfigEnvVars, Y as containsEnvVarReference, b as getChildLogger, dt as sleep, f as logVerbose, it as normalizeE164, j as isBlockedObjectKey, k as readConfigIncludeFileWithGuards, n as stripAnsi, ot as resolveConfigDir, q as sanitizeHostExecEnv, rt as isRecord$3, st as resolveUserPath, t as createSubsystemLogger, tt as escapeRegExp, w as createFileLogWriter } from "./subsystem-
|
|
2
|
+
import { _ as toAgentModelListLike, a as resolveAgentEffectiveModelPrimary, c as resolveAgentWorkspaceDir, g as resolveAgentModelPrimaryValue, l as resolveDefaultAgentId, n as listAgentIds, r as resolveAgentConfig } from "./agent-scope-CoIdVzmg.js";
|
|
3
|
+
import { c as resolveOAuthPath, f as resolveRequiredHomeDir, i as resolveDefaultConfigCandidates, l as resolveStateDir, r as resolveConfigPath, s as resolveOAuthDir, t as DEFAULT_GATEWAY_PORT, u as expandHomePrefix } from "./paths-B_gs59ga.js";
|
|
4
|
+
import { A as resolveConfigIncludes, D as ConfigIncludeError, E as normalizeConfigPaths, F as openBoundaryFileSync, G as applyConfigEnvVars, H as isPathInside$2, J as MissingEnvVarError, M as isPathInside$1, O as INCLUDE_KEY, X as resolveConfigEnvVars, Y as containsEnvVarReference, b as getChildLogger, dt as sleep, f as logVerbose, it as normalizeE164, j as isBlockedObjectKey, k as readConfigIncludeFileWithGuards, n as stripAnsi, ot as resolveConfigDir, q as sanitizeHostExecEnv, rt as isRecord$3, st as resolveUserPath, t as createSubsystemLogger, tt as escapeRegExp, w as createFileLogWriter } from "./subsystem-DynBFcQj.js";
|
|
5
5
|
import { n as resolveProcessScopedMap, t as isPlainObject$2 } from "./plain-object-Doc_YkH1.js";
|
|
6
|
-
import { C as DEFAULT_AGENT_ID, E as RAW_PEER_KEY_PREFIX, F as normalizeAgentId, G as normalizeAccountId$1, K as normalizeOptionalAccountId, M as expandIdentityLinksToMatchKeys, W as DEFAULT_ACCOUNT_ID, _ as runExec, rt as stripAgentSessionKeyPrefix, tt as parseAgentSessionKey } from "./workspace-
|
|
7
|
-
import { a as saveJsonFile, i as loadJsonFile, r as resolveCopilotApiToken, t as DEFAULT_COPILOT_API_BASE_URL } from "./github-copilot-token-
|
|
8
|
-
import { a as registerInternalHook, s as parseBooleanValue, t as readManifestNamespace } from "./legacy-names-
|
|
6
|
+
import { C as DEFAULT_AGENT_ID, E as RAW_PEER_KEY_PREFIX, F as normalizeAgentId, G as normalizeAccountId$1, K as normalizeOptionalAccountId, M as expandIdentityLinksToMatchKeys, W as DEFAULT_ACCOUNT_ID, _ as runExec, rt as stripAgentSessionKeyPrefix, tt as parseAgentSessionKey } from "./workspace-xnzx7wEV.js";
|
|
7
|
+
import { a as saveJsonFile, i as loadJsonFile, r as resolveCopilotApiToken, t as DEFAULT_COPILOT_API_BASE_URL } from "./github-copilot-token-BJeEWDJb.js";
|
|
8
|
+
import { a as registerInternalHook, s as parseBooleanValue, t as readManifestNamespace } from "./legacy-names-D7ywm6_7.js";
|
|
9
9
|
import { n as resolveConversationLabel, r as normalizeChatType } from "./conversation-label-Ckfze_uK.js";
|
|
10
10
|
import { createRequire } from "node:module";
|
|
11
11
|
import path from "node:path";
|
|
12
|
-
import
|
|
12
|
+
import syncFs from "node:fs";
|
|
13
13
|
import os, { userInfo } from "node:os";
|
|
14
|
-
import
|
|
15
|
-
import fs
|
|
14
|
+
import JSON5 from "json5";
|
|
15
|
+
import fs from "node:fs/promises";
|
|
16
16
|
import { isDeepStrictEqual } from "node:util";
|
|
17
17
|
import { execFileSync, spawn } from "node:child_process";
|
|
18
18
|
import { fileURLToPath } from "node:url";
|
|
@@ -275,7 +275,7 @@ function isValidPid(pid) {
|
|
|
275
275
|
function isZombieProcess(pid) {
|
|
276
276
|
if (process.platform !== "linux") return false;
|
|
277
277
|
try {
|
|
278
|
-
return
|
|
278
|
+
return syncFs.readFileSync(`/proc/${pid}/status`, "utf8").match(/^State:\s+(\S)/m)?.[1] === "Z";
|
|
279
279
|
} catch {
|
|
280
280
|
return false;
|
|
281
281
|
}
|
|
@@ -302,7 +302,7 @@ function getProcessStartTime(pid) {
|
|
|
302
302
|
if (process.platform !== "linux") return null;
|
|
303
303
|
if (!isValidPid(pid)) return null;
|
|
304
304
|
try {
|
|
305
|
-
const stat =
|
|
305
|
+
const stat = syncFs.readFileSync(`/proc/${pid}/stat`, "utf8");
|
|
306
306
|
const commEndIndex = stat.lastIndexOf(")");
|
|
307
307
|
if (commEndIndex < 0) return null;
|
|
308
308
|
const fields = stat.slice(commEndIndex + 1).trimStart().split(/\s+/);
|
|
@@ -370,7 +370,7 @@ function readLinuxProcessElapsedSeconds(pid) {
|
|
|
370
370
|
const starttimeTicks = getProcessStartTime(pid);
|
|
371
371
|
if (starttimeTicks === null) {
|
|
372
372
|
try {
|
|
373
|
-
|
|
373
|
+
syncFs.readFileSync(`/proc/${pid}/stat`, "utf8");
|
|
374
374
|
} catch (err) {
|
|
375
375
|
return err.code === "ENOENT" ? null : "unknown";
|
|
376
376
|
}
|
|
@@ -378,7 +378,7 @@ function readLinuxProcessElapsedSeconds(pid) {
|
|
|
378
378
|
}
|
|
379
379
|
let uptimeSeconds;
|
|
380
380
|
try {
|
|
381
|
-
const raw =
|
|
381
|
+
const raw = syncFs.readFileSync("/proc/uptime", "utf8");
|
|
382
382
|
uptimeSeconds = Number.parseFloat(raw.split(" ")[0] ?? "");
|
|
383
383
|
} catch {
|
|
384
384
|
return "unknown";
|
|
@@ -435,7 +435,7 @@ function isCreatedAtStale(createdAt, staleMs) {
|
|
|
435
435
|
}
|
|
436
436
|
async function readLockPayload$1(lockPath) {
|
|
437
437
|
try {
|
|
438
|
-
const raw = await fs
|
|
438
|
+
const raw = await fs.readFile(lockPath, "utf8");
|
|
439
439
|
const parsed = JSON.parse(raw);
|
|
440
440
|
if (typeof parsed.pid !== "number" || typeof parsed.createdAt !== "string") return null;
|
|
441
441
|
const payload = {
|
|
@@ -452,7 +452,7 @@ async function readLockPayload$1(lockPath) {
|
|
|
452
452
|
}
|
|
453
453
|
async function chmodIfSupported(filePath, mode) {
|
|
454
454
|
try {
|
|
455
|
-
await fs
|
|
455
|
+
await fs.chmod(filePath, mode);
|
|
456
456
|
} catch (err) {
|
|
457
457
|
if (process.platform === "win32") return;
|
|
458
458
|
throw err;
|
|
@@ -461,15 +461,15 @@ async function chmodIfSupported(filePath, mode) {
|
|
|
461
461
|
async function resolveNormalizedFilePath(filePath, options) {
|
|
462
462
|
const resolved = path.resolve(filePath);
|
|
463
463
|
const dir = path.dirname(resolved);
|
|
464
|
-
if (options.directoryMode === void 0) await fs
|
|
464
|
+
if (options.directoryMode === void 0) await fs.mkdir(dir, { recursive: true });
|
|
465
465
|
else {
|
|
466
|
-
await fs
|
|
466
|
+
await fs.mkdir(dir, {
|
|
467
467
|
recursive: true,
|
|
468
468
|
mode: options.directoryMode
|
|
469
469
|
});
|
|
470
470
|
await chmodIfSupported(dir, options.directoryMode);
|
|
471
471
|
}
|
|
472
|
-
const realDir = await fs
|
|
472
|
+
const realDir = await fs.realpath(dir);
|
|
473
473
|
return path.join(realDir, path.basename(resolved));
|
|
474
474
|
}
|
|
475
475
|
async function isStaleLock(lockPath, staleMs) {
|
|
@@ -484,7 +484,7 @@ async function isStaleLock(lockPath, staleMs) {
|
|
|
484
484
|
return false;
|
|
485
485
|
}
|
|
486
486
|
try {
|
|
487
|
-
const stat = await fs
|
|
487
|
+
const stat = await fs.stat(lockPath);
|
|
488
488
|
return Date.now() - stat.mtimeMs > staleMs;
|
|
489
489
|
} catch {
|
|
490
490
|
return true;
|
|
@@ -508,7 +508,7 @@ async function releaseHeldLock$1(normalizedFile) {
|
|
|
508
508
|
throw emitLockReleaseWarning("close", current.lockPath, err);
|
|
509
509
|
}
|
|
510
510
|
try {
|
|
511
|
-
await fs
|
|
511
|
+
await fs.rm(current.lockPath, { force: true });
|
|
512
512
|
} catch (err) {
|
|
513
513
|
current.count = 1;
|
|
514
514
|
throw emitLockReleaseWarning("remove", current.lockPath, err);
|
|
@@ -531,7 +531,7 @@ async function acquireFileLock(filePath, options) {
|
|
|
531
531
|
let attempt = 0;
|
|
532
532
|
let staleReclaims = 0;
|
|
533
533
|
while (attempt < attempts) try {
|
|
534
|
-
const handle = await fs
|
|
534
|
+
const handle = await fs.open(lockPath, "wx");
|
|
535
535
|
try {
|
|
536
536
|
await handle.writeFile(JSON.stringify({
|
|
537
537
|
pid: process.pid,
|
|
@@ -540,7 +540,7 @@ async function acquireFileLock(filePath, options) {
|
|
|
540
540
|
}, null, 2), "utf8");
|
|
541
541
|
} catch (writeErr) {
|
|
542
542
|
await handle.close().catch(() => void 0);
|
|
543
|
-
await fs
|
|
543
|
+
await fs.rm(lockPath, { force: true }).catch(() => void 0);
|
|
544
544
|
throw writeErr;
|
|
545
545
|
}
|
|
546
546
|
HELD_LOCKS$1.set(normalizedFile, {
|
|
@@ -556,7 +556,7 @@ async function acquireFileLock(filePath, options) {
|
|
|
556
556
|
} catch (err) {
|
|
557
557
|
if (err.code !== "EEXIST") throw err;
|
|
558
558
|
if (await isStaleLock(lockPath, options.stale)) {
|
|
559
|
-
await fs
|
|
559
|
+
await fs.rm(lockPath, { force: true }).catch(() => void 0);
|
|
560
560
|
if (staleReclaims < attempts) {
|
|
561
561
|
staleReclaims += 1;
|
|
562
562
|
continue;
|
|
@@ -722,7 +722,7 @@ function resolveAuthStorePathForDisplay(agentDir) {
|
|
|
722
722
|
return pathname.startsWith("~") ? pathname : resolveUserPath(pathname);
|
|
723
723
|
}
|
|
724
724
|
function ensureAuthStoreFile(pathname) {
|
|
725
|
-
if (
|
|
725
|
+
if (syncFs.existsSync(pathname)) return;
|
|
726
726
|
saveJsonFile(pathname, {
|
|
727
727
|
version: AUTH_STORE_VERSION,
|
|
728
728
|
profiles: {}
|
|
@@ -985,7 +985,7 @@ function loadAuthProfileStoreForAgent(agentDir, options) {
|
|
|
985
985
|
if (shouldWrite && legacy !== null) {
|
|
986
986
|
const legacyPath = resolveLegacyAuthStorePath(agentDir);
|
|
987
987
|
try {
|
|
988
|
-
|
|
988
|
+
syncFs.unlinkSync(legacyPath);
|
|
989
989
|
} catch (err) {
|
|
990
990
|
if (err?.code !== "ENOENT") log$12.warn("failed to delete legacy auth.json after migration", {
|
|
991
991
|
err,
|
|
@@ -1173,7 +1173,7 @@ function loadDotEnv(opts) {
|
|
|
1173
1173
|
const quiet = opts?.quiet ?? true;
|
|
1174
1174
|
dotenv.config({ quiet });
|
|
1175
1175
|
const globalEnvPath = path.join(resolveConfigDir(process.env), ".env");
|
|
1176
|
-
if (!
|
|
1176
|
+
if (!syncFs.existsSync(globalEnvPath)) return;
|
|
1177
1177
|
dotenv.config({
|
|
1178
1178
|
quiet,
|
|
1179
1179
|
path: globalEnvPath,
|
|
@@ -1216,7 +1216,7 @@ function resolveTimeoutMs(timeoutMs) {
|
|
|
1216
1216
|
function readEtcShells() {
|
|
1217
1217
|
if (shellEnvState.cachedEtcShells !== void 0) return shellEnvState.cachedEtcShells;
|
|
1218
1218
|
try {
|
|
1219
|
-
const entries =
|
|
1219
|
+
const entries = syncFs.readFileSync("/etc/shells", "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#") && path.isAbsolute(line));
|
|
1220
1220
|
shellEnvState.cachedEtcShells = new Set(entries);
|
|
1221
1221
|
} catch {
|
|
1222
1222
|
shellEnvState.cachedEtcShells = null;
|
|
@@ -1764,7 +1764,7 @@ function formatWindowsAclSummary(summary) {
|
|
|
1764
1764
|
//#region src/security/audit-fs.ts
|
|
1765
1765
|
async function safeStat(targetPath) {
|
|
1766
1766
|
try {
|
|
1767
|
-
const lst = await fs
|
|
1767
|
+
const lst = await fs.lstat(targetPath);
|
|
1768
1768
|
return {
|
|
1769
1769
|
ok: true,
|
|
1770
1770
|
isSymlink: lst.isSymbolicLink(),
|
|
@@ -1803,7 +1803,7 @@ async function inspectPathPermissions(targetPath, opts) {
|
|
|
1803
1803
|
let effectiveMode = st.mode;
|
|
1804
1804
|
let effectiveIsDir = st.isDir;
|
|
1805
1805
|
if (st.isSymlink) try {
|
|
1806
|
-
const target = await fs
|
|
1806
|
+
const target = await fs.stat(targetPath);
|
|
1807
1807
|
effectiveMode = typeof target.mode === "number" ? target.mode : st.mode;
|
|
1808
1808
|
effectiveIsDir = target.isDirectory();
|
|
1809
1809
|
} catch {}
|
|
@@ -2085,7 +2085,7 @@ async function assertSecurePath(params) {
|
|
|
2085
2085
|
if (stat.isSymlink) {
|
|
2086
2086
|
if (!params.allowSymlinkPath) throw new Error(`${params.label} must not be a symlink: ${effectivePath}`);
|
|
2087
2087
|
try {
|
|
2088
|
-
effectivePath = await fs
|
|
2088
|
+
effectivePath = await fs.realpath(effectivePath);
|
|
2089
2089
|
} catch {
|
|
2090
2090
|
throw new Error(`${params.label} symlink target is not readable: ${params.targetPath}`);
|
|
2091
2091
|
}
|
|
@@ -2133,7 +2133,7 @@ async function readFileProviderPayload(params) {
|
|
|
2133
2133
|
}, timeoutMs);
|
|
2134
2134
|
});
|
|
2135
2135
|
try {
|
|
2136
|
-
const payload = await Promise.race([fs
|
|
2136
|
+
const payload = await Promise.race([fs.readFile(secureFilePath, { signal: abortController.signal }), timeoutPromise]);
|
|
2137
2137
|
if (payload.byteLength > maxBytes) throw new Error(`File provider "${params.providerName}" exceeded maxBytes (${maxBytes}).`);
|
|
2138
2138
|
const text = payload.toString("utf8");
|
|
2139
2139
|
if (params.providerConfig.mode === "singleValue") return text.replace(/\r?\n$/, "");
|
|
@@ -2759,7 +2759,7 @@ function resolveActiveTalkProviderConfig(talk) {
|
|
|
2759
2759
|
};
|
|
2760
2760
|
}
|
|
2761
2761
|
function readTalkApiKeyFromProfile(deps = {}) {
|
|
2762
|
-
const fsImpl = deps.fs ??
|
|
2762
|
+
const fsImpl = deps.fs ?? syncFs;
|
|
2763
2763
|
const osImpl = deps.os ?? os;
|
|
2764
2764
|
const pathImpl = deps.path ?? path;
|
|
2765
2765
|
const home = osImpl.homedir();
|
|
@@ -5239,7 +5239,7 @@ function normalizeMatchTarget(value) {
|
|
|
5239
5239
|
}
|
|
5240
5240
|
function tryRealpath(value) {
|
|
5241
5241
|
try {
|
|
5242
|
-
return
|
|
5242
|
+
return syncFs.realpathSync(value);
|
|
5243
5243
|
} catch {
|
|
5244
5244
|
return null;
|
|
5245
5245
|
}
|
|
@@ -5792,8 +5792,8 @@ function resolveWindowsExecutableExtensions(executable, env) {
|
|
|
5792
5792
|
}
|
|
5793
5793
|
function isExecutableFile(filePath) {
|
|
5794
5794
|
try {
|
|
5795
|
-
if (!
|
|
5796
|
-
if (process.platform !== "win32")
|
|
5795
|
+
if (!syncFs.statSync(filePath).isFile()) return false;
|
|
5796
|
+
if (process.platform !== "win32") syncFs.accessSync(filePath, syncFs.constants.X_OK);
|
|
5797
5797
|
return true;
|
|
5798
5798
|
} catch {
|
|
5799
5799
|
return false;
|
|
@@ -5832,7 +5832,7 @@ const DEFAULT_SAFE_BINS = [
|
|
|
5832
5832
|
function tryResolveRealpath(filePath) {
|
|
5833
5833
|
if (!filePath) return;
|
|
5834
5834
|
try {
|
|
5835
|
-
return
|
|
5835
|
+
return syncFs.realpathSync(filePath);
|
|
5836
5836
|
} catch {
|
|
5837
5837
|
return;
|
|
5838
5838
|
}
|
|
@@ -6707,7 +6707,7 @@ function listWritableExplicitTrustedSafeBinDirs(entries) {
|
|
|
6707
6707
|
for (const dir of resolved) {
|
|
6708
6708
|
let stat;
|
|
6709
6709
|
try {
|
|
6710
|
-
stat =
|
|
6710
|
+
stat = syncFs.statSync(dir);
|
|
6711
6711
|
} catch {
|
|
6712
6712
|
continue;
|
|
6713
6713
|
}
|
|
@@ -7384,7 +7384,7 @@ async function releaseHeldLock(normalizedSessionFile, held, opts = {}) {
|
|
|
7384
7384
|
await held.handle.close();
|
|
7385
7385
|
} catch {}
|
|
7386
7386
|
try {
|
|
7387
|
-
await fs
|
|
7387
|
+
await fs.rm(held.lockPath, { force: true });
|
|
7388
7388
|
} catch {}
|
|
7389
7389
|
})();
|
|
7390
7390
|
try {
|
|
@@ -7404,7 +7404,7 @@ function releaseAllLocksSync() {
|
|
|
7404
7404
|
if (typeof held.handle.close === "function") held.handle.close().catch(() => {});
|
|
7405
7405
|
} catch {}
|
|
7406
7406
|
try {
|
|
7407
|
-
|
|
7407
|
+
syncFs.rmSync(held.lockPath, { force: true });
|
|
7408
7408
|
} catch {}
|
|
7409
7409
|
HELD_LOCKS.delete(sessionFile);
|
|
7410
7410
|
}
|
|
@@ -7463,7 +7463,7 @@ function registerCleanupHandlers() {
|
|
|
7463
7463
|
}
|
|
7464
7464
|
async function readLockPayload(lockPath) {
|
|
7465
7465
|
try {
|
|
7466
|
-
const raw = await fs
|
|
7466
|
+
const raw = await fs.readFile(lockPath, "utf8");
|
|
7467
7467
|
const parsed = JSON.parse(raw);
|
|
7468
7468
|
const payload = {};
|
|
7469
7469
|
if (isValidLockNumber(parsed.pid) && parsed.pid > 0) payload.pid = parsed.pid;
|
|
@@ -7507,7 +7507,7 @@ async function shouldReclaimContendedLockFile(lockPath, details, staleMs, nowMs)
|
|
|
7507
7507
|
if (!details.stale) return false;
|
|
7508
7508
|
if (!lockInspectionNeedsMtimeStaleFallback(details)) return true;
|
|
7509
7509
|
try {
|
|
7510
|
-
const stat = await fs
|
|
7510
|
+
const stat = await fs.stat(lockPath);
|
|
7511
7511
|
return Math.max(0, nowMs - stat.mtimeMs) > staleMs;
|
|
7512
7512
|
} catch (error) {
|
|
7513
7513
|
return error?.code !== "ENOENT";
|
|
@@ -7525,10 +7525,10 @@ async function acquireSessionWriteLockWithProcessIdentity(params, processIdentit
|
|
|
7525
7525
|
const maxHoldMs = resolvePositiveMs(params.maxHoldMs, DEFAULT_MAX_HOLD_MS);
|
|
7526
7526
|
const sessionFile = path.resolve(params.sessionFile);
|
|
7527
7527
|
const sessionDir = path.dirname(sessionFile);
|
|
7528
|
-
await fs
|
|
7528
|
+
await fs.mkdir(sessionDir, { recursive: true });
|
|
7529
7529
|
let normalizedDir = sessionDir;
|
|
7530
7530
|
try {
|
|
7531
|
-
normalizedDir = await fs
|
|
7531
|
+
normalizedDir = await fs.realpath(sessionDir);
|
|
7532
7532
|
} catch {}
|
|
7533
7533
|
const normalizedSessionFile = path.join(normalizedDir, path.basename(sessionFile));
|
|
7534
7534
|
const lockPath = `${normalizedSessionFile}.lock`;
|
|
@@ -7546,7 +7546,7 @@ async function acquireSessionWriteLockWithProcessIdentity(params, processIdentit
|
|
|
7546
7546
|
attempt += 1;
|
|
7547
7547
|
let handle = null;
|
|
7548
7548
|
try {
|
|
7549
|
-
handle = await fs
|
|
7549
|
+
handle = await fs.open(lockPath, "wx");
|
|
7550
7550
|
const createdAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7551
7551
|
const starttime = processIdentity.getProcessStartTime(process.pid);
|
|
7552
7552
|
const lockPayload = {
|
|
@@ -7572,7 +7572,7 @@ async function acquireSessionWriteLockWithProcessIdentity(params, processIdentit
|
|
|
7572
7572
|
await handle.close();
|
|
7573
7573
|
} catch {}
|
|
7574
7574
|
try {
|
|
7575
|
-
await fs
|
|
7575
|
+
await fs.rm(lockPath, { force: true });
|
|
7576
7576
|
} catch {}
|
|
7577
7577
|
}
|
|
7578
7578
|
if (err.code !== "EEXIST") throw err;
|
|
@@ -7587,7 +7587,7 @@ async function acquireSessionWriteLockWithProcessIdentity(params, processIdentit
|
|
|
7587
7587
|
stale: true,
|
|
7588
7588
|
staleReasons: inspected.staleReasons.includes("orphan-self-pid") ? inspected.staleReasons : [...inspected.staleReasons, "orphan-self-pid"]
|
|
7589
7589
|
} : inspected, staleMs, nowMs)) {
|
|
7590
|
-
await fs
|
|
7590
|
+
await fs.rm(lockPath, { force: true });
|
|
7591
7591
|
continue;
|
|
7592
7592
|
}
|
|
7593
7593
|
const delay = Math.min(1e3, 50 * attempt);
|
|
@@ -7792,7 +7792,7 @@ function isCacheEnabled(ttlMs) {
|
|
|
7792
7792
|
}
|
|
7793
7793
|
function getFileStatSnapshot(filePath) {
|
|
7794
7794
|
try {
|
|
7795
|
-
const stats =
|
|
7795
|
+
const stats = syncFs.statSync(filePath);
|
|
7796
7796
|
return {
|
|
7797
7797
|
mtimeMs: stats.mtimeMs,
|
|
7798
7798
|
sizeBytes: stats.size
|
|
@@ -8284,7 +8284,7 @@ const credsSaveQueues = resolveProcessScopedMap(Symbol.for("openclaw.webCredsSav
|
|
|
8284
8284
|
function canonicalWebAuthDir(authDir) {
|
|
8285
8285
|
const resolvedAuthDir = resolveUserPath(authDir);
|
|
8286
8286
|
try {
|
|
8287
|
-
return
|
|
8287
|
+
return syncFs.realpathSync.native(resolvedAuthDir);
|
|
8288
8288
|
} catch (err) {
|
|
8289
8289
|
if (err.code === "ENOENT") return resolvedAuthDir;
|
|
8290
8290
|
throw err;
|
|
@@ -8299,7 +8299,7 @@ function isWebAuthBeingCleared(authDir) {
|
|
|
8299
8299
|
}
|
|
8300
8300
|
function statFileSync(filePath) {
|
|
8301
8301
|
try {
|
|
8302
|
-
return
|
|
8302
|
+
return syncFs.statSync(filePath);
|
|
8303
8303
|
} catch {
|
|
8304
8304
|
return null;
|
|
8305
8305
|
}
|
|
@@ -8311,7 +8311,7 @@ function hasWebCredsSync(authDir) {
|
|
|
8311
8311
|
const resolvedAuthDir = resolveUserPath(authDir);
|
|
8312
8312
|
maybeRestoreCredsFromBackup(resolvedAuthDir);
|
|
8313
8313
|
try {
|
|
8314
|
-
const stats =
|
|
8314
|
+
const stats = syncFs.statSync(resolveWebCredsPath(resolvedAuthDir));
|
|
8315
8315
|
return stats.isFile() && stats.size > 1;
|
|
8316
8316
|
} catch {
|
|
8317
8317
|
return false;
|
|
@@ -8319,10 +8319,10 @@ function hasWebCredsSync(authDir) {
|
|
|
8319
8319
|
}
|
|
8320
8320
|
function readCredsJsonRaw(filePath) {
|
|
8321
8321
|
try {
|
|
8322
|
-
if (!
|
|
8323
|
-
const stats =
|
|
8322
|
+
if (!syncFs.existsSync(filePath)) return null;
|
|
8323
|
+
const stats = syncFs.statSync(filePath);
|
|
8324
8324
|
if (!stats.isFile() || stats.size <= 1) return null;
|
|
8325
|
-
return
|
|
8325
|
+
return syncFs.readFileSync(filePath, "utf-8");
|
|
8326
8326
|
} catch {
|
|
8327
8327
|
return null;
|
|
8328
8328
|
}
|
|
@@ -8347,12 +8347,12 @@ function maybeRestoreCredsFromBackup(authDir) {
|
|
|
8347
8347
|
const backupRaw = readCredsJsonRaw(backupPath);
|
|
8348
8348
|
const backupStats = statFileSync(backupPath);
|
|
8349
8349
|
if (!backupStats?.isFile() || !backupRaw || !isParseableJson(backupRaw)) return;
|
|
8350
|
-
|
|
8350
|
+
syncFs.copyFileSync(backupPath, credsPath);
|
|
8351
8351
|
try {
|
|
8352
|
-
|
|
8352
|
+
syncFs.chmodSync(credsPath, 384);
|
|
8353
8353
|
} catch {}
|
|
8354
8354
|
try {
|
|
8355
|
-
|
|
8355
|
+
syncFs.utimesSync(credsPath, backupStats.atime, backupStats.mtime);
|
|
8356
8356
|
} catch {}
|
|
8357
8357
|
logger.warn({ credsPath }, "restored corrupted WhatsApp creds.json from backup");
|
|
8358
8358
|
} catch {}
|
|
@@ -8372,7 +8372,7 @@ function listWhatsAppAuthDirs(cfg) {
|
|
|
8372
8372
|
accountId
|
|
8373
8373
|
}).authDir);
|
|
8374
8374
|
try {
|
|
8375
|
-
const entries =
|
|
8375
|
+
const entries = syncFs.readdirSync(whatsappDir, { withFileTypes: true });
|
|
8376
8376
|
for (const entry of entries) {
|
|
8377
8377
|
if (!entry.isDirectory()) continue;
|
|
8378
8378
|
authDirs.add(path.join(whatsappDir, entry.name));
|
|
@@ -8394,7 +8394,7 @@ function resolveLegacyAuthDir() {
|
|
|
8394
8394
|
}
|
|
8395
8395
|
function legacyAuthExists(authDir) {
|
|
8396
8396
|
try {
|
|
8397
|
-
return
|
|
8397
|
+
return syncFs.existsSync(path.join(authDir, "creds.json"));
|
|
8398
8398
|
} catch {
|
|
8399
8399
|
return false;
|
|
8400
8400
|
}
|
|
@@ -9509,7 +9509,7 @@ function resolveStructuralSessionFallbackPath(candidateAbsPath, expectedAgentId)
|
|
|
9509
9509
|
}
|
|
9510
9510
|
function safeRealpathSync$1(filePath) {
|
|
9511
9511
|
try {
|
|
9512
|
-
return
|
|
9512
|
+
return syncFs.realpathSync(filePath);
|
|
9513
9513
|
} catch {
|
|
9514
9514
|
return;
|
|
9515
9515
|
}
|
|
@@ -10477,7 +10477,7 @@ function loadSessionStoreFromDisk(storePath, opts = {}) {
|
|
|
10477
10477
|
const maxReadAttempts = process.platform === "win32" ? 3 : 1;
|
|
10478
10478
|
const retryBuf = maxReadAttempts > 1 ? new Int32Array(new SharedArrayBuffer(4)) : void 0;
|
|
10479
10479
|
for (let attempt = 0; attempt < maxReadAttempts; attempt++) try {
|
|
10480
|
-
const raw =
|
|
10480
|
+
const raw = syncFs.readFileSync(storePath, "utf-8");
|
|
10481
10481
|
if (raw.length === 0 && attempt < maxReadAttempts - 1) {
|
|
10482
10482
|
Atomics.wait(retryBuf, 0, 0, 50);
|
|
10483
10483
|
continue;
|
|
@@ -12584,13 +12584,13 @@ function resolveBundledPluginsDir() {
|
|
|
12584
12584
|
try {
|
|
12585
12585
|
const execDir = path.dirname(process.execPath);
|
|
12586
12586
|
const sibling = path.join(execDir, "extensions");
|
|
12587
|
-
if (
|
|
12587
|
+
if (syncFs.existsSync(sibling)) return sibling;
|
|
12588
12588
|
} catch {}
|
|
12589
12589
|
try {
|
|
12590
12590
|
let cursor = path.dirname(fileURLToPath(import.meta.url));
|
|
12591
12591
|
for (let i = 0; i < 6; i += 1) {
|
|
12592
12592
|
const candidate = path.join(cursor, "extensions");
|
|
12593
|
-
if (
|
|
12593
|
+
if (syncFs.existsSync(candidate) && syncFs.existsSync(path.join(cursor, "package.json"))) return candidate;
|
|
12594
12594
|
const parent = path.dirname(cursor);
|
|
12595
12595
|
if (parent === cursor) break;
|
|
12596
12596
|
cursor = parent;
|
|
@@ -12668,7 +12668,7 @@ function parseSessionConsumers(raw) {
|
|
|
12668
12668
|
function resolvePluginManifestPath(rootDir) {
|
|
12669
12669
|
for (const filename of PLUGIN_MANIFEST_FILENAMES) {
|
|
12670
12670
|
const candidate = path.join(rootDir, filename);
|
|
12671
|
-
if (
|
|
12671
|
+
if (syncFs.existsSync(candidate)) return candidate;
|
|
12672
12672
|
}
|
|
12673
12673
|
return path.join(rootDir, PLUGIN_MANIFEST_FILENAME);
|
|
12674
12674
|
}
|
|
@@ -12694,7 +12694,7 @@ function loadPluginManifest(rootDir, rejectHardlinks = true) {
|
|
|
12694
12694
|
}
|
|
12695
12695
|
let raw;
|
|
12696
12696
|
try {
|
|
12697
|
-
raw = JSON.parse(
|
|
12697
|
+
raw = JSON.parse(syncFs.readFileSync(opened.fd, "utf-8"));
|
|
12698
12698
|
} catch (err) {
|
|
12699
12699
|
return {
|
|
12700
12700
|
ok: false,
|
|
@@ -12702,7 +12702,7 @@ function loadPluginManifest(rootDir, rejectHardlinks = true) {
|
|
|
12702
12702
|
manifestPath
|
|
12703
12703
|
};
|
|
12704
12704
|
} finally {
|
|
12705
|
-
|
|
12705
|
+
syncFs.closeSync(opened.fd);
|
|
12706
12706
|
}
|
|
12707
12707
|
return {
|
|
12708
12708
|
...loadPluginManifestFromObject(raw, rejectHardlinks),
|
|
@@ -12877,7 +12877,7 @@ function safeRealpathSync(targetPath, cache) {
|
|
|
12877
12877
|
const cached = cache?.get(targetPath);
|
|
12878
12878
|
if (cached) return cached;
|
|
12879
12879
|
try {
|
|
12880
|
-
const resolved =
|
|
12880
|
+
const resolved = syncFs.realpathSync(targetPath);
|
|
12881
12881
|
cache?.set(targetPath, resolved);
|
|
12882
12882
|
return resolved;
|
|
12883
12883
|
} catch {
|
|
@@ -12886,7 +12886,7 @@ function safeRealpathSync(targetPath, cache) {
|
|
|
12886
12886
|
}
|
|
12887
12887
|
function safeStatSync(targetPath) {
|
|
12888
12888
|
try {
|
|
12889
|
-
return
|
|
12889
|
+
return syncFs.statSync(targetPath);
|
|
12890
12890
|
} catch {
|
|
12891
12891
|
return null;
|
|
12892
12892
|
}
|
|
@@ -13018,12 +13018,12 @@ function readPackageManifest(dir, rejectHardlinks = true) {
|
|
|
13018
13018
|
});
|
|
13019
13019
|
if (!opened.ok) return null;
|
|
13020
13020
|
try {
|
|
13021
|
-
const raw =
|
|
13021
|
+
const raw = syncFs.readFileSync(opened.fd, "utf-8");
|
|
13022
13022
|
return JSON.parse(raw);
|
|
13023
13023
|
} catch {
|
|
13024
13024
|
return null;
|
|
13025
13025
|
} finally {
|
|
13026
|
-
|
|
13026
|
+
syncFs.closeSync(opened.fd);
|
|
13027
13027
|
}
|
|
13028
13028
|
}
|
|
13029
13029
|
function deriveIdHint(params) {
|
|
@@ -13091,14 +13091,14 @@ function resolvePackageEntrySource(params) {
|
|
|
13091
13091
|
return null;
|
|
13092
13092
|
}
|
|
13093
13093
|
const safeSource = opened.path;
|
|
13094
|
-
|
|
13094
|
+
syncFs.closeSync(opened.fd);
|
|
13095
13095
|
return safeSource;
|
|
13096
13096
|
}
|
|
13097
13097
|
function discoverInDirectory(params) {
|
|
13098
|
-
if (!
|
|
13098
|
+
if (!syncFs.existsSync(params.dir)) return;
|
|
13099
13099
|
let entries = [];
|
|
13100
13100
|
try {
|
|
13101
|
-
entries =
|
|
13101
|
+
entries = syncFs.readdirSync(params.dir, { withFileTypes: true });
|
|
13102
13102
|
} catch (err) {
|
|
13103
13103
|
params.diagnostics.push({
|
|
13104
13104
|
level: "warn",
|
|
@@ -13161,7 +13161,7 @@ function discoverInDirectory(params) {
|
|
|
13161
13161
|
}
|
|
13162
13162
|
continue;
|
|
13163
13163
|
}
|
|
13164
|
-
const indexFile = [...DEFAULT_PLUGIN_ENTRY_CANDIDATES].map((candidate) => path.join(fullPath, candidate)).find((candidate) =>
|
|
13164
|
+
const indexFile = [...DEFAULT_PLUGIN_ENTRY_CANDIDATES].map((candidate) => path.join(fullPath, candidate)).find((candidate) => syncFs.existsSync(candidate));
|
|
13165
13165
|
if (indexFile && isExtensionFile(indexFile)) addCandidate({
|
|
13166
13166
|
candidates: params.candidates,
|
|
13167
13167
|
diagnostics: params.diagnostics,
|
|
@@ -13179,7 +13179,7 @@ function discoverInDirectory(params) {
|
|
|
13179
13179
|
}
|
|
13180
13180
|
function discoverFromPath(params) {
|
|
13181
13181
|
const resolved = resolveUserPath(params.rawPath);
|
|
13182
|
-
if (!
|
|
13182
|
+
if (!syncFs.existsSync(resolved)) {
|
|
13183
13183
|
params.diagnostics.push({
|
|
13184
13184
|
level: "error",
|
|
13185
13185
|
code: "PLUGIN_LOAD_ERROR",
|
|
@@ -13188,7 +13188,7 @@ function discoverFromPath(params) {
|
|
|
13188
13188
|
});
|
|
13189
13189
|
return;
|
|
13190
13190
|
}
|
|
13191
|
-
const stat =
|
|
13191
|
+
const stat = syncFs.statSync(resolved);
|
|
13192
13192
|
if (stat.isFile()) {
|
|
13193
13193
|
if (!isExtensionFile(resolved)) {
|
|
13194
13194
|
params.diagnostics.push({
|
|
@@ -13248,7 +13248,7 @@ function discoverFromPath(params) {
|
|
|
13248
13248
|
}
|
|
13249
13249
|
return;
|
|
13250
13250
|
}
|
|
13251
|
-
const indexFile = [...DEFAULT_PLUGIN_ENTRY_CANDIDATES].map((candidate) => path.join(resolved, candidate)).find((candidate) =>
|
|
13251
|
+
const indexFile = [...DEFAULT_PLUGIN_ENTRY_CANDIDATES].map((candidate) => path.join(resolved, candidate)).find((candidate) => syncFs.existsSync(candidate));
|
|
13252
13252
|
if (indexFile && isExtensionFile(indexFile)) {
|
|
13253
13253
|
addCandidate({
|
|
13254
13254
|
candidates: params.candidates,
|
|
@@ -13635,7 +13635,7 @@ function buildCacheKey$1(params) {
|
|
|
13635
13635
|
}
|
|
13636
13636
|
function safeStatMtimeMs(filePath) {
|
|
13637
13637
|
try {
|
|
13638
|
-
return
|
|
13638
|
+
return syncFs.statSync(filePath).mtimeMs;
|
|
13639
13639
|
} catch {
|
|
13640
13640
|
return null;
|
|
13641
13641
|
}
|
|
@@ -18850,7 +18850,7 @@ function validateConfigObjectWithPluginsBase(raw, opts) {
|
|
|
18850
18850
|
};
|
|
18851
18851
|
const buildManifestSchemaCacheKey = (manifestPath) => {
|
|
18852
18852
|
try {
|
|
18853
|
-
const mtimeMs =
|
|
18853
|
+
const mtimeMs = syncFs.statSync(manifestPath).mtimeMs;
|
|
18854
18854
|
return mtimeMs ? `${manifestPath}:${mtimeMs}` : manifestPath;
|
|
18855
18855
|
} catch {
|
|
18856
18856
|
return manifestPath;
|
|
@@ -18875,7 +18875,7 @@ function validateConfigObjectWithPluginsBase(raw, opts) {
|
|
|
18875
18875
|
manifestRoot = record.sourcePath;
|
|
18876
18876
|
} else if (sources.size === 0) {
|
|
18877
18877
|
const bundledDir = resolveBundledPluginsDir();
|
|
18878
|
-
if (bundledDir &&
|
|
18878
|
+
if (bundledDir && syncFs.existsSync(bundledDir)) {
|
|
18879
18879
|
const realSourcePath = safeRealpathSync(resolveUserPath(record.sourcePath), bundledInstallRealpathCache);
|
|
18880
18880
|
const realBundledDir = safeRealpathSync(bundledDir, bundledInstallRealpathCache) ?? bundledDir;
|
|
18881
18881
|
if (!realSourcePath || !isPathWithinRoot(realBundledDir, realSourcePath)) {
|
|
@@ -19612,8 +19612,8 @@ function resolveConfigPathForDeps(deps) {
|
|
|
19612
19612
|
}
|
|
19613
19613
|
function normalizeDeps(overrides = {}) {
|
|
19614
19614
|
return {
|
|
19615
|
-
fs: overrides.fs ??
|
|
19616
|
-
json5: overrides.json5 ??
|
|
19615
|
+
fs: overrides.fs ?? syncFs,
|
|
19616
|
+
json5: overrides.json5 ?? JSON5,
|
|
19617
19617
|
env: overrides.env ?? process.env,
|
|
19618
19618
|
homedir: overrides.homedir ?? (() => resolveRequiredHomeDir(overrides.env ?? process.env, os.homedir)),
|
|
19619
19619
|
configPath: overrides.configPath ?? "",
|
|
@@ -19624,11 +19624,11 @@ function maybeLoadDotEnvForConfig(env) {
|
|
|
19624
19624
|
if (env !== process.env) return;
|
|
19625
19625
|
loadDotEnv({ quiet: true });
|
|
19626
19626
|
}
|
|
19627
|
-
function parseConfigJson5(raw, json5
|
|
19627
|
+
function parseConfigJson5(raw, json5 = JSON5) {
|
|
19628
19628
|
try {
|
|
19629
19629
|
return {
|
|
19630
19630
|
ok: true,
|
|
19631
|
-
parsed: json5
|
|
19631
|
+
parsed: json5.parse(raw)
|
|
19632
19632
|
};
|
|
19633
19633
|
} catch (err) {
|
|
19634
19634
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as saveMediaBuffer } from "./store-
|
|
2
|
-
import { a as loadWebMedia } from "./ir-
|
|
1
|
+
import { i as saveMediaBuffer } from "./store-DniD8E6a.js";
|
|
2
|
+
import { a as loadWebMedia } from "./ir-D___VWlp.js";
|
|
3
3
|
import { t as buildOutboundMediaLoadOptions } from "./load-options-BFUunM8u.js";
|
|
4
4
|
|
|
5
5
|
//#region src/media/outbound-attachment.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { f as resolveSessionAgentId } from "./agent-scope-
|
|
2
|
-
import { f as logVerbose, t as createSubsystemLogger } from "./subsystem-
|
|
3
|
-
import { vn as getConfiguredSessionStorageRuntime } from "./model-selection-
|
|
4
|
-
import { n as createInternalHookEvent, o as triggerInternalHook } from "./legacy-names-
|
|
5
|
-
import { Rt as buildPluginRuntimeIdentity, zt as buildPluginTurnIdentity } from "./sessions-
|
|
1
|
+
import { f as resolveSessionAgentId } from "./agent-scope-CoIdVzmg.js";
|
|
2
|
+
import { f as logVerbose, t as createSubsystemLogger } from "./subsystem-DynBFcQj.js";
|
|
3
|
+
import { vn as getConfiguredSessionStorageRuntime } from "./model-selection-B7FYf8Fo.js";
|
|
4
|
+
import { n as createInternalHookEvent, o as triggerInternalHook } from "./legacy-names-D7ywm6_7.js";
|
|
5
|
+
import { Rt as buildPluginRuntimeIdentity, zt as buildPluginTurnIdentity } from "./sessions-BjSGNjb0.js";
|
|
6
6
|
|
|
7
7
|
//#region src/infra/outbound/session-context.ts
|
|
8
8
|
const log$1 = createSubsystemLogger("outbound/session-context");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as BOUNDARY_PATH_ALIAS_POLICIES, R as resolveBoundaryPath, V as isNotFoundPathError } from "./subsystem-
|
|
1
|
+
import { L as BOUNDARY_PATH_ALIAS_POLICIES, R as resolveBoundaryPath, V as isNotFoundPathError } from "./subsystem-DynBFcQj.js";
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
|