@akagilnc/pi-workflow-roles 0.1.5842 → 0.1.5853
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 -4
- package/README.zh-CN.md +4 -4
- package/dist/acp-host/production-host.js +348 -1254
- package/dist/acp-host/role-turn-host.js +4 -98
- package/dist/headless-host/production-host.js +15731 -16582
- package/dist/headless-host/role-turn-host.js +6 -31
- package/dist/migrate-book-topology.js +31 -16
- package/dist/navigator-attendance.js +54 -404
- package/dist/navigator-invocation-identity.js +0 -2
- package/dist/navigator-lookup-host.js +41 -0
- package/dist/navigator-lookup.js +68 -0
- package/dist/navigator-route-table.js +42 -0
- package/dist/package-contracts/navigator-output.js +3 -11
- package/dist/packaged-role-registry.js +3 -27
- package/dist/public-cli/instruction-seat-run.js +4 -1
- package/dist/public-cli/invocation.js +13 -26
- package/dist/public-cli/main.js +286 -114
- package/dist/public-cli/option-definitions.js +24 -4
- package/dist/public-cli/post-admission.js +0 -9
- package/dist/public-cli/role-seat-runtime.js +14 -0
- package/dist/public-cli/settlement.js +14 -40
- package/dist/public-cli/terminal.js +1 -8
- package/dist/public-cli/turn-request.js +0 -3
- package/dist/public-role-summons.js +0 -1
- package/dist/receipt-delivery-policy.js +0 -23
- package/dist/role-runtime-dependencies.js +4 -11
- package/dist/role-runtime.js +18 -194
- package/dist/submission-ledger.js +19 -15
- package/dist/ticket-progress.js +23 -5
- package/extensions/role-runtime.ts +0 -16
- package/package.json +1 -1
- package/scripts/build-package.mjs +3 -7
- package/souls/notary.md +1 -1
- package/src/acp-host/role-turn-host.ts +8 -97
- package/src/headless-host/description.ts +0 -2
- package/src/headless-host/role-turn-host.ts +7 -32
- package/src/host-contracts.ts +5 -7
- package/src/navigator-attendance.ts +86 -549
- package/src/navigator-invocation-identity.ts +0 -2
- package/src/navigator-lookup-host.ts +45 -0
- package/src/navigator-lookup.ts +98 -0
- package/src/navigator-route-table.ts +92 -0
- package/src/package-contracts/navigator-output.ts +4 -15
- package/src/packaged-role-registry.ts +3 -32
- package/src/public-cli/instruction-seat-run.ts +3 -0
- package/src/public-cli/invocation.ts +18 -30
- package/src/public-cli/option-definitions.ts +25 -4
- package/src/public-cli/post-admission.ts +0 -11
- package/src/public-cli/role-seat-runtime.ts +14 -0
- package/src/public-cli/settlement.ts +23 -51
- package/src/public-cli/terminal.ts +3 -18
- package/src/public-cli/turn-request.ts +0 -5
- package/src/public-role-summons.ts +0 -8
- package/src/receipt-delivery-policy.ts +0 -21
- package/src/role-runtime-dependencies.ts +4 -11
- package/src/role-runtime.ts +19 -210
- package/src/submission-ledger.ts +23 -16
- package/src/ticket-progress.ts +32 -5
- package/dist/navigator-public-session.js +0 -205
- package/dist/navigator-role.js +0 -6
- package/dist/navigator-session-contracts.js +0 -227
- package/dist/navigator-work-context.js +0 -72
- package/resources/navigator-route-playbook.md +0 -33
- package/src/navigator-public-session.ts +0 -305
- package/src/navigator-role.ts +0 -15
- package/src/navigator-session-contracts.ts +0 -320
- package/src/navigator-work-context.ts +0 -97
|
@@ -16,7 +16,6 @@ import { projectThrownFailureLeaf } from "../public-cli/settlement.js";
|
|
|
16
16
|
import { renderSystemPromptOverride, resolveBoundHostSessionId, } from "../prepared-role-turn.js";
|
|
17
17
|
import { copyAndRecordHostDossier, recordNativeSessionPointer, } from "../host-session-record.js";
|
|
18
18
|
import { closeJsonSchemaForCodex, codexTurnArgs, headlessMcpConfigDocument, headlessTurnArgs, isClaudePrintDescription, isCodexExecDescription, } from "./description.js";
|
|
19
|
-
import { NAVIGATOR_OUTPUT_TOOL_NAME } from "../package-contracts/navigator-output.js";
|
|
20
19
|
import { errorText, isRecord } from "../unknown-value.js";
|
|
21
20
|
/**
|
|
22
21
|
* True when a parsed stdout object is the typed result receipt (or a single-doc
|
|
@@ -312,7 +311,6 @@ function buildTurnArgs(options) {
|
|
|
312
311
|
if (options.sessionKind === "resume" && !options.sessionId) {
|
|
313
312
|
throw new Error("codex resume requires a bound thread_id");
|
|
314
313
|
}
|
|
315
|
-
// Codex always mounts --output-schema when the path is supplied (incl. navigator byStatus #1160).
|
|
316
314
|
return codexTurnArgs({
|
|
317
315
|
systemPromptPath: options.systemPromptPath,
|
|
318
316
|
...(options.outputSchemaPath === undefined ? {} : { outputSchemaPath: options.outputSchemaPath }),
|
|
@@ -335,7 +333,6 @@ function buildTurnArgs(options) {
|
|
|
335
333
|
return headlessTurnArgs({
|
|
336
334
|
description: options.description,
|
|
337
335
|
systemPromptPath: options.systemPromptPath,
|
|
338
|
-
// #959: navigator omits --json-schema so free-form prose is a lawful exit.
|
|
339
336
|
...(options.jsonSchema === undefined ? {} : { jsonSchema: options.jsonSchema }),
|
|
340
337
|
mcpConfigPath: options.mcpConfigPath,
|
|
341
338
|
...(options.model === undefined ? {} : { model: options.model }),
|
|
@@ -349,10 +346,6 @@ export function createHeadlessRoleTurnHost(config) {
|
|
|
349
346
|
const prepared = await config.prepare(request);
|
|
350
347
|
const systemPrompt = renderSystemPromptOverride(prepared.systemPrompt);
|
|
351
348
|
const codex = isCodexExecDescription(config.description);
|
|
352
|
-
// #1160: one exit-mode decision per turn — direct navigator free prose vs structured.
|
|
353
|
-
// Attendance sets request.navigatorByStatusPrepare; direct ak-role navigator does not.
|
|
354
|
-
const navigatorProseExit = prepared.terminatingToolName === NAVIGATOR_OUTPUT_TOOL_NAME
|
|
355
|
-
&& request.navigatorByStatusPrepare !== true;
|
|
356
349
|
let outcome = failure("session", "HeadlessNoOutcome", "no-outcome");
|
|
357
350
|
try {
|
|
358
351
|
// Claude mints a package UUID for --session-id; codex waits for thread.started.
|
|
@@ -386,17 +379,14 @@ export function createHeadlessRoleTurnHost(config) {
|
|
|
386
379
|
if (codex) {
|
|
387
380
|
// #1148: Codex --output-schema requires a native strict transport schema.
|
|
388
381
|
// Project from the unique open declaration; do not alter package receipt rules.
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
await writeFile(outputSchemaPath, `${JSON.stringify(deliveredSchema, null, 2)}\n`, "utf8");
|
|
393
|
-
}
|
|
382
|
+
outputSchemaPath = join(inputsDirectory, "output-schema.json");
|
|
383
|
+
deliveredSchema = closeJsonSchemaForCodex(prepared.jsonSchema);
|
|
384
|
+
await writeFile(outputSchemaPath, `${JSON.stringify(deliveredSchema, null, 2)}\n`, "utf8");
|
|
394
385
|
}
|
|
395
386
|
else {
|
|
396
387
|
mcpConfigPath = join(inputsDirectory, "mcp-config.json");
|
|
397
388
|
await writeFile(mcpConfigPath, `${JSON.stringify(headlessMcpConfigDocument(prepared.mcpServers), null, 2)}\n`, "utf8");
|
|
398
|
-
|
|
399
|
-
deliveredSchema = prepared.jsonSchema;
|
|
389
|
+
deliveredSchema = prepared.jsonSchema;
|
|
400
390
|
}
|
|
401
391
|
startedWithSchema = deliveredSchema;
|
|
402
392
|
}
|
|
@@ -425,8 +415,7 @@ export function createHeadlessRoleTurnHost(config) {
|
|
|
425
415
|
args = buildTurnArgs({
|
|
426
416
|
description: config.description,
|
|
427
417
|
systemPromptPath,
|
|
428
|
-
|
|
429
|
-
...(navigatorProseExit ? {} : { jsonSchema: prepared.jsonSchema }),
|
|
418
|
+
jsonSchema: prepared.jsonSchema,
|
|
430
419
|
mcpServers: prepared.mcpServers,
|
|
431
420
|
...(mcpConfigPath === undefined ? {} : { mcpConfigPath }),
|
|
432
421
|
...(outputSchemaPath === undefined ? {} : { outputSchemaPath }),
|
|
@@ -566,14 +555,7 @@ export function createHeadlessRoleTurnHost(config) {
|
|
|
566
555
|
const deliverReply = async () => {
|
|
567
556
|
if (!observation.turnCompleted || observation.finalMessage === undefined)
|
|
568
557
|
return undefined;
|
|
569
|
-
|
|
570
|
-
// Direct ak-role navigator: free-form agent_message is the prose body.
|
|
571
|
-
if (observation.finalMessage.trim() === "")
|
|
572
|
-
return undefined;
|
|
573
|
-
await prepared.ingestStructuredOutput({ prose: observation.finalMessage });
|
|
574
|
-
return deliveredFromSpawned(spawned);
|
|
575
|
-
}
|
|
576
|
-
// Structured seats (incl. #1160 byStatus prepare): native JSON receipt.
|
|
558
|
+
// Native JSON receipt.
|
|
577
559
|
let receipt;
|
|
578
560
|
try {
|
|
579
561
|
receipt = JSON.parse(observation.finalMessage);
|
|
@@ -621,13 +603,6 @@ export function createHeadlessRoleTurnHost(config) {
|
|
|
621
603
|
if (envelope.structured_output !== undefined) {
|
|
622
604
|
await prepared.ingestStructuredOutput(envelope.structured_output);
|
|
623
605
|
}
|
|
624
|
-
else if (navigatorProseExit
|
|
625
|
-
&& typeof envelope.result === "string"
|
|
626
|
-
&& envelope.result.trim() !== "") {
|
|
627
|
-
// #959: direct navigator prose exit — free-form result text is the body
|
|
628
|
-
// when structured_output is absent (json-schema omitted).
|
|
629
|
-
await prepared.ingestStructuredOutput({ prose: envelope.result });
|
|
630
|
-
}
|
|
631
606
|
return deliveredFromSpawned(spawned);
|
|
632
607
|
}
|
|
633
608
|
catch (error) {
|
|
@@ -8712,6 +8712,9 @@ var init_navigator_output = __esm({
|
|
|
8712
8712
|
}),
|
|
8713
8713
|
byStatus: typebox_exports.Unknown({
|
|
8714
8714
|
description: "\u6309\u4E3B\u8859\u95E8\u7ED3\u5C40 status \u9884\u5199\u7684\u6563\u6587\u5EFA\u8BAE\u3002\u952E\u4E3A status \u5B57\u9762\u91CF\uFF0C\u503C\u4E3A\u5EFA\u8BAE\u6B63\u6587\u3002\u7ED3\u7B97\u65F6\u4EE3\u7801\u53EA\u6309\u5B9E\u9645 status \u53D6\u5BF9\u5E94\u539F\u6587\uFF0C\u4E0D\u89E3\u6790\u5EFA\u8BAE\u8BED\u4E49\u3002"
|
|
8715
|
+
}),
|
|
8716
|
+
byRole: typebox_exports.Unknown({
|
|
8717
|
+
description: "\u6574\u5F20\u8DEF\u7EBF\u8868\uFF1A\u952E\u4E3A\u8859\u95E8\u89D2\u8272\uFF0C\u503C\u4E3A\u8BE5\u8859\u95E8 status \u2192 \u5EFA\u8BAE\u3002\u76F4\u63A5\u5165\u53E3\u4E0D\u7ED9\u89D2\u8272\u65F6\u4F7F\u7528\u3002"
|
|
8715
8718
|
})
|
|
8716
8719
|
};
|
|
8717
8720
|
navigatorAdviceBodySchema = openToolObject(typebox_exports.Object(navigatorAdviceFields));
|
|
@@ -9258,8 +9261,6 @@ var init_packaged_role_registry = __esm({
|
|
|
9258
9261
|
settlement: "sealed",
|
|
9259
9262
|
/** Factory board: court until another station has started, then marshal. */
|
|
9260
9263
|
boardPlacement: "judge-history",
|
|
9261
|
-
/** Navigator subject is the public admitted instruction when the run is bound. */
|
|
9262
|
-
navigatorSubject: "public-instruction",
|
|
9263
9264
|
activationStage: "load-and-install",
|
|
9264
9265
|
receiptStatusKey: "status",
|
|
9265
9266
|
sessionMaterials: [
|
|
@@ -9288,8 +9289,6 @@ var init_packaged_role_registry = __esm({
|
|
|
9288
9289
|
reportPhase: true
|
|
9289
9290
|
},
|
|
9290
9291
|
boardPlacement: "marshal",
|
|
9291
|
-
/** #1168: dispatch is first message; navigator reads admitted instruction. */
|
|
9292
|
-
navigatorSubject: "public-instruction",
|
|
9293
9292
|
activationFlags: [
|
|
9294
9293
|
{ field: "phase", flag: "ak-fixer-phase", binds: "phase" }
|
|
9295
9294
|
],
|
|
@@ -9318,8 +9317,6 @@ var init_packaged_role_registry = __esm({
|
|
|
9318
9317
|
artifactFace: {
|
|
9319
9318
|
reportPhase: true
|
|
9320
9319
|
},
|
|
9321
|
-
/** #1168: dispatch is first message; navigator reads admitted instruction. */
|
|
9322
|
-
navigatorSubject: "public-instruction",
|
|
9323
9320
|
activationFlags: [
|
|
9324
9321
|
{ field: "phase", flag: "ak-coder-phase", binds: "phase" }
|
|
9325
9322
|
],
|
|
@@ -9413,8 +9410,6 @@ var init_packaged_role_registry = __esm({
|
|
|
9413
9410
|
artifactFace: {
|
|
9414
9411
|
doctorReportFacts: true
|
|
9415
9412
|
},
|
|
9416
|
-
/** Navigator subject is the doctor case, not the case-path file bytes. */
|
|
9417
|
-
navigatorSubject: "case",
|
|
9418
9413
|
activationFlags: [
|
|
9419
9414
|
{ field: "casePath", from: "caseRunsPath", flag: "ak-doctor-case", binds: "input" }
|
|
9420
9415
|
],
|
|
@@ -9469,8 +9464,6 @@ var init_packaged_role_registry = __esm({
|
|
|
9469
9464
|
gateStageLabel: "\u7B26\u5B9D\u90CE",
|
|
9470
9465
|
/** Gate summon binds --source-run and keeps dialogue off the argv. */
|
|
9471
9466
|
gateSummon: "source-run",
|
|
9472
|
-
/** Navigator subject is the source-run locator, not the path file bytes. */
|
|
9473
|
-
navigatorSubject: "source-run",
|
|
9474
9467
|
activationFlags: [
|
|
9475
9468
|
{ field: "sourceRun", from: "sourceRunPath", flag: "ak-notary-source-run", binds: "input" },
|
|
9476
9469
|
{ field: "ticketNumber", flag: "ak-notary-ticket-number" }
|
|
@@ -9608,12 +9601,14 @@ var init_packaged_role_registry = __esm({
|
|
|
9608
9601
|
role: "navigator",
|
|
9609
9602
|
inCallAutoResume: false,
|
|
9610
9603
|
presentSettled: "always",
|
|
9611
|
-
summonResume:
|
|
9604
|
+
summonResume: false,
|
|
9612
9605
|
admission: "instruction",
|
|
9613
9606
|
sameParent: "none",
|
|
9614
9607
|
phases: [null],
|
|
9615
9608
|
outputTool: NAVIGATOR_OUTPUT_TOOL_NAME,
|
|
9616
9609
|
settlement: "accepted",
|
|
9610
|
+
/** #1192: structured target seat for the lookup run; no host flag (no host runs it). */
|
|
9611
|
+
activationFlags: [{ field: "forRole" }],
|
|
9617
9612
|
activationStage: "load-and-install",
|
|
9618
9613
|
sessionMaterials: ["CLAUDE.md", "souls/navigator.md"]
|
|
9619
9614
|
},
|
|
@@ -10489,7 +10484,7 @@ function publicOptionTable() {
|
|
|
10489
10484
|
}
|
|
10490
10485
|
return { global: GLOBAL_OPTIONS, ...roles, analyst: ANALYST_OPTIONS };
|
|
10491
10486
|
}
|
|
10492
|
-
var GLOBAL_OPTIONS, SHARED_PROJECT_SEMANTICS, SHARED_ATTACH_SEMANTICS, SHARED_PHASE_SEMANTICS, GLEANER_LEFT_OPTIONS, AUDITOR_OPTIONS, CODER_OPTIONS, FIXER_OPTIONS, REVIEWER_OPTIONS, COLLECTOR_OPTIONS, DOCTOR_OPTIONS, NOTARY_OPTIONS, INSPECTOR_OPTIONS, MERGER_OPTIONS, ANALYST_OPTIONS, SEAT_OPTION_ROWS, PUBLIC_OPTION_TABLE, PUBLIC_ROLE_OPTION_OWNERS, TOP_LEVEL_HELP, ROLE_COMMAND_HELP, SUPPORT_COMMAND_HELP, PUBLIC_COMMAND_HELP;
|
|
10487
|
+
var GLOBAL_OPTIONS, SHARED_PROJECT_SEMANTICS, SHARED_ATTACH_SEMANTICS, SHARED_PHASE_SEMANTICS, GLEANER_LEFT_OPTIONS, AUDITOR_OPTIONS, CODER_OPTIONS, FIXER_OPTIONS, REVIEWER_OPTIONS, COLLECTOR_OPTIONS, DOCTOR_OPTIONS, NAVIGATOR_OPTIONS, NOTARY_OPTIONS, INSPECTOR_OPTIONS, MERGER_OPTIONS, ANALYST_OPTIONS, SEAT_OPTION_ROWS, PUBLIC_OPTION_TABLE, PUBLIC_ROLE_OPTION_OWNERS, TOP_LEVEL_HELP, ROLE_COMMAND_HELP, SUPPORT_COMMAND_HELP, PUBLIC_COMMAND_HELP;
|
|
10493
10488
|
var init_option_definitions = __esm({
|
|
10494
10489
|
"src/public-cli/option-definitions.ts"() {
|
|
10495
10490
|
"use strict";
|
|
@@ -10801,6 +10796,23 @@ var init_option_definitions = __esm({
|
|
|
10801
10796
|
}
|
|
10802
10797
|
}
|
|
10803
10798
|
];
|
|
10799
|
+
NAVIGATOR_OPTIONS = [
|
|
10800
|
+
...projectAndAttach("navigator"),
|
|
10801
|
+
{
|
|
10802
|
+
id: "role",
|
|
10803
|
+
owner: "navigator",
|
|
10804
|
+
canonical: "--role",
|
|
10805
|
+
aliases: [],
|
|
10806
|
+
valueMetavar: "role",
|
|
10807
|
+
required: false,
|
|
10808
|
+
repeatable: false,
|
|
10809
|
+
form: "option",
|
|
10810
|
+
description: {
|
|
10811
|
+
en: "Optional seat whose status \u2192 advice rows to show; omitted shows the whole table. The instruction text is not read.",
|
|
10812
|
+
zh: "\u53EF\u9009\u8859\u95E8\u89D2\u8272\uFF1A\u53EA\u663E\u793A\u8BE5\u8859\u95E8\u7684 status \u2192 \u5EFA\u8BAE\uFF1B\u7F3A\u7701\u663E\u793A\u6574\u5F20\u8868\u3002instruction \u6B63\u6587\u4E0D\u8BFB\u3002"
|
|
10813
|
+
}
|
|
10814
|
+
}
|
|
10815
|
+
];
|
|
10804
10816
|
NOTARY_OPTIONS = [
|
|
10805
10817
|
bindOwner("notary", SHARED_PROJECT_SEMANTICS),
|
|
10806
10818
|
{
|
|
@@ -10994,7 +11006,8 @@ var init_option_definitions = __esm({
|
|
|
10994
11006
|
merger: MERGER_OPTIONS,
|
|
10995
11007
|
notary: NOTARY_OPTIONS,
|
|
10996
11008
|
auditor: AUDITOR_OPTIONS,
|
|
10997
|
-
inspector: INSPECTOR_OPTIONS
|
|
11009
|
+
inspector: INSPECTOR_OPTIONS,
|
|
11010
|
+
navigator: NAVIGATOR_OPTIONS
|
|
10998
11011
|
};
|
|
10999
11012
|
PUBLIC_OPTION_TABLE = publicOptionTable();
|
|
11000
11013
|
PUBLIC_ROLE_OPTION_OWNERS = [
|
|
@@ -11114,10 +11127,11 @@ var init_option_definitions = __esm({
|
|
|
11114
11127
|
},
|
|
11115
11128
|
navigator: {
|
|
11116
11129
|
command: "navigator",
|
|
11117
|
-
summary: "Direct Navigator (\u6E38\u5955\u4F7F)
|
|
11118
|
-
usage: ["ak-role navigator [options] [instruction]"],
|
|
11130
|
+
summary: "Direct Navigator (\u6E38\u5955\u4F7F) status \u2192 next-station advice table lookup; no model call.",
|
|
11131
|
+
usage: ["ak-role navigator [--role <role>] [options] [instruction]"],
|
|
11119
11132
|
examples: [
|
|
11120
|
-
|
|
11133
|
+
"ak-role navigator",
|
|
11134
|
+
"ak-role navigator --role coder"
|
|
11121
11135
|
]
|
|
11122
11136
|
},
|
|
11123
11137
|
auditor: {
|
|
@@ -11262,6 +11276,7 @@ var init_invocation = __esm({
|
|
|
11262
11276
|
init_notary_source_run();
|
|
11263
11277
|
init_cli_errors();
|
|
11264
11278
|
init_option_definitions();
|
|
11279
|
+
init_registry();
|
|
11265
11280
|
init_unknown_value();
|
|
11266
11281
|
}
|
|
11267
11282
|
});
|