@akagilnc/pi-workflow-roles 0.1.5368 → 0.1.5382
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 +1192 -1195
- package/dist/activation-ledger-git.js +2 -2
- package/dist/activation-ledger-topology.js +1 -7
- package/dist/analyst-entry.js +4 -8
- package/dist/analyst-gate-cycles-read.js +3 -11
- package/dist/analyst-index.js +3 -9
- package/dist/analyst-ledger.js +1 -11
- package/dist/analyst-metric-families/acceptance-success-rework.js +1 -3
- package/dist/analyst-metric-families/round-timeline.js +1 -3
- package/dist/analyst-page.js +2 -2
- package/dist/archivist-record-topology.js +2 -2
- package/dist/audit-escalation.js +2 -1
- package/dist/auditor-soul.js +2 -1
- package/dist/collector-config.js +6 -8
- package/dist/collector-tool-schemas.js +18 -0
- package/dist/compliance-transport.js +2 -1
- package/dist/countersign-contracts.js +2 -1
- package/dist/diarist-contracts.js +29 -2
- package/dist/doctor-contracts.js +1 -3
- package/dist/doctor-evidence.js +7 -8
- package/dist/dossier-resolution.js +1 -3
- package/dist/engine-detour-usage.js +1 -3
- package/dist/filed-submission.js +28 -0
- package/dist/gatekeeper-role.js +8 -19
- package/dist/gleaner-left-contracts.js +18 -1
- package/dist/headless-host/description.js +14 -17
- package/dist/headless-host/production-host.js +1210 -1215
- package/dist/host-session-record.js +3 -2
- package/dist/inspector-contracts.js +2 -1
- package/dist/judge-role.js +8 -16
- package/dist/ledger-session-read.js +1 -3
- package/dist/merger-contracts.js +9 -9
- package/dist/migrate-book-topology.js +610 -321
- package/dist/navigator-attendance.js +9 -11
- package/dist/navigator-invocation-identity.js +3 -2
- package/dist/navigator-public-session.js +3 -5
- package/dist/navigator-session-contracts.js +8 -10
- package/dist/navigator-work-base.js +5 -8
- package/dist/notary-contracts.js +3 -5
- package/dist/package-contracts/auditor-output.js +1 -3
- package/dist/package-contracts/fixer-packet.js +3 -6
- package/dist/package-contracts/gatekeeper-output.js +1 -3
- package/dist/package-contracts/navigator-output.js +8 -8
- package/dist/package-contracts/reviewer-output.js +16 -0
- package/dist/package-contracts/terminating-infrastructure.js +5 -9
- package/dist/package-contracts/terminating-tools.js +4 -3
- package/dist/package-contracts/worker-output.js +18 -2
- package/dist/public-cli/analyst-run.js +3 -2
- package/dist/public-cli/auto-resume.js +3 -8
- package/dist/public-cli/cli.js +9 -8
- package/dist/public-cli/config.js +8 -11
- package/dist/public-cli/countersign-run.js +1 -3
- package/dist/public-cli/host-providers.js +7 -14
- package/dist/public-cli/instruction-seat-run.js +12 -14
- package/dist/public-cli/invocation.js +9 -8
- package/dist/public-cli/main.js +1820 -1599
- package/dist/public-cli/post-admission.js +4 -3
- package/dist/public-cli/run-lifecycle.js +14 -26
- package/dist/public-cli/settlement.js +10 -26
- package/dist/public-role-summons.js +3 -2
- package/dist/receipt-delivery-policy.js +1 -3
- package/dist/role-run-placement.js +3 -5
- package/dist/role-run-relocation.js +12 -19
- package/dist/role-submission-declarations.js +131 -0
- package/dist/run-terminal-artifacts.js +1 -11
- package/dist/run-ticket-number.js +2 -4
- package/dist/secretariat-contracts.js +23 -1
- package/dist/session-assistant-usage.js +2 -1
- package/dist/session-dialogue.js +1 -14
- package/dist/sitian-reader.js +2 -4
- package/dist/submission-correctable-error.js +2 -1
- package/dist/submission-errors.js +2 -1
- package/dist/submission-gate.js +6 -8
- package/dist/submission-ledger.js +4 -5
- package/dist/ticket-provenance-contracts.js +1 -3
- package/dist/ticket-provenance.js +2 -1
- package/dist/typed-provider-http.js +4 -7
- package/dist/unknown-value.js +28 -0
- package/dist/user-dialogue-stdin.js +2 -1
- package/package.json +1 -1
- package/src/acp-host/role-turn-host.ts +4 -2
- package/src/activation-ledger-git.ts +3 -2
- package/src/activation-ledger-topology.ts +4 -12
- package/src/analyst-entry.ts +3 -11
- package/src/analyst-gate-cycles-read.ts +3 -15
- package/src/analyst-index.ts +3 -13
- package/src/analyst-ledger.ts +2 -16
- package/src/analyst-metric-families/acceptance-success-rework.ts +2 -4
- package/src/analyst-metric-families/round-timeline.ts +2 -4
- package/src/analyst-page.ts +2 -2
- package/src/archivist-record-topology.ts +2 -2
- package/src/audit-escalation.ts +2 -1
- package/src/auditor-role.ts +2 -8
- package/src/auditor-soul.ts +3 -1
- package/src/book-topology-migration-placement.ts +5 -16
- package/src/book-topology-migrators-t11.ts +16 -15
- package/src/book-topology-mixed-volume-migrators.ts +3 -6
- package/src/book-topology-record-class-migrators.ts +7 -10
- package/src/book-topology-runs-migrator.ts +4 -3
- package/src/collector-config.ts +7 -9
- package/src/collector-role.ts +5 -28
- package/src/compliance-transport.ts +2 -1
- package/src/countersign-contracts.ts +2 -1
- package/src/countersign-role.ts +2 -7
- package/src/diarist-contracts.ts +40 -2
- package/src/diarist-role.ts +4 -44
- package/src/doctor-contracts.ts +3 -1
- package/src/doctor-evidence.ts +8 -7
- package/src/doctor-role.ts +20 -13
- package/src/dossier-resolution.ts +2 -4
- package/src/engine-detour-tool.ts +0 -2
- package/src/engine-detour-usage.ts +2 -4
- package/src/external-host-turn-loop.ts +3 -1
- package/src/factory-board.ts +1 -8
- package/src/filed-submission.ts +44 -0
- package/src/gatekeeper-role.ts +8 -24
- package/src/gleaner-left-contracts.ts +29 -2
- package/src/gleaner-left-role.ts +4 -32
- package/src/headless-host/description.ts +15 -18
- package/src/headless-host/role-turn-host.ts +10 -9
- package/src/host-session-record.ts +4 -2
- package/src/inspector-contracts.ts +2 -1
- package/src/inspector-role.ts +2 -7
- package/src/judge-role.ts +12 -24
- package/src/ledger-session-read.ts +2 -5
- package/src/merger-contracts.ts +10 -9
- package/src/merger-role.ts +5 -8
- package/src/navigator-attendance.ts +10 -12
- package/src/navigator-invocation-identity.ts +3 -2
- package/src/navigator-public-session.ts +4 -6
- package/src/navigator-role.ts +2 -8
- package/src/navigator-session-contracts.ts +8 -11
- package/src/navigator-work-base.ts +5 -8
- package/src/navigator-work-context.ts +2 -1
- package/src/notary-contracts.ts +4 -6
- package/src/notary-role.ts +5 -20
- package/src/oauth-keepalive.ts +5 -18
- package/src/package-contracts/auditor-output.ts +2 -4
- package/src/package-contracts/fixer-packet.ts +4 -6
- package/src/package-contracts/gatekeeper-output.ts +2 -4
- package/src/package-contracts/judge-output.ts +0 -1
- package/src/package-contracts/navigator-output.ts +8 -8
- package/src/package-contracts/reviewer-output.ts +25 -0
- package/src/package-contracts/terminating-infrastructure.ts +6 -20
- package/src/package-contracts/terminating-tools.ts +8 -12
- package/src/package-contracts/worker-output.ts +43 -5
- package/src/pi/adapter.ts +0 -1
- package/src/pi/role-turn-host.ts +0 -1
- package/src/public-cli/analyst-run.ts +4 -2
- package/src/public-cli/auto-resume.ts +4 -11
- package/src/public-cli/cli.ts +10 -10
- package/src/public-cli/config.ts +8 -27
- package/src/public-cli/countersign-run.ts +2 -4
- package/src/public-cli/host-providers.ts +10 -27
- package/src/public-cli/instruction-seat-run.ts +14 -15
- package/src/public-cli/invocation.ts +11 -10
- package/src/public-cli/post-admission.ts +5 -3
- package/src/public-cli/run-lifecycle.ts +20 -41
- package/src/public-cli/settlement.ts +11 -33
- package/src/public-role-summons.ts +4 -3
- package/src/receipt-delivery-policy.ts +1 -4
- package/src/reviewer-role.ts +7 -36
- package/src/role-envelope.ts +5 -3
- package/src/role-run-placement.ts +4 -10
- package/src/role-run-relocation.ts +13 -23
- package/src/role-runtime.ts +16 -50
- package/src/role-submission-declarations.ts +143 -0
- package/src/run-terminal-artifacts.ts +2 -16
- package/src/run-ticket-number.ts +4 -10
- package/src/secretariat-contracts.ts +35 -0
- package/src/secretariat-role.ts +4 -40
- package/src/session-assistant-usage.ts +3 -1
- package/src/session-dialogue.ts +1 -4
- package/src/session-identity.ts +0 -1
- package/src/sitian-reader.ts +2 -4
- package/src/submission-correctable-error.ts +3 -1
- package/src/submission-errors.ts +2 -1
- package/src/submission-gate.ts +10 -9
- package/src/submission-ledger.ts +5 -6
- package/src/ticket-provenance-contracts.ts +1 -4
- package/src/ticket-provenance.ts +3 -1
- package/src/ticket-snapshot.ts +2 -4
- package/src/ticket-trajectory.ts +1 -8
- package/src/typed-provider-http.ts +5 -15
- package/src/unknown-value.ts +34 -0
- package/src/user-dialogue-stdin.ts +3 -1
- package/src/worker-role.ts +63 -83
- package/src/worker-submission-gates.ts +8 -7
|
@@ -1,4 +1,20 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
import { openToolObject } from "./open-tool-schema.js";
|
|
3
|
+
import { withTerminatingOutputDeclarations } from "./package-contracts/terminating-infrastructure.js";
|
|
4
|
+
import { isRecord } from "./unknown-value.js";
|
|
1
5
|
const GLEANER_LEFT_OUTPUT_TOOL_NAME = "ak_gleaner_left_output";
|
|
6
|
+
const gleanerLeftOutputSchema = withTerminatingOutputDeclarations(
|
|
7
|
+
openToolObject(
|
|
8
|
+
Type.Object({
|
|
9
|
+
status: Type.Unknown({
|
|
10
|
+
description: "completed"
|
|
11
|
+
}),
|
|
12
|
+
findings: Type.Unknown({
|
|
13
|
+
description: "\u5F39\u7AE0\u5217\u8868\uFF1B\u6BCF\u6761\u53EF\u542B pointer\uFF08\u6587\u4EF6/\u884C\u6307\u9488\uFF09\u4E0E statement\uFF08\u7591\u70B9\u9648\u8FF0\uFF09\uFF0C\u539F\u6837\u7559\u5B58\u3002\u7A7A\u5217\u8868\u5408\u6CD5\u5B8C\u5C40\uFF1B\u673A\u5668\u4E0D\u5224\u5F39\u7AE0\u662F\u5426\u6210\u7ACB\u3002"
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
)
|
|
17
|
+
);
|
|
2
18
|
const GLEANER_LEFT_BASE_FLAG = {
|
|
3
19
|
name: "ak-gleaner-left-base",
|
|
4
20
|
definition: {
|
|
@@ -7,7 +23,7 @@ const GLEANER_LEFT_BASE_FLAG = {
|
|
|
7
23
|
}
|
|
8
24
|
};
|
|
9
25
|
function validateRecordedGleanerLeftOutput(value) {
|
|
10
|
-
if (
|
|
26
|
+
if (!isRecord(value)) {
|
|
11
27
|
throw new Error("Gleaner-left output has no execution discriminator");
|
|
12
28
|
}
|
|
13
29
|
let status;
|
|
@@ -24,5 +40,6 @@ function validateRecordedGleanerLeftOutput(value) {
|
|
|
24
40
|
export {
|
|
25
41
|
GLEANER_LEFT_BASE_FLAG,
|
|
26
42
|
GLEANER_LEFT_OUTPUT_TOOL_NAME,
|
|
43
|
+
gleanerLeftOutputSchema,
|
|
27
44
|
validateRecordedGleanerLeftOutput
|
|
28
45
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRecord } from "../unknown-value.js";
|
|
1
2
|
export function isClaudePrintDescription(description) {
|
|
2
3
|
return description.protocol === "claude-print";
|
|
3
4
|
}
|
|
@@ -89,7 +90,7 @@ const CODEX_JSON_VALUE_SCHEMA = Object.freeze({
|
|
|
89
90
|
*/
|
|
90
91
|
export function closeJsonSchemaForCodex(schema) {
|
|
91
92
|
const closed = closeSchemaNode(schema);
|
|
92
|
-
const existingDefs =
|
|
93
|
+
const existingDefs = isRecord(closed.$defs)
|
|
93
94
|
? closed.$defs
|
|
94
95
|
: {};
|
|
95
96
|
return {
|
|
@@ -100,13 +101,9 @@ export function closeJsonSchemaForCodex(schema) {
|
|
|
100
101
|
},
|
|
101
102
|
};
|
|
102
103
|
}
|
|
103
|
-
/** Shared plain-object guard for headless host schema/event reduction. */
|
|
104
|
-
export function isPlainObject(value) {
|
|
105
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
106
|
-
}
|
|
107
104
|
/** Pure null leaf only — composite type|null is stripped in-leaf, not dropped whole. */
|
|
108
105
|
function isPureNullTypeSchema(value) {
|
|
109
|
-
if (!
|
|
106
|
+
if (!isRecord(value))
|
|
110
107
|
return false;
|
|
111
108
|
if (value.type === "null")
|
|
112
109
|
return true;
|
|
@@ -120,7 +117,7 @@ function isPureNullTypeSchema(value) {
|
|
|
120
117
|
* Required edges keep the non-null type(s); optional edges re-add null once.
|
|
121
118
|
*/
|
|
122
119
|
function stripNullFromLeafType(leaf) {
|
|
123
|
-
if (!
|
|
120
|
+
if (!isRecord(leaf) || !Array.isArray(leaf.type))
|
|
124
121
|
return leaf;
|
|
125
122
|
const nonNull = leaf.type.filter((t) => t !== "null");
|
|
126
123
|
if (nonNull.length === leaf.type.length)
|
|
@@ -137,7 +134,7 @@ function stripNullFromLeafType(leaf) {
|
|
|
137
134
|
* lack `type`; strict structured output rejects those intermediate nodes.
|
|
138
135
|
*/
|
|
139
136
|
function flattenUnionLeaves(schema) {
|
|
140
|
-
if (!
|
|
137
|
+
if (!isRecord(schema))
|
|
141
138
|
return [schema];
|
|
142
139
|
if (Array.isArray(schema.anyOf)) {
|
|
143
140
|
return schema.anyOf.flatMap(flattenUnionLeaves);
|
|
@@ -155,7 +152,7 @@ function nonNullLeaves(schema) {
|
|
|
155
152
|
* Required → closed non-null leaf(s). Optional → closed leaf(s) + null.
|
|
156
153
|
*/
|
|
157
154
|
function closePropertySchema(schema, optional) {
|
|
158
|
-
const description =
|
|
155
|
+
const description = isRecord(schema) && typeof schema.description === "string"
|
|
159
156
|
? { description: schema.description }
|
|
160
157
|
: {};
|
|
161
158
|
const leaves = nonNullLeaves(schema).map(closeSchemaNode);
|
|
@@ -165,10 +162,10 @@ function closePropertySchema(schema, optional) {
|
|
|
165
162
|
const closed = leaves.length === 1 ? leaves[0] : { anyOf: leaves };
|
|
166
163
|
// Codex strict does not allow sibling keys on $ref; put property guidance
|
|
167
164
|
// on an enclosing schema instead of losing it or weakening the free-JSON ref.
|
|
168
|
-
if (
|
|
165
|
+
if (isRecord(closed) && typeof closed.$ref === "string") {
|
|
169
166
|
return { anyOf: [closed], ...description };
|
|
170
167
|
}
|
|
171
|
-
return
|
|
168
|
+
return isRecord(closed) ? { ...closed, ...description } : closed;
|
|
172
169
|
}
|
|
173
170
|
return { anyOf: [...leaves, { type: "null" }], ...description };
|
|
174
171
|
}
|
|
@@ -182,7 +179,7 @@ function ensureTypedLeaf(schema) {
|
|
|
182
179
|
return schema;
|
|
183
180
|
if (typeof schema.$ref === "string")
|
|
184
181
|
return schema;
|
|
185
|
-
if (
|
|
182
|
+
if (isRecord(schema.properties) || schema.additionalProperties !== undefined) {
|
|
186
183
|
return { ...schema, type: "object" };
|
|
187
184
|
}
|
|
188
185
|
if (schema.items !== undefined) {
|
|
@@ -211,7 +208,7 @@ function originalRequiredNames(node) {
|
|
|
211
208
|
return new Set(node.required.filter((item) => typeof item === "string"));
|
|
212
209
|
}
|
|
213
210
|
function closeSchemaNode(node) {
|
|
214
|
-
if (!
|
|
211
|
+
if (!isRecord(node))
|
|
215
212
|
return node;
|
|
216
213
|
// Already a ref (free-JSON leaf or pre-existing) — do not retype.
|
|
217
214
|
if (typeof node.$ref === "string")
|
|
@@ -229,10 +226,10 @@ function closeSchemaNode(node) {
|
|
|
229
226
|
if (node.items !== undefined) {
|
|
230
227
|
out.items = closeSchemaNode(node.items);
|
|
231
228
|
}
|
|
232
|
-
if (
|
|
229
|
+
if (isRecord(node.$defs)) {
|
|
233
230
|
out.$defs = Object.fromEntries(Object.entries(node.$defs).map(([key, value]) => [key, closeSchemaNode(value)]));
|
|
234
231
|
}
|
|
235
|
-
const hasProperties =
|
|
232
|
+
const hasProperties = isRecord(node.properties);
|
|
236
233
|
const isObjectType = node.type === "object"
|
|
237
234
|
|| (Array.isArray(node.type) && node.type.includes("object"))
|
|
238
235
|
|| hasProperties
|
|
@@ -273,11 +270,11 @@ function closeSchemaNode(node) {
|
|
|
273
270
|
function stringEnvironment(value) {
|
|
274
271
|
const entries = Array.isArray(value)
|
|
275
272
|
? value.flatMap((item) => {
|
|
276
|
-
if (!
|
|
273
|
+
if (!isRecord(item) || typeof item.name !== "string" || typeof item.value !== "string")
|
|
277
274
|
return [];
|
|
278
275
|
return [[item.name, item.value]];
|
|
279
276
|
})
|
|
280
|
-
:
|
|
277
|
+
: isRecord(value)
|
|
281
278
|
? Object.entries(value).filter((entry) => typeof entry[1] === "string")
|
|
282
279
|
: [];
|
|
283
280
|
return entries.length === 0 ? undefined : Object.fromEntries(entries);
|