wednesdayai 0.5.1-dev.25 → 0.5.1-dev.27
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-BKsGMXqc.js → agent-scope-DCgndASv.js} +3 -3
- package/dist/{agent-turn-runner-LKV3FMwQ.js → agent-turn-runner-CX7rX8by.js} +6 -6
- package/dist/{api-key-rotation-DZNFm4xG.js → api-key-rotation-dv2YbGr8.js} +2 -2
- package/dist/{audio-preflight-DQous9JR.js → audio-preflight-Qwb3oAbc.js} +29 -29
- package/dist/{audio-transcription-runner-BK3cV_ad.js → audio-transcription-runner-C4eHWIy0.js} +26 -26
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +60 -60
- package/dist/bundled/bootstrap-extra-files/handler.js +6 -6
- package/dist/bundled/command-logger/handler.js +2 -2
- package/dist/bundled/session-journal/handler.js +60 -60
- package/dist/bundled/session-memory/handler.js +60 -60
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-activity-BAxUpg5h.js → channel-activity-Kn1_ykXE.js} +3 -3
- package/dist/{chat-content-BWkiC3u3.js → chat-content-CX7Bfpgy.js} +34 -34
- package/dist/{chrome-Dzgbe0zH.js → chrome-Bukcguhv.js} +31 -31
- package/dist/{chunk-Bvf22vTh.js → chunk-CEygNI3g.js} +3 -3
- package/dist/{command-queue-BOMFLCHM.js → command-queue-DOzYI9q4.js} +1 -1
- package/dist/{commands-registry-Da3c0MbL.js → commands-registry-Cof4HjvY.js} +2 -2
- package/dist/config.js +9 -9
- package/dist/{deliver-CJjQbaJE.js → deliver-BaTG7V5x.js} +29 -29
- package/dist/{diagnostic-Dn_o8RGN.js → diagnostic-DMrDenZI.js} +5 -5
- package/dist/{errors-1FTZDNVR.js → errors-COs_vQr3.js} +1 -1
- package/dist/{fetch-CnDdghbc.js → fetch-B1ohBh6A.js} +8 -8
- package/dist/{fetch-guard-B6BYdjiQ.js → fetch-guard-BXzVwvnJ.js} +3 -3
- package/dist/{frontmatter-DvbDhvt1.js → frontmatter-Cw_6jMAR.js} +3 -3
- package/dist/{fs-safe-IYMDplSg.js → fs-safe-BK5ALzKD.js} +26 -26
- package/dist/github-copilot-token-DYYKoDuV.js +106 -0
- package/dist/{image-ops-BuzZGoUm.js → image-ops-C-5VgbLB.js} +1 -1
- package/dist/{ir-CBsM7qoP.js → ir-DioI2VyB.js} +5 -5
- package/dist/{legacy-names-Ckds5WWe.js → legacy-names-CghFcfry.js} +1 -1
- package/dist/llm-slug-generator.js +60 -60
- package/dist/{logger-BeXVb5cn.js → logger-J4xjy-6D.js} +1 -1
- package/dist/{manager-BujYLKny.js → manager-D728Thsn.js} +18 -18
- package/dist/{markdown-tables-WuCFdPlC.js → markdown-tables-DfLMw9ti.js} +2 -2
- package/dist/{model-selection-CHi8o17y.js → model-selection-BHGpQSa9.js} +83 -83
- package/dist/{models-config-CAlyknIh.js → models-config-CJUMccZW.js} +2 -2
- package/dist/{outbound-attachment-C6mfyze2.js → outbound-attachment-DtVXUXnX.js} +2 -2
- package/dist/{outbound-message-hooks-jUzcd2OQ.js → outbound-message-hooks-7ErHCBLv.js} +5 -5
- package/dist/{path-alias-guards-BgOxr6f8.js → path-alias-guards-E9ntDORB.js} +1 -1
- package/dist/paths-BIDPYPVC.js +233 -0
- package/dist/{pi-embedded-aOKwlbog.js → pi-embedded-DpTacVAX.js} +277 -277
- package/dist/{pi-embedded-utils-BGvDJMAA.js → pi-embedded-utils-BAaHvb5G.js} +3 -3
- package/dist/{pi-model-discovery-CYfRyzsD.js → pi-model-discovery-BaH_6win.js} +7 -7
- package/dist/plugin-sdk/{agent-turn-execute-C6g1y27e.js → agent-turn-execute-Dg4sVJSk.js} +12 -12
- package/dist/plugin-sdk/{agent-turn-runner-BkP71ySA.js → agent-turn-runner-CD9Y0Gsf.js} +4 -4
- package/dist/plugin-sdk/{audio-preflight-CsMLbzm_.js → audio-preflight-GgmY1Zte.js} +5 -5
- package/dist/plugin-sdk/{audio-transcription-runner-2bpzZm3F.js → audio-transcription-runner-0gef4Ef0.js} +1 -1
- package/dist/plugin-sdk/{chat-content-CCOQCwrz.js → chat-content-Dpzf2nbZ.js} +3 -3
- package/dist/plugin-sdk/{chrome-C2bUQR0d.js → chrome-D9DwZOSC.js} +8 -8
- package/dist/plugin-sdk/{command-queue-J0ZpvnYU.js → command-queue-Cm8QKC0F.js} +1 -1
- package/dist/plugin-sdk/{deliver-CT3Lk2kq.js → deliver-CZVPDUrt.js} +1 -1
- package/dist/plugin-sdk/{deliver-dkNTCb3Z.js → deliver-D6hs0zDt.js} +3 -3
- package/dist/plugin-sdk/{diagnostic-C-Clqb63.js → diagnostic-Bi52EuT5.js} +1 -1
- package/dist/plugin-sdk/{monitor-BHeL2-is.js → monitor-BrUwRgsT.js} +32 -32
- package/dist/plugin-sdk/{pi-embedded-utils-BmeLQMRx.js → pi-embedded-utils-CeNVVYT3.js} +1 -1
- package/dist/plugin-sdk/{provider-dispatcher-BkEWKVLB.js → provider-dispatcher-Bx_RMlu-.js} +12 -12
- package/dist/plugin-sdk/{provider-image-QDVfXKph.js → provider-image-CBXOs7yQ.js} +4 -4
- package/dist/plugin-sdk/{provider-image-BSV8WjkR.js → provider-image-DH8Jro3J.js} +1 -1
- package/dist/plugin-sdk/{pw-ai-QlS2E2LB.js → pw-ai-BP4Kwaqc.js} +1 -1
- package/dist/plugin-sdk/{runs-8iACp6xv.js → runs-C1Lvxfri.js} +3 -3
- package/dist/plugin-sdk/{runs-D0UdtKVI.js → runs-DG49eFuR.js} +5 -5
- package/dist/plugin-sdk/{send-BP8o2l4w.js → send-BguPpGBL.js} +2 -2
- package/dist/plugin-sdk/{send-CYZi6dwK.js → send-CcEF6VcP.js} +1 -1
- package/dist/plugin-sdk/{subagent-registry-DA50ITkO.js → subagent-registry-B4EmS6cu.js} +12 -12
- package/dist/plugin-sdk/testing.js +12 -12
- package/dist/{provider-image-CNBkTbhu.js → provider-image-BSkZoSBN.js} +6 -6
- package/dist/{proxy-Ds4gxPy8.js → proxy-CrSpy5Aw.js} +1 -1
- package/dist/{proxy-env-DAf-b2bM.js → proxy-env-BxR4m86L.js} +1 -1
- package/dist/{proxy-fetch-M3YAp_Kv.js → proxy-fetch-g109vqdt.js} +1 -1
- package/dist/{pw-ai-BcibeG9a.js → pw-ai-CNTt9O_x.js} +14 -14
- package/dist/{qmd-manager-C3UBJiCk.js → qmd-manager-CU9iEql0.js} +12 -12
- package/dist/{query-expansion-BT5lS0um.js → query-expansion-B_2rETEo.js} +13 -13
- package/dist/{recorder-B08vNxya.js → recorder-Clg9Kbqu.js} +2 -2
- package/dist/{redact-CKI6SufO.js → redact-DpE5Tg36.js} +1 -1
- package/dist/{replies-BHkXhmOj.js → replies-Cty02S3t.js} +5 -5
- package/dist/{reply-directives-DkfwzHl4.js → reply-directives-BIh2AkNd.js} +2 -2
- package/dist/{reply-prefix-DS2s69iC.js → reply-prefix-C-DjHvQK.js} +1 -1
- package/dist/{resolve-route-DxuZn3_M.js → resolve-route-DKZiteo6.js} +5 -5
- package/dist/{runs-DFvW_PVw.js → runs-6Q7RU60m.js} +9 -9
- package/dist/{send-D2WSE41A.js → send-Bf4geLyV.js} +8 -8
- package/dist/{send-mILKKt54.js → send-CsDSBjFo.js} +6 -6
- package/dist/{send-yIxOvEiz.js → send-DQvfLvpJ.js} +6 -6
- package/dist/{send-2aTk7PU-.js → send-VDe5tGbO.js} +28 -28
- package/dist/{send-odd2G3DX.js → send-bwKTbNlJ.js} +7 -7
- package/dist/{session-meta-B8B6RwSE.js → session-meta-5XI6vLtM.js} +1 -1
- package/dist/{sessions-DC7A0bw-.js → sessions-DF9biCmh.js} +5 -5
- package/dist/{skill-commands-DdVSQNce.js → skill-commands-CAOvM2sb.js} +8 -8
- package/dist/{skills-BXMjgvRl.js → skills-VN1CJK6W.js} +21 -21
- package/dist/{store-BVdeIl7N.js → store-HgGweM4u.js} +7 -7
- package/dist/subsystem-BZy3aWdW.js +2761 -0
- package/dist/{tables-yHwb0GsI.js → tables-DkwNUhx1.js} +1 -1
- package/dist/{tokens-CXBau-U0.js → tokens-PMai9bNL.js} +1 -1
- package/dist/{tool-loop-detection-Bw8B0hV3.js → tool-loop-detection-BqyMjpvr.js} +2 -2
- package/dist/{user-run-recording-8MZq1Us4.js → user-run-recording-B1HujJiT.js} +2 -2
- package/dist/{workspace-DK2ZEkpT.js → workspace-Bj1Jegt-.js} +27 -27
- 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/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 +6 -3
- package/scripts/install.ps1 +329 -0
- package/scripts/install.sh +2479 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { it as normalizeE164, st as resolveUserPath } from "./subsystem-
|
|
3
|
-
import { U as loadConfig, xr as resolveIMessageAccount } from "./model-selection-
|
|
4
|
-
import { m as kindFromMime } from "./image-ops-
|
|
5
|
-
import { n as resolveMarkdownTableMode } from "./markdown-tables-
|
|
6
|
-
import { t as convertMarkdownTables } from "./tables-
|
|
7
|
-
import { t as resolveOutboundAttachmentFromUrl } from "./outbound-attachment-
|
|
2
|
+
import { it as normalizeE164, st as resolveUserPath } from "./subsystem-BZy3aWdW.js";
|
|
3
|
+
import { U as loadConfig, xr as resolveIMessageAccount } from "./model-selection-BHGpQSa9.js";
|
|
4
|
+
import { m as kindFromMime } from "./image-ops-C-5VgbLB.js";
|
|
5
|
+
import { n as resolveMarkdownTableMode } from "./markdown-tables-DfLMw9ti.js";
|
|
6
|
+
import { t as convertMarkdownTables } from "./tables-DkwNUhx1.js";
|
|
7
|
+
import { t as resolveOutboundAttachmentFromUrl } from "./outbound-attachment-DtVXUXnX.js";
|
|
8
8
|
import { spawn } from "node:child_process";
|
|
9
9
|
import { createInterface } from "node:readline";
|
|
10
10
|
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { f as resolveRequiredHomeDir, l as resolveStateDir, s as resolveOAuthDir, u as expandHomePrefix } from "./paths-
|
|
3
|
-
import { Z as CONFIG_DIR, ct as safeParseJson, f as logVerbose, r as avoidTrailingHighSurrogateBreak, t as createSubsystemLogger, u as danger } from "./subsystem-
|
|
4
|
-
import { B as DEFAULT_ACCOUNT_ID, V as normalizeAccountId } from "./workspace-
|
|
5
|
-
import { G as readConfigFileSnapshotForWrite, K as writeConfigFile, Kn as getChannelPlugin, U as loadConfig, Xi as resolveTelegramPreviewStreamMode, _a as withFileLock$1, ar as resolveTelegramAccount, la as isTruthyEnvValue, qn as listChannelPlugins } from "./model-selection-
|
|
6
|
-
import { _ as logTelegramPoll, g as logTelegramDelivery, h as logTelegramApiRequest, m as logTelegramAccountState, v as logTelegramUpdate, y as logTelegramWebhook } from "./diagnostic-
|
|
2
|
+
import { f as resolveRequiredHomeDir, l as resolveStateDir, s as resolveOAuthDir, u as expandHomePrefix } from "./paths-BIDPYPVC.js";
|
|
3
|
+
import { Z as CONFIG_DIR, ct as safeParseJson, f as logVerbose, r as avoidTrailingHighSurrogateBreak, t as createSubsystemLogger, u as danger } from "./subsystem-BZy3aWdW.js";
|
|
4
|
+
import { B as DEFAULT_ACCOUNT_ID, V as normalizeAccountId } from "./workspace-Bj1Jegt-.js";
|
|
5
|
+
import { G as readConfigFileSnapshotForWrite, K as writeConfigFile, Kn as getChannelPlugin, U as loadConfig, Xi as resolveTelegramPreviewStreamMode, _a as withFileLock$1, ar as resolveTelegramAccount, la as isTruthyEnvValue, qn as listChannelPlugins } from "./model-selection-BHGpQSa9.js";
|
|
6
|
+
import { _ as logTelegramPoll, g as logTelegramDelivery, h as logTelegramApiRequest, m as logTelegramAccountState, v as logTelegramUpdate, y as logTelegramWebhook } from "./diagnostic-DMrDenZI.js";
|
|
7
7
|
import { n as sha256HexPrefix, t as redactIdentifier } from "./redact-identifier-WYElxwAZ.js";
|
|
8
|
-
import { t as redactSensitiveText } from "./redact-
|
|
9
|
-
import { h as normalizeMimeType, m as kindFromMime, p as isGifMedia, u as getFileExtension } from "./image-ops-
|
|
10
|
-
import { a as formatUncaughtError, c as readErrorName, i as formatErrorMessage, n as extractErrorCode, r as formatErrorChainMessage, t as collectErrorGraphCandidates } from "./errors-
|
|
11
|
-
import { t as hasProxyEnvConfigured } from "./proxy-env-
|
|
8
|
+
import { t as redactSensitiveText } from "./redact-DpE5Tg36.js";
|
|
9
|
+
import { h as normalizeMimeType, m as kindFromMime, p as isGifMedia, u as getFileExtension } from "./image-ops-C-5VgbLB.js";
|
|
10
|
+
import { a as formatUncaughtError, c as readErrorName, i as formatErrorMessage, n as extractErrorCode, r as formatErrorChainMessage, t as collectErrorGraphCandidates } from "./errors-COs_vQr3.js";
|
|
11
|
+
import { t as hasProxyEnvConfigured } from "./proxy-env-BxR4m86L.js";
|
|
12
12
|
import { r as writeJsonAtomic } from "./json-files-DBtcstGX.js";
|
|
13
|
-
import { i as normalizeFormDataBodyForRuntime } from "./fetch-guard-
|
|
14
|
-
import { r as makeProxyFetch } from "./proxy-fetch-
|
|
15
|
-
import { n as resolveMarkdownTableMode } from "./markdown-tables-
|
|
16
|
-
import { a as loadWebMedia, n as markdownToIR } from "./ir-
|
|
13
|
+
import { i as normalizeFormDataBodyForRuntime } from "./fetch-guard-BXzVwvnJ.js";
|
|
14
|
+
import { r as makeProxyFetch } from "./proxy-fetch-g109vqdt.js";
|
|
15
|
+
import { n as resolveMarkdownTableMode } from "./markdown-tables-DfLMw9ti.js";
|
|
16
|
+
import { a as loadWebMedia, n as markdownToIR } from "./ir-DioI2VyB.js";
|
|
17
17
|
import { t as renderMarkdownWithMarkers } from "./render-2Ztmr_V0.js";
|
|
18
18
|
import { n as wrapFetchWithAbortSignal, t as resolveFetch } from "./fetch-BVyUaG_D.js";
|
|
19
|
-
import { i as normalizePollInput, n as recordChannelActivity, o as createTelegramRetryRunner } from "./channel-activity-
|
|
19
|
+
import { i as normalizePollInput, n as recordChannelActivity, o as createTelegramRetryRunner } from "./channel-activity-Kn1_ykXE.js";
|
|
20
20
|
import { t as buildOutboundMediaLoadOptions } from "./load-options-CkQ1z00p.js";
|
|
21
21
|
import path from "node:path";
|
|
22
|
-
import
|
|
22
|
+
import fs, { readFileSync } from "node:fs";
|
|
23
23
|
import os from "node:os";
|
|
24
24
|
import JSON5 from "json5";
|
|
25
|
-
import fs from "node:fs/promises";
|
|
25
|
+
import fs$1 from "node:fs/promises";
|
|
26
26
|
import process$1 from "node:process";
|
|
27
27
|
import crypto, { randomBytes } from "node:crypto";
|
|
28
28
|
import * as net$1 from "node:net";
|
|
@@ -160,7 +160,7 @@ function getPairingAdapter(channelId) {
|
|
|
160
160
|
//#region src/plugin-sdk/json-store.ts
|
|
161
161
|
async function readJsonFileWithFallback(filePath, fallback) {
|
|
162
162
|
try {
|
|
163
|
-
const parsed = safeParseJson(await
|
|
163
|
+
const parsed = safeParseJson(await fs.promises.readFile(filePath, "utf-8"));
|
|
164
164
|
if (parsed == null) return {
|
|
165
165
|
value: fallback,
|
|
166
166
|
exists: true
|
|
@@ -247,7 +247,7 @@ async function readPairingRequests(filePath) {
|
|
|
247
247
|
}
|
|
248
248
|
async function ensureJsonFile(filePath, fallback) {
|
|
249
249
|
try {
|
|
250
|
-
await
|
|
250
|
+
await fs.promises.access(filePath);
|
|
251
251
|
} catch {
|
|
252
252
|
await writeJsonFile(filePath, fallback);
|
|
253
253
|
}
|
|
@@ -403,7 +403,7 @@ function resolveAllowFromReadCacheOrMissing(filePath, stat) {
|
|
|
403
403
|
async function readAllowFromStateForPathWithExists(channel, filePath) {
|
|
404
404
|
let stat = null;
|
|
405
405
|
try {
|
|
406
|
-
stat = await
|
|
406
|
+
stat = await fs.promises.stat(filePath);
|
|
407
407
|
} catch (err) {
|
|
408
408
|
if (err.code !== "ENOENT") throw err;
|
|
409
409
|
}
|
|
@@ -446,7 +446,7 @@ async function writeAllowFromState(filePath, allowFrom) {
|
|
|
446
446
|
});
|
|
447
447
|
let stat = null;
|
|
448
448
|
try {
|
|
449
|
-
stat = await
|
|
449
|
+
stat = await fs.promises.stat(filePath);
|
|
450
450
|
} catch {}
|
|
451
451
|
setAllowFromReadCache(filePath, {
|
|
452
452
|
exists: true,
|
|
@@ -1053,7 +1053,7 @@ function resolveCronStorePath(storePath) {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
async function loadCronStore(storePath) {
|
|
1055
1055
|
try {
|
|
1056
|
-
const raw = await
|
|
1056
|
+
const raw = await fs.promises.readFile(storePath, "utf-8");
|
|
1057
1057
|
let parsed;
|
|
1058
1058
|
try {
|
|
1059
1059
|
parsed = JSON5.parse(raw);
|
|
@@ -1079,13 +1079,13 @@ async function loadCronStore(storePath) {
|
|
|
1079
1079
|
}
|
|
1080
1080
|
}
|
|
1081
1081
|
async function saveCronStore(storePath, store) {
|
|
1082
|
-
await
|
|
1082
|
+
await fs.promises.mkdir(path.dirname(storePath), { recursive: true });
|
|
1083
1083
|
const json = JSON.stringify(store, null, 2);
|
|
1084
1084
|
const cached = serializedStoreCache.get(storePath);
|
|
1085
1085
|
if (cached === json) return;
|
|
1086
1086
|
let previous = cached ?? null;
|
|
1087
1087
|
if (previous === null) try {
|
|
1088
|
-
previous = await
|
|
1088
|
+
previous = await fs.promises.readFile(storePath, "utf-8");
|
|
1089
1089
|
} catch (err) {
|
|
1090
1090
|
if (err.code !== "ENOENT") throw err;
|
|
1091
1091
|
}
|
|
@@ -1094,9 +1094,9 @@ async function saveCronStore(storePath, store) {
|
|
|
1094
1094
|
return;
|
|
1095
1095
|
}
|
|
1096
1096
|
const tmp = `${storePath}.${process.pid}.${randomBytes(8).toString("hex")}.tmp`;
|
|
1097
|
-
await
|
|
1097
|
+
await fs.promises.writeFile(tmp, json, "utf-8");
|
|
1098
1098
|
if (previous !== null) try {
|
|
1099
|
-
await
|
|
1099
|
+
await fs.promises.copyFile(storePath, `${storePath}.bak`);
|
|
1100
1100
|
} catch {}
|
|
1101
1101
|
await renameWithRetry(tmp, storePath);
|
|
1102
1102
|
serializedStoreCache.set(storePath, json);
|
|
@@ -1105,7 +1105,7 @@ const RENAME_MAX_RETRIES = 3;
|
|
|
1105
1105
|
const RENAME_BASE_DELAY_MS = 50;
|
|
1106
1106
|
async function renameWithRetry(src, dest) {
|
|
1107
1107
|
for (let attempt = 0; attempt <= RENAME_MAX_RETRIES; attempt++) try {
|
|
1108
|
-
await
|
|
1108
|
+
await fs.promises.rename(src, dest);
|
|
1109
1109
|
return;
|
|
1110
1110
|
} catch (err) {
|
|
1111
1111
|
const code = err.code;
|
|
@@ -1114,8 +1114,8 @@ async function renameWithRetry(src, dest) {
|
|
|
1114
1114
|
continue;
|
|
1115
1115
|
}
|
|
1116
1116
|
if (code === "EPERM" || code === "EEXIST") {
|
|
1117
|
-
await
|
|
1118
|
-
await
|
|
1117
|
+
await fs.promises.copyFile(src, dest);
|
|
1118
|
+
await fs.promises.unlink(src).catch(() => {});
|
|
1119
1119
|
return;
|
|
1120
1120
|
}
|
|
1121
1121
|
throw err;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { f as logVerbose } from "./subsystem-
|
|
3
|
-
import { U as loadConfig, fr as resolveSlackBotToken, lr as resolveSlackAccount } from "./model-selection-
|
|
2
|
+
import { f as logVerbose } from "./subsystem-BZy3aWdW.js";
|
|
3
|
+
import { U as loadConfig, fr as resolveSlackBotToken, lr as resolveSlackAccount } from "./model-selection-BHGpQSa9.js";
|
|
4
4
|
import { i as requireTargetKind, n as ensureTargetId, r as parseMentionPrefixOrAtUserTarget, t as buildMessagingTarget } from "./targets-05TiAkXA.js";
|
|
5
|
-
import { i as isSilentReplyText } from "./tokens-
|
|
6
|
-
import { r as withTrustedEnvProxyGuardedFetchMode, t as fetchWithSsrFGuard } from "./fetch-guard-
|
|
7
|
-
import { d as resolveTextChunkLimit, i as chunkMarkdownTextWithMode, l as resolveChunkMode, u as resolveChunkNewlinePacking } from "./chunk-
|
|
8
|
-
import { n as resolveMarkdownTableMode } from "./markdown-tables-
|
|
9
|
-
import { a as loadWebMedia, n as markdownToIR, t as chunkMarkdownIR } from "./ir-
|
|
5
|
+
import { i as isSilentReplyText } from "./tokens-PMai9bNL.js";
|
|
6
|
+
import { r as withTrustedEnvProxyGuardedFetchMode, t as fetchWithSsrFGuard } from "./fetch-guard-BXzVwvnJ.js";
|
|
7
|
+
import { d as resolveTextChunkLimit, i as chunkMarkdownTextWithMode, l as resolveChunkMode, u as resolveChunkNewlinePacking } from "./chunk-CEygNI3g.js";
|
|
8
|
+
import { n as resolveMarkdownTableMode } from "./markdown-tables-DfLMw9ti.js";
|
|
9
|
+
import { a as loadWebMedia, n as markdownToIR, t as chunkMarkdownIR } from "./ir-DioI2VyB.js";
|
|
10
10
|
import { t as renderMarkdownWithMarkers } from "./render-2Ztmr_V0.js";
|
|
11
11
|
import { WebClient } from "@slack/web-api";
|
|
12
12
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { Un as resolveStorePath, xn as recordSessionMetaFromInbound } from "./model-selection-
|
|
2
|
+
import { Un as resolveStorePath, xn as recordSessionMetaFromInbound } from "./model-selection-BHGpQSa9.js";
|
|
3
3
|
|
|
4
4
|
//#region src/channels/session-meta.ts
|
|
5
5
|
var session_meta_exports = /* @__PURE__ */ __exportAll({ recordInboundSessionMetaSafe: () => recordInboundSessionMetaSafe });
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { l as resolveStateDir } from "./paths-
|
|
2
|
-
import { ft as sliceUtf16Safe, it as normalizeE164, pt as truncateUtf16Safe, t as createSubsystemLogger } from "./subsystem-
|
|
3
|
-
import { C as buildAgentMainSessionKey, D as computeIdentityLinkScopedMatchKey, E as computeIdentityLinkMatchKeys, F as resolveConfiguredCanonicalIdentity, G as WAKE_GATE_SESSION_KEY_SEGMENT, M as normalizeMainKey, P as resolveCanonicalIdentity, Q as parseAgentSessionKey, S as RAW_PEER_KEY_PREFIX, U as BACKGROUND_SESSION_KEY_SEGMENT, W as HEARTBEAT_SESSION_KEY_SEGMENT, X as isCronTriggerSessionKey, j as normalizeAgentId, y as DEFAULT_AGENT_ID } from "./workspace-
|
|
4
|
-
import { $r as isRetryExhausted, En as DEFAULT_IDLE_MINUTES, Fn as resolveUpdatedAfterPageSize, Gn as resolveGroupSessionKey, Ln as SESSION_RUN_STORE_FILE_NAME, Nn as serializeSessionIndexRecordKey, Qr as computeNextAvailableAtMs, Rn as resolveDefaultSessionStorePath, U as loadConfig, Un as resolveStorePath, Vr as normalizeMessageChannel, Xr as CtxProjectionCorruptionError, _n as loadSessionStore, dn as requireSessionStorageRuntime, ei as parseRetryPolicy, hn as getConfiguredSessionStorageRuntime, ln as getConversationReadQuery, ti as serializeRetryPolicy, va as resolveProcessScopedMap, wn as updateSessionStore, zn as resolveSessionFilePath } from "./model-selection-
|
|
1
|
+
import { l as resolveStateDir } from "./paths-BIDPYPVC.js";
|
|
2
|
+
import { ft as sliceUtf16Safe, it as normalizeE164, pt as truncateUtf16Safe, t as createSubsystemLogger } from "./subsystem-BZy3aWdW.js";
|
|
3
|
+
import { C as buildAgentMainSessionKey, D as computeIdentityLinkScopedMatchKey, E as computeIdentityLinkMatchKeys, F as resolveConfiguredCanonicalIdentity, G as WAKE_GATE_SESSION_KEY_SEGMENT, M as normalizeMainKey, P as resolveCanonicalIdentity, Q as parseAgentSessionKey, S as RAW_PEER_KEY_PREFIX, U as BACKGROUND_SESSION_KEY_SEGMENT, W as HEARTBEAT_SESSION_KEY_SEGMENT, X as isCronTriggerSessionKey, j as normalizeAgentId, y as DEFAULT_AGENT_ID } from "./workspace-Bj1Jegt-.js";
|
|
4
|
+
import { $r as isRetryExhausted, En as DEFAULT_IDLE_MINUTES, Fn as resolveUpdatedAfterPageSize, Gn as resolveGroupSessionKey, Ln as SESSION_RUN_STORE_FILE_NAME, Nn as serializeSessionIndexRecordKey, Qr as computeNextAvailableAtMs, Rn as resolveDefaultSessionStorePath, U as loadConfig, Un as resolveStorePath, Vr as normalizeMessageChannel, Xr as CtxProjectionCorruptionError, _n as loadSessionStore, dn as requireSessionStorageRuntime, ei as parseRetryPolicy, hn as getConfiguredSessionStorageRuntime, ln as getConversationReadQuery, ti as serializeRetryPolicy, va as resolveProcessScopedMap, wn as updateSessionStore, zn as resolveSessionFilePath } from "./model-selection-BHGpQSa9.js";
|
|
5
5
|
import { r as normalizeChatType } from "./conversation-label-CrORLc0j.js";
|
|
6
6
|
import { t as emitDiagnosticEvent } from "./diagnostic-events-DGRcTqIH.js";
|
|
7
7
|
import { t as emitSessionTranscriptUpdate } from "./transcript-events-C9cNWasT.js";
|
|
8
|
-
import { r as formatErrorChainMessage } from "./errors-
|
|
8
|
+
import { r as formatErrorChainMessage } from "./errors-COs_vQr3.js";
|
|
9
9
|
import { a as guardVerificationStoreInputs, i as clientResumeRecordArtifactId, n as VERIFICATION_STORE_ERROR_CODES, r as VerificationStoreError, t as CLIENT_RESUME_RECORD_KIND } from "./verification-store-BjtVxiJr.js";
|
|
10
10
|
import { createRequire } from "node:module";
|
|
11
11
|
import path, { join } from "node:path";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { c as resolveAgentWorkspaceDir, n as listAgentIds, s as resolveAgentSkillsFilter } from "./agent-scope-
|
|
3
|
-
import { l as resolveStateDir } from "./paths-
|
|
4
|
-
import { Z as CONFIG_DIR, f as logVerbose, st as resolveUserPath, t as createSubsystemLogger } from "./subsystem-
|
|
5
|
-
import { s as resolvePluginSkillDirs, t as buildWorkspaceSkillCommandSpecs } from "./skills-
|
|
2
|
+
import { c as resolveAgentWorkspaceDir, n as listAgentIds, s as resolveAgentSkillsFilter } from "./agent-scope-DCgndASv.js";
|
|
3
|
+
import { l as resolveStateDir } from "./paths-BIDPYPVC.js";
|
|
4
|
+
import { Z as CONFIG_DIR, f as logVerbose, st as resolveUserPath, t as createSubsystemLogger } from "./subsystem-BZy3aWdW.js";
|
|
5
|
+
import { s as resolvePluginSkillDirs, t as buildWorkspaceSkillCommandSpecs } from "./skills-VN1CJK6W.js";
|
|
6
6
|
import { t as createAsyncLock } from "./json-files-DBtcstGX.js";
|
|
7
|
-
import { a as listChatCommands } from "./commands-registry-
|
|
7
|
+
import { a as listChatCommands } from "./commands-registry-Cof4HjvY.js";
|
|
8
8
|
import path from "node:path";
|
|
9
|
-
import
|
|
9
|
+
import fs from "node:fs";
|
|
10
10
|
import os from "node:os";
|
|
11
11
|
import { randomUUID } from "node:crypto";
|
|
12
12
|
import chokidar from "chokidar";
|
|
@@ -248,13 +248,13 @@ function listSkillCommandsForAgents(params) {
|
|
|
248
248
|
const workspaceFilters = /* @__PURE__ */ new Map();
|
|
249
249
|
for (const agentId of agentIds) {
|
|
250
250
|
const workspaceDir = resolveAgentWorkspaceDir(params.cfg, agentId);
|
|
251
|
-
if (!
|
|
251
|
+
if (!fs.existsSync(workspaceDir)) {
|
|
252
252
|
logVerbose(`Skipping agent "${agentId}": workspace does not exist: ${workspaceDir}`);
|
|
253
253
|
continue;
|
|
254
254
|
}
|
|
255
255
|
let canonicalDir;
|
|
256
256
|
try {
|
|
257
|
-
canonicalDir =
|
|
257
|
+
canonicalDir = fs.realpathSync(workspaceDir);
|
|
258
258
|
} catch {
|
|
259
259
|
logVerbose(`Skipping agent "${agentId}": cannot resolve workspace: ${workspaceDir}`);
|
|
260
260
|
continue;
|
|
@@ -1,11 +1,11 @@
|
|
|
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-
|
|
3
|
-
import { h as resolveOpenClawPackageRootSync } from "./workspace-
|
|
4
|
-
import { At as normalizePluginsConfig, Ea as normalizeResolvedSecretInputString, Et as loadPluginManifestRegistry, Mt as resolveMemorySlotDecision, jt as resolveEffectiveEnableState } from "./model-selection-
|
|
5
|
-
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-
|
|
6
|
-
import { n as assertNoPathAliasEscape } from "./path-alias-guards-
|
|
1
|
+
import { m as normalizeSkillFilter } from "./agent-scope-DCgndASv.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-BZy3aWdW.js";
|
|
3
|
+
import { h as resolveOpenClawPackageRootSync } from "./workspace-Bj1Jegt-.js";
|
|
4
|
+
import { At as normalizePluginsConfig, Ea as normalizeResolvedSecretInputString, Et as loadPluginManifestRegistry, Mt as resolveMemorySlotDecision, jt as resolveEffectiveEnableState } from "./model-selection-BHGpQSa9.js";
|
|
5
|
+
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-Cw_6jMAR.js";
|
|
6
|
+
import { n as assertNoPathAliasEscape } from "./path-alias-guards-E9ntDORB.js";
|
|
7
7
|
import path from "node:path";
|
|
8
|
-
import
|
|
8
|
+
import fs from "node:fs";
|
|
9
9
|
import os from "node:os";
|
|
10
10
|
import { URL as URL$1, fileURLToPath } from "node:url";
|
|
11
11
|
import { formatSkillsForPrompt, loadSkillsFromDir } from "@mariozechner/pi-coding-agent";
|
|
@@ -542,13 +542,13 @@ function shortPath(value) {
|
|
|
542
542
|
//#region src/agents/skills/bundled-dir.ts
|
|
543
543
|
function looksLikeSkillsDir(dir) {
|
|
544
544
|
try {
|
|
545
|
-
const entries =
|
|
545
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
546
546
|
for (const entry of entries) {
|
|
547
547
|
if (entry.name.startsWith(".")) continue;
|
|
548
548
|
const fullPath = path.join(dir, entry.name);
|
|
549
549
|
if (entry.isFile() && entry.name.endsWith(".md")) return true;
|
|
550
550
|
if (entry.isDirectory()) {
|
|
551
|
-
if (
|
|
551
|
+
if (fs.existsSync(path.join(fullPath, "SKILL.md"))) return true;
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
554
|
} catch {
|
|
@@ -563,7 +563,7 @@ function resolveBundledSkillsDir(opts = {}) {
|
|
|
563
563
|
const execPath = opts.execPath ?? process.execPath;
|
|
564
564
|
const execDir = path.dirname(execPath);
|
|
565
565
|
const sibling = path.join(execDir, "skills");
|
|
566
|
-
if (
|
|
566
|
+
if (fs.existsSync(sibling)) return sibling;
|
|
567
567
|
} catch {}
|
|
568
568
|
try {
|
|
569
569
|
const moduleUrl = opts.moduleUrl ?? import.meta.url;
|
|
@@ -626,7 +626,7 @@ function resolvePluginSkillDirs(params) {
|
|
|
626
626
|
const trimmed = raw.trim();
|
|
627
627
|
if (!trimmed) continue;
|
|
628
628
|
const candidate = path.resolve(record.rootDir, trimmed);
|
|
629
|
-
if (!
|
|
629
|
+
if (!fs.existsSync(candidate)) {
|
|
630
630
|
log.warn(`plugin skill path not found (${record.id}): ${candidate}`);
|
|
631
631
|
continue;
|
|
632
632
|
}
|
|
@@ -657,7 +657,7 @@ async function serializeByKey(key, task) {
|
|
|
657
657
|
|
|
658
658
|
//#endregion
|
|
659
659
|
//#region src/agents/skills/workspace.ts
|
|
660
|
-
const fsp =
|
|
660
|
+
const fsp = fs.promises;
|
|
661
661
|
const skillsLogger = createSubsystemLogger("skills");
|
|
662
662
|
const skillCommandDebugOnce = /* @__PURE__ */ new Set();
|
|
663
663
|
/**
|
|
@@ -734,7 +734,7 @@ function resolveSkillsLimits(config) {
|
|
|
734
734
|
}
|
|
735
735
|
function listChildDirectories(dir) {
|
|
736
736
|
try {
|
|
737
|
-
const entries =
|
|
737
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
738
738
|
const dirs = [];
|
|
739
739
|
for (const entry of entries) {
|
|
740
740
|
if (entry.name.startsWith(".")) continue;
|
|
@@ -745,7 +745,7 @@ function listChildDirectories(dir) {
|
|
|
745
745
|
continue;
|
|
746
746
|
}
|
|
747
747
|
if (entry.isSymbolicLink()) try {
|
|
748
|
-
if (
|
|
748
|
+
if (fs.statSync(fullPath).isDirectory()) dirs.push(entry.name);
|
|
749
749
|
} catch {}
|
|
750
750
|
}
|
|
751
751
|
return dirs;
|
|
@@ -756,7 +756,7 @@ function listChildDirectories(dir) {
|
|
|
756
756
|
function resolveNestedSkillsRoot(dir, opts) {
|
|
757
757
|
const nested = path.join(dir, "skills");
|
|
758
758
|
try {
|
|
759
|
-
if (!
|
|
759
|
+
if (!fs.existsSync(nested) || !fs.statSync(nested).isDirectory()) return { baseDir: dir };
|
|
760
760
|
} catch {
|
|
761
761
|
return { baseDir: dir };
|
|
762
762
|
}
|
|
@@ -765,7 +765,7 @@ function resolveNestedSkillsRoot(dir, opts) {
|
|
|
765
765
|
const toScan = scanLimit === 0 ? [] : nestedDirs.slice(0, Math.min(nestedDirs.length, scanLimit));
|
|
766
766
|
for (const name of toScan) {
|
|
767
767
|
const skillMd = path.join(nested, name, "SKILL.md");
|
|
768
|
-
if (
|
|
768
|
+
if (fs.existsSync(skillMd)) return {
|
|
769
769
|
baseDir: nested,
|
|
770
770
|
note: `Detected nested skills root at ${nested}`
|
|
771
771
|
};
|
|
@@ -785,9 +785,9 @@ function loadSkillEntries(workspaceDir, opts) {
|
|
|
785
785
|
const loadSkills = (params) => {
|
|
786
786
|
const baseDir = resolveNestedSkillsRoot(params.dir, { maxEntriesToScan: limits.maxCandidatesPerRoot }).baseDir;
|
|
787
787
|
const rootSkillMd = path.join(baseDir, "SKILL.md");
|
|
788
|
-
if (
|
|
788
|
+
if (fs.existsSync(rootSkillMd)) {
|
|
789
789
|
try {
|
|
790
|
-
const size =
|
|
790
|
+
const size = fs.statSync(rootSkillMd).size;
|
|
791
791
|
if (size > limits.maxSkillFileBytes) {
|
|
792
792
|
skillsLogger.warn("Skipping skills root due to oversized SKILL.md.", {
|
|
793
793
|
dir: baseDir,
|
|
@@ -826,9 +826,9 @@ function loadSkillEntries(workspaceDir, opts) {
|
|
|
826
826
|
for (const name of limitedChildren) {
|
|
827
827
|
const skillDir = path.join(baseDir, name);
|
|
828
828
|
const skillMd = path.join(skillDir, "SKILL.md");
|
|
829
|
-
if (!
|
|
829
|
+
if (!fs.existsSync(skillMd)) continue;
|
|
830
830
|
try {
|
|
831
|
-
const size =
|
|
831
|
+
const size = fs.statSync(skillMd).size;
|
|
832
832
|
if (size > limits.maxSkillFileBytes) {
|
|
833
833
|
skillsLogger.warn("Skipping skill due to oversized SKILL.md.", {
|
|
834
834
|
skill: name,
|
|
@@ -896,7 +896,7 @@ function loadSkillEntries(workspaceDir, opts) {
|
|
|
896
896
|
return Array.from(merged.values()).map((skill) => {
|
|
897
897
|
let frontmatter = {};
|
|
898
898
|
try {
|
|
899
|
-
frontmatter = parseFrontmatter(
|
|
899
|
+
frontmatter = parseFrontmatter(fs.readFileSync(skill.filePath, "utf-8"));
|
|
900
900
|
} catch {}
|
|
901
901
|
return {
|
|
902
902
|
skill,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ot as resolveConfigDir } from "./subsystem-
|
|
2
|
-
import { c as detectMime, l as extensionForMime } from "./image-ops-
|
|
1
|
+
import { ot as resolveConfigDir } from "./subsystem-BZy3aWdW.js";
|
|
2
|
+
import { c as detectMime, l as extensionForMime } from "./image-ops-C-5VgbLB.js";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import fs from "node:fs/promises";
|
|
4
|
+
import fs$1 from "node:fs/promises";
|
|
5
5
|
import crypto from "node:crypto";
|
|
6
6
|
import { pipeline } from "node:stream/promises";
|
|
7
7
|
|
|
@@ -14,7 +14,7 @@ const MEDIA_FILE_MODE = 420;
|
|
|
14
14
|
async function setMediaFileMode(filePath) {
|
|
15
15
|
if (process.platform === "win32") return;
|
|
16
16
|
try {
|
|
17
|
-
await fs.chmod(filePath, MEDIA_FILE_MODE);
|
|
17
|
+
await fs$1.chmod(filePath, MEDIA_FILE_MODE);
|
|
18
18
|
} catch (err) {
|
|
19
19
|
const code = err && typeof err === "object" && "code" in err ? String(err.code) : "";
|
|
20
20
|
if ([
|
|
@@ -41,7 +41,7 @@ function getMediaDir() {
|
|
|
41
41
|
}
|
|
42
42
|
async function ensureMediaDir() {
|
|
43
43
|
const mediaDir = resolveMediaDir();
|
|
44
|
-
await fs.mkdir(mediaDir, {
|
|
44
|
+
await fs$1.mkdir(mediaDir, {
|
|
45
45
|
recursive: true,
|
|
46
46
|
mode: 448
|
|
47
47
|
});
|
|
@@ -50,7 +50,7 @@ async function ensureMediaDir() {
|
|
|
50
50
|
async function saveMediaBuffer(buffer, contentType, subdir = "inbound", maxBytes = MAX_BYTES, originalFilename) {
|
|
51
51
|
if (buffer.byteLength > maxBytes) throw new Error(`Media exceeds ${(maxBytes / (1024 * 1024)).toFixed(0)}MB limit`);
|
|
52
52
|
const dir = path.join(resolveMediaDir(), subdir);
|
|
53
|
-
await fs.mkdir(dir, {
|
|
53
|
+
await fs$1.mkdir(dir, {
|
|
54
54
|
recursive: true,
|
|
55
55
|
mode: 448
|
|
56
56
|
});
|
|
@@ -70,7 +70,7 @@ async function saveMediaBuffer(buffer, contentType, subdir = "inbound", maxBytes
|
|
|
70
70
|
id = sanitized ? `${sanitized}---${uuid}${ext}` : `${uuid}${ext}`;
|
|
71
71
|
} else id = ext ? `${uuid}${ext}` : uuid;
|
|
72
72
|
const dest = path.join(dir, id);
|
|
73
|
-
await fs.writeFile(dest, buffer, { mode: MEDIA_FILE_MODE });
|
|
73
|
+
await fs$1.writeFile(dest, buffer, { mode: MEDIA_FILE_MODE });
|
|
74
74
|
await setMediaFileMode(dest);
|
|
75
75
|
return {
|
|
76
76
|
id,
|