@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.
Files changed (106) hide show
  1. package/dist/account-id-BM1T6029-DYjVxojW.mjs +46 -0
  2. package/dist/activation-context--5yu1dPF-Bwsn3moT.mjs +172 -0
  3. package/dist/anthropic-TH8ERTXK.mjs +5962 -0
  4. package/dist/assistant-visible-text-DuFWokAt-CsbII5KS.mjs +596 -0
  5. package/dist/azure-openai-responses-Bt_Ag9Er.mjs +166 -0
  6. package/dist/boundary-file-read-BSd9MXPy--KThL5e6.mjs +594 -0
  7. package/dist/browser-lifecycle-cleanup-BdNsMhMD-O3tnAM4i.mjs +60 -0
  8. package/dist/build-DgTrEpge.mjs +3333 -0
  9. package/dist/bundled-compat-BpaDaAAu-D7oazKjD.mjs +5216 -0
  10. package/dist/bundled-dir-U738ay4K-DXK0q_TV.mjs +258 -0
  11. package/dist/call-DimWbpgJ-ColD4W-y.mjs +9993 -0
  12. package/dist/channel-bootstrap.runtime-BVclcGv1-DJv_Z-Kr.mjs +2 -0
  13. package/dist/channel-bootstrap.runtime-Cwcr38m2-VRfVCR-i.mjs +33 -0
  14. package/dist/chunk-D6SyT4dJ.mjs +36 -0
  15. package/dist/cli.mjs +6 -6
  16. package/dist/command-format-LSnUCVVF-BQ2SMKka.mjs +685 -0
  17. package/dist/config-Bim2pi8a-BQUdfiEi.mjs +9 -0
  18. package/dist/delivery-context.shared-j5hC5qb1-CI83RXXZ.mjs +72 -0
  19. package/dist/diagnostic-ClMwNnUA-D6nUtLnb.mjs +140 -0
  20. package/dist/dist-CEGw8-2W.mjs +429 -0
  21. package/dist/dist-DD2aJ2UL.mjs +125135 -0
  22. package/dist/env-api-keys-BVvSg7T2.mjs +68 -0
  23. package/dist/event-stream-xaQWmyas.mjs +15226 -0
  24. package/dist/facade-loader-DFzIYYt_-CIr4HKtE.mjs +194 -0
  25. package/dist/from-DF7cl2wz.mjs +3842 -0
  26. package/dist/gateway-method-policy-C7rf0SeV-CJQMEYIE.mjs +28 -0
  27. package/dist/github-copilot-headers-DjqWtUoP.mjs +22 -0
  28. package/dist/google-C2pVrgBZ.mjs +336 -0
  29. package/dist/google-gemini-cli-BBxgS5Ho.mjs +623 -0
  30. package/dist/google-shared-BsWgwEk1.mjs +22791 -0
  31. package/dist/google-vertex-BsVLJrrC.mjs +358 -0
  32. package/dist/hash-DAFtW_W7.mjs +16 -0
  33. package/dist/headers-R3HdCbAE.mjs +8 -0
  34. package/dist/home-dir-C44RaPME-CBRS4HLP.mjs +93 -0
  35. package/dist/ids-BPsM98Uu-CwuxvUai.mjs +77 -0
  36. package/dist/image-2w3cApg7-CxpHvoB5.mjs +207 -0
  37. package/dist/io-CH2g3vsv-BOGlLlB8.mjs +26218 -0
  38. package/dist/jiti-loader-cache-Bat69wam-D6hCxboy.mjs +5049 -0
  39. package/dist/json-file-BQRNuxmK-DhJM5NsG.mjs +108 -0
  40. package/dist/json-parse-v_HIJjjI.mjs +381 -0
  41. package/dist/jws-GFcTvvVT.mjs +2291 -0
  42. package/dist/{lark-cli-provider-7LvtOIF_.mjs → lark-cli-provider-BARgbbmo.mjs} +1 -1
  43. package/dist/{live-smoke-nvTUPtrv.mjs → live-smoke-BhkBOcH9.mjs} +3 -3
  44. package/dist/load-context-mb7uvLSn-B10MAi3I.mjs +29 -0
  45. package/dist/loader-708jrx4Y-BOswuvpe.mjs +5053 -0
  46. package/dist/main.mjs +56550 -205
  47. package/dist/manifest-registry-_hxKCS2K-CZdeyN0f.mjs +3512 -0
  48. package/dist/mcp-server.mjs +1 -1
  49. package/dist/message-channel-Bk_YHfQg-AeNrPPpp.mjs +50 -0
  50. package/dist/message-channel-core-DTA--Gjh-CY4Tkb7N.mjs +29 -0
  51. package/dist/message.config.runtime-K-k4XOyq-DZTmXomP.mjs +2 -0
  52. package/dist/message.gateway.runtime-DqHOHRTQ-DH4ml0YF.mjs +2 -0
  53. package/dist/mistral-CaR4DiLu.mjs +28657 -0
  54. package/dist/model-auth-env-oyg2Hexc-DU_rOUU5.mjs +1306 -0
  55. package/dist/models-config-BmpSQJQF-Gfvh1n3A.mjs +1282 -0
  56. package/dist/models-config.runtime-BsU_22xk.mjs +2 -0
  57. package/dist/multipart-parser-DedmaB5g.mjs +294 -0
  58. package/dist/oauth-DOJeGfcE.mjs +6392 -0
  59. package/dist/openai-BDtIh3Ja.mjs +6693 -0
  60. package/dist/openai-codex-responses-C5EORu31.mjs +664 -0
  61. package/dist/openai-completions-CR_cS6gX.mjs +669 -0
  62. package/dist/openai-responses-oGxwZyuC.mjs +184 -0
  63. package/dist/openai-responses-shared-BixMSDZE.mjs +398 -0
  64. package/dist/paths-D6msg0S1-C2lYuisN.mjs +189 -0
  65. package/dist/paths-D92DjaZ--CTOESW2b.mjs +192 -0
  66. package/dist/pi-model-discovery-Bd0TWzo8-BFsJmeMb.mjs +227 -0
  67. package/dist/pi-model-discovery-runtime-CCCZxkd8.mjs +2 -0
  68. package/dist/pi-tools.before-tool-call.runtime-Bn7uqKie-C5ewk8kK.mjs +399 -0
  69. package/dist/plugin-auto-enable-DdH3n9V8-DsA1isaF.mjs +1456 -0
  70. package/dist/process-scoped-map-B2cWkYET-CXwUZ8CZ.mjs +61 -0
  71. package/dist/provider-discovery.runtime-BPzz1PFj.mjs +58 -0
  72. package/dist/provider-model-compat-CFqcq0it-BDDuBI3A.mjs +118 -0
  73. package/dist/provider-runtime-C8rljsNs-CIT93zoy.mjs +2 -0
  74. package/dist/provider-runtime-CT50mNIX-BwEV6GyO.mjs +573 -0
  75. package/dist/provider-stream-COLujAAo-CbJPDngm.mjs +35449 -0
  76. package/dist/providers.runtime-Ba7tOlq7-CXkhkzU9.mjs +219 -0
  77. package/dist/public-surface-loader-BVl0NQAE-C0piXtsT.mjs +117 -0
  78. package/dist/resolve-C33B7eeu-BNvYTl6k.mjs +1041 -0
  79. package/dist/runtime-Cym-fqI8-DaSDMH-a.mjs +120 -0
  80. package/dist/runtime-channel-state-CohMybAh-hXR6y5Gx.mjs +19 -0
  81. package/dist/runtime-snapshot-C54O1-gI-40cbyi7P.mjs +677 -0
  82. package/dist/runtime-state-IBOIXKOx-Bf9tcLvc.mjs +10 -0
  83. package/dist/runtime-web-tools-fallback.runtime-Ca-qn1mj-BCVImm7a.mjs +39 -0
  84. package/dist/runtime-web-tools-manifest.runtime-BgxQTjmq-Cb4nJkRT.mjs +2 -0
  85. package/dist/runtime-web-tools-public-artifacts.runtime-D9qcoWIX-BrQdXzOQ.mjs +2 -0
  86. package/dist/session-archive.runtime-B52_5vs4-BG-_IwNJ.mjs +2 -0
  87. package/dist/session-key-Cn2QoOyX-CuHbJMgR.mjs +82 -0
  88. package/dist/session-transcript-files.fs-DEeFXruQ-B1PF6nLy.mjs +147 -0
  89. package/dist/src-BgCX0MLG.mjs +813 -0
  90. package/dist/src-DYbqlAqf.mjs +1177 -0
  91. package/dist/subagent-announce-L5WsQatW-CQWI9GMd.mjs +344 -0
  92. package/dist/subagent-announce.registry.runtime-DiqZyeTs-BKuniyi3.mjs +28 -0
  93. package/dist/subagent-registry-steer-runtime-DFgZFC0j-BhBz0roy.mjs +211 -0
  94. package/dist/subagent-system-prompt-C1qnN--K-DpnTFP47.mjs +3061 -0
  95. package/dist/target-parsing-loaded-DKkb6jJY-BMD4CkpS.mjs +1002 -0
  96. package/dist/task-registry-delivery-runtime-Dd1CUkZF-C8U40a3O.mjs +2950 -0
  97. package/dist/task-registry-delivery-runtime-ragbeVx5-CNbFAkjD.mjs +2 -0
  98. package/dist/thinking-Bh-7MqXz-D3woGbO7.mjs +2 -0
  99. package/dist/transcript-E_-ISOkD-DWCfZP2p.mjs +2019 -0
  100. package/dist/transcript.runtime-BqhvZZdl-BPy42vBP.mjs +2 -0
  101. package/dist/transform-messages-DbhIzTxq.mjs +207 -0
  102. package/dist/web-provider-public-artifacts-BlpRwIUS-CGPSV4W2.mjs +295 -0
  103. package/dist/web-search-providers.runtime--0aUtC3b-DyuhC95V.mjs +200 -0
  104. package/package.json +3 -3
  105. package/dist/rolldown-runtime-wcPFST8Q.mjs +0 -13
  106. /package/dist/{interactive-init-B6j8j_Ap.mjs → interactive-init-BXQBalNr.mjs} +0 -0
@@ -0,0 +1,594 @@
1
+ import { o as normalizeLowercaseStringOrEmpty } from "./home-dir-C44RaPME-CBRS4HLP.mjs";
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ import "node:fs/promises";
5
+ import os from "node:os";
6
+ //#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/boundary-path-BSBSMt0u.js
7
+ const NOT_FOUND_CODES = new Set(["ENOENT", "ENOTDIR"]);
8
+ const SYMLINK_OPEN_CODES = new Set([
9
+ "ELOOP",
10
+ "EINVAL",
11
+ "ENOTSUP"
12
+ ]);
13
+ const PARENT_SEGMENT_PREFIX = /^\.\.(?:[\\/]|$)/u;
14
+ function normalizeWindowsPathForComparison(input) {
15
+ let normalized = path.win32.normalize(input);
16
+ if (normalized.startsWith("\\\\?\\")) {
17
+ normalized = normalized.slice(4);
18
+ if (normalized.toUpperCase().startsWith("UNC\\")) normalized = `\\\\${normalized.slice(4)}`;
19
+ }
20
+ return normalizeLowercaseStringOrEmpty(normalized.replaceAll("/", "\\"));
21
+ }
22
+ function isNodeError(value) {
23
+ return Boolean(value && typeof value === "object" && "code" in value);
24
+ }
25
+ function hasNodeErrorCode(value, code) {
26
+ return isNodeError(value) && value.code === code;
27
+ }
28
+ function isNotFoundPathError(value) {
29
+ return isNodeError(value) && typeof value.code === "string" && NOT_FOUND_CODES.has(value.code);
30
+ }
31
+ function isSymlinkOpenError(value) {
32
+ return isNodeError(value) && typeof value.code === "string" && SYMLINK_OPEN_CODES.has(value.code);
33
+ }
34
+ function isPathInside(root, target) {
35
+ if (process.platform === "win32") {
36
+ const rootForCompare = normalizeWindowsPathForComparison(path.win32.resolve(root));
37
+ const targetForCompare = normalizeWindowsPathForComparison(path.win32.resolve(target));
38
+ const relative = path.win32.relative(rootForCompare, targetForCompare);
39
+ return relative === "" || !PARENT_SEGMENT_PREFIX.test(relative) && !path.win32.isAbsolute(relative);
40
+ }
41
+ const resolvedRoot = path.resolve(root);
42
+ const resolvedTarget = path.resolve(target);
43
+ const relative = path.relative(resolvedRoot, resolvedTarget);
44
+ return relative === "" || !PARENT_SEGMENT_PREFIX.test(relative) && !path.isAbsolute(relative);
45
+ }
46
+ Object.freeze({
47
+ allowFinalSymlinkForUnlink: false,
48
+ allowFinalHardlinkForUnlink: false
49
+ }), Object.freeze({
50
+ allowFinalSymlinkForUnlink: true,
51
+ allowFinalHardlinkForUnlink: true
52
+ });
53
+ function resolveBoundaryPathSync(params) {
54
+ const rootPath = path.resolve(params.rootPath);
55
+ const absolutePath = path.resolve(params.absolutePath);
56
+ const context = createBoundaryResolutionContext({
57
+ resolveParams: params,
58
+ rootPath,
59
+ absolutePath,
60
+ rootCanonicalPath: params.rootCanonicalPath ? path.resolve(params.rootCanonicalPath) : resolvePathViaExistingAncestorSync(rootPath),
61
+ outsideLexicalCanonicalPath: resolveOutsideLexicalCanonicalPathSync({
62
+ rootPath,
63
+ absolutePath
64
+ })
65
+ });
66
+ const outsideResult = resolveOutsideBoundaryPathSync({
67
+ boundaryLabel: params.boundaryLabel,
68
+ context
69
+ });
70
+ if (outsideResult) return outsideResult;
71
+ return resolveBoundaryPathLexicalSync({
72
+ params,
73
+ absolutePath: context.absolutePath,
74
+ rootPath: context.rootPath,
75
+ rootCanonicalPath: context.rootCanonicalPath
76
+ });
77
+ }
78
+ function isPromiseLike(value) {
79
+ return Boolean(value && (typeof value === "object" || typeof value === "function") && "then" in value && typeof value.then === "function");
80
+ }
81
+ function createLexicalTraversalState(params) {
82
+ return {
83
+ segments: path.relative(params.rootPath, params.absolutePath).split(path.sep).filter(Boolean),
84
+ allowFinalSymlink: params.params.policy?.allowFinalSymlinkForUnlink === true,
85
+ canonicalCursor: params.rootCanonicalPath,
86
+ lexicalCursor: params.rootPath,
87
+ preserveFinalSymlink: false
88
+ };
89
+ }
90
+ function assertLexicalCursorInsideBoundary(params) {
91
+ assertInsideBoundary({
92
+ boundaryLabel: params.params.boundaryLabel,
93
+ rootCanonicalPath: params.rootCanonicalPath,
94
+ candidatePath: params.candidatePath,
95
+ absolutePath: params.absolutePath
96
+ });
97
+ }
98
+ function applyMissingSuffixToCanonicalCursor(params) {
99
+ const missingSuffix = params.state.segments.slice(params.missingFromIndex);
100
+ params.state.canonicalCursor = path.resolve(params.state.canonicalCursor, ...missingSuffix);
101
+ assertLexicalCursorInsideBoundary({
102
+ params: params.params,
103
+ rootCanonicalPath: params.rootCanonicalPath,
104
+ candidatePath: params.state.canonicalCursor,
105
+ absolutePath: params.absolutePath
106
+ });
107
+ }
108
+ function advanceCanonicalCursorForSegment(params) {
109
+ params.state.canonicalCursor = path.resolve(params.state.canonicalCursor, params.segment);
110
+ assertLexicalCursorInsideBoundary({
111
+ params: params.params,
112
+ rootCanonicalPath: params.rootCanonicalPath,
113
+ candidatePath: params.state.canonicalCursor,
114
+ absolutePath: params.absolutePath
115
+ });
116
+ }
117
+ function finalizeLexicalResolution(params) {
118
+ assertLexicalCursorInsideBoundary({
119
+ params: params.params,
120
+ rootCanonicalPath: params.rootCanonicalPath,
121
+ candidatePath: params.state.canonicalCursor,
122
+ absolutePath: params.absolutePath
123
+ });
124
+ return buildResolvedBoundaryPath({
125
+ absolutePath: params.absolutePath,
126
+ canonicalPath: params.state.canonicalCursor,
127
+ rootPath: params.rootPath,
128
+ rootCanonicalPath: params.rootCanonicalPath,
129
+ kind: params.kind
130
+ });
131
+ }
132
+ function handleLexicalLstatFailure(params) {
133
+ if (!isNotFoundPathError(params.error)) return false;
134
+ applyMissingSuffixToCanonicalCursor({
135
+ state: params.state,
136
+ missingFromIndex: params.missingFromIndex,
137
+ rootCanonicalPath: params.rootCanonicalPath,
138
+ params: params.resolveParams,
139
+ absolutePath: params.absolutePath
140
+ });
141
+ return true;
142
+ }
143
+ function handleLexicalStatReadFailure(params) {
144
+ if (handleLexicalLstatFailure({
145
+ error: params.error,
146
+ state: params.state,
147
+ missingFromIndex: params.missingFromIndex,
148
+ rootCanonicalPath: params.rootCanonicalPath,
149
+ resolveParams: params.resolveParams,
150
+ absolutePath: params.absolutePath
151
+ })) return null;
152
+ throw params.error;
153
+ }
154
+ function handleLexicalStatDisposition(params) {
155
+ if (!params.isSymbolicLink) {
156
+ advanceCanonicalCursorForSegment({
157
+ state: params.state,
158
+ segment: params.segment,
159
+ rootCanonicalPath: params.rootCanonicalPath,
160
+ params: params.resolveParams,
161
+ absolutePath: params.absolutePath
162
+ });
163
+ return "continue";
164
+ }
165
+ if (params.state.allowFinalSymlink && params.isLast) {
166
+ params.state.preserveFinalSymlink = true;
167
+ advanceCanonicalCursorForSegment({
168
+ state: params.state,
169
+ segment: params.segment,
170
+ rootCanonicalPath: params.rootCanonicalPath,
171
+ params: params.resolveParams,
172
+ absolutePath: params.absolutePath
173
+ });
174
+ return "break";
175
+ }
176
+ return "resolve-link";
177
+ }
178
+ function applyResolvedSymlinkHop(params) {
179
+ if (!isPathInside(params.rootCanonicalPath, params.linkCanonical)) throw symlinkEscapeError({
180
+ boundaryLabel: params.boundaryLabel,
181
+ rootCanonicalPath: params.rootCanonicalPath,
182
+ symlinkPath: params.state.lexicalCursor
183
+ });
184
+ params.state.canonicalCursor = params.linkCanonical;
185
+ params.state.lexicalCursor = params.linkCanonical;
186
+ }
187
+ function readLexicalStat(params) {
188
+ try {
189
+ const stat = params.read(params.state.lexicalCursor);
190
+ if (isPromiseLike(stat)) return Promise.resolve(stat).catch((error) => handleLexicalStatReadFailure({
191
+ ...params,
192
+ error
193
+ }));
194
+ return stat;
195
+ } catch (error) {
196
+ return handleLexicalStatReadFailure({
197
+ ...params,
198
+ error
199
+ });
200
+ }
201
+ }
202
+ function resolveAndApplySymlinkHop(params) {
203
+ const linkCanonical = params.resolveLinkCanonical(params.state.lexicalCursor);
204
+ if (isPromiseLike(linkCanonical)) return Promise.resolve(linkCanonical).then((value) => applyResolvedSymlinkHop({
205
+ state: params.state,
206
+ linkCanonical: value,
207
+ rootCanonicalPath: params.rootCanonicalPath,
208
+ boundaryLabel: params.boundaryLabel
209
+ }));
210
+ applyResolvedSymlinkHop({
211
+ state: params.state,
212
+ linkCanonical,
213
+ rootCanonicalPath: params.rootCanonicalPath,
214
+ boundaryLabel: params.boundaryLabel
215
+ });
216
+ }
217
+ function resolveBoundaryPathLexicalSync(params) {
218
+ const state = createLexicalTraversalState(params);
219
+ for (let idx = 0; idx < state.segments.length; idx += 1) {
220
+ const segment = state.segments[idx] ?? "";
221
+ const isLast = idx === state.segments.length - 1;
222
+ state.lexicalCursor = path.join(state.lexicalCursor, segment);
223
+ const maybeStat = readLexicalStat({
224
+ state,
225
+ missingFromIndex: idx,
226
+ rootCanonicalPath: params.rootCanonicalPath,
227
+ resolveParams: params.params,
228
+ absolutePath: params.absolutePath,
229
+ read: (cursor) => fs.lstatSync(cursor)
230
+ });
231
+ if (isPromiseLike(maybeStat)) throw new Error("Unexpected async lexical stat");
232
+ const stat = maybeStat;
233
+ if (!stat) break;
234
+ const disposition = handleLexicalStatDisposition({
235
+ state,
236
+ isSymbolicLink: stat.isSymbolicLink(),
237
+ segment,
238
+ isLast,
239
+ rootCanonicalPath: params.rootCanonicalPath,
240
+ resolveParams: params.params,
241
+ absolutePath: params.absolutePath
242
+ });
243
+ if (disposition === "continue") continue;
244
+ if (disposition === "break") break;
245
+ if (isPromiseLike(resolveAndApplySymlinkHop({
246
+ state,
247
+ rootCanonicalPath: params.rootCanonicalPath,
248
+ boundaryLabel: params.params.boundaryLabel,
249
+ resolveLinkCanonical: (cursor) => resolveSymlinkHopPathSync(cursor)
250
+ }))) throw new Error("Unexpected async symlink resolution");
251
+ }
252
+ const kind = getPathKindSync(params.absolutePath, state.preserveFinalSymlink);
253
+ return finalizeLexicalResolution({
254
+ ...params,
255
+ state,
256
+ kind
257
+ });
258
+ }
259
+ function resolveCanonicalOutsideLexicalPath(params) {
260
+ return params.outsideLexicalCanonicalPath ?? params.absolutePath;
261
+ }
262
+ function createBoundaryResolutionContext(params) {
263
+ const lexicalInside = isPathInside(params.rootPath, params.absolutePath);
264
+ const canonicalOutsideLexicalPath = resolveCanonicalOutsideLexicalPath({
265
+ absolutePath: params.absolutePath,
266
+ outsideLexicalCanonicalPath: params.outsideLexicalCanonicalPath
267
+ });
268
+ assertLexicalBoundaryOrCanonicalAlias({
269
+ skipLexicalRootCheck: params.resolveParams.skipLexicalRootCheck,
270
+ lexicalInside,
271
+ canonicalOutsideLexicalPath,
272
+ rootCanonicalPath: params.rootCanonicalPath,
273
+ boundaryLabel: params.resolveParams.boundaryLabel,
274
+ rootPath: params.rootPath,
275
+ absolutePath: params.absolutePath
276
+ });
277
+ return {
278
+ rootPath: params.rootPath,
279
+ absolutePath: params.absolutePath,
280
+ rootCanonicalPath: params.rootCanonicalPath,
281
+ lexicalInside,
282
+ canonicalOutsideLexicalPath
283
+ };
284
+ }
285
+ function resolveOutsideBoundaryPathSync(params) {
286
+ if (params.context.lexicalInside) return null;
287
+ const kind = getPathKindSync(params.context.absolutePath, false);
288
+ return buildOutsideBoundaryPathFromContext({
289
+ boundaryLabel: params.boundaryLabel,
290
+ context: params.context,
291
+ kind
292
+ });
293
+ }
294
+ function buildOutsideBoundaryPathFromContext(params) {
295
+ return buildOutsideLexicalBoundaryPath({
296
+ boundaryLabel: params.boundaryLabel,
297
+ rootCanonicalPath: params.context.rootCanonicalPath,
298
+ absolutePath: params.context.absolutePath,
299
+ canonicalOutsideLexicalPath: params.context.canonicalOutsideLexicalPath,
300
+ rootPath: params.context.rootPath,
301
+ kind: params.kind
302
+ });
303
+ }
304
+ function resolveOutsideLexicalCanonicalPathSync(params) {
305
+ if (isPathInside(params.rootPath, params.absolutePath)) return;
306
+ return resolvePathViaExistingAncestorSync(params.absolutePath);
307
+ }
308
+ function buildOutsideLexicalBoundaryPath(params) {
309
+ assertInsideBoundary({
310
+ boundaryLabel: params.boundaryLabel,
311
+ rootCanonicalPath: params.rootCanonicalPath,
312
+ candidatePath: params.canonicalOutsideLexicalPath,
313
+ absolutePath: params.absolutePath
314
+ });
315
+ return buildResolvedBoundaryPath({
316
+ absolutePath: params.absolutePath,
317
+ canonicalPath: params.canonicalOutsideLexicalPath,
318
+ rootPath: params.rootPath,
319
+ rootCanonicalPath: params.rootCanonicalPath,
320
+ kind: params.kind
321
+ });
322
+ }
323
+ function assertLexicalBoundaryOrCanonicalAlias(params) {
324
+ if (params.skipLexicalRootCheck || params.lexicalInside) return;
325
+ if (isPathInside(params.rootCanonicalPath, params.canonicalOutsideLexicalPath)) return;
326
+ throw pathEscapeError({
327
+ boundaryLabel: params.boundaryLabel,
328
+ rootPath: params.rootPath,
329
+ absolutePath: params.absolutePath
330
+ });
331
+ }
332
+ function buildResolvedBoundaryPath(params) {
333
+ return {
334
+ absolutePath: params.absolutePath,
335
+ canonicalPath: params.canonicalPath,
336
+ rootPath: params.rootPath,
337
+ rootCanonicalPath: params.rootCanonicalPath,
338
+ relativePath: relativeInsideRoot(params.rootCanonicalPath, params.canonicalPath),
339
+ exists: params.kind.exists,
340
+ kind: params.kind.kind
341
+ };
342
+ }
343
+ function resolvePathViaExistingAncestorSync(targetPath) {
344
+ const normalized = path.resolve(targetPath);
345
+ let cursor = normalized;
346
+ const missingSuffix = [];
347
+ while (!isFilesystemRoot(cursor) && !fs.existsSync(cursor)) {
348
+ missingSuffix.unshift(path.basename(cursor));
349
+ const parent = path.dirname(cursor);
350
+ if (parent === cursor) break;
351
+ cursor = parent;
352
+ }
353
+ if (!fs.existsSync(cursor)) return normalized;
354
+ try {
355
+ const resolvedAncestor = path.resolve(fs.realpathSync(cursor));
356
+ if (missingSuffix.length === 0) return resolvedAncestor;
357
+ return path.resolve(resolvedAncestor, ...missingSuffix);
358
+ } catch {
359
+ return normalized;
360
+ }
361
+ }
362
+ function getPathKindSync(absolutePath, preserveFinalSymlink) {
363
+ try {
364
+ return {
365
+ exists: true,
366
+ kind: toResolvedKind(preserveFinalSymlink ? fs.lstatSync(absolutePath) : fs.statSync(absolutePath))
367
+ };
368
+ } catch (error) {
369
+ if (isNotFoundPathError(error)) return {
370
+ exists: false,
371
+ kind: "missing"
372
+ };
373
+ throw error;
374
+ }
375
+ }
376
+ function toResolvedKind(stat) {
377
+ if (stat.isFile()) return "file";
378
+ if (stat.isDirectory()) return "directory";
379
+ if (stat.isSymbolicLink()) return "symlink";
380
+ return "other";
381
+ }
382
+ function relativeInsideRoot(rootPath, targetPath) {
383
+ const relative = path.relative(path.resolve(rootPath), path.resolve(targetPath));
384
+ if (!relative || relative === ".") return "";
385
+ if (relative.startsWith("..") || path.isAbsolute(relative)) return "";
386
+ return relative;
387
+ }
388
+ function assertInsideBoundary(params) {
389
+ if (isPathInside(params.rootCanonicalPath, params.candidatePath)) return;
390
+ throw new Error(`Path resolves outside ${params.boundaryLabel} (${shortPath(params.rootCanonicalPath)}): ${shortPath(params.absolutePath)}`);
391
+ }
392
+ function pathEscapeError(params) {
393
+ return /* @__PURE__ */ new Error(`Path escapes ${params.boundaryLabel} (${shortPath(params.rootPath)}): ${shortPath(params.absolutePath)}`);
394
+ }
395
+ function symlinkEscapeError(params) {
396
+ return /* @__PURE__ */ new Error(`Symlink escapes ${params.boundaryLabel} (${shortPath(params.rootCanonicalPath)}): ${shortPath(params.symlinkPath)}`);
397
+ }
398
+ function shortPath(value) {
399
+ const home = os.homedir();
400
+ if (value.startsWith(home)) return `~${value.slice(home.length)}`;
401
+ return value;
402
+ }
403
+ function isFilesystemRoot(candidate) {
404
+ return path.parse(candidate).root === candidate;
405
+ }
406
+ function resolveSymlinkHopPathSync(symlinkPath) {
407
+ try {
408
+ return path.resolve(fs.realpathSync(symlinkPath));
409
+ } catch (error) {
410
+ if (!isNotFoundPathError(error)) throw error;
411
+ const linkTarget = fs.readlinkSync(symlinkPath);
412
+ return resolvePathViaExistingAncestorSync(path.resolve(path.dirname(symlinkPath), linkTarget));
413
+ }
414
+ }
415
+ //#endregion
416
+ //#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/file-identity-DBd-elc3.js
417
+ function isZero(value) {
418
+ return value === 0 || value === 0n;
419
+ }
420
+ function sameFileIdentity$1(left, right, platform = process.platform) {
421
+ if (left.ino !== right.ino) return false;
422
+ if (left.dev === right.dev) return true;
423
+ return platform === "win32" && (isZero(left.dev) || isZero(right.dev));
424
+ }
425
+ //#endregion
426
+ //#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/safe-open-sync-X8Q1U9Y1.js
427
+ function isExpectedPathError(error) {
428
+ const code = typeof error === "object" && error !== null && "code" in error ? String(error.code) : "";
429
+ return code === "ENOENT" || code === "ENOTDIR" || code === "ELOOP";
430
+ }
431
+ function sameFileIdentity(left, right) {
432
+ return sameFileIdentity$1(left, right);
433
+ }
434
+ function openVerifiedFileSync(params) {
435
+ const ioFs = params.ioFs ?? fs;
436
+ const allowedType = params.allowedType ?? "file";
437
+ const openReadFlags = ioFs.constants.O_RDONLY | (typeof ioFs.constants.O_NOFOLLOW === "number" ? ioFs.constants.O_NOFOLLOW : 0);
438
+ let fd = null;
439
+ try {
440
+ if (params.rejectPathSymlink) {
441
+ if (ioFs.lstatSync(params.filePath).isSymbolicLink()) return {
442
+ ok: false,
443
+ reason: "validation"
444
+ };
445
+ }
446
+ const realPath = params.resolvedPath ?? ioFs.realpathSync(params.filePath);
447
+ const preOpenStat = ioFs.lstatSync(realPath);
448
+ if (!isAllowedType(preOpenStat, allowedType)) return {
449
+ ok: false,
450
+ reason: "validation"
451
+ };
452
+ if (params.rejectHardlinks && preOpenStat.isFile() && preOpenStat.nlink > 1) return {
453
+ ok: false,
454
+ reason: "validation"
455
+ };
456
+ if (params.maxBytes !== void 0 && preOpenStat.isFile() && preOpenStat.size > params.maxBytes) return {
457
+ ok: false,
458
+ reason: "validation"
459
+ };
460
+ fd = ioFs.openSync(realPath, openReadFlags);
461
+ const openedStat = ioFs.fstatSync(fd);
462
+ if (!isAllowedType(openedStat, allowedType)) return {
463
+ ok: false,
464
+ reason: "validation"
465
+ };
466
+ if (params.rejectHardlinks && openedStat.isFile() && openedStat.nlink > 1) return {
467
+ ok: false,
468
+ reason: "validation"
469
+ };
470
+ if (params.maxBytes !== void 0 && openedStat.isFile() && openedStat.size > params.maxBytes) return {
471
+ ok: false,
472
+ reason: "validation"
473
+ };
474
+ if (!sameFileIdentity(preOpenStat, openedStat)) return {
475
+ ok: false,
476
+ reason: "validation"
477
+ };
478
+ const opened = {
479
+ ok: true,
480
+ path: realPath,
481
+ fd,
482
+ stat: openedStat
483
+ };
484
+ fd = null;
485
+ return opened;
486
+ } catch (error) {
487
+ if (isExpectedPathError(error)) return {
488
+ ok: false,
489
+ reason: "path",
490
+ error
491
+ };
492
+ return {
493
+ ok: false,
494
+ reason: "io",
495
+ error
496
+ };
497
+ } finally {
498
+ if (fd !== null) ioFs.closeSync(fd);
499
+ }
500
+ }
501
+ function isAllowedType(stat, allowedType) {
502
+ if (allowedType === "directory") return stat.isDirectory();
503
+ return stat.isFile();
504
+ }
505
+ //#endregion
506
+ //#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/boundary-file-read-BSd9MXPy.js
507
+ function canUseBoundaryFileOpen(ioFs) {
508
+ return typeof ioFs.openSync === "function" && typeof ioFs.closeSync === "function" && typeof ioFs.fstatSync === "function" && typeof ioFs.lstatSync === "function" && typeof ioFs.realpathSync === "function" && typeof ioFs.readFileSync === "function" && typeof ioFs.constants === "object" && ioFs.constants !== null;
509
+ }
510
+ function openBoundaryFileSync(params) {
511
+ const ioFs = params.ioFs ?? fs;
512
+ const resolved = resolveBoundaryFilePathGeneric({
513
+ absolutePath: params.absolutePath,
514
+ resolve: (absolutePath) => resolveBoundaryPathSync({
515
+ absolutePath,
516
+ rootPath: params.rootPath,
517
+ rootCanonicalPath: params.rootRealPath,
518
+ boundaryLabel: params.boundaryLabel,
519
+ skipLexicalRootCheck: params.skipLexicalRootCheck
520
+ })
521
+ });
522
+ if (resolved instanceof Promise) return toBoundaryValidationError(/* @__PURE__ */ new Error("Unexpected async boundary resolution"));
523
+ return finalizeBoundaryFileOpen({
524
+ resolved,
525
+ maxBytes: params.maxBytes,
526
+ rejectHardlinks: params.rejectHardlinks,
527
+ allowedType: params.allowedType,
528
+ ioFs
529
+ });
530
+ }
531
+ function matchBoundaryFileOpenFailure(failure, handlers) {
532
+ switch (failure.reason) {
533
+ case "path": return handlers.path ? handlers.path(failure) : handlers.fallback(failure);
534
+ case "validation": return handlers.validation ? handlers.validation(failure) : handlers.fallback(failure);
535
+ case "io": return handlers.io ? handlers.io(failure) : handlers.fallback(failure);
536
+ }
537
+ return handlers.fallback(failure);
538
+ }
539
+ function openBoundaryFileResolved(params) {
540
+ const opened = openVerifiedFileSync({
541
+ filePath: params.absolutePath,
542
+ resolvedPath: params.resolvedPath,
543
+ rejectHardlinks: params.rejectHardlinks ?? true,
544
+ maxBytes: params.maxBytes,
545
+ allowedType: params.allowedType,
546
+ ioFs: params.ioFs
547
+ });
548
+ if (!opened.ok) return opened;
549
+ return {
550
+ ok: true,
551
+ path: opened.path,
552
+ fd: opened.fd,
553
+ stat: opened.stat,
554
+ rootRealPath: params.rootRealPath
555
+ };
556
+ }
557
+ function finalizeBoundaryFileOpen(params) {
558
+ if ("ok" in params.resolved) return params.resolved;
559
+ return openBoundaryFileResolved({
560
+ absolutePath: params.resolved.absolutePath,
561
+ resolvedPath: params.resolved.resolvedPath,
562
+ rootRealPath: params.resolved.rootRealPath,
563
+ maxBytes: params.maxBytes,
564
+ rejectHardlinks: params.rejectHardlinks,
565
+ allowedType: params.allowedType,
566
+ ioFs: params.ioFs
567
+ });
568
+ }
569
+ function toBoundaryValidationError(error) {
570
+ return {
571
+ ok: false,
572
+ reason: "validation",
573
+ error
574
+ };
575
+ }
576
+ function mapResolvedBoundaryPath(absolutePath, resolved) {
577
+ return {
578
+ absolutePath,
579
+ resolvedPath: resolved.canonicalPath,
580
+ rootRealPath: resolved.rootCanonicalPath
581
+ };
582
+ }
583
+ function resolveBoundaryFilePathGeneric(params) {
584
+ const absolutePath = path.resolve(params.absolutePath);
585
+ try {
586
+ const resolved = params.resolve(absolutePath);
587
+ if (resolved instanceof Promise) return resolved.then((value) => mapResolvedBoundaryPath(absolutePath, value)).catch((error) => toBoundaryValidationError(error));
588
+ return mapResolvedBoundaryPath(absolutePath, resolved);
589
+ } catch (error) {
590
+ return toBoundaryValidationError(error);
591
+ }
592
+ }
593
+ //#endregion
594
+ export { hasNodeErrorCode as a, isSymlinkOpenError as c, sameFileIdentity$1 as i, resolveBoundaryPathSync as l, matchBoundaryFileOpenFailure as n, isNotFoundPathError as o, openBoundaryFileSync as r, isPathInside as s, canUseBoundaryFileOpen as t };
@@ -0,0 +1,60 @@
1
+ import { n as loadBundledPluginPublicSurfaceModuleSync } from "./facade-loader-DFzIYYt_-CIr4HKtE.mjs";
2
+ import "node:fs";
3
+ import "node:path";
4
+ import "node:os";
5
+ //#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/browser-maintenance-CgzwL4B_.js
6
+ let cachedBrowserMaintenanceSurface;
7
+ function hasRequestedSessionKeys(sessionKeys) {
8
+ return sessionKeys.some((key) => Boolean(key?.trim()));
9
+ }
10
+ function loadBrowserMaintenanceSurface() {
11
+ cachedBrowserMaintenanceSurface ??= loadBundledPluginPublicSurfaceModuleSync({
12
+ dirName: "browser",
13
+ artifactBasename: "browser-maintenance.js"
14
+ });
15
+ return cachedBrowserMaintenanceSurface;
16
+ }
17
+ async function closeTrackedBrowserTabsForSessions(params) {
18
+ if (!hasRequestedSessionKeys(params.sessionKeys)) return 0;
19
+ let surface;
20
+ try {
21
+ surface = loadBrowserMaintenanceSurface();
22
+ } catch (error) {
23
+ params.onWarn?.(`browser cleanup unavailable: ${String(error)}`);
24
+ return 0;
25
+ }
26
+ return await surface.closeTrackedBrowserTabsForSessions(params);
27
+ }
28
+ //#endregion
29
+ //#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/browser-lifecycle-cleanup-D8s47iQX.js
30
+ async function runBestEffortCleanup(params) {
31
+ try {
32
+ return await params.cleanup();
33
+ } catch (error) {
34
+ params.onError?.(error);
35
+ return;
36
+ }
37
+ }
38
+ function normalizeSessionKeys(sessionKeys) {
39
+ const keys = /* @__PURE__ */ new Set();
40
+ for (const sessionKey of sessionKeys) {
41
+ const normalized = sessionKey.trim();
42
+ if (normalized) keys.add(normalized);
43
+ }
44
+ return [...keys];
45
+ }
46
+ async function cleanupBrowserSessionsForLifecycleEnd(params) {
47
+ const sessionKeys = normalizeSessionKeys(params.sessionKeys);
48
+ if (sessionKeys.length === 0) return;
49
+ await runBestEffortCleanup({
50
+ cleanup: async () => {
51
+ await closeTrackedBrowserTabsForSessions({
52
+ sessionKeys,
53
+ onWarn: params.onWarn
54
+ });
55
+ },
56
+ onError: params.onError
57
+ });
58
+ }
59
+ //#endregion
60
+ export { cleanupBrowserSessionsForLifecycleEnd };