@akagilnc/pi-workflow-roles 0.1.4321 → 0.1.4387
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 -1
- package/README.zh-CN.md +5 -1
- package/dist/acp-host/production-host.js +1308 -587
- package/dist/doctor-contracts.js +2 -2
- package/dist/engine-detour-tool.js +2 -8
- package/dist/gatekeeper-role.js +4 -19
- package/dist/headless-host/production-host.js +2613 -1892
- package/dist/merger-contracts.js +2 -2
- package/dist/migrate-book-topology.js +34 -9
- package/dist/notary-contracts.js +2 -2
- package/dist/package-contracts/auditor-output.js +2 -2
- package/dist/package-contracts/fixer-output.js +2 -2
- package/dist/package-contracts/gatekeeper-output.js +2 -2
- package/dist/package-contracts/navigator-output.js +2 -2
- package/dist/package-contracts/terminating-infrastructure.js +7 -2
- package/dist/package-contracts/terminating-tools.js +6 -0
- package/dist/packaged-role-registry.js +20 -1
- package/dist/public-cli/case-dossier-delivery.js +45 -28
- package/dist/public-cli/countersign-run.js +439 -0
- package/dist/public-cli/invocation.js +10 -0
- package/dist/public-cli/main.js +388 -101
- package/dist/public-cli/option-definitions.js +14 -0
- package/dist/public-cli/post-admission.js +44 -49
- package/dist/public-cli/run-lifecycle.js +13 -1
- package/dist/public-cli/settlement.js +14 -53
- package/dist/public-role-summons.js +14 -0
- package/dist/secretariat-contracts.js +8 -0
- package/dist/sitian-appender.js +21 -4
- package/extensions/role-runtime.ts +1 -0
- package/package.json +1 -1
- package/scripts/build-package.mjs +1 -0
- package/souls/secretariat.md +26 -0
- package/souls/ticket-law.md +9 -0
- package/src/collector-tool-schemas.ts +2 -2
- package/src/countersign-role.ts +2 -2
- package/src/diarist-role.ts +2 -2
- package/src/doctor-contracts.ts +2 -2
- package/src/engine-detour-tool.ts +3 -9
- package/src/gatekeeper-pass-envelope.ts +35 -2
- package/src/gatekeeper-role.ts +8 -31
- package/src/gleaner-left-role.ts +2 -2
- package/src/host-contracts.ts +2 -1
- package/src/inspector-role.ts +2 -2
- package/src/judge-role.ts +2 -2
- package/src/merger-contracts.ts +2 -2
- package/src/notary-contracts.ts +2 -2
- package/src/package-contracts/auditor-output.ts +2 -2
- package/src/package-contracts/fixer-output.ts +2 -2
- package/src/package-contracts/gatekeeper-output.ts +2 -2
- package/src/package-contracts/navigator-output.ts +2 -2
- package/src/package-contracts/terminating-infrastructure.ts +13 -3
- package/src/package-contracts/terminating-tools.ts +9 -1
- package/src/packaged-role-registry.ts +20 -1
- package/src/public-cli/case-dossier-delivery.ts +48 -29
- package/src/public-cli/cli.ts +10 -0
- package/src/public-cli/countersign-run.ts +29 -5
- package/src/public-cli/invocation.ts +28 -2
- package/src/public-cli/option-definitions.ts +17 -0
- package/src/public-cli/post-admission.ts +45 -58
- package/src/public-cli/run-lifecycle.ts +29 -2
- package/src/public-cli/secretariat-run.ts +266 -0
- package/src/public-cli/settlement.ts +31 -55
- package/src/public-cli/terminal.ts +2 -1
- package/src/public-role-summons.ts +23 -1
- package/src/reviewer-role.ts +2 -2
- package/src/role-runtime-dependencies.ts +1 -0
- package/src/role-runtime.ts +203 -18
- package/src/secretariat-contracts.ts +27 -0
- package/src/secretariat-role.ts +210 -0
- package/src/sitian-appender.ts +36 -3
- package/src/worker-role.ts +2 -2
package/dist/doctor-contracts.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
2
|
import { canonicalJson } from "./canonical-json.js";
|
|
3
3
|
import { openToolObjectFromUnion } from "./open-tool-schema.js";
|
|
4
|
-
import {
|
|
4
|
+
import { withTerminatingOutputDeclarations } from "./package-contracts/terminating-infrastructure.js";
|
|
5
5
|
const DOCTOR_EVIDENCE_TOOL_NAME = "ak_doctor_evidence";
|
|
6
6
|
const DOCTOR_OUTPUT_TOOL_NAME = "ak_doctor_output";
|
|
7
7
|
const DOCTOR_ACCEPTED_TEXT = "\u592A\u533B\u7F72\u56DE\u6267\u5DF2\u63A5\u53D7";
|
|
@@ -41,7 +41,7 @@ const doctorSubmissionVariants = Type.Union([
|
|
|
41
41
|
missingEvidence: Type.Array(Type.Object({ need: nonblank, targetKeys: evidenceIds }, { additionalProperties: true }), { description: "\u5982\u5B9E\u8BC1\u8BCD\u6240\u9700\u800C\u5C1A\u7F3A\u7684\u8BC1\u636E" })
|
|
42
42
|
}, { additionalProperties: false, description: "\u8BC1\u636E\u4E0D\u8DB3\u4EE5\u652F\u6491\u5982\u5B9E\u6848\u8BC1\u8BCD" })
|
|
43
43
|
]);
|
|
44
|
-
const doctorSubmissionSchema =
|
|
44
|
+
const doctorSubmissionSchema = withTerminatingOutputDeclarations(
|
|
45
45
|
openToolObjectFromUnion(doctorSubmissionVariants)
|
|
46
46
|
);
|
|
47
47
|
const doctorEvidenceReadSchema = Type.Object({ evidenceId: Type.String({ minLength: 1, description: "\u5F85\u8BFB\u7559\u5B58\u8BC1\u636E\u6807\u8BC6" }), offset: Type.Optional(Type.Integer({ minimum: 0, description: "\u8D77\u59CB\u5B57\u8282\u504F\u79FB\uFF08\u4ECE 0 \u8BA1\uFF09" })), limit: Type.Optional(Type.Integer({ minimum: 1, description: "\u8FD4\u56DE\u5B57\u8282\u6570\uFF08\u65E0\u4E0A\u9650\uFF09" })) }, { additionalProperties: true });
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { basename } from "node:path";
|
|
2
1
|
import { Type } from "typebox";
|
|
3
2
|
import {
|
|
4
3
|
ENGINE_DETOUR_TOOL_NAME,
|
|
@@ -12,12 +11,7 @@ import {
|
|
|
12
11
|
engineDetourStdoutByteLength,
|
|
13
12
|
reportEngineDetourCall
|
|
14
13
|
} from "./engine-detour-usage.js";
|
|
15
|
-
|
|
16
|
-
const leaf = basename(runDirectory);
|
|
17
|
-
const at = leaf.indexOf("@");
|
|
18
|
-
if (at <= 0) return void 0;
|
|
19
|
-
return leaf.slice(0, at);
|
|
20
|
-
}
|
|
14
|
+
import { runIdFromRunDirectory } from "./run-terminal-artifacts.js";
|
|
21
15
|
const engineDetourArgsSchema = Type.Object(
|
|
22
16
|
{
|
|
23
17
|
argv: Type.Array(Type.String({ minLength: 1 }), {
|
|
@@ -60,7 +54,7 @@ function createEngineDetourToolDefinition(input) {
|
|
|
60
54
|
const sessionParent = ctx.sessionManager?.getSessionFile?.();
|
|
61
55
|
const startedAt = Date.now();
|
|
62
56
|
const runDirectory = typeof ctx.runDirectory === "string" && ctx.runDirectory.length > 0 ? ctx.runDirectory : void 0;
|
|
63
|
-
const runId = runDirectory === void 0 ? void 0 :
|
|
57
|
+
const runId = runDirectory === void 0 ? void 0 : runIdFromRunDirectory(runDirectory);
|
|
64
58
|
const invocationScopeId = typeof ctx.invocationScopeId === "string" && ctx.invocationScopeId.trim() !== "" ? ctx.invocationScopeId.trim() : void 0;
|
|
65
59
|
const host = typeof ctx.host === "string" && ctx.host.trim() !== "" ? ctx.host.trim() : void 0;
|
|
66
60
|
const recordCall = (observed2) => {
|
package/dist/gatekeeper-role.js
CHANGED
|
@@ -178,8 +178,9 @@ function projectOfficerTerminal(officer, summoned) {
|
|
|
178
178
|
*/
|
|
179
179
|
export const OFFICER_CONCLUSION_REASK = "上次交卷的结论不是 pass、bounce、escalate 三态之一。请重新输出,结论字段写明其一;打回或上呈的话就是给对方看的原文。";
|
|
180
180
|
/**
|
|
181
|
-
* Summon + project
|
|
182
|
-
*
|
|
181
|
+
* Summon (via injected seam) + project. Default summonGateOfficer drive lives
|
|
182
|
+
* on the shared envelope (`gatekeeper-pass-envelope.ts`, ADR 0018 / #675) —
|
|
183
|
+
* role module keeps projection only.
|
|
183
184
|
*/
|
|
184
185
|
export async function projectGatekeeperRun(options) {
|
|
185
186
|
const officer = gateOfficerForSubject(options.subject);
|
|
@@ -198,23 +199,7 @@ export async function projectGatekeeperRun(options) {
|
|
|
198
199
|
// typed payload passed explicitly (never latest-toolCall recovery, A7.1–A7.3).
|
|
199
200
|
let summoned;
|
|
200
201
|
try {
|
|
201
|
-
|
|
202
|
-
?? (async (nextOfficer, sourceRunDirectory, officerSignal, reask, nextSubmission) => {
|
|
203
|
-
const { summonGateOfficer } = await import("./public-role-summons.js");
|
|
204
|
-
return summonGateOfficer({
|
|
205
|
-
officer: nextOfficer,
|
|
206
|
-
sourceRunDirectory,
|
|
207
|
-
cwd: options.context.cwd ?? process.cwd(),
|
|
208
|
-
...(officerSignal === undefined ? {} : { signal: officerSignal }),
|
|
209
|
-
...(reask === undefined ? {} : { reask }),
|
|
210
|
-
...(nextSubmission === undefined ? {} : { submission: nextSubmission }),
|
|
211
|
-
...(options.home === undefined ? {} : { home: options.home }),
|
|
212
|
-
...(options.packageRoot === undefined ? {} : { packageRoot: options.packageRoot }),
|
|
213
|
-
...(options.roleTurnHost === undefined ? {} : { roleTurnHost: options.roleTurnHost }),
|
|
214
|
-
...(options.createRunId === undefined ? {} : { createRunId: options.createRunId }),
|
|
215
|
-
});
|
|
216
|
-
});
|
|
217
|
-
summoned = await summon(officer, runDirectory, options.signal, options.reask, options.submission);
|
|
202
|
+
summoned = await options.summonOfficer(officer, runDirectory, options.signal, options.reask, options.submission);
|
|
218
203
|
}
|
|
219
204
|
catch (error) {
|
|
220
205
|
return {
|