@trydecember/cli 0.2.17 → 0.2.18
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/README.md +3 -3
- package/dist/december.js +877 -967
- package/package.json +4 -1
package/dist/december.js
CHANGED
|
@@ -99294,6 +99294,11 @@ ${content}`);
|
|
|
99294
99294
|
}
|
|
99295
99295
|
}
|
|
99296
99296
|
}
|
|
99297
|
+
const rootRulesPath = path7.join(this.config.workspaceDir, ".december", "rules.md");
|
|
99298
|
+
if (fs6.existsSync(rootRulesPath)) {
|
|
99299
|
+
const content = fs6.readFileSync(rootRulesPath, "utf8");
|
|
99300
|
+
rules.push({ path: rootRulesPath, content });
|
|
99301
|
+
}
|
|
99297
99302
|
} catch (e2) {}
|
|
99298
99303
|
return rules;
|
|
99299
99304
|
}
|
|
@@ -224420,6 +224425,585 @@ var require_main2 = __commonJS((exports, module) => {
|
|
|
224420
224425
|
module.exports = DotenvModule;
|
|
224421
224426
|
});
|
|
224422
224427
|
|
|
224428
|
+
// ../../node_modules/.bun/powershell-utils@0.1.0/node_modules/powershell-utils/index.js
|
|
224429
|
+
import process31 from "node:process";
|
|
224430
|
+
import { Buffer as Buffer8 } from "node:buffer";
|
|
224431
|
+
import { promisify as promisify8 } from "node:util";
|
|
224432
|
+
import childProcess3 from "node:child_process";
|
|
224433
|
+
var execFile3, powerShellPath2 = () => `${process31.env.SYSTEMROOT || process31.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`, executePowerShell2 = async (command, options = {}) => {
|
|
224434
|
+
const {
|
|
224435
|
+
powerShellPath: psPath,
|
|
224436
|
+
...execFileOptions
|
|
224437
|
+
} = options;
|
|
224438
|
+
const encodedCommand = executePowerShell2.encodeCommand(command);
|
|
224439
|
+
return execFile3(psPath ?? powerShellPath2(), [
|
|
224440
|
+
...executePowerShell2.argumentsPrefix,
|
|
224441
|
+
encodedCommand
|
|
224442
|
+
], {
|
|
224443
|
+
encoding: "utf8",
|
|
224444
|
+
...execFileOptions
|
|
224445
|
+
});
|
|
224446
|
+
};
|
|
224447
|
+
var init_powershell_utils2 = __esm(() => {
|
|
224448
|
+
execFile3 = promisify8(childProcess3.execFile);
|
|
224449
|
+
executePowerShell2.argumentsPrefix = [
|
|
224450
|
+
"-NoProfile",
|
|
224451
|
+
"-NonInteractive",
|
|
224452
|
+
"-ExecutionPolicy",
|
|
224453
|
+
"Bypass",
|
|
224454
|
+
"-EncodedCommand"
|
|
224455
|
+
];
|
|
224456
|
+
executePowerShell2.encodeCommand = (command) => Buffer8.from(command, "utf16le").toString("base64");
|
|
224457
|
+
executePowerShell2.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
|
|
224458
|
+
});
|
|
224459
|
+
|
|
224460
|
+
// ../../node_modules/.bun/wsl-utils@0.3.1/node_modules/wsl-utils/utilities.js
|
|
224461
|
+
function parseMountPointFromConfig(content) {
|
|
224462
|
+
for (const line of content.split(`
|
|
224463
|
+
`)) {
|
|
224464
|
+
if (/^\s*#/.test(line)) {
|
|
224465
|
+
continue;
|
|
224466
|
+
}
|
|
224467
|
+
const match2 = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(line);
|
|
224468
|
+
if (!match2) {
|
|
224469
|
+
continue;
|
|
224470
|
+
}
|
|
224471
|
+
return match2.groups.mountPoint.trim().replaceAll(/^["']|["']$/g, "");
|
|
224472
|
+
}
|
|
224473
|
+
}
|
|
224474
|
+
|
|
224475
|
+
// ../../node_modules/.bun/wsl-utils@0.3.1/node_modules/wsl-utils/index.js
|
|
224476
|
+
import { promisify as promisify9 } from "node:util";
|
|
224477
|
+
import childProcess4 from "node:child_process";
|
|
224478
|
+
import fs17, { constants as fsConstants } from "node:fs/promises";
|
|
224479
|
+
var execFile4, wslDrivesMountPoint, powerShellPathFromWsl = async () => {
|
|
224480
|
+
const mountPoint = await wslDrivesMountPoint();
|
|
224481
|
+
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
|
224482
|
+
}, powerShellPath3, canAccessPowerShellPromise, canAccessPowerShell = async () => {
|
|
224483
|
+
canAccessPowerShellPromise ??= (async () => {
|
|
224484
|
+
try {
|
|
224485
|
+
const psPath = await powerShellPath3();
|
|
224486
|
+
await fs17.access(psPath, fsConstants.X_OK);
|
|
224487
|
+
return true;
|
|
224488
|
+
} catch {
|
|
224489
|
+
return false;
|
|
224490
|
+
}
|
|
224491
|
+
})();
|
|
224492
|
+
return canAccessPowerShellPromise;
|
|
224493
|
+
}, wslDefaultBrowser = async () => {
|
|
224494
|
+
const psPath = await powerShellPath3();
|
|
224495
|
+
const command = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
|
224496
|
+
const { stdout } = await executePowerShell2(command, { powerShellPath: psPath });
|
|
224497
|
+
return stdout.trim();
|
|
224498
|
+
}, convertWslPathToWindows = async (path17) => {
|
|
224499
|
+
if (/^[a-z]+:\/\//i.test(path17)) {
|
|
224500
|
+
return path17;
|
|
224501
|
+
}
|
|
224502
|
+
try {
|
|
224503
|
+
const { stdout } = await execFile4("wslpath", ["-aw", path17], { encoding: "utf8" });
|
|
224504
|
+
return stdout.trim();
|
|
224505
|
+
} catch {
|
|
224506
|
+
return path17;
|
|
224507
|
+
}
|
|
224508
|
+
};
|
|
224509
|
+
var init_wsl_utils = __esm(() => {
|
|
224510
|
+
init_is_wsl();
|
|
224511
|
+
init_powershell_utils2();
|
|
224512
|
+
init_is_wsl();
|
|
224513
|
+
execFile4 = promisify9(childProcess4.execFile);
|
|
224514
|
+
wslDrivesMountPoint = (() => {
|
|
224515
|
+
const defaultMountPoint = "/mnt/";
|
|
224516
|
+
let mountPoint;
|
|
224517
|
+
return async function() {
|
|
224518
|
+
if (mountPoint) {
|
|
224519
|
+
return mountPoint;
|
|
224520
|
+
}
|
|
224521
|
+
const configFilePath = "/etc/wsl.conf";
|
|
224522
|
+
let isConfigFileExists = false;
|
|
224523
|
+
try {
|
|
224524
|
+
await fs17.access(configFilePath, fsConstants.F_OK);
|
|
224525
|
+
isConfigFileExists = true;
|
|
224526
|
+
} catch {}
|
|
224527
|
+
if (!isConfigFileExists) {
|
|
224528
|
+
return defaultMountPoint;
|
|
224529
|
+
}
|
|
224530
|
+
const configContent = await fs17.readFile(configFilePath, { encoding: "utf8" });
|
|
224531
|
+
const parsedMountPoint = parseMountPointFromConfig(configContent);
|
|
224532
|
+
if (parsedMountPoint === undefined) {
|
|
224533
|
+
return defaultMountPoint;
|
|
224534
|
+
}
|
|
224535
|
+
mountPoint = parsedMountPoint;
|
|
224536
|
+
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
224537
|
+
return mountPoint;
|
|
224538
|
+
};
|
|
224539
|
+
})();
|
|
224540
|
+
powerShellPath3 = is_wsl_default ? powerShellPathFromWsl : powerShellPath2;
|
|
224541
|
+
});
|
|
224542
|
+
|
|
224543
|
+
// ../../node_modules/.bun/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js
|
|
224544
|
+
function defineLazyProperty(object4, propertyName, valueGetter) {
|
|
224545
|
+
const define2 = (value) => Object.defineProperty(object4, propertyName, { value, enumerable: true, writable: true });
|
|
224546
|
+
Object.defineProperty(object4, propertyName, {
|
|
224547
|
+
configurable: true,
|
|
224548
|
+
enumerable: true,
|
|
224549
|
+
get() {
|
|
224550
|
+
const result2 = valueGetter();
|
|
224551
|
+
define2(result2);
|
|
224552
|
+
return result2;
|
|
224553
|
+
},
|
|
224554
|
+
set(value) {
|
|
224555
|
+
define2(value);
|
|
224556
|
+
}
|
|
224557
|
+
});
|
|
224558
|
+
return object4;
|
|
224559
|
+
}
|
|
224560
|
+
|
|
224561
|
+
// ../../node_modules/.bun/default-browser-id@5.0.1/node_modules/default-browser-id/index.js
|
|
224562
|
+
import { promisify as promisify10 } from "node:util";
|
|
224563
|
+
import process32 from "node:process";
|
|
224564
|
+
import { execFile as execFile5 } from "node:child_process";
|
|
224565
|
+
async function defaultBrowserId() {
|
|
224566
|
+
if (process32.platform !== "darwin") {
|
|
224567
|
+
throw new Error("macOS only");
|
|
224568
|
+
}
|
|
224569
|
+
const { stdout } = await execFileAsync2("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
|
|
224570
|
+
const match2 = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
|
|
224571
|
+
const browserId = match2?.groups.id ?? "com.apple.Safari";
|
|
224572
|
+
if (browserId === "com.apple.safari") {
|
|
224573
|
+
return "com.apple.Safari";
|
|
224574
|
+
}
|
|
224575
|
+
return browserId;
|
|
224576
|
+
}
|
|
224577
|
+
var execFileAsync2;
|
|
224578
|
+
var init_default_browser_id = __esm(() => {
|
|
224579
|
+
execFileAsync2 = promisify10(execFile5);
|
|
224580
|
+
});
|
|
224581
|
+
|
|
224582
|
+
// ../../node_modules/.bun/run-applescript@7.1.0/node_modules/run-applescript/index.js
|
|
224583
|
+
import process33 from "node:process";
|
|
224584
|
+
import { promisify as promisify11 } from "node:util";
|
|
224585
|
+
import { execFile as execFile6, execFileSync as execFileSync2 } from "node:child_process";
|
|
224586
|
+
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
224587
|
+
if (process33.platform !== "darwin") {
|
|
224588
|
+
throw new Error("macOS only");
|
|
224589
|
+
}
|
|
224590
|
+
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
224591
|
+
const execOptions = {};
|
|
224592
|
+
if (signal) {
|
|
224593
|
+
execOptions.signal = signal;
|
|
224594
|
+
}
|
|
224595
|
+
const { stdout } = await execFileAsync3("osascript", ["-e", script, outputArguments], execOptions);
|
|
224596
|
+
return stdout.trim();
|
|
224597
|
+
}
|
|
224598
|
+
var execFileAsync3;
|
|
224599
|
+
var init_run_applescript = __esm(() => {
|
|
224600
|
+
execFileAsync3 = promisify11(execFile6);
|
|
224601
|
+
});
|
|
224602
|
+
|
|
224603
|
+
// ../../node_modules/.bun/bundle-name@4.1.0/node_modules/bundle-name/index.js
|
|
224604
|
+
async function bundleName(bundleId) {
|
|
224605
|
+
return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string
|
|
224606
|
+
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
|
|
224607
|
+
}
|
|
224608
|
+
var init_bundle_name = __esm(() => {
|
|
224609
|
+
init_run_applescript();
|
|
224610
|
+
});
|
|
224611
|
+
|
|
224612
|
+
// ../../node_modules/.bun/default-browser@5.5.0/node_modules/default-browser/windows.js
|
|
224613
|
+
import { promisify as promisify12 } from "node:util";
|
|
224614
|
+
import { execFile as execFile7 } from "node:child_process";
|
|
224615
|
+
async function defaultBrowser(_execFileAsync = execFileAsync4) {
|
|
224616
|
+
const { stdout } = await _execFileAsync("reg", [
|
|
224617
|
+
"QUERY",
|
|
224618
|
+
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
|
|
224619
|
+
"/v",
|
|
224620
|
+
"ProgId"
|
|
224621
|
+
]);
|
|
224622
|
+
const match2 = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
|
|
224623
|
+
if (!match2) {
|
|
224624
|
+
throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
|
|
224625
|
+
}
|
|
224626
|
+
const { id } = match2.groups;
|
|
224627
|
+
const dotIndex = id.lastIndexOf(".");
|
|
224628
|
+
const hyphenIndex = id.lastIndexOf("-");
|
|
224629
|
+
const baseIdByDot = dotIndex === -1 ? undefined : id.slice(0, dotIndex);
|
|
224630
|
+
const baseIdByHyphen = hyphenIndex === -1 ? undefined : id.slice(0, hyphenIndex);
|
|
224631
|
+
return windowsBrowserProgIds[id] ?? windowsBrowserProgIds[baseIdByDot] ?? windowsBrowserProgIds[baseIdByHyphen] ?? { name: id, id };
|
|
224632
|
+
}
|
|
224633
|
+
var execFileAsync4, windowsBrowserProgIds, _windowsBrowserProgIdMap, UnknownBrowserError;
|
|
224634
|
+
var init_windows2 = __esm(() => {
|
|
224635
|
+
execFileAsync4 = promisify12(execFile7);
|
|
224636
|
+
windowsBrowserProgIds = {
|
|
224637
|
+
MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
|
|
224638
|
+
MSEdgeBHTML: { name: "Edge Beta", id: "com.microsoft.edge.beta" },
|
|
224639
|
+
MSEdgeDHTML: { name: "Edge Dev", id: "com.microsoft.edge.dev" },
|
|
224640
|
+
AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
|
|
224641
|
+
ChromeHTML: { name: "Chrome", id: "com.google.chrome" },
|
|
224642
|
+
ChromeBHTML: { name: "Chrome Beta", id: "com.google.chrome.beta" },
|
|
224643
|
+
ChromeDHTML: { name: "Chrome Dev", id: "com.google.chrome.dev" },
|
|
224644
|
+
ChromiumHTM: { name: "Chromium", id: "org.chromium.Chromium" },
|
|
224645
|
+
BraveHTML: { name: "Brave", id: "com.brave.Browser" },
|
|
224646
|
+
BraveBHTML: { name: "Brave Beta", id: "com.brave.Browser.beta" },
|
|
224647
|
+
BraveDHTML: { name: "Brave Dev", id: "com.brave.Browser.dev" },
|
|
224648
|
+
BraveSSHTM: { name: "Brave Nightly", id: "com.brave.Browser.nightly" },
|
|
224649
|
+
FirefoxURL: { name: "Firefox", id: "org.mozilla.firefox" },
|
|
224650
|
+
OperaStable: { name: "Opera", id: "com.operasoftware.Opera" },
|
|
224651
|
+
VivaldiHTM: { name: "Vivaldi", id: "com.vivaldi.Vivaldi" },
|
|
224652
|
+
"IE.HTTP": { name: "Internet Explorer", id: "com.microsoft.ie" }
|
|
224653
|
+
};
|
|
224654
|
+
_windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
|
|
224655
|
+
UnknownBrowserError = class UnknownBrowserError extends Error {
|
|
224656
|
+
};
|
|
224657
|
+
});
|
|
224658
|
+
|
|
224659
|
+
// ../../node_modules/.bun/default-browser@5.5.0/node_modules/default-browser/index.js
|
|
224660
|
+
import { promisify as promisify13 } from "node:util";
|
|
224661
|
+
import process34 from "node:process";
|
|
224662
|
+
import { execFile as execFile8 } from "node:child_process";
|
|
224663
|
+
async function defaultBrowser2() {
|
|
224664
|
+
if (process34.platform === "darwin") {
|
|
224665
|
+
const id = await defaultBrowserId();
|
|
224666
|
+
const name = await bundleName(id);
|
|
224667
|
+
return { name, id };
|
|
224668
|
+
}
|
|
224669
|
+
if (process34.platform === "linux") {
|
|
224670
|
+
const { stdout } = await execFileAsync5("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
|
|
224671
|
+
const id = stdout.trim();
|
|
224672
|
+
const name = titleize(id.replace(/.desktop$/, "").replace("-", " "));
|
|
224673
|
+
return { name, id };
|
|
224674
|
+
}
|
|
224675
|
+
if (process34.platform === "win32") {
|
|
224676
|
+
return defaultBrowser();
|
|
224677
|
+
}
|
|
224678
|
+
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
224679
|
+
}
|
|
224680
|
+
var execFileAsync5, titleize = (string4) => string4.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x3) => x3.toUpperCase());
|
|
224681
|
+
var init_default_browser = __esm(() => {
|
|
224682
|
+
init_default_browser_id();
|
|
224683
|
+
init_bundle_name();
|
|
224684
|
+
init_windows2();
|
|
224685
|
+
init_windows2();
|
|
224686
|
+
execFileAsync5 = promisify13(execFile8);
|
|
224687
|
+
});
|
|
224688
|
+
|
|
224689
|
+
// ../../node_modules/.bun/is-in-ssh@1.0.0/node_modules/is-in-ssh/index.js
|
|
224690
|
+
import process35 from "node:process";
|
|
224691
|
+
var isInSsh, is_in_ssh_default;
|
|
224692
|
+
var init_is_in_ssh = __esm(() => {
|
|
224693
|
+
isInSsh = Boolean(process35.env.SSH_CONNECTION || process35.env.SSH_CLIENT || process35.env.SSH_TTY);
|
|
224694
|
+
is_in_ssh_default = isInSsh;
|
|
224695
|
+
});
|
|
224696
|
+
|
|
224697
|
+
// ../../node_modules/.bun/open@11.0.0/node_modules/open/index.js
|
|
224698
|
+
var exports_open = {};
|
|
224699
|
+
__export(exports_open, {
|
|
224700
|
+
openApp: () => openApp,
|
|
224701
|
+
default: () => open_default,
|
|
224702
|
+
apps: () => apps
|
|
224703
|
+
});
|
|
224704
|
+
import process36 from "node:process";
|
|
224705
|
+
import path17 from "node:path";
|
|
224706
|
+
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
224707
|
+
import childProcess5 from "node:child_process";
|
|
224708
|
+
import fs18, { constants as fsConstants2 } from "node:fs/promises";
|
|
224709
|
+
function detectArchBinary(binary) {
|
|
224710
|
+
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
224711
|
+
return binary;
|
|
224712
|
+
}
|
|
224713
|
+
const { [arch]: archBinary } = binary;
|
|
224714
|
+
if (!archBinary) {
|
|
224715
|
+
throw new Error(`${arch} is not supported`);
|
|
224716
|
+
}
|
|
224717
|
+
return archBinary;
|
|
224718
|
+
}
|
|
224719
|
+
function detectPlatformBinary({ [platform3]: platformBinary }, { wsl } = {}) {
|
|
224720
|
+
if (wsl && is_wsl_default) {
|
|
224721
|
+
return detectArchBinary(wsl);
|
|
224722
|
+
}
|
|
224723
|
+
if (!platformBinary) {
|
|
224724
|
+
throw new Error(`${platform3} is not supported`);
|
|
224725
|
+
}
|
|
224726
|
+
return detectArchBinary(platformBinary);
|
|
224727
|
+
}
|
|
224728
|
+
var fallbackAttemptSymbol, __dirname4, localXdgOpenPath, platform3, arch, tryEachApp = async (apps, opener) => {
|
|
224729
|
+
if (apps.length === 0) {
|
|
224730
|
+
return;
|
|
224731
|
+
}
|
|
224732
|
+
const errors4 = [];
|
|
224733
|
+
for (const app2 of apps) {
|
|
224734
|
+
try {
|
|
224735
|
+
return await opener(app2);
|
|
224736
|
+
} catch (error4) {
|
|
224737
|
+
errors4.push(error4);
|
|
224738
|
+
}
|
|
224739
|
+
}
|
|
224740
|
+
throw new AggregateError(errors4, "Failed to open in all supported apps");
|
|
224741
|
+
}, baseOpen = async (options) => {
|
|
224742
|
+
options = {
|
|
224743
|
+
wait: false,
|
|
224744
|
+
background: false,
|
|
224745
|
+
newInstance: false,
|
|
224746
|
+
allowNonzeroExitCode: false,
|
|
224747
|
+
...options
|
|
224748
|
+
};
|
|
224749
|
+
const isFallbackAttempt = options[fallbackAttemptSymbol] === true;
|
|
224750
|
+
delete options[fallbackAttemptSymbol];
|
|
224751
|
+
if (Array.isArray(options.app)) {
|
|
224752
|
+
return tryEachApp(options.app, (singleApp) => baseOpen({
|
|
224753
|
+
...options,
|
|
224754
|
+
app: singleApp,
|
|
224755
|
+
[fallbackAttemptSymbol]: true
|
|
224756
|
+
}));
|
|
224757
|
+
}
|
|
224758
|
+
let { name: app2, arguments: appArguments = [] } = options.app ?? {};
|
|
224759
|
+
appArguments = [...appArguments];
|
|
224760
|
+
if (Array.isArray(app2)) {
|
|
224761
|
+
return tryEachApp(app2, (appName) => baseOpen({
|
|
224762
|
+
...options,
|
|
224763
|
+
app: {
|
|
224764
|
+
name: appName,
|
|
224765
|
+
arguments: appArguments
|
|
224766
|
+
},
|
|
224767
|
+
[fallbackAttemptSymbol]: true
|
|
224768
|
+
}));
|
|
224769
|
+
}
|
|
224770
|
+
if (app2 === "browser" || app2 === "browserPrivate") {
|
|
224771
|
+
const ids = {
|
|
224772
|
+
"com.google.chrome": "chrome",
|
|
224773
|
+
"google-chrome.desktop": "chrome",
|
|
224774
|
+
"com.brave.browser": "brave",
|
|
224775
|
+
"org.mozilla.firefox": "firefox",
|
|
224776
|
+
"firefox.desktop": "firefox",
|
|
224777
|
+
"com.microsoft.msedge": "edge",
|
|
224778
|
+
"com.microsoft.edge": "edge",
|
|
224779
|
+
"com.microsoft.edgemac": "edge",
|
|
224780
|
+
"microsoft-edge.desktop": "edge",
|
|
224781
|
+
"com.apple.safari": "safari"
|
|
224782
|
+
};
|
|
224783
|
+
const flags = {
|
|
224784
|
+
chrome: "--incognito",
|
|
224785
|
+
brave: "--incognito",
|
|
224786
|
+
firefox: "--private-window",
|
|
224787
|
+
edge: "--inPrivate"
|
|
224788
|
+
};
|
|
224789
|
+
let browser2;
|
|
224790
|
+
if (is_wsl_default) {
|
|
224791
|
+
const progId = await wslDefaultBrowser();
|
|
224792
|
+
const browserInfo = _windowsBrowserProgIdMap.get(progId);
|
|
224793
|
+
browser2 = browserInfo ?? {};
|
|
224794
|
+
} else {
|
|
224795
|
+
browser2 = await defaultBrowser2();
|
|
224796
|
+
}
|
|
224797
|
+
if (browser2.id in ids) {
|
|
224798
|
+
const browserName = ids[browser2.id.toLowerCase()];
|
|
224799
|
+
if (app2 === "browserPrivate") {
|
|
224800
|
+
if (browserName === "safari") {
|
|
224801
|
+
throw new Error("Safari doesn't support opening in private mode via command line");
|
|
224802
|
+
}
|
|
224803
|
+
appArguments.push(flags[browserName]);
|
|
224804
|
+
}
|
|
224805
|
+
return baseOpen({
|
|
224806
|
+
...options,
|
|
224807
|
+
app: {
|
|
224808
|
+
name: apps[browserName],
|
|
224809
|
+
arguments: appArguments
|
|
224810
|
+
}
|
|
224811
|
+
});
|
|
224812
|
+
}
|
|
224813
|
+
throw new Error(`${browser2.name} is not supported as a default browser`);
|
|
224814
|
+
}
|
|
224815
|
+
let command;
|
|
224816
|
+
const cliArguments = [];
|
|
224817
|
+
const childProcessOptions = {};
|
|
224818
|
+
let shouldUseWindowsInWsl = false;
|
|
224819
|
+
if (is_wsl_default && !isInsideContainer() && !is_in_ssh_default && !app2) {
|
|
224820
|
+
shouldUseWindowsInWsl = await canAccessPowerShell();
|
|
224821
|
+
}
|
|
224822
|
+
if (platform3 === "darwin") {
|
|
224823
|
+
command = "open";
|
|
224824
|
+
if (options.wait) {
|
|
224825
|
+
cliArguments.push("--wait-apps");
|
|
224826
|
+
}
|
|
224827
|
+
if (options.background) {
|
|
224828
|
+
cliArguments.push("--background");
|
|
224829
|
+
}
|
|
224830
|
+
if (options.newInstance) {
|
|
224831
|
+
cliArguments.push("--new");
|
|
224832
|
+
}
|
|
224833
|
+
if (app2) {
|
|
224834
|
+
cliArguments.push("-a", app2);
|
|
224835
|
+
}
|
|
224836
|
+
} else if (platform3 === "win32" || shouldUseWindowsInWsl) {
|
|
224837
|
+
command = await powerShellPath3();
|
|
224838
|
+
cliArguments.push(...executePowerShell2.argumentsPrefix);
|
|
224839
|
+
if (!is_wsl_default) {
|
|
224840
|
+
childProcessOptions.windowsVerbatimArguments = true;
|
|
224841
|
+
}
|
|
224842
|
+
if (is_wsl_default && options.target) {
|
|
224843
|
+
options.target = await convertWslPathToWindows(options.target);
|
|
224844
|
+
}
|
|
224845
|
+
const encodedArguments = ["$ProgressPreference = 'SilentlyContinue';", "Start"];
|
|
224846
|
+
if (options.wait) {
|
|
224847
|
+
encodedArguments.push("-Wait");
|
|
224848
|
+
}
|
|
224849
|
+
if (app2) {
|
|
224850
|
+
encodedArguments.push(executePowerShell2.escapeArgument(app2));
|
|
224851
|
+
if (options.target) {
|
|
224852
|
+
appArguments.push(options.target);
|
|
224853
|
+
}
|
|
224854
|
+
} else if (options.target) {
|
|
224855
|
+
encodedArguments.push(executePowerShell2.escapeArgument(options.target));
|
|
224856
|
+
}
|
|
224857
|
+
if (appArguments.length > 0) {
|
|
224858
|
+
appArguments = appArguments.map((argument) => executePowerShell2.escapeArgument(argument));
|
|
224859
|
+
encodedArguments.push("-ArgumentList", appArguments.join(","));
|
|
224860
|
+
}
|
|
224861
|
+
options.target = executePowerShell2.encodeCommand(encodedArguments.join(" "));
|
|
224862
|
+
if (!options.wait) {
|
|
224863
|
+
childProcessOptions.stdio = "ignore";
|
|
224864
|
+
}
|
|
224865
|
+
} else {
|
|
224866
|
+
if (app2) {
|
|
224867
|
+
command = app2;
|
|
224868
|
+
} else {
|
|
224869
|
+
const isBundled = !__dirname4 || __dirname4 === "/";
|
|
224870
|
+
let exeLocalXdgOpen = false;
|
|
224871
|
+
try {
|
|
224872
|
+
await fs18.access(localXdgOpenPath, fsConstants2.X_OK);
|
|
224873
|
+
exeLocalXdgOpen = true;
|
|
224874
|
+
} catch {}
|
|
224875
|
+
const useSystemXdgOpen = process36.versions.electron ?? (platform3 === "android" || isBundled || !exeLocalXdgOpen);
|
|
224876
|
+
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
224877
|
+
}
|
|
224878
|
+
if (appArguments.length > 0) {
|
|
224879
|
+
cliArguments.push(...appArguments);
|
|
224880
|
+
}
|
|
224881
|
+
if (!options.wait) {
|
|
224882
|
+
childProcessOptions.stdio = "ignore";
|
|
224883
|
+
childProcessOptions.detached = true;
|
|
224884
|
+
}
|
|
224885
|
+
}
|
|
224886
|
+
if (platform3 === "darwin" && appArguments.length > 0) {
|
|
224887
|
+
cliArguments.push("--args", ...appArguments);
|
|
224888
|
+
}
|
|
224889
|
+
if (options.target) {
|
|
224890
|
+
cliArguments.push(options.target);
|
|
224891
|
+
}
|
|
224892
|
+
const subprocess = childProcess5.spawn(command, cliArguments, childProcessOptions);
|
|
224893
|
+
if (options.wait) {
|
|
224894
|
+
return new Promise((resolve4, reject2) => {
|
|
224895
|
+
subprocess.once("error", reject2);
|
|
224896
|
+
subprocess.once("close", (exitCode) => {
|
|
224897
|
+
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
224898
|
+
reject2(new Error(`Exited with code ${exitCode}`));
|
|
224899
|
+
return;
|
|
224900
|
+
}
|
|
224901
|
+
resolve4(subprocess);
|
|
224902
|
+
});
|
|
224903
|
+
});
|
|
224904
|
+
}
|
|
224905
|
+
if (isFallbackAttempt) {
|
|
224906
|
+
return new Promise((resolve4, reject2) => {
|
|
224907
|
+
subprocess.once("error", reject2);
|
|
224908
|
+
subprocess.once("spawn", () => {
|
|
224909
|
+
subprocess.once("close", (exitCode) => {
|
|
224910
|
+
subprocess.off("error", reject2);
|
|
224911
|
+
if (exitCode !== 0) {
|
|
224912
|
+
reject2(new Error(`Exited with code ${exitCode}`));
|
|
224913
|
+
return;
|
|
224914
|
+
}
|
|
224915
|
+
subprocess.unref();
|
|
224916
|
+
resolve4(subprocess);
|
|
224917
|
+
});
|
|
224918
|
+
});
|
|
224919
|
+
});
|
|
224920
|
+
}
|
|
224921
|
+
subprocess.unref();
|
|
224922
|
+
return new Promise((resolve4, reject2) => {
|
|
224923
|
+
subprocess.once("error", reject2);
|
|
224924
|
+
subprocess.once("spawn", () => {
|
|
224925
|
+
subprocess.off("error", reject2);
|
|
224926
|
+
resolve4(subprocess);
|
|
224927
|
+
});
|
|
224928
|
+
});
|
|
224929
|
+
}, open4 = (target, options) => {
|
|
224930
|
+
if (typeof target !== "string") {
|
|
224931
|
+
throw new TypeError("Expected a `target`");
|
|
224932
|
+
}
|
|
224933
|
+
return baseOpen({
|
|
224934
|
+
...options,
|
|
224935
|
+
target
|
|
224936
|
+
});
|
|
224937
|
+
}, openApp = (name, options) => {
|
|
224938
|
+
if (typeof name !== "string" && !Array.isArray(name)) {
|
|
224939
|
+
throw new TypeError("Expected a valid `name`");
|
|
224940
|
+
}
|
|
224941
|
+
const { arguments: appArguments = [] } = options ?? {};
|
|
224942
|
+
if (appArguments !== undefined && appArguments !== null && !Array.isArray(appArguments)) {
|
|
224943
|
+
throw new TypeError("Expected `appArguments` as Array type");
|
|
224944
|
+
}
|
|
224945
|
+
return baseOpen({
|
|
224946
|
+
...options,
|
|
224947
|
+
app: {
|
|
224948
|
+
name,
|
|
224949
|
+
arguments: appArguments
|
|
224950
|
+
}
|
|
224951
|
+
});
|
|
224952
|
+
}, apps, open_default;
|
|
224953
|
+
var init_open = __esm(() => {
|
|
224954
|
+
init_wsl_utils();
|
|
224955
|
+
init_powershell_utils2();
|
|
224956
|
+
init_default_browser();
|
|
224957
|
+
init_is_inside_container();
|
|
224958
|
+
init_is_in_ssh();
|
|
224959
|
+
fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
224960
|
+
__dirname4 = import.meta.url ? path17.dirname(fileURLToPath6(import.meta.url)) : "";
|
|
224961
|
+
localXdgOpenPath = path17.join(__dirname4, "xdg-open");
|
|
224962
|
+
({ platform: platform3, arch } = process36);
|
|
224963
|
+
apps = {
|
|
224964
|
+
browser: "browser",
|
|
224965
|
+
browserPrivate: "browserPrivate"
|
|
224966
|
+
};
|
|
224967
|
+
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
224968
|
+
darwin: "google chrome",
|
|
224969
|
+
win32: "chrome",
|
|
224970
|
+
linux: ["google-chrome", "google-chrome-stable", "chromium", "chromium-browser"]
|
|
224971
|
+
}, {
|
|
224972
|
+
wsl: {
|
|
224973
|
+
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
224974
|
+
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
|
224975
|
+
}
|
|
224976
|
+
}));
|
|
224977
|
+
defineLazyProperty(apps, "brave", () => detectPlatformBinary({
|
|
224978
|
+
darwin: "brave browser",
|
|
224979
|
+
win32: "brave",
|
|
224980
|
+
linux: ["brave-browser", "brave"]
|
|
224981
|
+
}, {
|
|
224982
|
+
wsl: {
|
|
224983
|
+
ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
|
|
224984
|
+
x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
|
|
224985
|
+
}
|
|
224986
|
+
}));
|
|
224987
|
+
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
|
224988
|
+
darwin: "firefox",
|
|
224989
|
+
win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
|
|
224990
|
+
linux: "firefox"
|
|
224991
|
+
}, {
|
|
224992
|
+
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
|
|
224993
|
+
}));
|
|
224994
|
+
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
224995
|
+
darwin: "microsoft edge",
|
|
224996
|
+
win32: "msedge",
|
|
224997
|
+
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
224998
|
+
}, {
|
|
224999
|
+
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
|
225000
|
+
}));
|
|
225001
|
+
defineLazyProperty(apps, "safari", () => detectPlatformBinary({
|
|
225002
|
+
darwin: "Safari"
|
|
225003
|
+
}));
|
|
225004
|
+
open_default = open4;
|
|
225005
|
+
});
|
|
225006
|
+
|
|
224423
225007
|
// src/config.ts
|
|
224424
225008
|
var exports_config = {};
|
|
224425
225009
|
__export(exports_config, {
|
|
@@ -256356,7 +256940,7 @@ function ToastProvider({ children: children2 }) {
|
|
|
256356
256940
|
|
|
256357
256941
|
// ../../packages/tui/src/components/command-menu/commands.tsx
|
|
256358
256942
|
init_clipboardy();
|
|
256359
|
-
import { execSync, exec as exec3 } from "child_process";
|
|
256943
|
+
import { execSync, exec as exec3, spawn as spawn5 } from "child_process";
|
|
256360
256944
|
import fs15 from "node:fs";
|
|
256361
256945
|
import os4 from "node:os";
|
|
256362
256946
|
import path15 from "node:path";
|
|
@@ -256529,17 +257113,22 @@ var COMMANDS = [
|
|
|
256529
257113
|
}
|
|
256530
257114
|
fs15.mkdirSync(decDir);
|
|
256531
257115
|
const agentsFile = path15.join(decDir, "AGENTS.md");
|
|
256532
|
-
const
|
|
256533
|
-
const
|
|
256534
|
-
const skillsDir = path15.join(decDir, "skills");
|
|
256535
|
-
const skillsReadme = path15.join(skillsDir, "README.md");
|
|
257116
|
+
const rulesFile = path15.join(decDir, "rules.md");
|
|
257117
|
+
const mcpFile = path15.join(decDir, "mcp.json");
|
|
256536
257118
|
fs15.writeFileSync(agentsFile, "");
|
|
256537
|
-
fs15.
|
|
256538
|
-
fs15.writeFileSync(rulesReadme, "# Rules\n\nDrop Markdown files here (e.g., `database.md` or `styling.md`) with specific instructions. December will automatically read these modular rules when working on related files.\n");
|
|
256539
|
-
fs15.mkdirSync(skillsDir);
|
|
256540
|
-
fs15.writeFileSync(skillsReadme, `# Skills
|
|
257119
|
+
fs15.writeFileSync(rulesFile, `# Rules
|
|
256541
257120
|
|
|
256542
|
-
Add
|
|
257121
|
+
Add project-specific rules here (e.g., database schema guidelines, or styling rules). December will automatically read these rules when working on your project.
|
|
257122
|
+
`);
|
|
257123
|
+
fs15.writeFileSync(mcpFile, `{
|
|
257124
|
+
"mcpServers": {
|
|
257125
|
+
// Add your Model Context Protocol (MCP) servers here
|
|
257126
|
+
// "example-server": {
|
|
257127
|
+
// "command": "node",
|
|
257128
|
+
// "args": ["path/to/server.js"]
|
|
257129
|
+
// }
|
|
257130
|
+
}
|
|
257131
|
+
}
|
|
256543
257132
|
`);
|
|
256544
257133
|
ctx.toast.show({
|
|
256545
257134
|
variant: "success",
|
|
@@ -256618,10 +257207,26 @@ Add executable scripts or custom tool definitions here. December will be able to
|
|
|
256618
257207
|
description: "Update to the latest version",
|
|
256619
257208
|
value: "/update",
|
|
256620
257209
|
action: (ctx) => {
|
|
256621
|
-
|
|
256622
|
-
|
|
257210
|
+
ctx.toast.show({ message: "Updating CLI... The app will automatically restart." });
|
|
257211
|
+
exec3("npm install -g @trydecember/cli", async (err) => {
|
|
257212
|
+
if (err) {
|
|
257213
|
+
ctx.toast.show({
|
|
257214
|
+
variant: "error",
|
|
257215
|
+
message: "Update failed. Check your npm logs."
|
|
257216
|
+
});
|
|
257217
|
+
return;
|
|
257218
|
+
}
|
|
257219
|
+
if (ctx.agent) {
|
|
257220
|
+
await ctx.agent.saveContext();
|
|
257221
|
+
}
|
|
257222
|
+
console.clear();
|
|
257223
|
+
const child = spawn5(process.argv[0], process.argv.slice(1), {
|
|
257224
|
+
stdio: "inherit",
|
|
257225
|
+
detached: true
|
|
257226
|
+
});
|
|
257227
|
+
child.unref();
|
|
257228
|
+
ctx.exit();
|
|
256623
257229
|
});
|
|
256624
|
-
ctx.toast.show({ message: "Updating CLI in the background. Please restart soon." });
|
|
256625
257230
|
}
|
|
256626
257231
|
},
|
|
256627
257232
|
{
|
|
@@ -257183,7 +257788,8 @@ function InputBar({
|
|
|
257183
257788
|
customInputMode = false,
|
|
257184
257789
|
onInterrupt,
|
|
257185
257790
|
onCopy,
|
|
257186
|
-
contextTokens
|
|
257791
|
+
contextTokens,
|
|
257792
|
+
showExitConfirm = false
|
|
257187
257793
|
}) {
|
|
257188
257794
|
const [value, setValue] = import_react41.useState("");
|
|
257189
257795
|
const toast = useToast();
|
|
@@ -257248,13 +257854,7 @@ function InputBar({
|
|
|
257248
257854
|
return;
|
|
257249
257855
|
setValue("");
|
|
257250
257856
|
handleContentChange("");
|
|
257251
|
-
if (command.value === "/plan" || command.value === "/grill-me") {
|
|
257252
|
-
const next2 = command.value + " ";
|
|
257253
|
-
setValue(next2);
|
|
257254
|
-
handleContentChange(next2);
|
|
257255
|
-
return;
|
|
257256
|
-
}
|
|
257257
|
-
if (command.value === "/login" || command.value === "/logout" || command.value === "/exit" || command.value === "/model" || command.value === "/resume" || command.value === "/settings" || command.value === "/context" || command.value === "/tasks" || command.value === "/usage") {
|
|
257857
|
+
if (command.value === "/plan" || command.value === "/grill-me" || command.value === "/login" || command.value === "/logout" || command.value === "/exit" || command.value === "/model" || command.value === "/resume" || command.value === "/settings" || command.value === "/context" || command.value === "/tasks" || command.value === "/usage") {
|
|
257258
257858
|
onSubmit(command.value);
|
|
257259
257859
|
return;
|
|
257260
257860
|
}
|
|
@@ -257369,7 +257969,10 @@ function InputBar({
|
|
|
257369
257969
|
hasBothAuth && authMethod ? ` (via ${authMethod === "december" ? "December Cloud" : "BYOK"})` : ""
|
|
257370
257970
|
]
|
|
257371
257971
|
}, undefined, true, undefined, this),
|
|
257372
|
-
|
|
257972
|
+
showExitConfirm ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text3, {
|
|
257973
|
+
color: "gray",
|
|
257974
|
+
children: "· Press Ctrl+C again to exit"
|
|
257975
|
+
}, undefined, false, undefined, this) : contextTokens !== undefined && contextTokens > 0 && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text3, {
|
|
257373
257976
|
color: "#AAAAAA",
|
|
257374
257977
|
children: [
|
|
257375
257978
|
"· ",
|
|
@@ -259737,11 +260340,8 @@ function ErrorMessage({ message }) {
|
|
|
259737
260340
|
paddingY: 1,
|
|
259738
260341
|
children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text3, {
|
|
259739
260342
|
color: "#FCA5A5",
|
|
259740
|
-
children:
|
|
259741
|
-
|
|
259742
|
-
message
|
|
259743
|
-
]
|
|
259744
|
-
}, undefined, true, undefined, this)
|
|
260343
|
+
children: message
|
|
260344
|
+
}, undefined, false, undefined, this)
|
|
259745
260345
|
}, undefined, false, undefined, this);
|
|
259746
260346
|
}
|
|
259747
260347
|
|
|
@@ -260277,156 +260877,171 @@ function ContextSelectMenu(props) {
|
|
|
260277
260877
|
}, i3, false, undefined, this));
|
|
260278
260878
|
}
|
|
260279
260879
|
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260280
|
-
flexDirection: "
|
|
260880
|
+
flexDirection: "column",
|
|
260281
260881
|
paddingX: 1,
|
|
260282
|
-
gap: 4,
|
|
260283
260882
|
children: [
|
|
260284
260883
|
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260285
|
-
|
|
260286
|
-
children:
|
|
260884
|
+
marginBottom: 1,
|
|
260885
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260886
|
+
bold: true,
|
|
260887
|
+
color: "white",
|
|
260888
|
+
children: "Context"
|
|
260889
|
+
}, undefined, false, undefined, this)
|
|
260287
260890
|
}, undefined, false, undefined, this),
|
|
260288
260891
|
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260289
|
-
flexDirection: "
|
|
260892
|
+
flexDirection: "row",
|
|
260893
|
+
gap: 4,
|
|
260290
260894
|
children: [
|
|
260291
260895
|
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260292
|
-
|
|
260293
|
-
children:
|
|
260294
|
-
color: "#AAAAAA",
|
|
260295
|
-
children: [
|
|
260296
|
-
currentModelName,
|
|
260297
|
-
" · ",
|
|
260298
|
-
formatK(totalTokens),
|
|
260299
|
-
"/",
|
|
260300
|
-
formatK(maxTokens),
|
|
260301
|
-
" tokens (",
|
|
260302
|
-
pct(totalTokens),
|
|
260303
|
-
"%)"
|
|
260304
|
-
]
|
|
260305
|
-
}, undefined, true, undefined, this)
|
|
260306
|
-
}, undefined, false, undefined, this),
|
|
260307
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260308
|
-
marginTop: 1,
|
|
260309
|
-
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260310
|
-
color: "white",
|
|
260311
|
-
children: "Token usage by category"
|
|
260312
|
-
}, undefined, false, undefined, this)
|
|
260896
|
+
flexDirection: "column",
|
|
260897
|
+
children: gridRows
|
|
260313
260898
|
}, undefined, false, undefined, this),
|
|
260314
260899
|
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260315
260900
|
flexDirection: "column",
|
|
260316
260901
|
children: [
|
|
260317
260902
|
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260318
260903
|
gap: 1,
|
|
260904
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260905
|
+
color: "#AAAAAA",
|
|
260906
|
+
children: [
|
|
260907
|
+
currentModelName,
|
|
260908
|
+
" · ",
|
|
260909
|
+
formatK(totalTokens),
|
|
260910
|
+
"/",
|
|
260911
|
+
formatK(maxTokens),
|
|
260912
|
+
" tokens (",
|
|
260913
|
+
pct(totalTokens),
|
|
260914
|
+
"%)"
|
|
260915
|
+
]
|
|
260916
|
+
}, undefined, true, undefined, this)
|
|
260917
|
+
}, undefined, false, undefined, this),
|
|
260918
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260919
|
+
marginTop: 1,
|
|
260920
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260921
|
+
color: "white",
|
|
260922
|
+
children: "Token usage by category"
|
|
260923
|
+
}, undefined, false, undefined, this)
|
|
260924
|
+
}, undefined, false, undefined, this),
|
|
260925
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260926
|
+
flexDirection: "column",
|
|
260319
260927
|
children: [
|
|
260320
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(
|
|
260321
|
-
|
|
260322
|
-
children: "●"
|
|
260323
|
-
}, undefined, false, undefined, this),
|
|
260324
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260325
|
-
color: "#AAAAAA",
|
|
260928
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260929
|
+
gap: 1,
|
|
260326
260930
|
children: [
|
|
260327
|
-
|
|
260328
|
-
|
|
260329
|
-
|
|
260330
|
-
|
|
260331
|
-
|
|
260931
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260932
|
+
color: "#89B4F8",
|
|
260933
|
+
children: "●"
|
|
260934
|
+
}, undefined, false, undefined, this),
|
|
260935
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260936
|
+
color: "#AAAAAA",
|
|
260937
|
+
children: [
|
|
260938
|
+
"User messages: ",
|
|
260939
|
+
formatK(userTokens),
|
|
260940
|
+
" tokens (",
|
|
260941
|
+
pct(userTokens),
|
|
260942
|
+
"%)"
|
|
260943
|
+
]
|
|
260944
|
+
}, undefined, true, undefined, this)
|
|
260332
260945
|
]
|
|
260333
|
-
}, undefined, true, undefined, this)
|
|
260334
|
-
|
|
260335
|
-
|
|
260336
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260337
|
-
gap: 1,
|
|
260338
|
-
children: [
|
|
260339
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260340
|
-
color: "#6EE7B7",
|
|
260341
|
-
children: "●"
|
|
260342
|
-
}, undefined, false, undefined, this),
|
|
260343
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260344
|
-
color: "#AAAAAA",
|
|
260946
|
+
}, undefined, true, undefined, this),
|
|
260947
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260948
|
+
gap: 1,
|
|
260345
260949
|
children: [
|
|
260346
|
-
|
|
260347
|
-
|
|
260348
|
-
|
|
260349
|
-
|
|
260350
|
-
|
|
260950
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260951
|
+
color: "#6EE7B7",
|
|
260952
|
+
children: "●"
|
|
260953
|
+
}, undefined, false, undefined, this),
|
|
260954
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260955
|
+
color: "#AAAAAA",
|
|
260956
|
+
children: [
|
|
260957
|
+
"Agent responses: ",
|
|
260958
|
+
formatK(agentTokens),
|
|
260959
|
+
" tokens (",
|
|
260960
|
+
pct(agentTokens),
|
|
260961
|
+
"%)"
|
|
260962
|
+
]
|
|
260963
|
+
}, undefined, true, undefined, this)
|
|
260351
260964
|
]
|
|
260352
|
-
}, undefined, true, undefined, this)
|
|
260353
|
-
|
|
260354
|
-
|
|
260355
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260356
|
-
gap: 1,
|
|
260357
|
-
children: [
|
|
260358
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260359
|
-
color: "#FCD34D",
|
|
260360
|
-
children: "●"
|
|
260361
|
-
}, undefined, false, undefined, this),
|
|
260362
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260363
|
-
color: "#AAAAAA",
|
|
260965
|
+
}, undefined, true, undefined, this),
|
|
260966
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260967
|
+
gap: 1,
|
|
260364
260968
|
children: [
|
|
260365
|
-
|
|
260366
|
-
|
|
260367
|
-
|
|
260368
|
-
|
|
260369
|
-
|
|
260969
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260970
|
+
color: "#FCD34D",
|
|
260971
|
+
children: "●"
|
|
260972
|
+
}, undefined, false, undefined, this),
|
|
260973
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260974
|
+
color: "#AAAAAA",
|
|
260975
|
+
children: [
|
|
260976
|
+
"Tool calls: ",
|
|
260977
|
+
formatK(toolTokens),
|
|
260978
|
+
" tokens (",
|
|
260979
|
+
pct(toolTokens),
|
|
260980
|
+
"%)"
|
|
260981
|
+
]
|
|
260982
|
+
}, undefined, true, undefined, this)
|
|
260370
260983
|
]
|
|
260371
|
-
}, undefined, true, undefined, this)
|
|
260372
|
-
|
|
260373
|
-
|
|
260374
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260375
|
-
gap: 1,
|
|
260376
|
-
children: [
|
|
260377
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260378
|
-
color: "#AAAAAA",
|
|
260379
|
-
children: "●"
|
|
260380
|
-
}, undefined, false, undefined, this),
|
|
260381
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260382
|
-
color: "#AAAAAA",
|
|
260984
|
+
}, undefined, true, undefined, this),
|
|
260985
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260986
|
+
gap: 1,
|
|
260383
260987
|
children: [
|
|
260384
|
-
|
|
260385
|
-
|
|
260386
|
-
|
|
260387
|
-
|
|
260388
|
-
|
|
260988
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260989
|
+
color: "#AAAAAA",
|
|
260990
|
+
children: "●"
|
|
260991
|
+
}, undefined, false, undefined, this),
|
|
260992
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260993
|
+
color: "#AAAAAA",
|
|
260994
|
+
children: [
|
|
260995
|
+
"System prompt: ",
|
|
260996
|
+
formatK(sysTokens),
|
|
260997
|
+
" tokens (",
|
|
260998
|
+
pct(sysTokens),
|
|
260999
|
+
"%)"
|
|
261000
|
+
]
|
|
261001
|
+
}, undefined, true, undefined, this)
|
|
260389
261002
|
]
|
|
260390
|
-
}, undefined, true, undefined, this)
|
|
260391
|
-
|
|
260392
|
-
|
|
260393
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260394
|
-
gap: 1,
|
|
260395
|
-
children: [
|
|
260396
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260397
|
-
color: "#444444",
|
|
260398
|
-
children: "□"
|
|
260399
|
-
}, undefined, false, undefined, this),
|
|
260400
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260401
|
-
color: "#AAAAAA",
|
|
261003
|
+
}, undefined, true, undefined, this),
|
|
261004
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
261005
|
+
gap: 1,
|
|
260402
261006
|
children: [
|
|
260403
|
-
|
|
260404
|
-
|
|
260405
|
-
|
|
260406
|
-
|
|
260407
|
-
|
|
261007
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
261008
|
+
color: "#444444",
|
|
261009
|
+
children: "□"
|
|
261010
|
+
}, undefined, false, undefined, this),
|
|
261011
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
261012
|
+
color: "#AAAAAA",
|
|
261013
|
+
children: [
|
|
261014
|
+
"Free space: ",
|
|
261015
|
+
formatK(freeTokens),
|
|
261016
|
+
" (",
|
|
261017
|
+
pct(freeTokens),
|
|
261018
|
+
"%)"
|
|
261019
|
+
]
|
|
261020
|
+
}, undefined, true, undefined, this)
|
|
260408
261021
|
]
|
|
260409
261022
|
}, undefined, true, undefined, this)
|
|
260410
261023
|
]
|
|
260411
261024
|
}, undefined, true, undefined, this)
|
|
260412
261025
|
]
|
|
260413
|
-
}, undefined, true, undefined, this),
|
|
260414
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
260415
|
-
marginTop: 2,
|
|
260416
|
-
gap: 1,
|
|
260417
|
-
children: [
|
|
260418
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260419
|
-
color: "#89B4F8",
|
|
260420
|
-
children: "esc"
|
|
260421
|
-
}, undefined, false, undefined, this),
|
|
260422
|
-
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
260423
|
-
color: "#AAAAAA",
|
|
260424
|
-
children: "Cancel"
|
|
260425
|
-
}, undefined, false, undefined, this)
|
|
260426
|
-
]
|
|
260427
261026
|
}, undefined, true, undefined, this)
|
|
260428
261027
|
]
|
|
260429
|
-
}, undefined, true, undefined, this)
|
|
261028
|
+
}, undefined, true, undefined, this),
|
|
261029
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
261030
|
+
paddingTop: 1,
|
|
261031
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
261032
|
+
gap: 1,
|
|
261033
|
+
children: [
|
|
261034
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
261035
|
+
color: "#89B4F8",
|
|
261036
|
+
children: "esc"
|
|
261037
|
+
}, undefined, false, undefined, this),
|
|
261038
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
261039
|
+
color: "#AAAAAA",
|
|
261040
|
+
children: "Cancel"
|
|
261041
|
+
}, undefined, false, undefined, this)
|
|
261042
|
+
]
|
|
261043
|
+
}, undefined, true, undefined, this)
|
|
261044
|
+
}, undefined, false, undefined, this)
|
|
260430
261045
|
]
|
|
260431
261046
|
}, undefined, true, undefined, this);
|
|
260432
261047
|
}
|
|
@@ -261089,7 +261704,8 @@ function SessionSelectMenu(props) {
|
|
|
261089
261704
|
]
|
|
261090
261705
|
}, session.id, true, undefined, this);
|
|
261091
261706
|
}
|
|
261092
|
-
const
|
|
261707
|
+
const isCustomName = !session.id.startsWith("session-");
|
|
261708
|
+
const title = isCustomName ? session.id : session.preview || session.id;
|
|
261093
261709
|
const timeStr = timeAgo(session.updatedAt).padStart(10);
|
|
261094
261710
|
return /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
261095
261711
|
flexDirection: "row",
|
|
@@ -261232,10 +261848,6 @@ function SettingsMainMenu(props) {
|
|
|
261232
261848
|
settingsShowTasks,
|
|
261233
261849
|
settingsShowTips,
|
|
261234
261850
|
settingsToolPermission,
|
|
261235
|
-
settingsCompactMode,
|
|
261236
|
-
settingsSoundEffects,
|
|
261237
|
-
settingsAutoScroll,
|
|
261238
|
-
settingsStreamSpeed,
|
|
261239
261851
|
settingsAutoUpdate,
|
|
261240
261852
|
settingsThinkingLevel,
|
|
261241
261853
|
settingsSteeringMode,
|
|
@@ -261265,22 +261877,6 @@ function SettingsMainMenu(props) {
|
|
|
261265
261877
|
label: `Tool Permission [${settingsToolPermission}]`,
|
|
261266
261878
|
value: "toolPermission"
|
|
261267
261879
|
},
|
|
261268
|
-
{
|
|
261269
|
-
label: `Compact Mode [${settingsCompactMode ? "on" : "off"}]`,
|
|
261270
|
-
value: "compactMode"
|
|
261271
|
-
},
|
|
261272
|
-
{
|
|
261273
|
-
label: `Sound Effects [${settingsSoundEffects ? "on" : "off"}]`,
|
|
261274
|
-
value: "soundEffects"
|
|
261275
|
-
},
|
|
261276
|
-
{
|
|
261277
|
-
label: `Auto Scroll [${settingsAutoScroll ? "on" : "off"}]`,
|
|
261278
|
-
value: "autoScroll"
|
|
261279
|
-
},
|
|
261280
|
-
{
|
|
261281
|
-
label: `Stream Speed [${settingsStreamSpeed}]`,
|
|
261282
|
-
value: "streamSpeed"
|
|
261283
|
-
},
|
|
261284
261880
|
{
|
|
261285
261881
|
label: `Auto Update [${settingsAutoUpdate ? "on" : "off"}]`,
|
|
261286
261882
|
value: "autoUpdate"
|
|
@@ -261656,270 +262252,60 @@ function ToolPermissionMenu({ questions, onComplete }) {
|
|
|
261656
262252
|
}, undefined, true, undefined, this);
|
|
261657
262253
|
}
|
|
261658
262254
|
|
|
261659
|
-
// ../../packages/tui/src/components/menus/usage-menu.tsx
|
|
261660
|
-
var jsx_dev_runtime34 = __toESM(require_jsx_dev_runtime(), 1);
|
|
261661
|
-
function UsageMenu(props) {
|
|
261662
|
-
return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261663
|
-
flexDirection: "column",
|
|
261664
|
-
paddingX: 1,
|
|
261665
|
-
children: [
|
|
261666
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261667
|
-
marginBottom: 1,
|
|
261668
|
-
children: /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261669
|
-
bold: true,
|
|
261670
|
-
color: "white",
|
|
261671
|
-
children: "Usage"
|
|
261672
|
-
}, undefined, false, undefined, this)
|
|
261673
|
-
}, undefined, false, undefined, this),
|
|
261674
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261675
|
-
flexDirection: "column",
|
|
261676
|
-
marginBottom: 1,
|
|
261677
|
-
children: [
|
|
261678
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261679
|
-
color: "#89B4F8",
|
|
261680
|
-
bold: true,
|
|
261681
|
-
children: "Current Session (december)"
|
|
261682
|
-
}, undefined, false, undefined, this),
|
|
261683
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261684
|
-
gap: 2,
|
|
261685
|
-
children: [
|
|
261686
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261687
|
-
color: "#AAAAAA",
|
|
261688
|
-
children: [
|
|
261689
|
-
"Tokens: ",
|
|
261690
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261691
|
-
color: "white",
|
|
261692
|
-
children: "14,250"
|
|
261693
|
-
}, undefined, false, undefined, this)
|
|
261694
|
-
]
|
|
261695
|
-
}, undefined, true, undefined, this),
|
|
261696
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261697
|
-
color: "#AAAAAA",
|
|
261698
|
-
children: [
|
|
261699
|
-
"Requests: ",
|
|
261700
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261701
|
-
color: "white",
|
|
261702
|
-
children: "42"
|
|
261703
|
-
}, undefined, false, undefined, this)
|
|
261704
|
-
]
|
|
261705
|
-
}, undefined, true, undefined, this),
|
|
261706
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261707
|
-
color: "#AAAAAA",
|
|
261708
|
-
children: [
|
|
261709
|
-
"Cost: ",
|
|
261710
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261711
|
-
color: "#6EE7B7",
|
|
261712
|
-
children: "$0.15"
|
|
261713
|
-
}, undefined, false, undefined, this)
|
|
261714
|
-
]
|
|
261715
|
-
}, undefined, true, undefined, this)
|
|
261716
|
-
]
|
|
261717
|
-
}, undefined, true, undefined, this)
|
|
261718
|
-
]
|
|
261719
|
-
}, undefined, true, undefined, this),
|
|
261720
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261721
|
-
flexDirection: "column",
|
|
261722
|
-
marginBottom: 1,
|
|
261723
|
-
children: [
|
|
261724
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261725
|
-
color: "#89B4F8",
|
|
261726
|
-
bold: true,
|
|
261727
|
-
children: "Overall (This Month)"
|
|
261728
|
-
}, undefined, false, undefined, this),
|
|
261729
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261730
|
-
gap: 2,
|
|
261731
|
-
children: [
|
|
261732
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261733
|
-
color: "#AAAAAA",
|
|
261734
|
-
children: [
|
|
261735
|
-
"Tokens: ",
|
|
261736
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261737
|
-
color: "white",
|
|
261738
|
-
children: "1,024,500"
|
|
261739
|
-
}, undefined, false, undefined, this)
|
|
261740
|
-
]
|
|
261741
|
-
}, undefined, true, undefined, this),
|
|
261742
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261743
|
-
color: "#AAAAAA",
|
|
261744
|
-
children: [
|
|
261745
|
-
"Requests: ",
|
|
261746
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261747
|
-
color: "white",
|
|
261748
|
-
children: "1,240"
|
|
261749
|
-
}, undefined, false, undefined, this)
|
|
261750
|
-
]
|
|
261751
|
-
}, undefined, true, undefined, this),
|
|
261752
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261753
|
-
color: "#AAAAAA",
|
|
261754
|
-
children: [
|
|
261755
|
-
"Cost: ",
|
|
261756
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261757
|
-
color: "#6EE7B7",
|
|
261758
|
-
children: "$12.45"
|
|
261759
|
-
}, undefined, false, undefined, this)
|
|
261760
|
-
]
|
|
261761
|
-
}, undefined, true, undefined, this)
|
|
261762
|
-
]
|
|
261763
|
-
}, undefined, true, undefined, this)
|
|
261764
|
-
]
|
|
261765
|
-
}, undefined, true, undefined, this),
|
|
261766
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261767
|
-
flexDirection: "column",
|
|
261768
|
-
marginBottom: 1,
|
|
261769
|
-
children: [
|
|
261770
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261771
|
-
color: "#89B4F8",
|
|
261772
|
-
bold: true,
|
|
261773
|
-
children: "By Model (Month)"
|
|
261774
|
-
}, undefined, false, undefined, this),
|
|
261775
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261776
|
-
children: [
|
|
261777
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261778
|
-
width: 20,
|
|
261779
|
-
children: /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261780
|
-
color: "white",
|
|
261781
|
-
children: "gemini-2.5-flash"
|
|
261782
|
-
}, undefined, false, undefined, this)
|
|
261783
|
-
}, undefined, false, undefined, this),
|
|
261784
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261785
|
-
width: 15,
|
|
261786
|
-
children: /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261787
|
-
color: "#AAAAAA",
|
|
261788
|
-
children: "850k tokens"
|
|
261789
|
-
}, undefined, false, undefined, this)
|
|
261790
|
-
}, undefined, false, undefined, this),
|
|
261791
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261792
|
-
children: /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261793
|
-
color: "#6EE7B7",
|
|
261794
|
-
children: "$8.50"
|
|
261795
|
-
}, undefined, false, undefined, this)
|
|
261796
|
-
}, undefined, false, undefined, this)
|
|
261797
|
-
]
|
|
261798
|
-
}, undefined, true, undefined, this),
|
|
261799
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261800
|
-
children: [
|
|
261801
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261802
|
-
width: 20,
|
|
261803
|
-
children: /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261804
|
-
color: "white",
|
|
261805
|
-
children: "claude-3.5-sonnet"
|
|
261806
|
-
}, undefined, false, undefined, this)
|
|
261807
|
-
}, undefined, false, undefined, this),
|
|
261808
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261809
|
-
width: 15,
|
|
261810
|
-
children: /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261811
|
-
color: "#AAAAAA",
|
|
261812
|
-
children: "150k tokens"
|
|
261813
|
-
}, undefined, false, undefined, this)
|
|
261814
|
-
}, undefined, false, undefined, this),
|
|
261815
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261816
|
-
children: /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261817
|
-
color: "#6EE7B7",
|
|
261818
|
-
children: "$3.45"
|
|
261819
|
-
}, undefined, false, undefined, this)
|
|
261820
|
-
}, undefined, false, undefined, this)
|
|
261821
|
-
]
|
|
261822
|
-
}, undefined, true, undefined, this),
|
|
261823
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261824
|
-
children: [
|
|
261825
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261826
|
-
width: 20,
|
|
261827
|
-
children: /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261828
|
-
color: "white",
|
|
261829
|
-
children: "gpt-4o"
|
|
261830
|
-
}, undefined, false, undefined, this)
|
|
261831
|
-
}, undefined, false, undefined, this),
|
|
261832
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261833
|
-
width: 15,
|
|
261834
|
-
children: /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261835
|
-
color: "#AAAAAA",
|
|
261836
|
-
children: "24.5k tokens"
|
|
261837
|
-
}, undefined, false, undefined, this)
|
|
261838
|
-
}, undefined, false, undefined, this),
|
|
261839
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261840
|
-
children: /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261841
|
-
color: "#6EE7B7",
|
|
261842
|
-
children: "$0.50"
|
|
261843
|
-
}, undefined, false, undefined, this)
|
|
261844
|
-
}, undefined, false, undefined, this)
|
|
261845
|
-
]
|
|
261846
|
-
}, undefined, true, undefined, this)
|
|
261847
|
-
]
|
|
261848
|
-
}, undefined, true, undefined, this),
|
|
261849
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261850
|
-
paddingTop: 1,
|
|
261851
|
-
children: /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
261852
|
-
gap: 1,
|
|
261853
|
-
children: [
|
|
261854
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261855
|
-
color: "#89B4F8",
|
|
261856
|
-
children: "esc"
|
|
261857
|
-
}, undefined, false, undefined, this),
|
|
261858
|
-
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text3, {
|
|
261859
|
-
color: "#AAAAAA",
|
|
261860
|
-
children: "Cancel"
|
|
261861
|
-
}, undefined, false, undefined, this)
|
|
261862
|
-
]
|
|
261863
|
-
}, undefined, true, undefined, this)
|
|
261864
|
-
}, undefined, false, undefined, this)
|
|
261865
|
-
]
|
|
261866
|
-
}, undefined, true, undefined, this);
|
|
261867
|
-
}
|
|
261868
|
-
|
|
261869
262255
|
// ../../packages/tui/src/components/menus/auth-menus.tsx
|
|
261870
|
-
var
|
|
262256
|
+
var jsx_dev_runtime34 = __toESM(require_jsx_dev_runtime(), 1);
|
|
261871
262257
|
function AuthMenus(props) {
|
|
261872
262258
|
switch (props.authMode) {
|
|
261873
262259
|
case "menu":
|
|
261874
|
-
return /* @__PURE__ */
|
|
262260
|
+
return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(MenuMenu, {
|
|
261875
262261
|
...props
|
|
261876
262262
|
}, undefined, false, undefined, this);
|
|
261877
262263
|
case "december_login_select":
|
|
261878
|
-
return /* @__PURE__ */
|
|
262264
|
+
return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(DecemberLoginSelectMenu, {
|
|
261879
262265
|
...props
|
|
261880
262266
|
}, undefined, false, undefined, this);
|
|
261881
262267
|
case "byok_provider":
|
|
261882
|
-
return /* @__PURE__ */
|
|
262268
|
+
return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(ByokProviderMenu, {
|
|
261883
262269
|
...props
|
|
261884
262270
|
}, undefined, false, undefined, this);
|
|
261885
262271
|
case "byok_key":
|
|
261886
|
-
return /* @__PURE__ */
|
|
262272
|
+
return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(ByokKeyMenu, {
|
|
261887
262273
|
...props
|
|
261888
262274
|
}, undefined, false, undefined, this);
|
|
261889
262275
|
case "model_select":
|
|
261890
|
-
return /* @__PURE__ */
|
|
262276
|
+
return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(ModelSelectMenu, {
|
|
261891
262277
|
...props
|
|
261892
262278
|
}, undefined, false, undefined, this);
|
|
261893
262279
|
case "context_select":
|
|
261894
|
-
return /* @__PURE__ */
|
|
262280
|
+
return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(ContextSelectMenu, {
|
|
261895
262281
|
...props
|
|
261896
262282
|
}, undefined, false, undefined, this);
|
|
261897
262283
|
case "logout_select":
|
|
261898
|
-
return /* @__PURE__ */
|
|
262284
|
+
return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(LogoutSelectMenu, {
|
|
261899
262285
|
...props
|
|
261900
262286
|
}, undefined, false, undefined, this);
|
|
261901
262287
|
case "session_select":
|
|
261902
|
-
return /* @__PURE__ */
|
|
262288
|
+
return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(SessionSelectMenu, {
|
|
261903
262289
|
...props
|
|
261904
262290
|
}, undefined, false, undefined, this);
|
|
261905
262291
|
case "tasks_mode":
|
|
261906
|
-
return /* @__PURE__ */
|
|
262292
|
+
return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(TasksModeMenu, {
|
|
261907
262293
|
...props
|
|
261908
262294
|
}, undefined, false, undefined, this);
|
|
261909
262295
|
case "plan_approve":
|
|
261910
|
-
return /* @__PURE__ */
|
|
262296
|
+
return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(PlanApproveMenu, {
|
|
261911
262297
|
...props
|
|
261912
262298
|
}, undefined, false, undefined, this);
|
|
261913
262299
|
case "grill_question":
|
|
261914
|
-
return /* @__PURE__ */
|
|
262300
|
+
return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(GrillQuestionMenu, {
|
|
261915
262301
|
...props
|
|
261916
262302
|
}, undefined, false, undefined, this);
|
|
261917
262303
|
case "settings_main":
|
|
261918
|
-
return /* @__PURE__ */
|
|
262304
|
+
return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(SettingsMainMenu, {
|
|
261919
262305
|
...props
|
|
261920
262306
|
}, undefined, false, undefined, this);
|
|
261921
262307
|
case "tool_permission":
|
|
261922
|
-
return /* @__PURE__ */
|
|
262308
|
+
return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(ToolPermissionMenu, {
|
|
261923
262309
|
questions: props.pendingQuestions?.questions || [],
|
|
261924
262310
|
onComplete: (answer) => {
|
|
261925
262311
|
props.pendingQuestions?.resolve(answer);
|
|
@@ -261927,17 +262313,13 @@ function AuthMenus(props) {
|
|
|
261927
262313
|
props.setPendingQuestions(null);
|
|
261928
262314
|
}
|
|
261929
262315
|
}, undefined, false, undefined, this);
|
|
261930
|
-
case "usage":
|
|
261931
|
-
return /* @__PURE__ */ jsx_dev_runtime35.jsxDEV(UsageMenu, {
|
|
261932
|
-
...props
|
|
261933
|
-
}, undefined, false, undefined, this);
|
|
261934
262316
|
default:
|
|
261935
262317
|
return null;
|
|
261936
262318
|
}
|
|
261937
262319
|
}
|
|
261938
262320
|
// ../../packages/tui/src/components/menus/ask-question-menu.tsx
|
|
261939
262321
|
var import_react49 = __toESM(require_react(), 1);
|
|
261940
|
-
var
|
|
262322
|
+
var jsx_dev_runtime35 = __toESM(require_jsx_dev_runtime(), 1);
|
|
261941
262323
|
function AskQuestionMenu({ questions, onComplete }) {
|
|
261942
262324
|
const [currentQuestionIdx, setCurrentQuestionIdx] = import_react49.useState(0);
|
|
261943
262325
|
const [answers, setAnswers] = import_react49.useState([]);
|
|
@@ -261954,29 +262336,29 @@ function AskQuestionMenu({ questions, onComplete }) {
|
|
|
261954
262336
|
onComplete(newAnswers.length === 1 ? newAnswers[0] : newAnswers);
|
|
261955
262337
|
}
|
|
261956
262338
|
};
|
|
261957
|
-
return /* @__PURE__ */
|
|
262339
|
+
return /* @__PURE__ */ jsx_dev_runtime35.jsxDEV(Box_default, {
|
|
261958
262340
|
flexDirection: "column",
|
|
261959
262341
|
gap: 1,
|
|
261960
262342
|
children: [
|
|
261961
|
-
/* @__PURE__ */
|
|
262343
|
+
/* @__PURE__ */ jsx_dev_runtime35.jsxDEV(Box_default, {
|
|
261962
262344
|
flexDirection: "row",
|
|
261963
262345
|
gap: 1,
|
|
261964
262346
|
children: [
|
|
261965
|
-
/* @__PURE__ */
|
|
262347
|
+
/* @__PURE__ */ jsx_dev_runtime35.jsxDEV(Text3, {
|
|
261966
262348
|
color: "cyan",
|
|
261967
262349
|
bold: true,
|
|
261968
262350
|
children: `Q${currentQuestionIdx + 1}/${questions.length}:`
|
|
261969
262351
|
}, undefined, false, undefined, this),
|
|
261970
|
-
/* @__PURE__ */
|
|
262352
|
+
/* @__PURE__ */ jsx_dev_runtime35.jsxDEV(Text3, {
|
|
261971
262353
|
color: "white",
|
|
261972
262354
|
bold: true,
|
|
261973
262355
|
children: currentQ.question
|
|
261974
262356
|
}, undefined, false, undefined, this)
|
|
261975
262357
|
]
|
|
261976
262358
|
}, undefined, true, undefined, this),
|
|
261977
|
-
/* @__PURE__ */
|
|
262359
|
+
/* @__PURE__ */ jsx_dev_runtime35.jsxDEV(Box_default, {
|
|
261978
262360
|
paddingLeft: 2,
|
|
261979
|
-
children: /* @__PURE__ */
|
|
262361
|
+
children: /* @__PURE__ */ jsx_dev_runtime35.jsxDEV(SelectInput_default, {
|
|
261980
262362
|
items,
|
|
261981
262363
|
onSelect: handleSelect
|
|
261982
262364
|
}, undefined, false, undefined, this)
|
|
@@ -261988,7 +262370,7 @@ function AskQuestionMenu({ questions, onComplete }) {
|
|
|
261988
262370
|
import fs16 from "fs";
|
|
261989
262371
|
import path16 from "path";
|
|
261990
262372
|
var import_react50 = __toESM(require_react(), 1);
|
|
261991
|
-
var
|
|
262373
|
+
var jsx_dev_runtime36 = __toESM(require_jsx_dev_runtime(), 1);
|
|
261992
262374
|
function TaskHUD({ cwd: cwd2 }) {
|
|
261993
262375
|
const [taskLines, setTaskLines] = import_react50.useState([]);
|
|
261994
262376
|
import_react50.useEffect(() => {
|
|
@@ -262011,7 +262393,7 @@ function TaskHUD({ cwd: cwd2 }) {
|
|
|
262011
262393
|
}, [cwd2]);
|
|
262012
262394
|
if (taskLines.length === 0)
|
|
262013
262395
|
return null;
|
|
262014
|
-
return /* @__PURE__ */
|
|
262396
|
+
return /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
|
|
262015
262397
|
position: "absolute",
|
|
262016
262398
|
top: 1,
|
|
262017
262399
|
right: 2,
|
|
@@ -262021,7 +262403,7 @@ function TaskHUD({ cwd: cwd2 }) {
|
|
|
262021
262403
|
paddingX: 1,
|
|
262022
262404
|
width: 40,
|
|
262023
262405
|
children: [
|
|
262024
|
-
/* @__PURE__ */
|
|
262406
|
+
/* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text3, {
|
|
262025
262407
|
color: "#A78BFA",
|
|
262026
262408
|
bold: true,
|
|
262027
262409
|
children: "Active Plan (task.md)"
|
|
@@ -262030,7 +262412,7 @@ function TaskHUD({ cwd: cwd2 }) {
|
|
|
262030
262412
|
const isDone = line.includes("[x]");
|
|
262031
262413
|
const isProg = line.includes("[/]");
|
|
262032
262414
|
const color = isDone ? "#10B981" : isProg ? "#FBBF24" : "#AAAAAA";
|
|
262033
|
-
return /* @__PURE__ */
|
|
262415
|
+
return /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text3, {
|
|
262034
262416
|
color,
|
|
262035
262417
|
wrap: "truncate",
|
|
262036
262418
|
children: line.replace(/^- /, "")
|
|
@@ -262041,7 +262423,7 @@ function TaskHUD({ cwd: cwd2 }) {
|
|
|
262041
262423
|
}
|
|
262042
262424
|
// ../../packages/tui/src/app.tsx
|
|
262043
262425
|
var import_react51 = __toESM(require_react(), 1);
|
|
262044
|
-
var
|
|
262426
|
+
var jsx_dev_runtime37 = __toESM(require_jsx_dev_runtime(), 1);
|
|
262045
262427
|
function ChatApp({
|
|
262046
262428
|
agent: agent2,
|
|
262047
262429
|
isAuthenticated: initialAuth,
|
|
@@ -262053,6 +262435,13 @@ function ChatApp({
|
|
|
262053
262435
|
session
|
|
262054
262436
|
}) {
|
|
262055
262437
|
const [inputHistory, setInputHistory] = import_react51.useState([]);
|
|
262438
|
+
const [exitConfirm, setExitConfirm] = import_react51.useState(false);
|
|
262439
|
+
import_react51.useEffect(() => {
|
|
262440
|
+
if (exitConfirm) {
|
|
262441
|
+
const timer = setTimeout(() => setExitConfirm(false), 3000);
|
|
262442
|
+
return () => clearTimeout(timer);
|
|
262443
|
+
}
|
|
262444
|
+
}, [exitConfirm]);
|
|
262056
262445
|
const {
|
|
262057
262446
|
staticKey,
|
|
262058
262447
|
staticMessages,
|
|
@@ -262067,14 +262456,14 @@ function ChatApp({
|
|
|
262067
262456
|
setActiveMessages,
|
|
262068
262457
|
setAuthMode
|
|
262069
262458
|
} = session;
|
|
262070
|
-
const authUI = authMode !== "none" ? authMode === "ask_question" && session.pendingQuestions ? /* @__PURE__ */
|
|
262459
|
+
const authUI = authMode !== "none" ? authMode === "ask_question" && session.pendingQuestions ? /* @__PURE__ */ jsx_dev_runtime37.jsxDEV(AskQuestionMenu, {
|
|
262071
262460
|
questions: session.pendingQuestions.questions,
|
|
262072
262461
|
onComplete: (answers) => {
|
|
262073
262462
|
session.pendingQuestions?.resolve(typeof answers === "string" ? answers : answers.join(", "));
|
|
262074
262463
|
setAuthMode("none");
|
|
262075
262464
|
session.setPendingQuestions(null);
|
|
262076
262465
|
}
|
|
262077
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
262466
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime37.jsxDEV(AuthMenus, {
|
|
262078
262467
|
...session,
|
|
262079
262468
|
agent: agent2,
|
|
262080
262469
|
getProviderModels: session.getProviderModels
|
|
@@ -262093,18 +262482,18 @@ function ChatApp({
|
|
|
262093
262482
|
}, 0);
|
|
262094
262483
|
const activeSubagent = activeMessages.find((m3) => m3.role === "assistant" && m3.toolCalls?.some((tc) => tc.name === "invoke_subagent"));
|
|
262095
262484
|
const hasActiveSubagent = activeSubagent && !activeMessages.some((m3) => m3.role === "tool" && activeSubagent.toolCalls?.some((tc) => tc.id === m3.toolCallId));
|
|
262096
|
-
return /* @__PURE__ */
|
|
262485
|
+
return /* @__PURE__ */ jsx_dev_runtime37.jsxDEV(Box_default, {
|
|
262097
262486
|
flexDirection: "column",
|
|
262098
262487
|
width: "100%",
|
|
262099
262488
|
children: [
|
|
262100
|
-
/* @__PURE__ */
|
|
262489
|
+
/* @__PURE__ */ jsx_dev_runtime37.jsxDEV(GlobalShortcuts, {
|
|
262101
262490
|
...session,
|
|
262102
262491
|
agent: agent2
|
|
262103
262492
|
}, undefined, false, undefined, this),
|
|
262104
|
-
/* @__PURE__ */
|
|
262493
|
+
/* @__PURE__ */ jsx_dev_runtime37.jsxDEV(TaskHUD, {
|
|
262105
262494
|
cwd: process.cwd()
|
|
262106
262495
|
}, undefined, false, undefined, this),
|
|
262107
|
-
/* @__PURE__ */
|
|
262496
|
+
/* @__PURE__ */ jsx_dev_runtime37.jsxDEV(MessageList, {
|
|
262108
262497
|
staticKey,
|
|
262109
262498
|
staticMessages,
|
|
262110
262499
|
activeMessages,
|
|
@@ -262112,7 +262501,7 @@ function ChatApp({
|
|
|
262112
262501
|
cliVersion,
|
|
262113
262502
|
userEmail: currentEmail || userEmail
|
|
262114
262503
|
}, undefined, false, undefined, this),
|
|
262115
|
-
/* @__PURE__ */
|
|
262504
|
+
/* @__PURE__ */ jsx_dev_runtime37.jsxDEV(InputBar, {
|
|
262116
262505
|
onSubmit: handleFormSubmit,
|
|
262117
262506
|
history: inputHistory,
|
|
262118
262507
|
disabled: authMode !== "none",
|
|
@@ -262120,7 +262509,11 @@ function ChatApp({
|
|
|
262120
262509
|
if (session.isStreaming) {
|
|
262121
262510
|
agent2.abort();
|
|
262122
262511
|
} else {
|
|
262123
|
-
|
|
262512
|
+
if (exitConfirm) {
|
|
262513
|
+
process.exit(0);
|
|
262514
|
+
} else {
|
|
262515
|
+
setExitConfirm(true);
|
|
262516
|
+
}
|
|
262124
262517
|
}
|
|
262125
262518
|
},
|
|
262126
262519
|
onCopy: () => {
|
|
@@ -262139,9 +262532,9 @@ function ChatApp({
|
|
|
262139
262532
|
contextTokens: totalTokens,
|
|
262140
262533
|
authMethod: session.authMethod,
|
|
262141
262534
|
hasBothAuth: session.hasBothAuth,
|
|
262142
|
-
authUI: hasActiveSubagent ? /* @__PURE__ */
|
|
262535
|
+
authUI: hasActiveSubagent ? /* @__PURE__ */ jsx_dev_runtime37.jsxDEV(Box_default, {
|
|
262143
262536
|
paddingX: 1,
|
|
262144
|
-
children: /* @__PURE__ */
|
|
262537
|
+
children: /* @__PURE__ */ jsx_dev_runtime37.jsxDEV(Text3, {
|
|
262145
262538
|
color: "#F59E0B",
|
|
262146
262539
|
bold: true,
|
|
262147
262540
|
children: "◆ Subagent Active..."
|
|
@@ -262156,7 +262549,8 @@ function ChatApp({
|
|
|
262156
262549
|
},
|
|
262157
262550
|
planMode,
|
|
262158
262551
|
grillMode,
|
|
262159
|
-
customInputMode: false
|
|
262552
|
+
customInputMode: false,
|
|
262553
|
+
showExitConfirm: exitConfirm
|
|
262160
262554
|
}, undefined, false, undefined, this)
|
|
262161
262555
|
]
|
|
262162
262556
|
}, undefined, true, undefined, this);
|
|
@@ -262259,10 +262653,13 @@ var package_default = {
|
|
|
262259
262653
|
module: "src/index.ts",
|
|
262260
262654
|
type: "module",
|
|
262261
262655
|
private: false,
|
|
262262
|
-
version: "0.2.
|
|
262656
|
+
version: "0.2.18",
|
|
262263
262657
|
description: "Turn ideas into reality.",
|
|
262264
262658
|
author: "Chaitanya Sonawane",
|
|
262265
262659
|
license: "Apache-2.0",
|
|
262660
|
+
keywords: [
|
|
262661
|
+
"december"
|
|
262662
|
+
],
|
|
262266
262663
|
engines: {
|
|
262267
262664
|
node: ">=18.0.0"
|
|
262268
262665
|
},
|
|
@@ -262304,551 +262701,8 @@ var package_default = {
|
|
|
262304
262701
|
};
|
|
262305
262702
|
|
|
262306
262703
|
// src/auth/browser.ts
|
|
262704
|
+
init_open();
|
|
262307
262705
|
import http3 from "node:http";
|
|
262308
|
-
|
|
262309
|
-
// ../../node_modules/.bun/open@11.0.0/node_modules/open/index.js
|
|
262310
|
-
import process36 from "node:process";
|
|
262311
|
-
import path17 from "node:path";
|
|
262312
|
-
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
262313
|
-
import childProcess5 from "node:child_process";
|
|
262314
|
-
import fs18, { constants as fsConstants2 } from "node:fs/promises";
|
|
262315
|
-
|
|
262316
|
-
// ../../node_modules/.bun/wsl-utils@0.3.1/node_modules/wsl-utils/index.js
|
|
262317
|
-
init_is_wsl();
|
|
262318
|
-
import { promisify as promisify9 } from "node:util";
|
|
262319
|
-
import childProcess4 from "node:child_process";
|
|
262320
|
-
import fs17, { constants as fsConstants } from "node:fs/promises";
|
|
262321
|
-
|
|
262322
|
-
// ../../node_modules/.bun/powershell-utils@0.1.0/node_modules/powershell-utils/index.js
|
|
262323
|
-
import process31 from "node:process";
|
|
262324
|
-
import { Buffer as Buffer8 } from "node:buffer";
|
|
262325
|
-
import { promisify as promisify8 } from "node:util";
|
|
262326
|
-
import childProcess3 from "node:child_process";
|
|
262327
|
-
var execFile3 = promisify8(childProcess3.execFile);
|
|
262328
|
-
var powerShellPath2 = () => `${process31.env.SYSTEMROOT || process31.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
262329
|
-
var executePowerShell2 = async (command, options = {}) => {
|
|
262330
|
-
const {
|
|
262331
|
-
powerShellPath: psPath,
|
|
262332
|
-
...execFileOptions
|
|
262333
|
-
} = options;
|
|
262334
|
-
const encodedCommand = executePowerShell2.encodeCommand(command);
|
|
262335
|
-
return execFile3(psPath ?? powerShellPath2(), [
|
|
262336
|
-
...executePowerShell2.argumentsPrefix,
|
|
262337
|
-
encodedCommand
|
|
262338
|
-
], {
|
|
262339
|
-
encoding: "utf8",
|
|
262340
|
-
...execFileOptions
|
|
262341
|
-
});
|
|
262342
|
-
};
|
|
262343
|
-
executePowerShell2.argumentsPrefix = [
|
|
262344
|
-
"-NoProfile",
|
|
262345
|
-
"-NonInteractive",
|
|
262346
|
-
"-ExecutionPolicy",
|
|
262347
|
-
"Bypass",
|
|
262348
|
-
"-EncodedCommand"
|
|
262349
|
-
];
|
|
262350
|
-
executePowerShell2.encodeCommand = (command) => Buffer8.from(command, "utf16le").toString("base64");
|
|
262351
|
-
executePowerShell2.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
|
|
262352
|
-
|
|
262353
|
-
// ../../node_modules/.bun/wsl-utils@0.3.1/node_modules/wsl-utils/utilities.js
|
|
262354
|
-
function parseMountPointFromConfig(content) {
|
|
262355
|
-
for (const line of content.split(`
|
|
262356
|
-
`)) {
|
|
262357
|
-
if (/^\s*#/.test(line)) {
|
|
262358
|
-
continue;
|
|
262359
|
-
}
|
|
262360
|
-
const match2 = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(line);
|
|
262361
|
-
if (!match2) {
|
|
262362
|
-
continue;
|
|
262363
|
-
}
|
|
262364
|
-
return match2.groups.mountPoint.trim().replaceAll(/^["']|["']$/g, "");
|
|
262365
|
-
}
|
|
262366
|
-
}
|
|
262367
|
-
|
|
262368
|
-
// ../../node_modules/.bun/wsl-utils@0.3.1/node_modules/wsl-utils/index.js
|
|
262369
|
-
init_is_wsl();
|
|
262370
|
-
var execFile4 = promisify9(childProcess4.execFile);
|
|
262371
|
-
var wslDrivesMountPoint = (() => {
|
|
262372
|
-
const defaultMountPoint = "/mnt/";
|
|
262373
|
-
let mountPoint;
|
|
262374
|
-
return async function() {
|
|
262375
|
-
if (mountPoint) {
|
|
262376
|
-
return mountPoint;
|
|
262377
|
-
}
|
|
262378
|
-
const configFilePath = "/etc/wsl.conf";
|
|
262379
|
-
let isConfigFileExists = false;
|
|
262380
|
-
try {
|
|
262381
|
-
await fs17.access(configFilePath, fsConstants.F_OK);
|
|
262382
|
-
isConfigFileExists = true;
|
|
262383
|
-
} catch {}
|
|
262384
|
-
if (!isConfigFileExists) {
|
|
262385
|
-
return defaultMountPoint;
|
|
262386
|
-
}
|
|
262387
|
-
const configContent = await fs17.readFile(configFilePath, { encoding: "utf8" });
|
|
262388
|
-
const parsedMountPoint = parseMountPointFromConfig(configContent);
|
|
262389
|
-
if (parsedMountPoint === undefined) {
|
|
262390
|
-
return defaultMountPoint;
|
|
262391
|
-
}
|
|
262392
|
-
mountPoint = parsedMountPoint;
|
|
262393
|
-
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
262394
|
-
return mountPoint;
|
|
262395
|
-
};
|
|
262396
|
-
})();
|
|
262397
|
-
var powerShellPathFromWsl = async () => {
|
|
262398
|
-
const mountPoint = await wslDrivesMountPoint();
|
|
262399
|
-
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
|
262400
|
-
};
|
|
262401
|
-
var powerShellPath3 = is_wsl_default ? powerShellPathFromWsl : powerShellPath2;
|
|
262402
|
-
var canAccessPowerShellPromise;
|
|
262403
|
-
var canAccessPowerShell = async () => {
|
|
262404
|
-
canAccessPowerShellPromise ??= (async () => {
|
|
262405
|
-
try {
|
|
262406
|
-
const psPath = await powerShellPath3();
|
|
262407
|
-
await fs17.access(psPath, fsConstants.X_OK);
|
|
262408
|
-
return true;
|
|
262409
|
-
} catch {
|
|
262410
|
-
return false;
|
|
262411
|
-
}
|
|
262412
|
-
})();
|
|
262413
|
-
return canAccessPowerShellPromise;
|
|
262414
|
-
};
|
|
262415
|
-
var wslDefaultBrowser = async () => {
|
|
262416
|
-
const psPath = await powerShellPath3();
|
|
262417
|
-
const command = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
|
262418
|
-
const { stdout } = await executePowerShell2(command, { powerShellPath: psPath });
|
|
262419
|
-
return stdout.trim();
|
|
262420
|
-
};
|
|
262421
|
-
var convertWslPathToWindows = async (path17) => {
|
|
262422
|
-
if (/^[a-z]+:\/\//i.test(path17)) {
|
|
262423
|
-
return path17;
|
|
262424
|
-
}
|
|
262425
|
-
try {
|
|
262426
|
-
const { stdout } = await execFile4("wslpath", ["-aw", path17], { encoding: "utf8" });
|
|
262427
|
-
return stdout.trim();
|
|
262428
|
-
} catch {
|
|
262429
|
-
return path17;
|
|
262430
|
-
}
|
|
262431
|
-
};
|
|
262432
|
-
|
|
262433
|
-
// ../../node_modules/.bun/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js
|
|
262434
|
-
function defineLazyProperty(object4, propertyName, valueGetter) {
|
|
262435
|
-
const define2 = (value) => Object.defineProperty(object4, propertyName, { value, enumerable: true, writable: true });
|
|
262436
|
-
Object.defineProperty(object4, propertyName, {
|
|
262437
|
-
configurable: true,
|
|
262438
|
-
enumerable: true,
|
|
262439
|
-
get() {
|
|
262440
|
-
const result2 = valueGetter();
|
|
262441
|
-
define2(result2);
|
|
262442
|
-
return result2;
|
|
262443
|
-
},
|
|
262444
|
-
set(value) {
|
|
262445
|
-
define2(value);
|
|
262446
|
-
}
|
|
262447
|
-
});
|
|
262448
|
-
return object4;
|
|
262449
|
-
}
|
|
262450
|
-
|
|
262451
|
-
// ../../node_modules/.bun/default-browser@5.5.0/node_modules/default-browser/index.js
|
|
262452
|
-
import { promisify as promisify13 } from "node:util";
|
|
262453
|
-
import process34 from "node:process";
|
|
262454
|
-
import { execFile as execFile8 } from "node:child_process";
|
|
262455
|
-
|
|
262456
|
-
// ../../node_modules/.bun/default-browser-id@5.0.1/node_modules/default-browser-id/index.js
|
|
262457
|
-
import { promisify as promisify10 } from "node:util";
|
|
262458
|
-
import process32 from "node:process";
|
|
262459
|
-
import { execFile as execFile5 } from "node:child_process";
|
|
262460
|
-
var execFileAsync2 = promisify10(execFile5);
|
|
262461
|
-
async function defaultBrowserId() {
|
|
262462
|
-
if (process32.platform !== "darwin") {
|
|
262463
|
-
throw new Error("macOS only");
|
|
262464
|
-
}
|
|
262465
|
-
const { stdout } = await execFileAsync2("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
|
|
262466
|
-
const match2 = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
|
|
262467
|
-
const browserId = match2?.groups.id ?? "com.apple.Safari";
|
|
262468
|
-
if (browserId === "com.apple.safari") {
|
|
262469
|
-
return "com.apple.Safari";
|
|
262470
|
-
}
|
|
262471
|
-
return browserId;
|
|
262472
|
-
}
|
|
262473
|
-
|
|
262474
|
-
// ../../node_modules/.bun/run-applescript@7.1.0/node_modules/run-applescript/index.js
|
|
262475
|
-
import process33 from "node:process";
|
|
262476
|
-
import { promisify as promisify11 } from "node:util";
|
|
262477
|
-
import { execFile as execFile6, execFileSync as execFileSync2 } from "node:child_process";
|
|
262478
|
-
var execFileAsync3 = promisify11(execFile6);
|
|
262479
|
-
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
262480
|
-
if (process33.platform !== "darwin") {
|
|
262481
|
-
throw new Error("macOS only");
|
|
262482
|
-
}
|
|
262483
|
-
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
262484
|
-
const execOptions = {};
|
|
262485
|
-
if (signal) {
|
|
262486
|
-
execOptions.signal = signal;
|
|
262487
|
-
}
|
|
262488
|
-
const { stdout } = await execFileAsync3("osascript", ["-e", script, outputArguments], execOptions);
|
|
262489
|
-
return stdout.trim();
|
|
262490
|
-
}
|
|
262491
|
-
|
|
262492
|
-
// ../../node_modules/.bun/bundle-name@4.1.0/node_modules/bundle-name/index.js
|
|
262493
|
-
async function bundleName(bundleId) {
|
|
262494
|
-
return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string
|
|
262495
|
-
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
|
|
262496
|
-
}
|
|
262497
|
-
|
|
262498
|
-
// ../../node_modules/.bun/default-browser@5.5.0/node_modules/default-browser/windows.js
|
|
262499
|
-
import { promisify as promisify12 } from "node:util";
|
|
262500
|
-
import { execFile as execFile7 } from "node:child_process";
|
|
262501
|
-
var execFileAsync4 = promisify12(execFile7);
|
|
262502
|
-
var windowsBrowserProgIds = {
|
|
262503
|
-
MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
|
|
262504
|
-
MSEdgeBHTML: { name: "Edge Beta", id: "com.microsoft.edge.beta" },
|
|
262505
|
-
MSEdgeDHTML: { name: "Edge Dev", id: "com.microsoft.edge.dev" },
|
|
262506
|
-
AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
|
|
262507
|
-
ChromeHTML: { name: "Chrome", id: "com.google.chrome" },
|
|
262508
|
-
ChromeBHTML: { name: "Chrome Beta", id: "com.google.chrome.beta" },
|
|
262509
|
-
ChromeDHTML: { name: "Chrome Dev", id: "com.google.chrome.dev" },
|
|
262510
|
-
ChromiumHTM: { name: "Chromium", id: "org.chromium.Chromium" },
|
|
262511
|
-
BraveHTML: { name: "Brave", id: "com.brave.Browser" },
|
|
262512
|
-
BraveBHTML: { name: "Brave Beta", id: "com.brave.Browser.beta" },
|
|
262513
|
-
BraveDHTML: { name: "Brave Dev", id: "com.brave.Browser.dev" },
|
|
262514
|
-
BraveSSHTM: { name: "Brave Nightly", id: "com.brave.Browser.nightly" },
|
|
262515
|
-
FirefoxURL: { name: "Firefox", id: "org.mozilla.firefox" },
|
|
262516
|
-
OperaStable: { name: "Opera", id: "com.operasoftware.Opera" },
|
|
262517
|
-
VivaldiHTM: { name: "Vivaldi", id: "com.vivaldi.Vivaldi" },
|
|
262518
|
-
"IE.HTTP": { name: "Internet Explorer", id: "com.microsoft.ie" }
|
|
262519
|
-
};
|
|
262520
|
-
var _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
|
|
262521
|
-
|
|
262522
|
-
class UnknownBrowserError extends Error {
|
|
262523
|
-
}
|
|
262524
|
-
async function defaultBrowser(_execFileAsync = execFileAsync4) {
|
|
262525
|
-
const { stdout } = await _execFileAsync("reg", [
|
|
262526
|
-
"QUERY",
|
|
262527
|
-
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
|
|
262528
|
-
"/v",
|
|
262529
|
-
"ProgId"
|
|
262530
|
-
]);
|
|
262531
|
-
const match2 = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
|
|
262532
|
-
if (!match2) {
|
|
262533
|
-
throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
|
|
262534
|
-
}
|
|
262535
|
-
const { id } = match2.groups;
|
|
262536
|
-
const dotIndex = id.lastIndexOf(".");
|
|
262537
|
-
const hyphenIndex = id.lastIndexOf("-");
|
|
262538
|
-
const baseIdByDot = dotIndex === -1 ? undefined : id.slice(0, dotIndex);
|
|
262539
|
-
const baseIdByHyphen = hyphenIndex === -1 ? undefined : id.slice(0, hyphenIndex);
|
|
262540
|
-
return windowsBrowserProgIds[id] ?? windowsBrowserProgIds[baseIdByDot] ?? windowsBrowserProgIds[baseIdByHyphen] ?? { name: id, id };
|
|
262541
|
-
}
|
|
262542
|
-
|
|
262543
|
-
// ../../node_modules/.bun/default-browser@5.5.0/node_modules/default-browser/index.js
|
|
262544
|
-
var execFileAsync5 = promisify13(execFile8);
|
|
262545
|
-
var titleize = (string4) => string4.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x3) => x3.toUpperCase());
|
|
262546
|
-
async function defaultBrowser2() {
|
|
262547
|
-
if (process34.platform === "darwin") {
|
|
262548
|
-
const id = await defaultBrowserId();
|
|
262549
|
-
const name = await bundleName(id);
|
|
262550
|
-
return { name, id };
|
|
262551
|
-
}
|
|
262552
|
-
if (process34.platform === "linux") {
|
|
262553
|
-
const { stdout } = await execFileAsync5("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
|
|
262554
|
-
const id = stdout.trim();
|
|
262555
|
-
const name = titleize(id.replace(/.desktop$/, "").replace("-", " "));
|
|
262556
|
-
return { name, id };
|
|
262557
|
-
}
|
|
262558
|
-
if (process34.platform === "win32") {
|
|
262559
|
-
return defaultBrowser();
|
|
262560
|
-
}
|
|
262561
|
-
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
262562
|
-
}
|
|
262563
|
-
|
|
262564
|
-
// ../../node_modules/.bun/open@11.0.0/node_modules/open/index.js
|
|
262565
|
-
init_is_inside_container();
|
|
262566
|
-
|
|
262567
|
-
// ../../node_modules/.bun/is-in-ssh@1.0.0/node_modules/is-in-ssh/index.js
|
|
262568
|
-
import process35 from "node:process";
|
|
262569
|
-
var isInSsh = Boolean(process35.env.SSH_CONNECTION || process35.env.SSH_CLIENT || process35.env.SSH_TTY);
|
|
262570
|
-
var is_in_ssh_default = isInSsh;
|
|
262571
|
-
|
|
262572
|
-
// ../../node_modules/.bun/open@11.0.0/node_modules/open/index.js
|
|
262573
|
-
var fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
262574
|
-
var __dirname4 = import.meta.url ? path17.dirname(fileURLToPath6(import.meta.url)) : "";
|
|
262575
|
-
var localXdgOpenPath = path17.join(__dirname4, "xdg-open");
|
|
262576
|
-
var { platform: platform3, arch } = process36;
|
|
262577
|
-
var tryEachApp = async (apps, opener) => {
|
|
262578
|
-
if (apps.length === 0) {
|
|
262579
|
-
return;
|
|
262580
|
-
}
|
|
262581
|
-
const errors4 = [];
|
|
262582
|
-
for (const app2 of apps) {
|
|
262583
|
-
try {
|
|
262584
|
-
return await opener(app2);
|
|
262585
|
-
} catch (error4) {
|
|
262586
|
-
errors4.push(error4);
|
|
262587
|
-
}
|
|
262588
|
-
}
|
|
262589
|
-
throw new AggregateError(errors4, "Failed to open in all supported apps");
|
|
262590
|
-
};
|
|
262591
|
-
var baseOpen = async (options) => {
|
|
262592
|
-
options = {
|
|
262593
|
-
wait: false,
|
|
262594
|
-
background: false,
|
|
262595
|
-
newInstance: false,
|
|
262596
|
-
allowNonzeroExitCode: false,
|
|
262597
|
-
...options
|
|
262598
|
-
};
|
|
262599
|
-
const isFallbackAttempt = options[fallbackAttemptSymbol] === true;
|
|
262600
|
-
delete options[fallbackAttemptSymbol];
|
|
262601
|
-
if (Array.isArray(options.app)) {
|
|
262602
|
-
return tryEachApp(options.app, (singleApp) => baseOpen({
|
|
262603
|
-
...options,
|
|
262604
|
-
app: singleApp,
|
|
262605
|
-
[fallbackAttemptSymbol]: true
|
|
262606
|
-
}));
|
|
262607
|
-
}
|
|
262608
|
-
let { name: app2, arguments: appArguments = [] } = options.app ?? {};
|
|
262609
|
-
appArguments = [...appArguments];
|
|
262610
|
-
if (Array.isArray(app2)) {
|
|
262611
|
-
return tryEachApp(app2, (appName) => baseOpen({
|
|
262612
|
-
...options,
|
|
262613
|
-
app: {
|
|
262614
|
-
name: appName,
|
|
262615
|
-
arguments: appArguments
|
|
262616
|
-
},
|
|
262617
|
-
[fallbackAttemptSymbol]: true
|
|
262618
|
-
}));
|
|
262619
|
-
}
|
|
262620
|
-
if (app2 === "browser" || app2 === "browserPrivate") {
|
|
262621
|
-
const ids = {
|
|
262622
|
-
"com.google.chrome": "chrome",
|
|
262623
|
-
"google-chrome.desktop": "chrome",
|
|
262624
|
-
"com.brave.browser": "brave",
|
|
262625
|
-
"org.mozilla.firefox": "firefox",
|
|
262626
|
-
"firefox.desktop": "firefox",
|
|
262627
|
-
"com.microsoft.msedge": "edge",
|
|
262628
|
-
"com.microsoft.edge": "edge",
|
|
262629
|
-
"com.microsoft.edgemac": "edge",
|
|
262630
|
-
"microsoft-edge.desktop": "edge",
|
|
262631
|
-
"com.apple.safari": "safari"
|
|
262632
|
-
};
|
|
262633
|
-
const flags = {
|
|
262634
|
-
chrome: "--incognito",
|
|
262635
|
-
brave: "--incognito",
|
|
262636
|
-
firefox: "--private-window",
|
|
262637
|
-
edge: "--inPrivate"
|
|
262638
|
-
};
|
|
262639
|
-
let browser2;
|
|
262640
|
-
if (is_wsl_default) {
|
|
262641
|
-
const progId = await wslDefaultBrowser();
|
|
262642
|
-
const browserInfo = _windowsBrowserProgIdMap.get(progId);
|
|
262643
|
-
browser2 = browserInfo ?? {};
|
|
262644
|
-
} else {
|
|
262645
|
-
browser2 = await defaultBrowser2();
|
|
262646
|
-
}
|
|
262647
|
-
if (browser2.id in ids) {
|
|
262648
|
-
const browserName = ids[browser2.id.toLowerCase()];
|
|
262649
|
-
if (app2 === "browserPrivate") {
|
|
262650
|
-
if (browserName === "safari") {
|
|
262651
|
-
throw new Error("Safari doesn't support opening in private mode via command line");
|
|
262652
|
-
}
|
|
262653
|
-
appArguments.push(flags[browserName]);
|
|
262654
|
-
}
|
|
262655
|
-
return baseOpen({
|
|
262656
|
-
...options,
|
|
262657
|
-
app: {
|
|
262658
|
-
name: apps[browserName],
|
|
262659
|
-
arguments: appArguments
|
|
262660
|
-
}
|
|
262661
|
-
});
|
|
262662
|
-
}
|
|
262663
|
-
throw new Error(`${browser2.name} is not supported as a default browser`);
|
|
262664
|
-
}
|
|
262665
|
-
let command;
|
|
262666
|
-
const cliArguments = [];
|
|
262667
|
-
const childProcessOptions = {};
|
|
262668
|
-
let shouldUseWindowsInWsl = false;
|
|
262669
|
-
if (is_wsl_default && !isInsideContainer() && !is_in_ssh_default && !app2) {
|
|
262670
|
-
shouldUseWindowsInWsl = await canAccessPowerShell();
|
|
262671
|
-
}
|
|
262672
|
-
if (platform3 === "darwin") {
|
|
262673
|
-
command = "open";
|
|
262674
|
-
if (options.wait) {
|
|
262675
|
-
cliArguments.push("--wait-apps");
|
|
262676
|
-
}
|
|
262677
|
-
if (options.background) {
|
|
262678
|
-
cliArguments.push("--background");
|
|
262679
|
-
}
|
|
262680
|
-
if (options.newInstance) {
|
|
262681
|
-
cliArguments.push("--new");
|
|
262682
|
-
}
|
|
262683
|
-
if (app2) {
|
|
262684
|
-
cliArguments.push("-a", app2);
|
|
262685
|
-
}
|
|
262686
|
-
} else if (platform3 === "win32" || shouldUseWindowsInWsl) {
|
|
262687
|
-
command = await powerShellPath3();
|
|
262688
|
-
cliArguments.push(...executePowerShell2.argumentsPrefix);
|
|
262689
|
-
if (!is_wsl_default) {
|
|
262690
|
-
childProcessOptions.windowsVerbatimArguments = true;
|
|
262691
|
-
}
|
|
262692
|
-
if (is_wsl_default && options.target) {
|
|
262693
|
-
options.target = await convertWslPathToWindows(options.target);
|
|
262694
|
-
}
|
|
262695
|
-
const encodedArguments = ["$ProgressPreference = 'SilentlyContinue';", "Start"];
|
|
262696
|
-
if (options.wait) {
|
|
262697
|
-
encodedArguments.push("-Wait");
|
|
262698
|
-
}
|
|
262699
|
-
if (app2) {
|
|
262700
|
-
encodedArguments.push(executePowerShell2.escapeArgument(app2));
|
|
262701
|
-
if (options.target) {
|
|
262702
|
-
appArguments.push(options.target);
|
|
262703
|
-
}
|
|
262704
|
-
} else if (options.target) {
|
|
262705
|
-
encodedArguments.push(executePowerShell2.escapeArgument(options.target));
|
|
262706
|
-
}
|
|
262707
|
-
if (appArguments.length > 0) {
|
|
262708
|
-
appArguments = appArguments.map((argument) => executePowerShell2.escapeArgument(argument));
|
|
262709
|
-
encodedArguments.push("-ArgumentList", appArguments.join(","));
|
|
262710
|
-
}
|
|
262711
|
-
options.target = executePowerShell2.encodeCommand(encodedArguments.join(" "));
|
|
262712
|
-
if (!options.wait) {
|
|
262713
|
-
childProcessOptions.stdio = "ignore";
|
|
262714
|
-
}
|
|
262715
|
-
} else {
|
|
262716
|
-
if (app2) {
|
|
262717
|
-
command = app2;
|
|
262718
|
-
} else {
|
|
262719
|
-
const isBundled = !__dirname4 || __dirname4 === "/";
|
|
262720
|
-
let exeLocalXdgOpen = false;
|
|
262721
|
-
try {
|
|
262722
|
-
await fs18.access(localXdgOpenPath, fsConstants2.X_OK);
|
|
262723
|
-
exeLocalXdgOpen = true;
|
|
262724
|
-
} catch {}
|
|
262725
|
-
const useSystemXdgOpen = process36.versions.electron ?? (platform3 === "android" || isBundled || !exeLocalXdgOpen);
|
|
262726
|
-
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
262727
|
-
}
|
|
262728
|
-
if (appArguments.length > 0) {
|
|
262729
|
-
cliArguments.push(...appArguments);
|
|
262730
|
-
}
|
|
262731
|
-
if (!options.wait) {
|
|
262732
|
-
childProcessOptions.stdio = "ignore";
|
|
262733
|
-
childProcessOptions.detached = true;
|
|
262734
|
-
}
|
|
262735
|
-
}
|
|
262736
|
-
if (platform3 === "darwin" && appArguments.length > 0) {
|
|
262737
|
-
cliArguments.push("--args", ...appArguments);
|
|
262738
|
-
}
|
|
262739
|
-
if (options.target) {
|
|
262740
|
-
cliArguments.push(options.target);
|
|
262741
|
-
}
|
|
262742
|
-
const subprocess = childProcess5.spawn(command, cliArguments, childProcessOptions);
|
|
262743
|
-
if (options.wait) {
|
|
262744
|
-
return new Promise((resolve4, reject2) => {
|
|
262745
|
-
subprocess.once("error", reject2);
|
|
262746
|
-
subprocess.once("close", (exitCode) => {
|
|
262747
|
-
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
262748
|
-
reject2(new Error(`Exited with code ${exitCode}`));
|
|
262749
|
-
return;
|
|
262750
|
-
}
|
|
262751
|
-
resolve4(subprocess);
|
|
262752
|
-
});
|
|
262753
|
-
});
|
|
262754
|
-
}
|
|
262755
|
-
if (isFallbackAttempt) {
|
|
262756
|
-
return new Promise((resolve4, reject2) => {
|
|
262757
|
-
subprocess.once("error", reject2);
|
|
262758
|
-
subprocess.once("spawn", () => {
|
|
262759
|
-
subprocess.once("close", (exitCode) => {
|
|
262760
|
-
subprocess.off("error", reject2);
|
|
262761
|
-
if (exitCode !== 0) {
|
|
262762
|
-
reject2(new Error(`Exited with code ${exitCode}`));
|
|
262763
|
-
return;
|
|
262764
|
-
}
|
|
262765
|
-
subprocess.unref();
|
|
262766
|
-
resolve4(subprocess);
|
|
262767
|
-
});
|
|
262768
|
-
});
|
|
262769
|
-
});
|
|
262770
|
-
}
|
|
262771
|
-
subprocess.unref();
|
|
262772
|
-
return new Promise((resolve4, reject2) => {
|
|
262773
|
-
subprocess.once("error", reject2);
|
|
262774
|
-
subprocess.once("spawn", () => {
|
|
262775
|
-
subprocess.off("error", reject2);
|
|
262776
|
-
resolve4(subprocess);
|
|
262777
|
-
});
|
|
262778
|
-
});
|
|
262779
|
-
};
|
|
262780
|
-
var open4 = (target, options) => {
|
|
262781
|
-
if (typeof target !== "string") {
|
|
262782
|
-
throw new TypeError("Expected a `target`");
|
|
262783
|
-
}
|
|
262784
|
-
return baseOpen({
|
|
262785
|
-
...options,
|
|
262786
|
-
target
|
|
262787
|
-
});
|
|
262788
|
-
};
|
|
262789
|
-
function detectArchBinary(binary) {
|
|
262790
|
-
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
262791
|
-
return binary;
|
|
262792
|
-
}
|
|
262793
|
-
const { [arch]: archBinary } = binary;
|
|
262794
|
-
if (!archBinary) {
|
|
262795
|
-
throw new Error(`${arch} is not supported`);
|
|
262796
|
-
}
|
|
262797
|
-
return archBinary;
|
|
262798
|
-
}
|
|
262799
|
-
function detectPlatformBinary({ [platform3]: platformBinary }, { wsl } = {}) {
|
|
262800
|
-
if (wsl && is_wsl_default) {
|
|
262801
|
-
return detectArchBinary(wsl);
|
|
262802
|
-
}
|
|
262803
|
-
if (!platformBinary) {
|
|
262804
|
-
throw new Error(`${platform3} is not supported`);
|
|
262805
|
-
}
|
|
262806
|
-
return detectArchBinary(platformBinary);
|
|
262807
|
-
}
|
|
262808
|
-
var apps = {
|
|
262809
|
-
browser: "browser",
|
|
262810
|
-
browserPrivate: "browserPrivate"
|
|
262811
|
-
};
|
|
262812
|
-
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
262813
|
-
darwin: "google chrome",
|
|
262814
|
-
win32: "chrome",
|
|
262815
|
-
linux: ["google-chrome", "google-chrome-stable", "chromium", "chromium-browser"]
|
|
262816
|
-
}, {
|
|
262817
|
-
wsl: {
|
|
262818
|
-
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
262819
|
-
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
|
262820
|
-
}
|
|
262821
|
-
}));
|
|
262822
|
-
defineLazyProperty(apps, "brave", () => detectPlatformBinary({
|
|
262823
|
-
darwin: "brave browser",
|
|
262824
|
-
win32: "brave",
|
|
262825
|
-
linux: ["brave-browser", "brave"]
|
|
262826
|
-
}, {
|
|
262827
|
-
wsl: {
|
|
262828
|
-
ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
|
|
262829
|
-
x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
|
|
262830
|
-
}
|
|
262831
|
-
}));
|
|
262832
|
-
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
|
262833
|
-
darwin: "firefox",
|
|
262834
|
-
win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
|
|
262835
|
-
linux: "firefox"
|
|
262836
|
-
}, {
|
|
262837
|
-
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
|
|
262838
|
-
}));
|
|
262839
|
-
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
262840
|
-
darwin: "microsoft edge",
|
|
262841
|
-
win32: "msedge",
|
|
262842
|
-
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
262843
|
-
}, {
|
|
262844
|
-
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
|
262845
|
-
}));
|
|
262846
|
-
defineLazyProperty(apps, "safari", () => detectPlatformBinary({
|
|
262847
|
-
darwin: "Safari"
|
|
262848
|
-
}));
|
|
262849
|
-
var open_default = open4;
|
|
262850
|
-
|
|
262851
|
-
// src/auth/browser.ts
|
|
262852
262706
|
async function loginViaBrowser(baseUrl = process.env.DECEMBER_WEB_URL ? `${process.env.DECEMBER_WEB_URL}/cli/login` : "https://trydecember.com/cli/login") {
|
|
262853
262707
|
return new Promise((resolve4, reject2) => {
|
|
262854
262708
|
const server = http3.createServer((req, res) => {
|
|
@@ -263442,6 +263296,16 @@ if (!globalSymbols.__taskManager) {
|
|
|
263442
263296
|
globalSymbols.__taskManager = new TaskManager;
|
|
263443
263297
|
}
|
|
263444
263298
|
var taskManager = globalSymbols.__taskManager;
|
|
263299
|
+
if (!globalSymbols.__taskManagerCleanupAdded) {
|
|
263300
|
+
globalSymbols.__taskManagerCleanupAdded = true;
|
|
263301
|
+
process.on("exit", () => {
|
|
263302
|
+
for (const task of taskManager.getTasks()) {
|
|
263303
|
+
if (task.status === "running") {
|
|
263304
|
+
taskManager.killTask(task.id);
|
|
263305
|
+
}
|
|
263306
|
+
}
|
|
263307
|
+
});
|
|
263308
|
+
}
|
|
263445
263309
|
|
|
263446
263310
|
// src/utils/error-parser.ts
|
|
263447
263311
|
import util3 from "util";
|
|
@@ -264821,7 +264685,9 @@ function useAgentSession({
|
|
|
264821
264685
|
return;
|
|
264822
264686
|
}
|
|
264823
264687
|
if (text3.trim() === "/usage") {
|
|
264824
|
-
|
|
264688
|
+
Promise.resolve().then(() => (init_open(), exports_open)).then((open5) => {
|
|
264689
|
+
open5.default("https://trydecember.com/settings/analytics/plan");
|
|
264690
|
+
}).catch(console.error);
|
|
264825
264691
|
return;
|
|
264826
264692
|
}
|
|
264827
264693
|
if (!isAuthenticated) {
|
|
@@ -265028,7 +264894,7 @@ Explain which files need to be created, modified, or deleted, and what the chang
|
|
|
265028
264894
|
}
|
|
265029
264895
|
|
|
265030
264896
|
// src/local-operations.ts
|
|
265031
|
-
import { exec as exec4 } from "node:child_process";
|
|
264897
|
+
import { exec as exec4, spawn as spawn6 } from "node:child_process";
|
|
265032
264898
|
import fs21 from "node:fs/promises";
|
|
265033
264899
|
import path20 from "node:path";
|
|
265034
264900
|
import { promisify as promisify14 } from "node:util";
|
|
@@ -265038,7 +264904,50 @@ var localBashOps = createLocalBashOperations();
|
|
|
265038
264904
|
var localOperations = {
|
|
265039
264905
|
bash: {
|
|
265040
264906
|
exec: async (command, cwd2, options) => {
|
|
265041
|
-
return
|
|
264907
|
+
return new Promise((resolve4, reject2) => {
|
|
264908
|
+
const child = spawn6(command, {
|
|
264909
|
+
cwd: cwd2,
|
|
264910
|
+
detached: process.platform !== "win32",
|
|
264911
|
+
env: options.env ?? process.env,
|
|
264912
|
+
shell: true
|
|
264913
|
+
});
|
|
264914
|
+
const task = taskManager.addTask(command, child);
|
|
264915
|
+
let output = "";
|
|
264916
|
+
let resolved = false;
|
|
264917
|
+
const handleData = (data2) => {
|
|
264918
|
+
const chunk2 = data2.toString();
|
|
264919
|
+
output += chunk2;
|
|
264920
|
+
taskManager.appendOutput(task.id, chunk2);
|
|
264921
|
+
if (!resolved && options.onData) {
|
|
264922
|
+
options.onData(chunk2);
|
|
264923
|
+
}
|
|
264924
|
+
};
|
|
264925
|
+
child.stdout?.on("data", handleData);
|
|
264926
|
+
child.stderr?.on("data", handleData);
|
|
264927
|
+
let timeoutHandle;
|
|
264928
|
+
if (options.timeout) {
|
|
264929
|
+
timeoutHandle = setTimeout(() => {
|
|
264930
|
+
if (child.pid)
|
|
264931
|
+
taskManager.killTask(task.id);
|
|
264932
|
+
}, options.timeout * 1000);
|
|
264933
|
+
}
|
|
264934
|
+
const bgTimeout = setTimeout(() => {
|
|
264935
|
+
if (!resolved) {
|
|
264936
|
+
resolved = true;
|
|
264937
|
+
resolve4({ exitCode: null, output, taskId: task.id });
|
|
264938
|
+
}
|
|
264939
|
+
}, 3000);
|
|
264940
|
+
child.on("close", (code) => {
|
|
264941
|
+
clearTimeout(bgTimeout);
|
|
264942
|
+
if (timeoutHandle)
|
|
264943
|
+
clearTimeout(timeoutHandle);
|
|
264944
|
+
taskManager.markCompleted(task.id, code);
|
|
264945
|
+
if (!resolved) {
|
|
264946
|
+
resolved = true;
|
|
264947
|
+
resolve4({ exitCode: code, output });
|
|
264948
|
+
}
|
|
264949
|
+
});
|
|
264950
|
+
});
|
|
265042
264951
|
},
|
|
265043
264952
|
getTaskStatus: async (taskId) => {
|
|
265044
264953
|
const task = taskManager.getTask(taskId);
|
|
@@ -265141,6 +265050,7 @@ function AppWrapper(props) {
|
|
|
265141
265050
|
const session = useAgentSession(props);
|
|
265142
265051
|
return import_react54.default.createElement(ChatApp, { ...props, session });
|
|
265143
265052
|
}
|
|
265053
|
+
process.env.DOTENV_CONFIG_QUIET = "true";
|
|
265144
265054
|
import_dotenv.default.config();
|
|
265145
265055
|
var originalConsoleError = console.error;
|
|
265146
265056
|
async function main() {
|