@unbrained/pm-cli 2026.8.22 → 2026.8.24

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 (229) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +42 -1
  3. package/dist/cli/description-stdin.js +5 -4
  4. package/dist/cli/error-guidance.d.ts +13 -0
  5. package/dist/cli/error-guidance.js +62 -6
  6. package/dist/cli/extension-command-help.d.ts +5 -0
  7. package/dist/cli/extension-command-help.js +6 -2
  8. package/dist/cli/help-content.d.ts +5 -0
  9. package/dist/cli/help-content.js +56 -3
  10. package/dist/cli/help-json-payload.d.ts +5 -2
  11. package/dist/cli/help-json-payload.js +57 -17
  12. package/dist/cli/main.d.ts +3 -0
  13. package/dist/cli/main.js +39 -5
  14. package/dist/cli/register-annotations.js +5 -5
  15. package/dist/cli/register-mutation.js +77 -31
  16. package/dist/cli/register-operations.d.ts +73 -0
  17. package/dist/cli/register-operations.js +39 -14
  18. package/dist/cli/register-setup.js +3 -3
  19. package/dist/cli/schema-registration-helpers.d.ts +8 -1
  20. package/dist/cli/schema-registration-helpers.js +14 -5
  21. package/dist/cli-bundle/bundle-manifest.json +155 -155
  22. package/dist/cli-bundle/chunks/chunk-AGUL3HUT.js +3 -0
  23. package/dist/cli-bundle/chunks/{chunk-WG4STC36.js → chunk-DJNJBWAQ.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-MYYI3ZOA.js → chunk-I5Q7QSZX.js} +2 -2
  25. package/dist/cli-bundle/chunks/chunk-IW72J5FW.js +2 -0
  26. package/dist/cli-bundle/chunks/{chunk-BWX4SK46.js → chunk-L22NP5MA.js} +66 -66
  27. package/dist/cli-bundle/chunks/chunk-MKE6MD2K.js +36 -0
  28. package/dist/cli-bundle/chunks/{chunk-MZTZQTMS.js → chunk-NXBFO63A.js} +2 -2
  29. package/dist/cli-bundle/chunks/chunk-TEQDR5KI.js +202 -0
  30. package/dist/cli-bundle/chunks/chunk-X7WWQDYQ.js +2 -0
  31. package/dist/cli-bundle/chunks/chunk-YOLLRCLY.js +13 -0
  32. package/dist/cli-bundle/chunks/{chunk-U6GQ4VMV.js → chunk-ZAVCS2GH.js} +4 -4
  33. package/dist/cli-bundle/chunks/{register-list-query-HZKBQNWW.js → register-list-query-37A4P6O4.js} +2 -2
  34. package/dist/cli-bundle/chunks/register-mutation-TBJDHYIT.js +20 -0
  35. package/dist/cli-bundle/chunks/register-operations-WRZNEBUM.js +2 -0
  36. package/dist/cli-bundle/chunks/{register-setup-QK4OTOXN.js → register-setup-H4PDLACD.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-GMYPD4FX.js → chunk-4WP7LNE3.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/chunk-6MUTDXMP.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/chunk-6Z24ZMU3.js +2 -0
  40. package/dist/cli-bundle/focused-chunks/{chunk-2ARQGDDW.js → chunk-BFA6KKCI.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/chunk-CWCN5RLO.js +26 -0
  42. package/dist/cli-bundle/focused-chunks/chunk-FCTT4CZU.js +5 -0
  43. package/dist/cli-bundle/focused-chunks/chunk-GJR6YEMR.js +156 -0
  44. package/dist/cli-bundle/focused-chunks/{chunk-2POVTNLY.js → chunk-IMWTYKII.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/{chunk-D6RBZEJJ.js → chunk-IZNRRCU3.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/{chunk-PMGJUFNQ.js → chunk-MNPECIRL.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/{chunk-A2BC5PQL.js → chunk-O4ZXNJMT.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/chunk-Q63PSLO4.js +2 -0
  49. package/dist/cli-bundle/focused-chunks/chunk-QBP5FSBX.js +4 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-R6SR45XU.js → chunk-QV5UP27O.js} +48 -47
  51. package/dist/cli-bundle/focused-chunks/chunk-RASVBJX5.js +8 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-E2EWYPY6.js → chunk-RPRLENVA.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/chunk-TOFVXBWA.js +19 -0
  54. package/dist/cli-bundle/focused-chunks/{chunk-6S2MO3Q3.js → chunk-WZLSSGEU.js} +2 -2
  55. package/dist/cli-bundle/main.js +18 -17
  56. package/dist/cli-bundle/sdk-authoring.js +1 -1
  57. package/dist/cli-bundle/sdk-contracts.js +2 -2
  58. package/dist/cli-bundle/sdk-core.js +41 -41
  59. package/dist/cli-bundle/sdk-governance.js +1 -1
  60. package/dist/cli-bundle/sdk-graph.js +1 -1
  61. package/dist/cli-bundle/sdk-merge.js +33 -32
  62. package/dist/cli-bundle/sdk-query.js +1 -1
  63. package/dist/cli-bundle/sdk-runtime.js +1 -1
  64. package/dist/cli-bundle/sdk-testing.js +1 -1
  65. package/dist/cli-bundle/sdk.js +6 -5
  66. package/dist/core/config/nested-settings.js +8 -2
  67. package/dist/core/config/positional-value.d.ts +1 -1
  68. package/dist/core/config/positional-value.js +5 -2
  69. package/dist/core/extensions/command-metadata-contract.d.ts +10 -0
  70. package/dist/core/extensions/command-metadata-contract.js +23 -0
  71. package/dist/core/extensions/command-visibility-tier.js +12 -2
  72. package/dist/core/extensions/extension-types.d.ts +6 -0
  73. package/dist/core/extensions/extension-types.js +2 -2
  74. package/dist/core/extensions/loader.js +4 -3
  75. package/dist/core/history/history.js +3 -3
  76. package/dist/core/io/body-file.js +7 -2
  77. package/dist/core/io/bulk-ids-input.d.ts +24 -0
  78. package/dist/core/io/bulk-ids-input.js +113 -0
  79. package/dist/core/item/item-format.js +66 -12
  80. package/dist/core/item/parse.d.ts +22 -2
  81. package/dist/core/item/parse.js +97 -4
  82. package/dist/core/reproducibility/context.d.ts +4 -0
  83. package/dist/core/reproducibility/context.js +14 -8
  84. package/dist/core/shared/author.d.ts +55 -1
  85. package/dist/core/shared/author.js +333 -16
  86. package/dist/core/shared/constants.js +3 -2
  87. package/dist/core/store/settings-validator.d.ts +1 -0
  88. package/dist/core/store/settings-validator.js +6 -3
  89. package/dist/core/store/settings.js +5 -2
  90. package/dist/mcp/server.d.ts +4 -3
  91. package/dist/mcp/server.js +44 -16
  92. package/dist/sdk/agent/identity-config.d.ts +63 -0
  93. package/dist/sdk/agent/identity-config.js +107 -0
  94. package/dist/sdk/agent/refusal-closure-census.d.ts +66 -0
  95. package/dist/sdk/agent/refusal-closure-census.js +144 -0
  96. package/dist/sdk/agent/refusal-corpus-contracts.d.ts +76 -0
  97. package/dist/sdk/agent/refusal-corpus-contracts.js +194 -0
  98. package/dist/sdk/agent-capability-contracts.d.ts +34 -1
  99. package/dist/sdk/agent-capability-contracts.js +104 -6
  100. package/dist/sdk/annotations.d.ts +2 -0
  101. package/dist/sdk/annotations.js +25 -7
  102. package/dist/sdk/cli-contracts/agent-output-contracts.js +6 -4
  103. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -0
  104. package/dist/sdk/cli-contracts/enum-contracts.js +9 -2
  105. package/dist/sdk/cli-contracts/flag-contracts.js +9 -2
  106. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +4 -4
  107. package/dist/sdk/cli-contracts/registration-helpers.js +5 -2
  108. package/dist/sdk/cli-contracts/tool-parameter-tables.js +58 -2
  109. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  110. package/dist/sdk/cli-contracts/tool-schema.js +14 -3
  111. package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +4 -1
  112. package/dist/sdk/cli-contracts/typed-action-inputs.js +2 -2
  113. package/dist/sdk/cli-contracts.d.ts +3 -3
  114. package/dist/sdk/cli-contracts.js +4 -4
  115. package/dist/sdk/comments.js +15 -7
  116. package/dist/sdk/config.d.ts +6 -1
  117. package/dist/sdk/config.js +119 -14
  118. package/dist/sdk/context-intent-contracts.js +4 -2
  119. package/dist/sdk/core-governance.d.ts +1 -1
  120. package/dist/sdk/core-governance.js +3 -3
  121. package/dist/sdk/extension/scaffold.js +11 -5
  122. package/dist/sdk/flag-invocation-contracts.d.ts +2 -0
  123. package/dist/sdk/flag-invocation-contracts.js +30 -3
  124. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +83 -2
  125. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +87 -2
  126. package/dist/sdk/governance/assurance-action.js +30 -10
  127. package/dist/sdk/governance/validate.d.ts +2 -2
  128. package/dist/sdk/governance/validate.js +39 -14
  129. package/dist/sdk/guide-topics.d.ts +0 -5
  130. package/dist/sdk/guide-topics.js +28 -2
  131. package/dist/sdk/history-compact.d.ts +2 -1
  132. package/dist/sdk/history-compact.js +24 -5
  133. package/dist/sdk/history-mcp.js +11 -10
  134. package/dist/sdk/index.d.ts +8 -2
  135. package/dist/sdk/index.js +9 -3
  136. package/dist/sdk/item-transaction.js +19 -12
  137. package/dist/sdk/lifecycle/append.js +4 -4
  138. package/dist/sdk/lifecycle/close-many.js +16 -7
  139. package/dist/sdk/lifecycle/create.js +33 -22
  140. package/dist/sdk/lifecycle/plan.js +24 -6
  141. package/dist/sdk/lifecycle/update-many.js +15 -8
  142. package/dist/sdk/lifecycle/update.d.ts +2 -0
  143. package/dist/sdk/lifecycle/update.js +37 -25
  144. package/dist/sdk/merge/three-way.js +105 -26
  145. package/dist/sdk/read-output-budget.d.ts +21 -0
  146. package/dist/sdk/read-output-budget.js +39 -2
  147. package/dist/sdk/read-output-contracts.d.ts +5 -3
  148. package/dist/sdk/read-output-contracts.js +20 -12
  149. package/dist/sdk/reproducibility/process.d.ts +19 -0
  150. package/dist/sdk/reproducibility/process.js +88 -0
  151. package/dist/sdk/runtime-extended-actions.js +5 -3
  152. package/dist/sdk/runtime-input.d.ts +4 -0
  153. package/dist/sdk/runtime-input.js +98 -23
  154. package/dist/sdk/runtime-primitives.d.ts +3 -2
  155. package/dist/sdk/runtime-primitives.js +5 -4
  156. package/dist/sdk/runtime.js +11 -23
  157. package/dist/sdk/scheduling-shortcuts.js +5 -3
  158. package/dist/sdk/structured-mutations.js +10 -3
  159. package/dist/sdk/test/batch.d.ts +6 -0
  160. package/dist/sdk/test/batch.js +15 -3
  161. package/dist/sdk/test/entry.d.ts +1 -1
  162. package/dist/sdk/test/entry.js +3 -2
  163. package/dist/sdk/test/execution.d.ts +28 -3
  164. package/dist/sdk/test/execution.js +193 -34
  165. package/dist/sdk/test/parsers.d.ts +6 -0
  166. package/dist/sdk/test/parsers.js +21 -2
  167. package/dist/sdk/test/trust.d.ts +33 -0
  168. package/dist/sdk/test/trust.js +207 -0
  169. package/dist/sdk/workspace-contracts.d.ts +3 -0
  170. package/dist/sdk/workspace-contracts.js +3 -2
  171. package/dist/types.d.ts +23 -0
  172. package/dist/types.js +2 -2
  173. package/docs/AGENT_PROVENANCE_ADR.md +41 -5
  174. package/docs/CONFIGURATION.md +4 -0
  175. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +19 -2
  176. package/docs/MERGE_SAFETY.md +15 -1
  177. package/docs/README.md +2 -0
  178. package/docs/READ_OUTPUT_CONTRACTS.md +11 -1
  179. package/docs/RELEASING.md +40 -21
  180. package/docs/REPRODUCIBLE_WORKSPACES.md +42 -8
  181. package/docs/SCRIPTING.md +62 -3
  182. package/docs/SDK.md +17 -0
  183. package/docs/SDK_AGENT_SESSION_CONTEXT.md +6 -4
  184. package/docs/SDK_EVIDENCE_TRACEABILITY.md +1 -1
  185. package/docs/TESTING.md +75 -8
  186. package/docs/agent-task-token-baseline.json +2 -2
  187. package/docs/generated/AGENT_CAPABILITY_ROUTING.md +17 -0
  188. package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -1
  189. package/docs/generated/FLAG_LEXICON_BUDGETS.md +2 -2
  190. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +355 -0
  191. package/marketplace.json +2 -2
  192. package/package.json +2 -2
  193. package/packages/pm-beads/package.json +1 -1
  194. package/packages/pm-calendar/package.json +1 -1
  195. package/packages/pm-command-kit/README.md +9 -11
  196. package/packages/pm-command-kit/extensions/command-kit/index.ts +3 -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/extensions/guide-shell/index.ts +10 -0
  201. package/packages/pm-guide-shell/package.json +1 -1
  202. package/packages/pm-kanban/package.json +1 -1
  203. package/packages/pm-lifecycle-hooks/package.json +1 -1
  204. package/packages/pm-linked-test-adapters/package.json +1 -1
  205. package/packages/pm-search-advanced/package.json +1 -1
  206. package/packages/pm-templates/package.json +1 -1
  207. package/packages/pm-todos/package.json +1 -1
  208. package/packages/pm-vcs/package.json +1 -1
  209. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  210. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  211. package/scripts/generate-agent-capability-surfaces.mjs +27 -1
  212. package/sdk/public-surface.json +642 -28
  213. package/dist/cli-bundle/chunks/chunk-EMWDM5FI.js +0 -13
  214. package/dist/cli-bundle/chunks/chunk-HYG6LRL4.js +0 -200
  215. package/dist/cli-bundle/chunks/chunk-QI2CT3IX.js +0 -2
  216. package/dist/cli-bundle/chunks/chunk-SMWXHMVB.js +0 -35
  217. package/dist/cli-bundle/chunks/chunk-VMMIL3SI.js +0 -2
  218. package/dist/cli-bundle/chunks/chunk-YBPJAOQQ.js +0 -3
  219. package/dist/cli-bundle/chunks/register-mutation-HTKEEGRD.js +0 -20
  220. package/dist/cli-bundle/chunks/register-operations-6EMRWJJY.js +0 -2
  221. package/dist/cli-bundle/focused-chunks/chunk-2AZT5WXZ.js +0 -2
  222. package/dist/cli-bundle/focused-chunks/chunk-3LKU6PTJ.js +0 -4
  223. package/dist/cli-bundle/focused-chunks/chunk-5SHSBMX2.js +0 -2
  224. package/dist/cli-bundle/focused-chunks/chunk-C4S4A4JJ.js +0 -5
  225. package/dist/cli-bundle/focused-chunks/chunk-L5LDSRO2.js +0 -155
  226. package/dist/cli-bundle/focused-chunks/chunk-MB37AYN6.js +0 -26
  227. package/dist/cli-bundle/focused-chunks/chunk-MCOR37QK.js +0 -2
  228. package/dist/cli-bundle/focused-chunks/chunk-PH2OXXVZ.js +0 -18
  229. package/dist/cli-bundle/focused-chunks/chunk-WZE4LIPW.js +0 -8
@@ -24,7 +24,7 @@
24
24
  */
25
25
  /** Search/provider/vector-store leaves. Order is the display order in `pm config list` and in error hints. */
26
26
 
27
- !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]="be95f220-5f66-5e8c-8447-996696d02e43")}catch(e){}}();
27
+ !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]="4e50d57b-4502-5ce5-a6dd-0bdc8eba5af4")}catch(e){}}();
28
28
  export const NESTED_SETTING_DESCRIPTORS = [
29
29
  {
30
30
  key: "search_provider",
@@ -207,6 +207,12 @@ export const NESTED_SETTING_DESCRIPTORS = [
207
207
  non_empty: true,
208
208
  summary: "Default author recorded on mutations when --author is not supplied.",
209
209
  },
210
+ {
211
+ key: "agent_identity_probes_enabled",
212
+ path: "agent_identity.probes_enabled",
213
+ kind: "boolean",
214
+ summary: "Allow privacy-bounded local harness provenance probes; no network or subprocess access is permitted.",
215
+ },
210
216
  {
211
217
  key: "mutation_guard_require_attributed_author",
212
218
  path: "mutation_guard.require_attributed_author",
@@ -526,4 +532,4 @@ export function writeNestedSettingValue(settings, descriptor, value) {
526
532
  return true;
527
533
  }
528
534
  //# sourceMappingURL=nested-settings.js.map
529
- //# debugId=be95f220-5f66-5e8c-8447-996696d02e43
535
+ //# debugId=4e50d57b-4502-5ce5-a6dd-0bdc8eba5af4
@@ -41,7 +41,7 @@ export interface ConfigPositionalNotRoutable {
41
41
  /** Restricts config positional result values accepted by command, SDK, and storage contracts. */
42
42
  export type ConfigPositionalResult = ConfigPositionalRouted | ConfigPositionalNotRoutable;
43
43
  /** Canonical snake-case config keys accepted by the config command and positional router. */
44
- export type ConfigKey = "definition_of_done" | "item_format" | "history_missing_stream_policy" | "sprint_release_format_policy" | "parent_reference_policy" | "metadata_validation_profile" | "metadata_required_fields" | "lifecycle_stale_blocker_reason_patterns" | "lifecycle_closure_like_blocked_reason_patterns" | "lifecycle_closure_like_resolution_patterns" | "lifecycle_closure_like_actual_result_patterns" | "governance_preset" | "governance_ownership_enforcement" | "governance_create_mode_default" | "governance_close_validation_default" | "governance_require_close_reason" | "governance_create_default_type" | "governance_workflow_enforcement" | "governance_parent_reference_policy" | "governance_metadata_validation_profile" | "governance_force_required_for_stale_lock" | "test_result_tracking" | "telemetry_tracking" | "context";
44
+ export type ConfigKey = "definition_of_done" | "item_format" | "history_missing_stream_policy" | "sprint_release_format_policy" | "parent_reference_policy" | "metadata_validation_profile" | "metadata_required_fields" | "lifecycle_stale_blocker_reason_patterns" | "lifecycle_closure_like_blocked_reason_patterns" | "lifecycle_closure_like_resolution_patterns" | "lifecycle_closure_like_actual_result_patterns" | "governance_preset" | "governance_ownership_enforcement" | "governance_create_mode_default" | "governance_close_validation_default" | "governance_require_close_reason" | "governance_create_default_type" | "governance_workflow_enforcement" | "governance_parent_reference_policy" | "governance_metadata_validation_profile" | "governance_force_required_for_stale_lock" | "test_result_tracking" | "untrusted_linked_test_execution" | "telemetry_tracking" | "agent_identity_vocabulary" | "context";
45
45
  /**
46
46
  * Resolve which typed flag a positional `pm config set <key> <value>` value should
47
47
  * populate, plus the normalized value.
@@ -10,7 +10,7 @@
10
10
  * good error messages.
11
11
  */
12
12
 
13
- !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]="4f4f5f10-793d-5baa-8985-c0ec855b16c4")}catch(e){}}();
13
+ !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]="77fa2822-1681-59d5-8388-037cf13c45dd")}catch(e){}}();
14
14
  const FORMAT_KEYS = new Set(["item_format"]);
15
15
  const CRITERIA_KEYS = new Set([
16
16
  "definition_of_done",
@@ -36,13 +36,16 @@ const POLICY_KEYS = new Set([
36
36
  "governance_metadata_validation_profile",
37
37
  "governance_force_required_for_stale_lock",
38
38
  "test_result_tracking",
39
+ "untrusted_linked_test_execution",
39
40
  "telemetry_tracking",
41
+ "agent_identity_vocabulary",
40
42
  ]);
41
43
  /** Policy keys whose only valid values are enabled/disabled. For these we accept the intuitive synonyms off/on/true/false. Other policy keys pass through unchanged so their own validators report the precise allowed set. */
42
44
  const ENABLED_DISABLED_POLICY_KEYS = new Set([
43
45
  "governance_require_close_reason",
44
46
  "governance_force_required_for_stale_lock",
45
47
  "test_result_tracking",
48
+ "untrusted_linked_test_execution",
46
49
  "telemetry_tracking",
47
50
  ]);
48
51
  const ENABLED_DISABLED_SYNONYMS = {
@@ -104,4 +107,4 @@ export function resolveConfigPositionalValue(canonicalKeyOrAlias, value) {
104
107
  return { routable: true, flag: "policy", value: policyValue };
105
108
  }
106
109
  //# sourceMappingURL=positional-value.js.map
107
- //# debugId=4f4f5f10-793d-5baa-8985-c0ec855b16c4
110
+ //# debugId=77fa2822-1681-59d5-8388-037cf13c45dd
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @module core/extensions/command-metadata-contract
3
+ *
4
+ * Owns the closed metadata domains shared by extension registration, runtime
5
+ * validation, SDK contracts, and workspace projections.
6
+ */
7
+ /** Canonical capability-family values accepted for every command surface. */
8
+ export declare const EXTENSION_COMMAND_CAPABILITY_FAMILIES: readonly ["workspace", "intake", "context", "lifecycle", "evidence", "graph", "quality", "automation", "extensions", "internal"];
9
+ /** Capability family an extension command contributes to agent routing. */
10
+ export type ExtensionCommandCapabilityFamily = (typeof EXTENSION_COMMAND_CAPABILITY_FAMILIES)[number];
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @module core/extensions/command-metadata-contract
3
+ *
4
+ * Owns the closed metadata domains shared by extension registration, runtime
5
+ * validation, SDK contracts, and workspace projections.
6
+ */
7
+ /** Canonical capability-family values accepted for every command surface. */
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]="b799a368-2a8a-5031-8d14-f6b9dc4a3978")}catch(e){}}();
10
+ export const EXTENSION_COMMAND_CAPABILITY_FAMILIES = Object.freeze([
11
+ "workspace",
12
+ "intake",
13
+ "context",
14
+ "lifecycle",
15
+ "evidence",
16
+ "graph",
17
+ "quality",
18
+ "automation",
19
+ "extensions",
20
+ "internal",
21
+ ]);
22
+ //# sourceMappingURL=command-metadata-contract.js.map
23
+ //# debugId=b799a368-2a8a-5031-8d14-f6b9dc4a3978
@@ -1,9 +1,18 @@
1
1
 
2
- !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]="45d00ef3-870c-5f3f-89c1-6abd54c518fe")}catch(e){}}();
2
+ !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]="764d9a7d-90a2-578f-ab5d-bd0c039596df")}catch(e){}}();
3
3
  import { assertOptionalStringField } from "./registration-validation.js";
4
+ import { EXTENSION_COMMAND_CAPABILITY_FAMILIES } from "./command-metadata-contract.js";
5
+ const COMMAND_CAPABILITY_FAMILIES = new Set(EXTENSION_COMMAND_CAPABILITY_FAMILIES);
6
+ function assertCommandCapabilityFamily(family) {
7
+ if (family !== undefined &&
8
+ !COMMAND_CAPABILITY_FAMILIES.has(String(family))) {
9
+ throw new Error(`registerCommand definition.family must be one of: ${EXTENSION_COMMAND_CAPABILITY_FAMILIES.join(", ")}`);
10
+ }
11
+ }
4
12
  /** Validate optional command metadata strings and the closed visibility tier. */
5
13
  export function assertCommandDefinitionMetadataStrings(definition) {
6
14
  assertOptionalStringField("registerCommand definition.action", definition.action);
15
+ assertOptionalStringField("registerCommand definition.family", definition.family);
7
16
  assertOptionalStringField("registerCommand definition.description", definition.description);
8
17
  assertOptionalStringField("registerCommand definition.intent", definition.intent);
9
18
  assertOptionalStringField("registerCommand definition.tier", definition.tier);
@@ -15,6 +24,7 @@ export function assertCommandDefinitionMetadataStrings(definition) {
15
24
  tier !== "internal") {
16
25
  throw new Error("registerCommand definition.tier must be core, standard, full, or internal");
17
26
  }
27
+ assertCommandCapabilityFamily(definition.family);
18
28
  }
19
29
  //# sourceMappingURL=command-visibility-tier.js.map
20
- //# debugId=45d00ef3-870c-5f3f-89c1-6abd54c518fe
30
+ //# debugId=764d9a7d-90a2-578f-ab5d-bd0c039596df
@@ -13,6 +13,8 @@ import type { GetItemAtResult } from "../../sdk/history-read.js";
13
13
  import type { RelationshipEvent, RelationshipEventInput, RelationshipEventStore } from "../../sdk/relationship-history.js";
14
14
  import type { CommitWorkspaceTransactionOptions, WorkspaceTransactionCommitResult } from "../../sdk/workspace-transaction.js";
15
15
  import type { KnownItemFieldType } from "./item-field-types.js";
16
+ import type { ExtensionCommandCapabilityFamily } from "./command-metadata-contract.js";
17
+ export type { ExtensionCommandCapabilityFamily } from "./command-metadata-contract.js";
16
18
  /** Public contract for known extension capabilities, shared by SDK and presentation-layer consumers. */
17
19
  export declare const KNOWN_EXTENSION_CAPABILITIES: readonly ["commands", "renderers", "hooks", "schema", "importers", "search", "parser", "preflight", "services"];
18
20
  /** Restricts extension capability values accepted by command, SDK, and storage contracts. */
@@ -691,6 +693,8 @@ export interface CommandDefinition {
691
693
  flags?: FlagDefinition[];
692
694
  /** Minimum agent surface tier that should advertise this command. */
693
695
  tier?: "core" | "standard" | "full" | "internal";
696
+ /** Capability family used by generated agent routing surfaces. */
697
+ family?: ExtensionCommandCapabilityFamily;
694
698
  }
695
699
  /**
696
700
  * Optional command-definition metadata for first-class importer/exporter
@@ -1272,6 +1276,8 @@ export interface RegisteredExtensionCommandDefinition {
1272
1276
  arguments: ExtensionCommandArgumentDefinition[];
1273
1277
  /** Minimum agent surface tier that should advertise this command. */
1274
1278
  tier?: "core" | "standard" | "full" | "internal";
1279
+ /** Capability family used by generated agent routing surfaces. */
1280
+ family?: ExtensionCommandCapabilityFamily;
1275
1281
  }
1276
1282
  /** Documents the registered extension schema field definitions payload exchanged by command, SDK, and package integrations. */
1277
1283
  export interface RegisteredExtensionSchemaFieldDefinitions {
@@ -1,6 +1,6 @@
1
1
  /** Public contract for known extension capabilities, shared by SDK and presentation-layer consumers. */
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]="87454a57-b62e-560a-b66f-3c15d4a95cc2")}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]="ef5c8553-c206-5bb5-913a-85afb936f6d7")}catch(e){}}();
4
4
  export const KNOWN_EXTENSION_CAPABILITIES = [
5
5
  "commands",
6
6
  "renderers",
@@ -100,4 +100,4 @@ export function createDefaultExtensionGovernancePolicy() {
100
100
  };
101
101
  }
102
102
  //# sourceMappingURL=extension-types.js.map
103
- //# debugId=87454a57-b62e-560a-b66f-3c15d4a95cc2
103
+ //# debugId=ef5c8553-c206-5bb5-913a-85afb936f6d7
@@ -4,7 +4,7 @@
4
4
  * Implements extension runtime contracts and governance for Loader.
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]="10311c96-5cba-5021-a8c5-82abd6eeb6f5")}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]="e4e1b7c2-6551-5e56-b26a-30062aed5b97")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { pathToFileURL } from "node:url";
@@ -1505,7 +1505,8 @@ class ExtensionApiRegistrar {
1505
1505
  examples,
1506
1506
  failure_hints: failureHints,
1507
1507
  arguments: argumentsDefinition,
1508
- tier: definition.tier,
1508
+ tier: definition.tier ?? "standard",
1509
+ family: definition.family ?? "extensions",
1509
1510
  };
1510
1511
  if (description) {
1511
1512
  registration.description = description;
@@ -2220,4 +2221,4 @@ export const _testOnlyLoader = {
2220
2221
  },
2221
2222
  };
2222
2223
  //# sourceMappingURL=loader.js.map
2223
- //# debugId=10311c96-5cba-5021-a8c5-82abd6eeb6f5
2224
+ //# debugId=e4e1b7c2-6551-5e56-b26a-30062aed5b97
@@ -4,7 +4,7 @@
4
4
  * Implements append-only history and replay behavior for History.
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]="2fc7f675-3500-5abb-8d5c-9ca9caa803b6")}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]="f7cf18cb-0068-58ad-bd7f-759a5d91eb9f")}catch(e){}}();
8
8
  import jsonPatch from "fast-json-patch";
9
9
  import { ITEM_METADATA_KEY_ORDER } from "../shared/constants.js";
10
10
  import { runActiveServiceOverride } from "../extensions/index.js";
@@ -178,7 +178,7 @@ export function createHistoryEntry(params) {
178
178
  const patch = normalizeHistoryPatchOps(beforePatchCanonical, rawPatch);
179
179
  const agentIdentity = resolveHistoryAgentIdentity(params.author);
180
180
  const provenanceOutcomes = agentIdentity.harness
181
- ? Object.fromEntries(Object.entries(diagnoseAgentIdentity().provenance_outcomes).filter(([, outcome]) => outcome.status === "failed"))
181
+ ? Object.fromEntries(Object.entries(diagnoseAgentIdentity().provenance_outcomes).filter(([, outcome]) => outcome.resolver !== undefined && outcome.status !== "resolved"))
182
182
  : undefined;
183
183
  const context = provenanceOutcomes === undefined || Object.keys(provenanceOutcomes).length === 0
184
184
  ? params.context
@@ -292,4 +292,4 @@ export const _testOnly = {
292
292
  isDefinedPointerPath,
293
293
  };
294
294
  //# sourceMappingURL=history.js.map
295
- //# debugId=2fc7f675-3500-5abb-8d5c-9ca9caa803b6
295
+ //# debugId=f7cf18cb-0068-58ad-bd7f-759a5d91eb9f
@@ -4,10 +4,11 @@
4
4
  * Reads command body content from files, stdin, and inline arguments.
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]="7426082f-94a6-5b4e-9748-d3faab2fe1d4")}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]="a97ee152-4d20-54f1-add9-fdb991ab6b33")}catch(e){}}();
8
8
  import { readFile } from "node:fs/promises";
9
9
  import { EXIT_CODE } from "../shared/constants.js";
10
10
  import { PmCliError } from "../shared/errors.js";
11
+ import { createStdinTokenResolver } from "../item/parse.js";
11
12
  const defaultBodyFileReader = (path) => readFile(path, "utf8");
12
13
  /** Implements resolve body file content for the public runtime surface of this module. */
13
14
  export async function resolveBodyFileContent(bodyFile, inlineBody, readFileImpl = defaultBodyFileReader) {
@@ -31,6 +32,9 @@ export async function resolveBodyFileContent(bodyFile, inlineBody, readFileImpl
31
32
  why: "An empty --body-file value has no file to read the body from.",
32
33
  });
33
34
  }
35
+ if (path === "-") {
36
+ return (await createStdinTokenResolver().resolveValue("-", "--body-file"));
37
+ }
34
38
  try {
35
39
  return await readFileImpl(path);
36
40
  }
@@ -49,10 +53,11 @@ export async function resolveBodyFileContent(bodyFile, inlineBody, readFileImpl
49
53
  why: `The body content is loaded from the file at the supplied path, so an unreadable path cannot produce a body${errno ? ` (underlying error: ${errno})` : ""}.`,
50
54
  nextSteps: [
51
55
  `Verify the path: ls -l "${path}"`,
56
+ "Or pipe the body with --body-file -.",
52
57
  "Or pass the body inline with --body <text>.",
53
58
  ],
54
59
  });
55
60
  }
56
61
  }
57
62
  //# sourceMappingURL=body-file.js.map
58
- //# debugId=7426082f-94a6-5b4e-9748-d3faab2fe1d4
63
+ //# debugId=a97ee152-4d20-54f1-add9-fdb991ab6b33
@@ -0,0 +1,24 @@
1
+ /** File reader injected by tests or host runtimes that virtualize argv files. */
2
+ export type BulkIdsFileReader = (path: string) => Promise<string>;
3
+ /** Stdin reader injected by tests or hosts that do not use process stdin. */
4
+ export type BulkIdsStdinReader = (optionName: string) => Promise<string>;
5
+ /** Dependencies used to resolve CLI-only external ID sources. */
6
+ export interface BulkIdsInputReaders {
7
+ /** Read a UTF-8 `@path` payload. */
8
+ readFile?: BulkIdsFileReader;
9
+ /** Read the complete stdin payload for `-`. */
10
+ readStdin?: BulkIdsStdinReader;
11
+ }
12
+ /** Transport-native bulk ID shapes accepted by SDK and MCP adapters. */
13
+ export type BulkIdsValue = string | number | readonly (string | number)[] | undefined;
14
+ /** Parse comma- or line-delimited item IDs with stable first-seen deduplication. */
15
+ export declare function parseBulkIdsText(raw: string): string[];
16
+ /** Normalize SDK/MCP scalar-or-array ID input into the list query's CSV form. */
17
+ export declare function normalizeBulkIdsValue(value: BulkIdsValue): string | undefined;
18
+ /**
19
+ * Resolve one CLI `--ids` value. `-` reads newline/comma-delimited stdin and
20
+ * `@path` reads the same grammar from a UTF-8 file; ordinary argv text accepts
21
+ * the grammar inline. The return value is canonical CSV for existing list
22
+ * filtering and unmatched-id accounting.
23
+ */
24
+ export declare function resolveCliBulkIdsInput(value: string | undefined, optionName?: string, readers?: BulkIdsInputReaders): Promise<string | undefined>;
@@ -0,0 +1,113 @@
1
+ /**
2
+ * @module core/io/bulk-ids-input
3
+ *
4
+ * Normalizes bulk item-id selectors supplied inline, through stdin, or from an
5
+ * argv-referenced file. Presentation layers can share the parser while MCP and
6
+ * embedded SDK callers keep passing transport-native arrays.
7
+ */
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]="411f4336-eb02-5167-9dce-ea99822a8a14")}catch(e){}}();
10
+ import { readFile } from "node:fs/promises";
11
+ import { createStdinTokenResolver } from "../item/parse.js";
12
+ import { EXIT_CODE } from "../shared/constants.js";
13
+ import { PmCliError } from "../shared/errors.js";
14
+ const defaultFileReader = (path) => readFile(path, "utf8");
15
+ const defaultStdinReader = async (optionName) => (await createStdinTokenResolver().resolveValue("-", optionName));
16
+ /** Parse comma- or line-delimited item IDs with stable first-seen deduplication. */
17
+ export function parseBulkIdsText(raw) {
18
+ return [
19
+ ...new Set(raw
20
+ .split(/[,\r\n]+/)
21
+ .map((entry) => entry.trim())
22
+ .filter((entry) => entry.length > 0)),
23
+ ];
24
+ }
25
+ function normalizeBulkIdsArray(value) {
26
+ const entries = [];
27
+ for (const entry of value) {
28
+ if (typeof entry === "string") {
29
+ entries.push(entry);
30
+ }
31
+ else if (typeof entry === "number" && Number.isFinite(entry)) {
32
+ entries.push(String(entry));
33
+ }
34
+ else {
35
+ return "";
36
+ }
37
+ }
38
+ const ids = parseBulkIdsText(entries.join("\n"));
39
+ return ids.length > 0 ? ids.join(",") : "";
40
+ }
41
+ /** Normalize SDK/MCP scalar-or-array ID input into the list query's CSV form. */
42
+ export function normalizeBulkIdsValue(value) {
43
+ if (value === undefined) {
44
+ return undefined;
45
+ }
46
+ if (typeof value === "number") {
47
+ // Preserve an explicitly supplied but invalid numeric selector as blank so
48
+ // the bulk lifecycle's fail-closed empty-ID guard rejects it. Returning
49
+ // undefined here would erase the allowlist and could broaden a mutation to
50
+ // every item matched by the remaining filters.
51
+ return Number.isFinite(value) ? String(value) : "";
52
+ }
53
+ if (Array.isArray(value)) {
54
+ return normalizeBulkIdsArray(value);
55
+ }
56
+ if (typeof value !== "string") {
57
+ return "";
58
+ }
59
+ const ids = parseBulkIdsText(value);
60
+ return ids.length > 0 ? ids.join(",") : "";
61
+ }
62
+ /**
63
+ * Resolve one CLI `--ids` value. `-` reads newline/comma-delimited stdin and
64
+ * `@path` reads the same grammar from a UTF-8 file; ordinary argv text accepts
65
+ * the grammar inline. The return value is canonical CSV for existing list
66
+ * filtering and unmatched-id accounting.
67
+ */
68
+ export async function resolveCliBulkIdsInput(value, optionName = "--ids", readers = {}) {
69
+ if (value === undefined) {
70
+ return undefined;
71
+ }
72
+ const trimmed = value.trim();
73
+ let raw = value;
74
+ try {
75
+ if (trimmed === "-") {
76
+ raw = await (readers.readStdin ?? defaultStdinReader)(optionName);
77
+ }
78
+ else if (trimmed.startsWith("@")) {
79
+ const path = trimmed.slice(1).trim();
80
+ if (path.length === 0) {
81
+ throw new PmCliError(`${optionName} @path requires a non-empty file path.`, EXIT_CODE.USAGE, {
82
+ code: "bulk_ids_input_missing_path",
83
+ required: `Pass ${optionName} @<path>, ${optionName} -, or inline IDs.`,
84
+ });
85
+ }
86
+ raw = await (readers.readFile ?? defaultFileReader)(path);
87
+ }
88
+ }
89
+ catch (error) {
90
+ if (error instanceof PmCliError) {
91
+ throw error;
92
+ }
93
+ const detail = error instanceof Error ? error.message : String(error);
94
+ throw new PmCliError(`${optionName} could not read ${trimmed === "-" ? "stdin" : `"${trimmed.slice(1).trim()}"`}: ${detail}`, EXIT_CODE.NOT_FOUND, {
95
+ code: "bulk_ids_input_unreadable",
96
+ required: `Provide readable newline/comma-delimited IDs via ${optionName} -, ${optionName} @<path>, or inline argv text.`,
97
+ nextSteps: [
98
+ `Retry with inline IDs: ${optionName} pm-a1b2,pm-c3d4`,
99
+ `Or pipe IDs: pm list --id-only | pm update-many ${optionName} - --dry-run`,
100
+ ],
101
+ });
102
+ }
103
+ const normalized = normalizeBulkIdsValue(raw);
104
+ if (normalized !== "") {
105
+ return normalized;
106
+ }
107
+ throw new PmCliError(`${optionName} requires at least one non-empty item ID.`, EXIT_CODE.USAGE, {
108
+ code: "bulk_ids_input_empty",
109
+ required: `Provide one or more comma- or newline-delimited IDs through argv, stdin, or @path.`,
110
+ });
111
+ }
112
+ //# sourceMappingURL=bulk-ids-input.js.map
113
+ //# debugId=411f4336-eb02-5167-9dce-ea99822a8a14
@@ -4,7 +4,7 @@
4
4
  * Defines item parsing, formatting, and lifecycle helpers for Item Format.
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]="5eac19ec-235e-5e6f-8ae7-4725f99c9d7f")}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]="65a90a42-eecb-57d3-9f78-3a5f1bc3abd3")}catch(e){}}();
8
8
  import { encode as encodeToon } from "@toon-format/toon";
9
9
  import { isDeepStrictEqual } from "node:util";
10
10
  import { CONFIDENCE_TEXT_VALUES, ISSUE_SEVERITY_VALUES, PLAN_STEP_STATUS_VALUES, RECURRENCE_FREQUENCY_VALUES, RECURRENCE_WEEKDAY_VALUES, STATUS_VALUES, weekdayOrderIndex, } from "../../types/index.js";
@@ -24,6 +24,19 @@ const LINKED_TEST_PM_CONTEXT_MODE_VALUES = new Set([
24
24
  "tracker",
25
25
  "auto",
26
26
  ]);
27
+ const LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES = new Set([
28
+ "source",
29
+ "isolated",
30
+ "snapshot",
31
+ ]);
32
+ const LINKED_TEST_TRUST_REASON_VALUES = new Set([
33
+ "legacy",
34
+ "local_mutation",
35
+ "local_source_ref",
36
+ "acknowledged",
37
+ "invalid_provenance",
38
+ "foreign_source_ref",
39
+ ]);
27
40
  const ITEM_TEST_RUN_STATUS_VALUES = new Set([
28
41
  "passed",
29
42
  "failed",
@@ -602,6 +615,12 @@ function normalizeTestRunMeasurements(value) {
602
615
  return deduplicated.length > 0 ? deduplicated : undefined;
603
616
  }
604
617
  /** Normalize and bound command/context provenance retained for a test run. */
618
+ function normalizeTestRunEnum(value, allowedValues) {
619
+ return typeof value === "string" && allowedValues.has(value)
620
+ ? value
621
+ : undefined;
622
+ }
623
+ /** Normalize and bound command/context provenance retained for a test run. */
605
624
  function normalizeTestRunExecutions(values) {
606
625
  if (!Array.isArray(values))
607
626
  return undefined;
@@ -612,16 +631,10 @@ function normalizeTestRunExecutions(values) {
612
631
  .slice(0, 32)
613
632
  .map((execution) => ({
614
633
  command: execution.command.trim(),
615
- requested_pm_context_mode: execution.requested_pm_context_mode === "schema" ||
616
- execution.requested_pm_context_mode === "tracker" ||
617
- execution.requested_pm_context_mode === "auto"
618
- ? execution.requested_pm_context_mode
619
- : undefined,
620
- pm_context_mode: execution.pm_context_mode === "schema" ||
621
- execution.pm_context_mode === "tracker" ||
622
- execution.pm_context_mode === "auto"
623
- ? execution.pm_context_mode
624
- : undefined,
634
+ requested_pm_context_mode: normalizeTestRunEnum(execution.requested_pm_context_mode, LINKED_TEST_PM_CONTEXT_MODE_VALUES),
635
+ pm_context_mode: normalizeTestRunEnum(execution.pm_context_mode, LINKED_TEST_PM_CONTEXT_MODE_VALUES),
636
+ workspace_context_mode: normalizeTestRunEnum(execution.workspace_context_mode, LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES),
637
+ trust_reason: normalizeTestRunEnum(execution.trust_reason, LINKED_TEST_TRUST_REASON_VALUES),
625
638
  }));
626
639
  return executions.length > 0 ? executions : undefined;
627
640
  }
@@ -708,6 +721,45 @@ function normalizeLinkedTestContextMode(value) {
708
721
  }
709
722
  return normalized;
710
723
  }
724
+ function normalizeLinkedTestWorkspaceContextMode(value) {
725
+ const normalized = value?.trim().toLowerCase();
726
+ if (!normalized ||
727
+ !LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES.has(normalized)) {
728
+ return undefined;
729
+ }
730
+ return normalized;
731
+ }
732
+ function normalizeLinkedTestProvenance(value, invalid) {
733
+ if (invalid === true) {
734
+ return { provenance_invalid: true };
735
+ }
736
+ if (value === undefined) {
737
+ return {};
738
+ }
739
+ if (!isPlainObjectRecord(value)) {
740
+ return { provenance_invalid: true };
741
+ }
742
+ const author = trimStringOrUndefined(value.author);
743
+ const createdAt = trimStringOrUndefined(value.created_at);
744
+ const sourceKind = value.source_kind;
745
+ if (!author ||
746
+ !createdAt ||
747
+ !isTimestampLiteral(createdAt) ||
748
+ (sourceKind !== "local_mutation" && sourceKind !== "merge_union")) {
749
+ // Preserve malformed provenance as an explicit runtime sentinel. Dropping
750
+ // it would make a tampered entry indistinguishable from a trusted legacy
751
+ // command in the clone-local trust resolver.
752
+ return { provenance_invalid: true };
753
+ }
754
+ return {
755
+ provenance: {
756
+ author,
757
+ created_at: createdAt,
758
+ source_kind: sourceKind,
759
+ source_ref: trimStringOrUndefined(value.source_ref),
760
+ },
761
+ };
762
+ }
711
763
  function normalizeLinkedTest(value) {
712
764
  const test = {
713
765
  command: value.command?.trim() || undefined,
@@ -719,6 +771,8 @@ function normalizeLinkedTest(value) {
719
771
  ? value.timeout_seconds
720
772
  : undefined,
721
773
  pm_context_mode: normalizeLinkedTestContextMode(value.pm_context_mode),
774
+ workspace_context_mode: normalizeLinkedTestWorkspaceContextMode(value.workspace_context_mode),
775
+ ...normalizeLinkedTestProvenance(value.provenance, value.provenance_invalid),
722
776
  env_set: normalizeStringRecord(value.env_set),
723
777
  env_clear: normalizeTrimmedStringList(value.env_clear),
724
778
  shared_host_safe: value.shared_host_safe === true ? true : undefined,
@@ -1418,4 +1472,4 @@ export const _testOnlyItemFormat = {
1418
1472
  sortTests,
1419
1473
  };
1420
1474
  //# sourceMappingURL=item-format.js.map
1421
- //# debugId=5eac19ec-235e-5e6f-8ae7-4725f99c9d7f
1475
+ //# debugId=65a90a42-eecb-57d3-9f78-3a5f1bc3abd3
@@ -53,10 +53,30 @@ export declare function assertNoUnknownCsvKeys(kv: Record<string, string>, optio
53
53
  /** Documents the stdin token resolver payload exchanged by command, SDK, and package integrations. */
54
54
  export interface StdinTokenResolver {
55
55
  /** Value that configures or reports resolve value for this contract. */
56
- resolveValue(value: string | undefined, optionName: string): Promise<string | undefined>;
56
+ resolveValue(value: string | undefined, optionName: string, resolveToken?: boolean): Promise<string | undefined>;
57
57
  /** Value that configures or reports resolve list for this contract. */
58
- resolveList(values: string[] | undefined, optionName: string): Promise<string[] | undefined>;
58
+ resolveList(values: string[] | undefined, optionName: string, resolveToken?: boolean): Promise<string[] | undefined>;
59
59
  }
60
+ /** Mark transport-decoded options whose dash values are data, not stdin tokens. */
61
+ export declare function preserveMutationStdinTokenLiterals<T extends object>(options: T): T;
62
+ /** Mark selected mutation fields whose dash values are literal transport data. */
63
+ export declare function preserveMutationStdinTokenFields<T extends object>(options: T, fields: readonly PropertyKey[]): T;
64
+ /** Copy the complete mutation stdin-token policy across an option clone. */
65
+ export declare function transferMutationStdinTokenPolicy<T extends object>(source: object, target: T): T;
66
+ /** Add a source mutation stdin-token policy without weakening the target. */
67
+ export declare function overlayMutationStdinTokenPolicy<T extends object>(source: object, target: T): T;
68
+ /** Report whether lifecycle input should interpret dash values as stdin tokens. */
69
+ export declare function shouldResolveMutationStdinTokens(options: object): boolean;
70
+ /** Report whether one mutation field should interpret dash as a stdin token. */
71
+ export declare function shouldResolveMutationStdinTokenField(options: object, field: PropertyKey): boolean;
72
+ /** Refuse competing stdin-token fields before any resolver starts reading. */
73
+ export declare function assertSingleStdinTokenConsumer(candidates: readonly {
74
+ value: string | readonly string[] | undefined;
75
+ optionName: string;
76
+ resolveToken?: boolean;
77
+ }[]): void;
78
+ /** Resolve a typed mutation option bag only after its complete stdin plan is conflict-free. */
79
+ export declare function resolveMutationStdinTokenFields<T extends object>(options: T, scalarFields: readonly (readonly [keyof T & string, string])[], listFields: readonly (readonly [keyof T & string, string])[]): Promise<T>;
60
80
  /** Implements create stdin token resolver for the public runtime surface of this module. */
61
81
  export declare function createStdinTokenResolver(): StdinTokenResolver;
62
82
  /** Implements parse optional number for the public runtime surface of this module. */