@symerian/symi 2.6.38 → 2.6.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{accounts-BRw8yhIW.js → accounts-D1r2dq1t.js} +21 -21
- package/dist/{accounts-3dCrO3oZ.js → accounts-dRUMQQrB.js} +1 -1
- package/dist/{accounts-BuZxOb3B.js → accounts-wSphH5gv.js} +1 -1
- package/dist/{active-listener-Br2FcRv7.js → active-listener-C3pfJhdC.js} +1 -1
- package/dist/{agent-scope-CpEJ0B88.js → agent-scope-D68_xfTL.js} +3 -3
- package/dist/{audio-preflight-DBMz5TQp.js → audio-preflight-DZ_2w4B5.js} +4 -4
- package/dist/{audio-preflight-Cz1htqcz.js → audio-preflight-UXg8r6a7.js} +29 -29
- package/dist/{auth-profiles-q3HjbboY.js → auth-profiles-CZZjOpX8.js} +17 -17
- package/dist/{bindings-BsHoBLIE.js → bindings-Bat2RnAR.js} +2 -2
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +54 -54
- package/dist/bundled/bootstrap-extra-files/handler.js +5 -5
- package/dist/bundled/command-logger/handler.js +1 -1
- package/dist/bundled/session-memory/handler.js +54 -54
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-activity-D-kw83R0.js → channel-activity-Cm1OJRbv.js} +1 -1
- package/dist/{chrome-34eOyt_6.js → chrome-CXbfCc20.js} +5 -5
- package/dist/{chrome-CovpMGdO.js → chrome-D0sqCqXY.js} +16 -16
- package/dist/{chunk-BHW8Yu5A.js → chunk-B9x_1qSr.js} +1 -1
- package/dist/{command-registry-Dk55OGO6.js → command-registry-DSV-4T7A.js} +4 -4
- package/dist/{commands-registry-BSvi46KZ.js → commands-registry-DPf4J7nj.js} +4 -4
- package/dist/{completion-cli-1HmgP7tY.js → completion-cli-DjQVuJdD.js} +2 -2
- package/dist/{completion-cli-DrDwlbAX.js → completion-cli-dlL2VvFw.js} +1 -1
- package/dist/{config-4Iu6iHCA.js → config-giEDOxub.js} +12 -12
- package/dist/control-ui/js/app.js +16 -5
- package/dist/control-ui/js/render.js +24 -35
- package/dist/{deliver-DtM4u1u_.js → deliver-BY58QnO8.js} +20 -20
- package/dist/{deliver-BCYGr-CD.js → deliver-DepjYu87.js} +1 -1
- package/dist/{diagnostic-CQiU0O8b.js → diagnostic-DIKKFHpP.js} +1 -1
- package/dist/{doctor-completion-B8IZFxo9.js → doctor-completion-Cm7WG43a.js} +1 -1
- package/dist/{doctor-completion-D6tzA47C.js → doctor-completion-Z_RXu40-.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/{env-BDXYbTKj.js → env-xmBFQPBP.js} +1 -1
- package/dist/extensionAPI.js +6 -6
- package/dist/{frontmatter-CTR5f_Ez.js → frontmatter-CV0YkjoY.js} +2 -2
- package/dist/{gateway-cli-DdjXGMTo.js → gateway-cli-DliBYmLu.js} +2 -2
- package/dist/{gateway-cli-DCTt5acx.js → gateway-cli-Fnxgv97F.js} +2 -2
- package/dist/{gemini-auth-BkLFtndu.js → gemini-auth-C39f2zRe.js} +1 -1
- package/dist/{github-copilot-token-cCYzSU9h.js → github-copilot-token-B8B2pmph.js} +7 -7
- package/dist/{glass-ui-ws-C_DzMNsd.js → glass-ui-ws-B0sH6QQi.js} +18 -2
- package/dist/{glass-ui-ws-DBlQ-hk7.js → glass-ui-ws-CfNTIb_g.js} +18 -2
- package/dist/{image-mx18hbyY.js → image-CKMw_vhe.js} +4 -4
- package/dist/{image-DKudhySz.js → image-CjuJpc3E.js} +1 -1
- package/dist/{image-ops-C7CauEK8.js → image-ops-M5agStZn.js} +16 -16
- package/dist/index.js +1 -1
- package/dist/{ir-JAy_3A3B.js → ir-Z9axTYHx.js} +4 -4
- package/dist/llm-slug-generator.js +54 -54
- package/dist/{local-roots-Se92wAN5.js → local-roots-Bh5xx9IO.js} +5 -5
- package/dist/{login-IpOTJtyn.js → login-2w0Q7Btb.js} +7 -7
- package/dist/{login-qr-DRepVMvu.js → login-qr-BJMvic1s.js} +12 -12
- package/dist/{manager-CJ3M1Uxq.js → manager-BoLUtbg2.js} +22 -22
- package/dist/{manifest-registry-yb7sAlu4.js → manifest-registry-0J48biqr.js} +19 -19
- package/dist/{markdown-tables-Dnj2LQUc.js → markdown-tables-DuRhvVpP.js} +1 -1
- package/dist/{message-channel-OlFBYAw8.js → message-channel-DwDSKGn4.js} +1 -1
- package/dist/{onboard-CEE38rOh.js → onboard-A5dfwOyL.js} +1 -1
- package/dist/{onboard-Dxf43Kz5.js → onboard-BSlbkbv-.js} +1 -1
- package/dist/{onboarding-B1VwuUX5.js → onboarding-BTNiewJj.js} +1 -1
- package/dist/{onboarding-BxHFNg2y.js → onboarding-COqa6a28.js} +1 -1
- package/dist/{onboarding.finalize-dP5Igu4h.js → onboarding.finalize-CAax5IdL.js} +4 -4
- package/dist/{onboarding.finalize-DQm4Tey0.js → onboarding.finalize-CDsTN9zD.js} +3 -3
- package/dist/{outbound-UwQEXYXv.js → outbound-B_wliV26.js} +7 -7
- package/dist/{outbound-attachment-BzwVH4Pn.js → outbound-attachment-BOy-OY4-.js} +2 -2
- package/dist/paths-CYmyCDsE.js +212 -0
- package/dist/{paths-CbQV9WEg.js → paths-DEuVuViW.js} +1 -1
- package/dist/{pi-auth-json-CCaxCywz.js → pi-auth-json-BQcKJvH0.js} +1 -1
- package/dist/{pi-embedded-DKaDXfFG.js → pi-embedded-R_JHJFwq.js} +16 -16
- package/dist/{pi-embedded-helpers-CepVOR4e.js → pi-embedded-helpers-BJrRH97f.js} +4 -4
- package/dist/{pi-embedded-helpers-DASLSiel.js → pi-embedded-helpers-Cr1X3W9i.js} +73 -73
- package/dist/{plugins-BzmbgY7s.js → plugins-Bkr5ZdYs.js} +9 -9
- package/dist/{program-DGLuU2_H.js → program-C4k7oBuC.js} +2 -2
- package/dist/{program-context-B2BcluHm.js → program-context-CiGMAzyC.js} +6 -6
- package/dist/{prompt-select-styled-CAKiYm_X.js → prompt-select-styled-CYiMonwj.js} +1 -1
- package/dist/{prompt-select-styled-C9RTEKcx.js → prompt-select-styled-CoWkFI4l.js} +1 -1
- package/dist/{pw-ai-Cfeeyp0u.js → pw-ai-CS2tDZd2.js} +1 -1
- package/dist/{pw-ai-CPelTpWz.js → pw-ai-Ch_WUbQZ.js} +11 -11
- package/dist/{qmd-manager-lBS9mT9w.js → qmd-manager-8-Z3Cdpt.js} +7 -7
- package/dist/{register.maintenance-BKB_D_Py.js → register.maintenance-DAwf6cHN.js} +5 -5
- package/dist/{register.maintenance-BgWyvLo5.js → register.maintenance-DVv8ljal.js} +4 -4
- package/dist/{register.onboard-DT1We9u2.js → register.onboard-DJEZcUm5.js} +2 -2
- package/dist/{register.onboard-CSmfgDU5.js → register.onboard-DWrxbBr5.js} +2 -2
- package/dist/{register.setup-CEW5ApHJ.js → register.setup-Ah9E7LHA.js} +2 -2
- package/dist/{register.setup-mJzihfMO.js → register.setup-BDqhSgCz.js} +2 -2
- package/dist/{register.subclis-Bi4jmYW6.js → register.subclis-Bb0yWevQ.js} +3 -3
- package/dist/{registry-DYq1AYOv.js → registry-UkL38jvt.js} +17 -17
- package/dist/{replies-DA4YTv9G.js → replies-CbeMv5WZ.js} +3 -3
- package/dist/{reply-prefix-CvEIl6_d.js → reply-prefix-ZnX2V-k9.js} +1 -1
- package/dist/{resolve-route-DX7xcMsD.js → resolve-route-gl0ZOOKR.js} +4 -4
- package/dist/{retry-B-y5suGA.js → retry-D25Z8MVS.js} +1 -1
- package/dist/{run-main-Ugk40lFF.js → run-main-CZI2Ne08.js} +3 -3
- package/dist/{runner-DKq2NJqT.js → runner-B2Y_5crX.js} +22 -22
- package/dist/{runner-qeYibveF.js → runner-DKkSu9cc.js} +1 -1
- package/dist/{send-Cq1L-2Ik.js → send-CCNIWI2Z.js} +10 -10
- package/dist/{send-C4Bqsa_r.js → send-CPSKimCF.js} +6 -6
- package/dist/{send-DX0p0ym_.js → send-Dy8tsHUE.js} +6 -6
- package/dist/{send-vtz9ZwUj.js → send-iUSZIdml.js} +7 -7
- package/dist/{send-DVt9RLDh.js → send-sgxdFZNy.js} +18 -18
- package/dist/{session-BQWef058.js → session-BTpKgzso.js} +8 -8
- package/dist/{skill-commands-BiPrghRt.js → skill-commands-HBkNllDU.js} +16 -16
- package/dist/{skills-Bs0AW1g3.js → skills-CGHRETGF.js} +24 -24
- package/dist/{sqlite-BHWvOATS.js → sqlite-JHY-uOmS.js} +16 -16
- package/dist/{store-01F_JM7O.js → store-Ea3zM6xK.js} +6 -6
- package/dist/{subsystem-BjyjJF-d.js → subsystem-DN75fnEF.js} +1 -1
- package/dist/{tables-BuM4FKR3.js → tables-Dkg9O8rv.js} +1 -1
- package/dist/{target-errors-BEugWC4F.js → target-errors-Pr77jao5.js} +2 -2
- package/dist/{thinking-BprCy23Z.js → thinking-C9-JAUzD.js} +5 -5
- package/dist/{tokens-W0JzCJJM.js → tokens-CCZl4YHT.js} +1 -1
- package/dist/{tool-images-SqqWIT22.js → tool-images-B1qVCntj.js} +2 -2
- package/dist/{tool-loop-detection-D5mBY7AC.js → tool-loop-detection-C33wf43N.js} +3 -3
- package/dist/{unified-runner-CMgTwCmG.js → unified-runner-hulABWDL.js} +225 -225
- package/dist/{update-cli-Dup4Xi6b.js → update-cli-CnN_k3P1.js} +4 -4
- package/dist/{update-cli-DiH9ccFa.js → update-cli-DwGmFbPH.js} +5 -5
- package/dist/{web-BrGvZQ21.js → web-C0ZdaR6w.js} +6 -6
- package/dist/{web-BIo1QcLd.js → web-DpQ5RaFz.js} +58 -58
- package/dist/{whatsapp-actions-DZfLLQ0Y.js → whatsapp-actions-D_w4AfW9.js} +23 -23
- package/dist/{workspace-DscDraUb.js → workspace-DqJ5h-ZB.js} +27 -27
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/discord/package.json +1 -1
- package/extensions/feishu/package.json +1 -1
- package/extensions/google-antigravity-auth/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/googlechat/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/learning-loop/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +6 -0
- 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-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +6 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +6 -0
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/outlook/package.json +1 -1
- package/extensions/pipeline/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/slack/package.json +1 -1
- package/extensions/telegram/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +6 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +6 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +6 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +6 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { J as logVerbose, Z as shouldLogVerbose } from "./registry-
|
|
2
|
-
import { _ as runExec } from "./workspace-
|
|
3
|
-
import { A as normalizeGoogleModelId, B as resolveApiKeyForProvider, C as normalizeProviderId, et as resolveSymiAgentDir, z as requireApiKey } from "./auth-profiles-
|
|
4
|
-
import { d as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, f as isInboundPathAllowed, m as resolveIMessageAttachmentRoots, n as loadConfig, p as mergeInboundPathRoots } from "./config-
|
|
5
|
-
import { c as detectMime, f as isAudioFileName, m as kindFromMime, u as getFileExtension } from "./image-ops-
|
|
1
|
+
import { J as logVerbose, Z as shouldLogVerbose } from "./registry-UkL38jvt.js";
|
|
2
|
+
import { _ as runExec } from "./workspace-DqJ5h-ZB.js";
|
|
3
|
+
import { A as normalizeGoogleModelId, B as resolveApiKeyForProvider, C as normalizeProviderId, et as resolveSymiAgentDir, z as requireApiKey } from "./auth-profiles-CZZjOpX8.js";
|
|
4
|
+
import { d as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, f as isInboundPathAllowed, m as resolveIMessageAttachmentRoots, n as loadConfig, p as mergeInboundPathRoots } from "./config-giEDOxub.js";
|
|
5
|
+
import { c as detectMime, f as isAudioFileName, m as kindFromMime, u as getFileExtension } from "./image-ops-M5agStZn.js";
|
|
6
6
|
import { t as normalizeChatType } from "./chat-type-3FRbbjbq.js";
|
|
7
|
-
import { S as ensureSymiModelsJson, t as describeImageWithModel } from "./image-
|
|
8
|
-
import { n as collectProviderApiKeysForExecution, r as executeWithApiKeyRotation, t as parseGeminiAuth } from "./gemini-auth-
|
|
7
|
+
import { S as ensureSymiModelsJson, t as describeImageWithModel } from "./image-CKMw_vhe.js";
|
|
8
|
+
import { n as collectProviderApiKeysForExecution, r as executeWithApiKeyRotation, t as parseGeminiAuth } from "./gemini-auth-C39f2zRe.js";
|
|
9
9
|
import { n as fetchWithTimeout } from "./fetch-timeout-Cj6kcyGt.js";
|
|
10
|
-
import { i as fetchRemoteMedia, n as getDefaultMediaLocalRoots, o as fetchWithSsrFGuard, r as MediaFetchError } from "./local-roots-
|
|
10
|
+
import { i as fetchRemoteMedia, n as getDefaultMediaLocalRoots, o as fetchWithSsrFGuard, r as MediaFetchError } from "./local-roots-Bh5xx9IO.js";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import { constants } from "node:fs";
|
|
13
13
|
import os from "node:os";
|
|
14
|
-
import fs
|
|
14
|
+
import fs from "node:fs/promises";
|
|
15
15
|
import { fileURLToPath } from "node:url";
|
|
16
16
|
import crypto from "node:crypto";
|
|
17
17
|
import process$1 from "node:process";
|
|
@@ -693,7 +693,7 @@ var MediaAttachmentCache = class {
|
|
|
693
693
|
const size = await this.ensureLocalStat(entry);
|
|
694
694
|
if (entry.resolvedPath) {
|
|
695
695
|
if (size !== void 0 && size > params.maxBytes) throw new MediaUnderstandingSkipError("maxBytes", `Attachment ${params.attachmentIndex + 1} exceeds maxBytes ${params.maxBytes}`);
|
|
696
|
-
const buffer = await fs
|
|
696
|
+
const buffer = await fs.readFile(entry.resolvedPath);
|
|
697
697
|
entry.buffer = buffer;
|
|
698
698
|
entry.bufferMime = entry.bufferMime ?? entry.attachment.mime ?? await detectMime({
|
|
699
699
|
buffer,
|
|
@@ -763,10 +763,10 @@ var MediaAttachmentCache = class {
|
|
|
763
763
|
prefix: "symi-media",
|
|
764
764
|
extension: path.extname(bufferResult.fileName || "") || ""
|
|
765
765
|
});
|
|
766
|
-
await fs
|
|
766
|
+
await fs.writeFile(tmpPath, bufferResult.buffer);
|
|
767
767
|
entry.tempPath = tmpPath;
|
|
768
768
|
entry.tempCleanup = async () => {
|
|
769
|
-
await fs
|
|
769
|
+
await fs.unlink(tmpPath).catch(() => {});
|
|
770
770
|
};
|
|
771
771
|
return {
|
|
772
772
|
path: tmpPath,
|
|
@@ -813,12 +813,12 @@ var MediaAttachmentCache = class {
|
|
|
813
813
|
if (entry.statSize !== void 0) return entry.statSize;
|
|
814
814
|
try {
|
|
815
815
|
const currentPath = entry.resolvedPath;
|
|
816
|
-
const stat = await fs
|
|
816
|
+
const stat = await fs.stat(currentPath);
|
|
817
817
|
if (!stat.isFile()) {
|
|
818
818
|
entry.resolvedPath = void 0;
|
|
819
819
|
return;
|
|
820
820
|
}
|
|
821
|
-
const canonicalPath = await fs
|
|
821
|
+
const canonicalPath = await fs.realpath(currentPath).catch(() => currentPath);
|
|
822
822
|
if (!isInboundPathAllowed({
|
|
823
823
|
filePath: canonicalPath,
|
|
824
824
|
roots: await this.getCanonicalLocalPathRoots()
|
|
@@ -840,7 +840,7 @@ var MediaAttachmentCache = class {
|
|
|
840
840
|
if (this.canonicalLocalPathRoots) return await this.canonicalLocalPathRoots;
|
|
841
841
|
this.canonicalLocalPathRoots = (async () => mergeInboundPathRoots(this.localPathRoots, await Promise.all(this.localPathRoots.map(async (root) => {
|
|
842
842
|
if (root.includes("*")) return root;
|
|
843
|
-
return await fs
|
|
843
|
+
return await fs.realpath(root).catch(() => root);
|
|
844
844
|
}))))();
|
|
845
845
|
return await this.canonicalLocalPathRoots;
|
|
846
846
|
}
|
|
@@ -883,7 +883,7 @@ async function loadModelCatalog(params) {
|
|
|
883
883
|
try {
|
|
884
884
|
const cfg = params?.config ?? loadConfig();
|
|
885
885
|
await ensureSymiModelsJson(cfg);
|
|
886
|
-
await (await import("./pi-auth-json-
|
|
886
|
+
await (await import("./pi-auth-json-BQcKJvH0.js").then((n) => n.n)).ensurePiAuthJsonFromAuthProfiles(resolveSymiAgentDir(), { config: cfg });
|
|
887
887
|
const piSdk = await importPiSdk();
|
|
888
888
|
const agentDir = resolveSymiAgentDir();
|
|
889
889
|
const { join } = await import("node:path");
|
|
@@ -943,7 +943,7 @@ function findModelInCatalog(catalog, provider, modelId) {
|
|
|
943
943
|
async function fileExists(filePath) {
|
|
944
944
|
if (!filePath) return false;
|
|
945
945
|
try {
|
|
946
|
-
await fs
|
|
946
|
+
await fs.stat(filePath);
|
|
947
947
|
return true;
|
|
948
948
|
} catch {
|
|
949
949
|
return false;
|
|
@@ -1043,7 +1043,7 @@ async function resolveCliOutput(params) {
|
|
|
1043
1043
|
const commandId = commandBase(params.command);
|
|
1044
1044
|
const fileOutput = commandId === "whisper-cli" ? resolveWhisperCppOutputPath(params.args) : commandId === "whisper" ? resolveWhisperOutputPath(params.args, params.mediaPath) : null;
|
|
1045
1045
|
if (fileOutput && await fileExists(fileOutput)) try {
|
|
1046
|
-
const content = await fs
|
|
1046
|
+
const content = await fs.readFile(fileOutput, "utf8");
|
|
1047
1047
|
if (content.trim()) return content.trim();
|
|
1048
1048
|
} catch {}
|
|
1049
1049
|
if (commandId === "gemini") {
|
|
@@ -1334,7 +1334,7 @@ async function runCliEntry(params) {
|
|
|
1334
1334
|
maxBytes,
|
|
1335
1335
|
timeoutMs
|
|
1336
1336
|
});
|
|
1337
|
-
const outputDir = await fs
|
|
1337
|
+
const outputDir = await fs.mkdtemp(path.join(os.tmpdir(), "symi-media-cli-"));
|
|
1338
1338
|
const mediaPath = pathResult.path;
|
|
1339
1339
|
const outputBase = path.join(outputDir, path.parse(mediaPath).name);
|
|
1340
1340
|
const templCtx = {
|
|
@@ -1368,7 +1368,7 @@ async function runCliEntry(params) {
|
|
|
1368
1368
|
model: command
|
|
1369
1369
|
};
|
|
1370
1370
|
} finally {
|
|
1371
|
-
await fs
|
|
1371
|
+
await fs.rm(outputDir, {
|
|
1372
1372
|
recursive: true,
|
|
1373
1373
|
force: true
|
|
1374
1374
|
}).catch(() => {});
|
|
@@ -1412,9 +1412,9 @@ function candidateBinaryNames(name) {
|
|
|
1412
1412
|
}
|
|
1413
1413
|
async function isExecutable(filePath) {
|
|
1414
1414
|
try {
|
|
1415
|
-
if (!(await fs
|
|
1415
|
+
if (!(await fs.stat(filePath)).isFile()) return false;
|
|
1416
1416
|
if (process.platform === "win32") return true;
|
|
1417
|
-
await fs
|
|
1417
|
+
await fs.access(filePath, constants.X_OK);
|
|
1418
1418
|
return true;
|
|
1419
1419
|
} catch {
|
|
1420
1420
|
return false;
|
|
@@ -4,7 +4,7 @@ import { G as resolveSymiAgentDir, T as resolveApiKeyForProvider, c as normalize
|
|
|
4
4
|
import { t as normalizeChatType } from "./chat-type-DFDuk3FY.js";
|
|
5
5
|
import { _ as kindFromMime, d as detectMime, h as isAudioFileName, p as getFileExtension } from "./image-ops-ByaQt43P.js";
|
|
6
6
|
import { d as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, f as isInboundPathAllowed, m as resolveIMessageAttachmentRoots, n as loadConfig, p as mergeInboundPathRoots } from "./config-DBqxAhpU.js";
|
|
7
|
-
import { S as ensureSymiModelsJson, t as describeImageWithModel } from "./image-
|
|
7
|
+
import { S as ensureSymiModelsJson, t as describeImageWithModel } from "./image-CjuJpc3E.js";
|
|
8
8
|
import { n as collectProviderApiKeysForExecution, r as executeWithApiKeyRotation, t as parseGeminiAuth } from "./gemini-auth-ClVyOv9p.js";
|
|
9
9
|
import { n as fetchWithTimeout } from "./fetch-timeout-BheTNyes.js";
|
|
10
10
|
import { i as fetchRemoteMedia, n as getDefaultMediaLocalRoots, o as fetchWithSsrFGuard, r as MediaFetchError } from "./local-roots-CC8jiKDk.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { dt as resolvePreferredSymiTmpDir } from "./registry-
|
|
3
|
-
import { n as loadConfig } from "./config-
|
|
4
|
-
import { _ as maxBytesForKind, l as extensionForMime } from "./image-ops-
|
|
5
|
-
import { _ as resolveDiscordAccount, v as normalizeDiscordToken } from "./plugins-
|
|
2
|
+
import { dt as resolvePreferredSymiTmpDir } from "./registry-UkL38jvt.js";
|
|
3
|
+
import { n as loadConfig } from "./config-giEDOxub.js";
|
|
4
|
+
import { _ as maxBytesForKind, l as extensionForMime } from "./image-ops-M5agStZn.js";
|
|
5
|
+
import { _ as resolveDiscordAccount, v as normalizeDiscordToken } from "./plugins-Bkr5ZdYs.js";
|
|
6
6
|
import { a as requireTargetKind, i as parseTargetPrefixes, n as ensureTargetId, r as parseTargetMention, t as buildMessagingTarget } from "./targets-DGkXkFPj.js";
|
|
7
|
-
import { n as retryAsync, t as resolveRetryConfig } from "./retry-
|
|
8
|
-
import { c as resolveChunkMode, i as chunkMarkdownTextWithMode } from "./chunk-
|
|
9
|
-
import { n as resolveMarkdownTableMode } from "./markdown-tables-
|
|
10
|
-
import { a as loadWebMedia, o as loadWebMediaRaw } from "./ir-
|
|
7
|
+
import { n as retryAsync, t as resolveRetryConfig } from "./retry-D25Z8MVS.js";
|
|
8
|
+
import { c as resolveChunkMode, i as chunkMarkdownTextWithMode } from "./chunk-B9x_1qSr.js";
|
|
9
|
+
import { n as resolveMarkdownTableMode } from "./markdown-tables-DuRhvVpP.js";
|
|
10
|
+
import { a as loadWebMedia, o as loadWebMediaRaw } from "./ir-Z9axTYHx.js";
|
|
11
11
|
import { t as resolveFetch } from "./fetch-Dnti0cFs.js";
|
|
12
|
-
import { n as recordChannelActivity, r as createDiscordRetryRunner } from "./channel-activity-
|
|
12
|
+
import { n as recordChannelActivity, r as createDiscordRetryRunner } from "./channel-activity-Cm1OJRbv.js";
|
|
13
13
|
import { n as normalizePollInput, t as normalizePollDurationHours } from "./polls-BKbIUHj7.js";
|
|
14
|
-
import { t as convertMarkdownTables } from "./tables-
|
|
14
|
+
import { t as convertMarkdownTables } from "./tables-Dkg9O8rv.js";
|
|
15
15
|
import path from "node:path";
|
|
16
16
|
import fs from "node:fs/promises";
|
|
17
17
|
import { execFile } from "node:child_process";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { n as loadConfig } from "./config-
|
|
3
|
-
import { v as mediaKindFromMime } from "./image-ops-
|
|
4
|
-
import { n as resolveSignalAccount } from "./accounts-
|
|
5
|
-
import { n as resolveMarkdownTableMode } from "./markdown-tables-
|
|
2
|
+
import { n as loadConfig } from "./config-giEDOxub.js";
|
|
3
|
+
import { v as mediaKindFromMime } from "./image-ops-M5agStZn.js";
|
|
4
|
+
import { n as resolveSignalAccount } from "./accounts-wSphH5gv.js";
|
|
5
|
+
import { n as resolveMarkdownTableMode } from "./markdown-tables-DuRhvVpP.js";
|
|
6
6
|
import { n as fetchWithTimeout } from "./fetch-timeout-Cj6kcyGt.js";
|
|
7
|
-
import { n as markdownToIR, t as chunkMarkdownIR } from "./ir-
|
|
7
|
+
import { n as markdownToIR, t as chunkMarkdownIR } from "./ir-Z9axTYHx.js";
|
|
8
8
|
import { t as resolveFetch } from "./fetch-Dnti0cFs.js";
|
|
9
|
-
import { t as resolveOutboundAttachmentFromUrl } from "./outbound-attachment-
|
|
9
|
+
import { t as resolveOutboundAttachmentFromUrl } from "./outbound-attachment-BOy-OY4-.js";
|
|
10
10
|
import { randomUUID } from "node:crypto";
|
|
11
11
|
|
|
12
12
|
//#region src/signal/format.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { J as logVerbose } from "./registry-
|
|
3
|
-
import { n as loadConfig } from "./config-
|
|
4
|
-
import { d as resolveSlackAccount, m as resolveSlackBotToken } from "./plugins-
|
|
2
|
+
import { J as logVerbose } from "./registry-UkL38jvt.js";
|
|
3
|
+
import { n as loadConfig } from "./config-giEDOxub.js";
|
|
4
|
+
import { d as resolveSlackAccount, m as resolveSlackBotToken } from "./plugins-Bkr5ZdYs.js";
|
|
5
5
|
import { a as requireTargetKind, i as parseTargetPrefixes, n as ensureTargetId, r as parseTargetMention, t as buildMessagingTarget } from "./targets-DGkXkFPj.js";
|
|
6
|
-
import { c as resolveChunkMode, i as chunkMarkdownTextWithMode, l as resolveTextChunkLimit } from "./chunk-
|
|
7
|
-
import { n as resolveMarkdownTableMode } from "./markdown-tables-
|
|
8
|
-
import { a as loadWebMedia, n as markdownToIR, t as chunkMarkdownIR } from "./ir-
|
|
6
|
+
import { c as resolveChunkMode, i as chunkMarkdownTextWithMode, l as resolveTextChunkLimit } from "./chunk-B9x_1qSr.js";
|
|
7
|
+
import { n as resolveMarkdownTableMode } from "./markdown-tables-DuRhvVpP.js";
|
|
8
|
+
import { a as loadWebMedia, n as markdownToIR, t as chunkMarkdownIR } from "./ir-Z9axTYHx.js";
|
|
9
9
|
import { t as renderMarkdownWithMarkers } from "./render-DwEu-aCr.js";
|
|
10
10
|
import { WebClient } from "@slack/web-api";
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { I as resolveUserPath, M as normalizeE164 } from "./registry-
|
|
3
|
-
import { n as loadConfig } from "./config-
|
|
4
|
-
import { v as mediaKindFromMime } from "./image-ops-
|
|
5
|
-
import { t as resolveIMessageAccount } from "./accounts-
|
|
6
|
-
import { n as resolveMarkdownTableMode } from "./markdown-tables-
|
|
7
|
-
import { t as convertMarkdownTables } from "./tables-
|
|
8
|
-
import { t as resolveOutboundAttachmentFromUrl } from "./outbound-attachment-
|
|
2
|
+
import { I as resolveUserPath, M as normalizeE164 } from "./registry-UkL38jvt.js";
|
|
3
|
+
import { n as loadConfig } from "./config-giEDOxub.js";
|
|
4
|
+
import { v as mediaKindFromMime } from "./image-ops-M5agStZn.js";
|
|
5
|
+
import { t as resolveIMessageAccount } from "./accounts-dRUMQQrB.js";
|
|
6
|
+
import { n as resolveMarkdownTableMode } from "./markdown-tables-DuRhvVpP.js";
|
|
7
|
+
import { t as convertMarkdownTables } from "./tables-Dkg9O8rv.js";
|
|
8
|
+
import { t as resolveOutboundAttachmentFromUrl } from "./outbound-attachment-BOy-OY4-.js";
|
|
9
9
|
import { spawn } from "node:child_process";
|
|
10
10
|
import { createInterface } from "node:readline";
|
|
11
11
|
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { a as resolveOAuthDir, s as resolveStateDir, u as resolveRequiredHomeDir } from "./paths-
|
|
3
|
-
import { G as danger, J as logVerbose, L as safeParseJson } from "./registry-
|
|
4
|
-
import { t as createSubsystemLogger } from "./subsystem-
|
|
5
|
-
import { p as withFileLock$1 } from "./auth-profiles-
|
|
6
|
-
import { t as isTruthyEnvValue } from "./env-
|
|
7
|
-
import { n as loadConfig } from "./config-
|
|
2
|
+
import { a as resolveOAuthDir, s as resolveStateDir, u as resolveRequiredHomeDir } from "./paths-CYmyCDsE.js";
|
|
3
|
+
import { G as danger, J as logVerbose, L as safeParseJson } from "./registry-UkL38jvt.js";
|
|
4
|
+
import { t as createSubsystemLogger } from "./subsystem-DN75fnEF.js";
|
|
5
|
+
import { p as withFileLock$1 } from "./auth-profiles-CZZjOpX8.js";
|
|
6
|
+
import { t as isTruthyEnvValue } from "./env-xmBFQPBP.js";
|
|
7
|
+
import { n as loadConfig } from "./config-giEDOxub.js";
|
|
8
8
|
import { t as redactSensitiveText } from "./redact-BDMXB06K.js";
|
|
9
9
|
import { n as formatErrorMessage, r as formatUncaughtError, t as extractErrorCode } from "./errors-XIsvXeC-.js";
|
|
10
|
-
import { h as normalizeMimeType, p as isGifMedia, u as getFileExtension, v as mediaKindFromMime } from "./image-ops-
|
|
11
|
-
import { l as resolveTelegramAccount, n as listChannelPlugins, t as getChannelPlugin } from "./plugins-
|
|
12
|
-
import { n as resolveMarkdownTableMode } from "./markdown-tables-
|
|
13
|
-
import { a as loadWebMedia, n as markdownToIR, t as chunkMarkdownIR } from "./ir-
|
|
10
|
+
import { h as normalizeMimeType, p as isGifMedia, u as getFileExtension, v as mediaKindFromMime } from "./image-ops-M5agStZn.js";
|
|
11
|
+
import { l as resolveTelegramAccount, n as listChannelPlugins, t as getChannelPlugin } from "./plugins-Bkr5ZdYs.js";
|
|
12
|
+
import { n as resolveMarkdownTableMode } from "./markdown-tables-DuRhvVpP.js";
|
|
13
|
+
import { a as loadWebMedia, n as markdownToIR, t as chunkMarkdownIR } from "./ir-Z9axTYHx.js";
|
|
14
14
|
import { t as renderMarkdownWithMarkers } from "./render-DwEu-aCr.js";
|
|
15
15
|
import { t as resolveFetch } from "./fetch-Dnti0cFs.js";
|
|
16
|
-
import { i as createTelegramRetryRunner, n as recordChannelActivity } from "./channel-activity-
|
|
16
|
+
import { i as createTelegramRetryRunner, n as recordChannelActivity } from "./channel-activity-Cm1OJRbv.js";
|
|
17
17
|
import { n as normalizePollInput } from "./polls-BKbIUHj7.js";
|
|
18
18
|
import { t as makeProxyFetch } from "./proxy-DVy9foH0.js";
|
|
19
19
|
import path from "node:path";
|
|
20
|
-
import
|
|
20
|
+
import fsSync from "node:fs";
|
|
21
21
|
import os from "node:os";
|
|
22
22
|
import crypto from "node:crypto";
|
|
23
23
|
import process$1 from "node:process";
|
|
@@ -131,7 +131,7 @@ function getPairingAdapter(channelId) {
|
|
|
131
131
|
//#region src/plugin-sdk/json-store.ts
|
|
132
132
|
async function readJsonFileWithFallback(filePath, fallback) {
|
|
133
133
|
try {
|
|
134
|
-
const parsed = safeParseJson(await
|
|
134
|
+
const parsed = safeParseJson(await fsSync.promises.readFile(filePath, "utf-8"));
|
|
135
135
|
if (parsed == null) return {
|
|
136
136
|
value: fallback,
|
|
137
137
|
exists: true
|
|
@@ -153,14 +153,14 @@ async function readJsonFileWithFallback(filePath, fallback) {
|
|
|
153
153
|
}
|
|
154
154
|
async function writeJsonFileAtomically(filePath, value) {
|
|
155
155
|
const dir = path.dirname(filePath);
|
|
156
|
-
await
|
|
156
|
+
await fsSync.promises.mkdir(dir, {
|
|
157
157
|
recursive: true,
|
|
158
158
|
mode: 448
|
|
159
159
|
});
|
|
160
160
|
const tmp = path.join(dir, `${path.basename(filePath)}.${crypto.randomUUID()}.tmp`);
|
|
161
|
-
await
|
|
162
|
-
await
|
|
163
|
-
await
|
|
161
|
+
await fsSync.promises.writeFile(tmp, `${JSON.stringify(value, null, 2)}\n`, { encoding: "utf-8" });
|
|
162
|
+
await fsSync.promises.chmod(tmp, 384);
|
|
163
|
+
await fsSync.promises.rename(tmp, filePath);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
//#endregion
|
|
@@ -221,7 +221,7 @@ async function readPairingRequests(filePath) {
|
|
|
221
221
|
}
|
|
222
222
|
async function ensureJsonFile(filePath, fallback) {
|
|
223
223
|
try {
|
|
224
|
-
await
|
|
224
|
+
await fsSync.promises.access(filePath);
|
|
225
225
|
} catch {
|
|
226
226
|
await writeJsonFile(filePath, fallback);
|
|
227
227
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { E as ensureDir, G as danger, I as resolveUserPath, Q as success, ot as toPinoLikeLogger, rt as getChildLogger } from "./registry-
|
|
2
|
-
import { n as formatCliCommand } from "./env-
|
|
3
|
-
import { A as VERSION } from "./config-
|
|
4
|
-
import { c as readCredsJsonRaw, d as resolveWebCredsBackupPath, f as resolveWebCredsPath, o as maybeRestoreCredsFromBackup, u as resolveDefaultWebAuthDir } from "./accounts-
|
|
5
|
-
import
|
|
1
|
+
import { E as ensureDir, G as danger, I as resolveUserPath, Q as success, ot as toPinoLikeLogger, rt as getChildLogger } from "./registry-UkL38jvt.js";
|
|
2
|
+
import { n as formatCliCommand } from "./env-xmBFQPBP.js";
|
|
3
|
+
import { A as VERSION } from "./config-giEDOxub.js";
|
|
4
|
+
import { c as readCredsJsonRaw, d as resolveWebCredsBackupPath, f as resolveWebCredsPath, o as maybeRestoreCredsFromBackup, u as resolveDefaultWebAuthDir } from "./accounts-D1r2dq1t.js";
|
|
5
|
+
import fsSync from "node:fs";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
7
7
|
import { DisconnectReason, fetchLatestBaileysVersion, makeCacheableSignalKeyStore, makeWASocket, useMultiFileAuthState } from "@whiskeysockets/baileys";
|
|
8
8
|
import qrcode from "qrcode-terminal";
|
|
@@ -21,16 +21,16 @@ async function safeSaveCreds(authDir, saveCreds, logger) {
|
|
|
21
21
|
const raw = readCredsJsonRaw(credsPath);
|
|
22
22
|
if (raw) try {
|
|
23
23
|
JSON.parse(raw);
|
|
24
|
-
|
|
24
|
+
fsSync.copyFileSync(credsPath, backupPath);
|
|
25
25
|
try {
|
|
26
|
-
|
|
26
|
+
fsSync.chmodSync(backupPath, 384);
|
|
27
27
|
} catch {}
|
|
28
28
|
} catch {}
|
|
29
29
|
} catch {}
|
|
30
30
|
try {
|
|
31
31
|
await Promise.resolve(saveCreds());
|
|
32
32
|
try {
|
|
33
|
-
|
|
33
|
+
fsSync.chmodSync(resolveWebCredsPath(authDir), 384);
|
|
34
34
|
} catch {}
|
|
35
35
|
} catch (err) {
|
|
36
36
|
logger.warn({ error: String(err) }, "failed saving WhatsApp creds");
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { s as resolveStateDir } from "./paths-
|
|
3
|
-
import { I as resolveUserPath, S as CONFIG_DIR } from "./registry-
|
|
4
|
-
import { s as resolveAgentWorkspaceDir, t as listAgentIds } from "./agent-scope-
|
|
5
|
-
import { t as createSubsystemLogger } from "./subsystem-
|
|
6
|
-
import { o as resolvePluginSkillDirs, t as buildWorkspaceSkillCommandSpecs } from "./skills-
|
|
7
|
-
import { i as listChatCommands } from "./commands-registry-
|
|
2
|
+
import { s as resolveStateDir } from "./paths-CYmyCDsE.js";
|
|
3
|
+
import { I as resolveUserPath, S as CONFIG_DIR } from "./registry-UkL38jvt.js";
|
|
4
|
+
import { s as resolveAgentWorkspaceDir, t as listAgentIds } from "./agent-scope-D68_xfTL.js";
|
|
5
|
+
import { t as createSubsystemLogger } from "./subsystem-DN75fnEF.js";
|
|
6
|
+
import { o as resolvePluginSkillDirs, t as buildWorkspaceSkillCommandSpecs } from "./skills-CGHRETGF.js";
|
|
7
|
+
import { i as listChatCommands } from "./commands-registry-DPf4J7nj.js";
|
|
8
8
|
import path from "node:path";
|
|
9
|
-
import
|
|
9
|
+
import fsSync from "node:fs";
|
|
10
10
|
import os from "node:os";
|
|
11
|
-
import fs
|
|
11
|
+
import fs from "node:fs/promises";
|
|
12
12
|
import { randomUUID } from "node:crypto";
|
|
13
13
|
import chokidar from "chokidar";
|
|
14
14
|
|
|
15
15
|
//#region src/infra/json-files.ts
|
|
16
16
|
async function readJsonFile(filePath) {
|
|
17
17
|
try {
|
|
18
|
-
const raw = await fs
|
|
18
|
+
const raw = await fs.readFile(filePath, "utf8");
|
|
19
19
|
return JSON.parse(raw);
|
|
20
20
|
} catch {
|
|
21
21
|
return null;
|
|
@@ -24,15 +24,15 @@ async function readJsonFile(filePath) {
|
|
|
24
24
|
async function writeJsonAtomic(filePath, value, options) {
|
|
25
25
|
const mode = options?.mode ?? 384;
|
|
26
26
|
const dir = path.dirname(filePath);
|
|
27
|
-
await fs
|
|
27
|
+
await fs.mkdir(dir, { recursive: true });
|
|
28
28
|
const tmp = `${filePath}.${randomUUID()}.tmp`;
|
|
29
|
-
await fs
|
|
29
|
+
await fs.writeFile(tmp, JSON.stringify(value, null, 2), "utf8");
|
|
30
30
|
try {
|
|
31
|
-
await fs
|
|
31
|
+
await fs.chmod(tmp, mode);
|
|
32
32
|
} catch {}
|
|
33
|
-
await fs
|
|
33
|
+
await fs.rename(tmp, filePath);
|
|
34
34
|
try {
|
|
35
|
-
await fs
|
|
35
|
+
await fs.chmod(filePath, mode);
|
|
36
36
|
} catch {}
|
|
37
37
|
}
|
|
38
38
|
function createAsyncLock() {
|
|
@@ -283,8 +283,8 @@ function listSkillCommandsForAgents(params) {
|
|
|
283
283
|
const visitedDirs = /* @__PURE__ */ new Set();
|
|
284
284
|
for (const agentId of agentIds) {
|
|
285
285
|
const workspaceDir = resolveAgentWorkspaceDir(params.cfg, agentId);
|
|
286
|
-
if (!
|
|
287
|
-
const canonicalDir =
|
|
286
|
+
if (!fsSync.existsSync(workspaceDir)) continue;
|
|
287
|
+
const canonicalDir = fsSync.realpathSync(workspaceDir);
|
|
288
288
|
if (visitedDirs.has(canonicalDir)) continue;
|
|
289
289
|
visitedDirs.add(canonicalDir);
|
|
290
290
|
const commands = buildWorkspaceSkillCommandSpecs(workspaceDir, {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { I as resolveUserPath, S as CONFIG_DIR } from "./registry-
|
|
2
|
-
import { f as normalizeSkillFilter } from "./agent-scope-
|
|
3
|
-
import { t as createSubsystemLogger } from "./subsystem-
|
|
4
|
-
import { h as resolveSymiPackageRootSync } from "./workspace-
|
|
5
|
-
import { c as resolveMemorySlotDecision, d as isDangerousHostEnvVarName, o as normalizePluginsConfig, s as resolveEnableState, t as loadPluginManifestRegistry } from "./manifest-registry-
|
|
6
|
-
import { a as resolveSymiManifestBlock, c as resolveSymiManifestRequires, d as hasBinary, f as isConfigPathTruthyWithDefaults, i as parseSymiManifestInstallBase, l as parseFrontmatterBlock, n as normalizeStringList, o as resolveSymiManifestInstall, p as resolveRuntimePlatform, r as parseFrontmatterBool, s as resolveSymiManifestOs, t as getFrontmatterString, u as evaluateRuntimeRequires } from "./frontmatter-
|
|
1
|
+
import { I as resolveUserPath, S as CONFIG_DIR } from "./registry-UkL38jvt.js";
|
|
2
|
+
import { f as normalizeSkillFilter } from "./agent-scope-D68_xfTL.js";
|
|
3
|
+
import { t as createSubsystemLogger } from "./subsystem-DN75fnEF.js";
|
|
4
|
+
import { h as resolveSymiPackageRootSync } from "./workspace-DqJ5h-ZB.js";
|
|
5
|
+
import { c as resolveMemorySlotDecision, d as isDangerousHostEnvVarName, o as normalizePluginsConfig, s as resolveEnableState, t as loadPluginManifestRegistry } from "./manifest-registry-0J48biqr.js";
|
|
6
|
+
import { a as resolveSymiManifestBlock, c as resolveSymiManifestRequires, d as hasBinary, f as isConfigPathTruthyWithDefaults, i as parseSymiManifestInstallBase, l as parseFrontmatterBlock, n as normalizeStringList, o as resolveSymiManifestInstall, p as resolveRuntimePlatform, r as parseFrontmatterBool, s as resolveSymiManifestOs, t as getFrontmatterString, u as evaluateRuntimeRequires } from "./frontmatter-CV0YkjoY.js";
|
|
7
7
|
import path from "node:path";
|
|
8
|
-
import
|
|
8
|
+
import fsSync from "node:fs";
|
|
9
9
|
import os from "node:os";
|
|
10
|
-
import fs
|
|
10
|
+
import fs from "node:fs/promises";
|
|
11
11
|
import { fileURLToPath } from "node:url";
|
|
12
12
|
import { formatSkillsForPrompt, loadSkillsFromDir } from "@mariozechner/pi-coding-agent";
|
|
13
13
|
|
|
@@ -391,7 +391,7 @@ async function assertNoSymlinkEscape(relative, root, options) {
|
|
|
391
391
|
const isLast = idx === parts.length - 1;
|
|
392
392
|
current = path.join(current, part);
|
|
393
393
|
try {
|
|
394
|
-
if ((await fs
|
|
394
|
+
if ((await fs.lstat(current)).isSymbolicLink()) {
|
|
395
395
|
if (options?.allowFinalSymlink && isLast) return;
|
|
396
396
|
const target = await tryRealpath(current);
|
|
397
397
|
if (!isPathInside(rootReal, target)) throw new Error(`Symlink escapes sandbox root (${shortPath(rootReal)}): ${shortPath(current)}`);
|
|
@@ -405,7 +405,7 @@ async function assertNoSymlinkEscape(relative, root, options) {
|
|
|
405
405
|
}
|
|
406
406
|
async function tryRealpath(value) {
|
|
407
407
|
try {
|
|
408
|
-
return await fs
|
|
408
|
+
return await fs.realpath(value);
|
|
409
409
|
} catch {
|
|
410
410
|
return path.resolve(value);
|
|
411
411
|
}
|
|
@@ -424,13 +424,13 @@ function shortPath(value) {
|
|
|
424
424
|
//#region src/agents/skills/bundled-dir.ts
|
|
425
425
|
function looksLikeSkillsDir(dir) {
|
|
426
426
|
try {
|
|
427
|
-
const entries =
|
|
427
|
+
const entries = fsSync.readdirSync(dir, { withFileTypes: true });
|
|
428
428
|
for (const entry of entries) {
|
|
429
429
|
if (entry.name.startsWith(".")) continue;
|
|
430
430
|
const fullPath = path.join(dir, entry.name);
|
|
431
431
|
if (entry.isFile() && entry.name.endsWith(".md")) return true;
|
|
432
432
|
if (entry.isDirectory()) {
|
|
433
|
-
if (
|
|
433
|
+
if (fsSync.existsSync(path.join(fullPath, "SKILL.md"))) return true;
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
} catch {
|
|
@@ -445,7 +445,7 @@ function resolveBundledSkillsDir(opts = {}) {
|
|
|
445
445
|
const execPath = opts.execPath ?? process.execPath;
|
|
446
446
|
const execDir = path.dirname(execPath);
|
|
447
447
|
const sibling = path.join(execDir, "skills");
|
|
448
|
-
if (
|
|
448
|
+
if (fsSync.existsSync(sibling)) return sibling;
|
|
449
449
|
} catch {}
|
|
450
450
|
try {
|
|
451
451
|
const moduleUrl = opts.moduleUrl ?? import.meta.url;
|
|
@@ -501,7 +501,7 @@ function resolvePluginSkillDirs(params) {
|
|
|
501
501
|
const trimmed = raw.trim();
|
|
502
502
|
if (!trimmed) continue;
|
|
503
503
|
const candidate = path.resolve(record.rootDir, trimmed);
|
|
504
|
-
if (!
|
|
504
|
+
if (!fsSync.existsSync(candidate)) {
|
|
505
505
|
log.warn(`plugin skill path not found (${record.id}): ${candidate}`);
|
|
506
506
|
continue;
|
|
507
507
|
}
|
|
@@ -528,7 +528,7 @@ async function serializeByKey(key, task) {
|
|
|
528
528
|
|
|
529
529
|
//#endregion
|
|
530
530
|
//#region src/agents/skills/workspace.ts
|
|
531
|
-
const fsp =
|
|
531
|
+
const fsp = fsSync.promises;
|
|
532
532
|
const skillsLogger = createSubsystemLogger("skills");
|
|
533
533
|
const skillCommandDebugOnce = /* @__PURE__ */ new Set();
|
|
534
534
|
/**
|
|
@@ -605,7 +605,7 @@ function resolveSkillsLimits(config) {
|
|
|
605
605
|
}
|
|
606
606
|
function listChildDirectories(dir) {
|
|
607
607
|
try {
|
|
608
|
-
const entries =
|
|
608
|
+
const entries = fsSync.readdirSync(dir, { withFileTypes: true });
|
|
609
609
|
const dirs = [];
|
|
610
610
|
for (const entry of entries) {
|
|
611
611
|
if (entry.name.startsWith(".")) continue;
|
|
@@ -616,7 +616,7 @@ function listChildDirectories(dir) {
|
|
|
616
616
|
continue;
|
|
617
617
|
}
|
|
618
618
|
if (entry.isSymbolicLink()) try {
|
|
619
|
-
if (
|
|
619
|
+
if (fsSync.statSync(fullPath).isDirectory()) dirs.push(entry.name);
|
|
620
620
|
} catch {}
|
|
621
621
|
}
|
|
622
622
|
return dirs;
|
|
@@ -627,7 +627,7 @@ function listChildDirectories(dir) {
|
|
|
627
627
|
function resolveNestedSkillsRoot(dir, opts) {
|
|
628
628
|
const nested = path.join(dir, "skills");
|
|
629
629
|
try {
|
|
630
|
-
if (!
|
|
630
|
+
if (!fsSync.existsSync(nested) || !fsSync.statSync(nested).isDirectory()) return { baseDir: dir };
|
|
631
631
|
} catch {
|
|
632
632
|
return { baseDir: dir };
|
|
633
633
|
}
|
|
@@ -636,7 +636,7 @@ function resolveNestedSkillsRoot(dir, opts) {
|
|
|
636
636
|
const toScan = scanLimit === 0 ? [] : nestedDirs.slice(0, Math.min(nestedDirs.length, scanLimit));
|
|
637
637
|
for (const name of toScan) {
|
|
638
638
|
const skillMd = path.join(nested, name, "SKILL.md");
|
|
639
|
-
if (
|
|
639
|
+
if (fsSync.existsSync(skillMd)) return {
|
|
640
640
|
baseDir: nested,
|
|
641
641
|
note: `Detected nested skills root at ${nested}`
|
|
642
642
|
};
|
|
@@ -656,9 +656,9 @@ function loadSkillEntries(workspaceDir, opts) {
|
|
|
656
656
|
const loadSkills = (params) => {
|
|
657
657
|
const baseDir = resolveNestedSkillsRoot(params.dir, { maxEntriesToScan: limits.maxCandidatesPerRoot }).baseDir;
|
|
658
658
|
const rootSkillMd = path.join(baseDir, "SKILL.md");
|
|
659
|
-
if (
|
|
659
|
+
if (fsSync.existsSync(rootSkillMd)) {
|
|
660
660
|
try {
|
|
661
|
-
const size =
|
|
661
|
+
const size = fsSync.statSync(rootSkillMd).size;
|
|
662
662
|
if (size > limits.maxSkillFileBytes) {
|
|
663
663
|
skillsLogger.warn("Skipping skills root due to oversized SKILL.md.", {
|
|
664
664
|
dir: baseDir,
|
|
@@ -697,9 +697,9 @@ function loadSkillEntries(workspaceDir, opts) {
|
|
|
697
697
|
for (const name of limitedChildren) {
|
|
698
698
|
const skillDir = path.join(baseDir, name);
|
|
699
699
|
const skillMd = path.join(skillDir, "SKILL.md");
|
|
700
|
-
if (!
|
|
700
|
+
if (!fsSync.existsSync(skillMd)) continue;
|
|
701
701
|
try {
|
|
702
|
-
const size =
|
|
702
|
+
const size = fsSync.statSync(skillMd).size;
|
|
703
703
|
if (size > limits.maxSkillFileBytes) {
|
|
704
704
|
skillsLogger.warn("Skipping skill due to oversized SKILL.md.", {
|
|
705
705
|
skill: name,
|
|
@@ -767,7 +767,7 @@ function loadSkillEntries(workspaceDir, opts) {
|
|
|
767
767
|
return Array.from(merged.values()).map((skill) => {
|
|
768
768
|
let frontmatter = {};
|
|
769
769
|
try {
|
|
770
|
-
frontmatter = parseFrontmatter(
|
|
770
|
+
frontmatter = parseFrontmatter(fsSync.readFileSync(skill.filePath, "utf-8"));
|
|
771
771
|
} catch {}
|
|
772
772
|
return {
|
|
773
773
|
skill,
|