@unbrained/pm-cli 2026.8.21 → 2026.8.23

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 (228) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +44 -0
  3. package/dist/cli/error-guidance.d.ts +22 -4
  4. package/dist/cli/error-guidance.js +73 -16
  5. package/dist/cli/main.d.ts +3 -0
  6. package/dist/cli/main.js +51 -9
  7. package/dist/cli/register-mutation.js +6 -6
  8. package/dist/cli/register-operations.d.ts +73 -0
  9. package/dist/cli/register-operations.js +39 -14
  10. package/dist/cli/register-setup.js +3 -3
  11. package/dist/cli/schema-registration-helpers.d.ts +8 -1
  12. package/dist/cli/schema-registration-helpers.js +14 -5
  13. package/dist/cli-bundle/bundle-manifest.json +149 -149
  14. package/dist/cli-bundle/chunks/chunk-3ENVHX6C.js +36 -0
  15. package/dist/cli-bundle/chunks/{chunk-LOVTQ52Z.js → chunk-DW2CGEMU.js} +2 -2
  16. package/dist/cli-bundle/chunks/chunk-EG6CLDZT.js +5 -0
  17. package/dist/cli-bundle/chunks/{chunk-LARJJ3RK.js → chunk-F3AI2JFL.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-N3DSV4CH.js → chunk-HWZ6CELB.js} +8 -8
  19. package/dist/cli-bundle/chunks/chunk-HZBMLSZI.js +201 -0
  20. package/dist/cli-bundle/chunks/chunk-JB4KZWBF.js +3 -0
  21. package/dist/cli-bundle/chunks/chunk-KPH73XXJ.js +2 -0
  22. package/dist/cli-bundle/chunks/{chunk-BKYB45NQ.js → chunk-KXPMB2YL.js} +50 -50
  23. package/dist/cli-bundle/chunks/{chunk-BUNIEJNE.js → chunk-QDVHNHAQ.js} +2 -2
  24. package/dist/cli-bundle/chunks/chunk-TFI5V5N2.js +13 -0
  25. package/dist/cli-bundle/chunks/{register-list-query-F57EWDEF.js → register-list-query-UJB5FMV2.js} +2 -2
  26. package/dist/cli-bundle/chunks/register-mutation-NX5XE4VX.js +20 -0
  27. package/dist/cli-bundle/chunks/register-operations-RXIJIYXC.js +2 -0
  28. package/dist/cli-bundle/chunks/{register-setup-HXU7IZZD.js → register-setup-GFUZEKRE.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/{chunk-F4YEW5I2.js → chunk-37Z4OEAP.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/chunk-3UPTYG44.js +8 -0
  31. package/dist/cli-bundle/focused-chunks/chunk-5S7E72FY.js +16 -0
  32. package/dist/cli-bundle/focused-chunks/{chunk-4ERLO7QD.js → chunk-AUFH5H35.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/chunk-E7X25GC3.js +2 -0
  34. package/dist/cli-bundle/focused-chunks/chunk-FQCSTBWE.js +4 -0
  35. package/dist/cli-bundle/focused-chunks/{chunk-FH6DYED3.js → chunk-FZS4H32O.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/chunk-IFLWKY2R.js +156 -0
  37. package/dist/cli-bundle/focused-chunks/{chunk-YKBKIEAJ.js → chunk-JOWDB2MH.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/chunk-LYVSW5VM.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/chunk-MRCNF3U6.js +2 -0
  40. package/dist/cli-bundle/focused-chunks/{chunk-UZE7XUZK.js → chunk-OFVUGTLJ.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/{chunk-FJ22HNRP.js → chunk-OGLQBL46.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/chunk-OY7QAV4Y.js +51 -0
  43. package/dist/cli-bundle/focused-chunks/chunk-QGFNI65N.js +26 -0
  44. package/dist/cli-bundle/focused-chunks/{chunk-KDNG7TKQ.js → chunk-R27IDGHD.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/chunk-UYRFYCDQ.js +5 -0
  46. package/dist/cli-bundle/focused-chunks/{chunk-2NIY5NKG.js → chunk-ZHVA42R5.js} +9 -9
  47. package/dist/cli-bundle/main.js +13 -13
  48. package/dist/cli-bundle/sdk-authoring.js +1 -1
  49. package/dist/cli-bundle/sdk-contracts.js +2 -2
  50. package/dist/cli-bundle/sdk-core.js +40 -40
  51. package/dist/cli-bundle/sdk-governance.js +1 -1
  52. package/dist/cli-bundle/sdk-graph.js +1 -1
  53. package/dist/cli-bundle/sdk-merge.js +33 -32
  54. package/dist/cli-bundle/sdk-query.js +1 -1
  55. package/dist/cli-bundle/sdk-runtime.js +1 -1
  56. package/dist/cli-bundle/sdk-testing.js +1 -1
  57. package/dist/cli-bundle/sdk.js +5 -5
  58. package/dist/core/config/nested-settings.js +8 -2
  59. package/dist/core/config/positional-value.d.ts +1 -1
  60. package/dist/core/config/positional-value.js +5 -2
  61. package/dist/core/extensions/extension-hook-runtime.js +22 -20
  62. package/dist/core/extensions/extension-types.d.ts +8 -1
  63. package/dist/core/extensions/extension-types.js +2 -2
  64. package/dist/core/extensions/loader.js +7 -3
  65. package/dist/core/extensions/service-ownership.d.ts +8 -0
  66. package/dist/core/extensions/service-ownership.js +20 -0
  67. package/dist/core/history/history.js +3 -3
  68. package/dist/core/item/id.js +20 -5
  69. package/dist/core/item/item-format.js +81 -2
  70. package/dist/core/reproducibility/context.d.ts +4 -0
  71. package/dist/core/reproducibility/context.js +14 -8
  72. package/dist/core/shared/author.d.ts +55 -1
  73. package/dist/core/shared/author.js +333 -16
  74. package/dist/core/shared/constants.js +3 -2
  75. package/dist/core/shared/errors.d.ts +4 -0
  76. package/dist/core/shared/errors.js +2 -2
  77. package/dist/core/store/settings-validator.d.ts +1 -0
  78. package/dist/core/store/settings-validator.js +6 -3
  79. package/dist/core/store/settings.js +5 -2
  80. package/dist/mcp/server.d.ts +1 -1
  81. package/dist/mcp/server.js +30 -9
  82. package/dist/sdk/agent/identity-config.d.ts +63 -0
  83. package/dist/sdk/agent/identity-config.js +107 -0
  84. package/dist/sdk/agent/refusal-corpus-contracts.d.ts +76 -0
  85. package/dist/sdk/agent/refusal-corpus-contracts.js +194 -0
  86. package/dist/sdk/agent/refusal-reachability.d.ts +1 -1
  87. package/dist/sdk/authoring.d.ts +1 -1
  88. package/dist/sdk/authoring.js +2 -2
  89. package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +77 -0
  90. package/dist/sdk/cli-contracts/agent-output-contracts.js +326 -2
  91. package/dist/sdk/cli-contracts/commander-mutation-options.js +3 -3
  92. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -0
  93. package/dist/sdk/cli-contracts/enum-contracts.js +9 -2
  94. package/dist/sdk/cli-contracts/flag-contracts.js +9 -2
  95. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +4 -4
  96. package/dist/sdk/cli-contracts/registration-helpers.js +5 -2
  97. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +3 -1
  98. package/dist/sdk/cli-contracts/runtime-contracts.js +4 -3
  99. package/dist/sdk/cli-contracts/tool-parameter-tables.js +22 -2
  100. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  101. package/dist/sdk/cli-contracts/tool-schema.js +14 -3
  102. package/dist/sdk/cli-contracts.d.ts +4 -4
  103. package/dist/sdk/cli-contracts.js +5 -5
  104. package/dist/sdk/config.d.ts +6 -1
  105. package/dist/sdk/config.js +119 -14
  106. package/dist/sdk/context-intent-contracts.js +4 -2
  107. package/dist/sdk/core-governance.d.ts +1 -1
  108. package/dist/sdk/core-governance.js +3 -3
  109. package/dist/sdk/extension/install-sources.d.ts +1 -1
  110. package/dist/sdk/extension/install-sources.js +6 -3
  111. package/dist/sdk/extension/output-ownership.d.ts +1 -0
  112. package/dist/sdk/extension/output-ownership.js +3 -2
  113. package/dist/sdk/extension/scaffold.js +11 -5
  114. package/dist/sdk/flag-invocation-contracts.js +4 -2
  115. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +74 -2
  116. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +87 -26
  117. package/dist/sdk/governance/assurance-action.js +30 -10
  118. package/dist/sdk/governance/health.d.ts +3 -0
  119. package/dist/sdk/governance/health.js +39 -7
  120. package/dist/sdk/governance/hierarchy-validation.d.ts +29 -0
  121. package/dist/sdk/governance/hierarchy-validation.js +109 -0
  122. package/dist/sdk/governance/validate.d.ts +3 -9
  123. package/dist/sdk/governance/validate.js +84 -111
  124. package/dist/sdk/graph/assembly.d.ts +6 -1
  125. package/dist/sdk/graph/assembly.js +16 -22
  126. package/dist/sdk/graph/governance-contracts.d.ts +1 -1
  127. package/dist/sdk/graph/governance-contracts.js +8 -2
  128. package/dist/sdk/graph/governance.js +46 -2
  129. package/dist/sdk/graph/hierarchy-integrity.d.ts +94 -0
  130. package/dist/sdk/graph/hierarchy-integrity.js +311 -0
  131. package/dist/sdk/graph/index.d.ts +2 -1
  132. package/dist/sdk/graph/index.js +3 -2
  133. package/dist/sdk/graph/remediation.js +32 -2
  134. package/dist/sdk/graph/run.d.ts +31 -2
  135. package/dist/sdk/graph/run.js +80 -31
  136. package/dist/sdk/graph/workspace-relationship-kind-registry.d.ts +8 -0
  137. package/dist/sdk/graph/workspace-relationship-kind-registry.js +28 -0
  138. package/dist/sdk/index.d.ts +8 -3
  139. package/dist/sdk/index.js +9 -4
  140. package/dist/sdk/item-children.js +21 -8
  141. package/dist/sdk/lifecycle/create.js +129 -97
  142. package/dist/sdk/lifecycle/hierarchy-mutation-lock.d.ts +15 -0
  143. package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +25 -0
  144. package/dist/sdk/lifecycle/update.d.ts +2 -0
  145. package/dist/sdk/lifecycle/update.js +174 -84
  146. package/dist/sdk/merge/three-way.js +105 -26
  147. package/dist/sdk/query/complete-list.d.ts +3 -3
  148. package/dist/sdk/query/complete-list.js +46 -3
  149. package/dist/sdk/query/list.d.ts +4 -3
  150. package/dist/sdk/query/list.js +89 -49
  151. package/dist/sdk/read-output-budget.d.ts +21 -0
  152. package/dist/sdk/read-output-budget.js +39 -2
  153. package/dist/sdk/read-output-contracts.d.ts +10 -4
  154. package/dist/sdk/read-output-contracts.js +105 -32
  155. package/dist/sdk/relationship-context.js +3 -4
  156. package/dist/sdk/relationships.js +17 -10
  157. package/dist/sdk/reproducibility/process.d.ts +19 -0
  158. package/dist/sdk/reproducibility/process.js +88 -0
  159. package/dist/sdk/runtime-primitives.d.ts +1 -1
  160. package/dist/sdk/runtime-primitives.js +3 -3
  161. package/dist/sdk/runtime.d.ts +3 -2
  162. package/dist/sdk/runtime.js +7 -5
  163. package/dist/sdk/test/batch.d.ts +6 -0
  164. package/dist/sdk/test/batch.js +26 -6
  165. package/dist/sdk/test/entry.d.ts +1 -1
  166. package/dist/sdk/test/entry.js +3 -2
  167. package/dist/sdk/test/execution.d.ts +28 -3
  168. package/dist/sdk/test/execution.js +201 -34
  169. package/dist/sdk/test/parsers.d.ts +6 -0
  170. package/dist/sdk/test/parsers.js +21 -2
  171. package/dist/sdk/test/trust.d.ts +33 -0
  172. package/dist/sdk/test/trust.js +207 -0
  173. package/dist/types.d.ts +34 -0
  174. package/dist/types.js +2 -2
  175. package/docs/AGENT_PROVENANCE_ADR.md +41 -5
  176. package/docs/AGENT_UX_CONTRACTS.md +20 -4
  177. package/docs/COMMANDS.md +29 -14
  178. package/docs/CONFIGURATION.md +4 -0
  179. package/docs/DEPENDENCY_KIND_CONTRACT.md +31 -3
  180. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +115 -0
  181. package/docs/EXTENSIONS.md +2 -1
  182. package/docs/MERGE_SAFETY.md +15 -1
  183. package/docs/README.md +1 -0
  184. package/docs/READ_OUTPUT_CONTRACTS.md +19 -2
  185. package/docs/RELATIONSHIP_GRAPH.md +6 -3
  186. package/docs/REPRODUCIBLE_WORKSPACES.md +42 -8
  187. package/docs/SDK.md +9 -0
  188. package/docs/SDK_AGENT_SESSION_CONTEXT.md +6 -4
  189. package/docs/SDK_EVIDENCE_TRACEABILITY.md +1 -1
  190. package/docs/TESTING.md +83 -1
  191. package/docs/agent-task-token-baseline.json +2 -2
  192. package/docs/generated/FLAG_LEXICON_BUDGETS.md +2 -2
  193. package/marketplace.json +2 -2
  194. package/package.json +2 -2
  195. package/packages/pm-beads/package.json +1 -1
  196. package/packages/pm-calendar/package.json +1 -1
  197. package/packages/pm-command-kit/package.json +1 -1
  198. package/packages/pm-digital-twin/package.json +1 -1
  199. package/packages/pm-governance-audit/package.json +1 -1
  200. package/packages/pm-guide-shell/package.json +1 -1
  201. package/packages/pm-kanban/package.json +1 -1
  202. package/packages/pm-lifecycle-hooks/package.json +1 -1
  203. package/packages/pm-linked-test-adapters/package.json +1 -1
  204. package/packages/pm-search-advanced/package.json +1 -1
  205. package/packages/pm-templates/package.json +1 -1
  206. package/packages/pm-todos/package.json +1 -1
  207. package/packages/pm-vcs/package.json +1 -1
  208. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  209. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  210. package/sdk/public-surface.json +1021 -53
  211. package/dist/cli-bundle/chunks/chunk-2MA6ZQVZ.js +0 -197
  212. package/dist/cli-bundle/chunks/chunk-3AFAUHUE.js +0 -2
  213. package/dist/cli-bundle/chunks/chunk-7VHZS727.js +0 -5
  214. package/dist/cli-bundle/chunks/chunk-JSLOFXGA.js +0 -3
  215. package/dist/cli-bundle/chunks/chunk-OCLPLFAY.js +0 -35
  216. package/dist/cli-bundle/chunks/chunk-S4IRYKBU.js +0 -13
  217. package/dist/cli-bundle/chunks/register-mutation-7IY2D5KO.js +0 -20
  218. package/dist/cli-bundle/chunks/register-operations-FALL3YTU.js +0 -2
  219. package/dist/cli-bundle/focused-chunks/chunk-7WZRLCYF.js +0 -50
  220. package/dist/cli-bundle/focused-chunks/chunk-CKKQSJNN.js +0 -2
  221. package/dist/cli-bundle/focused-chunks/chunk-EEFKYMDR.js +0 -16
  222. package/dist/cli-bundle/focused-chunks/chunk-F2A56DHV.js +0 -8
  223. package/dist/cli-bundle/focused-chunks/chunk-FV5ACOK7.js +0 -2
  224. package/dist/cli-bundle/focused-chunks/chunk-JEAVFOWM.js +0 -2
  225. package/dist/cli-bundle/focused-chunks/chunk-NJ63LOP6.js +0 -155
  226. package/dist/cli-bundle/focused-chunks/chunk-NXRTQ7HI.js +0 -2
  227. package/dist/cli-bundle/focused-chunks/chunk-TJ7EMJ46.js +0 -4
  228. package/dist/cli-bundle/focused-chunks/chunk-ZOSEELYJ.js +0 -26
@@ -6,6 +6,59 @@ export type PmOutputDegradationStep = (typeof PM_OUTPUT_DEGRADATION_STEPS)[numbe
6
6
  export declare const PM_OUTPUT_BUDGET_CLASSES: readonly ["mutation", "read", "discovery", "governance"];
7
7
  /** Restricts command-output budget classes. */
8
8
  export type PmOutputBudgetClass = (typeof PM_OUTPUT_BUDGET_CLASSES)[number];
9
+ /** Stable diagnostic families that require independent output ceilings. */
10
+ export declare const PM_DIAGNOSTIC_OUTPUT_CLASSES: readonly ["error", "warning", "validation_summary", "recovery_bundle"];
11
+ /** Restricts diagnostic budget selection to declared families. */
12
+ export type PmDiagnosticOutputClass = (typeof PM_DIAGNOSTIC_OUTPUT_CLASSES)[number];
13
+ /** Deterministic diagnostic degradation stages, from richest to smallest. */
14
+ export declare const PM_DIAGNOSTIC_DEGRADATION_STEPS: readonly ["full", "omit_explanation", "limit_collections", "compact_recovery", "action_only"];
15
+ /** Restricts diagnostic degradation receipts to declared stages. */
16
+ export type PmDiagnosticDegradationStep = (typeof PM_DIAGNOSTIC_DEGRADATION_STEPS)[number];
17
+ /** Declares one diagnostic family's text and JSON token ceilings. */
18
+ export interface PmDiagnosticOutputBudgetContract {
19
+ /** Diagnostic family governed by this contract. */
20
+ diagnostic_class: PmDiagnosticOutputClass;
21
+ /** Default ceiling by rendered transport. */
22
+ default_max_estimated_tokens_by_format: Readonly<{
23
+ text: number;
24
+ json: number;
25
+ }>;
26
+ /** Smallest explicit ceiling accepted by the projector. */
27
+ minimum_max_estimated_tokens: number;
28
+ /** Ordered degradation policy applied when the ceiling binds. */
29
+ degradation_ladder: readonly PmDiagnosticDegradationStep[];
30
+ /** Paths whose first actionable value must survive degradation. */
31
+ corrective_action_paths: readonly string[];
32
+ /** Stable estimate used by gates and SDK consumers. */
33
+ token_estimate: "ceil(utf8_bytes / 4)";
34
+ }
35
+ /** Machine-readable disclosure attached to a projected diagnostic. */
36
+ export interface PmDiagnosticOutputReceipt {
37
+ /** Diagnostic family whose contract bound the output. */
38
+ diagnostic_class: PmDiagnosticOutputClass;
39
+ /** Rendered transport measured by the projector. */
40
+ format: "json" | "text";
41
+ /** Effective estimated-token ceiling. */
42
+ budget: number;
43
+ /** Whether the caller supplied the ceiling or used the declaration. */
44
+ budget_source: "default" | "explicit";
45
+ /** Estimate before diagnostic degradation. */
46
+ original_estimated_tokens: number;
47
+ /** Exact estimate of the returned projection. */
48
+ estimated_tokens: number;
49
+ /** Whether one or more fields were removed or compacted. */
50
+ truncated: boolean;
51
+ /** Applied stages in contract order. */
52
+ degradation_steps: PmDiagnosticDegradationStep[];
53
+ /** Top-level fields removed from the original diagnostic. */
54
+ omitted_fields: string[];
55
+ /** Additional omitted fields not named individually in a bounded receipt. */
56
+ omitted_fields_overflow_count?: number;
57
+ }
58
+ /** JSON diagnostic after binding it to a declared output contract. */
59
+ export type PmProjectedDiagnostic<TDiagnostic extends object> = Partial<TDiagnostic> & Pick<TDiagnostic, Extract<keyof TDiagnostic, "code" | "required">> & {
60
+ diagnostic_output?: PmDiagnosticOutputReceipt;
61
+ };
9
62
  /** Describes one command's default agent-output budget and degradation policy. */
10
63
  export interface PmCommandOutputBudgetContract {
11
64
  /** Canonical or compatibility command name. */
@@ -26,6 +79,8 @@ export interface PmCommandOutputBudgetContract {
26
79
  /** Stable estimate used by gates and SDK consumers. */
27
80
  token_estimate: "ceil(utf8_bytes / 4)";
28
81
  }
82
+ /** Public default contract for every diagnostic family. */
83
+ export declare const PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS: PmDiagnosticOutputBudgetContract[];
29
84
  /** Infer the conservative workload class for a core or package command. */
30
85
  export declare function inferPmOutputBudgetClass(command: string): PmOutputBudgetClass;
31
86
  /** Build the generated default budget for a core or package command. */
@@ -48,3 +103,25 @@ export declare function resolvePmCommandOutputBudget(command: string, options?:
48
103
  }): PmCommandOutputBudgetContract | null;
49
104
  /** Estimate conservative token usage from UTF-8 output bytes. */
50
105
  export declare function estimatePmOutputTokens(utf8Bytes: number): number;
106
+ /** Resolve the binding output contract for one diagnostic family. */
107
+ export declare function resolvePmDiagnosticOutputBudget(diagnosticClass: PmDiagnosticOutputClass): PmDiagnosticOutputBudgetContract;
108
+ /**
109
+ * Bind a JSON diagnostic to its declared ceiling while preserving the first
110
+ * corrective action and reporting every top-level omission.
111
+ */
112
+ export declare function projectPmDiagnosticOutput<TDiagnostic extends object>(diagnostic: TDiagnostic, options?: {
113
+ diagnosticClass?: PmDiagnosticOutputClass;
114
+ maxEstimatedTokens?: number;
115
+ }): PmProjectedDiagnostic<TDiagnostic>;
116
+ /** Text diagnostic together with the same measured receipt used by JSON. */
117
+ export interface PmProjectedTextDiagnostic {
118
+ /** Rendered action-first diagnostic. */
119
+ output: string;
120
+ /** Binding diagnostic budget receipt. */
121
+ diagnostic_output: PmDiagnosticOutputReceipt;
122
+ }
123
+ /** Bind human-readable diagnostics without ever truncating the corrective action away. */
124
+ export declare function projectPmDiagnosticText(output: string, correctiveAction: string, options?: {
125
+ diagnosticClass?: PmDiagnosticOutputClass;
126
+ maxEstimatedTokens?: number;
127
+ }): PmProjectedTextDiagnostic;
@@ -6,7 +6,7 @@
6
6
  * output policy without coupling package authors to pm's renderer.
7
7
  */
8
8
 
9
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="23b3a820-f205-506b-9507-dbd60087f62e")}catch(e){}}();
9
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1d338971-5a60-5b4e-b4c8-0705c8e8c98c")}catch(e){}}();
10
10
  import { PM_CORE_COMMAND_NAMES } from "./enum-contracts.js";
11
11
  /** Stable degradation stages applied when an output exceeds its token budget. */
12
12
  export const PM_OUTPUT_DEGRADATION_STEPS = [
@@ -23,6 +23,21 @@ export const PM_OUTPUT_BUDGET_CLASSES = [
23
23
  "discovery",
24
24
  "governance",
25
25
  ];
26
+ /** Stable diagnostic families that require independent output ceilings. */
27
+ export const PM_DIAGNOSTIC_OUTPUT_CLASSES = [
28
+ "error",
29
+ "warning",
30
+ "validation_summary",
31
+ "recovery_bundle",
32
+ ];
33
+ /** Deterministic diagnostic degradation stages, from richest to smallest. */
34
+ export const PM_DIAGNOSTIC_DEGRADATION_STEPS = [
35
+ "full",
36
+ "omit_explanation",
37
+ "limit_collections",
38
+ "compact_recovery",
39
+ "action_only",
40
+ ];
26
41
  const MUTATION_COMMANDS = new Set([
27
42
  "append",
28
43
  "claim",
@@ -84,6 +99,29 @@ const DEFAULT_MAX_ESTIMATED_TOKENS = {
84
99
  };
85
100
  const JSON_BUDGET_NUMERATOR = 3;
86
101
  const JSON_BUDGET_DENOMINATOR = 2;
102
+ const MINIMUM_DIAGNOSTIC_BUDGET = 192;
103
+ const DIAGNOSTIC_DEFAULT_BUDGETS = {
104
+ error: { text: 768, json: 2_000 },
105
+ warning: { text: 768, json: 2_000 },
106
+ validation_summary: { text: 1_500, json: 3_000 },
107
+ recovery_bundle: { text: 768, json: 2_000 },
108
+ };
109
+ /** Public default contract for every diagnostic family. */
110
+ export const PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS = PM_DIAGNOSTIC_OUTPUT_CLASSES.map((diagnosticClass) => ({
111
+ diagnostic_class: diagnosticClass,
112
+ default_max_estimated_tokens_by_format: DIAGNOSTIC_DEFAULT_BUDGETS[diagnosticClass],
113
+ minimum_max_estimated_tokens: MINIMUM_DIAGNOSTIC_BUDGET,
114
+ degradation_ladder: PM_DIAGNOSTIC_DEGRADATION_STEPS,
115
+ corrective_action_paths: [
116
+ "required",
117
+ "recovery.suggested_retry",
118
+ "recovery.suggested_retry_args",
119
+ "recovery.next_best_command",
120
+ "next_steps[0]",
121
+ ],
122
+ token_estimate: "ceil(utf8_bytes / 4)",
123
+ }));
124
+ const DIAGNOSTIC_BUDGET_BY_CLASS = new Map(PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS.map((contract) => [contract.diagnostic_class, contract]));
87
125
  /** Infer the conservative workload class for a core or package command. */
88
126
  export function inferPmOutputBudgetClass(command) {
89
127
  const [rootCommand = ""] = command.trim().split(/\s+/u);
@@ -150,5 +188,291 @@ export function resolvePmCommandOutputBudget(command, options = {}) {
150
188
  export function estimatePmOutputTokens(utf8Bytes) {
151
189
  return Math.ceil(Math.max(0, utf8Bytes) / 4);
152
190
  }
191
+ /** Resolve the binding output contract for one diagnostic family. */
192
+ export function resolvePmDiagnosticOutputBudget(diagnosticClass) {
193
+ const contract = DIAGNOSTIC_BUDGET_BY_CLASS.get(diagnosticClass);
194
+ if (contract === undefined) {
195
+ throw new TypeError(`diagnosticClass must be one of: ${PM_DIAGNOSTIC_OUTPUT_CLASSES.join(", ")}`);
196
+ }
197
+ return contract;
198
+ }
199
+ function estimateJsonDiagnosticTokens(value) {
200
+ return estimatePmOutputTokens(Buffer.byteLength(JSON.stringify(value, null, 2), "utf8"));
201
+ }
202
+ function isDiagnosticRecord(value) {
203
+ return typeof value === "object" && value !== null && !Array.isArray(value);
204
+ }
205
+ function compactDiagnosticRecovery(value) {
206
+ if (!isDiagnosticRecord(value))
207
+ return undefined;
208
+ const compact = {};
209
+ for (const key of [
210
+ "suggested_retry",
211
+ "suggested_retry_args",
212
+ "next_best_command",
213
+ "allowed_values",
214
+ "candidate_commands",
215
+ "missing",
216
+ "missing_required_fields",
217
+ "option_scope",
218
+ "retry_after_ms",
219
+ ]) {
220
+ const candidate = value[key];
221
+ if (Array.isArray(candidate)) {
222
+ compact[key] =
223
+ key === "suggested_retry_args" ? candidate : candidate.slice(0, 3);
224
+ }
225
+ else if (candidate !== undefined)
226
+ compact[key] = candidate;
227
+ }
228
+ return Object.keys(compact).length > 0 ? compact : undefined;
229
+ }
230
+ function truncateDiagnosticString(value, maximum) {
231
+ if (typeof value !== "string" || value.length <= maximum)
232
+ return value;
233
+ return `${value.slice(0, Math.max(1, maximum - 3))}...`;
234
+ }
235
+ function truncateDiagnosticUtf8Text(value, maximumBytes) {
236
+ if (Buffer.byteLength(value, "utf8") <= maximumBytes)
237
+ return value;
238
+ const suffix = "...";
239
+ const codePoints = Array.from(value);
240
+ let lower = 0;
241
+ let upper = codePoints.length;
242
+ while (lower < upper) {
243
+ const middle = Math.ceil((lower + upper) / 2);
244
+ const candidate = `${codePoints.slice(0, middle).join("")}${suffix}`;
245
+ if (Buffer.byteLength(candidate, "utf8") <= maximumBytes)
246
+ lower = middle;
247
+ else
248
+ upper = middle - 1;
249
+ }
250
+ return `${codePoints.slice(0, lower).join("")}${suffix}`;
251
+ }
252
+ function prioritizeDiagnosticFields(diagnostic) {
253
+ const prioritized = {};
254
+ for (const key of [
255
+ "code",
256
+ "required",
257
+ "recovery",
258
+ "next_steps",
259
+ "exit_code",
260
+ "type",
261
+ "title",
262
+ "detail",
263
+ "why",
264
+ "examples",
265
+ ]) {
266
+ if (Object.hasOwn(diagnostic, key) && diagnostic[key] !== undefined) {
267
+ prioritized[key] = diagnostic[key];
268
+ }
269
+ }
270
+ for (const [key, value] of Object.entries(diagnostic)) {
271
+ if (key !== "__proto__" && !Object.hasOwn(prioritized, key)) {
272
+ prioritized[key] = value;
273
+ }
274
+ }
275
+ return prioritized;
276
+ }
277
+ const DIAGNOSTIC_COLLECTION_LIMIT_STAGES = new Set(["limit_collections", "compact_recovery", "action_only"]);
278
+ const DIAGNOSTIC_RECOVERY_COMPACTION_STAGES = new Set(["compact_recovery", "action_only"]);
279
+ function actionOnlyDiagnostic(candidate) {
280
+ const actionOnly = {
281
+ code: typeof candidate.code === "string" ? candidate.code : "diagnostic",
282
+ required: truncateDiagnosticString(candidate.required, 160) ??
283
+ "Inspect the diagnostic code and retry with corrected input.",
284
+ };
285
+ const recovery = compactDiagnosticRecovery(candidate.recovery);
286
+ if (recovery !== undefined) {
287
+ actionOnly.recovery = recovery;
288
+ }
289
+ else if (Array.isArray(candidate.next_steps)) {
290
+ actionOnly.next_steps = candidate.next_steps.slice(0, 1);
291
+ }
292
+ if (candidate.exit_code !== undefined)
293
+ actionOnly.exit_code = candidate.exit_code;
294
+ if (candidate.type !== undefined)
295
+ actionOnly.type = candidate.type;
296
+ return actionOnly;
297
+ }
298
+ function diagnosticCandidate(diagnostic, stage) {
299
+ const candidate = structuredClone(diagnostic);
300
+ if (stage !== "full") {
301
+ delete candidate.why;
302
+ delete candidate.examples;
303
+ }
304
+ if (DIAGNOSTIC_COLLECTION_LIMIT_STAGES.has(stage)) {
305
+ for (const [key, value] of Object.entries(candidate)) {
306
+ if (Array.isArray(value))
307
+ candidate[key] = value.slice(0, 3);
308
+ }
309
+ }
310
+ if (DIAGNOSTIC_RECOVERY_COMPACTION_STAGES.has(stage)) {
311
+ const recovery = compactDiagnosticRecovery(candidate.recovery);
312
+ if (recovery)
313
+ candidate.recovery = recovery;
314
+ else
315
+ delete candidate.recovery;
316
+ }
317
+ if (stage !== "action_only")
318
+ return prioritizeDiagnosticFields(candidate);
319
+ return actionOnlyDiagnostic(candidate);
320
+ }
321
+ function attachDiagnosticReceipt(candidate, receipt) {
322
+ const projected = {
323
+ ...candidate,
324
+ diagnostic_output: { ...receipt, estimated_tokens: 0 },
325
+ };
326
+ for (let attempt = 0; attempt < 4; attempt += 1) {
327
+ const estimatedTokens = estimateJsonDiagnosticTokens(projected);
328
+ const outputReceipt = projected.diagnostic_output;
329
+ if (outputReceipt.estimated_tokens === estimatedTokens)
330
+ break;
331
+ outputReceipt.estimated_tokens = estimatedTokens;
332
+ }
333
+ return projected;
334
+ }
335
+ function shrinkMinimalDiagnosticCandidate(candidate, receipt, budget) {
336
+ let fallback = attachDiagnosticReceipt(candidate, receipt);
337
+ for (const optionalField of ["recovery", "exit_code"]) {
338
+ if (estimateJsonDiagnosticTokens(fallback) <= budget ||
339
+ candidate[optionalField] === undefined) {
340
+ continue;
341
+ }
342
+ delete candidate[optionalField];
343
+ fallback = attachDiagnosticReceipt(candidate, receipt);
344
+ }
345
+ let maximumActionBytes = 40;
346
+ while (estimateJsonDiagnosticTokens(fallback) > budget &&
347
+ maximumActionBytes > 4) {
348
+ maximumActionBytes -= 4;
349
+ candidate.code = truncateDiagnosticUtf8Text(String(candidate.code), maximumActionBytes);
350
+ candidate.required = truncateDiagnosticUtf8Text(String(candidate.required), maximumActionBytes);
351
+ fallback = attachDiagnosticReceipt(candidate, receipt);
352
+ }
353
+ return fallback;
354
+ }
355
+ function createMinimalDiagnosticFallback(projected, budget) {
356
+ const receipt = projected.diagnostic_output;
357
+ const { estimated_tokens: _estimatedTokens, ...receiptWithoutEstimate } = receipt;
358
+ const boundedOmittedFields = receiptWithoutEstimate.omitted_fields
359
+ .slice(0, 8)
360
+ .map((field) => truncateDiagnosticUtf8Text(field, 32));
361
+ const boundedReceipt = {
362
+ ...receiptWithoutEstimate,
363
+ omitted_fields: boundedOmittedFields,
364
+ ...(receiptWithoutEstimate.omitted_fields.length >
365
+ boundedOmittedFields.length
366
+ ? {
367
+ omitted_fields_overflow_count: receiptWithoutEstimate.omitted_fields.length -
368
+ boundedOmittedFields.length,
369
+ }
370
+ : {}),
371
+ };
372
+ const recoveryCandidate = compactDiagnosticRecovery(projected.recovery);
373
+ const recovery = recoveryCandidate && estimateJsonDiagnosticTokens(recoveryCandidate) <= 48
374
+ ? recoveryCandidate
375
+ : undefined;
376
+ const candidate = {
377
+ code: truncateDiagnosticUtf8Text(String(projected.code), 320),
378
+ required: truncateDiagnosticUtf8Text(String(projected.required), 320),
379
+ ...(recovery ? { recovery } : {}),
380
+ ...(projected.exit_code !== undefined
381
+ ? { exit_code: projected.exit_code }
382
+ : {}),
383
+ };
384
+ let fallback = attachDiagnosticReceipt(candidate, boundedReceipt);
385
+ while (estimateJsonDiagnosticTokens(fallback) > budget &&
386
+ boundedReceipt.omitted_fields.length > 0) {
387
+ boundedReceipt.omitted_fields.pop();
388
+ boundedReceipt.omitted_fields_overflow_count =
389
+ receiptWithoutEstimate.omitted_fields.length -
390
+ boundedReceipt.omitted_fields.length;
391
+ fallback = attachDiagnosticReceipt(candidate, boundedReceipt);
392
+ }
393
+ fallback = shrinkMinimalDiagnosticCandidate(candidate, boundedReceipt, budget);
394
+ return fallback;
395
+ }
396
+ /**
397
+ * Bind a JSON diagnostic to its declared ceiling while preserving the first
398
+ * corrective action and reporting every top-level omission.
399
+ */
400
+ export function projectPmDiagnosticOutput(diagnostic, options = {}) {
401
+ const diagnosticRecord = diagnostic;
402
+ const diagnosticClass = options.diagnosticClass ?? "error";
403
+ const contract = resolvePmDiagnosticOutputBudget(diagnosticClass);
404
+ const explicitBudget = options.maxEstimatedTokens;
405
+ if (explicitBudget !== undefined &&
406
+ (!Number.isSafeInteger(explicitBudget) ||
407
+ explicitBudget < contract.minimum_max_estimated_tokens)) {
408
+ throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${contract.minimum_max_estimated_tokens}`);
409
+ }
410
+ const budget = explicitBudget ?? contract.default_max_estimated_tokens_by_format.json;
411
+ const originalEstimatedTokens = estimateJsonDiagnosticTokens(diagnosticRecord);
412
+ const originalFields = Object.keys(diagnosticRecord);
413
+ if (originalEstimatedTokens <= budget) {
414
+ return prioritizeDiagnosticFields(structuredClone(diagnosticRecord));
415
+ }
416
+ let projected;
417
+ for (const [index, stage] of contract.degradation_ladder.entries()) {
418
+ const candidate = diagnosticCandidate(diagnosticRecord, stage);
419
+ const omittedFields = originalFields.filter((field) => !Object.hasOwn(candidate, field));
420
+ const withReceipt = attachDiagnosticReceipt(candidate, {
421
+ diagnostic_class: diagnosticClass,
422
+ format: "json",
423
+ budget,
424
+ budget_source: explicitBudget === undefined ? "default" : "explicit",
425
+ original_estimated_tokens: originalEstimatedTokens,
426
+ truncated: index > 0,
427
+ degradation_steps: contract.degradation_ladder.slice(0, index + 1),
428
+ omitted_fields: omittedFields,
429
+ });
430
+ projected = withReceipt;
431
+ if (estimateJsonDiagnosticTokens(withReceipt) <= budget)
432
+ break;
433
+ }
434
+ if (estimateJsonDiagnosticTokens(projected) > budget) {
435
+ projected = createMinimalDiagnosticFallback(projected, budget);
436
+ }
437
+ return projected;
438
+ }
439
+ /** Bind human-readable diagnostics without ever truncating the corrective action away. */
440
+ export function projectPmDiagnosticText(output, correctiveAction, options = {}) {
441
+ const diagnosticClass = options.diagnosticClass ?? "error";
442
+ const contract = resolvePmDiagnosticOutputBudget(diagnosticClass);
443
+ const explicitBudget = options.maxEstimatedTokens;
444
+ if (explicitBudget !== undefined &&
445
+ (!Number.isSafeInteger(explicitBudget) ||
446
+ explicitBudget < contract.minimum_max_estimated_tokens)) {
447
+ throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${contract.minimum_max_estimated_tokens}`);
448
+ }
449
+ const budget = explicitBudget ?? contract.default_max_estimated_tokens_by_format.text;
450
+ const originalEstimatedTokens = estimatePmOutputTokens(Buffer.byteLength(output, "utf8"));
451
+ const truncated = originalEstimatedTokens > budget;
452
+ const actionPrefix = "What is required:\n ";
453
+ const actionSuffix = `\n\nDiagnostic output exceeded its declared ${budget}-token ceiling; rerun with structured JSON for the bounded recovery envelope.`;
454
+ const correctiveActionText = correctiveAction.trim() ||
455
+ "Inspect the diagnostic code and retry with corrected input.";
456
+ const availableActionBytes = Math.max(1, budget * 4 - Buffer.byteLength(`${actionPrefix}${actionSuffix}`, "utf8"));
457
+ const projectedOutput = truncated
458
+ ? `${actionPrefix}${truncateDiagnosticUtf8Text(correctiveActionText, availableActionBytes)}${actionSuffix}`
459
+ : output;
460
+ return {
461
+ output: projectedOutput,
462
+ diagnostic_output: {
463
+ diagnostic_class: diagnosticClass,
464
+ format: "text",
465
+ budget,
466
+ budget_source: explicitBudget === undefined ? "default" : "explicit",
467
+ original_estimated_tokens: originalEstimatedTokens,
468
+ estimated_tokens: estimatePmOutputTokens(Buffer.byteLength(projectedOutput, "utf8")),
469
+ truncated,
470
+ degradation_steps: truncated
471
+ ? [...contract.degradation_ladder]
472
+ : ["full"],
473
+ omitted_fields: truncated ? ["explanation", "collections"] : [],
474
+ },
475
+ };
476
+ }
153
477
  //# sourceMappingURL=agent-output-contracts.js.map
154
- //# debugId=23b3a820-f205-506b-9507-dbd60087f62e
478
+ //# debugId=1d338971-5a60-5b4e-b4c8-0705c8e8c98c
@@ -1,6 +1,6 @@
1
1
  /** Creates commander option registration contracts using the validated operation inputs. */
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="93ce68bd-3140-5361-a6d0-bc60c7304a29")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="be7e506f-c48f-5dfb-9fed-ba1e74fa60ff")}catch(e){}}();
4
4
  export const CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS = [
5
5
  {
6
6
  target: "title",
@@ -969,7 +969,7 @@ export const UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS = [
969
969
  target: "depRemove",
970
970
  keys: ["depRemove", "dep_remove"],
971
971
  option: "--dep-remove <value>",
972
- description: "Remove dependencies by id or id=<id>,kind=<value>,source_kind=<value> selectors (repeatable)",
972
+ description: "Remove by dependency id or exact row signature (repeatable)",
973
973
  repeatable: true,
974
974
  aliasOptions: [
975
975
  {
@@ -1079,4 +1079,4 @@ export const UPDATE_COMMANDER_STRING_OPTION_CONTRACTS = UPDATE_COMMANDER_OPTION_
1079
1079
  /** Public contract for update commander repeatable option contracts, shared by SDK and presentation-layer consumers. */
1080
1080
  export const UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS = UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS.filter((entry) => entry.repeatable === true).map((entry) => ({ target: entry.target, keys: entry.keys }));
1081
1081
  //# sourceMappingURL=commander-mutation-options.js.map
1082
- //# debugId=93ce68bd-3140-5361-a6d0-bc60c7304a29
1082
+ //# debugId=be7e506f-c48f-5dfb-9fed-ba1e74fa60ff
@@ -28,6 +28,10 @@ export declare const PM_CORE_COMMAND_NAMES: readonly ["init", "config", "extensi
28
28
  export declare const GRAPH_SUBCOMMAND_VALUES: readonly ["ancestors", "descendants", "predecessors", "successors", "paths", "impact", "analyze", "audit", "communities", "redundancy", "dominators", "slack", "centrality", "articulation", "plan", "index"];
29
29
  /** Restricts graph subcommand values accepted by command, SDK, and MCP contracts. */
30
30
  export type GraphSubcommand = (typeof GRAPH_SUBCOMMAND_VALUES)[number];
31
+ /** Supported values accepted by the merge subcommand contract across CLI and SDK surfaces. */
32
+ export declare const MERGE_SUBCOMMAND_VALUES: readonly ["install", "reconcile", "report", "driver"];
33
+ /** Restricts merge subcommand values accepted by command and SDK contracts. */
34
+ export type MergeSubcommand = (typeof MERGE_SUBCOMMAND_VALUES)[number];
31
35
  /** Nested lifecycle verbs flattened by SDK and MCP package actions. */
32
36
  export declare const PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS: readonly ["init", "install", "uninstall", "explore", "manage", "describe", "reload", "doctor", "catalog", "adopt", "adopt-all", "activate", "deactivate"];
33
37
  /** Noun-first item lifecycle verbs flattened for SDK and MCP dispatch. */
@@ -4,7 +4,7 @@
4
4
  * Defines SDK command-contract metadata for Enum Contracts.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8b8b6b8e-5061-5da4-a369-eca379c0090b")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3935bae8-0a40-59ea-aca6-64e238d1f318")}catch(e){}}();
8
8
  import { KNOWN_EXTENSION_CAPABILITIES, KNOWN_EXTENSION_POLICY_MODES, KNOWN_EXTENSION_POLICY_SURFACES, KNOWN_EXTENSION_SANDBOX_PROFILES, KNOWN_EXTENSION_SERVICE_NAMES, KNOWN_EXTENSION_TRUST_MODES, } from "../../core/extensions/extension-types.js";
9
9
  import { PM_COMMAND_ALIAS_CONTRACTS } from "./command-aliases.js";
10
10
  /** Public contract for pm extension capability contracts, shared by SDK and presentation-layer consumers. */
@@ -124,6 +124,13 @@ export const GRAPH_SUBCOMMAND_VALUES = [
124
124
  "plan",
125
125
  "index",
126
126
  ];
127
+ /** Supported values accepted by the merge subcommand contract across CLI and SDK surfaces. */
128
+ export const MERGE_SUBCOMMAND_VALUES = [
129
+ "install",
130
+ "reconcile",
131
+ "report",
132
+ "driver",
133
+ ];
127
134
  /** Nested lifecycle verbs flattened by SDK and MCP package actions. */
128
135
  export const PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS = [
129
136
  "init",
@@ -208,4 +215,4 @@ export function isPmExtensionPolicySurfaceContract(value) {
208
215
  return PM_EXTENSION_POLICY_SURFACE_CONTRACTS.includes(value);
209
216
  }
210
217
  //# sourceMappingURL=enum-contracts.js.map
211
- //# debugId=8b8b6b8e-5061-5da4-a369-eca379c0090b
218
+ //# debugId=3935bae8-0a40-59ea-aca6-64e238d1f318
@@ -7,7 +7,7 @@
7
7
  * flag surface stays single-sourced across the CLI, SDK, and MCP boundaries.
8
8
  */
9
9
 
10
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e302f519-aa51-503b-bd1a-f3155338f133")}catch(e){}}();
10
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6664bc8f-e5da-5593-a2df-ac45f1cef09e")}catch(e){}}();
11
11
  import { normalizeUniqueStringList } from "./string-lists.js";
12
12
  import { RESERVED_EXTENSION_HOST_FLAGS } from "../../core/extensions/reserved-host-flags.js";
13
13
  import { PM_POSITIONAL_ACTION_CONTRACTS, } from "./grammar-contracts.js";
@@ -894,6 +894,10 @@ export const TEST_FLAG_CONTRACTS = [
894
894
  { flag: "--shared-host-safe" },
895
895
  { flag: "--pm-context" },
896
896
  { flag: "--override-linked-pm-context" },
897
+ { flag: "--workspace-context" },
898
+ { flag: "--override-linked-workspace-context" },
899
+ { flag: "--allow-untrusted-linked-tests" },
900
+ { flag: "--acknowledge-linked-tests" },
897
901
  { flag: "--fail-on-context-mismatch" },
898
902
  { flag: "--fail-on-skipped" },
899
903
  { flag: "--fail-on-empty-test-run" },
@@ -920,6 +924,9 @@ export const TEST_ALL_FLAG_CONTRACTS = [
920
924
  { flag: "--shared-host-safe" },
921
925
  { flag: "--pm-context" },
922
926
  { flag: "--override-linked-pm-context" },
927
+ { flag: "--workspace-context" },
928
+ { flag: "--override-linked-workspace-context" },
929
+ { flag: "--allow-untrusted-linked-tests" },
923
930
  { flag: "--fail-on-context-mismatch" },
924
931
  { flag: "--fail-on-skipped" },
925
932
  { flag: "--fail-on-empty-test-run" },
@@ -1901,4 +1908,4 @@ export function toCompletionFlagString(flagContracts, includeGlobal = true) {
1901
1908
  return normalizeUniqueStringList(all).join(" ");
1902
1909
  }
1903
1910
  //# sourceMappingURL=flag-contracts.js.map
1904
- //# debugId=e302f519-aa51-503b-bd1a-f3155338f133
1911
+ //# debugId=6664bc8f-e5da-5593-a2df-ac45f1cef09e
@@ -5,7 +5,7 @@
5
5
  * per-command growth budgets.
6
6
  */
7
7
 
8
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6ba3d756-dcd6-59b7-92fe-ec33d294d72b")}catch(e){}}();
8
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8320177c-e95d-5d14-a914-4ac37230c0b9")}catch(e){}}();
9
9
  import { hasSubcommandFlagContractsForCommand, resolveSubcommandFlagContractsForCommand, } from "./flag-contracts.js";
10
10
  import { PM_COMMAND_CAPABILITY_CONTRACTS, } from "../agent-capability-contracts.js";
11
11
  import { enrichCliFlagInvocationContracts } from "../flag-invocation-contracts.js";
@@ -153,8 +153,8 @@ const PM_COMMAND_FLAG_BUDGET_MAXIMUMS = Object.freeze({
153
153
  docs: 30,
154
154
  deps: 32,
155
155
  plan: 109,
156
- test: 48,
157
- "test-all": 37,
156
+ test: 52,
157
+ "test-all": 40,
158
158
  telemetry: 21,
159
159
  stats: 29,
160
160
  health: 36,
@@ -337,4 +337,4 @@ export function renderPmFlagLexiconMarkdown() {
337
337
  ].join("\n");
338
338
  }
339
339
  //# sourceMappingURL=flag-lexicon-contracts.js.map
340
- //# debugId=6ba3d756-dcd6-59b7-92fe-ec33d294d72b
340
+ //# debugId=8320177c-e95d-5d14-a914-4ac37230c0b9
@@ -4,7 +4,7 @@
4
4
  * Provides CLI runtime support for Registration Helpers.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8d60b13c-c58a-506f-adc9-2414dd69edef")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="01742f33-d1e8-5684-a585-2add88ddb73c")}catch(e){}}();
8
8
  import { Option } from "commander";
9
9
  import { pathExists, refreshSearchArtifactsForMutation, shouldRunSearchRefreshInForeground, EXIT_CODE, PmCliError, printError, printResult, writeStdout, getSettingsPath, resolvePmRoot, readSettings, runActiveServiceOverride, setActiveCommandResult, } from "../runtime-primitives.js";
10
10
  import { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, NEXT_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, readFirstValueFromCommanderOptions, readFirstStringFromCommanderOptions, readStringArrayFromCommanderOptions, } from "../cli-contracts.js";
@@ -259,6 +259,9 @@ function pushSharedBackgroundTestCommandArgs(args, options) {
259
259
  pushOptionalBooleanFlag(args, "--shared-host-safe", options.sharedHostSafe);
260
260
  pushOptionalValueFlag(args, "--pm-context", options.pmContext);
261
261
  pushOptionalBooleanFlag(args, "--override-linked-pm-context", options.overrideLinkedPmContext);
262
+ pushOptionalValueFlag(args, "--workspace-context", options.workspaceContext);
263
+ pushOptionalBooleanFlag(args, "--override-linked-workspace-context", options.overrideLinkedWorkspaceContext);
264
+ pushOptionalBooleanFlag(args, "--allow-untrusted-linked-tests", options.allowUntrustedLinkedTests);
262
265
  pushOptionalBooleanFlag(args, "--fail-on-context-mismatch", options.failOnContextMismatch);
263
266
  pushOptionalBooleanFlag(args, "--fail-on-skipped", options.failOnSkipped);
264
267
  pushOptionalBooleanFlag(args, "--fail-on-empty-test-run", options.failOnEmptyTestRun);
@@ -985,4 +988,4 @@ export const _testOnly = {
985
988
  collectMutationItemIds,
986
989
  };
987
990
  //# sourceMappingURL=registration-helpers.js.map
988
- //# debugId=8d60b13c-c58a-506f-adc9-2414dd69edef
991
+ //# debugId=01742f33-d1e8-5684-a585-2add88ddb73c
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { type GlobalOptions, type ExtensionRegistrationRegistry, type RegisteredExtensionCommandDefinition, type RegisteredExtensionFlagDefinitions, type RuntimeFieldRegistry, readSettings } from "../runtime-primitives.js";
7
7
  import { type McpToolContract } from "../../mcp/tool-definitions.js";
8
- import { PM_TOOL_ACTIONS, type CliFlagContract, type CommanderOptionAliasContract, type PmCommandOutputBudgetContract, type PmCommandAliasContract } from "../cli-contracts.js";
8
+ import { PM_TOOL_ACTIONS, type CliFlagContract, type CommanderOptionAliasContract, type PmCommandOutputBudgetContract, type PmDiagnosticOutputBudgetContract, type PmCommandAliasContract } from "../cli-contracts.js";
9
9
  import { type ListCommandName, type ListProjectionMode } from "../query/list.js";
10
10
  import { type PmContextIntentContract } from "../context-intent-contracts.js";
11
11
  import { type PmReadOutputSurfaceContract } from "../read-output-contracts.js";
@@ -187,6 +187,8 @@ export interface ContractsResult {
187
187
  budget: PmCommandOutputBudgetContract;
188
188
  envelope: PmCommandOutputEnvelopeContract;
189
189
  }>;
190
+ /** Binding ceilings and action-preserving degradation for diagnostic families. */
191
+ diagnostic_output_contracts?: readonly PmDiagnosticOutputBudgetContract[];
190
192
  /** Stable outcome vocabulary and exhaustive per-command process exit sets. */
191
193
  command_exit_contracts?: {
192
194
  vocabulary: readonly PmCommandExitOutcomeContract[];