@akagilnc/pi-workflow-roles 0.1.5368 → 0.1.5382
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/dist/acp-host/production-host.js +1192 -1195
- package/dist/activation-ledger-git.js +2 -2
- package/dist/activation-ledger-topology.js +1 -7
- package/dist/analyst-entry.js +4 -8
- package/dist/analyst-gate-cycles-read.js +3 -11
- package/dist/analyst-index.js +3 -9
- package/dist/analyst-ledger.js +1 -11
- package/dist/analyst-metric-families/acceptance-success-rework.js +1 -3
- package/dist/analyst-metric-families/round-timeline.js +1 -3
- package/dist/analyst-page.js +2 -2
- package/dist/archivist-record-topology.js +2 -2
- package/dist/audit-escalation.js +2 -1
- package/dist/auditor-soul.js +2 -1
- package/dist/collector-config.js +6 -8
- package/dist/collector-tool-schemas.js +18 -0
- package/dist/compliance-transport.js +2 -1
- package/dist/countersign-contracts.js +2 -1
- package/dist/diarist-contracts.js +29 -2
- package/dist/doctor-contracts.js +1 -3
- package/dist/doctor-evidence.js +7 -8
- package/dist/dossier-resolution.js +1 -3
- package/dist/engine-detour-usage.js +1 -3
- package/dist/filed-submission.js +28 -0
- package/dist/gatekeeper-role.js +8 -19
- package/dist/gleaner-left-contracts.js +18 -1
- package/dist/headless-host/description.js +14 -17
- package/dist/headless-host/production-host.js +1210 -1215
- package/dist/host-session-record.js +3 -2
- package/dist/inspector-contracts.js +2 -1
- package/dist/judge-role.js +8 -16
- package/dist/ledger-session-read.js +1 -3
- package/dist/merger-contracts.js +9 -9
- package/dist/migrate-book-topology.js +610 -321
- package/dist/navigator-attendance.js +9 -11
- package/dist/navigator-invocation-identity.js +3 -2
- package/dist/navigator-public-session.js +3 -5
- package/dist/navigator-session-contracts.js +8 -10
- package/dist/navigator-work-base.js +5 -8
- package/dist/notary-contracts.js +3 -5
- package/dist/package-contracts/auditor-output.js +1 -3
- package/dist/package-contracts/fixer-packet.js +3 -6
- package/dist/package-contracts/gatekeeper-output.js +1 -3
- package/dist/package-contracts/navigator-output.js +8 -8
- package/dist/package-contracts/reviewer-output.js +16 -0
- package/dist/package-contracts/terminating-infrastructure.js +5 -9
- package/dist/package-contracts/terminating-tools.js +4 -3
- package/dist/package-contracts/worker-output.js +18 -2
- package/dist/public-cli/analyst-run.js +3 -2
- package/dist/public-cli/auto-resume.js +3 -8
- package/dist/public-cli/cli.js +9 -8
- package/dist/public-cli/config.js +8 -11
- package/dist/public-cli/countersign-run.js +1 -3
- package/dist/public-cli/host-providers.js +7 -14
- package/dist/public-cli/instruction-seat-run.js +12 -14
- package/dist/public-cli/invocation.js +9 -8
- package/dist/public-cli/main.js +1820 -1599
- package/dist/public-cli/post-admission.js +4 -3
- package/dist/public-cli/run-lifecycle.js +14 -26
- package/dist/public-cli/settlement.js +10 -26
- package/dist/public-role-summons.js +3 -2
- package/dist/receipt-delivery-policy.js +1 -3
- package/dist/role-run-placement.js +3 -5
- package/dist/role-run-relocation.js +12 -19
- package/dist/role-submission-declarations.js +131 -0
- package/dist/run-terminal-artifacts.js +1 -11
- package/dist/run-ticket-number.js +2 -4
- package/dist/secretariat-contracts.js +23 -1
- package/dist/session-assistant-usage.js +2 -1
- package/dist/session-dialogue.js +1 -14
- package/dist/sitian-reader.js +2 -4
- package/dist/submission-correctable-error.js +2 -1
- package/dist/submission-errors.js +2 -1
- package/dist/submission-gate.js +6 -8
- package/dist/submission-ledger.js +4 -5
- package/dist/ticket-provenance-contracts.js +1 -3
- package/dist/ticket-provenance.js +2 -1
- package/dist/typed-provider-http.js +4 -7
- package/dist/unknown-value.js +28 -0
- package/dist/user-dialogue-stdin.js +2 -1
- package/package.json +1 -1
- package/src/acp-host/role-turn-host.ts +4 -2
- package/src/activation-ledger-git.ts +3 -2
- package/src/activation-ledger-topology.ts +4 -12
- package/src/analyst-entry.ts +3 -11
- package/src/analyst-gate-cycles-read.ts +3 -15
- package/src/analyst-index.ts +3 -13
- package/src/analyst-ledger.ts +2 -16
- package/src/analyst-metric-families/acceptance-success-rework.ts +2 -4
- package/src/analyst-metric-families/round-timeline.ts +2 -4
- package/src/analyst-page.ts +2 -2
- package/src/archivist-record-topology.ts +2 -2
- package/src/audit-escalation.ts +2 -1
- package/src/auditor-role.ts +2 -8
- package/src/auditor-soul.ts +3 -1
- package/src/book-topology-migration-placement.ts +5 -16
- package/src/book-topology-migrators-t11.ts +16 -15
- package/src/book-topology-mixed-volume-migrators.ts +3 -6
- package/src/book-topology-record-class-migrators.ts +7 -10
- package/src/book-topology-runs-migrator.ts +4 -3
- package/src/collector-config.ts +7 -9
- package/src/collector-role.ts +5 -28
- package/src/compliance-transport.ts +2 -1
- package/src/countersign-contracts.ts +2 -1
- package/src/countersign-role.ts +2 -7
- package/src/diarist-contracts.ts +40 -2
- package/src/diarist-role.ts +4 -44
- package/src/doctor-contracts.ts +3 -1
- package/src/doctor-evidence.ts +8 -7
- package/src/doctor-role.ts +20 -13
- package/src/dossier-resolution.ts +2 -4
- package/src/engine-detour-tool.ts +0 -2
- package/src/engine-detour-usage.ts +2 -4
- package/src/external-host-turn-loop.ts +3 -1
- package/src/factory-board.ts +1 -8
- package/src/filed-submission.ts +44 -0
- package/src/gatekeeper-role.ts +8 -24
- package/src/gleaner-left-contracts.ts +29 -2
- package/src/gleaner-left-role.ts +4 -32
- package/src/headless-host/description.ts +15 -18
- package/src/headless-host/role-turn-host.ts +10 -9
- package/src/host-session-record.ts +4 -2
- package/src/inspector-contracts.ts +2 -1
- package/src/inspector-role.ts +2 -7
- package/src/judge-role.ts +12 -24
- package/src/ledger-session-read.ts +2 -5
- package/src/merger-contracts.ts +10 -9
- package/src/merger-role.ts +5 -8
- package/src/navigator-attendance.ts +10 -12
- package/src/navigator-invocation-identity.ts +3 -2
- package/src/navigator-public-session.ts +4 -6
- package/src/navigator-role.ts +2 -8
- package/src/navigator-session-contracts.ts +8 -11
- package/src/navigator-work-base.ts +5 -8
- package/src/navigator-work-context.ts +2 -1
- package/src/notary-contracts.ts +4 -6
- package/src/notary-role.ts +5 -20
- package/src/oauth-keepalive.ts +5 -18
- package/src/package-contracts/auditor-output.ts +2 -4
- package/src/package-contracts/fixer-packet.ts +4 -6
- package/src/package-contracts/gatekeeper-output.ts +2 -4
- package/src/package-contracts/judge-output.ts +0 -1
- package/src/package-contracts/navigator-output.ts +8 -8
- package/src/package-contracts/reviewer-output.ts +25 -0
- package/src/package-contracts/terminating-infrastructure.ts +6 -20
- package/src/package-contracts/terminating-tools.ts +8 -12
- package/src/package-contracts/worker-output.ts +43 -5
- package/src/pi/adapter.ts +0 -1
- package/src/pi/role-turn-host.ts +0 -1
- package/src/public-cli/analyst-run.ts +4 -2
- package/src/public-cli/auto-resume.ts +4 -11
- package/src/public-cli/cli.ts +10 -10
- package/src/public-cli/config.ts +8 -27
- package/src/public-cli/countersign-run.ts +2 -4
- package/src/public-cli/host-providers.ts +10 -27
- package/src/public-cli/instruction-seat-run.ts +14 -15
- package/src/public-cli/invocation.ts +11 -10
- package/src/public-cli/post-admission.ts +5 -3
- package/src/public-cli/run-lifecycle.ts +20 -41
- package/src/public-cli/settlement.ts +11 -33
- package/src/public-role-summons.ts +4 -3
- package/src/receipt-delivery-policy.ts +1 -4
- package/src/reviewer-role.ts +7 -36
- package/src/role-envelope.ts +5 -3
- package/src/role-run-placement.ts +4 -10
- package/src/role-run-relocation.ts +13 -23
- package/src/role-runtime.ts +16 -50
- package/src/role-submission-declarations.ts +143 -0
- package/src/run-terminal-artifacts.ts +2 -16
- package/src/run-ticket-number.ts +4 -10
- package/src/secretariat-contracts.ts +35 -0
- package/src/secretariat-role.ts +4 -40
- package/src/session-assistant-usage.ts +3 -1
- package/src/session-dialogue.ts +1 -4
- package/src/session-identity.ts +0 -1
- package/src/sitian-reader.ts +2 -4
- package/src/submission-correctable-error.ts +3 -1
- package/src/submission-errors.ts +2 -1
- package/src/submission-gate.ts +10 -9
- package/src/submission-ledger.ts +5 -6
- package/src/ticket-provenance-contracts.ts +1 -4
- package/src/ticket-provenance.ts +3 -1
- package/src/ticket-snapshot.ts +2 -4
- package/src/ticket-trajectory.ts +1 -8
- package/src/typed-provider-http.ts +5 -15
- package/src/unknown-value.ts +34 -0
- package/src/user-dialogue-stdin.ts +3 -1
- package/src/worker-role.ts +63 -83
- package/src/worker-submission-gates.ts +8 -7
|
@@ -50,227 +50,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
50
50
|
mod
|
|
51
51
|
));
|
|
52
52
|
|
|
53
|
-
// src/activation-ledger-topology.ts
|
|
54
|
-
import {
|
|
55
|
-
lstatSync,
|
|
56
|
-
mkdirSync,
|
|
57
|
-
realpathSync,
|
|
58
|
-
statSync
|
|
59
|
-
} from "node:fs";
|
|
60
|
-
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
61
|
-
function activationBookDirectory(ledgerHome, bookKey) {
|
|
62
|
-
return join(ledgerHome, "books", bookKey);
|
|
63
|
-
}
|
|
64
|
-
function pathContainedIn(root, candidate) {
|
|
65
|
-
const rel = relative(root, candidate);
|
|
66
|
-
return rel !== "" && rel !== ".." && !rel.startsWith(`..${sep}`) && !isAbsolute(rel);
|
|
67
|
-
}
|
|
68
|
-
function physicalPathIdentity(path8) {
|
|
69
|
-
const absolute = resolve(path8);
|
|
70
|
-
const missing = [];
|
|
71
|
-
let cursor = absolute;
|
|
72
|
-
while (true) {
|
|
73
|
-
try {
|
|
74
|
-
const real = realpathSync(cursor);
|
|
75
|
-
return missing.length === 0 ? real : join(real, ...missing);
|
|
76
|
-
} catch (error) {
|
|
77
|
-
if (errnoCode(error) !== "ENOENT") {
|
|
78
|
-
return absolute;
|
|
79
|
-
}
|
|
80
|
-
const parent = dirname(cursor);
|
|
81
|
-
if (parent === cursor) return absolute;
|
|
82
|
-
missing.unshift(basename(cursor));
|
|
83
|
-
cursor = parent;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
function physicallyContainedIn(root, candidate) {
|
|
88
|
-
return pathContainedIn(physicalPathIdentity(root), physicalPathIdentity(candidate));
|
|
89
|
-
}
|
|
90
|
-
function errnoCode(error) {
|
|
91
|
-
return error !== null && typeof error === "object" && "code" in error && typeof error.code === "string" ? error.code : void 0;
|
|
92
|
-
}
|
|
93
|
-
var init_activation_ledger_topology = __esm({
|
|
94
|
-
"src/activation-ledger-topology.ts"() {
|
|
95
|
-
"use strict";
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
// src/run-ticket-number.ts
|
|
100
|
-
import { readFile } from "node:fs/promises";
|
|
101
|
-
import { join as join2 } from "node:path";
|
|
102
|
-
function isEnoent(error) {
|
|
103
|
-
return error instanceof Error && "code" in error && error.code === "ENOENT";
|
|
104
|
-
}
|
|
105
|
-
function isSafePositiveTicketNumber(value2) {
|
|
106
|
-
return typeof value2 === "number" && Number.isSafeInteger(value2) && value2 >= 1;
|
|
107
|
-
}
|
|
108
|
-
function requireSafePositiveTicketNumber(ticketNumber, context = "ticketNumber") {
|
|
109
|
-
if (!isSafePositiveTicketNumber(ticketNumber)) {
|
|
110
|
-
throw new Error(
|
|
111
|
-
`${context} requires a safe positive integer, got ${String(ticketNumber)}`
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
return ticketNumber;
|
|
115
|
-
}
|
|
116
|
-
function ticketFromRecord(record) {
|
|
117
|
-
return isSafePositiveTicketNumber(record.ticketNumber) ? record.ticketNumber : void 0;
|
|
118
|
-
}
|
|
119
|
-
async function readJsonObject(path8) {
|
|
120
|
-
try {
|
|
121
|
-
const raw = JSON.parse(await readFile(path8, "utf8"));
|
|
122
|
-
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
123
|
-
return void 0;
|
|
124
|
-
}
|
|
125
|
-
return raw;
|
|
126
|
-
} catch (error) {
|
|
127
|
-
if (isEnoent(error)) return void 0;
|
|
128
|
-
throw error;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
async function readBoardPageTicketNumber(runDirectory, page) {
|
|
132
|
-
const record = await readJsonObject(join2(runDirectory, page));
|
|
133
|
-
if (record === void 0) return void 0;
|
|
134
|
-
return ticketFromRecord(record);
|
|
135
|
-
}
|
|
136
|
-
async function readBoardTicketNumber(runDirectory) {
|
|
137
|
-
return await readBoardPageTicketNumber(runDirectory, "admitted-request.json") ?? await readBoardPageTicketNumber(runDirectory, "invocation.json");
|
|
138
|
-
}
|
|
139
|
-
async function readMigrationDerivedTicketNumber(runDirectory) {
|
|
140
|
-
const record = await readJsonObject(
|
|
141
|
-
join2(runDirectory, MIGRATION_TICKET_DERIVATION_PAGE)
|
|
142
|
-
);
|
|
143
|
-
if (record === void 0) return void 0;
|
|
144
|
-
if (record.derivation !== "worktree-path-basename") return void 0;
|
|
145
|
-
return ticketFromRecord(record);
|
|
146
|
-
}
|
|
147
|
-
var MIGRATION_TICKET_DERIVATION_PAGE;
|
|
148
|
-
var init_run_ticket_number = __esm({
|
|
149
|
-
"src/run-ticket-number.ts"() {
|
|
150
|
-
"use strict";
|
|
151
|
-
MIGRATION_TICKET_DERIVATION_PAGE = "migration-ticket-derivation.json";
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
// src/role-run-placement.ts
|
|
156
|
-
import { readdir } from "node:fs/promises";
|
|
157
|
-
import { join as join3 } from "node:path";
|
|
158
|
-
function isMissingPathError(error) {
|
|
159
|
-
return error instanceof Error && "code" in error && error.code === "ENOENT";
|
|
160
|
-
}
|
|
161
|
-
async function listBookRunDirectories(bookDir) {
|
|
162
|
-
const out = [];
|
|
163
|
-
const seen = /* @__PURE__ */ new Set();
|
|
164
|
-
const collect = async (runsDir) => {
|
|
165
|
-
let entries;
|
|
166
|
-
try {
|
|
167
|
-
entries = await readdir(runsDir, { withFileTypes: true });
|
|
168
|
-
} catch (error) {
|
|
169
|
-
if (isMissingPathError(error)) return;
|
|
170
|
-
throw error;
|
|
171
|
-
}
|
|
172
|
-
for (const entry of entries) {
|
|
173
|
-
if (!entry.isDirectory()) continue;
|
|
174
|
-
const runDir = join3(runsDir, entry.name);
|
|
175
|
-
if (seen.has(runDir)) continue;
|
|
176
|
-
seen.add(runDir);
|
|
177
|
-
out.push(runDir);
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
await collect(join3(bookDir, "runs"));
|
|
181
|
-
let subjects;
|
|
182
|
-
try {
|
|
183
|
-
subjects = await readdir(bookDir, { withFileTypes: true });
|
|
184
|
-
} catch (error) {
|
|
185
|
-
if (isMissingPathError(error)) return out.sort();
|
|
186
|
-
throw error;
|
|
187
|
-
}
|
|
188
|
-
for (const subject of subjects) {
|
|
189
|
-
if (!subject.isDirectory() || subject.name === "runs") continue;
|
|
190
|
-
await collect(join3(bookDir, subject.name, "runs"));
|
|
191
|
-
}
|
|
192
|
-
return out.sort();
|
|
193
|
-
}
|
|
194
|
-
function roleRunPlacement(ledgerHome, input) {
|
|
195
|
-
const subjectDirectory = "ticketNumber" in input.subject ? String(requireSafePositiveTicketNumber(
|
|
196
|
-
input.subject.ticketNumber,
|
|
197
|
-
"roleRunPlacement subject.ticketNumber"
|
|
198
|
-
)) : "unbound";
|
|
199
|
-
const runDirectory = join3(
|
|
200
|
-
activationBookDirectory(ledgerHome, input.bookKey),
|
|
201
|
-
subjectDirectory,
|
|
202
|
-
"runs",
|
|
203
|
-
`${input.runId}@${input.role}`
|
|
204
|
-
);
|
|
205
|
-
const sessionDirectory = join3(runDirectory, "session");
|
|
206
|
-
return {
|
|
207
|
-
runDirectory,
|
|
208
|
-
sessionDirectory,
|
|
209
|
-
sessionFile: join3(sessionDirectory, "session.jsonl"),
|
|
210
|
-
artifactsDirectory: roleRunArtifactsDirectory(runDirectory),
|
|
211
|
-
attachmentsDirectory: join3(runDirectory, "attachments")
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
function roleRunArtifactsDirectory(runDirectory) {
|
|
215
|
-
return join3(runDirectory, "artifacts");
|
|
216
|
-
}
|
|
217
|
-
function isUnboundRunDirectory(runDirectory) {
|
|
218
|
-
return runDirectory.replaceAll("\\", "/").includes("/unbound/runs/");
|
|
219
|
-
}
|
|
220
|
-
var init_role_run_placement = __esm({
|
|
221
|
-
"src/role-run-placement.ts"() {
|
|
222
|
-
"use strict";
|
|
223
|
-
init_activation_ledger_topology();
|
|
224
|
-
init_run_ticket_number();
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
// src/public-cli/cli-errors.ts
|
|
229
|
-
var init_cli_errors = __esm({
|
|
230
|
-
"src/public-cli/cli-errors.ts"() {
|
|
231
|
-
"use strict";
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
// src/typed-provider-http.ts
|
|
236
|
-
var init_typed_provider_http = __esm({
|
|
237
|
-
"src/typed-provider-http.ts"() {
|
|
238
|
-
"use strict";
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
|
|
242
|
-
// src/collector-config.ts
|
|
243
|
-
var init_collector_config = __esm({
|
|
244
|
-
"src/collector-config.ts"() {
|
|
245
|
-
"use strict";
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/system/memory/metrics.mjs
|
|
250
|
-
var Metrics;
|
|
251
|
-
var init_metrics = __esm({
|
|
252
|
-
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/system/memory/metrics.mjs"() {
|
|
253
|
-
Metrics = {
|
|
254
|
-
assign: 0,
|
|
255
|
-
create: 0,
|
|
256
|
-
clone: 0,
|
|
257
|
-
discard: 0,
|
|
258
|
-
update: 0
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/system/memory/assign.mjs
|
|
264
|
-
function Assign(left, right) {
|
|
265
|
-
Metrics.assign += 1;
|
|
266
|
-
return { ...left, ...right };
|
|
267
|
-
}
|
|
268
|
-
var init_assign = __esm({
|
|
269
|
-
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/system/memory/assign.mjs"() {
|
|
270
|
-
init_metrics();
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
|
|
274
53
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/guard/string.mjs
|
|
275
54
|
function IsBetween(value2, min, max) {
|
|
276
55
|
return value2 >= min && value2 <= max;
|
|
@@ -707,6 +486,255 @@ var init_guard2 = __esm({
|
|
|
707
486
|
}
|
|
708
487
|
});
|
|
709
488
|
|
|
489
|
+
// src/unknown-value.ts
|
|
490
|
+
function isRecord(value2) {
|
|
491
|
+
return guard_exports.IsObjectNotArray(value2);
|
|
492
|
+
}
|
|
493
|
+
function errnoCode(error) {
|
|
494
|
+
return error !== null && typeof error === "object" && "code" in error && typeof error.code === "string" ? error.code : void 0;
|
|
495
|
+
}
|
|
496
|
+
function errorText(error) {
|
|
497
|
+
return error instanceof Error ? error.message : String(error);
|
|
498
|
+
}
|
|
499
|
+
function isEnoent(error) {
|
|
500
|
+
return error instanceof Error && errnoCode(error) === "ENOENT";
|
|
501
|
+
}
|
|
502
|
+
var init_unknown_value = __esm({
|
|
503
|
+
"src/unknown-value.ts"() {
|
|
504
|
+
"use strict";
|
|
505
|
+
init_guard2();
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
// src/activation-ledger-topology.ts
|
|
510
|
+
import {
|
|
511
|
+
lstatSync,
|
|
512
|
+
mkdirSync,
|
|
513
|
+
realpathSync,
|
|
514
|
+
statSync
|
|
515
|
+
} from "node:fs";
|
|
516
|
+
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
517
|
+
function activationBookDirectory(ledgerHome, bookKey) {
|
|
518
|
+
return join(ledgerHome, "books", bookKey);
|
|
519
|
+
}
|
|
520
|
+
function pathContainedIn(root, candidate) {
|
|
521
|
+
const rel = relative(root, candidate);
|
|
522
|
+
return rel !== "" && rel !== ".." && !rel.startsWith(`..${sep}`) && !isAbsolute(rel);
|
|
523
|
+
}
|
|
524
|
+
function physicalPathIdentity(path8) {
|
|
525
|
+
const absolute = resolve(path8);
|
|
526
|
+
const missing = [];
|
|
527
|
+
let cursor = absolute;
|
|
528
|
+
while (true) {
|
|
529
|
+
try {
|
|
530
|
+
const real = realpathSync(cursor);
|
|
531
|
+
return missing.length === 0 ? real : join(real, ...missing);
|
|
532
|
+
} catch (error) {
|
|
533
|
+
if (errnoCode(error) !== "ENOENT") {
|
|
534
|
+
return absolute;
|
|
535
|
+
}
|
|
536
|
+
const parent = dirname(cursor);
|
|
537
|
+
if (parent === cursor) return absolute;
|
|
538
|
+
missing.unshift(basename(cursor));
|
|
539
|
+
cursor = parent;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
function physicallyContainedIn(root, candidate) {
|
|
544
|
+
return pathContainedIn(physicalPathIdentity(root), physicalPathIdentity(candidate));
|
|
545
|
+
}
|
|
546
|
+
var init_activation_ledger_topology = __esm({
|
|
547
|
+
"src/activation-ledger-topology.ts"() {
|
|
548
|
+
"use strict";
|
|
549
|
+
init_unknown_value();
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
// src/run-ticket-number.ts
|
|
554
|
+
import { readFile } from "node:fs/promises";
|
|
555
|
+
import { join as join2 } from "node:path";
|
|
556
|
+
function isSafePositiveTicketNumber(value2) {
|
|
557
|
+
return typeof value2 === "number" && Number.isSafeInteger(value2) && value2 >= 1;
|
|
558
|
+
}
|
|
559
|
+
function requireSafePositiveTicketNumber(ticketNumber, context = "ticketNumber") {
|
|
560
|
+
if (!isSafePositiveTicketNumber(ticketNumber)) {
|
|
561
|
+
throw new Error(
|
|
562
|
+
`${context} requires a safe positive integer, got ${String(ticketNumber)}`
|
|
563
|
+
);
|
|
564
|
+
}
|
|
565
|
+
return ticketNumber;
|
|
566
|
+
}
|
|
567
|
+
function ticketFromRecord(record) {
|
|
568
|
+
return isSafePositiveTicketNumber(record.ticketNumber) ? record.ticketNumber : void 0;
|
|
569
|
+
}
|
|
570
|
+
async function readJsonObject(path8) {
|
|
571
|
+
try {
|
|
572
|
+
const raw = JSON.parse(await readFile(path8, "utf8"));
|
|
573
|
+
if (!isRecord(raw)) {
|
|
574
|
+
return void 0;
|
|
575
|
+
}
|
|
576
|
+
return raw;
|
|
577
|
+
} catch (error) {
|
|
578
|
+
if (isEnoent(error)) return void 0;
|
|
579
|
+
throw error;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
async function readBoardPageTicketNumber(runDirectory, page) {
|
|
583
|
+
const record = await readJsonObject(join2(runDirectory, page));
|
|
584
|
+
if (record === void 0) return void 0;
|
|
585
|
+
return ticketFromRecord(record);
|
|
586
|
+
}
|
|
587
|
+
async function readBoardTicketNumber(runDirectory) {
|
|
588
|
+
return await readBoardPageTicketNumber(runDirectory, "admitted-request.json") ?? await readBoardPageTicketNumber(runDirectory, "invocation.json");
|
|
589
|
+
}
|
|
590
|
+
async function readMigrationDerivedTicketNumber(runDirectory) {
|
|
591
|
+
const record = await readJsonObject(
|
|
592
|
+
join2(runDirectory, MIGRATION_TICKET_DERIVATION_PAGE)
|
|
593
|
+
);
|
|
594
|
+
if (record === void 0) return void 0;
|
|
595
|
+
if (record.derivation !== "worktree-path-basename") return void 0;
|
|
596
|
+
return ticketFromRecord(record);
|
|
597
|
+
}
|
|
598
|
+
var MIGRATION_TICKET_DERIVATION_PAGE;
|
|
599
|
+
var init_run_ticket_number = __esm({
|
|
600
|
+
"src/run-ticket-number.ts"() {
|
|
601
|
+
"use strict";
|
|
602
|
+
init_unknown_value();
|
|
603
|
+
MIGRATION_TICKET_DERIVATION_PAGE = "migration-ticket-derivation.json";
|
|
604
|
+
}
|
|
605
|
+
});
|
|
606
|
+
|
|
607
|
+
// src/role-run-placement.ts
|
|
608
|
+
import { readdir } from "node:fs/promises";
|
|
609
|
+
import { join as join3 } from "node:path";
|
|
610
|
+
async function listBookRunDirectories(bookDir) {
|
|
611
|
+
const out = [];
|
|
612
|
+
const seen = /* @__PURE__ */ new Set();
|
|
613
|
+
const collect = async (runsDir) => {
|
|
614
|
+
let entries;
|
|
615
|
+
try {
|
|
616
|
+
entries = await readdir(runsDir, { withFileTypes: true });
|
|
617
|
+
} catch (error) {
|
|
618
|
+
if (isEnoent(error)) return;
|
|
619
|
+
throw error;
|
|
620
|
+
}
|
|
621
|
+
for (const entry of entries) {
|
|
622
|
+
if (!entry.isDirectory()) continue;
|
|
623
|
+
const runDir = join3(runsDir, entry.name);
|
|
624
|
+
if (seen.has(runDir)) continue;
|
|
625
|
+
seen.add(runDir);
|
|
626
|
+
out.push(runDir);
|
|
627
|
+
}
|
|
628
|
+
};
|
|
629
|
+
await collect(join3(bookDir, "runs"));
|
|
630
|
+
let subjects;
|
|
631
|
+
try {
|
|
632
|
+
subjects = await readdir(bookDir, { withFileTypes: true });
|
|
633
|
+
} catch (error) {
|
|
634
|
+
if (isEnoent(error)) return out.sort();
|
|
635
|
+
throw error;
|
|
636
|
+
}
|
|
637
|
+
for (const subject of subjects) {
|
|
638
|
+
if (!subject.isDirectory() || subject.name === "runs") continue;
|
|
639
|
+
await collect(join3(bookDir, subject.name, "runs"));
|
|
640
|
+
}
|
|
641
|
+
return out.sort();
|
|
642
|
+
}
|
|
643
|
+
function roleRunPlacement(ledgerHome, input) {
|
|
644
|
+
const subjectDirectory = "ticketNumber" in input.subject ? String(requireSafePositiveTicketNumber(
|
|
645
|
+
input.subject.ticketNumber,
|
|
646
|
+
"roleRunPlacement subject.ticketNumber"
|
|
647
|
+
)) : "unbound";
|
|
648
|
+
const runDirectory = join3(
|
|
649
|
+
activationBookDirectory(ledgerHome, input.bookKey),
|
|
650
|
+
subjectDirectory,
|
|
651
|
+
"runs",
|
|
652
|
+
`${input.runId}@${input.role}`
|
|
653
|
+
);
|
|
654
|
+
const sessionDirectory = join3(runDirectory, "session");
|
|
655
|
+
return {
|
|
656
|
+
runDirectory,
|
|
657
|
+
sessionDirectory,
|
|
658
|
+
sessionFile: join3(sessionDirectory, "session.jsonl"),
|
|
659
|
+
artifactsDirectory: roleRunArtifactsDirectory(runDirectory),
|
|
660
|
+
attachmentsDirectory: join3(runDirectory, "attachments")
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
function roleRunArtifactsDirectory(runDirectory) {
|
|
664
|
+
return join3(runDirectory, "artifacts");
|
|
665
|
+
}
|
|
666
|
+
function isUnboundRunDirectory(runDirectory) {
|
|
667
|
+
return runDirectory.replaceAll("\\", "/").includes("/unbound/runs/");
|
|
668
|
+
}
|
|
669
|
+
var init_role_run_placement = __esm({
|
|
670
|
+
"src/role-run-placement.ts"() {
|
|
671
|
+
"use strict";
|
|
672
|
+
init_activation_ledger_topology();
|
|
673
|
+
init_run_ticket_number();
|
|
674
|
+
init_unknown_value();
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
|
|
678
|
+
// src/public-cli/cli-errors.ts
|
|
679
|
+
var init_cli_errors = __esm({
|
|
680
|
+
"src/public-cli/cli-errors.ts"() {
|
|
681
|
+
"use strict";
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
|
|
685
|
+
// src/typed-provider-http.ts
|
|
686
|
+
var init_typed_provider_http = __esm({
|
|
687
|
+
"src/typed-provider-http.ts"() {
|
|
688
|
+
"use strict";
|
|
689
|
+
init_unknown_value();
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
|
|
693
|
+
// src/sha256.ts
|
|
694
|
+
import { createHash } from "node:crypto";
|
|
695
|
+
function sha256Hex(bytes) {
|
|
696
|
+
return createHash("sha256").update(bytes).digest("hex");
|
|
697
|
+
}
|
|
698
|
+
var init_sha256 = __esm({
|
|
699
|
+
"src/sha256.ts"() {
|
|
700
|
+
"use strict";
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
|
|
704
|
+
// src/collector-config.ts
|
|
705
|
+
var init_collector_config = __esm({
|
|
706
|
+
"src/collector-config.ts"() {
|
|
707
|
+
"use strict";
|
|
708
|
+
init_sha256();
|
|
709
|
+
init_unknown_value();
|
|
710
|
+
}
|
|
711
|
+
});
|
|
712
|
+
|
|
713
|
+
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/system/memory/metrics.mjs
|
|
714
|
+
var Metrics;
|
|
715
|
+
var init_metrics = __esm({
|
|
716
|
+
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/system/memory/metrics.mjs"() {
|
|
717
|
+
Metrics = {
|
|
718
|
+
assign: 0,
|
|
719
|
+
create: 0,
|
|
720
|
+
clone: 0,
|
|
721
|
+
discard: 0,
|
|
722
|
+
update: 0
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
|
|
727
|
+
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/system/memory/assign.mjs
|
|
728
|
+
function Assign(left, right) {
|
|
729
|
+
Metrics.assign += 1;
|
|
730
|
+
return { ...left, ...right };
|
|
731
|
+
}
|
|
732
|
+
var init_assign = __esm({
|
|
733
|
+
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/system/memory/assign.mjs"() {
|
|
734
|
+
init_metrics();
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
|
|
710
738
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/system/memory/clone.mjs
|
|
711
739
|
function FromClassInstance(value2) {
|
|
712
740
|
return value2;
|
|
@@ -8054,6 +8082,7 @@ var init_terminating_infrastructure = __esm({
|
|
|
8054
8082
|
"src/package-contracts/terminating-infrastructure.ts"() {
|
|
8055
8083
|
"use strict";
|
|
8056
8084
|
init_build();
|
|
8085
|
+
init_unknown_value();
|
|
8057
8086
|
INFRASTRUCTURE_FAILURE_DECLARATION_KEY = "infrastructureFailure";
|
|
8058
8087
|
INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY = "diagnostic";
|
|
8059
8088
|
infrastructureFailureNested = typebox_exports.Object(
|
|
@@ -8085,6 +8114,7 @@ var init_gatekeeper_output = __esm({
|
|
|
8085
8114
|
init_build();
|
|
8086
8115
|
init_open_tool_schema();
|
|
8087
8116
|
init_terminating_infrastructure();
|
|
8117
|
+
init_unknown_value();
|
|
8088
8118
|
GATEKEEPER_OUTPUT_TOOL_NAME = "ak_gatekeeper_output";
|
|
8089
8119
|
gatekeeperDecisionSchema = openToolObject(
|
|
8090
8120
|
typebox_exports.Object({
|
|
@@ -8111,6 +8141,7 @@ var init_navigator_output = __esm({
|
|
|
8111
8141
|
"src/package-contracts/navigator-output.ts"() {
|
|
8112
8142
|
"use strict";
|
|
8113
8143
|
init_build();
|
|
8144
|
+
init_unknown_value();
|
|
8114
8145
|
init_open_tool_schema();
|
|
8115
8146
|
init_terminating_infrastructure();
|
|
8116
8147
|
NAVIGATOR_OUTPUT_TOOL_NAME = "ak_navigator_output";
|
|
@@ -8173,11 +8204,26 @@ var init_judge_output = __esm({
|
|
|
8173
8204
|
});
|
|
8174
8205
|
|
|
8175
8206
|
// src/package-contracts/reviewer-output.ts
|
|
8176
|
-
var REVIEWER_OUTPUT_TOOL_NAME;
|
|
8207
|
+
var REVIEWER_OUTPUT_TOOL_NAME, REVIEWER_AMENDMENTS_DESCRIPTION, REVIEWER_STATUS_DESCRIPTION, reviewerOutputObject, reviewerOutputSchema;
|
|
8177
8208
|
var init_reviewer_output = __esm({
|
|
8178
8209
|
"src/package-contracts/reviewer-output.ts"() {
|
|
8179
8210
|
"use strict";
|
|
8211
|
+
init_build();
|
|
8212
|
+
init_open_tool_schema();
|
|
8213
|
+
init_terminating_infrastructure();
|
|
8180
8214
|
REVIEWER_OUTPUT_TOOL_NAME = "ak_reviewer_output";
|
|
8215
|
+
REVIEWER_AMENDMENTS_DESCRIPTION = "\u5DF2\u8FD0\u884C lens \u7684 amendments \u627F\u8F7D candidates\u3001\u9010\u6761\u5904\u7F6E\u4E0E verdict \u7684\u5B8C\u6574\u62A5\u544A\uFF08\u975E\u4EC5 verdict \u884C\uFF09\uFF1B\u663E\u5F0F\u5355\u8F74\u65F6\u53E6\u4E00\u8F74\u53EF\u7701\u7565\uFF08completeness / correctness\uFF09\u3002hard-stop\uFF0Fusage error \u4E3A refused \u65F6\uFF0C\u5DF2\u4EA7\u51FA\u62A5\u544A\u4ECD\u7167\u5F55\u5BF9\u5E94 lens \u5B57\u6BB5\u3002";
|
|
8216
|
+
REVIEWER_STATUS_DESCRIPTION = "completed | refused\u3002\u4E24\u79CD\u6B63\u5E38 lens verdict\uFF08completeness / correctness\uFF09\u5747 completed\uFF1Bhard-stop \u4E0E usage error \u4E3A refused\uFF08\u5DF2\u4EA7\u51FA\u62A5\u544A\u4ECD\u7167\u5F55\u8FDB\u6240\u9009 lens amendments\uFF09\u3002";
|
|
8217
|
+
reviewerOutputObject = typebox_exports.Object({
|
|
8218
|
+
status: typebox_exports.Unknown({ description: REVIEWER_STATUS_DESCRIPTION }),
|
|
8219
|
+
amendments: typebox_exports.Unknown({ description: REVIEWER_AMENDMENTS_DESCRIPTION }),
|
|
8220
|
+
diagnostic: typebox_exports.Unknown({
|
|
8221
|
+
description: "\u62D2\u7EDD\u8BCA\u65AD\u8BF4\u660E\uFF1Bhard-stop\uFF0Fusage error \u539F\u56E0\u8FDB\u6B64\u5B57\u6BB5\uFF0C\u5DF2\u4EA7\u51FA\u62A5\u544A\u53E6\u7167\u5F55 amendments"
|
|
8222
|
+
})
|
|
8223
|
+
});
|
|
8224
|
+
reviewerOutputSchema = withTerminatingOutputDeclarations(
|
|
8225
|
+
openToolObject(reviewerOutputObject)
|
|
8226
|
+
);
|
|
8181
8227
|
}
|
|
8182
8228
|
});
|
|
8183
8229
|
|
|
@@ -13602,24 +13648,39 @@ var init_fixer_packet = __esm({
|
|
|
13602
13648
|
"use strict";
|
|
13603
13649
|
init_build();
|
|
13604
13650
|
init_value2();
|
|
13651
|
+
init_unknown_value();
|
|
13605
13652
|
FIXER_PREREQUISITE_ID_PATTERN = "^[A-Za-z0-9][A-Za-z0-9._-]*$";
|
|
13606
13653
|
fixerPrerequisiteSchema = typebox_exports.Object({
|
|
13607
13654
|
id: typebox_exports.String({ pattern: FIXER_PREREQUISITE_ID_PATTERN }),
|
|
13608
13655
|
requirement: typebox_exports.String({ pattern: "\\S" })
|
|
13609
|
-
}
|
|
13656
|
+
});
|
|
13610
13657
|
fixerPrerequisitesSchema = typebox_exports.Array(fixerPrerequisiteSchema);
|
|
13611
13658
|
}
|
|
13612
13659
|
});
|
|
13613
13660
|
|
|
13614
13661
|
// src/package-contracts/worker-output.ts
|
|
13615
|
-
var CODER_OUTPUT_TOOL_NAME;
|
|
13662
|
+
var CODER_OUTPUT_TOOL_NAME, CODER_STATUS_DESCRIPTION, coderOutputObject, coderOutputSchema;
|
|
13616
13663
|
var init_worker_output = __esm({
|
|
13617
13664
|
"src/package-contracts/worker-output.ts"() {
|
|
13618
13665
|
"use strict";
|
|
13666
|
+
init_build();
|
|
13667
|
+
init_open_tool_schema();
|
|
13619
13668
|
init_fixer_output();
|
|
13620
13669
|
init_fixer_packet();
|
|
13621
|
-
|
|
13670
|
+
init_terminating_infrastructure();
|
|
13622
13671
|
CODER_OUTPUT_TOOL_NAME = "ak_coder_output";
|
|
13672
|
+
CODER_STATUS_DESCRIPTION = `planned | completed | refused | partially_completed | unfinished\u3002unfinished\uFF1A\u7F3A\u524D\u7F6E\u6216\u8FDD\u5BAA\u7EA6\u675F\u81F4\u672C\u5C40\u672A\u5B8C\u6210\u3002${PARTIALLY_COMPLETED_DEFINITION}`;
|
|
13673
|
+
coderOutputObject = typebox_exports.Object({
|
|
13674
|
+
status: typebox_exports.Unknown({ description: CODER_STATUS_DESCRIPTION }),
|
|
13675
|
+
report: typebox_exports.Unknown({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }),
|
|
13676
|
+
remainingScope: typebox_exports.Unknown({ description: "\u672C\u5C40\u540E\u5269\u4F59\u5DE5\u4F5C" }),
|
|
13677
|
+
reason: typebox_exports.Unknown({
|
|
13678
|
+
description: "\u963B\u65AD\u539F\u56E0\uFF1A\u7F3A\u524D\u7F6E\u6216\u8FDD\u5BAA\u7EA6\u675F\u3002\u7F3A\u5F85\u51B3 owner \u51B3\u5B9A\u6216\u7B54\u590D\u5C5E\u7F3A\u524D\u7F6E\u3002"
|
|
13679
|
+
})
|
|
13680
|
+
});
|
|
13681
|
+
coderOutputSchema = withTerminatingOutputDeclarations(
|
|
13682
|
+
openToolObject(coderOutputObject)
|
|
13683
|
+
);
|
|
13623
13684
|
}
|
|
13624
13685
|
});
|
|
13625
13686
|
|
|
@@ -13631,7 +13692,7 @@ var init_canonical_json = __esm({
|
|
|
13631
13692
|
});
|
|
13632
13693
|
|
|
13633
13694
|
// src/doctor-contracts.ts
|
|
13634
|
-
var DOCTOR_OUTPUT_TOOL_NAME, DOCTOR_AUDIT_TOOL_NAME, DOCTOR_TARGET_KINDS, DOCTOR_DISPOSITIONS, DOCTOR_PRESCRIPTION_KINDS, biteActual, biteNone, DOCTOR_BITE_KINDS, DOCTOR_STATUS_DESCRIPTION, doctorSubmissionObject, doctorSubmissionSchema, doctorEvidenceReadSchema;
|
|
13695
|
+
var DOCTOR_OUTPUT_TOOL_NAME, DOCTOR_AUDIT_TOOL_NAME, DOCTOR_OUTPUT_TOOL_DESCRIPTION, DOCTOR_TARGET_KINDS, DOCTOR_DISPOSITIONS, DOCTOR_PRESCRIPTION_KINDS, biteActual, biteNone, DOCTOR_BITE_KINDS, DOCTOR_STATUS_DESCRIPTION, doctorSubmissionObject, doctorSubmissionSchema, doctorEvidenceReadSchema;
|
|
13635
13696
|
var init_doctor_contracts = __esm({
|
|
13636
13697
|
"src/doctor-contracts.ts"() {
|
|
13637
13698
|
"use strict";
|
|
@@ -13639,8 +13700,10 @@ var init_doctor_contracts = __esm({
|
|
|
13639
13700
|
init_canonical_json();
|
|
13640
13701
|
init_open_tool_schema();
|
|
13641
13702
|
init_terminating_infrastructure();
|
|
13703
|
+
init_unknown_value();
|
|
13642
13704
|
DOCTOR_OUTPUT_TOOL_NAME = "ak_doctor_output";
|
|
13643
13705
|
DOCTOR_AUDIT_TOOL_NAME = "ak_doctor_audit_decision";
|
|
13706
|
+
DOCTOR_OUTPUT_TOOL_DESCRIPTION = "\u63D0\u4EA4\u552F\u4E00\u7EC8\u5C40\u5355\u6848\u8BC1\u8BCD\uFF1Bcompleted \u5141\u8BB8\u7A7A findings\u3002";
|
|
13644
13707
|
DOCTOR_TARGET_KINDS = ["law", "gate", "template", "station", "seat"];
|
|
13645
13708
|
DOCTOR_DISPOSITIONS = ["keep", "thin", "delete"];
|
|
13646
13709
|
DOCTOR_PRESCRIPTION_KINDS = ["retain", "delete", "simplify", "patch", "addMechanism"];
|
|
@@ -13688,17 +13751,18 @@ var init_merger_contracts = __esm({
|
|
|
13688
13751
|
init_exact_utf8();
|
|
13689
13752
|
init_open_tool_schema();
|
|
13690
13753
|
init_terminating_infrastructure();
|
|
13691
|
-
|
|
13692
|
-
|
|
13754
|
+
init_unknown_value();
|
|
13755
|
+
materialSchema = typebox_exports.Object({ bytesBase64: typebox_exports.String(), sha256: typebox_exports.String() });
|
|
13756
|
+
checkSchema = typebox_exports.Object({ name: typebox_exports.String({ minLength: 1 }), argv: typebox_exports.Array(typebox_exports.String({ minLength: 1 }), { minItems: 1 }) });
|
|
13693
13757
|
mergerInputSchema = typebox_exports.Object({
|
|
13694
13758
|
attemptId: typebox_exports.String({ minLength: 1, description: "\u5BF9\u8D26 attempt \u8EAB\u4EFD\uFF08transport\uFF09" }),
|
|
13695
13759
|
targetObjectId: typebox_exports.String({ description: "\u6750\u6599\uFF1Atarget parent OID\uFF1B\u53EF\u7A7A" }),
|
|
13696
13760
|
sourceObjectId: typebox_exports.String({ description: "\u6750\u6599\uFF1Asource parent OID\uFF1B\u53EF\u7A7A" }),
|
|
13697
|
-
materials: typebox_exports.Object({ task: materialSchema, authority: materialSchema, targetIntent: materialSchema, sourceIntent: materialSchema }
|
|
13761
|
+
materials: typebox_exports.Object({ task: materialSchema, authority: materialSchema, targetIntent: materialSchema, sourceIntent: materialSchema }),
|
|
13698
13762
|
expectedConflictPaths: typebox_exports.Array(typebox_exports.String(), { description: "\u6750\u6599\uFF1A\u5F53\u524D\u672A\u5408\u5E76\u8DEF\u5F84\uFF1B\u53EF\u7A7A" }),
|
|
13699
13763
|
resolutionScope: typebox_exports.Array(typebox_exports.String(), { description: "\u6750\u6599\uFF1A\u89E3\u6790\u8303\u56F4\u63D0\u793A\uFF1B\u53EF\u7A7A" }),
|
|
13700
13764
|
authorizedChecks: typebox_exports.Array(checkSchema)
|
|
13701
|
-
}
|
|
13765
|
+
});
|
|
13702
13766
|
MERGER_STATUS_DESCRIPTION = "completed | escalate";
|
|
13703
13767
|
mergerOutputObject = typebox_exports.Object({
|
|
13704
13768
|
status: typebox_exports.Unknown({ description: MERGER_STATUS_DESCRIPTION }),
|
|
@@ -13720,6 +13784,7 @@ var init_notary_contracts = __esm({
|
|
|
13720
13784
|
"src/notary-contracts.ts"() {
|
|
13721
13785
|
"use strict";
|
|
13722
13786
|
init_review_submission();
|
|
13787
|
+
init_unknown_value();
|
|
13723
13788
|
NOTARY_OUTPUT_TOOL_NAME = REVIEW_SUBMISSION_OUTPUT_TOOL_NAME;
|
|
13724
13789
|
}
|
|
13725
13790
|
});
|
|
@@ -13730,16 +13795,33 @@ var init_countersign_contracts = __esm({
|
|
|
13730
13795
|
"src/countersign-contracts.ts"() {
|
|
13731
13796
|
"use strict";
|
|
13732
13797
|
init_review_submission();
|
|
13798
|
+
init_unknown_value();
|
|
13733
13799
|
COUNTERSIGN_OUTPUT_TOOL_NAME = REVIEW_SUBMISSION_OUTPUT_TOOL_NAME;
|
|
13734
13800
|
}
|
|
13735
13801
|
});
|
|
13736
13802
|
|
|
13737
13803
|
// src/gleaner-left-contracts.ts
|
|
13738
|
-
var GLEANER_LEFT_OUTPUT_TOOL_NAME;
|
|
13804
|
+
var GLEANER_LEFT_OUTPUT_TOOL_NAME, gleanerLeftOutputSchema;
|
|
13739
13805
|
var init_gleaner_left_contracts = __esm({
|
|
13740
13806
|
"src/gleaner-left-contracts.ts"() {
|
|
13741
13807
|
"use strict";
|
|
13808
|
+
init_build();
|
|
13809
|
+
init_open_tool_schema();
|
|
13810
|
+
init_terminating_infrastructure();
|
|
13811
|
+
init_unknown_value();
|
|
13742
13812
|
GLEANER_LEFT_OUTPUT_TOOL_NAME = "ak_gleaner_left_output";
|
|
13813
|
+
gleanerLeftOutputSchema = withTerminatingOutputDeclarations(
|
|
13814
|
+
openToolObject(
|
|
13815
|
+
typebox_exports.Object({
|
|
13816
|
+
status: typebox_exports.Unknown({
|
|
13817
|
+
description: "completed"
|
|
13818
|
+
}),
|
|
13819
|
+
findings: typebox_exports.Unknown({
|
|
13820
|
+
description: "\u5F39\u7AE0\u5217\u8868\uFF1B\u6BCF\u6761\u53EF\u542B pointer\uFF08\u6587\u4EF6/\u884C\u6307\u9488\uFF09\u4E0E statement\uFF08\u7591\u70B9\u9648\u8FF0\uFF09\uFF0C\u539F\u6837\u7559\u5B58\u3002\u7A7A\u5217\u8868\u5408\u6CD5\u5B8C\u5C40\uFF1B\u673A\u5668\u4E0D\u5224\u5F39\u7AE0\u662F\u5426\u6210\u7ACB\u3002"
|
|
13821
|
+
})
|
|
13822
|
+
})
|
|
13823
|
+
)
|
|
13824
|
+
);
|
|
13743
13825
|
}
|
|
13744
13826
|
});
|
|
13745
13827
|
|
|
@@ -13749,6 +13831,7 @@ var init_inspector_contracts = __esm({
|
|
|
13749
13831
|
"src/inspector-contracts.ts"() {
|
|
13750
13832
|
"use strict";
|
|
13751
13833
|
init_review_submission();
|
|
13834
|
+
init_unknown_value();
|
|
13752
13835
|
INSPECTOR_OUTPUT_TOOL_NAME = REVIEW_SUBMISSION_OUTPUT_TOOL_NAME;
|
|
13753
13836
|
}
|
|
13754
13837
|
});
|
|
@@ -13759,14 +13842,12 @@ var init_auditor_output = __esm({
|
|
|
13759
13842
|
"src/package-contracts/auditor-output.ts"() {
|
|
13760
13843
|
"use strict";
|
|
13761
13844
|
init_review_submission();
|
|
13845
|
+
init_unknown_value();
|
|
13762
13846
|
AUDITOR_OUTPUT_TOOL_NAME = REVIEW_SUBMISSION_OUTPUT_TOOL_NAME;
|
|
13763
13847
|
}
|
|
13764
13848
|
});
|
|
13765
13849
|
|
|
13766
13850
|
// src/ticket-provenance-contracts.ts
|
|
13767
|
-
function isRecord(value2) {
|
|
13768
|
-
return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
|
|
13769
|
-
}
|
|
13770
13851
|
function positiveInteger(value2) {
|
|
13771
13852
|
if (typeof value2 === "number" && Number.isSafeInteger(value2) && value2 >= 1) return value2;
|
|
13772
13853
|
if (typeof value2 === "string" && /^[1-9][0-9]*$/.test(value2)) {
|
|
@@ -13824,26 +13905,74 @@ function projectTicketProvenanceHeader(value2) {
|
|
|
13824
13905
|
var init_ticket_provenance_contracts = __esm({
|
|
13825
13906
|
"src/ticket-provenance-contracts.ts"() {
|
|
13826
13907
|
"use strict";
|
|
13908
|
+
init_unknown_value();
|
|
13827
13909
|
}
|
|
13828
13910
|
});
|
|
13829
13911
|
|
|
13830
13912
|
// src/diarist-contracts.ts
|
|
13831
|
-
var DIARIST_OUTPUT_TOOL_NAME;
|
|
13913
|
+
var DIARIST_OUTPUT_TOOL_NAME, DIARIST_SESSIONS_DESCRIPTION, diaristOutputSchema;
|
|
13832
13914
|
var init_diarist_contracts = __esm({
|
|
13833
13915
|
"src/diarist-contracts.ts"() {
|
|
13834
13916
|
"use strict";
|
|
13917
|
+
init_build();
|
|
13918
|
+
init_open_tool_schema();
|
|
13919
|
+
init_terminating_infrastructure();
|
|
13835
13920
|
init_ticket_provenance_contracts();
|
|
13836
13921
|
init_run_ticket_number();
|
|
13922
|
+
init_unknown_value();
|
|
13837
13923
|
DIARIST_OUTPUT_TOOL_NAME = "ak_diarist_output";
|
|
13924
|
+
DIARIST_SESSIONS_DESCRIPTION = "\u5BF9\u8BDD\u8FB9\u754C\u3002\u6BCF\u5377\u542B path\uFF08\u4F1A\u8BDD\u5377\u7EDD\u5BF9\u6216\u53EF\u8BFB\u8DEF\u5F84\uFF09\u4E0E ranges\uFF08\u672C\u5377\u672C\u8F6E\u5404\u533A\u95F4\uFF09\u3002\u6BCF\u6BB5\u533A\u95F4\u542B from / to\uFF1B\u8D77\u70B9\u4E0E\u7EC8\u70B9\u5404\u5199 id\uFF08\u539F\u751F id\uFF09\u6216 line\uFF08\u672C\u8F6E\u884C\u53F7\uFF09\uFF0C\u4E8C\u9009\u4E00\u3002\u7A7A\u5217\u8868\uFF1D\u672C\u8F6E\u65E0\u5BF9\u8BDD\u53EF\u5212\u3002\u7AEF\u70B9\u65E0\u6CD5\u6307\u540D\u65F6\u8D70 reask\uFF0C\u4E0D\u4E2D\u6B62\u3002";
|
|
13925
|
+
diaristOutputSchema = withTerminatingOutputDeclarations(
|
|
13926
|
+
openToolObject(
|
|
13927
|
+
typebox_exports.Object({
|
|
13928
|
+
status: typebox_exports.Unknown({
|
|
13929
|
+
description: "completed | escalate"
|
|
13930
|
+
}),
|
|
13931
|
+
ticketNumber: typebox_exports.Optional(
|
|
13932
|
+
typebox_exports.Unknown({
|
|
13933
|
+
description: "\u672C\u5EAD\u5BF9\u8C61\u7968\u53F7\uFF08\u6B63\u6574\u6570\uFF09\u6216 null/\u7701\u7565\uFF1D\u771F\u65E0\u7968\uFF1B\u4E0B\u6E38\u8D70 typed \u952E\uFF1B\u8BA4\u4E0D\u51FA\u7528 status=escalate\uFF0C\u4E0D\u6D17\u6210\u65E0\u5F55\u3002\u673A\u68B0\u5C42\u4E0D\u91CD\u5224\u3002"
|
|
13934
|
+
})
|
|
13935
|
+
),
|
|
13936
|
+
reason: typebox_exports.Unknown({
|
|
13937
|
+
description: "status \u4E3A escalate \u65F6\uFF1A\u8BA4\u4E0D\u51FA\u672C\u5EAD\u5BF9\u8C61\u7684\u539F\u56E0"
|
|
13938
|
+
}),
|
|
13939
|
+
sessions: typebox_exports.Optional(typebox_exports.Unknown({ description: DIARIST_SESSIONS_DESCRIPTION })),
|
|
13940
|
+
ticketSessions: typebox_exports.Unknown({
|
|
13941
|
+
description: `\u591A\u7968\u5EAD\u9010\u7968\u5BF9\u8BDD\u8FB9\u754C\uFF1B\u6BCF\u7968\u542B ticketNumber\uFF08\u672C\u6761\u8FB9\u754C\u6240\u5F52\u7968\u53F7\uFF0C\u6B63\u6574\u6570\uFF09\u4E0E sessions\uFF08${DIARIST_SESSIONS_DESCRIPTION}\uFF09\u3002\u4E00\u6B21\u4EA4\u5377\u5404\u7968\u5404\u81EA\u5206\u5F55\u3002\u4E0E\u5355\u7968 sessions \u4E8C\u9009\u4E00\u3002`
|
|
13942
|
+
})
|
|
13943
|
+
})
|
|
13944
|
+
)
|
|
13945
|
+
);
|
|
13838
13946
|
}
|
|
13839
13947
|
});
|
|
13840
13948
|
|
|
13841
13949
|
// src/secretariat-contracts.ts
|
|
13842
|
-
var SECRETARIAT_OUTPUT_TOOL_NAME;
|
|
13950
|
+
var SECRETARIAT_OUTPUT_TOOL_NAME, secretariatVerdictSchema;
|
|
13843
13951
|
var init_secretariat_contracts = __esm({
|
|
13844
13952
|
"src/secretariat-contracts.ts"() {
|
|
13845
13953
|
"use strict";
|
|
13954
|
+
init_build();
|
|
13955
|
+
init_terminating_infrastructure();
|
|
13846
13956
|
SECRETARIAT_OUTPUT_TOOL_NAME = "ak_secretariat_output";
|
|
13957
|
+
secretariatVerdictSchema = withTerminatingOutputDeclarations(
|
|
13958
|
+
typebox_exports.Object(
|
|
13959
|
+
{
|
|
13960
|
+
secretariatStatus: typebox_exports.Unknown({
|
|
13961
|
+
description: "converged | escalate"
|
|
13962
|
+
}),
|
|
13963
|
+
ticketNumber: typebox_exports.Optional(
|
|
13964
|
+
typebox_exports.Unknown({ description: "\u672C\u7968\u53F7\uFF1B\u7F72\u65F6\u6307\u5411\u6700\u7EC8\u6B63\u6587\u6240\u5728\u7968" })
|
|
13965
|
+
),
|
|
13966
|
+
note: typebox_exports.Unknown({ description: "\u9644\u6CE8" }),
|
|
13967
|
+
evidence: typebox_exports.Optional(typebox_exports.Unknown({ description: "\u7559\u5B58\u8BC1\u636E" })),
|
|
13968
|
+
decisionGate: typebox_exports.Unknown({
|
|
13969
|
+
description: "\u9700\u965B\u4E0B\u5904\u7F6E\u7684\u95EE\u9898\u4E0E\u9009\u9879\uFF1B\u53EF\u5199 question \u4E0E options\uFF0C\u539F\u6837\u7559\u5B58\u3002"
|
|
13970
|
+
})
|
|
13971
|
+
},
|
|
13972
|
+
{ additionalProperties: true }
|
|
13973
|
+
)
|
|
13974
|
+
);
|
|
13975
|
+
secretariatVerdictSchema.required = [];
|
|
13847
13976
|
}
|
|
13848
13977
|
});
|
|
13849
13978
|
|
|
@@ -13857,6 +13986,12 @@ var init_judge_auditor = __esm({
|
|
|
13857
13986
|
});
|
|
13858
13987
|
|
|
13859
13988
|
// src/packaged-role-registry.ts
|
|
13989
|
+
function packagedRoleMetadata(role) {
|
|
13990
|
+
return PACKAGED_ROLE_REGISTRY.find((entry) => entry.role === role);
|
|
13991
|
+
}
|
|
13992
|
+
function packagedRoleOutputTool(role) {
|
|
13993
|
+
return packagedRoleMetadata(role)?.outputTool;
|
|
13994
|
+
}
|
|
13860
13995
|
var LEGACY_REVIEW_OUTPUT_ROLES, NOTARY_SESSION_MATERIALS, INSPECTOR_SESSION_MATERIALS, AUDITOR_PUBLIC_SESSION_MATERIALS, PUBLIC_ROLE_RECORDS, PACKAGED_ROLE_REGISTRY;
|
|
13861
13996
|
var init_packaged_role_registry = __esm({
|
|
13862
13997
|
"src/packaged-role-registry.ts"() {
|
|
@@ -14396,6 +14531,162 @@ var init_submission_errors = __esm({
|
|
|
14396
14531
|
"src/submission-errors.ts"() {
|
|
14397
14532
|
"use strict";
|
|
14398
14533
|
init_readable_gate_item();
|
|
14534
|
+
init_unknown_value();
|
|
14535
|
+
}
|
|
14536
|
+
});
|
|
14537
|
+
|
|
14538
|
+
// src/collector-tool-schemas.ts
|
|
14539
|
+
var collectorOutputBaseSchema, collectorOutputArgsSchema;
|
|
14540
|
+
var init_collector_tool_schemas = __esm({
|
|
14541
|
+
"src/collector-tool-schemas.ts"() {
|
|
14542
|
+
"use strict";
|
|
14543
|
+
init_build();
|
|
14544
|
+
init_open_tool_schema();
|
|
14545
|
+
init_terminating_infrastructure();
|
|
14546
|
+
collectorOutputBaseSchema = openToolObject(
|
|
14547
|
+
typebox_exports.Object({
|
|
14548
|
+
groups: typebox_exports.Unsafe({
|
|
14549
|
+
description: "\u6309\u673A\u5668\u8EAB\u4EFD\u5F52\u7EC4\u7684\u51FA\u5E2D\u3001\u6750\u6599\u4E0E\u9010\u6761 findings\uFF08LLM \u81EA\u884C\u4ECE\u5BBF\u4E3B CLI \u53D6\u8BC1\u6574\u7406\uFF1B\u4EE3\u7801\u4E0D\u4EE3\u6536\u4E0D\u5F52\u5E76\uFF09\u3002"
|
|
14550
|
+
}),
|
|
14551
|
+
unfinishedReasons: typebox_exports.Unknown({
|
|
14552
|
+
description: "\u672A\u5B8C\u6210\u539F\u56E0\uFF1B\u53D6\u8BC1\u53D7\u9650\u65F6\u5982\u5B9E\u62A5\u544A\u3002"
|
|
14553
|
+
})
|
|
14554
|
+
})
|
|
14555
|
+
);
|
|
14556
|
+
collectorOutputArgsSchema = withTerminatingOutputDeclarations(
|
|
14557
|
+
collectorOutputBaseSchema
|
|
14558
|
+
);
|
|
14559
|
+
}
|
|
14560
|
+
});
|
|
14561
|
+
|
|
14562
|
+
// src/role-submission-declarations.ts
|
|
14563
|
+
function roleSubmissionDeclaration(role) {
|
|
14564
|
+
const name = packagedRoleOutputTool(role);
|
|
14565
|
+
if (name === void 0) throw new Error(`${role} output tool is not declared`);
|
|
14566
|
+
const face = SUBMISSION_FACE[role];
|
|
14567
|
+
return {
|
|
14568
|
+
role,
|
|
14569
|
+
name,
|
|
14570
|
+
label: face.label,
|
|
14571
|
+
description: face.description,
|
|
14572
|
+
..."promptSnippet" in face ? { promptSnippet: face.promptSnippet } : {},
|
|
14573
|
+
parameters: face.parameters
|
|
14574
|
+
};
|
|
14575
|
+
}
|
|
14576
|
+
var SUBMISSION_FACE;
|
|
14577
|
+
var init_role_submission_declarations = __esm({
|
|
14578
|
+
"src/role-submission-declarations.ts"() {
|
|
14579
|
+
"use strict";
|
|
14580
|
+
init_packaged_role_registry();
|
|
14581
|
+
init_review_submission();
|
|
14582
|
+
init_collector_tool_schemas();
|
|
14583
|
+
init_diarist_contracts();
|
|
14584
|
+
init_doctor_contracts();
|
|
14585
|
+
init_fixer_output();
|
|
14586
|
+
init_gatekeeper_output();
|
|
14587
|
+
init_gleaner_left_contracts();
|
|
14588
|
+
init_merger_contracts();
|
|
14589
|
+
init_navigator_output();
|
|
14590
|
+
init_reviewer_output();
|
|
14591
|
+
init_secretariat_contracts();
|
|
14592
|
+
init_worker_output();
|
|
14593
|
+
SUBMISSION_FACE = {
|
|
14594
|
+
judge: {
|
|
14595
|
+
label: "\u5927\u7406\u5BFA\u8F93\u51FA",
|
|
14596
|
+
description: "\u63D0\u4EA4\u5927\u7406\u5BFA\u7EC8\u5C40\u5224\u8BCD\uFF1B\u4EA4\u5377\u8C03\u7528\u7ED3\u675F\u540E\uFF0C\u7531\u516C\u5F00\u8C03\u7528\u63A5\u7F1D\u6309\u5224\u8BCD\u72B6\u6001\u6267\u884C\u9002\u7528\u5BA1\u6838\u3002",
|
|
14597
|
+
promptSnippet: "\u63D0\u4EA4\u5927\u7406\u5BFA\u7EC8\u5C40\u5224\u8BCD",
|
|
14598
|
+
parameters: reviewSubmissionSchema
|
|
14599
|
+
},
|
|
14600
|
+
fixer: {
|
|
14601
|
+
label: "\u4FEE\u5185\u53F8\u8F93\u51FA",
|
|
14602
|
+
description: "\u63D0\u4EA4\u4FEE\u5185\u53F8\u7EC8\u5C40\u56DE\u6267\u3002",
|
|
14603
|
+
promptSnippet: "\u63D0\u4EA4\u4FEE\u5185\u53F8\u7EC8\u5C40\u56DE\u6267",
|
|
14604
|
+
parameters: fixerOutputSchema
|
|
14605
|
+
},
|
|
14606
|
+
coder: {
|
|
14607
|
+
label: "\u5C06\u4F5C\u76D1\u8F93\u51FA",
|
|
14608
|
+
description: "\u63D0\u4EA4\u5C06\u4F5C\u76D1\u7EC8\u5C40\u56DE\u6267\u3002",
|
|
14609
|
+
promptSnippet: "\u63D0\u4EA4\u5C06\u4F5C\u76D1\u7EC8\u5C40\u56DE\u6267",
|
|
14610
|
+
parameters: coderOutputSchema
|
|
14611
|
+
},
|
|
14612
|
+
reviewer: {
|
|
14613
|
+
label: "\u5FA1\u53F2\u53F0\u8F93\u51FA",
|
|
14614
|
+
description: "\u63D0\u4EA4\u5FA1\u53F2\u53F0\u7EC8\u5C40\u56DE\u6267\u3002",
|
|
14615
|
+
promptSnippet: "\u63D0\u4EA4\u5FA1\u53F2\u53F0\u7EC8\u5C40\u56DE\u6267",
|
|
14616
|
+
parameters: reviewerOutputSchema
|
|
14617
|
+
},
|
|
14618
|
+
collector: {
|
|
14619
|
+
label: "\u901A\u8FDB\u53F8\u8F93\u51FA",
|
|
14620
|
+
description: "\u63D0\u4EA4\u901A\u8FDB\u53F8\u56DE\u6267\u3002",
|
|
14621
|
+
promptSnippet: "\u63D0\u4EA4\u901A\u8FDB\u53F8\u56DE\u6267",
|
|
14622
|
+
parameters: collectorOutputArgsSchema
|
|
14623
|
+
},
|
|
14624
|
+
doctor: {
|
|
14625
|
+
label: "\u592A\u533B\u7F72\u8F93\u51FA",
|
|
14626
|
+
description: DOCTOR_OUTPUT_TOOL_DESCRIPTION,
|
|
14627
|
+
parameters: doctorSubmissionSchema
|
|
14628
|
+
},
|
|
14629
|
+
merger: {
|
|
14630
|
+
label: "\u5408\u5E76\u8F93\u51FA",
|
|
14631
|
+
description: "\u63D0\u4EA4\u5408\u5E76\u7ED3\u679C\uFF1B\u8F93\u51FA\u5206\u652F\u4E3A completed \u4E0E escalate\u3002",
|
|
14632
|
+
promptSnippet: "\u63D0\u4EA4\u5408\u5E76\u7ED3\u679C",
|
|
14633
|
+
parameters: mergerOutputSchema
|
|
14634
|
+
},
|
|
14635
|
+
notary: {
|
|
14636
|
+
label: "\u7B26\u5B9D\u90CE\u8F93\u51FA",
|
|
14637
|
+
description: "\u63D0\u4EA4\u5F15\u6587\u4FDD\u771F\u4E0E\u7968\u9762\u5BF9\u9F50\u7684 converged/continue/escalate \u51B3\u8BAE\u3002",
|
|
14638
|
+
promptSnippet: "\u63D0\u4EA4\u7B26\u5B9D\u90CE\u51B3\u8BAE",
|
|
14639
|
+
parameters: reviewSubmissionSchema
|
|
14640
|
+
},
|
|
14641
|
+
countersign: {
|
|
14642
|
+
label: "\u7ED9\u4E8B\u4E2D\u8F93\u51FA",
|
|
14643
|
+
description: "\u7ED9\u4E8B\u4E2D\u51B3\u8BAE\u3002",
|
|
14644
|
+
promptSnippet: "\u7ED9\u4E8B\u4E2D\u51B3\u8BAE",
|
|
14645
|
+
parameters: reviewSubmissionSchema
|
|
14646
|
+
},
|
|
14647
|
+
secretariat: {
|
|
14648
|
+
label: "\u4E2D\u4E66\u7701\u8F93\u51FA",
|
|
14649
|
+
description: "\u4E2D\u4E66\u7701\u7EC8\u5C40\u56DE\u6267\u3002",
|
|
14650
|
+
promptSnippet: "\u4E2D\u4E66\u7701\u7EC8\u5C40\u56DE\u6267",
|
|
14651
|
+
parameters: secretariatVerdictSchema
|
|
14652
|
+
},
|
|
14653
|
+
"gleaner-left": {
|
|
14654
|
+
label: "\u5DE6\u62FE\u9057\u8F93\u51FA",
|
|
14655
|
+
description: "\u5DE6\u62FE\u9057\u5F39\u7AE0\u3002",
|
|
14656
|
+
promptSnippet: "\u5DE6\u62FE\u9057\u5F39\u7AE0",
|
|
14657
|
+
parameters: gleanerLeftOutputSchema
|
|
14658
|
+
},
|
|
14659
|
+
inspector: {
|
|
14660
|
+
label: "\u53F0\u9662\u8F93\u51FA",
|
|
14661
|
+
description: "\u53F0\u9662\u7EC8\u5C40\u56DE\u6267\uFF0C\u72B6\u6001\u4E3A converged\u3001continue \u6216 escalate\u3002",
|
|
14662
|
+
promptSnippet: "\u53F0\u9662\u7EC8\u5C40\u56DE\u6267",
|
|
14663
|
+
parameters: reviewSubmissionSchema
|
|
14664
|
+
},
|
|
14665
|
+
gatekeeper: {
|
|
14666
|
+
label: "\u95E8\u4E0B\u7701\u51B3\u8BAE",
|
|
14667
|
+
description: "\u95E8\u4E0B\u7701\u7EC8\u5C40\u51B3\u8BAE\u3002status \u4E3A dispatch \u6216 pass\u3002",
|
|
14668
|
+
promptSnippet: "\u95E8\u4E0B\u7701\u51B3\u8BAE",
|
|
14669
|
+
parameters: gatekeeperOutputSchema
|
|
14670
|
+
},
|
|
14671
|
+
navigator: {
|
|
14672
|
+
label: "\u6E38\u5955\u4F7F\u5EFA\u8BAE",
|
|
14673
|
+
description: "\u6E38\u5955\u4F7F\u7EC8\u5C40\u56DE\u6267\uFF1A\u6563\u6587\u5EFA\u8BAE\uFF0C\u539F\u6837\u5448\u73B0\u3002",
|
|
14674
|
+
promptSnippet: "\u6E38\u5955\u4F7F\u5EFA\u8BAE",
|
|
14675
|
+
parameters: navigatorOutputSchema
|
|
14676
|
+
},
|
|
14677
|
+
auditor: {
|
|
14678
|
+
label: "\u5BA1\u5211\u9662\u8F93\u51FA",
|
|
14679
|
+
description: "\u5BA1\u5211\u9662\u7EC8\u5C40\u56DE\u6267\uFF0Cstatus \u4E3A converged\u3001continue \u6216 escalate\u3002",
|
|
14680
|
+
promptSnippet: "\u5BA1\u5211\u9662\u7EC8\u5C40\u56DE\u6267",
|
|
14681
|
+
parameters: reviewSubmissionSchema
|
|
14682
|
+
},
|
|
14683
|
+
diarist: {
|
|
14684
|
+
label: "\u8D77\u5C45\u90CE\u8F93\u51FA",
|
|
14685
|
+
description: "\u8D77\u5C45\u90CE\u4EA4\u5355\u7968 sessions \u6216\u591A\u7968\u9010\u7968 ticketSessions \u8FB9\u754C\uFF1B\u8BA4\u4E0D\u51FA\u672C\u5EAD\u5BF9\u8C61\u5219 escalate\u3002",
|
|
14686
|
+
promptSnippet: "\u8D77\u5C45\u90CE\u4EA4\u8FB9\u754C",
|
|
14687
|
+
parameters: diaristOutputSchema
|
|
14688
|
+
}
|
|
14689
|
+
};
|
|
14399
14690
|
}
|
|
14400
14691
|
});
|
|
14401
14692
|
|
|
@@ -14404,10 +14695,12 @@ var init_run_terminal_artifacts = __esm({
|
|
|
14404
14695
|
"src/run-terminal-artifacts.ts"() {
|
|
14405
14696
|
"use strict";
|
|
14406
14697
|
init_role_run_placement();
|
|
14698
|
+
init_unknown_value();
|
|
14407
14699
|
}
|
|
14408
14700
|
});
|
|
14409
14701
|
|
|
14410
14702
|
// src/gatekeeper-role.ts
|
|
14703
|
+
var GATEKEEPER_TOOL_SPEC;
|
|
14411
14704
|
var init_gatekeeper_role = __esm({
|
|
14412
14705
|
"src/gatekeeper-role.ts"() {
|
|
14413
14706
|
"use strict";
|
|
@@ -14417,8 +14710,11 @@ var init_gatekeeper_role = __esm({
|
|
|
14417
14710
|
init_inspector_contracts();
|
|
14418
14711
|
init_review_submission();
|
|
14419
14712
|
init_gatekeeper_output();
|
|
14713
|
+
init_role_submission_declarations();
|
|
14420
14714
|
init_run_terminal_artifacts();
|
|
14715
|
+
init_unknown_value();
|
|
14421
14716
|
init_submission_errors();
|
|
14717
|
+
GATEKEEPER_TOOL_SPEC = roleSubmissionDeclaration("gatekeeper");
|
|
14422
14718
|
}
|
|
14423
14719
|
});
|
|
14424
14720
|
|
|
@@ -14439,6 +14735,7 @@ var init_compliance_transport = __esm({
|
|
|
14439
14735
|
init_submission_errors();
|
|
14440
14736
|
init_terminal();
|
|
14441
14737
|
init_readable_gate_item();
|
|
14738
|
+
init_unknown_value();
|
|
14442
14739
|
AUDITOR_PARENT_ATTEMPT_BINDING_ENTRY_TYPE = "ak_auditor_parent_attempt_binding";
|
|
14443
14740
|
}
|
|
14444
14741
|
});
|
|
@@ -14447,9 +14744,6 @@ var init_compliance_transport = __esm({
|
|
|
14447
14744
|
import { existsSync } from "node:fs";
|
|
14448
14745
|
import { readdir as readdir2, readFile as readFile2, writeFile } from "node:fs/promises";
|
|
14449
14746
|
import { join as join4, sep as sep2 } from "node:path";
|
|
14450
|
-
function isEnoent2(error) {
|
|
14451
|
-
return error instanceof Error && "code" in error && error.code === "ENOENT";
|
|
14452
|
-
}
|
|
14453
14747
|
function rewriteRunDirectoryPathValue(value2, oldRunDirectory, newRunDirectory) {
|
|
14454
14748
|
if (typeof value2 !== "string") return value2;
|
|
14455
14749
|
if (value2 === oldRunDirectory) return newRunDirectory;
|
|
@@ -14503,11 +14797,8 @@ function collectRewrites(input) {
|
|
|
14503
14797
|
}
|
|
14504
14798
|
return out;
|
|
14505
14799
|
}
|
|
14506
|
-
function isPlainObject(value2) {
|
|
14507
|
-
return value2 !== null && typeof value2 === "object" && !Array.isArray(value2);
|
|
14508
|
-
}
|
|
14509
14800
|
function rewriteSourceRunLocator(value2, rewrites) {
|
|
14510
|
-
if (!
|
|
14801
|
+
if (!isRecord(value2)) return;
|
|
14511
14802
|
rewriteRunDirectoryPathFieldsAgainstRewrites(
|
|
14512
14803
|
value2,
|
|
14513
14804
|
SOURCE_RUN_LOCATOR_FIELDS,
|
|
@@ -14515,7 +14806,7 @@ function rewriteSourceRunLocator(value2, rewrites) {
|
|
|
14515
14806
|
);
|
|
14516
14807
|
}
|
|
14517
14808
|
function rewriteSummonsMaterials(value2, rewrites) {
|
|
14518
|
-
if (!
|
|
14809
|
+
if (!isRecord(value2)) return;
|
|
14519
14810
|
rewriteRunDirectoryPathFieldsAgainstRewrites(
|
|
14520
14811
|
value2,
|
|
14521
14812
|
SUMMONS_PATH_FIELDS,
|
|
@@ -14533,12 +14824,12 @@ function rewriteAdmittedRoleRunPage(page, rewrites) {
|
|
|
14533
14824
|
rewriteSourceRunLocator(page.sourceRun, rewrites);
|
|
14534
14825
|
if (Array.isArray(page.attachments)) {
|
|
14535
14826
|
for (const attachment of page.attachments) {
|
|
14536
|
-
if (
|
|
14827
|
+
if (isRecord(attachment)) {
|
|
14537
14828
|
rewriteRunDirectoryPathFieldsAgainstRewrites(attachment, ["frozenPath"], rewrites);
|
|
14538
14829
|
}
|
|
14539
14830
|
}
|
|
14540
14831
|
}
|
|
14541
|
-
if (
|
|
14832
|
+
if (isRecord(page.principal)) {
|
|
14542
14833
|
rewriteRunDirectoryPathFieldsAgainstRewrites(
|
|
14543
14834
|
page.principal,
|
|
14544
14835
|
["sessionDirectory", "sessionFile"],
|
|
@@ -14549,7 +14840,7 @@ function rewriteAdmittedRoleRunPage(page, rewrites) {
|
|
|
14549
14840
|
async function rewriteOfficerPointerFile(path8, rewrites) {
|
|
14550
14841
|
if (!existsSync(path8)) return;
|
|
14551
14842
|
const page = JSON.parse(await readFile2(path8, "utf8"));
|
|
14552
|
-
if (!
|
|
14843
|
+
if (!isRecord(page)) return;
|
|
14553
14844
|
if (page.kind !== "direct-officer-run-pointer") return;
|
|
14554
14845
|
const before = JSON.stringify(page);
|
|
14555
14846
|
rewriteRunDirectoryPathFieldsAgainstRewrites(
|
|
@@ -14587,7 +14878,7 @@ async function rewriteSitianRecordsJsonl(path8, rewrites) {
|
|
|
14587
14878
|
out.push(line);
|
|
14588
14879
|
continue;
|
|
14589
14880
|
}
|
|
14590
|
-
if (!
|
|
14881
|
+
if (!isRecord(parsed2)) {
|
|
14591
14882
|
out.push(line);
|
|
14592
14883
|
continue;
|
|
14593
14884
|
}
|
|
@@ -14638,7 +14929,7 @@ async function rewriteSessionTranscriptBindings(path8, rewrites) {
|
|
|
14638
14929
|
out.push(line);
|
|
14639
14930
|
continue;
|
|
14640
14931
|
}
|
|
14641
|
-
if (!
|
|
14932
|
+
if (!isRecord(parsed2)) {
|
|
14642
14933
|
out.push(line);
|
|
14643
14934
|
continue;
|
|
14644
14935
|
}
|
|
@@ -14651,7 +14942,7 @@ async function rewriteSessionTranscriptBindings(path8, rewrites) {
|
|
|
14651
14942
|
rewrites
|
|
14652
14943
|
);
|
|
14653
14944
|
if (parsed2.parentSession !== before) lineChanged = true;
|
|
14654
|
-
} else if (parsed2.type === "custom" && parsed2.customType === AUDITOR_PARENT_ATTEMPT_BINDING_ENTRY_TYPE &&
|
|
14945
|
+
} else if (parsed2.type === "custom" && parsed2.customType === AUDITOR_PARENT_ATTEMPT_BINDING_ENTRY_TYPE && isRecord(parsed2.data) && isRecord(parsed2.data.parent)) {
|
|
14655
14946
|
const parent = parsed2.data.parent;
|
|
14656
14947
|
const before = parent.sessionFile;
|
|
14657
14948
|
rewriteRunDirectoryPathFieldsAgainstRewrites(
|
|
@@ -14680,7 +14971,7 @@ async function rewriteNestedMachinePathPages(pagesDirectory, rewrites) {
|
|
|
14680
14971
|
try {
|
|
14681
14972
|
entries = await readdir2(directory, { withFileTypes: true });
|
|
14682
14973
|
} catch (error) {
|
|
14683
|
-
if (
|
|
14974
|
+
if (isEnoent(error)) return;
|
|
14684
14975
|
throw error;
|
|
14685
14976
|
}
|
|
14686
14977
|
for (const entry of entries) {
|
|
@@ -14733,14 +15024,14 @@ async function rewriteRoleRunDurablePages(input) {
|
|
|
14733
15024
|
RUN_STATE_PAGE_FIELDS,
|
|
14734
15025
|
rewrites
|
|
14735
15026
|
);
|
|
14736
|
-
if (
|
|
15027
|
+
if (isRecord(page.principal)) {
|
|
14737
15028
|
rewriteRunDirectoryPathFieldsAgainstRewrites(
|
|
14738
15029
|
page.principal,
|
|
14739
15030
|
["sessionDirectory", "sessionFile"],
|
|
14740
15031
|
rewrites
|
|
14741
15032
|
);
|
|
14742
15033
|
}
|
|
14743
|
-
if (
|
|
15034
|
+
if (isRecord(page.currentCourt)) {
|
|
14744
15035
|
rewriteSummonsMaterials(page.currentCourt.summons, rewrites);
|
|
14745
15036
|
}
|
|
14746
15037
|
if (JSON.stringify(page) !== before) {
|
|
@@ -14755,6 +15046,7 @@ var init_role_run_relocation = __esm({
|
|
|
14755
15046
|
"src/role-run-relocation.ts"() {
|
|
14756
15047
|
"use strict";
|
|
14757
15048
|
init_compliance_transport();
|
|
15049
|
+
init_unknown_value();
|
|
14758
15050
|
ADMITTED_PAGE_FIELDS = [
|
|
14759
15051
|
"runDirectory",
|
|
14760
15052
|
"admittedRequestPath",
|
|
@@ -14798,13 +15090,7 @@ var init_engine_material = __esm({
|
|
|
14798
15090
|
var init_activation_ledger_git = __esm({
|
|
14799
15091
|
"src/activation-ledger-git.ts"() {
|
|
14800
15092
|
"use strict";
|
|
14801
|
-
|
|
14802
|
-
});
|
|
14803
|
-
|
|
14804
|
-
// src/sha256.ts
|
|
14805
|
-
var init_sha256 = __esm({
|
|
14806
|
-
"src/sha256.ts"() {
|
|
14807
|
-
"use strict";
|
|
15093
|
+
init_unknown_value();
|
|
14808
15094
|
}
|
|
14809
15095
|
});
|
|
14810
15096
|
|
|
@@ -14814,6 +15100,7 @@ var init_submission_correctable_error = __esm({
|
|
|
14814
15100
|
"src/submission-correctable-error.ts"() {
|
|
14815
15101
|
"use strict";
|
|
14816
15102
|
init_submission_errors();
|
|
15103
|
+
init_unknown_value();
|
|
14817
15104
|
correctableSubmissionErrorBrand = /* @__PURE__ */ Symbol("ak-roles.correctable-submission-error");
|
|
14818
15105
|
CorrectableSubmissionError = class extends Error {
|
|
14819
15106
|
[correctableSubmissionErrorBrand] = true;
|
|
@@ -14843,6 +15130,7 @@ var init_terminating_tools = __esm({
|
|
|
14843
15130
|
init_diarist_contracts();
|
|
14844
15131
|
init_secretariat_contracts();
|
|
14845
15132
|
init_worker_output();
|
|
15133
|
+
init_unknown_value();
|
|
14846
15134
|
TERMINATING_TOOL_NAMES = [.../* @__PURE__ */ new Set([
|
|
14847
15135
|
...PACKAGED_ROLE_REGISTRY.map((entry) => entry.outputTool),
|
|
14848
15136
|
...LEGACY_REVIEW_OUTPUT_ROLES.keys()
|
|
@@ -14856,6 +15144,7 @@ var init_doctor_evidence = __esm({
|
|
|
14856
15144
|
"use strict";
|
|
14857
15145
|
init_sha256();
|
|
14858
15146
|
init_terminating_tools();
|
|
15147
|
+
init_unknown_value();
|
|
14859
15148
|
}
|
|
14860
15149
|
});
|
|
14861
15150
|
|
|
@@ -14890,6 +15179,7 @@ var init_merger_git_state = __esm({
|
|
|
14890
15179
|
var init_ledger_session_read = __esm({
|
|
14891
15180
|
"src/ledger-session-read.ts"() {
|
|
14892
15181
|
"use strict";
|
|
15182
|
+
init_unknown_value();
|
|
14893
15183
|
}
|
|
14894
15184
|
});
|
|
14895
15185
|
|
|
@@ -14897,6 +15187,7 @@ var init_ledger_session_read = __esm({
|
|
|
14897
15187
|
var init_session_dialogue = __esm({
|
|
14898
15188
|
"src/session-dialogue.ts"() {
|
|
14899
15189
|
"use strict";
|
|
15190
|
+
init_unknown_value();
|
|
14900
15191
|
}
|
|
14901
15192
|
});
|
|
14902
15193
|
|
|
@@ -14929,6 +15220,7 @@ var init_sitian_appender = __esm({
|
|
|
14929
15220
|
var init_sitian_reader = __esm({
|
|
14930
15221
|
"src/sitian-reader.ts"() {
|
|
14931
15222
|
"use strict";
|
|
15223
|
+
init_unknown_value();
|
|
14932
15224
|
}
|
|
14933
15225
|
});
|
|
14934
15226
|
|
|
@@ -14953,6 +15245,7 @@ var init_ticket_provenance = __esm({
|
|
|
14953
15245
|
init_session_dialogue();
|
|
14954
15246
|
init_sitian_facade();
|
|
14955
15247
|
init_ticket_provenance_contracts();
|
|
15248
|
+
init_unknown_value();
|
|
14956
15249
|
}
|
|
14957
15250
|
});
|
|
14958
15251
|
|
|
@@ -15763,6 +16056,7 @@ var init_invocation = __esm({
|
|
|
15763
16056
|
init_engine_material();
|
|
15764
16057
|
init_cli_errors();
|
|
15765
16058
|
init_option_definitions();
|
|
16059
|
+
init_unknown_value();
|
|
15766
16060
|
}
|
|
15767
16061
|
});
|
|
15768
16062
|
|
|
@@ -15818,6 +16112,7 @@ var init_run_lifecycle = __esm({
|
|
|
15818
16112
|
init_engine_material();
|
|
15819
16113
|
init_packaged_role_registry();
|
|
15820
16114
|
init_invocation();
|
|
16115
|
+
init_unknown_value();
|
|
15821
16116
|
}
|
|
15822
16117
|
});
|
|
15823
16118
|
|
|
@@ -82458,7 +82753,7 @@ var require_extend = __commonJS({
|
|
|
82458
82753
|
}
|
|
82459
82754
|
return toStr.call(arr) === "[object Array]";
|
|
82460
82755
|
};
|
|
82461
|
-
var
|
|
82756
|
+
var isPlainObject2 = function isPlainObject3(obj) {
|
|
82462
82757
|
if (!obj || toStr.call(obj) !== "[object Object]") {
|
|
82463
82758
|
return false;
|
|
82464
82759
|
}
|
|
@@ -82515,12 +82810,12 @@ var require_extend = __commonJS({
|
|
|
82515
82810
|
src = getProperty(target, name);
|
|
82516
82811
|
copy = getProperty(options, name);
|
|
82517
82812
|
if (target !== copy) {
|
|
82518
|
-
if (deep && copy && (
|
|
82813
|
+
if (deep && copy && (isPlainObject2(copy) || (copyIsArray = isArray3(copy)))) {
|
|
82519
82814
|
if (copyIsArray) {
|
|
82520
82815
|
copyIsArray = false;
|
|
82521
82816
|
clone2 = src && isArray3(src) ? src : [];
|
|
82522
82817
|
} else {
|
|
82523
|
-
clone2 = src &&
|
|
82818
|
+
clone2 = src && isPlainObject2(src) ? src : {};
|
|
82524
82819
|
}
|
|
82525
82820
|
setProperty(target, { name, newValue: extend(deep, clone2, copy) });
|
|
82526
82821
|
} else if (typeof copy !== "undefined") {
|
|
@@ -117308,12 +117603,12 @@ function toGoogleGenAIRequestOptions(options, streaming = false) {
|
|
|
117308
117603
|
}
|
|
117309
117604
|
const _e2 = options !== null && options !== void 0 ? options : {}, { timeout, maxRetries, defaultBaseURL, query, body, fetchOptions } = _e2, rest = __rest(_e2, ["timeout", "maxRetries", "defaultBaseURL", "query", "body", "fetchOptions"]);
|
|
117310
117605
|
const nextOptions = Object.assign({}, rest);
|
|
117311
|
-
if (
|
|
117606
|
+
if (isPlainObject(query)) {
|
|
117312
117607
|
nextOptions.extra_query = query;
|
|
117313
117608
|
} else {
|
|
117314
117609
|
warnIgnoredOption("query", query);
|
|
117315
117610
|
}
|
|
117316
|
-
if (
|
|
117611
|
+
if (isPlainObject(body)) {
|
|
117317
117612
|
nextOptions.extra_body = body;
|
|
117318
117613
|
} else {
|
|
117319
117614
|
warnIgnoredOption("body", body);
|
|
@@ -117410,7 +117705,7 @@ function wrapStreamErrors(stream12) {
|
|
|
117410
117705
|
});
|
|
117411
117706
|
}
|
|
117412
117707
|
function attachSdkHttpResponse(value2, call) {
|
|
117413
|
-
if (!
|
|
117708
|
+
if (!isPlainObject(value2) || call.status !== "complete") {
|
|
117414
117709
|
return value2;
|
|
117415
117710
|
}
|
|
117416
117711
|
return Object.assign(Object.assign({}, value2), { sdkHttpResponse: createSdkHttpResponse(call.response, value2) });
|
|
@@ -117434,7 +117729,7 @@ function addOutputPropertiesIfInteraction(value2) {
|
|
|
117434
117729
|
return addOutputProperties(interaction);
|
|
117435
117730
|
}
|
|
117436
117731
|
function normalizeInteractionShape(value2) {
|
|
117437
|
-
if (!
|
|
117732
|
+
if (!isPlainObject(value2)) {
|
|
117438
117733
|
return void 0;
|
|
117439
117734
|
}
|
|
117440
117735
|
if (Array.isArray(value2["steps"])) {
|
|
@@ -117453,7 +117748,7 @@ function isLegacyLyriaInteraction(value2) {
|
|
|
117453
117748
|
const model = value2["model"];
|
|
117454
117749
|
return typeof model === "string" && LEGACY_LYRIA_MODELS.has(model);
|
|
117455
117750
|
}
|
|
117456
|
-
function
|
|
117751
|
+
function isPlainObject(value2) {
|
|
117457
117752
|
return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
|
|
117458
117753
|
}
|
|
117459
117754
|
function addOutputProperties(interaction) {
|
|
@@ -190505,7 +190800,7 @@ var init_dist7 = __esm({
|
|
|
190505
190800
|
});
|
|
190506
190801
|
|
|
190507
190802
|
// node_modules/.pnpm/@earendil-works+pi-coding-agent@0.99.1_@aws-sdk+credential-provider-node@3.972.83_@smit_1f563b9fb7db4619e2913cc40d230799/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.js
|
|
190508
|
-
import { createHash, randomBytes as randomBytes2 } from "node:crypto";
|
|
190803
|
+
import { createHash as createHash2, randomBytes as randomBytes2 } from "node:crypto";
|
|
190509
190804
|
import { writeFile as writeFile5 } from "node:fs/promises";
|
|
190510
190805
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
190511
190806
|
import { join as join13 } from "node:path";
|
|
@@ -190521,7 +190816,7 @@ function createMcpToolName(server, tool, isTaken = () => false) {
|
|
|
190521
190816
|
const name = `mcp__${server}__${tool}`.replace(/[^A-Za-z0-9_-]/g, "_");
|
|
190522
190817
|
if (name.length <= MAX_TOOL_NAME_LENGTH && !isTaken(name))
|
|
190523
190818
|
return name;
|
|
190524
|
-
const hash =
|
|
190819
|
+
const hash = createHash2("sha256").update(`${server}\0${tool}`).digest("hex").slice(0, 8);
|
|
190525
190820
|
return `${name.slice(0, MAX_TOOL_NAME_LENGTH - hash.length - 1)}_${hash}`;
|
|
190526
190821
|
}
|
|
190527
190822
|
function textOf2(content) {
|
|
@@ -191811,7 +192106,7 @@ var init_oauth_page = __esm({
|
|
|
191811
192106
|
});
|
|
191812
192107
|
|
|
191813
192108
|
// node_modules/.pnpm/@earendil-works+pi-coding-agent@0.99.1_@aws-sdk+credential-provider-node@3.972.83_@smit_1f563b9fb7db4619e2913cc40d230799/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.js
|
|
191814
|
-
import { createHash as
|
|
192109
|
+
import { createHash as createHash3 } from "node:crypto";
|
|
191815
192110
|
import { mkdirSync as mkdirSync4 } from "node:fs";
|
|
191816
192111
|
import { join as join14 } from "node:path";
|
|
191817
192112
|
function callbackSettings(settings3) {
|
|
@@ -192040,7 +192335,7 @@ var init_oauth2 = __esm({
|
|
|
192040
192335
|
if (!this.lockDir)
|
|
192041
192336
|
return fn();
|
|
192042
192337
|
mkdirSync4(this.lockDir, { recursive: true, mode: 448 });
|
|
192043
|
-
const hash =
|
|
192338
|
+
const hash = createHash3("sha256").update(key).digest("hex").slice(0, 16);
|
|
192044
192339
|
const release = await import_proper_lockfile4.default.lock(join14(this.lockDir, `mcp-auth-refresh-${hash}`), {
|
|
192045
192340
|
realpath: false,
|
|
192046
192341
|
stale: REFRESH_LOCK_STALE_MS,
|
|
@@ -195033,6 +195328,7 @@ import { dirname as dirname10, join as join18, relative as relative4, resolve as
|
|
|
195033
195328
|
init_activation_ledger_topology();
|
|
195034
195329
|
|
|
195035
195330
|
// src/archivist-record-topology.ts
|
|
195331
|
+
init_sha256();
|
|
195036
195332
|
init_activation_ledger_git();
|
|
195037
195333
|
init_activation_ledger_topology();
|
|
195038
195334
|
|
|
@@ -195048,22 +195344,17 @@ var WORKER_SUBMISSION_GATE_KIND = "worker-submission-gate";
|
|
|
195048
195344
|
init_activation_ledger_topology();
|
|
195049
195345
|
init_role_run_placement();
|
|
195050
195346
|
init_run_ticket_number();
|
|
195347
|
+
init_unknown_value();
|
|
195051
195348
|
import { readdir as readdir6, readFile as readFile6 } from "node:fs/promises";
|
|
195052
195349
|
import { basename as basename8, dirname as dirname9, isAbsolute as isAbsolute5, join as join17, relative as relative3, resolve as resolve8, sep as sep6 } from "node:path";
|
|
195053
195350
|
var TICKET_NUMBER_RE = /^[1-9][0-9]*$/;
|
|
195054
195351
|
var RUN_DIR_NAME_RE = /^([^@]+)@([^@]+)$/;
|
|
195055
|
-
function isRecord6(value2) {
|
|
195056
|
-
return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
|
|
195057
|
-
}
|
|
195058
|
-
function isMigrationEnoent(error) {
|
|
195059
|
-
return error instanceof Error && "code" in error && error.code === "ENOENT";
|
|
195060
|
-
}
|
|
195061
195352
|
async function listMigrationBookKeys(booksDirectory) {
|
|
195062
195353
|
try {
|
|
195063
195354
|
const entries = await readdir6(booksDirectory, { withFileTypes: true });
|
|
195064
195355
|
return entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort((a, b2) => a.localeCompare(b2));
|
|
195065
195356
|
} catch (error) {
|
|
195066
|
-
if (
|
|
195357
|
+
if (isEnoent(error)) return [];
|
|
195067
195358
|
throw error;
|
|
195068
195359
|
}
|
|
195069
195360
|
}
|
|
@@ -195072,7 +195363,7 @@ async function listMigrationDirents(directory) {
|
|
|
195072
195363
|
const entries = await readdir6(directory, { withFileTypes: true });
|
|
195073
195364
|
return [...entries].sort((a, b2) => a.name.localeCompare(b2.name));
|
|
195074
195365
|
} catch (error) {
|
|
195075
|
-
if (
|
|
195366
|
+
if (isEnoent(error)) return [];
|
|
195076
195367
|
throw error;
|
|
195077
195368
|
}
|
|
195078
195369
|
}
|
|
@@ -195098,13 +195389,13 @@ async function readProjectRootFromRun(runDirectory) {
|
|
|
195098
195389
|
const path8 = join17(runDirectory, page);
|
|
195099
195390
|
try {
|
|
195100
195391
|
const raw = JSON.parse(await readFile6(path8, "utf8"));
|
|
195101
|
-
if (!
|
|
195392
|
+
if (!isRecord(raw)) continue;
|
|
195102
195393
|
const projectRoot = raw.projectRoot;
|
|
195103
195394
|
if (typeof projectRoot === "string" && projectRoot.length > 0) {
|
|
195104
195395
|
return { projectRoot, sourcePage: page };
|
|
195105
195396
|
}
|
|
195106
195397
|
} catch (error) {
|
|
195107
|
-
if (
|
|
195398
|
+
if (isEnoent(error)) continue;
|
|
195108
195399
|
throw error;
|
|
195109
195400
|
}
|
|
195110
195401
|
}
|
|
@@ -195333,7 +195624,7 @@ function runCoordsFromSessionParent(sessionParent) {
|
|
|
195333
195624
|
}
|
|
195334
195625
|
function runIdFromSubject(subject) {
|
|
195335
195626
|
if (typeof subject === "string" && subject.length > 0) return subject;
|
|
195336
|
-
if (
|
|
195627
|
+
if (isRecord(subject) && typeof subject.runId === "string" && subject.runId.length > 0) {
|
|
195337
195628
|
return subject.runId;
|
|
195338
195629
|
}
|
|
195339
195630
|
return void 0;
|
|
@@ -195342,11 +195633,12 @@ function ticketNumberFromSubject(subject) {
|
|
|
195342
195633
|
if (typeof subject === "string" || typeof subject === "number") {
|
|
195343
195634
|
return ticketNumberFromUnknown(subject);
|
|
195344
195635
|
}
|
|
195345
|
-
if (
|
|
195636
|
+
if (isRecord(subject)) return ticketNumberFromUnknown(subject.ticketNumber);
|
|
195346
195637
|
return void 0;
|
|
195347
195638
|
}
|
|
195348
195639
|
|
|
195349
195640
|
// src/book-topology-mixed-volume-migrators.ts
|
|
195641
|
+
init_unknown_value();
|
|
195350
195642
|
var SITIAN_MIXED_VOLUME_PARTITIONS = [
|
|
195351
195643
|
"attendance",
|
|
195352
195644
|
"auditor",
|
|
@@ -195354,9 +195646,6 @@ var SITIAN_MIXED_VOLUME_PARTITIONS = [
|
|
|
195354
195646
|
"gate"
|
|
195355
195647
|
];
|
|
195356
195648
|
var CURRENT_SESSION_LEDGER = "current-session.json";
|
|
195357
|
-
function isRecord7(value2) {
|
|
195358
|
-
return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
|
|
195359
|
-
}
|
|
195360
195649
|
function posixRelative(from, to) {
|
|
195361
195650
|
return relative4(from, to).split(sep7).join("/");
|
|
195362
195651
|
}
|
|
@@ -195370,17 +195659,17 @@ function pathCandidatesFromRecord(record) {
|
|
|
195370
195659
|
const seen = /* @__PURE__ */ new Set();
|
|
195371
195660
|
addPathCandidate(paths, seen, record.sessionParent);
|
|
195372
195661
|
addPathCandidate(paths, seen, record.parentSession);
|
|
195373
|
-
if (!
|
|
195662
|
+
if (!isRecord(record.payload)) return paths;
|
|
195374
195663
|
const payload = record.payload;
|
|
195375
195664
|
addPathCandidate(paths, seen, payload.sessionParent);
|
|
195376
195665
|
addPathCandidate(paths, seen, payload.parentSession);
|
|
195377
195666
|
addPathCandidate(paths, seen, payload.sessionFile);
|
|
195378
|
-
if (
|
|
195667
|
+
if (isRecord(payload.parent)) {
|
|
195379
195668
|
addPathCandidate(paths, seen, payload.parent.sessionFile);
|
|
195380
195669
|
addPathCandidate(paths, seen, payload.parent.sessionParent);
|
|
195381
195670
|
addPathCandidate(paths, seen, payload.parent.parentSession);
|
|
195382
195671
|
}
|
|
195383
|
-
if (
|
|
195672
|
+
if (isRecord(payload.data)) {
|
|
195384
195673
|
addPathCandidate(paths, seen, payload.data.sessionParent);
|
|
195385
195674
|
addPathCandidate(paths, seen, payload.data.parentSession);
|
|
195386
195675
|
addPathCandidate(paths, seen, payload.data.sessionFile);
|
|
@@ -195410,7 +195699,7 @@ async function readRegularBackupFile(path8) {
|
|
|
195410
195699
|
try {
|
|
195411
195700
|
info = await lstat2(path8);
|
|
195412
195701
|
} catch (error) {
|
|
195413
|
-
if (
|
|
195702
|
+
if (isEnoent(error)) return void 0;
|
|
195414
195703
|
throw error;
|
|
195415
195704
|
}
|
|
195416
195705
|
if (!info.isFile()) {
|
|
@@ -195435,7 +195724,7 @@ function inspectWorkerSubmissionGateVolume(text, bookRoots) {
|
|
|
195435
195724
|
malformedRows.push({ lineNumber: row.lineNumber, raw: row.raw });
|
|
195436
195725
|
continue;
|
|
195437
195726
|
}
|
|
195438
|
-
if (!
|
|
195727
|
+
if (!isRecord(parsed2)) {
|
|
195439
195728
|
malformedRows.push({ lineNumber: row.lineNumber, raw: row.raw });
|
|
195440
195729
|
continue;
|
|
195441
195730
|
}
|
|
@@ -195488,7 +195777,7 @@ async function migrateCurrentSessionPointer(input) {
|
|
|
195488
195777
|
let sessionFile;
|
|
195489
195778
|
try {
|
|
195490
195779
|
const parsed2 = JSON.parse(raw);
|
|
195491
|
-
if (
|
|
195780
|
+
if (isRecord(parsed2) && typeof parsed2.sessionFile === "string" && parsed2.sessionFile.length > 0) {
|
|
195492
195781
|
sessionFile = parsed2.sessionFile;
|
|
195493
195782
|
}
|
|
195494
195783
|
} catch {
|
|
@@ -195566,7 +195855,7 @@ async function migrateSitianMixedVolume(partition3, context) {
|
|
|
195566
195855
|
});
|
|
195567
195856
|
continue;
|
|
195568
195857
|
}
|
|
195569
|
-
if (!
|
|
195858
|
+
if (!isRecord(parsed2)) {
|
|
195570
195859
|
const dest2 = volumeDestinationFile(
|
|
195571
195860
|
booksDirectory,
|
|
195572
195861
|
bookKey,
|
|
@@ -195700,6 +195989,7 @@ init_activation_ledger_topology();
|
|
|
195700
195989
|
import { cp as cp3, lstat as lstat3, mkdir as mkdir4, readFile as readFile8, stat as stat4, unlink as unlink2, utimes, writeFile as writeFile7 } from "node:fs/promises";
|
|
195701
195990
|
import { basename as basename9, dirname as dirname11, join as join19, relative as relative5, resolve as resolve10, sep as sep8 } from "node:path";
|
|
195702
195991
|
init_role_run_relocation();
|
|
195992
|
+
init_unknown_value();
|
|
195703
195993
|
var AUDITOR_ROLES_PARTITION = "auditor-roles";
|
|
195704
195994
|
var ISSUES_PARTITION = "issues";
|
|
195705
195995
|
var DEPRECATED_KINDS_PARTITION = "deprecated-kinds";
|
|
@@ -195743,7 +196033,7 @@ async function directoryExists(path8) {
|
|
|
195743
196033
|
const info = await stat4(path8);
|
|
195744
196034
|
return info.isDirectory();
|
|
195745
196035
|
} catch (error) {
|
|
195746
|
-
if (
|
|
196036
|
+
if (isEnoent(error)) return false;
|
|
195747
196037
|
throw error;
|
|
195748
196038
|
}
|
|
195749
196039
|
}
|
|
@@ -195819,7 +196109,7 @@ async function readJsonlParentSession(path8) {
|
|
|
195819
196109
|
try {
|
|
195820
196110
|
raw = await readFile8(path8, "utf8");
|
|
195821
196111
|
} catch (error) {
|
|
195822
|
-
if (
|
|
196112
|
+
if (isEnoent(error)) return void 0;
|
|
195823
196113
|
throw error;
|
|
195824
196114
|
}
|
|
195825
196115
|
const newline = raw.indexOf("\n");
|
|
@@ -195827,7 +196117,7 @@ async function readJsonlParentSession(path8) {
|
|
|
195827
196117
|
if (line.length === 0) return void 0;
|
|
195828
196118
|
try {
|
|
195829
196119
|
const header = JSON.parse(line);
|
|
195830
|
-
if (
|
|
196120
|
+
if (!isRecord(header)) {
|
|
195831
196121
|
return void 0;
|
|
195832
196122
|
}
|
|
195833
196123
|
const parentSession = header.parentSession;
|
|
@@ -195847,13 +196137,13 @@ async function findTrueVolumeParent(backupBooksDirectory, booksDirectory, volume
|
|
|
195847
196137
|
try {
|
|
195848
196138
|
ledgerRaw = await readFile8(join19(volumeDirectory, CURRENT_SESSION_LEDGER2), "utf8");
|
|
195849
196139
|
} catch (error) {
|
|
195850
|
-
if (
|
|
196140
|
+
if (isEnoent(error)) return void 0;
|
|
195851
196141
|
throw error;
|
|
195852
196142
|
}
|
|
195853
196143
|
let sessionFileField;
|
|
195854
196144
|
try {
|
|
195855
196145
|
const ledger = JSON.parse(ledgerRaw);
|
|
195856
|
-
if (
|
|
196146
|
+
if (!isRecord(ledger)) {
|
|
195857
196147
|
return void 0;
|
|
195858
196148
|
}
|
|
195859
196149
|
const sessionFile = ledger.sessionFile;
|
|
@@ -195873,7 +196163,7 @@ async function findTrueVolumeParent(backupBooksDirectory, booksDirectory, volume
|
|
|
195873
196163
|
const info = await lstat3(liveSession);
|
|
195874
196164
|
if (!info.isFile()) return void 0;
|
|
195875
196165
|
} catch (error) {
|
|
195876
|
-
if (
|
|
196166
|
+
if (isEnoent(error)) return void 0;
|
|
195877
196167
|
throw error;
|
|
195878
196168
|
}
|
|
195879
196169
|
const parentSession = await readJsonlParentSession(liveSession);
|
|
@@ -195954,7 +196244,7 @@ async function readSessionFileField(path8) {
|
|
|
195954
196244
|
try {
|
|
195955
196245
|
raw = await readFile8(path8, "utf8");
|
|
195956
196246
|
} catch (error) {
|
|
195957
|
-
if (
|
|
196247
|
+
if (isEnoent(error)) return void 0;
|
|
195958
196248
|
throw error;
|
|
195959
196249
|
}
|
|
195960
196250
|
let parsed2;
|
|
@@ -195962,11 +196252,11 @@ async function readSessionFileField(path8) {
|
|
|
195962
196252
|
parsed2 = JSON.parse(raw);
|
|
195963
196253
|
} catch (error) {
|
|
195964
196254
|
throw new Error(
|
|
195965
|
-
`book topology migration cannot read current-session pointer at ${path8}: invalid JSON (${
|
|
196255
|
+
`book topology migration cannot read current-session pointer at ${path8}: invalid JSON (${errorText(error)})`,
|
|
195966
196256
|
{ cause: error }
|
|
195967
196257
|
);
|
|
195968
196258
|
}
|
|
195969
|
-
if (
|
|
196259
|
+
if (!isRecord(parsed2)) {
|
|
195970
196260
|
throw new Error(
|
|
195971
196261
|
`book topology migration cannot read current-session pointer at ${path8}: expected a JSON object`
|
|
195972
196262
|
);
|
|
@@ -196005,7 +196295,7 @@ async function mergeRewrittenCurrentSession(volumeDirectory, historicalVolume, d
|
|
|
196005
196295
|
srcStat = await stat4(srcPath);
|
|
196006
196296
|
srcRaw = await readFile8(srcPath, "utf8");
|
|
196007
196297
|
} catch (error) {
|
|
196008
|
-
if (
|
|
196298
|
+
if (isEnoent(error)) return;
|
|
196009
196299
|
throw error;
|
|
196010
196300
|
}
|
|
196011
196301
|
let nextRaw = srcRaw.endsWith("\n") ? srcRaw : `${srcRaw}
|
|
@@ -196013,7 +196303,7 @@ async function mergeRewrittenCurrentSession(volumeDirectory, historicalVolume, d
|
|
|
196013
196303
|
let nextSessionFile;
|
|
196014
196304
|
try {
|
|
196015
196305
|
const parsed2 = JSON.parse(srcRaw);
|
|
196016
|
-
if (
|
|
196306
|
+
if (isRecord(parsed2)) {
|
|
196017
196307
|
const record = parsed2;
|
|
196018
196308
|
if (typeof record.sessionFile === "string") {
|
|
196019
196309
|
const rewritten = rewritePathIntoDestination(
|
|
@@ -196035,7 +196325,7 @@ async function mergeRewrittenCurrentSession(volumeDirectory, historicalVolume, d
|
|
|
196035
196325
|
try {
|
|
196036
196326
|
destStat = await stat4(destPath);
|
|
196037
196327
|
} catch (error) {
|
|
196038
|
-
if (!
|
|
196328
|
+
if (!isEnoent(error)) throw error;
|
|
196039
196329
|
}
|
|
196040
196330
|
await writeWinningCurrentSession(
|
|
196041
196331
|
destPath,
|
|
@@ -196160,7 +196450,7 @@ async function copyIssuesNonRunTree(source, destination) {
|
|
|
196160
196450
|
`book topology migration refuses to overwrite ${to} with ${from}`
|
|
196161
196451
|
);
|
|
196162
196452
|
} catch (error) {
|
|
196163
|
-
if (!
|
|
196453
|
+
if (!isEnoent(error)) throw error;
|
|
196164
196454
|
}
|
|
196165
196455
|
await cp3(from, to, { preserveTimestamps: true });
|
|
196166
196456
|
}
|
|
@@ -196213,7 +196503,7 @@ async function unlinkIfPresent(path8) {
|
|
|
196213
196503
|
try {
|
|
196214
196504
|
await unlink2(path8);
|
|
196215
196505
|
} catch (error) {
|
|
196216
|
-
if (!
|
|
196506
|
+
if (!isEnoent(error)) throw error;
|
|
196217
196507
|
}
|
|
196218
196508
|
}
|
|
196219
196509
|
async function discardDeprecatedPagesFromRunSource(input) {
|
|
@@ -196319,22 +196609,20 @@ var BOOK_TOPOLOGY_T11_MIGRATORS = [
|
|
|
196319
196609
|
];
|
|
196320
196610
|
|
|
196321
196611
|
// src/book-topology-record-class-migrators.ts
|
|
196322
|
-
import { createHash as createHash3 } from "node:crypto";
|
|
196323
196612
|
import { appendFile as appendFile2, mkdir as mkdir5, readFile as readFile9, stat as stat5, writeFile as writeFile8 } from "node:fs/promises";
|
|
196324
196613
|
import { dirname as dirname12, join as join20, relative as relative6, sep as sep9 } from "node:path";
|
|
196325
196614
|
init_sitian_appender();
|
|
196326
196615
|
init_ticket_provenance_contracts();
|
|
196616
|
+
init_sha256();
|
|
196617
|
+
init_unknown_value();
|
|
196327
196618
|
var TICKET_PROVENANCE = "ticket-provenance";
|
|
196328
196619
|
var SUBMISSION_LEDGER = "submission-ledger";
|
|
196329
196620
|
var ATTEMPT_HISTORY = "attempt-history";
|
|
196330
196621
|
var MISPLACED = "misplaced-record-class";
|
|
196331
|
-
function isRecord8(value2) {
|
|
196332
|
-
return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
|
|
196333
|
-
}
|
|
196334
196622
|
function parseJsonlLine(raw) {
|
|
196335
196623
|
try {
|
|
196336
196624
|
const value2 = JSON.parse(raw);
|
|
196337
|
-
if (!
|
|
196625
|
+
if (!isRecord(value2)) return { ok: false, raw };
|
|
196338
196626
|
return { ok: true, value: value2, raw };
|
|
196339
196627
|
} catch {
|
|
196340
196628
|
return { ok: false, raw };
|
|
@@ -196347,14 +196635,14 @@ function lineSource(backupBooksDirectory, filePath, index3) {
|
|
|
196347
196635
|
return `${sourceRelative(backupBooksDirectory, filePath)}#${index3 + 1}`;
|
|
196348
196636
|
}
|
|
196349
196637
|
function stableKey(material) {
|
|
196350
|
-
return
|
|
196638
|
+
return sha256Hex(material).slice(0, 32);
|
|
196351
196639
|
}
|
|
196352
196640
|
async function readJsonlLines(filePath) {
|
|
196353
196641
|
let text;
|
|
196354
196642
|
try {
|
|
196355
196643
|
text = await readFile9(filePath, "utf8");
|
|
196356
196644
|
} catch (error) {
|
|
196357
|
-
if (
|
|
196645
|
+
if (isEnoent(error)) return [];
|
|
196358
196646
|
throw error;
|
|
196359
196647
|
}
|
|
196360
196648
|
if (text.length === 0) return [];
|
|
@@ -196446,13 +196734,13 @@ var RecordWriteCache = class {
|
|
|
196446
196734
|
}
|
|
196447
196735
|
};
|
|
196448
196736
|
function roleFromPayload(payload) {
|
|
196449
|
-
if (
|
|
196737
|
+
if (isRecord(payload) && typeof payload.role === "string" && payload.role.length > 0) {
|
|
196450
196738
|
return payload.role;
|
|
196451
196739
|
}
|
|
196452
196740
|
return void 0;
|
|
196453
196741
|
}
|
|
196454
196742
|
function runIdFromPayload(payload) {
|
|
196455
|
-
return
|
|
196743
|
+
return isRecord(payload) && typeof payload.runId === "string" && payload.runId.length > 0 ? payload.runId : void 0;
|
|
196456
196744
|
}
|
|
196457
196745
|
function recordClassOfKind(kind) {
|
|
196458
196746
|
if (kind === TICKET_PROVENANCE) return TICKET_PROVENANCE;
|
|
@@ -196742,7 +197030,7 @@ async function mergeOfferedIdentities(destDir, volumeDir, writes) {
|
|
|
196742
197030
|
await stat5(from);
|
|
196743
197031
|
lines = await readJsonlLines(from);
|
|
196744
197032
|
} catch (error) {
|
|
196745
|
-
if (
|
|
197033
|
+
if (isEnoent(error)) return;
|
|
196746
197034
|
throw error;
|
|
196747
197035
|
}
|
|
196748
197036
|
const destFile = join20(destDir, OFFERED_IDENTITIES);
|
|
@@ -196797,7 +197085,7 @@ async function migrateHomePartitionBook(context, bookKey, writes, category, outc
|
|
|
196797
197085
|
try {
|
|
196798
197086
|
await stat5(recordsFile);
|
|
196799
197087
|
} catch (error) {
|
|
196800
|
-
if (
|
|
197088
|
+
if (isEnoent(error)) continue;
|
|
196801
197089
|
throw error;
|
|
196802
197090
|
}
|
|
196803
197091
|
await migrateJsonlFileByKind(context, bookKey, writes, recordsFile, TICKET_PROVENANCE, outcomes);
|
|
@@ -196936,6 +197224,7 @@ import { basename as basename10, dirname as dirname13, join as join21, relative
|
|
|
196936
197224
|
init_role_run_placement();
|
|
196937
197225
|
init_role_run_relocation();
|
|
196938
197226
|
init_run_ticket_number();
|
|
197227
|
+
init_unknown_value();
|
|
196939
197228
|
var RUNS_PARTITION = "runs";
|
|
196940
197229
|
var RUN_LEAF2 = /^([A-Za-z0-9][A-Za-z0-9._-]*)@([A-Za-z][A-Za-z0-9_-]*)$/;
|
|
196941
197230
|
function parseRunLeaf2(name) {
|
|
@@ -196948,7 +197237,7 @@ async function pathExists2(path8) {
|
|
|
196948
197237
|
await stat6(path8);
|
|
196949
197238
|
return true;
|
|
196950
197239
|
} catch (error) {
|
|
196951
|
-
if (
|
|
197240
|
+
if (isEnoent(error)) return false;
|
|
196952
197241
|
throw error;
|
|
196953
197242
|
}
|
|
196954
197243
|
}
|
|
@@ -197129,7 +197418,7 @@ async function relocateBoardBoundUnboundRunsInBook(bookDirectory) {
|
|
|
197129
197418
|
try {
|
|
197130
197419
|
entries = await readdir7(unboundRuns, { withFileTypes: true });
|
|
197131
197420
|
} catch (error) {
|
|
197132
|
-
if (
|
|
197421
|
+
if (isEnoent(error)) return [];
|
|
197133
197422
|
throw error;
|
|
197134
197423
|
}
|
|
197135
197424
|
const planned = [];
|