@drewpayment/mink 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/agents/mink-agent.md.tmpl +84 -0
- package/dashboard/out/404.html +1 -1
- package/dashboard/out/action-log.html +1 -1
- package/dashboard/out/action-log.txt +1 -1
- package/dashboard/out/activity.html +1 -1
- package/dashboard/out/activity.txt +1 -1
- package/dashboard/out/bugs.html +1 -1
- package/dashboard/out/bugs.txt +1 -1
- package/dashboard/out/capture.html +1 -1
- package/dashboard/out/capture.txt +1 -1
- package/dashboard/out/config.html +1 -1
- package/dashboard/out/config.txt +1 -1
- package/dashboard/out/daemon.html +1 -1
- package/dashboard/out/daemon.txt +1 -1
- package/dashboard/out/design.html +1 -1
- package/dashboard/out/design.txt +1 -1
- package/dashboard/out/discord.html +1 -1
- package/dashboard/out/discord.txt +1 -1
- package/dashboard/out/file-index.html +1 -1
- package/dashboard/out/file-index.txt +1 -1
- package/dashboard/out/index.html +1 -1
- package/dashboard/out/index.txt +1 -1
- package/dashboard/out/insights.html +1 -1
- package/dashboard/out/insights.txt +1 -1
- package/dashboard/out/learning.html +1 -1
- package/dashboard/out/learning.txt +1 -1
- package/dashboard/out/overview.html +1 -1
- package/dashboard/out/overview.txt +1 -1
- package/dashboard/out/scheduler.html +1 -1
- package/dashboard/out/scheduler.txt +1 -1
- package/dashboard/out/sync.html +1 -1
- package/dashboard/out/sync.txt +1 -1
- package/dashboard/out/tokens.html +1 -1
- package/dashboard/out/tokens.txt +1 -1
- package/dashboard/out/waste.html +1 -1
- package/dashboard/out/waste.txt +1 -1
- package/dashboard/out/wiki.html +1 -1
- package/dashboard/out/wiki.txt +1 -1
- package/dist/cli.js +804 -376
- package/package.json +2 -1
- package/src/cli.ts +8 -1
- package/src/commands/agent.ts +245 -0
- package/src/commands/daemon.ts +12 -1
- package/src/commands/init.ts +27 -0
- package/src/core/daemon-service.ts +227 -0
- /package/dashboard/out/_next/static/{FiL3S_40BA764FL66DRZV → EC-_8nIOf1GnPrIqZ7Mk3}/_buildManifest.js +0 -0
- /package/dashboard/out/_next/static/{FiL3S_40BA764FL66DRZV → EC-_8nIOf1GnPrIqZ7Mk3}/_ssgManifest.js +0 -0
package/dist/cli.js
CHANGED
|
@@ -2951,6 +2951,7 @@ var init_seed = __esm(() => {
|
|
|
2951
2951
|
// src/commands/init.ts
|
|
2952
2952
|
var exports_init = {};
|
|
2953
2953
|
__export(exports_init, {
|
|
2954
|
+
writeMinkRule: () => writeMinkRule,
|
|
2954
2955
|
resolveCliPath: () => resolveCliPath,
|
|
2955
2956
|
mergeHooksIntoSettings: () => mergeHooksIntoSettings,
|
|
2956
2957
|
init: () => init,
|
|
@@ -3011,6 +3012,12 @@ function isMinkHook(entry) {
|
|
|
3011
3012
|
}
|
|
3012
3013
|
return false;
|
|
3013
3014
|
}
|
|
3015
|
+
function writeMinkRule(cwd) {
|
|
3016
|
+
const rulePath = resolve2(cwd, ".claude", "rules", "mink.md");
|
|
3017
|
+
mkdirSync6(dirname4(rulePath), { recursive: true });
|
|
3018
|
+
atomicWriteText(rulePath, MINK_RULE_CONTENT);
|
|
3019
|
+
return rulePath;
|
|
3020
|
+
}
|
|
3014
3021
|
function mergeHooksIntoSettings(settingsPath, newHooks) {
|
|
3015
3022
|
mkdirSync6(dirname4(settingsPath), { recursive: true });
|
|
3016
3023
|
const existing = safeReadJson(settingsPath) ?? {};
|
|
@@ -3043,6 +3050,7 @@ async function init(cwd) {
|
|
|
3043
3050
|
console.log(` backup: ${backupName}`);
|
|
3044
3051
|
}
|
|
3045
3052
|
mergeHooksIntoSettings(settingsPath, hooks);
|
|
3053
|
+
const rulePath = writeMinkRule(cwd);
|
|
3046
3054
|
mkdirSync6(dir, { recursive: true });
|
|
3047
3055
|
const projectId = generateProjectId(cwd);
|
|
3048
3056
|
const isNotesProject = isWikiEnabled() && isVaultInitialized() && isInsideVault(cwd);
|
|
@@ -3060,12 +3068,14 @@ async function init(cwd) {
|
|
|
3060
3068
|
console.log(`[mink] upgrade complete`);
|
|
3061
3069
|
console.log(` project: ${projectId}`);
|
|
3062
3070
|
console.log(` hooks: ${settingsPath}`);
|
|
3071
|
+
console.log(` rule: ${rulePath}`);
|
|
3063
3072
|
} else {
|
|
3064
3073
|
console.log(`[mink] initialized`);
|
|
3065
3074
|
console.log(` project: ${projectId}`);
|
|
3066
3075
|
console.log(` state: ${dir}`);
|
|
3067
3076
|
console.log(` runtime: ${runtime}`);
|
|
3068
3077
|
console.log(` hooks: ${settingsPath}`);
|
|
3078
|
+
console.log(` rule: ${rulePath}`);
|
|
3069
3079
|
}
|
|
3070
3080
|
const { scan: scan2 } = await Promise.resolve().then(() => (init_scan(), exports_scan));
|
|
3071
3081
|
scan2(cwd, { check: false });
|
|
@@ -3110,6 +3120,22 @@ async function init(cwd) {
|
|
|
3110
3120
|
} catch {}
|
|
3111
3121
|
}
|
|
3112
3122
|
}
|
|
3123
|
+
var MINK_RULE_CONTENT = `---
|
|
3124
|
+
description: Mink context management — automatic via hooks
|
|
3125
|
+
---
|
|
3126
|
+
|
|
3127
|
+
This project uses **Mink** (\`@drewpayment/mink\`) for cross-session context management.
|
|
3128
|
+
|
|
3129
|
+
## How it works
|
|
3130
|
+
- Mink runs automatically through Claude Code hooks configured in \`.claude/settings.json\` (SessionStart, PreToolUse, PostToolUse, Stop).
|
|
3131
|
+
- All state lives in \`~/.mink/\` on the user's machine — **not** in this repository. Do not create or write to any in-repo state directory (no \`.wolf/\`, \`.mink/\`, etc.).
|
|
3132
|
+
- Read intelligence, write enforcement, bug memory, and the token ledger are handled by the hooks. You do not need to manually read or update any state files.
|
|
3133
|
+
|
|
3134
|
+
## When to act on Mink
|
|
3135
|
+
- If the user asks to "save a note", "remember this", "log this to my wiki", or similar, use the \`mink-note\` skill — it captures into the user's \`~/.mink/\` vault.
|
|
3136
|
+
- If a hook surfaces a learning, past bug, or repeat-read warning, treat that as authoritative project memory and follow it.
|
|
3137
|
+
- The \`mink dashboard\` and \`mink agent\` commands are user tools — do not invoke them on the user's behalf.
|
|
3138
|
+
`;
|
|
3113
3139
|
var init_init = __esm(() => {
|
|
3114
3140
|
init_paths();
|
|
3115
3141
|
init_project_id();
|
|
@@ -7316,12 +7342,256 @@ var init_dashboard = __esm(() => {
|
|
|
7316
7342
|
init_paths();
|
|
7317
7343
|
});
|
|
7318
7344
|
|
|
7345
|
+
// src/commands/init.ts
|
|
7346
|
+
import { execSync as execSync4 } from "child_process";
|
|
7347
|
+
import { mkdirSync as mkdirSync11, existsSync as existsSync22 } from "fs";
|
|
7348
|
+
import { resolve as resolve5, dirname as dirname8, basename as basename8, join as join22 } from "path";
|
|
7349
|
+
function detectRuntime2() {
|
|
7350
|
+
try {
|
|
7351
|
+
execSync4("bun --version", { stdio: "ignore" });
|
|
7352
|
+
return "bun";
|
|
7353
|
+
} catch {
|
|
7354
|
+
return "node";
|
|
7355
|
+
}
|
|
7356
|
+
}
|
|
7357
|
+
function resolveCliPath2() {
|
|
7358
|
+
const selfPath = new URL(import.meta.url).pathname;
|
|
7359
|
+
const selfDir = dirname8(selfPath);
|
|
7360
|
+
if (selfPath.endsWith("dist/cli.js")) {
|
|
7361
|
+
return selfPath;
|
|
7362
|
+
}
|
|
7363
|
+
const projectRoot = resolve5(selfDir, "../..");
|
|
7364
|
+
const distPath = join22(projectRoot, "dist", "cli.js");
|
|
7365
|
+
if (existsSync22(distPath))
|
|
7366
|
+
return distPath;
|
|
7367
|
+
return resolve5(selfDir, "../cli.ts");
|
|
7368
|
+
}
|
|
7369
|
+
function buildHooksConfig2(runtime, cliPath) {
|
|
7370
|
+
const isTsSource = cliPath.endsWith(".ts");
|
|
7371
|
+
const prefix = isTsSource ? `bun run ${cliPath}` : runtime === "bun" ? `bun run ${cliPath}` : `node ${cliPath}`;
|
|
7372
|
+
const hook = (cmd) => [{ type: "command", command: cmd }];
|
|
7373
|
+
return {
|
|
7374
|
+
SessionStart: [{ matcher: "", hooks: hook(`${prefix} session-start`) }],
|
|
7375
|
+
Stop: [{ matcher: "", hooks: hook(`${prefix} session-stop`) }],
|
|
7376
|
+
PreToolUse: [
|
|
7377
|
+
{ matcher: "Read", hooks: hook(`${prefix} pre-read`) },
|
|
7378
|
+
{ matcher: "Edit", hooks: hook(`${prefix} pre-write`) },
|
|
7379
|
+
{ matcher: "Write", hooks: hook(`${prefix} pre-write`) }
|
|
7380
|
+
],
|
|
7381
|
+
PostToolUse: [
|
|
7382
|
+
{ matcher: "Read", hooks: hook(`${prefix} post-read`) },
|
|
7383
|
+
{ matcher: "Edit", hooks: hook(`${prefix} post-write`) },
|
|
7384
|
+
{ matcher: "Write", hooks: hook(`${prefix} post-write`) }
|
|
7385
|
+
]
|
|
7386
|
+
};
|
|
7387
|
+
}
|
|
7388
|
+
function isMinkCommand2(cmd) {
|
|
7389
|
+
return cmd.includes("cli") && (cmd.includes("session-start") || cmd.includes("session-stop") || cmd.includes("pre-read") || cmd.includes("post-read") || cmd.includes("pre-write") || cmd.includes("post-write"));
|
|
7390
|
+
}
|
|
7391
|
+
function isMinkHook2(entry) {
|
|
7392
|
+
if (Array.isArray(entry.hooks)) {
|
|
7393
|
+
return entry.hooks.some((h) => isMinkCommand2(h.command));
|
|
7394
|
+
}
|
|
7395
|
+
if (typeof entry.command === "string") {
|
|
7396
|
+
return isMinkCommand2(entry.command);
|
|
7397
|
+
}
|
|
7398
|
+
return false;
|
|
7399
|
+
}
|
|
7400
|
+
function mergeHooksIntoSettings2(settingsPath, newHooks) {
|
|
7401
|
+
mkdirSync11(dirname8(settingsPath), { recursive: true });
|
|
7402
|
+
const existing = safeReadJson(settingsPath) ?? {};
|
|
7403
|
+
const existingHooks = existing.hooks ?? {};
|
|
7404
|
+
for (const [event, entries] of Object.entries(newHooks)) {
|
|
7405
|
+
const current = existingHooks[event] ?? [];
|
|
7406
|
+
const withoutMink = current.filter((e) => !isMinkHook2(e));
|
|
7407
|
+
existingHooks[event] = [...withoutMink, ...entries];
|
|
7408
|
+
}
|
|
7409
|
+
existing.hooks = existingHooks;
|
|
7410
|
+
atomicWriteJson(settingsPath, existing);
|
|
7411
|
+
}
|
|
7412
|
+
var init_init2 = __esm(() => {
|
|
7413
|
+
init_paths();
|
|
7414
|
+
init_project_id();
|
|
7415
|
+
init_fs_utils();
|
|
7416
|
+
init_vault();
|
|
7417
|
+
});
|
|
7418
|
+
|
|
7419
|
+
// src/core/daemon-service.ts
|
|
7420
|
+
import { execSync as execSync5 } from "child_process";
|
|
7421
|
+
import { existsSync as existsSync23, mkdirSync as mkdirSync12, unlinkSync as unlinkSync4, writeFileSync as writeFileSync9 } from "fs";
|
|
7422
|
+
import { homedir as homedir4 } from "os";
|
|
7423
|
+
import { dirname as dirname9, join as join23 } from "path";
|
|
7424
|
+
function detectPlatform() {
|
|
7425
|
+
if (process.platform === "linux")
|
|
7426
|
+
return "systemd";
|
|
7427
|
+
if (process.platform === "darwin")
|
|
7428
|
+
return "launchd";
|
|
7429
|
+
return null;
|
|
7430
|
+
}
|
|
7431
|
+
function resolveServiceInvocation() {
|
|
7432
|
+
const entry = process.argv[1];
|
|
7433
|
+
if (entry && !/\.(js|ts|mjs|cjs)$/.test(entry) && existsSync23(entry)) {
|
|
7434
|
+
return {
|
|
7435
|
+
executable: entry,
|
|
7436
|
+
args: ["daemon", "start"],
|
|
7437
|
+
pathDir: dirname9(entry)
|
|
7438
|
+
};
|
|
7439
|
+
}
|
|
7440
|
+
const cliPath = resolveCliPath2();
|
|
7441
|
+
const interpreter = process.execPath;
|
|
7442
|
+
return {
|
|
7443
|
+
executable: interpreter,
|
|
7444
|
+
args: [cliPath, "daemon", "start"],
|
|
7445
|
+
pathDir: dirname9(interpreter)
|
|
7446
|
+
};
|
|
7447
|
+
}
|
|
7448
|
+
function servicePaths(platform2) {
|
|
7449
|
+
const home = homedir4();
|
|
7450
|
+
if (platform2 === "systemd") {
|
|
7451
|
+
const unitDir2 = join23(home, ".config", "systemd", "user");
|
|
7452
|
+
return { unitDir: unitDir2, unitFile: join23(unitDir2, "mink-daemon.service") };
|
|
7453
|
+
}
|
|
7454
|
+
const unitDir = join23(home, "Library", "LaunchAgents");
|
|
7455
|
+
return { unitDir, unitFile: join23(unitDir, "com.mink.daemon.plist") };
|
|
7456
|
+
}
|
|
7457
|
+
function renderSystemdUnit(inv) {
|
|
7458
|
+
const execStart = [inv.executable, ...inv.args].join(" ");
|
|
7459
|
+
const stopArgs = inv.args.map((a) => a === "start" ? "stop" : a);
|
|
7460
|
+
const execStop = [inv.executable, ...stopArgs].join(" ");
|
|
7461
|
+
const pathEnv = `${inv.pathDir}:/usr/local/bin:/usr/bin:/bin`;
|
|
7462
|
+
return [
|
|
7463
|
+
"[Unit]",
|
|
7464
|
+
"Description=Mink background daemon",
|
|
7465
|
+
"After=network-online.target",
|
|
7466
|
+
"Wants=network-online.target",
|
|
7467
|
+
"",
|
|
7468
|
+
"[Service]",
|
|
7469
|
+
"Type=forking",
|
|
7470
|
+
`ExecStart=${execStart}`,
|
|
7471
|
+
`ExecStop=${execStop}`,
|
|
7472
|
+
"Restart=on-failure",
|
|
7473
|
+
"RestartSec=10",
|
|
7474
|
+
`Environment="PATH=${pathEnv}"`,
|
|
7475
|
+
"",
|
|
7476
|
+
"[Install]",
|
|
7477
|
+
"WantedBy=default.target",
|
|
7478
|
+
""
|
|
7479
|
+
].join(`
|
|
7480
|
+
`);
|
|
7481
|
+
}
|
|
7482
|
+
function renderLaunchdPlist(inv, logPath) {
|
|
7483
|
+
const programArgs = [inv.executable, ...inv.args].map((a) => ` <string>${escapeXml(a)}</string>`).join(`
|
|
7484
|
+
`);
|
|
7485
|
+
const pathEnv = `${inv.pathDir}:/usr/local/bin:/usr/bin:/bin`;
|
|
7486
|
+
return [
|
|
7487
|
+
'<?xml version="1.0" encoding="UTF-8"?>',
|
|
7488
|
+
'<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">',
|
|
7489
|
+
'<plist version="1.0">',
|
|
7490
|
+
"<dict>",
|
|
7491
|
+
" <key>Label</key>",
|
|
7492
|
+
" <string>com.mink.daemon</string>",
|
|
7493
|
+
" <key>ProgramArguments</key>",
|
|
7494
|
+
" <array>",
|
|
7495
|
+
programArgs,
|
|
7496
|
+
" </array>",
|
|
7497
|
+
" <key>RunAtLoad</key>",
|
|
7498
|
+
" <true/>",
|
|
7499
|
+
" <key>KeepAlive</key>",
|
|
7500
|
+
" <dict>",
|
|
7501
|
+
" <key>SuccessfulExit</key>",
|
|
7502
|
+
" <false/>",
|
|
7503
|
+
" </dict>",
|
|
7504
|
+
" <key>EnvironmentVariables</key>",
|
|
7505
|
+
" <dict>",
|
|
7506
|
+
" <key>PATH</key>",
|
|
7507
|
+
` <string>${escapeXml(pathEnv)}</string>`,
|
|
7508
|
+
" </dict>",
|
|
7509
|
+
" <key>StandardOutPath</key>",
|
|
7510
|
+
` <string>${escapeXml(logPath)}</string>`,
|
|
7511
|
+
" <key>StandardErrorPath</key>",
|
|
7512
|
+
` <string>${escapeXml(logPath)}</string>`,
|
|
7513
|
+
"</dict>",
|
|
7514
|
+
"</plist>",
|
|
7515
|
+
""
|
|
7516
|
+
].join(`
|
|
7517
|
+
`);
|
|
7518
|
+
}
|
|
7519
|
+
function escapeXml(s) {
|
|
7520
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
7521
|
+
}
|
|
7522
|
+
function installService(options = {}) {
|
|
7523
|
+
const platform2 = detectPlatform();
|
|
7524
|
+
if (!platform2) {
|
|
7525
|
+
console.error(`[mink] daemon install is not supported on ${process.platform} (supported: linux, darwin)`);
|
|
7526
|
+
process.exit(1);
|
|
7527
|
+
}
|
|
7528
|
+
const paths = servicePaths(platform2);
|
|
7529
|
+
if (existsSync23(paths.unitFile) && !options.force) {
|
|
7530
|
+
console.error(`[mink] unit file already exists: ${paths.unitFile}`);
|
|
7531
|
+
console.error(" re-run with --force to overwrite, or run `mink daemon uninstall` first");
|
|
7532
|
+
process.exit(1);
|
|
7533
|
+
}
|
|
7534
|
+
const inv = resolveServiceInvocation();
|
|
7535
|
+
mkdirSync12(paths.unitDir, { recursive: true });
|
|
7536
|
+
if (platform2 === "systemd") {
|
|
7537
|
+
writeFileSync9(paths.unitFile, renderSystemdUnit(inv));
|
|
7538
|
+
try {
|
|
7539
|
+
execSync5("systemctl --user daemon-reload", { stdio: "ignore" });
|
|
7540
|
+
} catch {}
|
|
7541
|
+
console.log(`[mink] wrote ${paths.unitFile}`);
|
|
7542
|
+
console.log("[mink] next steps:");
|
|
7543
|
+
console.log(" systemctl --user enable --now mink-daemon.service");
|
|
7544
|
+
console.log(" # To survive logout (one-time, requires sudo):");
|
|
7545
|
+
console.log(` sudo loginctl enable-linger ${process.env.USER ?? "$USER"}`);
|
|
7546
|
+
} else {
|
|
7547
|
+
const { schedulerLogPath: schedulerLogPath3 } = (init_paths(), __toCommonJS(exports_paths));
|
|
7548
|
+
writeFileSync9(paths.unitFile, renderLaunchdPlist(inv, schedulerLogPath3()));
|
|
7549
|
+
console.log(`[mink] wrote ${paths.unitFile}`);
|
|
7550
|
+
console.log("[mink] next steps:");
|
|
7551
|
+
console.log(` launchctl load -w ${paths.unitFile}`);
|
|
7552
|
+
console.log(" # Launch agents run automatically on login; no lingering needed.");
|
|
7553
|
+
}
|
|
7554
|
+
}
|
|
7555
|
+
function uninstallService() {
|
|
7556
|
+
const platform2 = detectPlatform();
|
|
7557
|
+
if (!platform2) {
|
|
7558
|
+
console.error(`[mink] daemon uninstall is not supported on ${process.platform} (supported: linux, darwin)`);
|
|
7559
|
+
process.exit(1);
|
|
7560
|
+
}
|
|
7561
|
+
const paths = servicePaths(platform2);
|
|
7562
|
+
if (!existsSync23(paths.unitFile)) {
|
|
7563
|
+
console.log(`[mink] no unit file at ${paths.unitFile} — nothing to uninstall`);
|
|
7564
|
+
return;
|
|
7565
|
+
}
|
|
7566
|
+
if (platform2 === "systemd") {
|
|
7567
|
+
try {
|
|
7568
|
+
execSync5("systemctl --user disable --now mink-daemon.service", {
|
|
7569
|
+
stdio: "ignore"
|
|
7570
|
+
});
|
|
7571
|
+
} catch {}
|
|
7572
|
+
unlinkSync4(paths.unitFile);
|
|
7573
|
+
try {
|
|
7574
|
+
execSync5("systemctl --user daemon-reload", { stdio: "ignore" });
|
|
7575
|
+
} catch {}
|
|
7576
|
+
console.log(`[mink] removed ${paths.unitFile}`);
|
|
7577
|
+
} else {
|
|
7578
|
+
try {
|
|
7579
|
+
execSync5(`launchctl unload -w ${paths.unitFile}`, { stdio: "ignore" });
|
|
7580
|
+
} catch {}
|
|
7581
|
+
unlinkSync4(paths.unitFile);
|
|
7582
|
+
console.log(`[mink] removed ${paths.unitFile}`);
|
|
7583
|
+
}
|
|
7584
|
+
}
|
|
7585
|
+
var init_daemon_service = __esm(() => {
|
|
7586
|
+
init_init2();
|
|
7587
|
+
});
|
|
7588
|
+
|
|
7319
7589
|
// src/commands/daemon.ts
|
|
7320
7590
|
var exports_daemon = {};
|
|
7321
7591
|
__export(exports_daemon, {
|
|
7322
7592
|
daemon: () => daemon
|
|
7323
7593
|
});
|
|
7324
|
-
import { readFileSync as readFileSync22, existsSync as
|
|
7594
|
+
import { readFileSync as readFileSync22, existsSync as existsSync24 } from "fs";
|
|
7325
7595
|
async function daemon(cwd, args) {
|
|
7326
7596
|
const subcommand = args[0];
|
|
7327
7597
|
switch (subcommand) {
|
|
@@ -7337,7 +7607,7 @@ async function daemon(cwd, args) {
|
|
|
7337
7607
|
break;
|
|
7338
7608
|
case "logs": {
|
|
7339
7609
|
const logPath = schedulerLogPath();
|
|
7340
|
-
if (!
|
|
7610
|
+
if (!existsSync24(logPath)) {
|
|
7341
7611
|
console.log("[mink] no log file found");
|
|
7342
7612
|
return;
|
|
7343
7613
|
}
|
|
@@ -7353,14 +7623,21 @@ async function daemon(cwd, args) {
|
|
|
7353
7623
|
}
|
|
7354
7624
|
break;
|
|
7355
7625
|
}
|
|
7626
|
+
case "install":
|
|
7627
|
+
installService({ force: args.includes("--force") });
|
|
7628
|
+
break;
|
|
7629
|
+
case "uninstall":
|
|
7630
|
+
uninstallService();
|
|
7631
|
+
break;
|
|
7356
7632
|
default:
|
|
7357
7633
|
console.error(`[mink] unknown daemon subcommand: ${subcommand ?? "(none)"}`);
|
|
7358
|
-
console.error("Usage: mink daemon <start|stop|restart|logs>");
|
|
7634
|
+
console.error("Usage: mink daemon <start|stop|restart|logs|install|uninstall>");
|
|
7359
7635
|
process.exit(1);
|
|
7360
7636
|
}
|
|
7361
7637
|
}
|
|
7362
7638
|
var init_daemon2 = __esm(() => {
|
|
7363
7639
|
init_daemon();
|
|
7640
|
+
init_daemon_service();
|
|
7364
7641
|
init_paths();
|
|
7365
7642
|
});
|
|
7366
7643
|
|
|
@@ -7602,13 +7879,13 @@ function printValidKeys() {
|
|
|
7602
7879
|
}
|
|
7603
7880
|
}
|
|
7604
7881
|
function readLineFromStdin() {
|
|
7605
|
-
return new Promise((
|
|
7882
|
+
return new Promise((resolve7) => {
|
|
7606
7883
|
const chunks = [];
|
|
7607
7884
|
process.stdin.resume();
|
|
7608
7885
|
process.stdin.setEncoding("utf-8");
|
|
7609
7886
|
process.stdin.once("data", (data) => {
|
|
7610
7887
|
process.stdin.pause();
|
|
7611
|
-
|
|
7888
|
+
resolve7(String(data).trim());
|
|
7612
7889
|
});
|
|
7613
7890
|
});
|
|
7614
7891
|
}
|
|
@@ -7678,74 +7955,12 @@ var init_config2 = __esm(() => {
|
|
|
7678
7955
|
init_global_config();
|
|
7679
7956
|
});
|
|
7680
7957
|
|
|
7681
|
-
// src/commands/init.ts
|
|
7682
|
-
import { execSync as execSync4 } from "child_process";
|
|
7683
|
-
import { mkdirSync as mkdirSync11, existsSync as existsSync23 } from "fs";
|
|
7684
|
-
import { resolve as resolve5, dirname as dirname8, basename as basename8, join as join22 } from "path";
|
|
7685
|
-
function detectRuntime2() {
|
|
7686
|
-
try {
|
|
7687
|
-
execSync4("bun --version", { stdio: "ignore" });
|
|
7688
|
-
return "bun";
|
|
7689
|
-
} catch {
|
|
7690
|
-
return "node";
|
|
7691
|
-
}
|
|
7692
|
-
}
|
|
7693
|
-
function buildHooksConfig2(runtime, cliPath) {
|
|
7694
|
-
const isTsSource = cliPath.endsWith(".ts");
|
|
7695
|
-
const prefix = isTsSource ? `bun run ${cliPath}` : runtime === "bun" ? `bun run ${cliPath}` : `node ${cliPath}`;
|
|
7696
|
-
const hook = (cmd) => [{ type: "command", command: cmd }];
|
|
7697
|
-
return {
|
|
7698
|
-
SessionStart: [{ matcher: "", hooks: hook(`${prefix} session-start`) }],
|
|
7699
|
-
Stop: [{ matcher: "", hooks: hook(`${prefix} session-stop`) }],
|
|
7700
|
-
PreToolUse: [
|
|
7701
|
-
{ matcher: "Read", hooks: hook(`${prefix} pre-read`) },
|
|
7702
|
-
{ matcher: "Edit", hooks: hook(`${prefix} pre-write`) },
|
|
7703
|
-
{ matcher: "Write", hooks: hook(`${prefix} pre-write`) }
|
|
7704
|
-
],
|
|
7705
|
-
PostToolUse: [
|
|
7706
|
-
{ matcher: "Read", hooks: hook(`${prefix} post-read`) },
|
|
7707
|
-
{ matcher: "Edit", hooks: hook(`${prefix} post-write`) },
|
|
7708
|
-
{ matcher: "Write", hooks: hook(`${prefix} post-write`) }
|
|
7709
|
-
]
|
|
7710
|
-
};
|
|
7711
|
-
}
|
|
7712
|
-
function isMinkCommand2(cmd) {
|
|
7713
|
-
return cmd.includes("cli") && (cmd.includes("session-start") || cmd.includes("session-stop") || cmd.includes("pre-read") || cmd.includes("post-read") || cmd.includes("pre-write") || cmd.includes("post-write"));
|
|
7714
|
-
}
|
|
7715
|
-
function isMinkHook2(entry) {
|
|
7716
|
-
if (Array.isArray(entry.hooks)) {
|
|
7717
|
-
return entry.hooks.some((h) => isMinkCommand2(h.command));
|
|
7718
|
-
}
|
|
7719
|
-
if (typeof entry.command === "string") {
|
|
7720
|
-
return isMinkCommand2(entry.command);
|
|
7721
|
-
}
|
|
7722
|
-
return false;
|
|
7723
|
-
}
|
|
7724
|
-
function mergeHooksIntoSettings2(settingsPath, newHooks) {
|
|
7725
|
-
mkdirSync11(dirname8(settingsPath), { recursive: true });
|
|
7726
|
-
const existing = safeReadJson(settingsPath) ?? {};
|
|
7727
|
-
const existingHooks = existing.hooks ?? {};
|
|
7728
|
-
for (const [event, entries] of Object.entries(newHooks)) {
|
|
7729
|
-
const current = existingHooks[event] ?? [];
|
|
7730
|
-
const withoutMink = current.filter((e) => !isMinkHook2(e));
|
|
7731
|
-
existingHooks[event] = [...withoutMink, ...entries];
|
|
7732
|
-
}
|
|
7733
|
-
existing.hooks = existingHooks;
|
|
7734
|
-
atomicWriteJson(settingsPath, existing);
|
|
7735
|
-
}
|
|
7736
|
-
var init_init2 = __esm(() => {
|
|
7737
|
-
init_paths();
|
|
7738
|
-
init_project_id();
|
|
7739
|
-
init_fs_utils();
|
|
7740
|
-
init_vault();
|
|
7741
|
-
});
|
|
7742
|
-
|
|
7743
7958
|
// src/commands/update.ts
|
|
7744
7959
|
var exports_update = {};
|
|
7745
7960
|
__export(exports_update, {
|
|
7746
7961
|
update: () => update
|
|
7747
7962
|
});
|
|
7748
|
-
import { resolve as
|
|
7963
|
+
import { resolve as resolve7, dirname as dirname10 } from "path";
|
|
7749
7964
|
function parseArgs(args) {
|
|
7750
7965
|
let dryRun = false;
|
|
7751
7966
|
let project = null;
|
|
@@ -7793,7 +8008,7 @@ async function update(cwd, args) {
|
|
|
7793
8008
|
return;
|
|
7794
8009
|
}
|
|
7795
8010
|
const runtime = detectRuntime2();
|
|
7796
|
-
const cliPath =
|
|
8011
|
+
const cliPath = resolve7(dirname10(new URL(import.meta.url).pathname), "../cli.ts");
|
|
7797
8012
|
const newHooks = buildHooksConfig2(runtime, cliPath);
|
|
7798
8013
|
for (const target of targets) {
|
|
7799
8014
|
console.log(`[mink] updating: ${target.name} (${target.id})`);
|
|
@@ -7804,7 +8019,7 @@ async function update(cwd, args) {
|
|
|
7804
8019
|
}
|
|
7805
8020
|
const backupName = createBackup(target.cwd);
|
|
7806
8021
|
console.log(` backup: ${backupName}`);
|
|
7807
|
-
const settingsPath =
|
|
8022
|
+
const settingsPath = resolve7(target.cwd, ".claude", "settings.json");
|
|
7808
8023
|
mergeHooksIntoSettings2(settingsPath, newHooks);
|
|
7809
8024
|
console.log(" hooks: updated");
|
|
7810
8025
|
const metaPath = projectMetaPath(target.cwd);
|
|
@@ -7863,7 +8078,7 @@ var init_restore = __esm(() => {
|
|
|
7863
8078
|
|
|
7864
8079
|
// src/core/design-eval/server-detect.ts
|
|
7865
8080
|
import { readFileSync as readFileSync23 } from "fs";
|
|
7866
|
-
import { join as
|
|
8081
|
+
import { join as join24 } from "path";
|
|
7867
8082
|
async function probePort(port) {
|
|
7868
8083
|
try {
|
|
7869
8084
|
const controller = new AbortController;
|
|
@@ -7885,7 +8100,7 @@ async function findRunningServer(ports = DEFAULT_PROBE_PORTS) {
|
|
|
7885
8100
|
}
|
|
7886
8101
|
function detectDevCommand(cwd) {
|
|
7887
8102
|
try {
|
|
7888
|
-
const raw = readFileSync23(
|
|
8103
|
+
const raw = readFileSync23(join24(cwd, "package.json"), "utf-8");
|
|
7889
8104
|
const pkg = JSON.parse(raw);
|
|
7890
8105
|
const scripts = pkg.scripts;
|
|
7891
8106
|
if (!scripts || typeof scripts !== "object")
|
|
@@ -7905,10 +8120,10 @@ var init_server_detect = __esm(() => {
|
|
|
7905
8120
|
});
|
|
7906
8121
|
|
|
7907
8122
|
// src/core/design-eval/route-detect.ts
|
|
7908
|
-
import { existsSync as
|
|
7909
|
-
import { join as
|
|
8123
|
+
import { existsSync as existsSync25, readdirSync as readdirSync7, statSync as statSync9 } from "fs";
|
|
8124
|
+
import { join as join25, relative as relative6, sep as sep2 } from "path";
|
|
7910
8125
|
function detectFramework(cwd) {
|
|
7911
|
-
const has = (name) => ["js", "mjs", "ts", "cjs"].some((ext) =>
|
|
8126
|
+
const has = (name) => ["js", "mjs", "ts", "cjs"].some((ext) => existsSync25(join25(cwd, `${name}.${ext}`))) || existsSync25(join25(cwd, name));
|
|
7912
8127
|
if (has("next.config"))
|
|
7913
8128
|
return "nextjs";
|
|
7914
8129
|
if (has("svelte.config"))
|
|
@@ -7933,8 +8148,8 @@ function detectRoutes(cwd) {
|
|
|
7933
8148
|
}
|
|
7934
8149
|
function detectNextRoutes(cwd) {
|
|
7935
8150
|
const routes = [];
|
|
7936
|
-
const appDir =
|
|
7937
|
-
if (
|
|
8151
|
+
const appDir = join25(cwd, "app");
|
|
8152
|
+
if (existsSync25(appDir)) {
|
|
7938
8153
|
const pageFiles = findFiles(appDir, /^page\.(tsx?|jsx?)$/);
|
|
7939
8154
|
for (const file of pageFiles) {
|
|
7940
8155
|
const rel = relative6(appDir, file);
|
|
@@ -7945,8 +8160,8 @@ function detectNextRoutes(cwd) {
|
|
|
7945
8160
|
routes.push(route);
|
|
7946
8161
|
}
|
|
7947
8162
|
}
|
|
7948
|
-
const pagesDir =
|
|
7949
|
-
if (
|
|
8163
|
+
const pagesDir = join25(cwd, "pages");
|
|
8164
|
+
if (existsSync25(pagesDir)) {
|
|
7950
8165
|
const pageFiles = findFiles(pagesDir, /\.(tsx?|jsx?)$/);
|
|
7951
8166
|
for (const file of pageFiles) {
|
|
7952
8167
|
const rel = relative6(pagesDir, file);
|
|
@@ -7965,8 +8180,8 @@ function detectNextRoutes(cwd) {
|
|
|
7965
8180
|
return unique.length > 0 ? unique.sort() : ["/"];
|
|
7966
8181
|
}
|
|
7967
8182
|
function detectSvelteKitRoutes(cwd) {
|
|
7968
|
-
const routesDir =
|
|
7969
|
-
if (!
|
|
8183
|
+
const routesDir = join25(cwd, "src", "routes");
|
|
8184
|
+
if (!existsSync25(routesDir))
|
|
7970
8185
|
return ["/"];
|
|
7971
8186
|
const routes = [];
|
|
7972
8187
|
const pageFiles = findFiles(routesDir, /^\+page\.svelte$/);
|
|
@@ -7981,8 +8196,8 @@ function detectSvelteKitRoutes(cwd) {
|
|
|
7981
8196
|
return routes.length > 0 ? routes.sort() : ["/"];
|
|
7982
8197
|
}
|
|
7983
8198
|
function detectNuxtRoutes(cwd) {
|
|
7984
|
-
const pagesDir =
|
|
7985
|
-
if (!
|
|
8199
|
+
const pagesDir = join25(cwd, "pages");
|
|
8200
|
+
if (!existsSync25(pagesDir))
|
|
7986
8201
|
return ["/"];
|
|
7987
8202
|
const routes = [];
|
|
7988
8203
|
const vueFiles = findFiles(pagesDir, /\.vue$/);
|
|
@@ -8008,7 +8223,7 @@ function findFiles(dir, pattern) {
|
|
|
8008
8223
|
for (const entry of entries) {
|
|
8009
8224
|
if (entry.startsWith(".") || entry === "node_modules")
|
|
8010
8225
|
continue;
|
|
8011
|
-
const full =
|
|
8226
|
+
const full = join25(current, entry);
|
|
8012
8227
|
try {
|
|
8013
8228
|
const stat2 = statSync9(full);
|
|
8014
8229
|
if (stat2.isDirectory()) {
|
|
@@ -8036,11 +8251,11 @@ function __extends(d, b) {
|
|
|
8036
8251
|
}
|
|
8037
8252
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
8038
8253
|
function adopt(value) {
|
|
8039
|
-
return value instanceof P ? value : new P(function(
|
|
8040
|
-
|
|
8254
|
+
return value instanceof P ? value : new P(function(resolve8) {
|
|
8255
|
+
resolve8(value);
|
|
8041
8256
|
});
|
|
8042
8257
|
}
|
|
8043
|
-
return new (P || (P = Promise))(function(
|
|
8258
|
+
return new (P || (P = Promise))(function(resolve8, reject) {
|
|
8044
8259
|
function fulfilled(value) {
|
|
8045
8260
|
try {
|
|
8046
8261
|
step(generator.next(value));
|
|
@@ -8056,7 +8271,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
8056
8271
|
}
|
|
8057
8272
|
}
|
|
8058
8273
|
function step(result) {
|
|
8059
|
-
result.done ?
|
|
8274
|
+
result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
8060
8275
|
}
|
|
8061
8276
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8062
8277
|
});
|
|
@@ -8239,14 +8454,14 @@ function __asyncValues(o) {
|
|
|
8239
8454
|
}, i);
|
|
8240
8455
|
function verb(n) {
|
|
8241
8456
|
i[n] = o[n] && function(v) {
|
|
8242
|
-
return new Promise(function(
|
|
8243
|
-
v = o[n](v), settle(
|
|
8457
|
+
return new Promise(function(resolve8, reject) {
|
|
8458
|
+
v = o[n](v), settle(resolve8, reject, v.done, v.value);
|
|
8244
8459
|
});
|
|
8245
8460
|
};
|
|
8246
8461
|
}
|
|
8247
|
-
function settle(
|
|
8462
|
+
function settle(resolve8, reject, d, v) {
|
|
8248
8463
|
Promise.resolve(v).then(function(v2) {
|
|
8249
|
-
|
|
8464
|
+
resolve8({ value: v2, done: d });
|
|
8250
8465
|
}, reject);
|
|
8251
8466
|
}
|
|
8252
8467
|
}
|
|
@@ -8777,7 +8992,7 @@ function of() {
|
|
|
8777
8992
|
}
|
|
8778
8993
|
function lastValueFrom(source, config22) {
|
|
8779
8994
|
var hasConfig = typeof config22 === "object";
|
|
8780
|
-
return new Promise(function(
|
|
8995
|
+
return new Promise(function(resolve8, reject) {
|
|
8781
8996
|
var _hasValue = false;
|
|
8782
8997
|
var _value;
|
|
8783
8998
|
source.subscribe({
|
|
@@ -8788,9 +9003,9 @@ function lastValueFrom(source, config22) {
|
|
|
8788
9003
|
error: reject,
|
|
8789
9004
|
complete: function() {
|
|
8790
9005
|
if (_hasValue) {
|
|
8791
|
-
|
|
9006
|
+
resolve8(_value);
|
|
8792
9007
|
} else if (hasConfig) {
|
|
8793
|
-
|
|
9008
|
+
resolve8(config22.defaultValue);
|
|
8794
9009
|
} else {
|
|
8795
9010
|
reject(new EmptyError);
|
|
8796
9011
|
}
|
|
@@ -8800,16 +9015,16 @@ function lastValueFrom(source, config22) {
|
|
|
8800
9015
|
}
|
|
8801
9016
|
function firstValueFrom(source, config22) {
|
|
8802
9017
|
var hasConfig = typeof config22 === "object";
|
|
8803
|
-
return new Promise(function(
|
|
9018
|
+
return new Promise(function(resolve8, reject) {
|
|
8804
9019
|
var subscriber = new SafeSubscriber({
|
|
8805
9020
|
next: function(value) {
|
|
8806
|
-
|
|
9021
|
+
resolve8(value);
|
|
8807
9022
|
subscriber.unsubscribe();
|
|
8808
9023
|
},
|
|
8809
9024
|
error: reject,
|
|
8810
9025
|
complete: function() {
|
|
8811
9026
|
if (hasConfig) {
|
|
8812
|
-
|
|
9027
|
+
resolve8(config22.defaultValue);
|
|
8813
9028
|
} else {
|
|
8814
9029
|
reject(new EmptyError);
|
|
8815
9030
|
}
|
|
@@ -9861,7 +10076,7 @@ var init_rxjs = __esm(() => {
|
|
|
9861
10076
|
Observable2.prototype.forEach = function(next, promiseCtor) {
|
|
9862
10077
|
var _this = this;
|
|
9863
10078
|
promiseCtor = getPromiseCtor(promiseCtor);
|
|
9864
|
-
return new promiseCtor(function(
|
|
10079
|
+
return new promiseCtor(function(resolve8, reject) {
|
|
9865
10080
|
var subscriber = new SafeSubscriber({
|
|
9866
10081
|
next: function(value) {
|
|
9867
10082
|
try {
|
|
@@ -9872,7 +10087,7 @@ var init_rxjs = __esm(() => {
|
|
|
9872
10087
|
}
|
|
9873
10088
|
},
|
|
9874
10089
|
error: reject,
|
|
9875
|
-
complete:
|
|
10090
|
+
complete: resolve8
|
|
9876
10091
|
});
|
|
9877
10092
|
_this.subscribe(subscriber);
|
|
9878
10093
|
});
|
|
@@ -9894,14 +10109,14 @@ var init_rxjs = __esm(() => {
|
|
|
9894
10109
|
Observable2.prototype.toPromise = function(promiseCtor) {
|
|
9895
10110
|
var _this = this;
|
|
9896
10111
|
promiseCtor = getPromiseCtor(promiseCtor);
|
|
9897
|
-
return new promiseCtor(function(
|
|
10112
|
+
return new promiseCtor(function(resolve8, reject) {
|
|
9898
10113
|
var value;
|
|
9899
10114
|
_this.subscribe(function(x) {
|
|
9900
10115
|
return value = x;
|
|
9901
10116
|
}, function(err) {
|
|
9902
10117
|
return reject(err);
|
|
9903
10118
|
}, function() {
|
|
9904
|
-
return
|
|
10119
|
+
return resolve8(value);
|
|
9905
10120
|
});
|
|
9906
10121
|
});
|
|
9907
10122
|
};
|
|
@@ -11827,8 +12042,8 @@ class Deferred {
|
|
|
11827
12042
|
#isRejected = false;
|
|
11828
12043
|
#value;
|
|
11829
12044
|
#resolve;
|
|
11830
|
-
#taskPromise = new Promise((
|
|
11831
|
-
this.#resolve =
|
|
12045
|
+
#taskPromise = new Promise((resolve8) => {
|
|
12046
|
+
this.#resolve = resolve8;
|
|
11832
12047
|
});
|
|
11833
12048
|
#timeoutId;
|
|
11834
12049
|
#timeoutError;
|
|
@@ -11917,12 +12132,12 @@ var init_Mutex = __esm(() => {
|
|
|
11917
12132
|
return new Mutex.Guard(this, onRelease);
|
|
11918
12133
|
}
|
|
11919
12134
|
release() {
|
|
11920
|
-
const
|
|
11921
|
-
if (!
|
|
12135
|
+
const resolve8 = this.#acquirers.shift();
|
|
12136
|
+
if (!resolve8) {
|
|
11922
12137
|
this.#locked = false;
|
|
11923
12138
|
return;
|
|
11924
12139
|
}
|
|
11925
|
-
|
|
12140
|
+
resolve8();
|
|
11926
12141
|
}
|
|
11927
12142
|
};
|
|
11928
12143
|
});
|
|
@@ -13666,12 +13881,12 @@ var init_locators = __esm(() => {
|
|
|
13666
13881
|
}
|
|
13667
13882
|
return defer(() => {
|
|
13668
13883
|
return from(handle.evaluate((element) => {
|
|
13669
|
-
return new Promise((
|
|
13884
|
+
return new Promise((resolve8) => {
|
|
13670
13885
|
window.requestAnimationFrame(() => {
|
|
13671
13886
|
const rect1 = element.getBoundingClientRect();
|
|
13672
13887
|
window.requestAnimationFrame(() => {
|
|
13673
13888
|
const rect2 = element.getBoundingClientRect();
|
|
13674
|
-
|
|
13889
|
+
resolve8([
|
|
13675
13890
|
{
|
|
13676
13891
|
x: rect1.x,
|
|
13677
13892
|
y: rect1.y,
|
|
@@ -14962,9 +15177,9 @@ var init_ElementHandle = __esm(() => {
|
|
|
14962
15177
|
const handle = await this.#asSVGElementHandle();
|
|
14963
15178
|
const target = __addDisposableResource6(env_5, handle && await handle.#getOwnerSVGElement(), false);
|
|
14964
15179
|
return await (target ?? this).evaluate(async (element, threshold) => {
|
|
14965
|
-
const visibleRatio = await new Promise((
|
|
15180
|
+
const visibleRatio = await new Promise((resolve8) => {
|
|
14966
15181
|
const observer = new IntersectionObserver((entries) => {
|
|
14967
|
-
|
|
15182
|
+
resolve8(entries[0].intersectionRatio);
|
|
14968
15183
|
observer.disconnect();
|
|
14969
15184
|
});
|
|
14970
15185
|
observer.observe(element);
|
|
@@ -15358,7 +15573,7 @@ var init_Frame = __esm(() => {
|
|
|
15358
15573
|
}
|
|
15359
15574
|
type = type ?? "text/javascript";
|
|
15360
15575
|
return await this.mainRealm().transferHandle(await this.isolatedRealm().evaluateHandle(async ({ url, id, type: type2, content: content2 }) => {
|
|
15361
|
-
return await new Promise((
|
|
15576
|
+
return await new Promise((resolve8, reject) => {
|
|
15362
15577
|
const script = document.createElement("script");
|
|
15363
15578
|
script.type = type2;
|
|
15364
15579
|
script.text = content2;
|
|
@@ -15371,12 +15586,12 @@ var init_Frame = __esm(() => {
|
|
|
15371
15586
|
if (url) {
|
|
15372
15587
|
script.src = url;
|
|
15373
15588
|
script.addEventListener("load", () => {
|
|
15374
|
-
|
|
15589
|
+
resolve8(script);
|
|
15375
15590
|
}, { once: true });
|
|
15376
15591
|
document.head.appendChild(script);
|
|
15377
15592
|
} else {
|
|
15378
15593
|
document.head.appendChild(script);
|
|
15379
|
-
|
|
15594
|
+
resolve8(script);
|
|
15380
15595
|
}
|
|
15381
15596
|
});
|
|
15382
15597
|
}, { ...options, type, content }));
|
|
@@ -15393,7 +15608,7 @@ var init_Frame = __esm(() => {
|
|
|
15393
15608
|
options.content = content;
|
|
15394
15609
|
}
|
|
15395
15610
|
return await this.mainRealm().transferHandle(await this.isolatedRealm().evaluateHandle(async ({ url, content: content2 }) => {
|
|
15396
|
-
return await new Promise((
|
|
15611
|
+
return await new Promise((resolve8, reject) => {
|
|
15397
15612
|
let element;
|
|
15398
15613
|
if (!url) {
|
|
15399
15614
|
element = document.createElement("style");
|
|
@@ -15405,7 +15620,7 @@ var init_Frame = __esm(() => {
|
|
|
15405
15620
|
element = link;
|
|
15406
15621
|
}
|
|
15407
15622
|
element.addEventListener("load", () => {
|
|
15408
|
-
|
|
15623
|
+
resolve8(element);
|
|
15409
15624
|
}, { once: true });
|
|
15410
15625
|
element.addEventListener("error", (event) => {
|
|
15411
15626
|
reject(new Error(event.message ?? "Could not load style"));
|
|
@@ -16259,9 +16474,9 @@ var init_Page = __esm(() => {
|
|
|
16259
16474
|
++this.#screencastSessionCount;
|
|
16260
16475
|
if (!this.#startScreencastPromise) {
|
|
16261
16476
|
this.#startScreencastPromise = this.mainFrame().client.send("Page.startScreencast", { format: "png" }).then(() => {
|
|
16262
|
-
return new Promise((
|
|
16477
|
+
return new Promise((resolve8) => {
|
|
16263
16478
|
return this.mainFrame().client.once("Page.screencastFrame", () => {
|
|
16264
|
-
return
|
|
16479
|
+
return resolve8();
|
|
16265
16480
|
});
|
|
16266
16481
|
});
|
|
16267
16482
|
});
|
|
@@ -18919,11 +19134,11 @@ function addPageBinding(type, name, prefix) {
|
|
|
18919
19134
|
return value instanceof Node;
|
|
18920
19135
|
})
|
|
18921
19136
|
}));
|
|
18922
|
-
return new Promise((
|
|
19137
|
+
return new Promise((resolve8, reject) => {
|
|
18923
19138
|
callPuppeteer.callbacks.set(seq, {
|
|
18924
19139
|
resolve(value) {
|
|
18925
19140
|
callPuppeteer.args.delete(seq);
|
|
18926
|
-
|
|
19141
|
+
resolve8(value);
|
|
18927
19142
|
},
|
|
18928
19143
|
reject(value) {
|
|
18929
19144
|
callPuppeteer.args.delete(seq);
|
|
@@ -22386,8 +22601,8 @@ var init_Input2 = __esm(() => {
|
|
|
22386
22601
|
if (typeof delay === "number") {
|
|
22387
22602
|
await Promise.all(actions);
|
|
22388
22603
|
actions.length = 0;
|
|
22389
|
-
await new Promise((
|
|
22390
|
-
setTimeout(
|
|
22604
|
+
await new Promise((resolve8) => {
|
|
22605
|
+
setTimeout(resolve8, delay);
|
|
22391
22606
|
});
|
|
22392
22607
|
}
|
|
22393
22608
|
actions.push(this.up({ ...options, clickCount }));
|
|
@@ -22407,9 +22622,9 @@ var init_Input2 = __esm(() => {
|
|
|
22407
22622
|
});
|
|
22408
22623
|
}
|
|
22409
22624
|
async drag(start, target) {
|
|
22410
|
-
const promise = new Promise((
|
|
22625
|
+
const promise = new Promise((resolve8) => {
|
|
22411
22626
|
this.#client.once("Input.dragIntercepted", (event) => {
|
|
22412
|
-
return
|
|
22627
|
+
return resolve8(event.data);
|
|
22413
22628
|
});
|
|
22414
22629
|
});
|
|
22415
22630
|
await this.move(start.x, start.y);
|
|
@@ -22450,8 +22665,8 @@ var init_Input2 = __esm(() => {
|
|
|
22450
22665
|
await this.dragEnter(target, data);
|
|
22451
22666
|
await this.dragOver(target, data);
|
|
22452
22667
|
if (delay) {
|
|
22453
|
-
await new Promise((
|
|
22454
|
-
return setTimeout(
|
|
22668
|
+
await new Promise((resolve8) => {
|
|
22669
|
+
return setTimeout(resolve8, delay);
|
|
22455
22670
|
});
|
|
22456
22671
|
}
|
|
22457
22672
|
await this.drop(target, data);
|
|
@@ -23263,9 +23478,9 @@ var init_Page2 = __esm(() => {
|
|
|
23263
23478
|
async captureHeapSnapshot(options) {
|
|
23264
23479
|
const { createWriteStream } = environment.value.fs;
|
|
23265
23480
|
const stream = createWriteStream(options.path);
|
|
23266
|
-
const streamPromise = new Promise((
|
|
23481
|
+
const streamPromise = new Promise((resolve8, reject) => {
|
|
23267
23482
|
stream.on("error", reject);
|
|
23268
|
-
stream.on("finish",
|
|
23483
|
+
stream.on("finish", resolve8);
|
|
23269
23484
|
});
|
|
23270
23485
|
const client = this.#primaryTargetClient;
|
|
23271
23486
|
await client.send("HeapProfiler.enable");
|
|
@@ -24778,10 +24993,10 @@ __export(exports_BrowserWebSocketTransport, {
|
|
|
24778
24993
|
|
|
24779
24994
|
class BrowserWebSocketTransport {
|
|
24780
24995
|
static create(url) {
|
|
24781
|
-
return new Promise((
|
|
24996
|
+
return new Promise((resolve8, reject) => {
|
|
24782
24997
|
const ws = new WebSocket(url);
|
|
24783
24998
|
ws.addEventListener("open", () => {
|
|
24784
|
-
return
|
|
24999
|
+
return resolve8(new BrowserWebSocketTransport(ws));
|
|
24785
25000
|
});
|
|
24786
25001
|
ws.addEventListener("error", reject);
|
|
24787
25002
|
});
|
|
@@ -27615,11 +27830,11 @@ var require_BrowsingContextProcessor = __commonJS((exports) => {
|
|
|
27615
27830
|
}
|
|
27616
27831
|
const parentCdpClient = context2.cdpTarget.parentCdpClient;
|
|
27617
27832
|
try {
|
|
27618
|
-
const detachedFromTargetPromise = new Promise((
|
|
27833
|
+
const detachedFromTargetPromise = new Promise((resolve8) => {
|
|
27619
27834
|
const onContextDestroyed = (event) => {
|
|
27620
27835
|
if (event.targetId === params.context) {
|
|
27621
27836
|
parentCdpClient.off("Target.detachedFromTarget", onContextDestroyed);
|
|
27622
|
-
|
|
27837
|
+
resolve8();
|
|
27623
27838
|
}
|
|
27624
27839
|
};
|
|
27625
27840
|
parentCdpClient.on("Target.detachedFromTarget", onContextDestroyed);
|
|
@@ -28939,7 +29154,7 @@ var require_ActionDispatcher = __commonJS((exports) => {
|
|
|
28939
29154
|
}
|
|
28940
29155
|
}
|
|
28941
29156
|
const promises = [
|
|
28942
|
-
new Promise((
|
|
29157
|
+
new Promise((resolve8) => setTimeout(resolve8, this.#tickDuration))
|
|
28943
29158
|
];
|
|
28944
29159
|
for (const option of options) {
|
|
28945
29160
|
promises.push(this.#dispatchAction(option));
|
|
@@ -29538,8 +29753,8 @@ var require_Mutex = __commonJS((exports) => {
|
|
|
29538
29753
|
acquire() {
|
|
29539
29754
|
const state = { resolved: false };
|
|
29540
29755
|
if (this.#locked) {
|
|
29541
|
-
return new Promise((
|
|
29542
|
-
this.#acquirers.push(() =>
|
|
29756
|
+
return new Promise((resolve8) => {
|
|
29757
|
+
this.#acquirers.push(() => resolve8(this.#release.bind(this, state)));
|
|
29543
29758
|
});
|
|
29544
29759
|
}
|
|
29545
29760
|
this.#locked = true;
|
|
@@ -29550,12 +29765,12 @@ var require_Mutex = __commonJS((exports) => {
|
|
|
29550
29765
|
throw new Error("Cannot release more than once.");
|
|
29551
29766
|
}
|
|
29552
29767
|
state.resolved = true;
|
|
29553
|
-
const
|
|
29554
|
-
if (!
|
|
29768
|
+
const resolve8 = this.#acquirers.shift();
|
|
29769
|
+
if (!resolve8) {
|
|
29555
29770
|
this.#locked = false;
|
|
29556
29771
|
return;
|
|
29557
29772
|
}
|
|
29558
|
-
|
|
29773
|
+
resolve8();
|
|
29559
29774
|
}
|
|
29560
29775
|
async run(action) {
|
|
29561
29776
|
const release = await this.acquire();
|
|
@@ -30682,8 +30897,8 @@ var require_ChannelProxy = __commonJS((exports) => {
|
|
|
30682
30897
|
let queueNonEmptyResolver = null;
|
|
30683
30898
|
return {
|
|
30684
30899
|
async getMessage() {
|
|
30685
|
-
const onMessage = queue.length > 0 ? Promise.resolve() : new Promise((
|
|
30686
|
-
queueNonEmptyResolver =
|
|
30900
|
+
const onMessage = queue.length > 0 ? Promise.resolve() : new Promise((resolve8) => {
|
|
30901
|
+
queueNonEmptyResolver = resolve8;
|
|
30687
30902
|
});
|
|
30688
30903
|
await onMessage;
|
|
30689
30904
|
return queue.shift();
|
|
@@ -30769,7 +30984,7 @@ var require_ChannelProxy = __commonJS((exports) => {
|
|
|
30769
30984
|
functionDeclaration: String((id) => {
|
|
30770
30985
|
const w = window;
|
|
30771
30986
|
if (w[id] === undefined) {
|
|
30772
|
-
return new Promise((
|
|
30987
|
+
return new Promise((resolve8) => w[id] = resolve8);
|
|
30773
30988
|
}
|
|
30774
30989
|
const channelProxy = w[id];
|
|
30775
30990
|
delete w[id];
|
|
@@ -32120,8 +32335,8 @@ var require_Deferred = __commonJS((exports) => {
|
|
|
32120
32335
|
return this.#result;
|
|
32121
32336
|
}
|
|
32122
32337
|
constructor() {
|
|
32123
|
-
this.#promise = new Promise((
|
|
32124
|
-
this.#resolve =
|
|
32338
|
+
this.#promise = new Promise((resolve8, reject) => {
|
|
32339
|
+
this.#resolve = resolve8;
|
|
32125
32340
|
this.#reject = reject;
|
|
32126
32341
|
});
|
|
32127
32342
|
this.#promise.catch((_error) => {});
|
|
@@ -36446,11 +36661,11 @@ var require_BrowsingContextStorage = __commonJS((exports) => {
|
|
|
36446
36661
|
if (this.#contexts.has(browsingContextId)) {
|
|
36447
36662
|
return Promise.resolve(this.getContext(browsingContextId));
|
|
36448
36663
|
}
|
|
36449
|
-
return new Promise((
|
|
36664
|
+
return new Promise((resolve8) => {
|
|
36450
36665
|
const listener = (event) => {
|
|
36451
36666
|
if (event.browsingContext.id === browsingContextId) {
|
|
36452
36667
|
this.#eventEmitter.off("added", listener);
|
|
36453
|
-
|
|
36668
|
+
resolve8(event.browsingContext);
|
|
36454
36669
|
}
|
|
36455
36670
|
};
|
|
36456
36671
|
this.#eventEmitter.on("added", listener);
|
|
@@ -39946,8 +40161,8 @@ var init_ExposedFunction = __esm(() => {
|
|
|
39946
40161
|
const functionDeclaration = stringifyFunction(interpolateFunction((callback) => {
|
|
39947
40162
|
Object.assign(globalThis, {
|
|
39948
40163
|
[PLACEHOLDER("name")]: function(...args) {
|
|
39949
|
-
return new Promise((
|
|
39950
|
-
callback([
|
|
40164
|
+
return new Promise((resolve8, reject) => {
|
|
40165
|
+
callback([resolve8, reject, args]);
|
|
39951
40166
|
});
|
|
39952
40167
|
}
|
|
39953
40168
|
});
|
|
@@ -40035,8 +40250,8 @@ var init_ExposedFunction = __esm(() => {
|
|
|
40035
40250
|
return;
|
|
40036
40251
|
}
|
|
40037
40252
|
try {
|
|
40038
|
-
await dataHandle.evaluate(([
|
|
40039
|
-
|
|
40253
|
+
await dataHandle.evaluate(([resolve8], result2) => {
|
|
40254
|
+
resolve8(result2);
|
|
40040
40255
|
}, result);
|
|
40041
40256
|
} catch (error) {
|
|
40042
40257
|
debugError(error);
|
|
@@ -47328,7 +47543,7 @@ __export(exports_NodeWebSocketTransport, {
|
|
|
47328
47543
|
|
|
47329
47544
|
class NodeWebSocketTransport {
|
|
47330
47545
|
static create(url, headers) {
|
|
47331
|
-
return new Promise((
|
|
47546
|
+
return new Promise((resolve8, reject) => {
|
|
47332
47547
|
const ws = new wrapper_default(url, [], {
|
|
47333
47548
|
followRedirects: true,
|
|
47334
47549
|
perMessageDeflate: false,
|
|
@@ -47340,7 +47555,7 @@ class NodeWebSocketTransport {
|
|
|
47340
47555
|
}
|
|
47341
47556
|
});
|
|
47342
47557
|
ws.addEventListener("open", () => {
|
|
47343
|
-
return
|
|
47558
|
+
return resolve8(new NodeWebSocketTransport(ws));
|
|
47344
47559
|
});
|
|
47345
47560
|
ws.addEventListener("error", reject);
|
|
47346
47561
|
});
|
|
@@ -50232,8 +50447,8 @@ var require_helpers = __commonJS((exports) => {
|
|
|
50232
50447
|
function req(url, opts = {}) {
|
|
50233
50448
|
const href = typeof url === "string" ? url : url.href;
|
|
50234
50449
|
const req2 = (href.startsWith("https:") ? https : http).request(url, opts);
|
|
50235
|
-
const promise = new Promise((
|
|
50236
|
-
req2.once("response",
|
|
50450
|
+
const promise = new Promise((resolve8, reject) => {
|
|
50451
|
+
req2.once("response", resolve8).once("error", reject).end();
|
|
50237
50452
|
});
|
|
50238
50453
|
req2.then = promise.then.bind(promise);
|
|
50239
50454
|
return req2;
|
|
@@ -50604,7 +50819,7 @@ var require_parse_proxy_response = __commonJS((exports) => {
|
|
|
50604
50819
|
var debug_1 = __importDefault(require_src());
|
|
50605
50820
|
var debug2 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
|
|
50606
50821
|
function parseProxyResponse(socket) {
|
|
50607
|
-
return new Promise((
|
|
50822
|
+
return new Promise((resolve8, reject) => {
|
|
50608
50823
|
let buffersLength = 0;
|
|
50609
50824
|
const buffers = [];
|
|
50610
50825
|
function read() {
|
|
@@ -50673,7 +50888,7 @@ var require_parse_proxy_response = __commonJS((exports) => {
|
|
|
50673
50888
|
}
|
|
50674
50889
|
debug2("got proxy server response: %o %o", firstLine, headers);
|
|
50675
50890
|
cleanup();
|
|
50676
|
-
|
|
50891
|
+
resolve8({
|
|
50677
50892
|
connect: {
|
|
50678
50893
|
statusCode,
|
|
50679
50894
|
statusText,
|
|
@@ -52777,11 +52992,11 @@ var require_receivebuffer = __commonJS((exports) => {
|
|
|
52777
52992
|
var require_socksclient = __commonJS((exports) => {
|
|
52778
52993
|
var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
52779
52994
|
function adopt(value) {
|
|
52780
|
-
return value instanceof P ? value : new P(function(
|
|
52781
|
-
|
|
52995
|
+
return value instanceof P ? value : new P(function(resolve8) {
|
|
52996
|
+
resolve8(value);
|
|
52782
52997
|
});
|
|
52783
52998
|
}
|
|
52784
|
-
return new (P || (P = Promise))(function(
|
|
52999
|
+
return new (P || (P = Promise))(function(resolve8, reject) {
|
|
52785
53000
|
function fulfilled(value) {
|
|
52786
53001
|
try {
|
|
52787
53002
|
step(generator.next(value));
|
|
@@ -52797,7 +53012,7 @@ var require_socksclient = __commonJS((exports) => {
|
|
|
52797
53012
|
}
|
|
52798
53013
|
}
|
|
52799
53014
|
function step(result) {
|
|
52800
|
-
result.done ?
|
|
53015
|
+
result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
52801
53016
|
}
|
|
52802
53017
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
52803
53018
|
});
|
|
@@ -52824,13 +53039,13 @@ var require_socksclient = __commonJS((exports) => {
|
|
|
52824
53039
|
this.setState(constants_1.SocksClientState.Created);
|
|
52825
53040
|
}
|
|
52826
53041
|
static createConnection(options, callback) {
|
|
52827
|
-
return new Promise((
|
|
53042
|
+
return new Promise((resolve8, reject) => {
|
|
52828
53043
|
try {
|
|
52829
53044
|
(0, helpers_1.validateSocksClientOptions)(options, ["connect"]);
|
|
52830
53045
|
} catch (err) {
|
|
52831
53046
|
if (typeof callback === "function") {
|
|
52832
53047
|
callback(err);
|
|
52833
|
-
return
|
|
53048
|
+
return resolve8(err);
|
|
52834
53049
|
} else {
|
|
52835
53050
|
return reject(err);
|
|
52836
53051
|
}
|
|
@@ -52841,16 +53056,16 @@ var require_socksclient = __commonJS((exports) => {
|
|
|
52841
53056
|
client.removeAllListeners();
|
|
52842
53057
|
if (typeof callback === "function") {
|
|
52843
53058
|
callback(null, info);
|
|
52844
|
-
|
|
53059
|
+
resolve8(info);
|
|
52845
53060
|
} else {
|
|
52846
|
-
|
|
53061
|
+
resolve8(info);
|
|
52847
53062
|
}
|
|
52848
53063
|
});
|
|
52849
53064
|
client.once("error", (err) => {
|
|
52850
53065
|
client.removeAllListeners();
|
|
52851
53066
|
if (typeof callback === "function") {
|
|
52852
53067
|
callback(err);
|
|
52853
|
-
|
|
53068
|
+
resolve8(err);
|
|
52854
53069
|
} else {
|
|
52855
53070
|
reject(err);
|
|
52856
53071
|
}
|
|
@@ -52858,13 +53073,13 @@ var require_socksclient = __commonJS((exports) => {
|
|
|
52858
53073
|
});
|
|
52859
53074
|
}
|
|
52860
53075
|
static createConnectionChain(options, callback) {
|
|
52861
|
-
return new Promise((
|
|
53076
|
+
return new Promise((resolve8, reject) => __awaiter2(this, undefined, undefined, function* () {
|
|
52862
53077
|
try {
|
|
52863
53078
|
(0, helpers_1.validateSocksClientChainOptions)(options);
|
|
52864
53079
|
} catch (err) {
|
|
52865
53080
|
if (typeof callback === "function") {
|
|
52866
53081
|
callback(err);
|
|
52867
|
-
return
|
|
53082
|
+
return resolve8(err);
|
|
52868
53083
|
} else {
|
|
52869
53084
|
return reject(err);
|
|
52870
53085
|
}
|
|
@@ -52890,14 +53105,14 @@ var require_socksclient = __commonJS((exports) => {
|
|
|
52890
53105
|
}
|
|
52891
53106
|
if (typeof callback === "function") {
|
|
52892
53107
|
callback(null, { socket: sock });
|
|
52893
|
-
|
|
53108
|
+
resolve8({ socket: sock });
|
|
52894
53109
|
} else {
|
|
52895
|
-
|
|
53110
|
+
resolve8({ socket: sock });
|
|
52896
53111
|
}
|
|
52897
53112
|
} catch (err) {
|
|
52898
53113
|
if (typeof callback === "function") {
|
|
52899
53114
|
callback(err);
|
|
52900
|
-
|
|
53115
|
+
resolve8(err);
|
|
52901
53116
|
} else {
|
|
52902
53117
|
reject(err);
|
|
52903
53118
|
}
|
|
@@ -53497,12 +53712,12 @@ var require_dist4 = __commonJS((exports) => {
|
|
|
53497
53712
|
let { host } = opts;
|
|
53498
53713
|
const { port, lookup: lookupFn = dns.lookup } = opts;
|
|
53499
53714
|
if (shouldLookup) {
|
|
53500
|
-
host = await new Promise((
|
|
53715
|
+
host = await new Promise((resolve8, reject) => {
|
|
53501
53716
|
lookupFn(host, {}, (err, res) => {
|
|
53502
53717
|
if (err) {
|
|
53503
53718
|
reject(err);
|
|
53504
53719
|
} else {
|
|
53505
|
-
|
|
53720
|
+
resolve8(res);
|
|
53506
53721
|
}
|
|
53507
53722
|
});
|
|
53508
53723
|
});
|
|
@@ -54509,7 +54724,7 @@ var require_netUtils = __commonJS((exports) => {
|
|
|
54509
54724
|
return `${socket.remoteAddress}:${socket.remotePort}`;
|
|
54510
54725
|
}
|
|
54511
54726
|
function upgradeSocket(socket, options) {
|
|
54512
|
-
return new Promise((
|
|
54727
|
+
return new Promise((resolve8, reject) => {
|
|
54513
54728
|
const tlsOptions = Object.assign({}, options, {
|
|
54514
54729
|
socket
|
|
54515
54730
|
});
|
|
@@ -54519,7 +54734,7 @@ var require_netUtils = __commonJS((exports) => {
|
|
|
54519
54734
|
reject(tlsSocket.authorizationError);
|
|
54520
54735
|
} else {
|
|
54521
54736
|
tlsSocket.removeAllListeners("error");
|
|
54522
|
-
|
|
54737
|
+
resolve8(tlsSocket);
|
|
54523
54738
|
}
|
|
54524
54739
|
}).once("error", (error) => {
|
|
54525
54740
|
reject(error);
|
|
@@ -54611,7 +54826,7 @@ var require_transfer = __commonJS((exports) => {
|
|
|
54611
54826
|
};
|
|
54612
54827
|
}
|
|
54613
54828
|
function connectForPassiveTransfer(host, port, ftp) {
|
|
54614
|
-
return new Promise((
|
|
54829
|
+
return new Promise((resolve8, reject) => {
|
|
54615
54830
|
let socket = ftp._newSocket();
|
|
54616
54831
|
const handleConnErr = function(err) {
|
|
54617
54832
|
err.message = "Can't open data connection in passive mode: " + err.message;
|
|
@@ -54634,7 +54849,7 @@ var require_transfer = __commonJS((exports) => {
|
|
|
54634
54849
|
socket.removeListener("error", handleConnErr);
|
|
54635
54850
|
socket.removeListener("timeout", handleTimeout);
|
|
54636
54851
|
ftp.dataSocket = socket;
|
|
54637
|
-
|
|
54852
|
+
resolve8();
|
|
54638
54853
|
});
|
|
54639
54854
|
});
|
|
54640
54855
|
}
|
|
@@ -56712,7 +56927,7 @@ var require_util2 = __commonJS((exports) => {
|
|
|
56712
56927
|
return path;
|
|
56713
56928
|
}
|
|
56714
56929
|
exports.normalize = normalize2;
|
|
56715
|
-
function
|
|
56930
|
+
function join26(aRoot, aPath) {
|
|
56716
56931
|
if (aRoot === "") {
|
|
56717
56932
|
aRoot = ".";
|
|
56718
56933
|
}
|
|
@@ -56744,7 +56959,7 @@ var require_util2 = __commonJS((exports) => {
|
|
|
56744
56959
|
}
|
|
56745
56960
|
return joined;
|
|
56746
56961
|
}
|
|
56747
|
-
exports.join =
|
|
56962
|
+
exports.join = join26;
|
|
56748
56963
|
exports.isAbsolute = function(aPath) {
|
|
56749
56964
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
56750
56965
|
};
|
|
@@ -56917,7 +57132,7 @@ var require_util2 = __commonJS((exports) => {
|
|
|
56917
57132
|
parsed.path = parsed.path.substring(0, index + 1);
|
|
56918
57133
|
}
|
|
56919
57134
|
}
|
|
56920
|
-
sourceURL =
|
|
57135
|
+
sourceURL = join26(urlGenerate(parsed), sourceURL);
|
|
56921
57136
|
}
|
|
56922
57137
|
return normalize2(sourceURL);
|
|
56923
57138
|
}
|
|
@@ -58649,7 +58864,7 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
58649
58864
|
function noEmptySpace() {
|
|
58650
58865
|
return space ? space : " ";
|
|
58651
58866
|
}
|
|
58652
|
-
function
|
|
58867
|
+
function join26(left, right) {
|
|
58653
58868
|
var leftSource, rightSource, leftCharCode, rightCharCode;
|
|
58654
58869
|
leftSource = toSourceNodeWhenNeeded(left).toString();
|
|
58655
58870
|
if (leftSource.length === 0) {
|
|
@@ -58990,8 +59205,8 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
58990
59205
|
} else {
|
|
58991
59206
|
result.push(that.generateExpression(stmt.left, Precedence.Call, E_TTT));
|
|
58992
59207
|
}
|
|
58993
|
-
result =
|
|
58994
|
-
result = [
|
|
59208
|
+
result = join26(result, operator);
|
|
59209
|
+
result = [join26(result, that.generateExpression(stmt.right, Precedence.Assignment, E_TTT)), ")"];
|
|
58995
59210
|
});
|
|
58996
59211
|
result.push(this.maybeBlock(stmt.body, flags));
|
|
58997
59212
|
return result;
|
|
@@ -59129,11 +59344,11 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59129
59344
|
var result, fragment;
|
|
59130
59345
|
result = ["class"];
|
|
59131
59346
|
if (stmt.id) {
|
|
59132
|
-
result =
|
|
59347
|
+
result = join26(result, this.generateExpression(stmt.id, Precedence.Sequence, E_TTT));
|
|
59133
59348
|
}
|
|
59134
59349
|
if (stmt.superClass) {
|
|
59135
|
-
fragment =
|
|
59136
|
-
result =
|
|
59350
|
+
fragment = join26("extends", this.generateExpression(stmt.superClass, Precedence.Unary, E_TTT));
|
|
59351
|
+
result = join26(result, fragment);
|
|
59137
59352
|
}
|
|
59138
59353
|
result.push(space);
|
|
59139
59354
|
result.push(this.generateStatement(stmt.body, S_TFFT));
|
|
@@ -59146,9 +59361,9 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59146
59361
|
return escapeDirective(stmt.directive) + this.semicolon(flags);
|
|
59147
59362
|
},
|
|
59148
59363
|
DoWhileStatement: function(stmt, flags) {
|
|
59149
|
-
var result =
|
|
59364
|
+
var result = join26("do", this.maybeBlock(stmt.body, S_TFFF));
|
|
59150
59365
|
result = this.maybeBlockSuffix(stmt.body, result);
|
|
59151
|
-
return
|
|
59366
|
+
return join26(result, [
|
|
59152
59367
|
"while" + space + "(",
|
|
59153
59368
|
this.generateExpression(stmt.test, Precedence.Sequence, E_TTT),
|
|
59154
59369
|
")" + this.semicolon(flags)
|
|
@@ -59184,11 +59399,11 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59184
59399
|
ExportDefaultDeclaration: function(stmt, flags) {
|
|
59185
59400
|
var result = ["export"], bodyFlags;
|
|
59186
59401
|
bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF;
|
|
59187
|
-
result =
|
|
59402
|
+
result = join26(result, "default");
|
|
59188
59403
|
if (isStatement(stmt.declaration)) {
|
|
59189
|
-
result =
|
|
59404
|
+
result = join26(result, this.generateStatement(stmt.declaration, bodyFlags));
|
|
59190
59405
|
} else {
|
|
59191
|
-
result =
|
|
59406
|
+
result = join26(result, this.generateExpression(stmt.declaration, Precedence.Assignment, E_TTT) + this.semicolon(flags));
|
|
59192
59407
|
}
|
|
59193
59408
|
return result;
|
|
59194
59409
|
},
|
|
@@ -59196,15 +59411,15 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59196
59411
|
var result = ["export"], bodyFlags, that = this;
|
|
59197
59412
|
bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF;
|
|
59198
59413
|
if (stmt.declaration) {
|
|
59199
|
-
return
|
|
59414
|
+
return join26(result, this.generateStatement(stmt.declaration, bodyFlags));
|
|
59200
59415
|
}
|
|
59201
59416
|
if (stmt.specifiers) {
|
|
59202
59417
|
if (stmt.specifiers.length === 0) {
|
|
59203
|
-
result =
|
|
59418
|
+
result = join26(result, "{" + space + "}");
|
|
59204
59419
|
} else if (stmt.specifiers[0].type === Syntax.ExportBatchSpecifier) {
|
|
59205
|
-
result =
|
|
59420
|
+
result = join26(result, this.generateExpression(stmt.specifiers[0], Precedence.Sequence, E_TTT));
|
|
59206
59421
|
} else {
|
|
59207
|
-
result =
|
|
59422
|
+
result = join26(result, "{");
|
|
59208
59423
|
withIndent(function(indent2) {
|
|
59209
59424
|
var i, iz;
|
|
59210
59425
|
result.push(newline);
|
|
@@ -59222,7 +59437,7 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59222
59437
|
result.push(base + "}");
|
|
59223
59438
|
}
|
|
59224
59439
|
if (stmt.source) {
|
|
59225
|
-
result =
|
|
59440
|
+
result = join26(result, [
|
|
59226
59441
|
"from" + space,
|
|
59227
59442
|
this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
|
|
59228
59443
|
this.semicolon(flags)
|
|
@@ -59306,7 +59521,7 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59306
59521
|
];
|
|
59307
59522
|
cursor = 0;
|
|
59308
59523
|
if (stmt.specifiers[cursor].type === Syntax.ImportDefaultSpecifier) {
|
|
59309
|
-
result =
|
|
59524
|
+
result = join26(result, [
|
|
59310
59525
|
this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT)
|
|
59311
59526
|
]);
|
|
59312
59527
|
++cursor;
|
|
@@ -59316,7 +59531,7 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59316
59531
|
result.push(",");
|
|
59317
59532
|
}
|
|
59318
59533
|
if (stmt.specifiers[cursor].type === Syntax.ImportNamespaceSpecifier) {
|
|
59319
|
-
result =
|
|
59534
|
+
result = join26(result, [
|
|
59320
59535
|
space,
|
|
59321
59536
|
this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT)
|
|
59322
59537
|
]);
|
|
@@ -59345,7 +59560,7 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59345
59560
|
}
|
|
59346
59561
|
}
|
|
59347
59562
|
}
|
|
59348
|
-
result =
|
|
59563
|
+
result = join26(result, [
|
|
59349
59564
|
"from" + space,
|
|
59350
59565
|
this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
|
|
59351
59566
|
this.semicolon(flags)
|
|
@@ -59399,7 +59614,7 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59399
59614
|
return result;
|
|
59400
59615
|
},
|
|
59401
59616
|
ThrowStatement: function(stmt, flags) {
|
|
59402
|
-
return [
|
|
59617
|
+
return [join26("throw", this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT)), this.semicolon(flags)];
|
|
59403
59618
|
},
|
|
59404
59619
|
TryStatement: function(stmt, flags) {
|
|
59405
59620
|
var result, i, iz, guardedHandlers;
|
|
@@ -59407,7 +59622,7 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59407
59622
|
result = this.maybeBlockSuffix(stmt.block, result);
|
|
59408
59623
|
if (stmt.handlers) {
|
|
59409
59624
|
for (i = 0, iz = stmt.handlers.length;i < iz; ++i) {
|
|
59410
|
-
result =
|
|
59625
|
+
result = join26(result, this.generateStatement(stmt.handlers[i], S_TFFF));
|
|
59411
59626
|
if (stmt.finalizer || i + 1 !== iz) {
|
|
59412
59627
|
result = this.maybeBlockSuffix(stmt.handlers[i].body, result);
|
|
59413
59628
|
}
|
|
@@ -59415,7 +59630,7 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59415
59630
|
} else {
|
|
59416
59631
|
guardedHandlers = stmt.guardedHandlers || [];
|
|
59417
59632
|
for (i = 0, iz = guardedHandlers.length;i < iz; ++i) {
|
|
59418
|
-
result =
|
|
59633
|
+
result = join26(result, this.generateStatement(guardedHandlers[i], S_TFFF));
|
|
59419
59634
|
if (stmt.finalizer || i + 1 !== iz) {
|
|
59420
59635
|
result = this.maybeBlockSuffix(guardedHandlers[i].body, result);
|
|
59421
59636
|
}
|
|
@@ -59423,13 +59638,13 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59423
59638
|
if (stmt.handler) {
|
|
59424
59639
|
if (Array.isArray(stmt.handler)) {
|
|
59425
59640
|
for (i = 0, iz = stmt.handler.length;i < iz; ++i) {
|
|
59426
|
-
result =
|
|
59641
|
+
result = join26(result, this.generateStatement(stmt.handler[i], S_TFFF));
|
|
59427
59642
|
if (stmt.finalizer || i + 1 !== iz) {
|
|
59428
59643
|
result = this.maybeBlockSuffix(stmt.handler[i].body, result);
|
|
59429
59644
|
}
|
|
59430
59645
|
}
|
|
59431
59646
|
} else {
|
|
59432
|
-
result =
|
|
59647
|
+
result = join26(result, this.generateStatement(stmt.handler, S_TFFF));
|
|
59433
59648
|
if (stmt.finalizer) {
|
|
59434
59649
|
result = this.maybeBlockSuffix(stmt.handler.body, result);
|
|
59435
59650
|
}
|
|
@@ -59437,7 +59652,7 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59437
59652
|
}
|
|
59438
59653
|
}
|
|
59439
59654
|
if (stmt.finalizer) {
|
|
59440
|
-
result =
|
|
59655
|
+
result = join26(result, ["finally", this.maybeBlock(stmt.finalizer, S_TFFF)]);
|
|
59441
59656
|
}
|
|
59442
59657
|
return result;
|
|
59443
59658
|
},
|
|
@@ -59471,7 +59686,7 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59471
59686
|
withIndent(function() {
|
|
59472
59687
|
if (stmt.test) {
|
|
59473
59688
|
result = [
|
|
59474
|
-
|
|
59689
|
+
join26("case", that.generateExpression(stmt.test, Precedence.Sequence, E_TTT)),
|
|
59475
59690
|
":"
|
|
59476
59691
|
];
|
|
59477
59692
|
} else {
|
|
@@ -59519,9 +59734,9 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59519
59734
|
result.push(this.maybeBlock(stmt.consequent, S_TFFF));
|
|
59520
59735
|
result = this.maybeBlockSuffix(stmt.consequent, result);
|
|
59521
59736
|
if (stmt.alternate.type === Syntax.IfStatement) {
|
|
59522
|
-
result =
|
|
59737
|
+
result = join26(result, ["else ", this.generateStatement(stmt.alternate, bodyFlags)]);
|
|
59523
59738
|
} else {
|
|
59524
|
-
result =
|
|
59739
|
+
result = join26(result, join26("else", this.maybeBlock(stmt.alternate, bodyFlags)));
|
|
59525
59740
|
}
|
|
59526
59741
|
} else {
|
|
59527
59742
|
result.push(this.maybeBlock(stmt.consequent, bodyFlags));
|
|
@@ -59623,7 +59838,7 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59623
59838
|
},
|
|
59624
59839
|
ReturnStatement: function(stmt, flags) {
|
|
59625
59840
|
if (stmt.argument) {
|
|
59626
|
-
return [
|
|
59841
|
+
return [join26("return", this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT)), this.semicolon(flags)];
|
|
59627
59842
|
}
|
|
59628
59843
|
return ["return" + this.semicolon(flags)];
|
|
59629
59844
|
},
|
|
@@ -59705,14 +59920,14 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59705
59920
|
if (leftSource.charCodeAt(leftSource.length - 1) === 47 && esutils.code.isIdentifierPartES5(expr.operator.charCodeAt(0))) {
|
|
59706
59921
|
result = [fragment, noEmptySpace(), expr.operator];
|
|
59707
59922
|
} else {
|
|
59708
|
-
result =
|
|
59923
|
+
result = join26(fragment, expr.operator);
|
|
59709
59924
|
}
|
|
59710
59925
|
fragment = this.generateExpression(expr.right, rightPrecedence, flags);
|
|
59711
59926
|
if (expr.operator === "/" && fragment.toString().charAt(0) === "/" || expr.operator.slice(-1) === "<" && fragment.toString().slice(0, 3) === "!--") {
|
|
59712
59927
|
result.push(noEmptySpace());
|
|
59713
59928
|
result.push(fragment);
|
|
59714
59929
|
} else {
|
|
59715
|
-
result =
|
|
59930
|
+
result = join26(result, fragment);
|
|
59716
59931
|
}
|
|
59717
59932
|
if (expr.operator === "in" && !(flags & F_ALLOW_IN)) {
|
|
59718
59933
|
return ["(", result, ")"];
|
|
@@ -59752,7 +59967,7 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59752
59967
|
var result, length, i, iz, itemFlags;
|
|
59753
59968
|
length = expr["arguments"].length;
|
|
59754
59969
|
itemFlags = flags & F_ALLOW_UNPARATH_NEW && !parentheses && length === 0 ? E_TFT : E_TFF;
|
|
59755
|
-
result =
|
|
59970
|
+
result = join26("new", this.generateExpression(expr.callee, Precedence.New, itemFlags));
|
|
59756
59971
|
if (!(flags & F_ALLOW_UNPARATH_NEW) || parentheses || length > 0) {
|
|
59757
59972
|
result.push("(");
|
|
59758
59973
|
for (i = 0, iz = length;i < iz; ++i) {
|
|
@@ -59799,11 +60014,11 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59799
60014
|
var result, fragment, rightCharCode, leftSource, leftCharCode;
|
|
59800
60015
|
fragment = this.generateExpression(expr.argument, Precedence.Unary, E_TTT);
|
|
59801
60016
|
if (space === "") {
|
|
59802
|
-
result =
|
|
60017
|
+
result = join26(expr.operator, fragment);
|
|
59803
60018
|
} else {
|
|
59804
60019
|
result = [expr.operator];
|
|
59805
60020
|
if (expr.operator.length > 2) {
|
|
59806
|
-
result =
|
|
60021
|
+
result = join26(result, fragment);
|
|
59807
60022
|
} else {
|
|
59808
60023
|
leftSource = toSourceNodeWhenNeeded(result).toString();
|
|
59809
60024
|
leftCharCode = leftSource.charCodeAt(leftSource.length - 1);
|
|
@@ -59826,12 +60041,12 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59826
60041
|
result = "yield";
|
|
59827
60042
|
}
|
|
59828
60043
|
if (expr.argument) {
|
|
59829
|
-
result =
|
|
60044
|
+
result = join26(result, this.generateExpression(expr.argument, Precedence.Yield, E_TTT));
|
|
59830
60045
|
}
|
|
59831
60046
|
return parenthesize(result, Precedence.Yield, precedence);
|
|
59832
60047
|
},
|
|
59833
60048
|
AwaitExpression: function(expr, precedence, flags) {
|
|
59834
|
-
var result =
|
|
60049
|
+
var result = join26(expr.all ? "await*" : "await", this.generateExpression(expr.argument, Precedence.Await, E_TTT));
|
|
59835
60050
|
return parenthesize(result, Precedence.Await, precedence);
|
|
59836
60051
|
},
|
|
59837
60052
|
UpdateExpression: function(expr, precedence, flags) {
|
|
@@ -59903,11 +60118,11 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59903
60118
|
var result, fragment;
|
|
59904
60119
|
result = ["class"];
|
|
59905
60120
|
if (expr.id) {
|
|
59906
|
-
result =
|
|
60121
|
+
result = join26(result, this.generateExpression(expr.id, Precedence.Sequence, E_TTT));
|
|
59907
60122
|
}
|
|
59908
60123
|
if (expr.superClass) {
|
|
59909
|
-
fragment =
|
|
59910
|
-
result =
|
|
60124
|
+
fragment = join26("extends", this.generateExpression(expr.superClass, Precedence.Unary, E_TTT));
|
|
60125
|
+
result = join26(result, fragment);
|
|
59911
60126
|
}
|
|
59912
60127
|
result.push(space);
|
|
59913
60128
|
result.push(this.generateStatement(expr.body, S_TFFT));
|
|
@@ -59922,7 +60137,7 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59922
60137
|
}
|
|
59923
60138
|
if (expr.kind === "get" || expr.kind === "set") {
|
|
59924
60139
|
fragment = [
|
|
59925
|
-
|
|
60140
|
+
join26(expr.kind, this.generatePropertyKey(expr.key, expr.computed)),
|
|
59926
60141
|
this.generateFunctionBody(expr.value)
|
|
59927
60142
|
];
|
|
59928
60143
|
} else {
|
|
@@ -59932,7 +60147,7 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
59932
60147
|
this.generateFunctionBody(expr.value)
|
|
59933
60148
|
];
|
|
59934
60149
|
}
|
|
59935
|
-
return
|
|
60150
|
+
return join26(result, fragment);
|
|
59936
60151
|
},
|
|
59937
60152
|
Property: function(expr, precedence, flags) {
|
|
59938
60153
|
if (expr.kind === "get" || expr.kind === "set") {
|
|
@@ -60126,7 +60341,7 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
60126
60341
|
for (i = 0, iz = expr.blocks.length;i < iz; ++i) {
|
|
60127
60342
|
fragment = that.generateExpression(expr.blocks[i], Precedence.Sequence, E_TTT);
|
|
60128
60343
|
if (i > 0 || extra.moz.comprehensionExpressionStartsWithAssignment) {
|
|
60129
|
-
result =
|
|
60344
|
+
result = join26(result, fragment);
|
|
60130
60345
|
} else {
|
|
60131
60346
|
result.push(fragment);
|
|
60132
60347
|
}
|
|
@@ -60134,13 +60349,13 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
60134
60349
|
});
|
|
60135
60350
|
}
|
|
60136
60351
|
if (expr.filter) {
|
|
60137
|
-
result =
|
|
60352
|
+
result = join26(result, "if" + space);
|
|
60138
60353
|
fragment = this.generateExpression(expr.filter, Precedence.Sequence, E_TTT);
|
|
60139
|
-
result =
|
|
60354
|
+
result = join26(result, ["(", fragment, ")"]);
|
|
60140
60355
|
}
|
|
60141
60356
|
if (!extra.moz.comprehensionExpressionStartsWithAssignment) {
|
|
60142
60357
|
fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT);
|
|
60143
|
-
result =
|
|
60358
|
+
result = join26(result, fragment);
|
|
60144
60359
|
}
|
|
60145
60360
|
result.push(expr.type === Syntax.GeneratorExpression ? ")" : "]");
|
|
60146
60361
|
return result;
|
|
@@ -60156,8 +60371,8 @@ var require_escodegen = __commonJS((exports) => {
|
|
|
60156
60371
|
} else {
|
|
60157
60372
|
fragment = this.generateExpression(expr.left, Precedence.Call, E_TTT);
|
|
60158
60373
|
}
|
|
60159
|
-
fragment =
|
|
60160
|
-
fragment =
|
|
60374
|
+
fragment = join26(fragment, expr.of ? "of" : "in");
|
|
60375
|
+
fragment = join26(fragment, this.generateExpression(expr.right, Precedence.Sequence, E_TTT));
|
|
60161
60376
|
return ["for" + space + "(", fragment, ")"];
|
|
60162
60377
|
},
|
|
60163
60378
|
SpreadElement: function(expr, precedence, flags) {
|
|
@@ -66645,11 +66860,11 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
66645
66860
|
};
|
|
66646
66861
|
__awaiter2 = function(thisArg, _arguments, P, generator) {
|
|
66647
66862
|
function adopt(value) {
|
|
66648
|
-
return value instanceof P ? value : new P(function(
|
|
66649
|
-
|
|
66863
|
+
return value instanceof P ? value : new P(function(resolve8) {
|
|
66864
|
+
resolve8(value);
|
|
66650
66865
|
});
|
|
66651
66866
|
}
|
|
66652
|
-
return new (P || (P = Promise))(function(
|
|
66867
|
+
return new (P || (P = Promise))(function(resolve8, reject) {
|
|
66653
66868
|
function fulfilled(value) {
|
|
66654
66869
|
try {
|
|
66655
66870
|
step(generator.next(value));
|
|
@@ -66665,7 +66880,7 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
66665
66880
|
}
|
|
66666
66881
|
}
|
|
66667
66882
|
function step(result) {
|
|
66668
|
-
result.done ?
|
|
66883
|
+
result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
66669
66884
|
}
|
|
66670
66885
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
66671
66886
|
});
|
|
@@ -66894,14 +67109,14 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
66894
67109
|
}, i);
|
|
66895
67110
|
function verb(n) {
|
|
66896
67111
|
i[n] = o[n] && function(v) {
|
|
66897
|
-
return new Promise(function(
|
|
66898
|
-
v = o[n](v), settle(
|
|
67112
|
+
return new Promise(function(resolve8, reject) {
|
|
67113
|
+
v = o[n](v), settle(resolve8, reject, v.done, v.value);
|
|
66899
67114
|
});
|
|
66900
67115
|
};
|
|
66901
67116
|
}
|
|
66902
|
-
function settle(
|
|
67117
|
+
function settle(resolve8, reject, d, v) {
|
|
66903
67118
|
Promise.resolve(v).then(function(v2) {
|
|
66904
|
-
|
|
67119
|
+
resolve8({ value: v2, done: d });
|
|
66905
67120
|
}, reject);
|
|
66906
67121
|
}
|
|
66907
67122
|
};
|
|
@@ -70140,12 +70355,12 @@ var require_util3 = __commonJS((exports) => {
|
|
|
70140
70355
|
exports.isGMT = exports.dnsLookup = undefined;
|
|
70141
70356
|
var dns_1 = __require("dns");
|
|
70142
70357
|
function dnsLookup(host, opts) {
|
|
70143
|
-
return new Promise((
|
|
70358
|
+
return new Promise((resolve8, reject) => {
|
|
70144
70359
|
(0, dns_1.lookup)(host, opts, (err, res) => {
|
|
70145
70360
|
if (err) {
|
|
70146
70361
|
reject(err);
|
|
70147
70362
|
} else {
|
|
70148
|
-
|
|
70363
|
+
resolve8(res);
|
|
70149
70364
|
}
|
|
70150
70365
|
});
|
|
70151
70366
|
});
|
|
@@ -70719,10 +70934,10 @@ var require_myIpAddress = __commonJS((exports) => {
|
|
|
70719
70934
|
var ip_1 = require_ip();
|
|
70720
70935
|
var net_1 = __importDefault(__require("net"));
|
|
70721
70936
|
async function myIpAddress() {
|
|
70722
|
-
return new Promise((
|
|
70937
|
+
return new Promise((resolve8, reject) => {
|
|
70723
70938
|
const socket = net_1.default.connect({ host: "8.8.8.8", port: 53 });
|
|
70724
70939
|
const onError = () => {
|
|
70725
|
-
|
|
70940
|
+
resolve8(ip_1.ip.address());
|
|
70726
70941
|
};
|
|
70727
70942
|
socket.once("error", onError);
|
|
70728
70943
|
socket.once("connect", () => {
|
|
@@ -70730,9 +70945,9 @@ var require_myIpAddress = __commonJS((exports) => {
|
|
|
70730
70945
|
const addr = socket.address();
|
|
70731
70946
|
socket.destroy();
|
|
70732
70947
|
if (typeof addr === "string") {
|
|
70733
|
-
|
|
70948
|
+
resolve8(addr);
|
|
70734
70949
|
} else if (addr.address) {
|
|
70735
|
-
|
|
70950
|
+
resolve8(addr.address);
|
|
70736
70951
|
} else {
|
|
70737
70952
|
reject(new Error("Expected a `string`"));
|
|
70738
70953
|
}
|
|
@@ -71246,8 +71461,8 @@ var require_deferred_promise = __commonJS((exports) => {
|
|
|
71246
71461
|
this.context = args.context;
|
|
71247
71462
|
this.owner = args.context.runtime;
|
|
71248
71463
|
this.handle = args.promiseHandle;
|
|
71249
|
-
this.settled = new Promise((
|
|
71250
|
-
this.onSettled =
|
|
71464
|
+
this.settled = new Promise((resolve8) => {
|
|
71465
|
+
this.onSettled = resolve8;
|
|
71251
71466
|
});
|
|
71252
71467
|
this.resolveHandle = args.resolveHandle;
|
|
71253
71468
|
this.rejectHandle = args.rejectHandle;
|
|
@@ -71639,13 +71854,13 @@ var require_context = __commonJS((exports) => {
|
|
|
71639
71854
|
if (vmResolveResult.error) {
|
|
71640
71855
|
return Promise.resolve(vmResolveResult);
|
|
71641
71856
|
}
|
|
71642
|
-
return new Promise((
|
|
71857
|
+
return new Promise((resolve8) => {
|
|
71643
71858
|
lifetime_1.Scope.withScope((scope) => {
|
|
71644
71859
|
const resolveHandle = scope.manage(this.newFunction("resolve", (value) => {
|
|
71645
|
-
|
|
71860
|
+
resolve8({ value: value && value.dup() });
|
|
71646
71861
|
}));
|
|
71647
71862
|
const rejectHandle = scope.manage(this.newFunction("reject", (error) => {
|
|
71648
|
-
|
|
71863
|
+
resolve8({ error: error && error.dup() });
|
|
71649
71864
|
}));
|
|
71650
71865
|
const promiseHandle = scope.manage(vmResolveResult.value);
|
|
71651
71866
|
const promiseThenHandle = scope.manage(this.getProp(promiseHandle, "then"));
|
|
@@ -73759,13 +73974,13 @@ import * as http from "node:http";
|
|
|
73759
73974
|
import * as https from "node:https";
|
|
73760
73975
|
import { URL as URL2, urlToHttpOptions } from "node:url";
|
|
73761
73976
|
function headHttpRequest(url) {
|
|
73762
|
-
return new Promise((
|
|
73977
|
+
return new Promise((resolve8) => {
|
|
73763
73978
|
const request3 = httpRequest(url, "HEAD", (response) => {
|
|
73764
73979
|
response.resume();
|
|
73765
|
-
|
|
73980
|
+
resolve8(response.statusCode === 200);
|
|
73766
73981
|
}, false);
|
|
73767
73982
|
request3.on("error", () => {
|
|
73768
|
-
|
|
73983
|
+
resolve8(false);
|
|
73769
73984
|
});
|
|
73770
73985
|
});
|
|
73771
73986
|
}
|
|
@@ -73793,7 +74008,7 @@ function httpRequest(url, method, response, keepAlive = true) {
|
|
|
73793
74008
|
return request3;
|
|
73794
74009
|
}
|
|
73795
74010
|
function downloadFile(url, destinationPath, progressCallback) {
|
|
73796
|
-
return new Promise((
|
|
74011
|
+
return new Promise((resolve8, reject) => {
|
|
73797
74012
|
let downloadedBytes = 0;
|
|
73798
74013
|
let totalBytes = 0;
|
|
73799
74014
|
function onData(chunk) {
|
|
@@ -73809,7 +74024,7 @@ function downloadFile(url, destinationPath, progressCallback) {
|
|
|
73809
74024
|
}
|
|
73810
74025
|
const file = createWriteStream(destinationPath);
|
|
73811
74026
|
file.on("close", () => {
|
|
73812
|
-
return
|
|
74027
|
+
return resolve8();
|
|
73813
74028
|
});
|
|
73814
74029
|
file.on("error", (error) => {
|
|
73815
74030
|
return reject(error);
|
|
@@ -73834,7 +74049,7 @@ async function getJSON(url) {
|
|
|
73834
74049
|
}
|
|
73835
74050
|
}
|
|
73836
74051
|
function getText(url) {
|
|
73837
|
-
return new Promise((
|
|
74052
|
+
return new Promise((resolve8, reject) => {
|
|
73838
74053
|
const request3 = httpRequest(url, "GET", (response) => {
|
|
73839
74054
|
let data = "";
|
|
73840
74055
|
if (response.statusCode && response.statusCode >= 400) {
|
|
@@ -73845,7 +74060,7 @@ function getText(url) {
|
|
|
73845
74060
|
});
|
|
73846
74061
|
response.on("end", () => {
|
|
73847
74062
|
try {
|
|
73848
|
-
return
|
|
74063
|
+
return resolve8(String(data));
|
|
73849
74064
|
} catch {
|
|
73850
74065
|
return reject(new Error(`Failed to read text response from ${url}`));
|
|
73851
74066
|
}
|
|
@@ -73862,7 +74077,7 @@ var init_httpUtil = __esm(() => {
|
|
|
73862
74077
|
});
|
|
73863
74078
|
|
|
73864
74079
|
// node_modules/@puppeteer/browsers/lib/esm/browser-data/chrome.js
|
|
73865
|
-
import { execSync as
|
|
74080
|
+
import { execSync as execSync6 } from "node:child_process";
|
|
73866
74081
|
import os from "node:os";
|
|
73867
74082
|
import path from "node:path";
|
|
73868
74083
|
function folder(platform2) {
|
|
@@ -73952,7 +74167,7 @@ function getChromeWindowsLocation(channel2, locationsPrefixes) {
|
|
|
73952
74167
|
}
|
|
73953
74168
|
function getWslVariable(variable) {
|
|
73954
74169
|
try {
|
|
73955
|
-
const result =
|
|
74170
|
+
const result = execSync6(`cmd.exe /c echo %${variable.toLocaleUpperCase()}%`, {
|
|
73956
74171
|
stdio: ["ignore", "pipe", "ignore"],
|
|
73957
74172
|
encoding: "utf-8"
|
|
73958
74173
|
}).trim();
|
|
@@ -73963,7 +74178,7 @@ function getWslVariable(variable) {
|
|
|
73963
74178
|
return;
|
|
73964
74179
|
}
|
|
73965
74180
|
function getWslLocation(channel2) {
|
|
73966
|
-
const wslVersion =
|
|
74181
|
+
const wslVersion = execSync6("wslinfo --version", {
|
|
73967
74182
|
stdio: ["ignore", "pipe", "ignore"],
|
|
73968
74183
|
encoding: "utf-8"
|
|
73969
74184
|
}).trim();
|
|
@@ -73979,7 +74194,7 @@ function getWslLocation(channel2) {
|
|
|
73979
74194
|
}
|
|
73980
74195
|
const windowsPath = getChromeWindowsLocation(channel2, wslPrefixes);
|
|
73981
74196
|
return windowsPath.map((path2) => {
|
|
73982
|
-
return
|
|
74197
|
+
return execSync6(`wslpath "${path2}"`).toString().trim();
|
|
73983
74198
|
});
|
|
73984
74199
|
}
|
|
73985
74200
|
function getChromeLinuxOrWslLocation(channel2) {
|
|
@@ -75066,7 +75281,7 @@ class Process {
|
|
|
75066
75281
|
if (opts.onExit) {
|
|
75067
75282
|
this.#onExitHook = opts.onExit;
|
|
75068
75283
|
}
|
|
75069
|
-
this.#browserProcessExiting = new Promise((
|
|
75284
|
+
this.#browserProcessExiting = new Promise((resolve8, reject) => {
|
|
75070
75285
|
this.#browserProcess.once("exit", async () => {
|
|
75071
75286
|
debugLaunch(`Browser process ${this.#browserProcess.pid} onExit`);
|
|
75072
75287
|
this.#clearListeners();
|
|
@@ -75077,7 +75292,7 @@ class Process {
|
|
|
75077
75292
|
reject(err);
|
|
75078
75293
|
return;
|
|
75079
75294
|
}
|
|
75080
|
-
|
|
75295
|
+
resolve8();
|
|
75081
75296
|
});
|
|
75082
75297
|
});
|
|
75083
75298
|
}
|
|
@@ -75187,7 +75402,7 @@ Error cause: ${isErrorLike2(error) ? error.stack : error}`);
|
|
|
75187
75402
|
return [...this.#logs];
|
|
75188
75403
|
}
|
|
75189
75404
|
waitForLineOutput(regex, timeout2 = 0) {
|
|
75190
|
-
return new Promise((
|
|
75405
|
+
return new Promise((resolve8, reject) => {
|
|
75191
75406
|
const onClose = (errorOrCode) => {
|
|
75192
75407
|
cleanup();
|
|
75193
75408
|
reject(new Error([
|
|
@@ -75225,7 +75440,7 @@ Error cause: ${isErrorLike2(error) ? error.stack : error}`);
|
|
|
75225
75440
|
return;
|
|
75226
75441
|
}
|
|
75227
75442
|
cleanup();
|
|
75228
|
-
|
|
75443
|
+
resolve8(match[1]);
|
|
75229
75444
|
}
|
|
75230
75445
|
});
|
|
75231
75446
|
}
|
|
@@ -75755,7 +75970,7 @@ var require_get_stream = __commonJS((exports, module) => {
|
|
|
75755
75970
|
};
|
|
75756
75971
|
const { maxBuffer } = options;
|
|
75757
75972
|
let stream;
|
|
75758
|
-
await new Promise((
|
|
75973
|
+
await new Promise((resolve8, reject) => {
|
|
75759
75974
|
const rejectPromise = (error) => {
|
|
75760
75975
|
if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
|
|
75761
75976
|
error.bufferedData = stream.getBufferedValue();
|
|
@@ -75767,7 +75982,7 @@ var require_get_stream = __commonJS((exports, module) => {
|
|
|
75767
75982
|
rejectPromise(error);
|
|
75768
75983
|
return;
|
|
75769
75984
|
}
|
|
75770
|
-
|
|
75985
|
+
resolve8();
|
|
75771
75986
|
});
|
|
75772
75987
|
stream.on("data", () => {
|
|
75773
75988
|
if (stream.getBufferedLength() > maxBuffer) {
|
|
@@ -77128,7 +77343,7 @@ var require_extract_zip = __commonJS((exports, module) => {
|
|
|
77128
77343
|
debug4("opening", this.zipPath, "with opts", this.opts);
|
|
77129
77344
|
this.zipfile = await openZip(this.zipPath, { lazyEntries: true });
|
|
77130
77345
|
this.canceled = false;
|
|
77131
|
-
return new Promise((
|
|
77346
|
+
return new Promise((resolve8, reject) => {
|
|
77132
77347
|
this.zipfile.on("error", (err) => {
|
|
77133
77348
|
this.canceled = true;
|
|
77134
77349
|
reject(err);
|
|
@@ -77137,7 +77352,7 @@ var require_extract_zip = __commonJS((exports, module) => {
|
|
|
77137
77352
|
this.zipfile.on("close", () => {
|
|
77138
77353
|
if (!this.canceled) {
|
|
77139
77354
|
debug4("zip extraction complete");
|
|
77140
|
-
|
|
77355
|
+
resolve8();
|
|
77141
77356
|
}
|
|
77142
77357
|
});
|
|
77143
77358
|
this.zipfile.on("entry", async (entry) => {
|
|
@@ -78479,8 +78694,8 @@ var require_streamx = __commonJS((exports, module) => {
|
|
|
78479
78694
|
return this;
|
|
78480
78695
|
},
|
|
78481
78696
|
next() {
|
|
78482
|
-
return new Promise(function(
|
|
78483
|
-
promiseResolve =
|
|
78697
|
+
return new Promise(function(resolve8, reject) {
|
|
78698
|
+
promiseResolve = resolve8;
|
|
78484
78699
|
promiseReject = reject;
|
|
78485
78700
|
const data = stream.read();
|
|
78486
78701
|
if (data !== null)
|
|
@@ -78517,14 +78732,14 @@ var require_streamx = __commonJS((exports, module) => {
|
|
|
78517
78732
|
}
|
|
78518
78733
|
function destroy(err) {
|
|
78519
78734
|
stream.destroy(err);
|
|
78520
|
-
return new Promise((
|
|
78735
|
+
return new Promise((resolve8, reject) => {
|
|
78521
78736
|
if (stream._duplexState & DESTROYED)
|
|
78522
|
-
return
|
|
78737
|
+
return resolve8({ value: undefined, done: true });
|
|
78523
78738
|
stream.once("close", function() {
|
|
78524
78739
|
if (err)
|
|
78525
78740
|
reject(err);
|
|
78526
78741
|
else
|
|
78527
|
-
|
|
78742
|
+
resolve8({ value: undefined, done: true });
|
|
78528
78743
|
});
|
|
78529
78744
|
});
|
|
78530
78745
|
}
|
|
@@ -78576,8 +78791,8 @@ var require_streamx = __commonJS((exports, module) => {
|
|
|
78576
78791
|
return Promise.resolve(true);
|
|
78577
78792
|
if (state.drains === null)
|
|
78578
78793
|
state.drains = [];
|
|
78579
|
-
return new Promise((
|
|
78580
|
-
state.drains.push({ writes, resolve:
|
|
78794
|
+
return new Promise((resolve8) => {
|
|
78795
|
+
state.drains.push({ writes, resolve: resolve8 });
|
|
78581
78796
|
});
|
|
78582
78797
|
}
|
|
78583
78798
|
write(data) {
|
|
@@ -78691,11 +78906,11 @@ var require_streamx = __commonJS((exports, module) => {
|
|
|
78691
78906
|
cb(null);
|
|
78692
78907
|
}
|
|
78693
78908
|
function pipelinePromise(...streams) {
|
|
78694
|
-
return new Promise((
|
|
78909
|
+
return new Promise((resolve8, reject) => {
|
|
78695
78910
|
return pipeline(...streams, (err) => {
|
|
78696
78911
|
if (err)
|
|
78697
78912
|
return reject(err);
|
|
78698
|
-
|
|
78913
|
+
resolve8();
|
|
78699
78914
|
});
|
|
78700
78915
|
});
|
|
78701
78916
|
}
|
|
@@ -79409,16 +79624,16 @@ var require_extract = __commonJS((exports, module) => {
|
|
|
79409
79624
|
entryCallback = null;
|
|
79410
79625
|
cb(err);
|
|
79411
79626
|
}
|
|
79412
|
-
function onnext(
|
|
79627
|
+
function onnext(resolve8, reject) {
|
|
79413
79628
|
if (error) {
|
|
79414
79629
|
return reject(error);
|
|
79415
79630
|
}
|
|
79416
79631
|
if (entryStream) {
|
|
79417
|
-
|
|
79632
|
+
resolve8({ value: entryStream, done: false });
|
|
79418
79633
|
entryStream = null;
|
|
79419
79634
|
return;
|
|
79420
79635
|
}
|
|
79421
|
-
promiseResolve =
|
|
79636
|
+
promiseResolve = resolve8;
|
|
79422
79637
|
promiseReject = reject;
|
|
79423
79638
|
consumeCallback(null);
|
|
79424
79639
|
if (extract._finished && promiseResolve) {
|
|
@@ -79449,14 +79664,14 @@ var require_extract = __commonJS((exports, module) => {
|
|
|
79449
79664
|
function destroy(err) {
|
|
79450
79665
|
extract.destroy(err);
|
|
79451
79666
|
consumeCallback(err);
|
|
79452
|
-
return new Promise((
|
|
79667
|
+
return new Promise((resolve8, reject) => {
|
|
79453
79668
|
if (extract.destroyed)
|
|
79454
|
-
return
|
|
79669
|
+
return resolve8({ value: undefined, done: true });
|
|
79455
79670
|
extract.once("close", function() {
|
|
79456
79671
|
if (err)
|
|
79457
79672
|
reject(err);
|
|
79458
79673
|
else
|
|
79459
|
-
|
|
79674
|
+
resolve8({ value: undefined, done: true });
|
|
79460
79675
|
});
|
|
79461
79676
|
});
|
|
79462
79677
|
}
|
|
@@ -80254,7 +80469,7 @@ var init_fileUtil = __esm(() => {
|
|
|
80254
80469
|
// node_modules/@puppeteer/browsers/lib/esm/install.js
|
|
80255
80470
|
import assert2 from "node:assert";
|
|
80256
80471
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
80257
|
-
import { existsSync as
|
|
80472
|
+
import { existsSync as existsSync26, readFileSync as readFileSync24 } from "node:fs";
|
|
80258
80473
|
import { mkdir as mkdir2, unlink } from "node:fs/promises";
|
|
80259
80474
|
import os5 from "node:os";
|
|
80260
80475
|
import path8 from "node:path";
|
|
@@ -80307,7 +80522,7 @@ async function installWithProviders(options) {
|
|
|
80307
80522
|
continue;
|
|
80308
80523
|
}
|
|
80309
80524
|
debugInstall(`Successfully got URL from ${provider.getName()}: ${url}`);
|
|
80310
|
-
if (!
|
|
80525
|
+
if (!existsSync26(browserRoot)) {
|
|
80311
80526
|
await mkdir2(browserRoot, { recursive: true });
|
|
80312
80527
|
}
|
|
80313
80528
|
return await installUrl(url, options, provider);
|
|
@@ -80340,7 +80555,7 @@ async function installDeps(installedBrowser) {
|
|
|
80340
80555
|
return;
|
|
80341
80556
|
}
|
|
80342
80557
|
const depsPath = path8.join(path8.dirname(installedBrowser.executablePath), "deb.deps");
|
|
80343
|
-
if (!
|
|
80558
|
+
if (!existsSync26(depsPath)) {
|
|
80344
80559
|
debugInstall(`deb.deps file was not found at ${depsPath}`);
|
|
80345
80560
|
return;
|
|
80346
80561
|
}
|
|
@@ -80382,11 +80597,11 @@ async function installUrl(url, options, provider) {
|
|
|
80382
80597
|
const cache = new Cache(options.cacheDir);
|
|
80383
80598
|
const browserRoot = cache.browserRoot(options.browser);
|
|
80384
80599
|
const archivePath = path8.join(browserRoot, `${options.buildId}-${fileName}`);
|
|
80385
|
-
if (!
|
|
80600
|
+
if (!existsSync26(browserRoot)) {
|
|
80386
80601
|
await mkdir2(browserRoot, { recursive: true });
|
|
80387
80602
|
}
|
|
80388
80603
|
if (!options.unpack) {
|
|
80389
|
-
if (
|
|
80604
|
+
if (existsSync26(archivePath)) {
|
|
80390
80605
|
return archivePath;
|
|
80391
80606
|
}
|
|
80392
80607
|
debugInstall(`Downloading binary from ${url}`);
|
|
@@ -80407,8 +80622,8 @@ async function installUrl(url, options, provider) {
|
|
|
80407
80622
|
cache.writeExecutablePath(options.browser, options.platform, options.buildId, relativeExecutablePath6);
|
|
80408
80623
|
}
|
|
80409
80624
|
try {
|
|
80410
|
-
if (
|
|
80411
|
-
if (!
|
|
80625
|
+
if (existsSync26(outputPath)) {
|
|
80626
|
+
if (!existsSync26(installedBrowser.executablePath)) {
|
|
80412
80627
|
throw new Error(`The browser folder (${outputPath}) exists but the executable (${installedBrowser.executablePath}) is missing`);
|
|
80413
80628
|
}
|
|
80414
80629
|
await runSetup(installedBrowser);
|
|
@@ -80417,7 +80632,7 @@ async function installUrl(url, options, provider) {
|
|
|
80417
80632
|
}
|
|
80418
80633
|
return installedBrowser;
|
|
80419
80634
|
}
|
|
80420
|
-
if (!
|
|
80635
|
+
if (!existsSync26(archivePath)) {
|
|
80421
80636
|
debugInstall(`Downloading binary from ${url}`);
|
|
80422
80637
|
try {
|
|
80423
80638
|
debugTime("download");
|
|
@@ -80446,7 +80661,7 @@ async function installUrl(url, options, provider) {
|
|
|
80446
80661
|
}
|
|
80447
80662
|
return installedBrowser;
|
|
80448
80663
|
} finally {
|
|
80449
|
-
if (
|
|
80664
|
+
if (existsSync26(archivePath)) {
|
|
80450
80665
|
await unlink(archivePath);
|
|
80451
80666
|
}
|
|
80452
80667
|
}
|
|
@@ -80457,7 +80672,7 @@ async function runSetup(installedBrowser) {
|
|
|
80457
80672
|
debugTime("permissions");
|
|
80458
80673
|
const browserDir = path8.dirname(installedBrowser.executablePath);
|
|
80459
80674
|
const setupExePath = path8.join(browserDir, "setup.exe");
|
|
80460
|
-
if (!
|
|
80675
|
+
if (!existsSync26(setupExePath)) {
|
|
80461
80676
|
return;
|
|
80462
80677
|
}
|
|
80463
80678
|
spawnSync3(path8.join(browserDir, "setup.exe"), [`--configure-browser-in-directory=` + browserDir], {
|
|
@@ -80838,19 +81053,19 @@ var init_cliui = __esm(() => {
|
|
|
80838
81053
|
});
|
|
80839
81054
|
|
|
80840
81055
|
// node_modules/escalade/sync/index.mjs
|
|
80841
|
-
import { dirname as
|
|
81056
|
+
import { dirname as dirname11, resolve as resolve9 } from "path";
|
|
80842
81057
|
import { readdirSync as readdirSync8, statSync as statSync10 } from "fs";
|
|
80843
81058
|
function sync_default(start, callback) {
|
|
80844
|
-
let dir =
|
|
81059
|
+
let dir = resolve9(".", start);
|
|
80845
81060
|
let tmp, stats = statSync10(dir);
|
|
80846
81061
|
if (!stats.isDirectory()) {
|
|
80847
|
-
dir =
|
|
81062
|
+
dir = dirname11(dir);
|
|
80848
81063
|
}
|
|
80849
81064
|
while (true) {
|
|
80850
81065
|
tmp = callback(dir, readdirSync8(dir));
|
|
80851
81066
|
if (tmp)
|
|
80852
|
-
return
|
|
80853
|
-
dir =
|
|
81067
|
+
return resolve9(dir, tmp);
|
|
81068
|
+
dir = dirname11(tmp = dir);
|
|
80854
81069
|
if (tmp === dir)
|
|
80855
81070
|
break;
|
|
80856
81071
|
}
|
|
@@ -81796,7 +82011,7 @@ var init_yargs_parser = __esm(() => {
|
|
|
81796
82011
|
|
|
81797
82012
|
// node_modules/yargs-parser/build/lib/index.js
|
|
81798
82013
|
import { format } from "util";
|
|
81799
|
-
import { normalize as normalize2, resolve as
|
|
82014
|
+
import { normalize as normalize2, resolve as resolve10 } from "path";
|
|
81800
82015
|
var _a3, _b, _c, minNodeVersion, nodeVersion, env, parser, yargsParser = function Parser(args, opts) {
|
|
81801
82016
|
const result = parser.parse(args.slice(), opts);
|
|
81802
82017
|
return result.argv;
|
|
@@ -81819,7 +82034,7 @@ var init_lib2 = __esm(() => {
|
|
|
81819
82034
|
},
|
|
81820
82035
|
format,
|
|
81821
82036
|
normalize: normalize2,
|
|
81822
|
-
resolve:
|
|
82037
|
+
resolve: resolve10,
|
|
81823
82038
|
require: (path9) => {
|
|
81824
82039
|
if (true) {
|
|
81825
82040
|
return __require(path9);
|
|
@@ -81872,7 +82087,7 @@ var init_yerror = __esm(() => {
|
|
|
81872
82087
|
// node_modules/y18n/build/lib/platform-shims/node.js
|
|
81873
82088
|
import { readFileSync as readFileSync25, statSync as statSync11, writeFile } from "fs";
|
|
81874
82089
|
import { format as format2 } from "util";
|
|
81875
|
-
import { resolve as
|
|
82090
|
+
import { resolve as resolve11 } from "path";
|
|
81876
82091
|
var node_default;
|
|
81877
82092
|
var init_node = __esm(() => {
|
|
81878
82093
|
node_default = {
|
|
@@ -81881,7 +82096,7 @@ var init_node = __esm(() => {
|
|
|
81881
82096
|
writeFile
|
|
81882
82097
|
},
|
|
81883
82098
|
format: format2,
|
|
81884
|
-
resolve:
|
|
82099
|
+
resolve: resolve11,
|
|
81885
82100
|
exists: (file) => {
|
|
81886
82101
|
try {
|
|
81887
82102
|
return statSync11(file).isFile();
|
|
@@ -82064,7 +82279,7 @@ import { notStrictEqual, strictEqual } from "assert";
|
|
|
82064
82279
|
import { inspect } from "util";
|
|
82065
82280
|
import { readFileSync as readFileSync26 } from "fs";
|
|
82066
82281
|
import { fileURLToPath } from "url";
|
|
82067
|
-
import { basename as basename10, dirname as
|
|
82282
|
+
import { basename as basename10, dirname as dirname12, extname as extname3, relative as relative7, resolve as resolve12 } from "path";
|
|
82068
82283
|
var REQUIRE_ERROR = "require is not supported by ESM", REQUIRE_DIRECTORY_ERROR = "loading a directory of commands is not supported yet for ESM", __dirname2, mainFilename, esm_default;
|
|
82069
82284
|
var init_esm = __esm(() => {
|
|
82070
82285
|
init_cliui();
|
|
@@ -82097,10 +82312,10 @@ var init_esm = __esm(() => {
|
|
|
82097
82312
|
Parser: lib_default,
|
|
82098
82313
|
path: {
|
|
82099
82314
|
basename: basename10,
|
|
82100
|
-
dirname:
|
|
82315
|
+
dirname: dirname12,
|
|
82101
82316
|
extname: extname3,
|
|
82102
82317
|
relative: relative7,
|
|
82103
|
-
resolve:
|
|
82318
|
+
resolve: resolve12
|
|
82104
82319
|
},
|
|
82105
82320
|
process: {
|
|
82106
82321
|
argv: () => process.argv,
|
|
@@ -82122,7 +82337,7 @@ var init_esm = __esm(() => {
|
|
|
82122
82337
|
return [...str].length;
|
|
82123
82338
|
},
|
|
82124
82339
|
y18n: y18n_default({
|
|
82125
|
-
directory:
|
|
82340
|
+
directory: resolve12(__dirname2, "../../../locales"),
|
|
82126
82341
|
updateFiles: false
|
|
82127
82342
|
})
|
|
82128
82343
|
};
|
|
@@ -84370,12 +84585,12 @@ var init_yargs_factory = __esm(() => {
|
|
|
84370
84585
|
async getCompletion(args, done) {
|
|
84371
84586
|
argsert("<array> [function]", [args, done], arguments.length);
|
|
84372
84587
|
if (!done) {
|
|
84373
|
-
return new Promise((
|
|
84588
|
+
return new Promise((resolve13, reject) => {
|
|
84374
84589
|
__classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, (err, completions) => {
|
|
84375
84590
|
if (err)
|
|
84376
84591
|
reject(err);
|
|
84377
84592
|
else
|
|
84378
|
-
|
|
84593
|
+
resolve13(completions);
|
|
84379
84594
|
});
|
|
84380
84595
|
});
|
|
84381
84596
|
} else {
|
|
@@ -85810,9 +86025,9 @@ async function getConnectionTransport(options) {
|
|
|
85810
86025
|
throw new Error("Could not detect required browser platform");
|
|
85811
86026
|
}
|
|
85812
86027
|
const { convertPuppeteerChannelToBrowsersChannel: convertPuppeteerChannelToBrowsersChannel2 } = await Promise.resolve().then(() => (init_LaunchOptions(), exports_LaunchOptions));
|
|
85813
|
-
const { join:
|
|
86028
|
+
const { join: join27 } = await import("node:path");
|
|
85814
86029
|
const userDataDir = resolveDefaultUserDataDir3(Browser7.CHROME, platform2, convertPuppeteerChannelToBrowsersChannel2(options.channel));
|
|
85815
|
-
const portPath =
|
|
86030
|
+
const portPath = join27(userDataDir, "DevToolsActivePort");
|
|
85816
86031
|
try {
|
|
85817
86032
|
const fileContent = await environment.value.fs.promises.readFile(portPath, "ascii");
|
|
85818
86033
|
const [rawPort, rawPath] = fileContent.split(`
|
|
@@ -86036,9 +86251,9 @@ var init_PipeTransport = __esm(() => {
|
|
|
86036
86251
|
});
|
|
86037
86252
|
|
|
86038
86253
|
// node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserLauncher.js
|
|
86039
|
-
import { existsSync as
|
|
86254
|
+
import { existsSync as existsSync27 } from "node:fs";
|
|
86040
86255
|
import { tmpdir } from "node:os";
|
|
86041
|
-
import { join as
|
|
86256
|
+
import { join as join27 } from "node:path";
|
|
86042
86257
|
|
|
86043
86258
|
class BrowserLauncher {
|
|
86044
86259
|
#browser;
|
|
@@ -86063,7 +86278,7 @@ class BrowserLauncher {
|
|
|
86063
86278
|
...options,
|
|
86064
86279
|
protocol
|
|
86065
86280
|
});
|
|
86066
|
-
if (!
|
|
86281
|
+
if (!existsSync27(launchArgs.executablePath)) {
|
|
86067
86282
|
throw new Error(`Browser was not found at the configured executablePath (${launchArgs.executablePath})`);
|
|
86068
86283
|
}
|
|
86069
86284
|
const usePipe = launchArgs.args.includes("--remote-debugging-pipe");
|
|
@@ -86138,7 +86353,7 @@ class BrowserLauncher {
|
|
|
86138
86353
|
browserCloseCallback();
|
|
86139
86354
|
const logs = browserProcess.getRecentLogs().join(`
|
|
86140
86355
|
`);
|
|
86141
|
-
if (logs.includes("Failed to create a ProcessSingleton for your profile directory") || process.platform === "win32" &&
|
|
86356
|
+
if (logs.includes("Failed to create a ProcessSingleton for your profile directory") || process.platform === "win32" && existsSync27(join27(launchArgs.userDataDir, "lockfile"))) {
|
|
86142
86357
|
throw new Error(`The browser is already running for ${launchArgs.userDataDir}. Use a different \`userDataDir\` or stop the running browser first.`);
|
|
86143
86358
|
}
|
|
86144
86359
|
if (logs.includes("Missing X server") && options.headless === false) {
|
|
@@ -86228,12 +86443,12 @@ class BrowserLauncher {
|
|
|
86228
86443
|
});
|
|
86229
86444
|
}
|
|
86230
86445
|
getProfilePath() {
|
|
86231
|
-
return
|
|
86446
|
+
return join27(this.puppeteer.configuration.temporaryDirectory ?? tmpdir(), `puppeteer_dev_${this.browser}_profile-`);
|
|
86232
86447
|
}
|
|
86233
86448
|
resolveExecutablePath(headless, validatePath = true) {
|
|
86234
86449
|
let executablePath = this.puppeteer.configuration.executablePath;
|
|
86235
86450
|
if (executablePath) {
|
|
86236
|
-
if (validatePath && !
|
|
86451
|
+
if (validatePath && !existsSync27(executablePath)) {
|
|
86237
86452
|
throw new Error(`Tried to find the browser at the configured path (${executablePath}), but no executable was found.`);
|
|
86238
86453
|
}
|
|
86239
86454
|
return executablePath;
|
|
@@ -86256,7 +86471,7 @@ class BrowserLauncher {
|
|
|
86256
86471
|
browser: browserType,
|
|
86257
86472
|
buildId: this.puppeteer.browserVersion
|
|
86258
86473
|
});
|
|
86259
|
-
if (validatePath && !
|
|
86474
|
+
if (validatePath && !existsSync27(executablePath)) {
|
|
86260
86475
|
const configVersion = this.puppeteer.configuration?.[this.browser]?.version;
|
|
86261
86476
|
if (configVersion) {
|
|
86262
86477
|
throw new Error(`Tried to find the browser at the configured path (${executablePath}) for version ${configVersion}, but no executable was found.`);
|
|
@@ -86794,7 +87009,7 @@ var init_PuppeteerNode = __esm(() => {
|
|
|
86794
87009
|
import { spawn as spawn2, spawnSync as spawnSync4 } from "node:child_process";
|
|
86795
87010
|
import fs5 from "node:fs";
|
|
86796
87011
|
import os8 from "node:os";
|
|
86797
|
-
import { dirname as
|
|
87012
|
+
import { dirname as dirname13 } from "node:path";
|
|
86798
87013
|
import { PassThrough } from "node:stream";
|
|
86799
87014
|
var import_debug6, __runInitializers22 = function(thisArg, initializers, value) {
|
|
86800
87015
|
var useValue = arguments.length > 2;
|
|
@@ -86868,8 +87083,8 @@ var init_ScreenRecorder = __esm(() => {
|
|
|
86868
87083
|
static {
|
|
86869
87084
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : undefined;
|
|
86870
87085
|
__esDecorate22(this, _private_writeFrame_descriptor = { value: __setFunctionName5(async function(buffer) {
|
|
86871
|
-
const error = await new Promise((
|
|
86872
|
-
this.#process.stdin.write(buffer,
|
|
87086
|
+
const error = await new Promise((resolve13) => {
|
|
87087
|
+
this.#process.stdin.write(buffer, resolve13);
|
|
86873
87088
|
});
|
|
86874
87089
|
if (error) {
|
|
86875
87090
|
console.log(`ffmpeg failed to write: ${error.message}.`);
|
|
@@ -86918,7 +87133,7 @@ var init_ScreenRecorder = __esm(() => {
|
|
|
86918
87133
|
filters.push(formatArgs.splice(vf, 2).at(-1) ?? "");
|
|
86919
87134
|
}
|
|
86920
87135
|
if (path11) {
|
|
86921
|
-
fs5.mkdirSync(
|
|
87136
|
+
fs5.mkdirSync(dirname13(path11), { recursive: overwrite });
|
|
86922
87137
|
}
|
|
86923
87138
|
this.#process = spawn2(ffmpegPath, [
|
|
86924
87139
|
["-loglevel", "error"],
|
|
@@ -87024,8 +87239,8 @@ var init_ScreenRecorder = __esm(() => {
|
|
|
87024
87239
|
const [buffer, timestamp] = await this.#lastFrame;
|
|
87025
87240
|
await Promise.all(Array(Math.max(1, Math.round(this.#fps * (performance.now() - timestamp) / 1000))).fill(buffer).map(this.#writeFrame.bind(this)));
|
|
87026
87241
|
this.#process.stdin.end();
|
|
87027
|
-
await new Promise((
|
|
87028
|
-
this.#process.once("close",
|
|
87242
|
+
await new Promise((resolve13) => {
|
|
87243
|
+
this.#process.once("close", resolve13);
|
|
87029
87244
|
});
|
|
87030
87245
|
}
|
|
87031
87246
|
async[(_private_writeFrame_decorators = [guarded()], _stop_decorators = [guarded()], asyncDisposeSymbol)]() {
|
|
@@ -87071,17 +87286,17 @@ var init_puppeteer_core = __esm(() => {
|
|
|
87071
87286
|
});
|
|
87072
87287
|
|
|
87073
87288
|
// src/core/design-eval/capture.ts
|
|
87074
|
-
import { mkdirSync as
|
|
87075
|
-
import { join as
|
|
87289
|
+
import { mkdirSync as mkdirSync13, statSync as statSync12, existsSync as existsSync28 } from "fs";
|
|
87290
|
+
import { join as join28 } from "path";
|
|
87076
87291
|
function findBrowser() {
|
|
87077
87292
|
const platform2 = process.platform;
|
|
87078
87293
|
const paths = CHROME_PATHS[platform2] ?? [];
|
|
87079
87294
|
for (const p of paths) {
|
|
87080
|
-
if (
|
|
87295
|
+
if (existsSync28(p))
|
|
87081
87296
|
return p;
|
|
87082
87297
|
}
|
|
87083
|
-
const minkBrowsers =
|
|
87084
|
-
if (
|
|
87298
|
+
const minkBrowsers = join28(minkRoot(), "browsers");
|
|
87299
|
+
if (existsSync28(minkBrowsers)) {
|
|
87085
87300
|
const found = findChromeInDir(minkBrowsers);
|
|
87086
87301
|
if (found)
|
|
87087
87302
|
return found;
|
|
@@ -87102,7 +87317,7 @@ function findChromeInDir(dir) {
|
|
|
87102
87317
|
try {
|
|
87103
87318
|
const entries = readdirSync9(dir);
|
|
87104
87319
|
for (const entry of entries) {
|
|
87105
|
-
const full =
|
|
87320
|
+
const full = join28(dir, entry);
|
|
87106
87321
|
try {
|
|
87107
87322
|
const stat2 = statSync13(full);
|
|
87108
87323
|
if (stat2.isDirectory()) {
|
|
@@ -87150,7 +87365,7 @@ async function captureRoute(page, route, baseUrl, viewport, options) {
|
|
|
87150
87365
|
const y = section * viewport.height;
|
|
87151
87366
|
const clipHeight = Math.min(viewport.height, pageHeight - y);
|
|
87152
87367
|
const fileName = `${prefix}-${viewport.name}-${section}.jpg`;
|
|
87153
|
-
const filePath =
|
|
87368
|
+
const filePath = join28(options.outputDir, fileName);
|
|
87154
87369
|
await page.screenshot({
|
|
87155
87370
|
path: filePath,
|
|
87156
87371
|
type: "jpeg",
|
|
@@ -87182,7 +87397,7 @@ async function captureRoute(page, route, baseUrl, viewport, options) {
|
|
|
87182
87397
|
return results;
|
|
87183
87398
|
}
|
|
87184
87399
|
async function captureAllRoutes(routes, baseUrl, viewports, options, outputDir) {
|
|
87185
|
-
|
|
87400
|
+
mkdirSync13(outputDir, { recursive: true });
|
|
87186
87401
|
const executablePath = findBrowser();
|
|
87187
87402
|
const browser = await puppeteer_core_default.launch({
|
|
87188
87403
|
executablePath,
|
|
@@ -88614,9 +88829,9 @@ var exports_wiki = {};
|
|
|
88614
88829
|
__export(exports_wiki, {
|
|
88615
88830
|
wiki: () => wiki
|
|
88616
88831
|
});
|
|
88617
|
-
import { existsSync as
|
|
88618
|
-
import { resolve as
|
|
88619
|
-
import { homedir as
|
|
88832
|
+
import { existsSync as existsSync29, statSync as statSync13 } from "fs";
|
|
88833
|
+
import { resolve as resolve13 } from "path";
|
|
88834
|
+
import { homedir as homedir5 } from "os";
|
|
88620
88835
|
async function wiki(_cwd, args) {
|
|
88621
88836
|
const sub = args[0];
|
|
88622
88837
|
switch (sub) {
|
|
@@ -88670,7 +88885,7 @@ async function wikiInit(args) {
|
|
|
88670
88885
|
console.log(`[mink] initializing vault at ${targetPath}`);
|
|
88671
88886
|
console.log(" (set a custom path with: mink wiki init /path/to/vault)");
|
|
88672
88887
|
}
|
|
88673
|
-
const isExisting =
|
|
88888
|
+
const isExisting = existsSync29(targetPath) && statSync13(targetPath).isDirectory();
|
|
88674
88889
|
setConfigValue("wiki.path", targetPath);
|
|
88675
88890
|
ensureVaultStructure();
|
|
88676
88891
|
seedTemplates(vaultTemplates());
|
|
@@ -88874,9 +89089,9 @@ function wikiLinks() {
|
|
|
88874
89089
|
}
|
|
88875
89090
|
function expandPath(raw) {
|
|
88876
89091
|
if (raw.startsWith("~/")) {
|
|
88877
|
-
return
|
|
89092
|
+
return resolve13(homedir5(), raw.slice(2));
|
|
88878
89093
|
}
|
|
88879
|
-
return
|
|
89094
|
+
return resolve13(raw);
|
|
88880
89095
|
}
|
|
88881
89096
|
var init_wiki = __esm(() => {
|
|
88882
89097
|
init_vault();
|
|
@@ -88892,8 +89107,8 @@ var exports_note = {};
|
|
|
88892
89107
|
__export(exports_note, {
|
|
88893
89108
|
note: () => note
|
|
88894
89109
|
});
|
|
88895
|
-
import { resolve as
|
|
88896
|
-
import { existsSync as
|
|
89110
|
+
import { resolve as resolve14 } from "path";
|
|
89111
|
+
import { existsSync as existsSync30, readFileSync as readFileSync27 } from "fs";
|
|
88897
89112
|
async function note(cwd, args) {
|
|
88898
89113
|
if (!isWikiEnabled()) {
|
|
88899
89114
|
console.error("[mink] wiki feature is disabled");
|
|
@@ -88923,8 +89138,8 @@ async function note(cwd, args) {
|
|
|
88923
89138
|
return;
|
|
88924
89139
|
}
|
|
88925
89140
|
if (parsed.file) {
|
|
88926
|
-
const sourcePath =
|
|
88927
|
-
if (!
|
|
89141
|
+
const sourcePath = resolve14(cwd, parsed.file);
|
|
89142
|
+
if (!existsSync30(sourcePath)) {
|
|
88928
89143
|
console.error(`[mink] file not found: ${sourcePath}`);
|
|
88929
89144
|
process.exit(1);
|
|
88930
89145
|
}
|
|
@@ -89085,39 +89300,39 @@ var exports_skill = {};
|
|
|
89085
89300
|
__export(exports_skill, {
|
|
89086
89301
|
skill: () => skill
|
|
89087
89302
|
});
|
|
89088
|
-
import { join as
|
|
89089
|
-
import { homedir as
|
|
89303
|
+
import { join as join29, resolve as resolve15, dirname as dirname14 } from "path";
|
|
89304
|
+
import { homedir as homedir6 } from "os";
|
|
89090
89305
|
import {
|
|
89091
|
-
existsSync as
|
|
89092
|
-
mkdirSync as
|
|
89306
|
+
existsSync as existsSync31,
|
|
89307
|
+
mkdirSync as mkdirSync14,
|
|
89093
89308
|
copyFileSync,
|
|
89094
|
-
unlinkSync as
|
|
89309
|
+
unlinkSync as unlinkSync5,
|
|
89095
89310
|
readdirSync as readdirSync9,
|
|
89096
89311
|
rmSync,
|
|
89097
89312
|
symlinkSync as symlinkSync2,
|
|
89098
89313
|
lstatSync as lstatSync2
|
|
89099
89314
|
} from "fs";
|
|
89100
89315
|
function getSkillsSourceDir() {
|
|
89101
|
-
let dir =
|
|
89316
|
+
let dir = dirname14(new URL(import.meta.url).pathname);
|
|
89102
89317
|
while (true) {
|
|
89103
|
-
if (
|
|
89104
|
-
return
|
|
89318
|
+
if (existsSync31(join29(dir, "package.json")) && existsSync31(join29(dir, "skills"))) {
|
|
89319
|
+
return join29(dir, "skills");
|
|
89105
89320
|
}
|
|
89106
|
-
const parent =
|
|
89321
|
+
const parent = dirname14(dir);
|
|
89107
89322
|
if (parent === dir)
|
|
89108
89323
|
break;
|
|
89109
89324
|
dir = parent;
|
|
89110
89325
|
}
|
|
89111
|
-
return
|
|
89326
|
+
return resolve15(dirname14(new URL(import.meta.url).pathname), "../../skills");
|
|
89112
89327
|
}
|
|
89113
89328
|
function getAvailableSkills() {
|
|
89114
89329
|
const dir = getSkillsSourceDir();
|
|
89115
|
-
if (!
|
|
89330
|
+
if (!existsSync31(dir))
|
|
89116
89331
|
return [];
|
|
89117
|
-
return readdirSync9(dir, { withFileTypes: true }).filter((d) => d.isDirectory() &&
|
|
89332
|
+
return readdirSync9(dir, { withFileTypes: true }).filter((d) => d.isDirectory() && existsSync31(join29(dir, d.name, "SKILL.md"))).map((d) => d.name);
|
|
89118
89333
|
}
|
|
89119
89334
|
function isInstalled(skillName) {
|
|
89120
|
-
return
|
|
89335
|
+
return existsSync31(join29(AGENTS_SKILLS_DIR, skillName, "SKILL.md"));
|
|
89121
89336
|
}
|
|
89122
89337
|
async function skill(args) {
|
|
89123
89338
|
const sub = args[0];
|
|
@@ -89151,28 +89366,28 @@ function skillInstall(name) {
|
|
|
89151
89366
|
console.error(" Expected skills at: " + sourceDir);
|
|
89152
89367
|
return;
|
|
89153
89368
|
}
|
|
89154
|
-
|
|
89369
|
+
mkdirSync14(AGENTS_SKILLS_DIR, { recursive: true });
|
|
89155
89370
|
for (const skillName of skills) {
|
|
89156
|
-
const srcDir =
|
|
89157
|
-
const srcFile =
|
|
89158
|
-
const destDir =
|
|
89159
|
-
if (!
|
|
89371
|
+
const srcDir = join29(sourceDir, skillName);
|
|
89372
|
+
const srcFile = join29(srcDir, "SKILL.md");
|
|
89373
|
+
const destDir = join29(AGENTS_SKILLS_DIR, skillName);
|
|
89374
|
+
if (!existsSync31(srcFile)) {
|
|
89160
89375
|
console.error(`[mink] skill not found: ${skillName}`);
|
|
89161
89376
|
continue;
|
|
89162
89377
|
}
|
|
89163
|
-
|
|
89378
|
+
mkdirSync14(destDir, { recursive: true });
|
|
89164
89379
|
copyDirRecursive(srcDir, destDir);
|
|
89165
|
-
|
|
89166
|
-
const symlink =
|
|
89380
|
+
mkdirSync14(CLAUDE_SKILLS_DIR, { recursive: true });
|
|
89381
|
+
const symlink = join29(CLAUDE_SKILLS_DIR, skillName);
|
|
89167
89382
|
try {
|
|
89168
|
-
if (
|
|
89383
|
+
if (existsSync31(symlink)) {
|
|
89169
89384
|
if (lstatSync2(symlink).isSymbolicLink() || lstatSync2(symlink).isFile()) {
|
|
89170
|
-
|
|
89385
|
+
unlinkSync5(symlink);
|
|
89171
89386
|
} else {
|
|
89172
89387
|
rmSync(symlink, { recursive: true, force: true });
|
|
89173
89388
|
}
|
|
89174
89389
|
}
|
|
89175
|
-
const relativeTarget =
|
|
89390
|
+
const relativeTarget = join29("..", "..", ".agents", "skills", skillName);
|
|
89176
89391
|
symlinkSync2(relativeTarget, symlink);
|
|
89177
89392
|
} catch {}
|
|
89178
89393
|
console.log(`[mink] installed: ${skillName} -> ${destDir}`);
|
|
@@ -89183,16 +89398,16 @@ function skillInstall(name) {
|
|
|
89183
89398
|
function skillUninstall(name) {
|
|
89184
89399
|
const skills = name ? [name] : getAvailableSkills();
|
|
89185
89400
|
for (const skillName of skills) {
|
|
89186
|
-
const destDir =
|
|
89187
|
-
if (!
|
|
89401
|
+
const destDir = join29(AGENTS_SKILLS_DIR, skillName);
|
|
89402
|
+
if (!existsSync31(destDir)) {
|
|
89188
89403
|
console.log(`[mink] not installed: ${skillName}`);
|
|
89189
89404
|
continue;
|
|
89190
89405
|
}
|
|
89191
89406
|
rmSync(destDir, { recursive: true, force: true });
|
|
89192
|
-
const symlink =
|
|
89407
|
+
const symlink = join29(CLAUDE_SKILLS_DIR, skillName);
|
|
89193
89408
|
try {
|
|
89194
|
-
if (
|
|
89195
|
-
|
|
89409
|
+
if (existsSync31(symlink))
|
|
89410
|
+
unlinkSync5(symlink);
|
|
89196
89411
|
} catch {}
|
|
89197
89412
|
console.log(`[mink] uninstalled: ${skillName}`);
|
|
89198
89413
|
}
|
|
@@ -89206,7 +89421,7 @@ function skillList() {
|
|
|
89206
89421
|
if (installed.length > 0) {
|
|
89207
89422
|
console.log(" Installed:");
|
|
89208
89423
|
for (const s of installed) {
|
|
89209
|
-
console.log(` ${s} (${
|
|
89424
|
+
console.log(` ${s} (${join29(AGENTS_SKILLS_DIR, s)})`);
|
|
89210
89425
|
}
|
|
89211
89426
|
}
|
|
89212
89427
|
if (notInstalled.length > 0) {
|
|
@@ -89225,10 +89440,10 @@ function skillList() {
|
|
|
89225
89440
|
function copyDirRecursive(src, dest) {
|
|
89226
89441
|
const entries = readdirSync9(src, { withFileTypes: true });
|
|
89227
89442
|
for (const entry of entries) {
|
|
89228
|
-
const srcPath =
|
|
89229
|
-
const destPath =
|
|
89443
|
+
const srcPath = join29(src, entry.name);
|
|
89444
|
+
const destPath = join29(dest, entry.name);
|
|
89230
89445
|
if (entry.isDirectory()) {
|
|
89231
|
-
|
|
89446
|
+
mkdirSync14(destPath, { recursive: true });
|
|
89232
89447
|
copyDirRecursive(srcPath, destPath);
|
|
89233
89448
|
} else {
|
|
89234
89449
|
copyFileSync(srcPath, destPath);
|
|
@@ -89237,8 +89452,215 @@ function copyDirRecursive(src, dest) {
|
|
|
89237
89452
|
}
|
|
89238
89453
|
var AGENTS_SKILLS_DIR, CLAUDE_SKILLS_DIR;
|
|
89239
89454
|
var init_skill = __esm(() => {
|
|
89240
|
-
AGENTS_SKILLS_DIR =
|
|
89241
|
-
CLAUDE_SKILLS_DIR =
|
|
89455
|
+
AGENTS_SKILLS_DIR = join29(homedir6(), ".agents", "skills");
|
|
89456
|
+
CLAUDE_SKILLS_DIR = join29(homedir6(), ".claude", "skills");
|
|
89457
|
+
});
|
|
89458
|
+
|
|
89459
|
+
// src/commands/agent.ts
|
|
89460
|
+
var exports_agent = {};
|
|
89461
|
+
__export(exports_agent, {
|
|
89462
|
+
agent: () => agent
|
|
89463
|
+
});
|
|
89464
|
+
import { join as join30, resolve as resolve16, dirname as dirname15 } from "path";
|
|
89465
|
+
import { homedir as homedir7 } from "os";
|
|
89466
|
+
import {
|
|
89467
|
+
existsSync as existsSync32,
|
|
89468
|
+
mkdirSync as mkdirSync15,
|
|
89469
|
+
readFileSync as readFileSync28,
|
|
89470
|
+
writeFileSync as writeFileSync10
|
|
89471
|
+
} from "fs";
|
|
89472
|
+
import { createHash as createHash2 } from "crypto";
|
|
89473
|
+
import { spawnSync as spawnSync5 } from "child_process";
|
|
89474
|
+
function getAgentTemplatePath() {
|
|
89475
|
+
let dir = dirname15(new URL(import.meta.url).pathname);
|
|
89476
|
+
while (true) {
|
|
89477
|
+
if (existsSync32(join30(dir, "package.json")) && existsSync32(join30(dir, "agents", TEMPLATE_FILE))) {
|
|
89478
|
+
return join30(dir, "agents", TEMPLATE_FILE);
|
|
89479
|
+
}
|
|
89480
|
+
const parent = dirname15(dir);
|
|
89481
|
+
if (parent === dir)
|
|
89482
|
+
break;
|
|
89483
|
+
dir = parent;
|
|
89484
|
+
}
|
|
89485
|
+
return resolve16(dirname15(new URL(import.meta.url).pathname), "../../agents", TEMPLATE_FILE);
|
|
89486
|
+
}
|
|
89487
|
+
function getMinkVersion() {
|
|
89488
|
+
let dir = dirname15(new URL(import.meta.url).pathname);
|
|
89489
|
+
while (true) {
|
|
89490
|
+
const pkgPath = join30(dir, "package.json");
|
|
89491
|
+
if (existsSync32(pkgPath)) {
|
|
89492
|
+
try {
|
|
89493
|
+
const pkg = JSON.parse(readFileSync28(pkgPath, "utf-8"));
|
|
89494
|
+
if (pkg.name && pkg.version)
|
|
89495
|
+
return pkg.version;
|
|
89496
|
+
} catch {}
|
|
89497
|
+
}
|
|
89498
|
+
const parent = dirname15(dir);
|
|
89499
|
+
if (parent === dir)
|
|
89500
|
+
break;
|
|
89501
|
+
dir = parent;
|
|
89502
|
+
}
|
|
89503
|
+
return "unknown";
|
|
89504
|
+
}
|
|
89505
|
+
function renderTemplate(template, vars) {
|
|
89506
|
+
let out = template;
|
|
89507
|
+
for (const [key, value] of Object.entries(vars)) {
|
|
89508
|
+
out = out.split(`{{${key}}}`).join(value);
|
|
89509
|
+
}
|
|
89510
|
+
return out;
|
|
89511
|
+
}
|
|
89512
|
+
function sha256(text) {
|
|
89513
|
+
return createHash2("sha256").update(text).digest("hex");
|
|
89514
|
+
}
|
|
89515
|
+
function claudeAgentsDir() {
|
|
89516
|
+
return join30(homedir7(), ".claude", "agents");
|
|
89517
|
+
}
|
|
89518
|
+
function installedAgentPath() {
|
|
89519
|
+
return join30(claudeAgentsDir(), INSTALLED_FILE);
|
|
89520
|
+
}
|
|
89521
|
+
function installAgentDefinition(opts) {
|
|
89522
|
+
const templatePath = getAgentTemplatePath();
|
|
89523
|
+
if (!existsSync32(templatePath)) {
|
|
89524
|
+
throw new Error(`[mink agent] bundled agent template not found at ${templatePath}
|
|
89525
|
+
` + " This usually means the package was installed without bundled assets.");
|
|
89526
|
+
}
|
|
89527
|
+
const installed = installedAgentPath();
|
|
89528
|
+
if (opts.skip && existsSync32(installed)) {
|
|
89529
|
+
return { action: "skipped", path: installed };
|
|
89530
|
+
}
|
|
89531
|
+
const template = readFileSync28(templatePath, "utf-8");
|
|
89532
|
+
const rendered = renderTemplate(template, {
|
|
89533
|
+
MINK_ROOT: minkRoot(),
|
|
89534
|
+
VAULT_PATH: resolveVaultPath(),
|
|
89535
|
+
MINK_VERSION: getMinkVersion()
|
|
89536
|
+
});
|
|
89537
|
+
const exists = existsSync32(installed);
|
|
89538
|
+
if (!opts.force && exists) {
|
|
89539
|
+
const current = readFileSync28(installed, "utf-8");
|
|
89540
|
+
if (sha256(current) === sha256(rendered)) {
|
|
89541
|
+
return { action: "unchanged", path: installed };
|
|
89542
|
+
}
|
|
89543
|
+
}
|
|
89544
|
+
mkdirSync15(claudeAgentsDir(), { recursive: true });
|
|
89545
|
+
writeFileSync10(installed, rendered);
|
|
89546
|
+
return {
|
|
89547
|
+
action: exists ? "updated" : "installed",
|
|
89548
|
+
path: installed
|
|
89549
|
+
};
|
|
89550
|
+
}
|
|
89551
|
+
function isClaudeOnPath() {
|
|
89552
|
+
const result = spawnSync5("claude", ["--version"], {
|
|
89553
|
+
stdio: "ignore"
|
|
89554
|
+
});
|
|
89555
|
+
return !result.error && result.status === 0;
|
|
89556
|
+
}
|
|
89557
|
+
function parseArgs2(args) {
|
|
89558
|
+
const out = {
|
|
89559
|
+
noUpdate: false,
|
|
89560
|
+
reinstall: false,
|
|
89561
|
+
passthrough: [],
|
|
89562
|
+
showHelp: false
|
|
89563
|
+
};
|
|
89564
|
+
let inPassthrough = false;
|
|
89565
|
+
for (const arg of args) {
|
|
89566
|
+
if (inPassthrough) {
|
|
89567
|
+
out.passthrough.push(arg);
|
|
89568
|
+
continue;
|
|
89569
|
+
}
|
|
89570
|
+
if (arg === "--") {
|
|
89571
|
+
inPassthrough = true;
|
|
89572
|
+
continue;
|
|
89573
|
+
}
|
|
89574
|
+
if (arg === "--no-update") {
|
|
89575
|
+
out.noUpdate = true;
|
|
89576
|
+
continue;
|
|
89577
|
+
}
|
|
89578
|
+
if (arg === "--reinstall") {
|
|
89579
|
+
out.reinstall = true;
|
|
89580
|
+
continue;
|
|
89581
|
+
}
|
|
89582
|
+
if (arg === "--help" || arg === "-h") {
|
|
89583
|
+
out.showHelp = true;
|
|
89584
|
+
continue;
|
|
89585
|
+
}
|
|
89586
|
+
out.passthrough.push(arg);
|
|
89587
|
+
}
|
|
89588
|
+
return out;
|
|
89589
|
+
}
|
|
89590
|
+
function printHelp() {
|
|
89591
|
+
console.log("Usage: mink agent [options] [-- <claude args...>]");
|
|
89592
|
+
console.log();
|
|
89593
|
+
console.log("Open an interactive Claude Code session in your mink home with");
|
|
89594
|
+
console.log("the mink-agent persona — a proactive note/wiki assistant.");
|
|
89595
|
+
console.log();
|
|
89596
|
+
console.log("Options:");
|
|
89597
|
+
console.log(" --no-update Don't refresh ~/.claude/agents/mink-agent.md if it exists");
|
|
89598
|
+
console.log(" --reinstall Force overwrite the installed agent definition");
|
|
89599
|
+
console.log(" -- <args> Forward remaining arguments to `claude`");
|
|
89600
|
+
console.log();
|
|
89601
|
+
console.log("Environment:");
|
|
89602
|
+
console.log(" MINK_AGENT_NO_UPDATE=1 Equivalent to --no-update");
|
|
89603
|
+
console.log();
|
|
89604
|
+
console.log("The agent is bound to your mink root and resolved vault path. Changing");
|
|
89605
|
+
console.log("`mink config wiki.path` triggers a refresh on the next launch.");
|
|
89606
|
+
}
|
|
89607
|
+
async function agent(_cwd, rawArgs) {
|
|
89608
|
+
const args = parseArgs2(rawArgs);
|
|
89609
|
+
if (args.showHelp) {
|
|
89610
|
+
printHelp();
|
|
89611
|
+
return;
|
|
89612
|
+
}
|
|
89613
|
+
const skipUpdate = args.noUpdate || process.env.MINK_AGENT_NO_UPDATE === "1";
|
|
89614
|
+
const root = minkRoot();
|
|
89615
|
+
if (!existsSync32(root)) {
|
|
89616
|
+
mkdirSync15(root, { recursive: true });
|
|
89617
|
+
}
|
|
89618
|
+
let result;
|
|
89619
|
+
try {
|
|
89620
|
+
result = installAgentDefinition({
|
|
89621
|
+
force: args.reinstall,
|
|
89622
|
+
skip: skipUpdate && !args.reinstall
|
|
89623
|
+
});
|
|
89624
|
+
} catch (err) {
|
|
89625
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
89626
|
+
console.error(msg);
|
|
89627
|
+
process.exit(1);
|
|
89628
|
+
}
|
|
89629
|
+
switch (result.action) {
|
|
89630
|
+
case "installed":
|
|
89631
|
+
console.log(`[mink] installed mink-agent definition (v${getMinkVersion()}) -> ${result.path}`);
|
|
89632
|
+
break;
|
|
89633
|
+
case "updated":
|
|
89634
|
+
console.log(`[mink] updated mink-agent definition -> ${result.path}`);
|
|
89635
|
+
break;
|
|
89636
|
+
case "unchanged":
|
|
89637
|
+
case "skipped":
|
|
89638
|
+
break;
|
|
89639
|
+
}
|
|
89640
|
+
if (!isClaudeOnPath()) {
|
|
89641
|
+
console.error("[mink agent] `claude` (Claude Code CLI) was not found on PATH.");
|
|
89642
|
+
console.error(" Install Claude Code: https://claude.com/claude-code");
|
|
89643
|
+
process.exit(1);
|
|
89644
|
+
}
|
|
89645
|
+
const claudeArgs = ["--agent", AGENT_NAME, ...args.passthrough];
|
|
89646
|
+
const child = spawnSync5("claude", claudeArgs, {
|
|
89647
|
+
cwd: root,
|
|
89648
|
+
stdio: "inherit"
|
|
89649
|
+
});
|
|
89650
|
+
if (child.error) {
|
|
89651
|
+
console.error(`[mink agent] failed to launch claude: ${child.error.message}`);
|
|
89652
|
+
process.exit(1);
|
|
89653
|
+
}
|
|
89654
|
+
if (typeof child.status === "number") {
|
|
89655
|
+
process.exit(child.status);
|
|
89656
|
+
}
|
|
89657
|
+
}
|
|
89658
|
+
var AGENT_NAME = "mink-agent", TEMPLATE_FILE, INSTALLED_FILE;
|
|
89659
|
+
var init_agent = __esm(() => {
|
|
89660
|
+
init_paths();
|
|
89661
|
+
init_vault();
|
|
89662
|
+
TEMPLATE_FILE = `${AGENT_NAME}.md.tmpl`;
|
|
89663
|
+
INSTALLED_FILE = `${AGENT_NAME}.md`;
|
|
89242
89664
|
});
|
|
89243
89665
|
|
|
89244
89666
|
// src/commands/sync.ts
|
|
@@ -89738,6 +90160,11 @@ switch (command2) {
|
|
|
89738
90160
|
await skill2(process.argv.slice(3));
|
|
89739
90161
|
break;
|
|
89740
90162
|
}
|
|
90163
|
+
case "agent": {
|
|
90164
|
+
const { agent: agent2 } = await Promise.resolve().then(() => (init_agent(), exports_agent));
|
|
90165
|
+
await agent2(cwd, process.argv.slice(3));
|
|
90166
|
+
break;
|
|
90167
|
+
}
|
|
89741
90168
|
case "sync": {
|
|
89742
90169
|
const { sync: sync2 } = await Promise.resolve().then(() => (init_sync3(), exports_sync2));
|
|
89743
90170
|
await sync2(process.argv.slice(3));
|
|
@@ -89767,11 +90194,11 @@ switch (command2) {
|
|
|
89767
90194
|
case "version":
|
|
89768
90195
|
case "--version":
|
|
89769
90196
|
case "-v": {
|
|
89770
|
-
const { resolve:
|
|
89771
|
-
const cliPath =
|
|
89772
|
-
const { readFileSync:
|
|
90197
|
+
const { resolve: resolve17, dirname: dirname16 } = await import("path");
|
|
90198
|
+
const cliPath = resolve17(dirname16(new URL(import.meta.url).pathname));
|
|
90199
|
+
const { readFileSync: readFileSync29 } = await import("fs");
|
|
89773
90200
|
try {
|
|
89774
|
-
const pkg = JSON.parse(
|
|
90201
|
+
const pkg = JSON.parse(readFileSync29(resolve17(cliPath, "../package.json"), "utf-8"));
|
|
89775
90202
|
console.log(`mink ${pkg.version}`);
|
|
89776
90203
|
} catch {
|
|
89777
90204
|
console.log("mink (unknown version)");
|
|
@@ -89799,6 +90226,7 @@ switch (command2) {
|
|
|
89799
90226
|
console.log(" note list [filters] List notes (--category, --tag, --recent)");
|
|
89800
90227
|
console.log(" note search <term> Full-text search across the vault");
|
|
89801
90228
|
console.log(" skill install Install /mink:note skill for Claude Code");
|
|
90229
|
+
console.log(" agent Open a Claude Code session with the mink-agent persona");
|
|
89802
90230
|
console.log();
|
|
89803
90231
|
console.log("Devices & Sync:");
|
|
89804
90232
|
console.log(" device Show current device info");
|
|
@@ -89821,7 +90249,7 @@ switch (command2) {
|
|
|
89821
90249
|
console.log();
|
|
89822
90250
|
console.log("Automation & Analysis:");
|
|
89823
90251
|
console.log(" dashboard [--port=N] Open the real-time web dashboard");
|
|
89824
|
-
console.log(" daemon <cmd> Manage the background daemon (start|stop|restart|logs)");
|
|
90252
|
+
console.log(" daemon <cmd> Manage the background daemon (start|stop|restart|logs|install|uninstall)");
|
|
89825
90253
|
console.log(" cron <cmd> [id] Manage scheduled tasks (list|run|retry)");
|
|
89826
90254
|
console.log(" update [options] Update Mink across registered projects");
|
|
89827
90255
|
console.log(" restore [backup] Restore state from a backup");
|