@bitseek/claw 1.1.0-beta.2 → 1.2.0
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/{accounts-CX1yOBOk.js → accounts-BTexwKe8.js} +1 -1
- package/dist/{accounts-DZqwa5NK.js → accounts-CFz9Jc5d.js} +1 -1
- package/dist/{accounts-CaiECgq3.js → accounts-ubG6irXZ.js} +16 -16
- package/dist/{active-listener-neKWQsOO.js → active-listener-Hd9sOu9T.js} +1 -1
- package/dist/{agent-scope-CTbRzU1C.js → agent-scope-C6hps0r3.js} +4 -4
- package/dist/{api-key-rotation-BTSy5kZN.js → api-key-rotation-WzOC5dTW.js} +2 -2
- package/dist/{audio-preflight-DZWb0ozj.js → audio-preflight-BWOdDA2n.js} +39 -39
- package/dist/{audio-transcription-runner-2dp0SxL3.js → audio-transcription-runner-DaoqvWoi.js} +11 -11
- package/dist/{bindings-Daa-Etag.js → bindings-CsIiIjqN.js} +2 -2
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +65 -65
- package/dist/bundled/bootstrap-extra-files/handler.js +7 -7
- package/dist/bundled/command-logger/handler.js +2 -2
- package/dist/bundled/session-memory/handler.js +65 -65
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-activity-Btz1t5_1.js → channel-activity-D81g48kD.js} +3 -3
- package/dist/{chrome-DX1blHAJ.js → chrome-CjTE-vWv.js} +18 -18
- package/dist/{chunk-DEkdXze6.js → chunk-DtYb6TYl.js} +1 -1
- package/dist/{commands-registry-BQkQRhEo.js → commands-registry-NIsv9Z4R.js} +5 -5
- package/dist/{deliver-C82Egs0W.js → deliver-xY3h9X6N.js} +22 -22
- package/dist/{diagnostic-DpOlXoSr.js → diagnostic-BO1GQJJf.js} +2 -2
- package/dist/{dock-DWqb4ufG.js → dock-Cr9V9V1V.js} +6 -6
- package/dist/{env-Bn6pmvjK.js → env-DNMZEG57.js} +2 -2
- package/dist/{errors-azBrKJmF.js → errors-DEkWxItM.js} +1 -1
- package/dist/{fetch-B82CeaHJ.js → fetch--iXu7oa7.js} +5 -5
- package/dist/{fetch-guard-CCLWHwu7.js → fetch-guard-CNvY0vzQ.js} +2 -2
- package/dist/{frontmatter-5U1LYLH9.js → frontmatter-DIRc-IR1.js} +2 -2
- package/dist/{fs-safe-BDR6eQAw.js → fs-safe-D8x_nIIA.js} +4 -4
- package/dist/{github-copilot-token-CPjAmbfr.js → github-copilot-token-DLGN-8YS.js} +7 -7
- package/dist/{image-BQ1JgwZu.js → image-DCyaYY2d.js} +6 -6
- package/dist/{image-ops-jvmQoiyw.js → image-ops-DCpyia_K.js} +1 -1
- package/dist/{internal-hooks-oLQ2m8YT.js → internal-hooks-yQe6H47q.js} +1 -1
- package/dist/{ir-BODD8g-I.js → ir-BZUjdf-6.js} +6 -6
- package/dist/llm-slug-generator.js +65 -65
- package/dist/{logger-DelEB7MK.js → logger-BlH5MJiV.js} +1 -1
- package/dist/{login-Cm2zDfEU.js → login-CgEHUE7h.js} +6 -6
- package/dist/{login-qr-iS1jPDpP.js → login-qr-DUJfhbUe.js} +13 -13
- package/dist/{manager-DdzkWOvc.js → manager-BNuB9clC.js} +15 -15
- package/dist/{markdown-tables-pfs_NCNh.js → markdown-tables-BHONoo6S.js} +1 -1
- package/dist/{message-channel-POuk6EOq.js → message-channel-Dl8dSs0T.js} +1 -1
- package/dist/{model-selection-DfZMxaX3.js → model-selection-D_Si2Ict.js} +44 -44
- package/dist/{outbound-4q4mbU-Z.js → outbound-DOVV_R6m.js} +7 -7
- package/dist/{outbound-attachment-CBCp1oVQ.js → outbound-attachment-C7sJLSnv.js} +2 -2
- package/dist/{path-alias-guards-DfQIjfhB.js → path-alias-guards-CKjKIhQ3.js} +1 -1
- package/dist/{paths-BZO1jkK2.js → paths-Cpu0XgUj.js} +3 -3
- package/dist/{paths-DKuX7-1L.js → paths-aGRLvQx9.js} +5 -5
- package/dist/{pi-embedded-DiUmkZyz.js → pi-embedded-DE3hb87F.js} +178 -178
- package/dist/{pi-embedded-helpers-CuwhW4u9.js → pi-embedded-helpers-CMTVhLjq.js} +29 -29
- package/dist/{pi-model-discovery-COjkql-U.js → pi-model-discovery-DCIw1y1c.js} +7 -7
- package/dist/{plugins-D63QYxW6.js → plugins-CJoaoIHc.js} +11 -11
- package/dist/{proxy-jINniQBi.js → proxy-DfJJLvch.js} +1 -1
- package/dist/{proxy-env-vYAjKL5q.js → proxy-env-BnDt8j9F.js} +1 -1
- package/dist/{proxy-fetch-AvkSvetA.js → proxy-fetch-xlbVQYN_.js} +1 -1
- package/dist/{pw-ai-BLNiRUPI.js → pw-ai-DGwA7iCM.js} +17 -17
- package/dist/{qmd-manager-BBKfRzj-.js → qmd-manager-CeN3N992.js} +11 -11
- package/dist/{query-expansion-2BrixCA2.js → query-expansion-CGnW4Mk_.js} +5 -5
- package/dist/{redact-uUggP88O.js → redact-ScShueoF.js} +1 -1
- package/dist/{registry-C2GEGa2t.js → registry-CJCkqTms.js} +3 -3
- package/dist/{replies-yAf6dFeT.js → replies-BFYGUEKu.js} +3 -3
- package/dist/{reply-prefix-9mzt89Cf.js → reply-prefix-DK1i6bCJ.js} +1 -1
- package/dist/{resolve-route-BNElrVxR.js → resolve-route-C5hVstLo.js} +4 -4
- package/dist/{retry-Ayb7e4XG.js → retry-DTeP7C3h.js} +1 -1
- package/dist/{send-Bclgg0Ur.js → send-B4pSMBHk.js} +8 -8
- package/dist/{send-Bjaa69Cy.js → send-BqKSZyIb.js} +27 -27
- package/dist/{send-DYY51FOR.js → send-CN0f1Yst.js} +6 -6
- package/dist/{send-Cp0yQi_p.js → send-V3fEVmLq.js} +10 -10
- package/dist/{send-DQ7hIAIK.js → send-XAO1mk64.js} +7 -7
- package/dist/{session-meta-CyQWVUk4.js → session-meta-Cqv55kSk.js} +2 -2
- package/dist/{session-TVb8hgJP.js → session-xKPVUYQP.js} +9 -9
- package/dist/{sessions-3jroJwu7.js → sessions-CA_BydGA.js} +31 -31
- package/dist/{skill-commands-CSr9_48V.js → skill-commands-CZFmIM-s.js} +9 -9
- package/dist/{skills-B82IjVxn.js → skills-DMmr25nW.js} +22 -22
- package/dist/{store-DhC72KqW.js → store-C8KgeMt2.js} +2 -2
- package/dist/{subsystem-CAatx5oo.js → subsystem-BRjuJbbM.js} +14 -14
- package/dist/{tables-Bfh_TnCf.js → tables-BKnPZssn.js} +1 -1
- package/dist/{target-errors-CGYXYvSZ.js → target-errors-B9Jzop3d.js} +2 -2
- package/dist/{tokens-BvzZdrVJ.js → tokens-B9EDT4jv.js} +1 -1
- package/dist/{tool-images-CqsWnc1k.js → tool-images-ffdfBx0b.js} +2 -2
- package/dist/{tool-loop-detection-C4V990MS.js → tool-loop-detection-CLoYKYIq.js} +3 -3
- package/dist/{utils-Bo1RFF0l.js → utils-BFZnl-5N.js} +6 -6
- package/dist/{web-DsAoa63g.js → web-B2_c07KN.js} +69 -69
- package/dist/{whatsapp-actions-DXjy9m41.js → whatsapp-actions-CHt12z-f.js} +28 -28
- package/dist/{workspace-CswOYN9T.js → workspace-D6mrCnXi.js} +21 -21
- package/package.json +1 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { d as resolveSessionAgentId, r as resolveAgentConfig } from "./agent-scope-
|
|
2
|
-
import { a as resolveGatewayPort, n as STATE_DIR } from "./paths-
|
|
3
|
-
import { i as defaultRuntime, t as createSubsystemLogger } from "./subsystem-
|
|
1
|
+
import { d as resolveSessionAgentId, r as resolveAgentConfig } from "./agent-scope-C6hps0r3.js";
|
|
2
|
+
import { a as resolveGatewayPort, n as STATE_DIR } from "./paths-aGRLvQx9.js";
|
|
3
|
+
import { i as defaultRuntime, t as createSubsystemLogger } from "./subsystem-BRjuJbbM.js";
|
|
4
4
|
import { c as normalizeAgentId, u as resolveAgentIdFromSessionKey } from "./session-key-a6av96Fj.js";
|
|
5
|
-
import { S as truncateUtf16Safe, h as resolveUserPath } from "./utils-
|
|
6
|
-
import { D as resolvePathViaExistingAncestorSync, S as openBoundaryFile, a as DEFAULT_IDENTITY_FILENAME, c as DEFAULT_USER_FILENAME, i as DEFAULT_HEARTBEAT_FILENAME, l as ensureAgentWorkspace, n as DEFAULT_AGENT_WORKSPACE_DIR, o as DEFAULT_SOUL_FILENAME, r as DEFAULT_BOOTSTRAP_FILENAME, s as DEFAULT_TOOLS_FILENAME, t as DEFAULT_AGENTS_FILENAME, y as runExec } from "./workspace-
|
|
7
|
-
import { H as loadConfig, K as writeConfigFile, V as createConfigIO, it as getBlockedNetworkModeReason } from "./model-selection-
|
|
8
|
-
import { n as formatCliCommand } from "./env-
|
|
5
|
+
import { S as truncateUtf16Safe, h as resolveUserPath } from "./utils-BFZnl-5N.js";
|
|
6
|
+
import { D as resolvePathViaExistingAncestorSync, S as openBoundaryFile, a as DEFAULT_IDENTITY_FILENAME, c as DEFAULT_USER_FILENAME, i as DEFAULT_HEARTBEAT_FILENAME, l as ensureAgentWorkspace, n as DEFAULT_AGENT_WORKSPACE_DIR, o as DEFAULT_SOUL_FILENAME, r as DEFAULT_BOOTSTRAP_FILENAME, s as DEFAULT_TOOLS_FILENAME, t as DEFAULT_AGENTS_FILENAME, y as runExec } from "./workspace-D6mrCnXi.js";
|
|
7
|
+
import { H as loadConfig, K as writeConfigFile, V as createConfigIO, it as getBlockedNetworkModeReason } from "./model-selection-D_Si2Ict.js";
|
|
8
|
+
import { n as formatCliCommand } from "./env-DNMZEG57.js";
|
|
9
9
|
import { t as parseBooleanValue } from "./boolean-mcn6kL0s.js";
|
|
10
|
-
import { t as CHANNEL_IDS } from "./registry-
|
|
10
|
+
import { t as CHANNEL_IDS } from "./registry-CJCkqTms.js";
|
|
11
11
|
import { t as generateSecureToken } from "./secure-random-CY3Mg7Dp.js";
|
|
12
|
-
import { i as getImageMetadata, n as buildImageResizeSideGrid, s as resizeToJpeg, t as IMAGE_REDUCE_QUALITY_STEPS } from "./image-ops-
|
|
13
|
-
import { C as ensureChromeExtensionRelayServer, D as PROFILE_POST_RESTART_WS_TIMEOUT_MS, E as PROFILE_ATTACH_RETRY_TIMEOUT_MS, G as DEFAULT_BROWSER_EVALUATE_ENABLED, H as DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS, I as resolveWritablePathWithinRoot, J as DEFAULT_OPENCLAW_BROWSER_PROFILE_NAME, K as DEFAULT_OPENCLAW_BROWSER_COLOR, M as DEFAULT_TRACE_DIR, N as DEFAULT_UPLOAD_DIR, O as resolveCdpReachabilityTimeouts, P as resolveExistingPathsWithinRoot, R as normalizeBrowserFormField, T as CDP_JSON_NEW_TIMEOUT_MS, U as DEFAULT_AI_SNAPSHOT_MAX_CHARS, V as DEFAULT_AI_SNAPSHOT_EFFICIENT_DEPTH, W as DEFAULT_BROWSER_DEFAULT_PROFILE_NAME, _ as withBrowserNavigationPolicy, a as resolveOpenClawUserDataDir, b as fetchOk, c as resolveBrowserExecutableForPlatform, f as normalizeCdpWsUrl, g as assertBrowserNavigationResultAllowed, h as assertBrowserNavigationAllowed, i as launchOpenClawChrome, j as DEFAULT_DOWNLOAD_DIR, l as captureScreenshot, m as InvalidBrowserNavigationUrlError, n as isChromeCdpReady, o as stopOpenClawChrome, p as snapshotAria, q as DEFAULT_OPENCLAW_BROWSER_ENABLED, r as isChromeReachable, u as createTargetViaCdp, v as appendCdpPath, w as stopChromeExtensionRelayServer, y as fetchJson, z as isLoopbackHost } from "./chrome-
|
|
14
|
-
import { a as syncSkillsToWorkspace, l as resolveSandboxInputPath, m as sanitizeEnvVars, u as resolveSandboxPath } from "./skills-
|
|
15
|
-
import { t as PATH_ALIAS_POLICIES } from "./path-alias-guards-
|
|
16
|
-
import { n as extractErrorCode, r as formatErrorMessage } from "./errors-
|
|
17
|
-
import { n as SsrFBlockedError } from "./proxy-env-
|
|
18
|
-
import { i as saveMediaBuffer, n as ensureMediaDir } from "./store-
|
|
12
|
+
import { i as getImageMetadata, n as buildImageResizeSideGrid, s as resizeToJpeg, t as IMAGE_REDUCE_QUALITY_STEPS } from "./image-ops-DCpyia_K.js";
|
|
13
|
+
import { C as ensureChromeExtensionRelayServer, D as PROFILE_POST_RESTART_WS_TIMEOUT_MS, E as PROFILE_ATTACH_RETRY_TIMEOUT_MS, G as DEFAULT_BROWSER_EVALUATE_ENABLED, H as DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS, I as resolveWritablePathWithinRoot, J as DEFAULT_OPENCLAW_BROWSER_PROFILE_NAME, K as DEFAULT_OPENCLAW_BROWSER_COLOR, M as DEFAULT_TRACE_DIR, N as DEFAULT_UPLOAD_DIR, O as resolveCdpReachabilityTimeouts, P as resolveExistingPathsWithinRoot, R as normalizeBrowserFormField, T as CDP_JSON_NEW_TIMEOUT_MS, U as DEFAULT_AI_SNAPSHOT_MAX_CHARS, V as DEFAULT_AI_SNAPSHOT_EFFICIENT_DEPTH, W as DEFAULT_BROWSER_DEFAULT_PROFILE_NAME, _ as withBrowserNavigationPolicy, a as resolveOpenClawUserDataDir, b as fetchOk, c as resolveBrowserExecutableForPlatform, f as normalizeCdpWsUrl, g as assertBrowserNavigationResultAllowed, h as assertBrowserNavigationAllowed, i as launchOpenClawChrome, j as DEFAULT_DOWNLOAD_DIR, l as captureScreenshot, m as InvalidBrowserNavigationUrlError, n as isChromeCdpReady, o as stopOpenClawChrome, p as snapshotAria, q as DEFAULT_OPENCLAW_BROWSER_ENABLED, r as isChromeReachable, u as createTargetViaCdp, v as appendCdpPath, w as stopChromeExtensionRelayServer, y as fetchJson, z as isLoopbackHost } from "./chrome-CjTE-vWv.js";
|
|
14
|
+
import { a as syncSkillsToWorkspace, l as resolveSandboxInputPath, m as sanitizeEnvVars, u as resolveSandboxPath } from "./skills-DMmr25nW.js";
|
|
15
|
+
import { t as PATH_ALIAS_POLICIES } from "./path-alias-guards-CKjKIhQ3.js";
|
|
16
|
+
import { n as extractErrorCode, r as formatErrorMessage } from "./errors-DEkWxItM.js";
|
|
17
|
+
import { n as SsrFBlockedError } from "./proxy-env-BnDt8j9F.js";
|
|
18
|
+
import { i as saveMediaBuffer, n as ensureMediaDir } from "./store-C8KgeMt2.js";
|
|
19
19
|
import { n as resolveWindowsSpawnProgram, t as materializeWindowsSpawnProgram } from "./windows-spawn-BJZPhzR8.js";
|
|
20
20
|
import { r as writeJsonAtomic } from "./json-files-JTS4WE3P.js";
|
|
21
|
-
import { B as canonicalizeMainSessionAlias, K as acquireSessionWriteLock, V as resolveAgentMainSessionKey } from "./sessions-
|
|
22
|
-
import { t as sanitizeContentBlocksImages } from "./tool-images-
|
|
21
|
+
import { B as canonicalizeMainSessionAlias, K as acquireSessionWriteLock, V as resolveAgentMainSessionKey } from "./sessions-CA_BydGA.js";
|
|
22
|
+
import { t as sanitizeContentBlocksImages } from "./tool-images-ffdfBx0b.js";
|
|
23
23
|
import { o as normalizeThinkLevel } from "./thinking-FnAYAFD8.js";
|
|
24
24
|
import fs from "node:fs/promises";
|
|
25
25
|
import os from "node:os";
|
|
26
26
|
import path, { posix } from "node:path";
|
|
27
|
-
import
|
|
27
|
+
import syncFs, { existsSync } from "node:fs";
|
|
28
28
|
import { spawn } from "node:child_process";
|
|
29
29
|
import crypto, { createHash, timingSafeEqual } from "node:crypto";
|
|
30
30
|
import express from "express";
|
|
@@ -1192,7 +1192,7 @@ function isModuleNotFoundError(err) {
|
|
|
1192
1192
|
}
|
|
1193
1193
|
async function loadPwAiModule(mode) {
|
|
1194
1194
|
try {
|
|
1195
|
-
return await import("./pw-ai-
|
|
1195
|
+
return await import("./pw-ai-DGwA7iCM.js");
|
|
1196
1196
|
} catch (err) {
|
|
1197
1197
|
if (mode === "soft") return null;
|
|
1198
1198
|
if (isModuleNotFoundError(err)) return null;
|
|
@@ -2969,11 +2969,11 @@ async function movePathToTrash(targetPath) {
|
|
|
2969
2969
|
return targetPath;
|
|
2970
2970
|
} catch {
|
|
2971
2971
|
const trashDir = path.join(os.homedir(), ".Trash");
|
|
2972
|
-
|
|
2972
|
+
syncFs.mkdirSync(trashDir, { recursive: true });
|
|
2973
2973
|
const base = path.basename(targetPath);
|
|
2974
2974
|
let dest = path.join(trashDir, `${base}-${Date.now()}`);
|
|
2975
|
-
if (
|
|
2976
|
-
|
|
2975
|
+
if (syncFs.existsSync(dest)) dest = path.join(trashDir, `${base}-${Date.now()}-${generateSecureToken(6)}`);
|
|
2976
|
+
syncFs.renameSync(targetPath, dest);
|
|
2977
2977
|
return dest;
|
|
2978
2978
|
}
|
|
2979
2979
|
}
|
|
@@ -3060,7 +3060,7 @@ function createBrowserProfilesService(ctx) {
|
|
|
3060
3060
|
} catch {}
|
|
3061
3061
|
const userDataDir = resolveOpenClawUserDataDir(name);
|
|
3062
3062
|
const profileDir = path.dirname(userDataDir);
|
|
3063
|
-
if (
|
|
3063
|
+
if (syncFs.existsSync(profileDir)) {
|
|
3064
3064
|
await movePathToTrash(profileDir);
|
|
3065
3065
|
deleted = true;
|
|
3066
3066
|
}
|
|
@@ -3558,7 +3558,7 @@ function createProfileAvailability({ opts, profile, state, getProfileState, setP
|
|
|
3558
3558
|
//#region src/browser/server-context.reset.ts
|
|
3559
3559
|
async function closePlaywrightBrowserConnection() {
|
|
3560
3560
|
try {
|
|
3561
|
-
await (await import("./pw-ai-
|
|
3561
|
+
await (await import("./pw-ai-DGwA7iCM.js")).closePlaywrightBrowserConnection();
|
|
3562
3562
|
} catch {}
|
|
3563
3563
|
}
|
|
3564
3564
|
function createProfileResetOps({ profile, getProfileState, stopRunningBrowser, isHttpReachable, resolveOpenClawUserDataDir }) {
|
|
@@ -3576,7 +3576,7 @@ function createProfileResetOps({ profile, getProfileState, stopRunningBrowser, i
|
|
|
3576
3576
|
if (await isHttpReachable(300) && !profileState.running) await closePlaywrightBrowserConnection();
|
|
3577
3577
|
if (profileState.running) await stopRunningBrowser();
|
|
3578
3578
|
await closePlaywrightBrowserConnection();
|
|
3579
|
-
if (!
|
|
3579
|
+
if (!syncFs.existsSync(userDataDir)) return {
|
|
3580
3580
|
moved: false,
|
|
3581
3581
|
from: userDataDir
|
|
3582
3582
|
};
|
|
@@ -5635,7 +5635,7 @@ var SandboxFsBridgeImpl = class {
|
|
|
5635
5635
|
if (guarded.reason !== "path") {
|
|
5636
5636
|
if (!(options.allowedType === "directory" && this.pathIsExistingDirectory(target.hostPath))) throw guarded.error instanceof Error ? guarded.error : /* @__PURE__ */ new Error(`Sandbox boundary checks failed; cannot ${options.action}: ${target.containerPath}`);
|
|
5637
5637
|
}
|
|
5638
|
-
} else
|
|
5638
|
+
} else syncFs.closeSync(guarded.fd);
|
|
5639
5639
|
const canonicalContainerPath = await this.resolveCanonicalContainerPath({
|
|
5640
5640
|
containerPath: target.containerPath,
|
|
5641
5641
|
allowFinalSymlinkForUnlink: options.aliasPolicy?.allowFinalSymlinkForUnlink === true
|
|
@@ -5646,7 +5646,7 @@ var SandboxFsBridgeImpl = class {
|
|
|
5646
5646
|
}
|
|
5647
5647
|
pathIsExistingDirectory(hostPath) {
|
|
5648
5648
|
try {
|
|
5649
|
-
return
|
|
5649
|
+
return syncFs.statSync(hostPath).isDirectory();
|
|
5650
5650
|
} catch {
|
|
5651
5651
|
return false;
|
|
5652
5652
|
}
|
|
@@ -5914,13 +5914,13 @@ async function ensureSandboxWorkspace(workspaceDir, seedFrom, skipBootstrap) {
|
|
|
5914
5914
|
});
|
|
5915
5915
|
if (!opened.ok) continue;
|
|
5916
5916
|
try {
|
|
5917
|
-
const content =
|
|
5917
|
+
const content = syncFs.readFileSync(opened.fd, "utf-8");
|
|
5918
5918
|
await fs.writeFile(dest, content, {
|
|
5919
5919
|
encoding: "utf-8",
|
|
5920
5920
|
flag: "wx"
|
|
5921
5921
|
});
|
|
5922
5922
|
} finally {
|
|
5923
|
-
|
|
5923
|
+
syncFs.closeSync(opened.fd);
|
|
5924
5924
|
}
|
|
5925
5925
|
} catch {}
|
|
5926
5926
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { Dn as ensureAuthProfileStore, c as normalizeProviderId } from "./model-selection-
|
|
2
|
+
import { Dn as ensureAuthProfileStore, c as normalizeProviderId } from "./model-selection-D_Si2Ict.js";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import
|
|
4
|
+
import syncFs from "node:fs";
|
|
5
5
|
import * as PiCodingAgent from "@mariozechner/pi-coding-agent";
|
|
6
6
|
|
|
7
7
|
//#region src/agents/pi-auth-credentials.ts
|
|
@@ -70,10 +70,10 @@ function isRecord(value) {
|
|
|
70
70
|
}
|
|
71
71
|
function scrubLegacyStaticAuthJsonEntries(pathname) {
|
|
72
72
|
if (process.env.OPENCLAW_AUTH_STORE_READONLY === "1") return;
|
|
73
|
-
if (!
|
|
73
|
+
if (!syncFs.existsSync(pathname)) return;
|
|
74
74
|
let parsed;
|
|
75
75
|
try {
|
|
76
|
-
parsed = JSON.parse(
|
|
76
|
+
parsed = JSON.parse(syncFs.readFileSync(pathname, "utf8"));
|
|
77
77
|
} catch {
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
@@ -87,11 +87,11 @@ function scrubLegacyStaticAuthJsonEntries(pathname) {
|
|
|
87
87
|
}
|
|
88
88
|
if (!changed) return;
|
|
89
89
|
if (Object.keys(parsed).length === 0) {
|
|
90
|
-
|
|
90
|
+
syncFs.rmSync(pathname, { force: true });
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
syncFs.writeFileSync(pathname, `${JSON.stringify(parsed, null, 2)}\n`, "utf8");
|
|
94
|
+
syncFs.chmodSync(pathname, 384);
|
|
95
95
|
}
|
|
96
96
|
function createAuthStorage(AuthStorageLike, path, creds) {
|
|
97
97
|
const withInMemory = AuthStorageLike;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { t as createSubsystemLogger } from "./subsystem-
|
|
1
|
+
import { t as createSubsystemLogger } from "./subsystem-BRjuJbbM.js";
|
|
2
2
|
import { h as normalizeOptionalAccountId, m as normalizeAccountId, p as DEFAULT_ACCOUNT_ID } from "./session-key-a6av96Fj.js";
|
|
3
|
-
import { d as normalizeE164 } from "./utils-
|
|
4
|
-
import { t as isTruthyEnvValue } from "./env-
|
|
5
|
-
import { a as normalizeAnyChannelId, d as requireActivePluginRegistry, n as CHAT_CHANNEL_ORDER, u as getActivePluginRegistryVersion } from "./registry-
|
|
6
|
-
import { h as createAccountListHelpers } from "./accounts-
|
|
3
|
+
import { d as normalizeE164 } from "./utils-BFZnl-5N.js";
|
|
4
|
+
import { t as isTruthyEnvValue } from "./env-DNMZEG57.js";
|
|
5
|
+
import { a as normalizeAnyChannelId, d as requireActivePluginRegistry, n as CHAT_CHANNEL_ORDER, u as getActivePluginRegistryVersion } from "./registry-CJCkqTms.js";
|
|
6
|
+
import { h as createAccountListHelpers } from "./accounts-ubG6irXZ.js";
|
|
7
7
|
import { t as resolveAccountEntry } from "./account-lookup-JrULBwdR.js";
|
|
8
8
|
import { t as normalizeChatType } from "./chat-type-DKb2TlGZ.js";
|
|
9
|
-
import { i as resolveDefaultAgentBoundAccountId, r as listBoundAccountIds } from "./bindings-
|
|
10
|
-
import
|
|
9
|
+
import { i as resolveDefaultAgentBoundAccountId, r as listBoundAccountIds } from "./bindings-CsIiIjqN.js";
|
|
10
|
+
import syncFs from "node:fs";
|
|
11
11
|
import util from "node:util";
|
|
12
12
|
|
|
13
13
|
//#region src/channels/plugins/account-action-gate.ts
|
|
@@ -218,7 +218,7 @@ function resolveTelegramToken(cfg, opts = {}) {
|
|
|
218
218
|
const accountCfg = resolveAccountCfg(accountId !== DEFAULT_ACCOUNT_ID ? accountId : DEFAULT_ACCOUNT_ID);
|
|
219
219
|
const accountTokenFile = accountCfg?.tokenFile?.trim();
|
|
220
220
|
if (accountTokenFile) {
|
|
221
|
-
if (!
|
|
221
|
+
if (!syncFs.existsSync(accountTokenFile)) {
|
|
222
222
|
opts.logMissingFile?.(`channels.telegram.accounts.${accountId}.tokenFile not found: ${accountTokenFile}`);
|
|
223
223
|
return {
|
|
224
224
|
token: "",
|
|
@@ -226,7 +226,7 @@ function resolveTelegramToken(cfg, opts = {}) {
|
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
228
|
try {
|
|
229
|
-
const token =
|
|
229
|
+
const token = syncFs.readFileSync(accountTokenFile, "utf-8").trim();
|
|
230
230
|
if (token) return {
|
|
231
231
|
token,
|
|
232
232
|
source: "tokenFile"
|
|
@@ -251,7 +251,7 @@ function resolveTelegramToken(cfg, opts = {}) {
|
|
|
251
251
|
const allowEnv = accountId === DEFAULT_ACCOUNT_ID;
|
|
252
252
|
const tokenFile = telegramCfg?.tokenFile?.trim();
|
|
253
253
|
if (tokenFile && allowEnv) {
|
|
254
|
-
if (!
|
|
254
|
+
if (!syncFs.existsSync(tokenFile)) {
|
|
255
255
|
opts.logMissingFile?.(`channels.telegram.tokenFile not found: ${tokenFile}`);
|
|
256
256
|
return {
|
|
257
257
|
token: "",
|
|
@@ -259,7 +259,7 @@ function resolveTelegramToken(cfg, opts = {}) {
|
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
261
|
try {
|
|
262
|
-
const token =
|
|
262
|
+
const token = syncFs.readFileSync(tokenFile, "utf-8").trim();
|
|
263
263
|
if (token) return {
|
|
264
264
|
token,
|
|
265
265
|
source: "tokenFile"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { t as makeProxyFetch } from "./proxy-fetch-
|
|
2
|
+
import { t as makeProxyFetch } from "./proxy-fetch-xlbVQYN_.js";
|
|
3
3
|
|
|
4
4
|
//#region src/telegram/proxy.ts
|
|
5
5
|
var proxy_exports = /* @__PURE__ */ __exportAll({ makeProxyFetch: () => makeProxyFetch });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _t as parseLooseIpAddress, ct as isBlockedSpecialUseIpv4Address, dt as isIpv4Address, ft as isLegacyIpv4Literal, gt as parseCanonicalIpAddress, lt as isBlockedSpecialUseIpv6Address, st as extractEmbeddedIpv4FromIpv6, ut as isCanonicalDottedDecimalIPv4 } from "./model-selection-
|
|
1
|
+
import { _t as parseLooseIpAddress, ct as isBlockedSpecialUseIpv4Address, dt as isIpv4Address, ft as isLegacyIpv4Literal, gt as parseCanonicalIpAddress, lt as isBlockedSpecialUseIpv6Address, st as extractEmbeddedIpv4FromIpv6, ut as isCanonicalDottedDecimalIPv4 } from "./model-selection-D_Si2Ict.js";
|
|
2
2
|
import { lookup } from "node:dns";
|
|
3
3
|
import { lookup as lookup$1 } from "node:dns/promises";
|
|
4
4
|
import { Agent } from "undici";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import "./agent-scope-
|
|
2
|
-
import "./paths-
|
|
3
|
-
import { w as resolvePreferredOpenClawTmpDir } from "./subsystem-
|
|
4
|
-
import "./utils-
|
|
5
|
-
import "./workspace-
|
|
6
|
-
import "./logger-
|
|
7
|
-
import "./model-selection-
|
|
8
|
-
import "./github-copilot-token-
|
|
9
|
-
import { n as formatCliCommand } from "./env-
|
|
1
|
+
import "./agent-scope-C6hps0r3.js";
|
|
2
|
+
import "./paths-aGRLvQx9.js";
|
|
3
|
+
import { w as resolvePreferredOpenClawTmpDir } from "./subsystem-BRjuJbbM.js";
|
|
4
|
+
import "./utils-BFZnl-5N.js";
|
|
5
|
+
import "./workspace-D6mrCnXi.js";
|
|
6
|
+
import "./logger-BlH5MJiV.js";
|
|
7
|
+
import "./model-selection-D_Si2Ict.js";
|
|
8
|
+
import "./github-copilot-token-DLGN-8YS.js";
|
|
9
|
+
import { n as formatCliCommand } from "./env-DNMZEG57.js";
|
|
10
10
|
import "./boolean-mcn6kL0s.js";
|
|
11
|
-
import "./internal-hooks-
|
|
12
|
-
import "./registry-
|
|
13
|
-
import { F as resolveStrictExistingPathsWithinRoot, L as DEFAULT_FILL_FIELD_TYPE, M as DEFAULT_TRACE_DIR, N as DEFAULT_UPLOAD_DIR, S as withCdpSocket, _ as withBrowserNavigationPolicy, d as formatAriaSnapshot, f as normalizeCdpWsUrl, g as assertBrowserNavigationResultAllowed, h as assertBrowserNavigationAllowed, j as DEFAULT_DOWNLOAD_DIR, k as withNoProxyForCdpUrl, t as getChromeWebSocketUrl, v as appendCdpPath, x as getHeadersWithAuth, y as fetchJson } from "./chrome-
|
|
14
|
-
import "./path-alias-guards-
|
|
15
|
-
import "./redact-
|
|
16
|
-
import { r as formatErrorMessage } from "./errors-
|
|
17
|
-
import { s as writeFileFromPathWithinRoot } from "./fs-safe-
|
|
18
|
-
import "./proxy-env-
|
|
11
|
+
import "./internal-hooks-yQe6H47q.js";
|
|
12
|
+
import "./registry-CJCkqTms.js";
|
|
13
|
+
import { F as resolveStrictExistingPathsWithinRoot, L as DEFAULT_FILL_FIELD_TYPE, M as DEFAULT_TRACE_DIR, N as DEFAULT_UPLOAD_DIR, S as withCdpSocket, _ as withBrowserNavigationPolicy, d as formatAriaSnapshot, f as normalizeCdpWsUrl, g as assertBrowserNavigationResultAllowed, h as assertBrowserNavigationAllowed, j as DEFAULT_DOWNLOAD_DIR, k as withNoProxyForCdpUrl, t as getChromeWebSocketUrl, v as appendCdpPath, x as getHeadersWithAuth, y as fetchJson } from "./chrome-CjTE-vWv.js";
|
|
14
|
+
import "./path-alias-guards-CKjKIhQ3.js";
|
|
15
|
+
import "./redact-ScShueoF.js";
|
|
16
|
+
import { r as formatErrorMessage } from "./errors-DEkWxItM.js";
|
|
17
|
+
import { s as writeFileFromPathWithinRoot } from "./fs-safe-D8x_nIIA.js";
|
|
18
|
+
import "./proxy-env-BnDt8j9F.js";
|
|
19
19
|
import fs from "node:fs/promises";
|
|
20
20
|
import path from "node:path";
|
|
21
21
|
import crypto from "node:crypto";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { s as resolveAgentWorkspaceDir } from "./agent-scope-
|
|
2
|
-
import { c as resolveStateDir } from "./paths-
|
|
3
|
-
import { t as createSubsystemLogger } from "./subsystem-
|
|
1
|
+
import { s as resolveAgentWorkspaceDir } from "./agent-scope-C6hps0r3.js";
|
|
2
|
+
import { c as resolveStateDir } from "./paths-aGRLvQx9.js";
|
|
3
|
+
import { t as createSubsystemLogger } from "./subsystem-BRjuJbbM.js";
|
|
4
4
|
import { S as parseAgentSessionKey } from "./session-key-a6av96Fj.js";
|
|
5
|
-
import "./utils-
|
|
6
|
-
import "./workspace-
|
|
7
|
-
import "./logger-
|
|
8
|
-
import "./path-alias-guards-
|
|
9
|
-
import "./redact-
|
|
10
|
-
import { c as writeFileWithinRoot } from "./fs-safe-
|
|
5
|
+
import "./utils-BFZnl-5N.js";
|
|
6
|
+
import "./workspace-D6mrCnXi.js";
|
|
7
|
+
import "./logger-BlH5MJiV.js";
|
|
8
|
+
import "./path-alias-guards-CKjKIhQ3.js";
|
|
9
|
+
import "./redact-ScShueoF.js";
|
|
10
|
+
import { c as writeFileWithinRoot } from "./fs-safe-D8x_nIIA.js";
|
|
11
11
|
import { n as resolveWindowsSpawnProgram, t as materializeWindowsSpawnProgram } from "./windows-spawn-BJZPhzR8.js";
|
|
12
|
-
import "./paths-
|
|
13
|
-
import { _ as isFileMissingError, i as listSessionFilesForAgent, n as requireNodeSqlite, r as buildSessionEntry, t as extractKeywords, v as statRegularFile } from "./query-expansion-
|
|
12
|
+
import "./paths-Cpu0XgUj.js";
|
|
13
|
+
import { _ as isFileMissingError, i as listSessionFilesForAgent, n as requireNodeSqlite, r as buildSessionEntry, t as extractKeywords, v as statRegularFile } from "./query-expansion-CGnW4Mk_.js";
|
|
14
14
|
import fs from "node:fs/promises";
|
|
15
15
|
import os from "node:os";
|
|
16
16
|
import path from "node:path";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as createSubsystemLogger } from "./subsystem-
|
|
1
|
+
import { t as createSubsystemLogger } from "./subsystem-BRjuJbbM.js";
|
|
2
2
|
import { t as runTasksWithConcurrency } from "./run-with-concurrency-NY-gTuzr.js";
|
|
3
|
-
import { t as redactSensitiveText } from "./redact-
|
|
4
|
-
import { o as resolveSessionTranscriptsDirForAgent } from "./paths-
|
|
3
|
+
import { t as redactSensitiveText } from "./redact-ScShueoF.js";
|
|
4
|
+
import { o as resolveSessionTranscriptsDirForAgent } from "./paths-Cpu0XgUj.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import fs from "node:fs/promises";
|
|
7
7
|
import path from "node:path";
|
|
8
|
-
import
|
|
8
|
+
import syncFs from "node:fs";
|
|
9
9
|
import crypto from "node:crypto";
|
|
10
10
|
|
|
11
11
|
//#region src/memory/fs-utils.ts
|
|
@@ -31,7 +31,7 @@ async function statRegularFile(absPath) {
|
|
|
31
31
|
//#region src/memory/internal.ts
|
|
32
32
|
function ensureDir(dir) {
|
|
33
33
|
try {
|
|
34
|
-
|
|
34
|
+
syncFs.mkdirSync(dir, { recursive: true });
|
|
35
35
|
} catch {}
|
|
36
36
|
return dir;
|
|
37
37
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { u as logVerbose } from "./subsystem-
|
|
2
|
-
import { h as resolveUserPath } from "./utils-
|
|
3
|
-
import { i as registerInternalHook } from "./internal-hooks-
|
|
1
|
+
import { u as logVerbose } from "./subsystem-BRjuJbbM.js";
|
|
2
|
+
import { h as resolveUserPath } from "./utils-BFZnl-5N.js";
|
|
3
|
+
import { i as registerInternalHook } from "./internal-hooks-yQe6H47q.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
|
|
6
6
|
//#region src/plugins/commands.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { i as isSilentReplyText, n as SILENT_REPLY_TOKEN } from "./tokens-
|
|
3
|
-
import { r as markdownToSlackMrkdwnChunks, t as sendMessageSlack } from "./send-
|
|
4
|
-
import { i as chunkMarkdownTextWithMode } from "./chunk-
|
|
2
|
+
import { i as isSilentReplyText, n as SILENT_REPLY_TOKEN } from "./tokens-B9EDT4jv.js";
|
|
3
|
+
import { r as markdownToSlackMrkdwnChunks, t as sendMessageSlack } from "./send-B4pSMBHk.js";
|
|
4
|
+
import { i as chunkMarkdownTextWithMode } from "./chunk-DtYb6TYl.js";
|
|
5
5
|
|
|
6
6
|
//#region src/auto-reply/reply/reply-reference.ts
|
|
7
7
|
function createReplyReferencePlanner(options) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { r as resolveAgentConfig } from "./agent-scope-
|
|
2
|
+
import { r as resolveAgentConfig } from "./agent-scope-C6hps0r3.js";
|
|
3
3
|
|
|
4
4
|
//#region src/agents/identity.ts
|
|
5
5
|
const DEFAULT_ACK_REACTION = "👀";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { c as resolveDefaultAgentId } from "./agent-scope-
|
|
3
|
-
import { p as shouldLogVerbose } from "./subsystem-
|
|
2
|
+
import { c as resolveDefaultAgentId } from "./agent-scope-C6hps0r3.js";
|
|
3
|
+
import { p as shouldLogVerbose } from "./subsystem-BRjuJbbM.js";
|
|
4
4
|
import { c as normalizeAgentId, f as sanitizeAgentId, i as buildAgentPeerSessionKey, m as normalizeAccountId, n as DEFAULT_MAIN_KEY, p as DEFAULT_ACCOUNT_ID, r as buildAgentMainSessionKey, t as DEFAULT_AGENT_ID } from "./session-key-a6av96Fj.js";
|
|
5
|
-
import { t as logDebug } from "./logger-
|
|
5
|
+
import { t as logDebug } from "./logger-BlH5MJiV.js";
|
|
6
6
|
import { t as normalizeChatType } from "./chat-type-DKb2TlGZ.js";
|
|
7
|
-
import { n as listBindings } from "./bindings-
|
|
7
|
+
import { n as listBindings } from "./bindings-CsIiIjqN.js";
|
|
8
8
|
|
|
9
9
|
//#region src/routing/resolve-route.ts
|
|
10
10
|
var resolve_route_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { u as logVerbose } from "./subsystem-
|
|
3
|
-
import { H as loadConfig } from "./model-selection-
|
|
4
|
-
import { i as isSilentReplyText } from "./tokens-
|
|
5
|
-
import { d as resolveSlackAccount, m as resolveSlackBotToken } from "./plugins-
|
|
2
|
+
import { u as logVerbose } from "./subsystem-BRjuJbbM.js";
|
|
3
|
+
import { H as loadConfig } from "./model-selection-D_Si2Ict.js";
|
|
4
|
+
import { i as isSilentReplyText } from "./tokens-B9EDT4jv.js";
|
|
5
|
+
import { d as resolveSlackAccount, m as resolveSlackBotToken } from "./plugins-CJoaoIHc.js";
|
|
6
6
|
import { i as requireTargetKind, n as ensureTargetId, r as parseMentionPrefixOrAtUserTarget, t as buildMessagingTarget } from "./targets-Ci42d9xO.js";
|
|
7
|
-
import { r as withTrustedEnvProxyGuardedFetchMode, t as fetchWithSsrFGuard } from "./fetch-guard-
|
|
8
|
-
import { c as resolveChunkMode, i as chunkMarkdownTextWithMode, l as resolveTextChunkLimit } from "./chunk-
|
|
9
|
-
import { n as resolveMarkdownTableMode } from "./markdown-tables-
|
|
10
|
-
import { a as loadWebMedia, n as markdownToIR, t as chunkMarkdownIR } from "./ir-
|
|
7
|
+
import { r as withTrustedEnvProxyGuardedFetchMode, t as fetchWithSsrFGuard } from "./fetch-guard-CNvY0vzQ.js";
|
|
8
|
+
import { c as resolveChunkMode, i as chunkMarkdownTextWithMode, l as resolveTextChunkLimit } from "./chunk-DtYb6TYl.js";
|
|
9
|
+
import { n as resolveMarkdownTableMode } from "./markdown-tables-BHONoo6S.js";
|
|
10
|
+
import { a as loadWebMedia, n as markdownToIR, t as chunkMarkdownIR } from "./ir-BZUjdf-6.js";
|
|
11
11
|
import { t as renderMarkdownWithMarkers } from "./render-flG67HhW.js";
|
|
12
12
|
import { WebClient } from "@slack/web-api";
|
|
13
13
|
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { c as resolveStateDir, d as resolveRequiredHomeDir, l as expandHomePrefix, o as resolveOAuthDir } from "./paths-
|
|
3
|
-
import { c as danger, t as createSubsystemLogger, u as logVerbose } from "./subsystem-
|
|
2
|
+
import { c as resolveStateDir, d as resolveRequiredHomeDir, l as expandHomePrefix, o as resolveOAuthDir } from "./paths-aGRLvQx9.js";
|
|
3
|
+
import { c as danger, t as createSubsystemLogger, u as logVerbose } from "./subsystem-BRjuJbbM.js";
|
|
4
4
|
import { m as normalizeAccountId, p as DEFAULT_ACCOUNT_ID } from "./session-key-a6av96Fj.js";
|
|
5
|
-
import { g as safeParseJson, t as CONFIG_DIR } from "./utils-
|
|
6
|
-
import { An as withFileLock$1, H as loadConfig, K as writeConfigFile, W as readConfigFileSnapshotForWrite, mn as resolveTelegramPreviewStreamMode } from "./model-selection-
|
|
7
|
-
import { t as isTruthyEnvValue } from "./env-
|
|
8
|
-
import { l as resolveTelegramAccount, n as listChannelPlugins, t as getChannelPlugin } from "./plugins-
|
|
9
|
-
import { h as normalizeMimeType, m as kindFromMime, p as isGifMedia, u as getFileExtension } from "./image-ops-
|
|
10
|
-
import { t as redactSensitiveText } from "./redact-
|
|
11
|
-
import { i as formatUncaughtError, n as extractErrorCode, o as readErrorName, r as formatErrorMessage, t as collectErrorGraphCandidates } from "./errors-
|
|
12
|
-
import { t as hasProxyEnvConfigured } from "./proxy-env-
|
|
5
|
+
import { g as safeParseJson, t as CONFIG_DIR } from "./utils-BFZnl-5N.js";
|
|
6
|
+
import { An as withFileLock$1, H as loadConfig, K as writeConfigFile, W as readConfigFileSnapshotForWrite, mn as resolveTelegramPreviewStreamMode } from "./model-selection-D_Si2Ict.js";
|
|
7
|
+
import { t as isTruthyEnvValue } from "./env-DNMZEG57.js";
|
|
8
|
+
import { l as resolveTelegramAccount, n as listChannelPlugins, t as getChannelPlugin } from "./plugins-CJoaoIHc.js";
|
|
9
|
+
import { h as normalizeMimeType, m as kindFromMime, p as isGifMedia, u as getFileExtension } from "./image-ops-DCpyia_K.js";
|
|
10
|
+
import { t as redactSensitiveText } from "./redact-ScShueoF.js";
|
|
11
|
+
import { i as formatUncaughtError, n as extractErrorCode, o as readErrorName, r as formatErrorMessage, t as collectErrorGraphCandidates } from "./errors-DEkWxItM.js";
|
|
12
|
+
import { t as hasProxyEnvConfigured } from "./proxy-env-BnDt8j9F.js";
|
|
13
13
|
import { r as writeJsonAtomic } from "./json-files-JTS4WE3P.js";
|
|
14
|
-
import { t as makeProxyFetch } from "./proxy-fetch-
|
|
15
|
-
import { n as resolveMarkdownTableMode } from "./markdown-tables-
|
|
16
|
-
import { a as loadWebMedia, n as markdownToIR, t as chunkMarkdownIR } from "./ir-
|
|
14
|
+
import { t as makeProxyFetch } from "./proxy-fetch-xlbVQYN_.js";
|
|
15
|
+
import { n as resolveMarkdownTableMode } from "./markdown-tables-BHONoo6S.js";
|
|
16
|
+
import { a as loadWebMedia, n as markdownToIR, t as chunkMarkdownIR } from "./ir-BZUjdf-6.js";
|
|
17
17
|
import { t as renderMarkdownWithMarkers } from "./render-flG67HhW.js";
|
|
18
18
|
import { t as resolveFetch } from "./fetch-CIXnD4u2.js";
|
|
19
|
-
import { i as createTelegramRetryRunner, n as recordChannelActivity } from "./channel-activity-
|
|
19
|
+
import { i as createTelegramRetryRunner, n as recordChannelActivity } from "./channel-activity-D81g48kD.js";
|
|
20
20
|
import { t as buildOutboundMediaLoadOptions } from "./load-options-xFTRYZAO.js";
|
|
21
21
|
import { n as normalizePollInput } from "./polls-an_kOejR.js";
|
|
22
22
|
import fs from "node:fs/promises";
|
|
23
23
|
import os from "node:os";
|
|
24
24
|
import path from "node:path";
|
|
25
|
-
import
|
|
25
|
+
import syncFs, { readFileSync } from "node:fs";
|
|
26
26
|
import JSON5 from "json5";
|
|
27
27
|
import process$1 from "node:process";
|
|
28
28
|
import crypto, { randomBytes } from "node:crypto";
|
|
@@ -161,7 +161,7 @@ function getPairingAdapter(channelId) {
|
|
|
161
161
|
//#region src/plugin-sdk/json-store.ts
|
|
162
162
|
async function readJsonFileWithFallback(filePath, fallback) {
|
|
163
163
|
try {
|
|
164
|
-
const parsed = safeParseJson(await
|
|
164
|
+
const parsed = safeParseJson(await syncFs.promises.readFile(filePath, "utf-8"));
|
|
165
165
|
if (parsed == null) return {
|
|
166
166
|
value: fallback,
|
|
167
167
|
exists: true
|
|
@@ -248,7 +248,7 @@ async function readPairingRequests(filePath) {
|
|
|
248
248
|
}
|
|
249
249
|
async function ensureJsonFile(filePath, fallback) {
|
|
250
250
|
try {
|
|
251
|
-
await
|
|
251
|
+
await syncFs.promises.access(filePath);
|
|
252
252
|
} catch {
|
|
253
253
|
await writeJsonFile(filePath, fallback);
|
|
254
254
|
}
|
|
@@ -404,7 +404,7 @@ function resolveAllowFromReadCacheOrMissing(filePath, stat) {
|
|
|
404
404
|
async function readAllowFromStateForPathWithExists(channel, filePath) {
|
|
405
405
|
let stat = null;
|
|
406
406
|
try {
|
|
407
|
-
stat = await
|
|
407
|
+
stat = await syncFs.promises.stat(filePath);
|
|
408
408
|
} catch (err) {
|
|
409
409
|
if (err.code !== "ENOENT") throw err;
|
|
410
410
|
}
|
|
@@ -447,7 +447,7 @@ async function writeAllowFromState(filePath, allowFrom) {
|
|
|
447
447
|
});
|
|
448
448
|
let stat = null;
|
|
449
449
|
try {
|
|
450
|
-
stat = await
|
|
450
|
+
stat = await syncFs.promises.stat(filePath);
|
|
451
451
|
} catch {}
|
|
452
452
|
setAllowFromReadCache(filePath, {
|
|
453
453
|
exists: true,
|
|
@@ -1054,7 +1054,7 @@ function resolveCronStorePath(storePath) {
|
|
|
1054
1054
|
}
|
|
1055
1055
|
async function loadCronStore(storePath) {
|
|
1056
1056
|
try {
|
|
1057
|
-
const raw = await
|
|
1057
|
+
const raw = await syncFs.promises.readFile(storePath, "utf-8");
|
|
1058
1058
|
let parsed;
|
|
1059
1059
|
try {
|
|
1060
1060
|
parsed = JSON5.parse(raw);
|
|
@@ -1080,13 +1080,13 @@ async function loadCronStore(storePath) {
|
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
1082
|
async function saveCronStore(storePath, store) {
|
|
1083
|
-
await
|
|
1083
|
+
await syncFs.promises.mkdir(path.dirname(storePath), { recursive: true });
|
|
1084
1084
|
const json = JSON.stringify(store, null, 2);
|
|
1085
1085
|
const cached = serializedStoreCache.get(storePath);
|
|
1086
1086
|
if (cached === json) return;
|
|
1087
1087
|
let previous = cached ?? null;
|
|
1088
1088
|
if (previous === null) try {
|
|
1089
|
-
previous = await
|
|
1089
|
+
previous = await syncFs.promises.readFile(storePath, "utf-8");
|
|
1090
1090
|
} catch (err) {
|
|
1091
1091
|
if (err.code !== "ENOENT") throw err;
|
|
1092
1092
|
}
|
|
@@ -1095,9 +1095,9 @@ async function saveCronStore(storePath, store) {
|
|
|
1095
1095
|
return;
|
|
1096
1096
|
}
|
|
1097
1097
|
const tmp = `${storePath}.${process.pid}.${randomBytes(8).toString("hex")}.tmp`;
|
|
1098
|
-
await
|
|
1098
|
+
await syncFs.promises.writeFile(tmp, json, "utf-8");
|
|
1099
1099
|
if (previous !== null) try {
|
|
1100
|
-
await
|
|
1100
|
+
await syncFs.promises.copyFile(storePath, `${storePath}.bak`);
|
|
1101
1101
|
} catch {}
|
|
1102
1102
|
await renameWithRetry(tmp, storePath);
|
|
1103
1103
|
serializedStoreCache.set(storePath, json);
|
|
@@ -1106,7 +1106,7 @@ const RENAME_MAX_RETRIES = 3;
|
|
|
1106
1106
|
const RENAME_BASE_DELAY_MS = 50;
|
|
1107
1107
|
async function renameWithRetry(src, dest) {
|
|
1108
1108
|
for (let attempt = 0; attempt <= RENAME_MAX_RETRIES; attempt++) try {
|
|
1109
|
-
await
|
|
1109
|
+
await syncFs.promises.rename(src, dest);
|
|
1110
1110
|
return;
|
|
1111
1111
|
} catch (err) {
|
|
1112
1112
|
const code = err.code;
|
|
@@ -1115,8 +1115,8 @@ async function renameWithRetry(src, dest) {
|
|
|
1115
1115
|
continue;
|
|
1116
1116
|
}
|
|
1117
1117
|
if (code === "EPERM" || code === "EEXIST") {
|
|
1118
|
-
await
|
|
1119
|
-
await
|
|
1118
|
+
await syncFs.promises.copyFile(src, dest);
|
|
1119
|
+
await syncFs.promises.unlink(src).catch(() => {});
|
|
1120
1120
|
return;
|
|
1121
1121
|
}
|
|
1122
1122
|
throw err;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { H as loadConfig } from "./model-selection-
|
|
2
|
+
import { H as loadConfig } from "./model-selection-D_Si2Ict.js";
|
|
3
3
|
import { n as generateSecureUuid } from "./secure-random-CY3Mg7Dp.js";
|
|
4
|
-
import { n as resolveSignalAccount } from "./accounts-
|
|
5
|
-
import { m as kindFromMime } from "./image-ops-
|
|
4
|
+
import { n as resolveSignalAccount } from "./accounts-BTexwKe8.js";
|
|
5
|
+
import { m as kindFromMime } from "./image-ops-DCpyia_K.js";
|
|
6
6
|
import { n as fetchWithTimeout } from "./fetch-timeout-CYFFedEH.js";
|
|
7
|
-
import { n as resolveMarkdownTableMode } from "./markdown-tables-
|
|
8
|
-
import { n as markdownToIR, t as chunkMarkdownIR } from "./ir-
|
|
7
|
+
import { n as resolveMarkdownTableMode } from "./markdown-tables-BHONoo6S.js";
|
|
8
|
+
import { n as markdownToIR, t as chunkMarkdownIR } from "./ir-BZUjdf-6.js";
|
|
9
9
|
import { t as resolveFetch } from "./fetch-CIXnD4u2.js";
|
|
10
|
-
import { t as resolveOutboundAttachmentFromUrl } from "./outbound-attachment-
|
|
10
|
+
import { t as resolveOutboundAttachmentFromUrl } from "./outbound-attachment-C7sJLSnv.js";
|
|
11
11
|
|
|
12
12
|
//#region src/signal/format.ts
|
|
13
13
|
function normalizeUrlForComparison(url) {
|