@oxagen/cli 2.1.5-109 → 2.1.5-114
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 +269 -389
- package/package.json +1 -1
package/oxagen.mjs
CHANGED
|
@@ -140,14 +140,14 @@ function deliveredContext(text5, bundleEtag) {
|
|
|
140
140
|
}
|
|
141
141
|
function readDeliveredContext(value) {
|
|
142
142
|
if (typeof value !== "object" || value === null) return void 0;
|
|
143
|
-
const { digest:
|
|
143
|
+
const { digest: digest5, chars, bundle_etag } = value;
|
|
144
144
|
if (typeof chars !== "number" || !Number.isSafeInteger(chars) || chars < 0)
|
|
145
145
|
return void 0;
|
|
146
|
-
if (
|
|
146
|
+
if (digest5 !== void 0 && !isSha256Digest(digest5)) return void 0;
|
|
147
147
|
if (bundle_etag !== void 0 && (typeof bundle_etag !== "string" || bundle_etag.length === 0 || bundle_etag.length > 128))
|
|
148
148
|
return void 0;
|
|
149
149
|
return {
|
|
150
|
-
...
|
|
150
|
+
...digest5 !== void 0 ? { digest: digest5 } : {},
|
|
151
151
|
chars,
|
|
152
152
|
...bundle_etag !== void 0 ? { bundle_etag } : {}
|
|
153
153
|
};
|
|
@@ -5271,11 +5271,6 @@ var init_envelope = __esm({
|
|
|
5271
5271
|
...pick(...policyKeys),
|
|
5272
5272
|
...pick(...integrityKeys)
|
|
5273
5273
|
}),
|
|
5274
|
-
// A witness verdict on the worker's run (Mission Control spec §8.5,
|
|
5275
|
-
// ADR-064). The chain carries the body as it was produced; its schema is
|
|
5276
|
-
// `proofObservedBodySchema` in @oxagen/run-evidence, which the control
|
|
5277
|
-
// plane's ingest contract applies, so this leaf package holds no copy.
|
|
5278
|
-
"proof.observed": external_exports.object({}).catchall(json),
|
|
5279
5274
|
// What the assembler put in front of the agent at a session start and what
|
|
5280
5275
|
// it cut (ADR-093, ADR-144): the bundle's `context.manifest` plus the
|
|
5281
5276
|
// steers delivered beside it. The chain carries the body as the host
|
|
@@ -5286,7 +5281,7 @@ var init_envelope = __esm({
|
|
|
5286
5281
|
// not bound, then `control.interject` when it holds the loop to ask a
|
|
5287
5282
|
// person, and `control.answer` when the answer or the timeout arrives.
|
|
5288
5283
|
// `repo.bound` and `workspace.created` record what a link or create
|
|
5289
|
-
// answer did. Each body is opaque on the wire
|
|
5284
|
+
// answer did. Each body is opaque on the wire. Its
|
|
5290
5285
|
// strict schema is in `interjection.ts`, which the host applies before it
|
|
5291
5286
|
// seals and the control plane's ingest applies again.
|
|
5292
5287
|
"repo.unknown": external_exports.object({}).catchall(json),
|
|
@@ -5303,8 +5298,8 @@ var init_envelope = __esm({
|
|
|
5303
5298
|
"skills.loaded": external_exports.object({}).catchall(json),
|
|
5304
5299
|
// A connection or DNS query a sandbox's egress proxy refused (agent
|
|
5305
5300
|
// sandboxes, ADR-289). The sandbox host reports it to the control plane,
|
|
5306
|
-
// which records it on the sandbox's run. The body is opaque on the wire
|
|
5307
|
-
//
|
|
5301
|
+
// which records it on the sandbox's run. The body is opaque on the wire.
|
|
5302
|
+
// Its strict schema is
|
|
5308
5303
|
// `hostEgressRefusedMessageSchema` in `@oxagen/oxagen/sandbox-host/protocol`,
|
|
5309
5304
|
// which this leaf package cannot import.
|
|
5310
5305
|
"oxagen:egress_refused": external_exports.object({}).catchall(json),
|
|
@@ -5314,7 +5309,7 @@ var init_envelope = __esm({
|
|
|
5314
5309
|
// frames: the write-ahead request, durable before the provider or the tool
|
|
5315
5310
|
// is reached, and the completion. The history summary is the context a
|
|
5316
5311
|
// turn carried in place of its older messages, and the goal verdict is one
|
|
5317
|
-
// verifier round. Each body is opaque on the wire
|
|
5312
|
+
// verifier round. Each body is opaque on the wire:
|
|
5318
5313
|
// its members are the receipt the assistant recorded, and the readers in
|
|
5319
5314
|
// @oxagen/run-ledger read them by name.
|
|
5320
5315
|
"model.engine_call_started": external_exports.object({}).catchall(json),
|
|
@@ -11359,11 +11354,11 @@ function resolveStellaIdentity(options) {
|
|
|
11359
11354
|
return instance === void 0 ? { pid: key } : { pid: key, instance };
|
|
11360
11355
|
}
|
|
11361
11356
|
function stellaToolUseId(name, input) {
|
|
11362
|
-
const
|
|
11357
|
+
const digest5 = digestJcs({
|
|
11363
11358
|
name,
|
|
11364
11359
|
input: input ?? null
|
|
11365
11360
|
});
|
|
11366
|
-
return `stella_${
|
|
11361
|
+
return `stella_${digest5.slice("sha256:".length, "sha256:".length + 24)}`;
|
|
11367
11362
|
}
|
|
11368
11363
|
function startInstanceToken(started) {
|
|
11369
11364
|
const text5 = started.trim();
|
|
@@ -12145,10 +12140,10 @@ function promptIssueRefs(prompt) {
|
|
|
12145
12140
|
}
|
|
12146
12141
|
found.sort((a, b3) => a.at - b3.at);
|
|
12147
12142
|
const refs = [];
|
|
12148
|
-
for (const { ref
|
|
12143
|
+
for (const { ref } of found) {
|
|
12149
12144
|
if (refs.length === PROMPT_ISSUE_REFS_MAX) break;
|
|
12150
|
-
if (!refs.some((seen) => seen.toLowerCase() ===
|
|
12151
|
-
refs.push(
|
|
12145
|
+
if (!refs.some((seen) => seen.toLowerCase() === ref.toLowerCase()))
|
|
12146
|
+
refs.push(ref);
|
|
12152
12147
|
}
|
|
12153
12148
|
return refs;
|
|
12154
12149
|
}
|
|
@@ -14852,12 +14847,12 @@ var init_backfill = __esm({
|
|
|
14852
14847
|
* from the same value.
|
|
14853
14848
|
*/
|
|
14854
14849
|
digestOf(record) {
|
|
14855
|
-
let
|
|
14856
|
-
if (
|
|
14857
|
-
|
|
14858
|
-
this.recordDigests.set(record,
|
|
14850
|
+
let digest5 = this.recordDigests.get(record);
|
|
14851
|
+
if (digest5 === void 0) {
|
|
14852
|
+
digest5 = digestJcs(record);
|
|
14853
|
+
this.recordDigests.set(record, digest5);
|
|
14859
14854
|
}
|
|
14860
|
-
return
|
|
14855
|
+
return digest5;
|
|
14861
14856
|
}
|
|
14862
14857
|
/** Count what was sealed: frames by kind, and counted tokens by model. */
|
|
14863
14858
|
collect(events) {
|
|
@@ -15417,8 +15412,8 @@ var init_request_prefix = __esm({
|
|
|
15417
15412
|
}
|
|
15418
15413
|
}
|
|
15419
15414
|
const fields = [];
|
|
15420
|
-
for (const [field,
|
|
15421
|
-
if (before.fixed.get(field) ===
|
|
15415
|
+
for (const [field, digest5] of shape.fixed) {
|
|
15416
|
+
if (before.fixed.get(field) === digest5) {
|
|
15422
15417
|
fields.push(field);
|
|
15423
15418
|
delete stored[field];
|
|
15424
15419
|
}
|
|
@@ -15727,17 +15722,17 @@ var init_system_context = __esm({
|
|
|
15727
15722
|
}
|
|
15728
15723
|
capacity;
|
|
15729
15724
|
entries = /* @__PURE__ */ new Map();
|
|
15730
|
-
get(
|
|
15731
|
-
const entry2 = this.entries.get(
|
|
15725
|
+
get(digest5) {
|
|
15726
|
+
const entry2 = this.entries.get(digest5);
|
|
15732
15727
|
if (entry2 !== void 0) {
|
|
15733
|
-
this.entries.delete(
|
|
15734
|
-
this.entries.set(
|
|
15728
|
+
this.entries.delete(digest5);
|
|
15729
|
+
this.entries.set(digest5, entry2);
|
|
15735
15730
|
}
|
|
15736
15731
|
return entry2;
|
|
15737
15732
|
}
|
|
15738
|
-
set(
|
|
15739
|
-
this.entries.delete(
|
|
15740
|
-
this.entries.set(
|
|
15733
|
+
set(digest5, context) {
|
|
15734
|
+
this.entries.delete(digest5);
|
|
15735
|
+
this.entries.set(digest5, context);
|
|
15741
15736
|
while (this.entries.size > this.capacity) {
|
|
15742
15737
|
const oldest = this.entries.keys().next().value;
|
|
15743
15738
|
if (oldest === void 0) break;
|
|
@@ -15881,10 +15876,10 @@ var init_system_context = __esm({
|
|
|
15881
15876
|
];
|
|
15882
15877
|
facts.tool_definition_tokens = sum(resolved.tools);
|
|
15883
15878
|
facts.tool_definition_tokens_basis = "estimated";
|
|
15884
|
-
const
|
|
15885
|
-
facts.system_context_digest =
|
|
15879
|
+
const digest5 = systemContextDigest(parts);
|
|
15880
|
+
facts.system_context_digest = digest5;
|
|
15886
15881
|
const sameTurn = this.listedTurn === turn;
|
|
15887
|
-
const already = sameTurn && this.listed.includes(
|
|
15882
|
+
const already = sameTurn && this.listed.includes(digest5);
|
|
15888
15883
|
const out = {};
|
|
15889
15884
|
if (!already) {
|
|
15890
15885
|
if (parts.length > SYSTEM_CONTEXT_PARTS_MAX)
|
|
@@ -15897,7 +15892,7 @@ var init_system_context = __esm({
|
|
|
15897
15892
|
this.listedTurn = turn;
|
|
15898
15893
|
this.listed = [];
|
|
15899
15894
|
}
|
|
15900
|
-
this.listed.push(
|
|
15895
|
+
this.listed.push(digest5);
|
|
15901
15896
|
if (this.listed.length > LISTED_PER_TURN) this.listed.shift();
|
|
15902
15897
|
});
|
|
15903
15898
|
}
|
|
@@ -26722,7 +26717,7 @@ import { readFileSync as readFileSync10 } from "node:fs";
|
|
|
26722
26717
|
import { dirname as dirname9, resolve as resolve3 } from "node:path";
|
|
26723
26718
|
import { fileURLToPath } from "node:url";
|
|
26724
26719
|
function readVersion() {
|
|
26725
|
-
if (true) return "2.1.5-
|
|
26720
|
+
if (true) return "2.1.5-114";
|
|
26726
26721
|
try {
|
|
26727
26722
|
const here = dirname9(fileURLToPath(import.meta.url));
|
|
26728
26723
|
const pkg = JSON.parse(
|
|
@@ -36821,14 +36816,14 @@ function createMemoryReader(deps) {
|
|
|
36821
36816
|
const seen = /* @__PURE__ */ new Set();
|
|
36822
36817
|
async function offer(entry2) {
|
|
36823
36818
|
const key = keyOf(entry2.harness, entry2.path);
|
|
36824
|
-
const
|
|
36825
|
-
if (sent.get(key) ===
|
|
36819
|
+
const digest5 = sentDigest(entry2);
|
|
36820
|
+
if (sent.get(key) === digest5) return true;
|
|
36826
36821
|
try {
|
|
36827
36822
|
await deps.send(entry2);
|
|
36828
36823
|
} catch {
|
|
36829
36824
|
return false;
|
|
36830
36825
|
}
|
|
36831
|
-
sent.set(key,
|
|
36826
|
+
sent.set(key, digest5);
|
|
36832
36827
|
count12 += 1;
|
|
36833
36828
|
return true;
|
|
36834
36829
|
}
|
|
@@ -42415,8 +42410,8 @@ async function launchContainedAgent(options) {
|
|
|
42415
42410
|
})).stdout
|
|
42416
42411
|
)
|
|
42417
42412
|
);
|
|
42418
|
-
const
|
|
42419
|
-
if (
|
|
42413
|
+
const digest5 = image.success ? image.data[0]?.Id : void 0;
|
|
42414
|
+
if (digest5 === void 0)
|
|
42420
42415
|
throw new Error("The operator's contained image is not installed");
|
|
42421
42416
|
const sessionId = `contained-${randomBytes8(16).toString("hex")}`;
|
|
42422
42417
|
const directory = mkdtempSync(join31(tmpdir(), "oxagen-contained-"));
|
|
@@ -42447,7 +42442,7 @@ async function launchContainedAgent(options) {
|
|
|
42447
42442
|
}
|
|
42448
42443
|
const spec = {
|
|
42449
42444
|
name,
|
|
42450
|
-
image:
|
|
42445
|
+
image: digest5,
|
|
42451
42446
|
workspace,
|
|
42452
42447
|
sessionDirectory: directory,
|
|
42453
42448
|
uid: process.getuid?.() ?? 0,
|
|
@@ -42537,7 +42532,7 @@ function sandboxMeasurement(placement, guest) {
|
|
|
42537
42532
|
guest.baseLayerDigest,
|
|
42538
42533
|
guest.hookConfigDigest
|
|
42539
42534
|
];
|
|
42540
|
-
if (!HOST_ID.test(placement.hostId) || !VM_ID.test(placement.vmId) || digests.some((
|
|
42535
|
+
if (!HOST_ID.test(placement.hostId) || !VM_ID.test(placement.vmId) || digests.some((digest5) => !DIGEST.test(digest5)))
|
|
42541
42536
|
throw new Error(
|
|
42542
42537
|
"The sandbox placement or a measured digest is malformed; the agent was not started"
|
|
42543
42538
|
);
|
|
@@ -42803,12 +42798,12 @@ function readBaseLayerDigest(system) {
|
|
|
42803
42798
|
throw new Error(
|
|
42804
42799
|
"The sandbox has no root-owned base layer digest; the agent was not started"
|
|
42805
42800
|
);
|
|
42806
|
-
const
|
|
42807
|
-
if (!/^sha256:[a-f0-9]{64}$/.test(
|
|
42801
|
+
const digest5 = system.readFile(BASE_LAYER_DIGEST_FILE).toString("utf8").trim();
|
|
42802
|
+
if (!/^sha256:[a-f0-9]{64}$/.test(digest5))
|
|
42808
42803
|
throw new Error(
|
|
42809
42804
|
"The sandbox's base layer digest is malformed; the agent was not started"
|
|
42810
42805
|
);
|
|
42811
|
-
return
|
|
42806
|
+
return digest5;
|
|
42812
42807
|
}
|
|
42813
42808
|
async function agentIsUnprivileged(system) {
|
|
42814
42809
|
const id2 = async (flag2) => (await system.exec("id", [flag2, SANDBOX_AGENT_USER])).stdout.trim();
|
|
@@ -44415,7 +44410,7 @@ async function readWorkingTreeChanges(exec4, cwd, baseline) {
|
|
|
44415
44410
|
(out) => out === void 0 ? void 0 : parseNameStatusZ(out)
|
|
44416
44411
|
);
|
|
44417
44412
|
if (baseline !== void 0 && tracked === void 0) return void 0;
|
|
44418
|
-
const
|
|
44413
|
+
const ref = baseline ?? "HEAD";
|
|
44419
44414
|
const entries2 = tracked === void 0 ? worktree : [
|
|
44420
44415
|
...tracked,
|
|
44421
44416
|
...worktree.filter(
|
|
@@ -44424,9 +44419,9 @@ async function readWorkingTreeChanges(exec4, cwd, baseline) {
|
|
|
44424
44419
|
];
|
|
44425
44420
|
if (entries2.length === 0) return [];
|
|
44426
44421
|
const [numstatOut, root] = await Promise.all([
|
|
44427
|
-
git2(exec4, cwd, ["diff", "--numstat",
|
|
44422
|
+
git2(exec4, cwd, ["diff", "--numstat", ref, "-z"]).then(async (head2) => {
|
|
44428
44423
|
if (head2 !== void 0) return head2;
|
|
44429
|
-
if (
|
|
44424
|
+
if (ref !== "HEAD") return void 0;
|
|
44430
44425
|
if (!await provenUnborn(exec4, cwd)) return void 0;
|
|
44431
44426
|
return git2(exec4, cwd, ["diff", "--numstat", EMPTY_TREE_OBJECT, "-z"]);
|
|
44432
44427
|
}),
|
|
@@ -45174,16 +45169,16 @@ async function contentHash(absolutePath, kind, keep) {
|
|
|
45174
45169
|
await drop();
|
|
45175
45170
|
return void 0;
|
|
45176
45171
|
}
|
|
45177
|
-
const
|
|
45178
|
-
if (copy === null) return { hash:
|
|
45172
|
+
const digest5 = hash3.digest("hex").slice(0, 32);
|
|
45173
|
+
if (copy === null) return { hash: digest5 };
|
|
45179
45174
|
const { temp, handle } = copy;
|
|
45180
45175
|
try {
|
|
45181
45176
|
await handle.close();
|
|
45182
45177
|
} catch {
|
|
45183
45178
|
await unlink(temp).catch(() => void 0);
|
|
45184
|
-
return { hash:
|
|
45179
|
+
return { hash: digest5 };
|
|
45185
45180
|
}
|
|
45186
|
-
return { hash:
|
|
45181
|
+
return { hash: digest5, copy: temp };
|
|
45187
45182
|
}
|
|
45188
45183
|
async function settleCopy(temp, name) {
|
|
45189
45184
|
if (temp === void 0) return;
|
|
@@ -45353,10 +45348,10 @@ async function committerEmail(exec4, cwd) {
|
|
|
45353
45348
|
const email = ident === void 0 ? void 0 : /<([^>]*)>/.exec(ident)?.[1];
|
|
45354
45349
|
return email === void 0 || email.length === 0 ? void 0 : email.toLowerCase();
|
|
45355
45350
|
}
|
|
45356
|
-
async function diffAgainst(exec4, cwd,
|
|
45351
|
+
async function diffAgainst(exec4, cwd, ref) {
|
|
45357
45352
|
const [names2, numstat] = await Promise.all([
|
|
45358
|
-
git2(exec4, cwd, ["diff", "--name-status", "-z",
|
|
45359
|
-
git2(exec4, cwd, ["diff", "--numstat",
|
|
45353
|
+
git2(exec4, cwd, ["diff", "--name-status", "-z", ref]),
|
|
45354
|
+
git2(exec4, cwd, ["diff", "--numstat", ref, "-z"])
|
|
45360
45355
|
]);
|
|
45361
45356
|
if (names2 === void 0 || numstat === void 0) return void 0;
|
|
45362
45357
|
return { entries: parseNameStatusZ(names2), counts: parseNumstat(numstat) };
|
|
@@ -46062,14 +46057,14 @@ async function readWorktreeSnapshot(exec4, cwd, baseline, measured) {
|
|
|
46062
46057
|
patch += bytes.subarray(0, remaining).toString("utf8");
|
|
46063
46058
|
remaining = Math.max(0, remaining - bytes.length);
|
|
46064
46059
|
};
|
|
46065
|
-
const trackedDiff = (
|
|
46060
|
+
const trackedDiff = (ref, paths) => read2([
|
|
46066
46061
|
"diff",
|
|
46067
46062
|
"--no-ext-diff",
|
|
46068
46063
|
"--no-textconv",
|
|
46069
46064
|
"--no-color",
|
|
46070
46065
|
"--src-prefix=a/",
|
|
46071
46066
|
"--dst-prefix=b/",
|
|
46072
|
-
|
|
46067
|
+
ref,
|
|
46073
46068
|
"--",
|
|
46074
46069
|
// `:(literal)`, so a path holding `*` or `?` names itself.
|
|
46075
46070
|
...(paths ?? []).map((path2) => `:(literal)${path2}`)
|
|
@@ -50645,15 +50640,15 @@ ${lineage}`;
|
|
|
50645
50640
|
for (const memory of live.values()) {
|
|
50646
50641
|
if (!sending) break;
|
|
50647
50642
|
const key = sentKey(store, memory.lineage);
|
|
50648
|
-
const
|
|
50649
|
-
if (sent.get(key) ===
|
|
50643
|
+
const digest5 = sentDigest2(memory);
|
|
50644
|
+
if (sent.get(key) === digest5) continue;
|
|
50650
50645
|
try {
|
|
50651
50646
|
await deps.send(entryOf2(memory, store));
|
|
50652
50647
|
} catch {
|
|
50653
50648
|
sending = false;
|
|
50654
50649
|
break;
|
|
50655
50650
|
}
|
|
50656
|
-
sent.set(key,
|
|
50651
|
+
sent.set(key, digest5);
|
|
50657
50652
|
result2.sent += 1;
|
|
50658
50653
|
}
|
|
50659
50654
|
for (const key of [...sent.keys()])
|
|
@@ -51292,10 +51287,10 @@ function createPackageDigester(deps) {
|
|
|
51292
51287
|
const stamp = deps.stat === void 0 ? void 0 : stampOf(await deps.stat(path2));
|
|
51293
51288
|
const known = executables.get(path2);
|
|
51294
51289
|
if (stamp !== void 0 && known?.stamp === stamp) return known.digest;
|
|
51295
|
-
const
|
|
51290
|
+
const digest5 = digestBytes(await deps.readFile(path2));
|
|
51296
51291
|
if (stamp !== void 0)
|
|
51297
|
-
rememberBounded(executables, path2, { stamp, digest:
|
|
51298
|
-
return
|
|
51292
|
+
rememberBounded(executables, path2, { stamp, digest: digest5 });
|
|
51293
|
+
return digest5;
|
|
51299
51294
|
} catch (error) {
|
|
51300
51295
|
throw new DigestProblem(`${found} could not be read (${String(error)})`, {
|
|
51301
51296
|
cause: error
|
|
@@ -52013,12 +52008,12 @@ function createLocalServers(options) {
|
|
|
52013
52008
|
async function launchFor(spec, signal) {
|
|
52014
52009
|
const prepared = prepareLaunch(spec, options.env);
|
|
52015
52010
|
if (!prepared.ok) throw new LocalServerError(prepared.refusal);
|
|
52016
|
-
const
|
|
52011
|
+
const digest5 = await options.digester.digest(
|
|
52017
52012
|
prepared.launch.package,
|
|
52018
52013
|
prepared.launch,
|
|
52019
52014
|
signal
|
|
52020
52015
|
);
|
|
52021
|
-
if (
|
|
52016
|
+
if (digest5 !== prepared.launch.package.digest)
|
|
52022
52017
|
throw new LocalServerError(digestMismatch());
|
|
52023
52018
|
return prepared.launch;
|
|
52024
52019
|
}
|
|
@@ -52630,8 +52625,8 @@ function skillDigest(skill) {
|
|
|
52630
52625
|
}
|
|
52631
52626
|
function isMarker(value) {
|
|
52632
52627
|
if (typeof value !== "object" || value === null) return false;
|
|
52633
|
-
const { digest:
|
|
52634
|
-
return typeof
|
|
52628
|
+
const { digest: digest5, lineage, sessions } = value;
|
|
52629
|
+
return typeof digest5 === "string" && (lineage === void 0 || typeof lineage === "string") && typeof sessions === "object" && sessions !== null && Object.values(sessions).every((at2) => typeof at2 === "string");
|
|
52635
52630
|
}
|
|
52636
52631
|
async function readMarker(folder) {
|
|
52637
52632
|
let entries2;
|
|
@@ -52716,7 +52711,7 @@ async function placeSkills(root, sessionId, skills, now = /* @__PURE__ */ new Da
|
|
|
52716
52711
|
continue;
|
|
52717
52712
|
}
|
|
52718
52713
|
taken.add(skill.name);
|
|
52719
|
-
const
|
|
52714
|
+
const digest5 = skillDigest(skill);
|
|
52720
52715
|
const found = await readMarker(folder);
|
|
52721
52716
|
if (found.state === "foreign") {
|
|
52722
52717
|
result2.skipped.push(skill.name);
|
|
@@ -52727,7 +52722,7 @@ async function placeSkills(root, sessionId, skills, now = /* @__PURE__ */ new Da
|
|
|
52727
52722
|
}
|
|
52728
52723
|
if (found.state === "absent") {
|
|
52729
52724
|
await writeSkill(root, skill, {
|
|
52730
|
-
digest:
|
|
52725
|
+
digest: digest5,
|
|
52731
52726
|
lineage: skill.lineage,
|
|
52732
52727
|
sessions: { [sessionId]: now.toISOString() }
|
|
52733
52728
|
});
|
|
@@ -52747,9 +52742,9 @@ async function placeSkills(root, sessionId, skills, now = /* @__PURE__ */ new Da
|
|
|
52747
52742
|
continue;
|
|
52748
52743
|
}
|
|
52749
52744
|
const joined = { ...live, [sessionId]: now.toISOString() };
|
|
52750
|
-
if (found.marker.digest ===
|
|
52745
|
+
if (found.marker.digest === digest5 && (held === void 0 || held === skill.lineage)) {
|
|
52751
52746
|
await writeMarker(folder, {
|
|
52752
|
-
digest:
|
|
52747
|
+
digest: digest5,
|
|
52753
52748
|
lineage: skill.lineage,
|
|
52754
52749
|
sessions: joined
|
|
52755
52750
|
});
|
|
@@ -52769,7 +52764,7 @@ async function placeSkills(root, sessionId, skills, now = /* @__PURE__ */ new Da
|
|
|
52769
52764
|
continue;
|
|
52770
52765
|
}
|
|
52771
52766
|
await writeSkill(root, skill, {
|
|
52772
|
-
digest:
|
|
52767
|
+
digest: digest5,
|
|
52773
52768
|
lineage: skill.lineage,
|
|
52774
52769
|
sessions: { [sessionId]: now.toISOString() }
|
|
52775
52770
|
});
|
|
@@ -61574,29 +61569,29 @@ function writeNew(root, relative11, bytes) {
|
|
|
61574
61569
|
closeSync8(fd2);
|
|
61575
61570
|
}
|
|
61576
61571
|
}
|
|
61577
|
-
function blobPath(
|
|
61578
|
-
blobRefSchema.parse(
|
|
61579
|
-
return `blobs/sha256/${
|
|
61572
|
+
function blobPath(ref) {
|
|
61573
|
+
blobRefSchema.parse(ref);
|
|
61574
|
+
return `blobs/sha256/${ref.digest.slice(7)}`;
|
|
61580
61575
|
}
|
|
61581
61576
|
function storeBlob(root, bytes, mediaType) {
|
|
61582
|
-
const
|
|
61577
|
+
const ref = blobRefSchema.parse({
|
|
61583
61578
|
digest: digestBytes(bytes),
|
|
61584
61579
|
bytes: bytes.byteLength,
|
|
61585
61580
|
media_type: mediaType
|
|
61586
61581
|
});
|
|
61587
61582
|
try {
|
|
61588
|
-
writeNew(root, blobPath(
|
|
61583
|
+
writeNew(root, blobPath(ref), bytes);
|
|
61589
61584
|
} catch (error) {
|
|
61590
61585
|
if (error.code !== "EEXIST") throw error;
|
|
61591
|
-
readBlob(root,
|
|
61586
|
+
readBlob(root, ref);
|
|
61592
61587
|
}
|
|
61593
|
-
return
|
|
61588
|
+
return ref;
|
|
61594
61589
|
}
|
|
61595
|
-
function readBlob(root,
|
|
61596
|
-
const bytes = readBounded(root, blobPath(
|
|
61597
|
-
if (bytes.length !==
|
|
61590
|
+
function readBlob(root, ref) {
|
|
61591
|
+
const bytes = readBounded(root, blobPath(ref), ref.bytes);
|
|
61592
|
+
if (bytes.length !== ref.bytes || digestBytes(bytes) !== ref.digest) {
|
|
61598
61593
|
arpFail(
|
|
61599
|
-
`Blob ${
|
|
61594
|
+
`Blob ${ref.digest} failed its integrity check: its bytes do not match its digest and size (${ref.bytes} bytes).`
|
|
61600
61595
|
);
|
|
61601
61596
|
}
|
|
61602
61597
|
return bytes;
|
|
@@ -61780,26 +61775,26 @@ ${checkpointDigest}`,
|
|
|
61780
61775
|
let total2 = 0;
|
|
61781
61776
|
const seen = /* @__PURE__ */ new Map();
|
|
61782
61777
|
const blobs = /* @__PURE__ */ new Map();
|
|
61783
|
-
const read2 = (
|
|
61784
|
-
const bytes = seen.get(
|
|
61778
|
+
const read2 = (ref) => {
|
|
61779
|
+
const bytes = seen.get(ref.digest);
|
|
61785
61780
|
if (bytes === void 0) {
|
|
61786
|
-
total2 +=
|
|
61787
|
-
seen.set(
|
|
61781
|
+
total2 += ref.bytes;
|
|
61782
|
+
seen.set(ref.digest, ref.bytes);
|
|
61788
61783
|
if (total2 > ARP_MAX_TOTAL_BYTES || seen.size > MAX_BUNDLE_BLOBS)
|
|
61789
61784
|
arpFail(
|
|
61790
61785
|
`The bundle exceeds transfer limits: it names ${seen.size} blobs and ${total2} bytes, and the limits are ${MAX_BUNDLE_BLOBS} blobs and ${ARP_MAX_TOTAL_BYTES} bytes.`
|
|
61791
61786
|
);
|
|
61792
|
-
} else if (bytes !==
|
|
61787
|
+
} else if (bytes !== ref.bytes)
|
|
61793
61788
|
arpFail(
|
|
61794
|
-
`Blob ${
|
|
61789
|
+
`Blob ${ref.digest} is named with two sizes, ${bytes} and ${ref.bytes} bytes.`
|
|
61795
61790
|
);
|
|
61796
|
-
const held = blobs.get(
|
|
61791
|
+
const held = blobs.get(ref.digest);
|
|
61797
61792
|
if (held !== void 0) return held;
|
|
61798
|
-
const loaded = readBlob(root,
|
|
61799
|
-
blobs.set(
|
|
61793
|
+
const loaded = readBlob(root, ref);
|
|
61794
|
+
blobs.set(ref.digest, loaded);
|
|
61800
61795
|
return loaded;
|
|
61801
61796
|
};
|
|
61802
|
-
for (const
|
|
61797
|
+
for (const ref of [
|
|
61803
61798
|
checkpoint.task,
|
|
61804
61799
|
checkpoint.context,
|
|
61805
61800
|
checkpoint.environment,
|
|
@@ -61807,7 +61802,7 @@ ${checkpointDigest}`,
|
|
|
61807
61802
|
checkpoint.authority,
|
|
61808
61803
|
checkpoint.capture.barrier_evidence
|
|
61809
61804
|
])
|
|
61810
|
-
read2(
|
|
61805
|
+
read2(ref);
|
|
61811
61806
|
for (const effect of checkpoint.effects)
|
|
61812
61807
|
if (effect.receipt) read2(effect.receipt);
|
|
61813
61808
|
const workspace = parseControl(
|
|
@@ -62767,7 +62762,7 @@ function prepareCheckpoint(options) {
|
|
|
62767
62762
|
const verified = verifyBundle2(options.bundle, options.publicKey);
|
|
62768
62763
|
const bundle2 = realpathSync7(options.bundle);
|
|
62769
62764
|
const { checkpoint, workspace, checkpointDigest, events } = verified;
|
|
62770
|
-
const blob = (
|
|
62765
|
+
const blob = (ref) => verified.blobs.get(ref.digest) ?? arpFail(`Blob ${ref.digest} was not read during verification.`);
|
|
62771
62766
|
const traceReport = runOracles(projectToTrace(events));
|
|
62772
62767
|
if (traceReport.checks.some((check2) => check2.status === "fail"))
|
|
62773
62768
|
arpFail("The source failed CGP trace replay checks.");
|
|
@@ -63526,7 +63521,7 @@ var init_package = __esm({
|
|
|
63526
63521
|
"package.json"() {
|
|
63527
63522
|
package_default = {
|
|
63528
63523
|
name: "@oxagen/cli",
|
|
63529
|
-
version: "2.1.5-
|
|
63524
|
+
version: "2.1.5-114",
|
|
63530
63525
|
description: "Oxagen governance CLI \u2014 spend, lineage, grounding, credentials, and audit (agentic coding lives in the stella CLI)",
|
|
63531
63526
|
type: "module",
|
|
63532
63527
|
main: "./dist/index.js",
|
|
@@ -66288,8 +66283,8 @@ function draftGovernanceToml(mode) {
|
|
|
66288
66283
|
""
|
|
66289
66284
|
].join("\n");
|
|
66290
66285
|
}
|
|
66291
|
-
function parseRepositoryRef(
|
|
66292
|
-
const parts =
|
|
66286
|
+
function parseRepositoryRef(ref) {
|
|
66287
|
+
const parts = ref.trim().split("/");
|
|
66293
66288
|
if (parts.length !== 2) return null;
|
|
66294
66289
|
const [owner, name] = parts;
|
|
66295
66290
|
if (owner.length === 0 || name.length === 0) return null;
|
|
@@ -66334,12 +66329,12 @@ async function repoList(opts = {}, writer = stdoutWriter) {
|
|
|
66334
66329
|
);
|
|
66335
66330
|
}
|
|
66336
66331
|
}
|
|
66337
|
-
async function repoLink(
|
|
66338
|
-
const parsed2 = parseRepositoryRef(
|
|
66332
|
+
async function repoLink(ref, opts = {}, writer = stdoutWriter) {
|
|
66333
|
+
const parsed2 = parseRepositoryRef(ref);
|
|
66339
66334
|
if (!parsed2) {
|
|
66340
66335
|
return usageError(
|
|
66341
66336
|
writer,
|
|
66342
|
-
`expected <owner/name>, got ${JSON.stringify(
|
|
66337
|
+
`expected <owner/name>, got ${JSON.stringify(ref)}`,
|
|
66343
66338
|
"oxagen repo link <owner/name> [--json]"
|
|
66344
66339
|
);
|
|
66345
66340
|
}
|
|
@@ -66638,12 +66633,12 @@ function countsLine(counts2) {
|
|
|
66638
66633
|
const fixtures = counts2.fixtures > 0 ? `, and ${plural2(counts2.fixtures, "file", "files")} under fixture folders` : "";
|
|
66639
66634
|
return `${found.length > 0 ? found.join(", ") : "No harness files"}${fixtures}.`;
|
|
66640
66635
|
}
|
|
66641
|
-
async function repoScan(
|
|
66642
|
-
const fullName =
|
|
66636
|
+
async function repoScan(ref, opts = {}, writer = stdoutWriter) {
|
|
66637
|
+
const fullName = ref.trim().replace(/^\/+|\/+$/g, "");
|
|
66643
66638
|
if (!/^[^/\s]+(\/[^/\s]+)+$/.test(fullName)) {
|
|
66644
66639
|
usageError(
|
|
66645
66640
|
writer,
|
|
66646
|
-
`expected <owner/name>, got ${JSON.stringify(
|
|
66641
|
+
`expected <owner/name>, got ${JSON.stringify(ref)}`,
|
|
66647
66642
|
USAGE
|
|
66648
66643
|
);
|
|
66649
66644
|
return;
|
|
@@ -67872,8 +67867,8 @@ async function loadCommittedProjectGates({
|
|
|
67872
67867
|
if (!isSafeRefName(remote) || branch !== null && !isSafeRefName(branch)) {
|
|
67873
67868
|
return { layer: null, warning: null };
|
|
67874
67869
|
}
|
|
67875
|
-
const
|
|
67876
|
-
const spec = `${
|
|
67870
|
+
const ref = `refs/remotes/${remote}/${branch ?? "HEAD"}`;
|
|
67871
|
+
const spec = `${ref}:${PROJECT_DIR_NAME}/${PROJECT_SETTINGS_FILE}`;
|
|
67877
67872
|
let text5;
|
|
67878
67873
|
try {
|
|
67879
67874
|
text5 = await git3({ cwd, run: run3, timeoutMs }, "show", spec);
|
|
@@ -69864,9 +69859,9 @@ function toolName2(server, tool) {
|
|
|
69864
69859
|
}
|
|
69865
69860
|
return name;
|
|
69866
69861
|
}
|
|
69867
|
-
function parseToolRef(
|
|
69868
|
-
if (!TOOL_REF_PATTERN.test(
|
|
69869
|
-
const [name, version2] =
|
|
69862
|
+
function parseToolRef(ref) {
|
|
69863
|
+
if (!TOOL_REF_PATTERN.test(ref)) return null;
|
|
69864
|
+
const [name, version2] = ref.split("@");
|
|
69870
69865
|
const at2 = name.indexOf(TOOL_SEPARATOR);
|
|
69871
69866
|
return {
|
|
69872
69867
|
server: name.slice(0, at2),
|
|
@@ -69880,8 +69875,8 @@ function toolTargetMatches(target2, name) {
|
|
|
69880
69875
|
}
|
|
69881
69876
|
return target2 === name;
|
|
69882
69877
|
}
|
|
69883
|
-
function parseCredentialRef(
|
|
69884
|
-
return CREDENTIAL_REF_PATTERN.test(
|
|
69878
|
+
function parseCredentialRef(ref) {
|
|
69879
|
+
return CREDENTIAL_REF_PATTERN.test(ref) ? ref.slice(CREDENTIAL_REF_PREFIX.length) : null;
|
|
69885
69880
|
}
|
|
69886
69881
|
function findMentions(body2) {
|
|
69887
69882
|
return [...body2.matchAll(MENTION)].map((match) => ({
|
|
@@ -71130,7 +71125,6 @@ var init_spend_shared = __esm({
|
|
|
71130
71125
|
cost: costSchema.nullable(),
|
|
71131
71126
|
calls: external_exports.number().int().nonnegative(),
|
|
71132
71127
|
runs: external_exports.number().int().nonnegative(),
|
|
71133
|
-
proven: moneySchema.nullable(),
|
|
71134
71128
|
accepted: moneySchema.nullable(),
|
|
71135
71129
|
productiveRatio: ratioSchema.nullable()
|
|
71136
71130
|
}).strict();
|
|
@@ -71878,9 +71872,9 @@ var require_anchors = __commonJS({
|
|
|
71878
71872
|
*/
|
|
71879
71873
|
setAnchors: () => {
|
|
71880
71874
|
for (const source of aliasObjects) {
|
|
71881
|
-
const
|
|
71882
|
-
if (typeof
|
|
71883
|
-
|
|
71875
|
+
const ref = sourceObjects.get(source);
|
|
71876
|
+
if (typeof ref === "object" && ref.anchor && (identity.isScalar(ref.node) || identity.isCollection(ref.node))) {
|
|
71877
|
+
ref.node.anchor = ref.anchor;
|
|
71884
71878
|
} else {
|
|
71885
71879
|
const error = new Error("Failed to resolve repeated object (this should not happen)");
|
|
71886
71880
|
error.source = source;
|
|
@@ -72199,15 +72193,15 @@ var require_createNode = __commonJS({
|
|
|
72199
72193
|
value = value.valueOf();
|
|
72200
72194
|
}
|
|
72201
72195
|
const { aliasDuplicateObjects, onAnchor, onTagObj, schema, sourceObjects } = ctx;
|
|
72202
|
-
let
|
|
72196
|
+
let ref = void 0;
|
|
72203
72197
|
if (aliasDuplicateObjects && value && typeof value === "object") {
|
|
72204
|
-
|
|
72205
|
-
if (
|
|
72206
|
-
|
|
72207
|
-
return new Alias.Alias(
|
|
72198
|
+
ref = sourceObjects.get(value);
|
|
72199
|
+
if (ref) {
|
|
72200
|
+
ref.anchor ?? (ref.anchor = onAnchor(value));
|
|
72201
|
+
return new Alias.Alias(ref.anchor);
|
|
72208
72202
|
} else {
|
|
72209
|
-
|
|
72210
|
-
sourceObjects.set(value,
|
|
72203
|
+
ref = { anchor: null, node: null };
|
|
72204
|
+
sourceObjects.set(value, ref);
|
|
72211
72205
|
}
|
|
72212
72206
|
}
|
|
72213
72207
|
if (tagName?.startsWith("!!"))
|
|
@@ -72219,8 +72213,8 @@ var require_createNode = __commonJS({
|
|
|
72219
72213
|
}
|
|
72220
72214
|
if (!value || typeof value !== "object") {
|
|
72221
72215
|
const node3 = new Scalar.Scalar(value);
|
|
72222
|
-
if (
|
|
72223
|
-
|
|
72216
|
+
if (ref)
|
|
72217
|
+
ref.node = node3;
|
|
72224
72218
|
return node3;
|
|
72225
72219
|
}
|
|
72226
72220
|
tagObj = value instanceof Map ? schema[identity.MAP] : Symbol.iterator in Object(value) ? schema[identity.SEQ] : schema[identity.MAP];
|
|
@@ -72234,8 +72228,8 @@ var require_createNode = __commonJS({
|
|
|
72234
72228
|
node2.tag = tagName;
|
|
72235
72229
|
else if (!tagObj.default)
|
|
72236
72230
|
node2.tag = tagObj.tag;
|
|
72237
|
-
if (
|
|
72238
|
-
|
|
72231
|
+
if (ref)
|
|
72232
|
+
ref.node = node2;
|
|
72239
72233
|
return node2;
|
|
72240
72234
|
}
|
|
72241
72235
|
exports.createNode = createNode;
|
|
@@ -79302,13 +79296,12 @@ function sha256Digest(bytes) {
|
|
|
79302
79296
|
function digestJcs2(value) {
|
|
79303
79297
|
return sha256Digest(jcsBytes(value));
|
|
79304
79298
|
}
|
|
79305
|
-
var import_canonicalize,
|
|
79299
|
+
var import_canonicalize, intrinsicArraySort, intrinsicArrayIsArray2, intrinsicRegExpTest, intrinsicTextEncoderConstructor, intrinsicTextEncoderEncode, intrinsicUint8ArrayConstructor, intrinsicHashPrototype, intrinsicHashUpdate, intrinsicHashDigest;
|
|
79306
79300
|
var init_digest3 = __esm({
|
|
79307
79301
|
"../../packages/run-evidence/src/digest.ts"() {
|
|
79308
79302
|
"use strict";
|
|
79309
79303
|
import_canonicalize = __toESM(require_canonicalize(), 1);
|
|
79310
79304
|
init_json_wire();
|
|
79311
|
-
SHA256_DIGEST_PATTERN2 = /^sha256:[0-9a-f]{64}$/;
|
|
79312
79305
|
intrinsicArraySort = Array.prototype.sort;
|
|
79313
79306
|
intrinsicArrayIsArray2 = Array.isArray;
|
|
79314
79307
|
intrinsicRegExpTest = RegExp.prototype.test;
|
|
@@ -79361,111 +79354,6 @@ var init_limits = __esm({
|
|
|
79361
79354
|
}
|
|
79362
79355
|
});
|
|
79363
79356
|
|
|
79364
|
-
// ../../packages/run-evidence/src/proof.ts
|
|
79365
|
-
var PROOF_VERDICTS, ORACLE_KINDS, WITNESS_RESULTS, DISCLOSURE_GRAINS, TAMPER_EXCLUSIONS, RUN_PUBLIC_ID_PATTERN, digest4, gitSha, ref, proofObservedBodySchema;
|
|
79366
|
-
var init_proof = __esm({
|
|
79367
|
-
"../../packages/run-evidence/src/proof.ts"() {
|
|
79368
|
-
"use strict";
|
|
79369
|
-
init_zod();
|
|
79370
|
-
init_digest3();
|
|
79371
|
-
PROOF_VERDICTS = [
|
|
79372
|
-
"flipped",
|
|
79373
|
-
"failing",
|
|
79374
|
-
"unmoved",
|
|
79375
|
-
"unsatisfied",
|
|
79376
|
-
"tampered",
|
|
79377
|
-
"unverified",
|
|
79378
|
-
"waived"
|
|
79379
|
-
];
|
|
79380
|
-
ORACLE_KINDS = [
|
|
79381
|
-
"test_flip",
|
|
79382
|
-
"build_or_type",
|
|
79383
|
-
"property",
|
|
79384
|
-
"golden_snapshot",
|
|
79385
|
-
"contract",
|
|
79386
|
-
"metamorphic",
|
|
79387
|
-
"behavioral_probe"
|
|
79388
|
-
];
|
|
79389
|
-
WITNESS_RESULTS = [
|
|
79390
|
-
"pass",
|
|
79391
|
-
"fail",
|
|
79392
|
-
"excluded",
|
|
79393
|
-
"inconclusive"
|
|
79394
|
-
];
|
|
79395
|
-
DISCLOSURE_GRAINS = ["L0", "L1", "L2", "L3"];
|
|
79396
|
-
TAMPER_EXCLUSIONS = ["held", "broken"];
|
|
79397
|
-
RUN_PUBLIC_ID_PATTERN = /^(arun|tse)_[0-9a-z]{1,64}$/;
|
|
79398
|
-
digest4 = external_exports.string().regex(SHA256_DIGEST_PATTERN2);
|
|
79399
|
-
gitSha = external_exports.string().regex(/^[0-9a-f]{7,64}$/);
|
|
79400
|
-
ref = external_exports.string().min(1).max(256);
|
|
79401
|
-
proofObservedBodySchema = external_exports.object({
|
|
79402
|
-
witness_id: external_exports.string().regex(/^wit_[0-9A-Za-z]{1,64}$/),
|
|
79403
|
-
oracle: external_exports.enum(ORACLE_KINDS),
|
|
79404
|
-
target_ref: ref,
|
|
79405
|
-
target_sha: gitSha,
|
|
79406
|
-
pr_ref: ref,
|
|
79407
|
-
pr_sha: gitSha,
|
|
79408
|
-
/** The same normalized command runs on both sides; only its digest travels. */
|
|
79409
|
-
command_normalized_digest: digest4,
|
|
79410
|
-
target_result: external_exports.enum(WITNESS_RESULTS),
|
|
79411
|
-
pr_result: external_exports.enum(WITNESS_RESULTS),
|
|
79412
|
-
verdict: external_exports.enum(PROOF_VERDICTS),
|
|
79413
|
-
/** A hash of the failure output; present whenever a side failed. */
|
|
79414
|
-
fail_fingerprint: digest4.nullable().default(null),
|
|
79415
|
-
/** A hash of the passing output; present whenever the head passed. */
|
|
79416
|
-
pass_output_digest: digest4.nullable().default(null),
|
|
79417
|
-
tamper_exclusion: external_exports.enum(TAMPER_EXCLUSIONS),
|
|
79418
|
-
/** The two fingerprints that disagree; present exactly when the exclusion broke. */
|
|
79419
|
-
tamper: external_exports.object({ fingerprint_authored: digest4, fingerprint_at_run: digest4 }).strict().optional(),
|
|
79420
|
-
disclosure_grain: external_exports.enum(DISCLOSURE_GRAINS),
|
|
79421
|
-
/** A held-out witness is reported to the record and never to the worker. */
|
|
79422
|
-
held_out: external_exports.boolean().default(false),
|
|
79423
|
-
/** The witness's own run; null when the producer ran it without recording one. */
|
|
79424
|
-
witness_run_id: external_exports.string().regex(RUN_PUBLIC_ID_PATTERN).nullable(),
|
|
79425
|
-
runner_attestation: external_exports.object({
|
|
79426
|
-
key_id: external_exports.string().min(1).max(256),
|
|
79427
|
-
signature: external_exports.string().min(1).max(1024)
|
|
79428
|
-
}).strict()
|
|
79429
|
-
}).strict().superRefine((body2, ctx) => {
|
|
79430
|
-
const refuse4 = (message, path2) => ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message, path: [path2] });
|
|
79431
|
-
const { verdict, target_result: target2, pr_result: pr } = body2;
|
|
79432
|
-
if (verdict === "flipped" && !(target2 === "fail" && pr === "pass" && body2.tamper_exclusion === "held"))
|
|
79433
|
-
refuse4(
|
|
79434
|
-
"flipped needs a fail on the target, a pass on the head and a held fingerprint",
|
|
79435
|
-
"verdict"
|
|
79436
|
-
);
|
|
79437
|
-
if (verdict === "unmoved" && !(target2 === "pass" && pr === "pass"))
|
|
79438
|
-
refuse4("unmoved needs a pass on both sides", "verdict");
|
|
79439
|
-
if (verdict === "failing" && !(target2 === "fail" && pr === "fail"))
|
|
79440
|
-
refuse4("failing needs a fail on both sides", "verdict");
|
|
79441
|
-
if (body2.tamper_exclusion === "broken" !== (verdict === "tampered"))
|
|
79442
|
-
refuse4(
|
|
79443
|
-
"a broken tamper exclusion is exactly the tampered verdict",
|
|
79444
|
-
"tamper_exclusion"
|
|
79445
|
-
);
|
|
79446
|
-
if (body2.tamper !== void 0 !== (body2.tamper_exclusion === "broken"))
|
|
79447
|
-
refuse4(
|
|
79448
|
-
"tamper names the fingerprints exactly when the exclusion broke",
|
|
79449
|
-
"tamper"
|
|
79450
|
-
);
|
|
79451
|
-
if (target2 === "excluded")
|
|
79452
|
-
refuse4("only the head result can be excluded", "target_result");
|
|
79453
|
-
if (pr === "excluded" !== (verdict === "tampered"))
|
|
79454
|
-
refuse4(
|
|
79455
|
-
"an excluded head result is exactly the tampered verdict",
|
|
79456
|
-
"pr_result"
|
|
79457
|
-
);
|
|
79458
|
-
if ((target2 === "fail" || pr === "fail") && body2.fail_fingerprint === null)
|
|
79459
|
-
refuse4("a failing side carries its fingerprint", "fail_fingerprint");
|
|
79460
|
-
if (pr === "pass" !== (body2.pass_output_digest !== null))
|
|
79461
|
-
refuse4(
|
|
79462
|
-
"the pass output digest is present exactly when the head passed",
|
|
79463
|
-
"pass_output_digest"
|
|
79464
|
-
);
|
|
79465
|
-
});
|
|
79466
|
-
}
|
|
79467
|
-
});
|
|
79468
|
-
|
|
79469
79357
|
// ../../packages/run-evidence/src/record-hash.ts
|
|
79470
79358
|
var init_record_hash = __esm({
|
|
79471
79359
|
"../../packages/run-evidence/src/record-hash.ts"() {
|
|
@@ -79482,7 +79370,6 @@ var init_src3 = __esm({
|
|
|
79482
79370
|
init_contextgraph();
|
|
79483
79371
|
init_digest3();
|
|
79484
79372
|
init_limits();
|
|
79485
|
-
init_proof();
|
|
79486
79373
|
init_record_hash();
|
|
79487
79374
|
}
|
|
79488
79375
|
});
|
|
@@ -80314,11 +80201,11 @@ var init_columns = __esm({
|
|
|
80314
80201
|
|
|
80315
80202
|
// ../../packages/tacho/src/evidence/merkle.ts
|
|
80316
80203
|
import { createHash as createHash15 } from "node:crypto";
|
|
80317
|
-
function digestToBytes(
|
|
80318
|
-
if (!SHA256_DIGEST_PATTERN.test(
|
|
80319
|
-
throw new TypeError(`not a sha256 digest: ${
|
|
80204
|
+
function digestToBytes(digest5) {
|
|
80205
|
+
if (!SHA256_DIGEST_PATTERN.test(digest5)) {
|
|
80206
|
+
throw new TypeError(`not a sha256 digest: ${digest5}`);
|
|
80320
80207
|
}
|
|
80321
|
-
return Buffer.from(
|
|
80208
|
+
return Buffer.from(digest5.slice("sha256:".length), "hex");
|
|
80322
80209
|
}
|
|
80323
80210
|
function hash2(...parts) {
|
|
80324
80211
|
const h = createHash15("sha256");
|
|
@@ -80595,15 +80482,15 @@ function checkWrappedFrame(frame, attemptId) {
|
|
|
80595
80482
|
function checkLedgerFrame(frame) {
|
|
80596
80483
|
const reasons = [];
|
|
80597
80484
|
const payloadDigest = frame["payload_digest"];
|
|
80598
|
-
let
|
|
80485
|
+
let digest5 = "held";
|
|
80599
80486
|
if (frame["payload_inline"] !== null && frame["payload_inline"] !== void 0) {
|
|
80600
80487
|
const recomputed2 = safeDigestJcs(frame["payload_inline"]);
|
|
80601
80488
|
if (recomputed2 !== payloadDigest) {
|
|
80602
|
-
|
|
80489
|
+
digest5 = "broken";
|
|
80603
80490
|
reasons.push("payload does not hash to payload_digest");
|
|
80604
80491
|
}
|
|
80605
80492
|
} else if (typeof frame["encrypted_payload_ref"] !== "string") {
|
|
80606
|
-
|
|
80493
|
+
digest5 = "broken";
|
|
80607
80494
|
reasons.push("frame carries neither a payload nor an encrypted reference");
|
|
80608
80495
|
}
|
|
80609
80496
|
const recomputed = safeDigestJcs({
|
|
@@ -80615,10 +80502,10 @@ function checkLedgerFrame(frame) {
|
|
|
80615
80502
|
observed_at: typeof frame["observed_at"] === "string" ? normalizeInstant(frame["observed_at"]) : frame["observed_at"] ?? null
|
|
80616
80503
|
});
|
|
80617
80504
|
if (recomputed !== frame["event_digest"]) {
|
|
80618
|
-
|
|
80505
|
+
digest5 = "broken";
|
|
80619
80506
|
reasons.push("identity fields do not hash to event_digest");
|
|
80620
80507
|
}
|
|
80621
|
-
return { digest:
|
|
80508
|
+
return { digest: digest5, reasons };
|
|
80622
80509
|
}
|
|
80623
80510
|
function parseJson2(text5, name, checks) {
|
|
80624
80511
|
try {
|
|
@@ -80753,12 +80640,12 @@ function verifyRunExport(files2) {
|
|
|
80753
80640
|
if (byLine.has(line)) continue;
|
|
80754
80641
|
const frame = frames[i2];
|
|
80755
80642
|
const reasons = [];
|
|
80756
|
-
let
|
|
80643
|
+
let digest5;
|
|
80757
80644
|
let link = "held";
|
|
80758
80645
|
let seq = null;
|
|
80759
80646
|
if (manifest.source === "ledger") {
|
|
80760
80647
|
const own = checkLedgerFrame(frame);
|
|
80761
|
-
|
|
80648
|
+
digest5 = own.digest;
|
|
80762
80649
|
reasons.push(...own.reasons);
|
|
80763
80650
|
const attemptSeq = frame["attempt_seq"];
|
|
80764
80651
|
seq = typeof attemptSeq === "number" ? attemptSeq : null;
|
|
@@ -80779,7 +80666,7 @@ function verifyRunExport(files2) {
|
|
|
80779
80666
|
});
|
|
80780
80667
|
} else {
|
|
80781
80668
|
const own = checkWrappedFrame(frame, attempt.attempt_id);
|
|
80782
|
-
|
|
80669
|
+
digest5 = own.digest;
|
|
80783
80670
|
reasons.push(...own.reasons);
|
|
80784
80671
|
const rawSeq = frame["seq"];
|
|
80785
80672
|
seq = typeof rawSeq === "number" ? rawSeq : null;
|
|
@@ -80798,15 +80685,15 @@ function verifyRunExport(files2) {
|
|
|
80798
80685
|
prevHash = typeof frame["hash"] === "string" ? frame["hash"] : null;
|
|
80799
80686
|
}
|
|
80800
80687
|
if (digestOf2(frame) === null) {
|
|
80801
|
-
|
|
80688
|
+
digest5 = "broken";
|
|
80802
80689
|
reasons.push("frame carries no sha256 digest");
|
|
80803
80690
|
}
|
|
80804
80691
|
verdicts.push({
|
|
80805
80692
|
line,
|
|
80806
80693
|
attempt_id: attempt.attempt_id,
|
|
80807
80694
|
seq,
|
|
80808
|
-
status:
|
|
80809
|
-
digest:
|
|
80695
|
+
status: digest5 === "broken" || link === "broken" ? "broken" : "held",
|
|
80696
|
+
digest: digest5,
|
|
80810
80697
|
link,
|
|
80811
80698
|
reasons
|
|
80812
80699
|
});
|
|
@@ -81375,14 +81262,14 @@ function recordPreimage(frontmatter, body2) {
|
|
|
81375
81262
|
);
|
|
81376
81263
|
return { ...Object.fromEntries(fields), statement: recordStatement(body2) };
|
|
81377
81264
|
}
|
|
81378
|
-
function
|
|
81265
|
+
function digest4(value) {
|
|
81379
81266
|
return sha256Digest(jcsBytes(value));
|
|
81380
81267
|
}
|
|
81381
81268
|
function stampRecord(frontmatter, body2) {
|
|
81382
81269
|
const preimage = recordPreimage(frontmatter, body2);
|
|
81383
|
-
const seed =
|
|
81270
|
+
const seed = digest4(preimage);
|
|
81384
81271
|
const id2 = `rec_${recordSlug(String(frontmatter.lineage))}_${seed.slice(7, 19)}`;
|
|
81385
|
-
return { id: id2, hash:
|
|
81272
|
+
return { id: id2, hash: digest4({ ...preimage, id: id2 }) };
|
|
81386
81273
|
}
|
|
81387
81274
|
var import_yaml, recordStatusSchema, recordOriginSchema, provenanceMemorySchema, recordProvenanceSchema, recordDateSchema, decisionStatusSchema, decisionSourceSchema, decisionFieldsSchema, declassificationShared, textDeclassificationSchema, standingDeclassificationSchema, declassificationFieldsSchema, recordShape, STEERING_RECORD_FIELDS, steeringRecordSchema;
|
|
81388
81275
|
var init_record = __esm({
|
|
@@ -82569,7 +82456,6 @@ var init_run_list = __esm({
|
|
|
82569
82456
|
"use strict";
|
|
82570
82457
|
init_src4();
|
|
82571
82458
|
init_zod();
|
|
82572
|
-
init_src3();
|
|
82573
82459
|
init_registry2();
|
|
82574
82460
|
init_run_enrichment();
|
|
82575
82461
|
init_run_fit();
|
|
@@ -82874,12 +82760,6 @@ var init_run_list = __esm({
|
|
|
82874
82760
|
* predates the recorder. Never computed on read.
|
|
82875
82761
|
*/
|
|
82876
82762
|
replayGrade: replayGradeSchema.nullable(),
|
|
82877
|
-
/**
|
|
82878
|
-
* The run's witness verdict as the rollup recorded it (spec §8.5, §12.8;
|
|
82879
|
-
* ADR-064); null when no witness reported on the run or the rollup has
|
|
82880
|
-
* not rebuilt it. Only `flipped` marks a run proven.
|
|
82881
|
-
*/
|
|
82882
|
-
verdict: external_exports.enum(PROOF_VERDICTS).nullable(),
|
|
82883
82763
|
/**
|
|
82884
82764
|
* Where the run's actions were observed from (spec §8.4, §13.3). The tier
|
|
82885
82765
|
* says how much of a policy verdict Oxagen could enforce. It does not
|
|
@@ -84780,8 +84660,8 @@ function universe(tree, files2) {
|
|
|
84780
84660
|
}
|
|
84781
84661
|
function toolResolves(target2, known) {
|
|
84782
84662
|
if (target2.endsWith("__*")) return known.servers.has(target2.slice(0, -3));
|
|
84783
|
-
const
|
|
84784
|
-
const name =
|
|
84663
|
+
const ref = parseToolRef(target2);
|
|
84664
|
+
const name = ref === null ? target2 : `${ref.server}__${ref.tool}`;
|
|
84785
84665
|
return known.tools.some((tool) => toolTargetMatches(name, tool));
|
|
84786
84666
|
}
|
|
84787
84667
|
function stringItems(value) {
|
|
@@ -93015,7 +92895,7 @@ function lockLimitProblems(type, pkg, version2, launch) {
|
|
|
93015
92895
|
function registryLaunch({
|
|
93016
92896
|
source,
|
|
93017
92897
|
entry: entry2,
|
|
93018
|
-
digest:
|
|
92898
|
+
digest: digest5,
|
|
93019
92899
|
file
|
|
93020
92900
|
}) {
|
|
93021
92901
|
const type = source.registry_type;
|
|
@@ -93074,7 +92954,7 @@ function registryLaunch({
|
|
|
93074
92954
|
const version2 = pkg.version ?? entry2.server.version;
|
|
93075
92955
|
const pinned = runner.pin === "file" ? file : void 0;
|
|
93076
92956
|
const reference = pinned !== void 0 ? ["--from", literal2(pinned.url), literal2(pkg.identifier)] : [
|
|
93077
|
-
`${literal2(pkg.identifier)}@${runner.pin === "digest" ?
|
|
92957
|
+
`${literal2(pkg.identifier)}@${runner.pin === "digest" ? digest5 : literal2(version2)}`
|
|
93078
92958
|
];
|
|
93079
92959
|
const launch = [
|
|
93080
92960
|
...fromPackage(runner.flags),
|
|
@@ -93095,7 +92975,7 @@ function registryLaunch({
|
|
|
93095
92975
|
package: {
|
|
93096
92976
|
name: pkg.identifier,
|
|
93097
92977
|
version: version2,
|
|
93098
|
-
digest:
|
|
92978
|
+
digest: digest5,
|
|
93099
92979
|
registry_type: type,
|
|
93100
92980
|
...pinned === void 0 ? {} : { file: pinned }
|
|
93101
92981
|
}
|
|
@@ -96973,26 +96853,26 @@ function isUtf8Validated(proto, parent) {
|
|
|
96973
96853
|
parent
|
|
96974
96854
|
});
|
|
96975
96855
|
}
|
|
96976
|
-
function resolveFeature(name,
|
|
96856
|
+
function resolveFeature(name, ref) {
|
|
96977
96857
|
var _a2, _b2;
|
|
96978
|
-
const featureSet = (_a2 =
|
|
96858
|
+
const featureSet = (_a2 = ref.proto.options) === null || _a2 === void 0 ? void 0 : _a2.features;
|
|
96979
96859
|
if (featureSet) {
|
|
96980
96860
|
const val = featureSet[name];
|
|
96981
96861
|
if (val != 0) {
|
|
96982
96862
|
return val;
|
|
96983
96863
|
}
|
|
96984
96864
|
}
|
|
96985
|
-
if ("kind" in
|
|
96986
|
-
if (
|
|
96987
|
-
return resolveFeature(name, (_b2 =
|
|
96865
|
+
if ("kind" in ref) {
|
|
96866
|
+
if (ref.kind == "message") {
|
|
96867
|
+
return resolveFeature(name, (_b2 = ref.parent) !== null && _b2 !== void 0 ? _b2 : ref.file);
|
|
96988
96868
|
}
|
|
96989
|
-
const editionDefaults = featureDefaults[
|
|
96869
|
+
const editionDefaults = featureDefaults[ref.edition];
|
|
96990
96870
|
if (!editionDefaults) {
|
|
96991
|
-
throw new Error(`feature default for edition ${
|
|
96871
|
+
throw new Error(`feature default for edition ${ref.edition} not found`);
|
|
96992
96872
|
}
|
|
96993
96873
|
return editionDefaults[name];
|
|
96994
96874
|
}
|
|
96995
|
-
return resolveFeature(name,
|
|
96875
|
+
return resolveFeature(name, ref.parent);
|
|
96996
96876
|
}
|
|
96997
96877
|
function assert(condition, msg) {
|
|
96998
96878
|
if (!condition) {
|
|
@@ -102433,10 +102313,10 @@ var require_decoder = __commonJS({
|
|
|
102433
102313
|
var i2 = 0;
|
|
102434
102314
|
for (; i2 < /* initializes */
|
|
102435
102315
|
mtype.fieldsArray.length; ++i2) {
|
|
102436
|
-
var field = mtype._fieldsArray[i2].resolve(), type = field.resolvedType instanceof Enum ? "int32" : field.type,
|
|
102316
|
+
var field = mtype._fieldsArray[i2].resolve(), type = field.resolvedType instanceof Enum ? "int32" : field.type, ref = "m" + util2.safeProp(field.name);
|
|
102437
102317
|
gen("case %i: {", field.id);
|
|
102438
102318
|
if (field.map) {
|
|
102439
|
-
gen("if(%s===util.emptyObject)",
|
|
102319
|
+
gen("if(%s===util.emptyObject)", ref)("%s={}", ref)("var c2 = r.uint32()+r.pos");
|
|
102440
102320
|
if (types.defaults[field.keyType] !== void 0) gen("k=%j", types.defaults[field.keyType]);
|
|
102441
102321
|
else gen("k=null");
|
|
102442
102322
|
if (types.defaults[type] !== void 0) gen("value=%j", types.defaults[type]);
|
|
@@ -102445,18 +102325,18 @@ var require_decoder = __commonJS({
|
|
|
102445
102325
|
if (types.basic[type] === void 0) gen("value=types[%i].decode(r,r.uint32(),undefined,n+1)", i2);
|
|
102446
102326
|
else gen("value=r.%s()", type);
|
|
102447
102327
|
gen("break")("default:")("r.skipType(tag2&7,n)")("break")("}")("}");
|
|
102448
|
-
if (types.long[field.keyType] !== void 0) gen('%s[typeof k==="object"?util.longToHash(k):k]=value',
|
|
102328
|
+
if (types.long[field.keyType] !== void 0) gen('%s[typeof k==="object"?util.longToHash(k):k]=value', ref);
|
|
102449
102329
|
else {
|
|
102450
|
-
if (field.keyType === "string") gen('if(k==="__proto__")')("util.makeProp(%s,k)",
|
|
102451
|
-
gen("%s[k]=value",
|
|
102330
|
+
if (field.keyType === "string") gen('if(k==="__proto__")')("util.makeProp(%s,k)", ref);
|
|
102331
|
+
gen("%s[k]=value", ref);
|
|
102452
102332
|
}
|
|
102453
102333
|
} else if (field.repeated) {
|
|
102454
|
-
gen("if(!(%s&&%s.length))",
|
|
102455
|
-
if (types.packed[type] !== void 0) gen("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",
|
|
102456
|
-
if (types.basic[type] === void 0) gen(field.delimited ? "%s.push(types[%i].decode(r,undefined,((t&~7)|4),n+1))" : "%s.push(types[%i].decode(r,r.uint32(),undefined,n+1))",
|
|
102457
|
-
else gen("%s.push(r.%s())",
|
|
102458
|
-
} else if (types.basic[type] === void 0) gen(field.delimited ? "%s=types[%i].decode(r,undefined,((t&~7)|4),n+1)" : "%s=types[%i].decode(r,r.uint32(),undefined,n+1)",
|
|
102459
|
-
else gen("%s=r.%s()",
|
|
102334
|
+
gen("if(!(%s&&%s.length))", ref, ref)("%s=[]", ref);
|
|
102335
|
+
if (types.packed[type] !== void 0) gen("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())", ref, type)("}else");
|
|
102336
|
+
if (types.basic[type] === void 0) gen(field.delimited ? "%s.push(types[%i].decode(r,undefined,((t&~7)|4),n+1))" : "%s.push(types[%i].decode(r,r.uint32(),undefined,n+1))", ref, i2);
|
|
102337
|
+
else gen("%s.push(r.%s())", ref, type);
|
|
102338
|
+
} else if (types.basic[type] === void 0) gen(field.delimited ? "%s=types[%i].decode(r,undefined,((t&~7)|4),n+1)" : "%s=types[%i].decode(r,r.uint32(),undefined,n+1)", ref, i2);
|
|
102339
|
+
else gen("%s=r.%s()", ref, type);
|
|
102460
102340
|
gen("break")("}");
|
|
102461
102341
|
}
|
|
102462
102342
|
gen("default:")("r.skipType(t&7,n)")("break")("}")("}");
|
|
@@ -102479,14 +102359,14 @@ var require_verifier = __commonJS({
|
|
|
102479
102359
|
function invalid(field, expected) {
|
|
102480
102360
|
return field.name + ": " + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:" + field.keyType + "}" : "") + " expected";
|
|
102481
102361
|
}
|
|
102482
|
-
function genVerifyValue(gen, field, fieldIndex,
|
|
102362
|
+
function genVerifyValue(gen, field, fieldIndex, ref) {
|
|
102483
102363
|
if (field.resolvedType) {
|
|
102484
102364
|
if (field.resolvedType instanceof Enum) {
|
|
102485
|
-
gen("switch(%s){",
|
|
102365
|
+
gen("switch(%s){", ref)("default:")("return%j", invalid(field, "enum value"));
|
|
102486
102366
|
for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen("case %i:", field.resolvedType.values[keys[j]]);
|
|
102487
102367
|
gen("break")("}");
|
|
102488
102368
|
} else {
|
|
102489
|
-
gen("{")("var e=types[%i].verify(%s,n+1);", fieldIndex,
|
|
102369
|
+
gen("{")("var e=types[%i].verify(%s,n+1);", fieldIndex, ref)("if(e)")("return%j+e", field.name + ".")("}");
|
|
102490
102370
|
}
|
|
102491
102371
|
} else {
|
|
102492
102372
|
switch (field.type) {
|
|
@@ -102495,50 +102375,50 @@ var require_verifier = __commonJS({
|
|
|
102495
102375
|
case "sint32":
|
|
102496
102376
|
case "fixed32":
|
|
102497
102377
|
case "sfixed32":
|
|
102498
|
-
gen("if(!util.isInteger(%s))",
|
|
102378
|
+
gen("if(!util.isInteger(%s))", ref)("return%j", invalid(field, "integer"));
|
|
102499
102379
|
break;
|
|
102500
102380
|
case "int64":
|
|
102501
102381
|
case "uint64":
|
|
102502
102382
|
case "sint64":
|
|
102503
102383
|
case "fixed64":
|
|
102504
102384
|
case "sfixed64":
|
|
102505
|
-
gen("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",
|
|
102385
|
+
gen("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))", ref, ref, ref, ref)("return%j", invalid(field, "integer|Long"));
|
|
102506
102386
|
break;
|
|
102507
102387
|
case "float":
|
|
102508
102388
|
case "double":
|
|
102509
|
-
gen('if(typeof %s!=="number")',
|
|
102389
|
+
gen('if(typeof %s!=="number")', ref)("return%j", invalid(field, "number"));
|
|
102510
102390
|
break;
|
|
102511
102391
|
case "bool":
|
|
102512
|
-
gen('if(typeof %s!=="boolean")',
|
|
102392
|
+
gen('if(typeof %s!=="boolean")', ref)("return%j", invalid(field, "boolean"));
|
|
102513
102393
|
break;
|
|
102514
102394
|
case "string":
|
|
102515
|
-
gen("if(!util.isString(%s))",
|
|
102395
|
+
gen("if(!util.isString(%s))", ref)("return%j", invalid(field, "string"));
|
|
102516
102396
|
break;
|
|
102517
102397
|
case "bytes":
|
|
102518
|
-
gen('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',
|
|
102398
|
+
gen('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))', ref, ref, ref)("return%j", invalid(field, "buffer"));
|
|
102519
102399
|
break;
|
|
102520
102400
|
}
|
|
102521
102401
|
}
|
|
102522
102402
|
return gen;
|
|
102523
102403
|
}
|
|
102524
|
-
function genVerifyKey(gen, field,
|
|
102404
|
+
function genVerifyKey(gen, field, ref) {
|
|
102525
102405
|
switch (field.keyType) {
|
|
102526
102406
|
case "int32":
|
|
102527
102407
|
case "uint32":
|
|
102528
102408
|
case "sint32":
|
|
102529
102409
|
case "fixed32":
|
|
102530
102410
|
case "sfixed32":
|
|
102531
|
-
gen("if(!util.key32Re.test(%s))",
|
|
102411
|
+
gen("if(!util.key32Re.test(%s))", ref)("return%j", invalid(field, "integer key"));
|
|
102532
102412
|
break;
|
|
102533
102413
|
case "int64":
|
|
102534
102414
|
case "uint64":
|
|
102535
102415
|
case "sint64":
|
|
102536
102416
|
case "fixed64":
|
|
102537
102417
|
case "sfixed64":
|
|
102538
|
-
gen("if(!util.key64Re.test(%s))",
|
|
102418
|
+
gen("if(!util.key64Re.test(%s))", ref)("return%j", invalid(field, "integer|Long key"));
|
|
102539
102419
|
break;
|
|
102540
102420
|
case "bool":
|
|
102541
|
-
gen("if(!util.key2Re.test(%s))",
|
|
102421
|
+
gen("if(!util.key2Re.test(%s))", ref)("return%j", invalid(field, "boolean key"));
|
|
102542
102422
|
break;
|
|
102543
102423
|
}
|
|
102544
102424
|
return gen;
|
|
@@ -102549,15 +102429,15 @@ var require_verifier = __commonJS({
|
|
|
102549
102429
|
if (oneofs.length) gen("var p={}");
|
|
102550
102430
|
for (var i2 = 0; i2 < /* initializes */
|
|
102551
102431
|
mtype.fieldsArray.length; ++i2) {
|
|
102552
|
-
var field = mtype._fieldsArray[i2].resolve(),
|
|
102553
|
-
if (field.optional) gen("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",
|
|
102432
|
+
var field = mtype._fieldsArray[i2].resolve(), ref = "m" + util2.safeProp(field.name);
|
|
102433
|
+
if (field.optional) gen("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", ref, field.name);
|
|
102554
102434
|
if (field.map) {
|
|
102555
|
-
gen("if(!util.isObject(%s))",
|
|
102435
|
+
gen("if(!util.isObject(%s))", ref)("return%j", invalid(field, "object"))("var k=Object.keys(%s)", ref)("for(var i=0;i<k.length;++i){");
|
|
102556
102436
|
genVerifyKey(gen, field, "k[i]");
|
|
102557
|
-
genVerifyValue(gen, field, i2,
|
|
102437
|
+
genVerifyValue(gen, field, i2, ref + "[k[i]]")("}");
|
|
102558
102438
|
} else if (field.repeated) {
|
|
102559
|
-
gen("if(!Array.isArray(%s))",
|
|
102560
|
-
genVerifyValue(gen, field, i2,
|
|
102439
|
+
gen("if(!Array.isArray(%s))", ref)("return%j", invalid(field, "array"))("for(var i=0;i<%s.length;++i){", ref);
|
|
102440
|
+
genVerifyValue(gen, field, i2, ref + "[i]")("}");
|
|
102561
102441
|
} else {
|
|
102562
102442
|
if (field.partOf) {
|
|
102563
102443
|
var oneofProp = util2.safeProp(field.partOf.name);
|
|
@@ -102565,7 +102445,7 @@ var require_verifier = __commonJS({
|
|
|
102565
102445
|
seenFirstField[field.partOf.name] = 1;
|
|
102566
102446
|
gen("p%s=1", oneofProp);
|
|
102567
102447
|
}
|
|
102568
|
-
genVerifyValue(gen, field, i2,
|
|
102448
|
+
genVerifyValue(gen, field, i2, ref);
|
|
102569
102449
|
}
|
|
102570
102450
|
if (field.optional) gen("}");
|
|
102571
102451
|
}
|
|
@@ -104375,40 +104255,40 @@ var require_encoder = __commonJS({
|
|
|
104375
104255
|
var Enum = require_enum();
|
|
104376
104256
|
var types = require_types();
|
|
104377
104257
|
var util2 = require_util();
|
|
104378
|
-
function genTypePartial(gen, field, fieldIndex,
|
|
104379
|
-
return field.delimited ? gen("types[%i].encode(%s,w.uint32(%i),q+1).uint32(%i)", fieldIndex,
|
|
104258
|
+
function genTypePartial(gen, field, fieldIndex, ref) {
|
|
104259
|
+
return field.delimited ? gen("types[%i].encode(%s,w.uint32(%i),q+1).uint32(%i)", fieldIndex, ref, (field.id << 3 | 3) >>> 0, (field.id << 3 | 4) >>> 0) : gen("types[%i].encode(%s,w.uint32(%i).fork(),q+1).ldelim()", fieldIndex, ref, (field.id << 3 | 2) >>> 0);
|
|
104380
104260
|
}
|
|
104381
104261
|
function encoder6(mtype) {
|
|
104382
104262
|
var gen = util2.codegen(["m", "w", "q"], mtype.name + "$encode")("if(!w)")("w=Writer.create()")("if(q===undefined)q=0")("if(q>util.recursionLimit)")('throw Error("max depth exceeded")');
|
|
104383
|
-
var i2,
|
|
104263
|
+
var i2, ref;
|
|
104384
104264
|
var fields = (
|
|
104385
104265
|
/* initializes */
|
|
104386
104266
|
mtype.fieldsArray.slice().sort(util2.compareFieldsById)
|
|
104387
104267
|
);
|
|
104388
104268
|
for (var i2 = 0; i2 < fields.length; ++i2) {
|
|
104389
104269
|
var field = fields[i2].resolve(), index = mtype._fieldsArray.indexOf(field), type = field.resolvedType instanceof Enum ? "int32" : field.type, wireType = types.basic[type];
|
|
104390
|
-
|
|
104270
|
+
ref = "m" + util2.safeProp(field.name);
|
|
104391
104271
|
if (field.map) {
|
|
104392
|
-
gen("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",
|
|
104393
|
-
if (wireType === void 0) gen("types[%i].encode(%s[ks[i]],w.uint32(18).fork(),q+1).ldelim().ldelim()", index,
|
|
104394
|
-
else gen(".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | wireType, type,
|
|
104272
|
+
gen("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", ref, field.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){", ref)("w.uint32(%i).fork().uint32(%i).%s(ks[i])", (field.id << 3 | 2) >>> 0, 8 | types.mapKey[field.keyType], field.keyType);
|
|
104273
|
+
if (wireType === void 0) gen("types[%i].encode(%s[ks[i]],w.uint32(18).fork(),q+1).ldelim().ldelim()", index, ref);
|
|
104274
|
+
else gen(".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | wireType, type, ref);
|
|
104395
104275
|
gen("}")("}");
|
|
104396
104276
|
} else if (field.repeated) {
|
|
104397
|
-
gen("if(%s!=null&&%s.length){",
|
|
104277
|
+
gen("if(%s!=null&&%s.length){", ref, ref);
|
|
104398
104278
|
if (field.packed && types.packed[type] !== void 0) {
|
|
104399
|
-
gen("w.uint32(%i).fork()", (field.id << 3 | 2) >>> 0)("for(var i=0;i<%s.length;++i)",
|
|
104279
|
+
gen("w.uint32(%i).fork()", (field.id << 3 | 2) >>> 0)("for(var i=0;i<%s.length;++i)", ref)("w.%s(%s[i])", type, ref)("w.ldelim()");
|
|
104400
104280
|
} else {
|
|
104401
|
-
gen("for(var i=0;i<%s.length;++i)",
|
|
104281
|
+
gen("for(var i=0;i<%s.length;++i)", ref);
|
|
104402
104282
|
if (wireType === void 0)
|
|
104403
|
-
genTypePartial(gen, field, index,
|
|
104404
|
-
else gen("w.uint32(%i).%s(%s[i])", (field.id << 3 | wireType) >>> 0, type,
|
|
104283
|
+
genTypePartial(gen, field, index, ref + "[i]");
|
|
104284
|
+
else gen("w.uint32(%i).%s(%s[i])", (field.id << 3 | wireType) >>> 0, type, ref);
|
|
104405
104285
|
}
|
|
104406
104286
|
gen("}");
|
|
104407
104287
|
} else {
|
|
104408
|
-
if (field.optional) gen("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",
|
|
104288
|
+
if (field.optional) gen("if(%s!=null&&Object.hasOwnProperty.call(m,%j))", ref, field.name);
|
|
104409
104289
|
if (wireType === void 0)
|
|
104410
|
-
genTypePartial(gen, field, index,
|
|
104411
|
-
else gen("w.uint32(%i).%s(%s)", (field.id << 3 | wireType) >>> 0, type,
|
|
104290
|
+
genTypePartial(gen, field, index, ref);
|
|
104291
|
+
else gen("w.uint32(%i).%s(%s)", (field.id << 3 | wireType) >>> 0, type, ref);
|
|
104412
104292
|
}
|
|
104413
104293
|
}
|
|
104414
104294
|
return gen("return w");
|
|
@@ -106357,9 +106237,9 @@ function methodOf(method, service, build) {
|
|
|
106357
106237
|
const full = `${service}.${method.name}`;
|
|
106358
106238
|
keepComment(build, full, method.comment);
|
|
106359
106239
|
const descriptor = create(MethodDescriptorProtoSchema, { name: method.name });
|
|
106360
|
-
const pend = (
|
|
106240
|
+
const pend = (ref, which) => {
|
|
106361
106241
|
build.pending.push({
|
|
106362
|
-
ref
|
|
106242
|
+
ref,
|
|
106363
106243
|
scope: service,
|
|
106364
106244
|
holder: `the ${which} type of ${service}/${method.name}`,
|
|
106365
106245
|
accepts: "message",
|
|
@@ -107331,22 +107211,22 @@ var init_print = __esm({
|
|
|
107331
107211
|
* The shortest name for `ref` that resolves back to it from `scope`, or
|
|
107332
107212
|
* the full name with its leading dot when no shorter one does.
|
|
107333
107213
|
*/
|
|
107334
|
-
typeName(
|
|
107335
|
-
if (!
|
|
107214
|
+
typeName(ref, scope, where, accepts) {
|
|
107215
|
+
if (!ref.startsWith("."))
|
|
107336
107216
|
this.refuse(
|
|
107337
|
-
`${where} is ${JSON.stringify(
|
|
107217
|
+
`${where} is ${JSON.stringify(ref)}, which is not a full type name`
|
|
107338
107218
|
);
|
|
107339
|
-
const full =
|
|
107219
|
+
const full = ref.slice(1);
|
|
107340
107220
|
const parts = full.split(".");
|
|
107341
107221
|
if (!parts.every((part2) => IDENTIFIER.test(part2)))
|
|
107342
107222
|
this.refuse(
|
|
107343
|
-
`${where} is ${JSON.stringify(
|
|
107223
|
+
`${where} is ${JSON.stringify(ref)}, which is not a valid type name`
|
|
107344
107224
|
);
|
|
107345
107225
|
const found = this.symbols.find(full, this.visible);
|
|
107346
107226
|
const fits = found !== void 0 && (found.kind === "message" ? accepts !== "enum" : found.kind === "enum" ? accepts !== "message" : false);
|
|
107347
107227
|
if (!fits)
|
|
107348
107228
|
this.refuse(
|
|
107349
|
-
`${where} is ${
|
|
107229
|
+
`${where} is ${ref}, which is not ${ACCEPTS_TEXT[accepts]} that ${this.file.name} or its imports define`
|
|
107350
107230
|
);
|
|
107351
107231
|
for (let start = parts.length - 1; start >= 0; start -= 1) {
|
|
107352
107232
|
if (RESERVED.has(parts[start] ?? "")) continue;
|
|
@@ -107354,7 +107234,7 @@ var init_print = __esm({
|
|
|
107354
107234
|
if (this.symbols.lookup(candidate, scope, this.visible)?.name === full)
|
|
107355
107235
|
return candidate;
|
|
107356
107236
|
}
|
|
107357
|
-
return
|
|
107237
|
+
return ref;
|
|
107358
107238
|
}
|
|
107359
107239
|
/** The leading comment for the SourceCodeInfo path, as `//` lines. */
|
|
107360
107240
|
comment(path2) {
|
|
@@ -107558,36 +107438,36 @@ var init_symbols = __esm({
|
|
|
107558
107438
|
* from there. When a one-part name finds something that is not a type,
|
|
107559
107439
|
* the search goes on outward.
|
|
107560
107440
|
*/
|
|
107561
|
-
lookup(
|
|
107562
|
-
if (
|
|
107563
|
-
const dot =
|
|
107564
|
-
const first = dot === -1 ?
|
|
107441
|
+
lookup(ref, scope, visible) {
|
|
107442
|
+
if (ref.startsWith(".")) return this.find(ref.slice(1), visible);
|
|
107443
|
+
const dot = ref.indexOf(".");
|
|
107444
|
+
const first = dot === -1 ? ref : ref.slice(0, dot);
|
|
107565
107445
|
const parts = scope === "" ? [] : scope.split(".");
|
|
107566
107446
|
for (let end = parts.length; end > 0; end -= 1) {
|
|
107567
107447
|
const prefix = parts.slice(0, end).join(".");
|
|
107568
107448
|
const found = this.find(`${prefix}.${first}`, visible);
|
|
107569
107449
|
if (found === void 0) continue;
|
|
107570
|
-
if (dot !== -1) return this.find(`${prefix}.${
|
|
107450
|
+
if (dot !== -1) return this.find(`${prefix}.${ref}`, visible);
|
|
107571
107451
|
if (found.kind === "message" || found.kind === "enum") return found;
|
|
107572
107452
|
}
|
|
107573
|
-
return this.find(
|
|
107453
|
+
return this.find(ref, visible);
|
|
107574
107454
|
}
|
|
107575
107455
|
/**
|
|
107576
107456
|
* Why lookup found nothing for `ref`, when protoc says more than that
|
|
107577
107457
|
* nothing defines it, or undefined when nothing more explains it. It walks
|
|
107578
107458
|
* the scopes as lookup does.
|
|
107579
107459
|
*/
|
|
107580
|
-
explain(
|
|
107581
|
-
if (
|
|
107582
|
-
const dot =
|
|
107583
|
-
const first = dot === -1 ?
|
|
107460
|
+
explain(ref, scope, visible) {
|
|
107461
|
+
if (ref.startsWith(".")) return void 0;
|
|
107462
|
+
const dot = ref.indexOf(".");
|
|
107463
|
+
const first = dot === -1 ? ref : ref.slice(0, dot);
|
|
107584
107464
|
const parts = scope === "" ? [] : scope.split(".");
|
|
107585
107465
|
for (let end = parts.length; end > 0; end -= 1) {
|
|
107586
107466
|
const prefix = parts.slice(0, end).join(".");
|
|
107587
107467
|
const found = this.find(`${prefix}.${first}`, visible);
|
|
107588
107468
|
if (found === void 0) continue;
|
|
107589
107469
|
if (dot !== -1)
|
|
107590
|
-
return { reason: "shadowed", first: found, readAs: `${prefix}.${
|
|
107470
|
+
return { reason: "shadowed", first: found, readAs: `${prefix}.${ref}` };
|
|
107591
107471
|
if (found.kind !== "message" && found.kind !== "enum")
|
|
107592
107472
|
return { reason: "not_type", found };
|
|
107593
107473
|
}
|
|
@@ -107687,8 +107567,8 @@ function buildSet(input, notes) {
|
|
|
107687
107567
|
const customOptions = /* @__PURE__ */ new Set();
|
|
107688
107568
|
for (const [name, file] of built) {
|
|
107689
107569
|
const visible = visibility.of(name);
|
|
107690
|
-
for (const
|
|
107691
|
-
resolve24(
|
|
107570
|
+
for (const ref of file.pending)
|
|
107571
|
+
resolve24(ref, name, visible, everyFile, symbols);
|
|
107692
107572
|
for (const [key, text5] of file.comments) comments.set(key, text5);
|
|
107693
107573
|
for (const option of file.customOptions) customOptions.add(option);
|
|
107694
107574
|
}
|
|
@@ -107862,51 +107742,51 @@ function remember(built, name, file) {
|
|
|
107862
107742
|
built.set(name, file);
|
|
107863
107743
|
return file.proto;
|
|
107864
107744
|
}
|
|
107865
|
-
function resolve24(
|
|
107866
|
-
const found = symbols.lookup(
|
|
107745
|
+
function resolve24(ref, file, visible, everyFile, symbols) {
|
|
107746
|
+
const found = symbols.lookup(ref.ref, ref.scope, visible);
|
|
107867
107747
|
if (found === void 0) {
|
|
107868
|
-
const everywhere = symbols.lookup(
|
|
107748
|
+
const everywhere = symbols.lookup(ref.ref, ref.scope, everyFile);
|
|
107869
107749
|
const declaredIn = everywhere === void 0 ? void 0 : symbols.declaredIn(everywhere.name);
|
|
107870
107750
|
if (declaredIn !== void 0) {
|
|
107871
107751
|
throw new GrpcImportError(
|
|
107872
107752
|
"unresolved",
|
|
107873
|
-
`In ${file}, ${
|
|
107753
|
+
`In ${file}, ${ref.holder} names ${ref.ref}, which ${declaredIn} defines, but ${file} does not import ${declaredIn}. Add import "${declaredIn}"; to ${file}.`,
|
|
107874
107754
|
file
|
|
107875
107755
|
);
|
|
107876
107756
|
}
|
|
107877
|
-
const miss = symbols.explain(
|
|
107757
|
+
const miss = symbols.explain(ref.ref, ref.scope, visible);
|
|
107878
107758
|
if (miss?.reason === "shadowed") {
|
|
107879
|
-
const fromRoot = symbols.find(
|
|
107759
|
+
const fromRoot = symbols.find(ref.ref, visible) === void 0 ? "the full name with a leading dot" : `.${ref.ref}`;
|
|
107880
107760
|
throw new GrpcImportError(
|
|
107881
107761
|
"unresolved",
|
|
107882
|
-
`In ${file}, ${
|
|
107762
|
+
`In ${file}, ${ref.holder} names ${ref.ref}, which protoc reads as ${miss.readAs} because the ${miss.first.kind} ${miss.first.name} is in a nearer scope. Nothing defines ${miss.readAs}. Write ${fromRoot} to start from the outermost scope.`,
|
|
107883
107763
|
file
|
|
107884
107764
|
);
|
|
107885
107765
|
}
|
|
107886
107766
|
if (miss?.reason === "not_type") {
|
|
107887
107767
|
throw new GrpcImportError(
|
|
107888
107768
|
"unresolved",
|
|
107889
|
-
`In ${file}, ${
|
|
107769
|
+
`In ${file}, ${ref.holder} names ${ref.ref}, which is the ${miss.found.kind} ${miss.found.name}. It must name ${wantedBy(ref)}.`,
|
|
107890
107770
|
file
|
|
107891
107771
|
);
|
|
107892
107772
|
}
|
|
107893
107773
|
throw new GrpcImportError(
|
|
107894
107774
|
"unresolved",
|
|
107895
|
-
`In ${file}, ${
|
|
107775
|
+
`In ${file}, ${ref.holder} names ${ref.ref}, which none of its imports defines. Define ${ref.ref}, or import the file that does.`,
|
|
107896
107776
|
file
|
|
107897
107777
|
);
|
|
107898
107778
|
}
|
|
107899
|
-
if (found.kind === "package" || found.kind === "service" ||
|
|
107779
|
+
if (found.kind === "package" || found.kind === "service" || ref.accepts === "message" && found.kind === "enum") {
|
|
107900
107780
|
throw new GrpcImportError(
|
|
107901
107781
|
"unresolved",
|
|
107902
|
-
`In ${file}, ${
|
|
107782
|
+
`In ${file}, ${ref.holder} names ${ref.ref}, which is the ${found.kind} ${found.name}. It must name ${wantedBy(ref)}.`,
|
|
107903
107783
|
file
|
|
107904
107784
|
);
|
|
107905
107785
|
}
|
|
107906
|
-
|
|
107786
|
+
ref.resolve(found.name, found.kind);
|
|
107907
107787
|
}
|
|
107908
|
-
function wantedBy(
|
|
107909
|
-
return
|
|
107788
|
+
function wantedBy(ref) {
|
|
107789
|
+
return ref.accepts === "message" ? "a message" : "a message or an enum";
|
|
107910
107790
|
}
|
|
107911
107791
|
var PROTO_DIR, Visibility;
|
|
107912
107792
|
var init_set = __esm({
|
|
@@ -109567,13 +109447,13 @@ function lintServer(folder, context, report) {
|
|
|
109567
109447
|
fix: "Rename the server to at most 24 lowercase letters, digits, and underscores, starting with a letter."
|
|
109568
109448
|
});
|
|
109569
109449
|
}
|
|
109570
|
-
for (const [field,
|
|
109571
|
-
if (context.credentials.has(
|
|
109450
|
+
for (const [field, ref] of credentialFields2(folder)) {
|
|
109451
|
+
if (context.credentials.has(ref)) continue;
|
|
109572
109452
|
report("unknown_credential", {
|
|
109573
109453
|
tool: void 0,
|
|
109574
109454
|
field,
|
|
109575
|
-
message: `${field} names ${
|
|
109576
|
-
fix: `Add ${
|
|
109455
|
+
message: `${field} names ${ref}, and the organization has no credential by that name, so every call would fail.`,
|
|
109456
|
+
fix: `Add ${ref} in Oxagen, or set ${field} to a credential the organization has.`
|
|
109577
109457
|
});
|
|
109578
109458
|
}
|
|
109579
109459
|
const { source } = server;
|
|
@@ -113101,11 +112981,11 @@ function compilePattern(pattern) {
|
|
|
113101
112981
|
}
|
|
113102
112982
|
}
|
|
113103
112983
|
}
|
|
113104
|
-
function resolveRef(root,
|
|
113105
|
-
if (
|
|
113106
|
-
if (!
|
|
112984
|
+
function resolveRef(root, ref) {
|
|
112985
|
+
if (ref === "#") return root;
|
|
112986
|
+
if (!ref.startsWith("#/")) return void 0;
|
|
113107
112987
|
let current = root;
|
|
113108
|
-
for (const raw of
|
|
112988
|
+
for (const raw of ref.slice(2).split("/")) {
|
|
113109
112989
|
let token;
|
|
113110
112990
|
try {
|
|
113111
112991
|
token = decodeURIComponent(raw).replaceAll("~1", "/").replaceAll("~0", "~");
|
|
@@ -120992,27 +120872,27 @@ var require_channelz = __commonJS({
|
|
|
120992
120872
|
var subchannel_address_1 = require_subchannel_address();
|
|
120993
120873
|
var admin_1 = require_admin();
|
|
120994
120874
|
var make_client_1 = require_make_client();
|
|
120995
|
-
function channelRefToMessage(
|
|
120875
|
+
function channelRefToMessage(ref) {
|
|
120996
120876
|
return {
|
|
120997
|
-
channel_id:
|
|
120998
|
-
name:
|
|
120877
|
+
channel_id: ref.id,
|
|
120878
|
+
name: ref.name
|
|
120999
120879
|
};
|
|
121000
120880
|
}
|
|
121001
|
-
function subchannelRefToMessage(
|
|
120881
|
+
function subchannelRefToMessage(ref) {
|
|
121002
120882
|
return {
|
|
121003
|
-
subchannel_id:
|
|
121004
|
-
name:
|
|
120883
|
+
subchannel_id: ref.id,
|
|
120884
|
+
name: ref.name
|
|
121005
120885
|
};
|
|
121006
120886
|
}
|
|
121007
|
-
function serverRefToMessage(
|
|
120887
|
+
function serverRefToMessage(ref) {
|
|
121008
120888
|
return {
|
|
121009
|
-
server_id:
|
|
120889
|
+
server_id: ref.id
|
|
121010
120890
|
};
|
|
121011
120891
|
}
|
|
121012
|
-
function socketRefToMessage(
|
|
120892
|
+
function socketRefToMessage(ref) {
|
|
121013
120893
|
return {
|
|
121014
|
-
socket_id:
|
|
121015
|
-
name:
|
|
120894
|
+
socket_id: ref.id,
|
|
120895
|
+
name: ref.name
|
|
121016
120896
|
};
|
|
121017
120897
|
}
|
|
121018
120898
|
var TARGET_RETAINED_TRACES = 32;
|
|
@@ -121183,11 +121063,11 @@ var require_channelz = __commonJS({
|
|
|
121183
121063
|
const entityMap = entityMaps[kind];
|
|
121184
121064
|
return (name, getInfo, channelzEnabled) => {
|
|
121185
121065
|
const id2 = getNextId();
|
|
121186
|
-
const
|
|
121066
|
+
const ref = { id: id2, name, kind };
|
|
121187
121067
|
if (channelzEnabled) {
|
|
121188
|
-
entityMap.setElement(id2, { ref
|
|
121068
|
+
entityMap.setElement(id2, { ref, getInfo });
|
|
121189
121069
|
}
|
|
121190
|
-
return
|
|
121070
|
+
return ref;
|
|
121191
121071
|
};
|
|
121192
121072
|
};
|
|
121193
121073
|
exports.registerChannelzChannel = generateRegisterFn(
|
|
@@ -121206,8 +121086,8 @@ var require_channelz = __commonJS({
|
|
|
121206
121086
|
"socket"
|
|
121207
121087
|
/* EntityTypes.socket */
|
|
121208
121088
|
);
|
|
121209
|
-
function unregisterChannelzRef(
|
|
121210
|
-
entityMaps[
|
|
121089
|
+
function unregisterChannelzRef(ref) {
|
|
121090
|
+
entityMaps[ref.kind].eraseElementByKey(ref.id);
|
|
121211
121091
|
}
|
|
121212
121092
|
function parseIPv6Section(addressSection) {
|
|
121213
121093
|
const numberValue = Number.parseInt(addressSection, 16);
|
|
@@ -134305,12 +134185,12 @@ function nulSplit(out) {
|
|
|
134305
134185
|
function insideWorkTree(root) {
|
|
134306
134186
|
return git5(root, ["rev-parse", "--is-inside-work-tree"])?.toString("utf8").trim() === "true";
|
|
134307
134187
|
}
|
|
134308
|
-
function commitOf2(root,
|
|
134188
|
+
function commitOf2(root, ref) {
|
|
134309
134189
|
const out = git5(root, [
|
|
134310
134190
|
"rev-parse",
|
|
134311
134191
|
"--verify",
|
|
134312
134192
|
"--quiet",
|
|
134313
|
-
`${
|
|
134193
|
+
`${ref}^{commit}`
|
|
134314
134194
|
]);
|
|
134315
134195
|
const sha2 = out?.toString("utf8").trim() ?? "";
|
|
134316
134196
|
return sha2.length > 0 ? sha2 : null;
|
|
@@ -134382,10 +134262,10 @@ function readBase(root, commit) {
|
|
|
134382
134262
|
const sorted = blobs.map((blob, index) => [blob.path, texts[index]]).sort(([a], [b3]) => a < b3 ? -1 : a > b3 ? 1 : 0);
|
|
134383
134263
|
return new Map(sorted);
|
|
134384
134264
|
}
|
|
134385
|
-
function chooseBase(root,
|
|
134386
|
-
if (
|
|
134387
|
-
const commit =
|
|
134388
|
-
return commit === null ? { kind: "missing", ref
|
|
134265
|
+
function chooseBase(root, ref) {
|
|
134266
|
+
if (ref !== void 0) {
|
|
134267
|
+
const commit = ref.startsWith("-") ? null : commitOf2(root, ref);
|
|
134268
|
+
return commit === null ? { kind: "missing", ref } : { kind: "ref", ref, commit };
|
|
134389
134269
|
}
|
|
134390
134270
|
for (const candidate of DEFAULT_BASES) {
|
|
134391
134271
|
const commit = commitOf2(root, candidate);
|
|
@@ -141081,15 +140961,15 @@ function buildProgram() {
|
|
|
141081
140961
|
});
|
|
141082
140962
|
repoCmd.command("link").description(
|
|
141083
140963
|
"Open the steering PR that links a GitHub repository the workspace's GitHub App installation reaches. The link follows the merge."
|
|
141084
|
-
).argument("<owner/name>", "The repository, as GitHub names it").option("--json", "Output JSON").action(async (
|
|
140964
|
+
).argument("<owner/name>", "The repository, as GitHub names it").option("--json", "Output JSON").action(async (ref, opts) => {
|
|
141085
140965
|
const { repoLink: repoLink2 } = await Promise.resolve().then(() => (init_repo(), repo_exports));
|
|
141086
|
-
await repoLink2(
|
|
140966
|
+
await repoLink2(ref, opts);
|
|
141087
140967
|
});
|
|
141088
140968
|
repoCmd.command("scan").description(
|
|
141089
140969
|
"List the agent harness files on a repository's default branch: instruction and rule files, skills, commands, subagent files, settings files and MCP configs. The repository need not be linked."
|
|
141090
|
-
).argument("<owner/name>", "The repository, or the GitLab project path").option("--gitlab", "Scan a GitLab project the workspace has connected").option("--json", "Output JSON").action(async (
|
|
140970
|
+
).argument("<owner/name>", "The repository, or the GitLab project path").option("--gitlab", "Scan a GitLab project the workspace has connected").option("--json", "Output JSON").action(async (ref, opts) => {
|
|
141091
140971
|
const { repoScan: repoScan2 } = await Promise.resolve().then(() => (init_repo_scan(), repo_scan_exports));
|
|
141092
|
-
await repoScan2(
|
|
140972
|
+
await repoScan2(ref, opts);
|
|
141093
140973
|
});
|
|
141094
140974
|
repoCmd.command("unlink").description(
|
|
141095
140975
|
"Unlink a linked repository by its binding id. A repository workspace.toml lists is removed by a steering PR. The steering repository is refused."
|