claude-use 9.17.0 → 9.18.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 +2 -2
- package/dist/cli.cjs +732 -628
- package/dist/index.cjs +403 -188
- package/dist/index.mjs +379 -176
- package/dist/types/index.d.ts +384 -133
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -33317,7 +33317,7 @@ var init_package = __esm({
|
|
|
33317
33317
|
"package.json"() {
|
|
33318
33318
|
package_default = {
|
|
33319
33319
|
name: "claude-use",
|
|
33320
|
-
version: "9.
|
|
33320
|
+
version: "9.18.0",
|
|
33321
33321
|
description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
|
|
33322
33322
|
license: "MIT",
|
|
33323
33323
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -34262,22 +34262,25 @@ function rankPool(input2) {
|
|
|
34262
34262
|
return { ...candidate, feasible: true };
|
|
34263
34263
|
}
|
|
34264
34264
|
const drySpots = [];
|
|
34265
|
+
const dryAfterMs = [];
|
|
34265
34266
|
if (fiveHour !== void 0 && pace !== void 0) {
|
|
34266
34267
|
const runsDryInMs = fiveHour.remaining / pace;
|
|
34267
34268
|
if (runsDryInMs < fiveHour.untilResetMs) {
|
|
34269
|
+
dryAfterMs.push(runsDryInMs);
|
|
34268
34270
|
drySpots.push(`5h window would run dry in ${formatAge(runsDryInMs)}, before it resets in ${formatAge(fiveHour.untilResetMs)}`);
|
|
34269
34271
|
}
|
|
34270
34272
|
}
|
|
34271
34273
|
if (sevenDay !== void 0 && sevenDayBurn !== void 0) {
|
|
34272
34274
|
const runsDryInMs = sevenDay.remaining / sevenDayBurn;
|
|
34273
34275
|
if (runsDryInMs < sevenDay.untilResetMs) {
|
|
34276
|
+
dryAfterMs.push(runsDryInMs);
|
|
34274
34277
|
drySpots.push(`7d window would run dry in ${formatAge(runsDryInMs)}, before it resets in ${formatAge(sevenDay.untilResetMs)}`);
|
|
34275
34278
|
}
|
|
34276
34279
|
}
|
|
34277
34280
|
if (drySpots.length === 0) {
|
|
34278
34281
|
return { ...candidate, feasible: true };
|
|
34279
34282
|
}
|
|
34280
|
-
return { ...candidate, feasible: false, reasons: [...drySpots, ...candidate.reasons] };
|
|
34283
|
+
return { ...candidate, feasible: false, runsDryAtMs: nowMs + Math.min(...dryAfterMs), reasons: [...drySpots, ...candidate.reasons] };
|
|
34281
34284
|
});
|
|
34282
34285
|
const ordered = input2.preference === "listed" ? [...candidates] : [...candidates].sort(
|
|
34283
34286
|
(left, right) => CLASS_ORDER[left.class] - CLASS_ORDER[right.class] || Number(left.policyDemoted ?? false) - Number(right.policyDemoted ?? false) || Number(right.feasible) - Number(left.feasible) || (right.headroom ?? 1) - (left.headroom ?? 1) || (right.score ?? 0) - (left.score ?? 0) || left.identity.localeCompare(right.identity)
|
|
@@ -34299,11 +34302,13 @@ function rankPool(input2) {
|
|
|
34299
34302
|
const pick2 = ordered.find((candidate) => candidate.class !== "ineligible");
|
|
34300
34303
|
const returns = ordered.flatMap((candidate) => candidate.blockedUntilMs === void 0 ? [] : [{ identity: candidate.identity, atMs: candidate.blockedUntilMs }]);
|
|
34301
34304
|
const earliestReturn = returns.length === 0 ? void 0 : returns.reduce((soonest, entry) => entry.atMs < soonest.atMs ? entry : soonest);
|
|
34305
|
+
const holdForReturn = pick2?.runsDryAtMs === void 0 ? void 0 : returns.filter((entry) => entry.atMs < (pick2.runsDryAtMs ?? 0)).reduce((soonest, entry) => soonest === void 0 || entry.atMs < soonest.atMs ? entry : soonest, void 0);
|
|
34302
34306
|
return {
|
|
34303
34307
|
candidates: ordered,
|
|
34304
34308
|
...pick2 === void 0 ? { ...earliestReturn === void 0 ? {} : { earliestReturn } } : { pick: pick2 },
|
|
34305
34309
|
...movedOff === void 0 || pick2 === void 0 ? {} : { movedOff },
|
|
34306
|
-
...pick2?.planReturnsAtMs === void 0 ? {} : { planReturn: { identity: pick2.identity, atMs: pick2.planReturnsAtMs } }
|
|
34310
|
+
...pick2?.planReturnsAtMs === void 0 ? {} : { planReturn: { identity: pick2.identity, atMs: pick2.planReturnsAtMs } },
|
|
34311
|
+
...holdForReturn === void 0 ? {} : { holdForReturn }
|
|
34307
34312
|
};
|
|
34308
34313
|
}
|
|
34309
34314
|
var MS_PER_SECOND4, MS_PER_HOUR2, HOURS_PER_DAY2, FIVE_HOURS, PROMPT_CACHE_TTL_HOURS, PERCENT, SEVEN_DAYS, FIVE_HOUR_WINDOW_MS, SEVEN_DAY_WINDOW_MS, PROMPT_CACHE_TTL_MS, CLASS_ORDER;
|
|
@@ -61293,7 +61298,7 @@ request.on("error", (error) => finish(failed, (error.code ? error.code + ": " :
|
|
|
61293
61298
|
// src/frontdoor/trust.ts
|
|
61294
61299
|
function resolveTrustBundle(params) {
|
|
61295
61300
|
const { caCertFile, bundlesDir, variable, inherited, fs: fs22 } = params;
|
|
61296
|
-
if (inherited === void 0 || inherited === "" ||
|
|
61301
|
+
if (inherited === void 0 || inherited === "" || import_node_path34.default.resolve(inherited) === import_node_path34.default.resolve(caCertFile)) {
|
|
61297
61302
|
return { path: caCertFile };
|
|
61298
61303
|
}
|
|
61299
61304
|
const caPem = fs22.readFileUtf8(caCertFile);
|
|
@@ -61311,19 +61316,19 @@ function resolveTrustBundle(params) {
|
|
|
61311
61316
|
}
|
|
61312
61317
|
const combined = `${inheritedPem.trimEnd()}
|
|
61313
61318
|
${caPem}`;
|
|
61314
|
-
const bundle =
|
|
61319
|
+
const bundle = import_node_path34.default.join(bundlesDir, `${(0, import_node_crypto11.createHash)("sha256").update(combined).digest("hex").slice(0, BUNDLE_NAME_HEX_DIGITS)}.pem`);
|
|
61315
61320
|
if (!fs22.exists(bundle)) {
|
|
61316
61321
|
fs22.mkdirp(bundlesDir);
|
|
61317
61322
|
fs22.writeFileAtomic(bundle, combined);
|
|
61318
61323
|
}
|
|
61319
61324
|
return { path: bundle };
|
|
61320
61325
|
}
|
|
61321
|
-
var import_node_crypto11,
|
|
61326
|
+
var import_node_crypto11, import_node_path34, BUNDLE_NAME_HEX_DIGITS;
|
|
61322
61327
|
var init_trust = __esm({
|
|
61323
61328
|
"src/frontdoor/trust.ts"() {
|
|
61324
61329
|
"use strict";
|
|
61325
61330
|
import_node_crypto11 = require("node:crypto");
|
|
61326
|
-
|
|
61331
|
+
import_node_path34 = __toESM(require("node:path"), 1);
|
|
61327
61332
|
BUNDLE_NAME_HEX_DIGITS = 16;
|
|
61328
61333
|
}
|
|
61329
61334
|
});
|
|
@@ -61341,7 +61346,7 @@ function realEnsurePorts(paths, spawnDaemon) {
|
|
|
61341
61346
|
process.kill(pid, "SIGTERM");
|
|
61342
61347
|
},
|
|
61343
61348
|
// Read fresh for each probe: a replacement supervisor may have regenerated an unparseable CA, and the probe must trust exactly what the serving door's leaf chains to.
|
|
61344
|
-
verifyListener: (port) => probeFrontDoorSync(port,
|
|
61349
|
+
verifyListener: (port) => probeFrontDoorSync(port, import_node_fs13.default.readFileSync(paths.frontdoorCaCertFile, "utf8"))
|
|
61345
61350
|
};
|
|
61346
61351
|
}
|
|
61347
61352
|
function realRestartFrontDoor(paths, spawnDaemon) {
|
|
@@ -61365,21 +61370,21 @@ function realFrontDoorPort(paths, spawnDaemon) {
|
|
|
61365
61370
|
}
|
|
61366
61371
|
};
|
|
61367
61372
|
}
|
|
61368
|
-
var
|
|
61373
|
+
var import_node_fs13, realTrustBundleFs;
|
|
61369
61374
|
var init_realFrontDoorPort = __esm({
|
|
61370
61375
|
"src/frontdoor/realFrontDoorPort.ts"() {
|
|
61371
61376
|
"use strict";
|
|
61372
|
-
|
|
61377
|
+
import_node_fs13 = __toESM(require("node:fs"), 1);
|
|
61373
61378
|
init_realPorts();
|
|
61374
61379
|
init_ensure2();
|
|
61375
61380
|
init_state2();
|
|
61376
61381
|
init_probe();
|
|
61377
61382
|
init_trust();
|
|
61378
61383
|
realTrustBundleFs = {
|
|
61379
|
-
readFileUtf8: (file2) =>
|
|
61380
|
-
exists: (file2) =>
|
|
61384
|
+
readFileUtf8: (file2) => import_node_fs13.default.readFileSync(file2, "utf8"),
|
|
61385
|
+
exists: (file2) => import_node_fs13.default.existsSync(file2),
|
|
61381
61386
|
mkdirp: (dir) => {
|
|
61382
|
-
|
|
61387
|
+
import_node_fs13.default.mkdirSync(dir, { recursive: true });
|
|
61383
61388
|
},
|
|
61384
61389
|
writeFileAtomic: (file2, contents) => {
|
|
61385
61390
|
realFarmFs.writeFilePrivate(file2, contents);
|
|
@@ -61511,10 +61516,10 @@ async function downloadAndInstall(ports, asset, target) {
|
|
|
61511
61516
|
const tempDir = ports.fs.mkdtemp();
|
|
61512
61517
|
try {
|
|
61513
61518
|
const assetUrl = `${DOWNLOAD_BASE_URL}/${asset}`;
|
|
61514
|
-
ports.fs.writeFileBytes(
|
|
61515
|
-
ports.fs.writeFileUtf8(
|
|
61516
|
-
const downloaded = ports.fs.readFileBytes(
|
|
61517
|
-
const sidecar = ports.fs.readFileUtf8(
|
|
61519
|
+
ports.fs.writeFileBytes(import_node_path35.default.join(tempDir, asset), await mustDownload(ports.http, assetUrl));
|
|
61520
|
+
ports.fs.writeFileUtf8(import_node_path35.default.join(tempDir, `${asset}.sha256`), Buffer.from(await mustDownload(ports.http, `${assetUrl}.sha256`)).toString("utf8"));
|
|
61521
|
+
const downloaded = ports.fs.readFileBytes(import_node_path35.default.join(tempDir, asset));
|
|
61522
|
+
const sidecar = ports.fs.readFileUtf8(import_node_path35.default.join(tempDir, `${asset}.sha256`));
|
|
61518
61523
|
if (downloaded === void 0 || sidecar === void 0) {
|
|
61519
61524
|
throw new UpdateDownloadError(`the downloaded files for ${asset} are missing from ${tempDir}`);
|
|
61520
61525
|
}
|
|
@@ -61523,7 +61528,7 @@ async function downloadAndInstall(ports, asset, target) {
|
|
|
61523
61528
|
if (expected === void 0 || expected !== actual) {
|
|
61524
61529
|
throw new UpdateDownloadError(`checksum mismatch for ${asset} (expected ${expected ?? "(none)"}, got ${actual})`);
|
|
61525
61530
|
}
|
|
61526
|
-
const tempBinary =
|
|
61531
|
+
const tempBinary = import_node_path35.default.join(import_node_path35.default.dirname(target), `.${import_node_path35.default.basename(target)}.${String(process.pid)}.${(0, import_node_crypto12.randomUUID)()}.tmp`);
|
|
61527
61532
|
ports.fs.writeFileBytes(tempBinary, downloaded);
|
|
61528
61533
|
try {
|
|
61529
61534
|
ports.fs.chmod(tempBinary, EXECUTABLE_MODE);
|
|
@@ -61570,12 +61575,12 @@ async function runSelfUpdate(ports, options) {
|
|
|
61570
61575
|
}
|
|
61571
61576
|
return { current: options.currentVersion, latest, action: "updated" };
|
|
61572
61577
|
}
|
|
61573
|
-
var import_node_crypto12,
|
|
61578
|
+
var import_node_crypto12, import_node_path35, LATEST_RELEASE_URL, DOWNLOAD_BASE_URL, MACOS_X64_NOTE, BREW_PREFIXES, EXECUTABLE_MODE, UpdateChannelError, UpdateConflictError, UpdateDownloadError;
|
|
61574
61579
|
var init_update = __esm({
|
|
61575
61580
|
"src/update/update.ts"() {
|
|
61576
61581
|
"use strict";
|
|
61577
61582
|
import_node_crypto12 = require("node:crypto");
|
|
61578
|
-
|
|
61583
|
+
import_node_path35 = __toESM(require("node:path"), 1);
|
|
61579
61584
|
init_cliError();
|
|
61580
61585
|
LATEST_RELEASE_URL = "https://github.com/ExaDev/agent-shim/releases/latest";
|
|
61581
61586
|
DOWNLOAD_BASE_URL = "https://github.com/ExaDev/agent-shim/releases/latest/download";
|
|
@@ -62101,7 +62106,7 @@ function buildEnv(params) {
|
|
|
62101
62106
|
const parentCustomHeaders = params.baseEnv.ANTHROPIC_CUSTOM_HEADERS;
|
|
62102
62107
|
let providerCustomHeaders;
|
|
62103
62108
|
if (!params.configDirEscapeHatch && params.resolvedIdentityName !== void 0) {
|
|
62104
|
-
env.CLAUDE_CONFIG_DIR =
|
|
62109
|
+
env.CLAUDE_CONFIG_DIR = import_node_path37.default.join(params.identitiesDir, params.resolvedIdentityName);
|
|
62105
62110
|
}
|
|
62106
62111
|
if (params.provider !== void 0) {
|
|
62107
62112
|
const providerEnv = params.provider.definition.env ?? {};
|
|
@@ -62145,11 +62150,11 @@ function buildEnv(params) {
|
|
|
62145
62150
|
}
|
|
62146
62151
|
return env;
|
|
62147
62152
|
}
|
|
62148
|
-
var
|
|
62153
|
+
var import_node_path37, LOOPBACK_HOSTS;
|
|
62149
62154
|
var init_flags = __esm({
|
|
62150
62155
|
"src/launcher/flags.ts"() {
|
|
62151
62156
|
"use strict";
|
|
62152
|
-
|
|
62157
|
+
import_node_path37 = __toESM(require("node:path"), 1);
|
|
62153
62158
|
init_envBool();
|
|
62154
62159
|
init_credential();
|
|
62155
62160
|
init_headers();
|
|
@@ -62223,12 +62228,17 @@ function resolvePoolLaunch(params) {
|
|
|
62223
62228
|
if (graph.ranking.candidates.length === 0) {
|
|
62224
62229
|
return { ok: false, message: `agent-shim: no member of pool "${poolName}" is an existing identity.` };
|
|
62225
62230
|
}
|
|
62226
|
-
const { pick: pick2, earliestReturn, movedOff, planReturn } = graph.ranking;
|
|
62231
|
+
const { pick: pick2, earliestReturn, movedOff, planReturn, holdForReturn } = graph.ranking;
|
|
62227
62232
|
if (pick2 !== void 0 && params.wait && planReturn !== void 0) {
|
|
62228
62233
|
log.info(`agent-shim: pool "${poolName}" would continue ${planReturn.identity} on extra usage; waiting until ${new Date(planReturn.atMs).toISOString()} for its plan window`);
|
|
62229
62234
|
params.sleep(Math.max(planReturn.atMs - nowMs, 0));
|
|
62230
62235
|
continue;
|
|
62231
62236
|
}
|
|
62237
|
+
if (pick2 !== void 0 && params.wait && holdForReturn !== void 0) {
|
|
62238
|
+
log.info(`agent-shim: pool "${poolName}" pick ${pick2.identity} would run dry before its window resets; waiting until ${new Date(holdForReturn.atMs).toISOString()} for ${holdForReturn.identity}`);
|
|
62239
|
+
params.sleep(Math.max(holdForReturn.atMs - nowMs, 0));
|
|
62240
|
+
continue;
|
|
62241
|
+
}
|
|
62232
62242
|
if (pick2 !== void 0) {
|
|
62233
62243
|
if (params.recordPick) {
|
|
62234
62244
|
recordStickyPick(params.usageFs, params.paths.usagePicksFile, params.cwd, pick2.identity, nowMs);
|
|
@@ -62477,7 +62487,7 @@ function decideLaunch(params, readOnly) {
|
|
|
62477
62487
|
identityDefaultConfigProfile: loadedIdentity?.config.defaultConfigProfile,
|
|
62478
62488
|
globalDefaultConfigProfile: params.globalDefaultConfigProfile
|
|
62479
62489
|
});
|
|
62480
|
-
if (configProfileDecision.name !== void 0 && params.allowMissingConfigProfile !== true && fs22.readConfigFile(
|
|
62490
|
+
if (configProfileDecision.name !== void 0 && params.allowMissingConfigProfile !== true && fs22.readConfigFile(import_node_path38.default.join(paths.configProfilesDir, `${configProfileDecision.name}.json`)) === void 0) {
|
|
62481
62491
|
log.error(
|
|
62482
62492
|
`agent-shim: no configuration profile named "${configProfileDecision.name}" (selected via ${configProfileDecision.source}). Run \`agent-shim profile add ${configProfileDecision.name}\` first.`
|
|
62483
62493
|
);
|
|
@@ -62589,7 +62599,7 @@ function decideLaunch(params, readOnly) {
|
|
|
62589
62599
|
extraFlags: splitExtraFlags(env.CLAUDE_EXTRA_FLAGS),
|
|
62590
62600
|
passthrough: parsedArgv.rest
|
|
62591
62601
|
});
|
|
62592
|
-
const configDir = configDirEscapeHatchApplies || identityDecision.name === void 0 ? env.CLAUDE_CONFIG_DIR :
|
|
62602
|
+
const configDir = configDirEscapeHatchApplies || identityDecision.name === void 0 ? env.CLAUDE_CONFIG_DIR : import_node_path38.default.join(paths.identitiesDir, identityDecision.name);
|
|
62593
62603
|
const decision = {
|
|
62594
62604
|
identitySource: identityDecision.source,
|
|
62595
62605
|
configDirEscapeHatch: identityDecision.configDirEscapeHatch,
|
|
@@ -62630,7 +62640,7 @@ function prepareLaunch(params) {
|
|
|
62630
62640
|
);
|
|
62631
62641
|
const updateCheck = runLaunchUpdateCheck({
|
|
62632
62642
|
mode: params.updateMode ?? "off",
|
|
62633
|
-
checkPath:
|
|
62643
|
+
checkPath: import_node_path38.default.join(paths.root, "update.check"),
|
|
62634
62644
|
currentVersion: package_default.version,
|
|
62635
62645
|
port: params.update
|
|
62636
62646
|
});
|
|
@@ -62761,12 +62771,12 @@ function runLaunchPlan(plan, spawn4) {
|
|
|
62761
62771
|
function runLauncher(params) {
|
|
62762
62772
|
params.proc.exit(runLaunchPlan(prepareLaunch(params), params.spawn));
|
|
62763
62773
|
}
|
|
62764
|
-
var import_node_crypto14,
|
|
62774
|
+
var import_node_crypto14, import_node_path38;
|
|
62765
62775
|
var init_launcher = __esm({
|
|
62766
62776
|
"src/launcher.ts"() {
|
|
62767
62777
|
"use strict";
|
|
62768
62778
|
import_node_crypto14 = require("node:crypto");
|
|
62769
|
-
|
|
62779
|
+
import_node_path38 = __toESM(require("node:path"), 1);
|
|
62770
62780
|
init_package();
|
|
62771
62781
|
init_envBool();
|
|
62772
62782
|
init_argv();
|
|
@@ -63778,10 +63788,10 @@ function Ww(e14) {
|
|
|
63778
63788
|
}
|
|
63779
63789
|
function M_() {
|
|
63780
63790
|
let e14 = "";
|
|
63781
|
-
if (typeof process < "u" && typeof process.cwd === "function" && typeof
|
|
63791
|
+
if (typeof process < "u" && typeof process.cwd === "function" && typeof import_node_fs15.realpathSync === "function") try {
|
|
63782
63792
|
let t10 = (0, import_node_process4.cwd)();
|
|
63783
63793
|
try {
|
|
63784
|
-
e14 = Ww((0,
|
|
63794
|
+
e14 = Ww((0, import_node_fs15.realpathSync)(t10));
|
|
63785
63795
|
} catch {
|
|
63786
63796
|
e14 = Ww(t10);
|
|
63787
63797
|
}
|
|
@@ -77445,14 +77455,14 @@ async function jGe(e14, t10, n10, r10) {
|
|
|
77445
77455
|
if (d.length === 0) return [];
|
|
77446
77456
|
return iv(Buffer.from(gZ(d)), { limit: r10.limit, offset: r10.offset }, l, c10);
|
|
77447
77457
|
}
|
|
77448
|
-
var import_node_module, import_crypto, import_crypto2, import_path, import_node_fs14, import_node_process4, import_fs, import_os, import_path2, yy, import_fs2, import_promises, import_path3, import_readline, import_promises2, import_path4, import_os2, import_path5, Se, import_promises3, xe, import_promises4, import_fs3, import_promises5, import_os3, import_path6, import_promises6, import_os4, import_node_path37, import_node_os10, import_node_process5, import_path7, import_events, import_fs4, import_promises7, import_path8, import_child_process, import_util9, import_child_process2, import_fs5, import_path9, import_path10, import_crypto3, import_fs6, import_path11, import_promises8, import_path12, import_path13, import_promises9, import_path14, import_path15, import_fs7, import_promises10, import_path16, import_crypto4, import_path17, import_async_hooks, import_fs8, import_promises11, import_crypto5, import_fs9, import_promises12, import_path18, import_promises13, import_path19, import_crypto6, import_path20, import_path21, import_path22, import_path23, import_promises14, import_fs10, import_promises15, import_path24, import_util10, import_path25, import_os5, import_path26, import_path27, import_path28, import_path29, import_path30, import_net, import_os6, import_child_process3, import_fs11, import_child_process4, import_crypto7, import_promises16, import_module, import_os7, import_path31, import_url, import_events2, import_child_process5, import_fs12, import_readline2, import_string_decoder, import_fs13, import_promises17, import_os8, import_path32, import_crypto8, import_os9, import_fs14, import_path33, import_crypto9, import_fs15, import_promises18, import_path34, IZ, DZ, v_, LZ, OT, NZ, UZ, kT, X, FZ, dr, HZ, jZ, BZ, ot, st, ed, Kv, Te, Me, Oo, nd, hF, Xv, Qv, rd, LF, or, WF, ZF, sA, XF, od, sd, hg, id, Sg, Oz, fA, $z, Wz, Zz, s$, a$, d$, f$, g$, _$, E$, v$, T$, O$, I$, L$, wg, z$, j$, G$, V$, yA, SA, rH, lH, uH, _H, EH, EA, RH, TH, kH, DH, NH, zH, jH, GH, VH, ZH, JH, ej, nj, ij, cj, uj, CA, bj, Aj, wj, PT, KZ, GZ, VGe, VZ, MT, wr, jo, JZ, XZ, NT, UT, FT, zT, Bo, $T, HT, jT, BT, a4, sp, l4, c4, vt, u4, Nt, KT, d4, p4, uc, GT, m4, g4, WT, _4, y4, VT, Dn, Et, b4, C4, v4, A4, ra, x4, ip, qT, ZT, w4, O4, ro, P4, I4, D4, L4, M4, N4, U4, YT, JT, Sn, H4, Ko, j4, oo, XT, QT, G4, W4, V4, ew, Z4, Y4, tw, X4, nw, R_, rw, ow, Go, sw, iw, aw, lw, ei, aY, cw, Or, cY, uw, dw, lp, pw, cp, mY, gY, up, _Y, aa, fw, la, EY, bY, CY, vY, AY, RY, xY, TY, wY, OY, kY, PY, IY, mw, x_, gw, ca, MY, et, dp, hw, pp, zY, $Y, _w, HY, ua, yw, wt, KY, T_, Sw, WY, VY, qY, so, mp, Ew, vw, bw, YY, Cw, JY, XY, kr, QY, e9, Wo, n9, da, o9, s9, i9, a9, l9, c9, u9, d9, p9, f9, m9, g9, h9, _9, y9, S9, E9, b9, C9, v9, A9, R9, x9, T9, Qe, Aw, pa, hp, Rw, dc, k9, w_, P9, Pr, xw, I9, fa, D9, L9, _p, N9, ma, yp, z9, Tw, $9, H9, ww, Vo, Ir, pc, W9, V9, q9, Ow, Y9, Sp, J9, Ep, X9, qo, Q9, bp, kw, eJ, Pw, Iw, Dw, Lw, tJ, nJ, rJ, oJ, sJ, ti, io, iJ, Mw, Nw, Cp, aJ, Uw, Fw, ga, pr, uJ, Fe, $w, O_, k_, I_, ha, Bw, D_, qw, Vw, N_, U_, yJ, _a3, Yo, Zw, bJ, Rp, Yw, vJ, AJ, Jw, xp, Xw, Tp, Qw, kJ, ya, IJ, DJ, Sa, MJ, fc, NJ, eO, FJ, zJ, $J, tO, Ea, jJ, nO, rO, sO, iO, Vn, GJ, Ln, Jo, aO, lO, cO, wp, XJ, QJ, uO, ba, dO, pO, fO, Dr, ao, mO, Ca, gO, z_, $_, H_, j_, B_, K_, G_, W_, V_, q_, Z_, _O, Y_, J_, yO, X_, c3, Q_, ey, ty, ny, ry, oy, sy, iy, ay, ly, cy, we, SO, en, d3, Pp, vO, g3, gy, wO, S3, BO, KO, Ip, Dp, v3, GO, WO, F9e, IO, A3, hy, x3, NO, I3, Ay, Ry, D3, xy, L3, bc, xa, Ty, wy, Oy, ky, XO, Py, Iy, Dy, Ly, My, Ny, Uy, Fy, zy, nk, rk, d3e, p3e, f3e, m3e, g3e, U3, jp, jy, ik, By, Ky, lk, $3, uk, ck, G3, W3, V3, it, Y3, J3, hk, tXe, Q3, kt, We, gX, Ta, SX, mr, Yp, Jp, eS, nS, yXe, IX, DX, rS, ka, oS, Ok, kk, HX, jX, ef, bXe, Uk, Mr, wc, Fk, Pa, OXe, kXe, iS, PXe, IXe, DXe, GX, YX, JX, XX, QX, e6, t6, Yk, n6, r6, o6, s6, i6, a6, l6, c6, Vk, uS, lf, dS, Qk, eP, uf, os10, qXe, ZXe, h6, tP, df, _6, y6, S6, E6, b6, Jn, gr, nP, rP, Dc, pS, oP, gS, lP, C6, mS, lS, sP, w6, O6, dP, k6, YXe, JXe, P6, I6, pf, L6, fP, XXe, QXe, M6, SS, z6, $6, j6, bP, CP, G6, Lc, si, Z6, ES, bS, X6, Q6, e5, t5, n5, u5, r5, o5, s5, i5, a5, l5, c5, u52, d5, p5, f5, m5, g5, h5, _5, y5, S5, E5, b5, C5, v5, A5, R5, x5, T5, w5, O5, k5, P5, I5, D5, L5, M5, N5, U5, F5, z5, $5, H5, j5, B5, K5, G5, W5, V5, q5, Z5, Y5, J5, X5, Q5, e8, t8, n8, r8, o8, s8, i8, a8, l8, c8, u8, d8, CS, p8, f8, m8, g8, h8, _8, y8, S8, E8, b8, C8, v8, A8, R8, x8, T8, w8, O8, k8, P8, I8, D8, L8, M8, N8, U8, F8, z8, $8, H8, j8, B8, K8, G8, W8, V8, q8, Z8, Y8, J8, X8, Q8, e7, t7, n7, r7, o7, s7, i7, a7, l7, c7, u7, d7, p7, f7, m7, g7, h7, _7, y7, S7, E7, b7, C7, TP, v7, L6e, RP, A7, x7, kP, ff, U6e, F6e, Ua, z6e, $6e, H6e, j6e, PP, IP, vS, DP, w7, LP, O7, k7, P7, AS, RS, xS, I7, MP, NP, D7, G6e, L7, W6e, M7, N7, UP, V6e, U7, F7, z7, $7, H7, j7, B7, q6e, is, wS, Fa, K7, G7, W7, i5e, X7, Q7, HP, $P, BP, tQ, WP, VP, JP, _Q, QP, eI, xQ, Uc, DS, $a, wQ, OQ, kQ, PQ, IQ, DQ, LQ, MQ, NQ, UQ, FQ, zQ, $Q, HQ, jQ, BQ, KQ, GQ, WQ, VQ, qQ, ZQ, YQ, JQ, XQ, QQ, eee, tee, nee, ree, oee, see, iee, aee, lee, cee, uee, dee, pee, fee, mee, gee, hee, _ee, yee, See, Eee, bee, Cee, vee, Aee, Ree, xee, Tee, wee, Oee, kee, Pee, Iee, Dee, Lee, Mee, Nee, Uee, Fee, zee, $ee, Hee, jee, Bee, Kee, Gee, Wee, Vee, qee, Zee, Yee, Jee, Xee, Qee, ete, tte, nte, rte, ote, ste, ite, ate, lte, cte, ute, dte, pte, fte, mte, gte, hte, _te, yte, Ste, Ete, bte, Cte, vte, Ate, Rte, xte, Tte, wte, Ote, kte, Pte, Ite, Dte, Lte, Mte, Nte, Ute, Fte, zte, $te, Hte, jte, Bte, Kte, Gte, Wte, Vte, qte, Zte, Yte, Jte, Xte, Qte, ene, tne, nne, rne, one, sne, ine, ane, lne, cne, une, dne, pne, fne, mne, gne, hne, _ne, yne, Sne, Ene, bne, Cne, vne, Ane, Rne, xne, Tne, wne, One, kne, Pne, Ine, Dne, Lne, Mne, Nne, Une, Fne, zne, $ne, Hne, jne, Bne, Kne, Gne, Wne, Vne, qne, Zne, Yne, Jne, Xne, Qne, ere, tre, nre, rre, ore, sre, ire, are, lre, cre, ure, dre, pre, fre, mre, gre, hre, _re, yre, Sre, Ere, bre, Cre, vre, Are, Rre, xre, Tre, wre, Ore, kre, Pre, Ire, Dre, Lre, Mre, Nre, Ure, Fre, zre, $re, Hre, jre, Bre, Kre, Gre, Wre, Vre, qre, Zre, Yre, Jre, Xre, Qre, eoe, toe, noe, roe, ooe, soe, ioe, aoe, loe, coe, uoe, doe, poe, foe, moe, goe, hoe, _oe, yoe, Soe, Eoe, boe, Coe, voe, Aoe, Roe, xoe, Toe, woe, Ooe, koe, Poe, Ioe, Doe, Loe, Moe, Noe, Uoe, Foe, zoe, $oe, Hoe, joe, Boe, Koe, Goe, Woe, Voe, qoe, Zoe, Yoe, Joe, Xoe, Qoe, ese, tse, nse, rse, ose, sse, ise, ase, lse, cse, use, dse, pse, fse, mse, gse, hse, _se, yse, Sse, Ese, LS, bse, Cse, vse, Ase, Rse, xse, Tse, wse, Ose, kse, Pse, Ise, Dse, Lse, Mse, Nse, Use, Fse, zse, $se, Hse, jse, Bse, Kse, Gse, Wse, Vse, qse, Zse, Yse, Jse, Xse, Qse, eie, tie, nie, rie, oie, sie, iie, aie, lie, cie, uie, die, pie, fie, mie, gie, hie, _ie, yie, Sie, Eie, bie, Cie, vie, Aie, Rie, xie, Tie, wie, Oie, kie, Pie, Iie, Die, Lie, Mie, Nie, Uie, Fie, zie, $ie, Hie, jie, Bie, Kie, Gie, Wie, Vie, qie, Zie, Yie, Jie, Xie, Qie, eae, tae, nae, rae, oae, sae, iae, aae, lae, cae, uae, dae, pae, fae, mae, gae, hae, _ae, yae, Sae, Eae, bae, Cae, vae, Aae, Rae, xae, Tae, wae, Oae, kae, Pae, Iae, Dae, Lae, Mae, Nae, Uae, Fae, zae, $ae, Hae, jae, Bae, Kae, Gae, Wae, Vae, qae, Zae, Yae, Jae, Xae, Qae, ele, tle, nle, rle, ole, sle, ile, ale, lle, cle, ule, dle, ple, fle, mle, gle, hle, _le, yle, Sle, Ele, ble, Cle, vle, Ale, Rle, xle, Tle, wle, Ole, kle, Ple, Ile, Dle, Lle, Mle, Nle, Ule, Fle, zle, $le, Hle, jle, Ble, Kle, Gle, Wle, Vle, qle, Zle, Yle, Jle, MS, Xle, Qle, ece, tce, nce, rce, oce, sce, ice, ace, lce, cce, uce, dce, pce, fce, mce, gce, hce, _ce, yce, Sce, Ece, bce, Cce, vce, Ace, Rce, xce, Tce, wce, Oce, kce, Pce, Ice, Dce, Lce, Mce, Nce, Uce, Fce, zce, $ce, Hce, jce, Bce, Kce, Gce, Wce, Vce, qce, Zce, Yce, Jce, Xce, Qce, eue, tue, nue, rue, oue, sue, iue, aue, lue, cue, uue, due, pue, fue, mue, gue, hue, _ue, yue, Sue, Eue, bue, Cue, vue, Aue, Rue, xue, Tue, wue, Oue, kue, Pue, Iue, Due, Lue, Mue, Nue, Uue, Fue, zue, $ue, Hue, jue, Bue, Kue, Gue, Wue, Vue, que, Zue, Yue, Jue, Xue, Que, ede, tde, nde, rde, ode, sde, ide, ade, lde, cde, ude, dde, pde, fde, mde, gde, hde, _de, yde, Sde, Ede, bde, Cde, vde, Ade, Rde, xde, Tde, wde, Ode, kde, Pde, Ide, Dde, Lde, Mde, Nde, Ude, Fde, zde, $de, Hde, jde, Bde, Kde, Gde, Wde, Vde, qde, Zde, Yde, Jde, Xde, Qde, epe, tpe, npe, rpe, ope, spe, ipe, ape, lpe, cpe, upe, dpe, ppe, fpe, mpe, gpe, hpe, _pe, ype, Spe, Epe, bpe, Cpe, vpe, Ape, Rpe, xpe, Tpe, wpe, Ope, kpe, Ppe, Ipe, Dpe, Lpe, Mpe, Npe, Upe, Fpe, zpe, $pe, Hpe, jpe, Bpe, Kpe, Gpe, Wpe, Vpe, qpe, Zpe, Ype, Jpe, Xpe, Qpe, efe, tfe, nfe, rfe, ofe, sfe, ife, afe, lfe, cfe, ufe, dfe, pfe, ffe, mfe, gfe, hfe, _fe, yfe, Sfe, Efe, bfe, Cfe, vfe, Afe, Rfe, xfe, Tfe, wfe, Ofe, kfe, Pfe, Ife, Dfe, Lfe, Mfe, Nfe, Ufe, Ffe, zfe, $fe, Hfe, jfe, Bfe, Kfe, Gfe, Wfe, Vfe, qfe, Zfe, Yfe, Jfe, Xfe, Qfe, eme, tme, nme, rme, ome, sme, ime, ame, lme, cme, ume, dme, pme, fme, mme, gme, hme, _me, yme, Sme, Eme, bme, Cme, vme, Ame, Rme, xme, Tme, wme, Ome, kme, Pme, Ime, Dme, Lme, Mme, Nme, Ume, Fme, zme, $me, Hme, jme, Bme, Kme, Gme, Wme, Vme, qme, Zme, Yme, Jme, NS, Xme, Qme, ege, tge, nge, rge, oge, sge, ige, age, lge, cge, uge, dge, pge, fge, mge, gge, hge, _ge, yge, Sge, Ege, bge, Cge, vge, Age, Rge, xge, Tge, wge, Oge, kge, Pge, Ige, Dge, Lge, Mge, Nge, Uge, Fge, zge, $ge, Hge, US, jge, Bge, Kge, Gge, Wge, Vge, qge, Zge, Yge, Jge, Xge, Qge, ehe, the, nhe, rhe, ohe, she, ihe, ahe, lhe, che, uhe, dhe, phe, fhe, mhe, ghe, hhe, _he, yhe, She, Ehe, bhe, Che, vhe, Ahe, Rhe, xhe, The, whe, Ohe, khe, Phe, Ihe, Dhe, Lhe, Mhe, Nhe, FS, rI, oI, Uhe, Fhe, zhe, $he, Hhe, jhe, Bhe, Khe, Ghe, Whe, Vhe, qhe, Zhe, Yhe, Jhe, Xhe, Qhe, e_e, t_e, n_e, r_e, o_e, s_e, i_e, a_e, l_e, c_e, u_e, d_e, p_e, f_e, m_e, g_e, h_e, __e, y_e, S_e, E_e, b_e, C_e, v_e, A_e, R_e, x_e, T_e, w_e, O_e, k_e, P_e, I_e, D_e, L_e, M_e, N_e, U_e, F_e, z_e, $_e, H_e, j_e, B_e, K_e, G_e, W_e, V_e, q_e, Z_e, Y_e, J_e, Q_e, Xn, eye, F8e, tye, z8e, nye, iI, rye, oye, lI, cye, uye, dye, _ye, on, vye, Aye, dI, C7e, v7e, ho, kI, PI, Dye, Sf, Lye, jc, Mye, Nye, LI, NI, Fye, VS, zye, $ye, x7e, zI, YS, KI, GI, VI, Hye, qS, ls, Kye, Gye, oD, nE, sD, So, Yc, vn, Zye, oE, sE, iD, aD, wf, Jc, Xc, kf, Qc, Pf, eu, fi, tu, mi, lD, cD, uD, dD, pD, fD, mD, gD, hD, _D, yD, SD, ED, bD, vD, AD, cE, RD, Xye, TD, wD, OD, kD, PD, uE, ID, DD, LD, MD, FD, If, nu, zD, $D, HD, jD, BD, zt, dE, Df, pE, fE, KD, GD, WD, VD, qD, ru, ZD, YD, JD, XD, QD, eL, tL, mE, yr, He, rL, ou, Je, yE, SE, EE, fL, mL, tSe, bE, CE, vE, AE, RE, xE, TE, wE, gL, hL, _L, yL, OE, sSe, kE, PE, IE, DE, LE, ME, NE, Nf, UE, FE, zE, $E, HE, jE, BE, cSe, gE, KE, vL, Uf, GE, WE, VE, qE, ZE, YE, Ff, JE, XE, QE, eb, tb, nb, zf, AL, rb, ob, sb, TL, ab, RL, xL, $f, Hf, dSe, fSe, OL, kL, Sr, FL, ML, zL, lu, hSe, iC, aC, lC, HL, jL, cC, uC, BL, dC, KL, pC, GL, fC, mC, WL, VL, qL, ZL, gC, YL, hC, JL, XL, _C, yC, SC, EC, QL, sC, bC, CC, vC, AC, RC, xC, TC, wC, OC, tM, qf, kC, $L, rM, ASe, Fn, oM, sM, iM, aM, lM, cM, uM, dM, pM, fM, mM, gM, Be, SM, LC, ct, MC, EM, bM, CM, pEe, fEe, Yf, mEe, gEe, hEe, _Ee, yEe, SEe, EEe, bEe, CEe, vEe, AEe, REe, xEe, TEe, wEe, OEe, NC, kEe, vM, PEe, IEe, DEe, LEe, MEe, fu, AM, NEe, UEe, IC, DC, FEe, zEe, qa, TM, HEe, jEe, KEe, wM, em, mu, qEe, ZEe, JEe, OM, Qn, kM, LM, nbe, rbe, abe, lbe, cbe, rm, pbe, At, hbe, BC, BM, Zet, WM, VM, qM, ZM, Cbe, vbe, YM, Abe, Rbe, JM, xbe, Tbe, QM, Ibe, eN, Lbe, nN, Mbe, Nbe, sm, rN, iN, Fbe, aN, $be, jbe, Kbe, Gbe, yu, lN, uN, dN, Xbe, KM, Qbe, eCe, tCe, oCe, iCe, _N, yN, wN, Ytt, ON, OCe, DCe, LN, $Ce, HCe, Cu, BCe, MN, VCe, QCe, ive, uve, VN, pve, fve, _rt, gve, Sve, nv, tv, GN, tU, Fve, Hve, iU, tAe, sAe, iAe, aAe, cAe, Ie, bU, Q, vo, F, zn, fAe, ms, mAe, _m, nn, he, Xa, an, lv, cv, Si, wu, se, br, CU, Oe, gAe, hAe, _Ae, yAe, SAe, EAe, bAe, CAe, vAe, uv, AAe, RAe, xAe, TAe, wAe, OAe, vU, kAe, Ro, el, tl, ym, ku, Sm, Pu, Iu, Em, Ei, xo, bm, Fr, ft, Du, Ao, pv, Lu, To, Cm, vm, nl, Ou, Mu, Nu, bi, Uu, rl, $r, zr, gs, Fu, zu, Am, fv, Rm, $u, wot, H, Oot, kot, Pot, Iot, Dot, Lot, Mot, Not, Uot, Fot, zot, $ot, Hot, jot, xU, Bot, Kot, Got, Wot, Vot, qot, Zot, Yot, Jot, Xot, Qot, est, tst, nst, rst, ost, sst, ist, ast, FAe, zAe, gv, OU, Ss, km, Mt, kU, PU, kst, HAe, jAe, hv, $n, Hu, IU, Yt, tr, nr, Jt, Pm, DU, _v, LU, MU, yv, ju, le, Sv, NU, Pst, Ist, Im, BAe, Dm, KAe, Bu, ol, UU, GAe, WAe, VAe, qAe, ZAe, YAe, Ev, JAe, XAe, bv, Lm, QAe, eRe, Mm, tRe, Ku, Gu, nRe, Wu, sl, rRe, Vu, Nm, Um, Fm, Dst, zm, $m, Hm, FU, zU, $U, Cv, HU, qu, il, jU, oRe, jm, sRe, Bm, iRe, vv, aRe, Km, lRe, cRe, uRe, dRe, pRe, fRe, mRe, gRe, hRe, _Re, Gm, yRe, SRe, Wm, Av, Rv, xv, ERe, bRe, CRe, Tv, vRe, ARe, RRe, xRe, TRe, BU, Vm, wRe, qm, Lst, ORe, al, kRe, Mst, Zu, PRe, wv, IRe, DRe, LRe, MRe, NRe, URe, FRe, Om, zRe, $Re, HRe, Yu, Ov, jRe, BRe, KRe, GRe, WRe, VRe, qRe, ZRe, YRe, JRe, XRe, QRe, exe, txe, nxe, rxe, oxe, sxe, ll, ixe, axe, lxe, Zm, cxe, uxe, dxe, kv, pxe, Nst, Ust, Fst, zst, $st, Hst, ae, WU, qU, VU, ZU, YU, Ym, e0, fxe, mxe, Dv, Cr, gxe, Ju, d0, h0, _0, v0, A0, Sxe, Exe, Mv, Cxe, Fv, Oj, kj, PA, IA, DA, Lj, Dj, aLe, NA, FA, uLe, dd, fLe, Po, SLe, ELe, zA, bLe, xLe, TLe, wLe, OLe, kLe, $j, qj, ILe, DLe, LLe, MLe, Ce, NLe, Wg, Oi, VA, Do, Jj, Xj, Qj, eB, tB, nB, qA, ZA, jA, Bj, jLe, BLe, GLe, rB, BA, Gg, GA, WA, VLe, qLe, Kj, Hs, sB, QLe, YA, iB, uB, eMe, dB, pB, fB, mB, tMe, XA, aB, QA, gB, hB, _B, yB, jn, lMe, SB, dMe, bB, mMe, fd, RB, hMe, Rr, TB, SMe, EMe, Pl, wB, Vg, AMe, Il, RMe, xMe, qg, OB, wMe, OMe, kB, eo, Dl, Zg, DB, NMe, FB, WMe, VMe, $B, HB, jB, BB, Ml, GB, nR, WB, Jg, KB, eNe, Bs, VB, gd, Nl, Xg, tNe, YB, qB, Pi, rK, iK, pNe, hd, _d, to, yd, nh, uK, aK, _Ne, lK, cK, Sd, Ul, rh, oh, dK, CNe, pK, sh, fK, RNe, xNe, TNe, mK, wNe, ONe, ih, Ed, lr, gK, hK, yK, SK, EK, ah, bK, FNe, CK, zNe, $Ne, HNe, vK, BNe, lh, AK, RK, xK, VNe, dn, TK, wK, OK, kK, PK, QNe, eUe, IK, DK, rUe, LK, MK, NK, UK, iUe, aUe, lUe, cUe, uUe, dUe, pUe, fUe, mUe, gUe, hUe, _Ue, yUe, SUe, EUe, bUe, CUe, vUe, AUe, FK, xUe, zK, $K, wUe, HK, OUe, jK, BK, PUe, KK, IUe, DUe, LUe, GK, MUe, NUe, UUe, FUe, WK, zUe, $Ue, HUe, VK, jUe, BUe, KUe, GUe, WUe, VUe, qUe, ZUe, YUe, JUe, XUe, QUe, e0e, t0e, n0e, r0e, Xe, qK, ZK, YK, JK, a0e, l0e, uh, XK, QK, e1, n1, r1, dh, m0e, g0e, h0e, _0e, bd, o1, S0e, Fl, s1, b0e, i1, Di, a1, l1, c1, u1, d1, p1, f1, P0e, I0e, m1, D0e, g1, h1, _1, vyt, U0e, y1, Ayt, iR, F0e, z0e, $0e, Gs, zl, fh, E1, b1, H0e, j0e, B0e, K0e, mh, $l, gh, Ws, aR, hh, _h, G0e, W0e, lR, R1, x1, V0e, uR, k1, P1, I1, D1, L1, Y0e, dR, J0e, Fyt, pR, X0e, fR, mR, Q0e, zyt, eFe, gR, hR, _R, $yt, M1, yR, N1, U1, tFe, nFe, rFe, oFe, iFe, Mi, cFe, $1, Wyt, Vyt, H1, j1, B1, K1, uFe, G1, W1, V1, q1, dFe, pFe, SR, fFe, eSt, tSt, mFe, jl, Vs, gFe, Y1, hFe, _Fe, X1, Q1, eG, yFe, SFe, tG, EFe, bFe, CFe, vFe, bR, CR, RFe, xFe, vR, TFe, Eh, nSt, Cd, wFe, OFe, aSt, rG, PFe, IFe, _St, oG, sG, bSt, CSt, HFe, jFe, $St, BFe, KFe, HSt, JSt, XSt, lG, OR, VFe, YFe, uG, eze, nze, gG, vd, vh, kR, zi, sze, yG, ize, yEt, Ad, $i, bG, Kn, AEt, REt, xEt, aze, AG, wG, $R, dze, $G, pze, fze, mze, gze, hze, BR, HG, jG, fbt, yze, Sze, Eze, Gn, ji, kG, PG, NR, UR, KR, GG, Cze, vze, Rze, GR, xze, Tze, xh, WR, Oze, kze, mbt, Pze, Ize, Dze, Lze, Mze, Nze, qG, Uze, Fze, zze, $ze, ZG, Hze, IG, jze, Bze, YG, Kze, Gze, DG, Wze, Vze, JG, qze, Zze, Yze, Jze, QG, Xze, Qze, e$e, t$e, r$e, o$e, s$e, i$e, a$e, eW, nW, c$e, m$e, xd, VR, gbt, hbt, _bt, h$e, qR, Th, MR, aW, _$e, S$e, lW, E$e, b$e, C$e, v$e, A$e, x$e, w$e, O$e, k$e, P$e, I$e, N$e, ybt, FR, Sbt, U$e, MG, Td, Ebt, bbt, uW, z$e, $$e, H$e, Cbt, j$e, B$e, vbt, Abt, K$e, Rbt, Oh, kh, G$e, YR, Ph, W$e, Ih, Mbt, Nbt, Ubt, Dh, V$e, Z$e, tx, EW, Id, Fh, X$e, xCt, Q$e, eHe, ix, ax, lx, cx, zh, $h, MW, tHe, nHe, aHe, uHe, dHe, Zs, pHe, CW, vW, AW, Nh, UW, fHe, mHe, gHe, hHe, _He, yHe, SHe, EHe, pn, dx, nx, Mh, Bi, AHe, TCt, xHe, Pd, RW, THe, xW, wHe, OHe, Hh, kHe, TW, fx, Bh, Ki, KW, Gl, PHe, Kh, kW, Wl, NHe, Ld, UHe, tV, rV, jHe, XHe, cvt, tje, fV, mV, sje, aje, _V, yV, pje, zvt, $vt, gje, yje, Sje, Kvt, Gvt, eAt, RV, Eje, bje, mAt, Cje, gAt, xV, wV, OV, Js, Lje, FV, Yh, Jh, Md, Tx, zV, $V, HV, Xh, jV, cr, KV, Mo, Fje, zje, yRt, jje, Gje, Vje, sBe, YV, e22, o_, gBe, t2, s_, kx, o2, LBe, UBe, $x, Vi, R2, KBe, GBe, Dx, ZBe, k2, n_, l2, sKe, lKe, z2, bKe, RKe, ec, W2, H2, xKe, wKe, PKe, IKe, $Ke, X2, HKe, jKe, BKe, KKe, VKe, eTt, qKe, tTt, nTt, ZKe, rTt, YKe, oTt, JKe, Wx, XKe, iTt, eq, tq, QKe, nq, rq, e1e, t1e, oq, sq, n1e, r1e, aTt, lTt, c1e, Zx, cq, u1e, uq, a_, d1e, Xx, nc, S1e, c_, mq, gq, Qx, hq, _q, E1e, Sq, u_, rc, d_, b1e, bq, Uo, Cq, vq, A1e, Yd, Jd, R1e, x1e, Aq, gn, T1e, w1e, O1e, Xs, k1e, P1e, xq, Pwt, I1e, Oq, kq, Pq, D1e, L1e, Iq, M1e, N1e, nT, U1e, p_, rT, Dq, oT, iT, F1e, Uq, aT, jq, K1e, Gq, yOt, sGe, cGe, uGe, yGe;
|
|
77458
|
+
var import_node_module, import_crypto, import_crypto2, import_path, import_node_fs15, import_node_process4, import_fs, import_os, import_path2, yy, import_fs2, import_promises, import_path3, import_readline, import_promises2, import_path4, import_os2, import_path5, Se, import_promises3, xe, import_promises4, import_fs3, import_promises5, import_os3, import_path6, import_promises6, import_os4, import_node_path39, import_node_os10, import_node_process5, import_path7, import_events, import_fs4, import_promises7, import_path8, import_child_process, import_util9, import_child_process2, import_fs5, import_path9, import_path10, import_crypto3, import_fs6, import_path11, import_promises8, import_path12, import_path13, import_promises9, import_path14, import_path15, import_fs7, import_promises10, import_path16, import_crypto4, import_path17, import_async_hooks, import_fs8, import_promises11, import_crypto5, import_fs9, import_promises12, import_path18, import_promises13, import_path19, import_crypto6, import_path20, import_path21, import_path22, import_path23, import_promises14, import_fs10, import_promises15, import_path24, import_util10, import_path25, import_os5, import_path26, import_path27, import_path28, import_path29, import_path30, import_net, import_os6, import_child_process3, import_fs11, import_child_process4, import_crypto7, import_promises16, import_module, import_os7, import_path31, import_url, import_events2, import_child_process5, import_fs12, import_readline2, import_string_decoder, import_fs13, import_promises17, import_os8, import_path32, import_crypto8, import_os9, import_fs14, import_path33, import_crypto9, import_fs15, import_promises18, import_path34, IZ, DZ, v_, LZ, OT, NZ, UZ, kT, X, FZ, dr, HZ, jZ, BZ, ot, st, ed, Kv, Te, Me, Oo, nd, hF, Xv, Qv, rd, LF, or, WF, ZF, sA, XF, od, sd, hg, id, Sg, Oz, fA, $z, Wz, Zz, s$, a$, d$, f$, g$, _$, E$, v$, T$, O$, I$, L$, wg, z$, j$, G$, V$, yA, SA, rH, lH, uH, _H, EH, EA, RH, TH, kH, DH, NH, zH, jH, GH, VH, ZH, JH, ej, nj, ij, cj, uj, CA, bj, Aj, wj, PT, KZ, GZ, VGe, VZ, MT, wr, jo, JZ, XZ, NT, UT, FT, zT, Bo, $T, HT, jT, BT, a4, sp, l4, c4, vt, u4, Nt, KT, d4, p4, uc, GT, m4, g4, WT, _4, y4, VT, Dn, Et, b4, C4, v4, A4, ra, x4, ip, qT, ZT, w4, O4, ro, P4, I4, D4, L4, M4, N4, U4, YT, JT, Sn, H4, Ko, j4, oo, XT, QT, G4, W4, V4, ew, Z4, Y4, tw, X4, nw, R_, rw, ow, Go, sw, iw, aw, lw, ei, aY, cw, Or, cY, uw, dw, lp, pw, cp, mY, gY, up, _Y, aa, fw, la, EY, bY, CY, vY, AY, RY, xY, TY, wY, OY, kY, PY, IY, mw, x_, gw, ca, MY, et, dp, hw, pp, zY, $Y, _w, HY, ua, yw, wt, KY, T_, Sw, WY, VY, qY, so, mp, Ew, vw, bw, YY, Cw, JY, XY, kr, QY, e9, Wo, n9, da, o9, s9, i9, a9, l9, c9, u9, d9, p9, f9, m9, g9, h9, _9, y9, S9, E9, b9, C9, v9, A9, R9, x9, T9, Qe, Aw, pa, hp, Rw, dc, k9, w_, P9, Pr, xw, I9, fa, D9, L9, _p, N9, ma, yp, z9, Tw, $9, H9, ww, Vo, Ir, pc, W9, V9, q9, Ow, Y9, Sp, J9, Ep, X9, qo, Q9, bp, kw, eJ, Pw, Iw, Dw, Lw, tJ, nJ, rJ, oJ, sJ, ti, io, iJ, Mw, Nw, Cp, aJ, Uw, Fw, ga, pr, uJ, Fe, $w, O_, k_, I_, ha, Bw, D_, qw, Vw, N_, U_, yJ, _a3, Yo, Zw, bJ, Rp, Yw, vJ, AJ, Jw, xp, Xw, Tp, Qw, kJ, ya, IJ, DJ, Sa, MJ, fc, NJ, eO, FJ, zJ, $J, tO, Ea, jJ, nO, rO, sO, iO, Vn, GJ, Ln, Jo, aO, lO, cO, wp, XJ, QJ, uO, ba, dO, pO, fO, Dr, ao, mO, Ca, gO, z_, $_, H_, j_, B_, K_, G_, W_, V_, q_, Z_, _O, Y_, J_, yO, X_, c3, Q_, ey, ty, ny, ry, oy, sy, iy, ay, ly, cy, we, SO, en, d3, Pp, vO, g3, gy, wO, S3, BO, KO, Ip, Dp, v3, GO, WO, F9e, IO, A3, hy, x3, NO, I3, Ay, Ry, D3, xy, L3, bc, xa, Ty, wy, Oy, ky, XO, Py, Iy, Dy, Ly, My, Ny, Uy, Fy, zy, nk, rk, d3e, p3e, f3e, m3e, g3e, U3, jp, jy, ik, By, Ky, lk, $3, uk, ck, G3, W3, V3, it, Y3, J3, hk, tXe, Q3, kt, We, gX, Ta, SX, mr, Yp, Jp, eS, nS, yXe, IX, DX, rS, ka, oS, Ok, kk, HX, jX, ef, bXe, Uk, Mr, wc, Fk, Pa, OXe, kXe, iS, PXe, IXe, DXe, GX, YX, JX, XX, QX, e6, t6, Yk, n6, r6, o6, s6, i6, a6, l6, c6, Vk, uS, lf, dS, Qk, eP, uf, os10, qXe, ZXe, h6, tP, df, _6, y6, S6, E6, b6, Jn, gr, nP, rP, Dc, pS, oP, gS, lP, C6, mS, lS, sP, w6, O6, dP, k6, YXe, JXe, P6, I6, pf, L6, fP, XXe, QXe, M6, SS, z6, $6, j6, bP, CP, G6, Lc, si, Z6, ES, bS, X6, Q6, e5, t5, n5, u5, r5, o5, s5, i5, a5, l5, c5, u52, d5, p5, f5, m5, g5, h5, _5, y5, S5, E5, b5, C5, v5, A5, R5, x5, T5, w5, O5, k5, P5, I5, D5, L5, M5, N5, U5, F5, z5, $5, H5, j5, B5, K5, G5, W5, V5, q5, Z5, Y5, J5, X5, Q5, e8, t8, n8, r8, o8, s8, i8, a8, l8, c8, u8, d8, CS, p8, f8, m8, g8, h8, _8, y8, S8, E8, b8, C8, v8, A8, R8, x8, T8, w8, O8, k8, P8, I8, D8, L8, M8, N8, U8, F8, z8, $8, H8, j8, B8, K8, G8, W8, V8, q8, Z8, Y8, J8, X8, Q8, e7, t7, n7, r7, o7, s7, i7, a7, l7, c7, u7, d7, p7, f7, m7, g7, h7, _7, y7, S7, E7, b7, C7, TP, v7, L6e, RP, A7, x7, kP, ff, U6e, F6e, Ua, z6e, $6e, H6e, j6e, PP, IP, vS, DP, w7, LP, O7, k7, P7, AS, RS, xS, I7, MP, NP, D7, G6e, L7, W6e, M7, N7, UP, V6e, U7, F7, z7, $7, H7, j7, B7, q6e, is, wS, Fa, K7, G7, W7, i5e, X7, Q7, HP, $P, BP, tQ, WP, VP, JP, _Q, QP, eI, xQ, Uc, DS, $a, wQ, OQ, kQ, PQ, IQ, DQ, LQ, MQ, NQ, UQ, FQ, zQ, $Q, HQ, jQ, BQ, KQ, GQ, WQ, VQ, qQ, ZQ, YQ, JQ, XQ, QQ, eee, tee, nee, ree, oee, see, iee, aee, lee, cee, uee, dee, pee, fee, mee, gee, hee, _ee, yee, See, Eee, bee, Cee, vee, Aee, Ree, xee, Tee, wee, Oee, kee, Pee, Iee, Dee, Lee, Mee, Nee, Uee, Fee, zee, $ee, Hee, jee, Bee, Kee, Gee, Wee, Vee, qee, Zee, Yee, Jee, Xee, Qee, ete, tte, nte, rte, ote, ste, ite, ate, lte, cte, ute, dte, pte, fte, mte, gte, hte, _te, yte, Ste, Ete, bte, Cte, vte, Ate, Rte, xte, Tte, wte, Ote, kte, Pte, Ite, Dte, Lte, Mte, Nte, Ute, Fte, zte, $te, Hte, jte, Bte, Kte, Gte, Wte, Vte, qte, Zte, Yte, Jte, Xte, Qte, ene, tne, nne, rne, one, sne, ine, ane, lne, cne, une, dne, pne, fne, mne, gne, hne, _ne, yne, Sne, Ene, bne, Cne, vne, Ane, Rne, xne, Tne, wne, One, kne, Pne, Ine, Dne, Lne, Mne, Nne, Une, Fne, zne, $ne, Hne, jne, Bne, Kne, Gne, Wne, Vne, qne, Zne, Yne, Jne, Xne, Qne, ere, tre, nre, rre, ore, sre, ire, are, lre, cre, ure, dre, pre, fre, mre, gre, hre, _re, yre, Sre, Ere, bre, Cre, vre, Are, Rre, xre, Tre, wre, Ore, kre, Pre, Ire, Dre, Lre, Mre, Nre, Ure, Fre, zre, $re, Hre, jre, Bre, Kre, Gre, Wre, Vre, qre, Zre, Yre, Jre, Xre, Qre, eoe, toe, noe, roe, ooe, soe, ioe, aoe, loe, coe, uoe, doe, poe, foe, moe, goe, hoe, _oe, yoe, Soe, Eoe, boe, Coe, voe, Aoe, Roe, xoe, Toe, woe, Ooe, koe, Poe, Ioe, Doe, Loe, Moe, Noe, Uoe, Foe, zoe, $oe, Hoe, joe, Boe, Koe, Goe, Woe, Voe, qoe, Zoe, Yoe, Joe, Xoe, Qoe, ese, tse, nse, rse, ose, sse, ise, ase, lse, cse, use, dse, pse, fse, mse, gse, hse, _se, yse, Sse, Ese, LS, bse, Cse, vse, Ase, Rse, xse, Tse, wse, Ose, kse, Pse, Ise, Dse, Lse, Mse, Nse, Use, Fse, zse, $se, Hse, jse, Bse, Kse, Gse, Wse, Vse, qse, Zse, Yse, Jse, Xse, Qse, eie, tie, nie, rie, oie, sie, iie, aie, lie, cie, uie, die, pie, fie, mie, gie, hie, _ie, yie, Sie, Eie, bie, Cie, vie, Aie, Rie, xie, Tie, wie, Oie, kie, Pie, Iie, Die, Lie, Mie, Nie, Uie, Fie, zie, $ie, Hie, jie, Bie, Kie, Gie, Wie, Vie, qie, Zie, Yie, Jie, Xie, Qie, eae, tae, nae, rae, oae, sae, iae, aae, lae, cae, uae, dae, pae, fae, mae, gae, hae, _ae, yae, Sae, Eae, bae, Cae, vae, Aae, Rae, xae, Tae, wae, Oae, kae, Pae, Iae, Dae, Lae, Mae, Nae, Uae, Fae, zae, $ae, Hae, jae, Bae, Kae, Gae, Wae, Vae, qae, Zae, Yae, Jae, Xae, Qae, ele, tle, nle, rle, ole, sle, ile, ale, lle, cle, ule, dle, ple, fle, mle, gle, hle, _le, yle, Sle, Ele, ble, Cle, vle, Ale, Rle, xle, Tle, wle, Ole, kle, Ple, Ile, Dle, Lle, Mle, Nle, Ule, Fle, zle, $le, Hle, jle, Ble, Kle, Gle, Wle, Vle, qle, Zle, Yle, Jle, MS, Xle, Qle, ece, tce, nce, rce, oce, sce, ice, ace, lce, cce, uce, dce, pce, fce, mce, gce, hce, _ce, yce, Sce, Ece, bce, Cce, vce, Ace, Rce, xce, Tce, wce, Oce, kce, Pce, Ice, Dce, Lce, Mce, Nce, Uce, Fce, zce, $ce, Hce, jce, Bce, Kce, Gce, Wce, Vce, qce, Zce, Yce, Jce, Xce, Qce, eue, tue, nue, rue, oue, sue, iue, aue, lue, cue, uue, due, pue, fue, mue, gue, hue, _ue, yue, Sue, Eue, bue, Cue, vue, Aue, Rue, xue, Tue, wue, Oue, kue, Pue, Iue, Due, Lue, Mue, Nue, Uue, Fue, zue, $ue, Hue, jue, Bue, Kue, Gue, Wue, Vue, que, Zue, Yue, Jue, Xue, Que, ede, tde, nde, rde, ode, sde, ide, ade, lde, cde, ude, dde, pde, fde, mde, gde, hde, _de, yde, Sde, Ede, bde, Cde, vde, Ade, Rde, xde, Tde, wde, Ode, kde, Pde, Ide, Dde, Lde, Mde, Nde, Ude, Fde, zde, $de, Hde, jde, Bde, Kde, Gde, Wde, Vde, qde, Zde, Yde, Jde, Xde, Qde, epe, tpe, npe, rpe, ope, spe, ipe, ape, lpe, cpe, upe, dpe, ppe, fpe, mpe, gpe, hpe, _pe, ype, Spe, Epe, bpe, Cpe, vpe, Ape, Rpe, xpe, Tpe, wpe, Ope, kpe, Ppe, Ipe, Dpe, Lpe, Mpe, Npe, Upe, Fpe, zpe, $pe, Hpe, jpe, Bpe, Kpe, Gpe, Wpe, Vpe, qpe, Zpe, Ype, Jpe, Xpe, Qpe, efe, tfe, nfe, rfe, ofe, sfe, ife, afe, lfe, cfe, ufe, dfe, pfe, ffe, mfe, gfe, hfe, _fe, yfe, Sfe, Efe, bfe, Cfe, vfe, Afe, Rfe, xfe, Tfe, wfe, Ofe, kfe, Pfe, Ife, Dfe, Lfe, Mfe, Nfe, Ufe, Ffe, zfe, $fe, Hfe, jfe, Bfe, Kfe, Gfe, Wfe, Vfe, qfe, Zfe, Yfe, Jfe, Xfe, Qfe, eme, tme, nme, rme, ome, sme, ime, ame, lme, cme, ume, dme, pme, fme, mme, gme, hme, _me, yme, Sme, Eme, bme, Cme, vme, Ame, Rme, xme, Tme, wme, Ome, kme, Pme, Ime, Dme, Lme, Mme, Nme, Ume, Fme, zme, $me, Hme, jme, Bme, Kme, Gme, Wme, Vme, qme, Zme, Yme, Jme, NS, Xme, Qme, ege, tge, nge, rge, oge, sge, ige, age, lge, cge, uge, dge, pge, fge, mge, gge, hge, _ge, yge, Sge, Ege, bge, Cge, vge, Age, Rge, xge, Tge, wge, Oge, kge, Pge, Ige, Dge, Lge, Mge, Nge, Uge, Fge, zge, $ge, Hge, US, jge, Bge, Kge, Gge, Wge, Vge, qge, Zge, Yge, Jge, Xge, Qge, ehe, the, nhe, rhe, ohe, she, ihe, ahe, lhe, che, uhe, dhe, phe, fhe, mhe, ghe, hhe, _he, yhe, She, Ehe, bhe, Che, vhe, Ahe, Rhe, xhe, The, whe, Ohe, khe, Phe, Ihe, Dhe, Lhe, Mhe, Nhe, FS, rI, oI, Uhe, Fhe, zhe, $he, Hhe, jhe, Bhe, Khe, Ghe, Whe, Vhe, qhe, Zhe, Yhe, Jhe, Xhe, Qhe, e_e, t_e, n_e, r_e, o_e, s_e, i_e, a_e, l_e, c_e, u_e, d_e, p_e, f_e, m_e, g_e, h_e, __e, y_e, S_e, E_e, b_e, C_e, v_e, A_e, R_e, x_e, T_e, w_e, O_e, k_e, P_e, I_e, D_e, L_e, M_e, N_e, U_e, F_e, z_e, $_e, H_e, j_e, B_e, K_e, G_e, W_e, V_e, q_e, Z_e, Y_e, J_e, Q_e, Xn, eye, F8e, tye, z8e, nye, iI, rye, oye, lI, cye, uye, dye, _ye, on, vye, Aye, dI, C7e, v7e, ho, kI, PI, Dye, Sf, Lye, jc, Mye, Nye, LI, NI, Fye, VS, zye, $ye, x7e, zI, YS, KI, GI, VI, Hye, qS, ls, Kye, Gye, oD, nE, sD, So, Yc, vn, Zye, oE, sE, iD, aD, wf, Jc, Xc, kf, Qc, Pf, eu, fi, tu, mi, lD, cD, uD, dD, pD, fD, mD, gD, hD, _D, yD, SD, ED, bD, vD, AD, cE, RD, Xye, TD, wD, OD, kD, PD, uE, ID, DD, LD, MD, FD, If, nu, zD, $D, HD, jD, BD, zt, dE, Df, pE, fE, KD, GD, WD, VD, qD, ru, ZD, YD, JD, XD, QD, eL, tL, mE, yr, He, rL, ou, Je, yE, SE, EE, fL, mL, tSe, bE, CE, vE, AE, RE, xE, TE, wE, gL, hL, _L, yL, OE, sSe, kE, PE, IE, DE, LE, ME, NE, Nf, UE, FE, zE, $E, HE, jE, BE, cSe, gE, KE, vL, Uf, GE, WE, VE, qE, ZE, YE, Ff, JE, XE, QE, eb, tb, nb, zf, AL, rb, ob, sb, TL, ab, RL, xL, $f, Hf, dSe, fSe, OL, kL, Sr, FL, ML, zL, lu, hSe, iC, aC, lC, HL, jL, cC, uC, BL, dC, KL, pC, GL, fC, mC, WL, VL, qL, ZL, gC, YL, hC, JL, XL, _C, yC, SC, EC, QL, sC, bC, CC, vC, AC, RC, xC, TC, wC, OC, tM, qf, kC, $L, rM, ASe, Fn, oM, sM, iM, aM, lM, cM, uM, dM, pM, fM, mM, gM, Be, SM, LC, ct, MC, EM, bM, CM, pEe, fEe, Yf, mEe, gEe, hEe, _Ee, yEe, SEe, EEe, bEe, CEe, vEe, AEe, REe, xEe, TEe, wEe, OEe, NC, kEe, vM, PEe, IEe, DEe, LEe, MEe, fu, AM, NEe, UEe, IC, DC, FEe, zEe, qa, TM, HEe, jEe, KEe, wM, em, mu, qEe, ZEe, JEe, OM, Qn, kM, LM, nbe, rbe, abe, lbe, cbe, rm, pbe, At, hbe, BC, BM, Zet, WM, VM, qM, ZM, Cbe, vbe, YM, Abe, Rbe, JM, xbe, Tbe, QM, Ibe, eN, Lbe, nN, Mbe, Nbe, sm, rN, iN, Fbe, aN, $be, jbe, Kbe, Gbe, yu, lN, uN, dN, Xbe, KM, Qbe, eCe, tCe, oCe, iCe, _N, yN, wN, Ytt, ON, OCe, DCe, LN, $Ce, HCe, Cu, BCe, MN, VCe, QCe, ive, uve, VN, pve, fve, _rt, gve, Sve, nv, tv, GN, tU, Fve, Hve, iU, tAe, sAe, iAe, aAe, cAe, Ie, bU, Q, vo, F, zn, fAe, ms, mAe, _m, nn, he, Xa, an, lv, cv, Si, wu, se, br, CU, Oe, gAe, hAe, _Ae, yAe, SAe, EAe, bAe, CAe, vAe, uv, AAe, RAe, xAe, TAe, wAe, OAe, vU, kAe, Ro, el, tl, ym, ku, Sm, Pu, Iu, Em, Ei, xo, bm, Fr, ft, Du, Ao, pv, Lu, To, Cm, vm, nl, Ou, Mu, Nu, bi, Uu, rl, $r, zr, gs, Fu, zu, Am, fv, Rm, $u, wot, H, Oot, kot, Pot, Iot, Dot, Lot, Mot, Not, Uot, Fot, zot, $ot, Hot, jot, xU, Bot, Kot, Got, Wot, Vot, qot, Zot, Yot, Jot, Xot, Qot, est, tst, nst, rst, ost, sst, ist, ast, FAe, zAe, gv, OU, Ss, km, Mt, kU, PU, kst, HAe, jAe, hv, $n, Hu, IU, Yt, tr, nr, Jt, Pm, DU, _v, LU, MU, yv, ju, le, Sv, NU, Pst, Ist, Im, BAe, Dm, KAe, Bu, ol, UU, GAe, WAe, VAe, qAe, ZAe, YAe, Ev, JAe, XAe, bv, Lm, QAe, eRe, Mm, tRe, Ku, Gu, nRe, Wu, sl, rRe, Vu, Nm, Um, Fm, Dst, zm, $m, Hm, FU, zU, $U, Cv, HU, qu, il, jU, oRe, jm, sRe, Bm, iRe, vv, aRe, Km, lRe, cRe, uRe, dRe, pRe, fRe, mRe, gRe, hRe, _Re, Gm, yRe, SRe, Wm, Av, Rv, xv, ERe, bRe, CRe, Tv, vRe, ARe, RRe, xRe, TRe, BU, Vm, wRe, qm, Lst, ORe, al, kRe, Mst, Zu, PRe, wv, IRe, DRe, LRe, MRe, NRe, URe, FRe, Om, zRe, $Re, HRe, Yu, Ov, jRe, BRe, KRe, GRe, WRe, VRe, qRe, ZRe, YRe, JRe, XRe, QRe, exe, txe, nxe, rxe, oxe, sxe, ll, ixe, axe, lxe, Zm, cxe, uxe, dxe, kv, pxe, Nst, Ust, Fst, zst, $st, Hst, ae, WU, qU, VU, ZU, YU, Ym, e0, fxe, mxe, Dv, Cr, gxe, Ju, d0, h0, _0, v0, A0, Sxe, Exe, Mv, Cxe, Fv, Oj, kj, PA, IA, DA, Lj, Dj, aLe, NA, FA, uLe, dd, fLe, Po, SLe, ELe, zA, bLe, xLe, TLe, wLe, OLe, kLe, $j, qj, ILe, DLe, LLe, MLe, Ce, NLe, Wg, Oi, VA, Do, Jj, Xj, Qj, eB, tB, nB, qA, ZA, jA, Bj, jLe, BLe, GLe, rB, BA, Gg, GA, WA, VLe, qLe, Kj, Hs, sB, QLe, YA, iB, uB, eMe, dB, pB, fB, mB, tMe, XA, aB, QA, gB, hB, _B, yB, jn, lMe, SB, dMe, bB, mMe, fd, RB, hMe, Rr, TB, SMe, EMe, Pl, wB, Vg, AMe, Il, RMe, xMe, qg, OB, wMe, OMe, kB, eo, Dl, Zg, DB, NMe, FB, WMe, VMe, $B, HB, jB, BB, Ml, GB, nR, WB, Jg, KB, eNe, Bs, VB, gd, Nl, Xg, tNe, YB, qB, Pi, rK, iK, pNe, hd, _d, to, yd, nh, uK, aK, _Ne, lK, cK, Sd, Ul, rh, oh, dK, CNe, pK, sh, fK, RNe, xNe, TNe, mK, wNe, ONe, ih, Ed, lr, gK, hK, yK, SK, EK, ah, bK, FNe, CK, zNe, $Ne, HNe, vK, BNe, lh, AK, RK, xK, VNe, dn, TK, wK, OK, kK, PK, QNe, eUe, IK, DK, rUe, LK, MK, NK, UK, iUe, aUe, lUe, cUe, uUe, dUe, pUe, fUe, mUe, gUe, hUe, _Ue, yUe, SUe, EUe, bUe, CUe, vUe, AUe, FK, xUe, zK, $K, wUe, HK, OUe, jK, BK, PUe, KK, IUe, DUe, LUe, GK, MUe, NUe, UUe, FUe, WK, zUe, $Ue, HUe, VK, jUe, BUe, KUe, GUe, WUe, VUe, qUe, ZUe, YUe, JUe, XUe, QUe, e0e, t0e, n0e, r0e, Xe, qK, ZK, YK, JK, a0e, l0e, uh, XK, QK, e1, n1, r1, dh, m0e, g0e, h0e, _0e, bd, o1, S0e, Fl, s1, b0e, i1, Di, a1, l1, c1, u1, d1, p1, f1, P0e, I0e, m1, D0e, g1, h1, _1, vyt, U0e, y1, Ayt, iR, F0e, z0e, $0e, Gs, zl, fh, E1, b1, H0e, j0e, B0e, K0e, mh, $l, gh, Ws, aR, hh, _h, G0e, W0e, lR, R1, x1, V0e, uR, k1, P1, I1, D1, L1, Y0e, dR, J0e, Fyt, pR, X0e, fR, mR, Q0e, zyt, eFe, gR, hR, _R, $yt, M1, yR, N1, U1, tFe, nFe, rFe, oFe, iFe, Mi, cFe, $1, Wyt, Vyt, H1, j1, B1, K1, uFe, G1, W1, V1, q1, dFe, pFe, SR, fFe, eSt, tSt, mFe, jl, Vs, gFe, Y1, hFe, _Fe, X1, Q1, eG, yFe, SFe, tG, EFe, bFe, CFe, vFe, bR, CR, RFe, xFe, vR, TFe, Eh, nSt, Cd, wFe, OFe, aSt, rG, PFe, IFe, _St, oG, sG, bSt, CSt, HFe, jFe, $St, BFe, KFe, HSt, JSt, XSt, lG, OR, VFe, YFe, uG, eze, nze, gG, vd, vh, kR, zi, sze, yG, ize, yEt, Ad, $i, bG, Kn, AEt, REt, xEt, aze, AG, wG, $R, dze, $G, pze, fze, mze, gze, hze, BR, HG, jG, fbt, yze, Sze, Eze, Gn, ji, kG, PG, NR, UR, KR, GG, Cze, vze, Rze, GR, xze, Tze, xh, WR, Oze, kze, mbt, Pze, Ize, Dze, Lze, Mze, Nze, qG, Uze, Fze, zze, $ze, ZG, Hze, IG, jze, Bze, YG, Kze, Gze, DG, Wze, Vze, JG, qze, Zze, Yze, Jze, QG, Xze, Qze, e$e, t$e, r$e, o$e, s$e, i$e, a$e, eW, nW, c$e, m$e, xd, VR, gbt, hbt, _bt, h$e, qR, Th, MR, aW, _$e, S$e, lW, E$e, b$e, C$e, v$e, A$e, x$e, w$e, O$e, k$e, P$e, I$e, N$e, ybt, FR, Sbt, U$e, MG, Td, Ebt, bbt, uW, z$e, $$e, H$e, Cbt, j$e, B$e, vbt, Abt, K$e, Rbt, Oh, kh, G$e, YR, Ph, W$e, Ih, Mbt, Nbt, Ubt, Dh, V$e, Z$e, tx, EW, Id, Fh, X$e, xCt, Q$e, eHe, ix, ax, lx, cx, zh, $h, MW, tHe, nHe, aHe, uHe, dHe, Zs, pHe, CW, vW, AW, Nh, UW, fHe, mHe, gHe, hHe, _He, yHe, SHe, EHe, pn, dx, nx, Mh, Bi, AHe, TCt, xHe, Pd, RW, THe, xW, wHe, OHe, Hh, kHe, TW, fx, Bh, Ki, KW, Gl, PHe, Kh, kW, Wl, NHe, Ld, UHe, tV, rV, jHe, XHe, cvt, tje, fV, mV, sje, aje, _V, yV, pje, zvt, $vt, gje, yje, Sje, Kvt, Gvt, eAt, RV, Eje, bje, mAt, Cje, gAt, xV, wV, OV, Js, Lje, FV, Yh, Jh, Md, Tx, zV, $V, HV, Xh, jV, cr, KV, Mo, Fje, zje, yRt, jje, Gje, Vje, sBe, YV, e22, o_, gBe, t2, s_, kx, o2, LBe, UBe, $x, Vi, R2, KBe, GBe, Dx, ZBe, k2, n_, l2, sKe, lKe, z2, bKe, RKe, ec, W2, H2, xKe, wKe, PKe, IKe, $Ke, X2, HKe, jKe, BKe, KKe, VKe, eTt, qKe, tTt, nTt, ZKe, rTt, YKe, oTt, JKe, Wx, XKe, iTt, eq, tq, QKe, nq, rq, e1e, t1e, oq, sq, n1e, r1e, aTt, lTt, c1e, Zx, cq, u1e, uq, a_, d1e, Xx, nc, S1e, c_, mq, gq, Qx, hq, _q, E1e, Sq, u_, rc, d_, b1e, bq, Uo, Cq, vq, A1e, Yd, Jd, R1e, x1e, Aq, gn, T1e, w1e, O1e, Xs, k1e, P1e, xq, Pwt, I1e, Oq, kq, Pq, D1e, L1e, Iq, M1e, N1e, nT, U1e, p_, rT, Dq, oT, iT, F1e, Uq, aT, jq, K1e, Gq, yOt, sGe, cGe, uGe, yGe;
|
|
77449
77459
|
var init_sdk = __esm({
|
|
77450
77460
|
"node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.3.292_@anthropic-ai+sdk@0.131.0_zod@4.6.5__@modelconte_9caa915130557974815a7ac66b010e49/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs"() {
|
|
77451
77461
|
import_node_module = require("node:module");
|
|
77452
77462
|
import_crypto = require("crypto");
|
|
77453
77463
|
import_crypto2 = require("crypto");
|
|
77454
77464
|
import_path = require("path");
|
|
77455
|
-
|
|
77465
|
+
import_node_fs15 = require("node:fs");
|
|
77456
77466
|
import_node_process4 = require("node:process");
|
|
77457
77467
|
import_fs = require("fs");
|
|
77458
77468
|
import_os = require("os");
|
|
@@ -77476,7 +77486,7 @@ var init_sdk = __esm({
|
|
|
77476
77486
|
import_path6 = require("path");
|
|
77477
77487
|
import_promises6 = require("fs/promises");
|
|
77478
77488
|
import_os4 = require("os");
|
|
77479
|
-
|
|
77489
|
+
import_node_path39 = __toESM(require("node:path"), 1);
|
|
77480
77490
|
import_node_os10 = __toESM(require("node:os"), 1);
|
|
77481
77491
|
import_node_process5 = __toESM(require("node:process"), 1);
|
|
77482
77492
|
import_path7 = require("path");
|
|
@@ -85927,16 +85937,16 @@ var init_sdk = __esm({
|
|
|
85927
85937
|
wS = import_node_os10.default.tmpdir();
|
|
85928
85938
|
({ env: Fa } = import_node_process5.default);
|
|
85929
85939
|
K7 = (e14) => {
|
|
85930
|
-
let t10 =
|
|
85931
|
-
return { data:
|
|
85940
|
+
let t10 = import_node_path39.default.join(is, "Library");
|
|
85941
|
+
return { data: import_node_path39.default.join(t10, "Application Support", e14), config: import_node_path39.default.join(t10, "Preferences", e14), cache: import_node_path39.default.join(t10, "Caches", e14), log: import_node_path39.default.join(t10, "Logs", e14), temp: import_node_path39.default.join(wS, e14) };
|
|
85932
85942
|
};
|
|
85933
85943
|
G7 = (e14) => {
|
|
85934
|
-
let t10 = Fa.APPDATA ||
|
|
85935
|
-
return { data:
|
|
85944
|
+
let t10 = Fa.APPDATA || import_node_path39.default.join(is, "AppData", "Roaming"), n10 = Fa.LOCALAPPDATA || import_node_path39.default.join(is, "AppData", "Local");
|
|
85945
|
+
return { data: import_node_path39.default.join(n10, e14, "Data"), config: import_node_path39.default.join(t10, e14, "Config"), cache: import_node_path39.default.join(n10, e14, "Cache"), log: import_node_path39.default.join(n10, e14, "Log"), temp: import_node_path39.default.join(wS, e14) };
|
|
85936
85946
|
};
|
|
85937
85947
|
W7 = (e14) => {
|
|
85938
|
-
let t10 =
|
|
85939
|
-
return { data:
|
|
85948
|
+
let t10 = import_node_path39.default.basename(is);
|
|
85949
|
+
return { data: import_node_path39.default.join(Fa.XDG_DATA_HOME || import_node_path39.default.join(is, ".local", "share"), e14), config: import_node_path39.default.join(Fa.XDG_CONFIG_HOME || import_node_path39.default.join(is, ".config"), e14), cache: import_node_path39.default.join(Fa.XDG_CACHE_HOME || import_node_path39.default.join(is, ".cache"), e14), log: import_node_path39.default.join(Fa.XDG_STATE_HOME || import_node_path39.default.join(is, ".local", "state"), e14), temp: import_node_path39.default.join(wS, t10, e14) };
|
|
85940
85950
|
};
|
|
85941
85951
|
i5e = OS("claude-cli");
|
|
85942
85952
|
X7 = 100;
|
|
@@ -111645,16 +111655,503 @@ function registerCodexCommand(program2, deps) {
|
|
|
111645
111655
|
|
|
111646
111656
|
// src/frontdoor/commands.ts
|
|
111647
111657
|
var import_node_crypto20 = require("node:crypto");
|
|
111648
|
-
var
|
|
111649
|
-
var
|
|
111658
|
+
var import_node_path49 = __toESM(require("node:path"), 1);
|
|
111659
|
+
var import_node_fs17 = __toESM(require("node:fs"), 1);
|
|
111650
111660
|
init_commandDeps();
|
|
111651
111661
|
init_schema();
|
|
111662
|
+
|
|
111663
|
+
// src/agents/realFs.ts
|
|
111664
|
+
var import_node_fs12 = __toESM(require("node:fs"), 1);
|
|
111665
|
+
init_realPorts();
|
|
111666
|
+
var realSessionFs = {
|
|
111667
|
+
...realFarmFs,
|
|
111668
|
+
realpath: (candidate) => {
|
|
111669
|
+
try {
|
|
111670
|
+
return import_node_fs12.default.realpathSync(candidate);
|
|
111671
|
+
} catch {
|
|
111672
|
+
return void 0;
|
|
111673
|
+
}
|
|
111674
|
+
}
|
|
111675
|
+
};
|
|
111676
|
+
|
|
111677
|
+
// src/agents/sessions.ts
|
|
111678
|
+
var import_node_path33 = __toESM(require("node:path"), 1);
|
|
111679
|
+
init_cliError();
|
|
111680
|
+
|
|
111681
|
+
// src/agents/read.ts
|
|
111682
|
+
var import_node_path32 = __toESM(require("node:path"), 1);
|
|
111683
|
+
init_zod();
|
|
111684
|
+
|
|
111685
|
+
// src/agents/schema.ts
|
|
111686
|
+
init_zod();
|
|
111687
|
+
var AgentMetaSchema = external_exports.looseObject({
|
|
111688
|
+
agentType: external_exports.string(),
|
|
111689
|
+
isFork: external_exports.boolean().optional(),
|
|
111690
|
+
description: external_exports.string().optional(),
|
|
111691
|
+
name: external_exports.string().optional(),
|
|
111692
|
+
toolUseId: external_exports.string().optional(),
|
|
111693
|
+
spawnDepth: external_exports.number().int().nonnegative().optional(),
|
|
111694
|
+
parentAgentId: external_exports.string().optional(),
|
|
111695
|
+
model: external_exports.string().optional(),
|
|
111696
|
+
requestShape: external_exports.string().optional(),
|
|
111697
|
+
requestNonInteractive: external_exports.boolean().optional(),
|
|
111698
|
+
workflowPhase: external_exports.string().optional(),
|
|
111699
|
+
taskKind: external_exports.string().optional(),
|
|
111700
|
+
teamName: external_exports.string().optional(),
|
|
111701
|
+
worktreePath: external_exports.string().optional(),
|
|
111702
|
+
worktreeBranch: external_exports.string().optional(),
|
|
111703
|
+
stoppedByUser: external_exports.boolean().optional()
|
|
111704
|
+
});
|
|
111705
|
+
var AgentKindSchema = external_exports.enum(["subagent", "fork", "workflow-agent", "teammate"]);
|
|
111706
|
+
var AgentNodeSchema = external_exports.lazy(
|
|
111707
|
+
() => external_exports.strictObject({
|
|
111708
|
+
id: external_exports.string(),
|
|
111709
|
+
kind: AgentKindSchema,
|
|
111710
|
+
agentType: external_exports.string(),
|
|
111711
|
+
description: external_exports.string().optional(),
|
|
111712
|
+
name: external_exports.string().optional(),
|
|
111713
|
+
toolUseId: external_exports.string().optional(),
|
|
111714
|
+
spawnDepth: external_exports.number().int().nonnegative().optional(),
|
|
111715
|
+
model: external_exports.string().optional(),
|
|
111716
|
+
background: external_exports.boolean().optional(),
|
|
111717
|
+
workflowRunId: external_exports.string().optional(),
|
|
111718
|
+
workflowPhase: external_exports.string().optional(),
|
|
111719
|
+
teamName: external_exports.string().optional(),
|
|
111720
|
+
stoppedByUser: external_exports.boolean().optional(),
|
|
111721
|
+
transcript: external_exports.string(),
|
|
111722
|
+
children: external_exports.array(AgentNodeSchema)
|
|
111723
|
+
})
|
|
111724
|
+
);
|
|
111725
|
+
var TaskItemSchema = external_exports.strictObject({
|
|
111726
|
+
id: external_exports.string(),
|
|
111727
|
+
subject: external_exports.string(),
|
|
111728
|
+
description: external_exports.string().optional(),
|
|
111729
|
+
status: external_exports.string(),
|
|
111730
|
+
/** What a spinner shows while the task runs. */
|
|
111731
|
+
activeForm: external_exports.string().optional(),
|
|
111732
|
+
/** The teammate or agent name the task is assigned to, as Agent Teams writes it. */
|
|
111733
|
+
owner: external_exports.string().optional(),
|
|
111734
|
+
/** Free-form data the harness attaches to a task, kept as written. */
|
|
111735
|
+
metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
111736
|
+
blocks: external_exports.array(external_exports.string()),
|
|
111737
|
+
blockedBy: external_exports.array(external_exports.string()),
|
|
111738
|
+
/** The id of the shared task list this task belongs to (a team's name, or a custom list id), absent for the session's own list. */
|
|
111739
|
+
taskList: external_exports.string().optional()
|
|
111740
|
+
});
|
|
111741
|
+
var WorkflowRunSchema = external_exports.strictObject({
|
|
111742
|
+
runId: external_exports.string(),
|
|
111743
|
+
workflowName: external_exports.string().optional(),
|
|
111744
|
+
status: external_exports.string().optional(),
|
|
111745
|
+
startTime: external_exports.number().optional(),
|
|
111746
|
+
phases: external_exports.array(external_exports.string()),
|
|
111747
|
+
summary: external_exports.string().optional()
|
|
111748
|
+
});
|
|
111749
|
+
var AgentTreeProblemSchema = external_exports.strictObject({
|
|
111750
|
+
/** Relative to the identity's configuration directory. */
|
|
111751
|
+
path: external_exports.string(),
|
|
111752
|
+
reason: external_exports.string()
|
|
111753
|
+
});
|
|
111754
|
+
var SessionSummarySchema = external_exports.strictObject({
|
|
111755
|
+
project: external_exports.string(),
|
|
111756
|
+
sessionId: external_exports.string(),
|
|
111757
|
+
superseded: external_exports.boolean(),
|
|
111758
|
+
/** The directory and transcript stem exactly as on disk, which differs from `sessionId` for a superseded session. */
|
|
111759
|
+
entry: external_exports.string(),
|
|
111760
|
+
agentCount: external_exports.number().int().nonnegative(),
|
|
111761
|
+
workflowRunCount: external_exports.number().int().nonnegative(),
|
|
111762
|
+
/** When the transcript was last written, as an ISO instant; absent when there is no transcript file. */
|
|
111763
|
+
updatedAt: external_exports.iso.datetime().optional(),
|
|
111764
|
+
identities: external_exports.array(external_exports.string())
|
|
111765
|
+
});
|
|
111766
|
+
var SessionAgentTreeSchema = external_exports.strictObject({
|
|
111767
|
+
project: external_exports.string(),
|
|
111768
|
+
sessionId: external_exports.string(),
|
|
111769
|
+
/** True for a session directory a resume superseded (`<session-id>.superseded-<epoch-ms>`). */
|
|
111770
|
+
superseded: external_exports.boolean(),
|
|
111771
|
+
/** The agents the session itself spawned, each with its descendants. */
|
|
111772
|
+
agents: external_exports.array(AgentNodeSchema),
|
|
111773
|
+
tasks: external_exports.array(TaskItemSchema),
|
|
111774
|
+
workflowRuns: external_exports.array(WorkflowRunSchema),
|
|
111775
|
+
problems: external_exports.array(AgentTreeProblemSchema)
|
|
111776
|
+
});
|
|
111777
|
+
|
|
111778
|
+
// src/agents/read.ts
|
|
111779
|
+
var PROJECTS_DIR = "projects";
|
|
111780
|
+
var TASKS_DIR = "tasks";
|
|
111781
|
+
var SUBAGENTS_DIR = "subagents";
|
|
111782
|
+
var WORKFLOWS_DIR = "workflows";
|
|
111783
|
+
var AGENT_FILE_PREFIX = "agent-";
|
|
111784
|
+
var META_SUFFIX = ".meta.json";
|
|
111785
|
+
var TRANSCRIPT_SUFFIX = ".jsonl";
|
|
111786
|
+
var SHORT_SESSION_ID_LENGTH = 8;
|
|
111787
|
+
var SHORT_SESSION_LIST_PREFIX = "session-";
|
|
111788
|
+
var JSON_SUFFIX = ".json";
|
|
111789
|
+
var WORKFLOW_RUN_PREFIX = "wf_";
|
|
111790
|
+
var ARCHIVED_RE = /^(.+)\.(?:superseded|orphaned)-.+$/;
|
|
111791
|
+
var FORK_AGENT_TYPE = "fork";
|
|
111792
|
+
var WORKFLOW_AGENT_TYPE = "workflow-subagent";
|
|
111793
|
+
var TEAMMATE_TASK_KIND = "in_process_teammate";
|
|
111794
|
+
var BACKGROUND_REQUEST_SHAPE = "background";
|
|
111795
|
+
var SESSION_SPAWN_DEPTH = 1;
|
|
111796
|
+
function parseEntry2(project, entry) {
|
|
111797
|
+
const match = ARCHIVED_RE.exec(entry);
|
|
111798
|
+
const base = match?.[1];
|
|
111799
|
+
return base === void 0 ? { project, sessionId: entry, superseded: false, entry } : { project, sessionId: base, superseded: true, entry };
|
|
111800
|
+
}
|
|
111801
|
+
function listSessions2(fs22, configDir) {
|
|
111802
|
+
const found = [];
|
|
111803
|
+
for (const project of fs22.readdir(import_node_path32.default.join(configDir, PROJECTS_DIR))) {
|
|
111804
|
+
const projectDir = import_node_path32.default.join(configDir, PROJECTS_DIR, project);
|
|
111805
|
+
const entries = /* @__PURE__ */ new Set();
|
|
111806
|
+
for (const name of fs22.readdir(projectDir)) {
|
|
111807
|
+
if (name.endsWith(TRANSCRIPT_SUFFIX)) {
|
|
111808
|
+
entries.add(name.slice(0, -TRANSCRIPT_SUFFIX.length));
|
|
111809
|
+
continue;
|
|
111810
|
+
}
|
|
111811
|
+
const children = fs22.readdir(import_node_path32.default.join(projectDir, name));
|
|
111812
|
+
if (children.includes(SUBAGENTS_DIR) || children.includes(WORKFLOWS_DIR)) {
|
|
111813
|
+
entries.add(name);
|
|
111814
|
+
}
|
|
111815
|
+
}
|
|
111816
|
+
for (const entry of entries) {
|
|
111817
|
+
found.push(parseEntry2(project, entry));
|
|
111818
|
+
}
|
|
111819
|
+
}
|
|
111820
|
+
return found.sort((left, right) => left.project.localeCompare(right.project) || left.entry.localeCompare(right.entry));
|
|
111821
|
+
}
|
|
111822
|
+
function locateAgents(fs22, configDir, relativeDir, workflowRunId, report) {
|
|
111823
|
+
const located = [];
|
|
111824
|
+
for (const name of listDirOrReport(fs22, configDir, relativeDir, report)) {
|
|
111825
|
+
if (!name.startsWith(AGENT_FILE_PREFIX) || !name.endsWith(META_SUFFIX)) {
|
|
111826
|
+
continue;
|
|
111827
|
+
}
|
|
111828
|
+
const id2 = name.slice(AGENT_FILE_PREFIX.length, -META_SUFFIX.length);
|
|
111829
|
+
located.push({
|
|
111830
|
+
id: id2,
|
|
111831
|
+
metaPath: import_node_path32.default.join(relativeDir, name),
|
|
111832
|
+
transcriptPath: import_node_path32.default.join(relativeDir, `${AGENT_FILE_PREFIX}${id2}${TRANSCRIPT_SUFFIX}`),
|
|
111833
|
+
workflowRunId
|
|
111834
|
+
});
|
|
111835
|
+
}
|
|
111836
|
+
return located;
|
|
111837
|
+
}
|
|
111838
|
+
function kindOf(meta3, workflowRunId) {
|
|
111839
|
+
if (meta3.isFork === true || meta3.agentType === FORK_AGENT_TYPE) {
|
|
111840
|
+
return "fork";
|
|
111841
|
+
}
|
|
111842
|
+
if (workflowRunId !== void 0 || meta3.agentType === WORKFLOW_AGENT_TYPE) {
|
|
111843
|
+
return "workflow-agent";
|
|
111844
|
+
}
|
|
111845
|
+
if (meta3.taskKind === TEAMMATE_TASK_KIND || meta3.teamName !== void 0) {
|
|
111846
|
+
return "teammate";
|
|
111847
|
+
}
|
|
111848
|
+
return "subagent";
|
|
111849
|
+
}
|
|
111850
|
+
function toNode(read, children) {
|
|
111851
|
+
const { located, meta: meta3 } = read;
|
|
111852
|
+
return {
|
|
111853
|
+
id: located.id,
|
|
111854
|
+
kind: kindOf(meta3, located.workflowRunId),
|
|
111855
|
+
agentType: meta3.agentType,
|
|
111856
|
+
...meta3.description === void 0 ? {} : { description: meta3.description },
|
|
111857
|
+
...meta3.name === void 0 ? {} : { name: meta3.name },
|
|
111858
|
+
...meta3.toolUseId === void 0 ? {} : { toolUseId: meta3.toolUseId },
|
|
111859
|
+
...meta3.spawnDepth === void 0 ? {} : { spawnDepth: meta3.spawnDepth },
|
|
111860
|
+
...meta3.model === void 0 ? {} : { model: meta3.model },
|
|
111861
|
+
...meta3.requestShape === void 0 ? {} : { background: meta3.requestShape === BACKGROUND_REQUEST_SHAPE },
|
|
111862
|
+
...located.workflowRunId === void 0 ? {} : { workflowRunId: located.workflowRunId },
|
|
111863
|
+
...meta3.workflowPhase === void 0 ? {} : { workflowPhase: meta3.workflowPhase },
|
|
111864
|
+
...meta3.teamName === void 0 ? {} : { teamName: meta3.teamName },
|
|
111865
|
+
...meta3.stoppedByUser === void 0 ? {} : { stoppedByUser: meta3.stoppedByUser },
|
|
111866
|
+
transcript: located.transcriptPath,
|
|
111867
|
+
children
|
|
111868
|
+
};
|
|
111869
|
+
}
|
|
111870
|
+
function describeFailure(error63) {
|
|
111871
|
+
return error63 instanceof Error ? error63.message : String(error63);
|
|
111872
|
+
}
|
|
111873
|
+
function readFileOrReport(fs22, configDir, relative, report) {
|
|
111874
|
+
try {
|
|
111875
|
+
return fs22.readFileUtf8(import_node_path32.default.join(configDir, relative));
|
|
111876
|
+
} catch (error63) {
|
|
111877
|
+
report({ path: relative, reason: `could not be read: ${describeFailure(error63)}` });
|
|
111878
|
+
return void 0;
|
|
111879
|
+
}
|
|
111880
|
+
}
|
|
111881
|
+
function listDirOrReport(fs22, configDir, relative, report) {
|
|
111882
|
+
try {
|
|
111883
|
+
return fs22.readdir(import_node_path32.default.join(configDir, relative));
|
|
111884
|
+
} catch (error63) {
|
|
111885
|
+
report({ path: relative, reason: `could not be listed: ${describeFailure(error63)}` });
|
|
111886
|
+
return [];
|
|
111887
|
+
}
|
|
111888
|
+
}
|
|
111889
|
+
function parseJson3(text2) {
|
|
111890
|
+
try {
|
|
111891
|
+
const value2 = JSON.parse(text2);
|
|
111892
|
+
return value2;
|
|
111893
|
+
} catch {
|
|
111894
|
+
return void 0;
|
|
111895
|
+
}
|
|
111896
|
+
}
|
|
111897
|
+
var TaskFileSchema = external_exports.object({ ...TaskItemSchema.omit({ taskList: true }).shape, blocks: external_exports.array(external_exports.string()).default([]), blockedBy: external_exports.array(external_exports.string()).default([]) });
|
|
111898
|
+
var WorkflowRunFileSchema = external_exports.object({
|
|
111899
|
+
runId: external_exports.string(),
|
|
111900
|
+
workflowName: external_exports.string().optional(),
|
|
111901
|
+
status: external_exports.string().optional(),
|
|
111902
|
+
startTime: external_exports.number().optional(),
|
|
111903
|
+
phases: external_exports.array(external_exports.object({ title: external_exports.string() })).default([]),
|
|
111904
|
+
summary: external_exports.string().optional()
|
|
111905
|
+
});
|
|
111906
|
+
function summariseSession(fs22, configDir, ref) {
|
|
111907
|
+
const sessionRelative = import_node_path32.default.join(PROJECTS_DIR, ref.project, ref.entry);
|
|
111908
|
+
const subagentsRelative = import_node_path32.default.join(sessionRelative, SUBAGENTS_DIR);
|
|
111909
|
+
const workflowsUnderSubagents = import_node_path32.default.join(subagentsRelative, WORKFLOWS_DIR);
|
|
111910
|
+
const isMeta = (name) => name.startsWith(AGENT_FILE_PREFIX) && name.endsWith(META_SUFFIX);
|
|
111911
|
+
let agentCount = fs22.readdir(import_node_path32.default.join(configDir, subagentsRelative)).filter(isMeta).length;
|
|
111912
|
+
for (const runDir of fs22.readdir(import_node_path32.default.join(configDir, workflowsUnderSubagents))) {
|
|
111913
|
+
if (runDir.startsWith(WORKFLOW_RUN_PREFIX)) {
|
|
111914
|
+
agentCount += fs22.readdir(import_node_path32.default.join(configDir, workflowsUnderSubagents, runDir)).filter(isMeta).length;
|
|
111915
|
+
}
|
|
111916
|
+
}
|
|
111917
|
+
const workflowRunCount = fs22.readdir(import_node_path32.default.join(configDir, sessionRelative, WORKFLOWS_DIR)).filter((name) => name.startsWith(WORKFLOW_RUN_PREFIX) && name.endsWith(JSON_SUFFIX)).length;
|
|
111918
|
+
const transcript = fs22.lstat(import_node_path32.default.join(configDir, PROJECTS_DIR, ref.project, `${ref.entry}${TRANSCRIPT_SUFFIX}`));
|
|
111919
|
+
return { ...ref, agentCount, workflowRunCount, ...transcript === void 0 ? {} : { updatedAt: new Date(transcript.mtimeMs).toISOString() } };
|
|
111920
|
+
}
|
|
111921
|
+
function readSessionAgentTree(fs22, configDir, ref, options = {}) {
|
|
111922
|
+
const problems = [];
|
|
111923
|
+
const report = (problem) => {
|
|
111924
|
+
problems.push(problem);
|
|
111925
|
+
};
|
|
111926
|
+
const sessionRelative = import_node_path32.default.join(PROJECTS_DIR, ref.project, ref.entry);
|
|
111927
|
+
const subagentsRelative = import_node_path32.default.join(sessionRelative, SUBAGENTS_DIR);
|
|
111928
|
+
const workflowsUnderSubagents = import_node_path32.default.join(subagentsRelative, WORKFLOWS_DIR);
|
|
111929
|
+
const located = locateAgents(fs22, configDir, subagentsRelative, void 0, report);
|
|
111930
|
+
for (const runDir of listDirOrReport(fs22, configDir, workflowsUnderSubagents, report)) {
|
|
111931
|
+
if (runDir.startsWith(WORKFLOW_RUN_PREFIX)) {
|
|
111932
|
+
located.push(...locateAgents(fs22, configDir, import_node_path32.default.join(workflowsUnderSubagents, runDir), runDir, report));
|
|
111933
|
+
}
|
|
111934
|
+
}
|
|
111935
|
+
const agents = /* @__PURE__ */ new Map();
|
|
111936
|
+
for (const candidate of located) {
|
|
111937
|
+
const text2 = readFileOrReport(fs22, configDir, candidate.metaPath, report);
|
|
111938
|
+
if (text2 === void 0) {
|
|
111939
|
+
continue;
|
|
111940
|
+
}
|
|
111941
|
+
const parsed = AgentMetaSchema.safeParse(parseJson3(text2));
|
|
111942
|
+
if (!parsed.success) {
|
|
111943
|
+
report({ path: candidate.metaPath, reason: "meta file is not a JSON object with an agentType" });
|
|
111944
|
+
continue;
|
|
111945
|
+
}
|
|
111946
|
+
agents.set(candidate.id, { located: candidate, meta: parsed.data });
|
|
111947
|
+
}
|
|
111948
|
+
const teamNames = [...new Set([...agents.values()].flatMap((agent) => agent.meta.teamName === void 0 ? [] : [agent.meta.teamName]))].sort();
|
|
111949
|
+
const parentOf4 = resolveParents(fs22, configDir, agents, report);
|
|
111950
|
+
const childrenOf = /* @__PURE__ */ new Map();
|
|
111951
|
+
const roots = [];
|
|
111952
|
+
for (const id2 of agents.keys()) {
|
|
111953
|
+
const parent = parentOf4.get(id2);
|
|
111954
|
+
if (parent === void 0) {
|
|
111955
|
+
roots.push(id2);
|
|
111956
|
+
} else {
|
|
111957
|
+
childrenOf.set(parent, [...childrenOf.get(parent) ?? [], id2]);
|
|
111958
|
+
}
|
|
111959
|
+
}
|
|
111960
|
+
const build = (id2) => {
|
|
111961
|
+
const read = agents.get(id2);
|
|
111962
|
+
if (read === void 0) {
|
|
111963
|
+
throw new Error(`agent ${id2} is in the tree but was never read`);
|
|
111964
|
+
}
|
|
111965
|
+
return toNode(read, (childrenOf.get(id2) ?? []).sort().map(build));
|
|
111966
|
+
};
|
|
111967
|
+
return {
|
|
111968
|
+
project: ref.project,
|
|
111969
|
+
sessionId: ref.sessionId,
|
|
111970
|
+
superseded: ref.superseded,
|
|
111971
|
+
agents: roots.sort().map(build),
|
|
111972
|
+
tasks: readTasks(fs22, configDir, ownTaskLists(ref.sessionId), [.../* @__PURE__ */ new Set([...teamNames, ...options.taskListIds ?? []])].filter((id2) => !ownTaskLists(ref.sessionId).includes(id2)), report),
|
|
111973
|
+
workflowRuns: readWorkflowRuns(fs22, configDir, import_node_path32.default.join(sessionRelative, WORKFLOWS_DIR), report),
|
|
111974
|
+
problems
|
|
111975
|
+
};
|
|
111976
|
+
}
|
|
111977
|
+
function resolveParents(fs22, configDir, agents, report) {
|
|
111978
|
+
const parentOf4 = /* @__PURE__ */ new Map();
|
|
111979
|
+
const transcriptCache = /* @__PURE__ */ new Map();
|
|
111980
|
+
const transcriptOf = (agent) => {
|
|
111981
|
+
const cached2 = transcriptCache.get(agent.located.id);
|
|
111982
|
+
if (cached2 !== void 0) {
|
|
111983
|
+
return cached2;
|
|
111984
|
+
}
|
|
111985
|
+
const text2 = readFileOrReport(fs22, configDir, agent.located.transcriptPath, report) ?? "";
|
|
111986
|
+
transcriptCache.set(agent.located.id, text2);
|
|
111987
|
+
return text2;
|
|
111988
|
+
};
|
|
111989
|
+
const wouldCycle = (child, parent) => {
|
|
111990
|
+
for (let cursor3 = parent; cursor3 !== void 0; cursor3 = parentOf4.get(cursor3)) {
|
|
111991
|
+
if (cursor3 === child) {
|
|
111992
|
+
return true;
|
|
111993
|
+
}
|
|
111994
|
+
}
|
|
111995
|
+
return false;
|
|
111996
|
+
};
|
|
111997
|
+
const attach = (child, parent) => {
|
|
111998
|
+
if (wouldCycle(child.located.id, parent)) {
|
|
111999
|
+
report({ path: child.located.metaPath, reason: `parent ${parent} would make a cycle` });
|
|
112000
|
+
return;
|
|
112001
|
+
}
|
|
112002
|
+
parentOf4.set(child.located.id, parent);
|
|
112003
|
+
};
|
|
112004
|
+
for (const agent of agents.values()) {
|
|
112005
|
+
const { meta: meta3, located } = agent;
|
|
112006
|
+
if (meta3.parentAgentId !== void 0 && agents.has(meta3.parentAgentId)) {
|
|
112007
|
+
attach(agent, meta3.parentAgentId);
|
|
112008
|
+
continue;
|
|
112009
|
+
}
|
|
112010
|
+
const depth = meta3.spawnDepth;
|
|
112011
|
+
if (depth !== void 0 && depth <= SESSION_SPAWN_DEPTH || meta3.toolUseId === void 0) {
|
|
112012
|
+
if (meta3.parentAgentId !== void 0) {
|
|
112013
|
+
report({ path: located.metaPath, reason: `parentAgentId ${meta3.parentAgentId} names no agent in this session` });
|
|
112014
|
+
}
|
|
112015
|
+
continue;
|
|
112016
|
+
}
|
|
112017
|
+
const toolUseId = meta3.toolUseId;
|
|
112018
|
+
const owners = [...agents.values()].filter(
|
|
112019
|
+
(candidate) => candidate.located.id !== located.id && (depth === void 0 || candidate.meta.spawnDepth === void 0 || candidate.meta.spawnDepth === depth - 1) && candidate.located.workflowRunId === located.workflowRunId && transcriptOf(candidate).includes(toolUseId)
|
|
112020
|
+
);
|
|
112021
|
+
const owner = owners[0];
|
|
112022
|
+
if (owners.length === 1 && owner !== void 0) {
|
|
112023
|
+
attach(agent, owner.located.id);
|
|
112024
|
+
} else if (owners.length > 1) {
|
|
112025
|
+
report({ path: located.metaPath, reason: "more than one agent transcript records the call that spawned it" });
|
|
112026
|
+
} else if (depth !== void 0) {
|
|
112027
|
+
report({ path: located.metaPath, reason: "no agent transcript records the call that spawned it" });
|
|
112028
|
+
}
|
|
112029
|
+
}
|
|
112030
|
+
return parentOf4;
|
|
112031
|
+
}
|
|
112032
|
+
function ownTaskLists(sessionId) {
|
|
112033
|
+
return [sessionId, `${SHORT_SESSION_LIST_PREFIX}${sessionId.slice(0, SHORT_SESSION_ID_LENGTH)}`];
|
|
112034
|
+
}
|
|
112035
|
+
function readTasks(fs22, configDir, ownLists, sharedLists, report) {
|
|
112036
|
+
const tasks = [];
|
|
112037
|
+
[...ownLists, ...sharedLists].forEach((scope, index) => {
|
|
112038
|
+
const relativeDir = import_node_path32.default.join(TASKS_DIR, scope);
|
|
112039
|
+
for (const name of [...listDirOrReport(fs22, configDir, relativeDir, report)].sort()) {
|
|
112040
|
+
if (name.startsWith(".") || !name.endsWith(JSON_SUFFIX)) {
|
|
112041
|
+
continue;
|
|
112042
|
+
}
|
|
112043
|
+
const relative = import_node_path32.default.join(relativeDir, name);
|
|
112044
|
+
const text2 = readFileOrReport(fs22, configDir, relative, report);
|
|
112045
|
+
const parsed = TaskFileSchema.safeParse(text2 === void 0 ? void 0 : parseJson3(text2));
|
|
112046
|
+
if (parsed.success) {
|
|
112047
|
+
tasks.push(index < ownLists.length ? parsed.data : { ...parsed.data, taskList: scope });
|
|
112048
|
+
} else if (text2 !== void 0) {
|
|
112049
|
+
report({ path: relative, reason: "task file is not a task" });
|
|
112050
|
+
}
|
|
112051
|
+
}
|
|
112052
|
+
});
|
|
112053
|
+
return tasks;
|
|
112054
|
+
}
|
|
112055
|
+
function readWorkflowRuns(fs22, configDir, relativeDir, report) {
|
|
112056
|
+
const runs = [];
|
|
112057
|
+
for (const name of [...listDirOrReport(fs22, configDir, relativeDir, report)].sort()) {
|
|
112058
|
+
if (!name.startsWith(WORKFLOW_RUN_PREFIX) || !name.endsWith(JSON_SUFFIX)) {
|
|
112059
|
+
continue;
|
|
112060
|
+
}
|
|
112061
|
+
const relative = import_node_path32.default.join(relativeDir, name);
|
|
112062
|
+
const text2 = readFileOrReport(fs22, configDir, relative, report);
|
|
112063
|
+
const parsed = WorkflowRunFileSchema.safeParse(text2 === void 0 ? void 0 : parseJson3(text2));
|
|
112064
|
+
if (!parsed.success) {
|
|
112065
|
+
if (text2 !== void 0) {
|
|
112066
|
+
report({ path: relative, reason: "workflow run file is not a run record" });
|
|
112067
|
+
}
|
|
112068
|
+
continue;
|
|
112069
|
+
}
|
|
112070
|
+
const { phases, ...rest } = parsed.data;
|
|
112071
|
+
runs.push({ ...rest, phases: phases.map((phase) => phase.title) });
|
|
112072
|
+
}
|
|
112073
|
+
return runs;
|
|
112074
|
+
}
|
|
112075
|
+
|
|
112076
|
+
// src/agents/sessions.ts
|
|
112077
|
+
var SessionLookupError = class extends CliError {
|
|
112078
|
+
constructor(message) {
|
|
112079
|
+
super(message);
|
|
112080
|
+
this.name = "SessionLookupError";
|
|
112081
|
+
}
|
|
112082
|
+
};
|
|
112083
|
+
function identityConfigDir(identitiesDir, identity) {
|
|
112084
|
+
return import_node_path33.default.join(identitiesDir, identity);
|
|
112085
|
+
}
|
|
112086
|
+
function historyStores(fs22, identitiesDir, identities) {
|
|
112087
|
+
const byRealPath = /* @__PURE__ */ new Map();
|
|
112088
|
+
for (const identity of identities) {
|
|
112089
|
+
const configDir = identityConfigDir(identitiesDir, identity);
|
|
112090
|
+
const real = fs22.realpath(import_node_path33.default.join(configDir, "projects"));
|
|
112091
|
+
if (real === void 0) {
|
|
112092
|
+
continue;
|
|
112093
|
+
}
|
|
112094
|
+
const store = byRealPath.get(real);
|
|
112095
|
+
if (store === void 0) {
|
|
112096
|
+
byRealPath.set(real, { configDir, identities: [identity] });
|
|
112097
|
+
} else {
|
|
112098
|
+
store.identities.push(identity);
|
|
112099
|
+
}
|
|
112100
|
+
}
|
|
112101
|
+
return [...byRealPath.values()];
|
|
112102
|
+
}
|
|
112103
|
+
function collectSessionList(fs22, identitiesDir, identities, filters) {
|
|
112104
|
+
const names = filters.identity === void 0 ? identities : identities.filter((name) => name === filters.identity);
|
|
112105
|
+
if (filters.identity !== void 0 && names.length === 0) {
|
|
112106
|
+
throw new SessionLookupError(`no identity named "${filters.identity}"`);
|
|
112107
|
+
}
|
|
112108
|
+
const sessions = [];
|
|
112109
|
+
for (const store of historyStores(fs22, identitiesDir, names)) {
|
|
112110
|
+
for (const ref of listSessions2(fs22, store.configDir)) {
|
|
112111
|
+
const summary = summariseSession(fs22, store.configDir, ref);
|
|
112112
|
+
if (filters.all === true || summary.agentCount > 0 || summary.workflowRunCount > 0) {
|
|
112113
|
+
sessions.push({ ...summary, identities: store.identities });
|
|
112114
|
+
}
|
|
112115
|
+
}
|
|
112116
|
+
}
|
|
112117
|
+
return sessions.sort((left, right) => (right.updatedAt ?? "").localeCompare(left.updatedAt ?? "") || left.sessionId.localeCompare(right.sessionId));
|
|
112118
|
+
}
|
|
112119
|
+
function locateSession(fs22, identitiesDir, identities, query, onlyIdentity) {
|
|
112120
|
+
const names = onlyIdentity === void 0 ? identities : identities.filter((name) => name === onlyIdentity);
|
|
112121
|
+
if (onlyIdentity !== void 0 && names.length === 0) {
|
|
112122
|
+
throw new SessionLookupError(`no identity named "${onlyIdentity}"`);
|
|
112123
|
+
}
|
|
112124
|
+
const matches = [];
|
|
112125
|
+
for (const store of historyStores(fs22, identitiesDir, names)) {
|
|
112126
|
+
for (const ref of listSessions2(fs22, store.configDir)) {
|
|
112127
|
+
if (ref.sessionId.startsWith(query)) {
|
|
112128
|
+
matches.push({ identities: store.identities, configDir: store.configDir, ref });
|
|
112129
|
+
}
|
|
112130
|
+
}
|
|
112131
|
+
}
|
|
112132
|
+
const exact = matches.filter((match) => match.ref.sessionId === query);
|
|
112133
|
+
const candidates = exact.length > 0 ? exact : matches;
|
|
112134
|
+
const only = candidates[0];
|
|
112135
|
+
if (candidates.length === 1 && only !== void 0) {
|
|
112136
|
+
return only;
|
|
112137
|
+
}
|
|
112138
|
+
if (candidates.length === 0) {
|
|
112139
|
+
throw new SessionLookupError(`no session matches "${query}"`);
|
|
112140
|
+
}
|
|
112141
|
+
throw new SessionLookupError(`"${query}" matches ${String(candidates.length)} sessions: ${candidates.map((match) => `${match.ref.sessionId} (${match.identities.join(", ")})`).join("; ")}; give more of the id or pass --identity`);
|
|
112142
|
+
}
|
|
112143
|
+
function showSession(fs22, identitiesDir, identities, query, onlyIdentity) {
|
|
112144
|
+
const located = locateSession(fs22, identitiesDir, identities, query, onlyIdentity);
|
|
112145
|
+
return { identities: located.identities, tree: readSessionAgentTree(fs22, located.configDir, located.ref) };
|
|
112146
|
+
}
|
|
112147
|
+
|
|
112148
|
+
// src/frontdoor/commands.ts
|
|
111652
112149
|
init_realPorts();
|
|
111653
112150
|
|
|
111654
112151
|
// src/update/commands.ts
|
|
111655
|
-
var
|
|
112152
|
+
var import_node_fs14 = __toESM(require("node:fs"), 1);
|
|
111656
112153
|
var import_node_os7 = __toESM(require("node:os"), 1);
|
|
111657
|
-
var
|
|
112154
|
+
var import_node_path36 = __toESM(require("node:path"), 1);
|
|
111658
112155
|
init_package();
|
|
111659
112156
|
init_commandDeps();
|
|
111660
112157
|
init_store();
|
|
@@ -111686,10 +112183,10 @@ var realUpdatePorts = {
|
|
|
111686
112183
|
}
|
|
111687
112184
|
},
|
|
111688
112185
|
fs: {
|
|
111689
|
-
realpath: (target) =>
|
|
112186
|
+
realpath: (target) => import_node_fs14.default.realpathSync(target),
|
|
111690
112187
|
readFileUtf8: (filePath) => {
|
|
111691
112188
|
try {
|
|
111692
|
-
return
|
|
112189
|
+
return import_node_fs14.default.readFileSync(filePath, "utf8");
|
|
111693
112190
|
} catch (error63) {
|
|
111694
112191
|
if (isEnoent5(error63)) {
|
|
111695
112192
|
return void 0;
|
|
@@ -111699,7 +112196,7 @@ var realUpdatePorts = {
|
|
|
111699
112196
|
},
|
|
111700
112197
|
readFileBytes: (filePath) => {
|
|
111701
112198
|
try {
|
|
111702
|
-
return new Uint8Array(
|
|
112199
|
+
return new Uint8Array(import_node_fs14.default.readFileSync(filePath));
|
|
111703
112200
|
} catch (error63) {
|
|
111704
112201
|
if (isEnoent5(error63)) {
|
|
111705
112202
|
return void 0;
|
|
@@ -111710,7 +112207,7 @@ var realUpdatePorts = {
|
|
|
111710
112207
|
readFileHead: (filePath, length) => {
|
|
111711
112208
|
let descriptor;
|
|
111712
112209
|
try {
|
|
111713
|
-
descriptor =
|
|
112210
|
+
descriptor = import_node_fs14.default.openSync(filePath, "r");
|
|
111714
112211
|
} catch (error63) {
|
|
111715
112212
|
if (isEnoent5(error63)) {
|
|
111716
112213
|
return void 0;
|
|
@@ -111719,21 +112216,21 @@ var realUpdatePorts = {
|
|
|
111719
112216
|
}
|
|
111720
112217
|
try {
|
|
111721
112218
|
const buffer2 = Buffer.alloc(length);
|
|
111722
|
-
const read =
|
|
112219
|
+
const read = import_node_fs14.default.readSync(descriptor, buffer2, 0, length, 0);
|
|
111723
112220
|
return read === 0 ? "" : buffer2.toString("latin1", 0, read);
|
|
111724
112221
|
} finally {
|
|
111725
|
-
|
|
112222
|
+
import_node_fs14.default.closeSync(descriptor);
|
|
111726
112223
|
}
|
|
111727
112224
|
},
|
|
111728
112225
|
writeFileUtf8: (filePath, contents) => {
|
|
111729
|
-
|
|
112226
|
+
import_node_fs14.default.writeFileSync(filePath, contents, "utf8");
|
|
111730
112227
|
},
|
|
111731
112228
|
writeFileBytes: (filePath, contents) => {
|
|
111732
|
-
|
|
112229
|
+
import_node_fs14.default.writeFileSync(filePath, contents);
|
|
111733
112230
|
},
|
|
111734
112231
|
writeFileExclusive: (filePath, contents) => {
|
|
111735
112232
|
try {
|
|
111736
|
-
|
|
112233
|
+
import_node_fs14.default.writeFileSync(filePath, contents, { encoding: "utf8", flag: "wx" });
|
|
111737
112234
|
return true;
|
|
111738
112235
|
} catch (error63) {
|
|
111739
112236
|
if (isErrorWithCode2(error63, "EEXIST")) {
|
|
@@ -111744,7 +112241,7 @@ var realUpdatePorts = {
|
|
|
111744
112241
|
},
|
|
111745
112242
|
unlink: (filePath) => {
|
|
111746
112243
|
try {
|
|
111747
|
-
|
|
112244
|
+
import_node_fs14.default.unlinkSync(filePath);
|
|
111748
112245
|
} catch (error63) {
|
|
111749
112246
|
if (!isEnoent5(error63)) {
|
|
111750
112247
|
throw error63;
|
|
@@ -111752,14 +112249,14 @@ var realUpdatePorts = {
|
|
|
111752
112249
|
}
|
|
111753
112250
|
},
|
|
111754
112251
|
rename: (from, to2) => {
|
|
111755
|
-
|
|
112252
|
+
import_node_fs14.default.renameSync(from, to2);
|
|
111756
112253
|
},
|
|
111757
112254
|
chmod: (filePath, mode) => {
|
|
111758
|
-
|
|
112255
|
+
import_node_fs14.default.chmodSync(filePath, mode);
|
|
111759
112256
|
},
|
|
111760
|
-
mkdtemp: () =>
|
|
112257
|
+
mkdtemp: () => import_node_fs14.default.mkdtempSync(import_node_path36.default.join(import_node_os7.default.tmpdir(), "agent-shim-update-")),
|
|
111761
112258
|
rmRecursive: (targetPath) => {
|
|
111762
|
-
|
|
112259
|
+
import_node_fs14.default.rmSync(targetPath, { recursive: true, force: true });
|
|
111763
112260
|
}
|
|
111764
112261
|
},
|
|
111765
112262
|
// Signal 0 performs the permission and existence checks without delivering anything; EPERM means the process exists but belongs to another user.
|
|
@@ -111778,7 +112275,7 @@ function selfUpdateOptions(paths, checkOnly) {
|
|
|
111778
112275
|
platform: process.platform,
|
|
111779
112276
|
arch: process.arch,
|
|
111780
112277
|
executablePath: realOwnExecutablePath(),
|
|
111781
|
-
lockPath:
|
|
112278
|
+
lockPath: import_node_path36.default.join(paths.root, "update.lock"),
|
|
111782
112279
|
checkOnly,
|
|
111783
112280
|
pid: process.pid
|
|
111784
112281
|
};
|
|
@@ -111919,7 +112416,7 @@ init_poolPick();
|
|
|
111919
112416
|
init_realAnthropicUsageProbe();
|
|
111920
112417
|
|
|
111921
112418
|
// src/usage/realJobRunner.ts
|
|
111922
|
-
var
|
|
112419
|
+
var import_node_path40 = __toESM(require("node:path"), 1);
|
|
111923
112420
|
init_conditions();
|
|
111924
112421
|
init_identityClaude();
|
|
111925
112422
|
|
|
@@ -111945,7 +112442,7 @@ ${outcome.trimEnd()}
|
|
|
111945
112442
|
}
|
|
111946
112443
|
function createRealJobRunner(params) {
|
|
111947
112444
|
return async (name, identity, job) => {
|
|
111948
|
-
const logFile =
|
|
112445
|
+
const logFile = import_node_path40.default.join(params.paths.jobLogsDir, `${name}.log`);
|
|
111949
112446
|
const append = (outcome) => {
|
|
111950
112447
|
params.fs.mkdirPrivate(params.paths.jobLogsDir);
|
|
111951
112448
|
params.fs.appendFilePrivate(logFile, logEntry(name, identity, params.now(), outcome));
|
|
@@ -112035,7 +112532,7 @@ function createRealWindowOpener(params) {
|
|
|
112035
112532
|
init_conditions();
|
|
112036
112533
|
|
|
112037
112534
|
// src/usage/handledStamps.ts
|
|
112038
|
-
var
|
|
112535
|
+
var import_node_path41 = __toESM(require("node:path"), 1);
|
|
112039
112536
|
init_zod();
|
|
112040
112537
|
var STAMPS_SCHEMA_VERSION = 1;
|
|
112041
112538
|
var StampsFileSchema = external_exports.strictObject({
|
|
@@ -112058,7 +112555,7 @@ function readHandled(fs22, file2) {
|
|
|
112058
112555
|
}
|
|
112059
112556
|
function writeHandled(fs22, file2, handled) {
|
|
112060
112557
|
const next = { schemaVersion: STAMPS_SCHEMA_VERSION, handled: Object.fromEntries(Object.entries(handled).map(([key, at2]) => [key, new Date(at2).toISOString()])) };
|
|
112061
|
-
fs22.mkdirPrivate(
|
|
112558
|
+
fs22.mkdirPrivate(import_node_path41.default.dirname(file2));
|
|
112062
112559
|
fs22.writeFilePrivate(file2, `${JSON.stringify(next, null, 2)}
|
|
112063
112560
|
`);
|
|
112064
112561
|
}
|
|
@@ -112349,7 +112846,7 @@ init_capability();
|
|
|
112349
112846
|
|
|
112350
112847
|
// src/frontdoor/capture.ts
|
|
112351
112848
|
var fs15 = __toESM(require("node:fs"), 1);
|
|
112352
|
-
var
|
|
112849
|
+
var path41 = __toESM(require("node:path"), 1);
|
|
112353
112850
|
var SECRET_HEADER_NAME = /authorization|cookie|token|secret|credential|api[-_]key/i;
|
|
112354
112851
|
var SECRET_JSON_KEY = /token|secret|password|credential|authorization|api[-_]key/i;
|
|
112355
112852
|
var SECRET_BODY_PATTERNS = [
|
|
@@ -112393,10 +112890,10 @@ function redactBody(chunk) {
|
|
|
112393
112890
|
}
|
|
112394
112891
|
var CAPTURE_ENV = "AGENT_SHIM_FRONTDOOR_CAPTURE";
|
|
112395
112892
|
function captureFromEnv(env, logsDir) {
|
|
112396
|
-
return env[CAPTURE_ENV] === "1" ? createFileCapture(
|
|
112893
|
+
return env[CAPTURE_ENV] === "1" ? createFileCapture(path41.join(logsDir, "frontdoor-capture.jsonl")) : void 0;
|
|
112397
112894
|
}
|
|
112398
112895
|
function createFileCapture(file2, now = () => /* @__PURE__ */ new Date()) {
|
|
112399
|
-
fs15.mkdirSync(
|
|
112896
|
+
fs15.mkdirSync(path41.dirname(file2), { recursive: true });
|
|
112400
112897
|
let nextId = 0;
|
|
112401
112898
|
const append = (record2) => {
|
|
112402
112899
|
fs15.appendFileSync(file2, `${JSON.stringify({ ts: now().toISOString(), ...record2 })}
|
|
@@ -112815,14 +113312,14 @@ init_capability();
|
|
|
112815
113312
|
init_route();
|
|
112816
113313
|
|
|
112817
113314
|
// src/frontdoor/supervisor.ts
|
|
112818
|
-
var
|
|
113315
|
+
var import_node_path42 = __toESM(require("node:path"), 1);
|
|
112819
113316
|
init_state2();
|
|
112820
113317
|
function watchedInstallEntry(resolvedOwnExecutablePath, siblingExists) {
|
|
112821
|
-
const parsed =
|
|
113318
|
+
const parsed = import_node_path42.default.parse(resolvedOwnExecutablePath);
|
|
112822
113319
|
if (parsed.name === "agent-shim") {
|
|
112823
113320
|
return resolvedOwnExecutablePath;
|
|
112824
113321
|
}
|
|
112825
|
-
const sibling =
|
|
113322
|
+
const sibling = import_node_path42.default.join(parsed.dir, `agent-shim${parsed.ext}`);
|
|
112826
113323
|
return siblingExists(sibling) ? sibling : resolvedOwnExecutablePath;
|
|
112827
113324
|
}
|
|
112828
113325
|
var FRONTDOOR_SUPERVISOR_STILL_RUNNING = -1;
|
|
@@ -115229,11 +115726,11 @@ function realConnectEffects(ports = DOOR_SOURCE_PORTS) {
|
|
|
115229
115726
|
init_claudeShim();
|
|
115230
115727
|
init_store();
|
|
115231
115728
|
init_realPorts();
|
|
115232
|
-
var
|
|
115233
|
-
var
|
|
115729
|
+
var import_node_fs16 = __toESM(require("node:fs"), 1);
|
|
115730
|
+
var import_node_path44 = __toESM(require("node:path"), 1);
|
|
115234
115731
|
|
|
115235
115732
|
// src/usage/signIn.ts
|
|
115236
|
-
var
|
|
115733
|
+
var import_node_path43 = __toESM(require("node:path"), 1);
|
|
115237
115734
|
var CREDENTIALS_FILE = ".credentials.json";
|
|
115238
115735
|
function keychainHasItem(run, account) {
|
|
115239
115736
|
return run.run("security", ["find-generic-password", "-a", account]).status === 0;
|
|
@@ -115251,7 +115748,7 @@ function decideSignIn(facts) {
|
|
|
115251
115748
|
return { state: "signed-out", detail: facts.platform === "darwin" ? `no Keychain item and no ${CREDENTIALS_FILE}` : `no ${CREDENTIALS_FILE}` };
|
|
115252
115749
|
}
|
|
115253
115750
|
function credentialsFilePath(farmRoot) {
|
|
115254
|
-
return
|
|
115751
|
+
return import_node_path43.default.join(farmRoot, CREDENTIALS_FILE);
|
|
115255
115752
|
}
|
|
115256
115753
|
function identitySignIn(fs22, probe, identity) {
|
|
115257
115754
|
const probing = !identity.hasCredentialBlock;
|
|
@@ -115377,7 +115874,7 @@ function tcpPortEraRecord(raw) {
|
|
|
115377
115874
|
return (has("port") || has("lastPort")) && !has("socketPath");
|
|
115378
115875
|
}
|
|
115379
115876
|
function pushPathResolution(push, resolution) {
|
|
115380
|
-
const ownDir =
|
|
115877
|
+
const ownDir = import_node_path44.default.dirname(resolution.ownExecutablePath);
|
|
115381
115878
|
switch (resolution.agentShim.status) {
|
|
115382
115879
|
case "ok":
|
|
115383
115880
|
push("path-resolution", "pass", `\`agent-shim\` on PATH resolves to this running executable, ${resolution.ownExecutablePath}.`, "agent-shim");
|
|
@@ -115476,14 +115973,14 @@ function pushProvider(push, entry, cacheEnv, signIn) {
|
|
|
115476
115973
|
}
|
|
115477
115974
|
function pushLegacyName(push, params) {
|
|
115478
115975
|
const legacyVariables = Object.keys(params.env).filter((name) => name.startsWith(LEGACY_ENV_PREFIX) && params.env[name] !== void 0).sort();
|
|
115479
|
-
if (legacyVariables.length === 0 &&
|
|
115976
|
+
if (legacyVariables.length === 0 && import_node_path44.default.basename(params.rootPath) !== LEGACY_HOME_DIRNAME) {
|
|
115480
115977
|
push("legacy-name", "pass", "Nothing here still uses the former `claude-use` name.");
|
|
115481
115978
|
return;
|
|
115482
115979
|
}
|
|
115483
115980
|
for (const name of legacyVariables) {
|
|
115484
115981
|
push("legacy-name", "warn", `${name} is the former name of ${name.replace(LEGACY_ENV_PREFIX, ENV_PREFIX)}. Rename it; the old name still works but is only a fallback.`, name);
|
|
115485
115982
|
}
|
|
115486
|
-
if (
|
|
115983
|
+
if (import_node_path44.default.basename(params.rootPath) === LEGACY_HOME_DIRNAME) {
|
|
115487
115984
|
push(
|
|
115488
115985
|
"legacy-name",
|
|
115489
115986
|
"warn",
|
|
@@ -115847,27 +116344,27 @@ function formatDoctorReport(report) {
|
|
|
115847
116344
|
}
|
|
115848
116345
|
function realpathOrSelf(target) {
|
|
115849
116346
|
try {
|
|
115850
|
-
return
|
|
116347
|
+
return import_node_fs16.default.realpathSync(target);
|
|
115851
116348
|
} catch {
|
|
115852
116349
|
return target;
|
|
115853
116350
|
}
|
|
115854
116351
|
}
|
|
115855
116352
|
function collectDoctorReport(params) {
|
|
115856
116353
|
const { paths } = params;
|
|
115857
|
-
const identityNames =
|
|
116354
|
+
const identityNames = import_node_fs16.default.existsSync(paths.identitiesDir) ? import_node_fs16.default.readdirSync(paths.identitiesDir, { withFileTypes: true }).filter((entry) => entry.isDirectory() && isIdentityDirectoryName(entry.name)).map((entry) => entry.name).sort() : [];
|
|
115858
116355
|
const identities = identityNames.map((name) => {
|
|
115859
|
-
const farmRoot =
|
|
115860
|
-
const identityPath =
|
|
115861
|
-
return { name, path: identityPath, raw: realFsPort.readFileUtf8(identityPath), farmRoot, credentialsFilePresent:
|
|
116356
|
+
const farmRoot = import_node_path44.default.join(paths.identitiesDir, name);
|
|
116357
|
+
const identityPath = import_node_path44.default.join(farmRoot, "identity.json");
|
|
116358
|
+
return { name, path: identityPath, raw: realFsPort.readFileUtf8(identityPath), farmRoot, credentialsFilePresent: import_node_fs16.default.existsSync(credentialsFilePath(farmRoot)) };
|
|
115862
116359
|
});
|
|
115863
|
-
const profileNames =
|
|
116360
|
+
const profileNames = import_node_fs16.default.existsSync(paths.configProfilesDir) ? import_node_fs16.default.readdirSync(paths.configProfilesDir, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => entry.name.slice(0, -".json".length)).sort() : [];
|
|
115864
116361
|
const configProfiles = profileNames.map((name) => {
|
|
115865
|
-
const profilePath =
|
|
116362
|
+
const profilePath = import_node_path44.default.join(paths.configProfilesDir, `${name}.json`);
|
|
115866
116363
|
return { name, path: profilePath, raw: realFsPort.readFileUtf8(profilePath) };
|
|
115867
116364
|
});
|
|
115868
|
-
const providerNames =
|
|
116365
|
+
const providerNames = import_node_fs16.default.existsSync(paths.providersDir) ? import_node_fs16.default.readdirSync(paths.providersDir, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => entry.name.slice(0, -".json".length)).sort() : [];
|
|
115869
116366
|
const providers = providerNames.map((name) => {
|
|
115870
|
-
const providerPath =
|
|
116367
|
+
const providerPath = import_node_path44.default.join(paths.providersDir, `${name}.json`);
|
|
115871
116368
|
return { name, path: providerPath, raw: realFsPort.readFileUtf8(providerPath) };
|
|
115872
116369
|
});
|
|
115873
116370
|
const ownExecutablePath = realOwnExecutablePath();
|
|
@@ -115879,12 +116376,12 @@ function collectDoctorReport(params) {
|
|
|
115879
116376
|
binaryDiscovery = { ok: false, message: error63 instanceof Error ? error63.message : String(error63) };
|
|
115880
116377
|
}
|
|
115881
116378
|
const shimState = readJson(paths.claudeShimFile, ClaudeShimStateSchema);
|
|
115882
|
-
const pathDirs = (params.env.PATH ?? "").split(
|
|
116379
|
+
const pathDirs = (params.env.PATH ?? "").split(import_node_path44.default.delimiter).filter((dir) => dir !== "");
|
|
115883
116380
|
const claudeShimShadow = shimState === void 0 ? void 0 : refinePathShadow(
|
|
115884
116381
|
findPathShadow({
|
|
115885
116382
|
pathDirs,
|
|
115886
|
-
targetDir:
|
|
115887
|
-
targetFilename:
|
|
116383
|
+
targetDir: import_node_path44.default.dirname(shimState.targetPath),
|
|
116384
|
+
targetFilename: import_node_path44.default.basename(shimState.targetPath),
|
|
115888
116385
|
findExecutableInDir
|
|
115889
116386
|
}),
|
|
115890
116387
|
shimState.targetPath,
|
|
@@ -115906,14 +116403,14 @@ function collectDoctorReport(params) {
|
|
|
115906
116403
|
categoriesLocal: { path: paths.categoriesLocalFile, raw: realFsPort.readFileUtf8(paths.categoriesLocalFile) },
|
|
115907
116404
|
activeIdentity: { path: paths.activeIdentityFile, raw: realFsPort.readFileUtf8(paths.activeIdentityFile) },
|
|
115908
116405
|
binaryDiscovery,
|
|
115909
|
-
claudeShim: { state: shimState, targetExists: shimState !== void 0 &&
|
|
116406
|
+
claudeShim: { state: shimState, targetExists: shimState !== void 0 && import_node_fs16.default.existsSync(shimState.targetPath) },
|
|
115910
116407
|
rootPath: paths.root,
|
|
115911
116408
|
pathResolution: {
|
|
115912
116409
|
ownExecutablePath,
|
|
115913
116410
|
agentShim: refinePathShadow(
|
|
115914
116411
|
findPathShadow({
|
|
115915
116412
|
pathDirs,
|
|
115916
|
-
targetDir:
|
|
116413
|
+
targetDir: import_node_path44.default.dirname(ownExecutablePath),
|
|
115917
116414
|
targetFilename: commandFilename(ownExecutablePath, "agent-shim"),
|
|
115918
116415
|
findExecutableInDir
|
|
115919
116416
|
}),
|
|
@@ -121440,7 +121937,7 @@ var ResetRowSchema = external_exports.strictObject({
|
|
|
121440
121937
|
var ResetScheduleSchema = external_exports.strictObject({ resets: external_exports.readonly(external_exports.array(ResetRowSchema)) });
|
|
121441
121938
|
|
|
121442
121939
|
// src/frontdoor/controlSchemas.ts
|
|
121443
|
-
var
|
|
121940
|
+
var import_node_path45 = __toESM(require("node:path"), 1);
|
|
121444
121941
|
init_zod();
|
|
121445
121942
|
init_schema2();
|
|
121446
121943
|
|
|
@@ -121652,11 +122149,11 @@ var FrontDoorSessionsOutputSchema = external_exports.strictObject({ sessions: ex
|
|
|
121652
122149
|
var CheckRunInputSchema = external_exports.strictObject({
|
|
121653
122150
|
path: external_exports.string().min(1),
|
|
121654
122151
|
identity: external_exports.string().min(1).optional()
|
|
121655
|
-
}).refine((input2) =>
|
|
122152
|
+
}).refine((input2) => import_node_path45.default.isAbsolute(input2.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
|
|
121656
122153
|
var PoolPickInputSchema = external_exports.strictObject({
|
|
121657
122154
|
pool: external_exports.string().min(1),
|
|
121658
122155
|
path: external_exports.string().min(1)
|
|
121659
|
-
}).refine((input2) =>
|
|
122156
|
+
}).refine((input2) => import_node_path45.default.isAbsolute(input2.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
|
|
121660
122157
|
var DoctorFindingSchema = external_exports.strictObject({
|
|
121661
122158
|
section: external_exports.enum(DOCTOR_SECTIONS),
|
|
121662
122159
|
subject: external_exports.string().optional(),
|
|
@@ -123732,6 +124229,7 @@ var RC_ORPC_PATH_PREFIX = "/__agent-shim/orpc";
|
|
|
123732
124229
|
var RC_OPENAPI_DOC_PATH = "/openapi.json";
|
|
123733
124230
|
var RC_SUBSCRIBER_BUFFER_EVENTS = 100;
|
|
123734
124231
|
var READ_ONLY_OPERATION_EXTENSION = "x-agent-shim-read-only";
|
|
124232
|
+
var SESSION_HISTORY_TAG = "agent-trees";
|
|
123735
124233
|
function doorApiBearer(headers) {
|
|
123736
124234
|
const presented = headers.authorization;
|
|
123737
124235
|
const bearerPrefix = "bearer ".length;
|
|
@@ -124484,7 +124982,7 @@ function createLifecycleApiRouter(deps) {
|
|
|
124484
124982
|
init_cliError();
|
|
124485
124983
|
|
|
124486
124984
|
// src/frontdoor/launchSchemas.ts
|
|
124487
|
-
var
|
|
124985
|
+
var import_node_path46 = __toESM(require("node:path"), 1);
|
|
124488
124986
|
init_zod();
|
|
124489
124987
|
init_claudeVersion();
|
|
124490
124988
|
init_identity();
|
|
@@ -124494,7 +124992,7 @@ var LaunchResolveInputSchema = external_exports.strictObject({
|
|
|
124494
124992
|
argv: external_exports.readonly(external_exports.array(external_exports.string())).optional(),
|
|
124495
124993
|
/** The launch's inherited environment. Absent means an empty one: the door's own environment is never a substitute for the caller's, so a caller that wants `AGENT_SHIM_*` switches or a `CLAUDE_CONFIG_DIR` considered names them here. Values are read, never reported. */
|
|
124496
124994
|
env: external_exports.record(external_exports.string(), external_exports.string()).optional()
|
|
124497
|
-
}).refine((input2) =>
|
|
124995
|
+
}).refine((input2) => import_node_path46.default.isAbsolute(input2.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
|
|
124498
124996
|
var LaunchPoolDecisionSchema = external_exports.strictObject({
|
|
124499
124997
|
name: external_exports.string(),
|
|
124500
124998
|
reasons: external_exports.readonly(external_exports.array(external_exports.string())),
|
|
@@ -124562,6 +125060,69 @@ function createLaunchApiRouter(deps) {
|
|
|
124562
125060
|
};
|
|
124563
125061
|
}
|
|
124564
125062
|
|
|
125063
|
+
// src/frontdoor/agentTreesApi.ts
|
|
125064
|
+
init_zod();
|
|
125065
|
+
init_cliError();
|
|
125066
|
+
var AgentTreesListInputSchema = external_exports.strictObject({
|
|
125067
|
+
/** Only this identity's sessions. */
|
|
125068
|
+
identity: external_exports.string().optional(),
|
|
125069
|
+
/** Include sessions that spawned no agent and ran no workflow. */
|
|
125070
|
+
all: external_exports.boolean().optional()
|
|
125071
|
+
});
|
|
125072
|
+
var AgentTreesListOutputSchema = external_exports.array(SessionSummarySchema);
|
|
125073
|
+
var AgentTreesShowInputSchema = external_exports.strictObject({
|
|
125074
|
+
/** A session id, or an unambiguous prefix of one. */
|
|
125075
|
+
session: external_exports.string().min(1),
|
|
125076
|
+
/** Look only in this identity. */
|
|
125077
|
+
identity: external_exports.string().optional()
|
|
125078
|
+
});
|
|
125079
|
+
var AgentTreesShowOutputSchema = external_exports.strictObject({ identities: external_exports.array(external_exports.string()), ...SessionAgentTreeSchema.shape });
|
|
125080
|
+
function asBadRequest(error63) {
|
|
125081
|
+
if (error63 instanceof CliError) {
|
|
125082
|
+
throw new ORPCError("BAD_REQUEST", { message: error63.message });
|
|
125083
|
+
}
|
|
125084
|
+
throw error63;
|
|
125085
|
+
}
|
|
125086
|
+
function createAgentTreesApiRouter(deps) {
|
|
125087
|
+
const authed = doorApiAuth(deps.expectedToken);
|
|
125088
|
+
return {
|
|
125089
|
+
agentTrees: {
|
|
125090
|
+
list: authed.meta(
|
|
125091
|
+
openapi({
|
|
125092
|
+
method: "POST",
|
|
125093
|
+
path: "/rest/agent-trees/list",
|
|
125094
|
+
summary: "List the sessions that spawned agents or ran workflows, newest transcript first",
|
|
125095
|
+
tags: [SESSION_HISTORY_TAG],
|
|
125096
|
+
// A POST because the filters are a body, but the answer changes nothing.
|
|
125097
|
+
spec: (current) => ({ ...current, [READ_ONLY_OPERATION_EXTENSION]: true })
|
|
125098
|
+
})
|
|
125099
|
+
).input(AgentTreesListInputSchema).output(AgentTreesListOutputSchema).handler(({ input: input2 }) => {
|
|
125100
|
+
try {
|
|
125101
|
+
return deps.sessionList(input2).map((session) => ({ ...session, identities: [...session.identities] }));
|
|
125102
|
+
} catch (error63) {
|
|
125103
|
+
return asBadRequest(error63);
|
|
125104
|
+
}
|
|
125105
|
+
}),
|
|
125106
|
+
show: authed.meta(
|
|
125107
|
+
openapi({
|
|
125108
|
+
method: "POST",
|
|
125109
|
+
path: "/rest/agent-trees/show",
|
|
125110
|
+
summary: "Show one session's agent tree, task list and workflow runs",
|
|
125111
|
+
tags: [SESSION_HISTORY_TAG],
|
|
125112
|
+
spec: (current) => ({ ...current, [READ_ONLY_OPERATION_EXTENSION]: true })
|
|
125113
|
+
})
|
|
125114
|
+
).input(AgentTreesShowInputSchema).output(AgentTreesShowOutputSchema).handler(({ input: input2 }) => {
|
|
125115
|
+
try {
|
|
125116
|
+
const view = deps.sessionShow(input2.session, input2.identity);
|
|
125117
|
+
return { identities: [...view.identities], ...view.tree };
|
|
125118
|
+
} catch (error63) {
|
|
125119
|
+
return asBadRequest(error63);
|
|
125120
|
+
}
|
|
125121
|
+
})
|
|
125122
|
+
}
|
|
125123
|
+
};
|
|
125124
|
+
}
|
|
125125
|
+
|
|
124565
125126
|
// src/frontdoor/controlApi.ts
|
|
124566
125127
|
var USAGE_API_TAG = "usage";
|
|
124567
125128
|
var FRONTDOOR_API_TAG2 = "frontdoor";
|
|
@@ -124630,7 +125191,7 @@ function createControlApiRouter(deps) {
|
|
|
124630
125191
|
function createDoorApiRouter(deps) {
|
|
124631
125192
|
const control = createControlApiRouter(deps);
|
|
124632
125193
|
const lifecycle = createLifecycleApiRouter(deps);
|
|
124633
|
-
return { ...createRcApiRouter(deps), ...control, ...lifecycle, ...createConfigApiRouter(deps), ...createCodexApiRouter(deps), ...createLaunchApiRouter(deps), ...createEventsApiRouter(deps), frontdoor: { ...control.frontdoor, ...lifecycle.frontdoor } };
|
|
125194
|
+
return { ...createRcApiRouter(deps), ...control, ...lifecycle, ...createConfigApiRouter(deps), ...createCodexApiRouter(deps), ...createLaunchApiRouter(deps), ...createAgentTreesApiRouter(deps), ...createEventsApiRouter(deps), frontdoor: { ...control.frontdoor, ...lifecycle.frontdoor } };
|
|
124634
125195
|
}
|
|
124635
125196
|
function createDoorApiNodeHandler(deps) {
|
|
124636
125197
|
return doorApiNodeHandlerOf(createDoorApiRouter(deps), deps.expectedToken);
|
|
@@ -125780,7 +126341,7 @@ data: ${errorBody2(status, message)}
|
|
|
125780
126341
|
var UPSTREAM_DETAIL_CHARS = 2e3;
|
|
125781
126342
|
var UPSTREAM_LOG_DETAIL_CHARS = 300;
|
|
125782
126343
|
var CHARS_PER_TOKEN = 4;
|
|
125783
|
-
function
|
|
126344
|
+
function parseJson4(body) {
|
|
125784
126345
|
try {
|
|
125785
126346
|
const value2 = JSON.parse(body);
|
|
125786
126347
|
return { ok: true, value: value2 };
|
|
@@ -125925,7 +126486,7 @@ function createCodexRoute(ports) {
|
|
|
125925
126486
|
if (!provider.ok) {
|
|
125926
126487
|
return errorResponse(provider.status, provider.message);
|
|
125927
126488
|
}
|
|
125928
|
-
const json2 =
|
|
126489
|
+
const json2 = parseJson4(request7.body);
|
|
125929
126490
|
if (!json2.ok) {
|
|
125930
126491
|
return errorResponse(HTTP_STATUS.badRequest, json2.message);
|
|
125931
126492
|
}
|
|
@@ -126409,7 +126970,7 @@ function createRcLiveUsage(deps) {
|
|
|
126409
126970
|
}
|
|
126410
126971
|
|
|
126411
126972
|
// src/frontdoor/rcSelfHostMint.ts
|
|
126412
|
-
var
|
|
126973
|
+
var import_node_path47 = __toESM(require("node:path"), 1);
|
|
126413
126974
|
init_account();
|
|
126414
126975
|
|
|
126415
126976
|
// src/frontdoor/rcSelfHostLocal.ts
|
|
@@ -126539,7 +127100,7 @@ function readJsonObject(fs22, file2) {
|
|
|
126539
127100
|
return isRecord7(parsed) ? parsed : void 0;
|
|
126540
127101
|
}
|
|
126541
127102
|
function readRcSelfHostRecord(fs22, frontdoorDir) {
|
|
126542
|
-
const parsed = readJsonObject(fs22,
|
|
127103
|
+
const parsed = readJsonObject(fs22, import_node_path47.default.join(frontdoorDir, RC_SELF_HOST_RECORD_DIR, RC_SELF_HOST_RECORD_FILE));
|
|
126543
127104
|
if (parsed === void 0) {
|
|
126544
127105
|
return void 0;
|
|
126545
127106
|
}
|
|
@@ -126553,11 +127114,11 @@ function mintRcSelfHostCredential(deps) {
|
|
|
126553
127114
|
if (!isIdentityName(deps.identity)) {
|
|
126554
127115
|
throw new Error(`"${deps.identity}" is not a valid identity name.`);
|
|
126555
127116
|
}
|
|
126556
|
-
const identityDir =
|
|
126557
|
-
const credentialsFile =
|
|
126558
|
-
const claudeJsonFile =
|
|
126559
|
-
const recordDir =
|
|
126560
|
-
const recordFile =
|
|
127117
|
+
const identityDir = import_node_path47.default.join(deps.identitiesDir, deps.identity);
|
|
127118
|
+
const credentialsFile = import_node_path47.default.join(identityDir, CREDENTIALS_FILE2);
|
|
127119
|
+
const claudeJsonFile = import_node_path47.default.join(identityDir, CLAUDE_JSON2);
|
|
127120
|
+
const recordDir = import_node_path47.default.join(deps.frontdoorDir, RC_SELF_HOST_RECORD_DIR);
|
|
127121
|
+
const recordFile = import_node_path47.default.join(recordDir, RC_SELF_HOST_RECORD_FILE);
|
|
126561
127122
|
const previousRecord = readRcSelfHostRecord(deps.fs, deps.frontdoorDir);
|
|
126562
127123
|
const existingCredentials = readJsonObject(deps.fs, credentialsFile);
|
|
126563
127124
|
const existingOauth = isRecord7(existingCredentials?.claudeAiOauth) ? existingCredentials.claudeAiOauth : void 0;
|
|
@@ -126573,7 +127134,7 @@ function mintRcSelfHostCredential(deps) {
|
|
|
126573
127134
|
const organizationUuid = deps.newUuid();
|
|
126574
127135
|
const accountUuid = deps.newUuid();
|
|
126575
127136
|
const mintedAt = new Date(deps.now()).toISOString();
|
|
126576
|
-
deps.fs.mkdirPrivate(
|
|
127137
|
+
deps.fs.mkdirPrivate(import_node_path47.default.dirname(credentialsFile));
|
|
126577
127138
|
deps.fs.writeFilePrivate(credentialsFile, `${JSON.stringify({ ...existingCredentials, claudeAiOauth: { accessToken, refreshToken, expiresAt: null, scopes: [...RC_SELF_HOST_SCOPE_LIST], subscriptionType: SELF_HOST_SUBSCRIPTION_TYPE, rateLimitTier: null } }, null, 2)}
|
|
126578
127139
|
`);
|
|
126579
127140
|
const claudeJson = readJsonObject(deps.fs, claudeJsonFile) ?? {};
|
|
@@ -126960,7 +127521,7 @@ function registerRcCommand(frontdoor, paths) {
|
|
|
126960
127521
|
}
|
|
126961
127522
|
|
|
126962
127523
|
// src/frontdoor/rcCredentialStore.ts
|
|
126963
|
-
var
|
|
127524
|
+
var import_node_path48 = __toESM(require("node:path"), 1);
|
|
126964
127525
|
function isSafeSessionId(sessionId) {
|
|
126965
127526
|
return /^[A-Za-z0-9_-]+$/.test(sessionId);
|
|
126966
127527
|
}
|
|
@@ -126986,7 +127547,7 @@ function sequenceNumOfJson(value2) {
|
|
|
126986
127547
|
}
|
|
126987
127548
|
function createRcCredentialStore(fs22, dir) {
|
|
126988
127549
|
fs22.mkdirPrivate(dir);
|
|
126989
|
-
const fileFor = (sessionId) =>
|
|
127550
|
+
const fileFor = (sessionId) => import_node_path48.default.join(dir, `${sessionId}.json`);
|
|
126990
127551
|
const readParsed = (sessionId) => {
|
|
126991
127552
|
const raw = fs22.readFileUtf8(fileFor(sessionId));
|
|
126992
127553
|
if (raw === void 0) {
|
|
@@ -129155,8 +129716,8 @@ function createRealQuotaRefresher(params) {
|
|
|
129155
129716
|
// src/frontdoor/commands.ts
|
|
129156
129717
|
init_store2();
|
|
129157
129718
|
function appendLog(paths, line) {
|
|
129158
|
-
|
|
129159
|
-
|
|
129719
|
+
import_node_fs17.default.mkdirSync(paths.logsDir, { recursive: true });
|
|
129720
|
+
import_node_fs17.default.appendFileSync(paths.frontdoorLogPath, `${(/* @__PURE__ */ new Date()).toISOString()} ${line}
|
|
129160
129721
|
`);
|
|
129161
129722
|
}
|
|
129162
129723
|
function rcObservingResolver(resolve2, tracker, hub) {
|
|
@@ -129169,7 +129730,7 @@ function rcObservingResolver(resolve2, tracker, hub) {
|
|
|
129169
129730
|
}
|
|
129170
129731
|
function realStatOwnExecutable(watchPath) {
|
|
129171
129732
|
return () => {
|
|
129172
|
-
const st2 =
|
|
129733
|
+
const st2 = import_node_fs17.default.statSync(watchPath, { throwIfNoEntry: false });
|
|
129173
129734
|
return st2?.isFile() !== true ? void 0 : { dev: st2.dev, ino: st2.ino, size: st2.size, mtimeMs: st2.mtimeMs };
|
|
129174
129735
|
};
|
|
129175
129736
|
}
|
|
@@ -129350,7 +129911,7 @@ function realFrontDoorSupervisorPorts(paths) {
|
|
|
129350
129911
|
},
|
|
129351
129912
|
isRunning: realIsProcessRunning,
|
|
129352
129913
|
// The turnover check's file identity, over the installed entry resolved once at door start: re-resolving per tick would re-run the PATH scan every second and could theoretically flip between two files, while the entry itself is fixed for as long as this door lives. The existence check prefers the agent-shim sibling only when it is really there (see watchedInstallEntry).
|
|
129353
|
-
statOwnExecutable: realStatOwnExecutable(watchedInstallEntry(realOwnExecutablePath(), (candidate) =>
|
|
129914
|
+
statOwnExecutable: realStatOwnExecutable(watchedInstallEntry(realOwnExecutablePath(), (candidate) => import_node_fs17.default.existsSync(candidate))),
|
|
129354
129915
|
startProviderListener: async (preferredPort) => {
|
|
129355
129916
|
const authority = loadCa();
|
|
129356
129917
|
const rcDial = rcSelfHost ? lateRcEventDial(rcSelfHostDialTarget) : realRcEventDial();
|
|
@@ -129388,7 +129949,10 @@ function realFrontDoorSupervisorPorts(paths) {
|
|
|
129388
129949
|
},
|
|
129389
129950
|
poolNames: () => Object.keys(readPools(paths)).sort(),
|
|
129390
129951
|
// A read-only resolution of what a launch from one directory would do: the launcher's own decision with its effects left out, so a read never recovers or resyncs a farm, starts a daemon, records a pool pick or runs a credential command.
|
|
129391
|
-
resolveLaunch: (request7) => resolveClaudeLaunch({ argv: request7.argv, cwd: request7.path, env: request7.env, paths })
|
|
129952
|
+
resolveLaunch: (request7) => resolveClaudeLaunch({ argv: request7.argv, cwd: request7.path, env: request7.env, paths }),
|
|
129953
|
+
// The identities are read per call, like the pool table, so an identity added after the door started is listed the moment the CLI would see it.
|
|
129954
|
+
sessionList: (filters) => collectSessionList(realSessionFs, paths.identitiesDir, listIdentities(paths).map((entry) => entry.name), { ...filters.identity === void 0 ? {} : { identity: filters.identity }, ...filters.all === void 0 ? {} : { all: filters.all } }),
|
|
129955
|
+
sessionShow: (query, identity) => showSession(realSessionFs, paths.identitiesDir, listIdentities(paths).map((entry) => entry.name), query, identity)
|
|
129392
129956
|
};
|
|
129393
129957
|
const lifecycleAndCodexDeps = {
|
|
129394
129958
|
doorPid: process.pid,
|
|
@@ -129458,7 +130022,7 @@ function realFrontDoorSupervisorPorts(paths) {
|
|
|
129458
130022
|
const leafFor = createLeafCache(loadCa(), () => /* @__PURE__ */ new Date());
|
|
129459
130023
|
const capture = captureFromEnv(process.env, paths.logsDir);
|
|
129460
130024
|
if (capture !== void 0) {
|
|
129461
|
-
log(`capture enabled, recording CONNECT targets and piped exchanges to ${
|
|
130025
|
+
log(`capture enabled, recording CONNECT targets and piped exchanges to ${import_node_path49.default.join(paths.logsDir, "frontdoor-capture.jsonl")}`);
|
|
129462
130026
|
}
|
|
129463
130027
|
if (rcSelfHostSurface !== void 0) {
|
|
129464
130028
|
log("self-hosted Remote Control surface on: the door serves the CCR session family itself, and its own client-half dials its own transparent surface");
|
|
@@ -139324,31 +139888,33 @@ async function serveMcp(mcp, transport, options = {}) {
|
|
|
139324
139888
|
}
|
|
139325
139889
|
|
|
139326
139890
|
// src/mcp/permissions.ts
|
|
139327
|
-
var
|
|
139328
|
-
var
|
|
139891
|
+
var import_node_fs18 = __toESM(require("node:fs"), 1);
|
|
139892
|
+
var import_node_path50 = __toESM(require("node:path"), 1);
|
|
139329
139893
|
init_zod();
|
|
139330
139894
|
init_store();
|
|
139331
139895
|
var StoredMcpPermissionsSchema = external_exports.strictObject({
|
|
139332
139896
|
writes: external_exports.boolean(),
|
|
139333
|
-
remoteControl: external_exports.boolean()
|
|
139897
|
+
remoteControl: external_exports.boolean(),
|
|
139898
|
+
// Absent from a file written before the grant existed, which meant not allowed.
|
|
139899
|
+
history: external_exports.boolean().default(false)
|
|
139334
139900
|
});
|
|
139335
139901
|
var OWNER_ONLY_MODE = 384;
|
|
139336
|
-
var NONE2 = { writes: false, remoteControl: false };
|
|
139902
|
+
var NONE2 = { writes: false, remoteControl: false, history: false };
|
|
139337
139903
|
function readStoredMcpPermissions(paths) {
|
|
139338
139904
|
return readJson(paths.mcpPermissionsFile, StoredMcpPermissionsSchema) ?? NONE2;
|
|
139339
139905
|
}
|
|
139340
139906
|
function writeStoredMcpPermissions(paths, permissions) {
|
|
139341
|
-
writeJsonAtomic(paths.mcpPermissionsFile, { writes: permissions.writes, remoteControl: permissions.remoteControl });
|
|
139342
|
-
|
|
139907
|
+
writeJsonAtomic(paths.mcpPermissionsFile, { writes: permissions.writes, remoteControl: permissions.remoteControl, history: permissions.history });
|
|
139908
|
+
import_node_fs18.default.chmodSync(paths.mcpPermissionsFile, OWNER_ONLY_MODE);
|
|
139343
139909
|
}
|
|
139344
139910
|
function effectiveMcpPermissions(flags, stored) {
|
|
139345
|
-
return { writes: flags.writes || stored.writes, remoteControl: flags.remoteControl || stored.remoteControl };
|
|
139911
|
+
return { writes: flags.writes || stored.writes, remoteControl: flags.remoteControl || stored.remoteControl, history: flags.history || stored.history };
|
|
139346
139912
|
}
|
|
139347
139913
|
function watchMcpPermissions(paths, onChange) {
|
|
139348
|
-
const directory =
|
|
139349
|
-
|
|
139350
|
-
const watcher =
|
|
139351
|
-
if (filename === null || filename ===
|
|
139914
|
+
const directory = import_node_path50.default.dirname(paths.mcpPermissionsFile);
|
|
139915
|
+
import_node_fs18.default.mkdirSync(directory, { recursive: true });
|
|
139916
|
+
const watcher = import_node_fs18.default.watch(directory, (_event, filename) => {
|
|
139917
|
+
if (filename === null || filename === import_node_path50.default.basename(paths.mcpPermissionsFile)) {
|
|
139352
139918
|
onChange();
|
|
139353
139919
|
}
|
|
139354
139920
|
});
|
|
@@ -139395,6 +139961,9 @@ function isStream(operation) {
|
|
|
139395
139961
|
return Object.values(operation.responses ?? {}).some((response) => response.content !== void 0 && "text/event-stream" in response.content);
|
|
139396
139962
|
}
|
|
139397
139963
|
function permitted(tag, readOnly, permissions) {
|
|
139964
|
+
if (tag === SESSION_HISTORY_TAG) {
|
|
139965
|
+
return permissions.history;
|
|
139966
|
+
}
|
|
139398
139967
|
if (readOnly) {
|
|
139399
139968
|
return true;
|
|
139400
139969
|
}
|
|
@@ -139456,16 +140025,16 @@ function doorMcpPorts(paths, permissions) {
|
|
|
139456
140025
|
}
|
|
139457
140026
|
};
|
|
139458
140027
|
}
|
|
139459
|
-
var PERMISSION_FIELDS = { writes: "writes", "remote-control": "remoteControl" };
|
|
140028
|
+
var PERMISSION_FIELDS = { writes: "writes", "remote-control": "remoteControl", history: "history" };
|
|
139460
140029
|
function permissionName(value2) {
|
|
139461
|
-
if (value2 !== "writes" && value2 !== "remote-control") {
|
|
139462
|
-
throw new UsageError(`unknown permission "${value2}": expected writes
|
|
140030
|
+
if (value2 !== "writes" && value2 !== "remote-control" && value2 !== "history") {
|
|
140031
|
+
throw new UsageError(`unknown permission "${value2}": expected writes, remote-control or history`);
|
|
139463
140032
|
}
|
|
139464
140033
|
return value2;
|
|
139465
140034
|
}
|
|
139466
140035
|
function registerMcpCommand(program2, deps) {
|
|
139467
|
-
const mcp = program2.command("mcp").description("Serve the front door's typed API as MCP tools on standard input and output, so an agent can read quota and door state and, when allowed, act on it.").option("--allow-writes", "Also expose the operations that change the door's configuration and lifecycle, whatever `mcp permissions` says. Read-only without it or a stored permission.").option("--allow-remote-control", "Also expose the Remote Control operations that send into, answer for and end other sessions, whatever `mcp permissions` says.").action(async (options) => {
|
|
139468
|
-
const flags = { writes: options.allowWrites === true, remoteControl: options.allowRemoteControl === true };
|
|
140036
|
+
const mcp = program2.command("mcp").description("Serve the front door's typed API as MCP tools on standard input and output, so an agent can read quota and door state and, when allowed, act on it.").option("--allow-writes", "Also expose the operations that change the door's configuration and lifecycle, whatever `mcp permissions` says. Read-only without it or a stored permission.").option("--allow-remote-control", "Also expose the Remote Control operations that send into, answer for and end other sessions, whatever `mcp permissions` says.").option("--allow-history", "Also expose the reads of session history (agents, tasks and workflow runs across every identity), whatever `mcp permissions` says.").action(async (options) => {
|
|
140037
|
+
const flags = { writes: options.allowWrites === true, remoteControl: options.allowRemoteControl === true, history: options.allowHistory === true };
|
|
139469
140038
|
const inForce = () => effectiveMcpPermissions(flags, readStoredMcpPermissions(deps.paths));
|
|
139470
140039
|
const server = createMcpServer({ name: "agent-shim", version: package_default.version }, doorMcpPorts(deps.paths, inForce));
|
|
139471
140040
|
await serveMcp(server, new StdioServerTransport(), {
|
|
@@ -139489,12 +140058,13 @@ function registerMcpCommand(program2, deps) {
|
|
|
139489
140058
|
}
|
|
139490
140059
|
console.log(`writes: ${stored.writes ? "allowed" : "not allowed"}`);
|
|
139491
140060
|
console.log(`remote-control: ${stored.remoteControl ? "allowed" : "not allowed"}`);
|
|
140061
|
+
console.log(`history: ${stored.history ? "allowed" : "not allowed"}`);
|
|
139492
140062
|
}),
|
|
139493
140063
|
["agent-shim mcp permissions show"]
|
|
139494
140064
|
);
|
|
139495
140065
|
for (const [verb, granted] of [["allow", true], ["deny", false]]) {
|
|
139496
140066
|
withExamples(
|
|
139497
|
-
permissions.command(`${verb} <permission>`).description(`${verb === "allow" ? "Allow" : "Stop allowing"} \`writes\` (configuration and lifecycle operations)
|
|
140067
|
+
permissions.command(`${verb} <permission>`).description(`${verb === "allow" ? "Allow" : "Stop allowing"} \`writes\` (configuration and lifecycle operations), \`remote-control\` (operations on other sessions) or \`history\` (reads of session history across identities) for the MCP server's agents.`).action((permission) => {
|
|
139498
140068
|
const field = PERMISSION_FIELDS[permissionName(permission)];
|
|
139499
140069
|
writeStoredMcpPermissions(deps.paths, { ...readStoredMcpPermissions(deps.paths), [field]: granted });
|
|
139500
140070
|
console.log(`${permission}: ${granted ? "allowed" : "not allowed"}`);
|
|
@@ -139656,17 +140226,17 @@ init_credential();
|
|
|
139656
140226
|
init_credentialCache();
|
|
139657
140227
|
|
|
139658
140228
|
// src/identityToken.ts
|
|
139659
|
-
var
|
|
139660
|
-
var
|
|
140229
|
+
var import_node_fs19 = __toESM(require("node:fs"), 1);
|
|
140230
|
+
var import_node_path51 = __toESM(require("node:path"), 1);
|
|
139661
140231
|
init_cliError();
|
|
139662
140232
|
var TOKEN_FILE_MODE = 384;
|
|
139663
140233
|
var TOKEN_DIR_MODE = 448;
|
|
139664
140234
|
var OAUTH_TOKEN_RE = /^sk-ant-oat\d+-[A-Za-z0-9_-]+$/;
|
|
139665
140235
|
function identityTokenDir(paths) {
|
|
139666
|
-
return
|
|
140236
|
+
return import_node_path51.default.join(paths.root, "credentials");
|
|
139667
140237
|
}
|
|
139668
140238
|
function identityTokenPath(paths, identityName) {
|
|
139669
|
-
return
|
|
140239
|
+
return import_node_path51.default.join(identityTokenDir(paths), `${identityName}.token`);
|
|
139670
140240
|
}
|
|
139671
140241
|
function storeIdentityToken(paths, identityName, raw) {
|
|
139672
140242
|
const token = raw.trim();
|
|
@@ -139674,13 +140244,13 @@ function storeIdentityToken(paths, identityName, raw) {
|
|
|
139674
140244
|
throw new UsageError("That is not a claude setup-token token (expected it to start with sk-ant-oat). Run `claude setup-token` and pass its token on standard input.");
|
|
139675
140245
|
}
|
|
139676
140246
|
const dir = identityTokenDir(paths);
|
|
139677
|
-
|
|
139678
|
-
|
|
140247
|
+
import_node_fs19.default.mkdirSync(dir, { recursive: true, mode: TOKEN_DIR_MODE });
|
|
140248
|
+
import_node_fs19.default.chmodSync(dir, TOKEN_DIR_MODE);
|
|
139679
140249
|
const target = identityTokenPath(paths, identityName);
|
|
139680
|
-
const temp =
|
|
139681
|
-
|
|
140250
|
+
const temp = import_node_path51.default.join(dir, `.${identityName}.${String(process.pid)}.tmp`);
|
|
140251
|
+
import_node_fs19.default.writeFileSync(temp, `${token}
|
|
139682
140252
|
`, { mode: TOKEN_FILE_MODE });
|
|
139683
|
-
|
|
140253
|
+
import_node_fs19.default.renameSync(temp, target);
|
|
139684
140254
|
return target;
|
|
139685
140255
|
}
|
|
139686
140256
|
|
|
@@ -139843,9 +140413,9 @@ function registerDoctorCommand(program2, deps) {
|
|
|
139843
140413
|
}
|
|
139844
140414
|
|
|
139845
140415
|
// src/headroom/commands.ts
|
|
139846
|
-
var
|
|
140416
|
+
var import_node_fs20 = __toESM(require("node:fs"), 1);
|
|
139847
140417
|
var import_node_http4 = __toESM(require("node:http"), 1);
|
|
139848
|
-
var
|
|
140418
|
+
var import_node_path52 = __toESM(require("node:path"), 1);
|
|
139849
140419
|
var import_node_child_process6 = require("node:child_process");
|
|
139850
140420
|
init_commandDeps();
|
|
139851
140421
|
init_realFrontDoorPort();
|
|
@@ -139975,12 +140545,12 @@ function readInstalledHeadroomCommit() {
|
|
|
139975
140545
|
if (toolDir.status !== 0) {
|
|
139976
140546
|
return void 0;
|
|
139977
140547
|
}
|
|
139978
|
-
const libDir =
|
|
140548
|
+
const libDir = import_node_path52.default.join(toolDir.stdout.trim(), HEADROOM_TOOL_NAME, "lib");
|
|
139979
140549
|
for (const python of realFarmFs.readdir(libDir)) {
|
|
139980
|
-
const sitePackages =
|
|
140550
|
+
const sitePackages = import_node_path52.default.join(libDir, python, "site-packages");
|
|
139981
140551
|
for (const entry of realFarmFs.readdir(sitePackages)) {
|
|
139982
140552
|
if (entry.startsWith("headroom_ai-") && entry.endsWith(".dist-info")) {
|
|
139983
|
-
const directUrl = realFarmFs.readFileUtf8(
|
|
140553
|
+
const directUrl = realFarmFs.readFileUtf8(import_node_path52.default.join(sitePackages, entry, "direct_url.json"));
|
|
139984
140554
|
return directUrl === void 0 ? void 0 : parseInstalledCommit(directUrl);
|
|
139985
140555
|
}
|
|
139986
140556
|
}
|
|
@@ -140004,12 +140574,12 @@ function realSupervisorPorts(paths) {
|
|
|
140004
140574
|
readConfig: () => resolveSupervisorConfig(readGlobalConfig(paths)?.headroom ?? {}),
|
|
140005
140575
|
spawnHeadroom: (socketPath, allowlist, settings2) => {
|
|
140006
140576
|
const trust = resolveHeadroomTrustBundle({ caCertFile: paths.frontdoorCaCertFile, bundlesDir: paths.frontdoorCaBundlesDir, inherited: process.env[HEADROOM_CA_BUNDLE], fs: realTrustBundleFs });
|
|
140007
|
-
|
|
140577
|
+
import_node_fs20.default.mkdirSync(paths.logsDir, { recursive: true });
|
|
140008
140578
|
if (trust?.warning !== void 0) {
|
|
140009
|
-
|
|
140579
|
+
import_node_fs20.default.appendFileSync(paths.headroomLogPath, `${(/* @__PURE__ */ new Date()).toISOString()} ${trust.warning}
|
|
140010
140580
|
`);
|
|
140011
140581
|
}
|
|
140012
|
-
const logFd =
|
|
140582
|
+
const logFd = import_node_fs20.default.openSync(paths.headroomLogPath, "a");
|
|
140013
140583
|
try {
|
|
140014
140584
|
const child = (0, import_node_child_process6.spawn)("headroom", headroomProxyArgs(socketPath, settings2), {
|
|
140015
140585
|
detached: true,
|
|
@@ -140024,12 +140594,12 @@ function realSupervisorPorts(paths) {
|
|
|
140024
140594
|
child.once("exit", (code, signal) => {
|
|
140025
140595
|
ownedHeadroom.delete(pid);
|
|
140026
140596
|
exitedHeadroom.add(pid);
|
|
140027
|
-
|
|
140597
|
+
import_node_fs20.default.appendFileSync(paths.headroomLogPath, `${(/* @__PURE__ */ new Date()).toISOString()} agent-shim headroom supervisor: headroom exited (${signal ?? `code ${String(code)}`})
|
|
140028
140598
|
`);
|
|
140029
140599
|
});
|
|
140030
140600
|
return pid;
|
|
140031
140601
|
} finally {
|
|
140032
|
-
|
|
140602
|
+
import_node_fs20.default.closeSync(logFd);
|
|
140033
140603
|
}
|
|
140034
140604
|
},
|
|
140035
140605
|
stopProcess: (pid) => {
|
|
@@ -140042,7 +140612,7 @@ function realSupervisorPorts(paths) {
|
|
|
140042
140612
|
now: () => Date.now()
|
|
140043
140613
|
});
|
|
140044
140614
|
if (outcome === "still-running") {
|
|
140045
|
-
|
|
140615
|
+
import_node_fs20.default.appendFileSync(
|
|
140046
140616
|
paths.headroomLogPath,
|
|
140047
140617
|
`${(/* @__PURE__ */ new Date()).toISOString()} agent-shim headroom supervisor: pid ${String(pid)} survived SIGKILL within its grace; it is stuck uninterruptibly
|
|
140048
140618
|
`
|
|
@@ -140056,10 +140626,10 @@ function realSupervisorPorts(paths) {
|
|
|
140056
140626
|
return { ok: false, error: `uv is not installed or not on PATH (${result.error.message})` };
|
|
140057
140627
|
}
|
|
140058
140628
|
if (result.stdout !== "") {
|
|
140059
|
-
|
|
140629
|
+
import_node_fs20.default.appendFileSync(paths.headroomLogPath, result.stdout);
|
|
140060
140630
|
}
|
|
140061
140631
|
if (result.stderr !== "") {
|
|
140062
|
-
|
|
140632
|
+
import_node_fs20.default.appendFileSync(paths.headroomLogPath, result.stderr);
|
|
140063
140633
|
}
|
|
140064
140634
|
return result.status === 0 ? { ok: true } : { ok: false, error: `uv tool install exited ${String(result.status)}` };
|
|
140065
140635
|
},
|
|
@@ -140069,8 +140639,8 @@ function realSupervisorPorts(paths) {
|
|
|
140069
140639
|
},
|
|
140070
140640
|
installedCommit: readInstalledHeadroomCommit,
|
|
140071
140641
|
log: (line) => {
|
|
140072
|
-
|
|
140073
|
-
|
|
140642
|
+
import_node_fs20.default.mkdirSync(paths.logsDir, { recursive: true });
|
|
140643
|
+
import_node_fs20.default.appendFileSync(paths.headroomLogPath, `${(/* @__PURE__ */ new Date()).toISOString()} ${line}
|
|
140074
140644
|
`);
|
|
140075
140645
|
}
|
|
140076
140646
|
};
|
|
@@ -140116,7 +140686,7 @@ function registerHeadroomCommand(program2, deps) {
|
|
|
140116
140686
|
}
|
|
140117
140687
|
|
|
140118
140688
|
// src/jobs.ts
|
|
140119
|
-
var
|
|
140689
|
+
var import_node_path53 = __toESM(require("node:path"), 1);
|
|
140120
140690
|
init_commandDeps();
|
|
140121
140691
|
init_cliError();
|
|
140122
140692
|
init_schema();
|
|
@@ -140141,7 +140711,7 @@ function jobOf(options) {
|
|
|
140141
140711
|
target: options.identity === void 0 ? { pool: options.pool ?? "" } : { identity: options.identity },
|
|
140142
140712
|
trigger: options.at === void 0 ? { beforeReset: options.beforeReset ?? "fiveHour", lead: options.lead ?? "" } : { at: options.at },
|
|
140143
140713
|
prompt: options.prompt,
|
|
140144
|
-
cwd:
|
|
140714
|
+
cwd: import_node_path53.default.resolve(options.cwd ?? process.cwd()),
|
|
140145
140715
|
timeout: options.timeout,
|
|
140146
140716
|
...options.model === void 0 ? {} : { model: options.model },
|
|
140147
140717
|
...options.allowedTool === void 0 ? {} : { allowedTools: options.allowedTool }
|
|
@@ -140214,7 +140784,7 @@ function registerJobCommand(program2, deps) {
|
|
|
140214
140784
|
console.log(`Allowed tools: ${entry.allowedTools.join(", ")}`);
|
|
140215
140785
|
}
|
|
140216
140786
|
console.log(`Prompt: ${entry.prompt}`);
|
|
140217
|
-
console.log(`Results: ${
|
|
140787
|
+
console.log(`Results: ${import_node_path53.default.join(paths.jobLogsDir, `${name}.log`)}`);
|
|
140218
140788
|
}),
|
|
140219
140789
|
["agent-shim job show digest"]
|
|
140220
140790
|
);
|
|
@@ -140237,7 +140807,7 @@ function registerJobCommand(program2, deps) {
|
|
|
140237
140807
|
throw new UsageError(`No member of the job's pool can be picked right now.`);
|
|
140238
140808
|
}
|
|
140239
140809
|
await createRealJobRunner({ paths, spawnDaemon: spawnDetachedSupervisor, fs: realFarmFs, now: () => /* @__PURE__ */ new Date() })(name, identity, entry);
|
|
140240
|
-
console.log(`Ran job "${name}" as ${identity}; the result is in ${
|
|
140810
|
+
console.log(`Ran job "${name}" as ${identity}; the result is in ${import_node_path53.default.join(paths.jobLogsDir, `${name}.log`)}.`);
|
|
140241
140811
|
}),
|
|
140242
140812
|
["agent-shim job run digest"]
|
|
140243
140813
|
);
|
|
@@ -140648,472 +141218,7 @@ function registerRunCommand(program2, handler) {
|
|
|
140648
141218
|
}
|
|
140649
141219
|
|
|
140650
141220
|
// src/agents/commands.ts
|
|
140651
|
-
var import_node_fs20 = __toESM(require("node:fs"), 1);
|
|
140652
|
-
var import_node_path53 = __toESM(require("node:path"), 1);
|
|
140653
141221
|
init_commandDeps();
|
|
140654
|
-
init_cliError();
|
|
140655
|
-
init_realPorts();
|
|
140656
|
-
|
|
140657
|
-
// src/agents/read.ts
|
|
140658
|
-
var import_node_path52 = __toESM(require("node:path"), 1);
|
|
140659
|
-
init_zod();
|
|
140660
|
-
|
|
140661
|
-
// src/agents/schema.ts
|
|
140662
|
-
init_zod();
|
|
140663
|
-
var AgentMetaSchema = external_exports.looseObject({
|
|
140664
|
-
agentType: external_exports.string(),
|
|
140665
|
-
isFork: external_exports.boolean().optional(),
|
|
140666
|
-
description: external_exports.string().optional(),
|
|
140667
|
-
name: external_exports.string().optional(),
|
|
140668
|
-
toolUseId: external_exports.string().optional(),
|
|
140669
|
-
spawnDepth: external_exports.number().int().nonnegative().optional(),
|
|
140670
|
-
parentAgentId: external_exports.string().optional(),
|
|
140671
|
-
model: external_exports.string().optional(),
|
|
140672
|
-
requestShape: external_exports.string().optional(),
|
|
140673
|
-
requestNonInteractive: external_exports.boolean().optional(),
|
|
140674
|
-
workflowPhase: external_exports.string().optional(),
|
|
140675
|
-
taskKind: external_exports.string().optional(),
|
|
140676
|
-
teamName: external_exports.string().optional(),
|
|
140677
|
-
worktreePath: external_exports.string().optional(),
|
|
140678
|
-
worktreeBranch: external_exports.string().optional(),
|
|
140679
|
-
stoppedByUser: external_exports.boolean().optional()
|
|
140680
|
-
});
|
|
140681
|
-
var AgentKindSchema = external_exports.enum(["subagent", "fork", "workflow-agent", "teammate"]);
|
|
140682
|
-
var AgentNodeSchema = external_exports.lazy(
|
|
140683
|
-
() => external_exports.strictObject({
|
|
140684
|
-
id: external_exports.string(),
|
|
140685
|
-
kind: AgentKindSchema,
|
|
140686
|
-
agentType: external_exports.string(),
|
|
140687
|
-
description: external_exports.string().optional(),
|
|
140688
|
-
name: external_exports.string().optional(),
|
|
140689
|
-
toolUseId: external_exports.string().optional(),
|
|
140690
|
-
spawnDepth: external_exports.number().int().nonnegative().optional(),
|
|
140691
|
-
model: external_exports.string().optional(),
|
|
140692
|
-
background: external_exports.boolean().optional(),
|
|
140693
|
-
workflowRunId: external_exports.string().optional(),
|
|
140694
|
-
workflowPhase: external_exports.string().optional(),
|
|
140695
|
-
teamName: external_exports.string().optional(),
|
|
140696
|
-
stoppedByUser: external_exports.boolean().optional(),
|
|
140697
|
-
transcript: external_exports.string(),
|
|
140698
|
-
children: external_exports.array(AgentNodeSchema)
|
|
140699
|
-
})
|
|
140700
|
-
);
|
|
140701
|
-
var TaskItemSchema = external_exports.strictObject({
|
|
140702
|
-
id: external_exports.string(),
|
|
140703
|
-
subject: external_exports.string(),
|
|
140704
|
-
description: external_exports.string().optional(),
|
|
140705
|
-
status: external_exports.string(),
|
|
140706
|
-
/** What a spinner shows while the task runs. */
|
|
140707
|
-
activeForm: external_exports.string().optional(),
|
|
140708
|
-
/** The teammate or agent name the task is assigned to, as Agent Teams writes it. */
|
|
140709
|
-
owner: external_exports.string().optional(),
|
|
140710
|
-
/** Free-form data the harness attaches to a task, kept as written. */
|
|
140711
|
-
metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
140712
|
-
blocks: external_exports.array(external_exports.string()),
|
|
140713
|
-
blockedBy: external_exports.array(external_exports.string()),
|
|
140714
|
-
/** The id of the shared task list this task belongs to (a team's name, or a custom list id), absent for the session's own list. */
|
|
140715
|
-
taskList: external_exports.string().optional()
|
|
140716
|
-
});
|
|
140717
|
-
var WorkflowRunSchema = external_exports.strictObject({
|
|
140718
|
-
runId: external_exports.string(),
|
|
140719
|
-
workflowName: external_exports.string().optional(),
|
|
140720
|
-
status: external_exports.string().optional(),
|
|
140721
|
-
startTime: external_exports.number().optional(),
|
|
140722
|
-
phases: external_exports.array(external_exports.string()),
|
|
140723
|
-
summary: external_exports.string().optional()
|
|
140724
|
-
});
|
|
140725
|
-
var AgentTreeProblemSchema = external_exports.strictObject({
|
|
140726
|
-
/** Relative to the identity's configuration directory. */
|
|
140727
|
-
path: external_exports.string(),
|
|
140728
|
-
reason: external_exports.string()
|
|
140729
|
-
});
|
|
140730
|
-
var SessionAgentTreeSchema = external_exports.strictObject({
|
|
140731
|
-
project: external_exports.string(),
|
|
140732
|
-
sessionId: external_exports.string(),
|
|
140733
|
-
/** True for a session directory a resume superseded (`<session-id>.superseded-<epoch-ms>`). */
|
|
140734
|
-
superseded: external_exports.boolean(),
|
|
140735
|
-
/** The agents the session itself spawned, each with its descendants. */
|
|
140736
|
-
agents: external_exports.array(AgentNodeSchema),
|
|
140737
|
-
tasks: external_exports.array(TaskItemSchema),
|
|
140738
|
-
workflowRuns: external_exports.array(WorkflowRunSchema),
|
|
140739
|
-
problems: external_exports.array(AgentTreeProblemSchema)
|
|
140740
|
-
});
|
|
140741
|
-
|
|
140742
|
-
// src/agents/read.ts
|
|
140743
|
-
var PROJECTS_DIR = "projects";
|
|
140744
|
-
var TASKS_DIR = "tasks";
|
|
140745
|
-
var SUBAGENTS_DIR = "subagents";
|
|
140746
|
-
var WORKFLOWS_DIR = "workflows";
|
|
140747
|
-
var AGENT_FILE_PREFIX = "agent-";
|
|
140748
|
-
var META_SUFFIX = ".meta.json";
|
|
140749
|
-
var TRANSCRIPT_SUFFIX = ".jsonl";
|
|
140750
|
-
var SHORT_SESSION_ID_LENGTH = 8;
|
|
140751
|
-
var SHORT_SESSION_LIST_PREFIX = "session-";
|
|
140752
|
-
var JSON_SUFFIX = ".json";
|
|
140753
|
-
var WORKFLOW_RUN_PREFIX = "wf_";
|
|
140754
|
-
var ARCHIVED_RE = /^(.+)\.(?:superseded|orphaned)-.+$/;
|
|
140755
|
-
var FORK_AGENT_TYPE = "fork";
|
|
140756
|
-
var WORKFLOW_AGENT_TYPE = "workflow-subagent";
|
|
140757
|
-
var TEAMMATE_TASK_KIND = "in_process_teammate";
|
|
140758
|
-
var BACKGROUND_REQUEST_SHAPE = "background";
|
|
140759
|
-
var SESSION_SPAWN_DEPTH = 1;
|
|
140760
|
-
function parseEntry2(project, entry) {
|
|
140761
|
-
const match = ARCHIVED_RE.exec(entry);
|
|
140762
|
-
const base = match?.[1];
|
|
140763
|
-
return base === void 0 ? { project, sessionId: entry, superseded: false, entry } : { project, sessionId: base, superseded: true, entry };
|
|
140764
|
-
}
|
|
140765
|
-
function listSessions2(fs22, configDir) {
|
|
140766
|
-
const found = [];
|
|
140767
|
-
for (const project of fs22.readdir(import_node_path52.default.join(configDir, PROJECTS_DIR))) {
|
|
140768
|
-
const projectDir = import_node_path52.default.join(configDir, PROJECTS_DIR, project);
|
|
140769
|
-
const entries = /* @__PURE__ */ new Set();
|
|
140770
|
-
for (const name of fs22.readdir(projectDir)) {
|
|
140771
|
-
if (name.endsWith(TRANSCRIPT_SUFFIX)) {
|
|
140772
|
-
entries.add(name.slice(0, -TRANSCRIPT_SUFFIX.length));
|
|
140773
|
-
continue;
|
|
140774
|
-
}
|
|
140775
|
-
const children = fs22.readdir(import_node_path52.default.join(projectDir, name));
|
|
140776
|
-
if (children.includes(SUBAGENTS_DIR) || children.includes(WORKFLOWS_DIR)) {
|
|
140777
|
-
entries.add(name);
|
|
140778
|
-
}
|
|
140779
|
-
}
|
|
140780
|
-
for (const entry of entries) {
|
|
140781
|
-
found.push(parseEntry2(project, entry));
|
|
140782
|
-
}
|
|
140783
|
-
}
|
|
140784
|
-
return found.sort((left, right) => left.project.localeCompare(right.project) || left.entry.localeCompare(right.entry));
|
|
140785
|
-
}
|
|
140786
|
-
function locateAgents(fs22, configDir, relativeDir, workflowRunId, report) {
|
|
140787
|
-
const located = [];
|
|
140788
|
-
for (const name of listDirOrReport(fs22, configDir, relativeDir, report)) {
|
|
140789
|
-
if (!name.startsWith(AGENT_FILE_PREFIX) || !name.endsWith(META_SUFFIX)) {
|
|
140790
|
-
continue;
|
|
140791
|
-
}
|
|
140792
|
-
const id2 = name.slice(AGENT_FILE_PREFIX.length, -META_SUFFIX.length);
|
|
140793
|
-
located.push({
|
|
140794
|
-
id: id2,
|
|
140795
|
-
metaPath: import_node_path52.default.join(relativeDir, name),
|
|
140796
|
-
transcriptPath: import_node_path52.default.join(relativeDir, `${AGENT_FILE_PREFIX}${id2}${TRANSCRIPT_SUFFIX}`),
|
|
140797
|
-
workflowRunId
|
|
140798
|
-
});
|
|
140799
|
-
}
|
|
140800
|
-
return located;
|
|
140801
|
-
}
|
|
140802
|
-
function kindOf(meta3, workflowRunId) {
|
|
140803
|
-
if (meta3.isFork === true || meta3.agentType === FORK_AGENT_TYPE) {
|
|
140804
|
-
return "fork";
|
|
140805
|
-
}
|
|
140806
|
-
if (workflowRunId !== void 0 || meta3.agentType === WORKFLOW_AGENT_TYPE) {
|
|
140807
|
-
return "workflow-agent";
|
|
140808
|
-
}
|
|
140809
|
-
if (meta3.taskKind === TEAMMATE_TASK_KIND || meta3.teamName !== void 0) {
|
|
140810
|
-
return "teammate";
|
|
140811
|
-
}
|
|
140812
|
-
return "subagent";
|
|
140813
|
-
}
|
|
140814
|
-
function toNode(read, children) {
|
|
140815
|
-
const { located, meta: meta3 } = read;
|
|
140816
|
-
return {
|
|
140817
|
-
id: located.id,
|
|
140818
|
-
kind: kindOf(meta3, located.workflowRunId),
|
|
140819
|
-
agentType: meta3.agentType,
|
|
140820
|
-
...meta3.description === void 0 ? {} : { description: meta3.description },
|
|
140821
|
-
...meta3.name === void 0 ? {} : { name: meta3.name },
|
|
140822
|
-
...meta3.toolUseId === void 0 ? {} : { toolUseId: meta3.toolUseId },
|
|
140823
|
-
...meta3.spawnDepth === void 0 ? {} : { spawnDepth: meta3.spawnDepth },
|
|
140824
|
-
...meta3.model === void 0 ? {} : { model: meta3.model },
|
|
140825
|
-
...meta3.requestShape === void 0 ? {} : { background: meta3.requestShape === BACKGROUND_REQUEST_SHAPE },
|
|
140826
|
-
...located.workflowRunId === void 0 ? {} : { workflowRunId: located.workflowRunId },
|
|
140827
|
-
...meta3.workflowPhase === void 0 ? {} : { workflowPhase: meta3.workflowPhase },
|
|
140828
|
-
...meta3.teamName === void 0 ? {} : { teamName: meta3.teamName },
|
|
140829
|
-
...meta3.stoppedByUser === void 0 ? {} : { stoppedByUser: meta3.stoppedByUser },
|
|
140830
|
-
transcript: located.transcriptPath,
|
|
140831
|
-
children
|
|
140832
|
-
};
|
|
140833
|
-
}
|
|
140834
|
-
function describeFailure(error63) {
|
|
140835
|
-
return error63 instanceof Error ? error63.message : String(error63);
|
|
140836
|
-
}
|
|
140837
|
-
function readFileOrReport(fs22, configDir, relative, report) {
|
|
140838
|
-
try {
|
|
140839
|
-
return fs22.readFileUtf8(import_node_path52.default.join(configDir, relative));
|
|
140840
|
-
} catch (error63) {
|
|
140841
|
-
report({ path: relative, reason: `could not be read: ${describeFailure(error63)}` });
|
|
140842
|
-
return void 0;
|
|
140843
|
-
}
|
|
140844
|
-
}
|
|
140845
|
-
function listDirOrReport(fs22, configDir, relative, report) {
|
|
140846
|
-
try {
|
|
140847
|
-
return fs22.readdir(import_node_path52.default.join(configDir, relative));
|
|
140848
|
-
} catch (error63) {
|
|
140849
|
-
report({ path: relative, reason: `could not be listed: ${describeFailure(error63)}` });
|
|
140850
|
-
return [];
|
|
140851
|
-
}
|
|
140852
|
-
}
|
|
140853
|
-
function parseJson4(text2) {
|
|
140854
|
-
try {
|
|
140855
|
-
const value2 = JSON.parse(text2);
|
|
140856
|
-
return value2;
|
|
140857
|
-
} catch {
|
|
140858
|
-
return void 0;
|
|
140859
|
-
}
|
|
140860
|
-
}
|
|
140861
|
-
var TaskFileSchema = external_exports.object({ ...TaskItemSchema.omit({ taskList: true }).shape, blocks: external_exports.array(external_exports.string()).default([]), blockedBy: external_exports.array(external_exports.string()).default([]) });
|
|
140862
|
-
var WorkflowRunFileSchema = external_exports.object({
|
|
140863
|
-
runId: external_exports.string(),
|
|
140864
|
-
workflowName: external_exports.string().optional(),
|
|
140865
|
-
status: external_exports.string().optional(),
|
|
140866
|
-
startTime: external_exports.number().optional(),
|
|
140867
|
-
phases: external_exports.array(external_exports.object({ title: external_exports.string() })).default([]),
|
|
140868
|
-
summary: external_exports.string().optional()
|
|
140869
|
-
});
|
|
140870
|
-
function summariseSession(fs22, configDir, ref) {
|
|
140871
|
-
const sessionRelative = import_node_path52.default.join(PROJECTS_DIR, ref.project, ref.entry);
|
|
140872
|
-
const subagentsRelative = import_node_path52.default.join(sessionRelative, SUBAGENTS_DIR);
|
|
140873
|
-
const workflowsUnderSubagents = import_node_path52.default.join(subagentsRelative, WORKFLOWS_DIR);
|
|
140874
|
-
const isMeta = (name) => name.startsWith(AGENT_FILE_PREFIX) && name.endsWith(META_SUFFIX);
|
|
140875
|
-
let agentCount = fs22.readdir(import_node_path52.default.join(configDir, subagentsRelative)).filter(isMeta).length;
|
|
140876
|
-
for (const runDir of fs22.readdir(import_node_path52.default.join(configDir, workflowsUnderSubagents))) {
|
|
140877
|
-
if (runDir.startsWith(WORKFLOW_RUN_PREFIX)) {
|
|
140878
|
-
agentCount += fs22.readdir(import_node_path52.default.join(configDir, workflowsUnderSubagents, runDir)).filter(isMeta).length;
|
|
140879
|
-
}
|
|
140880
|
-
}
|
|
140881
|
-
const workflowRunCount = fs22.readdir(import_node_path52.default.join(configDir, sessionRelative, WORKFLOWS_DIR)).filter((name) => name.startsWith(WORKFLOW_RUN_PREFIX) && name.endsWith(JSON_SUFFIX)).length;
|
|
140882
|
-
const transcript = fs22.lstat(import_node_path52.default.join(configDir, PROJECTS_DIR, ref.project, `${ref.entry}${TRANSCRIPT_SUFFIX}`));
|
|
140883
|
-
return { ...ref, agentCount, workflowRunCount, ...transcript === void 0 ? {} : { updatedAt: new Date(transcript.mtimeMs).toISOString() } };
|
|
140884
|
-
}
|
|
140885
|
-
function readSessionAgentTree(fs22, configDir, ref, options = {}) {
|
|
140886
|
-
const problems = [];
|
|
140887
|
-
const report = (problem) => {
|
|
140888
|
-
problems.push(problem);
|
|
140889
|
-
};
|
|
140890
|
-
const sessionRelative = import_node_path52.default.join(PROJECTS_DIR, ref.project, ref.entry);
|
|
140891
|
-
const subagentsRelative = import_node_path52.default.join(sessionRelative, SUBAGENTS_DIR);
|
|
140892
|
-
const workflowsUnderSubagents = import_node_path52.default.join(subagentsRelative, WORKFLOWS_DIR);
|
|
140893
|
-
const located = locateAgents(fs22, configDir, subagentsRelative, void 0, report);
|
|
140894
|
-
for (const runDir of listDirOrReport(fs22, configDir, workflowsUnderSubagents, report)) {
|
|
140895
|
-
if (runDir.startsWith(WORKFLOW_RUN_PREFIX)) {
|
|
140896
|
-
located.push(...locateAgents(fs22, configDir, import_node_path52.default.join(workflowsUnderSubagents, runDir), runDir, report));
|
|
140897
|
-
}
|
|
140898
|
-
}
|
|
140899
|
-
const agents = /* @__PURE__ */ new Map();
|
|
140900
|
-
for (const candidate of located) {
|
|
140901
|
-
const text2 = readFileOrReport(fs22, configDir, candidate.metaPath, report);
|
|
140902
|
-
if (text2 === void 0) {
|
|
140903
|
-
continue;
|
|
140904
|
-
}
|
|
140905
|
-
const parsed = AgentMetaSchema.safeParse(parseJson4(text2));
|
|
140906
|
-
if (!parsed.success) {
|
|
140907
|
-
report({ path: candidate.metaPath, reason: "meta file is not a JSON object with an agentType" });
|
|
140908
|
-
continue;
|
|
140909
|
-
}
|
|
140910
|
-
agents.set(candidate.id, { located: candidate, meta: parsed.data });
|
|
140911
|
-
}
|
|
140912
|
-
const teamNames = [...new Set([...agents.values()].flatMap((agent) => agent.meta.teamName === void 0 ? [] : [agent.meta.teamName]))].sort();
|
|
140913
|
-
const parentOf4 = resolveParents(fs22, configDir, agents, report);
|
|
140914
|
-
const childrenOf = /* @__PURE__ */ new Map();
|
|
140915
|
-
const roots = [];
|
|
140916
|
-
for (const id2 of agents.keys()) {
|
|
140917
|
-
const parent = parentOf4.get(id2);
|
|
140918
|
-
if (parent === void 0) {
|
|
140919
|
-
roots.push(id2);
|
|
140920
|
-
} else {
|
|
140921
|
-
childrenOf.set(parent, [...childrenOf.get(parent) ?? [], id2]);
|
|
140922
|
-
}
|
|
140923
|
-
}
|
|
140924
|
-
const build = (id2) => {
|
|
140925
|
-
const read = agents.get(id2);
|
|
140926
|
-
if (read === void 0) {
|
|
140927
|
-
throw new Error(`agent ${id2} is in the tree but was never read`);
|
|
140928
|
-
}
|
|
140929
|
-
return toNode(read, (childrenOf.get(id2) ?? []).sort().map(build));
|
|
140930
|
-
};
|
|
140931
|
-
return {
|
|
140932
|
-
project: ref.project,
|
|
140933
|
-
sessionId: ref.sessionId,
|
|
140934
|
-
superseded: ref.superseded,
|
|
140935
|
-
agents: roots.sort().map(build),
|
|
140936
|
-
tasks: readTasks(fs22, configDir, ownTaskLists(ref.sessionId), [.../* @__PURE__ */ new Set([...teamNames, ...options.taskListIds ?? []])].filter((id2) => !ownTaskLists(ref.sessionId).includes(id2)), report),
|
|
140937
|
-
workflowRuns: readWorkflowRuns(fs22, configDir, import_node_path52.default.join(sessionRelative, WORKFLOWS_DIR), report),
|
|
140938
|
-
problems
|
|
140939
|
-
};
|
|
140940
|
-
}
|
|
140941
|
-
function resolveParents(fs22, configDir, agents, report) {
|
|
140942
|
-
const parentOf4 = /* @__PURE__ */ new Map();
|
|
140943
|
-
const transcriptCache = /* @__PURE__ */ new Map();
|
|
140944
|
-
const transcriptOf = (agent) => {
|
|
140945
|
-
const cached2 = transcriptCache.get(agent.located.id);
|
|
140946
|
-
if (cached2 !== void 0) {
|
|
140947
|
-
return cached2;
|
|
140948
|
-
}
|
|
140949
|
-
const text2 = readFileOrReport(fs22, configDir, agent.located.transcriptPath, report) ?? "";
|
|
140950
|
-
transcriptCache.set(agent.located.id, text2);
|
|
140951
|
-
return text2;
|
|
140952
|
-
};
|
|
140953
|
-
const wouldCycle = (child, parent) => {
|
|
140954
|
-
for (let cursor3 = parent; cursor3 !== void 0; cursor3 = parentOf4.get(cursor3)) {
|
|
140955
|
-
if (cursor3 === child) {
|
|
140956
|
-
return true;
|
|
140957
|
-
}
|
|
140958
|
-
}
|
|
140959
|
-
return false;
|
|
140960
|
-
};
|
|
140961
|
-
const attach = (child, parent) => {
|
|
140962
|
-
if (wouldCycle(child.located.id, parent)) {
|
|
140963
|
-
report({ path: child.located.metaPath, reason: `parent ${parent} would make a cycle` });
|
|
140964
|
-
return;
|
|
140965
|
-
}
|
|
140966
|
-
parentOf4.set(child.located.id, parent);
|
|
140967
|
-
};
|
|
140968
|
-
for (const agent of agents.values()) {
|
|
140969
|
-
const { meta: meta3, located } = agent;
|
|
140970
|
-
if (meta3.parentAgentId !== void 0 && agents.has(meta3.parentAgentId)) {
|
|
140971
|
-
attach(agent, meta3.parentAgentId);
|
|
140972
|
-
continue;
|
|
140973
|
-
}
|
|
140974
|
-
const depth = meta3.spawnDepth;
|
|
140975
|
-
if (depth !== void 0 && depth <= SESSION_SPAWN_DEPTH || meta3.toolUseId === void 0) {
|
|
140976
|
-
if (meta3.parentAgentId !== void 0) {
|
|
140977
|
-
report({ path: located.metaPath, reason: `parentAgentId ${meta3.parentAgentId} names no agent in this session` });
|
|
140978
|
-
}
|
|
140979
|
-
continue;
|
|
140980
|
-
}
|
|
140981
|
-
const toolUseId = meta3.toolUseId;
|
|
140982
|
-
const owners = [...agents.values()].filter(
|
|
140983
|
-
(candidate) => candidate.located.id !== located.id && (depth === void 0 || candidate.meta.spawnDepth === void 0 || candidate.meta.spawnDepth === depth - 1) && candidate.located.workflowRunId === located.workflowRunId && transcriptOf(candidate).includes(toolUseId)
|
|
140984
|
-
);
|
|
140985
|
-
const owner = owners[0];
|
|
140986
|
-
if (owners.length === 1 && owner !== void 0) {
|
|
140987
|
-
attach(agent, owner.located.id);
|
|
140988
|
-
} else if (owners.length > 1) {
|
|
140989
|
-
report({ path: located.metaPath, reason: "more than one agent transcript records the call that spawned it" });
|
|
140990
|
-
} else if (depth !== void 0) {
|
|
140991
|
-
report({ path: located.metaPath, reason: "no agent transcript records the call that spawned it" });
|
|
140992
|
-
}
|
|
140993
|
-
}
|
|
140994
|
-
return parentOf4;
|
|
140995
|
-
}
|
|
140996
|
-
function ownTaskLists(sessionId) {
|
|
140997
|
-
return [sessionId, `${SHORT_SESSION_LIST_PREFIX}${sessionId.slice(0, SHORT_SESSION_ID_LENGTH)}`];
|
|
140998
|
-
}
|
|
140999
|
-
function readTasks(fs22, configDir, ownLists, sharedLists, report) {
|
|
141000
|
-
const tasks = [];
|
|
141001
|
-
[...ownLists, ...sharedLists].forEach((scope, index) => {
|
|
141002
|
-
const relativeDir = import_node_path52.default.join(TASKS_DIR, scope);
|
|
141003
|
-
for (const name of [...listDirOrReport(fs22, configDir, relativeDir, report)].sort()) {
|
|
141004
|
-
if (name.startsWith(".") || !name.endsWith(JSON_SUFFIX)) {
|
|
141005
|
-
continue;
|
|
141006
|
-
}
|
|
141007
|
-
const relative = import_node_path52.default.join(relativeDir, name);
|
|
141008
|
-
const text2 = readFileOrReport(fs22, configDir, relative, report);
|
|
141009
|
-
const parsed = TaskFileSchema.safeParse(text2 === void 0 ? void 0 : parseJson4(text2));
|
|
141010
|
-
if (parsed.success) {
|
|
141011
|
-
tasks.push(index < ownLists.length ? parsed.data : { ...parsed.data, taskList: scope });
|
|
141012
|
-
} else if (text2 !== void 0) {
|
|
141013
|
-
report({ path: relative, reason: "task file is not a task" });
|
|
141014
|
-
}
|
|
141015
|
-
}
|
|
141016
|
-
});
|
|
141017
|
-
return tasks;
|
|
141018
|
-
}
|
|
141019
|
-
function readWorkflowRuns(fs22, configDir, relativeDir, report) {
|
|
141020
|
-
const runs = [];
|
|
141021
|
-
for (const name of [...listDirOrReport(fs22, configDir, relativeDir, report)].sort()) {
|
|
141022
|
-
if (!name.startsWith(WORKFLOW_RUN_PREFIX) || !name.endsWith(JSON_SUFFIX)) {
|
|
141023
|
-
continue;
|
|
141024
|
-
}
|
|
141025
|
-
const relative = import_node_path52.default.join(relativeDir, name);
|
|
141026
|
-
const text2 = readFileOrReport(fs22, configDir, relative, report);
|
|
141027
|
-
const parsed = WorkflowRunFileSchema.safeParse(text2 === void 0 ? void 0 : parseJson4(text2));
|
|
141028
|
-
if (!parsed.success) {
|
|
141029
|
-
if (text2 !== void 0) {
|
|
141030
|
-
report({ path: relative, reason: "workflow run file is not a run record" });
|
|
141031
|
-
}
|
|
141032
|
-
continue;
|
|
141033
|
-
}
|
|
141034
|
-
const { phases, ...rest } = parsed.data;
|
|
141035
|
-
runs.push({ ...rest, phases: phases.map((phase) => phase.title) });
|
|
141036
|
-
}
|
|
141037
|
-
return runs;
|
|
141038
|
-
}
|
|
141039
|
-
|
|
141040
|
-
// src/agents/commands.ts
|
|
141041
|
-
var realSessionFs = {
|
|
141042
|
-
...realFarmFs,
|
|
141043
|
-
realpath: (candidate) => {
|
|
141044
|
-
try {
|
|
141045
|
-
return import_node_fs20.default.realpathSync(candidate);
|
|
141046
|
-
} catch {
|
|
141047
|
-
return void 0;
|
|
141048
|
-
}
|
|
141049
|
-
}
|
|
141050
|
-
};
|
|
141051
|
-
var SessionLookupError = class extends CliError {
|
|
141052
|
-
constructor(message) {
|
|
141053
|
-
super(message);
|
|
141054
|
-
this.name = "SessionLookupError";
|
|
141055
|
-
}
|
|
141056
|
-
};
|
|
141057
|
-
function identityConfigDir(identitiesDir, identity) {
|
|
141058
|
-
return import_node_path53.default.join(identitiesDir, identity);
|
|
141059
|
-
}
|
|
141060
|
-
function historyStores(fs22, identitiesDir, identities) {
|
|
141061
|
-
const byRealPath = /* @__PURE__ */ new Map();
|
|
141062
|
-
for (const identity of identities) {
|
|
141063
|
-
const configDir = identityConfigDir(identitiesDir, identity);
|
|
141064
|
-
const real = fs22.realpath(import_node_path53.default.join(configDir, "projects"));
|
|
141065
|
-
if (real === void 0) {
|
|
141066
|
-
continue;
|
|
141067
|
-
}
|
|
141068
|
-
const store = byRealPath.get(real);
|
|
141069
|
-
if (store === void 0) {
|
|
141070
|
-
byRealPath.set(real, { configDir, identities: [identity] });
|
|
141071
|
-
} else {
|
|
141072
|
-
store.identities.push(identity);
|
|
141073
|
-
}
|
|
141074
|
-
}
|
|
141075
|
-
return [...byRealPath.values()];
|
|
141076
|
-
}
|
|
141077
|
-
function collectSessionList(fs22, identitiesDir, identities, filters) {
|
|
141078
|
-
const names = filters.identity === void 0 ? identities : identities.filter((name) => name === filters.identity);
|
|
141079
|
-
if (filters.identity !== void 0 && names.length === 0) {
|
|
141080
|
-
throw new SessionLookupError(`no identity named "${filters.identity}"`);
|
|
141081
|
-
}
|
|
141082
|
-
const sessions = [];
|
|
141083
|
-
for (const store of historyStores(fs22, identitiesDir, names)) {
|
|
141084
|
-
for (const ref of listSessions2(fs22, store.configDir)) {
|
|
141085
|
-
const summary = summariseSession(fs22, store.configDir, ref);
|
|
141086
|
-
if (filters.all === true || summary.agentCount > 0 || summary.workflowRunCount > 0) {
|
|
141087
|
-
sessions.push({ ...summary, identities: store.identities });
|
|
141088
|
-
}
|
|
141089
|
-
}
|
|
141090
|
-
}
|
|
141091
|
-
return sessions.sort((left, right) => (right.updatedAt ?? "").localeCompare(left.updatedAt ?? "") || left.sessionId.localeCompare(right.sessionId));
|
|
141092
|
-
}
|
|
141093
|
-
function locateSession(fs22, identitiesDir, identities, query, onlyIdentity) {
|
|
141094
|
-
const names = onlyIdentity === void 0 ? identities : identities.filter((name) => name === onlyIdentity);
|
|
141095
|
-
if (onlyIdentity !== void 0 && names.length === 0) {
|
|
141096
|
-
throw new SessionLookupError(`no identity named "${onlyIdentity}"`);
|
|
141097
|
-
}
|
|
141098
|
-
const matches = [];
|
|
141099
|
-
for (const store of historyStores(fs22, identitiesDir, names)) {
|
|
141100
|
-
for (const ref of listSessions2(fs22, store.configDir)) {
|
|
141101
|
-
if (ref.sessionId.startsWith(query)) {
|
|
141102
|
-
matches.push({ identities: store.identities, configDir: store.configDir, ref });
|
|
141103
|
-
}
|
|
141104
|
-
}
|
|
141105
|
-
}
|
|
141106
|
-
const exact = matches.filter((match) => match.ref.sessionId === query);
|
|
141107
|
-
const candidates = exact.length > 0 ? exact : matches;
|
|
141108
|
-
const only = candidates[0];
|
|
141109
|
-
if (candidates.length === 1 && only !== void 0) {
|
|
141110
|
-
return only;
|
|
141111
|
-
}
|
|
141112
|
-
if (candidates.length === 0) {
|
|
141113
|
-
throw new SessionLookupError(`no session matches "${query}"`);
|
|
141114
|
-
}
|
|
141115
|
-
throw new SessionLookupError(`"${query}" matches ${String(candidates.length)} sessions: ${candidates.map((match) => `${match.ref.sessionId} (${match.identities.join(", ")})`).join("; ")}; give more of the id or pass --identity`);
|
|
141116
|
-
}
|
|
141117
141222
|
function identityColumn(identities) {
|
|
141118
141223
|
const [first, ...rest] = identities;
|
|
141119
141224
|
return rest.length === 0 ? first ?? "-" : `${first ?? "-"} +${String(rest.length)}`;
|
|
@@ -141174,13 +141279,12 @@ function registerSessionCommands(program2, deps) {
|
|
|
141174
141279
|
);
|
|
141175
141280
|
withExamples(
|
|
141176
141281
|
session.command("show <session>").description("Show one session's agent tree, task list and workflow runs. Takes the session id or an unambiguous prefix of it. Read-only.").option("--identity <name>", "Look only in this identity.").option("--json", "Print the tree as JSON.").action((query, options) => {
|
|
141177
|
-
const
|
|
141178
|
-
const tree = readSessionAgentTree(realSessionFs, located.configDir, located.ref);
|
|
141282
|
+
const view = showSession(realSessionFs, paths.identitiesDir, identityNames(), query, options.identity);
|
|
141179
141283
|
if (options.json === true) {
|
|
141180
|
-
printJson({ identities:
|
|
141284
|
+
printJson({ identities: view.identities, ...view.tree });
|
|
141181
141285
|
return;
|
|
141182
141286
|
}
|
|
141183
|
-
for (const line of formatSessionTree(
|
|
141287
|
+
for (const line of formatSessionTree(view.identities, view.tree)) {
|
|
141184
141288
|
console.log(line);
|
|
141185
141289
|
}
|
|
141186
141290
|
}),
|