wednesdayai 0.5.1-dev.36 → 0.5.1-dev.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-scope-cTY4-zRz.js → agent-scope-CoIdVzmg.js} +3 -3
- package/dist/{agent-turn-runner-JxDS9bU_.js → agent-turn-runner-CiEPY6RO.js} +2 -2
- package/dist/{agent-turn-runner-7LQU6Fut.js → agent-turn-runner-DKwd_tAc.js} +6 -6
- package/dist/{api-key-rotation-BCh_J5f6.js → api-key-rotation-CoKWzuyV.js} +2 -2
- package/dist/{audio-preflight-C9EHsVrE.js → audio-preflight-BV83ctbI.js} +23 -23
- package/dist/{audio-preflight-Cxyte-N3.js → audio-preflight-CKFGJslr.js} +3 -3
- package/dist/{audio-transcription-runner-CoyogVcx.js → audio-transcription-runner-B-MEt_yD.js} +1 -1
- package/dist/{audio-transcription-runner-DXlkPfwW.js → audio-transcription-runner-DRUTJgZh.js} +25 -25
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +50 -50
- package/dist/bundled/bootstrap-extra-files/handler.js +5 -5
- package/dist/bundled/command-logger/handler.js +2 -2
- package/dist/bundled/session-journal/handler.js +50 -50
- package/dist/bundled/session-memory/handler.js +50 -50
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{chat-content-Cafge7N8.js → chat-content-01nUeO9I.js} +3 -3
- package/dist/{chat-content-Csm95kDY.js → chat-content-B2kNxQ3a.js} +39 -39
- package/dist/{chrome-H5-7mQ4m.js → chrome-DgDNUC2A.js} +4 -4
- package/dist/{chrome-D-DfD0Cv.js → chrome-kwiyU0Mr.js} +31 -31
- package/dist/{chunk-zortZzCP.js → chunk-BRJHaAd6.js} +3 -3
- package/dist/{command-queue-DfL4YmGb.js → command-queue-CRm1AADE.js} +1 -1
- package/dist/{commands-registry-Vo5C1XbD.js → commands-registry-D3lOVOa7.js} +2 -2
- package/dist/{deliver-BKt_OVTK.js → deliver-BoOCdGXY.js} +28 -28
- package/dist/{deliver-x22mTRDq.js → deliver-CgFkiA4Z.js} +1 -1
- package/dist/{diagnostic-8jsvSbYs.js → diagnostic-BSnQ1U_E.js} +3 -3
- package/dist/{errors-muW4vMSB.js → errors-CgPgYfWg.js} +1 -1
- package/dist/extensionAPI.js +6 -6
- package/dist/{fetch-Ciq99DHJ.js → fetch-BBi5dEoV.js} +8 -8
- package/dist/{fetch-B9Tca1cY.js → fetch-BrwJHFZR.js} +1 -1
- package/dist/{fetch-guard-DaJwMbcY.js → fetch-guard-BcLYPGi1.js} +2 -2
- package/dist/{frontmatter-BzlMEBkz.js → frontmatter-DQTIIgFI.js} +5 -5
- package/dist/{fs-safe-CDfp5e8Q.js → fs-safe-CRbowDkj.js} +26 -26
- package/dist/{ir-BczXO28b.js → ir-D___VWlp.js} +4 -4
- package/dist/{json-files-CNVg1Wi5.js → json-files-CurKd8gy.js} +28 -28
- package/dist/{legacy-names-CRCLZarD.js → legacy-names-D7ywm6_7.js} +1 -1
- package/dist/llm-slug-generator.js +50 -50
- package/dist/{manager-ywiQQ5nv.js → manager-yAtdyPwQ.js} +18 -18
- package/dist/{markdown-tables-CmGUH7Wy.js → markdown-tables-DfqPFbkZ.js} +2 -2
- package/dist/{model-selection-BJZFC8fA.js → model-selection-B7FYf8Fo.js} +83 -83
- package/dist/{outbound-attachment-BXAhY7Q6.js → outbound-attachment-BJq1brbB.js} +2 -2
- package/dist/{outbound-message-hooks-CjfNIFcN.js → outbound-message-hooks-Dl2zci3u.js} +5 -5
- package/dist/{path-alias-guards-BV6CR8H3.js → path-alias-guards-nWrE5acE.js} +1 -1
- package/dist/{pi-embedded-BzjQS2tl.js → pi-embedded-BAKd4NmP.js} +18 -18
- package/dist/{pi-embedded-D6Ti_RiY.js → pi-embedded-_YhHvi3M.js} +258 -258
- package/dist/{pi-model-discovery-PH-bhX7g.js → pi-model-discovery-CusLASy5.js} +7 -7
- package/dist/plugin-sdk/provider-media-understanding.js +7 -7
- package/dist/{proxy-env-DXcKRnns.js → proxy-env-DrmTb0QW.js} +1 -1
- package/dist/{pw-ai-ByUzz5o2.js → pw-ai-BKN66RLi.js} +13 -13
- package/dist/{pw-ai-qlENNDHC.js → pw-ai-CPIjXEgJ.js} +1 -1
- package/dist/{qmd-manager-CPPURYfg.js → qmd-manager-BYC9bX-E.js} +12 -12
- package/dist/{qmd-scope-dd_YbPG-.js → qmd-scope-D6tMcgqR.js} +1 -1
- package/dist/{query-expansion-0S2l-J2-.js → query-expansion-CnQI0IeV.js} +13 -13
- package/dist/{recorder-CrrhLZt5.js → recorder-B7dhxQ62.js} +2 -2
- package/dist/{redact-BkE4uRXu.js → redact-CysJDryP.js} +1 -1
- package/dist/{replies-j6q2EArA.js → replies-CP8xbTSR.js} +5 -5
- package/dist/{reply-prefix-BCu_i91I.js → reply-prefix-C7r81KLS.js} +1 -1
- package/dist/{resolve-route-WUZ7lH6L.js → resolve-route-BvD1w4_v.js} +4 -4
- package/dist/{send-lY0a6iA2.js → send-4WdiWuFu.js} +8 -8
- package/dist/{send-CFG2EYja.js → send-BZv91SjC.js} +6 -6
- package/dist/{send-80rMjd6V.js → send-CjR30q4U.js} +8 -8
- package/dist/{send-D1aXT71a.js → send-bmlVFiBl.js} +7 -7
- package/dist/{session-meta-BjRAI6ON.js → session-meta-BeqTuIFU.js} +1 -1
- package/dist/{sessions-B6iaKddN.js → sessions-BjSGNjb0.js} +5 -5
- package/dist/{skill-commands-BG0ravVA.js → skill-commands-CcrQquVr.js} +8 -8
- package/dist/{store-BXWb__DD.js → store-DniD8E6a.js} +7 -7
- package/dist/{tables-CBpS5G91.js → tables-BbmkAuhA.js} +1 -1
- package/dist/{tokens-Q7TMdIpT.js → tokens-C2ll8wSq.js} +1 -1
- package/dist/{tool-loop-detection-CVIDnpv_.js → tool-loop-detection-B0Jj6y2H.js} +2 -2
- package/dist/{user-run-recording-DNsWtMOn.js → user-run-recording-COpooN64.js} +2 -2
- package/dist/{workspace-D8z8s1Xz.js → workspace-xnzx7wEV.js} +26 -26
- package/extensions/acpx/package.json +1 -1
- package/extensions/anthropic/package.json +1 -1
- package/extensions/bifrost/package.json +1 -1
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/deepgram/package.json +1 -1
- package/extensions/deepinfra/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/diffs/package.json +1 -1
- package/extensions/discord/package.json +1 -1
- package/extensions/dream-cycle/package.json +1 -1
- package/extensions/elevenlabs/package.json +1 -1
- package/extensions/feishu/package.json +1 -1
- package/extensions/gemini-search/package.json +1 -1
- package/extensions/google/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/googlechat/package.json +1 -1
- package/extensions/grok-search/package.json +1 -1
- package/extensions/groq/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/kimi-search/package.json +1 -1
- package/extensions/kokoro/package.json +1 -1
- package/extensions/learning-core/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +1 -1
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +1 -1
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/mistral/package.json +1 -1
- package/extensions/moonshot/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +1 -1
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +1 -1
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/openai/package.json +1 -1
- package/extensions/openai-realtime/package.json +1 -1
- package/extensions/openrouter/package.json +1 -1
- package/extensions/perplexity-search/package.json +1 -1
- package/extensions/searxng-search/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/slack/package.json +1 -1
- package/extensions/synology-chat/package.json +1 -1
- package/extensions/telegram/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +1 -1
- package/extensions/twitch/package.json +1 -1
- package/extensions/ui-surfaces/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +1 -1
- package/extensions/voice-call/package.json +1 -1
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zai/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +1 -1
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +1 -1
- package/extensions/zalouser/package.json +1 -1
- package/package.json +1 -1
- package/dist/github-copilot-token-DrVydgnY.js +0 -106
- package/dist/paths-BIDPYPVC.js +0 -233
- package/dist/subsystem-BOg9wqSC.js +0 -2777
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { l as resolveDefaultAgentId } from "./agent-scope-
|
|
3
|
-
import { l as resolveStateDir } from "./paths-
|
|
4
|
-
import { t as createSubsystemLogger } from "./subsystem-
|
|
5
|
-
import { F as normalizeAgentId, G as normalizeAccountId, I as normalizeMainKey, K as normalizeOptionalAccountId, tt as parseAgentSessionKey } from "./workspace-
|
|
6
|
-
import { $n as getChannelPlugin, Gt as getActivePluginRegistryVersion, Kn as resolveStorePath, On as updateSessionStoreEntry, U as loadConfig, Ut as getActivePluginRegistry, Xn as getChannelDock, bn as loadSessionStore, fn as getConversationReadQuery, pa as resolveOpenClawAgentDir, tr as normalizeChannelId, un as StorageReadAccessError, yn as listConfiguredSessionStorageAgentIds } from "./model-selection-
|
|
7
|
-
import { i as isSilentReplyText, n as SILENT_REPLY_TOKEN } from "./tokens-
|
|
8
|
-
import { L as resolveMainSessionKey, Nt as getGlobalHookRunner, P as canonicalizeMainSessionAlias, a as resolveMirroredTranscriptText, at as eventOrder, i as appendAssistantMessageToSessionTranscript, jt as hasInterSessionUserProvenance, o as parseInlineDirectives } from "./sessions-
|
|
2
|
+
import { l as resolveDefaultAgentId } from "./agent-scope-CoIdVzmg.js";
|
|
3
|
+
import { l as resolveStateDir } from "./paths-B_gs59ga.js";
|
|
4
|
+
import { t as createSubsystemLogger } from "./subsystem-DynBFcQj.js";
|
|
5
|
+
import { F as normalizeAgentId, G as normalizeAccountId, I as normalizeMainKey, K as normalizeOptionalAccountId, tt as parseAgentSessionKey } from "./workspace-xnzx7wEV.js";
|
|
6
|
+
import { $n as getChannelPlugin, Gt as getActivePluginRegistryVersion, Kn as resolveStorePath, On as updateSessionStoreEntry, U as loadConfig, Ut as getActivePluginRegistry, Xn as getChannelDock, bn as loadSessionStore, fn as getConversationReadQuery, pa as resolveOpenClawAgentDir, tr as normalizeChannelId, un as StorageReadAccessError, yn as listConfiguredSessionStorageAgentIds } from "./model-selection-B7FYf8Fo.js";
|
|
7
|
+
import { i as isSilentReplyText, n as SILENT_REPLY_TOKEN } from "./tokens-C2ll8wSq.js";
|
|
8
|
+
import { L as resolveMainSessionKey, Nt as getGlobalHookRunner, P as canonicalizeMainSessionAlias, a as resolveMirroredTranscriptText, at as eventOrder, i as appendAssistantMessageToSessionTranscript, jt as hasInterSessionUserProvenance, o as parseInlineDirectives } from "./sessions-BjSGNjb0.js";
|
|
9
9
|
import { n as generateSecureUuid } from "./secure-random-BDA1WAvZ.js";
|
|
10
|
-
import { i as getAgentScopedMediaLocalRoots } from "./fetch-
|
|
11
|
-
import { n as ensureOpenClawModelsJson, o as isMessagingToolDuplicate, t as extractTextFromChatContent } from "./chat-content-
|
|
12
|
-
import { i as hasErrnoCode } from "./errors-
|
|
13
|
-
import { c as resolveChunkDelivery, d as resolveTextChunkLimit, i as chunkMarkdownTextWithMode, m as parseFenceSpans, n as chunkByParagraph } from "./chunk-
|
|
14
|
-
import { n as resolveMarkdownTableMode } from "./markdown-tables-
|
|
15
|
-
import { d as resolveOutboundSessionId, n as createMessageSentEmitter, t as applyMessageSendingHook } from "./outbound-message-hooks-
|
|
16
|
-
import { l as markdownToSignalTextChunks, t as sendMessageSignal } from "./send-
|
|
10
|
+
import { i as getAgentScopedMediaLocalRoots } from "./fetch-BBi5dEoV.js";
|
|
11
|
+
import { n as ensureOpenClawModelsJson, o as isMessagingToolDuplicate, t as extractTextFromChatContent } from "./chat-content-B2kNxQ3a.js";
|
|
12
|
+
import { i as hasErrnoCode } from "./errors-CgPgYfWg.js";
|
|
13
|
+
import { c as resolveChunkDelivery, d as resolveTextChunkLimit, i as chunkMarkdownTextWithMode, m as parseFenceSpans, n as chunkByParagraph } from "./chunk-BRJHaAd6.js";
|
|
14
|
+
import { n as resolveMarkdownTableMode } from "./markdown-tables-DfqPFbkZ.js";
|
|
15
|
+
import { d as resolveOutboundSessionId, n as createMessageSentEmitter, t as applyMessageSendingHook } from "./outbound-message-hooks-Dl2zci3u.js";
|
|
16
|
+
import { l as markdownToSignalTextChunks, t as sendMessageSignal } from "./send-CjR30q4U.js";
|
|
17
17
|
import path from "node:path";
|
|
18
|
-
import
|
|
18
|
+
import syncFs from "node:fs";
|
|
19
19
|
import { createHash } from "node:crypto";
|
|
20
20
|
import { setTimeout } from "node:timers/promises";
|
|
21
21
|
|
|
@@ -371,7 +371,7 @@ function ensureContextWindowCacheLoaded() {
|
|
|
371
371
|
await ensureOpenClawModelsJson(cfg);
|
|
372
372
|
} catch {}
|
|
373
373
|
try {
|
|
374
|
-
const { discoverAuthStorage, discoverModels } = await import("./pi-model-discovery-
|
|
374
|
+
const { discoverAuthStorage, discoverModels } = await import("./pi-model-discovery-CusLASy5.js").then((n) => n.r);
|
|
375
375
|
const agentDir = resolveOpenClawAgentDir();
|
|
376
376
|
const modelRegistry = discoverModels(discoverAuthStorage(agentDir), agentDir);
|
|
377
377
|
applyDiscoveredContextWindows({
|
|
@@ -871,7 +871,7 @@ function listExistingAgentIdsFromDisk() {
|
|
|
871
871
|
const root = resolveStateDir();
|
|
872
872
|
const agentsDir = path.join(root, "agents");
|
|
873
873
|
try {
|
|
874
|
-
return
|
|
874
|
+
return syncFs.readdirSync(agentsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => normalizeAgentId(entry.name)).filter(Boolean);
|
|
875
875
|
} catch {
|
|
876
876
|
return [];
|
|
877
877
|
}
|
|
@@ -1072,11 +1072,11 @@ function resolveFailedDir(stateDir) {
|
|
|
1072
1072
|
/** Ensure the queue directory (and failed/ subdirectory) exist. */
|
|
1073
1073
|
async function ensureQueueDir(stateDir) {
|
|
1074
1074
|
const queueDir = resolveQueueDir(stateDir);
|
|
1075
|
-
await
|
|
1075
|
+
await syncFs.promises.mkdir(queueDir, {
|
|
1076
1076
|
recursive: true,
|
|
1077
1077
|
mode: 448
|
|
1078
1078
|
});
|
|
1079
|
-
await
|
|
1079
|
+
await syncFs.promises.mkdir(resolveFailedDir(stateDir), {
|
|
1080
1080
|
recursive: true,
|
|
1081
1081
|
mode: 448
|
|
1082
1082
|
});
|
|
@@ -1106,18 +1106,18 @@ async function enqueueDelivery(params, stateDir) {
|
|
|
1106
1106
|
const filePath = path.join(queueDir, `${id}.json`);
|
|
1107
1107
|
const tmp = `${filePath}.${process.pid}.tmp`;
|
|
1108
1108
|
const json = JSON.stringify(entry, null, 2);
|
|
1109
|
-
await
|
|
1109
|
+
await syncFs.promises.writeFile(tmp, json, {
|
|
1110
1110
|
encoding: "utf-8",
|
|
1111
1111
|
mode: 384
|
|
1112
1112
|
});
|
|
1113
|
-
await
|
|
1113
|
+
await syncFs.promises.rename(tmp, filePath);
|
|
1114
1114
|
return id;
|
|
1115
1115
|
}
|
|
1116
1116
|
/** Remove a successfully delivered entry from the queue. */
|
|
1117
1117
|
async function ackDelivery(id, stateDir) {
|
|
1118
1118
|
const filePath = path.join(resolveQueueDir(stateDir), `${id}.json`);
|
|
1119
1119
|
try {
|
|
1120
|
-
await
|
|
1120
|
+
await syncFs.promises.unlink(filePath);
|
|
1121
1121
|
} catch (err) {
|
|
1122
1122
|
if ((err && typeof err === "object" && "code" in err ? String(err.code) : null) !== "ENOENT") throw err;
|
|
1123
1123
|
}
|
|
@@ -1144,22 +1144,22 @@ async function failDelivery(id, error, stateDir) {
|
|
|
1144
1144
|
return serializeByKey(filePath, () => failDeliveryWrite(filePath, error));
|
|
1145
1145
|
}
|
|
1146
1146
|
async function failDeliveryWrite(filePath, error) {
|
|
1147
|
-
const raw = await
|
|
1147
|
+
const raw = await syncFs.promises.readFile(filePath, "utf-8");
|
|
1148
1148
|
const entry = JSON.parse(raw);
|
|
1149
1149
|
entry.retryCount += 1;
|
|
1150
1150
|
entry.lastAttemptAt = Date.now();
|
|
1151
1151
|
entry.lastError = error;
|
|
1152
1152
|
const tmp = `${filePath}.${process.pid}.tmp`;
|
|
1153
|
-
await
|
|
1153
|
+
await syncFs.promises.writeFile(tmp, JSON.stringify(entry, null, 2), {
|
|
1154
1154
|
encoding: "utf-8",
|
|
1155
1155
|
mode: 384
|
|
1156
1156
|
});
|
|
1157
|
-
await
|
|
1157
|
+
await syncFs.promises.rename(tmp, filePath);
|
|
1158
1158
|
}
|
|
1159
1159
|
/** Read a queue entry raw; null when the file is missing. */
|
|
1160
1160
|
async function readEntryFile(filePath) {
|
|
1161
1161
|
try {
|
|
1162
|
-
const raw = await
|
|
1162
|
+
const raw = await syncFs.promises.readFile(filePath, "utf-8");
|
|
1163
1163
|
return JSON.parse(raw);
|
|
1164
1164
|
} catch (err) {
|
|
1165
1165
|
if (hasErrnoCode(err, "ENOENT")) return null;
|
|
@@ -1181,11 +1181,11 @@ function markDeliveryPhase(filePath, transition) {
|
|
|
1181
1181
|
const next = transition(entry);
|
|
1182
1182
|
if (!next.advanced) return next;
|
|
1183
1183
|
const tmp = `${filePath}.${process.pid}.tmp`;
|
|
1184
|
-
await
|
|
1184
|
+
await syncFs.promises.writeFile(tmp, JSON.stringify(next.entry, null, 2), {
|
|
1185
1185
|
encoding: "utf-8",
|
|
1186
1186
|
mode: 384
|
|
1187
1187
|
});
|
|
1188
|
-
await
|
|
1188
|
+
await syncFs.promises.rename(tmp, filePath);
|
|
1189
1189
|
return next;
|
|
1190
1190
|
});
|
|
1191
1191
|
}
|
|
@@ -7,7 +7,7 @@ import { i as isSilentReplyText, n as SILENT_REPLY_TOKEN } from "./tokens-D81t1p
|
|
|
7
7
|
import { L as resolveMainSessionKey, Nt as getGlobalHookRunner, P as canonicalizeMainSessionAlias, a as resolveMirroredTranscriptText, at as eventOrder, i as appendAssistantMessageToSessionTranscript, o as parseInlineDirectives } from "./sessions-DpewQpWj.js";
|
|
8
8
|
import { n as generateSecureUuid } from "./secure-random-CXrBi7Jq.js";
|
|
9
9
|
import { i as getAgentScopedMediaLocalRoots } from "./fetch-EMfyKQ8c.js";
|
|
10
|
-
import { n as ensureOpenClawModelsJson, o as isMessagingToolDuplicate, t as extractTextFromChatContent } from "./chat-content-
|
|
10
|
+
import { n as ensureOpenClawModelsJson, o as isMessagingToolDuplicate, t as extractTextFromChatContent } from "./chat-content-01nUeO9I.js";
|
|
11
11
|
import { i as hasErrnoCode } from "./errors-CwBnqLdW.js";
|
|
12
12
|
import { c as resolveChunkDelivery, d as resolveTextChunkLimit, i as chunkMarkdownTextWithMode, m as parseFenceSpans, n as chunkByParagraph } from "./chunk-B1kH1hpV.js";
|
|
13
13
|
import { n as resolveMarkdownTableMode } from "./markdown-tables-D9rvkGhN.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { t as createSubsystemLogger } from "./subsystem-
|
|
2
|
+
import { t as createSubsystemLogger } from "./subsystem-DynBFcQj.js";
|
|
3
3
|
import { n as resolveProcessScopedMap } from "./plain-object-Doc_YkH1.js";
|
|
4
|
-
import { L as resolveAgentIdFromSessionKey } from "./workspace-
|
|
4
|
+
import { L as resolveAgentIdFromSessionKey } from "./workspace-xnzx7wEV.js";
|
|
5
5
|
import { t as emitDiagnosticEvent } from "./diagnostic-events-BTSwhIfk.js";
|
|
6
6
|
import { a as recordTurnDuration, i as recordSessionChannelCorrelation, r as getDiagnosticSessionState, t as diagnosticSessionStates } from "./diagnostic-session-state-DJQj3Ka7.js";
|
|
7
7
|
import { t as redactIdentifier } from "./redact-identifier-C_VCQ34e.js";
|
|
8
|
-
import { t as redactSensitiveText } from "./redact-
|
|
8
|
+
import { t as redactSensitiveText } from "./redact-CysJDryP.js";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
10
|
|
|
11
11
|
//#region src/agents/command-poll-backoff.ts
|
package/dist/extensionAPI.js
CHANGED
|
@@ -7,7 +7,7 @@ import "./github-copilot-token-BJeEWDJb.js";
|
|
|
7
7
|
import "./send-CGdfXpKz.js";
|
|
8
8
|
import "./send-B_ZucklA.js";
|
|
9
9
|
import "./tokens-D81t1pbF.js";
|
|
10
|
-
import { a as resolveAgentTimeoutMs, t as runEmbeddedPiAgent } from "./pi-embedded-
|
|
10
|
+
import { a as resolveAgentTimeoutMs, t as runEmbeddedPiAgent } from "./pi-embedded-BAKd4NmP.js";
|
|
11
11
|
import "./sessions-DpewQpWj.js";
|
|
12
12
|
import "./diagnostic-events-DMwgeRgr.js";
|
|
13
13
|
import "./diagnostic-XckGznW_.js";
|
|
@@ -16,8 +16,8 @@ import "./redact-DsVjtfGq.js";
|
|
|
16
16
|
import "./command-queue-K_AfPnin.js";
|
|
17
17
|
import "./fetch-EMfyKQ8c.js";
|
|
18
18
|
import "./pi-model-discovery-DvJxbshP.js";
|
|
19
|
-
import "./chat-content-
|
|
20
|
-
import "./chrome-
|
|
19
|
+
import "./chat-content-01nUeO9I.js";
|
|
20
|
+
import "./chrome-kwiyU0Mr.js";
|
|
21
21
|
import "./json-files-BATYfXx7.js";
|
|
22
22
|
import "./path-alias-guards-DQnGmIZb.js";
|
|
23
23
|
import "./errors-CwBnqLdW.js";
|
|
@@ -26,7 +26,7 @@ import "./proxy-env-Bs474VeG.js";
|
|
|
26
26
|
import "./store-C61Zp9wj.js";
|
|
27
27
|
import "./fetch-guard-BEeIyqsn.js";
|
|
28
28
|
import "./thinking-BOHpxvdU.js";
|
|
29
|
-
import "./audio-transcription-runner-
|
|
29
|
+
import "./audio-transcription-runner-B-MEt_yD.js";
|
|
30
30
|
import "./api-key-rotation-CzNIm6xw.js";
|
|
31
31
|
import "./chunk-B1kH1hpV.js";
|
|
32
32
|
import "./markdown-tables-D9rvkGhN.js";
|
|
@@ -35,10 +35,10 @@ import "./render-DSLzcBxk.js";
|
|
|
35
35
|
import "./commands-registry-HSwuwV_9.js";
|
|
36
36
|
import "./user-run-recording-B2ufmO0r.js";
|
|
37
37
|
import "./recorder-BOR-jLfu.js";
|
|
38
|
-
import "./agent-turn-runner-
|
|
38
|
+
import "./agent-turn-runner-CiEPY6RO.js";
|
|
39
39
|
import "./skill-commands-Bcc0IOwG.js";
|
|
40
40
|
import "./outbound-message-hooks-DYzUasBA.js";
|
|
41
|
-
import "./deliver-
|
|
41
|
+
import "./deliver-CgFkiA4Z.js";
|
|
42
42
|
import "./fetch-wfPHbAnw.js";
|
|
43
43
|
import "./tables-CNp0EK8h.js";
|
|
44
44
|
import "./send-D6i2jgso.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { c as resolveAgentWorkspaceDir } from "./agent-scope-
|
|
2
|
-
import { l as resolveStateDir } from "./paths-
|
|
3
|
-
import { mt as resolvePreferredOpenClawTmpDir } from "./subsystem-
|
|
1
|
+
import { c as resolveAgentWorkspaceDir } from "./agent-scope-CoIdVzmg.js";
|
|
2
|
+
import { l as resolveStateDir } from "./paths-B_gs59ga.js";
|
|
3
|
+
import { mt as resolvePreferredOpenClawTmpDir } from "./subsystem-DynBFcQj.js";
|
|
4
4
|
import { n as resolveProcessScopedMap } from "./plain-object-Doc_YkH1.js";
|
|
5
|
-
import { _ as runExec } from "./workspace-
|
|
6
|
-
import { U as loadConfig } from "./model-selection-
|
|
7
|
-
import { t as redactSensitiveText } from "./redact-
|
|
8
|
-
import { n as formatErrorChainMessage } from "./errors-
|
|
9
|
-
import { n as withStrictGuardedFetchMode, s as resolveNetworkSsrFPolicy, t as fetchWithSsrFGuard } from "./fetch-guard-
|
|
5
|
+
import { _ as runExec } from "./workspace-xnzx7wEV.js";
|
|
6
|
+
import { U as loadConfig } from "./model-selection-B7FYf8Fo.js";
|
|
7
|
+
import { t as redactSensitiveText } from "./redact-CysJDryP.js";
|
|
8
|
+
import { n as formatErrorChainMessage } from "./errors-CgPgYfWg.js";
|
|
9
|
+
import { n as withStrictGuardedFetchMode, s as resolveNetworkSsrFPolicy, t as fetchWithSsrFGuard } from "./fetch-guard-BcLYPGi1.js";
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
import os from "node:os";
|
|
12
12
|
import fs from "node:fs/promises";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as logWarn, x as logInfo } from "./workspace-
|
|
2
|
-
import { c as resolvePinnedHostnameWithPolicy, i as createPinnedDispatcher, n as SsrFBlockedError, o as isPrivateIpAddress, r as closeDispatcher, t as hasProxyEnvConfigured } from "./proxy-env-
|
|
1
|
+
import { S as logWarn, x as logInfo } from "./workspace-xnzx7wEV.js";
|
|
2
|
+
import { c as resolvePinnedHostnameWithPolicy, i as createPinnedDispatcher, n as SsrFBlockedError, o as isPrivateIpAddress, r as closeDispatcher, t as hasProxyEnvConfigured } from "./proxy-env-DrmTb0QW.js";
|
|
3
3
|
import { EnvHttpProxyAgent, FormData, ProxyAgent, fetch as fetch$1 } from "undici";
|
|
4
4
|
|
|
5
5
|
//#region src/infra/net/ssrf-config.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { s as parseBooleanValue, t as readManifestNamespace } from "./legacy-names-
|
|
1
|
+
import { s as parseBooleanValue, t as readManifestNamespace } from "./legacy-names-D7ywm6_7.js";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import syncFs from "node:fs";
|
|
4
|
+
import JSON5 from "json5";
|
|
5
5
|
import YAML from "yaml";
|
|
6
6
|
|
|
7
7
|
//#region src/shared/config-eval.ts
|
|
@@ -92,7 +92,7 @@ function hasBinary(bin) {
|
|
|
92
92
|
for (const part of parts) for (const ext of extensions) {
|
|
93
93
|
const candidate = path.join(part, bin + ext);
|
|
94
94
|
try {
|
|
95
|
-
|
|
95
|
+
syncFs.accessSync(candidate, syncFs.constants.X_OK);
|
|
96
96
|
hasBinaryCache.set(bin, true);
|
|
97
97
|
return true;
|
|
98
98
|
} catch {}
|
|
@@ -258,7 +258,7 @@ function resolveOpenClawManifestBlock(params) {
|
|
|
258
258
|
const raw = getFrontmatterString(params.frontmatter, params.key ?? "metadata");
|
|
259
259
|
if (!raw) return;
|
|
260
260
|
try {
|
|
261
|
-
const parsed =
|
|
261
|
+
const parsed = JSON5.parse(raw);
|
|
262
262
|
if (!parsed || typeof parsed !== "object") return;
|
|
263
263
|
return readManifestNamespace(parsed);
|
|
264
264
|
} catch {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { u as expandHomePrefix } from "./paths-
|
|
2
|
-
import { B as hasNodeErrorCode, H as isPathInside, I as sameFileIdentity, U as isSymlinkOpenError, V as isNotFoundPathError } from "./subsystem-
|
|
3
|
-
import { S as logWarn } from "./workspace-
|
|
4
|
-
import { n as assertNoPathAliasEscape } from "./path-alias-guards-
|
|
1
|
+
import { u as expandHomePrefix } from "./paths-B_gs59ga.js";
|
|
2
|
+
import { B as hasNodeErrorCode, H as isPathInside, I as sameFileIdentity, U as isSymlinkOpenError, V as isNotFoundPathError } from "./subsystem-DynBFcQj.js";
|
|
3
|
+
import { S as logWarn } from "./workspace-xnzx7wEV.js";
|
|
4
|
+
import { n as assertNoPathAliasEscape } from "./path-alias-guards-nWrE5acE.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { constants } from "node:fs";
|
|
7
7
|
import os from "node:os";
|
|
8
|
-
import fs
|
|
8
|
+
import fs from "node:fs/promises";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
10
10
|
import { pipeline } from "node:stream/promises";
|
|
11
11
|
|
|
@@ -25,19 +25,19 @@ const ensureTrailingSep = (value) => value.endsWith(path.sep) ? value : value +
|
|
|
25
25
|
async function expandRelativePathWithHome(relativePath) {
|
|
26
26
|
let home = process.env.HOME || process.env.USERPROFILE || os.homedir();
|
|
27
27
|
try {
|
|
28
|
-
home = await fs
|
|
28
|
+
home = await fs.realpath(home);
|
|
29
29
|
} catch {}
|
|
30
30
|
return expandHomePrefix(relativePath, { home });
|
|
31
31
|
}
|
|
32
32
|
async function openVerifiedLocalFile(filePath, options) {
|
|
33
33
|
try {
|
|
34
|
-
if ((await fs
|
|
34
|
+
if ((await fs.lstat(filePath)).isDirectory()) throw new SafeOpenError("not-file", "not a file");
|
|
35
35
|
} catch (err) {
|
|
36
36
|
if (err instanceof SafeOpenError) throw err;
|
|
37
37
|
}
|
|
38
38
|
let handle;
|
|
39
39
|
try {
|
|
40
|
-
handle = await fs
|
|
40
|
+
handle = await fs.open(filePath, OPEN_READ_FLAGS);
|
|
41
41
|
} catch (err) {
|
|
42
42
|
if (isNotFoundPathError(err)) throw new SafeOpenError("not-found", "file not found");
|
|
43
43
|
if (isSymlinkOpenError(err)) throw new SafeOpenError("symlink", "symlink open blocked", { cause: err });
|
|
@@ -45,13 +45,13 @@ async function openVerifiedLocalFile(filePath, options) {
|
|
|
45
45
|
throw err;
|
|
46
46
|
}
|
|
47
47
|
try {
|
|
48
|
-
const [stat, lstat] = await Promise.all([handle.stat(), fs
|
|
48
|
+
const [stat, lstat] = await Promise.all([handle.stat(), fs.lstat(filePath)]);
|
|
49
49
|
if (lstat.isSymbolicLink()) throw new SafeOpenError("symlink", "symlink not allowed");
|
|
50
50
|
if (!stat.isFile()) throw new SafeOpenError("not-file", "not a file");
|
|
51
51
|
if (options?.rejectHardlinks && stat.nlink > 1) throw new SafeOpenError("invalid-path", "hardlinked path not allowed");
|
|
52
52
|
if (!sameFileIdentity(stat, lstat)) throw new SafeOpenError("path-mismatch", "path changed during read");
|
|
53
|
-
const realPath = await fs
|
|
54
|
-
const realStat = await fs
|
|
53
|
+
const realPath = await fs.realpath(filePath);
|
|
54
|
+
const realStat = await fs.stat(realPath);
|
|
55
55
|
if (options?.rejectHardlinks && realStat.nlink > 1) throw new SafeOpenError("invalid-path", "hardlinked path not allowed");
|
|
56
56
|
if (!sameFileIdentity(stat, realStat)) throw new SafeOpenError("path-mismatch", "path mismatch");
|
|
57
57
|
return {
|
|
@@ -69,7 +69,7 @@ async function openVerifiedLocalFile(filePath, options) {
|
|
|
69
69
|
async function resolvePathWithinRoot(params) {
|
|
70
70
|
let rootReal;
|
|
71
71
|
try {
|
|
72
|
-
rootReal = await fs
|
|
72
|
+
rootReal = await fs.realpath(params.rootDir);
|
|
73
73
|
} catch (err) {
|
|
74
74
|
if (isNotFoundPathError(err)) throw new SafeOpenError("not-found", "root dir not found");
|
|
75
75
|
throw err;
|
|
@@ -170,7 +170,7 @@ function buildAtomicWriteTempPath(targetPath) {
|
|
|
170
170
|
return path.join(dir, `.${base}.${process.pid}.${randomUUID()}.tmp`);
|
|
171
171
|
}
|
|
172
172
|
async function writeTempFileForAtomicReplace(params) {
|
|
173
|
-
const tempHandle = await fs
|
|
173
|
+
const tempHandle = await fs.open(params.tempPath, OPEN_WRITE_CREATE_FLAGS, params.mode);
|
|
174
174
|
try {
|
|
175
175
|
if (typeof params.data === "string") await tempHandle.writeFile(params.data, params.encoding ?? "utf8");
|
|
176
176
|
else await tempHandle.writeFile(params.data);
|
|
@@ -180,7 +180,7 @@ async function writeTempFileForAtomicReplace(params) {
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
async function verifyAtomicWriteResult(params) {
|
|
183
|
-
const rootWithSep = ensureTrailingSep(await fs
|
|
183
|
+
const rootWithSep = ensureTrailingSep(await fs.realpath(params.rootDir));
|
|
184
184
|
const opened = await openVerifiedLocalFile(params.targetPath, { rejectHardlinks: true });
|
|
185
185
|
try {
|
|
186
186
|
if (!sameFileIdentity(opened.stat, params.expectedStat)) throw new SafeOpenError("path-mismatch", "path changed during write");
|
|
@@ -191,13 +191,13 @@ async function verifyAtomicWriteResult(params) {
|
|
|
191
191
|
}
|
|
192
192
|
async function resolveOpenedFileRealPathForHandle(handle, ioPath) {
|
|
193
193
|
try {
|
|
194
|
-
return await fs
|
|
194
|
+
return await fs.realpath(ioPath);
|
|
195
195
|
} catch (err) {
|
|
196
196
|
if (!isNotFoundPathError(err)) throw err;
|
|
197
197
|
}
|
|
198
198
|
const fdCandidates = process.platform === "linux" ? [`/proc/self/fd/${handle.fd}`, `/dev/fd/${handle.fd}`] : process.platform === "win32" ? [] : [`/dev/fd/${handle.fd}`];
|
|
199
199
|
for (const fdPath of fdCandidates) try {
|
|
200
|
-
return await fs
|
|
200
|
+
return await fs.realpath(fdPath);
|
|
201
201
|
} catch {}
|
|
202
202
|
throw new SafeOpenError("path-mismatch", "unable to resolve opened file path");
|
|
203
203
|
}
|
|
@@ -212,10 +212,10 @@ async function openWritableFileWithinRoot(params) {
|
|
|
212
212
|
} catch (err) {
|
|
213
213
|
throw new SafeOpenError("invalid-path", "path alias escape blocked", { cause: err });
|
|
214
214
|
}
|
|
215
|
-
if (params.mkdir !== false) await fs
|
|
215
|
+
if (params.mkdir !== false) await fs.mkdir(path.dirname(resolved), { recursive: true });
|
|
216
216
|
let ioPath = resolved;
|
|
217
217
|
try {
|
|
218
|
-
const resolvedRealPath = await fs
|
|
218
|
+
const resolvedRealPath = await fs.realpath(resolved);
|
|
219
219
|
if (!isPathInside(rootWithSep, resolvedRealPath)) throw new SafeOpenError("outside-workspace", "file is outside workspace root");
|
|
220
220
|
ioPath = resolvedRealPath;
|
|
221
221
|
} catch (err) {
|
|
@@ -227,10 +227,10 @@ async function openWritableFileWithinRoot(params) {
|
|
|
227
227
|
let createdForWrite = false;
|
|
228
228
|
try {
|
|
229
229
|
try {
|
|
230
|
-
handle = await fs
|
|
230
|
+
handle = await fs.open(ioPath, OPEN_WRITE_EXISTING_FLAGS, fileMode);
|
|
231
231
|
} catch (err) {
|
|
232
232
|
if (!isNotFoundPathError(err)) throw err;
|
|
233
|
-
handle = await fs
|
|
233
|
+
handle = await fs.open(ioPath, OPEN_WRITE_CREATE_FLAGS, fileMode);
|
|
234
234
|
createdForWrite = true;
|
|
235
235
|
}
|
|
236
236
|
} catch (err) {
|
|
@@ -244,7 +244,7 @@ async function openWritableFileWithinRoot(params) {
|
|
|
244
244
|
if (!stat.isFile()) throw new SafeOpenError("invalid-path", "path is not a regular file under root");
|
|
245
245
|
if (stat.nlink > 1) throw new SafeOpenError("invalid-path", "hardlinked path not allowed");
|
|
246
246
|
try {
|
|
247
|
-
const lstat = await fs
|
|
247
|
+
const lstat = await fs.lstat(ioPath);
|
|
248
248
|
if (lstat.isSymbolicLink() || !lstat.isFile()) throw new SafeOpenError("invalid-path", "path is not a regular file under root");
|
|
249
249
|
if (!sameFileIdentity(stat, lstat)) throw new SafeOpenError("path-mismatch", "path changed during write");
|
|
250
250
|
} catch (err) {
|
|
@@ -252,7 +252,7 @@ async function openWritableFileWithinRoot(params) {
|
|
|
252
252
|
}
|
|
253
253
|
const realPath = await resolveOpenedFileRealPathForHandle(handle, ioPath);
|
|
254
254
|
openedRealPath = realPath;
|
|
255
|
-
const realStat = await fs
|
|
255
|
+
const realStat = await fs.stat(realPath);
|
|
256
256
|
if (!sameFileIdentity(stat, realStat)) throw new SafeOpenError("path-mismatch", "path mismatch");
|
|
257
257
|
if (realStat.nlink > 1) throw new SafeOpenError("invalid-path", "hardlinked path not allowed");
|
|
258
258
|
if (!isPathInside(rootWithSep, realPath)) throw new SafeOpenError("outside-workspace", "file is outside workspace root");
|
|
@@ -267,7 +267,7 @@ async function openWritableFileWithinRoot(params) {
|
|
|
267
267
|
const cleanupCreatedPath = createdForWrite && err instanceof SafeOpenError;
|
|
268
268
|
const cleanupPath = openedRealPath ?? ioPath;
|
|
269
269
|
await handle.close().catch(() => {});
|
|
270
|
-
if (cleanupCreatedPath) await fs
|
|
270
|
+
if (cleanupCreatedPath) await fs.rm(cleanupPath, { force: true }).catch(() => {});
|
|
271
271
|
throw err;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
@@ -290,7 +290,7 @@ async function writeFileWithinRoot(params) {
|
|
|
290
290
|
encoding: params.encoding,
|
|
291
291
|
mode: targetMode || 384
|
|
292
292
|
});
|
|
293
|
-
await fs
|
|
293
|
+
await fs.rename(tempPath, destinationPath);
|
|
294
294
|
tempPath = null;
|
|
295
295
|
try {
|
|
296
296
|
await verifyAtomicWriteResult({
|
|
@@ -303,7 +303,7 @@ async function writeFileWithinRoot(params) {
|
|
|
303
303
|
throw err;
|
|
304
304
|
}
|
|
305
305
|
} finally {
|
|
306
|
-
if (tempPath) await fs
|
|
306
|
+
if (tempPath) await fs.rm(tempPath, { force: true }).catch(() => {});
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
async function copyFileWithinRoot(params) {
|
|
@@ -331,7 +331,7 @@ async function copyFileWithinRoot(params) {
|
|
|
331
331
|
});
|
|
332
332
|
await pipeline(sourceStream, targetStream);
|
|
333
333
|
} catch (err) {
|
|
334
|
-
if (target?.createdForWrite) await fs
|
|
334
|
+
if (target?.createdForWrite) await fs.rm(target.openedRealPath, { force: true }).catch(() => {});
|
|
335
335
|
throw err;
|
|
336
336
|
} finally {
|
|
337
337
|
if (!sourceClosedByStream) await source.handle.close().catch(() => {});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { f as logVerbose, h as shouldLogVerbose, st as resolveUserPath } from "./subsystem-
|
|
2
|
-
import { a as getDefaultMediaLocalRoots, c as convertHeicToJpeg, d as optimizeImageToPng, f as resizeToJpeg, m as extensionForMime, n as fetchRemoteMedia, p as detectMime, u as hasAlphaChannel, v as kindFromMime, x as maxBytesForKind } from "./fetch-
|
|
3
|
-
import { o as readLocalFileSafely, t as SafeOpenError } from "./fs-safe-
|
|
4
|
-
import { a as chunkText } from "./chunk-
|
|
1
|
+
import { f as logVerbose, h as shouldLogVerbose, st as resolveUserPath } from "./subsystem-DynBFcQj.js";
|
|
2
|
+
import { a as getDefaultMediaLocalRoots, c as convertHeicToJpeg, d as optimizeImageToPng, f as resizeToJpeg, m as extensionForMime, n as fetchRemoteMedia, p as detectMime, u as hasAlphaChannel, v as kindFromMime, x as maxBytesForKind } from "./fetch-BBi5dEoV.js";
|
|
3
|
+
import { o as readLocalFileSafely, t as SafeOpenError } from "./fs-safe-CRbowDkj.js";
|
|
4
|
+
import { a as chunkText } from "./chunk-BRJHaAd6.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import fs from "node:fs/promises";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { m as normalizeSkillFilter } from "./agent-scope-
|
|
2
|
-
import { H as isPathInside, K as isDangerousHostEnvVarName, N as isPathInsideWithRealpath, Z as CONFIG_DIR, mt as resolvePreferredOpenClawTmpDir, st as resolveUserPath, t as createSubsystemLogger } from "./subsystem-
|
|
1
|
+
import { m as normalizeSkillFilter } from "./agent-scope-CoIdVzmg.js";
|
|
2
|
+
import { H as isPathInside, K as isDangerousHostEnvVarName, N as isPathInsideWithRealpath, Z as CONFIG_DIR, mt as resolvePreferredOpenClawTmpDir, st as resolveUserPath, t as createSubsystemLogger } from "./subsystem-DynBFcQj.js";
|
|
3
3
|
import { n as resolveProcessScopedMap } from "./plain-object-Doc_YkH1.js";
|
|
4
|
-
import { h as resolveOpenClawPackageRootSync } from "./workspace-
|
|
5
|
-
import { At as resolveMemorySlotDecision, Ot as normalizePluginsConfig, Sa as normalizeResolvedSecretInputString, kt as resolveEffectiveEnableState, wt as loadPluginManifestRegistry } from "./model-selection-
|
|
6
|
-
import { a as resolveOpenClawManifestBlock, c as resolveOpenClawManifestRequires, d as hasBinary, f as isConfigPathTruthyWithDefaults, i as parseOpenClawManifestInstallBase, l as parseFrontmatterBlock, n as normalizeStringList, o as resolveOpenClawManifestInstall, r as parseFrontmatterBool, s as resolveOpenClawManifestOs, t as getFrontmatterString, u as evaluateRuntimeEligibility } from "./frontmatter-
|
|
7
|
-
import { n as assertNoPathAliasEscape } from "./path-alias-guards-
|
|
4
|
+
import { h as resolveOpenClawPackageRootSync } from "./workspace-xnzx7wEV.js";
|
|
5
|
+
import { At as resolveMemorySlotDecision, Ot as normalizePluginsConfig, Sa as normalizeResolvedSecretInputString, kt as resolveEffectiveEnableState, wt as loadPluginManifestRegistry } from "./model-selection-B7FYf8Fo.js";
|
|
6
|
+
import { a as resolveOpenClawManifestBlock, c as resolveOpenClawManifestRequires, d as hasBinary, f as isConfigPathTruthyWithDefaults, i as parseOpenClawManifestInstallBase, l as parseFrontmatterBlock, n as normalizeStringList, o as resolveOpenClawManifestInstall, r as parseFrontmatterBool, s as resolveOpenClawManifestOs, t as getFrontmatterString, u as evaluateRuntimeEligibility } from "./frontmatter-DQTIIgFI.js";
|
|
7
|
+
import { n as assertNoPathAliasEscape } from "./path-alias-guards-nWrE5acE.js";
|
|
8
8
|
import path from "node:path";
|
|
9
|
-
import
|
|
9
|
+
import syncFs from "node:fs";
|
|
10
10
|
import os from "node:os";
|
|
11
|
-
import fs
|
|
11
|
+
import fs from "node:fs/promises";
|
|
12
12
|
import { URL as URL$1, fileURLToPath } from "node:url";
|
|
13
13
|
import { randomUUID } from "node:crypto";
|
|
14
14
|
import { formatSkillsForPrompt, loadSkillsFromDir } from "@mariozechner/pi-coding-agent";
|
|
@@ -545,13 +545,13 @@ function shortPath(value) {
|
|
|
545
545
|
//#region src/agents/skills/bundled-dir.ts
|
|
546
546
|
function looksLikeSkillsDir(dir) {
|
|
547
547
|
try {
|
|
548
|
-
const entries =
|
|
548
|
+
const entries = syncFs.readdirSync(dir, { withFileTypes: true });
|
|
549
549
|
for (const entry of entries) {
|
|
550
550
|
if (entry.name.startsWith(".")) continue;
|
|
551
551
|
const fullPath = path.join(dir, entry.name);
|
|
552
552
|
if (entry.isFile() && entry.name.endsWith(".md")) return true;
|
|
553
553
|
if (entry.isDirectory()) {
|
|
554
|
-
if (
|
|
554
|
+
if (syncFs.existsSync(path.join(fullPath, "SKILL.md"))) return true;
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
} catch {
|
|
@@ -566,7 +566,7 @@ function resolveBundledSkillsDir(opts = {}) {
|
|
|
566
566
|
const execPath = opts.execPath ?? process.execPath;
|
|
567
567
|
const execDir = path.dirname(execPath);
|
|
568
568
|
const sibling = path.join(execDir, "skills");
|
|
569
|
-
if (
|
|
569
|
+
if (syncFs.existsSync(sibling)) return sibling;
|
|
570
570
|
} catch {}
|
|
571
571
|
try {
|
|
572
572
|
const moduleUrl = opts.moduleUrl ?? import.meta.url;
|
|
@@ -629,7 +629,7 @@ function resolvePluginSkillDirs(params) {
|
|
|
629
629
|
const trimmed = raw.trim();
|
|
630
630
|
if (!trimmed) continue;
|
|
631
631
|
const candidate = path.resolve(record.rootDir, trimmed);
|
|
632
|
-
if (!
|
|
632
|
+
if (!syncFs.existsSync(candidate)) {
|
|
633
633
|
log.warn(`plugin skill path not found (${record.id}): ${candidate}`);
|
|
634
634
|
continue;
|
|
635
635
|
}
|
|
@@ -660,7 +660,7 @@ async function serializeByKey(key, task) {
|
|
|
660
660
|
|
|
661
661
|
//#endregion
|
|
662
662
|
//#region src/agents/skills/workspace.ts
|
|
663
|
-
const fsp =
|
|
663
|
+
const fsp = syncFs.promises;
|
|
664
664
|
const skillsLogger = createSubsystemLogger("skills");
|
|
665
665
|
const skillCommandDebugOnceState = resolveProcessScopedMap(Symbol.for("openclaw.agents.skills.workspace.skillCommandDebugOnce"));
|
|
666
666
|
const skillCommandDebugOnce = skillCommandDebugOnceState.get("value") ?? /* @__PURE__ */ new Set();
|
|
@@ -739,7 +739,7 @@ function resolveSkillsLimits(config) {
|
|
|
739
739
|
}
|
|
740
740
|
function listChildDirectories(dir) {
|
|
741
741
|
try {
|
|
742
|
-
const entries =
|
|
742
|
+
const entries = syncFs.readdirSync(dir, { withFileTypes: true });
|
|
743
743
|
const dirs = [];
|
|
744
744
|
for (const entry of entries) {
|
|
745
745
|
if (entry.name.startsWith(".")) continue;
|
|
@@ -750,7 +750,7 @@ function listChildDirectories(dir) {
|
|
|
750
750
|
continue;
|
|
751
751
|
}
|
|
752
752
|
if (entry.isSymbolicLink()) try {
|
|
753
|
-
if (
|
|
753
|
+
if (syncFs.statSync(fullPath).isDirectory()) dirs.push(entry.name);
|
|
754
754
|
} catch {}
|
|
755
755
|
}
|
|
756
756
|
return dirs;
|
|
@@ -761,7 +761,7 @@ function listChildDirectories(dir) {
|
|
|
761
761
|
function resolveNestedSkillsRoot(dir, opts) {
|
|
762
762
|
const nested = path.join(dir, "skills");
|
|
763
763
|
try {
|
|
764
|
-
if (!
|
|
764
|
+
if (!syncFs.existsSync(nested) || !syncFs.statSync(nested).isDirectory()) return { baseDir: dir };
|
|
765
765
|
} catch {
|
|
766
766
|
return { baseDir: dir };
|
|
767
767
|
}
|
|
@@ -770,7 +770,7 @@ function resolveNestedSkillsRoot(dir, opts) {
|
|
|
770
770
|
const toScan = scanLimit === 0 ? [] : nestedDirs.slice(0, Math.min(nestedDirs.length, scanLimit));
|
|
771
771
|
for (const name of toScan) {
|
|
772
772
|
const skillMd = path.join(nested, name, "SKILL.md");
|
|
773
|
-
if (
|
|
773
|
+
if (syncFs.existsSync(skillMd)) return {
|
|
774
774
|
baseDir: nested,
|
|
775
775
|
note: `Detected nested skills root at ${nested}`
|
|
776
776
|
};
|
|
@@ -790,9 +790,9 @@ function loadSkillEntries(workspaceDir, opts) {
|
|
|
790
790
|
const loadSkills = (params) => {
|
|
791
791
|
const baseDir = resolveNestedSkillsRoot(params.dir, { maxEntriesToScan: limits.maxCandidatesPerRoot }).baseDir;
|
|
792
792
|
const rootSkillMd = path.join(baseDir, "SKILL.md");
|
|
793
|
-
if (
|
|
793
|
+
if (syncFs.existsSync(rootSkillMd)) {
|
|
794
794
|
try {
|
|
795
|
-
const size =
|
|
795
|
+
const size = syncFs.statSync(rootSkillMd).size;
|
|
796
796
|
if (size > limits.maxSkillFileBytes) {
|
|
797
797
|
skillsLogger.warn("Skipping skills root due to oversized SKILL.md.", {
|
|
798
798
|
dir: baseDir,
|
|
@@ -831,9 +831,9 @@ function loadSkillEntries(workspaceDir, opts) {
|
|
|
831
831
|
for (const name of limitedChildren) {
|
|
832
832
|
const skillDir = path.join(baseDir, name);
|
|
833
833
|
const skillMd = path.join(skillDir, "SKILL.md");
|
|
834
|
-
if (!
|
|
834
|
+
if (!syncFs.existsSync(skillMd)) continue;
|
|
835
835
|
try {
|
|
836
|
-
const size =
|
|
836
|
+
const size = syncFs.statSync(skillMd).size;
|
|
837
837
|
if (size > limits.maxSkillFileBytes) {
|
|
838
838
|
skillsLogger.warn("Skipping skill due to oversized SKILL.md.", {
|
|
839
839
|
skill: name,
|
|
@@ -901,7 +901,7 @@ function loadSkillEntries(workspaceDir, opts) {
|
|
|
901
901
|
return Array.from(merged.values()).map((skill) => {
|
|
902
902
|
let frontmatter = {};
|
|
903
903
|
try {
|
|
904
|
-
frontmatter = parseFrontmatter(
|
|
904
|
+
frontmatter = parseFrontmatter(syncFs.readFileSync(skill.filePath, "utf-8"));
|
|
905
905
|
} catch {}
|
|
906
906
|
return {
|
|
907
907
|
skill,
|
|
@@ -1139,7 +1139,7 @@ function buildWorkspaceSkillCommandSpecs(workspaceDir, opts) {
|
|
|
1139
1139
|
//#region src/infra/json-files.ts
|
|
1140
1140
|
async function readJsonFile(filePath) {
|
|
1141
1141
|
try {
|
|
1142
|
-
const raw = await fs
|
|
1142
|
+
const raw = await fs.readFile(filePath, "utf8");
|
|
1143
1143
|
return JSON.parse(raw);
|
|
1144
1144
|
} catch {
|
|
1145
1145
|
return null;
|
|
@@ -1154,7 +1154,7 @@ async function writeJsonAtomic(filePath, value, options) {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
async function chmodIfSupported(filePath, mode) {
|
|
1156
1156
|
try {
|
|
1157
|
-
await fs
|
|
1157
|
+
await fs.chmod(filePath, mode);
|
|
1158
1158
|
} catch (err) {
|
|
1159
1159
|
if (process.platform === "win32") return;
|
|
1160
1160
|
throw err;
|
|
@@ -1165,18 +1165,18 @@ async function writeTextAtomic(filePath, content, options) {
|
|
|
1165
1165
|
const payload = options?.appendTrailingNewline && !content.endsWith("\n") ? `${content}\n` : content;
|
|
1166
1166
|
const mkdirOptions = { recursive: true };
|
|
1167
1167
|
if (typeof options?.ensureDirMode === "number") mkdirOptions.mode = options.ensureDirMode;
|
|
1168
|
-
await fs
|
|
1168
|
+
await fs.mkdir(path.dirname(filePath), mkdirOptions);
|
|
1169
1169
|
const tmp = `${filePath}.${randomUUID()}.tmp`;
|
|
1170
1170
|
try {
|
|
1171
|
-
await fs
|
|
1171
|
+
await fs.writeFile(tmp, payload, {
|
|
1172
1172
|
encoding: "utf8",
|
|
1173
1173
|
mode
|
|
1174
1174
|
});
|
|
1175
1175
|
await chmodIfSupported(tmp, mode);
|
|
1176
|
-
await fs
|
|
1176
|
+
await fs.rename(tmp, filePath);
|
|
1177
1177
|
await chmodIfSupported(filePath, mode);
|
|
1178
1178
|
} finally {
|
|
1179
|
-
await fs
|
|
1179
|
+
await fs.rm(tmp, { force: true }).catch(() => void 0);
|
|
1180
1180
|
}
|
|
1181
1181
|
}
|
|
1182
1182
|
function createAsyncLock() {
|