@akagilnc/pi-workflow-roles 0.1.6115 → 0.1.6126

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.
Files changed (45) hide show
  1. package/README.md +3 -3
  2. package/README.zh-CN.md +3 -3
  3. package/dist/acp-host/production-host.js +354 -250
  4. package/dist/engine-detour-usage.js +2 -1
  5. package/dist/gatekeeper-role.js +3 -15
  6. package/dist/headless-host/description.js +4 -1
  7. package/dist/headless-host/production-host.js +340 -236
  8. package/dist/migrate-book-topology.js +39 -22
  9. package/dist/notary-source-run.js +8 -8
  10. package/dist/public-cli/auto-resume.js +3 -3
  11. package/dist/public-cli/cli.js +38 -32
  12. package/dist/public-cli/instruction-seat-run.js +2 -5
  13. package/dist/public-cli/main.js +310 -208
  14. package/dist/public-cli/option-definitions.js +22 -21
  15. package/dist/public-cli/run-lifecycle.js +27 -26
  16. package/dist/public-cli/seat-ticket-binding.js +2 -1
  17. package/dist/public-cli/settlement.js +33 -8
  18. package/dist/public-cli/terminal.js +13 -3
  19. package/dist/public-role-summons.js +1 -7
  20. package/dist/role-run-placement.js +1 -1
  21. package/dist/run-dossier-files.js +4 -2
  22. package/dist/submission-gate.js +3 -3
  23. package/dist/submission-ledger.js +29 -3
  24. package/dist/ticket-address.js +77 -0
  25. package/dist/ticket-progress.js +31 -0
  26. package/package.json +1 -1
  27. package/src/engine-detour-usage.ts +2 -1
  28. package/src/gatekeeper-role.ts +5 -18
  29. package/src/headless-host/description.ts +4 -1
  30. package/src/notary-source-run.ts +8 -8
  31. package/src/public-cli/auto-resume.ts +4 -3
  32. package/src/public-cli/cli.ts +53 -32
  33. package/src/public-cli/instruction-seat-run.ts +2 -5
  34. package/src/public-cli/option-definitions.ts +22 -21
  35. package/src/public-cli/run-lifecycle.ts +31 -31
  36. package/src/public-cli/seat-ticket-binding.ts +2 -1
  37. package/src/public-cli/settlement.ts +43 -7
  38. package/src/public-cli/terminal.ts +33 -14
  39. package/src/public-role-summons.ts +3 -15
  40. package/src/role-run-placement.ts +1 -1
  41. package/src/run-dossier-files.ts +5 -2
  42. package/src/submission-gate.ts +3 -2
  43. package/src/submission-ledger.ts +32 -2
  44. package/src/ticket-address.ts +91 -0
  45. package/src/ticket-progress.ts +42 -0
@@ -29,7 +29,8 @@ export const ENGINE_DETOUR_CALL_KIND = "engine-detour-call";
29
29
  export const ENGINE_DETOUR_TOOL_USAGE_FACT_KEY = "engineDetourToolUsage";
30
30
  /**
31
31
  * Run-relative path of the log that holds one detour call's record.
32
- * Openable once the run directory is known from the terminal's run id.
32
+ * Openable once the leg directory is known from the paths the terminal reports
33
+ * (receipt, artifact, or the no-receipt run pointer).
33
34
  * Contains no runId bytes itself (#108 + #537).
34
35
  */
35
36
  export const ENGINE_DETOUR_CALL_RECORD_FILE_RELATIVE = RUN_LOG_FILE;
@@ -80,20 +80,9 @@ function projectOfficerPayloads(officer, payloads, fallbackStatus) {
80
80
  // Single this-court seal is the common path. Never fold history into an array receipt.
81
81
  return projectOfficerDecision(officer, payloads[payloads.length - 1], fallbackStatus);
82
82
  }
83
- /** Nested officer runId from summoned.runDirectory, else terminal.runId (resume identity). */
83
+ /** Nested officer runId from the summoned leg's run directory (package-internal resume identity). */
84
84
  export function officerRunIdFromSummoned(summoned) {
85
- if (typeof summoned.runDirectory === "string" && summoned.runDirectory.trim() !== "") {
86
- const fromDir = runIdFromRunDirectory(summoned.runDirectory);
87
- if (fromDir !== undefined)
88
- return fromDir;
89
- }
90
- const terminal = summoned.terminal;
91
- if (terminal !== undefined
92
- && typeof terminal.runId === "string"
93
- && terminal.runId.trim() !== "") {
94
- return terminal.runId;
95
- }
96
- return undefined;
85
+ return summoned.runDirectory === undefined ? undefined : runIdFromRunDirectory(summoned.runDirectory);
97
86
  }
98
87
  function withOfficerRunId(result, summoned) {
99
88
  if (result.status !== "converged"
@@ -156,8 +145,7 @@ function projectOfficerTerminal(officer, summoned) {
156
145
  }
157
146
  if (outcome.kind === "accepted") {
158
147
  // Nested / prior incomplete (directionUnsettled) is not a gate pass (ADR 0055).
159
- // Receipt stays this-court or retained; runId comes from the summoned volume
160
- // (public-role-summons already prefers nested terminal.runId when roles differ).
148
+ // Receipt stays this-court or retained; runId comes from the summoned volume.
161
149
  // No parent-side officerPayloads / officerRunId copies (#1195).
162
150
  if (outcome.decisiveFacts?.directionUnsettled === true) {
163
151
  const receipt = thisCourt.length > 0 ? thisCourt[thisCourt.length - 1] : retainedReceipt(outcome);
@@ -394,6 +394,9 @@ export function codexTurnArgs(options) {
394
394
  /**
395
395
  * Project shared-envelope MCP server rows into Claude `--mcp-config` JSON.
396
396
  * Env stays a plain object (Claude CLI shape); ACP rows use `{name,value}[]`.
397
+ * Each server carries Claude's `alwaysLoad` (#1295): Claude otherwise defers MCP
398
+ * tool definitions until searched, so a leg would not see "when to call" in the
399
+ * report-ticket tool's description at session start.
397
400
  */
398
401
  export function headlessMcpConfigDocument(mcpServers) {
399
402
  const servers = {};
@@ -402,7 +405,7 @@ export function headlessMcpConfigDocument(mcpServers) {
402
405
  const command = typeof row.command === "string" ? row.command : undefined;
403
406
  if (name === undefined || name === "" || command === undefined || command === "")
404
407
  continue;
405
- const entry = { command };
408
+ const entry = { command, alwaysLoad: true };
406
409
  if (Array.isArray(row.args))
407
410
  entry.args = row.args;
408
411
  const env = stringEnvironment(row.env);