@tekmidian/pai 1.0.3 → 1.0.4
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/.claude-plugin/plugin.json +1 -1
- package/dist/{auto-route-B7Yu6Uam.mjs → auto-route-21GdHL70.mjs} +1 -1
- package/dist/{auto-route-CjjQqU1o.mjs → auto-route-C3S2W3Bc.mjs} +1 -1
- package/dist/{budget-Dod6rnA9.mjs → budget-BrloTOZW.mjs} +1 -1
- package/dist/{chain-7n9Gx56r.mjs → chain-D7PFur8Y.mjs} +2 -2
- package/dist/cli/index.mjs +70 -180
- package/dist/{cockpit-actions-DR9X514g.mjs → cockpit-actions-BfRMr2sm.mjs} +6 -6
- package/dist/{cockpit-actions-BBHeyEZI.mjs → cockpit-actions-OodH_vx_.mjs} +20 -18
- package/dist/{cockpit-memory--dnShXBA.mjs → cockpit-memory-teG9M8bG.mjs} +6 -6
- package/dist/config/defaults/config.yaml +6 -0
- package/dist/{controls-CPoeudou.mjs → controls-JLm6g0yP.mjs} +7 -5
- package/dist/daemon/index.mjs +18 -18
- package/dist/{daemon-DKdBNKfa.mjs → daemon-DeYImF1F.mjs} +18 -18
- package/dist/daemon-mcp/index.mjs +18 -18
- package/dist/{daemon-DPAo6WTa.mjs → daemon-nXanenDM.mjs} +21 -17
- package/dist/{detect-9CZNO0yf.mjs → detect-BLKsUOgG.mjs} +2 -2
- package/dist/{detect-D1ziFFfA.mjs → detect-Rrimh0xc.mjs} +3 -3
- package/dist/{embed-pass-DIWjA68P.mjs → embed-pass-e64AwDCa.mjs} +1 -1
- package/dist/{endreason-C577xIQz.mjs → endreason-BC-v05H_.mjs} +17 -3
- package/dist/{factory-DjAAsqr_.mjs → factory-B7nv75rC.mjs} +2 -2
- package/dist/{factory-Bsib-qDG.mjs → factory-Bs9imVMq.mjs} +2 -2
- package/dist/{fallback-DFlItw1Z.mjs → fallback-CBWpp2F2.mjs} +227 -5
- package/dist/{health-Dnym-qcT.mjs → health-C4FQmkJn.mjs} +2 -2
- package/dist/{helpers-BD6V-p9w.mjs → helpers-DSNK_1KP.mjs} +2 -2
- package/dist/{helpers-CMGjy_0N.mjs → helpers-Dz7mjTSw.mjs} +3 -3
- package/dist/hooks/capture-all-events.mjs +21 -2
- package/dist/hooks/capture-tool-output.mjs +21 -2
- package/dist/hooks/worker-pool-host.mjs +52 -9
- package/dist/hooks/worker-status-line.mjs +34 -6
- package/dist/{indexer-backend-Cll7le4P.mjs → indexer-backend-BdjeL4P8.mjs} +31 -228
- package/dist/{ipc-client-CaiGJnSM.mjs → ipc-client-CnYEF31R.mjs} +1 -1
- package/dist/{ipc-client-ZRmDKd5Z.mjs → ipc-client-DN7EvoVo.mjs} +1 -1
- package/dist/{kill-tree-EWYaEk5v.mjs → kill-tree-DleMNZX3.mjs} +2 -2
- package/dist/{kill-tree-BG7dRVtp.mjs → kill-tree-SV6hrIa3.mjs} +2 -2
- package/dist/{launch-Jh5NVeNe.mjs → launch-Di7N-J5X.mjs} +2 -2
- package/dist/{launch-CXVlZjHt.mjs → launch-DlZTKE3u.mjs} +2 -2
- package/dist/{main-config-ops-BEMpuhDz.mjs → main-config-ops-kTXR8Pyv.mjs} +1 -1
- package/dist/{main-resolver-3Ns1HPmS.mjs → main-resolver-yp_puSSb.mjs} +5 -5
- package/dist/{model-inventory-BFVSNFT3.mjs → model-inventory-h6Z9fN_o.mjs} +1 -1
- package/dist/{models-add-C1QIc1DA.mjs → models-add-TVni3A7V.mjs} +19 -19
- package/dist/{pane-audit-DKQt71s4.mjs → pane-audit-Lqy9N_Ki.mjs} +23 -5
- package/dist/{planner-BmFACdLa.mjs → planner-j77ndkBf.mjs} +11 -11
- package/dist/{postgres-BdBNkL_l.mjs → postgres-BK4FP9Zg.mjs} +1 -1
- package/dist/{postgres-C6ti4haA.mjs → postgres-DNIOQijl.mjs} +17 -7
- package/dist/{project-setup-jvfONJTQ.mjs → project-setup-CBRtFFh0.mjs} +15 -235
- package/dist/{providers-CblTFrhz.mjs → providers-C9QC0TtO.mjs} +2 -2
- package/dist/{providers-BeDiVEb-.mjs → providers-FvCLzFge.mjs} +2 -2
- package/dist/{query-feedback-BRfPtqki.mjs → query-feedback-DN52N9C5.mjs} +1 -1
- package/dist/{render-CoMvwMPs.mjs → render-B35bQTE-.mjs} +2 -2
- package/dist/{render-BYmQkuLd.mjs → render-C84BqQRC.mjs} +2 -2
- package/dist/{root-Xglu0OPD.mjs → root-C4oXlXS_.mjs} +7 -7
- package/dist/{root-FtJsxYnm.mjs → root-DD1xx_Vu.mjs} +12 -12
- package/dist/route-table-FEfDuhIV.mjs +15 -0
- package/dist/{routing-BAAST9vT.mjs → routing-DmkheCRH.mjs} +126 -8
- package/dist/{routing-CENt4HH1.mjs → routing-f2zulGwD.mjs} +1 -1
- package/dist/{run-CSC7mgPf.mjs → run-BwZKBJZZ.mjs} +25 -11
- package/dist/{scan-C_Y5W9py.mjs → scan-BBGvU5EB.mjs} +2 -2
- package/dist/{session-BeqAbNPd.mjs → session-BAhtXdxj.mjs} +11 -11
- package/dist/{session-8iqQDkqb.mjs → session-Dn5OJXlg.mjs} +20 -20
- package/dist/{session-scan-BJI_ZO8M.mjs → session-scan-B57dNuA4.mjs} +1 -1
- package/dist/{session-scan-W-gbwJHM.mjs → session-scan-DUn10MBd.mjs} +2 -2
- package/dist/session-usage-CPvXvSkw.mjs +222 -0
- package/dist/{sources-ESUkZaWv.mjs → sources-CiE3rZek.mjs} +1 -1
- package/dist/{viewer-CqozWW39.mjs → viewer-DEySE4c_.mjs} +6 -6
- package/dist/{viewer-mDXUNHNy.mjs → viewer-wfKnvnrI.mjs} +5 -5
- package/dist/{worker-config-DESkIjMF.mjs → worker-config-CO5FXLAT.mjs} +18 -18
- package/dist/{worker-config-CJhEMk19.mjs → worker-config-eY5Qy4vl.mjs} +318 -21
- package/dist/{zettelkasten-BzMm8REH.mjs → zettelkasten-_h_tUm2T.mjs} +1 -1
- package/dist/{zettelkasten-B_rRRRvD.mjs → zettelkasten-tpCRBYvH.mjs} +2 -2
- package/docs/cockpit.md +1 -0
- package/gemini-extension.json +1 -1
- package/package.json +1 -1
- package/pai-plugin.json +1 -1
- package/plugins/context-preservation/plugin.json +1 -1
- package/plugins/core/plugin.json +1 -1
- package/plugins/creative/plugin.json +1 -1
- package/plugins/observability/plugin.json +1 -1
- package/plugins/productivity/plugin.json +1 -1
- package/plugins/semantic-search/plugin.json +1 -1
- package/plugins/ui/plugin.json +1 -1
- package/plugins/zettelkasten/plugin.json +1 -1
- package/src/hooks/ts/capture-all-events.ts +15 -3
- package/src/hooks/ts/lib/raw-capture.ts +7 -0
- package/src/hooks/ts/post-tool-use/capture-tool-output.ts +13 -3
- package/dist/route-table-B7zpoypi.mjs +0 -15
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { g as paiHomePath, h as paiHomeDir } from "./runtime-paths-WsO9sJFc.mjs";
|
|
2
2
|
import { t as writeFileAtomic } from "./atomic-file-BorMa4T3.mjs";
|
|
3
|
-
import { A as providerQuotaSkipAt, F as writeWorkersSection, L as isLoopbackHostname, M as resolveCapability, N as resolveModelCapability, O as providerCostTier, P as resolveProviderKey, R as isLoopbackUrl$1, at as MAX_ROUTE_MODELS, b as nativeOrchestratorModel, c as WorkersConfigError, ct as entryProvider, dt as migrateSessionRoutes, ft as parseEntry, j as readWorkersSection, lt as findTier, m as isLocalProvider, mt as targetList, p as getProviderOrNative, pt as sessionTier, s as WORKER_CLASSES, st as classRoute, t as ANTHROPIC_NATIVE, tt as workersYamlPath, u as classModelCapability, ut as listForPolicy, vt as stripModelVariant, y as nativeAnthropicProvider, z as loopbackUrl$1 } from "./config-XpZWOYOG.mjs";
|
|
3
|
+
import { A as providerQuotaSkipAt, F as writeWorkersSection, I as LOOPBACK_HOST, L as isLoopbackHostname, M as resolveCapability, N as resolveModelCapability, O as providerCostTier, P as resolveProviderKey, R as isLoopbackUrl$1, at as MAX_ROUTE_MODELS, b as nativeOrchestratorModel, c as WorkersConfigError, ct as entryProvider, dt as migrateSessionRoutes, ft as parseEntry, j as readWorkersSection, lt as findTier, m as isLocalProvider, mt as targetList, p as getProviderOrNative, pt as sessionTier, s as WORKER_CLASSES, st as classRoute, t as ANTHROPIC_NATIVE, tt as workersYamlPath, u as classModelCapability, ut as listForPolicy, vt as stripModelVariant, y as nativeAnthropicProvider, z as loopbackUrl$1 } from "./config-XpZWOYOG.mjs";
|
|
4
4
|
import { c as loadConfig, f as readMainConfigRaw } from "./config-Bu1_vbY8.mjs";
|
|
5
5
|
import { s as routingStatePath, u as workersLogDir } from "./paths-CHifubDh.mjs";
|
|
6
6
|
import { g as isLive, v as loadStatus, y as loadStatuses } from "./status-ggJ7lgVg.mjs";
|
|
@@ -12,11 +12,11 @@ import { a as newPrefill, c as schedEnabled, f as sharedScheduler } from "./sche
|
|
|
12
12
|
import { i as effectiveCap } from "./capacity-DEveQdFV.mjs";
|
|
13
13
|
import { i as instanceNumber, l as readInstances, r as instanceEngineKey, s as pickInstance, t as endpointRegistry, u as readLiveInstances } from "./local-instances-DOxSgT_L.mjs";
|
|
14
14
|
import { c as writeLocalStatus, n as tierProviderNames, r as LOCAL_STATUS_REFRESH_MS, s as readLocalStatus, t as isLocalCandidate } from "./local-candidate-DLdwQt0s.mjs";
|
|
15
|
-
import { t as LOCAL_PROBE_TIMEOUT_MS } from "./timeouts-1MLooEBB.mjs";
|
|
15
|
+
import { n as TAILSCALE_STATUS_TIMEOUT_MS, t as LOCAL_PROBE_TIMEOUT_MS } from "./timeouts-1MLooEBB.mjs";
|
|
16
16
|
import { appendFileSync, chmodSync, closeSync, existsSync, fstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, readdirSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
17
|
-
import { createHash } from "node:crypto";
|
|
17
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
18
18
|
import { delimiter, dirname, join } from "node:path";
|
|
19
|
-
import { homedir, tmpdir } from "node:os";
|
|
19
|
+
import { homedir, networkInterfaces, tmpdir } from "node:os";
|
|
20
20
|
import { execFile, execFileSync, spawnSync } from "node:child_process";
|
|
21
21
|
import { parse, stringify } from "yaml";
|
|
22
22
|
import http from "node:http";
|
|
@@ -1664,7 +1664,7 @@ function currentSessionName(env = process.env) {
|
|
|
1664
1664
|
*/
|
|
1665
1665
|
async function registryProjectName(cwd) {
|
|
1666
1666
|
try {
|
|
1667
|
-
const { detectProject } = await import("./detect-
|
|
1667
|
+
const { detectProject } = await import("./detect-Rrimh0xc.mjs");
|
|
1668
1668
|
return (await detectProject(cwd))?.display_name || void 0;
|
|
1669
1669
|
} catch {
|
|
1670
1670
|
return;
|
|
@@ -1690,7 +1690,7 @@ async function detectSessionName(env = process.env, deps = {}) {
|
|
|
1690
1690
|
let name;
|
|
1691
1691
|
const registry = deps.registryPath ?? AIBROKER_REGISTRY;
|
|
1692
1692
|
const claudeId = env.CLAUDE_CODE_SESSION_ID?.trim();
|
|
1693
|
-
const { loadBrokerNames, transcriptCustomTitle } = await import("./session-scan-
|
|
1693
|
+
const { loadBrokerNames, transcriptCustomTitle } = await import("./session-scan-B57dNuA4.mjs");
|
|
1694
1694
|
name = resolveSession(env.ITERM_SESSION_ID ?? "", registry)?.name ?? (claudeId ? loadBrokerNames(registry, deps.mapPath).get(claudeId) ?? transcriptCustomTitle(claudeId, deps.projectsDir) : void 0) ?? await (deps.projectName ?? registryProjectName)(cwd);
|
|
1695
1695
|
cached = {
|
|
1696
1696
|
key,
|
|
@@ -2380,6 +2380,105 @@ function isTailnetOrLocalName(hostname) {
|
|
|
2380
2380
|
return hostname.endsWith(".ts.net") || /^[a-z0-9-]+$/i.test(hostname) && !/^\d+$/.test(hostname);
|
|
2381
2381
|
}
|
|
2382
2382
|
|
|
2383
|
+
//#endregion
|
|
2384
|
+
//#region src/router/cockpit-auth.ts
|
|
2385
|
+
/** The /v1 remote rule: loopback (any 127/8, ::1, v4-mapped) or the tailnet. */
|
|
2386
|
+
function defaultV1Guard(remoteAddress) {
|
|
2387
|
+
return isLoopbackAddress(remoteAddress) || inTailscaleRange(remoteAddress);
|
|
2388
|
+
}
|
|
2389
|
+
/** Strip the ::ffff: IPv4-mapped prefix (Node reports v4 peers this way on v6 sockets). */
|
|
2390
|
+
function normalizeIp(ip) {
|
|
2391
|
+
const a = (ip ?? "").trim().toLowerCase();
|
|
2392
|
+
return a.startsWith("::ffff:") ? a.slice(7) : a;
|
|
2393
|
+
}
|
|
2394
|
+
function isLoopbackAddress(ip) {
|
|
2395
|
+
const a = normalizeIp(ip);
|
|
2396
|
+
return a === "::1" || a.startsWith("127.");
|
|
2397
|
+
}
|
|
2398
|
+
function ipv4ToInt(ip) {
|
|
2399
|
+
const parts = ip.split(".");
|
|
2400
|
+
if (parts.length !== 4) return null;
|
|
2401
|
+
let out = 0;
|
|
2402
|
+
for (const p of parts) {
|
|
2403
|
+
if (!/^\d{1,3}$/.test(p)) return null;
|
|
2404
|
+
const n = Number(p);
|
|
2405
|
+
if (n > 255) return null;
|
|
2406
|
+
out = out * 256 + n;
|
|
2407
|
+
}
|
|
2408
|
+
return out;
|
|
2409
|
+
}
|
|
2410
|
+
function inTailscaleRange(ip) {
|
|
2411
|
+
const n = ipv4ToInt(normalizeIp(ip));
|
|
2412
|
+
if (n === null) return false;
|
|
2413
|
+
return (n & 4290772992) === 1681915904;
|
|
2414
|
+
}
|
|
2415
|
+
/**
|
|
2416
|
+
* router.bind → a concrete address. "loopback" (also empty/unset) is
|
|
2417
|
+
* 127.0.0.1; "tailscale" resolves the utun/tailscale interface's IPv4 inside
|
|
2418
|
+
* 100.64.0.0/10 (null when Tailscale is down); anything else must be a dotted
|
|
2419
|
+
* quad — 0.0.0.0 and every non-IPv4 value are refused (null).
|
|
2420
|
+
*/
|
|
2421
|
+
function resolveBindAddress(bind, interfaces = networkInterfaces) {
|
|
2422
|
+
const v = (bind ?? "").trim().toLowerCase();
|
|
2423
|
+
if (!v || v === "loopback") return LOOPBACK_HOST;
|
|
2424
|
+
if (v === "tailscale") {
|
|
2425
|
+
let fallback;
|
|
2426
|
+
for (const [name, addrs] of Object.entries(interfaces() ?? {})) for (const a of addrs ?? []) {
|
|
2427
|
+
if (a.family !== "IPv4" && a.family !== 4) continue;
|
|
2428
|
+
if (!inTailscaleRange(a.address)) continue;
|
|
2429
|
+
if (/^(utun|tailscale)/i.test(name)) return a.address;
|
|
2430
|
+
fallback ??= a.address;
|
|
2431
|
+
}
|
|
2432
|
+
return fallback ?? null;
|
|
2433
|
+
}
|
|
2434
|
+
if (v === "0.0.0.0" || v === "::" || v === "*") return null;
|
|
2435
|
+
return ipv4ToInt(v) !== null ? v : null;
|
|
2436
|
+
}
|
|
2437
|
+
function isCockpitPath(path) {
|
|
2438
|
+
return path === "/cockpit" || path.startsWith("/cockpit/") || path.startsWith("/api/session/");
|
|
2439
|
+
}
|
|
2440
|
+
/**
|
|
2441
|
+
* DNS-rebinding check on the Host header. Allowed: `127.0.0.1[:port]`,
|
|
2442
|
+
* `localhost[:port]`, `[::1][:port]`, the bind address itself (loopback when
|
|
2443
|
+
* `bind` is empty/"loopback"), and any entry of `extraHosts` (tailnet names;
|
|
2444
|
+
* router.allowedHosts in config.yaml). A missing or unparsable Host is
|
|
2445
|
+
* rejected — non-browser clients always send one, so accepting its absence
|
|
2446
|
+
* would hand an attacker the whole check.
|
|
2447
|
+
*/
|
|
2448
|
+
function hostAllowed(hostHeader, bind, extraHosts) {
|
|
2449
|
+
if (!hostHeader || !URL.canParse(`http://${hostHeader}`)) return false;
|
|
2450
|
+
const hostname = new URL(`http://${hostHeader}`).hostname.replace(/^\[|\]$/g, "");
|
|
2451
|
+
if (hostname === LOOPBACK_HOST || hostname === "localhost" || hostname === "::1") return true;
|
|
2452
|
+
const bindAddr = resolveBindAddress(bind);
|
|
2453
|
+
if (bindAddr && hostname === bindAddr) return true;
|
|
2454
|
+
return extraHosts.some((h) => h.trim().toLowerCase() === hostname);
|
|
2455
|
+
}
|
|
2456
|
+
/**
|
|
2457
|
+
* Cross-site check on the Origin header: no Origin passes (curl, the Claude
|
|
2458
|
+
* client); an Origin present must carry the same host:port as the Host header.
|
|
2459
|
+
*/
|
|
2460
|
+
function originAllowed(originHeader, hostHeader) {
|
|
2461
|
+
if (!originHeader) return true;
|
|
2462
|
+
if (!hostHeader || !URL.canParse(`http://${hostHeader}`) || !URL.canParse(originHeader)) return false;
|
|
2463
|
+
return new URL(originHeader).host === new URL(`http://${hostHeader}`).host;
|
|
2464
|
+
}
|
|
2465
|
+
/**
|
|
2466
|
+
* The address to show a human for a bind address: the tailnet hostname
|
|
2467
|
+
* (MagicDNS name, from `tailscale status --json`) when the address is the
|
|
2468
|
+
* machine's own Tailscale IP, else the address itself.
|
|
2469
|
+
*/
|
|
2470
|
+
async function displayHost(addr) {
|
|
2471
|
+
if (!inTailscaleRange(addr)) return addr;
|
|
2472
|
+
try {
|
|
2473
|
+
const { execFile } = await import("node:child_process");
|
|
2474
|
+
const { promisify } = await import("node:util");
|
|
2475
|
+
const { stdout } = await promisify(execFile)("tailscale", ["status", "--json"], { timeout: TAILSCALE_STATUS_TIMEOUT_MS });
|
|
2476
|
+
const self = JSON.parse(stdout).Self;
|
|
2477
|
+
if (self?.DNSName && self.TailscaleIPs?.includes(addr)) return self.DNSName.replace(/\.$/, "");
|
|
2478
|
+
} catch {}
|
|
2479
|
+
return addr;
|
|
2480
|
+
}
|
|
2481
|
+
|
|
2383
2482
|
//#endregion
|
|
2384
2483
|
//#region src/router/router.ts
|
|
2385
2484
|
/**
|
|
@@ -2821,6 +2920,25 @@ function routerHandler(loadProviders = () => withTierProviders(readWorkersSectio
|
|
|
2821
2920
|
log(`${(/* @__PURE__ */ new Date()).toISOString()} warning: model id ${model} is declared by several providers (${cands.join(", ")}); preferring one that is up`);
|
|
2822
2921
|
};
|
|
2823
2922
|
return (req, res) => {
|
|
2923
|
+
const hosts = options?.hosts;
|
|
2924
|
+
if (hosts) {
|
|
2925
|
+
const path = (req.url ?? "/").split("?")[0];
|
|
2926
|
+
const mutating = [
|
|
2927
|
+
"POST",
|
|
2928
|
+
"PUT",
|
|
2929
|
+
"PATCH",
|
|
2930
|
+
"DELETE"
|
|
2931
|
+
].includes((req.method ?? "GET").toUpperCase());
|
|
2932
|
+
if (isCockpitPath(path) || mutating) {
|
|
2933
|
+
const refuse = (error) => {
|
|
2934
|
+
res.writeHead(403, { "content-type": "application/json" });
|
|
2935
|
+
res.end(JSON.stringify({ error }));
|
|
2936
|
+
log(`${(/* @__PURE__ */ new Date()).toISOString()} ${req.method ?? "-"} ${path} 403 ${error}`);
|
|
2937
|
+
};
|
|
2938
|
+
if (!hostAllowed(req.headers.host, hosts.bind, hosts.extraHosts)) return refuse("host not allowed");
|
|
2939
|
+
if (!originAllowed(req.headers.origin, req.headers.host)) return refuse("origin not allowed");
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2824
2942
|
if (extra?.(req, res)) return;
|
|
2825
2943
|
const guard = options?.remoteAllowed;
|
|
2826
2944
|
if (guard && !guard(req.socket.remoteAddress ?? void 0)) {
|
|
@@ -5907,5 +6025,5 @@ function resolveCapabilityRun(config, capability) {
|
|
|
5907
6025
|
}
|
|
5908
6026
|
|
|
5909
6027
|
//#endregion
|
|
5910
|
-
export { parseFootprint as $,
|
|
5911
|
-
//# sourceMappingURL=routing-
|
|
6028
|
+
export { parseFootprint as $, splitBySessionKind as $n, POLICY_MODES as $t, budgetSkipReason as A, findSetup as An, hostAllowed as At, MODEL_INVENTORY_MAX_AGE_MS as B, parkConfigFrom as Bn, parseSelector as Bt, detectSessionProvider as C, providerHostPort as Cn, removeRunSettings as Ct, budgetExceeded as D, PORT_TIMEOUT_MS as Dn, routerPort as Dt, budgetCache as E, startLocalStatusRefresh as En, routerHandler as Et, LimitsCache as F, setupProfile as Fn, applyPolicyToRoutes as Ft, fmtMem as G, aggregateBySession as Gn, routeText as Gt, ProbeHold as H, sharedParker as Hn, resolveSessionArg as Ht, buildSpeed as I, setupWorkersLabel as In, clearSessionRoute as It, inventoryRows as J, formatStats as Jn, sessionStartTarget as Jt, fmtMemMapped as K, appendUsage as Kn, servingChip as Kt, percentile as L, setupsPath as Ln, configuredLocal as Lt, budgetWall as M, loadSaved as Mn, isTailnetOrLocalName as Mt, fetchBudgetReading as N, orchestratorLabel as Nn, loopbackRefusal as Nt, budgetFresh as O, allSetups as On, defaultV1Guard as Ot, pickBudgetWindow as P, saveSetup as Pn, TIGHT_PERCENT as Pt, modelLabel as Q, readUsage as Qn, validateRoute as Qt, DOWN_AFTER_MISSES as R, shortModel as Rn, entryLabel as Rt, applySessionProviderEnv as S, probeLoopback as Sn, gcSettingsFiles as St, BudgetCache as T, resolveRunnerProvider as Tn, duplicateModelIds as Tt, computeInventory as U, recordDuration as Un, routeChoices as Ut, MODEL_INVENTORY_REFRESH_MS as V, setParkConfigSource as Vn, resolveSelector as Vt, currentInventory as W, aggregate as Wn, routeRows as Wt, liveDeps as X, markTimeOrdered as Xn, setSessionRoute as Xt, inventoryText as Y, isTimeOrdered as Yn, setRoute as Yt, modelKind as Z, parseSince as Zn, tierFlow as Zt, resolveTarget as _, NoLocalServerError as _n, nativeRoutePreflight as _t, clearCooldown as a, parseDuration as an, readInventoryInput as at, SESSION_PROVIDER_ENV as b, localTierOrder as bn, routeLoopbackViaRouter as bt, exclusionReason as c, writePolicy as cn, writeInventory as ct, probeQuota as d, SESSION_NAME_ENV as dn, claudeCommand as dt, clearPolicy as en, usageLogFile as er, parseSizeMb as et, quotaExceeded as f, getProfile as fn, claudeSettingsExtra as ft, resolveCapabilityRun as g, LOCAL_MECHANISM_LINE as gn, nativeLaunchSettingsArgs as gt, recordBudgetCooldowns as h, updateProfile as hn, nativeLaunchEnv as ht, capabilityForRun as i, onBattery as in, readInventory as it, budgetUntilLabel as j, httpModelsCheck as jn, resolveBindAddress as jt, budgetFull as k, downLocalProviders as kn, displayHost as kt, isQuotaFailure as l, detectSessionName as ln, addSchedulingHeaders as lt, readRoutingState as m, readProfiles as mn, loopbackRouterChoice as mt, NoProviderError as n, fallThroughReason as nn, processTreeMemory as nt, cooldownRemaining as o, readPolicy as on, readModelLabels as ot, quotaSkipThreshold as p, profilesPath as pn, isLoopbackProvider as pt, inventoryPath as q, formatSessionStats as qn, sessionRoutesPatch as qt, autoOrder as r, findLocal as rn, processTreeRssMb as rt, entryModel as s, routeRun as sn, startInventoryRefresh as st, BUDGET_COOLDOWN_MIN as t, committedFallThrough as tn, parseTable as tt, nextAutoProvider as u, BATCH_ENV as un, buildRunEnv as ut, setCooldown as v, currentLocalStatus as vn, pinnedSettings as vt, BUDGET_TTL_MS as w, resolveLocalProvider as wn, writePrivateFile as wt, SESSION_WORKER_PROVIDER_ENV as x, pickLocal as xn, routeVerdictLine as xt, writeRoutingState as y, localProviderForDelegation as yn, pinnedSettingsArgs as yt, INVENTORY_HEADERS as z, workersLabel as zn, flowText as zt };
|
|
6029
|
+
//# sourceMappingURL=routing-DmkheCRH.mjs.map
|
|
@@ -3,7 +3,7 @@ import "./config-Bu1_vbY8.mjs";
|
|
|
3
3
|
import "./paths-CHifubDh.mjs";
|
|
4
4
|
import "./status-ggJ7lgVg.mjs";
|
|
5
5
|
import "./scope-D-h6F6DN.mjs";
|
|
6
|
-
import { _ as resolveTarget, a as clearCooldown, c as exclusionReason, d as probeQuota, f as quotaExceeded, g as resolveCapabilityRun, h as recordBudgetCooldowns, i as capabilityForRun, l as isQuotaFailure, m as readRoutingState, n as NoProviderError, o as cooldownRemaining, p as quotaSkipThreshold, r as autoOrder, s as entryModel, t as BUDGET_COOLDOWN_MIN, u as nextAutoProvider, v as setCooldown, y as writeRoutingState } from "./routing-
|
|
6
|
+
import { _ as resolveTarget, a as clearCooldown, c as exclusionReason, d as probeQuota, f as quotaExceeded, g as resolveCapabilityRun, h as recordBudgetCooldowns, i as capabilityForRun, l as isQuotaFailure, m as readRoutingState, n as NoProviderError, o as cooldownRemaining, p as quotaSkipThreshold, r as autoOrder, s as entryModel, t as BUDGET_COOLDOWN_MIN, u as nextAutoProvider, v as setCooldown, y as writeRoutingState } from "./routing-DmkheCRH.mjs";
|
|
7
7
|
import "./tool-errors-7E13StWd.mjs";
|
|
8
8
|
import "./wait-ByV0OyMZ.mjs";
|
|
9
9
|
import "./local-tiers-BE4jGaMa.mjs";
|
|
@@ -6,7 +6,7 @@ import { A as applyScratchEnv, C as worktreeWanted, S as worktreeSystemPrompt, _
|
|
|
6
6
|
import { C as nowStamp, D as pidAlive, E as parseSleepSecs, J as loadPreamble, Q as appendSystemPromptArgs, S as newWorkerId, X as preambleLine, Y as preambleBlock, Z as projectRoot, a as UNLABELED, d as describeTool, g as isLive, k as saveStatus, nt as shortText, rt as stripPromptValues, tt as parseRunnerArgs, v as loadStatus, x as markStartFailed, y as loadStatuses } from "./status-ggJ7lgVg.mjs";
|
|
7
7
|
import { D as readMcpServers, E as mcpServersFromToolGrants, O as writeMcpConfig, S as inputSideTokens, T as grantsChrome, d as poolIneligibleReason, g as postTaskToPool, h as poolSettings, n as SLOT_TOOLS, r as UNIT_MARKER, t as SHARED_MARKER, w as expandMcpNames, y as reloadInProgress } from "./pool-Dh-q3iJi.mjs";
|
|
8
8
|
import { i as itermUuid, o as resolveSession, s as resolveSpawnerSession } from "./scope-D-h6F6DN.mjs";
|
|
9
|
-
import { Cn as
|
|
9
|
+
import { Cn as providerHostPort, Ct as removeRunSettings, Dn as PORT_TIMEOUT_MS, Dt as routerPort, E as budgetCache, S as applySessionProviderEnv, Sn as probeLoopback, Tn as resolveRunnerProvider, _ as resolveTarget, _n as NoLocalServerError, bt as routeLoopbackViaRouter, dt as claudeCommand, fn as getProfile, ft as claudeSettingsExtra, g as resolveCapabilityRun, gn as LOCAL_MECHANISM_LINE, h as recordBudgetCooldowns, i as capabilityForRun, jn as httpModelsCheck, k as budgetFull, l as isQuotaFailure, ln as detectSessionName, lt as addSchedulingHeaders, n as NoProviderError, nn as fallThroughReason, o as cooldownRemaining, pt as isLoopbackProvider, r as autoOrder, sn as routeRun, tn as committedFallThrough, u as nextAutoProvider, un as BATCH_ENV, ut as buildRunEnv, v as setCooldown, vt as pinnedSettings, wn as resolveLocalProvider, wt as writePrivateFile, x as SESSION_WORKER_PROVIDER_ENV } from "./routing-DmkheCRH.mjs";
|
|
10
10
|
import { t as maxOf } from "./min-max-DrSRUaWQ.mjs";
|
|
11
11
|
import { b as readToolErrors, h as harnessToolErrorTexts, p as grantedToolNames, x as recordToolError } from "./tool-errors-7E13StWd.mjs";
|
|
12
12
|
import { _ as workerContractPrompt, b as killProcessTree, c as checkProof, d as parseWorkerReport, f as promptTrailer, g as verifyReportChanges, h as verifyFailNote, l as newUntracked, m as untrackedPaths, o as AG2_REASK_TEXT, s as OPERATOR_MARK, u as noteTokenSentence, v as repairAndValidateAg2, x as processTree, y as validateAg2 } from "./wait-ByV0OyMZ.mjs";
|
|
@@ -14,13 +14,13 @@ import { a as buildsDir, d as releaseBuildsOf } from "./caller-identity-yLFb7CKq
|
|
|
14
14
|
import { c as queuedText, d as resolveCap, h as staggerGate, m as recordWarmup, n as capacityGate, p as sessionScopeKey, t as admitCap } from "./capacity-DEveQdFV.mjs";
|
|
15
15
|
import { n as tierProviderNames, t as isLocalCandidate } from "./local-candidate-DLdwQt0s.mjs";
|
|
16
16
|
import { t as LOCAL_PROBE_TIMEOUT_MS } from "./timeouts-1MLooEBB.mjs";
|
|
17
|
-
import { i as getRegistryBackend } from "./factory-
|
|
18
|
-
import { c as ensureProxyRunning, i as detectCurrentModel, l as proxyPort } from "./launch-
|
|
19
|
-
import { A as tail, Et as openOwnedPane, Kt as isHandoffMessage, Q as NoTerminalError, Wt as deliverHandoff, Xt as localFailures, _ as troublePolicy, _t as paneTitle, at as headlessAllowed, d as aibrokerMessenger, f as detachRun, h as originFromEnv, ht as resolveHostSession, it as followCommand, m as markRunDone, mt as realPaneOps, nt as closePaneForWorker, o as ownerOf, p as eventLine, r as returnControlsIfHeld, ut as openVerifiedPane, v as appendRunLog, z as gatePhaseName } from "./controls-
|
|
20
|
-
import { i as endFields, o as parentInfo, r as decideEndReason } from "./endreason-
|
|
21
|
-
import { A as resolveLimit, E as armDeadline, F as checkOrphanedChildren, I as isWorkerId, L as launchParent, M as blockedMsOf, O as deadlinePromptLine, P as assertChildAllowed, T as recordDenial, k as extendLimit, w as parseDenialText } from "./render-
|
|
17
|
+
import { i as getRegistryBackend } from "./factory-B7nv75rC.mjs";
|
|
18
|
+
import { c as ensureProxyRunning, i as detectCurrentModel, l as proxyPort } from "./launch-Di7N-J5X.mjs";
|
|
19
|
+
import { A as tail, Et as openOwnedPane, Kt as isHandoffMessage, Q as NoTerminalError, Wt as deliverHandoff, Xt as localFailures, _ as troublePolicy, _t as paneTitle, at as headlessAllowed, d as aibrokerMessenger, f as detachRun, h as originFromEnv, ht as resolveHostSession, it as followCommand, m as markRunDone, mt as realPaneOps, nt as closePaneForWorker, o as ownerOf, p as eventLine, r as returnControlsIfHeld, ut as openVerifiedPane, v as appendRunLog, z as gatePhaseName } from "./controls-JLm6g0yP.mjs";
|
|
20
|
+
import { i as endFields, o as parentInfo, r as decideEndReason, t as appendStopEvent } from "./endreason-BC-v05H_.mjs";
|
|
21
|
+
import { A as resolveLimit, E as armDeadline, F as checkOrphanedChildren, I as isWorkerId, L as launchParent, M as blockedMsOf, O as deadlinePromptLine, P as assertChildAllowed, T as recordDenial, k as extendLimit, w as parseDenialText } from "./render-C84BqQRC.mjs";
|
|
22
22
|
import { t as createOperatorServer } from "./operator-CyuB3aVw.mjs";
|
|
23
|
-
import { i as killTree } from "./kill-tree-
|
|
23
|
+
import { i as killTree } from "./kill-tree-DleMNZX3.mjs";
|
|
24
24
|
import { r as ensurePoolHost } from "./pool-cli-BggU8GRp.mjs";
|
|
25
25
|
import { closeSync, existsSync, mkdirSync, mkdtempSync, openSync, readFileSync, readdirSync, realpathSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
|
|
26
26
|
import { createHash, randomBytes } from "node:crypto";
|
|
@@ -936,6 +936,11 @@ function fireDeadline(logDir, status, ledger, limit) {
|
|
|
936
936
|
minutes: limit.minutes,
|
|
937
937
|
waitedMin: waited
|
|
938
938
|
});
|
|
939
|
+
appendStopEvent(logDir, status.id, {
|
|
940
|
+
killed_by: "deadline",
|
|
941
|
+
forced: false,
|
|
942
|
+
reason: `${what} (timer: --max-minutes/--deadline, armed at spawn)`
|
|
943
|
+
});
|
|
939
944
|
killTree(logDir, status.id, {
|
|
940
945
|
skipRoot: true,
|
|
941
946
|
by: "deadline",
|
|
@@ -1063,6 +1068,15 @@ async function finaliseRun(f) {
|
|
|
1063
1068
|
loopStopped: !!loopStop
|
|
1064
1069
|
});
|
|
1065
1070
|
status.endReason = end.reason;
|
|
1071
|
+
if (end.reason === "pai-worker-kill" && !f.timedOut && end.killReason && !succeeded) {
|
|
1072
|
+
status.last = shortText(end.killReason, 90);
|
|
1073
|
+
report = {
|
|
1074
|
+
...report ?? {},
|
|
1075
|
+
result: report?.result ?? "-",
|
|
1076
|
+
why: end.killReason,
|
|
1077
|
+
notes: [end.killReason, report?.notes ?? f.fallbackText].filter(Boolean).join("\n")
|
|
1078
|
+
};
|
|
1079
|
+
}
|
|
1066
1080
|
status.claimsContinue = report?.result === "~";
|
|
1067
1081
|
saveStatus(logDir, status);
|
|
1068
1082
|
appendLedger(ledger, "WORKER-END", {
|
|
@@ -3413,8 +3427,8 @@ function resolveWorkers(args, ctx) {
|
|
|
3413
3427
|
async function liveResolveCtx(env = process.env, warm = true) {
|
|
3414
3428
|
const [{ readWorkersSection }, { budgetCache }, { readRoutingState }, { workersLogDir }] = await Promise.all([
|
|
3415
3429
|
import("./config-Cxi-aBf4.mjs"),
|
|
3416
|
-
import("./budget-
|
|
3417
|
-
import("./routing-
|
|
3430
|
+
import("./budget-BrloTOZW.mjs"),
|
|
3431
|
+
import("./routing-f2zulGwD.mjs"),
|
|
3418
3432
|
import("./paths-CFHTloSe.mjs")
|
|
3419
3433
|
]);
|
|
3420
3434
|
const { workers } = readWorkersSection();
|
|
@@ -4882,7 +4896,7 @@ async function runWorker(opts) {
|
|
|
4882
4896
|
if (gc?.length) process.stderr.write(`pai worker: archived ${gc.length} leftover worktree(s) (pai worker gc)\n`);
|
|
4883
4897
|
} catch {}
|
|
4884
4898
|
if (opts.className === "plan" && !opts._planner) {
|
|
4885
|
-
const { runPlanner } = await import("./planner-
|
|
4899
|
+
const { runPlanner } = await import("./planner-j77ndkBf.mjs");
|
|
4886
4900
|
return runPlanner(opts);
|
|
4887
4901
|
}
|
|
4888
4902
|
const parent = launchParent(opts.parent);
|
|
@@ -5106,4 +5120,4 @@ setRunWorker(runWorker);
|
|
|
5106
5120
|
|
|
5107
5121
|
//#endregion
|
|
5108
5122
|
export { routerPidFile as A, usageContextTokens as B, workerUsage as C, routerHandoverFile as D, probeRouter as E, startHandover as F, testProvider as H, paneWaiver as I, launchPane as L, routerSwapArgs as M, runRouterTick as N, routerIsStale as O, spawnRouter as P, noTerminalReasons as R, usageJson as S, projectLaunchConfig as T, endProcesses as U, printResult as V, findWorktreeOrphans as W, stopLaunchedWorkers as _, resolveWorkers as a, renderUsage as b, reportOriginWithHost as c, capture as d, dirtyPaths as f, realRunnerDeps as g, realCommitsAhead as h, liveResolveCtx as i, routerRunningPid as j, routerLogFile as k, runMessenger as l, mergeBranch as m, LocalProviderRefusedError as n, sessionWorkersLine as o, launchWorker as p, PoolRefusedError as r, finishDetached as s, runWorker as t, startDetached as u, parseWhen as v, pinNotices as w, transcriptUsage as x, priceTableText as y, recordSystemJobStart as z };
|
|
5109
|
-
//# sourceMappingURL=run-
|
|
5123
|
+
//# sourceMappingURL=run-BwZKBJZZ.mjs.map
|
|
@@ -4,7 +4,7 @@ import { a as slugify, i as parseSessionFilename, n as decodeEncodedDir, t as bu
|
|
|
4
4
|
import { D as readJsonStrict, O as writeJsonAtomic, o as expandHome } from "./config-Bu1_vbY8.mjs";
|
|
5
5
|
import { a as unregistrableReason, o as workerWorktreesRoot, r as pruneWorktreeProjects } from "./registrable-DpyTtajg.mjs";
|
|
6
6
|
import { n as ensurePaiMarker, t as discoverPaiMarkers } from "./pai-marker-BcZyJguM.mjs";
|
|
7
|
-
import { i as getRegistryBackend } from "./factory-
|
|
7
|
+
import { i as getRegistryBackend } from "./factory-B7nv75rC.mjs";
|
|
8
8
|
import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, statSync, writeFileSync } from "node:fs";
|
|
9
9
|
import { basename, join, resolve } from "node:path";
|
|
10
10
|
import { homedir } from "node:os";
|
|
@@ -718,4 +718,4 @@ async function cmdScan(opts = {}) {
|
|
|
718
718
|
|
|
719
719
|
//#endregion
|
|
720
720
|
export { resolveHome as a, upsertSession as c, scanTranscriptFolders as d, transcriptFiles as f, performScan as i, claudeProjectsDir as l, loadScanConfig as n, saveScanConfig as o, migrateScanConfig as r, upsertProject as s, cmdScan as t, findMovedProjects as u };
|
|
721
|
-
//# sourceMappingURL=scan-
|
|
721
|
+
//# sourceMappingURL=scan-BBGvU5EB.mjs.map
|
|
@@ -10,7 +10,7 @@ import "./registrable-DpyTtajg.mjs";
|
|
|
10
10
|
import "./pai-marker-BcZyJguM.mjs";
|
|
11
11
|
import "./helpers-CRuBUas3.mjs";
|
|
12
12
|
import "./scope-D-h6F6DN.mjs";
|
|
13
|
-
import "./routing-
|
|
13
|
+
import "./routing-DmkheCRH.mjs";
|
|
14
14
|
import "./tool-errors-7E13StWd.mjs";
|
|
15
15
|
import "./wait-ByV0OyMZ.mjs";
|
|
16
16
|
import "./local-tiers-BE4jGaMa.mjs";
|
|
@@ -18,18 +18,18 @@ import "./caller-identity-yLFb7CKq.mjs";
|
|
|
18
18
|
import "./capacity-DEveQdFV.mjs";
|
|
19
19
|
import "./local-instances-DOxSgT_L.mjs";
|
|
20
20
|
import "./local-candidate-DLdwQt0s.mjs";
|
|
21
|
-
import "./factory-
|
|
22
|
-
import "./postgres-
|
|
21
|
+
import "./factory-B7nv75rC.mjs";
|
|
22
|
+
import "./postgres-DNIOQijl.mjs";
|
|
23
23
|
import "./embedding-gate-6rZrWRXa.mjs";
|
|
24
24
|
import "./embeddings-BVq3esBF.mjs";
|
|
25
25
|
import "./router-CQSc3lk3.mjs";
|
|
26
|
-
import "./detect-
|
|
27
|
-
import "./helpers-
|
|
28
|
-
import "./scan-
|
|
29
|
-
import { a as newTop, c as planOpen, d as runNewDefault, f as sessionCommand, i as lsCommand, l as renameTop, n as collectRows, o as oneLine, p as sessionDir, r as collectView, s as openTop, t as applyProfileChat, u as rowsTable } from "./session-
|
|
30
|
-
import "./launch-
|
|
31
|
-
import "./health-
|
|
32
|
-
import "./launch-
|
|
33
|
-
import "./session-scan-
|
|
26
|
+
import "./detect-BLKsUOgG.mjs";
|
|
27
|
+
import "./helpers-DSNK_1KP.mjs";
|
|
28
|
+
import "./scan-BBGvU5EB.mjs";
|
|
29
|
+
import { a as newTop, c as planOpen, d as runNewDefault, f as sessionCommand, i as lsCommand, l as renameTop, n as collectRows, o as oneLine, p as sessionDir, r as collectView, s as openTop, t as applyProfileChat, u as rowsTable } from "./session-Dn5OJXlg.mjs";
|
|
30
|
+
import "./launch-Di7N-J5X.mjs";
|
|
31
|
+
import "./health-C4FQmkJn.mjs";
|
|
32
|
+
import "./launch-DlZTKE3u.mjs";
|
|
33
|
+
import "./session-scan-DUn10MBd.mjs";
|
|
34
34
|
|
|
35
35
|
export { runNewDefault };
|
|
@@ -6,17 +6,17 @@ import { M as trustProjectPath } from "./pool-Dh-q3iJi.mjs";
|
|
|
6
6
|
import { a as unregistrableReason } from "./registrable-DpyTtajg.mjs";
|
|
7
7
|
import { n as ensurePaiMarker } from "./pai-marker-BcZyJguM.mjs";
|
|
8
8
|
import { t as STOP_WORDS } from "./stop-words-DSEYQdNe.mjs";
|
|
9
|
-
import {
|
|
9
|
+
import { dn as SESSION_NAME_ENV, fn as getProfile, x as SESSION_WORKER_PROVIDER_ENV, xt as routeVerdictLine } from "./routing-DmkheCRH.mjs";
|
|
10
10
|
import { n as OPT, t as CliError } from "./define-CjJsmq-6.mjs";
|
|
11
|
-
import { i as getRegistryBackend } from "./factory-
|
|
12
|
-
import { n as formatDetection, r as formatDetectionJson, t as detectProject } from "./detect-
|
|
13
|
-
import { a as getSessionCount, c as upsertTag$1, i as getProjectTags, n as getProject$1, o as requireProject, r as getProjectAliases, s as resolveIdentifier, t as getLastSessionDate } from "./helpers-
|
|
14
|
-
import { a as resolveHome, n as loadScanConfig } from "./scan-
|
|
15
|
-
import { n as buildLaunchPlan, o as launchableProviderNames, s as maskLaunchEnv, t as LaunchError } from "./launch-
|
|
16
|
-
import { a as colorEnabled, f as renderTable$1, i as saveBudgetSnapshot, n as readBudget, o as makeStyle, r as readBudgetSnapshot, t as providerHealth } from "./health-
|
|
17
|
-
import { d as printExitDir, i as probeResume, u as transcriptModelFor } from "./launch-
|
|
11
|
+
import { i as getRegistryBackend } from "./factory-B7nv75rC.mjs";
|
|
12
|
+
import { n as formatDetection, r as formatDetectionJson, t as detectProject } from "./detect-BLKsUOgG.mjs";
|
|
13
|
+
import { a as getSessionCount, c as upsertTag$1, i as getProjectTags, n as getProject$1, o as requireProject, r as getProjectAliases, s as resolveIdentifier, t as getLastSessionDate } from "./helpers-DSNK_1KP.mjs";
|
|
14
|
+
import { a as resolveHome, n as loadScanConfig } from "./scan-BBGvU5EB.mjs";
|
|
15
|
+
import { n as buildLaunchPlan, o as launchableProviderNames, s as maskLaunchEnv, t as LaunchError } from "./launch-Di7N-J5X.mjs";
|
|
16
|
+
import { a as colorEnabled, f as renderTable$1, i as saveBudgetSnapshot, n as readBudget, o as makeStyle, r as readBudgetSnapshot, t as providerHealth } from "./health-C4FQmkJn.mjs";
|
|
17
|
+
import { d as printExitDir, i as probeResume, u as transcriptModelFor } from "./launch-DlZTKE3u.mjs";
|
|
18
18
|
import { n as fetchLiveSessions } from "./aibroker-client-CQPGqLxL.mjs";
|
|
19
|
-
import { a as resolveSessionByNameOrId, s as scanSessions, t as fmtAge } from "./session-scan-
|
|
19
|
+
import { a as resolveSessionByNameOrId, s as scanSessions, t as fmtAge } from "./session-scan-DUn10MBd.mjs";
|
|
20
20
|
import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, statSync, writeFileSync } from "node:fs";
|
|
21
21
|
import { basename, dirname, join, resolve } from "node:path";
|
|
22
22
|
import chalk from "chalk";
|
|
@@ -1066,7 +1066,7 @@ async function getSessionTags(registryBackend, sessionId) {
|
|
|
1066
1066
|
* Session CRUD commands: list, info, rename, slug, tag, route, active, auto-route.
|
|
1067
1067
|
*/
|
|
1068
1068
|
async function cmdList(projectSlug, opts) {
|
|
1069
|
-
const { getRegistryBackend } = await import("./factory-
|
|
1069
|
+
const { getRegistryBackend } = await import("./factory-Bs9imVMq.mjs");
|
|
1070
1070
|
const registryBackend = await getRegistryBackend();
|
|
1071
1071
|
const limit = parseInt(opts.limit ?? "20", 10);
|
|
1072
1072
|
let project;
|
|
@@ -1131,7 +1131,7 @@ async function cmdList(projectSlug, opts) {
|
|
|
1131
1131
|
console.log(dim(` ${rows.length} session(s) shown (limit: ${limit})`));
|
|
1132
1132
|
}
|
|
1133
1133
|
async function cmdInfo(projectSlug, sessionNumber) {
|
|
1134
|
-
const { getRegistryBackend } = await import("./factory-
|
|
1134
|
+
const { getRegistryBackend } = await import("./factory-Bs9imVMq.mjs");
|
|
1135
1135
|
const registryBackend = await getRegistryBackend();
|
|
1136
1136
|
const project = await getProject(registryBackend, projectSlug);
|
|
1137
1137
|
if (!project) {
|
|
@@ -1155,7 +1155,7 @@ async function cmdInfo(projectSlug, sessionNumber) {
|
|
|
1155
1155
|
console.log();
|
|
1156
1156
|
}
|
|
1157
1157
|
async function cmdRename(projectSlug, numberOrLatest, newSlug) {
|
|
1158
|
-
const { getRegistryBackend } = await import("./factory-
|
|
1158
|
+
const { getRegistryBackend } = await import("./factory-Bs9imVMq.mjs");
|
|
1159
1159
|
await cmdRenameWith(await getRegistryBackend(), projectSlug, numberOrLatest, newSlug);
|
|
1160
1160
|
}
|
|
1161
1161
|
/** Strips path separators and ".." so a title can never leave the notes dir. */
|
|
@@ -1242,7 +1242,7 @@ async function cmdRenameWith(registryBackend, projectSlug, numberOrLatest, newSl
|
|
|
1242
1242
|
console.log();
|
|
1243
1243
|
}
|
|
1244
1244
|
async function cmdSlug(projectSlug, numberOrLatest, opts) {
|
|
1245
|
-
const { getRegistryBackend } = await import("./factory-
|
|
1245
|
+
const { getRegistryBackend } = await import("./factory-Bs9imVMq.mjs");
|
|
1246
1246
|
const registryBackend = await getRegistryBackend();
|
|
1247
1247
|
const project = await getProject(registryBackend, projectSlug);
|
|
1248
1248
|
if (!project) {
|
|
@@ -1272,7 +1272,7 @@ async function cmdSlug(projectSlug, numberOrLatest, opts) {
|
|
|
1272
1272
|
}
|
|
1273
1273
|
}
|
|
1274
1274
|
async function cmdTag(projectSlug, sessionNumber, rawTags) {
|
|
1275
|
-
const { getRegistryBackend } = await import("./factory-
|
|
1275
|
+
const { getRegistryBackend } = await import("./factory-Bs9imVMq.mjs");
|
|
1276
1276
|
const registryBackend = await getRegistryBackend();
|
|
1277
1277
|
const project = await getProject(registryBackend, projectSlug);
|
|
1278
1278
|
if (!project) {
|
|
@@ -1312,7 +1312,7 @@ async function cmdTag(projectSlug, sessionNumber, rawTags) {
|
|
|
1312
1312
|
console.log();
|
|
1313
1313
|
}
|
|
1314
1314
|
async function cmdRoute(projectSlug, sessionNumber, targetProjectSlug, opts) {
|
|
1315
|
-
const { getRegistryBackend } = await import("./factory-
|
|
1315
|
+
const { getRegistryBackend } = await import("./factory-Bs9imVMq.mjs");
|
|
1316
1316
|
const registryBackend = await getRegistryBackend();
|
|
1317
1317
|
const project = await getProject(registryBackend, projectSlug);
|
|
1318
1318
|
if (!project) {
|
|
@@ -1354,7 +1354,7 @@ async function cmdRoute(projectSlug, sessionNumber, targetProjectSlug, opts) {
|
|
|
1354
1354
|
console.log();
|
|
1355
1355
|
}
|
|
1356
1356
|
async function cmdActive(opts) {
|
|
1357
|
-
const { getRegistryBackend } = await import("./factory-
|
|
1357
|
+
const { getRegistryBackend } = await import("./factory-Bs9imVMq.mjs");
|
|
1358
1358
|
const registryBackend = await getRegistryBackend();
|
|
1359
1359
|
const minutes = parseInt(opts.minutes ?? "60", 10);
|
|
1360
1360
|
const cutoff = Date.now() - minutes * 60 * 1e3;
|
|
@@ -1441,8 +1441,8 @@ async function cmdActive(opts) {
|
|
|
1441
1441
|
], rows));
|
|
1442
1442
|
}
|
|
1443
1443
|
async function cmdAutoRoute(opts) {
|
|
1444
|
-
const { autoRoute, formatAutoRouteJson } = await import("./auto-route-
|
|
1445
|
-
const { getRegistryBackend, createStorageBackend } = await import("./factory-
|
|
1444
|
+
const { autoRoute, formatAutoRouteJson } = await import("./auto-route-C3S2W3Bc.mjs");
|
|
1445
|
+
const { getRegistryBackend, createStorageBackend } = await import("./factory-Bs9imVMq.mjs");
|
|
1446
1446
|
const { loadConfig } = await import("./config-DtENJ6cL.mjs");
|
|
1447
1447
|
const config = loadConfig();
|
|
1448
1448
|
const registryBackend = await getRegistryBackend();
|
|
@@ -1854,7 +1854,7 @@ const newCommand = {
|
|
|
1854
1854
|
const name = ctx.opts.name;
|
|
1855
1855
|
const withSetup = ctx.opts.with;
|
|
1856
1856
|
if (withSetup) {
|
|
1857
|
-
const { runNewWith } = await import("./root-
|
|
1857
|
+
const { runNewWith } = await import("./root-DD1xx_Vu.mjs");
|
|
1858
1858
|
return runNewWith({
|
|
1859
1859
|
dir,
|
|
1860
1860
|
with: withSetup,
|
|
@@ -1960,4 +1960,4 @@ const renameTop = {
|
|
|
1960
1960
|
|
|
1961
1961
|
//#endregion
|
|
1962
1962
|
export { cmdAdd as A, cmdRebind as B, assertAvailable as C, execHarness as D, dryRunText as E, cmdEdit as F, cmdUnarchive as H, cmdGo as I, cmdInfo$1 as L, cmdArchive as M, cmdConsolidate as N, looksLikePath as O, cmdDetect as P, cmdList$1 as R, legacy as S, buildHarness as T, findMovedPath as U, cmdTag$1 as V, cmdList as _, newTop as a, cmdSlug as b, planOpen as c, runNewDefault as d, sessionCommand as f, cmdInfo as g, cmdAutoRoute as h, lsCommand as i, cmdAlias as j, prepareDir as k, renameTop as l, cmdActive as m, collectRows as n, oneLine as o, sessionDir as p, collectView as r, openTop as s, applyProfileChat as t, rowsTable as u, cmdRename as v, modelFor as w, cmdTag as x, cmdRoute as y, cmdMove as z };
|
|
1963
|
-
//# sourceMappingURL=session-
|
|
1963
|
+
//# sourceMappingURL=session-Dn5OJXlg.mjs.map
|
|
@@ -4,6 +4,6 @@ import "./config-Bu1_vbY8.mjs";
|
|
|
4
4
|
import "./paths-CHifubDh.mjs";
|
|
5
5
|
import "./status-ggJ7lgVg.mjs";
|
|
6
6
|
import "./scope-D-h6F6DN.mjs";
|
|
7
|
-
import { a as resolveSessionByNameOrId, c as transcriptCustomTitle, i as resolveFriendlyName, n as loadBrokerNames, o as scanCacheFilePath, r as migrateSessionScanCache, s as scanSessions, t as fmtAge } from "./session-scan-
|
|
7
|
+
import { a as resolveSessionByNameOrId, c as transcriptCustomTitle, i as resolveFriendlyName, n as loadBrokerNames, o as scanCacheFilePath, r as migrateSessionScanCache, s as scanSessions, t as fmtAge } from "./session-scan-DUn10MBd.mjs";
|
|
8
8
|
|
|
9
9
|
export { loadBrokerNames, transcriptCustomTitle };
|
|
@@ -137,7 +137,7 @@ function loadBrokerNames(registryPath = AIBROKER_REGISTRY, mapPath) {
|
|
|
137
137
|
/** Build encoded_dir → root_path map from PAI registry (authoritative cwd). */
|
|
138
138
|
async function buildRegistryRootPathMap() {
|
|
139
139
|
try {
|
|
140
|
-
const { getRegistryBackend } = await import("./factory-
|
|
140
|
+
const { getRegistryBackend } = await import("./factory-Bs9imVMq.mjs");
|
|
141
141
|
const projects = await (await getRegistryBackend()).listProjects();
|
|
142
142
|
const map = /* @__PURE__ */ new Map();
|
|
143
143
|
for (const p of projects) if (p.encoded_dir) map.set(p.encoded_dir, p.root_path);
|
|
@@ -870,4 +870,4 @@ function transcriptCustomTitle(claudeSessionId, projectsDir = CLAUDE_PROJECTS_DI
|
|
|
870
870
|
|
|
871
871
|
//#endregion
|
|
872
872
|
export { resolveSessionByNameOrId as a, transcriptCustomTitle as c, resolveFriendlyName as i, loadBrokerNames as n, scanCacheFilePath as o, migrateSessionScanCache as r, scanSessions as s, fmtAge as t };
|
|
873
|
-
//# sourceMappingURL=session-scan-
|
|
873
|
+
//# sourceMappingURL=session-scan-DUn10MBd.mjs.map
|