@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
|
@@ -856,84 +856,25 @@ var init_run_ticket_number = __esm({
|
|
|
856
856
|
});
|
|
857
857
|
|
|
858
858
|
// src/diarist-contracts.ts
|
|
859
|
-
function projectCourtTicketNumbers(raw, options) {
|
|
860
|
-
if (!Array.isArray(raw)) return null;
|
|
861
|
-
const out = [];
|
|
862
|
-
const seen = /* @__PURE__ */ new Set();
|
|
863
|
-
for (const item of raw) {
|
|
864
|
-
if (!isSafePositiveTicketNumber(item)) continue;
|
|
865
|
-
if (seen.has(item)) continue;
|
|
866
|
-
seen.add(item);
|
|
867
|
-
out.push(item);
|
|
868
|
-
}
|
|
869
|
-
const principal = options?.principalTicket;
|
|
870
|
-
if (principal === void 0) return out;
|
|
871
|
-
requireSafePositiveTicketNumber(principal, "projectCourtTicketNumbers principalTicket");
|
|
872
|
-
if (seen.has(principal)) return out;
|
|
873
|
-
return [principal, ...out];
|
|
874
|
-
}
|
|
875
|
-
function interpretDurableCourtTicketNumbers(record4, options) {
|
|
876
|
-
if (!Object.hasOwn(record4, "courtTicketNumbers")) {
|
|
877
|
-
return { kind: "absent" };
|
|
878
|
-
}
|
|
879
|
-
const raw = record4.courtTicketNumbers;
|
|
880
|
-
if (!Array.isArray(raw)) {
|
|
881
|
-
return {
|
|
882
|
-
kind: "damage",
|
|
883
|
-
reason: "courtTicketNumbers is present but not an array"
|
|
884
|
-
};
|
|
885
|
-
}
|
|
886
|
-
if (raw.length === 0) {
|
|
887
|
-
return {
|
|
888
|
-
kind: "damage",
|
|
889
|
-
reason: "courtTicketNumbers is present but empty"
|
|
890
|
-
};
|
|
891
|
-
}
|
|
892
|
-
for (let i = 0; i < raw.length; i += 1) {
|
|
893
|
-
const item = raw[i];
|
|
894
|
-
if (!isSafePositiveTicketNumber(item)) {
|
|
895
|
-
return {
|
|
896
|
-
kind: "damage",
|
|
897
|
-
reason: `courtTicketNumbers[${i}] is not a safe positive integer`
|
|
898
|
-
};
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
const tickets = projectCourtTicketNumbers(raw);
|
|
902
|
-
if (tickets === null || tickets.length === 0) {
|
|
903
|
-
return {
|
|
904
|
-
kind: "damage",
|
|
905
|
-
reason: "courtTicketNumbers projected empty after lawful members"
|
|
906
|
-
};
|
|
907
|
-
}
|
|
908
|
-
const principal = options?.principalTicket;
|
|
909
|
-
if (principal !== void 0) {
|
|
910
|
-
if (!isSafePositiveTicketNumber(principal)) {
|
|
911
|
-
return {
|
|
912
|
-
kind: "damage",
|
|
913
|
-
reason: "courtTicketNumbers principal ticket is not a safe positive integer"
|
|
914
|
-
};
|
|
915
|
-
}
|
|
916
|
-
if (!tickets.includes(principal)) {
|
|
917
|
-
return {
|
|
918
|
-
kind: "damage",
|
|
919
|
-
reason: `courtTicketNumbers is missing principal ticket #${principal}`
|
|
920
|
-
};
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
return { kind: "ok", tickets: Object.freeze([...tickets]) };
|
|
924
|
-
}
|
|
925
|
-
function sameCourtTicketNumbers(left, right) {
|
|
926
|
-
if (left.length !== right.length) return false;
|
|
927
|
-
for (let i = 0; i < left.length; i += 1) {
|
|
928
|
-
if (left[i] !== right[i]) return false;
|
|
929
|
-
}
|
|
930
|
-
return true;
|
|
931
|
-
}
|
|
932
859
|
function projectDiaristSessions(value) {
|
|
933
860
|
const raw = value?.sessions;
|
|
934
861
|
if (raw === void 0) return [];
|
|
935
862
|
return projectTicketProvenanceSessions(raw);
|
|
936
863
|
}
|
|
864
|
+
function projectDiaristTicketSessions(value) {
|
|
865
|
+
const raw = value.ticketSessions;
|
|
866
|
+
if (!Array.isArray(raw)) return void 0;
|
|
867
|
+
const perTicket = /* @__PURE__ */ new Map();
|
|
868
|
+
for (const entry of raw) {
|
|
869
|
+
if (entry === null || typeof entry !== "object" || Array.isArray(entry)) return void 0;
|
|
870
|
+
const { ticketNumber, sessions: rawSessions } = entry;
|
|
871
|
+
if (!isSafePositiveTicketNumber(ticketNumber)) return void 0;
|
|
872
|
+
const sessions = projectTicketProvenanceSessions(rawSessions);
|
|
873
|
+
if (sessions === void 0) return void 0;
|
|
874
|
+
perTicket.set(ticketNumber, [...perTicket.get(ticketNumber) ?? [], ...sessions]);
|
|
875
|
+
}
|
|
876
|
+
return Array.from(perTicket, ([ticketNumber, sessions]) => ({ ticketNumber, sessions }));
|
|
877
|
+
}
|
|
937
878
|
var DIARIST_OUTPUT_TOOL_NAME;
|
|
938
879
|
var init_diarist_contracts = __esm({
|
|
939
880
|
"src/diarist-contracts.ts"() {
|
|
@@ -5768,42 +5709,37 @@ async function projectSessionRanges(input) {
|
|
|
5768
5709
|
}
|
|
5769
5710
|
return { entries };
|
|
5770
5711
|
}
|
|
5771
|
-
async function
|
|
5772
|
-
const
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5712
|
+
async function reprojectTicketProvenanceBatch(input) {
|
|
5713
|
+
const projections = [];
|
|
5714
|
+
for (const ticket of input.tickets) {
|
|
5715
|
+
const recordInput = ticketProvenanceRecordInput(
|
|
5716
|
+
ticket.ticketNumber,
|
|
5717
|
+
input.cwd,
|
|
5718
|
+
input.home,
|
|
5719
|
+
input.runDirectory
|
|
5720
|
+
);
|
|
5721
|
+
const entries = [];
|
|
5722
|
+
for (let s = 0; s < ticket.sessions.length; s += 1) {
|
|
5723
|
+
const projected = await projectSessionRanges({
|
|
5724
|
+
s,
|
|
5725
|
+
session: ticket.sessions[s],
|
|
5726
|
+
...input.home === void 0 ? {} : { home: input.home }
|
|
5727
|
+
});
|
|
5728
|
+
entries.push(...projected.entries);
|
|
5729
|
+
}
|
|
5730
|
+
projections.push({ ticket, recordInput, entries });
|
|
5784
5731
|
}
|
|
5785
|
-
const entries
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5732
|
+
for (const { ticket, recordInput, entries } of projections) {
|
|
5733
|
+
if (ticket.sessions.length === 0) continue;
|
|
5734
|
+
appendSitianRecord({
|
|
5735
|
+
...recordInput,
|
|
5736
|
+
payload: {
|
|
5737
|
+
type: "ticket-provenance-append",
|
|
5738
|
+
sessions: ticket.sessions,
|
|
5739
|
+
lines: entries
|
|
5740
|
+
}
|
|
5792
5741
|
});
|
|
5793
|
-
entries.push(...projected.entries);
|
|
5794
5742
|
}
|
|
5795
|
-
const pointer = appendSitianRecord({
|
|
5796
|
-
...recordInput,
|
|
5797
|
-
payload: {
|
|
5798
|
-
type: "ticket-provenance-append",
|
|
5799
|
-
sessions: input.sessions,
|
|
5800
|
-
lines: entries
|
|
5801
|
-
}
|
|
5802
|
-
});
|
|
5803
|
-
return {
|
|
5804
|
-
recordFile: pointer.recordFile,
|
|
5805
|
-
lines: entries.filter((entry) => "speaker" in entry)
|
|
5806
|
-
};
|
|
5807
5743
|
}
|
|
5808
5744
|
var TicketProvenanceInputError;
|
|
5809
5745
|
var init_ticket_provenance = __esm({
|
|
@@ -7191,43 +7127,6 @@ async function recordAdmittedCorrelation(admitted, correlationId) {
|
|
|
7191
7127
|
mutable.correlationId = correlationId;
|
|
7192
7128
|
mutable.correlationIds = correlationIds;
|
|
7193
7129
|
}
|
|
7194
|
-
async function bindCourtTicketNumbersOnAdmitted(admitted, courtTicketNumbers) {
|
|
7195
|
-
if (admitted.ticketNumber === void 0) {
|
|
7196
|
-
throw new Error(
|
|
7197
|
-
"bindCourtTicketNumbersOnAdmitted requires a bound principal ticketNumber"
|
|
7198
|
-
);
|
|
7199
|
-
}
|
|
7200
|
-
const principal = requireSafePositiveTicketNumber(
|
|
7201
|
-
admitted.ticketNumber,
|
|
7202
|
-
"bindCourtTicketNumbersOnAdmitted principal ticketNumber"
|
|
7203
|
-
);
|
|
7204
|
-
for (const item of courtTicketNumbers) {
|
|
7205
|
-
if (!isSafePositiveTicketNumber(item)) {
|
|
7206
|
-
throw new Error(
|
|
7207
|
-
`bindCourtTicketNumbersOnAdmitted requires safe positive integers, got ${String(item)}`
|
|
7208
|
-
);
|
|
7209
|
-
}
|
|
7210
|
-
}
|
|
7211
|
-
const projected = projectCourtTicketNumbers(courtTicketNumbers, {
|
|
7212
|
-
principalTicket: principal
|
|
7213
|
-
});
|
|
7214
|
-
if (projected === null || projected.length === 0) {
|
|
7215
|
-
throw new Error("bindCourtTicketNumbersOnAdmitted requires a non-empty ticket set");
|
|
7216
|
-
}
|
|
7217
|
-
const frozen = Object.freeze([...projected]);
|
|
7218
|
-
const admittedPath = admitted.admittedRequestPath;
|
|
7219
|
-
const current = JSON.parse(await readFile13(admittedPath, "utf8"));
|
|
7220
|
-
await writeFile5(
|
|
7221
|
-
admittedPath,
|
|
7222
|
-
`${JSON.stringify({ ...current, courtTicketNumbers: frozen }, null, 2)}
|
|
7223
|
-
`,
|
|
7224
|
-
"utf8"
|
|
7225
|
-
);
|
|
7226
|
-
await mergeInvocationIdentityPage(admitted.runDirectory, {
|
|
7227
|
-
courtTicketNumbers: frozen
|
|
7228
|
-
});
|
|
7229
|
-
admitted.courtTicketNumbers = frozen;
|
|
7230
|
-
}
|
|
7231
7130
|
async function relocateAdmittedRunToTicket(admitted, authority, heldLease) {
|
|
7232
7131
|
if (admitted.ticketNumber === void 0 || !admitted.runDirectory.includes(`${sep3}unbound${sep3}runs${sep3}`)) return void 0;
|
|
7233
7132
|
const oldRunDirectory = admitted.runDirectory;
|
|
@@ -8687,7 +8586,6 @@ var init_invocation = __esm({
|
|
|
8687
8586
|
init_run_ticket_number();
|
|
8688
8587
|
init_role_run_relocation();
|
|
8689
8588
|
init_doctor_evidence();
|
|
8690
|
-
init_diarist_contracts();
|
|
8691
8589
|
init_collector_config();
|
|
8692
8590
|
init_github_remote();
|
|
8693
8591
|
init_fixer_packet();
|
|
@@ -13505,9 +13403,6 @@ async function dispatchPostAdmissionTurn(input) {
|
|
|
13505
13403
|
io,
|
|
13506
13404
|
persistRunState
|
|
13507
13405
|
);
|
|
13508
|
-
if (error instanceof StationChildExhaustedError) {
|
|
13509
|
-
return { ...settled2, skipAutoResume: true, ...deferredPersist };
|
|
13510
|
-
}
|
|
13511
13406
|
return { ...settled2, ...deferredPersist };
|
|
13512
13407
|
}
|
|
13513
13408
|
}
|
|
@@ -14210,7 +14105,7 @@ async function runPostAdmissionManualResume(input) {
|
|
|
14210
14105
|
}
|
|
14211
14106
|
return result;
|
|
14212
14107
|
}
|
|
14213
|
-
var
|
|
14108
|
+
var POST_ADMISSION_CLEANUP_DIAGNOSTIC_ENTRY_TYPE;
|
|
14214
14109
|
var init_post_admission = __esm({
|
|
14215
14110
|
"src/public-cli/post-admission.ts"() {
|
|
14216
14111
|
"use strict";
|
|
@@ -14232,9 +14127,6 @@ var init_post_admission = __esm({
|
|
|
14232
14127
|
init_settlement();
|
|
14233
14128
|
init_terminal();
|
|
14234
14129
|
init_auto_resume();
|
|
14235
|
-
StationChildExhaustedError = class extends Error {
|
|
14236
|
-
name = "StationChildExhaustedError";
|
|
14237
|
-
};
|
|
14238
14130
|
POST_ADMISSION_CLEANUP_DIAGNOSTIC_ENTRY_TYPE = "ak_post_admission_cleanup_diagnostic";
|
|
14239
14131
|
}
|
|
14240
14132
|
});
|
|
@@ -14533,30 +14425,6 @@ function courtDiaristEscalateDiagnostic(roleOutcome, submissions) {
|
|
|
14533
14425
|
currentConclusion: escalatePayloads[escalatePayloads.length - 1]
|
|
14534
14426
|
})}`;
|
|
14535
14427
|
}
|
|
14536
|
-
function courtTicketNumbersFromOutcome(roleOutcome, principalTicket, submissions) {
|
|
14537
|
-
if (roleOutcome === void 0) return void 0;
|
|
14538
|
-
const payloads = courtDiaristPayloadRows(roleOutcome, submissions);
|
|
14539
|
-
let latest;
|
|
14540
|
-
for (const payload of payloads) {
|
|
14541
|
-
if (typeof payload !== "object" || payload === null || Array.isArray(payload)) {
|
|
14542
|
-
continue;
|
|
14543
|
-
}
|
|
14544
|
-
const record4 = payload;
|
|
14545
|
-
if (!Object.hasOwn(record4, "courtTicketNumbers")) continue;
|
|
14546
|
-
const raw = record4.courtTicketNumbers;
|
|
14547
|
-
if (!Array.isArray(raw)) continue;
|
|
14548
|
-
const members = projectCourtTicketNumbers(raw);
|
|
14549
|
-
if (members === null) continue;
|
|
14550
|
-
if (members.length === 0) {
|
|
14551
|
-
if (raw.length === 0) {
|
|
14552
|
-
latest = projectCourtTicketNumbers([], { principalTicket }) ?? void 0;
|
|
14553
|
-
}
|
|
14554
|
-
continue;
|
|
14555
|
-
}
|
|
14556
|
-
latest = projectCourtTicketNumbers(raw, { principalTicket }) ?? void 0;
|
|
14557
|
-
}
|
|
14558
|
-
return latest;
|
|
14559
|
-
}
|
|
14560
14428
|
function latestPayloadEscalated(roleOutcome) {
|
|
14561
14429
|
if (roleOutcome === void 0) return false;
|
|
14562
14430
|
if (roleOutcome.kind === "audit_escalation") return true;
|
|
@@ -14596,7 +14464,6 @@ async function invokeCourtDiarist(input, env, io) {
|
|
|
14596
14464
|
...env.credentials === void 0 ? {} : { credentials: env.credentials },
|
|
14597
14465
|
...env.signal === void 0 ? {} : { signal: env.signal },
|
|
14598
14466
|
...input.correlationId === void 0 ? {} : { correlationId: input.correlationId },
|
|
14599
|
-
...input.boundTicketNumber === void 0 ? {} : { boundTicketNumber: input.boundTicketNumber },
|
|
14600
14467
|
// Child seat selects from the composition-root table. Do not pass the
|
|
14601
14468
|
// already-selected parent adapter (#840 / ADR 0082: --host 旗标>席位配置>缺省 pi).
|
|
14602
14469
|
...env.hostAdapters === void 0 ? {} : { hostAdapters: env.hostAdapters }
|
|
@@ -14623,78 +14490,15 @@ async function invokeCourtDiarist(input, env, io) {
|
|
|
14623
14490
|
}
|
|
14624
14491
|
};
|
|
14625
14492
|
}
|
|
14626
|
-
const asserted = result.admitted?.ticketNumber;
|
|
14627
|
-
if (isSafePositiveTicketNumber(asserted)) {
|
|
14628
|
-
const courtTicketNumbers = courtTicketNumbersFromOutcome(
|
|
14629
|
-
roleOutcome,
|
|
14630
|
-
asserted,
|
|
14631
|
-
submissions
|
|
14632
|
-
);
|
|
14633
|
-
return {
|
|
14634
|
-
identity: {
|
|
14635
|
-
kind: "ticket",
|
|
14636
|
-
ticketNumber: asserted,
|
|
14637
|
-
...courtTicketNumbers === void 0 ? {} : { courtTicketNumbers }
|
|
14638
|
-
},
|
|
14639
|
-
...result.admitted === void 0 ? {} : { admitted: result.admitted }
|
|
14640
|
-
};
|
|
14641
|
-
}
|
|
14642
14493
|
return {
|
|
14643
14494
|
identity: { kind: "unbound" },
|
|
14644
14495
|
...result.admitted === void 0 ? {} : { admitted: result.admitted }
|
|
14645
14496
|
};
|
|
14646
14497
|
}
|
|
14647
|
-
async function runCountersignCourtDiaristStation(admitted, env, io, afterTicketNumber) {
|
|
14648
|
-
if (env.runCourtDiaristStation !== void 0) {
|
|
14649
|
-
await env.runCourtDiaristStation(admitted);
|
|
14650
|
-
return;
|
|
14651
|
-
}
|
|
14652
|
-
if (admitted.ticketNumber === void 0) return;
|
|
14653
|
-
let refreshTickets;
|
|
14654
|
-
if (admitted.courtTicketNumbers !== void 0) {
|
|
14655
|
-
if (admitted.courtTicketNumbers.length === 0 || !admitted.courtTicketNumbers.includes(admitted.ticketNumber)) {
|
|
14656
|
-
throw new StationChildExhaustedError(
|
|
14657
|
-
`court diarist station: courtTicketNumbers is damaged (empty or missing principal #${admitted.ticketNumber})`
|
|
14658
|
-
);
|
|
14659
|
-
}
|
|
14660
|
-
refreshTickets = admitted.courtTicketNumbers;
|
|
14661
|
-
} else {
|
|
14662
|
-
refreshTickets = [admitted.ticketNumber];
|
|
14663
|
-
}
|
|
14664
|
-
const completedIndex = afterTicketNumber === void 0 ? -1 : refreshTickets.indexOf(afterTicketNumber);
|
|
14665
|
-
for (const ticketNumber of refreshTickets.slice(completedIndex + 1)) {
|
|
14666
|
-
const outcome = await invokeCourtDiarist(
|
|
14667
|
-
{
|
|
14668
|
-
instruction: admitted.instruction,
|
|
14669
|
-
projectRoot: admitted.projectRoot,
|
|
14670
|
-
failureLabel: `ticket #${ticketNumber}`,
|
|
14671
|
-
correlationId: admitted.runId,
|
|
14672
|
-
// Refresh holds a typed key — hand it off so identity is bound before turn.
|
|
14673
|
-
boundTicketNumber: ticketNumber
|
|
14674
|
-
},
|
|
14675
|
-
env,
|
|
14676
|
-
io
|
|
14677
|
-
);
|
|
14678
|
-
if (outcome.failedWithoutEscalate !== void 0) {
|
|
14679
|
-
throw new StationChildExhaustedError(
|
|
14680
|
-
outcome.failedWithoutEscalate.diagnostic
|
|
14681
|
-
);
|
|
14682
|
-
}
|
|
14683
|
-
if (outcome.identity.kind === "escalate" && outcome.terminal !== void 0) {
|
|
14684
|
-
return {
|
|
14685
|
-
terminal: outcome.terminal,
|
|
14686
|
-
...outcome.admitted === void 0 ? {} : { childRunId: outcome.admitted.runId }
|
|
14687
|
-
};
|
|
14688
|
-
}
|
|
14689
|
-
}
|
|
14690
|
-
}
|
|
14691
14498
|
var init_countersign_run = __esm({
|
|
14692
14499
|
"src/public-cli/countersign-run.ts"() {
|
|
14693
14500
|
"use strict";
|
|
14694
|
-
init_diarist_contracts();
|
|
14695
14501
|
init_readable_gate_item();
|
|
14696
|
-
init_run_ticket_number();
|
|
14697
|
-
init_post_admission();
|
|
14698
14502
|
}
|
|
14699
14503
|
});
|
|
14700
14504
|
|
|
@@ -14981,84 +14785,14 @@ async function runCountersignBody(parsed, env, io) {
|
|
|
14981
14785
|
...ticketNumber === void 0 ? {} : { ticketNumber }
|
|
14982
14786
|
});
|
|
14983
14787
|
};
|
|
14984
|
-
|
|
14985
|
-
|
|
14986
|
-
|
|
14987
|
-
let childDiaristRunId;
|
|
14988
|
-
let pausedDiaristTerminal;
|
|
14989
|
-
if (gateParentRunPath === void 0 && env.runCourtDiaristStation === void 0) {
|
|
14990
|
-
let outcome;
|
|
14991
|
-
try {
|
|
14992
|
-
outcome = await invokeCourtDiarist({
|
|
14993
|
-
instruction: parsed.instruction ?? "",
|
|
14994
|
-
projectRoot: admitted.projectRoot,
|
|
14995
|
-
failureLabel: "unbound summons",
|
|
14996
|
-
correlationId: admitted.runId,
|
|
14997
|
-
...env.boundTicketNumber === void 0 ? {} : { boundTicketNumber: env.boundTicketNumber }
|
|
14998
|
-
}, env, io);
|
|
14999
|
-
} catch (error) {
|
|
15000
|
-
await materializeAdmission(
|
|
15001
|
-
isSafePositiveTicketNumber(env.boundTicketNumber) ? env.boundTicketNumber : void 0
|
|
15002
|
-
);
|
|
15003
|
-
await markRunAdmitted(admitted, env.principalAuthority);
|
|
15004
|
-
return await presentControlledFailure2(admitted, {
|
|
15005
|
-
timedOut: false,
|
|
15006
|
-
code: null,
|
|
15007
|
-
stderr: "",
|
|
15008
|
-
thrown: error
|
|
15009
|
-
}, seatAdapters(admitted, env), env.principalAuthority, io);
|
|
15010
|
-
}
|
|
15011
|
-
identityDiaristRan = true;
|
|
15012
|
-
if (outcome.identity.kind === "escalate") pausedDiaristTerminal = outcome.terminal;
|
|
15013
|
-
if (outcome.admitted?.runDirectory.includes(`${sep4}unbound${sep4}runs${sep4}`)) {
|
|
15014
|
-
childDiaristRunId = outcome.admitted.runId;
|
|
15015
|
-
}
|
|
15016
|
-
if (outcome.failedWithoutEscalate !== void 0) {
|
|
15017
|
-
const diagnostic = outcome.failedWithoutEscalate.diagnostic;
|
|
15018
|
-
await materializeAdmission(
|
|
15019
|
-
isSafePositiveTicketNumber(env.boundTicketNumber) ? env.boundTicketNumber : void 0
|
|
15020
|
-
);
|
|
15021
|
-
if (childDiaristRunId !== void 0) await recordChildDiaristRun(admitted, childDiaristRunId);
|
|
15022
|
-
await markRunAdmitted(admitted, env.principalAuthority);
|
|
15023
|
-
return await presentControlledFailure2(admitted, {
|
|
15024
|
-
timedOut: false,
|
|
15025
|
-
code: null,
|
|
15026
|
-
stderr: "",
|
|
15027
|
-
thrown: new Error(diagnostic)
|
|
15028
|
-
}, seatAdapters(admitted, env), env.principalAuthority, io);
|
|
15029
|
-
}
|
|
15030
|
-
if (outcome.identity.kind === "ticket") {
|
|
15031
|
-
typedTicket = outcome.identity.ticketNumber;
|
|
15032
|
-
typedCourtTicketNumbers = outcome.identity.courtTicketNumbers;
|
|
15033
|
-
}
|
|
15034
|
-
}
|
|
15035
|
-
await materializeAdmission(typedTicket);
|
|
14788
|
+
await materializeAdmission(
|
|
14789
|
+
isSafePositiveTicketNumber(env.boundTicketNumber) ? env.boundTicketNumber : void 0
|
|
14790
|
+
);
|
|
15036
14791
|
await markRunAdmitted(admitted, env.principalAuthority);
|
|
15037
|
-
if (childDiaristRunId !== void 0) {
|
|
15038
|
-
await recordChildDiaristRun(admitted, childDiaristRunId);
|
|
15039
|
-
}
|
|
15040
|
-
if (pausedDiaristTerminal !== void 0) {
|
|
15041
|
-
io.stdout(formatTerminalResult(pausedDiaristTerminal));
|
|
15042
|
-
return { exitCode: 0, admitted, terminal: pausedDiaristTerminal };
|
|
15043
|
-
}
|
|
15044
14792
|
if (gateParentRunPath !== void 0) {
|
|
15045
14793
|
await persistAdmittedSourceRunPath(admitted, gateParentRunPath);
|
|
15046
14794
|
admitted = { ...admitted, sourceRunPath: gateParentRunPath };
|
|
15047
14795
|
}
|
|
15048
|
-
if (identityDiaristRan && typedTicket !== void 0) {
|
|
15049
|
-
try {
|
|
15050
|
-
await bindAdmittedTicketNumber(admitted, typedTicket);
|
|
15051
|
-
await relocateAdmittedRunToTicket(admitted, env.principalAuthority);
|
|
15052
|
-
await bindCourtTicketNumbersOnAdmitted(admitted, typedCourtTicketNumbers ?? [typedTicket]);
|
|
15053
|
-
} catch (error) {
|
|
15054
|
-
return await presentControlledFailure2(admitted, {
|
|
15055
|
-
timedOut: false,
|
|
15056
|
-
code: null,
|
|
15057
|
-
stderr: "",
|
|
15058
|
-
thrown: error
|
|
15059
|
-
}, seatAdapters(admitted, env), env.principalAuthority, io);
|
|
15060
|
-
}
|
|
15061
|
-
}
|
|
15062
14796
|
const turnProjection = {
|
|
15063
14797
|
packageRoot: env.packageRoot,
|
|
15064
14798
|
home: env.home,
|
|
@@ -15088,13 +14822,6 @@ async function runCountersignBody(parsed, env, io) {
|
|
|
15088
14822
|
...seatAdapters(admitted, env),
|
|
15089
14823
|
beforeDispatch: async (admittedSeat, lease) => {
|
|
15090
14824
|
if (!packagedAdmitsCountersign(admittedSeat.role)) return;
|
|
15091
|
-
if (!identityDiaristRan || typedTicket !== void 0) {
|
|
15092
|
-
const refresh = await runCountersignCourtDiaristStation(admittedSeat, env, io);
|
|
15093
|
-
if (refresh !== void 0) {
|
|
15094
|
-
io.stdout(formatTerminalResult(refresh.terminal));
|
|
15095
|
-
return refresh.terminal;
|
|
15096
|
-
}
|
|
15097
|
-
}
|
|
15098
14825
|
await relocateAdmittedRunToTicket(admittedSeat, env.principalAuthority, lease);
|
|
15099
14826
|
Object.assign(turnRequest, buildInstructionSeatTurnRequest(admittedSeat, turnProjection));
|
|
15100
14827
|
}
|
|
@@ -15426,13 +15153,6 @@ async function continueParentAfterChild(parentRunId, child, env, io) {
|
|
|
15426
15153
|
return runPublicInstructionSeatResume({ runId: parentRunId }, env, io);
|
|
15427
15154
|
}
|
|
15428
15155
|
const admitted = loaded.admitted;
|
|
15429
|
-
if (admitted.role === "countersign" && admitted.ticketNumber !== void 0 && child.role === "diarist") {
|
|
15430
|
-
const refresh = await runCountersignCourtDiaristStation(admitted, env, io, child.ticketNumber);
|
|
15431
|
-
if (refresh !== void 0) {
|
|
15432
|
-
io.stdout(formatTerminalResult(refresh.terminal));
|
|
15433
|
-
return { exitCode: 0, admitted, terminal: refresh.terminal };
|
|
15434
|
-
}
|
|
15435
|
-
}
|
|
15436
15156
|
const resolved = await queueConclusionFromChild(child, env, io);
|
|
15437
15157
|
if (resolved !== void 0 && "stop" in resolved) return resolved.stop;
|
|
15438
15158
|
if (resolved !== void 0 && resolved.status === "escalate") {
|
|
@@ -18978,8 +18698,8 @@ async function summonPublicRole(options) {
|
|
|
18978
18698
|
// Nested court stations keep station-child semantics; dual-lens
|
|
18979
18699
|
// ordinary Reviewer axes opt out (#946 / ADR 0082).
|
|
18980
18700
|
...options.stationChild === false ? {} : { stationChild: true },
|
|
18981
|
-
// Forward composition-root adapters so nested
|
|
18982
|
-
//
|
|
18701
|
+
// Forward composition-root adapters so nested stations (e.g.
|
|
18702
|
+
// secretariat → diarist) select the same faux/production table (#924).
|
|
18983
18703
|
...options.hostAdapters === void 0 ? {} : { hostAdapters: options.hostAdapters },
|
|
18984
18704
|
...config.autoResumeLimit === void 0 ? {} : { autoResumeLimit: config.autoResumeLimit },
|
|
18985
18705
|
...options.signal === void 0 ? {} : { signal: options.signal },
|
|
@@ -19263,10 +18983,10 @@ async function summonGateOfficer(options) {
|
|
|
19263
18983
|
);
|
|
19264
18984
|
}
|
|
19265
18985
|
const correlationId = parentRunId;
|
|
19266
|
-
const { isSafePositiveTicketNumber:
|
|
18986
|
+
const { isSafePositiveTicketNumber: isSafePositiveTicketNumber3, readBoardTicketNumber: readBoardTicketNumber2 } = await Promise.resolve().then(() => (init_run_ticket_number(), run_ticket_number_exports));
|
|
19267
18987
|
const parentTicket = await readBoardTicketNumber2(options.sourceRunDirectory);
|
|
19268
18988
|
const submittedTicket = options.submission !== null && typeof options.submission === "object" && !Array.isArray(options.submission) ? options.submission.ticketNumber : void 0;
|
|
19269
|
-
const courtTicket =
|
|
18989
|
+
const courtTicket = isSafePositiveTicketNumber3(submittedTicket) ? submittedTicket : parentTicket;
|
|
19270
18990
|
const instruction = options.reask ?? gateReviewInstruction ?? "";
|
|
19271
18991
|
return summonPublicRole({
|
|
19272
18992
|
role: options.officer,
|
|
@@ -20158,52 +19878,10 @@ function parsePersistedTicketIdentity(record4) {
|
|
|
20158
19878
|
...ticketNumber === void 0 ? {} : { ticketNumber }
|
|
20159
19879
|
};
|
|
20160
19880
|
}
|
|
20161
|
-
function readDurableCourtTicketNumbersPage(record4, principalTicket, pageLabel) {
|
|
20162
|
-
const interpreted = interpretDurableCourtTicketNumbers(record4, {
|
|
20163
|
-
...principalTicket === void 0 ? {} : { principalTicket }
|
|
20164
|
-
});
|
|
20165
|
-
if (interpreted.kind === "damage") {
|
|
20166
|
-
return {
|
|
20167
|
-
kind: "damage",
|
|
20168
|
-
reason: `role run ${pageLabel} courtTicketNumbers is damaged: ${interpreted.reason}`
|
|
20169
|
-
};
|
|
20170
|
-
}
|
|
20171
|
-
if (interpreted.kind === "ok") {
|
|
20172
|
-
return { kind: "ok", tickets: interpreted.tickets };
|
|
20173
|
-
}
|
|
20174
|
-
return { kind: "absent" };
|
|
20175
|
-
}
|
|
20176
|
-
function mergeDurableCourtTicketNumbers(input) {
|
|
20177
|
-
const fromAdmitted = input.admittedRecord === void 0 ? { kind: "absent" } : readDurableCourtTicketNumbersPage(
|
|
20178
|
-
input.admittedRecord,
|
|
20179
|
-
input.principalTicket,
|
|
20180
|
-
"admitted-request"
|
|
20181
|
-
);
|
|
20182
|
-
const fromInvocation = input.invocationRecord === void 0 ? { kind: "absent" } : readDurableCourtTicketNumbersPage(
|
|
20183
|
-
input.invocationRecord,
|
|
20184
|
-
input.principalTicket,
|
|
20185
|
-
"invocation"
|
|
20186
|
-
);
|
|
20187
|
-
if (fromAdmitted.kind === "damage") return fromAdmitted;
|
|
20188
|
-
if (fromInvocation.kind === "damage") return fromInvocation;
|
|
20189
|
-
if (fromAdmitted.kind === "ok" && fromInvocation.kind === "ok") {
|
|
20190
|
-
if (!sameCourtTicketNumbers(fromAdmitted.tickets, fromInvocation.tickets)) {
|
|
20191
|
-
return {
|
|
20192
|
-
kind: "damage",
|
|
20193
|
-
reason: "role run courtTicketNumbers differs between admitted-request and invocation"
|
|
20194
|
-
};
|
|
20195
|
-
}
|
|
20196
|
-
return { kind: "ok", tickets: fromAdmitted.tickets };
|
|
20197
|
-
}
|
|
20198
|
-
if (fromAdmitted.kind === "ok") return { kind: "ok", tickets: fromAdmitted.tickets };
|
|
20199
|
-
if (fromInvocation.kind === "ok") return { kind: "ok", tickets: fromInvocation.tickets };
|
|
20200
|
-
return { kind: "ok" };
|
|
20201
|
-
}
|
|
20202
19881
|
function restoredTicketFields(fields) {
|
|
20203
19882
|
return {
|
|
20204
19883
|
...fields.correlationId === void 0 ? {} : { correlationId: fields.correlationId },
|
|
20205
|
-
...fields.ticketNumber === void 0 ? {} : { ticketNumber: fields.ticketNumber }
|
|
20206
|
-
...fields.courtTicketNumbers === void 0 ? {} : { courtTicketNumbers: fields.courtTicketNumbers }
|
|
19884
|
+
...fields.ticketNumber === void 0 ? {} : { ticketNumber: fields.ticketNumber }
|
|
20207
19885
|
};
|
|
20208
19886
|
}
|
|
20209
19887
|
async function loadResumableRunRecord(home, runId, authority) {
|
|
@@ -20235,10 +19913,6 @@ async function loadResumableRunRecord(home, runId, authority) {
|
|
|
20235
19913
|
let derived;
|
|
20236
19914
|
let correlationId;
|
|
20237
19915
|
let ticketNumber;
|
|
20238
|
-
let courtTicketNumbers;
|
|
20239
|
-
let courtTicketNumbersDamage;
|
|
20240
|
-
let admittedIdentityRecord;
|
|
20241
|
-
let invocationIdentityRecord;
|
|
20242
19916
|
let prNumber;
|
|
20243
19917
|
let repository;
|
|
20244
19918
|
let repositoryDisplay;
|
|
@@ -20360,7 +20034,6 @@ async function loadResumableRunRecord(home, runId, authority) {
|
|
|
20360
20034
|
};
|
|
20361
20035
|
}
|
|
20362
20036
|
}
|
|
20363
|
-
admittedIdentityRecord = record4;
|
|
20364
20037
|
const fromAdmitted = parsePersistedTicketIdentity(record4);
|
|
20365
20038
|
correlationId = fromAdmitted.correlationId;
|
|
20366
20039
|
ticketNumber = fromAdmitted.ticketNumber;
|
|
@@ -20379,7 +20052,6 @@ async function loadResumableRunRecord(home, runId, authority) {
|
|
|
20379
20052
|
);
|
|
20380
20053
|
if (invocationRaw !== null && typeof invocationRaw === "object" && !Array.isArray(invocationRaw)) {
|
|
20381
20054
|
const rec = invocationRaw;
|
|
20382
|
-
invocationIdentityRecord = rec;
|
|
20383
20055
|
if (typeof rec.provider === "string" && typeof rec.model === "string") {
|
|
20384
20056
|
model = {
|
|
20385
20057
|
provider: rec.provider,
|
|
@@ -20404,16 +20076,6 @@ async function loadResumableRunRecord(home, runId, authority) {
|
|
|
20404
20076
|
);
|
|
20405
20077
|
}
|
|
20406
20078
|
}
|
|
20407
|
-
const mergedSet = mergeDurableCourtTicketNumbers({
|
|
20408
|
-
admittedRecord: admittedIdentityRecord,
|
|
20409
|
-
invocationRecord: invocationIdentityRecord,
|
|
20410
|
-
principalTicket: ticketNumber
|
|
20411
|
-
});
|
|
20412
|
-
if (mergedSet.kind === "damage") {
|
|
20413
|
-
courtTicketNumbersDamage = mergedSet.reason;
|
|
20414
|
-
} else if (mergedSet.tickets !== void 0) {
|
|
20415
|
-
courtTicketNumbers = mergedSet.tickets;
|
|
20416
|
-
}
|
|
20417
20079
|
const sourceRunLeaf = basename10(sourceRunPath ?? "").split("@");
|
|
20418
20080
|
const referencedRunId = sourceRun?.runId ?? sourceRunLeaf[0];
|
|
20419
20081
|
const referencedRole = sourceRun?.role ?? sourceRunLeaf[1];
|
|
@@ -20451,8 +20113,6 @@ async function loadResumableRunRecord(home, runId, authority) {
|
|
|
20451
20113
|
...derived === void 0 ? {} : { derived },
|
|
20452
20114
|
...correlationId === void 0 ? {} : { correlationId },
|
|
20453
20115
|
...ticketNumber === void 0 ? {} : { ticketNumber },
|
|
20454
|
-
...courtTicketNumbers === void 0 ? {} : { courtTicketNumbers },
|
|
20455
|
-
...courtTicketNumbersDamage === void 0 ? {} : { courtTicketNumbersDamage },
|
|
20456
20116
|
...prNumber === void 0 ? {} : { prNumber },
|
|
20457
20117
|
...repository === void 0 ? {} : { repository },
|
|
20458
20118
|
...repositoryDisplay === void 0 ? {} : { repositoryDisplay },
|
|
@@ -20527,9 +20187,7 @@ function admitResumedRole(loaded) {
|
|
|
20527
20187
|
case "court-materials": {
|
|
20528
20188
|
const admitted = {
|
|
20529
20189
|
role: "countersign",
|
|
20530
|
-
...base
|
|
20531
|
-
...base.courtTicketNumbers === void 0 ? {} : { courtTicketNumbers: base.courtTicketNumbers },
|
|
20532
|
-
...fields.courtTicketNumbersDamage === void 0 ? {} : { courtTicketNumbersDamage: fields.courtTicketNumbersDamage }
|
|
20190
|
+
...base
|
|
20533
20191
|
};
|
|
20534
20192
|
return admitted;
|
|
20535
20193
|
}
|
|
@@ -20736,7 +20394,6 @@ var init_run_lifecycle = __esm({
|
|
|
20736
20394
|
init_typed_provider_http();
|
|
20737
20395
|
init_typed_provider_http();
|
|
20738
20396
|
init_collector_config();
|
|
20739
|
-
init_diarist_contracts();
|
|
20740
20397
|
init_role_run_relocation();
|
|
20741
20398
|
init_engine_material();
|
|
20742
20399
|
init_packaged_role_registry();
|
|
@@ -22935,6 +22592,37 @@ init_terminating_infrastructure();
|
|
|
22935
22592
|
init_diarist_contracts();
|
|
22936
22593
|
init_diarist_contracts();
|
|
22937
22594
|
import { Type as Type18 } from "typebox";
|
|
22595
|
+
var diaristSessionsSchema = Type18.Array(
|
|
22596
|
+
Type18.Object(
|
|
22597
|
+
{
|
|
22598
|
+
path: Type18.Optional(Type18.String({ description: "\u4F1A\u8BDD\u5377\u7EDD\u5BF9\u6216\u53EF\u8BFB\u8DEF\u5F84" })),
|
|
22599
|
+
ranges: Type18.Optional(
|
|
22600
|
+
Type18.Array(
|
|
22601
|
+
Type18.Object(
|
|
22602
|
+
{
|
|
22603
|
+
from: Type18.Optional(
|
|
22604
|
+
Type18.Object(
|
|
22605
|
+
{ id: Type18.Optional(Type18.String()), line: Type18.Optional(Type18.Unknown()) },
|
|
22606
|
+
{ additionalProperties: true, description: "\u8D77\u70B9\uFF1A\u539F\u751F id \u6216\u672C\u8F6E\u884C\u53F7\u4E8C\u9009\u4E00" }
|
|
22607
|
+
)
|
|
22608
|
+
),
|
|
22609
|
+
to: Type18.Optional(
|
|
22610
|
+
Type18.Object(
|
|
22611
|
+
{ id: Type18.Optional(Type18.String()), line: Type18.Optional(Type18.Unknown()) },
|
|
22612
|
+
{ additionalProperties: true, description: "\u7EC8\u70B9\uFF1A\u539F\u751F id \u6216\u672C\u8F6E\u884C\u53F7\u4E8C\u9009\u4E00" }
|
|
22613
|
+
)
|
|
22614
|
+
)
|
|
22615
|
+
},
|
|
22616
|
+
{ additionalProperties: true, description: "\u4E00\u6BB5\u5BF9\u8BDD\u533A\u95F4" }
|
|
22617
|
+
),
|
|
22618
|
+
{ description: "\u672C\u5377\u672C\u8F6E\u5404\u533A\u95F4\uFF1B\u81F3\u5C11\u4E00\u6BB5" }
|
|
22619
|
+
)
|
|
22620
|
+
)
|
|
22621
|
+
},
|
|
22622
|
+
{ additionalProperties: true, description: "\u4E00\u5377\u4F1A\u8BDD\u7684\u8FB9\u754C" }
|
|
22623
|
+
),
|
|
22624
|
+
{ 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" }
|
|
22625
|
+
);
|
|
22938
22626
|
var diaristOutputSchema = withTerminatingOutputDeclarations(
|
|
22939
22627
|
openToolObject(
|
|
22940
22628
|
Type18.Object({
|
|
@@ -22946,63 +22634,22 @@ var diaristOutputSchema = withTerminatingOutputDeclarations(
|
|
|
22946
22634
|
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"
|
|
22947
22635
|
})
|
|
22948
22636
|
),
|
|
22949
|
-
courtTicketNumbers: Type18.Optional(
|
|
22950
|
-
Type18.Unknown({
|
|
22951
|
-
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"
|
|
22952
|
-
})
|
|
22953
|
-
),
|
|
22954
22637
|
reason: Type18.Optional(
|
|
22955
22638
|
Type18.String({
|
|
22956
22639
|
description: "status \u4E3A escalate \u65F6\uFF1A\u8BA4\u4E0D\u51FA\u672C\u5EAD\u5BF9\u8C61\u7684\u539F\u56E0"
|
|
22957
22640
|
})
|
|
22958
22641
|
),
|
|
22959
|
-
sessions: Type18.Optional(
|
|
22642
|
+
sessions: Type18.Optional(diaristSessionsSchema),
|
|
22643
|
+
ticketSessions: Type18.Optional(
|
|
22960
22644
|
Type18.Array(
|
|
22961
22645
|
Type18.Object(
|
|
22962
22646
|
{
|
|
22963
|
-
|
|
22964
|
-
|
|
22965
|
-
),
|
|
22966
|
-
ranges: Type18.Optional(
|
|
22967
|
-
Type18.Array(
|
|
22968
|
-
Type18.Object(
|
|
22969
|
-
{
|
|
22970
|
-
from: Type18.Optional(
|
|
22971
|
-
Type18.Object(
|
|
22972
|
-
{
|
|
22973
|
-
id: Type18.Optional(Type18.String()),
|
|
22974
|
-
line: Type18.Optional(Type18.Unknown())
|
|
22975
|
-
},
|
|
22976
|
-
{
|
|
22977
|
-
additionalProperties: true,
|
|
22978
|
-
description: "\u8D77\u70B9\uFF1A\u539F\u751F id \u6216\u672C\u8F6E\u884C\u53F7\u4E8C\u9009\u4E00"
|
|
22979
|
-
}
|
|
22980
|
-
)
|
|
22981
|
-
),
|
|
22982
|
-
to: Type18.Optional(
|
|
22983
|
-
Type18.Object(
|
|
22984
|
-
{
|
|
22985
|
-
id: Type18.Optional(Type18.String()),
|
|
22986
|
-
line: Type18.Optional(Type18.Unknown())
|
|
22987
|
-
},
|
|
22988
|
-
{
|
|
22989
|
-
additionalProperties: true,
|
|
22990
|
-
description: "\u7EC8\u70B9\uFF1A\u539F\u751F id \u6216\u672C\u8F6E\u884C\u53F7\u4E8C\u9009\u4E00"
|
|
22991
|
-
}
|
|
22992
|
-
)
|
|
22993
|
-
)
|
|
22994
|
-
},
|
|
22995
|
-
{ additionalProperties: true, description: "\u4E00\u6BB5\u5BF9\u8BDD\u533A\u95F4" }
|
|
22996
|
-
),
|
|
22997
|
-
{ description: "\u672C\u5377\u672C\u8F6E\u5404\u533A\u95F4\uFF1B\u81F3\u5C11\u4E00\u6BB5" }
|
|
22998
|
-
)
|
|
22999
|
-
)
|
|
22647
|
+
ticketNumber: Type18.Unknown({ description: "\u672C\u6761\u8FB9\u754C\u6240\u5F52\u7968\u53F7\uFF08\u6B63\u6574\u6570\uFF09" }),
|
|
22648
|
+
sessions: diaristSessionsSchema
|
|
23000
22649
|
},
|
|
23001
|
-
{ additionalProperties: true
|
|
22650
|
+
{ additionalProperties: true }
|
|
23002
22651
|
),
|
|
23003
|
-
{
|
|
23004
|
-
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"
|
|
23005
|
-
}
|
|
22652
|
+
{ 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" }
|
|
23006
22653
|
)
|
|
23007
22654
|
)
|
|
23008
22655
|
})
|
|
@@ -23011,7 +22658,7 @@ var diaristOutputSchema = withTerminatingOutputDeclarations(
|
|
|
23011
22658
|
var DIARIST_TOOL_SPEC = {
|
|
23012
22659
|
name: DIARIST_OUTPUT_TOOL_NAME,
|
|
23013
22660
|
label: "\u8D77\u5C45\u90CE\u8F93\u51FA",
|
|
23014
|
-
description: "\u8D77\u5C45\u90CE\u4EA4\
|
|
22661
|
+
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",
|
|
23015
22662
|
promptSnippet: "\u8D77\u5C45\u90CE\u4EA4\u8FB9\u754C",
|
|
23016
22663
|
parameters: diaristOutputSchema
|
|
23017
22664
|
};
|
|
@@ -23061,18 +22708,7 @@ init_diarist_contracts();
|
|
|
23061
22708
|
// src/diarist.ts
|
|
23062
22709
|
init_ticket_provenance();
|
|
23063
22710
|
async function commitDiaristProjection(input) {
|
|
23064
|
-
|
|
23065
|
-
ticketNumber: input.ticketNumber,
|
|
23066
|
-
cwd: input.cwd,
|
|
23067
|
-
...input.home === void 0 ? {} : { home: input.home },
|
|
23068
|
-
sessions: input.sessions,
|
|
23069
|
-
...input.runDirectory === void 0 ? {} : { runDirectory: input.runDirectory }
|
|
23070
|
-
});
|
|
23071
|
-
return {
|
|
23072
|
-
ticketNumber: input.ticketNumber,
|
|
23073
|
-
volumeRecordFile: result.recordFile,
|
|
23074
|
-
lineCount: result.lines.length
|
|
23075
|
-
};
|
|
22711
|
+
await reprojectTicketProvenanceBatch(input);
|
|
23076
22712
|
}
|
|
23077
22713
|
|
|
23078
22714
|
// src/role-runtime.ts
|
|
@@ -24215,7 +23851,7 @@ function readDiaristRunCoordinates(ctx) {
|
|
|
24215
23851
|
...bound === void 0 ? {} : { boundTicketNumber: bound }
|
|
24216
23852
|
};
|
|
24217
23853
|
}
|
|
24218
|
-
var DIARIST_BOUNDS_REASK = "\u8FB9\u754C\u65E0\u6CD5\u4F7F\u7528\u3002\u8BF7\u91CD\u4EA4 sessions\
|
|
23854
|
+
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";
|
|
24219
23855
|
function createDiaristRoleRuntime(roleHost, dependencies) {
|
|
24220
23856
|
return createFiledOfficerRuntime(
|
|
24221
23857
|
roleHost,
|
|
@@ -24235,18 +23871,17 @@ function createDiaristRoleRuntime(roleHost, dependencies) {
|
|
|
24235
23871
|
await bindTicketNumberOnRunDirectory(coords.runDirectory, ticketNumber);
|
|
24236
23872
|
}
|
|
24237
23873
|
}
|
|
24238
|
-
const
|
|
24239
|
-
|
|
23874
|
+
const singleSessions = submitted && !Object.hasOwn(submitted, "ticketSessions") ? projectDiaristSessions(parameters) : void 0;
|
|
23875
|
+
const ticketSessions = submitted && Object.hasOwn(submitted, "ticketSessions") ? projectDiaristTicketSessions(submitted) : singleSessions === void 0 ? void 0 : [{ ticketNumber: ticketNumber ?? null, sessions: singleSessions }];
|
|
23876
|
+
if (ticketSessions === void 0) {
|
|
24240
23877
|
throw new ParentQueueReaskError(DIARIST_BOUNDS_REASK);
|
|
24241
23878
|
}
|
|
24242
|
-
let facts;
|
|
24243
23879
|
try {
|
|
24244
|
-
|
|
24245
|
-
ticketNumber: ticketNumber ?? null,
|
|
23880
|
+
await commitDiaristProjection({
|
|
24246
23881
|
cwd: coords.projectRoot,
|
|
24247
23882
|
home: coords.home,
|
|
24248
23883
|
runDirectory: coords.runDirectory,
|
|
24249
|
-
|
|
23884
|
+
tickets: ticketSessions
|
|
24250
23885
|
});
|
|
24251
23886
|
} catch (error) {
|
|
24252
23887
|
if (error instanceof ParentQueueReaskError) throw error;
|