@akagilnc/pi-workflow-roles 0.1.5289 → 0.1.5301
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/README.zh-CN.md +7 -3
- package/dist/acp-host/production-host.js +97 -462
- package/dist/diarist-contracts.js +20 -96
- package/dist/headless-host/production-host.js +97 -462
- package/dist/migrate-book-topology.js +75 -77
- package/dist/public-cli/countersign-run.js +3 -124
- package/dist/public-cli/instruction-seat-run.js +5 -97
- package/dist/public-cli/invocation.js +0 -33
- package/dist/public-cli/main.js +10 -362
- package/dist/public-cli/post-admission.js +2 -14
- package/dist/public-cli/run-lifecycle.js +0 -85
- package/dist/public-role-summons.js +2 -2
- package/dist/ticket-provenance.js +25 -29
- package/package.json +1 -1
- package/resources/diarist-collect.md +4 -4
- package/src/diarist-contracts.ts +24 -116
- package/src/diarist-role.ts +39 -50
- package/src/diarist.ts +9 -29
- package/src/public-cli/countersign-run.ts +7 -184
- package/src/public-cli/instruction-seat-run.ts +6 -101
- package/src/public-cli/invocation.ts +2 -64
- package/src/public-cli/post-admission.ts +2 -15
- package/src/public-cli/run-lifecycle.ts +0 -117
- package/src/public-role-summons.ts +3 -3
- package/src/role-runtime.ts +13 -7
- package/src/ticket-provenance.ts +31 -44
|
@@ -1029,84 +1029,25 @@ var init_run_ticket_number = __esm({
|
|
|
1029
1029
|
});
|
|
1030
1030
|
|
|
1031
1031
|
// src/diarist-contracts.ts
|
|
1032
|
-
function projectCourtTicketNumbers(raw, options) {
|
|
1033
|
-
if (!Array.isArray(raw)) return null;
|
|
1034
|
-
const out = [];
|
|
1035
|
-
const seen = /* @__PURE__ */ new Set();
|
|
1036
|
-
for (const item of raw) {
|
|
1037
|
-
if (!isSafePositiveTicketNumber(item)) continue;
|
|
1038
|
-
if (seen.has(item)) continue;
|
|
1039
|
-
seen.add(item);
|
|
1040
|
-
out.push(item);
|
|
1041
|
-
}
|
|
1042
|
-
const principal = options?.principalTicket;
|
|
1043
|
-
if (principal === void 0) return out;
|
|
1044
|
-
requireSafePositiveTicketNumber(principal, "projectCourtTicketNumbers principalTicket");
|
|
1045
|
-
if (seen.has(principal)) return out;
|
|
1046
|
-
return [principal, ...out];
|
|
1047
|
-
}
|
|
1048
|
-
function interpretDurableCourtTicketNumbers(record4, options) {
|
|
1049
|
-
if (!Object.hasOwn(record4, "courtTicketNumbers")) {
|
|
1050
|
-
return { kind: "absent" };
|
|
1051
|
-
}
|
|
1052
|
-
const raw = record4.courtTicketNumbers;
|
|
1053
|
-
if (!Array.isArray(raw)) {
|
|
1054
|
-
return {
|
|
1055
|
-
kind: "damage",
|
|
1056
|
-
reason: "courtTicketNumbers is present but not an array"
|
|
1057
|
-
};
|
|
1058
|
-
}
|
|
1059
|
-
if (raw.length === 0) {
|
|
1060
|
-
return {
|
|
1061
|
-
kind: "damage",
|
|
1062
|
-
reason: "courtTicketNumbers is present but empty"
|
|
1063
|
-
};
|
|
1064
|
-
}
|
|
1065
|
-
for (let i = 0; i < raw.length; i += 1) {
|
|
1066
|
-
const item = raw[i];
|
|
1067
|
-
if (!isSafePositiveTicketNumber(item)) {
|
|
1068
|
-
return {
|
|
1069
|
-
kind: "damage",
|
|
1070
|
-
reason: `courtTicketNumbers[${i}] is not a safe positive integer`
|
|
1071
|
-
};
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
const tickets = projectCourtTicketNumbers(raw);
|
|
1075
|
-
if (tickets === null || tickets.length === 0) {
|
|
1076
|
-
return {
|
|
1077
|
-
kind: "damage",
|
|
1078
|
-
reason: "courtTicketNumbers projected empty after lawful members"
|
|
1079
|
-
};
|
|
1080
|
-
}
|
|
1081
|
-
const principal = options?.principalTicket;
|
|
1082
|
-
if (principal !== void 0) {
|
|
1083
|
-
if (!isSafePositiveTicketNumber(principal)) {
|
|
1084
|
-
return {
|
|
1085
|
-
kind: "damage",
|
|
1086
|
-
reason: "courtTicketNumbers principal ticket is not a safe positive integer"
|
|
1087
|
-
};
|
|
1088
|
-
}
|
|
1089
|
-
if (!tickets.includes(principal)) {
|
|
1090
|
-
return {
|
|
1091
|
-
kind: "damage",
|
|
1092
|
-
reason: `courtTicketNumbers is missing principal ticket #${principal}`
|
|
1093
|
-
};
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
return { kind: "ok", tickets: Object.freeze([...tickets]) };
|
|
1097
|
-
}
|
|
1098
|
-
function sameCourtTicketNumbers(left, right) {
|
|
1099
|
-
if (left.length !== right.length) return false;
|
|
1100
|
-
for (let i = 0; i < left.length; i += 1) {
|
|
1101
|
-
if (left[i] !== right[i]) return false;
|
|
1102
|
-
}
|
|
1103
|
-
return true;
|
|
1104
|
-
}
|
|
1105
1032
|
function projectDiaristSessions(value) {
|
|
1106
1033
|
const raw = value?.sessions;
|
|
1107
1034
|
if (raw === void 0) return [];
|
|
1108
1035
|
return projectTicketProvenanceSessions(raw);
|
|
1109
1036
|
}
|
|
1037
|
+
function projectDiaristTicketSessions(value) {
|
|
1038
|
+
const raw = value.ticketSessions;
|
|
1039
|
+
if (!Array.isArray(raw)) return void 0;
|
|
1040
|
+
const perTicket = /* @__PURE__ */ new Map();
|
|
1041
|
+
for (const entry of raw) {
|
|
1042
|
+
if (entry === null || typeof entry !== "object" || Array.isArray(entry)) return void 0;
|
|
1043
|
+
const { ticketNumber, sessions: rawSessions } = entry;
|
|
1044
|
+
if (!isSafePositiveTicketNumber(ticketNumber)) return void 0;
|
|
1045
|
+
const sessions = projectTicketProvenanceSessions(rawSessions);
|
|
1046
|
+
if (sessions === void 0) return void 0;
|
|
1047
|
+
perTicket.set(ticketNumber, [...perTicket.get(ticketNumber) ?? [], ...sessions]);
|
|
1048
|
+
}
|
|
1049
|
+
return Array.from(perTicket, ([ticketNumber, sessions]) => ({ ticketNumber, sessions }));
|
|
1050
|
+
}
|
|
1110
1051
|
var DIARIST_OUTPUT_TOOL_NAME;
|
|
1111
1052
|
var init_diarist_contracts = __esm({
|
|
1112
1053
|
"src/diarist-contracts.ts"() {
|
|
@@ -4888,42 +4829,37 @@ async function projectSessionRanges(input) {
|
|
|
4888
4829
|
}
|
|
4889
4830
|
return { entries };
|
|
4890
4831
|
}
|
|
4891
|
-
async function
|
|
4892
|
-
const
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4832
|
+
async function reprojectTicketProvenanceBatch(input) {
|
|
4833
|
+
const projections = [];
|
|
4834
|
+
for (const ticket of input.tickets) {
|
|
4835
|
+
const recordInput = ticketProvenanceRecordInput(
|
|
4836
|
+
ticket.ticketNumber,
|
|
4837
|
+
input.cwd,
|
|
4838
|
+
input.home,
|
|
4839
|
+
input.runDirectory
|
|
4840
|
+
);
|
|
4841
|
+
const entries = [];
|
|
4842
|
+
for (let s = 0; s < ticket.sessions.length; s += 1) {
|
|
4843
|
+
const projected = await projectSessionRanges({
|
|
4844
|
+
s,
|
|
4845
|
+
session: ticket.sessions[s],
|
|
4846
|
+
...input.home === void 0 ? {} : { home: input.home }
|
|
4847
|
+
});
|
|
4848
|
+
entries.push(...projected.entries);
|
|
4849
|
+
}
|
|
4850
|
+
projections.push({ ticket, recordInput, entries });
|
|
4904
4851
|
}
|
|
4905
|
-
const entries
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4852
|
+
for (const { ticket, recordInput, entries } of projections) {
|
|
4853
|
+
if (ticket.sessions.length === 0) continue;
|
|
4854
|
+
appendSitianRecord({
|
|
4855
|
+
...recordInput,
|
|
4856
|
+
payload: {
|
|
4857
|
+
type: "ticket-provenance-append",
|
|
4858
|
+
sessions: ticket.sessions,
|
|
4859
|
+
lines: entries
|
|
4860
|
+
}
|
|
4912
4861
|
});
|
|
4913
|
-
entries.push(...projected.entries);
|
|
4914
4862
|
}
|
|
4915
|
-
const pointer = appendSitianRecord({
|
|
4916
|
-
...recordInput,
|
|
4917
|
-
payload: {
|
|
4918
|
-
type: "ticket-provenance-append",
|
|
4919
|
-
sessions: input.sessions,
|
|
4920
|
-
lines: entries
|
|
4921
|
-
}
|
|
4922
|
-
});
|
|
4923
|
-
return {
|
|
4924
|
-
recordFile: pointer.recordFile,
|
|
4925
|
-
lines: entries.filter((entry) => "speaker" in entry)
|
|
4926
|
-
};
|
|
4927
4863
|
}
|
|
4928
4864
|
var TicketProvenanceInputError;
|
|
4929
4865
|
var init_ticket_provenance = __esm({
|
|
@@ -6410,43 +6346,6 @@ async function recordAdmittedCorrelation(admitted, correlationId) {
|
|
|
6410
6346
|
mutable.correlationId = correlationId;
|
|
6411
6347
|
mutable.correlationIds = correlationIds;
|
|
6412
6348
|
}
|
|
6413
|
-
async function bindCourtTicketNumbersOnAdmitted(admitted, courtTicketNumbers) {
|
|
6414
|
-
if (admitted.ticketNumber === void 0) {
|
|
6415
|
-
throw new Error(
|
|
6416
|
-
"bindCourtTicketNumbersOnAdmitted requires a bound principal ticketNumber"
|
|
6417
|
-
);
|
|
6418
|
-
}
|
|
6419
|
-
const principal = requireSafePositiveTicketNumber(
|
|
6420
|
-
admitted.ticketNumber,
|
|
6421
|
-
"bindCourtTicketNumbersOnAdmitted principal ticketNumber"
|
|
6422
|
-
);
|
|
6423
|
-
for (const item of courtTicketNumbers) {
|
|
6424
|
-
if (!isSafePositiveTicketNumber(item)) {
|
|
6425
|
-
throw new Error(
|
|
6426
|
-
`bindCourtTicketNumbersOnAdmitted requires safe positive integers, got ${String(item)}`
|
|
6427
|
-
);
|
|
6428
|
-
}
|
|
6429
|
-
}
|
|
6430
|
-
const projected = projectCourtTicketNumbers(courtTicketNumbers, {
|
|
6431
|
-
principalTicket: principal
|
|
6432
|
-
});
|
|
6433
|
-
if (projected === null || projected.length === 0) {
|
|
6434
|
-
throw new Error("bindCourtTicketNumbersOnAdmitted requires a non-empty ticket set");
|
|
6435
|
-
}
|
|
6436
|
-
const frozen = Object.freeze([...projected]);
|
|
6437
|
-
const admittedPath = admitted.admittedRequestPath;
|
|
6438
|
-
const current = JSON.parse(await readFile11(admittedPath, "utf8"));
|
|
6439
|
-
await writeFile3(
|
|
6440
|
-
admittedPath,
|
|
6441
|
-
`${JSON.stringify({ ...current, courtTicketNumbers: frozen }, null, 2)}
|
|
6442
|
-
`,
|
|
6443
|
-
"utf8"
|
|
6444
|
-
);
|
|
6445
|
-
await mergeInvocationIdentityPage(admitted.runDirectory, {
|
|
6446
|
-
courtTicketNumbers: frozen
|
|
6447
|
-
});
|
|
6448
|
-
admitted.courtTicketNumbers = frozen;
|
|
6449
|
-
}
|
|
6450
6349
|
async function relocateAdmittedRunToTicket(admitted, authority, heldLease) {
|
|
6451
6350
|
if (admitted.ticketNumber === void 0 || !admitted.runDirectory.includes(`${sep3}unbound${sep3}runs${sep3}`)) return void 0;
|
|
6452
6351
|
const oldRunDirectory = admitted.runDirectory;
|
|
@@ -7906,7 +7805,6 @@ var init_invocation = __esm({
|
|
|
7906
7805
|
init_run_ticket_number();
|
|
7907
7806
|
init_role_run_relocation();
|
|
7908
7807
|
init_doctor_evidence();
|
|
7909
|
-
init_diarist_contracts();
|
|
7910
7808
|
init_collector_config();
|
|
7911
7809
|
init_github_remote();
|
|
7912
7810
|
init_fixer_packet();
|
|
@@ -13085,9 +12983,6 @@ async function dispatchPostAdmissionTurn(input) {
|
|
|
13085
12983
|
io,
|
|
13086
12984
|
persistRunState
|
|
13087
12985
|
);
|
|
13088
|
-
if (error instanceof StationChildExhaustedError) {
|
|
13089
|
-
return { ...settled2, skipAutoResume: true, ...deferredPersist };
|
|
13090
|
-
}
|
|
13091
12986
|
return { ...settled2, ...deferredPersist };
|
|
13092
12987
|
}
|
|
13093
12988
|
}
|
|
@@ -13790,7 +13685,7 @@ async function runPostAdmissionManualResume(input) {
|
|
|
13790
13685
|
}
|
|
13791
13686
|
return result;
|
|
13792
13687
|
}
|
|
13793
|
-
var
|
|
13688
|
+
var POST_ADMISSION_CLEANUP_DIAGNOSTIC_ENTRY_TYPE;
|
|
13794
13689
|
var init_post_admission = __esm({
|
|
13795
13690
|
"src/public-cli/post-admission.ts"() {
|
|
13796
13691
|
"use strict";
|
|
@@ -13812,9 +13707,6 @@ var init_post_admission = __esm({
|
|
|
13812
13707
|
init_settlement();
|
|
13813
13708
|
init_terminal();
|
|
13814
13709
|
init_auto_resume();
|
|
13815
|
-
StationChildExhaustedError = class extends Error {
|
|
13816
|
-
name = "StationChildExhaustedError";
|
|
13817
|
-
};
|
|
13818
13710
|
POST_ADMISSION_CLEANUP_DIAGNOSTIC_ENTRY_TYPE = "ak_post_admission_cleanup_diagnostic";
|
|
13819
13711
|
}
|
|
13820
13712
|
});
|
|
@@ -14113,30 +14005,6 @@ function courtDiaristEscalateDiagnostic(roleOutcome, submissions) {
|
|
|
14113
14005
|
currentConclusion: escalatePayloads[escalatePayloads.length - 1]
|
|
14114
14006
|
})}`;
|
|
14115
14007
|
}
|
|
14116
|
-
function courtTicketNumbersFromOutcome(roleOutcome, principalTicket, submissions) {
|
|
14117
|
-
if (roleOutcome === void 0) return void 0;
|
|
14118
|
-
const payloads = courtDiaristPayloadRows(roleOutcome, submissions);
|
|
14119
|
-
let latest;
|
|
14120
|
-
for (const payload of payloads) {
|
|
14121
|
-
if (typeof payload !== "object" || payload === null || Array.isArray(payload)) {
|
|
14122
|
-
continue;
|
|
14123
|
-
}
|
|
14124
|
-
const record4 = payload;
|
|
14125
|
-
if (!Object.hasOwn(record4, "courtTicketNumbers")) continue;
|
|
14126
|
-
const raw = record4.courtTicketNumbers;
|
|
14127
|
-
if (!Array.isArray(raw)) continue;
|
|
14128
|
-
const members = projectCourtTicketNumbers(raw);
|
|
14129
|
-
if (members === null) continue;
|
|
14130
|
-
if (members.length === 0) {
|
|
14131
|
-
if (raw.length === 0) {
|
|
14132
|
-
latest = projectCourtTicketNumbers([], { principalTicket }) ?? void 0;
|
|
14133
|
-
}
|
|
14134
|
-
continue;
|
|
14135
|
-
}
|
|
14136
|
-
latest = projectCourtTicketNumbers(raw, { principalTicket }) ?? void 0;
|
|
14137
|
-
}
|
|
14138
|
-
return latest;
|
|
14139
|
-
}
|
|
14140
14008
|
function latestPayloadEscalated(roleOutcome) {
|
|
14141
14009
|
if (roleOutcome === void 0) return false;
|
|
14142
14010
|
if (roleOutcome.kind === "audit_escalation") return true;
|
|
@@ -14176,7 +14044,6 @@ async function invokeCourtDiarist(input, env, io) {
|
|
|
14176
14044
|
...env.credentials === void 0 ? {} : { credentials: env.credentials },
|
|
14177
14045
|
...env.signal === void 0 ? {} : { signal: env.signal },
|
|
14178
14046
|
...input.correlationId === void 0 ? {} : { correlationId: input.correlationId },
|
|
14179
|
-
...input.boundTicketNumber === void 0 ? {} : { boundTicketNumber: input.boundTicketNumber },
|
|
14180
14047
|
// Child seat selects from the composition-root table. Do not pass the
|
|
14181
14048
|
// already-selected parent adapter (#840 / ADR 0082: --host 旗标>席位配置>缺省 pi).
|
|
14182
14049
|
...env.hostAdapters === void 0 ? {} : { hostAdapters: env.hostAdapters }
|
|
@@ -14203,78 +14070,15 @@ async function invokeCourtDiarist(input, env, io) {
|
|
|
14203
14070
|
}
|
|
14204
14071
|
};
|
|
14205
14072
|
}
|
|
14206
|
-
const asserted = result.admitted?.ticketNumber;
|
|
14207
|
-
if (isSafePositiveTicketNumber(asserted)) {
|
|
14208
|
-
const courtTicketNumbers = courtTicketNumbersFromOutcome(
|
|
14209
|
-
roleOutcome,
|
|
14210
|
-
asserted,
|
|
14211
|
-
submissions
|
|
14212
|
-
);
|
|
14213
|
-
return {
|
|
14214
|
-
identity: {
|
|
14215
|
-
kind: "ticket",
|
|
14216
|
-
ticketNumber: asserted,
|
|
14217
|
-
...courtTicketNumbers === void 0 ? {} : { courtTicketNumbers }
|
|
14218
|
-
},
|
|
14219
|
-
...result.admitted === void 0 ? {} : { admitted: result.admitted }
|
|
14220
|
-
};
|
|
14221
|
-
}
|
|
14222
14073
|
return {
|
|
14223
14074
|
identity: { kind: "unbound" },
|
|
14224
14075
|
...result.admitted === void 0 ? {} : { admitted: result.admitted }
|
|
14225
14076
|
};
|
|
14226
14077
|
}
|
|
14227
|
-
async function runCountersignCourtDiaristStation(admitted, env, io, afterTicketNumber) {
|
|
14228
|
-
if (env.runCourtDiaristStation !== void 0) {
|
|
14229
|
-
await env.runCourtDiaristStation(admitted);
|
|
14230
|
-
return;
|
|
14231
|
-
}
|
|
14232
|
-
if (admitted.ticketNumber === void 0) return;
|
|
14233
|
-
let refreshTickets;
|
|
14234
|
-
if (admitted.courtTicketNumbers !== void 0) {
|
|
14235
|
-
if (admitted.courtTicketNumbers.length === 0 || !admitted.courtTicketNumbers.includes(admitted.ticketNumber)) {
|
|
14236
|
-
throw new StationChildExhaustedError(
|
|
14237
|
-
`court diarist station: courtTicketNumbers is damaged (empty or missing principal #${admitted.ticketNumber})`
|
|
14238
|
-
);
|
|
14239
|
-
}
|
|
14240
|
-
refreshTickets = admitted.courtTicketNumbers;
|
|
14241
|
-
} else {
|
|
14242
|
-
refreshTickets = [admitted.ticketNumber];
|
|
14243
|
-
}
|
|
14244
|
-
const completedIndex = afterTicketNumber === void 0 ? -1 : refreshTickets.indexOf(afterTicketNumber);
|
|
14245
|
-
for (const ticketNumber of refreshTickets.slice(completedIndex + 1)) {
|
|
14246
|
-
const outcome = await invokeCourtDiarist(
|
|
14247
|
-
{
|
|
14248
|
-
instruction: admitted.instruction,
|
|
14249
|
-
projectRoot: admitted.projectRoot,
|
|
14250
|
-
failureLabel: `ticket #${ticketNumber}`,
|
|
14251
|
-
correlationId: admitted.runId,
|
|
14252
|
-
// Refresh holds a typed key — hand it off so identity is bound before turn.
|
|
14253
|
-
boundTicketNumber: ticketNumber
|
|
14254
|
-
},
|
|
14255
|
-
env,
|
|
14256
|
-
io
|
|
14257
|
-
);
|
|
14258
|
-
if (outcome.failedWithoutEscalate !== void 0) {
|
|
14259
|
-
throw new StationChildExhaustedError(
|
|
14260
|
-
outcome.failedWithoutEscalate.diagnostic
|
|
14261
|
-
);
|
|
14262
|
-
}
|
|
14263
|
-
if (outcome.identity.kind === "escalate" && outcome.terminal !== void 0) {
|
|
14264
|
-
return {
|
|
14265
|
-
terminal: outcome.terminal,
|
|
14266
|
-
...outcome.admitted === void 0 ? {} : { childRunId: outcome.admitted.runId }
|
|
14267
|
-
};
|
|
14268
|
-
}
|
|
14269
|
-
}
|
|
14270
|
-
}
|
|
14271
14078
|
var init_countersign_run = __esm({
|
|
14272
14079
|
"src/public-cli/countersign-run.ts"() {
|
|
14273
14080
|
"use strict";
|
|
14274
|
-
init_diarist_contracts();
|
|
14275
14081
|
init_readable_gate_item();
|
|
14276
|
-
init_run_ticket_number();
|
|
14277
|
-
init_post_admission();
|
|
14278
14082
|
}
|
|
14279
14083
|
});
|
|
14280
14084
|
|
|
@@ -14561,84 +14365,14 @@ async function runCountersignBody(parsed, env, io) {
|
|
|
14561
14365
|
...ticketNumber === void 0 ? {} : { ticketNumber }
|
|
14562
14366
|
});
|
|
14563
14367
|
};
|
|
14564
|
-
|
|
14565
|
-
|
|
14566
|
-
|
|
14567
|
-
let childDiaristRunId;
|
|
14568
|
-
let pausedDiaristTerminal;
|
|
14569
|
-
if (gateParentRunPath === void 0 && env.runCourtDiaristStation === void 0) {
|
|
14570
|
-
let outcome;
|
|
14571
|
-
try {
|
|
14572
|
-
outcome = await invokeCourtDiarist({
|
|
14573
|
-
instruction: parsed.instruction ?? "",
|
|
14574
|
-
projectRoot: admitted.projectRoot,
|
|
14575
|
-
failureLabel: "unbound summons",
|
|
14576
|
-
correlationId: admitted.runId,
|
|
14577
|
-
...env.boundTicketNumber === void 0 ? {} : { boundTicketNumber: env.boundTicketNumber }
|
|
14578
|
-
}, env, io);
|
|
14579
|
-
} catch (error) {
|
|
14580
|
-
await materializeAdmission(
|
|
14581
|
-
isSafePositiveTicketNumber(env.boundTicketNumber) ? env.boundTicketNumber : void 0
|
|
14582
|
-
);
|
|
14583
|
-
await markRunAdmitted(admitted, env.principalAuthority);
|
|
14584
|
-
return await presentControlledFailure2(admitted, {
|
|
14585
|
-
timedOut: false,
|
|
14586
|
-
code: null,
|
|
14587
|
-
stderr: "",
|
|
14588
|
-
thrown: error
|
|
14589
|
-
}, seatAdapters(admitted, env), env.principalAuthority, io);
|
|
14590
|
-
}
|
|
14591
|
-
identityDiaristRan = true;
|
|
14592
|
-
if (outcome.identity.kind === "escalate") pausedDiaristTerminal = outcome.terminal;
|
|
14593
|
-
if (outcome.admitted?.runDirectory.includes(`${sep4}unbound${sep4}runs${sep4}`)) {
|
|
14594
|
-
childDiaristRunId = outcome.admitted.runId;
|
|
14595
|
-
}
|
|
14596
|
-
if (outcome.failedWithoutEscalate !== void 0) {
|
|
14597
|
-
const diagnostic = outcome.failedWithoutEscalate.diagnostic;
|
|
14598
|
-
await materializeAdmission(
|
|
14599
|
-
isSafePositiveTicketNumber(env.boundTicketNumber) ? env.boundTicketNumber : void 0
|
|
14600
|
-
);
|
|
14601
|
-
if (childDiaristRunId !== void 0) await recordChildDiaristRun(admitted, childDiaristRunId);
|
|
14602
|
-
await markRunAdmitted(admitted, env.principalAuthority);
|
|
14603
|
-
return await presentControlledFailure2(admitted, {
|
|
14604
|
-
timedOut: false,
|
|
14605
|
-
code: null,
|
|
14606
|
-
stderr: "",
|
|
14607
|
-
thrown: new Error(diagnostic)
|
|
14608
|
-
}, seatAdapters(admitted, env), env.principalAuthority, io);
|
|
14609
|
-
}
|
|
14610
|
-
if (outcome.identity.kind === "ticket") {
|
|
14611
|
-
typedTicket = outcome.identity.ticketNumber;
|
|
14612
|
-
typedCourtTicketNumbers = outcome.identity.courtTicketNumbers;
|
|
14613
|
-
}
|
|
14614
|
-
}
|
|
14615
|
-
await materializeAdmission(typedTicket);
|
|
14368
|
+
await materializeAdmission(
|
|
14369
|
+
isSafePositiveTicketNumber(env.boundTicketNumber) ? env.boundTicketNumber : void 0
|
|
14370
|
+
);
|
|
14616
14371
|
await markRunAdmitted(admitted, env.principalAuthority);
|
|
14617
|
-
if (childDiaristRunId !== void 0) {
|
|
14618
|
-
await recordChildDiaristRun(admitted, childDiaristRunId);
|
|
14619
|
-
}
|
|
14620
|
-
if (pausedDiaristTerminal !== void 0) {
|
|
14621
|
-
io.stdout(formatTerminalResult(pausedDiaristTerminal));
|
|
14622
|
-
return { exitCode: 0, admitted, terminal: pausedDiaristTerminal };
|
|
14623
|
-
}
|
|
14624
14372
|
if (gateParentRunPath !== void 0) {
|
|
14625
14373
|
await persistAdmittedSourceRunPath(admitted, gateParentRunPath);
|
|
14626
14374
|
admitted = { ...admitted, sourceRunPath: gateParentRunPath };
|
|
14627
14375
|
}
|
|
14628
|
-
if (identityDiaristRan && typedTicket !== void 0) {
|
|
14629
|
-
try {
|
|
14630
|
-
await bindAdmittedTicketNumber(admitted, typedTicket);
|
|
14631
|
-
await relocateAdmittedRunToTicket(admitted, env.principalAuthority);
|
|
14632
|
-
await bindCourtTicketNumbersOnAdmitted(admitted, typedCourtTicketNumbers ?? [typedTicket]);
|
|
14633
|
-
} catch (error) {
|
|
14634
|
-
return await presentControlledFailure2(admitted, {
|
|
14635
|
-
timedOut: false,
|
|
14636
|
-
code: null,
|
|
14637
|
-
stderr: "",
|
|
14638
|
-
thrown: error
|
|
14639
|
-
}, seatAdapters(admitted, env), env.principalAuthority, io);
|
|
14640
|
-
}
|
|
14641
|
-
}
|
|
14642
14376
|
const turnProjection = {
|
|
14643
14377
|
packageRoot: env.packageRoot,
|
|
14644
14378
|
home: env.home,
|
|
@@ -14668,13 +14402,6 @@ async function runCountersignBody(parsed, env, io) {
|
|
|
14668
14402
|
...seatAdapters(admitted, env),
|
|
14669
14403
|
beforeDispatch: async (admittedSeat, lease) => {
|
|
14670
14404
|
if (!packagedAdmitsCountersign(admittedSeat.role)) return;
|
|
14671
|
-
if (!identityDiaristRan || typedTicket !== void 0) {
|
|
14672
|
-
const refresh = await runCountersignCourtDiaristStation(admittedSeat, env, io);
|
|
14673
|
-
if (refresh !== void 0) {
|
|
14674
|
-
io.stdout(formatTerminalResult(refresh.terminal));
|
|
14675
|
-
return refresh.terminal;
|
|
14676
|
-
}
|
|
14677
|
-
}
|
|
14678
14405
|
await relocateAdmittedRunToTicket(admittedSeat, env.principalAuthority, lease);
|
|
14679
14406
|
Object.assign(turnRequest, buildInstructionSeatTurnRequest(admittedSeat, turnProjection));
|
|
14680
14407
|
}
|
|
@@ -15006,13 +14733,6 @@ async function continueParentAfterChild(parentRunId, child, env, io) {
|
|
|
15006
14733
|
return runPublicInstructionSeatResume({ runId: parentRunId }, env, io);
|
|
15007
14734
|
}
|
|
15008
14735
|
const admitted = loaded.admitted;
|
|
15009
|
-
if (admitted.role === "countersign" && admitted.ticketNumber !== void 0 && child.role === "diarist") {
|
|
15010
|
-
const refresh = await runCountersignCourtDiaristStation(admitted, env, io, child.ticketNumber);
|
|
15011
|
-
if (refresh !== void 0) {
|
|
15012
|
-
io.stdout(formatTerminalResult(refresh.terminal));
|
|
15013
|
-
return { exitCode: 0, admitted, terminal: refresh.terminal };
|
|
15014
|
-
}
|
|
15015
|
-
}
|
|
15016
14736
|
const resolved = await queueConclusionFromChild(child, env, io);
|
|
15017
14737
|
if (resolved !== void 0 && "stop" in resolved) return resolved.stop;
|
|
15018
14738
|
if (resolved !== void 0 && resolved.status === "escalate") {
|
|
@@ -18579,8 +18299,8 @@ async function summonPublicRole(options) {
|
|
|
18579
18299
|
// Nested court stations keep station-child semantics; dual-lens
|
|
18580
18300
|
// ordinary Reviewer axes opt out (#946 / ADR 0082).
|
|
18581
18301
|
...options.stationChild === false ? {} : { stationChild: true },
|
|
18582
|
-
// Forward composition-root adapters so nested
|
|
18583
|
-
//
|
|
18302
|
+
// Forward composition-root adapters so nested stations (e.g.
|
|
18303
|
+
// secretariat → diarist) select the same faux/production table (#924).
|
|
18584
18304
|
...options.hostAdapters === void 0 ? {} : { hostAdapters: options.hostAdapters },
|
|
18585
18305
|
...config.autoResumeLimit === void 0 ? {} : { autoResumeLimit: config.autoResumeLimit },
|
|
18586
18306
|
...options.signal === void 0 ? {} : { signal: options.signal },
|
|
@@ -18864,10 +18584,10 @@ async function summonGateOfficer(options) {
|
|
|
18864
18584
|
);
|
|
18865
18585
|
}
|
|
18866
18586
|
const correlationId = parentRunId;
|
|
18867
|
-
const { isSafePositiveTicketNumber:
|
|
18587
|
+
const { isSafePositiveTicketNumber: isSafePositiveTicketNumber3, readBoardTicketNumber: readBoardTicketNumber2 } = await Promise.resolve().then(() => (init_run_ticket_number(), run_ticket_number_exports));
|
|
18868
18588
|
const parentTicket = await readBoardTicketNumber2(options.sourceRunDirectory);
|
|
18869
18589
|
const submittedTicket = options.submission !== null && typeof options.submission === "object" && !Array.isArray(options.submission) ? options.submission.ticketNumber : void 0;
|
|
18870
|
-
const courtTicket =
|
|
18590
|
+
const courtTicket = isSafePositiveTicketNumber3(submittedTicket) ? submittedTicket : parentTicket;
|
|
18871
18591
|
const instruction = options.reask ?? gateReviewInstruction ?? "";
|
|
18872
18592
|
return summonPublicRole({
|
|
18873
18593
|
role: options.officer,
|
|
@@ -19759,52 +19479,10 @@ function parsePersistedTicketIdentity(record4) {
|
|
|
19759
19479
|
...ticketNumber === void 0 ? {} : { ticketNumber }
|
|
19760
19480
|
};
|
|
19761
19481
|
}
|
|
19762
|
-
function readDurableCourtTicketNumbersPage(record4, principalTicket, pageLabel) {
|
|
19763
|
-
const interpreted = interpretDurableCourtTicketNumbers(record4, {
|
|
19764
|
-
...principalTicket === void 0 ? {} : { principalTicket }
|
|
19765
|
-
});
|
|
19766
|
-
if (interpreted.kind === "damage") {
|
|
19767
|
-
return {
|
|
19768
|
-
kind: "damage",
|
|
19769
|
-
reason: `role run ${pageLabel} courtTicketNumbers is damaged: ${interpreted.reason}`
|
|
19770
|
-
};
|
|
19771
|
-
}
|
|
19772
|
-
if (interpreted.kind === "ok") {
|
|
19773
|
-
return { kind: "ok", tickets: interpreted.tickets };
|
|
19774
|
-
}
|
|
19775
|
-
return { kind: "absent" };
|
|
19776
|
-
}
|
|
19777
|
-
function mergeDurableCourtTicketNumbers(input) {
|
|
19778
|
-
const fromAdmitted = input.admittedRecord === void 0 ? { kind: "absent" } : readDurableCourtTicketNumbersPage(
|
|
19779
|
-
input.admittedRecord,
|
|
19780
|
-
input.principalTicket,
|
|
19781
|
-
"admitted-request"
|
|
19782
|
-
);
|
|
19783
|
-
const fromInvocation = input.invocationRecord === void 0 ? { kind: "absent" } : readDurableCourtTicketNumbersPage(
|
|
19784
|
-
input.invocationRecord,
|
|
19785
|
-
input.principalTicket,
|
|
19786
|
-
"invocation"
|
|
19787
|
-
);
|
|
19788
|
-
if (fromAdmitted.kind === "damage") return fromAdmitted;
|
|
19789
|
-
if (fromInvocation.kind === "damage") return fromInvocation;
|
|
19790
|
-
if (fromAdmitted.kind === "ok" && fromInvocation.kind === "ok") {
|
|
19791
|
-
if (!sameCourtTicketNumbers(fromAdmitted.tickets, fromInvocation.tickets)) {
|
|
19792
|
-
return {
|
|
19793
|
-
kind: "damage",
|
|
19794
|
-
reason: "role run courtTicketNumbers differs between admitted-request and invocation"
|
|
19795
|
-
};
|
|
19796
|
-
}
|
|
19797
|
-
return { kind: "ok", tickets: fromAdmitted.tickets };
|
|
19798
|
-
}
|
|
19799
|
-
if (fromAdmitted.kind === "ok") return { kind: "ok", tickets: fromAdmitted.tickets };
|
|
19800
|
-
if (fromInvocation.kind === "ok") return { kind: "ok", tickets: fromInvocation.tickets };
|
|
19801
|
-
return { kind: "ok" };
|
|
19802
|
-
}
|
|
19803
19482
|
function restoredTicketFields(fields) {
|
|
19804
19483
|
return {
|
|
19805
19484
|
...fields.correlationId === void 0 ? {} : { correlationId: fields.correlationId },
|
|
19806
|
-
...fields.ticketNumber === void 0 ? {} : { ticketNumber: fields.ticketNumber }
|
|
19807
|
-
...fields.courtTicketNumbers === void 0 ? {} : { courtTicketNumbers: fields.courtTicketNumbers }
|
|
19485
|
+
...fields.ticketNumber === void 0 ? {} : { ticketNumber: fields.ticketNumber }
|
|
19808
19486
|
};
|
|
19809
19487
|
}
|
|
19810
19488
|
async function loadResumableRunRecord(home, runId, authority) {
|
|
@@ -19836,10 +19514,6 @@ async function loadResumableRunRecord(home, runId, authority) {
|
|
|
19836
19514
|
let derived;
|
|
19837
19515
|
let correlationId;
|
|
19838
19516
|
let ticketNumber;
|
|
19839
|
-
let courtTicketNumbers;
|
|
19840
|
-
let courtTicketNumbersDamage;
|
|
19841
|
-
let admittedIdentityRecord;
|
|
19842
|
-
let invocationIdentityRecord;
|
|
19843
19517
|
let prNumber;
|
|
19844
19518
|
let repository;
|
|
19845
19519
|
let repositoryDisplay;
|
|
@@ -19961,7 +19635,6 @@ async function loadResumableRunRecord(home, runId, authority) {
|
|
|
19961
19635
|
};
|
|
19962
19636
|
}
|
|
19963
19637
|
}
|
|
19964
|
-
admittedIdentityRecord = record4;
|
|
19965
19638
|
const fromAdmitted = parsePersistedTicketIdentity(record4);
|
|
19966
19639
|
correlationId = fromAdmitted.correlationId;
|
|
19967
19640
|
ticketNumber = fromAdmitted.ticketNumber;
|
|
@@ -19980,7 +19653,6 @@ async function loadResumableRunRecord(home, runId, authority) {
|
|
|
19980
19653
|
);
|
|
19981
19654
|
if (invocationRaw !== null && typeof invocationRaw === "object" && !Array.isArray(invocationRaw)) {
|
|
19982
19655
|
const rec = invocationRaw;
|
|
19983
|
-
invocationIdentityRecord = rec;
|
|
19984
19656
|
if (typeof rec.provider === "string" && typeof rec.model === "string") {
|
|
19985
19657
|
model = {
|
|
19986
19658
|
provider: rec.provider,
|
|
@@ -20005,16 +19677,6 @@ async function loadResumableRunRecord(home, runId, authority) {
|
|
|
20005
19677
|
);
|
|
20006
19678
|
}
|
|
20007
19679
|
}
|
|
20008
|
-
const mergedSet = mergeDurableCourtTicketNumbers({
|
|
20009
|
-
admittedRecord: admittedIdentityRecord,
|
|
20010
|
-
invocationRecord: invocationIdentityRecord,
|
|
20011
|
-
principalTicket: ticketNumber
|
|
20012
|
-
});
|
|
20013
|
-
if (mergedSet.kind === "damage") {
|
|
20014
|
-
courtTicketNumbersDamage = mergedSet.reason;
|
|
20015
|
-
} else if (mergedSet.tickets !== void 0) {
|
|
20016
|
-
courtTicketNumbers = mergedSet.tickets;
|
|
20017
|
-
}
|
|
20018
19680
|
const sourceRunLeaf = basename9(sourceRunPath ?? "").split("@");
|
|
20019
19681
|
const referencedRunId = sourceRun?.runId ?? sourceRunLeaf[0];
|
|
20020
19682
|
const referencedRole = sourceRun?.role ?? sourceRunLeaf[1];
|
|
@@ -20052,8 +19714,6 @@ async function loadResumableRunRecord(home, runId, authority) {
|
|
|
20052
19714
|
...derived === void 0 ? {} : { derived },
|
|
20053
19715
|
...correlationId === void 0 ? {} : { correlationId },
|
|
20054
19716
|
...ticketNumber === void 0 ? {} : { ticketNumber },
|
|
20055
|
-
...courtTicketNumbers === void 0 ? {} : { courtTicketNumbers },
|
|
20056
|
-
...courtTicketNumbersDamage === void 0 ? {} : { courtTicketNumbersDamage },
|
|
20057
19717
|
...prNumber === void 0 ? {} : { prNumber },
|
|
20058
19718
|
...repository === void 0 ? {} : { repository },
|
|
20059
19719
|
...repositoryDisplay === void 0 ? {} : { repositoryDisplay },
|
|
@@ -20128,9 +19788,7 @@ function admitResumedRole(loaded) {
|
|
|
20128
19788
|
case "court-materials": {
|
|
20129
19789
|
const admitted = {
|
|
20130
19790
|
role: "countersign",
|
|
20131
|
-
...base
|
|
20132
|
-
...base.courtTicketNumbers === void 0 ? {} : { courtTicketNumbers: base.courtTicketNumbers },
|
|
20133
|
-
...fields.courtTicketNumbersDamage === void 0 ? {} : { courtTicketNumbersDamage: fields.courtTicketNumbersDamage }
|
|
19791
|
+
...base
|
|
20134
19792
|
};
|
|
20135
19793
|
return admitted;
|
|
20136
19794
|
}
|
|
@@ -20337,7 +19995,6 @@ var init_run_lifecycle = __esm({
|
|
|
20337
19995
|
init_typed_provider_http();
|
|
20338
19996
|
init_typed_provider_http();
|
|
20339
19997
|
init_collector_config();
|
|
20340
|
-
init_diarist_contracts();
|
|
20341
19998
|
init_role_run_relocation();
|
|
20342
19999
|
init_engine_material();
|
|
20343
20000
|
init_packaged_role_registry();
|
|
@@ -21877,6 +21534,37 @@ init_terminating_infrastructure();
|
|
|
21877
21534
|
init_diarist_contracts();
|
|
21878
21535
|
init_diarist_contracts();
|
|
21879
21536
|
import { Type as Type16 } from "typebox";
|
|
21537
|
+
var diaristSessionsSchema = Type16.Array(
|
|
21538
|
+
Type16.Object(
|
|
21539
|
+
{
|
|
21540
|
+
path: Type16.Optional(Type16.String({ description: "\u4F1A\u8BDD\u5377\u7EDD\u5BF9\u6216\u53EF\u8BFB\u8DEF\u5F84" })),
|
|
21541
|
+
ranges: Type16.Optional(
|
|
21542
|
+
Type16.Array(
|
|
21543
|
+
Type16.Object(
|
|
21544
|
+
{
|
|
21545
|
+
from: Type16.Optional(
|
|
21546
|
+
Type16.Object(
|
|
21547
|
+
{ id: Type16.Optional(Type16.String()), line: Type16.Optional(Type16.Unknown()) },
|
|
21548
|
+
{ additionalProperties: true, description: "\u8D77\u70B9\uFF1A\u539F\u751F id \u6216\u672C\u8F6E\u884C\u53F7\u4E8C\u9009\u4E00" }
|
|
21549
|
+
)
|
|
21550
|
+
),
|
|
21551
|
+
to: Type16.Optional(
|
|
21552
|
+
Type16.Object(
|
|
21553
|
+
{ id: Type16.Optional(Type16.String()), line: Type16.Optional(Type16.Unknown()) },
|
|
21554
|
+
{ additionalProperties: true, description: "\u7EC8\u70B9\uFF1A\u539F\u751F id \u6216\u672C\u8F6E\u884C\u53F7\u4E8C\u9009\u4E00" }
|
|
21555
|
+
)
|
|
21556
|
+
)
|
|
21557
|
+
},
|
|
21558
|
+
{ additionalProperties: true, description: "\u4E00\u6BB5\u5BF9\u8BDD\u533A\u95F4" }
|
|
21559
|
+
),
|
|
21560
|
+
{ description: "\u672C\u5377\u672C\u8F6E\u5404\u533A\u95F4\uFF1B\u81F3\u5C11\u4E00\u6BB5" }
|
|
21561
|
+
)
|
|
21562
|
+
)
|
|
21563
|
+
},
|
|
21564
|
+
{ additionalProperties: true, description: "\u4E00\u5377\u4F1A\u8BDD\u7684\u8FB9\u754C" }
|
|
21565
|
+
),
|
|
21566
|
+
{ description: "\u5BF9\u8BDD\u8FB9\u754C\uFF1B\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" }
|
|
21567
|
+
);
|
|
21880
21568
|
var diaristOutputSchema = withTerminatingOutputDeclarations(
|
|
21881
21569
|
openToolObject(
|
|
21882
21570
|
Type16.Object({
|
|
@@ -21888,63 +21576,22 @@ var diaristOutputSchema = withTerminatingOutputDeclarations(
|
|
|
21888
21576
|
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"
|
|
21889
21577
|
})
|
|
21890
21578
|
),
|
|
21891
|
-
courtTicketNumbers: Type16.Optional(
|
|
21892
|
-
Type16.Unknown({
|
|
21893
|
-
description: "#871 \u672C\u6B21\u5408\u5BA1\u5E94\u5404\u81EA\u6210\u5F55\u7684\u7968\u53F7\u96C6\u5408\uFF08\u6B63\u6574\u6570\u6570\u7EC4\uFF0C\u542B\u4E3B\u7968\uFF09\uFF1B\u5355\u7968\u53EF\u7701\u7565\u3002\u673A\u68B0\u5C42\u53EA\u505A\u7C7B\u578B/\u53BB\u91CD\u6295\u5F71\uFF0C\u4E0D\u4ECE\u6563\u6587\u731C\u7968\u3002"
|
|
21894
|
-
})
|
|
21895
|
-
),
|
|
21896
21579
|
reason: Type16.Optional(
|
|
21897
21580
|
Type16.String({
|
|
21898
21581
|
description: "status \u4E3A escalate \u65F6\uFF1A\u8BA4\u4E0D\u51FA\u672C\u5EAD\u5BF9\u8C61\u7684\u539F\u56E0"
|
|
21899
21582
|
})
|
|
21900
21583
|
),
|
|
21901
|
-
sessions: Type16.Optional(
|
|
21584
|
+
sessions: Type16.Optional(diaristSessionsSchema),
|
|
21585
|
+
ticketSessions: Type16.Optional(
|
|
21902
21586
|
Type16.Array(
|
|
21903
21587
|
Type16.Object(
|
|
21904
21588
|
{
|
|
21905
|
-
|
|
21906
|
-
|
|
21907
|
-
),
|
|
21908
|
-
ranges: Type16.Optional(
|
|
21909
|
-
Type16.Array(
|
|
21910
|
-
Type16.Object(
|
|
21911
|
-
{
|
|
21912
|
-
from: Type16.Optional(
|
|
21913
|
-
Type16.Object(
|
|
21914
|
-
{
|
|
21915
|
-
id: Type16.Optional(Type16.String()),
|
|
21916
|
-
line: Type16.Optional(Type16.Unknown())
|
|
21917
|
-
},
|
|
21918
|
-
{
|
|
21919
|
-
additionalProperties: true,
|
|
21920
|
-
description: "\u8D77\u70B9\uFF1A\u539F\u751F id \u6216\u672C\u8F6E\u884C\u53F7\u4E8C\u9009\u4E00"
|
|
21921
|
-
}
|
|
21922
|
-
)
|
|
21923
|
-
),
|
|
21924
|
-
to: Type16.Optional(
|
|
21925
|
-
Type16.Object(
|
|
21926
|
-
{
|
|
21927
|
-
id: Type16.Optional(Type16.String()),
|
|
21928
|
-
line: Type16.Optional(Type16.Unknown())
|
|
21929
|
-
},
|
|
21930
|
-
{
|
|
21931
|
-
additionalProperties: true,
|
|
21932
|
-
description: "\u7EC8\u70B9\uFF1A\u539F\u751F id \u6216\u672C\u8F6E\u884C\u53F7\u4E8C\u9009\u4E00"
|
|
21933
|
-
}
|
|
21934
|
-
)
|
|
21935
|
-
)
|
|
21936
|
-
},
|
|
21937
|
-
{ additionalProperties: true, description: "\u4E00\u6BB5\u5BF9\u8BDD\u533A\u95F4" }
|
|
21938
|
-
),
|
|
21939
|
-
{ description: "\u672C\u5377\u672C\u8F6E\u5404\u533A\u95F4\uFF1B\u81F3\u5C11\u4E00\u6BB5" }
|
|
21940
|
-
)
|
|
21941
|
-
)
|
|
21589
|
+
ticketNumber: Type16.Unknown({ description: "\u672C\u6761\u8FB9\u754C\u6240\u5F52\u7968\u53F7\uFF08\u6B63\u6574\u6570\uFF09" }),
|
|
21590
|
+
sessions: diaristSessionsSchema
|
|
21942
21591
|
},
|
|
21943
|
-
{ additionalProperties: true
|
|
21592
|
+
{ additionalProperties: true }
|
|
21944
21593
|
),
|
|
21945
|
-
{
|
|
21946
|
-
description: "\u672C\u7968\u5BF9\u8BDD\u8FB9\u754C\uFF1B\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"
|
|
21947
|
-
}
|
|
21594
|
+
{ description: "\u591A\u7968\u5EAD\u9010\u7968\u5BF9\u8BDD\u8FB9\u754C\uFF1B\u4E00\u6B21\u4EA4\u5377\u5404\u7968\u5404\u81EA\u5206\u5F55\u3002\u4E0E\u5355\u7968 sessions \u4E8C\u9009\u4E00\u3002" }
|
|
21948
21595
|
)
|
|
21949
21596
|
)
|
|
21950
21597
|
})
|
|
@@ -21953,7 +21600,7 @@ var diaristOutputSchema = withTerminatingOutputDeclarations(
|
|
|
21953
21600
|
var DIARIST_TOOL_SPEC = {
|
|
21954
21601
|
name: DIARIST_OUTPUT_TOOL_NAME,
|
|
21955
21602
|
label: "\u8D77\u5C45\u90CE\u8F93\u51FA",
|
|
21956
|
-
description: "\u8D77\u5C45\u90CE\u4EA4\
|
|
21603
|
+
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",
|
|
21957
21604
|
promptSnippet: "\u8D77\u5C45\u90CE\u4EA4\u8FB9\u754C",
|
|
21958
21605
|
parameters: diaristOutputSchema
|
|
21959
21606
|
};
|
|
@@ -22003,18 +21650,7 @@ init_diarist_contracts();
|
|
|
22003
21650
|
// src/diarist.ts
|
|
22004
21651
|
init_ticket_provenance();
|
|
22005
21652
|
async function commitDiaristProjection(input) {
|
|
22006
|
-
|
|
22007
|
-
ticketNumber: input.ticketNumber,
|
|
22008
|
-
cwd: input.cwd,
|
|
22009
|
-
...input.home === void 0 ? {} : { home: input.home },
|
|
22010
|
-
sessions: input.sessions,
|
|
22011
|
-
...input.runDirectory === void 0 ? {} : { runDirectory: input.runDirectory }
|
|
22012
|
-
});
|
|
22013
|
-
return {
|
|
22014
|
-
ticketNumber: input.ticketNumber,
|
|
22015
|
-
volumeRecordFile: result.recordFile,
|
|
22016
|
-
lineCount: result.lines.length
|
|
22017
|
-
};
|
|
21653
|
+
await reprojectTicketProvenanceBatch(input);
|
|
22018
21654
|
}
|
|
22019
21655
|
|
|
22020
21656
|
// src/role-runtime.ts
|
|
@@ -24122,7 +23758,7 @@ function readDiaristRunCoordinates(ctx) {
|
|
|
24122
23758
|
...bound === void 0 ? {} : { boundTicketNumber: bound }
|
|
24123
23759
|
};
|
|
24124
23760
|
}
|
|
24125
|
-
var DIARIST_BOUNDS_REASK = "\u8FB9\u754C\u65E0\u6CD5\u4F7F\u7528\u3002\u8BF7\u91CD\u4EA4 sessions\
|
|
23761
|
+
var DIARIST_BOUNDS_REASK = "\u8FB9\u754C\u65E0\u6CD5\u4F7F\u7528\u3002\u591A\u7968\u8BF7\u9010\u7968\u91CD\u4EA4 ticketSessions\uFF0C\u5355\u7968\u91CD\u4EA4 sessions\uFF1B\u6BCF\u5377 path + ranges\uFF0C\u6BCF\u7AEF\u4EE5\u539F\u751F id \u6216\u672C\u8F6E\u884C\u53F7\u4E8C\u9009\u4E00\u6307\u540D\u3002";
|
|
24126
23762
|
function createDiaristRoleRuntime(roleHost, dependencies) {
|
|
24127
23763
|
return createFiledOfficerRuntime(
|
|
24128
23764
|
roleHost,
|
|
@@ -24142,18 +23778,17 @@ function createDiaristRoleRuntime(roleHost, dependencies) {
|
|
|
24142
23778
|
await bindTicketNumberOnRunDirectory(coords.runDirectory, ticketNumber);
|
|
24143
23779
|
}
|
|
24144
23780
|
}
|
|
24145
|
-
const
|
|
24146
|
-
|
|
23781
|
+
const singleSessions = submitted && !Object.hasOwn(submitted, "ticketSessions") ? projectDiaristSessions(parameters) : void 0;
|
|
23782
|
+
const ticketSessions = submitted && Object.hasOwn(submitted, "ticketSessions") ? projectDiaristTicketSessions(submitted) : singleSessions === void 0 ? void 0 : [{ ticketNumber: ticketNumber ?? null, sessions: singleSessions }];
|
|
23783
|
+
if (ticketSessions === void 0) {
|
|
24147
23784
|
throw new ParentQueueReaskError(DIARIST_BOUNDS_REASK);
|
|
24148
23785
|
}
|
|
24149
|
-
let facts;
|
|
24150
23786
|
try {
|
|
24151
|
-
|
|
24152
|
-
ticketNumber: ticketNumber ?? null,
|
|
23787
|
+
await commitDiaristProjection({
|
|
24153
23788
|
cwd: coords.projectRoot,
|
|
24154
23789
|
home: coords.home,
|
|
24155
23790
|
runDirectory: coords.runDirectory,
|
|
24156
|
-
|
|
23791
|
+
tickets: ticketSessions
|
|
24157
23792
|
});
|
|
24158
23793
|
} catch (error) {
|
|
24159
23794
|
if (error instanceof ParentQueueReaskError) throw error;
|