@jini-ai/platform 0.1.0

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 (66) hide show
  1. package/LICENSE +201 -0
  2. package/dist/asset-cache.d.ts +80 -0
  3. package/dist/asset-cache.d.ts.map +1 -0
  4. package/dist/asset-cache.js +423 -0
  5. package/dist/asset-cache.js.map +1 -0
  6. package/dist/aws-sigv4.d.ts +51 -0
  7. package/dist/aws-sigv4.d.ts.map +1 -0
  8. package/dist/aws-sigv4.js +104 -0
  9. package/dist/aws-sigv4.js.map +1 -0
  10. package/dist/blob-storage.d.ts +89 -0
  11. package/dist/blob-storage.d.ts.map +1 -0
  12. package/dist/blob-storage.js +315 -0
  13. package/dist/blob-storage.js.map +1 -0
  14. package/dist/command.d.ts +32 -0
  15. package/dist/command.d.ts.map +1 -0
  16. package/dist/command.js +101 -0
  17. package/dist/command.js.map +1 -0
  18. package/dist/download.d.ts +92 -0
  19. package/dist/download.d.ts.map +1 -0
  20. package/dist/download.js +856 -0
  21. package/dist/download.js.map +1 -0
  22. package/dist/fs.d.ts +55 -0
  23. package/dist/fs.d.ts.map +1 -0
  24. package/dist/fs.js +124 -0
  25. package/dist/fs.js.map +1 -0
  26. package/dist/home-expansion.d.ts +18 -0
  27. package/dist/home-expansion.d.ts.map +1 -0
  28. package/dist/home-expansion.js +58 -0
  29. package/dist/home-expansion.js.map +1 -0
  30. package/dist/http.d.ts +14 -0
  31. package/dist/http.d.ts.map +1 -0
  32. package/dist/http.js +39 -0
  33. package/dist/http.js.map +1 -0
  34. package/dist/index.d.ts +59 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +45 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/process.d.ts +159 -0
  39. package/dist/process.d.ts.map +1 -0
  40. package/dist/process.js +362 -0
  41. package/dist/process.js.map +1 -0
  42. package/dist/proxy-env.d.ts +50 -0
  43. package/dist/proxy-env.d.ts.map +1 -0
  44. package/dist/proxy-env.js +373 -0
  45. package/dist/proxy-env.js.map +1 -0
  46. package/dist/resource-paths.d.ts +68 -0
  47. package/dist/resource-paths.d.ts.map +1 -0
  48. package/dist/resource-paths.js +137 -0
  49. package/dist/resource-paths.js.map +1 -0
  50. package/dist/sandbox-env.d.ts +86 -0
  51. package/dist/sandbox-env.d.ts.map +1 -0
  52. package/dist/sandbox-env.js +215 -0
  53. package/dist/sandbox-env.js.map +1 -0
  54. package/dist/shell.d.ts +46 -0
  55. package/dist/shell.d.ts.map +1 -0
  56. package/dist/shell.js +78 -0
  57. package/dist/shell.js.map +1 -0
  58. package/dist/terminal.d.ts +137 -0
  59. package/dist/terminal.d.ts.map +1 -0
  60. package/dist/terminal.js +398 -0
  61. package/dist/terminal.js.map +1 -0
  62. package/dist/toolchain.d.ts +17 -0
  63. package/dist/toolchain.d.ts.map +1 -0
  64. package/dist/toolchain.js +251 -0
  65. package/dist/toolchain.js.map +1 -0
  66. package/package.json +47 -0
@@ -0,0 +1,373 @@
1
+ /**
2
+ * @module proxy-env
3
+ *
4
+ * System proxy discovery and proxy-aware environment merging. Reads the OS
5
+ * proxy configuration (macOS `scutil --proxy`, Windows Internet Settings
6
+ * registry) and normalizes it into canonical `HTTP_PROXY` / `HTTPS_PROXY` /
7
+ * `ALL_PROXY` / `NO_PROXY` / `NODE_USE_ENV_PROXY` environment variables, plus a
8
+ * merge that keeps proxy variables consistent across layered env sources.
9
+ *
10
+ * Pure aside from the single `execFileSync` used to shell out to the platform
11
+ * proxy-config tools; owns no other sibling dependency.
12
+ */
13
+ import { execFileSync } from "node:child_process";
14
+ const CANONICAL_PROXY_ENV_KEYS = new Map([
15
+ ["all_proxy", "ALL_PROXY"],
16
+ ["http_proxy", "HTTP_PROXY"],
17
+ ["https_proxy", "HTTPS_PROXY"],
18
+ ["node_use_env_proxy", "NODE_USE_ENV_PROXY"],
19
+ ["no_proxy", "NO_PROXY"],
20
+ ]);
21
+ /** @internal Default proxy-config command runner: a short-timeout synchronous shell-out with output captured as UTF-8. */
22
+ function defaultSystemProxyCommandRunner(command, args) {
23
+ return execFileSync(command, args, {
24
+ encoding: "utf8",
25
+ stdio: ["ignore", "pipe", "ignore"],
26
+ timeout: 2_000,
27
+ windowsHide: true,
28
+ });
29
+ }
30
+ /** @internal Map a case-insensitive proxy env key to its canonical spelling, or `null` if it is not a proxy variable. */
31
+ function canonicalProxyEnvKey(key) {
32
+ return CANONICAL_PROXY_ENV_KEYS.get(key.toLowerCase()) ?? null;
33
+ }
34
+ /** @internal Delete every case-variant of a proxy env key from `env` so a canonical value can replace it cleanly. */
35
+ function deleteProxyEnvVariants(env, canonicalKey) {
36
+ for (const existingKey of Object.keys(env)) {
37
+ if (existingKey.toLowerCase() === canonicalKey.toLowerCase())
38
+ delete env[existingKey];
39
+ }
40
+ }
41
+ /** @internal Assign a canonical proxy value into `env`, clearing prior case-variants and adding lowercase aliases on POSIX. */
42
+ function setCanonicalProxyEnvValue(env, canonicalKey, value, platform) {
43
+ deleteProxyEnvVariants(env, canonicalKey);
44
+ if (canonicalKey === "NODE_USE_ENV_PROXY") {
45
+ env.NODE_USE_ENV_PROXY = value;
46
+ return;
47
+ }
48
+ addProxyEnvValue(env, canonicalKey, value, platform);
49
+ }
50
+ /**
51
+ * Merge multiple env sources into one proxy-consistent environment. Proxy
52
+ * variables are collapsed to their canonical spelling (preferring lowercase
53
+ * inputs), non-proxy keys pass through, and `NODE_USE_ENV_PROXY=1` is set when
54
+ * a proxy endpoint is present but the flag is not.
55
+ *
56
+ * @param platform - Target platform, controlling lowercase-alias emission.
57
+ * @param sources - Env sources merged left-to-right (later sources win).
58
+ * @returns A new merged environment with normalized proxy variables.
59
+ */
60
+ export function mergeProxyAwareEnv(platform, ...sources) {
61
+ const merged = {};
62
+ for (const source of sources) {
63
+ const proxyEntries = new Map();
64
+ for (const [key, value] of Object.entries(source)) {
65
+ if (value == null)
66
+ continue;
67
+ const canonicalKey = canonicalProxyEnvKey(key);
68
+ if (canonicalKey) {
69
+ const current = proxyEntries.get(canonicalKey);
70
+ const preferLowercase = key === key.toLowerCase();
71
+ if (!current || preferLowercase || !current.preferLowercase) {
72
+ proxyEntries.set(canonicalKey, { preferLowercase, value });
73
+ }
74
+ continue;
75
+ }
76
+ merged[key] = value;
77
+ }
78
+ for (const [canonicalKey, entry] of proxyEntries) {
79
+ setCanonicalProxyEnvValue(merged, canonicalKey, entry.value, platform);
80
+ }
81
+ }
82
+ if (hasProxyEndpointEnv(merged) && !hasCanonicalProxyEnv(merged, "NODE_USE_ENV_PROXY")) {
83
+ merged.NODE_USE_ENV_PROXY = "1";
84
+ }
85
+ return merged;
86
+ }
87
+ /** @internal Whether `env` already contains any case-variant of the given canonical proxy key. */
88
+ function hasCanonicalProxyEnv(env, canonicalKey) {
89
+ return Object.keys(env).some((key) => key.toLowerCase() === canonicalKey.toLowerCase());
90
+ }
91
+ /** @internal Whether `env` defines a non-empty HTTP/HTTPS/ALL proxy endpoint (ignoring `NO_PROXY`). */
92
+ function hasProxyEndpointEnv(env) {
93
+ return ["ALL_PROXY", "HTTP_PROXY", "HTTPS_PROXY"].some((key) => {
94
+ for (const [envKey, value] of Object.entries(env)) {
95
+ if (envKey.toLowerCase() === key.toLowerCase() && value?.trim())
96
+ return true;
97
+ }
98
+ return false;
99
+ });
100
+ }
101
+ /** @internal Set an uppercase proxy variable (and its lowercase alias on POSIX) from a trimmed value; no-op when blank. */
102
+ function addProxyEnvValue(env, key, value, platform) {
103
+ const trimmed = value.trim();
104
+ if (!trimmed)
105
+ return;
106
+ env[key] = trimmed;
107
+ if (platform !== "win32")
108
+ env[key.toLowerCase()] = trimmed;
109
+ }
110
+ /** @internal Expand a single NO_PROXY bypass token into its normalized forms (e.g. `<local>`, `*.foo`, `::1`). */
111
+ function normalizeBypassToken(token) {
112
+ const trimmed = token.trim();
113
+ if (!trimmed)
114
+ return [];
115
+ if (trimmed === "<local>")
116
+ return ["<local>", "localhost", "127.0.0.1", "[::1]", ".local"];
117
+ if (trimmed === "::1")
118
+ return ["[::1]"];
119
+ if (trimmed.startsWith("*."))
120
+ return [`.${trimmed.slice(2)}`];
121
+ return [trimmed];
122
+ }
123
+ /** @internal Build a de-duplicated, comma-joined NO_PROXY value from bypass tokens, or `null` when empty. */
124
+ function buildNoProxyValue(tokens) {
125
+ const seen = new Set();
126
+ const values = [];
127
+ for (const token of tokens) {
128
+ for (const normalized of normalizeBypassToken(token)) {
129
+ if (!seen.has(normalized)) {
130
+ seen.add(normalized);
131
+ values.push(normalized);
132
+ }
133
+ }
134
+ }
135
+ return values.length > 0 ? values.join(",") : null;
136
+ }
137
+ /** @internal Preserve a wildcard (`*`) NO_PROXY bypass verbatim, since it disables proxying entirely. */
138
+ function preserveWildcardNoProxyValue(noProxy) {
139
+ return noProxy?.split(",").some((token) => token.trim() === "*") ? "*" : undefined;
140
+ }
141
+ /** @internal Ensure a proxy URL has a scheme, defaulting to the supplied scheme when only an authority is given.
142
+ * Its only call site (`normalizeHostPortProxyUrl`) already guarantees a non-empty `raw` (both `host` and `port`
143
+ * are checked truthy before it's composed), so no empty/whitespace-only-input guard is needed here. */
144
+ function normalizeProxyUrl(raw, scheme) {
145
+ const trimmed = raw.trim();
146
+ return /^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed) ? trimmed : `${scheme}://${trimmed}`;
147
+ }
148
+ /** @internal Bracket a bare IPv6 host in an `authority` (`host:port`) so URL parsing does not mistake it for a port. */
149
+ function bracketIpv6Authority(authority) {
150
+ if (authority.startsWith("[") || !authority.includes(":"))
151
+ return authority;
152
+ const portSeparatorIndex = authority.lastIndexOf(":");
153
+ if (portSeparatorIndex <= 0)
154
+ return authority;
155
+ const host = authority.slice(0, portSeparatorIndex);
156
+ const port = authority.slice(portSeparatorIndex + 1);
157
+ if (!host.includes(":") || !/^\d+$/.test(port))
158
+ return authority;
159
+ return `[${host}]:${port}`;
160
+ }
161
+ /** @internal Normalize a proxy authority into a scheme-qualified URL, IPv6-bracketing the host as needed.
162
+ * Every call site already guarantees a non-empty, trimmed `raw` before calling this (see
163
+ * `parseWindowsInternetSettingsProxyOutput`'s own `!kind || !value` / `!proxyServer.trim()` guards), so no
164
+ * empty/whitespace-only-input guard is needed here. */
165
+ function normalizeAuthorityProxyUrl(raw, scheme) {
166
+ const trimmed = raw.trim();
167
+ if (/^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed))
168
+ return trimmed;
169
+ return `${scheme}://${bracketIpv6Authority(trimmed)}`;
170
+ }
171
+ /** @internal Compose a scheme-qualified proxy URL from separate host and port fields, IPv6-bracketing the host. */
172
+ function normalizeHostPortProxyUrl(host, port, scheme) {
173
+ const trimmedHost = host?.trim() ?? "";
174
+ const trimmedPort = port?.trim() ?? "";
175
+ if (!trimmedHost || !trimmedPort)
176
+ return null;
177
+ const normalizedHost = trimmedHost.includes(":") && !trimmedHost.startsWith("[") && !trimmedHost.endsWith("]")
178
+ ? `[${trimmedHost}]`
179
+ : trimmedHost;
180
+ return normalizeProxyUrl(`${normalizedHost}:${trimmedPort}`, scheme);
181
+ }
182
+ /** @internal Assemble the final proxy env from parsed values, adding loopback bypasses and the `NODE_USE_ENV_PROXY` flag. */
183
+ function finalizeSystemProxyEnv(values, platform) {
184
+ const hasProxy = Boolean(values.httpProxy || values.httpsProxy || values.allProxy);
185
+ const noProxy = hasProxy
186
+ ? preserveWildcardNoProxyValue(values.noProxy) ??
187
+ buildNoProxyValue([
188
+ ...(values.noProxy ? values.noProxy.split(",") : []),
189
+ "localhost",
190
+ "127.0.0.1",
191
+ "[::1]",
192
+ ])
193
+ : null;
194
+ const env = {};
195
+ if (values.httpProxy)
196
+ addProxyEnvValue(env, "HTTP_PROXY", values.httpProxy, platform);
197
+ if (values.httpsProxy)
198
+ addProxyEnvValue(env, "HTTPS_PROXY", values.httpsProxy, platform);
199
+ if (values.allProxy)
200
+ addProxyEnvValue(env, "ALL_PROXY", values.allProxy, platform);
201
+ if (noProxy)
202
+ addProxyEnvValue(env, "NO_PROXY", noProxy, platform);
203
+ if (hasProxy)
204
+ env.NODE_USE_ENV_PROXY = "1";
205
+ return env;
206
+ }
207
+ /**
208
+ * Parse macOS `scutil --proxy` output into a normalized proxy environment.
209
+ * Honors the HTTP/HTTPS/SOCKS enable flags, exception list, and the
210
+ * "exclude simple hostnames" toggle.
211
+ *
212
+ * @param stdout - Raw `scutil --proxy` output.
213
+ * @param platform - Target platform for env normalization (defaults to `"darwin"`).
214
+ * @returns A normalized proxy environment (empty when no proxy is enabled).
215
+ */
216
+ export function parseMacosScutilProxyOutput(stdout, platform = "darwin") {
217
+ const scalars = new Map();
218
+ const exceptions = [];
219
+ let inExceptions = false;
220
+ for (const rawLine of stdout.split(/\r?\n/)) {
221
+ const line = rawLine.trim();
222
+ if (!line)
223
+ continue;
224
+ if (/^ExceptionsList\s*:\s*<array>\s*\{$/.test(line)) {
225
+ inExceptions = true;
226
+ continue;
227
+ }
228
+ if (inExceptions) {
229
+ if (line === "}") {
230
+ inExceptions = false;
231
+ continue;
232
+ }
233
+ const match = line.match(/^\d+\s*:\s*(.+)$/);
234
+ if (match)
235
+ exceptions.push(match[1].trim());
236
+ continue;
237
+ }
238
+ const match = line.match(/^([A-Za-z][A-Za-z0-9]*)\s*:\s*(.+)$/);
239
+ if (match)
240
+ scalars.set(match[1], match[2].trim());
241
+ }
242
+ const httpProxy = scalars.get("HTTPEnable") === "1"
243
+ ? normalizeHostPortProxyUrl(scalars.get("HTTPProxy"), scalars.get("HTTPPort"), "http")
244
+ : null;
245
+ const httpsProxy = scalars.get("HTTPSEnable") === "1"
246
+ ? normalizeHostPortProxyUrl(scalars.get("HTTPSProxy"), scalars.get("HTTPSPort"), "http")
247
+ : null;
248
+ const allProxy = scalars.get("SOCKSEnable") === "1"
249
+ ? normalizeHostPortProxyUrl(scalars.get("SOCKSProxy"), scalars.get("SOCKSPort"), "socks5")
250
+ : null;
251
+ return finalizeSystemProxyEnv({
252
+ allProxy,
253
+ httpProxy,
254
+ httpsProxy,
255
+ noProxy: buildNoProxyValue([
256
+ ...exceptions,
257
+ ...(scalars.get("ExcludeSimpleHostnames") === "1" ? ["<local>"] : []),
258
+ ]),
259
+ }, platform);
260
+ }
261
+ /** @internal Extract a `reg query` value line (`Name REG_TYPE value`) for the named value, or `null` if absent. */
262
+ function parseRegistryValue(stdout, valueName) {
263
+ const match = stdout.match(new RegExp(`^\\s*${valueName}\\s+REG_\\w+\\s+(.+)$`, "m"));
264
+ return match ? match[1].trim() : null;
265
+ }
266
+ /**
267
+ * Parse Windows Internet Settings proxy registry output into a normalized proxy
268
+ * environment. Handles both the per-protocol (`http=…;https=…`) and shared
269
+ * single-endpoint `ProxyServer` forms, and the `ProxyOverride` bypass list.
270
+ *
271
+ * @param input - Raw `reg query` output for `ProxyEnable`, and optionally `ProxyServer` / `ProxyOverride`.
272
+ * @param platform - Target platform for env normalization (defaults to `"win32"`).
273
+ * @returns A normalized proxy environment (empty when proxying is disabled or unset).
274
+ */
275
+ export function parseWindowsInternetSettingsProxyOutput(input, platform = "win32") {
276
+ const enabled = parseRegistryValue(input.proxyEnable, "ProxyEnable");
277
+ if (enabled == null || !/^(1|0x1)$/i.test(enabled))
278
+ return {};
279
+ const proxyServer = parseRegistryValue(input.proxyServer ?? "", "ProxyServer") ?? "";
280
+ const proxyOverride = parseRegistryValue(input.proxyOverride ?? "", "ProxyOverride") ?? "";
281
+ if (!proxyServer.trim())
282
+ return {};
283
+ let httpProxy = null;
284
+ let httpsProxy = null;
285
+ let allProxy = null;
286
+ if (proxyServer.includes("=")) {
287
+ for (const segment of proxyServer.split(";")) {
288
+ const [kind, rawValue] = segment.split("=", 2);
289
+ const value = rawValue?.trim();
290
+ if (!kind || !value)
291
+ continue;
292
+ const lowerKind = kind.trim().toLowerCase();
293
+ if (lowerKind === "http")
294
+ httpProxy = normalizeAuthorityProxyUrl(value, "http");
295
+ else if (lowerKind === "https")
296
+ httpsProxy = normalizeAuthorityProxyUrl(value, "http");
297
+ else if (lowerKind === "socks")
298
+ allProxy = normalizeAuthorityProxyUrl(value, "socks5");
299
+ }
300
+ }
301
+ else {
302
+ const shared = normalizeAuthorityProxyUrl(proxyServer, "http");
303
+ httpProxy = shared;
304
+ httpsProxy = shared;
305
+ }
306
+ return finalizeSystemProxyEnv({
307
+ allProxy,
308
+ httpProxy,
309
+ httpsProxy,
310
+ noProxy: buildNoProxyValue(proxyOverride.split(/[;,]/)),
311
+ }, platform);
312
+ }
313
+ /**
314
+ * Resolve the OS-level proxy configuration into a normalized proxy environment.
315
+ * Shells out to `scutil` on macOS and `reg query` on Windows (swallowing per-
316
+ * command failures), and returns an empty env on other platforms or on error.
317
+ *
318
+ * @param options - Optional platform override and command runner (for testing).
319
+ * @returns A normalized proxy environment, or `{}` when no proxy is configured.
320
+ */
321
+ export function resolveSystemProxyEnv(options = {}) {
322
+ const platform = options.platform ?? process.platform;
323
+ const runCommand = options.runCommand ?? defaultSystemProxyCommandRunner;
324
+ const tryRun = (command, args) => {
325
+ try {
326
+ return runCommand(command, args);
327
+ }
328
+ catch {
329
+ return "";
330
+ }
331
+ };
332
+ try {
333
+ if (platform === "darwin") {
334
+ return parseMacosScutilProxyOutput(tryRun("scutil", ["--proxy"]), platform);
335
+ }
336
+ if (platform === "win32") {
337
+ return parseWindowsInternetSettingsProxyOutput({
338
+ proxyEnable: tryRun("reg", [
339
+ "query",
340
+ "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
341
+ "/v",
342
+ "ProxyEnable",
343
+ ]),
344
+ proxyOverride: tryRun("reg", [
345
+ "query",
346
+ "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
347
+ "/v",
348
+ "ProxyOverride",
349
+ ]),
350
+ proxyServer: tryRun("reg", [
351
+ "query",
352
+ "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
353
+ "/v",
354
+ "ProxyServer",
355
+ ]),
356
+ }, platform);
357
+ }
358
+ }
359
+ catch {
360
+ // Defense-in-depth, not reachable through any real call path: `tryRun`
361
+ // already swallows every `runCommand` failure, and neither parse
362
+ // function (`parseMacosScutilProxyOutput` / the Windows one) nor
363
+ // anything they call performs any operation that can throw for a
364
+ // string input — no `new URL`, no `JSON.parse`, no fixed-pattern
365
+ // `RegExp` construction from untrusted input. Empirically re-verified
366
+ // this session: 200k fuzzed `stdout`/registry-value strings (control
367
+ // characters, huge lengths, null bytes) through both parse functions,
368
+ // zero throws — see source-map.md's 2026-07-22 entry.
369
+ return {};
370
+ }
371
+ return {};
372
+ }
373
+ //# sourceMappingURL=proxy-env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxy-env.js","sourceRoot":"","sources":["../src/proxy-env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AASlD,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAAyF;IAC/H,CAAC,WAAW,EAAE,WAAW,CAAC;IAC1B,CAAC,YAAY,EAAE,YAAY,CAAC;IAC5B,CAAC,aAAa,EAAE,aAAa,CAAC;IAC9B,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAC5C,CAAC,UAAU,EAAE,UAAU,CAAC;CACzB,CAAC,CAAC;AAEH,0HAA0H;AAC1H,SAAS,+BAA+B,CAAC,OAAe,EAAE,IAAc;IACtE,OAAO,YAAY,CAAC,OAAO,EAAE,IAAI,EAAE;QACjC,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;QACnC,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;AACL,CAAC;AAED,yHAAyH;AACzH,SAAS,oBAAoB,CAC3B,GAAW;IAEX,OAAO,wBAAwB,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,IAAI,CAAC;AACjE,CAAC;AAED,qHAAqH;AACrH,SAAS,sBAAsB,CAAC,GAAsB,EAAE,YAAoB;IAC1E,KAAK,M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 export interface ResourcePathsConfig {
3
+ /** Primary env var carrying an explicit CLI entry-point path override. */
4
+ cliPathEnvVar: string;
5
+ /** Secondary/legacy env var carrying the same override. */
6
+ cliPathFallbackEnvVar: string;
7
+ /** The npm package specifier whose `package.json` locates the CLI when no override is set. */
8
+ cliPackageName: string;
9
+ /** Env var carrying an explicit resource-root override. */
10
+ resourceRootEnvVar: string;
11
+ /** Env var carrying an explicit plugin-previews-directory override. */
12
+ pluginPreviewsDirEnvVar: string;
13
+ /** Env var carrying the daemon's data directory. */
14
+ dataDirEnvVar: string;
15
+ /** Directory name used under `projectRoot` when {@link dataDirEnvVar} is unset. */
16
+ defaultDataDirName: string;
17
+ /** Path segment identifying a Windows packaged-app `resources/<segment>/bin/` layout. */
18
+ windowsResourceBinSegment: string;
19
+ }
20
+ /**
21
+ * Resolves the daemon CLI's own entry-point path: an explicit env override
22
+ * first, then the CLI's own package location.
23
+ */
24
+ export declare function resolveDaemonCliPath(config: ResourcePathsConfig, env?: NodeJS.ProcessEnv): string;
25
+ /**
26
+ * Resolves a packaged-app "resources" directory: Electron's own
27
+ * `process.resourcesPath` when present, else a macOS `.app/Contents/Resources`
28
+ * marker in `process.execPath`, else a Windows `resources/<segment>/bin`
29
+ * marker. Returns `null` when running unpackaged (plain Node).
30
+ */
31
+ export declare function resolveProcessResourcesPath(config: ResourcePathsConfig, processInfo?: {
32
+ resourcesPath?: string;
33
+ execPath: string;
34
+ }): string | null;
35
+ export interface ResolveDaemonResourceRootOptions {
36
+ configured?: string;
37
+ safeBases?: Array<string | null | undefined>;
38
+ }
39
+ /**
40
+ * Resolves an explicit resource-root override, requiring it to fall under
41
+ * one of `safeBases`. Returns `null` when no override is configured; throws
42
+ * when an override is configured but escapes every safe base.
43
+ */
44
+ export declare function resolveDaemonResourceRoot(config: ResourcePathsConfig, { configured, safeBases }?: ResolveDaemonResourceRootOptions): string | null;
45
+ /** Joins `segment` under `resourceRoot` when present, else returns `fallback`. */
46
+ export declare function resolveDaemonResourceDir(resourceRoot: string | null, segment: string, fallback: string): string;
47
+ export interface ResolveDaemonPluginPreviewsDirOptions {
48
+ env?: NodeJS.ProcessEnv;
49
+ resourceRoot: string | null | undefined;
50
+ projectRoot: string;
51
+ }
52
+ /**
53
+ * Resolves the plugin-previews scratch directory: an explicit env override
54
+ * (resolved against `projectRoot` if relative), else the standard
55
+ * `data/plugin-previews` location under the resource root or project root.
56
+ */
57
+ export declare function resolveDaemonPluginPreviewsDir(config: ResourcePathsConfig, { env, resourceRoot, projectRoot }: ResolveDaemonPluginPreviewsDirOptions): string;
58
+ export interface ResolveDataDirOptions {
59
+ requireExplicit?: boolean;
60
+ }
61
+ /**
62
+ * Resolves the daemon's data directory: an explicit env value (expanded and
63
+ * made absolute) if set, else `<projectRoot>/<defaultDataDirName>`. Creates
64
+ * the resolved directory and verifies it's writable, throwing a
65
+ * diagnostic-rich error otherwise.
66
+ */
67
+ export declare function resolveDataDir(config: ResourcePathsConfig, raw: string | undefined, projectRoot: string, options?: ResolveDataDirOptions): string;
68
+ //# sourceMappingURL=resource-paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-paths.d.ts","sourceRoot":"","sources":["../src/resource-paths.ts"],"names":[],"mappings":"AAuBA,yEAAyE;AACzE,MAAM,WAAW,mBAAmB;IAClC,0EAA0E;IAC1E,aAAa,EAAE,MAAM,CAAC;IACtB,2DAA2D;IAC3D,qBAAqB,EAAE,MAAM,CAAC;IAC9B,8FAA8F;IAC9F,cAAc,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,kBAAkB,EAAE,MAAM,CAAC;IAC3B,uEAAuE;IACvE,uBAAuB,EAAE,MAAM,CAAC;IAChC,oDAAoD;IACpD,aAAa,EAAE,MAAM,CAAC;IACtB,mFAAmF;IACnF,kBAAkB,EAAE,MAAM,CAAC;IAC3B,yFAAyF;IACzF,yBAAyB,EAAE,MAAM,CAAC;CACnC;AAMD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,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AM,CAkCR"}
@@ -0,0 +1,137 @@
1
+ /**
2
+ * @module resource-paths
3
+ *
4
+ * Resolves the paths a packaged desktop host needs to find itself: its own
5
+ * CLI entry point, a packaged-app "resources" directory (macOS `.app`
6
+ * bundle / Windows install-relative layout), a resource root override
7
+ * (validated to stay under safe bases), plugin-preview scratch space, and
8
+ * the daemon's on-disk data directory.
9
+ *
10
+ * Generalized from an upstream flat daemon module: every hardcoded env-var
11
+ * name, the host CLI's own package specifier, the default data-directory
12
+ * name, and the Windows packaged-resources marker segment are now fields on
13
+ * {@link ResourcePathsConfig} — see `source-map.md` for the exact mapping.
14
+ */
15
+ import fs from 'node:fs';
16
+ import { createRequire } from 'node:module';
17
+ import os from 'node:os';
18
+ import path from 'node:path';
19
+ import { resolveProjectRelativePath } from './home-expansion.js';
20
+ const require = createRequire(import.meta.url);
21
+ function cleanOptionalPath(value) {
22
+ return typeof value === 'string' && value.trim().length > 0 ? path.resolve(value) : null;
23
+ }
24
+ /**
25
+ * Resolves the daemon CLI's own entry-point path: an explicit env override
26
+ * first, then the CLI's own package location.
27
+ */
28
+ export function resolveDaemonCliPath(config, env = process.env) {
29
+ const configured = cleanOptionalPath(env[config.cliPathEnvVar]) ?? cleanOptionalPath(env[config.cliPathFallbackEnvVar]);
30
+ if (configured)
31
+ return configured;
32
+ const packageJsonPath = require.resolve(`${config.cliPackageName}/package.json`);
33
+ return path.join(path.dirname(packageJsonPath), 'dist', 'cli.js');
34
+ }
35
+ function isPathWithin(base, target) {
36
+ const relativePath = path.relative(path.resolve(base), path.resolve(target));
37
+ return (relativePath === '' ||
38
+ (relativePath.length > 0 && !relativePath.startsWith('..') && !path.isAbsolute(relativePath)));
39
+ }
40
+ /**
41
+ * Resolves a packaged-app "resources" directory: Electron's own
42
+ * `process.resourcesPath` when present, else a macOS `.app/Contents/Resources`
43
+ * marker in `process.execPath`, else a Windows `resources/<segment>/bin`
44
+ * marker. Returns `null` when running unpackaged (plain Node).
45
+ */
46
+ export function resolveProcessResourcesPath(config, processInfo = process) {
47
+ const { resourcesPath } = processInfo;
48
+ if (typeof resourcesPath === 'string' && resourcesPath.length > 0) {
49
+ return resourcesPath;
50
+ }
51
+ const resourcesMarker = `${path.sep}Contents${path.sep}Resources${path.sep}`;
52
+ const markerIndex = processInfo.execPath.indexOf(resourcesMarker);
53
+ if (markerIndex !== -1) {
54
+ return processInfo.execPath.slice(0, markerIndex + resourcesMarker.length - 1);
55
+ }
56
+ const normalizedExecPath = processInfo.execPath.toLowerCase();
57
+ const windowsResourceBinMarker = `${path.sep}resources${path.sep}${config.windowsResourceBinSegment}${path.sep}bin${path.sep}`.toLowerCase();
58
+ const windowsMarkerIndex = normalizedExecPath.indexOf(windowsResourceBinMarker);
59
+ if (windowsMarkerIndex !== -1) {
60
+ return processInfo.execPath.slice(0, windowsMarkerIndex + `${path.sep}resources`.length);
61
+ }
62
+ return null;
63
+ }
64
+ /**
65
+ * Resolves an explicit resource-root override, requiring it to fall under
66
+ * one of `safeBases`. Returns `null` when no override is configured; throws
67
+ * when an override is configured but escapes every safe base.
68
+ */
69
+ export function resolveDaemonResourceRoot(config, { configured = process.env[config.resourceRootEnvVar], safeBases } = {}) {
70
+ if (!configured || configured.length === 0)
71
+ return null;
72
+ const resolved = path.resolve(configured);
73
+ const normalizedSafeBases = (safeBases ?? [])
74
+ .filter((base) => typeof base === 'string' && base.length > 0)
75
+ .map((base) => path.resolve(base));
76
+ if (!normalizedSafeBases.some((base) => isPathWithin(base, resolved))) {
77
+ throw new Error(`${config.resourceRootEnvVar} must be under the workspace root or app resources path`);
78
+ }
79
+ return resolved;
80
+ }
81
+ /** Joins `segment` under `resourceRoot` when present, else returns `fallback`. */
82
+ export function resolveDaemonResourceDir(resourceRoot, segment, fallback) {
83
+ return resourceRoot ? path.join(resourceRoot, segment) : fallback;
84
+ }
85
+ /**
86
+ * Resolves the plugin-previews scratch directory: an explicit env override
87
+ * (resolved against `projectRoot` if relative), else the standard
88
+ * `data/plugin-previews` location under the resource root or project root.
89
+ */
90
+ export function resolveDaemonPluginPreviewsDir(config, { env = process.env, resourceRoot, projectRoot }) {
91
+ const override = env[config.pluginPreviewsDirEnvVar];
92
+ if (override) {
93
+ return path.isAbsolute(override) ? override : path.resolve(projectRoot, override);
94
+ }
95
+ return resolveDaemonResourceDir(resourceRoot ?? null, path.join('data', 'plugin-previews'), path.join(projectRoot, 'data', 'plugin-previews'));
96
+ }
97
+ /**
98
+ * Resolves the daemon's data directory: an explicit env value (expanded and
99
+ * made absolute) if set, else `<projectRoot>/<defaultDataDirName>`. Creates
100
+ * the resolved directory and verifies it's writable, throwing a
101
+ * diagnostic-rich error otherwise.
102
+ */
103
+ export function resolveDataDir(config, raw, projectRoot, options = {}) {
104
+ const value = raw?.trim();
105
+ if (!value) {
106
+ if (options.requireExplicit) {
107
+ throw new Error(`${config.dataDirEnvVar} is required when sandboxing is enabled`);
108
+ }
109
+ return path.join(projectRoot, config.defaultDataDirName);
110
+ }
111
+ const resolved = resolveProjectRelativePath(value, projectRoot);
112
+ try {
113
+ fs.mkdirSync(resolved, { recursive: true });
114
+ fs.accessSync(resolved, fs.constants.W_OK);
115
+ }
116
+ catch (err) {
117
+ const e = err;
118
+ const currentUser = (() => {
119
+ try {
120
+ return os.userInfo().username;
121
+ }
122
+ catch {
123
+ return process.env.USER ?? process.env.LOGNAME ?? 'unknown';
124
+ }
125
+ })();
126
+ const parentDir = path.dirname(resolved);
127
+ throw new Error([
128
+ `${config.dataDirEnvVar} "${resolved}" is not writable: ${e.message}`,
129
+ `Current user: ${currentUser}`,
130
+ 'Check whether the folder or one of its parents is owned by another user, is a symlink to a protected location, or was previously created with sudo.',
131
+ `Try: ls -ld "${parentDir}" "${resolved}"`,
132
+ `If the folder should belong to you, fix ownership/permissions, for example: sudo chown -R "${currentUser}":staff "${parentDir}" && chmod -R u+rwX "${parentDir}"`,
133
+ ].join(' '));
134
+ }
135
+ return resolved;
136
+ }
137
+ //# sourceMappingURL=resource-paths.js.map
@@ -0,0 +1 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