@akagilnc/pi-workflow-roles 0.1.4321 → 0.1.4363
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acp-host/production-host.js +81 -99
- package/dist/doctor-contracts.js +2 -2
- package/dist/headless-host/production-host.js +81 -99
- package/dist/merger-contracts.js +2 -2
- package/dist/migrate-book-topology.js +13 -8
- 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/public-cli/case-dossier-delivery.js +45 -28
- package/dist/public-cli/main.js +71 -89
- package/dist/public-cli/post-admission.js +41 -41
- package/dist/public-cli/settlement.js +3 -53
- package/dist/sitian-appender.js +21 -4
- package/package.json +1 -1
- 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/gleaner-left-role.ts +2 -2
- 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/public-cli/case-dossier-delivery.ts +48 -29
- package/src/public-cli/post-admission.ts +42 -50
- package/src/public-cli/settlement.ts +3 -53
- package/src/reviewer-role.ts +2 -2
- package/src/sitian-appender.ts +36 -3
- package/src/worker-role.ts +2 -2
|
@@ -1284,10 +1284,15 @@ var init_open_tool_schema = __esm({
|
|
|
1284
1284
|
|
|
1285
1285
|
// src/package-contracts/terminating-infrastructure.ts
|
|
1286
1286
|
import { Type as Type3 } from "typebox";
|
|
1287
|
-
function
|
|
1287
|
+
function withTerminatingOutputDeclarations(schema) {
|
|
1288
1288
|
const baseProperties = schema.properties;
|
|
1289
1289
|
const properties = {
|
|
1290
1290
|
...baseProperties ?? {},
|
|
1291
|
+
...baseProperties?.ticketNumber === void 0 ? {
|
|
1292
|
+
ticketNumber: Type3.Unknown({
|
|
1293
|
+
description: "\u53EF\u9009\u672C\u7968\u53F7\uFF1A\u5C1A\u672A\u7ED1\u5B9A\u65F6\u7531\u89D2\u8272\u5728\u65E2\u6709\u56DE\u6267\u4E2D\u7533\u62A5\uFF1B\u673A\u68B0\u5C42\u53EA\u8BB0\u5F55\u5408\u6CD5\u6B63\u6574\u6570\uFF0C\u4E0D\u4ECE\u6563\u6587\u63A8\u5BFC\u3001\u4E0D\u9A8C\u771F\u3002\u7F3A\u5931\u6216\u9519\u5F62\u4E0D\u62D2\u6536\u3002"
|
|
1294
|
+
})
|
|
1295
|
+
} : {},
|
|
1291
1296
|
[INFRASTRUCTURE_FAILURE_DECLARATION_KEY]: infrastructureFailureDeclarationSchema.properties[INFRASTRUCTURE_FAILURE_DECLARATION_KEY]
|
|
1292
1297
|
};
|
|
1293
1298
|
const object = Type3.Object(properties, { additionalProperties: true });
|
|
@@ -1381,7 +1386,7 @@ var init_gatekeeper_output = __esm({
|
|
|
1381
1386
|
})
|
|
1382
1387
|
})
|
|
1383
1388
|
);
|
|
1384
|
-
gatekeeperOutputSchema =
|
|
1389
|
+
gatekeeperOutputSchema = withTerminatingOutputDeclarations(
|
|
1385
1390
|
gatekeeperDecisionSchema
|
|
1386
1391
|
);
|
|
1387
1392
|
}
|
|
@@ -1855,7 +1860,7 @@ var init_navigator_output = __esm({
|
|
|
1855
1860
|
init_terminating_infrastructure();
|
|
1856
1861
|
NAVIGATOR_OUTPUT_TOOL_NAME = "ak_navigator_output";
|
|
1857
1862
|
NAVIGATOR_ACCEPTED_TEXT = "\u6E38\u5955\u4F7F\u5EFA\u8BAE\u5DF2\u53D7\u7406";
|
|
1858
|
-
navigatorOutputSchema =
|
|
1863
|
+
navigatorOutputSchema = withTerminatingOutputDeclarations(
|
|
1859
1864
|
openToolObject(
|
|
1860
1865
|
Type5.Object({
|
|
1861
1866
|
status: Type5.Unknown({
|
|
@@ -1953,7 +1958,7 @@ var init_fixer_output = __esm({
|
|
|
1953
1958
|
Type6.Object({ status: Type6.Unknown({ description: FIXER_STATUS_DESCRIPTION }), report: Type6.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }), classResults: Type6.Array(classResultSchema, { description: "\u5404\u7C7B\u62D2\u7EDD\u7ED3\u7B97" }) }),
|
|
1954
1959
|
Type6.Object({ status: Type6.Unknown({ description: FIXER_STATUS_DESCRIPTION }), report: Type6.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }), classResults: Type6.Array(classResultSchema, { description: "\u5404\u7C7B\u5B8C\u6210\u6216\u62D2\u7EDD\u7ED3\u7B97" }), testEvidence: Type6.Optional(testEvidenceSchema) })
|
|
1955
1960
|
]);
|
|
1956
|
-
fixerOutputSchema =
|
|
1961
|
+
fixerOutputSchema = withTerminatingOutputDeclarations(
|
|
1957
1962
|
openToolObjectFromUnion(fixerOutputVariants)
|
|
1958
1963
|
);
|
|
1959
1964
|
}
|
|
@@ -2119,7 +2124,7 @@ var init_doctor_contracts = __esm({
|
|
|
2119
2124
|
missingEvidence: Type8.Array(Type8.Object({ need: nonblank, targetKeys: evidenceIds }, { additionalProperties: true }), { description: "\u5982\u5B9E\u8BC1\u8BCD\u6240\u9700\u800C\u5C1A\u7F3A\u7684\u8BC1\u636E" })
|
|
2120
2125
|
}, { additionalProperties: false, description: "\u8BC1\u636E\u4E0D\u8DB3\u4EE5\u652F\u6491\u5982\u5B9E\u6848\u8BC1\u8BCD" })
|
|
2121
2126
|
]);
|
|
2122
|
-
doctorSubmissionSchema =
|
|
2127
|
+
doctorSubmissionSchema = withTerminatingOutputDeclarations(
|
|
2123
2128
|
openToolObjectFromUnion(doctorSubmissionVariants)
|
|
2124
2129
|
);
|
|
2125
2130
|
doctorEvidenceReadSchema = Type8.Object({ evidenceId: Type8.String({ minLength: 1, description: "\u5F85\u8BFB\u7559\u5B58\u8BC1\u636E\u6807\u8BC6" }), offset: Type8.Optional(Type8.Integer({ minimum: 0, description: "\u8D77\u59CB\u5B57\u8282\u504F\u79FB\uFF08\u4ECE 0 \u8BA1\uFF09" })), limit: Type8.Optional(Type8.Integer({ minimum: 1, description: "\u8FD4\u56DE\u5B57\u8282\u6570\uFF08\u65E0\u4E0A\u9650\uFF09" })) }, { additionalProperties: true });
|
|
@@ -2237,7 +2242,7 @@ var init_merger_contracts = __esm({
|
|
|
2237
2242
|
Type9.Object({ status: Type9.Unknown({ description: MERGER_STATUS_DESCRIPTION }), attemptId: Type9.String({ description: "\u5DF2\u53D7\u7406\u5408\u5E76 attempt \u8EAB\u4EFD" }), report: Type9.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }), mergeCommitId: Type9.String({ description: "\u5B8C\u6210\u5408\u5E76 commit object ID" }) }, { additionalProperties: false }),
|
|
2238
2243
|
Type9.Object({ status: Type9.Unknown({ description: MERGER_STATUS_DESCRIPTION }), attemptId: Type9.String({ description: "\u5DF2\u53D7\u7406\u5408\u5E76 attempt \u8EAB\u4EFD" }), diagnosis: Type9.String({ description: "\u5408\u5E76\u65E0\u6CD5\u6216\u4E0D\u5E94\u7531\u672C\u5E2D\u5B8C\u6210\u7684\u539F\u56E0\uFF08\u542B\u65E0\u8FDB\u884C\u4E2D\u5408\u5E76\u3001\u65E0\u6D3B\u53EF\u5E72\u3001\u9700\u65B0\u7684\u4EA7\u54C1/\u6743\u529B\u51B3\u5B9A\uFF09" }), report: Type9.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }) }, { additionalProperties: false })
|
|
2239
2244
|
]);
|
|
2240
|
-
mergerOutputSchema =
|
|
2245
|
+
mergerOutputSchema = withTerminatingOutputDeclarations(openToolObjectFromUnion(mergerOutputVariants));
|
|
2241
2246
|
MERGER_OUTPUT_TOOL_NAME = "ak_merger_output";
|
|
2242
2247
|
MERGER_ACCEPTED_TEXT = "\u5408\u5E76\u56DE\u6267\u5DF2\u63A5\u53D7";
|
|
2243
2248
|
record2 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
@@ -2278,7 +2283,7 @@ var init_notary_contracts = __esm({
|
|
|
2278
2283
|
}
|
|
2279
2284
|
};
|
|
2280
2285
|
NOTARY_FIXED_KICKOFF = "\u7B26\u5B9D\u90CE\u6848\u5377\u5DF2\u53D7\u7406\uFF1B\u6765\u6E90 run \u5B9A\u4F4D\u89C1\u4F1A\u8BDD\u6750\u6599\u3002";
|
|
2281
|
-
notaryOutputSchema =
|
|
2286
|
+
notaryOutputSchema = withTerminatingOutputDeclarations(
|
|
2282
2287
|
openToolObject(
|
|
2283
2288
|
Type10.Object({
|
|
2284
2289
|
status: Type10.Unknown({
|
|
@@ -2333,7 +2338,7 @@ var init_auditor_output = __esm({
|
|
|
2333
2338
|
init_terminating_infrastructure();
|
|
2334
2339
|
AUDITOR_OUTPUT_TOOL_NAME = "ak_auditor_output";
|
|
2335
2340
|
AUDITOR_ACCEPTED_TEXT = "\u5BA1\u5211\u9662\u56DE\u6267\u5DF2\u63A5\u53D7";
|
|
2336
|
-
auditorOutputSchema =
|
|
2341
|
+
auditorOutputSchema = withTerminatingOutputDeclarations(
|
|
2337
2342
|
openToolObject(
|
|
2338
2343
|
Type11.Object({
|
|
2339
2344
|
status: Type11.Unknown({
|
|
@@ -3007,25 +3012,40 @@ function resolveSitianVolumeCategory(kind) {
|
|
|
3007
3012
|
}
|
|
3008
3013
|
return kind;
|
|
3009
3014
|
}
|
|
3015
|
+
function ticketProvenanceUnderBookPaths(ledgerHome, bookKey, ticketId) {
|
|
3016
|
+
const sessionDir = join8(activationBookDirectory(ledgerHome, bookKey), ticketId);
|
|
3017
|
+
return { sessionDir, recordFile: join8(sessionDir, SITIAN_RECORDS_LEAF) };
|
|
3018
|
+
}
|
|
3010
3019
|
function resolveSitianRecordPathInLedger(input, ledgerHome) {
|
|
3011
3020
|
const category = resolveSitianVolumeCategory(input.kind);
|
|
3012
3021
|
const ticketNumber = category === "ticket-provenance" ? typeof input.subject === "string" && /^[1-9][0-9]*$/.test(input.subject) ? input.subject : typeof input.subject === "object" && typeof input.subject.ticketNumber === "number" && Number.isSafeInteger(input.subject.ticketNumber) && input.subject.ticketNumber > 0 ? String(input.subject.ticketNumber) : void 0 : void 0;
|
|
3013
3022
|
let sessionDir;
|
|
3023
|
+
let recordFile;
|
|
3014
3024
|
if (ticketNumber !== void 0) {
|
|
3015
|
-
const
|
|
3025
|
+
const paths = ticketProvenanceUnderBookPaths(
|
|
3016
3026
|
ledgerHome,
|
|
3017
|
-
resolveBookKeyFromGit(input.cwd ?? process.cwd())
|
|
3027
|
+
resolveBookKeyFromGit(input.cwd ?? process.cwd()),
|
|
3028
|
+
ticketNumber
|
|
3018
3029
|
);
|
|
3019
|
-
sessionDir =
|
|
3030
|
+
sessionDir = paths.sessionDir;
|
|
3031
|
+
recordFile = paths.recordFile;
|
|
3020
3032
|
} else {
|
|
3021
3033
|
if (input.sessionParent === void 0 || input.sessionParent.length === 0 || !physicallyContainedIn(ledgerHome, input.sessionParent)) {
|
|
3022
3034
|
throw new Error("Sitian record ownership requires a parent session inside the ledger home");
|
|
3023
3035
|
}
|
|
3024
3036
|
sessionDir = join8(dirname5(input.sessionParent), category);
|
|
3037
|
+
recordFile = join8(sessionDir, SITIAN_RECORDS_LEAF);
|
|
3025
3038
|
}
|
|
3026
|
-
const recordFile = join8(sessionDir, "records.jsonl");
|
|
3027
3039
|
return { sessionDir, recordFile, ledgerHome };
|
|
3028
3040
|
}
|
|
3041
|
+
function projectTicketRecordsPathShape() {
|
|
3042
|
+
const { recordFile } = ticketProvenanceUnderBookPaths(
|
|
3043
|
+
join8("~", ".ak-roles"),
|
|
3044
|
+
"<\u7C3F>",
|
|
3045
|
+
"<\u7968\u53F7>"
|
|
3046
|
+
);
|
|
3047
|
+
return recordFile.replace(/\\/g, "/");
|
|
3048
|
+
}
|
|
3029
3049
|
function resolveSitianRecordPath(input) {
|
|
3030
3050
|
const ledgerHome = input.home !== void 0 && input.home.length > 0 ? resolveActivationLedgerHome(input.home) : resolveActivationLedgerHomeForPath(input.sessionParent);
|
|
3031
3051
|
return resolveSitianRecordPathInLedger(input, ledgerHome);
|
|
@@ -3062,7 +3082,7 @@ function appendSitianRecord(input) {
|
|
|
3062
3082
|
);
|
|
3063
3083
|
}
|
|
3064
3084
|
}
|
|
3065
|
-
var S4_SUBMISSION_LEDGER_KINDS;
|
|
3085
|
+
var S4_SUBMISSION_LEDGER_KINDS, SITIAN_RECORDS_LEAF;
|
|
3066
3086
|
var init_sitian_appender = __esm({
|
|
3067
3087
|
"src/sitian-appender.ts"() {
|
|
3068
3088
|
"use strict";
|
|
@@ -3076,6 +3096,7 @@ var init_sitian_appender = __esm({
|
|
|
3076
3096
|
"sealed",
|
|
3077
3097
|
"post-seal-anomaly"
|
|
3078
3098
|
]);
|
|
3099
|
+
SITIAN_RECORDS_LEAF = "records.jsonl";
|
|
3079
3100
|
}
|
|
3080
3101
|
});
|
|
3081
3102
|
|
|
@@ -13635,7 +13656,6 @@ __export(settlement_exports, {
|
|
|
13635
13656
|
publishMergerArtifacts: () => publishMergerArtifacts,
|
|
13636
13657
|
publishReviewerArtifacts: () => publishReviewerArtifacts,
|
|
13637
13658
|
raceNavigatorGrace: () => raceNavigatorGrace,
|
|
13638
|
-
readBoundAuditorKnownFailure: () => readBoundAuditorKnownFailure,
|
|
13639
13659
|
readBoundEvidenceChildKnownFailure: () => readBoundEvidenceChildKnownFailure,
|
|
13640
13660
|
readCollectorInfrastructureFailure: () => readCollectorInfrastructureFailure,
|
|
13641
13661
|
readEngineDetourInfrastructureFailure: () => readEngineDetourInfrastructureFailure,
|
|
@@ -14179,32 +14199,6 @@ async function loadBoundAuditorVolumes(sessionFile) {
|
|
|
14179
14199
|
}
|
|
14180
14200
|
const parentId = parentEntries.find((entry) => entry.type === "session")?.id;
|
|
14181
14201
|
if (parentId === void 0) return void 0;
|
|
14182
|
-
const isResumeEnvelopeBytes = (value) => {
|
|
14183
|
-
if (typeof value !== "string") return false;
|
|
14184
|
-
if (value.length === 0) return true;
|
|
14185
|
-
const nl = value.indexOf("\n");
|
|
14186
|
-
const firstLine = nl === -1 ? value : value.slice(0, nl);
|
|
14187
|
-
const body = firstLine === "" && nl !== -1 ? value.slice(nl + 1) : value;
|
|
14188
|
-
return body.startsWith("\u672C\u6B21\u914D\u7F6E\u7684\u52B3\u52A1\u5F15\u64CE\u53CA\u5176\u624B\u518C\uFF1A") || body.startsWith("- engine:");
|
|
14189
|
-
};
|
|
14190
|
-
const isResumeEnvelope = (msg) => {
|
|
14191
|
-
if (!isRecord11(msg) || msg.role !== "user") return false;
|
|
14192
|
-
const text = typeof msg.text === "string" ? msg.text : typeof msg.content === "string" ? msg.content : void 0;
|
|
14193
|
-
if (isResumeEnvelopeBytes(text)) return true;
|
|
14194
|
-
const content = msg.content;
|
|
14195
|
-
if (Array.isArray(content)) {
|
|
14196
|
-
return content.some((p) => isRecord11(p) && (isResumeEnvelopeBytes(p.text) || isResumeEnvelopeBytes(p.content)));
|
|
14197
|
-
}
|
|
14198
|
-
return false;
|
|
14199
|
-
};
|
|
14200
|
-
let latestParentUserIndex = -1;
|
|
14201
|
-
for (let i = parentEntries.length - 1; i >= 0; i -= 1) {
|
|
14202
|
-
const entry = parentEntries[i];
|
|
14203
|
-
if (entry?.type !== "message" || entry.message?.role !== "user") continue;
|
|
14204
|
-
if (isResumeEnvelope(entry.message)) continue;
|
|
14205
|
-
latestParentUserIndex = i;
|
|
14206
|
-
break;
|
|
14207
|
-
}
|
|
14208
14202
|
const childDirectories = [join26(dirname14(sessionFile), "auditor-roles")];
|
|
14209
14203
|
const valid = [];
|
|
14210
14204
|
let sawAnyDirectory = false;
|
|
@@ -14241,12 +14235,9 @@ async function loadBoundAuditorVolumes(sessionFile) {
|
|
|
14241
14235
|
for (const { entry: bindingEntry, start, end } of bindingPasses) {
|
|
14242
14236
|
const bindingParent = bindingEntry !== void 0 && isRecord11(bindingEntry.data) && isRecord11(bindingEntry.data.parent) ? bindingEntry.data.parent : void 0;
|
|
14243
14237
|
const attemptEntryId = typeof bindingParent?.attemptEntryId === "string" ? bindingParent.attemptEntryId : void 0;
|
|
14244
|
-
const attemptEntryIndex = attemptEntryId === void 0 ? -1 : parentEntries.findIndex((entry) => entry.id === attemptEntryId);
|
|
14245
14238
|
const boundSessionFile = typeof bindingParent?.sessionFile === "string" ? bindingParent.sessionFile : typeof header.parentSession === "string" ? header.parentSession : void 0;
|
|
14246
14239
|
if (boundSessionFile !== sessionFile) continue;
|
|
14247
|
-
if (bindingParent !== void 0 &&
|
|
14248
|
-
continue;
|
|
14249
|
-
}
|
|
14240
|
+
if (bindingParent !== void 0 && bindingParent.sessionId !== parentId) continue;
|
|
14250
14241
|
if (bindingParent === void 0 && header.parentSession !== sessionFile) continue;
|
|
14251
14242
|
valid.push({
|
|
14252
14243
|
entries: entries.slice(start, end),
|
|
@@ -14301,11 +14292,6 @@ function providerStopFallbackFromAuditorVolumes(volumes) {
|
|
|
14301
14292
|
}
|
|
14302
14293
|
return void 0;
|
|
14303
14294
|
}
|
|
14304
|
-
async function readBoundAuditorKnownFailure(sessionFile) {
|
|
14305
|
-
const volumes = await loadBoundAuditorVolumes(sessionFile);
|
|
14306
|
-
if (volumes === void 0) return void 0;
|
|
14307
|
-
return complianceFailureFromAuditorVolumes(volumes) ?? providerStopFallbackFromAuditorVolumes(volumes);
|
|
14308
|
-
}
|
|
14309
14295
|
async function readBoundAuditorComplianceFailure(sessionFile) {
|
|
14310
14296
|
const volumes = await loadBoundAuditorVolumes(sessionFile);
|
|
14311
14297
|
if (volumes === void 0) return void 0;
|
|
@@ -16875,11 +16861,14 @@ __export(case_dossier_delivery_exports, {
|
|
|
16875
16861
|
import { mkdtemp as mkdtemp2, readFile as readFile20, rm as rm2, writeFile as writeFile9 } from "node:fs/promises";
|
|
16876
16862
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
16877
16863
|
import { join as join29 } from "node:path";
|
|
16878
|
-
function describeDossierFile(path) {
|
|
16879
|
-
return path;
|
|
16880
|
-
}
|
|
16881
16864
|
async function projectCaseDossierPointerSection(input) {
|
|
16882
|
-
if (input.ticketNumber === void 0)
|
|
16865
|
+
if (input.ticketNumber === void 0) {
|
|
16866
|
+
return [
|
|
16867
|
+
UNBOUND_DOSSIER_PATH_HEADING,
|
|
16868
|
+
"",
|
|
16869
|
+
`\u8BB0\u5F55\u5377\u5B97\uFF1A${projectTicketRecordsPathShape()}`
|
|
16870
|
+
].join("\n");
|
|
16871
|
+
}
|
|
16883
16872
|
const volume = resolveTicketProvenanceVolume(
|
|
16884
16873
|
input.ticketNumber,
|
|
16885
16874
|
input.projectRoot,
|
|
@@ -16889,7 +16878,7 @@ async function projectCaseDossierPointerSection(input) {
|
|
|
16889
16878
|
CASE_DOSSIER_SECTION_HEADING,
|
|
16890
16879
|
"",
|
|
16891
16880
|
`\u7968\u53F7\uFF1A#${input.ticketNumber}`,
|
|
16892
|
-
`\u8BB0\u5F55\u5377\u5B97\uFF1A${
|
|
16881
|
+
`\u8BB0\u5F55\u5377\u5B97\uFF1A${volume.recordFile}`
|
|
16893
16882
|
].join("\n");
|
|
16894
16883
|
}
|
|
16895
16884
|
async function deliverCaseDossierAsAttachment(input) {
|
|
@@ -16898,7 +16887,6 @@ async function deliverCaseDossierAsAttachment(input) {
|
|
|
16898
16887
|
projectRoot: input.projectRoot,
|
|
16899
16888
|
home: input.home
|
|
16900
16889
|
});
|
|
16901
|
-
if (section === void 0) return void 0;
|
|
16902
16890
|
const stagingDir = await mkdtemp2(join29(tmpdir2(), "ak-case-dossier-"));
|
|
16903
16891
|
try {
|
|
16904
16892
|
const stagingPath = join29(stagingDir, CASE_DOSSIER_ATTACH_FILE);
|
|
@@ -16930,13 +16918,15 @@ async function loadCaseDossierReadingMaterial(runDirectory) {
|
|
|
16930
16918
|
if (section.trim() === "") return void 0;
|
|
16931
16919
|
return { kind: "case-dossier-pointer", frozenPath, section };
|
|
16932
16920
|
}
|
|
16933
|
-
var CASE_DOSSIER_SECTION_HEADING, CASE_DOSSIER_ATTACH_KEY, CASE_DOSSIER_ATTACH_FILE;
|
|
16921
|
+
var CASE_DOSSIER_SECTION_HEADING, UNBOUND_DOSSIER_PATH_HEADING, CASE_DOSSIER_ATTACH_KEY, CASE_DOSSIER_ATTACH_FILE;
|
|
16934
16922
|
var init_case_dossier_delivery = __esm({
|
|
16935
16923
|
"src/public-cli/case-dossier-delivery.ts"() {
|
|
16936
16924
|
"use strict";
|
|
16925
|
+
init_sitian_facade();
|
|
16937
16926
|
init_ticket_provenance();
|
|
16938
16927
|
init_invocation();
|
|
16939
16928
|
CASE_DOSSIER_SECTION_HEADING = "## \u672C\u7968\u8D77\u5C45\u5F55\uFF08\u7CFB\u7EDF\u968F\u6848\u63D0\u4F9B\uFF09";
|
|
16929
|
+
UNBOUND_DOSSIER_PATH_HEADING = "## \u8D77\u5C45\u5F55\u8DEF\u5F84\uFF08\u7CFB\u7EDF\u968F\u6848\u63D0\u4F9B\uFF09";
|
|
16940
16930
|
CASE_DOSSIER_ATTACH_KEY = "case-dossier";
|
|
16941
16931
|
CASE_DOSSIER_ATTACH_FILE = "case-dossier-pointer.md";
|
|
16942
16932
|
}
|
|
@@ -17435,12 +17425,6 @@ function describeCaughtError(error) {
|
|
|
17435
17425
|
}
|
|
17436
17426
|
return { message: String(error) };
|
|
17437
17427
|
}
|
|
17438
|
-
function appendContinuationSection(continuation, section) {
|
|
17439
|
-
const prompt = `${continuation.prompt}
|
|
17440
|
-
|
|
17441
|
-
${section}`;
|
|
17442
|
-
return continuation.kind === "initial" ? { kind: "initial", prompt } : { kind: "resume", prompt };
|
|
17443
|
-
}
|
|
17444
17428
|
function isStationChildOfficerDialogue(role, env) {
|
|
17445
17429
|
return env.stationChild === true && isOfficerReviewSeat(role);
|
|
17446
17430
|
}
|
|
@@ -17578,10 +17562,24 @@ async function dispatchPostAdmissionTurn(input) {
|
|
|
17578
17562
|
const shouldPresent = adapters.shouldPresentSettled ?? ((terminal) => isLawfulTypedTerminalOutcome(terminal.roleOutcome));
|
|
17579
17563
|
let afterDispatchApplied = false;
|
|
17580
17564
|
const finishAfterTurn = async (result) => {
|
|
17581
|
-
if (
|
|
17565
|
+
if (afterDispatchApplied) return result;
|
|
17582
17566
|
afterDispatchApplied = true;
|
|
17583
17567
|
try {
|
|
17584
|
-
|
|
17568
|
+
if (admitted.ticketNumber === void 0) {
|
|
17569
|
+
const rows = await readRecordedSubmissionRows(
|
|
17570
|
+
admitted.projectRoot,
|
|
17571
|
+
admitted.runId,
|
|
17572
|
+
{ home: homeFromRunDirectory(admitted.runDirectory), sessionParent: join32(admitted.runDirectory, "session", "session.jsonl") }
|
|
17573
|
+
);
|
|
17574
|
+
const asserted = rows.filter((row) => row.kind === "accepted" && row.role === admitted.role).map((row) => row.accepted).find((payload) => {
|
|
17575
|
+
if (payload === null || typeof payload !== "object" || Array.isArray(payload)) return false;
|
|
17576
|
+
const value = payload.ticketNumber;
|
|
17577
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value > 0;
|
|
17578
|
+
});
|
|
17579
|
+
const ticketNumber = asserted === void 0 ? void 0 : asserted.ticketNumber;
|
|
17580
|
+
if (ticketNumber !== void 0) await bindAdmittedTicketNumber(admitted, ticketNumber);
|
|
17581
|
+
}
|
|
17582
|
+
if (adapters.afterDispatch !== void 0) await adapters.afterDispatch(admitted, lease);
|
|
17585
17583
|
return result;
|
|
17586
17584
|
} catch (error) {
|
|
17587
17585
|
const primaryFailure = result.terminal !== void 0 && !isLawfulTypedTerminalOutcome(result.terminal.roleOutcome);
|
|
@@ -17696,29 +17694,12 @@ async function dispatchPostAdmissionTurn(input) {
|
|
|
17696
17694
|
if (typeof liveHost === "string" && liveHost.trim() !== "") {
|
|
17697
17695
|
turnRequest = { ...turnRequest, host: liveHost.trim() };
|
|
17698
17696
|
}
|
|
17699
|
-
|
|
17700
|
-
|
|
17701
|
-
|
|
17702
|
-
|
|
17703
|
-
|
|
17704
|
-
|
|
17705
|
-
});
|
|
17706
|
-
} else {
|
|
17707
|
-
const dossierSection = await projectCaseDossierPointerSection({
|
|
17708
|
-
ticketNumber: admitted.ticketNumber,
|
|
17709
|
-
projectRoot: admitted.projectRoot,
|
|
17710
|
-
home: env.home
|
|
17711
|
-
});
|
|
17712
|
-
if (dossierSection !== void 0) {
|
|
17713
|
-
turnRequest = {
|
|
17714
|
-
...turnRequest,
|
|
17715
|
-
continuation: appendContinuationSection(
|
|
17716
|
-
turnRequest.continuation,
|
|
17717
|
-
dossierSection
|
|
17718
|
-
)
|
|
17719
|
-
};
|
|
17720
|
-
}
|
|
17721
|
-
}
|
|
17697
|
+
await deliverCaseDossierAsAttachment({
|
|
17698
|
+
ticketNumber: admitted.ticketNumber,
|
|
17699
|
+
projectRoot: admitted.projectRoot,
|
|
17700
|
+
home: env.home,
|
|
17701
|
+
runDirectory: admitted.runDirectory
|
|
17702
|
+
});
|
|
17722
17703
|
await markRunRunning(
|
|
17723
17704
|
admitted.runDirectory,
|
|
17724
17705
|
env.model,
|
|
@@ -18306,6 +18287,7 @@ var init_post_admission = __esm({
|
|
|
18306
18287
|
init_run_lifecycle();
|
|
18307
18288
|
init_cli_errors();
|
|
18308
18289
|
init_invocation();
|
|
18290
|
+
init_submission_ledger();
|
|
18309
18291
|
init_activation_ledger_topology();
|
|
18310
18292
|
init_engine_material();
|
|
18311
18293
|
init_session_identity();
|
|
@@ -19654,8 +19636,8 @@ async function summonPublicRole(options) {
|
|
|
19654
19636
|
async function summonGateOfficer(options) {
|
|
19655
19637
|
let home = options.home;
|
|
19656
19638
|
if (home === void 0) {
|
|
19657
|
-
const { homeFromRunDirectory:
|
|
19658
|
-
home =
|
|
19639
|
+
const { homeFromRunDirectory: homeFromRunDirectory2 } = await Promise.resolve().then(() => (init_activation_ledger_topology(), activation_ledger_topology_exports));
|
|
19640
|
+
home = homeFromRunDirectory2(options.sourceRunDirectory);
|
|
19659
19641
|
}
|
|
19660
19642
|
let gateReviewInstruction;
|
|
19661
19643
|
if (options.reask === void 0 && options.submission !== void 0) {
|
|
@@ -20075,8 +20057,8 @@ async function runComplianceAudit(options) {
|
|
|
20075
20057
|
const subject = options.subject;
|
|
20076
20058
|
const summon = options.summonAuditor ?? (async (auditSubject, sourceRunDirectory, auditSignal, reask2) => {
|
|
20077
20059
|
const { summonPublicRole: summonPublicRole2 } = await Promise.resolve().then(() => (init_public_role_summons(), public_role_summons_exports));
|
|
20078
|
-
const { homeFromRunDirectory:
|
|
20079
|
-
const home =
|
|
20060
|
+
const { homeFromRunDirectory: homeFromRunDirectory2 } = await Promise.resolve().then(() => (init_activation_ledger_topology(), activation_ledger_topology_exports));
|
|
20061
|
+
const home = homeFromRunDirectory2(sourceRunDirectory);
|
|
20080
20062
|
return await summonPublicRole2({
|
|
20081
20063
|
role: "auditor",
|
|
20082
20064
|
argv: [
|
|
@@ -22360,7 +22342,7 @@ var collectorOutputBaseSchema = openToolObject(
|
|
|
22360
22342
|
})
|
|
22361
22343
|
})
|
|
22362
22344
|
);
|
|
22363
|
-
var collectorOutputArgsSchema =
|
|
22345
|
+
var collectorOutputArgsSchema = withTerminatingOutputDeclarations(
|
|
22364
22346
|
collectorOutputBaseSchema
|
|
22365
22347
|
);
|
|
22366
22348
|
|
|
@@ -23207,7 +23189,7 @@ init_terminating_infrastructure();
|
|
|
23207
23189
|
init_countersign_contracts();
|
|
23208
23190
|
init_countersign_contracts();
|
|
23209
23191
|
import { Type as Type18 } from "typebox";
|
|
23210
|
-
var countersignVerdictSchema =
|
|
23192
|
+
var countersignVerdictSchema = withTerminatingOutputDeclarations(
|
|
23211
23193
|
Type18.Object(
|
|
23212
23194
|
{
|
|
23213
23195
|
countersignStatus: Type18.Unknown({ description: "converged | continue | escalate\u3002\u975E\u4E09\u6001\u65F6\u8BF7\u91CD\u8BFB\u540E\u91CD\u4EA4\uFF0C\u52FF\u6539\u6807\u3002" }),
|
|
@@ -23250,7 +23232,7 @@ init_terminating_infrastructure();
|
|
|
23250
23232
|
init_gleaner_left_contracts();
|
|
23251
23233
|
init_gleaner_left_contracts();
|
|
23252
23234
|
import { Type as Type19 } from "typebox";
|
|
23253
|
-
var gleanerLeftOutputSchema =
|
|
23235
|
+
var gleanerLeftOutputSchema = withTerminatingOutputDeclarations(
|
|
23254
23236
|
openToolObject(
|
|
23255
23237
|
Type19.Object({
|
|
23256
23238
|
status: Type19.Unknown({
|
|
@@ -23285,7 +23267,7 @@ init_open_tool_schema();
|
|
|
23285
23267
|
init_terminating_infrastructure();
|
|
23286
23268
|
init_inspector_contracts();
|
|
23287
23269
|
import { Type as Type20 } from "typebox";
|
|
23288
|
-
var inspectorOutputSchema =
|
|
23270
|
+
var inspectorOutputSchema = withTerminatingOutputDeclarations(
|
|
23289
23271
|
openToolObject(
|
|
23290
23272
|
Type20.Object({
|
|
23291
23273
|
status: Type20.Unknown({
|
|
@@ -23317,7 +23299,7 @@ init_terminating_infrastructure();
|
|
|
23317
23299
|
init_diarist_contracts();
|
|
23318
23300
|
init_diarist_contracts();
|
|
23319
23301
|
import { Type as Type21 } from "typebox";
|
|
23320
|
-
var diaristOutputSchema =
|
|
23302
|
+
var diaristOutputSchema = withTerminatingOutputDeclarations(
|
|
23321
23303
|
openToolObject(
|
|
23322
23304
|
Type21.Object({
|
|
23323
23305
|
status: Type21.Unknown({
|
|
@@ -23488,7 +23470,7 @@ init_judge_output();
|
|
|
23488
23470
|
import { Type as Type22 } from "typebox";
|
|
23489
23471
|
var JUDGE_QUEUE_STATUSES = /* @__PURE__ */ new Set(["converged", "continue", "escalate"]);
|
|
23490
23472
|
var JUDGE_STATUS_REASK = "judgeStatus \u4E0D\u662F converged\u3001continue\u3001escalate \u4E09\u6001\u4E4B\u4E00\u3002\u8BF7\u91CD\u65B0\u4EA4\u5377\uFF0Cstatus \u5199\u660E\u5176\u4E00\u3002";
|
|
23491
|
-
var judgeVerdictSchema =
|
|
23473
|
+
var judgeVerdictSchema = withTerminatingOutputDeclarations(
|
|
23492
23474
|
Type22.Object(
|
|
23493
23475
|
{
|
|
23494
23476
|
judgeStatus: Type22.Unknown({ description: "converged | continue | escalate \u2014 \u5F62\u72B6\u6307\u5F15\uFF0C\u975E schema \u95F8" }),
|
|
@@ -23615,7 +23597,7 @@ var reviewerOutputVariants = Type23.Union([
|
|
|
23615
23597
|
amendments: Type23.Optional(reviewerAmendmentsSchema)
|
|
23616
23598
|
}, { additionalProperties: false })
|
|
23617
23599
|
]);
|
|
23618
|
-
var reviewerOutputSchema =
|
|
23600
|
+
var reviewerOutputSchema = withTerminatingOutputDeclarations(
|
|
23619
23601
|
openToolObjectFromUnion(reviewerOutputVariants)
|
|
23620
23602
|
);
|
|
23621
23603
|
function createReviewerRoleRuntime(pi, dependencies, _hostActions) {
|
|
@@ -23952,7 +23934,7 @@ var coderOutputVariants = Type24.Union([
|
|
|
23952
23934
|
}))
|
|
23953
23935
|
}, { additionalProperties: false })
|
|
23954
23936
|
]);
|
|
23955
|
-
var coderOutputSchema =
|
|
23937
|
+
var coderOutputSchema = withTerminatingOutputDeclarations(
|
|
23956
23938
|
openToolObjectFromUnion(coderOutputVariants)
|
|
23957
23939
|
);
|
|
23958
23940
|
var FIXER_FLAG_DEFINITIONS = {
|
package/dist/merger-contracts.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
2
|
import { exactUtf8 } from "./exact-utf8.js";
|
|
3
3
|
import { openToolObjectFromUnion } from "./open-tool-schema.js";
|
|
4
|
-
import {
|
|
4
|
+
import { withTerminatingOutputDeclarations } from "./package-contracts/terminating-infrastructure.js";
|
|
5
5
|
const materialSchema = Type.Object({ bytesBase64: Type.String(), sha256: Type.String() }, { additionalProperties: false });
|
|
6
6
|
const checkSchema = Type.Object({ name: Type.String({ minLength: 1 }), argv: Type.Array(Type.String({ minLength: 1 }), { minItems: 1 }) }, { additionalProperties: false });
|
|
7
7
|
const mergerInputSchema = Type.Object({
|
|
@@ -18,7 +18,7 @@ const mergerOutputVariants = Type.Union([
|
|
|
18
18
|
Type.Object({ status: Type.Unknown({ description: MERGER_STATUS_DESCRIPTION }), attemptId: Type.String({ description: "\u5DF2\u53D7\u7406\u5408\u5E76 attempt \u8EAB\u4EFD" }), report: Type.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }), mergeCommitId: Type.String({ description: "\u5B8C\u6210\u5408\u5E76 commit object ID" }) }, { additionalProperties: false }),
|
|
19
19
|
Type.Object({ status: Type.Unknown({ description: MERGER_STATUS_DESCRIPTION }), attemptId: Type.String({ description: "\u5DF2\u53D7\u7406\u5408\u5E76 attempt \u8EAB\u4EFD" }), diagnosis: Type.String({ description: "\u5408\u5E76\u65E0\u6CD5\u6216\u4E0D\u5E94\u7531\u672C\u5E2D\u5B8C\u6210\u7684\u539F\u56E0\uFF08\u542B\u65E0\u8FDB\u884C\u4E2D\u5408\u5E76\u3001\u65E0\u6D3B\u53EF\u5E72\u3001\u9700\u65B0\u7684\u4EA7\u54C1/\u6743\u529B\u51B3\u5B9A\uFF09" }), report: Type.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }) }, { additionalProperties: false })
|
|
20
20
|
]);
|
|
21
|
-
const mergerOutputSchema =
|
|
21
|
+
const mergerOutputSchema = withTerminatingOutputDeclarations(openToolObjectFromUnion(mergerOutputVariants));
|
|
22
22
|
const MERGER_OUTPUT_TOOL_NAME = "ak_merger_output";
|
|
23
23
|
const MERGER_ACCEPTED_TEXT = "\u5408\u5E76\u56DE\u6267\u5DF2\u63A5\u53D7";
|
|
24
24
|
const record = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
@@ -8112,10 +8112,15 @@ var init_open_tool_schema = __esm({
|
|
|
8112
8112
|
});
|
|
8113
8113
|
|
|
8114
8114
|
// src/package-contracts/terminating-infrastructure.ts
|
|
8115
|
-
function
|
|
8115
|
+
function withTerminatingOutputDeclarations(schema) {
|
|
8116
8116
|
const baseProperties = schema.properties;
|
|
8117
8117
|
const properties = {
|
|
8118
8118
|
...baseProperties ?? {},
|
|
8119
|
+
...baseProperties?.ticketNumber === void 0 ? {
|
|
8120
|
+
ticketNumber: typebox_exports.Unknown({
|
|
8121
|
+
description: "\u53EF\u9009\u672C\u7968\u53F7\uFF1A\u5C1A\u672A\u7ED1\u5B9A\u65F6\u7531\u89D2\u8272\u5728\u65E2\u6709\u56DE\u6267\u4E2D\u7533\u62A5\uFF1B\u673A\u68B0\u5C42\u53EA\u8BB0\u5F55\u5408\u6CD5\u6B63\u6574\u6570\uFF0C\u4E0D\u4ECE\u6563\u6587\u63A8\u5BFC\u3001\u4E0D\u9A8C\u771F\u3002\u7F3A\u5931\u6216\u9519\u5F62\u4E0D\u62D2\u6536\u3002"
|
|
8122
|
+
})
|
|
8123
|
+
} : {},
|
|
8119
8124
|
[INFRASTRUCTURE_FAILURE_DECLARATION_KEY]: infrastructureFailureDeclarationSchema.properties[INFRASTRUCTURE_FAILURE_DECLARATION_KEY]
|
|
8120
8125
|
};
|
|
8121
8126
|
const object2 = typebox_exports.Object(properties, { additionalProperties: true });
|
|
@@ -8171,7 +8176,7 @@ var init_gatekeeper_output = __esm({
|
|
|
8171
8176
|
})
|
|
8172
8177
|
})
|
|
8173
8178
|
);
|
|
8174
|
-
gatekeeperOutputSchema =
|
|
8179
|
+
gatekeeperOutputSchema = withTerminatingOutputDeclarations(
|
|
8175
8180
|
gatekeeperDecisionSchema
|
|
8176
8181
|
);
|
|
8177
8182
|
}
|
|
@@ -8647,7 +8652,7 @@ var init_doctor_contracts = __esm({
|
|
|
8647
8652
|
missingEvidence: typebox_exports.Array(typebox_exports.Object({ need: nonblank, targetKeys: evidenceIds }, { additionalProperties: true }), { description: "\u5982\u5B9E\u8BC1\u8BCD\u6240\u9700\u800C\u5C1A\u7F3A\u7684\u8BC1\u636E" })
|
|
8648
8653
|
}, { additionalProperties: false, description: "\u8BC1\u636E\u4E0D\u8DB3\u4EE5\u652F\u6491\u5982\u5B9E\u6848\u8BC1\u8BCD" })
|
|
8649
8654
|
]);
|
|
8650
|
-
doctorSubmissionSchema =
|
|
8655
|
+
doctorSubmissionSchema = withTerminatingOutputDeclarations(
|
|
8651
8656
|
openToolObjectFromUnion(doctorSubmissionVariants)
|
|
8652
8657
|
);
|
|
8653
8658
|
doctorEvidenceReadSchema = typebox_exports.Object({ evidenceId: typebox_exports.String({ minLength: 1, description: "\u5F85\u8BFB\u7559\u5B58\u8BC1\u636E\u6807\u8BC6" }), offset: typebox_exports.Optional(typebox_exports.Integer({ minimum: 0, description: "\u8D77\u59CB\u5B57\u8282\u504F\u79FB\uFF08\u4ECE 0 \u8BA1\uFF09" })), limit: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, description: "\u8FD4\u56DE\u5B57\u8282\u6570\uFF08\u65E0\u4E0A\u9650\uFF09" })) }, { additionalProperties: true });
|
|
@@ -8662,7 +8667,7 @@ var init_navigator_output = __esm({
|
|
|
8662
8667
|
init_build();
|
|
8663
8668
|
init_open_tool_schema();
|
|
8664
8669
|
init_terminating_infrastructure();
|
|
8665
|
-
navigatorOutputSchema =
|
|
8670
|
+
navigatorOutputSchema = withTerminatingOutputDeclarations(
|
|
8666
8671
|
openToolObject(
|
|
8667
8672
|
typebox_exports.Object({
|
|
8668
8673
|
status: typebox_exports.Unknown({
|
|
@@ -8685,7 +8690,7 @@ var init_auditor_output = __esm({
|
|
|
8685
8690
|
init_build();
|
|
8686
8691
|
init_open_tool_schema();
|
|
8687
8692
|
init_terminating_infrastructure();
|
|
8688
|
-
auditorOutputSchema =
|
|
8693
|
+
auditorOutputSchema = withTerminatingOutputDeclarations(
|
|
8689
8694
|
openToolObject(
|
|
8690
8695
|
typebox_exports.Object({
|
|
8691
8696
|
status: typebox_exports.Unknown({
|
|
@@ -8740,7 +8745,7 @@ var init_merger_contracts = __esm({
|
|
|
8740
8745
|
typebox_exports.Object({ status: typebox_exports.Unknown({ description: MERGER_STATUS_DESCRIPTION }), attemptId: typebox_exports.String({ description: "\u5DF2\u53D7\u7406\u5408\u5E76 attempt \u8EAB\u4EFD" }), report: typebox_exports.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }), mergeCommitId: typebox_exports.String({ description: "\u5B8C\u6210\u5408\u5E76 commit object ID" }) }, { additionalProperties: false }),
|
|
8741
8746
|
typebox_exports.Object({ status: typebox_exports.Unknown({ description: MERGER_STATUS_DESCRIPTION }), attemptId: typebox_exports.String({ description: "\u5DF2\u53D7\u7406\u5408\u5E76 attempt \u8EAB\u4EFD" }), diagnosis: typebox_exports.String({ description: "\u5408\u5E76\u65E0\u6CD5\u6216\u4E0D\u5E94\u7531\u672C\u5E2D\u5B8C\u6210\u7684\u539F\u56E0\uFF08\u542B\u65E0\u8FDB\u884C\u4E2D\u5408\u5E76\u3001\u65E0\u6D3B\u53EF\u5E72\u3001\u9700\u65B0\u7684\u4EA7\u54C1/\u6743\u529B\u51B3\u5B9A\uFF09" }), report: typebox_exports.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }) }, { additionalProperties: false })
|
|
8742
8747
|
]);
|
|
8743
|
-
mergerOutputSchema =
|
|
8748
|
+
mergerOutputSchema = withTerminatingOutputDeclarations(openToolObjectFromUnion(mergerOutputVariants));
|
|
8744
8749
|
}
|
|
8745
8750
|
});
|
|
8746
8751
|
|
|
@@ -8752,7 +8757,7 @@ var init_notary_contracts = __esm({
|
|
|
8752
8757
|
init_build();
|
|
8753
8758
|
init_open_tool_schema();
|
|
8754
8759
|
init_terminating_infrastructure();
|
|
8755
|
-
notaryOutputSchema =
|
|
8760
|
+
notaryOutputSchema = withTerminatingOutputDeclarations(
|
|
8756
8761
|
openToolObject(
|
|
8757
8762
|
typebox_exports.Object({
|
|
8758
8763
|
status: typebox_exports.Unknown({
|
|
@@ -8826,7 +8831,7 @@ var init_fixer_output = __esm({
|
|
|
8826
8831
|
typebox_exports.Object({ status: typebox_exports.Unknown({ description: FIXER_STATUS_DESCRIPTION }), report: typebox_exports.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }), classResults: typebox_exports.Array(classResultSchema, { description: "\u5404\u7C7B\u62D2\u7EDD\u7ED3\u7B97" }) }),
|
|
8827
8832
|
typebox_exports.Object({ status: typebox_exports.Unknown({ description: FIXER_STATUS_DESCRIPTION }), report: typebox_exports.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }), classResults: typebox_exports.Array(classResultSchema, { description: "\u5404\u7C7B\u5B8C\u6210\u6216\u62D2\u7EDD\u7ED3\u7B97" }), testEvidence: typebox_exports.Optional(testEvidenceSchema) })
|
|
8828
8833
|
]);
|
|
8829
|
-
fixerOutputSchema =
|
|
8834
|
+
fixerOutputSchema = withTerminatingOutputDeclarations(
|
|
8830
8835
|
openToolObjectFromUnion(fixerOutputVariants)
|
|
8831
8836
|
);
|
|
8832
8837
|
}
|
package/dist/notary-contracts.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
2
|
import { openToolObject } from "./open-tool-schema.js";
|
|
3
|
-
import {
|
|
3
|
+
import { withTerminatingOutputDeclarations } from "./package-contracts/terminating-infrastructure.js";
|
|
4
4
|
const NOTARY_OUTPUT_TOOL_NAME = "ak_notary_output";
|
|
5
5
|
const NOTARY_ACCEPTED_TEXT = "\u7B26\u5B9D\u90CE\u56DE\u6267\u5DF2\u63A5\u53D7";
|
|
6
6
|
const NOTARY_SOURCE_RUN_FLAG = {
|
|
@@ -18,7 +18,7 @@ const NOTARY_TICKET_FLAG = {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
const NOTARY_FIXED_KICKOFF = "\u7B26\u5B9D\u90CE\u6848\u5377\u5DF2\u53D7\u7406\uFF1B\u6765\u6E90 run \u5B9A\u4F4D\u89C1\u4F1A\u8BDD\u6750\u6599\u3002";
|
|
21
|
-
const notaryOutputSchema =
|
|
21
|
+
const notaryOutputSchema = withTerminatingOutputDeclarations(
|
|
22
22
|
openToolObject(
|
|
23
23
|
Type.Object({
|
|
24
24
|
status: Type.Unknown({
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Type } from "typebox";
|
|
6
6
|
import { openToolObject } from "../open-tool-schema.js";
|
|
7
|
-
import {
|
|
7
|
+
import { withTerminatingOutputDeclarations } from "./terminating-infrastructure.js";
|
|
8
8
|
export const AUDITOR_OUTPUT_TOOL_NAME = "ak_auditor_output";
|
|
9
9
|
export const AUDITOR_ACCEPTED_TEXT = "审刑院回执已接受";
|
|
10
|
-
export const auditorOutputSchema =
|
|
10
|
+
export const auditorOutputSchema = withTerminatingOutputDeclarations(openToolObject(Type.Object({
|
|
11
11
|
status: Type.Unknown({
|
|
12
12
|
description: "pass | bounce | escalate — 形状指引,非 schema 闸",
|
|
13
13
|
}),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
2
|
import { openToolObjectFromUnion } from "../open-tool-schema.js";
|
|
3
|
-
import {
|
|
3
|
+
import { withTerminatingOutputDeclarations } from "./terminating-infrastructure.js";
|
|
4
4
|
const FIXER_OUTPUT_TOOL_NAME = "ak_fixer_output";
|
|
5
5
|
const FIXER_ACCEPTED_TEXT = "\u4FEE\u5185\u53F8\u56DE\u6267\u5DF2\u63A5\u53D7";
|
|
6
6
|
const transportString = Type.String();
|
|
@@ -37,7 +37,7 @@ const fixerOutputVariants = Type.Union([
|
|
|
37
37
|
Type.Object({ status: Type.Unknown({ description: FIXER_STATUS_DESCRIPTION }), report: Type.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }), classResults: Type.Array(classResultSchema, { description: "\u5404\u7C7B\u62D2\u7EDD\u7ED3\u7B97" }) }),
|
|
38
38
|
Type.Object({ status: Type.Unknown({ description: FIXER_STATUS_DESCRIPTION }), report: Type.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }), classResults: Type.Array(classResultSchema, { description: "\u5404\u7C7B\u5B8C\u6210\u6216\u62D2\u7EDD\u7ED3\u7B97" }), testEvidence: Type.Optional(testEvidenceSchema) })
|
|
39
39
|
]);
|
|
40
|
-
const fixerOutputSchema =
|
|
40
|
+
const fixerOutputSchema = withTerminatingOutputDeclarations(
|
|
41
41
|
openToolObjectFromUnion(fixerOutputVariants)
|
|
42
42
|
);
|
|
43
43
|
function validateFixerOutput(value, _phase) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
2
|
import { openToolObject } from "../open-tool-schema.js";
|
|
3
|
-
import {
|
|
3
|
+
import { withTerminatingOutputDeclarations } from "./terminating-infrastructure.js";
|
|
4
4
|
const GATEKEEPER_OUTPUT_TOOL_NAME = "ak_gatekeeper_output";
|
|
5
5
|
const GATEKEEPER_ACCEPTED_TEXT = "\u95E8\u4E0B\u7701\u51B3\u8BAE\u5DF2\u53D7\u7406";
|
|
6
6
|
const gatekeeperDecisionSchema = openToolObject(
|
|
@@ -16,7 +16,7 @@ const gatekeeperDecisionSchema = openToolObject(
|
|
|
16
16
|
})
|
|
17
17
|
})
|
|
18
18
|
);
|
|
19
|
-
const gatekeeperOutputSchema =
|
|
19
|
+
const gatekeeperOutputSchema = withTerminatingOutputDeclarations(
|
|
20
20
|
gatekeeperDecisionSchema
|
|
21
21
|
);
|
|
22
22
|
function isRecord(value) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
2
|
import { openToolObject } from "../open-tool-schema.js";
|
|
3
|
-
import {
|
|
3
|
+
import { withTerminatingOutputDeclarations } from "./terminating-infrastructure.js";
|
|
4
4
|
const NAVIGATOR_OUTPUT_TOOL_NAME = "ak_navigator_output";
|
|
5
5
|
const NAVIGATOR_ACCEPTED_TEXT = "\u6E38\u5955\u4F7F\u5EFA\u8BAE\u5DF2\u53D7\u7406";
|
|
6
|
-
const navigatorOutputSchema =
|
|
6
|
+
const navigatorOutputSchema = withTerminatingOutputDeclarations(
|
|
7
7
|
openToolObject(
|
|
8
8
|
Type.Object({
|
|
9
9
|
status: Type.Unknown({
|
|
@@ -19,10 +19,15 @@ const infrastructureFailureDeclarationSchema = Type.Object(
|
|
|
19
19
|
},
|
|
20
20
|
{ additionalProperties: true }
|
|
21
21
|
);
|
|
22
|
-
function
|
|
22
|
+
function withTerminatingOutputDeclarations(schema) {
|
|
23
23
|
const baseProperties = schema.properties;
|
|
24
24
|
const properties = {
|
|
25
25
|
...baseProperties ?? {},
|
|
26
|
+
...baseProperties?.ticketNumber === void 0 ? {
|
|
27
|
+
ticketNumber: Type.Unknown({
|
|
28
|
+
description: "\u53EF\u9009\u672C\u7968\u53F7\uFF1A\u5C1A\u672A\u7ED1\u5B9A\u65F6\u7531\u89D2\u8272\u5728\u65E2\u6709\u56DE\u6267\u4E2D\u7533\u62A5\uFF1B\u673A\u68B0\u5C42\u53EA\u8BB0\u5F55\u5408\u6CD5\u6B63\u6574\u6570\uFF0C\u4E0D\u4ECE\u6563\u6587\u63A8\u5BFC\u3001\u4E0D\u9A8C\u771F\u3002\u7F3A\u5931\u6216\u9519\u5F62\u4E0D\u62D2\u6536\u3002"
|
|
29
|
+
})
|
|
30
|
+
} : {},
|
|
26
31
|
[INFRASTRUCTURE_FAILURE_DECLARATION_KEY]: infrastructureFailureDeclarationSchema.properties[INFRASTRUCTURE_FAILURE_DECLARATION_KEY]
|
|
27
32
|
};
|
|
28
33
|
const object = Type.Object(properties, { additionalProperties: true });
|
|
@@ -70,5 +75,5 @@ export {
|
|
|
70
75
|
INFRASTRUCTURE_FAILURE_DECLARATION_KEY,
|
|
71
76
|
INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY,
|
|
72
77
|
failOnInfrastructureFailureDeclaration,
|
|
73
|
-
|
|
78
|
+
withTerminatingOutputDeclarations
|
|
74
79
|
};
|