@vibe-lark/larkpal 0.1.86 → 0.1.87
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/account-id-BM1T6029-BzQ_cMoi.mjs +1 -0
- package/dist/activation-context--5yu1dPF-XV0Y0pTy.mjs +1 -0
- package/dist/anthropic-CFZUCb1w.mjs +39 -0
- package/dist/assistant-visible-text-DuFWokAt-BOJV_zwc.mjs +9 -0
- package/dist/azure-openai-responses-BEuiMaF-.mjs +1 -0
- package/dist/boundary-file-read-BSd9MXPy-gnNVhPKT.mjs +1 -0
- package/dist/browser-lifecycle-cleanup-BdNsMhMD-BM97qA_M.mjs +1 -0
- package/dist/build-Bkj0hOS2.mjs +3 -0
- package/dist/bundled-compat-BpaDaAAu-DJtrIX6i.mjs +27 -0
- package/dist/bundled-dir-U738ay4K-BxbzrJOo.mjs +1 -0
- package/dist/call-DimWbpgJ-B4pv55RH.mjs +20 -0
- package/dist/channel-bootstrap.runtime-BVclcGv1-CEZ0-JP9.mjs +1 -0
- package/dist/channel-bootstrap.runtime-Cwcr38m2-Dt6QlQkX.mjs +1 -0
- package/dist/chunk-DHbaKqs-.mjs +1 -0
- package/dist/cli.mjs +7 -92
- package/dist/command-format-LSnUCVVF-Dn4h9IOh.mjs +16 -0
- package/dist/config-Bim2pi8a-03N-28sw.mjs +1 -0
- package/dist/delivery-context.shared-j5hC5qb1-BSLQG47q.mjs +1 -0
- package/dist/diagnostic-ClMwNnUA-BMKvPQJT.mjs +1 -0
- package/dist/dist-J5UB83Ws.mjs +601 -0
- package/dist/dist-coestTs9.mjs +5 -0
- package/dist/env-api-keys-Cuz5irWW.mjs +1 -0
- package/dist/event-stream-B7Ei41Bu.mjs +1 -0
- package/dist/facade-loader-DFzIYYt_-4bzFvy-b.mjs +1 -0
- package/dist/from-Ba69_5cR.mjs +14 -0
- package/dist/gateway-method-policy-C7rf0SeV-CTJcMQCE.mjs +1 -0
- package/dist/github-copilot-headers-BfhryVuU.mjs +1 -0
- package/dist/google-ABo-1guT.mjs +1 -0
- package/dist/google-gemini-cli-CGlN1zUA.mjs +2 -0
- package/dist/google-shared-C60sNhwd.mjs +301 -0
- package/dist/google-vertex-De0nAItu.mjs +1 -0
- package/dist/hash-Dw-N8Y9l.mjs +1 -0
- package/dist/headers-Bpsp70B9.mjs +1 -0
- package/dist/home-dir-C44RaPME-B5iLWwCq.mjs +1 -0
- package/dist/ids-BPsM98Uu-CJBJAeVC.mjs +1 -0
- package/dist/image-2w3cApg7-CrpUMCvm.mjs +3 -0
- package/dist/interactive-init-C5MFL5MW.mjs +8 -0
- package/dist/io-CH2g3vsv-JJtUIa_U.mjs +10 -0
- package/dist/jiti-loader-cache-Bat69wam-DNIteTtO.mjs +9 -0
- package/dist/json-file-BQRNuxmK-hRjIgOXI.mjs +1 -0
- package/dist/json-parse-BESd8UAM.mjs +3 -0
- package/dist/jws-YaZ38F_i.mjs +12 -0
- package/dist/lark-cli-provider-BLMxH6CN.mjs +4 -0
- package/dist/lark-logger-xpMKNNtY.mjs +1 -0
- package/dist/live-smoke-DpURW676.mjs +33 -0
- package/dist/load-context-mb7uvLSn-3xYwSnOZ.mjs +1 -0
- package/dist/loader-708jrx4Y-BbJRXNlQ.mjs +4 -0
- package/dist/main.mjs +153 -74571
- package/dist/manifest-registry-_hxKCS2K-OL8KK_o4.mjs +15 -0
- package/dist/mcp-server.mjs +4 -527
- package/dist/message-channel-Bk_YHfQg-n2Hw2Y0L.mjs +1 -0
- package/dist/message-channel-core-DTA--Gjh-CIh10vfo.mjs +1 -0
- package/dist/message.config.runtime-K-k4XOyq-F_h0Cgkl.mjs +1 -0
- package/dist/message.gateway.runtime-DqHOHRTQ-ge4c5p4s.mjs +1 -0
- package/dist/mistral-DyL3Zo1b.mjs +7 -0
- package/dist/model-auth-env-oyg2Hexc-DJbt9J3o.mjs +1 -0
- package/dist/models-config-BmpSQJQF-BL6S5qAo.mjs +1 -0
- package/dist/models-config.runtime-SOhLEw-f.mjs +1 -0
- package/dist/multipart-parser-B9dwXBqu.mjs +2 -0
- package/dist/oauth-25y2wc7K.mjs +75 -0
- package/dist/openai-C-rgGb7X.mjs +16 -0
- package/dist/openai-codex-responses-BbyAPsP1.mjs +7 -0
- package/dist/openai-completions-Bu5qvQzb.mjs +5 -0
- package/dist/openai-responses-pIdwQBc4.mjs +1 -0
- package/dist/openai-responses-shared-DqW1JSux.mjs +10 -0
- package/dist/paths-D6msg0S1-BO4XgM1u.mjs +1 -0
- package/dist/paths-D92DjaZ--DdtJ-zYp.mjs +1 -0
- package/dist/pi-model-discovery-Bd0TWzo8-DvSM0eWu.mjs +1 -0
- package/dist/pi-model-discovery-runtime-PrjWOmsV.mjs +1 -0
- package/dist/pi-tools.before-tool-call.runtime-Bn7uqKie-WPxU5oNX.mjs +2 -0
- package/dist/plugin-auto-enable-DdH3n9V8-Dr_bUXkG.mjs +1 -0
- package/dist/process-scoped-map-B2cWkYET-Co-i-MXA.mjs +1 -0
- package/dist/provider-discovery.runtime-DY0VWQ81.mjs +1 -0
- package/dist/provider-model-compat-CFqcq0it-BUwZENrz.mjs +1 -0
- package/dist/provider-runtime-C8rljsNs-BDvu6FW3.mjs +1 -0
- package/dist/provider-runtime-CT50mNIX-DImw7ZZu.mjs +79 -0
- package/dist/provider-stream-COLujAAo-Dpq1DSIk.mjs +248 -0
- package/dist/providers.runtime-Ba7tOlq7-B4t6ywCr.mjs +1 -0
- package/dist/public-surface-loader-BVl0NQAE-TfJ3izj1.mjs +1 -0
- package/dist/resolve-C33B7eeu-DZM_z6Wr.mjs +1 -0
- package/dist/runtime-Cym-fqI8-1GOIuRRQ.mjs +1 -0
- package/dist/runtime-channel-state-CohMybAh-BBzhl07Q.mjs +1 -0
- package/dist/runtime-snapshot-C54O1-gI-DxusscPf.mjs +1 -0
- package/dist/runtime-state-IBOIXKOx-Cw1GA1td.mjs +1 -0
- package/dist/runtime-web-tools-fallback.runtime-Ca-qn1mj-BsYE2gOd.mjs +1 -0
- package/dist/runtime-web-tools-manifest.runtime-BgxQTjmq-P6MKP9gQ.mjs +1 -0
- package/dist/runtime-web-tools-public-artifacts.runtime-D9qcoWIX-5VoyjouO.mjs +1 -0
- package/dist/session-archive.runtime-B52_5vs4-cU2tYbBz.mjs +1 -0
- package/dist/session-key-Cn2QoOyX-QZeYmbxd.mjs +1 -0
- package/dist/session-transcript-files.fs-DEeFXruQ-CXIAFSsr.mjs +1 -0
- package/dist/src-CCDx_C-U.mjs +3 -0
- package/dist/src-DACmA9V6.mjs +5 -0
- package/dist/subagent-announce-L5WsQatW--rMn240x.mjs +2 -0
- package/dist/subagent-announce.registry.runtime-DiqZyeTs-DNfNHsls.mjs +1 -0
- package/dist/subagent-registry-steer-runtime-DFgZFC0j-XYS1_qwl.mjs +1 -0
- package/dist/subagent-system-prompt-C1qnN--K-CsU4f97T.mjs +23 -0
- package/dist/target-parsing-loaded-DKkb6jJY-B830OA1a.mjs +12 -0
- package/dist/task-registry-delivery-runtime-Dd1CUkZF-B2Hj2k8C.mjs +16 -0
- package/dist/task-registry-delivery-runtime-ragbeVx5-Bdvo2Q5u.mjs +1 -0
- package/dist/thinking-Bh-7MqXz-uApNUe6g.mjs +1 -0
- package/dist/transcript-E_-ISOkD-VTwb782D.mjs +5 -0
- package/dist/transcript.runtime-BqhvZZdl-B4E0TiX5.mjs +1 -0
- package/dist/transform-messages-BTA3xbAI.mjs +1 -0
- package/dist/web-provider-public-artifacts-BlpRwIUS-DbVhDOrY.mjs +1 -0
- package/dist/web-search-providers.runtime--0aUtC3b-Bjh4Bmrz.mjs +1 -0
- package/package.json +2 -3
- package/dist/account-id-BM1T6029-DYjVxojW.mjs +0 -46
- package/dist/activation-context--5yu1dPF-Bwsn3moT.mjs +0 -172
- package/dist/anthropic-TH8ERTXK.mjs +0 -5962
- package/dist/assistant-visible-text-DuFWokAt-CsbII5KS.mjs +0 -596
- package/dist/azure-openai-responses-Bt_Ag9Er.mjs +0 -166
- package/dist/boundary-file-read-BSd9MXPy--KThL5e6.mjs +0 -594
- package/dist/browser-lifecycle-cleanup-BdNsMhMD-O3tnAM4i.mjs +0 -60
- package/dist/build-DgTrEpge.mjs +0 -3333
- package/dist/bundled-compat-BpaDaAAu-D7oazKjD.mjs +0 -5216
- package/dist/bundled-dir-U738ay4K-DXK0q_TV.mjs +0 -258
- package/dist/call-DimWbpgJ-ColD4W-y.mjs +0 -9993
- package/dist/channel-bootstrap.runtime-BVclcGv1-DJv_Z-Kr.mjs +0 -2
- package/dist/channel-bootstrap.runtime-Cwcr38m2-VRfVCR-i.mjs +0 -33
- package/dist/chunk-D6SyT4dJ.mjs +0 -36
- package/dist/command-format-LSnUCVVF-BQ2SMKka.mjs +0 -685
- package/dist/config-Bim2pi8a-BQUdfiEi.mjs +0 -9
- package/dist/delivery-context.shared-j5hC5qb1-CI83RXXZ.mjs +0 -72
- package/dist/diagnostic-ClMwNnUA-D6nUtLnb.mjs +0 -140
- package/dist/dist-CEGw8-2W.mjs +0 -429
- package/dist/dist-DD2aJ2UL.mjs +0 -125135
- package/dist/env-api-keys-BVvSg7T2.mjs +0 -68
- package/dist/event-stream-xaQWmyas.mjs +0 -15226
- package/dist/facade-loader-DFzIYYt_-CIr4HKtE.mjs +0 -194
- package/dist/from-DF7cl2wz.mjs +0 -3842
- package/dist/gateway-method-policy-C7rf0SeV-CJQMEYIE.mjs +0 -28
- package/dist/github-copilot-headers-DjqWtUoP.mjs +0 -22
- package/dist/google-C2pVrgBZ.mjs +0 -336
- package/dist/google-gemini-cli-BBxgS5Ho.mjs +0 -623
- package/dist/google-shared-BsWgwEk1.mjs +0 -22791
- package/dist/google-vertex-BsVLJrrC.mjs +0 -358
- package/dist/hash-DAFtW_W7.mjs +0 -16
- package/dist/headers-R3HdCbAE.mjs +0 -8
- package/dist/home-dir-C44RaPME-CBRS4HLP.mjs +0 -93
- package/dist/ids-BPsM98Uu-CwuxvUai.mjs +0 -77
- package/dist/image-2w3cApg7-CxpHvoB5.mjs +0 -207
- package/dist/interactive-init-BXQBalNr.mjs +0 -450
- package/dist/io-CH2g3vsv-BOGlLlB8.mjs +0 -26218
- package/dist/jiti-loader-cache-Bat69wam-D6hCxboy.mjs +0 -5049
- package/dist/json-file-BQRNuxmK-DhJM5NsG.mjs +0 -108
- package/dist/json-parse-v_HIJjjI.mjs +0 -381
- package/dist/jws-GFcTvvVT.mjs +0 -2291
- package/dist/lark-cli-provider-BARgbbmo.mjs +0 -554
- package/dist/lark-logger-D7_pEVQc.mjs +0 -143
- package/dist/live-smoke-BhkBOcH9.mjs +0 -7135
- package/dist/load-context-mb7uvLSn-B10MAi3I.mjs +0 -29
- package/dist/loader-708jrx4Y-BOswuvpe.mjs +0 -5053
- package/dist/manifest-registry-_hxKCS2K-CZdeyN0f.mjs +0 -3512
- package/dist/message-channel-Bk_YHfQg-AeNrPPpp.mjs +0 -50
- package/dist/message-channel-core-DTA--Gjh-CY4Tkb7N.mjs +0 -29
- package/dist/message.config.runtime-K-k4XOyq-DZTmXomP.mjs +0 -2
- package/dist/message.gateway.runtime-DqHOHRTQ-DH4ml0YF.mjs +0 -2
- package/dist/mistral-CaR4DiLu.mjs +0 -28657
- package/dist/model-auth-env-oyg2Hexc-DU_rOUU5.mjs +0 -1306
- package/dist/models-config-BmpSQJQF-Gfvh1n3A.mjs +0 -1282
- package/dist/models-config.runtime-BsU_22xk.mjs +0 -2
- package/dist/multipart-parser-DedmaB5g.mjs +0 -294
- package/dist/oauth-DOJeGfcE.mjs +0 -6392
- package/dist/openai-BDtIh3Ja.mjs +0 -6693
- package/dist/openai-codex-responses-C5EORu31.mjs +0 -664
- package/dist/openai-completions-CR_cS6gX.mjs +0 -669
- package/dist/openai-responses-oGxwZyuC.mjs +0 -184
- package/dist/openai-responses-shared-BixMSDZE.mjs +0 -398
- package/dist/paths-D6msg0S1-C2lYuisN.mjs +0 -189
- package/dist/paths-D92DjaZ--CTOESW2b.mjs +0 -192
- package/dist/pi-model-discovery-Bd0TWzo8-BFsJmeMb.mjs +0 -227
- package/dist/pi-model-discovery-runtime-CCCZxkd8.mjs +0 -2
- package/dist/pi-tools.before-tool-call.runtime-Bn7uqKie-C5ewk8kK.mjs +0 -399
- package/dist/plugin-auto-enable-DdH3n9V8-DsA1isaF.mjs +0 -1456
- package/dist/process-scoped-map-B2cWkYET-CXwUZ8CZ.mjs +0 -61
- package/dist/provider-discovery.runtime-BPzz1PFj.mjs +0 -58
- package/dist/provider-model-compat-CFqcq0it-BDDuBI3A.mjs +0 -118
- package/dist/provider-runtime-C8rljsNs-CIT93zoy.mjs +0 -2
- package/dist/provider-runtime-CT50mNIX-BwEV6GyO.mjs +0 -573
- package/dist/provider-stream-COLujAAo-CbJPDngm.mjs +0 -35449
- package/dist/providers.runtime-Ba7tOlq7-CXkhkzU9.mjs +0 -219
- package/dist/public-surface-loader-BVl0NQAE-C0piXtsT.mjs +0 -117
- package/dist/resolve-C33B7eeu-BNvYTl6k.mjs +0 -1041
- package/dist/runtime-Cym-fqI8-DaSDMH-a.mjs +0 -120
- package/dist/runtime-channel-state-CohMybAh-hXR6y5Gx.mjs +0 -19
- package/dist/runtime-snapshot-C54O1-gI-40cbyi7P.mjs +0 -677
- package/dist/runtime-state-IBOIXKOx-Bf9tcLvc.mjs +0 -10
- package/dist/runtime-web-tools-fallback.runtime-Ca-qn1mj-BCVImm7a.mjs +0 -39
- package/dist/runtime-web-tools-manifest.runtime-BgxQTjmq-Cb4nJkRT.mjs +0 -2
- package/dist/runtime-web-tools-public-artifacts.runtime-D9qcoWIX-BrQdXzOQ.mjs +0 -2
- package/dist/session-archive.runtime-B52_5vs4-BG-_IwNJ.mjs +0 -2
- package/dist/session-key-Cn2QoOyX-CuHbJMgR.mjs +0 -82
- package/dist/session-transcript-files.fs-DEeFXruQ-B1PF6nLy.mjs +0 -147
- package/dist/src-BgCX0MLG.mjs +0 -813
- package/dist/src-DYbqlAqf.mjs +0 -1177
- package/dist/subagent-announce-L5WsQatW-CQWI9GMd.mjs +0 -344
- package/dist/subagent-announce.registry.runtime-DiqZyeTs-BKuniyi3.mjs +0 -28
- package/dist/subagent-registry-steer-runtime-DFgZFC0j-BhBz0roy.mjs +0 -211
- package/dist/subagent-system-prompt-C1qnN--K-DpnTFP47.mjs +0 -3061
- package/dist/target-parsing-loaded-DKkb6jJY-BMD4CkpS.mjs +0 -1002
- package/dist/task-registry-delivery-runtime-Dd1CUkZF-C8U40a3O.mjs +0 -2950
- package/dist/task-registry-delivery-runtime-ragbeVx5-CNbFAkjD.mjs +0 -2
- package/dist/thinking-Bh-7MqXz-D3woGbO7.mjs +0 -2
- package/dist/transcript-E_-ISOkD-DWCfZP2p.mjs +0 -2019
- package/dist/transcript.runtime-BqhvZZdl-BPy42vBP.mjs +0 -2
- package/dist/transform-messages-DbhIzTxq.mjs +0 -207
- package/dist/web-provider-public-artifacts-BlpRwIUS-CGPSV4W2.mjs +0 -295
- package/dist/web-search-providers.runtime--0aUtC3b-DyuhC95V.mjs +0 -200
|
@@ -1,677 +0,0 @@
|
|
|
1
|
-
import { c as normalizeOptionalString, d as readStringValue, i as resolveRequiredHomeDir, o as normalizeLowercaseStringOrEmpty, s as normalizeOptionalLowercaseString } from "./home-dir-C44RaPME-CBRS4HLP.mjs";
|
|
2
|
-
import { o as resolveStateDir, s as isBlockedObjectKey } from "./paths-D92DjaZ--CTOESW2b.mjs";
|
|
3
|
-
import { l as resolveUserPath, o as isPlainObject } from "./bundled-dir-U738ay4K-DXK0q_TV.mjs";
|
|
4
|
-
import { n as CHAT_CHANNEL_ORDER } from "./ids-BPsM98Uu-CwuxvUai.mjs";
|
|
5
|
-
import { n as getActivePluginChannelRegistryVersionFromState, t as getActivePluginChannelRegistryFromState } from "./runtime-channel-state-CohMybAh-hXR6y5Gx.mjs";
|
|
6
|
-
import { At as isFileLogLevelEnabled, Ct as Chalk, Dt as isVerbose, Et as stripAnsi, Rt as normalizeAnyChannelId, St as createSubsystemLogger, kt as getLogger, u as getBundledChannelPlugin, wt as chalk } from "./bundled-compat-BpaDaAAu-D7oazKjD.mjs";
|
|
7
|
-
import { P as defaultRuntime } from "./manifest-registry-_hxKCS2K-CZdeyN0f.mjs";
|
|
8
|
-
import "./boundary-file-read-BSd9MXPy--KThL5e6.mjs";
|
|
9
|
-
import { i as normalizeAgentId, o as parseAgentSessionKey, t as DEFAULT_AGENT_ID } from "./session-key-Cn2QoOyX-CuHbJMgR.mjs";
|
|
10
|
-
import { createRequire } from "node:module";
|
|
11
|
-
import fs from "node:fs";
|
|
12
|
-
import path from "node:path";
|
|
13
|
-
import { fileURLToPath } from "node:url";
|
|
14
|
-
import "node:fs/promises";
|
|
15
|
-
import os from "node:os";
|
|
16
|
-
import { execFile } from "node:child_process";
|
|
17
|
-
import process$1 from "node:process";
|
|
18
|
-
import { promisify } from "node:util";
|
|
19
|
-
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/registry-loaded-DtXD7Ilc.js
|
|
20
|
-
let cachedChannelPlugins = {
|
|
21
|
-
registryVersion: -1,
|
|
22
|
-
registryRef: null,
|
|
23
|
-
sorted: [],
|
|
24
|
-
byId: /* @__PURE__ */ new Map()
|
|
25
|
-
};
|
|
26
|
-
function coerceLoadedChannelPlugin(plugin) {
|
|
27
|
-
const id = normalizeOptionalString(plugin?.id) ?? "";
|
|
28
|
-
if (!plugin || !id) return null;
|
|
29
|
-
if (!plugin.meta || typeof plugin.meta !== "object") plugin.meta = {};
|
|
30
|
-
return plugin;
|
|
31
|
-
}
|
|
32
|
-
function dedupeChannels(channels) {
|
|
33
|
-
const seen = /* @__PURE__ */ new Set();
|
|
34
|
-
const resolved = [];
|
|
35
|
-
for (const plugin of channels) {
|
|
36
|
-
const id = normalizeOptionalString(plugin.id) ?? "";
|
|
37
|
-
if (!id || seen.has(id)) continue;
|
|
38
|
-
seen.add(id);
|
|
39
|
-
resolved.push(plugin);
|
|
40
|
-
}
|
|
41
|
-
return resolved;
|
|
42
|
-
}
|
|
43
|
-
function resolveCachedChannelPlugins() {
|
|
44
|
-
const registry = getActivePluginChannelRegistryFromState();
|
|
45
|
-
const registryVersion = getActivePluginChannelRegistryVersionFromState();
|
|
46
|
-
const cached = cachedChannelPlugins;
|
|
47
|
-
if (cached.registryVersion === registryVersion && cached.registryRef === registry) return cached;
|
|
48
|
-
const channelPlugins = [];
|
|
49
|
-
if (registry && Array.isArray(registry.channels)) for (const entry of registry.channels) {
|
|
50
|
-
const plugin = coerceLoadedChannelPlugin(entry?.plugin);
|
|
51
|
-
if (plugin) channelPlugins.push(plugin);
|
|
52
|
-
}
|
|
53
|
-
const sorted = dedupeChannels(channelPlugins).toSorted((a, b) => {
|
|
54
|
-
const indexA = CHAT_CHANNEL_ORDER.indexOf(a.id);
|
|
55
|
-
const indexB = CHAT_CHANNEL_ORDER.indexOf(b.id);
|
|
56
|
-
const orderA = a.meta.order ?? (indexA === -1 ? 999 : indexA);
|
|
57
|
-
const orderB = b.meta.order ?? (indexB === -1 ? 999 : indexB);
|
|
58
|
-
if (orderA !== orderB) return orderA - orderB;
|
|
59
|
-
return a.id.localeCompare(b.id);
|
|
60
|
-
});
|
|
61
|
-
const byId = /* @__PURE__ */ new Map();
|
|
62
|
-
for (const plugin of sorted) byId.set(plugin.id, plugin);
|
|
63
|
-
const next = {
|
|
64
|
-
registryVersion,
|
|
65
|
-
registryRef: registry,
|
|
66
|
-
sorted,
|
|
67
|
-
byId
|
|
68
|
-
};
|
|
69
|
-
cachedChannelPlugins = next;
|
|
70
|
-
return next;
|
|
71
|
-
}
|
|
72
|
-
function listLoadedChannelPlugins() {
|
|
73
|
-
return resolveCachedChannelPlugins().sorted.slice();
|
|
74
|
-
}
|
|
75
|
-
function getLoadedChannelPluginById(id) {
|
|
76
|
-
const resolvedId = normalizeOptionalString(id) ?? "";
|
|
77
|
-
if (!resolvedId) return;
|
|
78
|
-
return resolveCachedChannelPlugins().byId.get(resolvedId);
|
|
79
|
-
}
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/registry-CaUS2Z2d.js
|
|
82
|
-
function listChannelPlugins() {
|
|
83
|
-
return listLoadedChannelPlugins();
|
|
84
|
-
}
|
|
85
|
-
function getLoadedChannelPlugin(id) {
|
|
86
|
-
const resolvedId = normalizeOptionalString(id) ?? "";
|
|
87
|
-
if (!resolvedId) return;
|
|
88
|
-
return getLoadedChannelPluginById(resolvedId);
|
|
89
|
-
}
|
|
90
|
-
function getChannelPlugin(id) {
|
|
91
|
-
const resolvedId = normalizeOptionalString(id) ?? "";
|
|
92
|
-
if (!resolvedId) return;
|
|
93
|
-
return getLoadedChannelPlugin(resolvedId) ?? getBundledChannelPlugin(resolvedId);
|
|
94
|
-
}
|
|
95
|
-
function normalizeChannelId(raw) {
|
|
96
|
-
return normalizeAnyChannelId(raw);
|
|
97
|
-
}
|
|
98
|
-
//#endregion
|
|
99
|
-
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/theme-BrRleVfL.js
|
|
100
|
-
const LOBSTER_PALETTE = {
|
|
101
|
-
accent: "#FF5A2D",
|
|
102
|
-
accentBright: "#FF7A3D",
|
|
103
|
-
accentDim: "#D14A22",
|
|
104
|
-
info: "#FF8A5B",
|
|
105
|
-
success: "#2FBF71",
|
|
106
|
-
warn: "#FFB020",
|
|
107
|
-
error: "#E23D2D",
|
|
108
|
-
muted: "#8B7F77"
|
|
109
|
-
};
|
|
110
|
-
const hasForceColor = typeof process.env.FORCE_COLOR === "string" && process.env.FORCE_COLOR.trim().length > 0 && process.env.FORCE_COLOR.trim() !== "0";
|
|
111
|
-
const baseChalk = process.env.NO_COLOR && !hasForceColor ? new Chalk({ level: 0 }) : chalk;
|
|
112
|
-
const hex = (value) => baseChalk.hex(value);
|
|
113
|
-
const theme = {
|
|
114
|
-
accent: hex(LOBSTER_PALETTE.accent),
|
|
115
|
-
accentBright: hex(LOBSTER_PALETTE.accentBright),
|
|
116
|
-
accentDim: hex(LOBSTER_PALETTE.accentDim),
|
|
117
|
-
info: hex(LOBSTER_PALETTE.info),
|
|
118
|
-
success: hex(LOBSTER_PALETTE.success),
|
|
119
|
-
warn: hex(LOBSTER_PALETTE.warn),
|
|
120
|
-
error: hex(LOBSTER_PALETTE.error),
|
|
121
|
-
muted: hex(LOBSTER_PALETTE.muted),
|
|
122
|
-
heading: baseChalk.bold.hex(LOBSTER_PALETTE.accent),
|
|
123
|
-
command: hex(LOBSTER_PALETTE.accentBright),
|
|
124
|
-
option: hex(LOBSTER_PALETTE.warn)
|
|
125
|
-
};
|
|
126
|
-
//#endregion
|
|
127
|
-
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/globals-Bo8QPRgM.js
|
|
128
|
-
function shouldLogVerbose() {
|
|
129
|
-
return isVerbose() || isFileLogLevelEnabled("debug");
|
|
130
|
-
}
|
|
131
|
-
function logVerbose(message) {
|
|
132
|
-
if (!shouldLogVerbose()) return;
|
|
133
|
-
try {
|
|
134
|
-
getLogger().debug({ message }, "verbose");
|
|
135
|
-
} catch {}
|
|
136
|
-
if (!isVerbose()) return;
|
|
137
|
-
console.log(theme.muted(message));
|
|
138
|
-
}
|
|
139
|
-
theme.success;
|
|
140
|
-
theme.warn;
|
|
141
|
-
theme.info;
|
|
142
|
-
const danger$1 = theme.error;
|
|
143
|
-
//#endregion
|
|
144
|
-
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/openclaw-exec-env-B_Z1z9iZ.js
|
|
145
|
-
const OPENCLAW_CLI_ENV_VAR = "OPENCLAW_CLI";
|
|
146
|
-
function markOpenClawExecEnv(env) {
|
|
147
|
-
return {
|
|
148
|
-
...env,
|
|
149
|
-
[OPENCLAW_CLI_ENV_VAR]: "1"
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
//#endregion
|
|
153
|
-
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/logger-Dm9TyjBd.js
|
|
154
|
-
const subsystemPrefixRe = /^([a-z][a-z0-9-]{1,20}):\s+(.*)$/i;
|
|
155
|
-
function splitSubsystem(message) {
|
|
156
|
-
const match = message.match(subsystemPrefixRe);
|
|
157
|
-
if (!match) return null;
|
|
158
|
-
const [, subsystem, rest] = match;
|
|
159
|
-
return {
|
|
160
|
-
subsystem,
|
|
161
|
-
rest
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
function logWithSubsystem(params) {
|
|
165
|
-
const parsed = params.runtime === defaultRuntime ? splitSubsystem(params.message) : null;
|
|
166
|
-
if (parsed) {
|
|
167
|
-
createSubsystemLogger(parsed.subsystem)[params.subsystemMethod](parsed.rest);
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
params.runtime[params.runtimeMethod](params.runtimeFormatter(params.message));
|
|
171
|
-
getLogger()[params.loggerMethod](params.message);
|
|
172
|
-
}
|
|
173
|
-
theme.info;
|
|
174
|
-
const warn = theme.warn;
|
|
175
|
-
theme.success;
|
|
176
|
-
const danger = theme.error;
|
|
177
|
-
function logWarn(message, runtime = defaultRuntime) {
|
|
178
|
-
logWithSubsystem({
|
|
179
|
-
message,
|
|
180
|
-
runtime,
|
|
181
|
-
runtimeMethod: "log",
|
|
182
|
-
runtimeFormatter: warn,
|
|
183
|
-
loggerMethod: "warn",
|
|
184
|
-
subsystemMethod: "warn"
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
function logError(message, runtime = defaultRuntime) {
|
|
188
|
-
logWithSubsystem({
|
|
189
|
-
message,
|
|
190
|
-
runtime,
|
|
191
|
-
runtimeMethod: "error",
|
|
192
|
-
runtimeFormatter: danger,
|
|
193
|
-
loggerMethod: "error",
|
|
194
|
-
subsystemMethod: "error"
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
function logDebug(message) {
|
|
198
|
-
getLogger().debug(message);
|
|
199
|
-
if (isVerbose()) console.log(theme.muted(message));
|
|
200
|
-
}
|
|
201
|
-
//#endregion
|
|
202
|
-
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/exec-CIhMaoDG.js
|
|
203
|
-
function resolveWindowsCommandShim(params) {
|
|
204
|
-
if ((params.platform ?? process$1.platform) !== "win32") return params.command;
|
|
205
|
-
const basename = normalizeLowercaseStringOrEmpty(path.basename(params.command));
|
|
206
|
-
if (path.extname(basename)) return params.command;
|
|
207
|
-
if (params.cmdCommands.includes(basename)) return `${params.command}.cmd`;
|
|
208
|
-
return params.command;
|
|
209
|
-
}
|
|
210
|
-
const execFileAsync = promisify(execFile);
|
|
211
|
-
const WINDOWS_UNSAFE_CMD_CHARS_RE = /[&|<>^%\r\n]/;
|
|
212
|
-
function isWindowsBatchCommand(resolvedCommand) {
|
|
213
|
-
if (process$1.platform !== "win32") return false;
|
|
214
|
-
const ext = normalizeLowercaseStringOrEmpty(path.extname(resolvedCommand));
|
|
215
|
-
return ext === ".cmd" || ext === ".bat";
|
|
216
|
-
}
|
|
217
|
-
function escapeForCmdExe(arg) {
|
|
218
|
-
if (WINDOWS_UNSAFE_CMD_CHARS_RE.test(arg)) throw new Error(`Unsafe Windows cmd.exe argument detected: ${JSON.stringify(arg)}. Pass an explicit shell-wrapper argv at the call site instead.`);
|
|
219
|
-
if (!arg.includes(" ") && !arg.includes("\"")) return arg;
|
|
220
|
-
return `"${arg.replace(/"/g, "\"\"")}"`;
|
|
221
|
-
}
|
|
222
|
-
function buildCmdExeCommandLine(resolvedCommand, args) {
|
|
223
|
-
return [escapeForCmdExe(resolvedCommand), ...args.map(escapeForCmdExe)].join(" ");
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* On Windows, Node 18.20.2+ (CVE-2024-27980) rejects spawning .cmd/.bat directly
|
|
227
|
-
* without shell, causing EINVAL. Resolve npm/npx to node + cli script so we
|
|
228
|
-
* spawn node.exe instead of npm.cmd.
|
|
229
|
-
*/
|
|
230
|
-
function resolveNpmArgvForWindows(argv) {
|
|
231
|
-
if (process$1.platform !== "win32" || argv.length === 0) return null;
|
|
232
|
-
const basename = normalizeLowercaseStringOrEmpty(path.basename(argv[0])).replace(/\.(cmd|exe|bat)$/, "");
|
|
233
|
-
const cliName = basename === "npx" ? "npx-cli.js" : basename === "npm" ? "npm-cli.js" : null;
|
|
234
|
-
if (!cliName) return null;
|
|
235
|
-
const nodeDir = path.dirname(process$1.execPath);
|
|
236
|
-
const cliPath = path.join(nodeDir, "node_modules", "npm", "bin", cliName);
|
|
237
|
-
if (!fs.existsSync(cliPath)) {
|
|
238
|
-
const command = argv[0] ?? "";
|
|
239
|
-
return [normalizeLowercaseStringOrEmpty(path.extname(command)) ? command : `${command}.cmd`, ...argv.slice(1)];
|
|
240
|
-
}
|
|
241
|
-
return [
|
|
242
|
-
process$1.execPath,
|
|
243
|
-
cliPath,
|
|
244
|
-
...argv.slice(1)
|
|
245
|
-
];
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Resolves a command for Windows compatibility.
|
|
249
|
-
* On Windows, non-.exe commands (like pnpm, yarn) are resolved to .cmd; npm/npx
|
|
250
|
-
* are handled by resolveNpmArgvForWindows to avoid spawn EINVAL (no direct .cmd).
|
|
251
|
-
*/
|
|
252
|
-
function resolveCommand(command) {
|
|
253
|
-
return resolveWindowsCommandShim({
|
|
254
|
-
command,
|
|
255
|
-
cmdCommands: [
|
|
256
|
-
"corepack",
|
|
257
|
-
"pnpm",
|
|
258
|
-
"yarn"
|
|
259
|
-
]
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
function resolveChildProcessInvocation(params) {
|
|
263
|
-
const finalArgv = process$1.platform === "win32" ? resolveNpmArgvForWindows(params.argv) ?? params.argv : params.argv;
|
|
264
|
-
const resolvedCommand = finalArgv !== params.argv ? finalArgv[0] ?? "" : resolveCommand(params.argv[0] ?? "");
|
|
265
|
-
const useCmdWrapper = isWindowsBatchCommand(resolvedCommand);
|
|
266
|
-
return {
|
|
267
|
-
command: useCmdWrapper ? process$1.env.ComSpec ?? "cmd.exe" : resolvedCommand,
|
|
268
|
-
args: useCmdWrapper ? [
|
|
269
|
-
"/d",
|
|
270
|
-
"/s",
|
|
271
|
-
"/c",
|
|
272
|
-
buildCmdExeCommandLine(resolvedCommand, finalArgv.slice(1))
|
|
273
|
-
] : finalArgv.slice(1),
|
|
274
|
-
usesWindowsExitCodeShim: process$1.platform === "win32" && (useCmdWrapper || finalArgv !== params.argv),
|
|
275
|
-
windowsHide: true,
|
|
276
|
-
windowsVerbatimArguments: useCmdWrapper ? true : params.windowsVerbatimArguments
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
async function runExec(command, args, opts = 1e4) {
|
|
280
|
-
const options = typeof opts === "number" ? {
|
|
281
|
-
timeout: opts,
|
|
282
|
-
encoding: "utf8"
|
|
283
|
-
} : {
|
|
284
|
-
timeout: opts.timeoutMs,
|
|
285
|
-
maxBuffer: opts.maxBuffer,
|
|
286
|
-
cwd: opts.cwd,
|
|
287
|
-
encoding: "utf8"
|
|
288
|
-
};
|
|
289
|
-
try {
|
|
290
|
-
const invocation = resolveChildProcessInvocation({ argv: [command, ...args] });
|
|
291
|
-
const { stdout, stderr } = await execFileAsync(invocation.command, invocation.args, {
|
|
292
|
-
...options,
|
|
293
|
-
windowsHide: invocation.windowsHide,
|
|
294
|
-
windowsVerbatimArguments: invocation.windowsVerbatimArguments
|
|
295
|
-
});
|
|
296
|
-
if (shouldLogVerbose()) {
|
|
297
|
-
if (stdout.trim()) logDebug(stdout.trim());
|
|
298
|
-
if (stderr.trim()) logError(stderr.trim());
|
|
299
|
-
}
|
|
300
|
-
return {
|
|
301
|
-
stdout,
|
|
302
|
-
stderr
|
|
303
|
-
};
|
|
304
|
-
} catch (err) {
|
|
305
|
-
if (shouldLogVerbose()) logError(danger$1(`Command failed: ${command} ${args.join(" ")}`));
|
|
306
|
-
throw err;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../docs/reference/templates");
|
|
310
|
-
function resolveDefaultAgentWorkspaceDir(env = process.env, homedir = os.homedir) {
|
|
311
|
-
const home = resolveRequiredHomeDir(env, homedir);
|
|
312
|
-
const profile = env.OPENCLAW_PROFILE?.trim();
|
|
313
|
-
if (profile && normalizeOptionalLowercaseString(profile) !== "default") return path.join(home, ".openclaw", `workspace-${profile}`);
|
|
314
|
-
return path.join(home, ".openclaw", "workspace");
|
|
315
|
-
}
|
|
316
|
-
resolveDefaultAgentWorkspaceDir();
|
|
317
|
-
//#endregion
|
|
318
|
-
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/agent-scope-D-T17Rdc.js
|
|
319
|
-
let log = null;
|
|
320
|
-
let defaultAgentWarned = false;
|
|
321
|
-
function getLog() {
|
|
322
|
-
log ??= createSubsystemLogger("agent-scope");
|
|
323
|
-
return log;
|
|
324
|
-
}
|
|
325
|
-
/** Strip null bytes from paths to prevent ENOTDIR errors. */
|
|
326
|
-
function stripNullBytes$1(s) {
|
|
327
|
-
return s.replaceAll("\0", "");
|
|
328
|
-
}
|
|
329
|
-
function listAgentEntries(cfg) {
|
|
330
|
-
const list = cfg.agents?.list;
|
|
331
|
-
if (!Array.isArray(list)) return [];
|
|
332
|
-
return list.filter((entry) => entry !== null && typeof entry === "object");
|
|
333
|
-
}
|
|
334
|
-
function resolveDefaultAgentId(cfg) {
|
|
335
|
-
const agents = listAgentEntries(cfg);
|
|
336
|
-
if (agents.length === 0) return DEFAULT_AGENT_ID;
|
|
337
|
-
const defaults = agents.filter((agent) => agent?.default);
|
|
338
|
-
if (defaults.length > 1 && !defaultAgentWarned) {
|
|
339
|
-
defaultAgentWarned = true;
|
|
340
|
-
getLog().warn("Multiple agents marked default=true; using the first entry as default.");
|
|
341
|
-
}
|
|
342
|
-
const chosen = (defaults[0] ?? agents[0])?.id?.trim();
|
|
343
|
-
return normalizeAgentId(chosen || "main");
|
|
344
|
-
}
|
|
345
|
-
function resolveAgentEntry(cfg, agentId) {
|
|
346
|
-
const id = normalizeAgentId(agentId);
|
|
347
|
-
return listAgentEntries(cfg).find((entry) => normalizeAgentId(entry.id) === id);
|
|
348
|
-
}
|
|
349
|
-
function resolveAgentConfig(cfg, agentId) {
|
|
350
|
-
const entry = resolveAgentEntry(cfg, normalizeAgentId(agentId));
|
|
351
|
-
if (!entry) return;
|
|
352
|
-
const agentDefaults = cfg.agents?.defaults;
|
|
353
|
-
return {
|
|
354
|
-
name: readStringValue(entry.name),
|
|
355
|
-
workspace: readStringValue(entry.workspace),
|
|
356
|
-
agentDir: readStringValue(entry.agentDir),
|
|
357
|
-
systemPromptOverride: readStringValue(entry.systemPromptOverride),
|
|
358
|
-
model: typeof entry.model === "string" || entry.model && typeof entry.model === "object" ? entry.model : void 0,
|
|
359
|
-
thinkingDefault: entry.thinkingDefault,
|
|
360
|
-
verboseDefault: entry.verboseDefault ?? agentDefaults?.verboseDefault,
|
|
361
|
-
reasoningDefault: entry.reasoningDefault,
|
|
362
|
-
fastModeDefault: entry.fastModeDefault,
|
|
363
|
-
skills: Array.isArray(entry.skills) ? entry.skills : void 0,
|
|
364
|
-
memorySearch: entry.memorySearch,
|
|
365
|
-
humanDelay: entry.humanDelay,
|
|
366
|
-
contextLimits: typeof entry.contextLimits === "object" && entry.contextLimits ? {
|
|
367
|
-
...agentDefaults?.contextLimits,
|
|
368
|
-
...entry.contextLimits
|
|
369
|
-
} : agentDefaults?.contextLimits,
|
|
370
|
-
heartbeat: entry.heartbeat,
|
|
371
|
-
identity: entry.identity,
|
|
372
|
-
groupChat: entry.groupChat,
|
|
373
|
-
subagents: typeof entry.subagents === "object" && entry.subagents ? entry.subagents : void 0,
|
|
374
|
-
embeddedPi: typeof entry.embeddedPi === "object" && entry.embeddedPi ? entry.embeddedPi : void 0,
|
|
375
|
-
sandbox: entry.sandbox,
|
|
376
|
-
tools: entry.tools
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
function resolveAgentWorkspaceDir(cfg, agentId, env = process.env) {
|
|
380
|
-
const id = normalizeAgentId(agentId);
|
|
381
|
-
const configured = resolveAgentConfig(cfg, id)?.workspace?.trim();
|
|
382
|
-
if (configured) return stripNullBytes$1(resolveUserPath(configured, env));
|
|
383
|
-
const defaultAgentId = resolveDefaultAgentId(cfg);
|
|
384
|
-
const fallback = cfg.agents?.defaults?.workspace?.trim();
|
|
385
|
-
if (id === defaultAgentId) {
|
|
386
|
-
if (fallback) return stripNullBytes$1(resolveUserPath(fallback, env));
|
|
387
|
-
return stripNullBytes$1(resolveDefaultAgentWorkspaceDir(env));
|
|
388
|
-
}
|
|
389
|
-
if (fallback) return stripNullBytes$1(path.join(resolveUserPath(fallback, env), id));
|
|
390
|
-
const stateDir = resolveStateDir(env);
|
|
391
|
-
return stripNullBytes$1(path.join(stateDir, `workspace-${id}`));
|
|
392
|
-
}
|
|
393
|
-
function resolveSessionAgentIds(params) {
|
|
394
|
-
const defaultAgentId = resolveDefaultAgentId(params.config ?? {});
|
|
395
|
-
const explicitAgentIdRaw = normalizeLowercaseStringOrEmpty(params.agentId);
|
|
396
|
-
const explicitAgentId = explicitAgentIdRaw ? normalizeAgentId(explicitAgentIdRaw) : null;
|
|
397
|
-
const sessionKey = params.sessionKey?.trim();
|
|
398
|
-
const normalizedSessionKey = sessionKey ? normalizeLowercaseStringOrEmpty(sessionKey) : void 0;
|
|
399
|
-
const parsed = normalizedSessionKey ? parseAgentSessionKey(normalizedSessionKey) : null;
|
|
400
|
-
return {
|
|
401
|
-
defaultAgentId,
|
|
402
|
-
sessionAgentId: explicitAgentId ?? (parsed?.agentId ? normalizeAgentId(parsed.agentId) : defaultAgentId)
|
|
403
|
-
};
|
|
404
|
-
}
|
|
405
|
-
function resolveSessionAgentId(params) {
|
|
406
|
-
return resolveSessionAgentIds(params).sessionAgentId;
|
|
407
|
-
}
|
|
408
|
-
//#endregion
|
|
409
|
-
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/record-coerce-DZKKYOg9.js
|
|
410
|
-
function isRecord(value) {
|
|
411
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
412
|
-
}
|
|
413
|
-
function asNullableRecord(value) {
|
|
414
|
-
return isRecord(value) ? value : null;
|
|
415
|
-
}
|
|
416
|
-
//#endregion
|
|
417
|
-
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/safe-text-DC97lJF2.js
|
|
418
|
-
/**
|
|
419
|
-
* Normalize untrusted text for single-line terminal/log rendering.
|
|
420
|
-
*/
|
|
421
|
-
function sanitizeTerminalText(input) {
|
|
422
|
-
const normalized = stripAnsi(input).replace(/\r/g, "\\r").replace(/\n/g, "\\n").replace(/\t/g, "\\t");
|
|
423
|
-
let sanitized = "";
|
|
424
|
-
for (const char of normalized) {
|
|
425
|
-
const code = char.charCodeAt(0);
|
|
426
|
-
if (!(code >= 0 && code <= 31 || code >= 127 && code <= 159)) sanitized += char;
|
|
427
|
-
}
|
|
428
|
-
return sanitized;
|
|
429
|
-
}
|
|
430
|
-
//#endregion
|
|
431
|
-
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/schema-validator-BkLQHQcA.js
|
|
432
|
-
function isObjectWithStringId(value) {
|
|
433
|
-
if (!isPlainObject(value)) return false;
|
|
434
|
-
return typeof value.id === "string" && value.id.length > 0;
|
|
435
|
-
}
|
|
436
|
-
/**
|
|
437
|
-
* Merge arrays of object-like entries keyed by `id`.
|
|
438
|
-
*
|
|
439
|
-
* Contract:
|
|
440
|
-
* - Base array must be fully id-keyed; otherwise return undefined (caller should replace).
|
|
441
|
-
* - Patch entries with valid id merge by id (or append when the id is new).
|
|
442
|
-
* - Patch entries without valid id append as-is, avoiding destructive full-array replacement.
|
|
443
|
-
*/
|
|
444
|
-
function mergeObjectArraysById(base, patch, options) {
|
|
445
|
-
if (!base.every(isObjectWithStringId)) return;
|
|
446
|
-
const merged = [...base];
|
|
447
|
-
const indexById = /* @__PURE__ */ new Map();
|
|
448
|
-
for (const [index, entry] of merged.entries()) {
|
|
449
|
-
if (!isObjectWithStringId(entry)) return;
|
|
450
|
-
indexById.set(entry.id, index);
|
|
451
|
-
}
|
|
452
|
-
for (const patchEntry of patch) {
|
|
453
|
-
if (!isObjectWithStringId(patchEntry)) {
|
|
454
|
-
merged.push(structuredClone(patchEntry));
|
|
455
|
-
continue;
|
|
456
|
-
}
|
|
457
|
-
const existingIndex = indexById.get(patchEntry.id);
|
|
458
|
-
if (existingIndex === void 0) {
|
|
459
|
-
merged.push(structuredClone(patchEntry));
|
|
460
|
-
indexById.set(patchEntry.id, merged.length - 1);
|
|
461
|
-
continue;
|
|
462
|
-
}
|
|
463
|
-
merged[existingIndex] = applyMergePatch(merged[existingIndex], patchEntry, options);
|
|
464
|
-
}
|
|
465
|
-
return merged;
|
|
466
|
-
}
|
|
467
|
-
function applyMergePatch(base, patch, options = {}) {
|
|
468
|
-
if (!isPlainObject(patch)) return patch;
|
|
469
|
-
const result = isPlainObject(base) ? { ...base } : {};
|
|
470
|
-
for (const [key, value] of Object.entries(patch)) {
|
|
471
|
-
if (isBlockedObjectKey(key)) continue;
|
|
472
|
-
if (value === null) {
|
|
473
|
-
delete result[key];
|
|
474
|
-
continue;
|
|
475
|
-
}
|
|
476
|
-
if (options.mergeObjectArraysById && Array.isArray(result[key]) && Array.isArray(value)) {
|
|
477
|
-
const mergedArray = mergeObjectArraysById(result[key], value, options);
|
|
478
|
-
if (mergedArray) {
|
|
479
|
-
result[key] = mergedArray;
|
|
480
|
-
continue;
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
if (isPlainObject(value)) {
|
|
484
|
-
const baseValue = result[key];
|
|
485
|
-
result[key] = applyMergePatch(isPlainObject(baseValue) ? baseValue : {}, value, options);
|
|
486
|
-
continue;
|
|
487
|
-
}
|
|
488
|
-
result[key] = value;
|
|
489
|
-
}
|
|
490
|
-
return result;
|
|
491
|
-
}
|
|
492
|
-
const MAX_ALLOWED_VALUES_HINT = 12;
|
|
493
|
-
const MAX_ALLOWED_VALUE_CHARS = 160;
|
|
494
|
-
function truncateHintText(text, limit) {
|
|
495
|
-
if (text.length <= limit) return text;
|
|
496
|
-
return `${text.slice(0, limit)}... (+${text.length - limit} chars)`;
|
|
497
|
-
}
|
|
498
|
-
function safeStringify(value) {
|
|
499
|
-
try {
|
|
500
|
-
const serialized = JSON.stringify(value);
|
|
501
|
-
if (serialized !== void 0) return serialized;
|
|
502
|
-
} catch {}
|
|
503
|
-
return String(value);
|
|
504
|
-
}
|
|
505
|
-
function toAllowedValueLabel(value) {
|
|
506
|
-
if (typeof value === "string") return JSON.stringify(truncateHintText(value, MAX_ALLOWED_VALUE_CHARS));
|
|
507
|
-
return truncateHintText(safeStringify(value), MAX_ALLOWED_VALUE_CHARS);
|
|
508
|
-
}
|
|
509
|
-
function toAllowedValueValue(value) {
|
|
510
|
-
if (typeof value === "string") return value;
|
|
511
|
-
return safeStringify(value);
|
|
512
|
-
}
|
|
513
|
-
function toAllowedValueDedupKey(value) {
|
|
514
|
-
if (value === null) return "null:null";
|
|
515
|
-
const kind = typeof value;
|
|
516
|
-
if (kind === "string") return `string:${value}`;
|
|
517
|
-
return `${kind}:${safeStringify(value)}`;
|
|
518
|
-
}
|
|
519
|
-
function summarizeAllowedValues(values) {
|
|
520
|
-
if (values.length === 0) return null;
|
|
521
|
-
const deduped = [];
|
|
522
|
-
const seenValues = /* @__PURE__ */ new Set();
|
|
523
|
-
for (const item of values) {
|
|
524
|
-
const dedupeKey = toAllowedValueDedupKey(item);
|
|
525
|
-
if (seenValues.has(dedupeKey)) continue;
|
|
526
|
-
seenValues.add(dedupeKey);
|
|
527
|
-
deduped.push({
|
|
528
|
-
value: toAllowedValueValue(item),
|
|
529
|
-
label: toAllowedValueLabel(item)
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
const shown = deduped.slice(0, MAX_ALLOWED_VALUES_HINT);
|
|
533
|
-
const hiddenCount = deduped.length - shown.length;
|
|
534
|
-
const formattedCore = shown.map((entry) => entry.label).join(", ");
|
|
535
|
-
const formatted = hiddenCount > 0 ? `${formattedCore}, ... (+${hiddenCount} more)` : formattedCore;
|
|
536
|
-
return {
|
|
537
|
-
values: shown.map((entry) => entry.value),
|
|
538
|
-
hiddenCount,
|
|
539
|
-
formatted
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
function messageAlreadyIncludesAllowedValues(message) {
|
|
543
|
-
const lower = normalizeLowercaseStringOrEmpty(message);
|
|
544
|
-
return lower.includes("(allowed:") || lower.includes("expected one of");
|
|
545
|
-
}
|
|
546
|
-
function appendAllowedValuesHint(message, summary) {
|
|
547
|
-
if (messageAlreadyIncludesAllowedValues(message)) return message;
|
|
548
|
-
return `${message} (allowed: ${summary.formatted})`;
|
|
549
|
-
}
|
|
550
|
-
const require = createRequire(import.meta.url);
|
|
551
|
-
const ajvSingletons = /* @__PURE__ */ new Map();
|
|
552
|
-
function getAjv(mode) {
|
|
553
|
-
const cached = ajvSingletons.get(mode);
|
|
554
|
-
if (cached) return cached;
|
|
555
|
-
const ajvModule = require("ajv");
|
|
556
|
-
const instance = new (typeof ajvModule.default === "function" ? ajvModule.default : ajvModule)({
|
|
557
|
-
allErrors: true,
|
|
558
|
-
strict: false,
|
|
559
|
-
removeAdditional: false,
|
|
560
|
-
...mode === "defaults" ? { useDefaults: true } : {}
|
|
561
|
-
});
|
|
562
|
-
instance.addFormat("uri", {
|
|
563
|
-
type: "string",
|
|
564
|
-
validate: (value) => {
|
|
565
|
-
return URL.canParse(value);
|
|
566
|
-
}
|
|
567
|
-
});
|
|
568
|
-
ajvSingletons.set(mode, instance);
|
|
569
|
-
return instance;
|
|
570
|
-
}
|
|
571
|
-
const schemaCache = /* @__PURE__ */ new Map();
|
|
572
|
-
function cloneValidationValue(value) {
|
|
573
|
-
if (value === void 0 || value === null) return value;
|
|
574
|
-
return structuredClone(value);
|
|
575
|
-
}
|
|
576
|
-
function normalizeAjvPath(instancePath) {
|
|
577
|
-
const path = instancePath?.replace(/^\//, "").replace(/\//g, ".");
|
|
578
|
-
return path && path.length > 0 ? path : "<root>";
|
|
579
|
-
}
|
|
580
|
-
function appendPathSegment(path, segment) {
|
|
581
|
-
const trimmed = segment.trim();
|
|
582
|
-
if (!trimmed) return path;
|
|
583
|
-
if (path === "<root>") return trimmed;
|
|
584
|
-
return `${path}.${trimmed}`;
|
|
585
|
-
}
|
|
586
|
-
function resolveMissingProperty(error) {
|
|
587
|
-
if (error.keyword !== "required" && error.keyword !== "dependentRequired" && error.keyword !== "dependencies") return null;
|
|
588
|
-
const missingProperty = error.params.missingProperty;
|
|
589
|
-
return typeof missingProperty === "string" && missingProperty.trim() ? missingProperty : null;
|
|
590
|
-
}
|
|
591
|
-
function resolveAjvErrorPath(error) {
|
|
592
|
-
const basePath = normalizeAjvPath(error.instancePath);
|
|
593
|
-
const missingProperty = resolveMissingProperty(error);
|
|
594
|
-
if (!missingProperty) return basePath;
|
|
595
|
-
return appendPathSegment(basePath, missingProperty);
|
|
596
|
-
}
|
|
597
|
-
function extractAllowedValues(error) {
|
|
598
|
-
if (error.keyword === "enum") {
|
|
599
|
-
const allowedValues = error.params.allowedValues;
|
|
600
|
-
return Array.isArray(allowedValues) ? allowedValues : null;
|
|
601
|
-
}
|
|
602
|
-
if (error.keyword === "const") {
|
|
603
|
-
const params = error.params;
|
|
604
|
-
if (!Object.prototype.hasOwnProperty.call(params, "allowedValue")) return null;
|
|
605
|
-
return [params.allowedValue];
|
|
606
|
-
}
|
|
607
|
-
return null;
|
|
608
|
-
}
|
|
609
|
-
function getAjvAllowedValuesSummary(error) {
|
|
610
|
-
const allowedValues = extractAllowedValues(error);
|
|
611
|
-
if (!allowedValues) return null;
|
|
612
|
-
return summarizeAllowedValues(allowedValues);
|
|
613
|
-
}
|
|
614
|
-
function formatAjvErrors(errors) {
|
|
615
|
-
if (!errors || errors.length === 0) return [{
|
|
616
|
-
path: "<root>",
|
|
617
|
-
message: "invalid config",
|
|
618
|
-
text: "<root>: invalid config"
|
|
619
|
-
}];
|
|
620
|
-
return errors.map((error) => {
|
|
621
|
-
const path = resolveAjvErrorPath(error);
|
|
622
|
-
const baseMessage = error.message ?? "invalid";
|
|
623
|
-
const allowedValuesSummary = getAjvAllowedValuesSummary(error);
|
|
624
|
-
const message = allowedValuesSummary ? appendAllowedValuesHint(baseMessage, allowedValuesSummary) : baseMessage;
|
|
625
|
-
return {
|
|
626
|
-
path,
|
|
627
|
-
message,
|
|
628
|
-
text: `${sanitizeTerminalText(path)}: ${sanitizeTerminalText(message)}`,
|
|
629
|
-
...allowedValuesSummary ? {
|
|
630
|
-
allowedValues: allowedValuesSummary.values,
|
|
631
|
-
allowedValuesHiddenCount: allowedValuesSummary.hiddenCount
|
|
632
|
-
} : {}
|
|
633
|
-
};
|
|
634
|
-
});
|
|
635
|
-
}
|
|
636
|
-
function validateJsonSchemaValue(params) {
|
|
637
|
-
const cacheKey = params.applyDefaults ? `${params.cacheKey}::defaults` : params.cacheKey;
|
|
638
|
-
let cached = schemaCache.get(cacheKey);
|
|
639
|
-
if (!cached || cached.schema !== params.schema) {
|
|
640
|
-
cached = {
|
|
641
|
-
validate: getAjv(params.applyDefaults ? "defaults" : "default").compile(params.schema),
|
|
642
|
-
schema: params.schema
|
|
643
|
-
};
|
|
644
|
-
schemaCache.set(cacheKey, cached);
|
|
645
|
-
}
|
|
646
|
-
const value = params.applyDefaults ? cloneValidationValue(params.value) : params.value;
|
|
647
|
-
if (cached.validate(value)) return {
|
|
648
|
-
ok: true,
|
|
649
|
-
value
|
|
650
|
-
};
|
|
651
|
-
return {
|
|
652
|
-
ok: false,
|
|
653
|
-
errors: formatAjvErrors(cached.validate.errors)
|
|
654
|
-
};
|
|
655
|
-
}
|
|
656
|
-
//#endregion
|
|
657
|
-
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/runtime-snapshot-C54O1-gI.js
|
|
658
|
-
let runtimeConfigSnapshot = null;
|
|
659
|
-
let runtimeConfigSourceSnapshot = null;
|
|
660
|
-
function setRuntimeConfigSnapshot(config, sourceConfig) {
|
|
661
|
-
runtimeConfigSnapshot = config;
|
|
662
|
-
runtimeConfigSourceSnapshot = sourceConfig ?? null;
|
|
663
|
-
}
|
|
664
|
-
function getRuntimeConfigSnapshot() {
|
|
665
|
-
return runtimeConfigSnapshot;
|
|
666
|
-
}
|
|
667
|
-
function getRuntimeConfigSourceSnapshot() {
|
|
668
|
-
return runtimeConfigSourceSnapshot;
|
|
669
|
-
}
|
|
670
|
-
function loadPinnedRuntimeConfig(loadFresh) {
|
|
671
|
-
if (runtimeConfigSnapshot) return runtimeConfigSnapshot;
|
|
672
|
-
const config = loadFresh();
|
|
673
|
-
setRuntimeConfigSnapshot(config);
|
|
674
|
-
return getRuntimeConfigSnapshot() ?? config;
|
|
675
|
-
}
|
|
676
|
-
//#endregion
|
|
677
|
-
export { normalizeChannelId as C, listChannelPlugins as S, logWarn as _, applyMergePatch as a, getChannelPlugin as b, sanitizeTerminalText as c, resolveAgentWorkspaceDir as d, resolveDefaultAgentId as f, logError as g, logDebug as h, appendAllowedValuesHint as i, asNullableRecord as l, runExec as m, getRuntimeConfigSourceSnapshot as n, summarizeAllowedValues as o, resolveSessionAgentId as p, loadPinnedRuntimeConfig as r, validateJsonSchemaValue as s, getRuntimeConfigSnapshot as t, resolveAgentConfig as u, markOpenClawExecEnv as v, getLoadedChannelPlugin as x, logVerbose as y };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/runtime-state-IBOIXKOx.js
|
|
2
|
-
const PLUGIN_REGISTRY_STATE = Symbol.for("openclaw.pluginRegistryState");
|
|
3
|
-
function getPluginRegistryState() {
|
|
4
|
-
return globalThis[PLUGIN_REGISTRY_STATE];
|
|
5
|
-
}
|
|
6
|
-
function getActivePluginRegistryWorkspaceDirFromState() {
|
|
7
|
-
return getPluginRegistryState()?.workspaceDir ?? void 0;
|
|
8
|
-
}
|
|
9
|
-
//#endregion
|
|
10
|
-
export { getActivePluginRegistryWorkspaceDirFromState as n, getPluginRegistryState as r, PLUGIN_REGISTRY_STATE as t };
|