cclawd 1.0.7 → 1.0.8
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/{active-listener-DYmI7imH.js → active-listener-Dkhmfuwx.js} +2 -2
- package/dist/{api-key-rotation-DLU4jvSu.js → api-key-rotation-BOfI3cG3.js} +1 -1
- package/dist/{audio-preflight-C9TMbRb4.js → audio-preflight-CtkZ5SAs.js} +15 -15
- package/dist/{audio-transcription-runner-Q5zG_hYd.js → audio-transcription-runner-CbPqoiHX.js} +10 -10
- package/dist/{audit-membership-runtime-DhxSwFnF.js → audit-membership-runtime-hXUuer4x.js} +6 -6
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +35 -35
- package/dist/bundled/bootstrap-extra-files/handler.js +5 -5
- package/dist/bundled/command-logger/handler.js +2 -2
- package/dist/bundled/session-memory/handler.js +35 -35
- package/dist/{channel-activity-Bx08UTAg.js → channel-activity-DWAER4wd.js} +2 -2
- package/dist/{commands-registry-llLVCTH9.js → commands-registry-BUyiA7nE.js} +2 -2
- package/dist/compact.runtime-DpcZpcTl.js +39 -0
- package/dist/{deliver-DJf2ZBpe.js → deliver-aHOaRbkt.js} +19 -19
- package/dist/deliver-runtime-D4bCsr6d.js +19 -0
- package/dist/deps-send-discord.runtime-BziKU-pE.js +19 -0
- package/dist/deps-send-imessage.runtime-CFRnDTqp.js +18 -0
- package/dist/deps-send-signal.runtime-BuOtABJm.js +17 -0
- package/dist/deps-send-slack.runtime-BOLqvMxW.js +17 -0
- package/dist/deps-send-telegram.runtime-DeEoFLv5.js +20 -0
- package/dist/deps-send-whatsapp.runtime-CG1uXYLY.js +43 -0
- package/dist/{diagnostic-BCCMF3O_.js → diagnostic-BdcXX9iJ.js} +2 -2
- package/dist/{env-aYXLHjfZ.js → env-lw2hsIUY.js} +1 -1
- package/dist/{fetch-bvgIiupu.js → fetch-C0iyt-Iz.js} +3 -3
- package/dist/{fetch-DCTUdr1U.js → fetch-D9NUULbj.js} +5 -5
- package/dist/{fetch-guard-CqpEmMQ2.js → fetch-guard-B5ZMnGaN.js} +2 -2
- package/dist/{frontmatter-DjZuS525.js → frontmatter-C_obXuTp.js} +3 -3
- package/dist/{github-copilot-token-CQmATy5E.js → github-copilot-token-8N63GdbE.js} +7 -7
- package/dist/{image-Q8E1-lZn.js → image-4x07m4Jl.js} +4 -4
- package/dist/image-runtime-smkMrIol.js +12 -0
- package/dist/{ir-CzM3SxId.js → ir-CsgNUpOU.js} +6 -6
- package/dist/llm-slug-generator.js +35 -35
- package/dist/{logger-ChbX1G7s.js → logger-CbUVl62f.js} +7 -7
- package/dist/{login-B0mtU11X.js → login-p_O59TVQ.js} +4 -4
- package/dist/{login-qr-DY_i60f5.js → login-qr-BCJpDsAy.js} +10 -10
- package/dist/{manager-FAQPC0uO.js → manager-CwYv8O3T.js} +12 -12
- package/dist/manager-runtime-D_jEoBr9.js +15 -0
- package/dist/{model-selection-wf3OY5DX.js → model-selection-Cv2Puf5z.js} +122 -122
- package/dist/{outbound-Bw0dOVS7.js → outbound-Chpiwybe.js} +6 -6
- package/dist/{outbound-attachment-1R6r9Pg_.js → outbound-attachment-BnAVJDLe.js} +2 -2
- package/dist/{paths-C0HLtPu0.js → paths-CehYKFsO.js} +7 -7
- package/dist/{paths-hfkBoC7i.js → paths-DkxwiA8g.js} +5 -5
- package/dist/{pi-embedded-BAHaY-Oh.js → pi-embedded-CJVNBk0y.js} +150 -150
- package/dist/pi-model-discovery-7IzK0Uc3.js +131 -0
- package/dist/pi-model-discovery-runtime-DABef3qy.js +12 -0
- package/dist/{pi-tools.before-tool-call.runtime-D_mthvtC.js → pi-tools.before-tool-call.runtime-BP2UvGJb.js} +10 -10
- package/dist/plugin-sdk/active-listener-CN-tMEvN.js +35 -0
- package/dist/plugin-sdk/api-key-rotation-CimGYMBc.js +176 -0
- package/dist/plugin-sdk/audio-preflight-C-xXBoE2.js +51 -0
- package/dist/plugin-sdk/audio-transcription-runner-CTIHpebA.js +2173 -0
- package/dist/plugin-sdk/audit-membership-runtime-BFatB2LJ.js +58 -0
- package/dist/plugin-sdk/channel-activity-DO0FEzyj.js +95 -0
- package/dist/plugin-sdk/channel-web-Da-__nUF.js +2238 -0
- package/dist/plugin-sdk/commands-registry-6no2NNrY.js +1118 -0
- package/dist/plugin-sdk/compact.runtime-CCoclu5e.js +35 -0
- package/dist/plugin-sdk/compat.js +35 -35
- package/dist/plugin-sdk/config-B9ODwgpz.js +37426 -0
- package/dist/plugin-sdk/deliver-B1fFpKjV.js +1757 -0
- package/dist/plugin-sdk/deliver-runtime-DB-VRMe1.js +15 -0
- package/dist/plugin-sdk/deps-send-discord.runtime-DklqycYG.js +15 -0
- package/dist/plugin-sdk/deps-send-imessage.runtime-Chs8zeon.js +14 -0
- package/dist/plugin-sdk/deps-send-signal.runtime-clW9aSJP.js +13 -0
- package/dist/plugin-sdk/deps-send-slack.runtime-BUx0LYY1.js +13 -0
- package/dist/plugin-sdk/deps-send-telegram.runtime-LECSHgMG.js +16 -0
- package/dist/plugin-sdk/deps-send-whatsapp.runtime-D2d65fw0.js +40 -0
- package/dist/plugin-sdk/diagnostic-CxIvS-C2.js +315 -0
- package/dist/plugin-sdk/dispatch-BqlR4dPx.js +105863 -0
- package/dist/plugin-sdk/env-b9k1PHMI.js +34 -0
- package/dist/plugin-sdk/fetch-PoxzAANT.js +326 -0
- package/dist/plugin-sdk/fetch-guard-4UVSZ0uS.js +164 -0
- package/dist/plugin-sdk/image-Ch6M4tnJ.js +2420 -0
- package/dist/plugin-sdk/image-runtime-CSh2o5wY.js +8 -0
- package/dist/plugin-sdk/ir-CugsqGH8.js +1312 -0
- package/dist/plugin-sdk/local-roots-adnEg9zb.js +217 -0
- package/dist/plugin-sdk/logger-D6zRubj0.js +1164 -0
- package/dist/plugin-sdk/login-CYvkQ0At.js +54 -0
- package/dist/plugin-sdk/login-qr-ll4NtaT5.js +316 -0
- package/dist/plugin-sdk/manager-CHy8IclH.js +3959 -0
- package/dist/plugin-sdk/manager-runtime-C70EkEr7.js +11 -0
- package/dist/plugin-sdk/outbound-Wzs2iN7X.js +216 -0
- package/dist/plugin-sdk/outbound-attachment-khXJwucX.js +17 -0
- package/dist/plugin-sdk/paths-BtVqCdw4.js +3063 -0
- package/dist/{pi-model-discovery-ItS07aJB.js → plugin-sdk/pi-model-discovery-Dh4ziodY.js} +2 -2
- package/dist/plugin-sdk/pi-model-discovery-runtime-b83Xe-HT.js +8 -0
- package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-C1z5CDBF.js +349 -0
- package/dist/{proxy-fetch-c1ZUFFcO.js → plugin-sdk/proxy-fetch-CJEmoBxi.js} +1 -1
- package/dist/plugin-sdk/pw-ai-Dj3Cvlzl.js +1990 -0
- package/dist/plugin-sdk/qmd-manager-egHUAseQ.js +1581 -0
- package/dist/plugin-sdk/resolve-outbound-target-BiICvIKs.js +38 -0
- package/dist/plugin-sdk/runtime-whatsapp-login.runtime-DNApufzW.js +9 -0
- package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-CBmtfIQ8.js +13 -0
- package/dist/plugin-sdk/send-CScblaI4.js +532 -0
- package/dist/plugin-sdk/send-CeHhnld6.js +407 -0
- package/dist/plugin-sdk/send-DP_c8JfR.js +3277 -0
- package/dist/plugin-sdk/send-Dc5fI6e8.js +495 -0
- package/dist/plugin-sdk/send-l-77_s1_.js +2507 -0
- package/dist/plugin-sdk/session-CkOKZaqa.js +166 -0
- package/dist/plugin-sdk/signal.js +2 -2
- package/dist/plugin-sdk/skill-commands-BohYCgkq.js +336 -0
- package/dist/plugin-sdk/slash-commands.runtime-DpLfVTM6.js +8 -0
- package/dist/plugin-sdk/slash-dispatch.runtime-CASMHwpm.js +35 -0
- package/dist/plugin-sdk/slash-skill-commands.runtime-D7rrJEci.js +9 -0
- package/dist/plugin-sdk/sqlite-CJE3X7Mv.js +1005 -0
- package/dist/plugin-sdk/subagent-registry-runtime-B1oo5bih.js +35 -0
- package/dist/plugin-sdk/tables-D5VgpTmm.js +53 -0
- package/dist/plugin-sdk/target-errors-C6zZ_OpA.js +191 -0
- package/dist/{tokens-BWDIKewp.js → plugin-sdk/tokens-DUnJnpMS.js} +1 -1
- package/dist/plugin-sdk/web-TfUM1nSi.js +39 -0
- package/dist/plugin-sdk/whatsapp-actions-DuWJ0j1r.js +71 -0
- package/dist/proxy-fetch-BOh1PLOW.js +54 -0
- package/dist/{pw-ai-Ok6KGelf.js → pw-ai-DwH5GpEO.js} +9 -9
- package/dist/{qmd-manager-DhfEz4Ar.js → qmd-manager-DEscZz5_.js} +6 -6
- package/dist/{query-expansion-GqNV2iIE.js → query-expansion-BErUY8P2.js} +4 -4
- package/dist/runtime-whatsapp-login.runtime-BI3U306v.js +13 -0
- package/dist/runtime-whatsapp-outbound.runtime-Bsc2uD09.js +17 -0
- package/dist/{send-DwAoiT2p.js → send-BDnOgWIp.js} +25 -25
- package/dist/{send-CS0ocZHl.js → send-C-Q_WPMf.js} +3 -3
- package/dist/{send-6R8b9zsj.js → send-DUibfNQD.js} +5 -5
- package/dist/{send-DPflcjM5.js → send-DtBvCnPQ.js} +6 -6
- package/dist/{send-CEg4P96c.js → send-ORtn50qg.js} +5 -5
- package/dist/{session-BoIID5UR.js → session-B7imi6T5.js} +7 -7
- package/dist/{skill-commands-DhdiziMs.js → skill-commands-B9brPuiL.js} +9 -9
- package/dist/slash-commands.runtime-Cf6ygfBp.js +12 -0
- package/dist/slash-dispatch.runtime-CsmvhO5K.js +39 -0
- package/dist/slash-skill-commands.runtime-CX7stIEP.js +13 -0
- package/dist/subagent-registry-runtime-B_S1nf7y.js +39 -0
- package/dist/{subsystem-C8z6w6xC.js → subsystem-DfXy5gUB.js} +14 -14
- package/dist/{tables-DQusRhkD.js → tables-CjQqTOdD.js} +1 -1
- package/dist/{target-errors-CfavnC9U.js → target-errors-BZE1mc-W.js} +1 -1
- package/dist/tokens-6ul2IrzG.js +50 -0
- package/dist/{web-CrcrTQ2c.js → web-Cd8yK1Zq.js} +39 -39
- package/dist/{whatsapp-actions-B0u0ZAme.js → whatsapp-actions-CYEzUMBI.js} +15 -15
- package/dist/{workspace-CWDYHR27.js → workspace-DGIcKCCW.js} +20 -20
- package/extensions/cclawd-mfa-auth/README.md +118 -0
- package/extensions/cclawd-mfa-auth/index.ts +382 -0
- package/extensions/cclawd-mfa-auth/openclaw.plugin.json +34 -0
- package/extensions/cclawd-mfa-auth/package.json +27 -0
- package/extensions/cclawd-mfa-auth/src/auth-manager.ts +536 -0
- package/extensions/cclawd-mfa-auth/src/config.ts +82 -0
- package/extensions/cclawd-mfa-auth/src/dabby-client.ts +200 -0
- package/extensions/cclawd-mfa-auth/src/notification-service.ts +417 -0
- package/extensions/cclawd-mfa-auth/src/polling-manager.ts +232 -0
- package/extensions/cclawd-mfa-auth/src/providers/base.ts +25 -0
- package/extensions/cclawd-mfa-auth/src/providers/qr-code.ts +98 -0
- package/extensions/cclawd-mfa-auth/src/sensitive-detector.ts +159 -0
- package/extensions/cclawd-mfa-auth/src/session-resolver.ts +159 -0
- package/extensions/cclawd-mfa-auth/src/types.ts +156 -0
- package/extensions/mfa-auth/index.ts +675 -1028
- package/extensions/mfa-auth/openclaw.plugin.json +1 -1
- package/extensions/mfa-auth/src/notification-service.ts +2 -8
- package/package.json +453 -453
- package/dist/compact.runtime-BEn3giMt.js +0 -39
- package/dist/deliver-runtime-DkQ3XzGv.js +0 -19
- package/dist/deps-send-discord.runtime-BLpqSj6s.js +0 -19
- package/dist/deps-send-imessage.runtime-BFzyYqvR.js +0 -18
- package/dist/deps-send-signal.runtime-DT0TYCy1.js +0 -17
- package/dist/deps-send-slack.runtime-BhaGFfMX.js +0 -17
- package/dist/deps-send-telegram.runtime-B6Cic9NX.js +0 -20
- package/dist/deps-send-whatsapp.runtime-WtEhIq2S.js +0 -43
- package/dist/image-runtime-B1LFYfQ2.js +0 -12
- package/dist/manager-runtime-Da7ME9vS.js +0 -15
- package/dist/pi-model-discovery-runtime-DjM7Z1fx.js +0 -12
- package/dist/runtime-whatsapp-login.runtime-D4BRhQkK.js +0 -13
- package/dist/runtime-whatsapp-outbound.runtime-DJPpS6g-.js +0 -17
- package/dist/slash-commands.runtime-Cu1lTjV9.js +0 -12
- package/dist/slash-dispatch.runtime-DRVJEF4l.js +0 -39
- package/dist/slash-skill-commands.runtime-C373PJjv.js +0 -13
- package/dist/subagent-registry-runtime-D7hWBo1G.js +0 -39
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { S as redactSensitiveText } from "./paths-
|
|
2
|
-
import { c as resolveStateDir, d as resolveRequiredHomeDir, l as expandHomePrefix, o as resolveOAuthDir } from "./paths-
|
|
3
|
-
import { d as logVerbose, l as danger, t as createSubsystemLogger } from "./subsystem-
|
|
4
|
-
import { q as normalizeAccountId } from "./workspace-
|
|
5
|
-
import { a as CONFIG_DIR, b as safeParseJson } from "./logger-
|
|
6
|
-
import { Ii as isGifMedia, Ji as formatErrorMessage, Ki as collectErrorGraphCandidates, Li as kindFromMime, Ni as getFileExtension, Ri as normalizeMimeType, Rn as getChannelPlugin, Vs as resolveTelegramPreviewStreamMode, Xi as readErrorName, Xn as resolveTelegramAccount, Yi as formatUncaughtError, ao as loadConfig, ii as writeJsonAtomic, qi as extractErrorCode, so as readConfigFileSnapshotForWrite, tc as withFileLock$1, uo as writeConfigFile, zn as listChannelPlugins } from "./model-selection-
|
|
1
|
+
import { S as redactSensitiveText } from "./paths-CehYKFsO.js";
|
|
2
|
+
import { c as resolveStateDir, d as resolveRequiredHomeDir, l as expandHomePrefix, o as resolveOAuthDir } from "./paths-DkxwiA8g.js";
|
|
3
|
+
import { d as logVerbose, l as danger, t as createSubsystemLogger } from "./subsystem-DfXy5gUB.js";
|
|
4
|
+
import { q as normalizeAccountId } from "./workspace-DGIcKCCW.js";
|
|
5
|
+
import { a as CONFIG_DIR, b as safeParseJson } from "./logger-CbUVl62f.js";
|
|
6
|
+
import { Ii as isGifMedia, Ji as formatErrorMessage, Ki as collectErrorGraphCandidates, Li as kindFromMime, Ni as getFileExtension, Ri as normalizeMimeType, Rn as getChannelPlugin, Vs as resolveTelegramPreviewStreamMode, Xi as readErrorName, Xn as resolveTelegramAccount, Yi as formatUncaughtError, ao as loadConfig, ii as writeJsonAtomic, qi as extractErrorCode, so as readConfigFileSnapshotForWrite, tc as withFileLock$1, uo as writeConfigFile, zn as listChannelPlugins } from "./model-selection-Cv2Puf5z.js";
|
|
7
7
|
import { n as normalizeTelegramLookupTarget, r as parseTelegramTarget, t as normalizeTelegramChatId } from "./targets-D4pwl9LR.js";
|
|
8
|
-
import { n as makeProxyFetch } from "./proxy-fetch-
|
|
9
|
-
import { a as loadWebMedia, n as markdownToIR, s as resolveMarkdownTableMode, t as chunkMarkdownIR } from "./ir-
|
|
8
|
+
import { n as makeProxyFetch } from "./proxy-fetch-BOh1PLOW.js";
|
|
9
|
+
import { a as loadWebMedia, n as markdownToIR, s as resolveMarkdownTableMode, t as chunkMarkdownIR } from "./ir-CsgNUpOU.js";
|
|
10
10
|
import { t as renderMarkdownWithMarkers } from "./render-IRnn-2gt.js";
|
|
11
|
-
import { i as createTelegramRetryRunner, n as recordChannelActivity } from "./channel-activity-
|
|
11
|
+
import { i as createTelegramRetryRunner, n as recordChannelActivity } from "./channel-activity-DWAER4wd.js";
|
|
12
12
|
import { t as buildOutboundMediaLoadOptions } from "./load-options-C-AlrR3n.js";
|
|
13
13
|
import { n as normalizePollInput } from "./polls-Dw-aNTWI.js";
|
|
14
|
-
import { t as resolveTelegramFetch } from "./fetch-
|
|
14
|
+
import { t as resolveTelegramFetch } from "./fetch-C0iyt-Iz.js";
|
|
15
15
|
import os from "node:os";
|
|
16
16
|
import path from "node:path";
|
|
17
|
-
import
|
|
17
|
+
import syncFs from "node:fs";
|
|
18
18
|
import JSON5 from "json5";
|
|
19
19
|
import crypto, { randomBytes } from "node:crypto";
|
|
20
20
|
import { Bot, HttpError, InputFile } from "grammy";
|
|
@@ -68,7 +68,7 @@ function getPairingAdapter(channelId) {
|
|
|
68
68
|
//#region src/plugin-sdk/json-store.ts
|
|
69
69
|
async function readJsonFileWithFallback(filePath, fallback) {
|
|
70
70
|
try {
|
|
71
|
-
const parsed = safeParseJson(await
|
|
71
|
+
const parsed = safeParseJson(await syncFs.promises.readFile(filePath, "utf-8"));
|
|
72
72
|
if (parsed == null) return {
|
|
73
73
|
value: fallback,
|
|
74
74
|
exists: true
|
|
@@ -154,7 +154,7 @@ async function readPairingRequests(filePath) {
|
|
|
154
154
|
}
|
|
155
155
|
async function ensureJsonFile(filePath, fallback) {
|
|
156
156
|
try {
|
|
157
|
-
await
|
|
157
|
+
await syncFs.promises.access(filePath);
|
|
158
158
|
} catch {
|
|
159
159
|
await writeJsonFile(filePath, fallback);
|
|
160
160
|
}
|
|
@@ -310,7 +310,7 @@ function resolveAllowFromReadCacheOrMissing(filePath, stat) {
|
|
|
310
310
|
async function readAllowFromStateForPathWithExists(channel, filePath) {
|
|
311
311
|
let stat = null;
|
|
312
312
|
try {
|
|
313
|
-
stat = await
|
|
313
|
+
stat = await syncFs.promises.stat(filePath);
|
|
314
314
|
} catch (err) {
|
|
315
315
|
if (err.code !== "ENOENT") throw err;
|
|
316
316
|
}
|
|
@@ -353,7 +353,7 @@ async function writeAllowFromState(filePath, allowFrom) {
|
|
|
353
353
|
});
|
|
354
354
|
let stat = null;
|
|
355
355
|
try {
|
|
356
|
-
stat = await
|
|
356
|
+
stat = await syncFs.promises.stat(filePath);
|
|
357
357
|
} catch {}
|
|
358
358
|
setAllowFromReadCache(filePath, {
|
|
359
359
|
exists: true,
|
|
@@ -977,7 +977,7 @@ function resolveCronStorePath(storePath) {
|
|
|
977
977
|
}
|
|
978
978
|
async function loadCronStore(storePath) {
|
|
979
979
|
try {
|
|
980
|
-
const raw = await
|
|
980
|
+
const raw = await syncFs.promises.readFile(storePath, "utf-8");
|
|
981
981
|
let parsed;
|
|
982
982
|
try {
|
|
983
983
|
parsed = JSON5.parse(raw);
|
|
@@ -1003,21 +1003,21 @@ async function loadCronStore(storePath) {
|
|
|
1003
1003
|
}
|
|
1004
1004
|
}
|
|
1005
1005
|
async function setSecureFileMode(filePath) {
|
|
1006
|
-
await
|
|
1006
|
+
await syncFs.promises.chmod(filePath, 384).catch(() => void 0);
|
|
1007
1007
|
}
|
|
1008
1008
|
async function saveCronStore(storePath, store, opts) {
|
|
1009
1009
|
const storeDir = path.dirname(storePath);
|
|
1010
|
-
await
|
|
1010
|
+
await syncFs.promises.mkdir(storeDir, {
|
|
1011
1011
|
recursive: true,
|
|
1012
1012
|
mode: 448
|
|
1013
1013
|
});
|
|
1014
|
-
await
|
|
1014
|
+
await syncFs.promises.chmod(storeDir, 448).catch(() => void 0);
|
|
1015
1015
|
const json = JSON.stringify(store, null, 2);
|
|
1016
1016
|
const cached = serializedStoreCache.get(storePath);
|
|
1017
1017
|
if (cached === json) return;
|
|
1018
1018
|
let previous = cached ?? null;
|
|
1019
1019
|
if (previous === null) try {
|
|
1020
|
-
previous = await
|
|
1020
|
+
previous = await syncFs.promises.readFile(storePath, "utf-8");
|
|
1021
1021
|
} catch (err) {
|
|
1022
1022
|
if (err.code !== "ENOENT") throw err;
|
|
1023
1023
|
}
|
|
@@ -1026,14 +1026,14 @@ async function saveCronStore(storePath, store, opts) {
|
|
|
1026
1026
|
return;
|
|
1027
1027
|
}
|
|
1028
1028
|
const tmp = `${storePath}.${process.pid}.${randomBytes(8).toString("hex")}.tmp`;
|
|
1029
|
-
await
|
|
1029
|
+
await syncFs.promises.writeFile(tmp, json, {
|
|
1030
1030
|
encoding: "utf-8",
|
|
1031
1031
|
mode: 384
|
|
1032
1032
|
});
|
|
1033
1033
|
await setSecureFileMode(tmp);
|
|
1034
1034
|
if (previous !== null && !opts?.skipBackup) try {
|
|
1035
1035
|
const backupPath = `${storePath}.bak`;
|
|
1036
|
-
await
|
|
1036
|
+
await syncFs.promises.copyFile(storePath, backupPath);
|
|
1037
1037
|
await setSecureFileMode(backupPath);
|
|
1038
1038
|
} catch {}
|
|
1039
1039
|
await renameWithRetry(tmp, storePath);
|
|
@@ -1044,7 +1044,7 @@ const RENAME_MAX_RETRIES = 3;
|
|
|
1044
1044
|
const RENAME_BASE_DELAY_MS = 50;
|
|
1045
1045
|
async function renameWithRetry(src, dest) {
|
|
1046
1046
|
for (let attempt = 0; attempt <= RENAME_MAX_RETRIES; attempt++) try {
|
|
1047
|
-
await
|
|
1047
|
+
await syncFs.promises.rename(src, dest);
|
|
1048
1048
|
return;
|
|
1049
1049
|
} catch (err) {
|
|
1050
1050
|
const code = err.code;
|
|
@@ -1053,8 +1053,8 @@ async function renameWithRetry(src, dest) {
|
|
|
1053
1053
|
continue;
|
|
1054
1054
|
}
|
|
1055
1055
|
if (code === "EPERM" || code === "EEXIST") {
|
|
1056
|
-
await
|
|
1057
|
-
await
|
|
1056
|
+
await syncFs.promises.copyFile(src, dest);
|
|
1057
|
+
await syncFs.promises.unlink(src).catch(() => {});
|
|
1058
1058
|
return;
|
|
1059
1059
|
}
|
|
1060
1060
|
throw err;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Li as kindFromMime, ao as loadConfig, ci as generateSecureUuid, cr as resolveSignalAccount } from "./model-selection-
|
|
1
|
+
import { Li as kindFromMime, ao as loadConfig, ci as generateSecureUuid, cr as resolveSignalAccount } from "./model-selection-Cv2Puf5z.js";
|
|
2
2
|
import { n as fetchWithTimeout } from "./fetch-timeout-Bj8qHhwJ.js";
|
|
3
|
-
import { n as markdownToIR, s as resolveMarkdownTableMode, t as chunkMarkdownIR } from "./ir-
|
|
3
|
+
import { n as markdownToIR, s as resolveMarkdownTableMode, t as chunkMarkdownIR } from "./ir-CsgNUpOU.js";
|
|
4
4
|
import { t as resolveFetch } from "./fetch-CeWULXBI.js";
|
|
5
|
-
import { t as resolveOutboundAttachmentFromUrl } from "./outbound-attachment-
|
|
5
|
+
import { t as resolveOutboundAttachmentFromUrl } from "./outbound-attachment-BnAVJDLe.js";
|
|
6
6
|
//#region src/signal/format.ts
|
|
7
7
|
function normalizeUrlForComparison(url) {
|
|
8
8
|
let normalized = url.toLowerCase();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { h as normalizeE164, y as resolveUserPath } from "./logger-
|
|
2
|
-
import { Li as kindFromMime, Or as isAllowedParsedChatSender, Tr as resolveIMessageAccount, ao as loadConfig } from "./model-selection-
|
|
3
|
-
import { s as resolveMarkdownTableMode } from "./ir-
|
|
4
|
-
import { t as convertMarkdownTables } from "./tables-
|
|
5
|
-
import { t as resolveOutboundAttachmentFromUrl } from "./outbound-attachment-
|
|
1
|
+
import { h as normalizeE164, y as resolveUserPath } from "./logger-CbUVl62f.js";
|
|
2
|
+
import { Li as kindFromMime, Or as isAllowedParsedChatSender, Tr as resolveIMessageAccount, ao as loadConfig } from "./model-selection-Cv2Puf5z.js";
|
|
3
|
+
import { s as resolveMarkdownTableMode } from "./ir-CsgNUpOU.js";
|
|
4
|
+
import { t as convertMarkdownTables } from "./tables-CjQqTOdD.js";
|
|
5
|
+
import { t as resolveOutboundAttachmentFromUrl } from "./outbound-attachment-BnAVJDLe.js";
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
7
7
|
import { createInterface } from "node:readline";
|
|
8
8
|
//#region src/imessage/target-parsing-helpers.ts
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { E as resolvePreferredOpenClawTmpDir } from "./subsystem-
|
|
2
|
-
import { q as normalizeAccountId } from "./workspace-
|
|
3
|
-
import { Bi as maxBytesForKind, E as retryAsync, Mi as extensionForMime, Mr as resolveDiscordAccount, Pr as normalizeDiscordToken, T as resolveRetryConfig, ao as loadConfig } from "./model-selection-
|
|
1
|
+
import { E as resolvePreferredOpenClawTmpDir } from "./subsystem-DfXy5gUB.js";
|
|
2
|
+
import { q as normalizeAccountId } from "./workspace-DGIcKCCW.js";
|
|
3
|
+
import { Bi as maxBytesForKind, E as retryAsync, Mi as extensionForMime, Mr as resolveDiscordAccount, Pr as normalizeDiscordToken, T as resolveRetryConfig, ao as loadConfig } from "./model-selection-Cv2Puf5z.js";
|
|
4
4
|
import { i as requireTargetKind, r as parseMentionPrefixOrAtUserTarget, t as buildMessagingTarget } from "./targets-C81dAn9s.js";
|
|
5
|
-
import { a as loadWebMedia, d as chunkMarkdownTextWithMode, m as resolveChunkMode, o as loadWebMediaRaw, s as resolveMarkdownTableMode } from "./ir-
|
|
5
|
+
import { a as loadWebMedia, d as chunkMarkdownTextWithMode, m as resolveChunkMode, o as loadWebMediaRaw, s as resolveMarkdownTableMode } from "./ir-CsgNUpOU.js";
|
|
6
6
|
import { t as resolveFetch } from "./fetch-CeWULXBI.js";
|
|
7
|
-
import { n as recordChannelActivity, r as createDiscordRetryRunner } from "./channel-activity-
|
|
7
|
+
import { n as recordChannelActivity, r as createDiscordRetryRunner } from "./channel-activity-DWAER4wd.js";
|
|
8
8
|
import { t as buildOutboundMediaLoadOptions } from "./load-options-C-AlrR3n.js";
|
|
9
9
|
import { n as normalizePollInput, t as normalizePollDurationHours } from "./polls-Dw-aNTWI.js";
|
|
10
|
-
import { t as convertMarkdownTables } from "./tables-
|
|
10
|
+
import { t as convertMarkdownTables } from "./tables-CjQqTOdD.js";
|
|
11
11
|
import fs from "node:fs/promises";
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
import { promisify } from "node:util";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { d as logVerbose } from "./subsystem-
|
|
2
|
-
import { ao as loadConfig, or as resolveSlackBotToken, rr as resolveSlackAccount } from "./model-selection-
|
|
1
|
+
import { d as logVerbose } from "./subsystem-DfXy5gUB.js";
|
|
2
|
+
import { ao as loadConfig, or as resolveSlackBotToken, rr as resolveSlackAccount } from "./model-selection-Cv2Puf5z.js";
|
|
3
3
|
import { i as requireTargetKind, n as ensureTargetId, r as parseMentionPrefixOrAtUserTarget, t as buildMessagingTarget } from "./targets-C81dAn9s.js";
|
|
4
|
-
import { i as isSilentReplyText } from "./tokens-
|
|
5
|
-
import { r as withTrustedEnvProxyGuardedFetchMode, t as fetchWithSsrFGuard } from "./fetch-guard-
|
|
6
|
-
import { a as loadWebMedia, d as chunkMarkdownTextWithMode, h as resolveTextChunkLimit, m as resolveChunkMode, n as markdownToIR, s as resolveMarkdownTableMode, t as chunkMarkdownIR } from "./ir-
|
|
4
|
+
import { i as isSilentReplyText } from "./tokens-6ul2IrzG.js";
|
|
5
|
+
import { r as withTrustedEnvProxyGuardedFetchMode, t as fetchWithSsrFGuard } from "./fetch-guard-B5ZMnGaN.js";
|
|
6
|
+
import { a as loadWebMedia, d as chunkMarkdownTextWithMode, h as resolveTextChunkLimit, m as resolveChunkMode, n as markdownToIR, s as resolveMarkdownTableMode, t as chunkMarkdownIR } from "./ir-CsgNUpOU.js";
|
|
7
7
|
import { t as renderMarkdownWithMarkers } from "./render-IRnn-2gt.js";
|
|
8
8
|
import { WebClient } from "@slack/web-api";
|
|
9
9
|
//#region src/slack/targets.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as toPinoLikeLogger, b as getChildLogger, h as success, l as danger } from "./subsystem-
|
|
2
|
-
import { l as ensureDir, y as resolveUserPath } from "./logger-
|
|
3
|
-
import { Cr as resolveWebCredsPath, Sr as resolveWebCredsBackupPath, Ws as VERSION, _r as maybeRestoreCredsFromBackup, nc as formatCliCommand, xr as resolveDefaultWebAuthDir, yr as readCredsJsonRaw } from "./model-selection-
|
|
4
|
-
import
|
|
1
|
+
import { S as toPinoLikeLogger, b as getChildLogger, h as success, l as danger } from "./subsystem-DfXy5gUB.js";
|
|
2
|
+
import { l as ensureDir, y as resolveUserPath } from "./logger-CbUVl62f.js";
|
|
3
|
+
import { Cr as resolveWebCredsPath, Sr as resolveWebCredsBackupPath, Ws as VERSION, _r as maybeRestoreCredsFromBackup, nc as formatCliCommand, xr as resolveDefaultWebAuthDir, yr as readCredsJsonRaw } from "./model-selection-Cv2Puf5z.js";
|
|
4
|
+
import syncFs from "node:fs";
|
|
5
5
|
import "node:crypto";
|
|
6
6
|
import { DisconnectReason, fetchLatestBaileysVersion, makeCacheableSignalKeyStore, makeWASocket, useMultiFileAuthState } from "@whiskeysockets/baileys";
|
|
7
7
|
import qrcode from "qrcode-terminal";
|
|
@@ -19,16 +19,16 @@ async function safeSaveCreds(authDir, saveCreds, logger) {
|
|
|
19
19
|
const raw = readCredsJsonRaw(credsPath);
|
|
20
20
|
if (raw) try {
|
|
21
21
|
JSON.parse(raw);
|
|
22
|
-
|
|
22
|
+
syncFs.copyFileSync(credsPath, backupPath);
|
|
23
23
|
try {
|
|
24
|
-
|
|
24
|
+
syncFs.chmodSync(backupPath, 384);
|
|
25
25
|
} catch {}
|
|
26
26
|
} catch {}
|
|
27
27
|
} catch {}
|
|
28
28
|
try {
|
|
29
29
|
await Promise.resolve(saveCreds());
|
|
30
30
|
try {
|
|
31
|
-
|
|
31
|
+
syncFs.chmodSync(resolveWebCredsPath(authDir), 384);
|
|
32
32
|
} catch {}
|
|
33
33
|
} catch (err) {
|
|
34
34
|
logger.warn({ error: String(err) }, "failed saving WhatsApp creds");
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { N as resolveAgentSkillsFilter, O as listAgentIds, P as resolveAgentWorkspaceDir } from "./paths-
|
|
2
|
-
import { c as resolveStateDir } from "./paths-
|
|
3
|
-
import { d as logVerbose, t as createSubsystemLogger } from "./subsystem-
|
|
4
|
-
import { a as CONFIG_DIR, y as resolveUserPath } from "./logger-
|
|
5
|
-
import { da as buildWorkspaceSkillCommandSpecs, ha as resolvePluginSkillDirs, ni as createAsyncLock } from "./model-selection-
|
|
6
|
-
import { i as listChatCommands } from "./commands-registry-
|
|
1
|
+
import { N as resolveAgentSkillsFilter, O as listAgentIds, P as resolveAgentWorkspaceDir } from "./paths-CehYKFsO.js";
|
|
2
|
+
import { c as resolveStateDir } from "./paths-DkxwiA8g.js";
|
|
3
|
+
import { d as logVerbose, t as createSubsystemLogger } from "./subsystem-DfXy5gUB.js";
|
|
4
|
+
import { a as CONFIG_DIR, y as resolveUserPath } from "./logger-CbUVl62f.js";
|
|
5
|
+
import { da as buildWorkspaceSkillCommandSpecs, ha as resolvePluginSkillDirs, ni as createAsyncLock } from "./model-selection-Cv2Puf5z.js";
|
|
6
|
+
import { i as listChatCommands } from "./commands-registry-BUyiA7nE.js";
|
|
7
7
|
import os from "node:os";
|
|
8
8
|
import path from "node:path";
|
|
9
|
-
import
|
|
9
|
+
import syncFs from "node:fs";
|
|
10
10
|
import "node:crypto";
|
|
11
11
|
import chokidar from "chokidar";
|
|
12
12
|
//#region src/infra/pairing-files.ts
|
|
@@ -241,13 +241,13 @@ function listSkillCommandsForAgents(params) {
|
|
|
241
241
|
const workspaceFilters = /* @__PURE__ */ new Map();
|
|
242
242
|
for (const agentId of agentIds) {
|
|
243
243
|
const workspaceDir = resolveAgentWorkspaceDir(params.cfg, agentId);
|
|
244
|
-
if (!
|
|
244
|
+
if (!syncFs.existsSync(workspaceDir)) {
|
|
245
245
|
logVerbose(`Skipping agent "${agentId}": workspace does not exist: ${workspaceDir}`);
|
|
246
246
|
continue;
|
|
247
247
|
}
|
|
248
248
|
let canonicalDir;
|
|
249
249
|
try {
|
|
250
|
-
canonicalDir =
|
|
250
|
+
canonicalDir = syncFs.realpathSync(workspaceDir);
|
|
251
251
|
} catch {
|
|
252
252
|
logVerbose(`Skipping agent "${agentId}": cannot resolve workspace: ${workspaceDir}`);
|
|
253
253
|
continue;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./paths-CehYKFsO.js";
|
|
2
|
+
import "./paths-DkxwiA8g.js";
|
|
3
|
+
import "./subsystem-DfXy5gUB.js";
|
|
4
|
+
import "./workspace-DGIcKCCW.js";
|
|
5
|
+
import "./logger-CbUVl62f.js";
|
|
6
|
+
import "./model-selection-Cv2Puf5z.js";
|
|
7
|
+
import "./github-copilot-token-8N63GdbE.js";
|
|
8
|
+
import "./boolean-C7Ct_klp.js";
|
|
9
|
+
import "./env-lw2hsIUY.js";
|
|
10
|
+
import "./frontmatter-C_obXuTp.js";
|
|
11
|
+
import { f as resolveCommandArgMenu, n as findCommandByNativeName, s as listNativeCommandSpecsForConfig, t as buildCommandTextFromArgs, u as parseCommandArgs } from "./commands-registry-BUyiA7nE.js";
|
|
12
|
+
export { buildCommandTextFromArgs, findCommandByNativeName, listNativeCommandSpecsForConfig, parseCommandArgs, resolveCommandArgMenu };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import "./paths-CehYKFsO.js";
|
|
2
|
+
import "./paths-DkxwiA8g.js";
|
|
3
|
+
import "./subsystem-DfXy5gUB.js";
|
|
4
|
+
import "./workspace-DGIcKCCW.js";
|
|
5
|
+
import "./logger-CbUVl62f.js";
|
|
6
|
+
import { zr as resolveConversationLabel } from "./model-selection-Cv2Puf5z.js";
|
|
7
|
+
import "./github-copilot-token-8N63GdbE.js";
|
|
8
|
+
import "./boolean-C7Ct_klp.js";
|
|
9
|
+
import "./env-lw2hsIUY.js";
|
|
10
|
+
import "./frontmatter-C_obXuTp.js";
|
|
11
|
+
import "./send-ORtn50qg.js";
|
|
12
|
+
import "./send-DtBvCnPQ.js";
|
|
13
|
+
import { F as finalizeInboundContext, N as resolveAgentRoute, b as dispatchReplyWithDispatcher, d as createReplyPrefixOptions, i as deliverSlackSlashReplies, r as recordInboundSessionMetaSafe } from "./pi-embedded-CJVNBk0y.js";
|
|
14
|
+
import "./tokens-6ul2IrzG.js";
|
|
15
|
+
import "./deliver-aHOaRbkt.js";
|
|
16
|
+
import "./diagnostic-BdcXX9iJ.js";
|
|
17
|
+
import "./send-BDnOgWIp.js";
|
|
18
|
+
import "./pi-model-discovery-7IzK0Uc3.js";
|
|
19
|
+
import "./image-4x07m4Jl.js";
|
|
20
|
+
import "./audio-transcription-runner-CbPqoiHX.js";
|
|
21
|
+
import "./fetch-D9NUULbj.js";
|
|
22
|
+
import "./fetch-guard-B5ZMnGaN.js";
|
|
23
|
+
import "./api-key-rotation-BOfI3cG3.js";
|
|
24
|
+
import "./proxy-fetch-BOh1PLOW.js";
|
|
25
|
+
import { m as resolveChunkMode, s as resolveMarkdownTableMode } from "./ir-CsgNUpOU.js";
|
|
26
|
+
import "./render-IRnn-2gt.js";
|
|
27
|
+
import "./target-errors-BZE1mc-W.js";
|
|
28
|
+
import "./commands-registry-BUyiA7nE.js";
|
|
29
|
+
import "./skill-commands-B9brPuiL.js";
|
|
30
|
+
import "./fetch-CeWULXBI.js";
|
|
31
|
+
import "./channel-activity-DWAER4wd.js";
|
|
32
|
+
import "./tables-CjQqTOdD.js";
|
|
33
|
+
import "./send-C-Q_WPMf.js";
|
|
34
|
+
import "./outbound-attachment-BnAVJDLe.js";
|
|
35
|
+
import "./send-DUibfNQD.js";
|
|
36
|
+
import "./fetch-C0iyt-Iz.js";
|
|
37
|
+
import "./manager-CwYv8O3T.js";
|
|
38
|
+
import "./query-expansion-BErUY8P2.js";
|
|
39
|
+
export { createReplyPrefixOptions, deliverSlackSlashReplies, dispatchReplyWithDispatcher, finalizeInboundContext, recordInboundSessionMetaSafe, resolveAgentRoute, resolveChunkMode, resolveConversationLabel, resolveMarkdownTableMode };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "./paths-CehYKFsO.js";
|
|
2
|
+
import "./paths-DkxwiA8g.js";
|
|
3
|
+
import "./subsystem-DfXy5gUB.js";
|
|
4
|
+
import "./workspace-DGIcKCCW.js";
|
|
5
|
+
import "./logger-CbUVl62f.js";
|
|
6
|
+
import "./model-selection-Cv2Puf5z.js";
|
|
7
|
+
import "./github-copilot-token-8N63GdbE.js";
|
|
8
|
+
import "./boolean-C7Ct_klp.js";
|
|
9
|
+
import "./env-lw2hsIUY.js";
|
|
10
|
+
import "./frontmatter-C_obXuTp.js";
|
|
11
|
+
import "./commands-registry-BUyiA7nE.js";
|
|
12
|
+
import { n as listSkillCommandsForAgents } from "./skill-commands-B9brPuiL.js";
|
|
13
|
+
export { listSkillCommandsForAgents };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import "./paths-CehYKFsO.js";
|
|
2
|
+
import "./paths-DkxwiA8g.js";
|
|
3
|
+
import "./subsystem-DfXy5gUB.js";
|
|
4
|
+
import "./workspace-DGIcKCCW.js";
|
|
5
|
+
import "./logger-CbUVl62f.js";
|
|
6
|
+
import "./model-selection-Cv2Puf5z.js";
|
|
7
|
+
import "./github-copilot-token-8N63GdbE.js";
|
|
8
|
+
import "./boolean-C7Ct_klp.js";
|
|
9
|
+
import "./env-lw2hsIUY.js";
|
|
10
|
+
import "./frontmatter-C_obXuTp.js";
|
|
11
|
+
import "./send-ORtn50qg.js";
|
|
12
|
+
import "./send-DtBvCnPQ.js";
|
|
13
|
+
import { B as countActiveDescendantRuns, G as replaceSubagentRunAfterSteer, H as countPendingDescendantRunsExcludingRun, K as resolveRequesterForChildSession, U as isSubagentSessionRunActive, V as countPendingDescendantRuns, W as listSubagentRunsForRequester, q as shouldIgnorePostCompletionAnnounceForSession } from "./pi-embedded-CJVNBk0y.js";
|
|
14
|
+
import "./tokens-6ul2IrzG.js";
|
|
15
|
+
import "./deliver-aHOaRbkt.js";
|
|
16
|
+
import "./diagnostic-BdcXX9iJ.js";
|
|
17
|
+
import "./send-BDnOgWIp.js";
|
|
18
|
+
import "./pi-model-discovery-7IzK0Uc3.js";
|
|
19
|
+
import "./image-4x07m4Jl.js";
|
|
20
|
+
import "./audio-transcription-runner-CbPqoiHX.js";
|
|
21
|
+
import "./fetch-D9NUULbj.js";
|
|
22
|
+
import "./fetch-guard-B5ZMnGaN.js";
|
|
23
|
+
import "./api-key-rotation-BOfI3cG3.js";
|
|
24
|
+
import "./proxy-fetch-BOh1PLOW.js";
|
|
25
|
+
import "./ir-CsgNUpOU.js";
|
|
26
|
+
import "./render-IRnn-2gt.js";
|
|
27
|
+
import "./target-errors-BZE1mc-W.js";
|
|
28
|
+
import "./commands-registry-BUyiA7nE.js";
|
|
29
|
+
import "./skill-commands-B9brPuiL.js";
|
|
30
|
+
import "./fetch-CeWULXBI.js";
|
|
31
|
+
import "./channel-activity-DWAER4wd.js";
|
|
32
|
+
import "./tables-CjQqTOdD.js";
|
|
33
|
+
import "./send-C-Q_WPMf.js";
|
|
34
|
+
import "./outbound-attachment-BnAVJDLe.js";
|
|
35
|
+
import "./send-DUibfNQD.js";
|
|
36
|
+
import "./fetch-C0iyt-Iz.js";
|
|
37
|
+
import "./manager-CwYv8O3T.js";
|
|
38
|
+
import "./query-expansion-BErUY8P2.js";
|
|
39
|
+
export { countActiveDescendantRuns, countPendingDescendantRuns, countPendingDescendantRunsExcludingRun, isSubagentSessionRunActive, listSubagentRunsForRequester, replaceSubagentRunAfterSteer, resolveRequesterForChildSession, shouldIgnorePostCompletionAnnounceForSession };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as resolveConfigPath } from "./paths-
|
|
1
|
+
import { r as resolveConfigPath } from "./paths-DkxwiA8g.js";
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import
|
|
4
|
+
import syncFs from "node:fs";
|
|
5
5
|
import chalk, { Chalk } from "chalk";
|
|
6
6
|
import { Logger } from "tslog";
|
|
7
7
|
import JSON5 from "json5";
|
|
@@ -49,15 +49,15 @@ function getCommandPathInternal(argv, depth, opts) {
|
|
|
49
49
|
//#endregion
|
|
50
50
|
//#region src/infra/tmp-openclaw-dir.ts
|
|
51
51
|
const POSIX_OPENCLAW_TMP_DIR = "/tmp/openclaw";
|
|
52
|
-
const TMP_DIR_ACCESS_MODE =
|
|
52
|
+
const TMP_DIR_ACCESS_MODE = syncFs.constants.W_OK | syncFs.constants.X_OK;
|
|
53
53
|
function isNodeErrorWithCode(err, code) {
|
|
54
54
|
return typeof err === "object" && err !== null && "code" in err && err.code === code;
|
|
55
55
|
}
|
|
56
56
|
function resolvePreferredOpenClawTmpDir(options = {}) {
|
|
57
|
-
const accessSync = options.accessSync ??
|
|
58
|
-
const chmodSync = options.chmodSync ??
|
|
59
|
-
const lstatSync = options.lstatSync ??
|
|
60
|
-
const mkdirSync = options.mkdirSync ??
|
|
57
|
+
const accessSync = options.accessSync ?? syncFs.accessSync;
|
|
58
|
+
const chmodSync = options.chmodSync ?? syncFs.chmodSync;
|
|
59
|
+
const lstatSync = options.lstatSync ?? syncFs.lstatSync;
|
|
60
|
+
const mkdirSync = options.mkdirSync ?? syncFs.mkdirSync;
|
|
61
61
|
const warn = options.warn ?? ((message) => console.warn(message));
|
|
62
62
|
const getuid = options.getuid ?? (() => {
|
|
63
63
|
try {
|
|
@@ -149,8 +149,8 @@ function resolvePreferredOpenClawTmpDir(options = {}) {
|
|
|
149
149
|
function readLoggingConfig() {
|
|
150
150
|
const configPath = resolveConfigPath();
|
|
151
151
|
try {
|
|
152
|
-
if (!
|
|
153
|
-
const raw =
|
|
152
|
+
if (!syncFs.existsSync(configPath)) return;
|
|
153
|
+
const raw = syncFs.readFileSync(configPath, "utf-8");
|
|
154
154
|
const logging = JSON5.parse(raw)?.logging;
|
|
155
155
|
if (!logging || typeof logging !== "object" || Array.isArray(logging)) return;
|
|
156
156
|
return logging;
|
|
@@ -332,7 +332,7 @@ function buildLogger(settings) {
|
|
|
332
332
|
for (const transport of externalTransports) attachExternalTransport(logger, transport);
|
|
333
333
|
return logger;
|
|
334
334
|
}
|
|
335
|
-
|
|
335
|
+
syncFs.mkdirSync(path.dirname(settings.file), { recursive: true });
|
|
336
336
|
if (isRollingPath(settings.file)) pruneOldRollingLogs(path.dirname(settings.file));
|
|
337
337
|
let currentFileBytes = getCurrentLogFileBytes(settings.file);
|
|
338
338
|
let warnedAboutSizeCap = false;
|
|
@@ -371,14 +371,14 @@ function resolveMaxLogFileBytes(raw) {
|
|
|
371
371
|
}
|
|
372
372
|
function getCurrentLogFileBytes(file) {
|
|
373
373
|
try {
|
|
374
|
-
return
|
|
374
|
+
return syncFs.statSync(file).size;
|
|
375
375
|
} catch {
|
|
376
376
|
return 0;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
function appendLogLine(file, line) {
|
|
380
380
|
try {
|
|
381
|
-
|
|
381
|
+
syncFs.appendFileSync(file, line, { encoding: "utf8" });
|
|
382
382
|
return true;
|
|
383
383
|
} catch {
|
|
384
384
|
return false;
|
|
@@ -430,14 +430,14 @@ function isRollingPath(file) {
|
|
|
430
430
|
}
|
|
431
431
|
function pruneOldRollingLogs(dir) {
|
|
432
432
|
try {
|
|
433
|
-
const entries =
|
|
433
|
+
const entries = syncFs.readdirSync(dir, { withFileTypes: true });
|
|
434
434
|
const cutoff = Date.now() - MAX_LOG_AGE_MS;
|
|
435
435
|
for (const entry of entries) {
|
|
436
436
|
if (!entry.isFile()) continue;
|
|
437
437
|
if (!entry.name.startsWith(`${LOG_PREFIX}-`) || !entry.name.endsWith(LOG_SUFFIX)) continue;
|
|
438
438
|
const fullPath = path.join(dir, entry.name);
|
|
439
439
|
try {
|
|
440
|
-
if (
|
|
440
|
+
if (syncFs.statSync(fullPath).mtimeMs < cutoff) syncFs.rmSync(fullPath, { force: true });
|
|
441
441
|
} catch {}
|
|
442
442
|
}
|
|
443
443
|
} catch {}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ji as detectMime, lt as sanitizeToolResultImages } from "./model-selection-
|
|
1
|
+
import { ji as detectMime, lt as sanitizeToolResultImages } from "./model-selection-Cv2Puf5z.js";
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
//#region src/agents/tools/common.ts
|
|
4
4
|
var ToolInputError = class extends Error {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { u as escapeRegExp } from "./logger-CbUVl62f.js";
|
|
2
|
+
//#region src/auto-reply/tokens.ts
|
|
3
|
+
const HEARTBEAT_TOKEN = "HEARTBEAT_OK";
|
|
4
|
+
const SILENT_REPLY_TOKEN = "NO_REPLY";
|
|
5
|
+
const silentExactRegexByToken = /* @__PURE__ */ new Map();
|
|
6
|
+
const silentTrailingRegexByToken = /* @__PURE__ */ new Map();
|
|
7
|
+
function getSilentExactRegex(token) {
|
|
8
|
+
const cached = silentExactRegexByToken.get(token);
|
|
9
|
+
if (cached) return cached;
|
|
10
|
+
const escaped = escapeRegExp(token);
|
|
11
|
+
const regex = new RegExp(`^\\s*${escaped}\\s*$`);
|
|
12
|
+
silentExactRegexByToken.set(token, regex);
|
|
13
|
+
return regex;
|
|
14
|
+
}
|
|
15
|
+
function getSilentTrailingRegex(token) {
|
|
16
|
+
const cached = silentTrailingRegexByToken.get(token);
|
|
17
|
+
if (cached) return cached;
|
|
18
|
+
const escaped = escapeRegExp(token);
|
|
19
|
+
const regex = new RegExp(`(?:^|\\s+|\\*+)${escaped}\\s*$`);
|
|
20
|
+
silentTrailingRegexByToken.set(token, regex);
|
|
21
|
+
return regex;
|
|
22
|
+
}
|
|
23
|
+
function isSilentReplyText(text, token = SILENT_REPLY_TOKEN) {
|
|
24
|
+
if (!text) return false;
|
|
25
|
+
return getSilentExactRegex(token).test(text);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Strip a trailing silent reply token from mixed-content text.
|
|
29
|
+
* Returns the remaining text with the token removed (trimmed).
|
|
30
|
+
* If the result is empty, the entire message should be treated as silent.
|
|
31
|
+
*/
|
|
32
|
+
function stripSilentToken(text, token = SILENT_REPLY_TOKEN) {
|
|
33
|
+
return text.replace(getSilentTrailingRegex(token), "").trim();
|
|
34
|
+
}
|
|
35
|
+
function isSilentReplyPrefixText(text, token = SILENT_REPLY_TOKEN) {
|
|
36
|
+
if (!text) return false;
|
|
37
|
+
const trimmed = text.trimStart();
|
|
38
|
+
if (!trimmed) return false;
|
|
39
|
+
if (trimmed !== trimmed.toUpperCase()) return false;
|
|
40
|
+
const normalized = trimmed.toUpperCase();
|
|
41
|
+
if (!normalized) return false;
|
|
42
|
+
if (normalized.length < 2) return false;
|
|
43
|
+
if (/[^A-Z_]/.test(normalized)) return false;
|
|
44
|
+
const tokenUpper = token.toUpperCase();
|
|
45
|
+
if (!tokenUpper.startsWith(normalized)) return false;
|
|
46
|
+
if (normalized.includes("_")) return true;
|
|
47
|
+
return tokenUpper === "NO_REPLY" && normalized === "NO";
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { stripSilentToken as a, isSilentReplyText as i, SILENT_REPLY_TOKEN as n, isSilentReplyPrefixText as r, HEARTBEAT_TOKEN as t };
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { s as resolveStorePath } from "./paths-
|
|
2
|
-
import "./paths-
|
|
3
|
-
import { a as defaultRuntime, b as getChildLogger, d as logVerbose, m as shouldLogVerbose, t as createSubsystemLogger } from "./subsystem-
|
|
4
|
-
import { I as buildGroupHistoryKey, N as DEFAULT_MAIN_KEY, P as buildAgentMainSessionKey, z as normalizeAgentId } from "./workspace-
|
|
5
|
-
import { C as sleep, T as toWhatsappJid, h as normalizeE164, m as jidToE164, o as clamp, p as isSelfChatMode, v as resolveJidToE164 } from "./logger-
|
|
6
|
-
import { $t as recordSessionMetaFromInbound, Ai as saveMediaBuffer, Fr as resolveChannelGroupPolicy, Ir as resolveChannelGroupRequireMention, Vr as resolveGroupSessionKey, Zt as loadSessionStore, ao as loadConfig, br as readWebSelfId, dr as resolveWhatsAppAccount, fr as resolveWhatsAppMediaMaxBytes, hr as logWebSelfId, mr as getWebAuthAgeMs, nc as formatCliCommand, pr as WA_WEB_AUTH_DIR, tn as updateLastRoute, vr as pickWebChannel, wr as webAuthExists } from "./model-selection-
|
|
7
|
-
import "./github-copilot-token-
|
|
1
|
+
import { s as resolveStorePath } from "./paths-CehYKFsO.js";
|
|
2
|
+
import "./paths-DkxwiA8g.js";
|
|
3
|
+
import { a as defaultRuntime, b as getChildLogger, d as logVerbose, m as shouldLogVerbose, t as createSubsystemLogger } from "./subsystem-DfXy5gUB.js";
|
|
4
|
+
import { I as buildGroupHistoryKey, N as DEFAULT_MAIN_KEY, P as buildAgentMainSessionKey, z as normalizeAgentId } from "./workspace-DGIcKCCW.js";
|
|
5
|
+
import { C as sleep, T as toWhatsappJid, h as normalizeE164, m as jidToE164, o as clamp, p as isSelfChatMode, v as resolveJidToE164 } from "./logger-CbUVl62f.js";
|
|
6
|
+
import { $t as recordSessionMetaFromInbound, Ai as saveMediaBuffer, Fr as resolveChannelGroupPolicy, Ir as resolveChannelGroupRequireMention, Vr as resolveGroupSessionKey, Zt as loadSessionStore, ao as loadConfig, br as readWebSelfId, dr as resolveWhatsAppAccount, fr as resolveWhatsAppMediaMaxBytes, hr as logWebSelfId, mr as getWebAuthAgeMs, nc as formatCliCommand, pr as WA_WEB_AUTH_DIR, tn as updateLastRoute, vr as pickWebChannel, wr as webAuthExists } from "./model-selection-Cv2Puf5z.js";
|
|
7
|
+
import "./github-copilot-token-8N63GdbE.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
|
-
import "./env-
|
|
10
|
-
import "./frontmatter-
|
|
11
|
-
import "./send-
|
|
12
|
-
import { At as resolveOpenProviderRuntimeGroupPolicy, jt as warnMissingProviderGroupPolicyFallbackOnce, kt as resolveDefaultGroupPolicy } from "./send-
|
|
13
|
-
import { A as enqueueSystemEvent, C as formatInboundEnvelope, D as computeBackoff, E as parseActivationCommand, F as finalizeInboundContext, I as hasControlCommand, J as createDedupeCache, L as shouldComputeCommandAuthorized, M as deriveLastRoutePolicy, N as resolveAgentRoute, O as sleepWithAbort, P as resolveInboundLastRouteSessionKey, R as buildMentionRegexes, S as resolveInboundDebounceMs, T as normalizeGroupActivation, X as resolveMessagePrefix, Y as resolveIdentityNamePrefix, _ as resolvePinnedMainDmOwnerFromAllowlist, a as resolveInboundSessionEnvelopeContext, c as createConnectedChannelStatusPatch, d as createReplyPrefixOptions, f as buildHistoryContextFromEntries, g as resolveDmGroupAccessWithLists, h as resolveDmGroupAccessWithCommandGate, j as buildAgentSessionKey, k as formatDurationPrecise, l as issuePairingChallenge, m as readStoreAllowFromForDmPolicy, p as recordPendingHistoryEntryIfEnabled, u as resolveMentionGating, v as shouldAckReactionForWhatsApp, w as getReplyFromConfig, x as createInboundDebouncer, y as dispatchReplyWithBufferedBlockDispatcher, z as normalizeMentionText } from "./pi-embedded-
|
|
14
|
-
import "./tokens-
|
|
15
|
-
import "./deliver-
|
|
16
|
-
import "./diagnostic-
|
|
17
|
-
import { $ as toLocationContext, Q as formatLocationText, rt as upsertChannelPairingRequest } from "./send-
|
|
18
|
-
import "./pi-model-discovery-
|
|
19
|
-
import "./image-
|
|
20
|
-
import { _ as registerUnhandledRejectionHandler } from "./audio-transcription-runner-
|
|
21
|
-
import { i as getAgentScopedMediaLocalRoots } from "./fetch-
|
|
22
|
-
import "./fetch-guard-
|
|
23
|
-
import "./api-key-rotation-
|
|
24
|
-
import "./proxy-fetch-
|
|
25
|
-
import { a as loadWebMedia, d as chunkMarkdownTextWithMode, h as resolveTextChunkLimit, m as resolveChunkMode, s as resolveMarkdownTableMode } from "./ir-
|
|
9
|
+
import "./env-lw2hsIUY.js";
|
|
10
|
+
import "./frontmatter-C_obXuTp.js";
|
|
11
|
+
import "./send-ORtn50qg.js";
|
|
12
|
+
import { At as resolveOpenProviderRuntimeGroupPolicy, jt as warnMissingProviderGroupPolicyFallbackOnce, kt as resolveDefaultGroupPolicy } from "./send-DtBvCnPQ.js";
|
|
13
|
+
import { A as enqueueSystemEvent, C as formatInboundEnvelope, D as computeBackoff, E as parseActivationCommand, F as finalizeInboundContext, I as hasControlCommand, J as createDedupeCache, L as shouldComputeCommandAuthorized, M as deriveLastRoutePolicy, N as resolveAgentRoute, O as sleepWithAbort, P as resolveInboundLastRouteSessionKey, R as buildMentionRegexes, S as resolveInboundDebounceMs, T as normalizeGroupActivation, X as resolveMessagePrefix, Y as resolveIdentityNamePrefix, _ as resolvePinnedMainDmOwnerFromAllowlist, a as resolveInboundSessionEnvelopeContext, c as createConnectedChannelStatusPatch, d as createReplyPrefixOptions, f as buildHistoryContextFromEntries, g as resolveDmGroupAccessWithLists, h as resolveDmGroupAccessWithCommandGate, j as buildAgentSessionKey, k as formatDurationPrecise, l as issuePairingChallenge, m as readStoreAllowFromForDmPolicy, p as recordPendingHistoryEntryIfEnabled, u as resolveMentionGating, v as shouldAckReactionForWhatsApp, w as getReplyFromConfig, x as createInboundDebouncer, y as dispatchReplyWithBufferedBlockDispatcher, z as normalizeMentionText } from "./pi-embedded-CJVNBk0y.js";
|
|
14
|
+
import "./tokens-6ul2IrzG.js";
|
|
15
|
+
import "./deliver-aHOaRbkt.js";
|
|
16
|
+
import "./diagnostic-BdcXX9iJ.js";
|
|
17
|
+
import { $ as toLocationContext, Q as formatLocationText, rt as upsertChannelPairingRequest } from "./send-BDnOgWIp.js";
|
|
18
|
+
import "./pi-model-discovery-7IzK0Uc3.js";
|
|
19
|
+
import "./image-4x07m4Jl.js";
|
|
20
|
+
import { _ as registerUnhandledRejectionHandler } from "./audio-transcription-runner-CbPqoiHX.js";
|
|
21
|
+
import { i as getAgentScopedMediaLocalRoots } from "./fetch-D9NUULbj.js";
|
|
22
|
+
import "./fetch-guard-B5ZMnGaN.js";
|
|
23
|
+
import "./api-key-rotation-BOfI3cG3.js";
|
|
24
|
+
import "./proxy-fetch-BOh1PLOW.js";
|
|
25
|
+
import { a as loadWebMedia, d as chunkMarkdownTextWithMode, h as resolveTextChunkLimit, m as resolveChunkMode, s as resolveMarkdownTableMode } from "./ir-CsgNUpOU.js";
|
|
26
26
|
import "./render-IRnn-2gt.js";
|
|
27
|
-
import "./target-errors-
|
|
28
|
-
import "./commands-registry-
|
|
29
|
-
import "./skill-commands-
|
|
27
|
+
import "./target-errors-BZE1mc-W.js";
|
|
28
|
+
import "./commands-registry-BUyiA7nE.js";
|
|
29
|
+
import "./skill-commands-B9brPuiL.js";
|
|
30
30
|
import "./fetch-CeWULXBI.js";
|
|
31
|
-
import { n as recordChannelActivity } from "./channel-activity-
|
|
32
|
-
import { t as convertMarkdownTables } from "./tables-
|
|
33
|
-
import "./send-
|
|
34
|
-
import "./outbound-attachment-
|
|
35
|
-
import "./send-
|
|
36
|
-
import "./fetch-
|
|
37
|
-
import { r as setActiveWebListener } from "./active-listener-
|
|
38
|
-
import "./manager-
|
|
39
|
-
import "./query-expansion-
|
|
40
|
-
import { i as markdownToWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./outbound-
|
|
41
|
-
import { i as waitForWaConnection, n as formatError, r as getStatusCode, t as createWaSocket } from "./session-
|
|
42
|
-
import { t as loginWeb } from "./login-
|
|
31
|
+
import { n as recordChannelActivity } from "./channel-activity-DWAER4wd.js";
|
|
32
|
+
import { t as convertMarkdownTables } from "./tables-CjQqTOdD.js";
|
|
33
|
+
import "./send-C-Q_WPMf.js";
|
|
34
|
+
import "./outbound-attachment-BnAVJDLe.js";
|
|
35
|
+
import "./send-DUibfNQD.js";
|
|
36
|
+
import "./fetch-C0iyt-Iz.js";
|
|
37
|
+
import { r as setActiveWebListener } from "./active-listener-Dkhmfuwx.js";
|
|
38
|
+
import "./manager-CwYv8O3T.js";
|
|
39
|
+
import "./query-expansion-BErUY8P2.js";
|
|
40
|
+
import { i as markdownToWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./outbound-Chpiwybe.js";
|
|
41
|
+
import { i as waitForWaConnection, n as formatError, r as getStatusCode, t as createWaSocket } from "./session-B7imi6T5.js";
|
|
42
|
+
import { t as loginWeb } from "./login-p_O59TVQ.js";
|
|
43
43
|
import { randomUUID } from "node:crypto";
|
|
44
44
|
import { DisconnectReason, downloadMediaMessage, extractMessageContent, getContentType, isJidGroup, normalizeMessageContent } from "@whiskeysockets/baileys";
|
|
45
45
|
const DEFAULT_RECONNECT_POLICY = {
|