@akagilnc/pi-workflow-roles 0.1.5382 → 0.1.5462
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 +4 -2
- package/README.zh-CN.md +4 -2
- package/dist/acp-host/production-host.js +8843 -9012
- package/dist/archivist-record-pointer.js +38 -0
- package/dist/compliance-transport.js +7 -5
- package/dist/doctor-auditor.js +1 -0
- package/dist/engine-detour-usage.js +9 -36
- package/dist/gatekeeper-role.js +4 -18
- package/dist/headless-host/description.js +0 -209
- package/dist/headless-host/production-host.js +7828 -8247
- package/dist/host-contracts.js +8 -0
- package/dist/judge-role.js +14 -1
- package/dist/migrate-book-topology.js +215 -96
- package/dist/navigator-attendance.js +10 -9
- package/dist/navigator-invocation-identity.js +18 -0
- package/dist/packaged-role-registry.js +1 -9
- package/dist/pi/role-turn-host.js +46 -19
- package/dist/public-cli/auto-resume.js +29 -66
- package/dist/public-cli/cli.js +1 -0
- package/dist/public-cli/countersign-run.js +4 -18
- package/dist/public-cli/instruction-seat-run.js +258 -69
- package/dist/public-cli/main.js +7488 -7758
- package/dist/public-cli/post-admission.js +451 -349
- package/dist/public-cli/process-cancel.js +8 -0
- package/dist/public-cli/run-lifecycle.js +24 -94
- package/dist/public-cli/settlement.js +624 -1471
- package/dist/public-cli/terminal.js +34 -53
- package/dist/public-cli/turn-request.js +3 -0
- package/dist/public-role-summons.js +3 -8
- package/dist/receipt-delivery-policy.js +162 -28
- package/dist/run-terminal-artifacts.js +19 -14
- package/dist/serialize-thrown-value.js +7 -1
- package/dist/submission-errors.js +11 -1
- package/dist/submission-gate.js +27 -4
- package/dist/submission-ledger.js +21 -89
- package/package.json +1 -1
- package/scripts/build-package.mjs +0 -2
- package/src/acp-host/role-turn-host.ts +168 -75
- package/src/archivist-record-pointer.ts +48 -0
- package/src/compliance-transport.ts +13 -8
- package/src/doctor-auditor.ts +3 -0
- package/src/engine-detour-usage.ts +10 -39
- package/src/external-host-turn-loop.ts +100 -43
- package/src/gatekeeper-role.ts +7 -22
- package/src/headless-host/description.ts +4 -214
- package/src/headless-host/production-host.ts +2 -1
- package/src/headless-host/role-turn-host.ts +153 -186
- package/src/host-contracts.ts +20 -10
- package/src/judge-role.ts +24 -5
- package/src/navigator-attendance.ts +17 -12
- package/src/navigator-invocation-identity.ts +31 -0
- package/src/navigator-public-session.ts +1 -1
- package/src/navigator-session-contracts.ts +1 -1
- package/src/packaged-role-registry.ts +2 -10
- package/src/pi/adapter.ts +33 -11
- package/src/pi/role-turn-host.ts +49 -28
- package/src/prepared-role-turn.ts +2 -0
- package/src/public-cli/auto-resume.ts +27 -66
- package/src/public-cli/cli.ts +1 -0
- package/src/public-cli/countersign-run.ts +4 -22
- package/src/public-cli/instruction-seat-run.ts +307 -74
- package/src/public-cli/post-admission.ts +615 -459
- package/src/public-cli/process-cancel.ts +9 -0
- package/src/public-cli/run-lifecycle.ts +25 -126
- package/src/public-cli/settlement.ts +801 -1859
- package/src/public-cli/terminal.ts +42 -70
- package/src/public-cli/turn-request.ts +10 -1
- package/src/public-role-summons.ts +3 -8
- package/src/receipt-delivery-policy.ts +219 -28
- package/src/role-envelope.ts +21 -10
- package/src/role-runtime-dependencies.ts +1 -0
- package/src/role-runtime.ts +79 -102
- package/src/run-terminal-artifacts.ts +21 -17
- package/src/serialize-thrown-value.ts +7 -1
- package/src/submission-correctable-error.ts +5 -2
- package/src/submission-errors.ts +12 -1
- package/src/submission-gate.ts +34 -4
- package/src/submission-ledger.ts +30 -116
- package/src/worker-role.ts +19 -7
- package/src/worker-submission-gates.ts +29 -7
- package/dist/audit-escalation.js +0 -7
- package/dist/pi/known-failure.js +0 -51
- package/dist/typed-provider-http.js +0 -57
- package/dist/upstream-error-testimony.js +0 -19
- package/src/pi/known-failure.ts +0 -76
- package/src/typed-provider-http.ts +0 -89
- package/src/upstream-error-testimony.ts +0 -45
|
@@ -7,7 +7,7 @@ import { readableGateItem } from "../readable-gate-item.ts";
|
|
|
7
7
|
import type { AdmittedCountersignInvocation } from "./invocation.ts";
|
|
8
8
|
import type { PostAdmissionEnv } from "./post-admission.ts";
|
|
9
9
|
import type { CliIo } from "./cli-io.ts";
|
|
10
|
-
import type
|
|
10
|
+
import { currentReplyRows, type TerminalResult, type TerminalRoleOutcome } from "./terminal.ts";
|
|
11
11
|
|
|
12
12
|
import { isRecord } from "../unknown-value.ts";
|
|
13
13
|
|
|
@@ -60,22 +60,6 @@ function isEscalatePayload(payload: unknown): boolean {
|
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
/**
|
|
64
|
-
* Rows a parent may read from a nested diarist terminal (#836 / #953).
|
|
65
|
-
* Accepted/audit use role result payloads; failure history is submissions only.
|
|
66
|
-
*/
|
|
67
|
-
function courtDiaristPayloadRows(
|
|
68
|
-
roleOutcome: TerminalRoleOutcome | undefined,
|
|
69
|
-
submissions: readonly unknown[] | undefined,
|
|
70
|
-
): readonly unknown[] {
|
|
71
|
-
if (roleOutcome === undefined) return submissions ?? [];
|
|
72
|
-
if (roleOutcome.kind === "accepted" || roleOutcome.kind === "audit_escalation") {
|
|
73
|
-
return roleOutcome.payloads ?? [];
|
|
74
|
-
}
|
|
75
|
-
if (roleOutcome.kind === "failure") return submissions ?? [];
|
|
76
|
-
return [];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
63
|
/**
|
|
80
64
|
* Parent diagnostic for court-diarist escalate (#953 / 失败诚实 / 传话).
|
|
81
65
|
* Relays diarist escalate payload(s) via readableGateItem — never invents
|
|
@@ -87,10 +71,9 @@ function courtDiaristPayloadRows(
|
|
|
87
71
|
* every escalate receipt as-is, last = currentConclusion.
|
|
88
72
|
*/
|
|
89
73
|
function courtDiaristEscalateDiagnostic(
|
|
90
|
-
|
|
91
|
-
submissions?: readonly unknown[],
|
|
74
|
+
terminal: TerminalResult | undefined,
|
|
92
75
|
): string {
|
|
93
|
-
const payloads =
|
|
76
|
+
const payloads = currentReplyRows(terminal);
|
|
94
77
|
const escalatePayloads: unknown[] = [];
|
|
95
78
|
for (const payload of payloads) {
|
|
96
79
|
if (isEscalatePayload(payload)) escalatePayloads.push(payload);
|
|
@@ -183,14 +166,13 @@ export async function invokeCourtDiarist(
|
|
|
183
166
|
});
|
|
184
167
|
|
|
185
168
|
const roleOutcome = result.terminal?.roleOutcome;
|
|
186
|
-
const submissions = result.terminal?.submissions;
|
|
187
169
|
// Escalate routing is a boolean over the preserved sequence (#881). Reasons and
|
|
188
170
|
// payload bodies stay on roleOutcome — never rewritten into a sole identity reason.
|
|
189
171
|
if (latestPayloadEscalated(roleOutcome)) {
|
|
190
172
|
return {
|
|
191
173
|
identity: {
|
|
192
174
|
kind: "escalate",
|
|
193
|
-
diagnostic: courtDiaristEscalateDiagnostic(
|
|
175
|
+
diagnostic: courtDiaristEscalateDiagnostic(result.terminal),
|
|
194
176
|
},
|
|
195
177
|
...(result.admitted === undefined ? {} : { admitted: result.admitted }),
|
|
196
178
|
...(result.terminal === undefined ? {} : { terminal: result.terminal }),
|