@vibe-lark/larkpal 0.1.85 → 0.1.86
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-DYjVxojW.mjs +46 -0
- package/dist/activation-context--5yu1dPF-Bwsn3moT.mjs +172 -0
- package/dist/anthropic-TH8ERTXK.mjs +5962 -0
- package/dist/assistant-visible-text-DuFWokAt-CsbII5KS.mjs +596 -0
- package/dist/azure-openai-responses-Bt_Ag9Er.mjs +166 -0
- package/dist/boundary-file-read-BSd9MXPy--KThL5e6.mjs +594 -0
- package/dist/browser-lifecycle-cleanup-BdNsMhMD-O3tnAM4i.mjs +60 -0
- package/dist/build-DgTrEpge.mjs +3333 -0
- package/dist/bundled-compat-BpaDaAAu-D7oazKjD.mjs +5216 -0
- package/dist/bundled-dir-U738ay4K-DXK0q_TV.mjs +258 -0
- package/dist/call-DimWbpgJ-ColD4W-y.mjs +9993 -0
- package/dist/channel-bootstrap.runtime-BVclcGv1-DJv_Z-Kr.mjs +2 -0
- package/dist/channel-bootstrap.runtime-Cwcr38m2-VRfVCR-i.mjs +33 -0
- package/dist/chunk-D6SyT4dJ.mjs +36 -0
- package/dist/cli.mjs +6 -6
- package/dist/command-format-LSnUCVVF-BQ2SMKka.mjs +685 -0
- package/dist/config-Bim2pi8a-BQUdfiEi.mjs +9 -0
- package/dist/delivery-context.shared-j5hC5qb1-CI83RXXZ.mjs +72 -0
- package/dist/diagnostic-ClMwNnUA-D6nUtLnb.mjs +140 -0
- package/dist/dist-CEGw8-2W.mjs +429 -0
- package/dist/dist-DD2aJ2UL.mjs +125135 -0
- package/dist/env-api-keys-BVvSg7T2.mjs +68 -0
- package/dist/event-stream-xaQWmyas.mjs +15226 -0
- package/dist/facade-loader-DFzIYYt_-CIr4HKtE.mjs +194 -0
- package/dist/from-DF7cl2wz.mjs +3842 -0
- package/dist/gateway-method-policy-C7rf0SeV-CJQMEYIE.mjs +28 -0
- package/dist/github-copilot-headers-DjqWtUoP.mjs +22 -0
- package/dist/google-C2pVrgBZ.mjs +336 -0
- package/dist/google-gemini-cli-BBxgS5Ho.mjs +623 -0
- package/dist/google-shared-BsWgwEk1.mjs +22791 -0
- package/dist/google-vertex-BsVLJrrC.mjs +358 -0
- package/dist/hash-DAFtW_W7.mjs +16 -0
- package/dist/headers-R3HdCbAE.mjs +8 -0
- package/dist/home-dir-C44RaPME-CBRS4HLP.mjs +93 -0
- package/dist/ids-BPsM98Uu-CwuxvUai.mjs +77 -0
- package/dist/image-2w3cApg7-CxpHvoB5.mjs +207 -0
- package/dist/io-CH2g3vsv-BOGlLlB8.mjs +26218 -0
- package/dist/jiti-loader-cache-Bat69wam-D6hCxboy.mjs +5049 -0
- package/dist/json-file-BQRNuxmK-DhJM5NsG.mjs +108 -0
- package/dist/json-parse-v_HIJjjI.mjs +381 -0
- package/dist/jws-GFcTvvVT.mjs +2291 -0
- package/dist/{lark-cli-provider-7LvtOIF_.mjs → lark-cli-provider-BARgbbmo.mjs} +1 -1
- package/dist/{live-smoke-nvTUPtrv.mjs → live-smoke-BhkBOcH9.mjs} +3 -3
- package/dist/load-context-mb7uvLSn-B10MAi3I.mjs +29 -0
- package/dist/loader-708jrx4Y-BOswuvpe.mjs +5053 -0
- package/dist/main.mjs +56550 -205
- package/dist/manifest-registry-_hxKCS2K-CZdeyN0f.mjs +3512 -0
- package/dist/mcp-server.mjs +1 -1
- package/dist/message-channel-Bk_YHfQg-AeNrPPpp.mjs +50 -0
- package/dist/message-channel-core-DTA--Gjh-CY4Tkb7N.mjs +29 -0
- package/dist/message.config.runtime-K-k4XOyq-DZTmXomP.mjs +2 -0
- package/dist/message.gateway.runtime-DqHOHRTQ-DH4ml0YF.mjs +2 -0
- package/dist/mistral-CaR4DiLu.mjs +28657 -0
- package/dist/model-auth-env-oyg2Hexc-DU_rOUU5.mjs +1306 -0
- package/dist/models-config-BmpSQJQF-Gfvh1n3A.mjs +1282 -0
- package/dist/models-config.runtime-BsU_22xk.mjs +2 -0
- package/dist/multipart-parser-DedmaB5g.mjs +294 -0
- package/dist/oauth-DOJeGfcE.mjs +6392 -0
- package/dist/openai-BDtIh3Ja.mjs +6693 -0
- package/dist/openai-codex-responses-C5EORu31.mjs +664 -0
- package/dist/openai-completions-CR_cS6gX.mjs +669 -0
- package/dist/openai-responses-oGxwZyuC.mjs +184 -0
- package/dist/openai-responses-shared-BixMSDZE.mjs +398 -0
- package/dist/paths-D6msg0S1-C2lYuisN.mjs +189 -0
- package/dist/paths-D92DjaZ--CTOESW2b.mjs +192 -0
- package/dist/pi-model-discovery-Bd0TWzo8-BFsJmeMb.mjs +227 -0
- package/dist/pi-model-discovery-runtime-CCCZxkd8.mjs +2 -0
- package/dist/pi-tools.before-tool-call.runtime-Bn7uqKie-C5ewk8kK.mjs +399 -0
- package/dist/plugin-auto-enable-DdH3n9V8-DsA1isaF.mjs +1456 -0
- package/dist/process-scoped-map-B2cWkYET-CXwUZ8CZ.mjs +61 -0
- package/dist/provider-discovery.runtime-BPzz1PFj.mjs +58 -0
- package/dist/provider-model-compat-CFqcq0it-BDDuBI3A.mjs +118 -0
- package/dist/provider-runtime-C8rljsNs-CIT93zoy.mjs +2 -0
- package/dist/provider-runtime-CT50mNIX-BwEV6GyO.mjs +573 -0
- package/dist/provider-stream-COLujAAo-CbJPDngm.mjs +35449 -0
- package/dist/providers.runtime-Ba7tOlq7-CXkhkzU9.mjs +219 -0
- package/dist/public-surface-loader-BVl0NQAE-C0piXtsT.mjs +117 -0
- package/dist/resolve-C33B7eeu-BNvYTl6k.mjs +1041 -0
- package/dist/runtime-Cym-fqI8-DaSDMH-a.mjs +120 -0
- package/dist/runtime-channel-state-CohMybAh-hXR6y5Gx.mjs +19 -0
- package/dist/runtime-snapshot-C54O1-gI-40cbyi7P.mjs +677 -0
- package/dist/runtime-state-IBOIXKOx-Bf9tcLvc.mjs +10 -0
- package/dist/runtime-web-tools-fallback.runtime-Ca-qn1mj-BCVImm7a.mjs +39 -0
- package/dist/runtime-web-tools-manifest.runtime-BgxQTjmq-Cb4nJkRT.mjs +2 -0
- package/dist/runtime-web-tools-public-artifacts.runtime-D9qcoWIX-BrQdXzOQ.mjs +2 -0
- package/dist/session-archive.runtime-B52_5vs4-BG-_IwNJ.mjs +2 -0
- package/dist/session-key-Cn2QoOyX-CuHbJMgR.mjs +82 -0
- package/dist/session-transcript-files.fs-DEeFXruQ-B1PF6nLy.mjs +147 -0
- package/dist/src-BgCX0MLG.mjs +813 -0
- package/dist/src-DYbqlAqf.mjs +1177 -0
- package/dist/subagent-announce-L5WsQatW-CQWI9GMd.mjs +344 -0
- package/dist/subagent-announce.registry.runtime-DiqZyeTs-BKuniyi3.mjs +28 -0
- package/dist/subagent-registry-steer-runtime-DFgZFC0j-BhBz0roy.mjs +211 -0
- package/dist/subagent-system-prompt-C1qnN--K-DpnTFP47.mjs +3061 -0
- package/dist/target-parsing-loaded-DKkb6jJY-BMD4CkpS.mjs +1002 -0
- package/dist/task-registry-delivery-runtime-Dd1CUkZF-C8U40a3O.mjs +2950 -0
- package/dist/task-registry-delivery-runtime-ragbeVx5-CNbFAkjD.mjs +2 -0
- package/dist/thinking-Bh-7MqXz-D3woGbO7.mjs +2 -0
- package/dist/transcript-E_-ISOkD-DWCfZP2p.mjs +2019 -0
- package/dist/transcript.runtime-BqhvZZdl-BPy42vBP.mjs +2 -0
- package/dist/transform-messages-DbhIzTxq.mjs +207 -0
- package/dist/web-provider-public-artifacts-BlpRwIUS-CGPSV4W2.mjs +295 -0
- package/dist/web-search-providers.runtime--0aUtC3b-DyuhC95V.mjs +200 -0
- package/package.json +3 -3
- package/dist/rolldown-runtime-wcPFST8Q.mjs +0 -13
- /package/dist/{interactive-init-B6j8j_Ap.mjs → interactive-init-BXQBalNr.mjs} +0 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { i as resolveRequiredHomeDir, n as resolveEffectiveHomeDir, r as resolveHomeRelativePath, s as normalizeOptionalLowercaseString } from "./home-dir-C44RaPME-CBRS4HLP.mjs";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import "node:fs/promises";
|
|
6
|
+
import os from "node:os";
|
|
7
|
+
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/utils-CB8xp0O4.js
|
|
8
|
+
/**
|
|
9
|
+
* Strict plain-object guard (excludes arrays and host objects).
|
|
10
|
+
*/
|
|
11
|
+
function isPlainObject(value) {
|
|
12
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) && Object.prototype.toString.call(value) === "[object Object]";
|
|
13
|
+
}
|
|
14
|
+
async function ensureDir(dir) {
|
|
15
|
+
await fs.promises.mkdir(dir, { recursive: true });
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Escapes special regex characters in a string so it can be used in a RegExp constructor.
|
|
19
|
+
*/
|
|
20
|
+
function escapeRegExp(value) {
|
|
21
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Type guard for Record<string, unknown> (less strict than isPlainObject).
|
|
25
|
+
* Accepts any non-null object that isn't an array.
|
|
26
|
+
*/
|
|
27
|
+
function isRecord(value) {
|
|
28
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
29
|
+
}
|
|
30
|
+
function isHighSurrogate(codeUnit) {
|
|
31
|
+
return codeUnit >= 55296 && codeUnit <= 56319;
|
|
32
|
+
}
|
|
33
|
+
function isLowSurrogate(codeUnit) {
|
|
34
|
+
return codeUnit >= 56320 && codeUnit <= 57343;
|
|
35
|
+
}
|
|
36
|
+
function sliceUtf16Safe(input, start, end) {
|
|
37
|
+
const len = input.length;
|
|
38
|
+
let from = start < 0 ? Math.max(len + start, 0) : Math.min(start, len);
|
|
39
|
+
let to = end === void 0 ? len : end < 0 ? Math.max(len + end, 0) : Math.min(end, len);
|
|
40
|
+
if (to < from) {
|
|
41
|
+
const tmp = from;
|
|
42
|
+
from = to;
|
|
43
|
+
to = tmp;
|
|
44
|
+
}
|
|
45
|
+
if (from > 0 && from < len) {
|
|
46
|
+
if (isLowSurrogate(input.charCodeAt(from)) && isHighSurrogate(input.charCodeAt(from - 1))) from += 1;
|
|
47
|
+
}
|
|
48
|
+
if (to > 0 && to < len) {
|
|
49
|
+
if (isHighSurrogate(input.charCodeAt(to - 1)) && isLowSurrogate(input.charCodeAt(to))) to -= 1;
|
|
50
|
+
}
|
|
51
|
+
return input.slice(from, to);
|
|
52
|
+
}
|
|
53
|
+
function truncateUtf16Safe(input, maxLen) {
|
|
54
|
+
const limit = Math.max(0, Math.floor(maxLen));
|
|
55
|
+
if (input.length <= limit) return input;
|
|
56
|
+
return sliceUtf16Safe(input, 0, limit);
|
|
57
|
+
}
|
|
58
|
+
function resolveUserPath(input, env = process.env, homedir = os.homedir) {
|
|
59
|
+
if (!input) return "";
|
|
60
|
+
return resolveHomeRelativePath(input, {
|
|
61
|
+
env,
|
|
62
|
+
homedir
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function resolveConfigDir(env = process.env, homedir = os.homedir) {
|
|
66
|
+
const override = env.OPENCLAW_STATE_DIR?.trim();
|
|
67
|
+
if (override) return resolveUserPath(override, env, homedir);
|
|
68
|
+
const configPath = env.OPENCLAW_CONFIG_PATH?.trim();
|
|
69
|
+
if (configPath) return path.dirname(resolveUserPath(configPath, env, homedir));
|
|
70
|
+
const newDir = path.join(resolveRequiredHomeDir(env, homedir), ".openclaw");
|
|
71
|
+
try {
|
|
72
|
+
if (fs.existsSync(newDir)) return newDir;
|
|
73
|
+
} catch {}
|
|
74
|
+
return newDir;
|
|
75
|
+
}
|
|
76
|
+
function resolveHomeDir() {
|
|
77
|
+
return resolveEffectiveHomeDir(process.env, os.homedir);
|
|
78
|
+
}
|
|
79
|
+
function resolveHomeDisplayPrefix() {
|
|
80
|
+
const home = resolveHomeDir();
|
|
81
|
+
if (!home) return;
|
|
82
|
+
if (process.env.OPENCLAW_HOME?.trim()) return {
|
|
83
|
+
home,
|
|
84
|
+
prefix: "$OPENCLAW_HOME"
|
|
85
|
+
};
|
|
86
|
+
return {
|
|
87
|
+
home,
|
|
88
|
+
prefix: "~"
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function shortenHomeInString(input) {
|
|
92
|
+
if (!input) return input;
|
|
93
|
+
const display = resolveHomeDisplayPrefix();
|
|
94
|
+
if (!display) return input;
|
|
95
|
+
return input.split(display.home).join(display.prefix);
|
|
96
|
+
}
|
|
97
|
+
const CONFIG_DIR = resolveConfigDir();
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/openclaw-root-GhlHRwjz.js
|
|
100
|
+
const CORE_PACKAGE_NAMES = new Set(["openclaw"]);
|
|
101
|
+
function parsePackageName(raw) {
|
|
102
|
+
const parsed = JSON.parse(raw);
|
|
103
|
+
return typeof parsed.name === "string" ? parsed.name : null;
|
|
104
|
+
}
|
|
105
|
+
function readPackageNameSync(dir) {
|
|
106
|
+
try {
|
|
107
|
+
return parsePackageName(fs.readFileSync(path.join(dir, "package.json"), "utf-8"));
|
|
108
|
+
} catch {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function findPackageRootSync(startDir, maxDepth = 12) {
|
|
113
|
+
for (const current of iterAncestorDirs(startDir, maxDepth)) {
|
|
114
|
+
const name = readPackageNameSync(current);
|
|
115
|
+
if (name && CORE_PACKAGE_NAMES.has(name)) return current;
|
|
116
|
+
}
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
function* iterAncestorDirs(startDir, maxDepth) {
|
|
120
|
+
let current = path.resolve(startDir);
|
|
121
|
+
for (let i = 0; i < maxDepth; i += 1) {
|
|
122
|
+
yield current;
|
|
123
|
+
const parent = path.dirname(current);
|
|
124
|
+
if (parent === current) break;
|
|
125
|
+
current = parent;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function candidateDirsFromArgv1(argv1) {
|
|
129
|
+
const normalized = path.resolve(argv1);
|
|
130
|
+
const candidates = [path.dirname(normalized)];
|
|
131
|
+
try {
|
|
132
|
+
const resolved = fs.realpathSync(normalized);
|
|
133
|
+
if (resolved !== normalized) candidates.push(path.dirname(resolved));
|
|
134
|
+
} catch {}
|
|
135
|
+
const parts = normalized.split(path.sep);
|
|
136
|
+
const binIndex = parts.lastIndexOf(".bin");
|
|
137
|
+
if (binIndex > 0 && parts[binIndex - 1] === "node_modules") {
|
|
138
|
+
const binName = path.basename(normalized);
|
|
139
|
+
const nodeModulesDir = parts.slice(0, binIndex).join(path.sep);
|
|
140
|
+
candidates.push(path.join(nodeModulesDir, binName));
|
|
141
|
+
}
|
|
142
|
+
return candidates;
|
|
143
|
+
}
|
|
144
|
+
function resolveOpenClawPackageRootSync(opts) {
|
|
145
|
+
for (const candidate of buildCandidates(opts)) {
|
|
146
|
+
const found = findPackageRootSync(candidate);
|
|
147
|
+
if (found) return found;
|
|
148
|
+
}
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
function buildCandidates(opts) {
|
|
152
|
+
const candidates = [];
|
|
153
|
+
if (opts.moduleUrl) try {
|
|
154
|
+
candidates.push(path.dirname(fileURLToPath(opts.moduleUrl)));
|
|
155
|
+
} catch {}
|
|
156
|
+
if (opts.argv1) candidates.push(...candidateDirsFromArgv1(opts.argv1));
|
|
157
|
+
if (opts.cwd) candidates.push(opts.cwd);
|
|
158
|
+
return candidates;
|
|
159
|
+
}
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/bundled-dir-U738ay4K.js
|
|
162
|
+
const DISABLED_BUNDLED_PLUGINS_DIR = path.join(os.tmpdir(), "openclaw-empty-bundled-plugins");
|
|
163
|
+
function bundledPluginsDisabled(env) {
|
|
164
|
+
const raw = normalizeOptionalLowercaseString(env.OPENCLAW_DISABLE_BUNDLED_PLUGINS);
|
|
165
|
+
return raw === "1" || raw === "true";
|
|
166
|
+
}
|
|
167
|
+
function resolveDisabledBundledPluginsDir() {
|
|
168
|
+
fs.mkdirSync(DISABLED_BUNDLED_PLUGINS_DIR, { recursive: true });
|
|
169
|
+
return DISABLED_BUNDLED_PLUGINS_DIR;
|
|
170
|
+
}
|
|
171
|
+
function isSourceCheckoutRoot(packageRoot) {
|
|
172
|
+
return fs.existsSync(path.join(packageRoot, ".git")) && fs.existsSync(path.join(packageRoot, "src")) && fs.existsSync(path.join(packageRoot, "extensions"));
|
|
173
|
+
}
|
|
174
|
+
function hasUsableBundledPluginTree(pluginsDir) {
|
|
175
|
+
if (!fs.existsSync(pluginsDir)) return false;
|
|
176
|
+
try {
|
|
177
|
+
return fs.readdirSync(pluginsDir, { withFileTypes: true }).some((entry) => {
|
|
178
|
+
if (!entry.isDirectory()) return false;
|
|
179
|
+
const pluginDir = path.join(pluginsDir, entry.name);
|
|
180
|
+
return fs.existsSync(path.join(pluginDir, "package.json")) || fs.existsSync(path.join(pluginDir, "openclaw.plugin.json"));
|
|
181
|
+
});
|
|
182
|
+
} catch {
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function runningSourceTypeScriptProcess() {
|
|
187
|
+
const argv1 = process.argv[1]?.toLowerCase();
|
|
188
|
+
if (argv1?.endsWith(".ts") || argv1?.endsWith(".tsx") || argv1?.endsWith(".mts") || argv1?.endsWith(".cts")) return true;
|
|
189
|
+
for (let index = 0; index < process.execArgv.length; index += 1) {
|
|
190
|
+
const arg = process.execArgv[index]?.toLowerCase();
|
|
191
|
+
if (!arg) continue;
|
|
192
|
+
if (arg === "tsx" || arg.includes("tsx/register")) return true;
|
|
193
|
+
if ((arg === "--import" || arg === "--loader") && process.execArgv[index + 1]) {
|
|
194
|
+
const next = process.execArgv[index + 1].toLowerCase();
|
|
195
|
+
if (next === "tsx" || next.includes("tsx/")) return true;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
function resolveBundledDirFromPackageRoot(packageRoot, preferSourceCheckout) {
|
|
201
|
+
const sourceExtensionsDir = path.join(packageRoot, "extensions");
|
|
202
|
+
const builtExtensionsDir = path.join(packageRoot, "dist", "extensions");
|
|
203
|
+
const sourceCheckout = isSourceCheckoutRoot(packageRoot);
|
|
204
|
+
if (preferSourceCheckout && fs.existsSync(sourceExtensionsDir)) return sourceExtensionsDir;
|
|
205
|
+
const runtimeExtensionsDir = path.join(packageRoot, "dist-runtime", "extensions");
|
|
206
|
+
const hasUsableRuntimeTree = sourceCheckout ? hasUsableBundledPluginTree(runtimeExtensionsDir) : fs.existsSync(runtimeExtensionsDir);
|
|
207
|
+
const hasUsableBuiltTree = sourceCheckout ? hasUsableBundledPluginTree(builtExtensionsDir) : fs.existsSync(builtExtensionsDir);
|
|
208
|
+
if (hasUsableRuntimeTree && hasUsableBuiltTree) return runtimeExtensionsDir;
|
|
209
|
+
if (hasUsableBuiltTree) return builtExtensionsDir;
|
|
210
|
+
if (sourceCheckout && fs.existsSync(sourceExtensionsDir)) return sourceExtensionsDir;
|
|
211
|
+
}
|
|
212
|
+
function resolveBundledPluginsDir(env = process.env) {
|
|
213
|
+
if (bundledPluginsDisabled(env)) return resolveDisabledBundledPluginsDir();
|
|
214
|
+
const override = env.OPENCLAW_BUNDLED_PLUGINS_DIR?.trim();
|
|
215
|
+
if (override) {
|
|
216
|
+
const resolvedOverride = resolveUserPath(override, env);
|
|
217
|
+
if (fs.existsSync(resolvedOverride)) return resolvedOverride;
|
|
218
|
+
try {
|
|
219
|
+
const argvPackageRoot = resolveOpenClawPackageRootSync({ argv1: process.argv[1] });
|
|
220
|
+
if (argvPackageRoot && !isSourceCheckoutRoot(argvPackageRoot)) {
|
|
221
|
+
const argvFallback = resolveBundledDirFromPackageRoot(argvPackageRoot, false);
|
|
222
|
+
if (argvFallback) return argvFallback;
|
|
223
|
+
}
|
|
224
|
+
} catch {}
|
|
225
|
+
return resolvedOverride;
|
|
226
|
+
}
|
|
227
|
+
const preferSourceCheckout = Boolean(env.VITEST) || runningSourceTypeScriptProcess();
|
|
228
|
+
try {
|
|
229
|
+
const packageRoots = [
|
|
230
|
+
resolveOpenClawPackageRootSync({ argv1: process.argv[1] }),
|
|
231
|
+
resolveOpenClawPackageRootSync({ cwd: process.cwd() }),
|
|
232
|
+
resolveOpenClawPackageRootSync({ moduleUrl: import.meta.url })
|
|
233
|
+
].filter((entry, index, all) => Boolean(entry) && all.indexOf(entry) === index);
|
|
234
|
+
for (const packageRoot of packageRoots) {
|
|
235
|
+
const bundledDir = resolveBundledDirFromPackageRoot(packageRoot, preferSourceCheckout);
|
|
236
|
+
if (bundledDir) return bundledDir;
|
|
237
|
+
}
|
|
238
|
+
} catch {}
|
|
239
|
+
try {
|
|
240
|
+
const execDir = path.dirname(process.execPath);
|
|
241
|
+
const siblingBuilt = path.join(execDir, "dist", "extensions");
|
|
242
|
+
if (fs.existsSync(siblingBuilt)) return siblingBuilt;
|
|
243
|
+
const sibling = path.join(execDir, "extensions");
|
|
244
|
+
if (fs.existsSync(sibling)) return sibling;
|
|
245
|
+
} catch {}
|
|
246
|
+
try {
|
|
247
|
+
let cursor = path.dirname(fileURLToPath(import.meta.url));
|
|
248
|
+
for (let i = 0; i < 6; i += 1) {
|
|
249
|
+
const candidate = path.join(cursor, "extensions");
|
|
250
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
251
|
+
const parent = path.dirname(cursor);
|
|
252
|
+
if (parent === cursor) break;
|
|
253
|
+
cursor = parent;
|
|
254
|
+
}
|
|
255
|
+
} catch {}
|
|
256
|
+
}
|
|
257
|
+
//#endregion
|
|
258
|
+
export { escapeRegExp as a, resolveConfigDir as c, truncateUtf16Safe as d, ensureDir as i, resolveUserPath as l, resolveOpenClawPackageRootSync as n, isPlainObject as o, CONFIG_DIR as r, isRecord as s, resolveBundledPluginsDir as t, shortenHomeInString as u };
|