codexuse-cli 2.5.8 → 3.0.2

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.
@@ -0,0 +1,554 @@
1
+ #!/usr/bin/env bun
2
+
3
+ import childProcess, { execFile } from "node:child_process";
4
+ import fs from "node:fs";
5
+ import os from "node:os";
6
+ import path from "node:path";
7
+ import { fileURLToPath } from "node:url";
8
+ import fs$1, { constants as constants$1 } from "node:fs/promises";
9
+ import { promisify } from "node:util";
10
+ import process from "node:process";
11
+ import { Buffer } from "node:buffer";
12
+ //#region ../../node_modules/.bun/is-docker@3.0.0/node_modules/is-docker/index.js
13
+ let isDockerCached;
14
+ function hasDockerEnv() {
15
+ try {
16
+ fs.statSync("/.dockerenv");
17
+ return true;
18
+ } catch {
19
+ return false;
20
+ }
21
+ }
22
+ function hasDockerCGroup() {
23
+ try {
24
+ return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
25
+ } catch {
26
+ return false;
27
+ }
28
+ }
29
+ function isDocker() {
30
+ if (isDockerCached === void 0) isDockerCached = hasDockerEnv() || hasDockerCGroup();
31
+ return isDockerCached;
32
+ }
33
+ //#endregion
34
+ //#region ../../node_modules/.bun/is-inside-container@1.0.0/node_modules/is-inside-container/index.js
35
+ let cachedResult;
36
+ const hasContainerEnv = () => {
37
+ try {
38
+ fs.statSync("/run/.containerenv");
39
+ return true;
40
+ } catch {
41
+ return false;
42
+ }
43
+ };
44
+ function isInsideContainer() {
45
+ if (cachedResult === void 0) cachedResult = hasContainerEnv() || isDocker();
46
+ return cachedResult;
47
+ }
48
+ //#endregion
49
+ //#region ../../node_modules/.bun/is-wsl@3.1.1/node_modules/is-wsl/index.js
50
+ const isWsl = () => {
51
+ if (process.platform !== "linux") return false;
52
+ if (os.release().toLowerCase().includes("microsoft")) {
53
+ if (isInsideContainer()) return false;
54
+ return true;
55
+ }
56
+ try {
57
+ if (fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft")) return !isInsideContainer();
58
+ } catch {}
59
+ if (fs.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop") || fs.existsSync("/run/WSL")) return !isInsideContainer();
60
+ return false;
61
+ };
62
+ var is_wsl_default = process.env.__IS_WSL_TEST__ ? isWsl : isWsl();
63
+ //#endregion
64
+ //#region ../../node_modules/.bun/powershell-utils@0.1.0/node_modules/powershell-utils/index.js
65
+ const execFile$2 = promisify(childProcess.execFile);
66
+ const powerShellPath$1 = () => `${process.env.SYSTEMROOT || process.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
67
+ const executePowerShell = async (command, options = {}) => {
68
+ const { powerShellPath: psPath, ...execFileOptions } = options;
69
+ const encodedCommand = executePowerShell.encodeCommand(command);
70
+ return execFile$2(psPath ?? powerShellPath$1(), [...executePowerShell.argumentsPrefix, encodedCommand], {
71
+ encoding: "utf8",
72
+ ...execFileOptions
73
+ });
74
+ };
75
+ executePowerShell.argumentsPrefix = [
76
+ "-NoProfile",
77
+ "-NonInteractive",
78
+ "-ExecutionPolicy",
79
+ "Bypass",
80
+ "-EncodedCommand"
81
+ ];
82
+ executePowerShell.encodeCommand = (command) => Buffer.from(command, "utf16le").toString("base64");
83
+ executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
84
+ //#endregion
85
+ //#region ../../node_modules/.bun/wsl-utils@0.3.1/node_modules/wsl-utils/utilities.js
86
+ function parseMountPointFromConfig(content) {
87
+ for (const line of content.split("\n")) {
88
+ if (/^\s*#/.test(line)) continue;
89
+ const match = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(line);
90
+ if (!match) continue;
91
+ return match.groups.mountPoint.trim().replaceAll(/^["']|["']$/g, "");
92
+ }
93
+ }
94
+ //#endregion
95
+ //#region ../../node_modules/.bun/wsl-utils@0.3.1/node_modules/wsl-utils/index.js
96
+ const execFile$1 = promisify(childProcess.execFile);
97
+ const wslDrivesMountPoint = (() => {
98
+ const defaultMountPoint = "/mnt/";
99
+ let mountPoint;
100
+ return async function() {
101
+ if (mountPoint) return mountPoint;
102
+ const configFilePath = "/etc/wsl.conf";
103
+ let isConfigFileExists = false;
104
+ try {
105
+ await fs$1.access(configFilePath, constants$1.F_OK);
106
+ isConfigFileExists = true;
107
+ } catch {}
108
+ if (!isConfigFileExists) return defaultMountPoint;
109
+ const parsedMountPoint = parseMountPointFromConfig(await fs$1.readFile(configFilePath, { encoding: "utf8" }));
110
+ if (parsedMountPoint === void 0) return defaultMountPoint;
111
+ mountPoint = parsedMountPoint;
112
+ mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
113
+ return mountPoint;
114
+ };
115
+ })();
116
+ const powerShellPathFromWsl = async () => {
117
+ return `${await wslDrivesMountPoint()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
118
+ };
119
+ const powerShellPath = is_wsl_default ? powerShellPathFromWsl : powerShellPath$1;
120
+ let canAccessPowerShellPromise;
121
+ const canAccessPowerShell = async () => {
122
+ canAccessPowerShellPromise ??= (async () => {
123
+ try {
124
+ const psPath = await powerShellPath();
125
+ await fs$1.access(psPath, constants$1.X_OK);
126
+ return true;
127
+ } catch {
128
+ return false;
129
+ }
130
+ })();
131
+ return canAccessPowerShellPromise;
132
+ };
133
+ const wslDefaultBrowser = async () => {
134
+ const psPath = await powerShellPath();
135
+ const { stdout } = await executePowerShell(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, { powerShellPath: psPath });
136
+ return stdout.trim();
137
+ };
138
+ const convertWslPathToWindows = async (path) => {
139
+ if (/^[a-z]+:\/\//i.test(path)) return path;
140
+ try {
141
+ const { stdout } = await execFile$1("wslpath", ["-aw", path], { encoding: "utf8" });
142
+ return stdout.trim();
143
+ } catch {
144
+ return path;
145
+ }
146
+ };
147
+ //#endregion
148
+ //#region ../../node_modules/.bun/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js
149
+ function defineLazyProperty(object, propertyName, valueGetter) {
150
+ const define = (value) => Object.defineProperty(object, propertyName, {
151
+ value,
152
+ enumerable: true,
153
+ writable: true
154
+ });
155
+ Object.defineProperty(object, propertyName, {
156
+ configurable: true,
157
+ enumerable: true,
158
+ get() {
159
+ const result = valueGetter();
160
+ define(result);
161
+ return result;
162
+ },
163
+ set(value) {
164
+ define(value);
165
+ }
166
+ });
167
+ return object;
168
+ }
169
+ //#endregion
170
+ //#region ../../node_modules/.bun/default-browser-id@5.0.1/node_modules/default-browser-id/index.js
171
+ const execFileAsync$3 = promisify(execFile);
172
+ async function defaultBrowserId() {
173
+ if (process.platform !== "darwin") throw new Error("macOS only");
174
+ const { stdout } = await execFileAsync$3("defaults", [
175
+ "read",
176
+ "com.apple.LaunchServices/com.apple.launchservices.secure",
177
+ "LSHandlers"
178
+ ]);
179
+ const browserId = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout)?.groups.id ?? "com.apple.Safari";
180
+ if (browserId === "com.apple.safari") return "com.apple.Safari";
181
+ return browserId;
182
+ }
183
+ //#endregion
184
+ //#region ../../node_modules/.bun/run-applescript@7.1.0/node_modules/run-applescript/index.js
185
+ const execFileAsync$2 = promisify(execFile);
186
+ async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
187
+ if (process.platform !== "darwin") throw new Error("macOS only");
188
+ const outputArguments = humanReadableOutput ? [] : ["-ss"];
189
+ const execOptions = {};
190
+ if (signal) execOptions.signal = signal;
191
+ const { stdout } = await execFileAsync$2("osascript", [
192
+ "-e",
193
+ script,
194
+ outputArguments
195
+ ], execOptions);
196
+ return stdout.trim();
197
+ }
198
+ //#endregion
199
+ //#region ../../node_modules/.bun/bundle-name@4.1.0/node_modules/bundle-name/index.js
200
+ async function bundleName(bundleId) {
201
+ return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
202
+ }
203
+ //#endregion
204
+ //#region ../../node_modules/.bun/default-browser@5.5.0/node_modules/default-browser/windows.js
205
+ const execFileAsync$1 = promisify(execFile);
206
+ const windowsBrowserProgIds = {
207
+ MSEdgeHTM: {
208
+ name: "Edge",
209
+ id: "com.microsoft.edge"
210
+ },
211
+ MSEdgeBHTML: {
212
+ name: "Edge Beta",
213
+ id: "com.microsoft.edge.beta"
214
+ },
215
+ MSEdgeDHTML: {
216
+ name: "Edge Dev",
217
+ id: "com.microsoft.edge.dev"
218
+ },
219
+ AppXq0fevzme2pys62n3e0fbqa7peapykr8v: {
220
+ name: "Edge",
221
+ id: "com.microsoft.edge.old"
222
+ },
223
+ ChromeHTML: {
224
+ name: "Chrome",
225
+ id: "com.google.chrome"
226
+ },
227
+ ChromeBHTML: {
228
+ name: "Chrome Beta",
229
+ id: "com.google.chrome.beta"
230
+ },
231
+ ChromeDHTML: {
232
+ name: "Chrome Dev",
233
+ id: "com.google.chrome.dev"
234
+ },
235
+ ChromiumHTM: {
236
+ name: "Chromium",
237
+ id: "org.chromium.Chromium"
238
+ },
239
+ BraveHTML: {
240
+ name: "Brave",
241
+ id: "com.brave.Browser"
242
+ },
243
+ BraveBHTML: {
244
+ name: "Brave Beta",
245
+ id: "com.brave.Browser.beta"
246
+ },
247
+ BraveDHTML: {
248
+ name: "Brave Dev",
249
+ id: "com.brave.Browser.dev"
250
+ },
251
+ BraveSSHTM: {
252
+ name: "Brave Nightly",
253
+ id: "com.brave.Browser.nightly"
254
+ },
255
+ FirefoxURL: {
256
+ name: "Firefox",
257
+ id: "org.mozilla.firefox"
258
+ },
259
+ OperaStable: {
260
+ name: "Opera",
261
+ id: "com.operasoftware.Opera"
262
+ },
263
+ VivaldiHTM: {
264
+ name: "Vivaldi",
265
+ id: "com.vivaldi.Vivaldi"
266
+ },
267
+ "IE.HTTP": {
268
+ name: "Internet Explorer",
269
+ id: "com.microsoft.ie"
270
+ }
271
+ };
272
+ const _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
273
+ var UnknownBrowserError = class extends Error {};
274
+ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
275
+ const { stdout } = await _execFileAsync("reg", [
276
+ "QUERY",
277
+ " HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
278
+ "/v",
279
+ "ProgId"
280
+ ]);
281
+ const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
282
+ if (!match) throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
283
+ const { id } = match.groups;
284
+ const dotIndex = id.lastIndexOf(".");
285
+ const hyphenIndex = id.lastIndexOf("-");
286
+ const baseIdByDot = dotIndex === -1 ? void 0 : id.slice(0, dotIndex);
287
+ const baseIdByHyphen = hyphenIndex === -1 ? void 0 : id.slice(0, hyphenIndex);
288
+ return windowsBrowserProgIds[id] ?? windowsBrowserProgIds[baseIdByDot] ?? windowsBrowserProgIds[baseIdByHyphen] ?? {
289
+ name: id,
290
+ id
291
+ };
292
+ }
293
+ //#endregion
294
+ //#region ../../node_modules/.bun/default-browser@5.5.0/node_modules/default-browser/index.js
295
+ const execFileAsync = promisify(execFile);
296
+ const titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
297
+ async function defaultBrowser() {
298
+ if (process.platform === "darwin") {
299
+ const id = await defaultBrowserId();
300
+ return {
301
+ name: await bundleName(id),
302
+ id
303
+ };
304
+ }
305
+ if (process.platform === "linux") {
306
+ const { stdout } = await execFileAsync("xdg-mime", [
307
+ "query",
308
+ "default",
309
+ "x-scheme-handler/http"
310
+ ]);
311
+ const id = stdout.trim();
312
+ return {
313
+ name: titleize(id.replace(/.desktop$/, "").replace("-", " ")),
314
+ id
315
+ };
316
+ }
317
+ if (process.platform === "win32") return defaultBrowser$1();
318
+ throw new Error("Only macOS, Linux, and Windows are supported");
319
+ }
320
+ //#endregion
321
+ //#region ../../node_modules/.bun/is-in-ssh@1.0.0/node_modules/is-in-ssh/index.js
322
+ const isInSsh = Boolean(process.env.SSH_CONNECTION || process.env.SSH_CLIENT || process.env.SSH_TTY);
323
+ //#endregion
324
+ //#region ../../node_modules/.bun/open@11.0.0/node_modules/open/index.js
325
+ const fallbackAttemptSymbol = Symbol("fallbackAttempt");
326
+ const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
327
+ const localXdgOpenPath = path.join(__dirname, "xdg-open");
328
+ const { platform, arch } = process;
329
+ const tryEachApp = async (apps, opener) => {
330
+ if (apps.length === 0) return;
331
+ const errors = [];
332
+ for (const app of apps) try {
333
+ return await opener(app);
334
+ } catch (error) {
335
+ errors.push(error);
336
+ }
337
+ throw new AggregateError(errors, "Failed to open in all supported apps");
338
+ };
339
+ const baseOpen = async (options) => {
340
+ options = {
341
+ wait: false,
342
+ background: false,
343
+ newInstance: false,
344
+ allowNonzeroExitCode: false,
345
+ ...options
346
+ };
347
+ const isFallbackAttempt = options[fallbackAttemptSymbol] === true;
348
+ delete options[fallbackAttemptSymbol];
349
+ if (Array.isArray(options.app)) return tryEachApp(options.app, (singleApp) => baseOpen({
350
+ ...options,
351
+ app: singleApp,
352
+ [fallbackAttemptSymbol]: true
353
+ }));
354
+ let { name: app, arguments: appArguments = [] } = options.app ?? {};
355
+ appArguments = [...appArguments];
356
+ if (Array.isArray(app)) return tryEachApp(app, (appName) => baseOpen({
357
+ ...options,
358
+ app: {
359
+ name: appName,
360
+ arguments: appArguments
361
+ },
362
+ [fallbackAttemptSymbol]: true
363
+ }));
364
+ if (app === "browser" || app === "browserPrivate") {
365
+ const ids = {
366
+ "com.google.chrome": "chrome",
367
+ "google-chrome.desktop": "chrome",
368
+ "com.brave.browser": "brave",
369
+ "org.mozilla.firefox": "firefox",
370
+ "firefox.desktop": "firefox",
371
+ "com.microsoft.msedge": "edge",
372
+ "com.microsoft.edge": "edge",
373
+ "com.microsoft.edgemac": "edge",
374
+ "microsoft-edge.desktop": "edge",
375
+ "com.apple.safari": "safari"
376
+ };
377
+ const flags = {
378
+ chrome: "--incognito",
379
+ brave: "--incognito",
380
+ firefox: "--private-window",
381
+ edge: "--inPrivate"
382
+ };
383
+ let browser;
384
+ if (is_wsl_default) {
385
+ const progId = await wslDefaultBrowser();
386
+ browser = _windowsBrowserProgIdMap.get(progId) ?? {};
387
+ } else browser = await defaultBrowser();
388
+ if (browser.id in ids) {
389
+ const browserName = ids[browser.id.toLowerCase()];
390
+ if (app === "browserPrivate") {
391
+ if (browserName === "safari") throw new Error("Safari doesn't support opening in private mode via command line");
392
+ appArguments.push(flags[browserName]);
393
+ }
394
+ return baseOpen({
395
+ ...options,
396
+ app: {
397
+ name: apps[browserName],
398
+ arguments: appArguments
399
+ }
400
+ });
401
+ }
402
+ throw new Error(`${browser.name} is not supported as a default browser`);
403
+ }
404
+ let command;
405
+ const cliArguments = [];
406
+ const childProcessOptions = {};
407
+ let shouldUseWindowsInWsl = false;
408
+ if (is_wsl_default && !isInsideContainer() && !isInSsh && !app) shouldUseWindowsInWsl = await canAccessPowerShell();
409
+ if (platform === "darwin") {
410
+ command = "open";
411
+ if (options.wait) cliArguments.push("--wait-apps");
412
+ if (options.background) cliArguments.push("--background");
413
+ if (options.newInstance) cliArguments.push("--new");
414
+ if (app) cliArguments.push("-a", app);
415
+ } else if (platform === "win32" || shouldUseWindowsInWsl) {
416
+ command = await powerShellPath();
417
+ cliArguments.push(...executePowerShell.argumentsPrefix);
418
+ if (!is_wsl_default) childProcessOptions.windowsVerbatimArguments = true;
419
+ if (is_wsl_default && options.target) options.target = await convertWslPathToWindows(options.target);
420
+ const encodedArguments = ["$ProgressPreference = 'SilentlyContinue';", "Start"];
421
+ if (options.wait) encodedArguments.push("-Wait");
422
+ if (app) {
423
+ encodedArguments.push(executePowerShell.escapeArgument(app));
424
+ if (options.target) appArguments.push(options.target);
425
+ } else if (options.target) encodedArguments.push(executePowerShell.escapeArgument(options.target));
426
+ if (appArguments.length > 0) {
427
+ appArguments = appArguments.map((argument) => executePowerShell.escapeArgument(argument));
428
+ encodedArguments.push("-ArgumentList", appArguments.join(","));
429
+ }
430
+ options.target = executePowerShell.encodeCommand(encodedArguments.join(" "));
431
+ if (!options.wait) childProcessOptions.stdio = "ignore";
432
+ } else {
433
+ if (app) command = app;
434
+ else {
435
+ const isBundled = !__dirname || __dirname === "/";
436
+ let exeLocalXdgOpen = false;
437
+ try {
438
+ await fs$1.access(localXdgOpenPath, constants$1.X_OK);
439
+ exeLocalXdgOpen = true;
440
+ } catch {}
441
+ command = process.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
442
+ }
443
+ if (appArguments.length > 0) cliArguments.push(...appArguments);
444
+ if (!options.wait) {
445
+ childProcessOptions.stdio = "ignore";
446
+ childProcessOptions.detached = true;
447
+ }
448
+ }
449
+ if (platform === "darwin" && appArguments.length > 0) cliArguments.push("--args", ...appArguments);
450
+ if (options.target) cliArguments.push(options.target);
451
+ const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
452
+ if (options.wait) return new Promise((resolve, reject) => {
453
+ subprocess.once("error", reject);
454
+ subprocess.once("close", (exitCode) => {
455
+ if (!options.allowNonzeroExitCode && exitCode !== 0) {
456
+ reject(/* @__PURE__ */ new Error(`Exited with code ${exitCode}`));
457
+ return;
458
+ }
459
+ resolve(subprocess);
460
+ });
461
+ });
462
+ if (isFallbackAttempt) return new Promise((resolve, reject) => {
463
+ subprocess.once("error", reject);
464
+ subprocess.once("spawn", () => {
465
+ subprocess.once("close", (exitCode) => {
466
+ subprocess.off("error", reject);
467
+ if (exitCode !== 0) {
468
+ reject(/* @__PURE__ */ new Error(`Exited with code ${exitCode}`));
469
+ return;
470
+ }
471
+ subprocess.unref();
472
+ resolve(subprocess);
473
+ });
474
+ });
475
+ });
476
+ subprocess.unref();
477
+ return new Promise((resolve, reject) => {
478
+ subprocess.once("error", reject);
479
+ subprocess.once("spawn", () => {
480
+ subprocess.off("error", reject);
481
+ resolve(subprocess);
482
+ });
483
+ });
484
+ };
485
+ const open = (target, options) => {
486
+ if (typeof target !== "string") throw new TypeError("Expected a `target`");
487
+ return baseOpen({
488
+ ...options,
489
+ target
490
+ });
491
+ };
492
+ const openApp = (name, options) => {
493
+ if (typeof name !== "string" && !Array.isArray(name)) throw new TypeError("Expected a valid `name`");
494
+ const { arguments: appArguments = [] } = options ?? {};
495
+ if (appArguments !== void 0 && appArguments !== null && !Array.isArray(appArguments)) throw new TypeError("Expected `appArguments` as Array type");
496
+ return baseOpen({
497
+ ...options,
498
+ app: {
499
+ name,
500
+ arguments: appArguments
501
+ }
502
+ });
503
+ };
504
+ function detectArchBinary(binary) {
505
+ if (typeof binary === "string" || Array.isArray(binary)) return binary;
506
+ const { [arch]: archBinary } = binary;
507
+ if (!archBinary) throw new Error(`${arch} is not supported`);
508
+ return archBinary;
509
+ }
510
+ function detectPlatformBinary({ [platform]: platformBinary }, { wsl } = {}) {
511
+ if (wsl && is_wsl_default) return detectArchBinary(wsl);
512
+ if (!platformBinary) throw new Error(`${platform} is not supported`);
513
+ return detectArchBinary(platformBinary);
514
+ }
515
+ const apps = {
516
+ browser: "browser",
517
+ browserPrivate: "browserPrivate"
518
+ };
519
+ defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
520
+ darwin: "google chrome",
521
+ win32: "chrome",
522
+ linux: [
523
+ "google-chrome",
524
+ "google-chrome-stable",
525
+ "chromium",
526
+ "chromium-browser"
527
+ ]
528
+ }, { wsl: {
529
+ ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
530
+ x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
531
+ } }));
532
+ defineLazyProperty(apps, "brave", () => detectPlatformBinary({
533
+ darwin: "brave browser",
534
+ win32: "brave",
535
+ linux: ["brave-browser", "brave"]
536
+ }, { wsl: {
537
+ ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
538
+ x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
539
+ } }));
540
+ defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
541
+ darwin: "firefox",
542
+ win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
543
+ linux: "firefox"
544
+ }, { wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe" }));
545
+ defineLazyProperty(apps, "edge", () => detectPlatformBinary({
546
+ darwin: "microsoft edge",
547
+ win32: "msedge",
548
+ linux: ["microsoft-edge", "microsoft-edge-dev"]
549
+ }, { wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" }));
550
+ defineLazyProperty(apps, "safari", () => detectPlatformBinary({ darwin: "Safari" }));
551
+ //#endregion
552
+ export { apps, open as default, openApp };
553
+
554
+ //# sourceMappingURL=open-BM96ykXl.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codexuse-cli",
3
- "version": "2.5.8",
3
+ "version": "3.0.2",
4
4
  "description": "CodexUse CLI for managing Codex profiles and licenses.",
5
5
  "author": {
6
6
  "name": "Hoang",
@@ -8,6 +8,9 @@
8
8
  },
9
9
  "license": "UNLICENSED",
10
10
  "type": "commonjs",
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
11
14
  "bin": {
12
15
  "codexuse": "dist/index.js"
13
16
  },
@@ -16,13 +19,21 @@
16
19
  "README.md"
17
20
  ],
18
21
  "scripts": {
19
- "build": "tsup && node scripts/chmod.js"
22
+ "build": "tsup && node scripts/package-server.js && node scripts/chmod.js",
23
+ "typecheck": "bunx tsc --noEmit"
20
24
  },
21
25
  "dependencies": {
22
- "@iarna/toml": "2.2.5"
26
+ "@codexuse/contracts": "workspace:*",
27
+ "@codexuse/runtime-app-state": "workspace:*",
28
+ "@codexuse/runtime-codex": "workspace:*",
29
+ "@codexuse/runtime-profiles": "workspace:*",
30
+ "@codexuse/shared": "workspace:*"
31
+ },
32
+ "optionalDependencies": {
33
+ "node-pty": "^1.1.0"
23
34
  },
24
35
  "devDependencies": {
25
- "tsup": "8.5.1",
26
- "typescript": "5.9.3"
36
+ "tsup": "catalog:",
37
+ "typescript": "catalog:"
27
38
  }
28
39
  }