@oxagen/cli 5.5.1-231 → 5.5.1-235
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/oxagen.mjs +423 -323
- package/package.json +1 -1
package/oxagen.mjs
CHANGED
|
@@ -4555,14 +4555,14 @@ var init_timestamp = __esm({
|
|
|
4555
4555
|
|
|
4556
4556
|
// ../../packages/tacho/src/envelope.ts
|
|
4557
4557
|
function refineTokenSourcePairs(body2, ctx2, path2 = []) {
|
|
4558
|
-
for (const
|
|
4559
|
-
const basis = `${
|
|
4560
|
-
const hasCount = body2[
|
|
4558
|
+
for (const count15 of TOKEN_SOURCE_COUNTS) {
|
|
4559
|
+
const basis = `${count15}_basis`;
|
|
4560
|
+
const hasCount = body2[count15] !== void 0;
|
|
4561
4561
|
if (hasCount === (body2[basis] !== void 0)) continue;
|
|
4562
4562
|
ctx2.addIssue({
|
|
4563
4563
|
code: external_exports.ZodIssueCode.custom,
|
|
4564
|
-
path: [...path2, hasCount ? basis :
|
|
4565
|
-
message: hasCount ? `${
|
|
4564
|
+
path: [...path2, hasCount ? basis : count15],
|
|
4565
|
+
message: hasCount ? `${count15} needs ${basis} beside it` : `${basis} names no ${count15}`
|
|
4566
4566
|
});
|
|
4567
4567
|
}
|
|
4568
4568
|
}
|
|
@@ -8040,27 +8040,27 @@ function isPaymentCardNumber(candidate) {
|
|
|
8040
8040
|
const digits2 = candidate.replace(/[ -]/g, "");
|
|
8041
8041
|
return digits2.length >= CARD_DIGITS_MIN && digits2.length <= CARD_DIGITS_MAX && /^[2-6]/.test(digits2) && passesLuhn(digits2);
|
|
8042
8042
|
}
|
|
8043
|
-
function sensitiveDataAttrs(
|
|
8044
|
-
const rules = SENSITIVE_DATA_KINDS.filter((kind) =>
|
|
8043
|
+
function sensitiveDataAttrs(count15, screen) {
|
|
8044
|
+
const rules = SENSITIVE_DATA_KINDS.filter((kind) => count15[kind] > 0).map(
|
|
8045
8045
|
(kind) => SENSITIVE_SCREEN_RULE_IDS[kind]
|
|
8046
8046
|
);
|
|
8047
8047
|
return {
|
|
8048
|
-
[SENSITIVE_DATA_ATTRS.total]: String(
|
|
8049
|
-
[SENSITIVE_DATA_ATTRS.email]: String(
|
|
8050
|
-
[SENSITIVE_DATA_ATTRS.payment_card]: String(
|
|
8048
|
+
[SENSITIVE_DATA_ATTRS.total]: String(count15.total),
|
|
8049
|
+
[SENSITIVE_DATA_ATTRS.email]: String(count15.email),
|
|
8050
|
+
[SENSITIVE_DATA_ATTRS.payment_card]: String(count15.payment_card),
|
|
8051
8051
|
[SENSITIVE_DATA_ATTRS.rules]: rules.join(","),
|
|
8052
8052
|
[SENSITIVE_DATA_ATTRS.screen]: screen
|
|
8053
8053
|
};
|
|
8054
8054
|
}
|
|
8055
8055
|
function screenSensitiveJson(value, strip) {
|
|
8056
|
-
const
|
|
8056
|
+
const count15 = { email: 0, payment_card: 0, total: 0 };
|
|
8057
8057
|
const find14 = (text6) => findSpans(text6, SENSITIVE_DETECTORS);
|
|
8058
8058
|
const next = walkJson(value, find14, strip, (span) => {
|
|
8059
8059
|
if (span.reason === "email" || span.reason === "payment_card")
|
|
8060
|
-
|
|
8061
|
-
|
|
8060
|
+
count15[span.reason] += 1;
|
|
8061
|
+
count15.total += 1;
|
|
8062
8062
|
});
|
|
8063
|
-
return { value: next, count:
|
|
8063
|
+
return { value: next, count: count15 };
|
|
8064
8064
|
}
|
|
8065
8065
|
function unrunnablePatternRefusal(policy) {
|
|
8066
8066
|
const patterns = policy?.prompt_redaction?.patterns;
|
|
@@ -8074,33 +8074,33 @@ function unrunnablePatternRefusal(policy) {
|
|
|
8074
8074
|
}
|
|
8075
8075
|
}
|
|
8076
8076
|
function promptRedactionRefusal(problems) {
|
|
8077
|
-
const
|
|
8077
|
+
const count15 = problems.length;
|
|
8078
8078
|
const first = problems[0] ?? "";
|
|
8079
|
-
const listed =
|
|
8079
|
+
const listed = count15 === 1 ? `a pattern the gateway cannot run, so the call was not sent. ${first}` : `${count15} patterns the gateway cannot run, so the call was not sent. For the first one: ${first}`;
|
|
8080
8080
|
return {
|
|
8081
8081
|
code: "prompt_redaction_unrunnable",
|
|
8082
|
-
message: `This workspace's Oxagen prompt redaction is on and lists ${listed} Ask a workspace Admin to enter ${
|
|
8082
|
+
message: `This workspace's Oxagen prompt redaction is on and lists ${listed} Ask a workspace Admin to enter ${count15 === 1 ? "it" : "them"} again under Workspace settings \u203A Agent gateway \u203A Prompt redaction.`,
|
|
8083
8083
|
source: "bundle",
|
|
8084
|
-
attrs: { "oxagen.prompt_redaction_unrunnable": String(
|
|
8084
|
+
attrs: { "oxagen.prompt_redaction_unrunnable": String(count15) }
|
|
8085
8085
|
};
|
|
8086
8086
|
}
|
|
8087
8087
|
function sensitiveRequestRefusal(request4) {
|
|
8088
8088
|
if (request4 === void 0) return void 0;
|
|
8089
|
-
const { count:
|
|
8090
|
-
if (
|
|
8089
|
+
const { count: count15 } = screenSensitiveJson(request4, false);
|
|
8090
|
+
if (count15.total === 0) return void 0;
|
|
8091
8091
|
const found = [
|
|
8092
|
-
...
|
|
8093
|
-
|
|
8092
|
+
...count15.email > 0 ? [
|
|
8093
|
+
count15.email === 1 ? "1 email address" : `${count15.email} email addresses`
|
|
8094
8094
|
] : [],
|
|
8095
|
-
...
|
|
8096
|
-
|
|
8095
|
+
...count15.payment_card > 0 ? [
|
|
8096
|
+
count15.payment_card === 1 ? "1 payment card number" : `${count15.payment_card} payment card numbers`
|
|
8097
8097
|
] : []
|
|
8098
8098
|
].join(" and ");
|
|
8099
8099
|
return {
|
|
8100
8100
|
code: "sensitive_data",
|
|
8101
8101
|
message: `This workspace's Oxagen sensitive data screen refuses a prompt that carries an email address or a payment card number, and this one carries ${found}. Remove them and send the call again.`,
|
|
8102
8102
|
source: "bundle",
|
|
8103
|
-
attrs: sensitiveDataAttrs(
|
|
8103
|
+
attrs: sensitiveDataAttrs(count15, "reject")
|
|
8104
8104
|
};
|
|
8105
8105
|
}
|
|
8106
8106
|
function applyModelRequestPrivacy(request4, policy) {
|
|
@@ -12260,9 +12260,9 @@ function frame(chunks, value) {
|
|
|
12260
12260
|
function frameText(chunks, value) {
|
|
12261
12261
|
frame(chunks, Buffer.from(value, "utf8"));
|
|
12262
12262
|
}
|
|
12263
|
-
function frameListLength(chunks,
|
|
12263
|
+
function frameListLength(chunks, count15) {
|
|
12264
12264
|
const bytes = Buffer.alloc(4);
|
|
12265
|
-
bytes.writeUInt32BE(
|
|
12265
|
+
bytes.writeUInt32BE(count15);
|
|
12266
12266
|
frame(chunks, bytes);
|
|
12267
12267
|
}
|
|
12268
12268
|
function frameOptionalText(chunks, value) {
|
|
@@ -18004,7 +18004,7 @@ function llmCallKeys(body2) {
|
|
|
18004
18004
|
finiteNumber(body2["cache_read_tokens"]),
|
|
18005
18005
|
finiteNumber(body2["cache_creation_tokens"])
|
|
18006
18006
|
];
|
|
18007
|
-
const tuple2 = counts2.some((
|
|
18007
|
+
const tuple2 = counts2.some((count15) => count15 !== void 0) ? `tuple:${str2(body2["model"]) ?? ""}|${counts2.map((count15) => count15 ?? "").join("|")}` : void 0;
|
|
18008
18008
|
return { ids, tuple: tuple2 };
|
|
18009
18009
|
}
|
|
18010
18010
|
var LLM_CALL_USAGE_KEYS, LLM_CALL_TOKEN_SOURCES, LLM_CALL_LEDGER_CAPACITY, LlmCallLedger;
|
|
@@ -27329,13 +27329,13 @@ async function countSubagents(sessionDir) {
|
|
|
27329
27329
|
const isAgent = (name2) => /^agent-.+\.jsonl$/.test(name2);
|
|
27330
27330
|
const ignore = () => {
|
|
27331
27331
|
};
|
|
27332
|
-
let
|
|
27332
|
+
let count15 = (await listDir(dir, ignore)).filter(isAgent).length;
|
|
27333
27333
|
const workflows = join15(dir, "workflows");
|
|
27334
27334
|
for (const workflow of await listDir(workflows, ignore))
|
|
27335
|
-
|
|
27335
|
+
count15 += (await listDir(join15(workflows, workflow), ignore)).filter(
|
|
27336
27336
|
isAgent
|
|
27337
27337
|
).length;
|
|
27338
|
-
return
|
|
27338
|
+
return count15;
|
|
27339
27339
|
}
|
|
27340
27340
|
async function readMeta(path2, unreadable) {
|
|
27341
27341
|
let parsed2;
|
|
@@ -32382,8 +32382,8 @@ function spawnInvocation(command2, args, platform2 = process.platform, env = pro
|
|
|
32382
32382
|
windowsVerbatimArguments: true
|
|
32383
32383
|
};
|
|
32384
32384
|
}
|
|
32385
|
-
function failure3(problem2,
|
|
32386
|
-
return { answers: Array.from({ length:
|
|
32385
|
+
function failure3(problem2, count15) {
|
|
32386
|
+
return { answers: Array.from({ length: count15 }, () => ({})), problem: problem2 };
|
|
32387
32387
|
}
|
|
32388
32388
|
function codexAppServerClient(options) {
|
|
32389
32389
|
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
@@ -32907,7 +32907,7 @@ function renderWindowsLauncher(spec, generation = "0") {
|
|
|
32907
32907
|
).join("\r\n");
|
|
32908
32908
|
const command2 = spec.command.map(cmdQuote).join(" ");
|
|
32909
32909
|
const system = "%SystemRoot%\\System32";
|
|
32910
|
-
const ping = (
|
|
32910
|
+
const ping = (count15) => `"${system}\\PING.EXE" -n ${count15} 127.0.0.1 >nul`;
|
|
32911
32911
|
return [
|
|
32912
32912
|
"@echo off",
|
|
32913
32913
|
`"${system}\\chcp.com" 65001 >nul`,
|
|
@@ -33126,7 +33126,7 @@ import { readFileSync as readFileSync12 } from "node:fs";
|
|
|
33126
33126
|
import { dirname as dirname14, resolve as resolve3 } from "node:path";
|
|
33127
33127
|
import { fileURLToPath } from "node:url";
|
|
33128
33128
|
function readVersion() {
|
|
33129
|
-
if (true) return "5.5.1-
|
|
33129
|
+
if (true) return "5.5.1-235";
|
|
33130
33130
|
try {
|
|
33131
33131
|
const here = dirname14(fileURLToPath(import.meta.url));
|
|
33132
33132
|
const pkg = JSON.parse(
|
|
@@ -35441,11 +35441,11 @@ ${list2.join("\n")}
|
|
|
35441
35441
|
*/
|
|
35442
35442
|
remove(sessionUuid2) {
|
|
35443
35443
|
const state = this.state();
|
|
35444
|
-
const
|
|
35444
|
+
const count15 = state.get(sessionUuid2)?.bodies ?? 0;
|
|
35445
35445
|
const path2 = this.pathFor(sessionUuid2);
|
|
35446
35446
|
if (existsSync15(path2)) unlinkSync10(path2);
|
|
35447
35447
|
state.delete(sessionUuid2);
|
|
35448
|
-
return
|
|
35448
|
+
return count15;
|
|
35449
35449
|
}
|
|
35450
35450
|
state() {
|
|
35451
35451
|
if (this.loaded !== void 0) return this.loaded;
|
|
@@ -36102,15 +36102,15 @@ ${lines.join("\n")}
|
|
|
36102
36102
|
}
|
|
36103
36103
|
/** Count a session and read its endpoints without keeping its history in memory. */
|
|
36104
36104
|
summary(sessionUuid2) {
|
|
36105
|
-
let
|
|
36105
|
+
let count15 = 0;
|
|
36106
36106
|
let first;
|
|
36107
36107
|
let last;
|
|
36108
36108
|
for (const event of this.eventsForward(sessionUuid2)) {
|
|
36109
36109
|
first ??= event;
|
|
36110
36110
|
last = event;
|
|
36111
|
-
|
|
36111
|
+
count15 += 1;
|
|
36112
36112
|
}
|
|
36113
|
-
return { count:
|
|
36113
|
+
return { count: count15, first, last };
|
|
36114
36114
|
}
|
|
36115
36115
|
*eventsForward(sessionUuid2) {
|
|
36116
36116
|
const path2 = this.fileFor(sessionUuid2);
|
|
@@ -38422,11 +38422,11 @@ function shippingHealth(daemon, wal, now) {
|
|
|
38422
38422
|
if (wal.unshipped === 0)
|
|
38423
38423
|
return { healthy: true, detail: "every recorded event has shipped" };
|
|
38424
38424
|
const lastError = typeof daemon["last_error"] === "string" && daemon["last_error"] !== "" ? daemon["last_error"] : void 0;
|
|
38425
|
-
const
|
|
38425
|
+
const count15 = `${wal.unshipped} event${wal.unshipped === 1 ? "" : "s"} waiting`;
|
|
38426
38426
|
if (lastError !== void 0)
|
|
38427
38427
|
return {
|
|
38428
38428
|
healthy: false,
|
|
38429
|
-
detail: `the last ingest failed, ${
|
|
38429
|
+
detail: `the last ingest failed, ${count15}: ${lastError}`
|
|
38430
38430
|
};
|
|
38431
38431
|
const lastIngest = typeof daemon["last_ingest_at"] === "string" ? Date.parse(daemon["last_ingest_at"]) : Number.NaN;
|
|
38432
38432
|
const oldest = wal.oldestUnshippedAt !== void 0 ? Date.parse(wal.oldestUnshippedAt) : Number.NaN;
|
|
@@ -38435,9 +38435,9 @@ function shippingHealth(daemon, wal, now) {
|
|
|
38435
38435
|
if (ingestStale && backlogOld)
|
|
38436
38436
|
return {
|
|
38437
38437
|
healthy: false,
|
|
38438
|
-
detail: `nothing has shipped in over ${SHIPPING_STALL_MS / 6e4} minutes, ${
|
|
38438
|
+
detail: `nothing has shipped in over ${SHIPPING_STALL_MS / 6e4} minutes, ${count15}`
|
|
38439
38439
|
};
|
|
38440
|
-
return { healthy: true, detail: `shipping, ${
|
|
38440
|
+
return { healthy: true, detail: `shipping, ${count15}` };
|
|
38441
38441
|
}
|
|
38442
38442
|
function installedCursor(execpath, deps) {
|
|
38443
38443
|
const cli = execpath !== void 0 && execpath.length > 0 && existsSync18(execpath) ? execpath : void 0;
|
|
@@ -41589,8 +41589,8 @@ async function exportCommand(options, deps) {
|
|
|
41589
41589
|
if (options.list === true || options.session === void 0) {
|
|
41590
41590
|
const rows = wals.flatMap(
|
|
41591
41591
|
(wal) => wal.sessions().map((uuid3) => {
|
|
41592
|
-
const { first, last, count:
|
|
41593
|
-
return `${uuid3} ${first?.session_id ?? "?"} ${
|
|
41592
|
+
const { first, last, count: count15 } = wal.summary(uuid3);
|
|
41593
|
+
return `${uuid3} ${first?.session_id ?? "?"} ${count15} events ${first?.ts ?? ""} .. ${last?.ts ?? ""}${last?.kind === "agent_stop" ? " locked" : ""}`;
|
|
41594
41594
|
})
|
|
41595
41595
|
);
|
|
41596
41596
|
deps.out(
|
|
@@ -45355,10 +45355,10 @@ function createMcpGateway(deps) {
|
|
|
45355
45355
|
};
|
|
45356
45356
|
}
|
|
45357
45357
|
const ceiling = ceilingOf(bundle2);
|
|
45358
|
-
const
|
|
45359
|
-
if (ceiling !== void 0 &&
|
|
45358
|
+
const count15 = toolCountOf(served2);
|
|
45359
|
+
if (ceiling !== void 0 && count15 !== void 0 && count15 > ceiling.maxTools) {
|
|
45360
45360
|
log(
|
|
45361
|
-
`mcp gateway refused tools/list: ${
|
|
45361
|
+
`mcp gateway refused tools/list: ${count15} tools exceeds ${ceiling.maxTools} for ${ceiling.modelId}`
|
|
45362
45362
|
);
|
|
45363
45363
|
recordCall(
|
|
45364
45364
|
request4,
|
|
@@ -45373,11 +45373,11 @@ function createMcpGateway(deps) {
|
|
|
45373
45373
|
body: rpcError(
|
|
45374
45374
|
id2,
|
|
45375
45375
|
RPC_REFUSED,
|
|
45376
|
-
tooManyToolsMessage(ceiling,
|
|
45376
|
+
tooManyToolsMessage(ceiling, count15),
|
|
45377
45377
|
{
|
|
45378
45378
|
modelId: ceiling.modelId,
|
|
45379
45379
|
maxTools: ceiling.maxTools,
|
|
45380
|
-
toolCount:
|
|
45380
|
+
toolCount: count15
|
|
45381
45381
|
}
|
|
45382
45382
|
)
|
|
45383
45383
|
});
|
|
@@ -49431,14 +49431,14 @@ function rowsOf(entries2, counts2, root, uncommitted) {
|
|
|
49431
49431
|
for (const entry2 of entries2) {
|
|
49432
49432
|
const status2 = statusOf(entry2.code);
|
|
49433
49433
|
if (status2 === void 0) continue;
|
|
49434
|
-
const
|
|
49434
|
+
const count15 = counts2.get(entry2.path);
|
|
49435
49435
|
const left = uncommitted?.get(entry2.path);
|
|
49436
49436
|
out.push({
|
|
49437
49437
|
path: absoluteIn(root, entry2.path),
|
|
49438
49438
|
repo_relative_path: root === void 0 ? "" : entry2.path,
|
|
49439
49439
|
status: status2,
|
|
49440
|
-
lines_added:
|
|
49441
|
-
lines_removed:
|
|
49440
|
+
lines_added: count15?.added ?? 0,
|
|
49441
|
+
lines_removed: count15?.removed ?? 0,
|
|
49442
49442
|
...uncommitted === void 0 ? {} : {
|
|
49443
49443
|
uncommitted_lines_added: left?.added ?? 0,
|
|
49444
49444
|
uncommitted_lines_removed: left?.removed ?? 0
|
|
@@ -50584,16 +50584,16 @@ async function contributionOf(exec4, cwd, root, repoRelative, entry2, copies) {
|
|
|
50584
50584
|
if (kept === void 0 || kept === "absent" || kept.kind !== "file")
|
|
50585
50585
|
return void 0;
|
|
50586
50586
|
} else if (now === "absent") return void 0;
|
|
50587
|
-
const
|
|
50587
|
+
const count15 = await lineDelta(
|
|
50588
50588
|
exec4,
|
|
50589
50589
|
cwd,
|
|
50590
50590
|
copy ?? "/dev/null",
|
|
50591
50591
|
now === "absent" ? "/dev/null" : absolute
|
|
50592
50592
|
);
|
|
50593
|
-
if (
|
|
50593
|
+
if (count15 === void 0) return void 0;
|
|
50594
50594
|
return {
|
|
50595
50595
|
code: copy === null ? "A " : now === "absent" ? "D " : "M ",
|
|
50596
|
-
count:
|
|
50596
|
+
count: count15,
|
|
50597
50597
|
copy
|
|
50598
50598
|
};
|
|
50599
50599
|
}
|
|
@@ -50705,7 +50705,7 @@ async function sessionCommits(exec4, cwd, baseline, head3, firstReadAt, known) {
|
|
|
50705
50705
|
]);
|
|
50706
50706
|
if (local === void 0 || mine === void 0) return void 0;
|
|
50707
50707
|
const tests = new Map(known.tests);
|
|
50708
|
-
const
|
|
50708
|
+
const count15 = (into, commits, test) => {
|
|
50709
50709
|
for (const commit of commits)
|
|
50710
50710
|
if (commit.committedAt >= since && commit.authoredAt >= since) {
|
|
50711
50711
|
into.set(commit.sha, commit);
|
|
@@ -50713,8 +50713,8 @@ async function sessionCommits(exec4, cwd, baseline, head3, firstReadAt, known) {
|
|
|
50713
50713
|
}
|
|
50714
50714
|
};
|
|
50715
50715
|
const counted = /* @__PURE__ */ new Map();
|
|
50716
|
-
|
|
50717
|
-
|
|
50716
|
+
count15(counted, parseLog(local), "unpushed");
|
|
50717
|
+
count15(
|
|
50718
50718
|
counted,
|
|
50719
50719
|
parseLog(mine).filter((commit) => commit.email === email3),
|
|
50720
50720
|
"email"
|
|
@@ -50745,7 +50745,7 @@ async function sessionCommits(exec4, cwd, baseline, head3, firstReadAt, known) {
|
|
|
50745
50745
|
}),
|
|
50746
50746
|
UNTRACKED_COUNT_CONCURRENCY
|
|
50747
50747
|
);
|
|
50748
|
-
|
|
50748
|
+
count15(
|
|
50749
50749
|
counted,
|
|
50750
50750
|
candidates.filter((commit) => reached.has(commit.sha)),
|
|
50751
50751
|
"reflog"
|
|
@@ -50753,8 +50753,8 @@ async function sessionCommits(exec4, cwd, baseline, head3, firstReadAt, known) {
|
|
|
50753
50753
|
}
|
|
50754
50754
|
const merges = /* @__PURE__ */ new Map();
|
|
50755
50755
|
if (localMerges !== void 0 && myMerges !== void 0) {
|
|
50756
|
-
|
|
50757
|
-
|
|
50756
|
+
count15(merges, parseLog(localMerges), "unpushed");
|
|
50757
|
+
count15(
|
|
50758
50758
|
merges,
|
|
50759
50759
|
parseLog(myMerges).filter((commit) => commit.email === email3),
|
|
50760
50760
|
"email"
|
|
@@ -50880,14 +50880,14 @@ async function readSessionChanges(exec4, cwd, start, copies) {
|
|
|
50880
50880
|
if (!touched.paths.has(entry2.path)) continue;
|
|
50881
50881
|
rows.set(entry2.path, entry2.code);
|
|
50882
50882
|
baselinePaths.add(entry2.path);
|
|
50883
|
-
const
|
|
50884
|
-
if (
|
|
50883
|
+
const count15 = atBaseline?.counts.get(entry2.path);
|
|
50884
|
+
if (count15 !== void 0) counts2.set(entry2.path, count15);
|
|
50885
50885
|
}
|
|
50886
50886
|
for (const entry2 of atHead.entries) {
|
|
50887
50887
|
if (rows.has(entry2.path)) continue;
|
|
50888
50888
|
rows.set(entry2.path, entry2.code);
|
|
50889
|
-
const
|
|
50890
|
-
if (
|
|
50889
|
+
const count15 = atHead.counts.get(entry2.path);
|
|
50890
|
+
if (count15 !== void 0) counts2.set(entry2.path, count15);
|
|
50891
50891
|
}
|
|
50892
50892
|
for (const entry2 of listed)
|
|
50893
50893
|
if (entry2.code === "??" && !rows.has(entry2.path))
|
|
@@ -54126,7 +54126,7 @@ function promptText(input2) {
|
|
|
54126
54126
|
function recallContext(memories, used, max2 = ADDITIONAL_CONTEXT_MAX_CHARS) {
|
|
54127
54127
|
const room = max2 - used - (used > 0 ? CONTEXT_JOINER.length : 0);
|
|
54128
54128
|
let text6 = RECALL_HEADING;
|
|
54129
|
-
let
|
|
54129
|
+
let count15 = 0;
|
|
54130
54130
|
for (const memory of memories) {
|
|
54131
54131
|
const statement = memory.statement.replace(/\s+/g, " ").trim();
|
|
54132
54132
|
if (statement.length === 0) continue;
|
|
@@ -54134,9 +54134,9 @@ function recallContext(memories, used, max2 = ADDITIONAL_CONTEXT_MAX_CHARS) {
|
|
|
54134
54134
|
- ${statement}`;
|
|
54135
54135
|
if (text6.length + line.length > room) continue;
|
|
54136
54136
|
text6 += line;
|
|
54137
|
-
|
|
54137
|
+
count15 += 1;
|
|
54138
54138
|
}
|
|
54139
|
-
return
|
|
54139
|
+
return count15 > 0 ? { text: text6, count: count15 } : void 0;
|
|
54140
54140
|
}
|
|
54141
54141
|
async function runSteeringBundle(record2, deps) {
|
|
54142
54142
|
if (deps.runSteering === void 0) return void 0;
|
|
@@ -56401,21 +56401,21 @@ function countsOf(state) {
|
|
|
56401
56401
|
record2.counts
|
|
56402
56402
|
)) {
|
|
56403
56403
|
if (typeof paths !== "object" || paths === null) continue;
|
|
56404
|
-
for (const [path2,
|
|
56404
|
+
for (const [path2, count15] of Object.entries(
|
|
56405
56405
|
paths
|
|
56406
56406
|
))
|
|
56407
|
-
if (Number.isSafeInteger(
|
|
56408
|
-
counts2.set(keyOf(harness, path2),
|
|
56407
|
+
if (Number.isSafeInteger(count15) && count15 > 0)
|
|
56408
|
+
counts2.set(keyOf(harness, path2), count15);
|
|
56409
56409
|
}
|
|
56410
56410
|
return counts2;
|
|
56411
56411
|
}
|
|
56412
56412
|
function stateOf2(counts2) {
|
|
56413
56413
|
const byHarness = {};
|
|
56414
|
-
for (const [key,
|
|
56414
|
+
for (const [key, count15] of counts2) {
|
|
56415
56415
|
const split = key.indexOf("\n");
|
|
56416
56416
|
const harness = key.slice(0, split);
|
|
56417
56417
|
const path2 = key.slice(split + 1);
|
|
56418
|
-
(byHarness[harness] ??= {})[path2] =
|
|
56418
|
+
(byHarness[harness] ??= {})[path2] = count15;
|
|
56419
56419
|
}
|
|
56420
56420
|
return JSON.stringify({
|
|
56421
56421
|
schema: MEMORY_COUNTS_STATE_SCHEMA,
|
|
@@ -56475,19 +56475,19 @@ function createUseCountLedger(deps) {
|
|
|
56475
56475
|
let changed = false;
|
|
56476
56476
|
for (const read2 of reads) {
|
|
56477
56477
|
const present = /* @__PURE__ */ new Set();
|
|
56478
|
-
for (const { path: path2, count:
|
|
56479
|
-
if (!Number.isSafeInteger(
|
|
56478
|
+
for (const { path: path2, count: count15, lastUsedAt } of read2.counts) {
|
|
56479
|
+
if (!Number.isSafeInteger(count15) || count15 < 0) continue;
|
|
56480
56480
|
const key = keyOf(read2.harness, path2);
|
|
56481
56481
|
present.add(key);
|
|
56482
56482
|
const base2 = counts2.get(key) ?? 0;
|
|
56483
|
-
if (
|
|
56484
|
-
if (
|
|
56485
|
-
else counts2.set(key,
|
|
56483
|
+
if (count15 < base2) {
|
|
56484
|
+
if (count15 === 0) counts2.delete(key);
|
|
56485
|
+
else counts2.set(key, count15);
|
|
56486
56486
|
changed = true;
|
|
56487
56487
|
continue;
|
|
56488
56488
|
}
|
|
56489
|
-
if (
|
|
56490
|
-
const rise = Math.min(
|
|
56489
|
+
if (count15 === base2) continue;
|
|
56490
|
+
const rise = Math.min(count15 - base2, RISE_MAX);
|
|
56491
56491
|
rises.push({
|
|
56492
56492
|
harness: read2.harness,
|
|
56493
56493
|
path: path2,
|
|
@@ -56816,7 +56816,7 @@ function createMemoryReader(deps) {
|
|
|
56816
56816
|
else if (where2.kind === "outside") uploading.delete(root);
|
|
56817
56817
|
}
|
|
56818
56818
|
async function offerStored(store, memories, budget, seen, read2) {
|
|
56819
|
-
let
|
|
56819
|
+
let count15 = 0;
|
|
56820
56820
|
const paths = [];
|
|
56821
56821
|
const counts2 = [];
|
|
56822
56822
|
for (const memory of memories) {
|
|
@@ -56840,8 +56840,8 @@ function createMemoryReader(deps) {
|
|
|
56840
56840
|
read2
|
|
56841
56841
|
);
|
|
56842
56842
|
if (offered === "failed")
|
|
56843
|
-
return { sent:
|
|
56844
|
-
if (offered === "sent")
|
|
56843
|
+
return { sent: count15, failed: true, paths, counts: counts2 };
|
|
56844
|
+
if (offered === "sent") count15 += 1;
|
|
56845
56845
|
if (memory.useCount !== void 0)
|
|
56846
56846
|
counts2.push({
|
|
56847
56847
|
path: memory.path,
|
|
@@ -56849,10 +56849,10 @@ function createMemoryReader(deps) {
|
|
|
56849
56849
|
...memory.lastUsedAt !== void 0 ? { lastUsedAt: memory.lastUsedAt } : {}
|
|
56850
56850
|
});
|
|
56851
56851
|
}
|
|
56852
|
-
return { sent:
|
|
56852
|
+
return { sent: count15, failed: false, paths, counts: counts2 };
|
|
56853
56853
|
}
|
|
56854
56854
|
async function scanOnce() {
|
|
56855
|
-
let
|
|
56855
|
+
let count15 = 0;
|
|
56856
56856
|
const scans = [];
|
|
56857
56857
|
const counts2 = [];
|
|
56858
56858
|
const whole2 = [];
|
|
@@ -56876,7 +56876,7 @@ function createMemoryReader(deps) {
|
|
|
56876
56876
|
file2.read
|
|
56877
56877
|
);
|
|
56878
56878
|
if (offered === "failed") return false;
|
|
56879
|
-
if (offered === "sent")
|
|
56879
|
+
if (offered === "sent") count15 += 1;
|
|
56880
56880
|
}
|
|
56881
56881
|
return true;
|
|
56882
56882
|
}
|
|
@@ -56902,7 +56902,7 @@ function createMemoryReader(deps) {
|
|
|
56902
56902
|
if (!sends(where3)) continue;
|
|
56903
56903
|
const paths2 = [];
|
|
56904
56904
|
if (!await readFolder(location, dir, files2.names, where3, paths2))
|
|
56905
|
-
return { sent:
|
|
56905
|
+
return { sent: count15 };
|
|
56906
56906
|
whole2.push(keyOf2(location.harness, folder));
|
|
56907
56907
|
scans.push({
|
|
56908
56908
|
harness: location.harness,
|
|
@@ -56923,7 +56923,7 @@ function createMemoryReader(deps) {
|
|
|
56923
56923
|
const files2 = await list2(dir);
|
|
56924
56924
|
if (!files2.complete) complete = false;
|
|
56925
56925
|
if (!await readFolder(location, dir, files2.names, where2, paths))
|
|
56926
|
-
return { sent:
|
|
56926
|
+
return { sent: count15 };
|
|
56927
56927
|
}
|
|
56928
56928
|
if (!complete) continue;
|
|
56929
56929
|
whole2.push(prefix);
|
|
@@ -56946,8 +56946,8 @@ function createMemoryReader(deps) {
|
|
|
56946
56946
|
seen,
|
|
56947
56947
|
storeRead
|
|
56948
56948
|
);
|
|
56949
|
-
|
|
56950
|
-
if (offered.failed) return { sent:
|
|
56949
|
+
count15 += offered.sent;
|
|
56950
|
+
if (offered.failed) return { sent: count15 };
|
|
56951
56951
|
scans.push({
|
|
56952
56952
|
harness: store.harness,
|
|
56953
56953
|
root: store.root,
|
|
@@ -56967,7 +56967,7 @@ function createMemoryReader(deps) {
|
|
|
56967
56967
|
dirty = true;
|
|
56968
56968
|
}
|
|
56969
56969
|
for (const key of [...refused3.keys()]) if (gone(key)) refused3.delete(key);
|
|
56970
|
-
return { sent:
|
|
56970
|
+
return { sent: count15, scans, counts: counts2 };
|
|
56971
56971
|
}
|
|
56972
56972
|
async function sendFile(given) {
|
|
56973
56973
|
if (!isAbsolute10(given)) return "skipped";
|
|
@@ -61041,7 +61041,7 @@ function parseRequest(text6) {
|
|
|
61041
61041
|
purpose: value.input_type === "query" ? "query" : "document"
|
|
61042
61042
|
};
|
|
61043
61043
|
}
|
|
61044
|
-
function vectorsOf(text6,
|
|
61044
|
+
function vectorsOf(text6, count15) {
|
|
61045
61045
|
let body2;
|
|
61046
61046
|
try {
|
|
61047
61047
|
body2 = JSON.parse(text6);
|
|
@@ -61049,7 +61049,7 @@ function vectorsOf(text6, count14) {
|
|
|
61049
61049
|
return void 0;
|
|
61050
61050
|
}
|
|
61051
61051
|
const value = body2 ?? {};
|
|
61052
|
-
if (value.space !== OXAGEN_EMBED_SPACE || value.dimensions !== OXAGEN_EMBED_DIMENSIONS || !Array.isArray(value.vectors) || value.vectors.length !==
|
|
61052
|
+
if (value.space !== OXAGEN_EMBED_SPACE || value.dimensions !== OXAGEN_EMBED_DIMENSIONS || !Array.isArray(value.vectors) || value.vectors.length !== count15)
|
|
61053
61053
|
return void 0;
|
|
61054
61054
|
const vectors = value.vectors;
|
|
61055
61055
|
const usable = vectors.every(
|
|
@@ -63035,16 +63035,16 @@ var init_cache_keep_alive = __esm({
|
|
|
63035
63035
|
this.stop(state, `no price for ${snapshot.model}`);
|
|
63036
63036
|
return void 0;
|
|
63037
63037
|
}
|
|
63038
|
-
const
|
|
63038
|
+
const count15 = state.sent + 1;
|
|
63039
63039
|
if (!mayKeepAlive(state.sent, snapshot, price)) {
|
|
63040
63040
|
this.stop(
|
|
63041
63041
|
state,
|
|
63042
|
-
`${
|
|
63042
|
+
`${count15} keep-alive${count15 === 1 ? "" : "s"} would cost at least one rewrite of the prefix`
|
|
63043
63043
|
);
|
|
63044
63044
|
return void 0;
|
|
63045
63045
|
}
|
|
63046
63046
|
state.inFlight = true;
|
|
63047
|
-
return Promise.resolve().then(() => this.deps.send(state.session, snapshot,
|
|
63047
|
+
return Promise.resolve().then(() => this.deps.send(state.session, snapshot, count15, finding)).catch(
|
|
63048
63048
|
(error2) => ({
|
|
63049
63049
|
sent: false,
|
|
63050
63050
|
reason: error2 instanceof Error ? error2.message : String(error2)
|
|
@@ -63064,7 +63064,7 @@ var init_cache_keep_alive = __esm({
|
|
|
63064
63064
|
return;
|
|
63065
63065
|
}
|
|
63066
63066
|
snapshot.anchorAt = outcome.startedAt;
|
|
63067
|
-
state.sent =
|
|
63067
|
+
state.sent = count15;
|
|
63068
63068
|
});
|
|
63069
63069
|
}
|
|
63070
63070
|
stop(state, reason3) {
|
|
@@ -63354,9 +63354,9 @@ function modelSteeringAttributes(manifest) {
|
|
|
63354
63354
|
const json3 = JSON.stringify(manifest);
|
|
63355
63355
|
if (json3.length <= 4096) return { [MODEL_STEERING_MANIFEST_ATTR]: json3 };
|
|
63356
63356
|
const attrs2 = {};
|
|
63357
|
-
const
|
|
63358
|
-
attrs2[`${MODEL_STEERING_MANIFEST_ATTR}.parts`] = String(
|
|
63359
|
-
for (let i2 = 0; i2 <
|
|
63357
|
+
const count15 = Math.ceil(json3.length / 4096);
|
|
63358
|
+
attrs2[`${MODEL_STEERING_MANIFEST_ATTR}.parts`] = String(count15);
|
|
63359
|
+
for (let i2 = 0; i2 < count15; i2 += 1)
|
|
63360
63360
|
attrs2[`${MODEL_STEERING_MANIFEST_ATTR}.${i2}`] = json3.slice(
|
|
63361
63361
|
i2 * 4096,
|
|
63362
63362
|
(i2 + 1) * 4096
|
|
@@ -64271,7 +64271,7 @@ function createModelProxy(deps) {
|
|
|
64271
64271
|
waiting: (record2) => record2.recorder.openChildren.size > 0,
|
|
64272
64272
|
finding: () => cacheKeepAliveFinding(deps.policy().bundle),
|
|
64273
64273
|
price: (model) => resolveModelPrice(deps.policy().bundle.model_prices, "anthropic", model),
|
|
64274
|
-
send: (record2, snapshot,
|
|
64274
|
+
send: (record2, snapshot, count15, finding) => sendKeepAlive(record2, snapshot, count15, finding),
|
|
64275
64275
|
log: deps.log
|
|
64276
64276
|
});
|
|
64277
64277
|
const keepAliveTimer = setInterval(() => {
|
|
@@ -64876,7 +64876,7 @@ function createModelProxy(deps) {
|
|
|
64876
64876
|
if (timer !== void 0) clearTimeout(timer);
|
|
64877
64877
|
}
|
|
64878
64878
|
}
|
|
64879
|
-
function sendKeepAlive(record2, snapshot,
|
|
64879
|
+
function sendKeepAlive(record2, snapshot, count15, finding) {
|
|
64880
64880
|
const refusal = refusalFor2(record2, snapshot.model, false, true);
|
|
64881
64881
|
if (refusal !== void 0)
|
|
64882
64882
|
return Promise.resolve({
|
|
@@ -64977,7 +64977,7 @@ function createModelProxy(deps) {
|
|
|
64977
64977
|
const requestId = response.headers["request-id"] ?? response.headers["x-request-id"];
|
|
64978
64978
|
let readTokens = 0;
|
|
64979
64979
|
try {
|
|
64980
|
-
readTokens = sealKeepAlive(record2, snapshot,
|
|
64980
|
+
readTokens = sealKeepAlive(record2, snapshot, count15, finding, {
|
|
64981
64981
|
startedAt,
|
|
64982
64982
|
firstByteAt,
|
|
64983
64983
|
status: status2,
|
|
@@ -65022,7 +65022,7 @@ function createModelProxy(deps) {
|
|
|
65022
65022
|
sent.end(payload.body);
|
|
65023
65023
|
});
|
|
65024
65024
|
}
|
|
65025
|
-
function sealKeepAlive(record2, snapshot,
|
|
65025
|
+
function sealKeepAlive(record2, snapshot, count15, finding, answer) {
|
|
65026
65026
|
const payload = snapshot.payload;
|
|
65027
65027
|
const usage3 = {};
|
|
65028
65028
|
if (answer.responseText !== void 0) {
|
|
@@ -65104,7 +65104,7 @@ function createModelProxy(deps) {
|
|
|
65104
65104
|
[TACHO_METERING_ATTR]: TACHO_METERING_OBSERVED,
|
|
65105
65105
|
[KEEP_ALIVE_ATTR]: "1",
|
|
65106
65106
|
[KEEP_ALIVE_FINDING_ATTR]: finding,
|
|
65107
|
-
[KEEP_ALIVE_COUNT_ATTR]: String(
|
|
65107
|
+
[KEEP_ALIVE_COUNT_ATTR]: String(count15),
|
|
65108
65108
|
[KEEP_ALIVE_TTL_ATTR]: snapshot.ttl,
|
|
65109
65109
|
"oxagen.request_digest": digestBytes(payload.body),
|
|
65110
65110
|
"oxagen.request_bytes": String(payload.body.length),
|
|
@@ -72386,11 +72386,11 @@ async function initializeDaemon(options, server, port, ready, clock2) {
|
|
|
72386
72386
|
await modelProxyListener.start();
|
|
72387
72387
|
}
|
|
72388
72388
|
function quarantineFileCount() {
|
|
72389
|
-
const
|
|
72389
|
+
const count15 = readdirSync17(paths.quarantine).filter(
|
|
72390
72390
|
(name2) => name2.endsWith(".json")
|
|
72391
72391
|
).length;
|
|
72392
|
-
quarantineDepth =
|
|
72393
|
-
return
|
|
72392
|
+
quarantineDepth = count15;
|
|
72393
|
+
return count15;
|
|
72394
72394
|
}
|
|
72395
72395
|
async function refreshQuarantineDepth() {
|
|
72396
72396
|
const writes = quarantineWrites;
|
|
@@ -74425,6 +74425,47 @@ var init_workspace_switch = __esm({
|
|
|
74425
74425
|
}
|
|
74426
74426
|
});
|
|
74427
74427
|
|
|
74428
|
+
// ../../packages/tacho/src/codegraph/embedding-estimate.ts
|
|
74429
|
+
function formatTokens(tokens) {
|
|
74430
|
+
return new Intl.NumberFormat("en-US", {
|
|
74431
|
+
notation: "compact",
|
|
74432
|
+
maximumFractionDigits: 1
|
|
74433
|
+
}).format(tokens);
|
|
74434
|
+
}
|
|
74435
|
+
function describeEstimate(estimate2) {
|
|
74436
|
+
return `About ${formatTokens(estimate2.tokens)} tokens to embed ${estimate2.cards.toLocaleString("en-US")} cards.`;
|
|
74437
|
+
}
|
|
74438
|
+
function count7(value) {
|
|
74439
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 0 ? value : void 0;
|
|
74440
|
+
}
|
|
74441
|
+
async function fetchEmbeddingEstimate(fetch2, host) {
|
|
74442
|
+
try {
|
|
74443
|
+
const answer = await postToControlPlane(
|
|
74444
|
+
fetch2,
|
|
74445
|
+
host,
|
|
74446
|
+
EMBEDDING_ESTIMATE_PATH,
|
|
74447
|
+
{},
|
|
74448
|
+
AbortSignal.timeout(ESTIMATE_TIMEOUT_MS)
|
|
74449
|
+
);
|
|
74450
|
+
if (!answer.ok) return void 0;
|
|
74451
|
+
const body2 = JSON.parse(answer.text);
|
|
74452
|
+
const cards = count7(body2.cards);
|
|
74453
|
+
const tokens = count7(body2.tokens);
|
|
74454
|
+
return cards === void 0 || tokens === void 0 ? void 0 : { cards, tokens };
|
|
74455
|
+
} catch {
|
|
74456
|
+
return void 0;
|
|
74457
|
+
}
|
|
74458
|
+
}
|
|
74459
|
+
var EMBEDDING_ESTIMATE_PATH, ESTIMATE_TIMEOUT_MS;
|
|
74460
|
+
var init_embedding_estimate = __esm({
|
|
74461
|
+
"../../packages/tacho/src/codegraph/embedding-estimate.ts"() {
|
|
74462
|
+
"use strict";
|
|
74463
|
+
init_memory_upload();
|
|
74464
|
+
EMBEDDING_ESTIMATE_PATH = "/v1/tacho/codegraph/embedding-estimate";
|
|
74465
|
+
ESTIMATE_TIMEOUT_MS = 1e4;
|
|
74466
|
+
}
|
|
74467
|
+
});
|
|
74468
|
+
|
|
74428
74469
|
// ../../packages/tacho/src/codegraph/harness-entries.ts
|
|
74429
74470
|
import { existsSync as existsSync29, readFileSync as readFileSync27 } from "node:fs";
|
|
74430
74471
|
import { dirname as dirname34, join as join60 } from "node:path";
|
|
@@ -74562,6 +74603,7 @@ var init_harness_entries = __esm({
|
|
|
74562
74603
|
// ../../packages/tacho/src/codegraph/cli.ts
|
|
74563
74604
|
import { rmSync as rmSync12 } from "node:fs";
|
|
74564
74605
|
import { resolve as resolve21 } from "node:path";
|
|
74606
|
+
import { createInterface as createInterface3 } from "node:readline/promises";
|
|
74565
74607
|
async function daemonRoute(deps, route, body2) {
|
|
74566
74608
|
if (deps.daemonStream === void 0) return void 0;
|
|
74567
74609
|
const lines = [];
|
|
@@ -74705,6 +74747,42 @@ async function buildAndWait(deps, link, path2, force) {
|
|
|
74705
74747
|
);
|
|
74706
74748
|
return { started, state: done.state };
|
|
74707
74749
|
}
|
|
74750
|
+
async function askAtTerminal(question) {
|
|
74751
|
+
if (!process.stdin.isTTY) return false;
|
|
74752
|
+
const lines = createInterface3({
|
|
74753
|
+
input: process.stdin,
|
|
74754
|
+
output: process.stderr
|
|
74755
|
+
});
|
|
74756
|
+
try {
|
|
74757
|
+
return /^y(es)?$/i.test((await lines.question(question)).trim());
|
|
74758
|
+
} finally {
|
|
74759
|
+
lines.close();
|
|
74760
|
+
}
|
|
74761
|
+
}
|
|
74762
|
+
function embeddingsSwitchedOff(answer) {
|
|
74763
|
+
const supervisor = answer.supervisor;
|
|
74764
|
+
return supervisor?.embeddings === "none" && supervisor.embeddingsReason?.startsWith("embeddings_off") === true;
|
|
74765
|
+
}
|
|
74766
|
+
async function offerEmbeddings(deps, host, answer, options) {
|
|
74767
|
+
if (!embeddingsSwitchedOff(answer)) return void 0;
|
|
74768
|
+
const estimate2 = await fetchEmbeddingEstimate(deps.fetch, {
|
|
74769
|
+
api_url: host.api_url,
|
|
74770
|
+
api_key: host.api_key,
|
|
74771
|
+
host_enrollment_id: host.host_enrollment_id,
|
|
74772
|
+
deviceKey: loadOrCreateDeviceKey(deps.paths.deviceKey).key
|
|
74773
|
+
});
|
|
74774
|
+
if (estimate2 === void 0 || options.json === true) return estimate2;
|
|
74775
|
+
deps.out("Embeddings are off.");
|
|
74776
|
+
if (estimate2.tokens === 0) return estimate2;
|
|
74777
|
+
deps.out(describeEstimate(estimate2));
|
|
74778
|
+
const ask = deps.askYesNo ?? askAtTerminal;
|
|
74779
|
+
if (await ask("Turn on embeddings? [y/N] "))
|
|
74780
|
+
deps.out(
|
|
74781
|
+
"Turn them on with the Embeddings switch in Code graph settings. The switch opens a steering PR."
|
|
74782
|
+
);
|
|
74783
|
+
else deps.out("Embeddings stay off.");
|
|
74784
|
+
return estimate2;
|
|
74785
|
+
}
|
|
74708
74786
|
async function withLink(deps, host, body2) {
|
|
74709
74787
|
let opened;
|
|
74710
74788
|
try {
|
|
@@ -74738,8 +74816,20 @@ async function codegraphInit(path2, options, deps) {
|
|
|
74738
74816
|
);
|
|
74739
74817
|
const answer = await link.status();
|
|
74740
74818
|
if (options.json === true) {
|
|
74819
|
+
const embeddingEstimate = await offerEmbeddings(
|
|
74820
|
+
deps,
|
|
74821
|
+
host,
|
|
74822
|
+
answer,
|
|
74823
|
+
options
|
|
74824
|
+
);
|
|
74741
74825
|
deps.out(
|
|
74742
|
-
JSON.stringify({
|
|
74826
|
+
JSON.stringify({
|
|
74827
|
+
entries: entries2,
|
|
74828
|
+
build: built,
|
|
74829
|
+
...answer,
|
|
74830
|
+
via: link.via,
|
|
74831
|
+
...embeddingEstimate !== void 0 ? { embeddingEstimate } : {}
|
|
74832
|
+
})
|
|
74743
74833
|
);
|
|
74744
74834
|
} else {
|
|
74745
74835
|
printEntries(deps, entries2);
|
|
@@ -74748,6 +74838,7 @@ async function codegraphInit(path2, options, deps) {
|
|
|
74748
74838
|
deps.out(
|
|
74749
74839
|
"The build is still running. Run `oxagen graph status` to see when it ends."
|
|
74750
74840
|
);
|
|
74841
|
+
await offerEmbeddings(deps, host, answer, options);
|
|
74751
74842
|
}
|
|
74752
74843
|
return built.state !== "failed";
|
|
74753
74844
|
});
|
|
@@ -74798,6 +74889,7 @@ var init_cli = __esm({
|
|
|
74798
74889
|
"use strict";
|
|
74799
74890
|
init_device_key();
|
|
74800
74891
|
init_host_file();
|
|
74892
|
+
init_embedding_estimate();
|
|
74801
74893
|
init_harness_entries();
|
|
74802
74894
|
init_local();
|
|
74803
74895
|
init_supervisor();
|
|
@@ -78347,10 +78439,10 @@ function readBounded(root, relative11, limit = ARP_MAX_BLOB_BYTES) {
|
|
|
78347
78439
|
const bytes = Buffer.alloc(stat7.size);
|
|
78348
78440
|
let offset = 0;
|
|
78349
78441
|
while (offset < bytes.length) {
|
|
78350
|
-
const
|
|
78351
|
-
if (!
|
|
78442
|
+
const count15 = readSync5(fd2, bytes, offset, bytes.length - offset, offset);
|
|
78443
|
+
if (!count15)
|
|
78352
78444
|
arpFail(`The bundle file ${relative11} changed while it was read.`);
|
|
78353
|
-
offset +=
|
|
78445
|
+
offset += count15;
|
|
78354
78446
|
}
|
|
78355
78447
|
if (readSync5(fd2, Buffer.alloc(1), 0, 1, offset) !== 0)
|
|
78356
78448
|
arpFail(`The bundle file ${relative11} changed while it was read.`);
|
|
@@ -79299,12 +79391,12 @@ function readRegular(label, path2, limit) {
|
|
|
79299
79391
|
const bytes = Buffer.alloc(before.size);
|
|
79300
79392
|
let offset = 0;
|
|
79301
79393
|
while (offset < bytes.length) {
|
|
79302
|
-
const
|
|
79303
|
-
if (
|
|
79394
|
+
const count15 = readSync6(fd2, bytes, offset, bytes.length - offset, offset);
|
|
79395
|
+
if (count15 === 0)
|
|
79304
79396
|
arpFail(
|
|
79305
79397
|
`${label} ${path2} changed while it was read. Stop its writer and capture again.`
|
|
79306
79398
|
);
|
|
79307
|
-
offset +=
|
|
79399
|
+
offset += count15;
|
|
79308
79400
|
}
|
|
79309
79401
|
if (readSync6(fd2, Buffer.alloc(1), 0, 1, offset) !== 0)
|
|
79310
79402
|
arpFail(
|
|
@@ -80460,7 +80552,7 @@ var init_package = __esm({
|
|
|
80460
80552
|
"package.json"() {
|
|
80461
80553
|
package_default = {
|
|
80462
80554
|
name: "@oxagen/cli",
|
|
80463
|
-
version: "5.5.1-
|
|
80555
|
+
version: "5.5.1-235",
|
|
80464
80556
|
description: "Oxagen governance CLI: spend, source tracking, grounding, credentials, and audit (agentic coding lives in the stella CLI)",
|
|
80465
80557
|
type: "module",
|
|
80466
80558
|
main: "./dist/index.js",
|
|
@@ -83371,7 +83463,7 @@ function responseSchema(result2) {
|
|
|
83371
83463
|
source: external_exports.enum(["cloud", "local"]),
|
|
83372
83464
|
enrichment: enrichmentStateSchema,
|
|
83373
83465
|
indexedAt: external_exports.string().datetime(),
|
|
83374
|
-
behindHead: external_exports.record(repoName,
|
|
83466
|
+
behindHead: external_exports.record(repoName, count8),
|
|
83375
83467
|
budget: budgetReportSchema,
|
|
83376
83468
|
hint: external_exports.string().min(1).optional(),
|
|
83377
83469
|
restricted: external_exports.boolean().default(false),
|
|
@@ -83381,7 +83473,7 @@ function responseSchema(result2) {
|
|
|
83381
83473
|
path: ["revision"]
|
|
83382
83474
|
});
|
|
83383
83475
|
}
|
|
83384
|
-
var nodeKindSchema, edgeKindSchema, QUERY_TARGET_KINDS, queryTargetKindSchema, QUERY_PSEUDO_TARGETS, DEFAULT_BUDGET, sourceTagSchema, shortSha, unit2,
|
|
83476
|
+
var nodeKindSchema, edgeKindSchema, QUERY_TARGET_KINDS, queryTargetKindSchema, QUERY_PSEUDO_TARGETS, DEFAULT_BUDGET, sourceTagSchema, shortSha, unit2, count8, repoName, publicIdSchema, nodeTargetSchema, symbolTargetSchema, diffTargetSchema, pullRequestTargetSchema, targetSchema, atSchema, responseFormatSchema, baseRequestShape, snapshotEntrySchema, steeringSchema, enrichmentStateSchema, budgetReportSchema, excludedSchema, seedSchema, graphItemSchema, ambiguousTargetSchema;
|
|
83385
83477
|
var init_common = __esm({
|
|
83386
83478
|
"../../packages/codegraph/src/query/common.ts"() {
|
|
83387
83479
|
"use strict";
|
|
@@ -83416,7 +83508,7 @@ var init_common = __esm({
|
|
|
83416
83508
|
sourceTagSchema = external_exports.string().regex(/^[a-z][a-z0-9-]*$/, "a lowercase source tag");
|
|
83417
83509
|
shortSha = external_exports.string().regex(/^[0-9a-f]{7,64}$/, "a commit hash");
|
|
83418
83510
|
unit2 = external_exports.number().min(0).max(1);
|
|
83419
|
-
|
|
83511
|
+
count8 = external_exports.number().int().nonnegative();
|
|
83420
83512
|
repoName = external_exports.string().min(1);
|
|
83421
83513
|
publicIdSchema = external_exports.string().regex(PUBLIC_ID_PATTERN, "a public ID is gn_ and 26 base32 characters");
|
|
83422
83514
|
nodeTargetSchema = external_exports.object({
|
|
@@ -83476,8 +83568,8 @@ var init_common = __esm({
|
|
|
83476
83568
|
enrichmentStateSchema = external_exports.enum(["pending", "tagged", "complete"]);
|
|
83477
83569
|
budgetReportSchema = external_exports.object({
|
|
83478
83570
|
requested: external_exports.number().int().positive(),
|
|
83479
|
-
used:
|
|
83480
|
-
omitted: external_exports.record(external_exports.string(),
|
|
83571
|
+
used: count8,
|
|
83572
|
+
omitted: external_exports.record(external_exports.string(), count8).default({})
|
|
83481
83573
|
}).strict();
|
|
83482
83574
|
excludedSchema = external_exports.record(external_exports.string(), excludedEntrySchema);
|
|
83483
83575
|
seedSchema = external_exports.object({
|
|
@@ -83498,7 +83590,7 @@ var init_common = __esm({
|
|
|
83498
83590
|
/** `file:line`. */
|
|
83499
83591
|
at: external_exports.string().min(1).optional(),
|
|
83500
83592
|
via: edgeKindSchema.optional(),
|
|
83501
|
-
distance:
|
|
83593
|
+
distance: count8.optional(),
|
|
83502
83594
|
provenance: provenanceKindSchema.optional(),
|
|
83503
83595
|
/** What a `RELATES_TO` link means, such as `plans` or `configures`. */
|
|
83504
83596
|
relation: external_exports.string().min(1).optional(),
|
|
@@ -83510,7 +83602,7 @@ var init_common = __esm({
|
|
|
83510
83602
|
deleted: external_exports.boolean().optional(),
|
|
83511
83603
|
why: external_exports.string().optional(),
|
|
83512
83604
|
signature: external_exports.string().optional(),
|
|
83513
|
-
span: external_exports.object({ startLine:
|
|
83605
|
+
span: external_exports.object({ startLine: count8, endLine: count8 }).strict().optional()
|
|
83514
83606
|
}).strict();
|
|
83515
83607
|
ambiguousTargetSchema = external_exports.object({
|
|
83516
83608
|
error: external_exports.literal("ambiguous_target"),
|
|
@@ -83524,7 +83616,7 @@ var init_common = __esm({
|
|
|
83524
83616
|
function call(name2, request4, result2) {
|
|
83525
83617
|
return { call: name2, request: request4, result: result2, response: responseSchema(result2) };
|
|
83526
83618
|
}
|
|
83527
|
-
var unit3,
|
|
83619
|
+
var unit3, count9, names, excluded, withinSchema, testRefSchema, SEARCH_GROUPS, searchHitSchema, SEARCH_MEANING_STATES, searchMeaningStateSchema, searchCodeGraphRequest, searchCodeGraphResult, blastTargetSchema, decisionItemSchema, blastGroupsSchema, getBlastRadiusRequest, getBlastRadiusResult, listUnitTestsRequest, listUnitTestsResult, flowDataSchema, flowNodeSchema, jobStepSchema, getExecutionFlowRequest, getExecutionFlowResult, traceSpecRequest, traceSpecResult, listGoverningDecisionsBase, listGoverningDecisionsRequest, listGoverningDecisionsResult, getEnvVarsRequest, getEnvVarsResult, connectionSchema, getInfraRequest, getInfraResult, listCiJobsRequest, listCiJobsResult, scriptEffectSchema, listScriptsRequest, listScriptsResult, getApiDocsRequest, getApiDocsResult, exportOpenapiDraftRequest, exportOpenapiDraftResult, listCoChangesRequest, listCoChangesResult, rankSymbolsRequest, rankSymbolsResult, getMeaningMapRequest, getMeaningMapResult, getRepoMapRequest, getRepoMapResult, getDomainBriefRequest, getDomainBriefResult, checkChangeRequest, checkChangeResult, findDefinitionRequest, findDefinitionResult, findReferencesRequest, findReferencesResult, findImplementationsRequest, findImplementationsResult, listNeighborsRequest, listNeighborsResult, failureRefSchema, FAILURE_KINDS, failureSchema2, DATAFLOW_EDGE_KINDS, SLICE_DIRECTIONS, SLICE_ROLES, SLICE_MAX_DEPTH, SLICE_MAX_CALL_DEPTH, SLICE_DEFAULT_CALL_DEPTH, sliceStepSchema, dataflowSliceBase, getDataflowSliceRequest, dataflowLayerKey, missingLayerSchema, getDataflowSliceResult, FAULT_SIGNALS, LOCALIZE_MAX_SUSPECTS, signalEvidenceSchema, suspectSchema, localizeFaultBase, localizeFaultRequest, localizeFaultResult, INTENT_EVIDENCE_KINDS, intentEvidenceSchema, getIntendedBehaviorRequest, getIntendedBehaviorResult, REPAIR_CONTEXT_SECTIONS, REPAIR_CONTEXT_DEFAULT_BUDGET, REPAIR_CONTEXT_MIN_BUDGET, REPAIR_CONTEXT_MAX_BUDGET, REPAIR_CONTEXT_MAX_FIX_RANGES, REPAIR_CONTEXT_MAX_FIX_SPAN, repairContextSectionSchema, fixLinesSchema, repairContextBase, getRepairContextRequest, repairContextCutSchema, repairContextTrimmedSchema, missingSourceSchema, getRepairContextResult, CODEGRAPH_CALLS;
|
|
83528
83620
|
var init_calls = __esm({
|
|
83529
83621
|
"../../packages/codegraph/src/query/calls.ts"() {
|
|
83530
83622
|
"use strict";
|
|
@@ -83533,7 +83625,7 @@ var init_calls = __esm({
|
|
|
83533
83625
|
init_status2();
|
|
83534
83626
|
init_common();
|
|
83535
83627
|
unit3 = external_exports.number().min(0).max(1);
|
|
83536
|
-
|
|
83628
|
+
count9 = external_exports.number().int().nonnegative();
|
|
83537
83629
|
names = external_exports.array(external_exports.string().min(1));
|
|
83538
83630
|
excluded = excludedSchema.default({});
|
|
83539
83631
|
withinSchema = external_exports.object({
|
|
@@ -83663,7 +83755,7 @@ var init_calls = __esm({
|
|
|
83663
83755
|
getBlastRadiusResult = external_exports.object({
|
|
83664
83756
|
target: blastTargetSchema,
|
|
83665
83757
|
seeds: external_exports.array(seedSchema).min(1),
|
|
83666
|
-
summary: external_exports.record(external_exports.string(),
|
|
83758
|
+
summary: external_exports.record(external_exports.string(), count9),
|
|
83667
83759
|
excluded,
|
|
83668
83760
|
groups: blastGroupsSchema
|
|
83669
83761
|
}).strict();
|
|
@@ -83680,8 +83772,8 @@ var init_calls = __esm({
|
|
|
83680
83772
|
external_exports.object({
|
|
83681
83773
|
name: external_exports.string().min(1),
|
|
83682
83774
|
source: external_exports.enum(["coverage", "static", "runtime"]),
|
|
83683
|
-
linesHit:
|
|
83684
|
-
durationMs:
|
|
83775
|
+
linesHit: count9.optional(),
|
|
83776
|
+
durationMs: count9.optional(),
|
|
83685
83777
|
confidence: unit3.optional(),
|
|
83686
83778
|
run: external_exports.string().min(1).optional()
|
|
83687
83779
|
}).strict()
|
|
@@ -83697,7 +83789,7 @@ var init_calls = __esm({
|
|
|
83697
83789
|
symbol: external_exports.string().min(1).optional(),
|
|
83698
83790
|
at: external_exports.string().min(1).optional(),
|
|
83699
83791
|
observed: external_exports.boolean().optional(),
|
|
83700
|
-
count:
|
|
83792
|
+
count: count9.optional(),
|
|
83701
83793
|
share: external_exports.number().gt(0).lte(1).optional(),
|
|
83702
83794
|
data: flowDataSchema.optional(),
|
|
83703
83795
|
context: external_exports.record(external_exports.string(), external_exports.union([external_exports.string(), external_exports.boolean()])).optional(),
|
|
@@ -83736,7 +83828,7 @@ var init_calls = __esm({
|
|
|
83736
83828
|
flow: flowNodeSchema.optional(),
|
|
83737
83829
|
jobs: external_exports.array(jobStepSchema).optional(),
|
|
83738
83830
|
shared: external_exports.record(external_exports.string(), flowNodeSchema).default({}),
|
|
83739
|
-
omitted: external_exports.object({ branches:
|
|
83831
|
+
omitted: external_exports.object({ branches: count9, reason: external_exports.string().min(1) }).strict().optional(),
|
|
83740
83832
|
excluded
|
|
83741
83833
|
}).strict().refine((r) => r.flow !== void 0 || r.jobs !== void 0, {
|
|
83742
83834
|
message: "a flow answer holds a call tree or a job order"
|
|
@@ -83865,9 +83957,9 @@ var init_calls = __esm({
|
|
|
83865
83957
|
// The job's own runs summed up, as the CI index stored them on the
|
|
83866
83958
|
// job (#8010). Absent when the host read no runs of it.
|
|
83867
83959
|
history: external_exports.object({
|
|
83868
|
-
runs:
|
|
83869
|
-
passed:
|
|
83870
|
-
failed:
|
|
83960
|
+
runs: count9,
|
|
83961
|
+
passed: count9,
|
|
83962
|
+
failed: count9,
|
|
83871
83963
|
passRate: unit3,
|
|
83872
83964
|
/** The job both failed and passed on one commit. */
|
|
83873
83965
|
flaky: external_exports.boolean(),
|
|
@@ -83878,14 +83970,14 @@ var init_calls = __esm({
|
|
|
83878
83970
|
}).strict()
|
|
83879
83971
|
),
|
|
83880
83972
|
runHistory: external_exports.object({
|
|
83881
|
-
runs:
|
|
83973
|
+
runs: count9,
|
|
83882
83974
|
passRate: unit3,
|
|
83883
83975
|
medianMinutes: external_exports.number().nonnegative(),
|
|
83884
83976
|
flakyJobs: names,
|
|
83885
83977
|
// The figures the CI index stores beside those (#8010). Each is
|
|
83886
83978
|
// absent when the stored history has none.
|
|
83887
|
-
passed:
|
|
83888
|
-
failed:
|
|
83979
|
+
passed: count9.optional(),
|
|
83980
|
+
failed: count9.optional(),
|
|
83889
83981
|
/** The 90th percentile run time. */
|
|
83890
83982
|
p90Minutes: external_exports.number().nonnegative().optional(),
|
|
83891
83983
|
/** The median time a run waited for a runner. */
|
|
@@ -83943,7 +84035,7 @@ var init_calls = __esm({
|
|
|
83943
84035
|
});
|
|
83944
84036
|
exportOpenapiDraftResult = external_exports.object({
|
|
83945
84037
|
format: external_exports.literal("openapi-3.1"),
|
|
83946
|
-
operations:
|
|
84038
|
+
operations: count9,
|
|
83947
84039
|
document: external_exports.record(external_exports.string(), external_exports.unknown()),
|
|
83948
84040
|
excluded
|
|
83949
84041
|
}).strict();
|
|
@@ -83968,17 +84060,17 @@ var init_calls = __esm({
|
|
|
83968
84060
|
/** The embedding space the map was drawn in, or null with no map. */
|
|
83969
84061
|
space: external_exports.string().min(1).nullable(),
|
|
83970
84062
|
/** How many symbols the map places in scope, before the budget cut. */
|
|
83971
|
-
placed:
|
|
84063
|
+
placed: count9,
|
|
83972
84064
|
/** How many folders those symbols sit in, before the budget cut. */
|
|
83973
|
-
modules:
|
|
84065
|
+
modules: count9,
|
|
83974
84066
|
/**
|
|
83975
84067
|
* How many of them are bridges between two listed groups, before the
|
|
83976
84068
|
* budget cut. A bridge whose second group is not listed keeps its role
|
|
83977
84069
|
* and is not counted.
|
|
83978
84070
|
*/
|
|
83979
|
-
bridges:
|
|
84071
|
+
bridges: count9,
|
|
83980
84072
|
/** How many of them are outliers, before the budget cut. */
|
|
83981
|
-
outliers:
|
|
84073
|
+
outliers: count9,
|
|
83982
84074
|
/**
|
|
83983
84075
|
* The listed symbols, in turns: one symbol from each group, the most
|
|
83984
84076
|
* typical first, then one bridge, the narrowest margin first, then one
|
|
@@ -83992,11 +84084,11 @@ var init_calls = __esm({
|
|
|
83992
84084
|
x: external_exports.number(),
|
|
83993
84085
|
y: external_exports.number(),
|
|
83994
84086
|
/** The index of its group in `clusters`. */
|
|
83995
|
-
cluster:
|
|
84087
|
+
cluster: count9,
|
|
83996
84088
|
/** Its cosine similarity to its group's center. */
|
|
83997
84089
|
similarity: external_exports.number().min(-1).max(1),
|
|
83998
84090
|
/** The nearest other group, by its index. */
|
|
83999
|
-
next:
|
|
84091
|
+
next: count9.optional(),
|
|
84000
84092
|
/** Its cosine similarity to that group's center. */
|
|
84001
84093
|
nextSimilarity: external_exports.number().min(-1).max(1).optional(),
|
|
84002
84094
|
/**
|
|
@@ -84006,7 +84098,7 @@ var init_calls = __esm({
|
|
|
84006
84098
|
*/
|
|
84007
84099
|
role: external_exports.enum(["bridge", "outlier"]).optional(),
|
|
84008
84100
|
/** How many places call, import or reference it in its repo. */
|
|
84009
|
-
fanIn:
|
|
84101
|
+
fanIn: count9
|
|
84010
84102
|
}).strict()
|
|
84011
84103
|
),
|
|
84012
84104
|
/** Each group with a member in scope, largest first across the workspace. */
|
|
@@ -84015,9 +84107,9 @@ var init_calls = __esm({
|
|
|
84015
84107
|
/** Counted from its members' names. Null when the answer is restricted. */
|
|
84016
84108
|
name: external_exports.string().min(1).nullable(),
|
|
84017
84109
|
/** How many listed symbols are in it, after the budget cut. */
|
|
84018
|
-
size:
|
|
84110
|
+
size: count9,
|
|
84019
84111
|
/** How many of its symbols are in scope, before the budget cut. */
|
|
84020
|
-
placed:
|
|
84112
|
+
placed: count9,
|
|
84021
84113
|
/** Their mean similarity to its center, before the budget cut. */
|
|
84022
84114
|
mean: external_exports.number().min(-1).max(1),
|
|
84023
84115
|
/** Its center's cosine similarity to every listed center, in order. */
|
|
@@ -84037,7 +84129,7 @@ var init_calls = __esm({
|
|
|
84037
84129
|
external_exports.object({
|
|
84038
84130
|
name: external_exports.string().min(1),
|
|
84039
84131
|
signature: external_exports.string().optional(),
|
|
84040
|
-
line:
|
|
84132
|
+
line: count9.optional()
|
|
84041
84133
|
}).strict()
|
|
84042
84134
|
)
|
|
84043
84135
|
}).strict()
|
|
@@ -84072,7 +84164,7 @@ var init_calls = __esm({
|
|
|
84072
84164
|
scripts: external_exports.array(
|
|
84073
84165
|
external_exports.object({ name: external_exports.string().min(1), effect: external_exports.string().min(1) }).strict()
|
|
84074
84166
|
),
|
|
84075
|
-
blastRadius: external_exports.object({ summary: external_exports.record(external_exports.string(),
|
|
84167
|
+
blastRadius: external_exports.object({ summary: external_exports.record(external_exports.string(), count9) }).strict(),
|
|
84076
84168
|
tests: external_exports.array(testRefSchema),
|
|
84077
84169
|
findings: external_exports.array(
|
|
84078
84170
|
external_exports.object({ rule: external_exports.string().min(1), at: external_exports.string().min(1) }).strict()
|
|
@@ -84143,11 +84235,11 @@ var init_calls = __esm({
|
|
|
84143
84235
|
SLICE_MAX_CALL_DEPTH = 10;
|
|
84144
84236
|
SLICE_DEFAULT_CALL_DEPTH = 3;
|
|
84145
84237
|
sliceStepSchema = external_exports.object({
|
|
84146
|
-
order:
|
|
84238
|
+
order: count9,
|
|
84147
84239
|
role: external_exports.enum(SLICE_ROLES),
|
|
84148
84240
|
file: external_exports.string().min(1),
|
|
84149
84241
|
repo: external_exports.string().min(1).optional(),
|
|
84150
|
-
span: external_exports.object({ startLine:
|
|
84242
|
+
span: external_exports.object({ startLine: count9, endLine: count9 }).strict(),
|
|
84151
84243
|
/** The statement's text. With `responseFormat: "detailed"` only. */
|
|
84152
84244
|
text: external_exports.string().optional(),
|
|
84153
84245
|
/** The function the statement sits in, and its stable id. */
|
|
@@ -84155,7 +84247,7 @@ var init_calls = __esm({
|
|
|
84155
84247
|
symbolId: external_exports.string().min(1).optional(),
|
|
84156
84248
|
/** The edge the step was reached over, and the order of the step before it. */
|
|
84157
84249
|
via: external_exports.enum(DATAFLOW_EDGE_KINDS).optional(),
|
|
84158
|
-
from:
|
|
84250
|
+
from: count9.optional(),
|
|
84159
84251
|
provenance: provenanceKindSchema.optional(),
|
|
84160
84252
|
confidence: unit3
|
|
84161
84253
|
}).strict();
|
|
@@ -84249,7 +84341,7 @@ var init_calls = __esm({
|
|
|
84249
84341
|
repo: external_exports.string().min(1).optional(),
|
|
84250
84342
|
at: external_exports.string().min(1).optional(),
|
|
84251
84343
|
/** The suspect lines inside the symbol or file. */
|
|
84252
|
-
lines: external_exports.array(external_exports.object({ startLine:
|
|
84344
|
+
lines: external_exports.array(external_exports.object({ startLine: count9, endLine: count9 }).strict()).optional(),
|
|
84253
84345
|
/** The fused score the ranking orders by. */
|
|
84254
84346
|
score: external_exports.number().nonnegative(),
|
|
84255
84347
|
signals: external_exports.array(signalEvidenceSchema).min(1)
|
|
@@ -84346,7 +84438,7 @@ var init_calls = __esm({
|
|
|
84346
84438
|
REPAIR_CONTEXT_MAX_FIX_SPAN = 1e4;
|
|
84347
84439
|
repairContextSectionSchema = external_exports.object({
|
|
84348
84440
|
name: external_exports.enum(REPAIR_CONTEXT_SECTIONS),
|
|
84349
|
-
tokens:
|
|
84441
|
+
tokens: count9,
|
|
84350
84442
|
/** The section as it goes to a model. */
|
|
84351
84443
|
text: external_exports.string(),
|
|
84352
84444
|
/** The nodes the text cites. */
|
|
@@ -84384,13 +84476,13 @@ var init_calls = __esm({
|
|
|
84384
84476
|
/** The suspect or test the piece is about. */
|
|
84385
84477
|
name: external_exports.string().min(1),
|
|
84386
84478
|
/** What the piece would have cost. */
|
|
84387
|
-
tokens:
|
|
84479
|
+
tokens: count9
|
|
84388
84480
|
}).strict();
|
|
84389
84481
|
repairContextTrimmedSchema = external_exports.object({
|
|
84390
84482
|
section: external_exports.enum(REPAIR_CONTEXT_SECTIONS),
|
|
84391
84483
|
name: external_exports.string().min(1),
|
|
84392
|
-
shownLines:
|
|
84393
|
-
totalLines:
|
|
84484
|
+
shownLines: count9,
|
|
84485
|
+
totalLines: count9
|
|
84394
84486
|
}).strict();
|
|
84395
84487
|
missingSourceSchema = external_exports.object({
|
|
84396
84488
|
repo: external_exports.string().min(1),
|
|
@@ -84814,7 +84906,7 @@ function charsetTable(spec) {
|
|
|
84814
84906
|
for (const c of parseCharset(spec)) table[c] = 1;
|
|
84815
84907
|
return table;
|
|
84816
84908
|
}
|
|
84817
|
-
var isAscii, isLower, id, text4, lowerText, charset,
|
|
84909
|
+
var isAscii, isLower, id, text4, lowerText, charset, count10, blockRuleSchema, tokenRuleSchema, assignmentRuleSchema, lowerList, skipListSchema, secretPatternsSchema;
|
|
84818
84910
|
var init_schema3 = __esm({
|
|
84819
84911
|
"../../packages/codegraph/src/secrets/schema.ts"() {
|
|
84820
84912
|
"use strict";
|
|
@@ -84831,7 +84923,7 @@ var init_schema3 = __esm({
|
|
|
84831
84923
|
ctx2.addIssue({ code: external_exports.ZodIssueCode.custom, message: String(error2) });
|
|
84832
84924
|
}
|
|
84833
84925
|
});
|
|
84834
|
-
|
|
84926
|
+
count10 = external_exports.number().int().min(1);
|
|
84835
84927
|
blockRuleSchema = external_exports.object({
|
|
84836
84928
|
id,
|
|
84837
84929
|
begin: text4,
|
|
@@ -84840,21 +84932,21 @@ var init_schema3 = __esm({
|
|
|
84840
84932
|
labelChars: charset,
|
|
84841
84933
|
labelSuffixes: external_exports.array(text4).min(1),
|
|
84842
84934
|
truncatedChars: charset,
|
|
84843
|
-
truncatedMin:
|
|
84935
|
+
truncatedMin: count10
|
|
84844
84936
|
}).strict();
|
|
84845
84937
|
tokenRuleSchema = external_exports.object({
|
|
84846
84938
|
id,
|
|
84847
84939
|
prefixes: external_exports.array(text4).min(1),
|
|
84848
84940
|
chars: charset,
|
|
84849
84941
|
boundary: charset,
|
|
84850
|
-
min:
|
|
84851
|
-
max:
|
|
84942
|
+
min: count10,
|
|
84943
|
+
max: count10.optional(),
|
|
84852
84944
|
requireDigit: external_exports.boolean().optional(),
|
|
84853
84945
|
keepPrefix: external_exports.boolean().optional(),
|
|
84854
84946
|
segments: external_exports.object({
|
|
84855
84947
|
separator: external_exports.string().length(1).refine(isAscii, "must be ASCII"),
|
|
84856
84948
|
count: external_exports.number().int().min(2),
|
|
84857
|
-
min:
|
|
84949
|
+
min: count10
|
|
84858
84950
|
}).strict().optional()
|
|
84859
84951
|
}).strict().refine((r) => r.max === void 0 || r.max >= r.min, "max is below min");
|
|
84860
84952
|
assignmentRuleSchema = external_exports.object({
|
|
@@ -84862,7 +84954,7 @@ var init_schema3 = __esm({
|
|
|
84862
84954
|
names: external_exports.array(text4.refine((s2) => s2 === s2.toUpperCase(), "must be upper case")).min(1),
|
|
84863
84955
|
nameChars: charset,
|
|
84864
84956
|
valueChars: charset,
|
|
84865
|
-
minLength:
|
|
84957
|
+
minLength: count10,
|
|
84866
84958
|
minEntropy: external_exports.number().min(0).max(8),
|
|
84867
84959
|
placeholders: external_exports.array(lowerText)
|
|
84868
84960
|
}).strict();
|
|
@@ -86067,8 +86159,8 @@ var require_Node = __commonJS({
|
|
|
86067
86159
|
};
|
|
86068
86160
|
const res = toJS.toJS(this, "", ctx2);
|
|
86069
86161
|
if (typeof onAnchor === "function")
|
|
86070
|
-
for (const { count:
|
|
86071
|
-
onAnchor(res2,
|
|
86162
|
+
for (const { count: count15, res: res2 } of ctx2.anchors.values())
|
|
86163
|
+
onAnchor(res2, count15);
|
|
86072
86164
|
return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
|
|
86073
86165
|
}
|
|
86074
86166
|
};
|
|
@@ -86176,13 +86268,13 @@ var require_Alias = __commonJS({
|
|
|
86176
86268
|
const anchor2 = anchors2 && source && anchors2.get(source);
|
|
86177
86269
|
return anchor2 ? anchor2.count * anchor2.aliasCount : 0;
|
|
86178
86270
|
} else if (identity.isCollection(node3)) {
|
|
86179
|
-
let
|
|
86271
|
+
let count15 = 0;
|
|
86180
86272
|
for (const item of node3.items) {
|
|
86181
86273
|
const c = getAliasCount(doc, item, anchors2);
|
|
86182
|
-
if (c >
|
|
86183
|
-
|
|
86274
|
+
if (c > count15)
|
|
86275
|
+
count15 = c;
|
|
86184
86276
|
}
|
|
86185
|
-
return
|
|
86277
|
+
return count15;
|
|
86186
86278
|
} else if (identity.isPair(node3)) {
|
|
86187
86279
|
const kc = getAliasCount(doc, node3.key, anchors2);
|
|
86188
86280
|
const vc = getAliasCount(doc, node3.value, anchors2);
|
|
@@ -89135,8 +89227,8 @@ var require_Document = __commonJS({
|
|
|
89135
89227
|
};
|
|
89136
89228
|
const res = toJS.toJS(this.contents, jsonArg ?? "", ctx2);
|
|
89137
89229
|
if (typeof onAnchor === "function")
|
|
89138
|
-
for (const { count:
|
|
89139
|
-
onAnchor(res2,
|
|
89230
|
+
for (const { count: count15, res: res2 } of ctx2.anchors.values())
|
|
89231
|
+
onAnchor(res2, count15);
|
|
89140
89232
|
return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
|
|
89141
89233
|
}
|
|
89142
89234
|
/**
|
|
@@ -89213,12 +89305,12 @@ var require_errors = __commonJS({
|
|
|
89213
89305
|
lineStr = prev + lineStr;
|
|
89214
89306
|
}
|
|
89215
89307
|
if (/[^ ]/.test(lineStr)) {
|
|
89216
|
-
let
|
|
89308
|
+
let count15 = 1;
|
|
89217
89309
|
const end = error2.linePos[1];
|
|
89218
89310
|
if (end?.line === line && end.col > col) {
|
|
89219
|
-
|
|
89311
|
+
count15 = Math.max(1, Math.min(end.col - col, 80 - ci));
|
|
89220
89312
|
}
|
|
89221
|
-
const pointer = " ".repeat(ci) + "^".repeat(
|
|
89313
|
+
const pointer = " ".repeat(ci) + "^".repeat(count15);
|
|
89222
89314
|
error2.message += `:
|
|
89223
89315
|
|
|
89224
89316
|
${lineStr}
|
|
@@ -97386,7 +97478,7 @@ function wrappedFrameOf(event, bytesRef, serverCut = null) {
|
|
|
97386
97478
|
const content = asRecord2(event["content"]);
|
|
97387
97479
|
const turn = asRecord2(event["turn"]);
|
|
97388
97480
|
const text6 = (value) => typeof value === "string" ? value : "";
|
|
97389
|
-
const
|
|
97481
|
+
const count15 = (value) => typeof value === "number" ? value : null;
|
|
97390
97482
|
return {
|
|
97391
97483
|
event_id: event["event_id"] ?? null,
|
|
97392
97484
|
seq: event["seq"] ?? null,
|
|
@@ -97417,8 +97509,8 @@ function wrappedFrameOf(event, bytesRef, serverCut = null) {
|
|
|
97417
97509
|
model: text6(body2["model"]),
|
|
97418
97510
|
provider: text6(body2["provider"]),
|
|
97419
97511
|
policy_decision: text6(body2["policy_decision"]),
|
|
97420
|
-
cost_usd_micros:
|
|
97421
|
-
turn_seq:
|
|
97512
|
+
cost_usd_micros: count15(body2["cost_usd_micros"]),
|
|
97513
|
+
turn_seq: count15(turn?.["turn_seq"]),
|
|
97422
97514
|
event
|
|
97423
97515
|
};
|
|
97424
97516
|
}
|
|
@@ -97426,14 +97518,14 @@ function asRecord2(value) {
|
|
|
97426
97518
|
return isRecord(value) ? value : null;
|
|
97427
97519
|
}
|
|
97428
97520
|
function tally(counts2) {
|
|
97429
|
-
return [...counts2.entries()].map(([kind, { count:
|
|
97521
|
+
return [...counts2.entries()].map(([kind, { count: count15, frames }]) => ({ kind, count: count15, frames })).sort((a, b3) => a.kind.localeCompare(b3.kind));
|
|
97430
97522
|
}
|
|
97431
97523
|
function summarizeRunExportRedactions(envelopes) {
|
|
97432
97524
|
const redacted2 = /* @__PURE__ */ new Map();
|
|
97433
97525
|
const withheld = /* @__PURE__ */ new Map();
|
|
97434
|
-
const bump = (map2, kind,
|
|
97526
|
+
const bump = (map2, kind, count15) => {
|
|
97435
97527
|
const entry2 = map2.get(kind) ?? { count: 0, frames: 0 };
|
|
97436
|
-
entry2.count +=
|
|
97528
|
+
entry2.count += count15;
|
|
97437
97529
|
entry2.frames += 1;
|
|
97438
97530
|
map2.set(kind, entry2);
|
|
97439
97531
|
};
|
|
@@ -97450,9 +97542,9 @@ function summarizeRunExportRedactions(envelopes) {
|
|
|
97450
97542
|
const kind = typeof reason3 === "string" ? reason3 : "unknown";
|
|
97451
97543
|
perReason.set(kind, (perReason.get(kind) ?? 0) + 1);
|
|
97452
97544
|
}
|
|
97453
|
-
for (const [kind,
|
|
97454
|
-
bump(redacted2, kind,
|
|
97455
|
-
total2 +=
|
|
97545
|
+
for (const [kind, count15] of perReason) {
|
|
97546
|
+
bump(redacted2, kind, count15);
|
|
97547
|
+
total2 += count15;
|
|
97456
97548
|
}
|
|
97457
97549
|
}
|
|
97458
97550
|
if (typeof content?.["bytes_ref"] === "string") {
|
|
@@ -98038,8 +98130,8 @@ function printable2(text6) {
|
|
|
98038
98130
|
}
|
|
98039
98131
|
return out;
|
|
98040
98132
|
}
|
|
98041
|
-
function plural(
|
|
98042
|
-
return `${
|
|
98133
|
+
function plural(count15, one, many) {
|
|
98134
|
+
return `${count15} ${count15 === 1 ? one : many}`;
|
|
98043
98135
|
}
|
|
98044
98136
|
function formatClaimVerification(result2) {
|
|
98045
98137
|
const lines = ["Frames"];
|
|
@@ -98253,15 +98345,15 @@ var init_cbor = __esm({
|
|
|
98253
98345
|
this.take(this.length(info))
|
|
98254
98346
|
);
|
|
98255
98347
|
case 4: {
|
|
98256
|
-
const
|
|
98348
|
+
const count15 = this.length(info);
|
|
98257
98349
|
const out = [];
|
|
98258
|
-
for (let i2 = 0; i2 <
|
|
98350
|
+
for (let i2 = 0; i2 < count15; i2 += 1) out.push(this.item(depth + 1));
|
|
98259
98351
|
return out;
|
|
98260
98352
|
}
|
|
98261
98353
|
case 5: {
|
|
98262
|
-
const
|
|
98354
|
+
const count15 = this.length(info);
|
|
98263
98355
|
const out = /* @__PURE__ */ new Map();
|
|
98264
|
-
for (let i2 = 0; i2 <
|
|
98356
|
+
for (let i2 = 0; i2 < count15; i2 += 1) {
|
|
98265
98357
|
const key = this.item(depth + 1);
|
|
98266
98358
|
if (typeof key !== "number" && typeof key !== "string") {
|
|
98267
98359
|
throw new CborError("a CBOR map key is not an integer or text");
|
|
@@ -98677,17 +98769,17 @@ function parseAt(bytes, start, depth) {
|
|
|
98677
98769
|
at2 += 1;
|
|
98678
98770
|
let length = first;
|
|
98679
98771
|
if (first & 128) {
|
|
98680
|
-
const
|
|
98681
|
-
if (
|
|
98772
|
+
const count15 = first & 127;
|
|
98773
|
+
if (count15 === 0 || count15 > 4)
|
|
98682
98774
|
throw new DerError("DER length is not definite");
|
|
98683
98775
|
length = 0;
|
|
98684
|
-
for (let i2 = 0; i2 <
|
|
98776
|
+
for (let i2 = 0; i2 < count15; i2 += 1) {
|
|
98685
98777
|
const b3 = bytes[at2];
|
|
98686
98778
|
if (b3 === void 0) throw new DerError("DER ends early");
|
|
98687
98779
|
length = length * 256 + b3;
|
|
98688
98780
|
at2 += 1;
|
|
98689
98781
|
}
|
|
98690
|
-
if (length < 128 ||
|
|
98782
|
+
if (length < 128 || count15 > 1 && length < 256 ** (count15 - 1)) {
|
|
98691
98783
|
throw new DerError("DER length is not in its shortest form");
|
|
98692
98784
|
}
|
|
98693
98785
|
}
|
|
@@ -101877,8 +101969,8 @@ async function defaultEnroll(opts, writer) {
|
|
|
101877
101969
|
return result2.ok && result2.shipping?.healthy !== false;
|
|
101878
101970
|
}
|
|
101879
101971
|
async function defaultConfirm(question) {
|
|
101880
|
-
const { createInterface:
|
|
101881
|
-
const rl =
|
|
101972
|
+
const { createInterface: createInterface6 } = await import("node:readline/promises");
|
|
101973
|
+
const rl = createInterface6({ input: process.stdin, output: process.stdout });
|
|
101882
101974
|
try {
|
|
101883
101975
|
const answer = await rl.question(`${question} [y/N] `);
|
|
101884
101976
|
return /^y(es)?$/i.test(answer.trim());
|
|
@@ -102344,16 +102436,16 @@ ${question}
|
|
|
102344
102436
|
}
|
|
102345
102437
|
return items[choiceIndex];
|
|
102346
102438
|
}
|
|
102347
|
-
function parseMultiSelection(raw,
|
|
102439
|
+
function parseMultiSelection(raw, count15, defaults) {
|
|
102348
102440
|
const answer = raw.trim().toLowerCase();
|
|
102349
102441
|
if (answer === "") return [...defaults];
|
|
102350
|
-
if (answer === "all") return Array.from({ length:
|
|
102442
|
+
if (answer === "all") return Array.from({ length: count15 }, (_, i2) => i2);
|
|
102351
102443
|
if (answer === "none") return [];
|
|
102352
102444
|
const chosen = /* @__PURE__ */ new Set();
|
|
102353
102445
|
for (const word2 of answer.split(/[\s,]+/).filter((w) => w !== "")) {
|
|
102354
102446
|
if (!/^\d+$/.test(word2)) return null;
|
|
102355
102447
|
const n2 = parseInt(word2, 10);
|
|
102356
|
-
if (n2 < 1 || n2 >
|
|
102448
|
+
if (n2 < 1 || n2 > count15) return null;
|
|
102357
102449
|
chosen.add(n2 - 1);
|
|
102358
102450
|
}
|
|
102359
102451
|
return [...chosen].sort((a, b3) => a - b3);
|
|
@@ -106753,8 +106845,8 @@ function formatDollars(micros2) {
|
|
|
106753
106845
|
const minus = value < 0n && cents > 0n ? "-" : "";
|
|
106754
106846
|
return `${minus}$${String(cents / 100n)}.${frac}`;
|
|
106755
106847
|
}
|
|
106756
|
-
function formatCount(
|
|
106757
|
-
return Number.isInteger(
|
|
106848
|
+
function formatCount(count15) {
|
|
106849
|
+
return Number.isInteger(count15) ? String(count15) : count15.toFixed(1);
|
|
106758
106850
|
}
|
|
106759
106851
|
function nameOf(group) {
|
|
106760
106852
|
const { name: name2, number: itemNumber } = group.display;
|
|
@@ -106772,8 +106864,8 @@ function wordOf(dimension) {
|
|
|
106772
106864
|
function lastDay(end) {
|
|
106773
106865
|
return new Date(Date.parse(end) - 1).toISOString().slice(0, 10);
|
|
106774
106866
|
}
|
|
106775
|
-
function plural2(
|
|
106776
|
-
return `${formatCount(
|
|
106867
|
+
function plural2(count15, noun) {
|
|
106868
|
+
return `${formatCount(count15)} ${noun}${count15 === 1 ? "" : "s"}`;
|
|
106777
106869
|
}
|
|
106778
106870
|
function render(result2, writer) {
|
|
106779
106871
|
const { groupBy, crossBy, range, compared: compared2, total: total2 } = result2;
|
|
@@ -106933,14 +107025,14 @@ var init_spend_export2 = __esm({
|
|
|
106933
107025
|
});
|
|
106934
107026
|
|
|
106935
107027
|
// ../../packages/oxagen/src/contracts/status-report.shared.ts
|
|
106936
|
-
var micros,
|
|
107028
|
+
var micros, count11, day, lookSchema2, statusValueDisplaySchema, valueSchema, ranked, statusReportAboutSchema, STATUS_NOTABLE_KINDS, statusReportFactsSchema;
|
|
106937
107029
|
var init_status_report_shared = __esm({
|
|
106938
107030
|
"../../packages/oxagen/src/contracts/status-report.shared.ts"() {
|
|
106939
107031
|
"use strict";
|
|
106940
107032
|
init_zod();
|
|
106941
107033
|
init_spend_attribution_shared();
|
|
106942
107034
|
micros = external_exports.string().regex(/^\d+$/);
|
|
106943
|
-
|
|
107035
|
+
count11 = external_exports.number().finite().nonnegative();
|
|
106944
107036
|
day = external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/);
|
|
106945
107037
|
lookSchema2 = external_exports.object({ icon: external_exports.string(), color: external_exports.string(), variant: external_exports.string() }).strict();
|
|
106946
107038
|
statusValueDisplaySchema = external_exports.object({
|
|
@@ -106963,8 +107055,8 @@ var init_status_report_shared = __esm({
|
|
|
106963
107055
|
name: external_exports.string(),
|
|
106964
107056
|
display: statusValueDisplaySchema.optional(),
|
|
106965
107057
|
spendMicros: micros,
|
|
106966
|
-
items:
|
|
106967
|
-
runs:
|
|
107058
|
+
items: count11,
|
|
107059
|
+
runs: count11
|
|
106968
107060
|
}).strict();
|
|
106969
107061
|
statusReportAboutSchema = external_exports.object({
|
|
106970
107062
|
scope: external_exports.discriminatedUnion("kind", [
|
|
@@ -106998,18 +107090,18 @@ var init_status_report_shared = __esm({
|
|
|
106998
107090
|
statusReportFactsSchema = external_exports.object({
|
|
106999
107091
|
version: external_exports.literal("status-report-facts/v1"),
|
|
107000
107092
|
about: statusReportAboutSchema.optional(),
|
|
107001
|
-
items: external_exports.object({ opened:
|
|
107093
|
+
items: external_exports.object({ opened: count11, closed: count11 }).strict(),
|
|
107002
107094
|
runs: external_exports.object({
|
|
107003
|
-
started:
|
|
107004
|
-
merged:
|
|
107005
|
-
failed:
|
|
107006
|
-
abandoned:
|
|
107007
|
-
running:
|
|
107095
|
+
started: count11,
|
|
107096
|
+
merged: count11,
|
|
107097
|
+
failed: count11,
|
|
107098
|
+
abandoned: count11,
|
|
107099
|
+
running: count11
|
|
107008
107100
|
}).strict(),
|
|
107009
107101
|
spend: external_exports.object({
|
|
107010
107102
|
micros,
|
|
107011
107103
|
wastedMicros: micros,
|
|
107012
|
-
estimatedRuns:
|
|
107104
|
+
estimatedRuns: count11,
|
|
107013
107105
|
comparedMicros: micros.nullable().optional(),
|
|
107014
107106
|
comparedWastedMicros: micros.nullable().optional()
|
|
107015
107107
|
}).strict(),
|
|
@@ -107029,7 +107121,7 @@ var init_status_report_shared = __esm({
|
|
|
107029
107121
|
notable: external_exports.array(
|
|
107030
107122
|
external_exports.object({
|
|
107031
107123
|
text: external_exports.string(),
|
|
107032
|
-
weight:
|
|
107124
|
+
weight: count11,
|
|
107033
107125
|
kind: external_exports.enum(STATUS_NOTABLE_KINDS).optional()
|
|
107034
107126
|
}).strict()
|
|
107035
107127
|
).max(2)
|
|
@@ -108157,8 +108249,8 @@ function usageError(writer, message2, line) {
|
|
|
108157
108249
|
writer.writeErr(`usage: ${line}`);
|
|
108158
108250
|
process.exitCode = 2;
|
|
108159
108251
|
}
|
|
108160
|
-
function plural3(
|
|
108161
|
-
return `${
|
|
108252
|
+
function plural3(count15, one, many) {
|
|
108253
|
+
return `${count15} ${count15 === 1 ? one : many}`;
|
|
108162
108254
|
}
|
|
108163
108255
|
function findingRow(finding) {
|
|
108164
108256
|
const pr = finding.pull_request;
|
|
@@ -108542,8 +108634,8 @@ function fileRow(file2) {
|
|
|
108542
108634
|
file2.fixture ? "fixture" : ""
|
|
108543
108635
|
];
|
|
108544
108636
|
}
|
|
108545
|
-
function plural4(
|
|
108546
|
-
return `${
|
|
108637
|
+
function plural4(count15, one, many) {
|
|
108638
|
+
return `${count15} ${count15 === 1 ? one : many}`;
|
|
108547
108639
|
}
|
|
108548
108640
|
function countsLine(counts2) {
|
|
108549
108641
|
const parts = [
|
|
@@ -111262,15 +111354,15 @@ var init_context_steering_shared = __esm({
|
|
|
111262
111354
|
|
|
111263
111355
|
// ../../packages/oxagen/src/contracts/steering.markdown_import.shared.ts
|
|
111264
111356
|
function markdownImportFileCount(rows) {
|
|
111265
|
-
let
|
|
111357
|
+
let count15 = rows.policies.filter((policy) => policy.action === "add").length;
|
|
111266
111358
|
for (const row of rows.records) {
|
|
111267
|
-
if (row.action === "add")
|
|
111359
|
+
if (row.action === "add") count15 += 1 + (row.files?.length ?? 0);
|
|
111268
111360
|
}
|
|
111269
|
-
return
|
|
111361
|
+
return count15;
|
|
111270
111362
|
}
|
|
111271
|
-
function markdownImportTooManyFiles(
|
|
111272
|
-
if (
|
|
111273
|
-
return `The import marks ${
|
|
111363
|
+
function markdownImportTooManyFiles(count15) {
|
|
111364
|
+
if (count15 <= STEERING_PR_MAX_FILES) return null;
|
|
111365
|
+
return `The import marks ${count15} records and policy files add, and one steering PR holds at most ${STEERING_PR_MAX_FILES} files. Mark ${count15 - STEERING_PR_MAX_FILES} of them skip, or import the files in smaller sets.`;
|
|
111274
111366
|
}
|
|
111275
111367
|
function markdownImportSourceOf(path2) {
|
|
111276
111368
|
const clean = path2.replace(/\\/g, "/").replace(/^\.?\//, "");
|
|
@@ -114695,10 +114787,18 @@ var init_codegraph_settings = __esm({
|
|
|
114695
114787
|
),
|
|
114696
114788
|
30
|
|
114697
114789
|
),
|
|
114698
|
-
|
|
114699
|
-
external_exports.number().int().min(1).describe(
|
|
114700
|
-
|
|
114790
|
+
tracked_branch_revisions: setting(
|
|
114791
|
+
external_exports.number().int().min(1).describe(
|
|
114792
|
+
"How many of the newest built revisions of each repository's tracked branch are kept."
|
|
114793
|
+
),
|
|
114794
|
+
2
|
|
114701
114795
|
),
|
|
114796
|
+
// The 90-day window that tracked_branch_revisions replaced (#7269). It
|
|
114797
|
+
// still reads, so a file written before the change passes its check, and
|
|
114798
|
+
// nothing uses its value.
|
|
114799
|
+
revision_retention_days: external_exports.number().int().min(1).describe(
|
|
114800
|
+
"No longer used. Revisions are kept by count: see tracked_branch_revisions."
|
|
114801
|
+
).optional(),
|
|
114702
114802
|
pr_copy_retention_days: setting(
|
|
114703
114803
|
external_exports.number().int().min(0).describe("Days a PR copy is kept after the PR closes."),
|
|
114704
114804
|
7
|
|
@@ -114706,7 +114806,7 @@ var init_codegraph_settings = __esm({
|
|
|
114706
114806
|
}).strict();
|
|
114707
114807
|
CODEGRAPH_FRESHNESS_DEFAULTS = {
|
|
114708
114808
|
lag_window_minutes: 30,
|
|
114709
|
-
|
|
114809
|
+
tracked_branch_revisions: 2,
|
|
114710
114810
|
pr_copy_retention_days: 7
|
|
114711
114811
|
};
|
|
114712
114812
|
CODEGRAPH_SETTINGS_GROUPS = [
|
|
@@ -114822,7 +114922,7 @@ var init_codegraph_settings = __esm({
|
|
|
114822
114922
|
group: "freshness",
|
|
114823
114923
|
id: "codegraph-freshness/v1",
|
|
114824
114924
|
title: "Code graph freshness and retention",
|
|
114825
|
-
description: "codegraph/freshness.toml: the CI check's lag window
|
|
114925
|
+
description: "codegraph/freshness.toml: the CI check's lag window, how many revisions are kept, and how long PR copies are kept.",
|
|
114826
114926
|
schema: codegraphFreshnessSchema,
|
|
114827
114927
|
defaults: CODEGRAPH_FRESHNESS_DEFAULTS,
|
|
114828
114928
|
timing: "next_build"
|
|
@@ -118701,9 +118801,9 @@ function formatImportRows(rows) {
|
|
|
118701
118801
|
const alwaysOn = rows.filter(
|
|
118702
118802
|
(row) => row.action === "add" && (row.force === "must" || row.force === "should")
|
|
118703
118803
|
).reduce((sum3, row) => sum3 + row.tokens, 0);
|
|
118704
|
-
const
|
|
118804
|
+
const count15 = rows.length;
|
|
118705
118805
|
return [header2, ...lines].join("\n") + `
|
|
118706
|
-
${
|
|
118806
|
+
${count15} proposed ${count15 === 1 ? "record" : "records"}. The must and should rows marked add load ${alwaysOn} tokens on every request.`;
|
|
118707
118807
|
}
|
|
118708
118808
|
function formatImportPolicies(policies) {
|
|
118709
118809
|
if (policies.length === 0) return "No policies were proposed.";
|
|
@@ -118721,10 +118821,10 @@ function formatImportPolicies(policies) {
|
|
|
118721
118821
|
return `${String(i2 + 1).padEnd(4)} ${truncate(policy.path, 36).padEnd(36)} ${String(policy.statements.length).padEnd(10)} ${policy.action.padEnd(7)} ${truncate(policy.file, 48)}` + notes.map((note) => `
|
|
118722
118822
|
${note}`).join("");
|
|
118723
118823
|
});
|
|
118724
|
-
const
|
|
118824
|
+
const count15 = policies.length;
|
|
118725
118825
|
const fix = policies.some((policy) => policy.issues.length > 0) ? " A file with an issue stays skip. Fix its Markdown and import it again." : "";
|
|
118726
118826
|
return [header2, ...lines].join("\n") + `
|
|
118727
|
-
${
|
|
118827
|
+
${count15} proposed policy ${count15 === 1 ? "file" : "files"}.${fix}`;
|
|
118728
118828
|
}
|
|
118729
118829
|
function memoryMark(row) {
|
|
118730
118830
|
const match = row.duplicate;
|
|
@@ -118747,9 +118847,9 @@ function formatImportMemories(rows) {
|
|
|
118747
118847
|
return `${String(i2 + 1).padEnd(4)} ${source} ${row.action.padEnd(7)} ${truncate(row.statement, 60)}` + (mark ? `
|
|
118748
118848
|
${mark}` : "");
|
|
118749
118849
|
});
|
|
118750
|
-
const
|
|
118850
|
+
const count15 = rows.length;
|
|
118751
118851
|
return [header2, ...lines].join("\n") + `
|
|
118752
|
-
${
|
|
118852
|
+
${count15} proposed ${count15 === 1 ? "memory" : "memories"}. Each one marked add is stored as a waiting memory, and none steers an agent until a person promotes it.`;
|
|
118753
118853
|
}
|
|
118754
118854
|
function memorySkipNote(skip2) {
|
|
118755
118855
|
const where2 = `${skip2.file}:${skip2.line}`;
|
|
@@ -119021,12 +119121,12 @@ async function runMarkdownImport(documents, run3, writer) {
|
|
|
119021
119121
|
}
|
|
119022
119122
|
const records = reconcileImportRows(parsedRecords);
|
|
119023
119123
|
const policies = run3.policies ? reconcileImportPolicies(parsedPolicies) : [];
|
|
119024
|
-
const
|
|
119025
|
-
const tooMany = markdownImportTooManyFiles(
|
|
119124
|
+
const count15 = markdownImportFileCount({ records, policies });
|
|
119125
|
+
const tooMany = markdownImportTooManyFiles(count15);
|
|
119026
119126
|
if (!run3.yes) {
|
|
119027
119127
|
if (run3.json) {
|
|
119028
119128
|
const pullRequestFiles = {
|
|
119029
|
-
count:
|
|
119129
|
+
count: count15,
|
|
119030
119130
|
max: STEERING_PR_MAX_FILES,
|
|
119031
119131
|
message: tooMany
|
|
119032
119132
|
};
|
|
@@ -119594,8 +119694,8 @@ async function dropMemoryPrRecord(input2) {
|
|
|
119594
119694
|
function memoryName(memory) {
|
|
119595
119695
|
return memory.label ?? memory.statement.split("\n")[0] ?? memory.statement;
|
|
119596
119696
|
}
|
|
119597
|
-
function usesText(
|
|
119598
|
-
return signal ||
|
|
119697
|
+
function usesText(count15, signal) {
|
|
119698
|
+
return signal || count15 > 0 ? String(count15) : "No signal";
|
|
119599
119699
|
}
|
|
119600
119700
|
function ago(iso, now = /* @__PURE__ */ new Date()) {
|
|
119601
119701
|
if (iso === null) return "Never";
|
|
@@ -119610,8 +119710,8 @@ function ago(iso, now = /* @__PURE__ */ new Date()) {
|
|
|
119610
119710
|
if (hours < 48) return `${hours}h ago`;
|
|
119611
119711
|
return `${Math.round(hours / 24)}d ago`;
|
|
119612
119712
|
}
|
|
119613
|
-
function plural5(
|
|
119614
|
-
return `${
|
|
119713
|
+
function plural5(count15, one, many) {
|
|
119714
|
+
return `${count15} ${count15 === 1 ? one : many}`;
|
|
119615
119715
|
}
|
|
119616
119716
|
function formatWorkspaceMemories(result2, now = /* @__PURE__ */ new Date()) {
|
|
119617
119717
|
if (result2.groups.length === 0) {
|
|
@@ -120769,19 +120869,19 @@ async function runTranscript(runId, opts = {}, writer = stdoutWriter) {
|
|
|
120769
120869
|
return;
|
|
120770
120870
|
}
|
|
120771
120871
|
const { counts: counts2, search, complete } = result2;
|
|
120772
|
-
const
|
|
120872
|
+
const count15 = (n2) => complete ? String(n2) : `${n2}+`;
|
|
120773
120873
|
const shown3 = result2.entries.filter((entry2) => entry2.quiet !== true);
|
|
120774
120874
|
writer.write(
|
|
120775
|
-
`${runId} at ${result2.zoom}: ${plural3(shown3.length, "entry", "entries")} on this page${counts2 === void 0 ? "" : `, ${
|
|
120875
|
+
`${runId} at ${result2.zoom}: ${plural3(shown3.length, "entry", "entries")} on this page${counts2 === void 0 ? "" : `, ${count15(counts2.entries)} in the run`}`
|
|
120776
120876
|
);
|
|
120777
120877
|
if (counts2 !== void 0) {
|
|
120778
120878
|
const chipCounts = TRANSCRIPT_KINDS.filter(
|
|
120779
120879
|
(kind) => counts2.kinds[kind] !== void 0
|
|
120780
|
-
).map((kind) => `${kind} ${
|
|
120880
|
+
).map((kind) => `${kind} ${count15(counts2.kinds[kind] ?? 0)}`);
|
|
120781
120881
|
writer.write(`Counts: ${chipCounts.join(", ")}`);
|
|
120782
120882
|
}
|
|
120783
120883
|
if (search !== void 0) {
|
|
120784
|
-
writer.write(`Search "${search.query}": ${
|
|
120884
|
+
writer.write(`Search "${search.query}": ${count15(search.matched)} matched`);
|
|
120785
120885
|
if (search.unsearched > 0) {
|
|
120786
120886
|
writer.write(
|
|
120787
120887
|
`The search is partial: it could not look inside ${plural3(search.unsearched, "kept body", "kept bodies")}.`
|
|
@@ -121263,7 +121363,7 @@ async function runContext(runId, opts = {}, writer = stdoutWriter) {
|
|
|
121263
121363
|
const assembly = result2.assemblies[0];
|
|
121264
121364
|
if (assembly !== void 0)
|
|
121265
121365
|
writer.write(
|
|
121266
|
-
`Steering: ${
|
|
121366
|
+
`Steering: ${count12(assembly.spentTokens)} of ${count12(assembly.budgetTokens)} tokens spent, ${assembly.included} included, ${assembly.cut} cut (frame ${assembly.seq})`
|
|
121267
121367
|
);
|
|
121268
121368
|
if (result2.windows.length === 0) {
|
|
121269
121369
|
writer.write(
|
|
@@ -121276,11 +121376,11 @@ async function runContext(runId, opts = {}, writer = stdoutWriter) {
|
|
|
121276
121376
|
...result2.windows.map((w) => [
|
|
121277
121377
|
w.seq,
|
|
121278
121378
|
w.model ?? NOT_RECORDED2,
|
|
121279
|
-
w.promptTokens === null ? NOT_RECORDED2 :
|
|
121379
|
+
w.promptTokens === null ? NOT_RECORDED2 : count12(w.promptTokens),
|
|
121280
121380
|
...BLOCKS.map((kind) => {
|
|
121281
121381
|
const block = w.blocks.find((b3) => b3.kind === kind);
|
|
121282
121382
|
if (block === void 0) return "-";
|
|
121283
|
-
return block.tokens === null ? NOT_RECORDED2 :
|
|
121383
|
+
return block.tokens === null ? NOT_RECORDED2 : count12(block.tokens);
|
|
121284
121384
|
})
|
|
121285
121385
|
])
|
|
121286
121386
|
];
|
|
@@ -121288,11 +121388,11 @@ async function runContext(runId, opts = {}, writer = stdoutWriter) {
|
|
|
121288
121388
|
if (composition !== null)
|
|
121289
121389
|
rows.push([
|
|
121290
121390
|
"All",
|
|
121291
|
-
`${
|
|
121292
|
-
|
|
121391
|
+
`${count12(composition.requests)} request(s)`,
|
|
121392
|
+
count12(composition.promptTokens),
|
|
121293
121393
|
...BLOCKS.map((kind) => {
|
|
121294
121394
|
const tokens = composition.blocks[kind];
|
|
121295
|
-
return tokens === null ? "-" :
|
|
121395
|
+
return tokens === null ? "-" : count12(tokens);
|
|
121296
121396
|
})
|
|
121297
121397
|
]);
|
|
121298
121398
|
writer.write("");
|
|
@@ -121307,7 +121407,7 @@ async function runContext(runId, opts = {}, writer = stdoutWriter) {
|
|
|
121307
121407
|
function titleOf(kind) {
|
|
121308
121408
|
return kind.charAt(0).toUpperCase() + kind.slice(1);
|
|
121309
121409
|
}
|
|
121310
|
-
var BLOCKS, NOT_RECORDED2,
|
|
121410
|
+
var BLOCKS, NOT_RECORDED2, count12;
|
|
121311
121411
|
var init_run_context = __esm({
|
|
121312
121412
|
"src/commands/run-context.ts"() {
|
|
121313
121413
|
init_api();
|
|
@@ -121322,7 +121422,7 @@ var init_run_context = __esm({
|
|
|
121322
121422
|
"conversation"
|
|
121323
121423
|
];
|
|
121324
121424
|
NOT_RECORDED2 = "not recorded";
|
|
121325
|
-
|
|
121425
|
+
count12 = (n2) => n2.toLocaleString("en-US");
|
|
121326
121426
|
}
|
|
121327
121427
|
});
|
|
121328
121428
|
|
|
@@ -121352,7 +121452,7 @@ function wholeNumber(value, min, max2) {
|
|
|
121352
121452
|
const n2 = Number(text6);
|
|
121353
121453
|
return n2 >= min && n2 <= max2 ? n2 : void 0;
|
|
121354
121454
|
}
|
|
121355
|
-
function
|
|
121455
|
+
function count13(n2) {
|
|
121356
121456
|
return n2.toLocaleString("en-US");
|
|
121357
121457
|
}
|
|
121358
121458
|
function parseSteer(text6, opts) {
|
|
@@ -121391,7 +121491,7 @@ function parseSteer(text6, opts) {
|
|
|
121391
121491
|
if (body2 === "") return { error: "the steer text is empty." };
|
|
121392
121492
|
if (body2.length > STEER_TEXT_MAX)
|
|
121393
121493
|
return {
|
|
121394
|
-
error: `the steer text is ${
|
|
121494
|
+
error: `the steer text is ${count13(body2.length)} characters, and a steer holds at most ${count13(STEER_TEXT_MAX)}.`
|
|
121395
121495
|
};
|
|
121396
121496
|
const mode = opts.mode ?? "next_step";
|
|
121397
121497
|
if (!isDeliveryMode(mode))
|
|
@@ -121405,7 +121505,7 @@ function parseSteer(text6, opts) {
|
|
|
121405
121505
|
return { error: "--reason is empty. Say why, or leave it out." };
|
|
121406
121506
|
if (reason3.length > COMMAND_REASON_MAX)
|
|
121407
121507
|
return {
|
|
121408
|
-
error: `--reason is ${
|
|
121508
|
+
error: `--reason is ${count13(reason3.length)} characters, and a reason holds at most ${count13(COMMAND_REASON_MAX)}.`
|
|
121409
121509
|
};
|
|
121410
121510
|
request4.reason = reason3;
|
|
121411
121511
|
}
|
|
@@ -121413,7 +121513,7 @@ function parseSteer(text6, opts) {
|
|
|
121413
121513
|
const minutes = wholeNumber(opts.expiresIn, 1, EXPIRES_IN_MAX_MINUTES);
|
|
121414
121514
|
if (minutes === void 0)
|
|
121415
121515
|
return {
|
|
121416
|
-
error: `--expires-in takes whole minutes from 1 to ${
|
|
121516
|
+
error: `--expires-in takes whole minutes from 1 to ${count13(EXPIRES_IN_MAX_MINUTES)}, got ${JSON.stringify(String(opts.expiresIn))}.`
|
|
121417
121517
|
};
|
|
121418
121518
|
request4.expiresInMs = minutes * 6e4;
|
|
121419
121519
|
}
|
|
@@ -122112,8 +122212,8 @@ function keyName(credential) {
|
|
|
122112
122212
|
return `the ${credential.provider} key${name2} ending ${credential.hint}`;
|
|
122113
122213
|
}
|
|
122114
122214
|
async function confirmOnTerminal(question) {
|
|
122115
|
-
const { createInterface:
|
|
122116
|
-
const rl =
|
|
122215
|
+
const { createInterface: createInterface6 } = await import("node:readline/promises");
|
|
122216
|
+
const rl = createInterface6({ input: process.stdin, output: process.stderr });
|
|
122117
122217
|
try {
|
|
122118
122218
|
const answer = (await rl.question(question)).trim().toLowerCase();
|
|
122119
122219
|
return answer === "y" || answer === "yes";
|
|
@@ -123674,8 +123774,8 @@ function formatOf(entries2) {
|
|
|
123674
123774
|
return null;
|
|
123675
123775
|
}
|
|
123676
123776
|
}
|
|
123677
|
-
function plural6(
|
|
123678
|
-
return `${
|
|
123777
|
+
function plural6(count15, one, many) {
|
|
123778
|
+
return `${count15} ${count15 === 1 ? one : many}`;
|
|
123679
123779
|
}
|
|
123680
123780
|
function digestLabel(state) {
|
|
123681
123781
|
return state === "not_carried" ? "not carried" : state;
|
|
@@ -124851,14 +124951,14 @@ function codePointLength(str4) {
|
|
|
124851
124951
|
const units = str4.length;
|
|
124852
124952
|
if (!highSurrogate.test(str4))
|
|
124853
124953
|
return units;
|
|
124854
|
-
let
|
|
124954
|
+
let count15 = units;
|
|
124855
124955
|
for (let i2 = 0; i2 < units - 1; i2++) {
|
|
124856
124956
|
if ((str4.charCodeAt(i2) & 64512) === 55296 && (str4.charCodeAt(i2 + 1) & 64512) === 56320) {
|
|
124857
|
-
|
|
124957
|
+
count15--;
|
|
124858
124958
|
i2++;
|
|
124859
124959
|
}
|
|
124860
124960
|
}
|
|
124861
|
-
return
|
|
124961
|
+
return count15;
|
|
124862
124962
|
}
|
|
124863
124963
|
function getLengthableOrigin(input2) {
|
|
124864
124964
|
if (Array.isArray(input2))
|
|
@@ -141521,15 +141621,15 @@ var init_ajvProvider_BIwGVY6G = __esm({
|
|
|
141521
141621
|
return false;
|
|
141522
141622
|
}
|
|
141523
141623
|
function countKeys(schema) {
|
|
141524
|
-
let
|
|
141624
|
+
let count15 = 0;
|
|
141525
141625
|
for (const key in schema) {
|
|
141526
141626
|
if (key === "$ref") return Infinity;
|
|
141527
|
-
|
|
141627
|
+
count15++;
|
|
141528
141628
|
if (SIMPLE_INLINED.has(key)) continue;
|
|
141529
|
-
if (typeof schema[key] == "object") (0, util_1.eachItem)(schema[key], (sch) =>
|
|
141530
|
-
if (
|
|
141629
|
+
if (typeof schema[key] == "object") (0, util_1.eachItem)(schema[key], (sch) => count15 += countKeys(sch));
|
|
141630
|
+
if (count15 === Infinity) return Infinity;
|
|
141531
141631
|
}
|
|
141532
|
-
return
|
|
141632
|
+
return count15;
|
|
141533
141633
|
}
|
|
141534
141634
|
function getFullPath(resolver, id2 = "", normalize4) {
|
|
141535
141635
|
if (normalize4 !== false) id2 = normalizeId(id2);
|
|
@@ -144482,8 +144582,8 @@ var init_ajvProvider_BIwGVY6G = __esm({
|
|
|
144482
144582
|
cxt.result(valid, () => cxt.reset());
|
|
144483
144583
|
function validateItemsWithCount() {
|
|
144484
144584
|
const schValid = gen.name("_valid");
|
|
144485
|
-
const
|
|
144486
|
-
validateItems(schValid, () => gen.if(schValid, () => checkLimits(
|
|
144585
|
+
const count15 = gen.let("count", 0);
|
|
144586
|
+
validateItems(schValid, () => gen.if(schValid, () => checkLimits(count15)));
|
|
144487
144587
|
}
|
|
144488
144588
|
function validateItems(_valid, block) {
|
|
144489
144589
|
gen.forRange("i", 0, len, (i2) => {
|
|
@@ -144496,13 +144596,13 @@ var init_ajvProvider_BIwGVY6G = __esm({
|
|
|
144496
144596
|
block();
|
|
144497
144597
|
});
|
|
144498
144598
|
}
|
|
144499
|
-
function checkLimits(
|
|
144500
|
-
gen.code((0, codegen_1._)`${
|
|
144501
|
-
if (max2 === void 0) gen.if((0, codegen_1._)`${
|
|
144599
|
+
function checkLimits(count15) {
|
|
144600
|
+
gen.code((0, codegen_1._)`${count15}++`);
|
|
144601
|
+
if (max2 === void 0) gen.if((0, codegen_1._)`${count15} >= ${min}`, () => gen.assign(valid, true).break());
|
|
144502
144602
|
else {
|
|
144503
|
-
gen.if((0, codegen_1._)`${
|
|
144603
|
+
gen.if((0, codegen_1._)`${count15} > ${max2}`, () => gen.assign(valid, false).break());
|
|
144504
144604
|
if (min === 1) gen.assign(valid, true);
|
|
144505
|
-
else gen.if((0, codegen_1._)`${
|
|
144605
|
+
else gen.if((0, codegen_1._)`${count15} >= ${min}`, () => gen.assign(valid, true));
|
|
144506
144606
|
}
|
|
144507
144607
|
}
|
|
144508
144608
|
}
|
|
@@ -155187,7 +155287,7 @@ var init_schemas6 = __esm({
|
|
|
155187
155287
|
});
|
|
155188
155288
|
|
|
155189
155289
|
// ../../packages/mcp-studio/src/model/definition-limits.ts
|
|
155190
|
-
function
|
|
155290
|
+
function count14(value) {
|
|
155191
155291
|
return value.toLocaleString("en-US");
|
|
155192
155292
|
}
|
|
155193
155293
|
var DEFINITION_BYTES_MAX, DEFINITION_SIZE;
|
|
@@ -155269,11 +155369,11 @@ function keyProblems(all, given, type) {
|
|
|
155269
155369
|
if (name2 !== void 0) counts2.set(name2, (counts2.get(name2) ?? 0) + 1);
|
|
155270
155370
|
if (key !== void 0) settable.add(key);
|
|
155271
155371
|
}
|
|
155272
|
-
for (const [name2,
|
|
155273
|
-
if (
|
|
155372
|
+
for (const [name2, count15] of counts2) {
|
|
155373
|
+
if (count15 > 1 && settable.has(name2)) {
|
|
155274
155374
|
problems.push({
|
|
155275
155375
|
field: "source.registry_type",
|
|
155276
|
-
message: `the ${type} package has ${
|
|
155376
|
+
message: `the ${type} package has ${count15} arguments keyed ${name2}, so source.arguments cannot tell them apart`
|
|
155277
155377
|
});
|
|
155278
155378
|
}
|
|
155279
155379
|
}
|
|
@@ -170097,7 +170197,7 @@ function namedSources(input2) {
|
|
|
170097
170197
|
if (bytes > DEFINITION_BYTES_MAX) {
|
|
170098
170198
|
throw new GrpcImportError(
|
|
170099
170199
|
"too_large",
|
|
170100
|
-
`The .proto files come to ${
|
|
170200
|
+
`The .proto files come to ${count14(bytes)} bytes. Import refuses a definition over ${DEFINITION_SIZE}, so import only the files the services need.`
|
|
170101
170201
|
);
|
|
170102
170202
|
}
|
|
170103
170203
|
const sources = /* @__PURE__ */ new Map();
|
|
@@ -170313,7 +170413,7 @@ function fromReflection(protos, notes) {
|
|
|
170313
170413
|
if (bytes > DEFINITION_BYTES_MAX) {
|
|
170314
170414
|
throw new GrpcImportError(
|
|
170315
170415
|
"too_large",
|
|
170316
|
-
`Server reflection returned ${
|
|
170416
|
+
`Server reflection returned ${count14(bytes)} bytes of descriptors. Import refuses a definition over ${DEFINITION_SIZE}, so import the .proto files the services need instead.`
|
|
170317
170417
|
);
|
|
170318
170418
|
}
|
|
170319
170419
|
const reflected = decodeAll(protos);
|
|
@@ -170646,11 +170746,11 @@ var init_json_schema4 = __esm({
|
|
|
170646
170746
|
}
|
|
170647
170747
|
if (this.toolNodes > TOOL_NODES_SOFT_MAX) {
|
|
170648
170748
|
this.note(
|
|
170649
|
-
`This tool's schemas passed ${
|
|
170749
|
+
`This tool's schemas passed ${count14(TOOL_NODES_SOFT_MAX)} nodes, so import cut each message after that point to a stub.`
|
|
170650
170750
|
);
|
|
170651
170751
|
return {
|
|
170652
170752
|
type: "object",
|
|
170653
|
-
description: `Cut: this tool's schemas passed ${
|
|
170753
|
+
description: `Cut: this tool's schemas passed ${count14(TOOL_NODES_SOFT_MAX)} nodes.`
|
|
170654
170754
|
};
|
|
170655
170755
|
}
|
|
170656
170756
|
this.active.set(name2, open8 + 1);
|
|
@@ -170755,7 +170855,7 @@ var init_json_schema4 = __esm({
|
|
|
170755
170855
|
if (this.nodes > EXPANSION_NODES_MAX) {
|
|
170756
170856
|
throw new GrpcImportError(
|
|
170757
170857
|
"expansion_limit",
|
|
170758
|
-
`Schema expansion passed ${
|
|
170858
|
+
`Schema expansion passed ${count14(EXPANSION_NODES_MAX)} nodes, the limit for one import. Remove unused services or split the definition, then import again.`
|
|
170759
170859
|
);
|
|
170760
170860
|
}
|
|
170761
170861
|
}
|
|
@@ -171831,12 +171931,12 @@ function lintKeys(slots, given, type, other, report) {
|
|
|
171831
171931
|
if (name2 !== void 0) counts2.set(name2, (counts2.get(name2) ?? 0) + 1);
|
|
171832
171932
|
if (key !== void 0) settable.add(key);
|
|
171833
171933
|
}
|
|
171834
|
-
for (const [name2,
|
|
171835
|
-
if (
|
|
171934
|
+
for (const [name2, count15] of counts2) {
|
|
171935
|
+
if (count15 < 2 || !settable.has(name2)) continue;
|
|
171836
171936
|
report("argument_without_value", {
|
|
171837
171937
|
tool: void 0,
|
|
171838
171938
|
field: "source.registry_type",
|
|
171839
|
-
message: `The ${type} package has ${
|
|
171939
|
+
message: `The ${type} package has ${count15} arguments keyed ${name2}, so source.arguments cannot tell them apart.`,
|
|
171840
171940
|
fix: other
|
|
171841
171941
|
});
|
|
171842
171942
|
}
|
|
@@ -172283,7 +172383,7 @@ function lintTools(folder, context, report) {
|
|
|
172283
172383
|
report("over_definition_budget", {
|
|
172284
172384
|
tool: void 0,
|
|
172285
172385
|
field: "exposure.mode",
|
|
172286
|
-
message: `${imported === 1 ? "The one imported tool costs" : `The ${imported} imported tools cost`} about ${
|
|
172386
|
+
message: `${imported === 1 ? "The one imported tool costs" : `The ${imported} imported tools cost`} about ${count14(tokens)} tokens on every request, over the definition_budget of ${count14(budget)}.`,
|
|
172287
172387
|
fix: `Set exposure.mode = "search" in server.toml, so each request lists ${SEARCH_MODE_TOOLS.length} tools (${andList([...SEARCH_MODE_TOOLS])}) in place of ${imported}.`
|
|
172288
172388
|
});
|
|
172289
172389
|
}
|
|
@@ -172349,8 +172449,8 @@ function lintLength(key, entry2, description, report) {
|
|
|
172349
172449
|
report("long_description", {
|
|
172350
172450
|
tool: key,
|
|
172351
172451
|
field: "description",
|
|
172352
|
-
message: own2 ? `${key}'s description is ${
|
|
172353
|
-
fix: `Set description in [tools.${key}] to a summary under ${
|
|
172452
|
+
message: own2 ? `${key}'s description is ${count14(description.length)} characters, over the ${count14(TOOL_DESCRIPTION_MAX)} a description may be, and every request pays for it.` : `The source's description of ${key} is ${count14(description.length)} characters, at the ${count14(TOOL_DESCRIPTION_MAX)} import cuts a description to, and every request pays for it.`,
|
|
172453
|
+
fix: `Set description in [tools.${key}] to a summary under ${count14(TOOL_DESCRIPTION_MAX)} characters.`
|
|
172354
172454
|
});
|
|
172355
172455
|
}
|
|
172356
172456
|
function lintName(folder, key, report) {
|
|
@@ -172378,7 +172478,7 @@ function lintName(folder, key, report) {
|
|
|
172378
172478
|
report("invalid_name", {
|
|
172379
172479
|
tool: key,
|
|
172380
172480
|
field: "name",
|
|
172381
|
-
message: `${name2} is ${
|
|
172481
|
+
message: `${name2} is ${count14(name2.length)} characters, and model APIs reject a tool name over ${TOOL_NAME_MAX}.`,
|
|
172382
172482
|
fix: `Rename [tools.${key}] to at most ${room} characters.`
|
|
172383
172483
|
});
|
|
172384
172484
|
}
|
|
@@ -174525,8 +174625,8 @@ function errorText3(error2) {
|
|
|
174525
174625
|
function asSentence(text6) {
|
|
174526
174626
|
return /[.!?…]$/.test(text6) ? text6 : `${text6}.`;
|
|
174527
174627
|
}
|
|
174528
|
-
function plural7(
|
|
174529
|
-
return `${
|
|
174628
|
+
function plural7(count15, one, many) {
|
|
174629
|
+
return `${count15} ${count15 === 1 ? one : many}`;
|
|
174530
174630
|
}
|
|
174531
174631
|
function pagingNote(paged, options) {
|
|
174532
174632
|
const read2 = `${plural7(paged.items, "item", "items")} from ${plural7(paged.pages, "page", "pages")}`;
|
|
@@ -175924,12 +176024,12 @@ function jsonResultBytes(value, text6) {
|
|
|
175924
176024
|
function cutList(value, rules) {
|
|
175925
176025
|
const list2 = valueAt2(value, rules.list);
|
|
175926
176026
|
if (!isList(list2) || list2.length === 0) return void 0;
|
|
175927
|
-
const render2 = (
|
|
175928
|
-
const head4 = withValueAt(value, rules.list, list2.slice(0,
|
|
176027
|
+
const render2 = (count15) => {
|
|
176028
|
+
const head4 = withValueAt(value, rules.list, list2.slice(0, count15));
|
|
175929
176029
|
return { head: head4, text: JSON.stringify(head4) };
|
|
175930
176030
|
};
|
|
175931
|
-
const fits = (
|
|
175932
|
-
const { head: head4, text: text7 } = render2(
|
|
176031
|
+
const fits = (count15) => {
|
|
176032
|
+
const { head: head4, text: text7 } = render2(count15);
|
|
175933
176033
|
return jsonResultBytes(head4, text7) <= rules.max_result_bytes;
|
|
175934
176034
|
};
|
|
175935
176035
|
if (!fits(0)) return void 0;
|
|
@@ -176216,8 +176316,8 @@ function listOf3(values) {
|
|
|
176216
176316
|
const more = values.length - shown3.length;
|
|
176217
176317
|
return more > 0 ? `${shown3.join(", ")}, and ${more} more` : shown3.join(", ");
|
|
176218
176318
|
}
|
|
176219
|
-
function plural8(
|
|
176220
|
-
return
|
|
176319
|
+
function plural8(count15, one, many = `${one}s`) {
|
|
176320
|
+
return count15 === 1 ? one : many;
|
|
176221
176321
|
}
|
|
176222
176322
|
var MAX_DEPTH4, MAX_STEPS, MAX_ISSUES, REJECTED_INPUT_MAX, ROOT, PATTERNS, PATH_STEP, SURROGATE, TYPE_NAMES, Checker;
|
|
176223
176323
|
var init_validate = __esm({
|
|
@@ -176480,12 +176580,12 @@ var init_validate = __esm({
|
|
|
176480
176580
|
const decided = schema.oneOf.map(
|
|
176481
176581
|
(part) => this.decides(part, value, path2, depth + 1)
|
|
176482
176582
|
);
|
|
176483
|
-
const
|
|
176583
|
+
const count15 = decided.filter((match) => match === true).length;
|
|
176484
176584
|
const unsure = decided.includes(void 0);
|
|
176485
|
-
if (
|
|
176585
|
+
if (count15 > 1 || count15 === 0 && !unsure)
|
|
176486
176586
|
issues.push({
|
|
176487
176587
|
path: path2,
|
|
176488
|
-
message: `${path2} must match exactly one of its oneOf schemas, and it matches ${
|
|
176588
|
+
message: `${path2} must match exactly one of its oneOf schemas, and it matches ${count15}.`
|
|
176489
176589
|
});
|
|
176490
176590
|
}
|
|
176491
176591
|
if (schema.not !== void 0 && this.decides(schema.not, value, path2, depth + 1) === true) {
|
|
@@ -188278,13 +188378,13 @@ var require_retrying_call = __commonJS({
|
|
|
188278
188378
|
}, retryDelayMs);
|
|
188279
188379
|
}
|
|
188280
188380
|
countActiveCalls() {
|
|
188281
|
-
let
|
|
188381
|
+
let count15 = 0;
|
|
188282
188382
|
for (const call2 of this.underlyingCalls) {
|
|
188283
188383
|
if ((call2 === null || call2 === void 0 ? void 0 : call2.state) === "ACTIVE") {
|
|
188284
|
-
|
|
188384
|
+
count15 += 1;
|
|
188285
188385
|
}
|
|
188286
188386
|
}
|
|
188287
|
-
return
|
|
188387
|
+
return count15;
|
|
188288
188388
|
}
|
|
188289
188389
|
handleProcessedStatus(status2, callIndex, pushback) {
|
|
188290
188390
|
var _a4, _b2, _c;
|
|
@@ -194197,13 +194297,13 @@ var require_load_balancer_weighted_round_robin = __commonJS({
|
|
|
194197
194297
|
this.weightUpdateTimer = null;
|
|
194198
194298
|
}
|
|
194199
194299
|
countChildrenWithState(state) {
|
|
194200
|
-
let
|
|
194300
|
+
let count15 = 0;
|
|
194201
194301
|
for (const entry2 of this.children.values()) {
|
|
194202
194302
|
if (entry2.child.getConnectivityState() === state) {
|
|
194203
|
-
|
|
194303
|
+
count15 += 1;
|
|
194204
194304
|
}
|
|
194205
194305
|
}
|
|
194206
|
-
return
|
|
194306
|
+
return count15;
|
|
194207
194307
|
}
|
|
194208
194308
|
updateWeight(entry2, loadReport) {
|
|
194209
194309
|
var _a4, _b2;
|
|
@@ -196606,8 +196706,8 @@ type Tool = {
|
|
|
196606
196706
|
});
|
|
196607
196707
|
|
|
196608
196708
|
// ../../packages/policy/src/compile.ts
|
|
196609
|
-
function lexicalOrder(
|
|
196610
|
-
return Array.from({ length:
|
|
196709
|
+
function lexicalOrder(count15) {
|
|
196710
|
+
return Array.from({ length: count15 }, (_, k) => `policy${k}`).sort().map((id2) => Number(id2.slice("policy".length)));
|
|
196611
196711
|
}
|
|
196612
196712
|
function sourceOrder(source, parts) {
|
|
196613
196713
|
const offsets = parts.map((part) => source.indexOf(part));
|
|
@@ -196798,10 +196898,10 @@ function compilePolicies(input2, runtime) {
|
|
|
196798
196898
|
if (policy.approval) approvalIds.push(policy.id);
|
|
196799
196899
|
}
|
|
196800
196900
|
}
|
|
196801
|
-
const
|
|
196802
|
-
if (
|
|
196901
|
+
const count15 = Object.keys(policies).length;
|
|
196902
|
+
if (count15 > MAX_POLICIES) {
|
|
196803
196903
|
errors.push({
|
|
196804
|
-
message: `The set holds ${
|
|
196904
|
+
message: `The set holds ${count15} policies. The limit is ${MAX_POLICIES}.`
|
|
196805
196905
|
});
|
|
196806
196906
|
return { schema, errors, warnings };
|
|
196807
196907
|
}
|
|
@@ -197874,10 +197974,10 @@ function readHead2(root) {
|
|
|
197874
197974
|
}
|
|
197875
197975
|
return files2;
|
|
197876
197976
|
}
|
|
197877
|
-
function parseBatch(out,
|
|
197977
|
+
function parseBatch(out, count15) {
|
|
197878
197978
|
const texts = [];
|
|
197879
197979
|
let at2 = 0;
|
|
197880
|
-
while (texts.length <
|
|
197980
|
+
while (texts.length < count15) {
|
|
197881
197981
|
const eol = out.indexOf(10, at2);
|
|
197882
197982
|
if (eol < 0) return null;
|
|
197883
197983
|
const [, type, sizeText] = out.subarray(at2, eol).toString("utf8").split(" ");
|
|
@@ -198736,8 +198836,8 @@ import * as http from "node:http";
|
|
|
198736
198836
|
import * as os from "node:os";
|
|
198737
198837
|
function describeWait(ms) {
|
|
198738
198838
|
const minutes = ms >= 6e4;
|
|
198739
|
-
const
|
|
198740
|
-
return `${
|
|
198839
|
+
const count15 = minutes ? Math.round(ms / 6e4) : Math.max(1, Math.round(ms / 1e3));
|
|
198840
|
+
return `${count15} ${minutes ? "minute" : "second"}${count15 === 1 ? "" : "s"}`;
|
|
198741
198841
|
}
|
|
198742
198842
|
function asTokenExchangeResponse(body2) {
|
|
198743
198843
|
const record2 = body2 !== null && typeof body2 === "object" ? body2 : {};
|
|
@@ -200433,8 +200533,8 @@ async function confirmsIrreversible(what, yes) {
|
|
|
200433
200533
|
process.exitCode = 2;
|
|
200434
200534
|
return false;
|
|
200435
200535
|
}
|
|
200436
|
-
const { createInterface:
|
|
200437
|
-
const rl =
|
|
200536
|
+
const { createInterface: createInterface6 } = await import("node:readline/promises");
|
|
200537
|
+
const rl = createInterface6({ input: process.stdin, output: process.stderr });
|
|
200438
200538
|
let answer;
|
|
200439
200539
|
try {
|
|
200440
200540
|
answer = (await rl.question(`${what} cannot be undone. Continue? [y/N] `)).trim().toLowerCase();
|