@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
package/dist/sdk/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Defines public SDK APIs and package-author helpers for Index.
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]="483445af-d102-5b49-9b45-8452f8e48ea8")}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]="805c081a-a781-50c3-8919-81492208913b")}catch(e){}}();
8
8
  export { PM_COMMAND_CAPABILITY_CONTRACTS, PM_COMMAND_VISIBILITY_CONTRACTS, PM_MCP_PROMPT_CONTRACTS, PM_MCP_RESOURCE_CONTRACTS, PM_MCP_TOOL_COMMAND_CONTRACTS, listPmCommandsForFamily, listPmCommandsForTier, listPmMcpToolsForProfile, renderPmCommandVisibilityMarkdown, resolvePmCommandCapabilityFamily, resolvePmCommandVisibilityTier, } from "./agent-capability-contracts.js";
9
9
  export * from "./cli-contracts/grammar-contracts.js";
10
10
  export * from "./agent-session-context.js";
@@ -14,6 +14,7 @@ export { BUILTIN_CORPUS_SHAPES, PM_CORPUS_SHAPE_SCHEMA, buildCorpusShapeItemPlan
14
14
  export * from "./core-governance.js";
15
15
  export { createPmCliProgram } from "./cli-program.js";
16
16
  export { runSearchRefreshWorkerEntrypoint } from "./search-refresh-worker.js";
17
+ export { PM_REPRODUCIBLE_PROCESS_ENV, createReproducibleProcessRunner, resolveReproducibleProcessEnvironment, runWithReproducibleProcessEnvironment, } from "./reproducibility/process.js";
17
18
  export { PM_WORKSPACE_RECIPE_SCHEMA, defineWorkspaceRecipe, executeWorkspaceRecipe, runWithWorkspaceRecipe, } from "./workspace-recipe.js";
18
19
  export { SNAPSHOT_SCHEMA, WORKSPACE_SNAPSHOT_ACTIONS, createWorkspaceSnapshot, deleteWorkspaceSnapshot, inspectWorkspaceSnapshot, listWorkspaceSnapshots, planWorkspaceSnapshotRestore, restoreWorkspaceSnapshot, restoreWorkspaceSnapshotWithRecovery, } from "./workspace-snapshot.js";
19
20
  export { flushTelemetryQueue } from "./telemetry-flush.js";
@@ -48,6 +49,7 @@ export { discoverNearbyPmRoot } from "./tracker-root-discovery.js";
48
49
  export { assertInitializedTracker, assertReadableTrackerRoot, buildTrackerInitializationRecovery, } from "./environment/tracker-preflight.js";
49
50
  export { _testOnly as _testOnlyTemplates, } from "./templates.js";
50
51
  export { runConfig, _testOnlyConfigCommand, } from "./config.js";
52
+ export * from "./agent/identity-config.js";
51
53
  export { INIT_AGENT_GUIDANCE_MODE_VALUES, runInitAgentGuidance, _testOnly as _testOnlyInitAgentGuidance, } from "./init-agent-guidance.js";
52
54
  export { runInit, summarizeInitResult, _testOnly as _testOnlyInit, } from "./init.js";
53
55
  export { PROFILE_SUBCOMMANDS, formatProfileApplyHuman, formatProfileLintHuman, formatProfileListHuman, formatProfileShowHuman, runProfileApply, runProfileLint, runProfileList, runProfileShow, } from "./profile.js";
@@ -119,8 +121,11 @@ export * from "./error-runtime.js";
119
121
  export * from "./error-code-catalog.js";
120
122
  export * from "./generated-error-code-catalog.js";
121
123
  export * from "./agent/refusal-reachability.js";
124
+ export * from "./agent/refusal-closure-census.js";
122
125
  export * from "./agent/refusal-closure.js";
123
126
  export * from "./agent/closed-domain-contracts.js";
127
+ export * from "./agent/refusal-corpus-contracts.js";
128
+ export { MERGE_SUBCOMMAND_VALUES } from "./cli-contracts.js";
124
129
  export * from "./agent/tracker-preflight-contracts.js";
125
130
  export * from "./agent/subcommand-recovery.js";
126
131
  export * from "./flag-invocation-contracts.js";
@@ -150,7 +155,8 @@ export { runTelemetry, TELEMETRY_SUBCOMMANDS, } from "./telemetry.js";
150
155
  export { classifyLinkedTestFailure, countFailureCategories, extractReferencedPmItemIdsFromCommand, resolveLinkedTestFailureExitCode, runLinkedTests, runTest, summarizeContextPreflight, } from "./test/execution.js";
151
156
  export { TEST_RUN_MEASUREMENT_LIMIT, diffTestRunMeasurements, parseTestRunMeasurements, queryTestRunMeasurementsBelow, } from "./test/measurements.js";
152
157
  export { runTestAll, } from "./test/batch.js";
153
- export { LINKED_TEST_ENV_NAME_PATTERN, LINKED_TEST_PM_CONTEXT_MODE_VALUES, LINKED_TEST_PROTECTED_ENV_KEYS, parseLinkedTestAssertionEqualsMap, parseLinkedTestAssertionGteMap, parseLinkedTestBoolean, parseLinkedTestContextMode, parseLinkedTestEnvClear, parseLinkedTestEnvSet, parseLinkedTestJsonEntries, parseLinkedTestMinLines, parseLinkedTestRegexList, parseLinkedTestStringList, } from "./test/parsers.js";
158
+ export { LINKED_TEST_ENV_NAME_PATTERN, LINKED_TEST_PM_CONTEXT_MODE_VALUES, LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES, LINKED_TEST_PROTECTED_ENV_KEYS, parseLinkedTestAssertionEqualsMap, parseLinkedTestAssertionGteMap, parseLinkedTestBoolean, parseLinkedTestContextMode, parseLinkedTestEnvClear, parseLinkedTestEnvSet, parseLinkedTestJsonEntries, parseLinkedTestMinLines, parseLinkedTestRegexList, parseLinkedTestStringList, parseLinkedTestWorkspaceContextMode, } from "./test/parsers.js";
159
+ export { acknowledgeLinkedTests, attachLinkedTestMutationProvenance, attachLinkedTestProvenance, linkedTestTrustFingerprint, resolveLinkedTestSourceRef, resolveLinkedTestSourceWorkspaceRoot, resolveLinkedTestTrust, resolveLinkedTestTrustBatch, } from "./test/trust.js";
154
160
  export { runStartBackgroundRun, runTestRunsWorker, } from "./test/runs.js";
155
161
  export { BUILTIN_PROFILES, listProfiles, normalizeProfileName, PROFILE_NAMES, resolveProfile, } from "../core/profile/profile-presets.js";
156
162
  export { planProfileApplication, } from "../core/profile/profile-plan.js";
@@ -161,4 +167,4 @@ export * from "./governance.js";
161
167
  export * from "./query.js";
162
168
  export * from "./testing.js";
163
169
  //# sourceMappingURL=index.js.map
164
- //# debugId=483445af-d102-5b49-9b45-8452f8e48ea8
170
+ //# debugId=805c081a-a781-50c3-8919-81492208913b
@@ -6,15 +6,22 @@
6
6
  * with correct-by-construction inspection and compensation wiring.
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]="ed638747-7a72-5332-87fc-c82088457b91")}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]="ea10685a-3187-533c-9699-73c23d377705")}catch(e){}}();
10
10
  import crypto from "node:crypto";
11
11
  import path from "node:path";
12
+ import { transferMutationStdinTokenPolicy, } from "../core/item/parse.js";
12
13
  import { EXIT_CODE } from "../core/shared/constants.js";
13
14
  import { PmCliError } from "../core/shared/errors.js";
14
15
  import { stableStringify } from "../core/shared/serialization.js";
15
16
  import { readHistoryEntries } from "./history-read.js";
16
17
  import { close, create, deleteItem, get, release, restore, update, } from "./runtime.js";
17
18
  import { commitWorkspaceTransaction, } from "./workspace-transaction.js";
19
+ function mergeTransactionMutationOptions(source, additions) {
20
+ const merged = { ...source, ...additions };
21
+ return source === undefined
22
+ ? merged
23
+ : transferMutationStdinTokenPolicy(source, merged);
24
+ }
18
25
  /** Read one item's transaction-relevant fields, mapping not-found to undefined. */
19
26
  async function readItemSnapshot(pmRoot, id) {
20
27
  try {
@@ -112,7 +119,10 @@ function buildCreateStep(config, mutation, stepId) {
112
119
  return { state: "applied", result: { id: snapshot.id, op: "create" } };
113
120
  },
114
121
  async apply() {
115
- const created = await create({ ...mutation.options, author: config.author, id: mutation.id }, { pmRoot: config.pmRoot });
122
+ const created = await create(mergeTransactionMutationOptions(mutation.options, {
123
+ author: config.author,
124
+ id: mutation.id,
125
+ }), { pmRoot: config.pmRoot });
116
126
  const createdItem = created.item;
117
127
  return { id: String(createdItem.id), op: "create" };
118
128
  },
@@ -155,11 +165,10 @@ function buildUpdateStep(config, mutation, stepId) {
155
165
  return prepareRestoreCompensation(config.pmRoot, mutation);
156
166
  },
157
167
  async apply() {
158
- const updated = await update(mutation.id, {
159
- ...mutation.options,
168
+ const updated = await update(mutation.id, mergeTransactionMutationOptions(mutation.options, {
160
169
  author: config.author,
161
170
  message: bulkHistoryMarker(config.transactionId, stepId, "apply"),
162
- }, { pmRoot: config.pmRoot });
171
+ }), { pmRoot: config.pmRoot });
163
172
  const updatedItem = updated.item;
164
173
  return { id: String(updatedItem.id), op: "update" };
165
174
  },
@@ -191,11 +200,10 @@ function buildCloseStep(config, mutation, stepId) {
191
200
  return prepareRestoreCompensation(config.pmRoot, mutation);
192
201
  },
193
202
  async apply() {
194
- const closed = await close(mutation.id, mutation.reason, {
195
- ...mutation.options,
203
+ const closed = await close(mutation.id, mutation.reason, mergeTransactionMutationOptions(mutation.options, {
196
204
  author: config.author,
197
205
  message: bulkHistoryMarker(config.transactionId, stepId, "apply"),
198
- }, { pmRoot: config.pmRoot });
206
+ }), { pmRoot: config.pmRoot });
199
207
  const closedItem = closed.item;
200
208
  return { id: String(closedItem.id), op: "close" };
201
209
  },
@@ -226,11 +234,10 @@ function buildReleaseStep(config, mutation, stepId) {
226
234
  return prepareRestoreCompensation(config.pmRoot, mutation);
227
235
  },
228
236
  async apply() {
229
- const released = await release(mutation.id, {
230
- ...mutation.options,
237
+ const released = await release(mutation.id, mergeTransactionMutationOptions(mutation.options, {
231
238
  author: config.author,
232
239
  message: bulkHistoryMarker(config.transactionId, stepId, "apply"),
233
- }, { pmRoot: config.pmRoot });
240
+ }), { pmRoot: config.pmRoot });
234
241
  const releasedItem = released.item;
235
242
  return { id: String(releasedItem.id), op: "release" };
236
243
  },
@@ -387,4 +394,4 @@ export const _testOnlyItemTransaction = {
387
394
  readItemSnapshot,
388
395
  };
389
396
  //# sourceMappingURL=item-transaction.js.map
390
- //# debugId=ed638747-7a72-5332-87fc-c82088457b91
397
+ //# debugId=ea10685a-3187-533c-9699-73c23d377705
@@ -4,9 +4,9 @@
4
4
  * Implements the pm append command surface and its agent-facing runtime behavior.
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]="73184370-6517-533e-90db-536893402616")}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]="b4b1f63b-12f9-574c-8e92-a5cc9c6178c1")}catch(e){}}();
8
8
  import { assertInitializedTracker } from "../environment/tracker-preflight.js";
9
- import { EXIT_CODE, PmCliError, resolveAuthor, toItemRecord, createStdinTokenResolver, mutateItem, resolvePmRoot, readSettings, } from "../runtime-primitives.js";
9
+ import { EXIT_CODE, PmCliError, resolveAuthor, toItemRecord, createStdinTokenResolver, shouldResolveMutationStdinTokenField, mutateItem, resolvePmRoot, readSettings, } from "../runtime-primitives.js";
10
10
  /** Implements run append for the public runtime surface of this module. */
11
11
  export async function runAppend(id, options, global) {
12
12
  if (options.body === undefined) {
@@ -18,7 +18,7 @@ export async function runAppend(id, options, global) {
18
18
  const settings = await readSettings(pmRoot);
19
19
  const author = resolveAuthor(options.author, settings.author_default);
20
20
  // options.body is guaranteed defined by the guard above, so resolveValue returns a defined string.
21
- const bodyInput = await stdinResolver.resolveValue(options.body, "--body");
21
+ const bodyInput = await stdinResolver.resolveValue(options.body, "--body", shouldResolveMutationStdinTokenField(options, "body"));
22
22
  const appended = bodyInput.trim();
23
23
  if (appended.length === 0) {
24
24
  throw new PmCliError("--body text cannot be empty; append requires non-blank content and empty appends would only rewrite updated_at.", EXIT_CODE.USAGE, {
@@ -51,4 +51,4 @@ export async function runAppend(id, options, global) {
51
51
  };
52
52
  }
53
53
  //# sourceMappingURL=append.js.map
54
- //# debugId=73184370-6517-533e-90db-536893402616
54
+ //# debugId=b4b1f63b-12f9-574c-8e92-a5cc9c6178c1
@@ -4,7 +4,7 @@
4
4
  * Implements the pm close many command surface and its agent-facing runtime behavior.
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]="a7113374-b169-5f92-9c20-075a47520440")}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]="a97a3cf0-beef-5967-8f5b-2372a6c9f2f7")}catch(e){}}();
8
8
  import { assertInitializedTracker } from "../environment/tracker-preflight.js";
9
9
  import { createCheckpointId, loadMutationCheckpoint, restoreCheckpointItems, writeMutationCheckpoint, getActiveExtensionRegistrations, isTerminalStatus, resolveItemTypeRegistry, resolveRuntimeStatusRegistry, EXIT_CODE, PmCliError, toErrorMessage, resolveAuthor, nowIso, listAllItemMetadataLight, resolvePmRoot, readSettings, } from "../runtime-primitives.js";
10
10
  import { runClose } from "./close.js";
@@ -280,7 +280,14 @@ async function buildCloseManyPlanContext(params) {
280
280
  .map((entry) => entry.trim())
281
281
  .filter((entry) => entry.length > 0)),
282
282
  ];
283
- const matchedIds = new Set(matched.map((item) => item.id));
283
+ const existenceItems = requestedIds.length === 0
284
+ ? []
285
+ : (await runList(undefined, {
286
+ ids: requestedIds.join(","),
287
+ noTruncate: true,
288
+ full: true,
289
+ }, params.global)).items;
290
+ const existingIds = new Set(existenceItems.map((item) => item.id));
284
291
  const closePlannedIds = resolveCloseManyPlannedIds(matched, statusRegistry, force);
285
292
  return {
286
293
  pmRoot: params.pmRoot,
@@ -291,7 +298,9 @@ async function buildCloseManyPlanContext(params) {
291
298
  force,
292
299
  listed,
293
300
  matched,
294
- unmatchedIds: requestedIds.filter((id) => !matchedIds.has(id)),
301
+ unmatchedIds: requestedIds.length === 0
302
+ ? undefined
303
+ : requestedIds.filter((id) => !existingIds.has(id)),
295
304
  planRows: planCloseManyRows(matched, childrenByParent, closePlannedIds, statusRegistry, force),
296
305
  };
297
306
  }
@@ -309,7 +318,7 @@ function buildCloseManyDryRunResult(context) {
309
318
  : {}),
310
319
  item_plans: context.planRows,
311
320
  ids: [],
312
- ...(context.unmatchedIds.length > 0
321
+ ...(context.unmatchedIds !== undefined
313
322
  ? {
314
323
  unmatched_ids: context.unmatchedIds,
315
324
  unmatched_count: context.unmatchedIds.length,
@@ -392,7 +401,7 @@ export async function runCloseMany(options, global) {
392
401
  applied: closedCount,
393
402
  skipped: skippedCount,
394
403
  failed: failedCount,
395
- unmatched: context.unmatchedIds.length,
404
+ unmatched: context.unmatchedIds?.length ?? 0,
396
405
  }),
397
406
  mode: "apply",
398
407
  matched_count: context.matched.length,
@@ -408,7 +417,7 @@ export async function runCloseMany(options, global) {
408
417
  failed_count: failedCount,
409
418
  rows,
410
419
  ids: closedIds,
411
- ...(context.unmatchedIds.length > 0
420
+ ...(context.unmatchedIds !== undefined
412
421
  ? {
413
422
  unmatched_ids: context.unmatchedIds,
414
423
  unmatched_count: context.unmatchedIds.length,
@@ -427,4 +436,4 @@ export const _testOnly = {
427
436
  resolveReason,
428
437
  };
429
438
  //# sourceMappingURL=close-many.js.map
430
- //# debugId=a7113374-b169-5f92-9c20-075a47520440
439
+ //# debugId=a97a3cf0-beef-5967-8f5b-2372a6c9f2f7
@@ -4,9 +4,10 @@
4
4
  * Implements the pm create command surface and its agent-facing runtime behavior.
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]="4dff80ab-acfc-5f81-a546-3f19629d97be")}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]="02c41ea1-8d4e-5239-b95a-a07210b63d7f")}catch(e){}}();
8
8
  import { assertInitializedTracker } from "../environment/tracker-preflight.js";
9
- import { removeFileIfExists, writeFileAtomic, appendHistoryEntry, createHistoryEntry, generateItemId, normalizeItemId, canonicalDocument, normalizeItemMetadata, serializeItemDocument, assertParentReferenceIsNotSelf, isPlaceholderReferenceToken, normalizeParentReferenceValue, validateMissingParentReference, validateSprintOrReleaseValue, assertNoUnknownCsvKeys, createStdinTokenResolver, looksLikeGenericKeyValueEntry, mergeAdditiveTags, parseCsvKv, parseOptionalNonNegativeInteger, parseOptionalNumber, parseTags, resolvePriority, getFocusedItem, normalizeStatusInput, isTerminalStatus, canonicalizeCommandOptionKey, commandOptionFlagLabel, resolveItemTypeRegistry, resolveCommandOptionPolicyState, resolveTypeDefinition, resolveTypeName, validateTypeOptions, acquireLock, printError, buildInvalidTypeError, resolveTypeSynonym, collectRuntimeCreateFieldValues, resolveItemTypesFilePath, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, EXIT_CODE, ITEM_METADATA_KEY_ORDER, PmCliError, nowIso, resolveIsoOrRelative, getActiveExtensionRegistrations, projectAfterCommandItemSnapshot, recordAfterCommandAffectedItem, runActiveCommandHandler, runActiveBeforeMutationHooks, runActiveOnWriteHooks, collectRegisteredItemFieldNames, applyRegisteredItemFieldDefaultsAndValidation, parseRegisteredItemFieldAssignments, listAllItemMetadataLight, locateItem, createMutationGuardSdk, getHistoryPath, getItemPath, resolvePmRoot, readSettings, resolveAuthor, } from "../runtime-primitives.js";
9
+ import { resolveMutationStdinTokenFields } from "../../core/item/parse.js";
10
+ import { removeFileIfExists, writeFileAtomic, appendHistoryEntry, createHistoryEntry, generateItemId, normalizeItemId, canonicalDocument, normalizeItemMetadata, serializeItemDocument, assertParentReferenceIsNotSelf, isPlaceholderReferenceToken, normalizeParentReferenceValue, validateMissingParentReference, validateSprintOrReleaseValue, assertNoUnknownCsvKeys, looksLikeGenericKeyValueEntry, mergeAdditiveTags, parseCsvKv, parseOptionalNonNegativeInteger, parseOptionalNumber, parseTags, shouldResolveMutationStdinTokens, transferMutationStdinTokenPolicy, resolvePriority, getFocusedItem, normalizeStatusInput, isTerminalStatus, canonicalizeCommandOptionKey, commandOptionFlagLabel, resolveItemTypeRegistry, resolveCommandOptionPolicyState, resolveTypeDefinition, resolveTypeName, validateTypeOptions, acquireLock, printError, buildInvalidTypeError, resolveTypeSynonym, collectRuntimeCreateFieldValues, resolveItemTypesFilePath, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, EXIT_CODE, ITEM_METADATA_KEY_ORDER, PmCliError, nowIso, resolveIsoOrRelative, getActiveExtensionRegistrations, projectAfterCommandItemSnapshot, recordAfterCommandAffectedItem, runActiveCommandHandler, runActiveBeforeMutationHooks, runActiveOnWriteHooks, collectRegisteredItemFieldNames, applyRegisteredItemFieldDefaultsAndValidation, parseRegisteredItemFieldAssignments, listAllItemMetadataLight, locateItem, createMutationGuardSdk, getHistoryPath, getItemPath, resolvePmRoot, readSettings, resolveAuthor, } from "../runtime-primitives.js";
10
11
  import { requireTerminalReasonWithRecovery } from "../lifecycle-policy.js";
11
12
  import { evaluateSimilarityGovernance, similarityAdvisoryWarnings, } from "../similarity.js";
12
13
  import { acquireItemMetadataDerivedIndexLock, refreshItemMetadataDerivedIndex, } from "../item-metadata-index.js";
@@ -17,8 +18,9 @@ import { acquireHierarchyMutationLock } from "./hierarchy-mutation-lock.js";
17
18
  import { normalizeRiskInput, normalizeSeverityInput, parseConfidenceInput, parseRegressionInput, } from "./metadata-normalizers.js";
18
19
  import { applyLegacyNoneCollectionNormalizers, createLegacyNoneCollectionNormalizers, assertNoLegacyNoneToken, assertNoLegacyNoneTokens, isLegacyNoneToken, } from "./legacy-none-tokens.js";
19
20
  import { suggestNextLifecycleTransition, } from "./lifecycle-transitions.js";
20
- import { parseLinkedTestAssertionEqualsMap, parseLinkedTestAssertionGteMap, parseLinkedTestBoolean, parseLinkedTestContextMode, parseLinkedTestEnvClear, parseLinkedTestEnvSet, parseLinkedTestMinLines, parseLinkedTestRegexList, parseLinkedTestStringList, } from "../test/parsers.js";
21
+ import { parseLinkedTestAssertionEqualsMap, parseLinkedTestAssertionGteMap, parseLinkedTestBoolean, parseLinkedTestContextMode, parseLinkedTestEnvClear, parseLinkedTestEnvSet, parseLinkedTestMinLines, parseLinkedTestRegexList, parseLinkedTestStringList, parseLinkedTestWorkspaceContextMode, } from "../test/parsers.js";
21
22
  import { looksLikeStructuredLinkedTestEntry, normalizeStructuredLinkedTestEntry, } from "../test/entry.js";
23
+ import { attachLinkedTestMutationProvenance } from "../test/trust.js";
22
24
  import { COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR, COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_AUTHOR, parseCommandUnsetTargets, resolveRuntimeUnsetFieldDefinition, } from "./shared-unset-fields.js";
23
25
  import { ensureEnumValue } from "./recurrence-parsers.js";
24
26
  import { assertDependencyEdgesAllowed, assertDependencyTargetsResolvable, assertValidBareDependencyFlagValue, } from "../dependency-flag-validation.js";
@@ -133,7 +135,7 @@ function normalizeLegacyNoneCreateOptions(options) {
133
135
  normalized[optionKey] = undefined;
134
136
  /* c8 ignore stop */
135
137
  }
136
- return applyLegacyNoneCollectionNormalizers(normalized, CREATE_LEGACY_NONE_COLLECTION_NORMALIZERS);
138
+ return transferMutationStdinTokenPolicy(options, applyLegacyNoneCollectionNormalizers(normalized, CREATE_LEGACY_NONE_COLLECTION_NORMALIZERS));
137
139
  }
138
140
  function parseOptionalString(value) {
139
141
  if (value === undefined)
@@ -327,6 +329,7 @@ export function parseTests(raw) {
327
329
  ? parseOptionalNumber(timeoutRaw, "timeout_seconds")
328
330
  : undefined,
329
331
  pm_context_mode: parseLinkedTestContextMode(kv.pm_context_mode, "--test"),
332
+ workspace_context_mode: parseLinkedTestWorkspaceContextMode(kv.workspace_context_mode, "--test"),
330
333
  env_set: parseLinkedTestEnvSet(kv.env_set, "--test"),
331
334
  env_clear: parseLinkedTestEnvClear(kv.env_clear, "--test"),
332
335
  shared_host_safe: parseLinkedTestBoolean(kv.shared_host_safe, "--test", "shared_host_safe"),
@@ -542,22 +545,29 @@ function parseTypeOptions(raw) {
542
545
  };
543
546
  }
544
547
  async function resolveCreateStdinInputs(options) {
545
- const stdinResolver = createStdinTokenResolver();
546
- return {
547
- ...options,
548
- body: await stdinResolver.resolveValue(options.body, "--body"),
549
- dep: await stdinResolver.resolveList(options.dep, "--dep"),
550
- comment: await stdinResolver.resolveList(options.comment, "--comment"),
551
- note: await stdinResolver.resolveList(options.note, "--note"),
552
- learning: await stdinResolver.resolveList(options.learning, "--learning"),
553
- file: await stdinResolver.resolveList(options.file, "--file"),
554
- test: await stdinResolver.resolveList(options.test, "--test"),
555
- doc: await stdinResolver.resolveList(options.doc, "--doc"),
556
- reminder: await stdinResolver.resolveList(options.reminder, "--reminder"),
557
- event: await stdinResolver.resolveList(options.event, "--event"),
558
- typeOption: await stdinResolver.resolveList(options.typeOption, "--type-option"),
559
- field: await stdinResolver.resolveList(options.field, "--field"),
560
- };
548
+ const scalarFields = [
549
+ ["body", "--body"],
550
+ ["description", "--description"],
551
+ ];
552
+ const listFields = [
553
+ ["dep", "--dep"],
554
+ ["comment", "--comment"],
555
+ ["note", "--note"],
556
+ ["learning", "--learning"],
557
+ ["file", "--file"],
558
+ ["test", "--test"],
559
+ ["doc", "--doc"],
560
+ ["reminder", "--reminder"],
561
+ ["event", "--event"],
562
+ ["typeOption", "--type-option"],
563
+ ["field", "--field"],
564
+ ];
565
+ return await resolveMutationStdinTokenFields(options, scalarFields, listFields);
566
+ }
567
+ async function resolveCreateTransportInputs(options) {
568
+ return shouldResolveMutationStdinTokens(options)
569
+ ? await resolveCreateStdinInputs(options)
570
+ : options;
561
571
  }
562
572
  function resolveCreateMode(createMode, defaultMode) {
563
573
  if (createMode === undefined) {
@@ -1582,7 +1592,7 @@ async function writeCreatedItem(params) {
1582
1592
  }
1583
1593
  /** Implements run create for the public runtime surface of this module. */
1584
1594
  export async function runCreate(options, global) {
1585
- let resolvedOptions = normalizeLegacyNoneCreateOptions(await resolveCreateStdinInputs(options));
1595
+ let resolvedOptions = normalizeLegacyNoneCreateOptions(await resolveCreateTransportInputs(options));
1586
1596
  const pmRoot = resolvePmRoot(process.cwd(), global.path);
1587
1597
  await ensureInitHasRun(pmRoot);
1588
1598
  const settings = await readSettings(pmRoot);
@@ -1605,6 +1615,7 @@ export async function runCreate(options, global) {
1605
1615
  const learnings = parseLogSeed("--learning", resolvedOptions.learning, nowValue, author);
1606
1616
  const files = parseFiles(resolvedOptions.file);
1607
1617
  const tests = parseTests(resolvedOptions.test);
1618
+ tests.values = await attachLinkedTestMutationProvenance(tests.values, author, nowValue);
1608
1619
  const docs = parseDocs(resolvedOptions.doc);
1609
1620
  const reminders = parseReminders(resolvedOptions.reminder, nowValue);
1610
1621
  const events = parseEvents(resolvedOptions.event, nowValue);
@@ -1915,4 +1926,4 @@ export const _testOnlyCreateCommand = {
1915
1926
  typeOptionExampleValue,
1916
1927
  };
1917
1928
  //# sourceMappingURL=create.js.map
1918
- //# debugId=4dff80ab-acfc-5f81-a546-3f19629d97be
1929
+ //# debugId=02c41ea1-8d4e-5239-b95a-a07210b63d7f
@@ -4,9 +4,9 @@
4
4
  * Implements the pm plan command surface and its agent-facing runtime behavior.
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]="49fd5730-99c2-5a93-a80e-83c806a124bf")}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]="f7e870b6-fd80-5742-bc81-826d8f102d30")}catch(e){}}();
8
8
  import { assertInitializedTracker } from "../environment/tracker-preflight.js";
9
- import { getActiveExtensionRegistrations, isTerminalStatus, resolveItemTypeRegistry, resolveRuntimeStatusRegistry, resolveTypeName, EXIT_CODE, PmCliError, splitCommaList, nowIso, locateItem, mutateItem, readLocatedItem, resolvePmRoot, readSettings, resolveAuthor, isTerminalPlanMode, } from "../runtime-primitives.js";
9
+ import { getActiveExtensionRegistrations, isTerminalStatus, resolveItemTypeRegistry, resolveRuntimeStatusRegistry, resolveTypeName, EXIT_CODE, PmCliError, splitCommaList, nowIso, locateItem, mutateItem, readLocatedItem, resolvePmRoot, readSettings, resolveAuthor, isTerminalPlanMode, preserveMutationStdinTokenFields, transferMutationStdinTokenPolicy, } from "../runtime-primitives.js";
10
10
  import { PLAN_HARNESS_VALUES, PLAN_MODE_VALUES, PLAN_STEP_LINK_KIND_VALUES, PLAN_STEP_STATUS_VALUES, } from "../../types/index.js";
11
11
  import { runCreate, } from "./create.js";
12
12
  import { createUnknownSubcommandError } from "../agent/subcommand-recovery.js";
@@ -692,6 +692,12 @@ function buildInitialSteps(options) {
692
692
  hasPerStepDetailOptions: hasDetailOptions,
693
693
  };
694
694
  }
695
+ function preservePlanCreateStdinPolicy(source, createOptions, derivedLiteralFields = []) {
696
+ transferMutationStdinTokenPolicy(source, createOptions);
697
+ if (derivedLiteralFields.length > 0) {
698
+ preserveMutationStdinTokenFields(createOptions, derivedLiteralFields);
699
+ }
700
+ }
695
701
  async function planCreate(options, global, ctx) {
696
702
  const title = options.title?.trim();
697
703
  if (!title) {
@@ -738,6 +744,7 @@ async function planCreate(options, global, ctx) {
738
744
  message: options.message ??
739
745
  (fromSearch ? `plan create (search: ${fromSearch})` : `plan create`),
740
746
  };
747
+ preservePlanCreateStdinPolicy(options, createOptions);
741
748
  const createResult = await runCreate(createOptions, global);
742
749
  // Seed every Plan-specific field before assigning the requested owner so
743
750
  // cross-owner creation cannot reject a follow-up enrichment and leave a
@@ -1380,7 +1387,7 @@ async function createMaterializedStepItems(params) {
1380
1387
  materializeFields[fieldKey] = value;
1381
1388
  }
1382
1389
  for (const step of params.targets) {
1383
- const created = await runCreate({
1390
+ const createOptions = {
1384
1391
  ...materializeFields,
1385
1392
  title: step.title,
1386
1393
  description: step.body?.trim() || step.title,
@@ -1391,7 +1398,15 @@ async function createMaterializedStepItems(params) {
1391
1398
  message: params.options.message ??
1392
1399
  `materialized from plan ${params.planItemId} step ${step.id}`,
1393
1400
  dep: buildMaterializeDependencies(params.parent, params.planItemId, step),
1394
- }, { ...{}, path: params.pmRoot });
1401
+ };
1402
+ preservePlanCreateStdinPolicy(params.options, createOptions, [
1403
+ "description",
1404
+ ...Object.keys(materializeFields),
1405
+ ]);
1406
+ const created = await runCreate(createOptions, {
1407
+ ...{},
1408
+ path: params.pmRoot,
1409
+ });
1395
1410
  materialized.push({
1396
1411
  id: created.item.id,
1397
1412
  title: created.item.title,
@@ -1489,7 +1504,10 @@ function normalizePlanStepAliasInput(input) {
1489
1504
  if (stepValues.length === 1 && !input.options.stepTitle?.trim()) {
1490
1505
  return {
1491
1506
  ...input,
1492
- options: { ...input.options, stepTitle: stepValues[0] },
1507
+ options: transferMutationStdinTokenPolicy(input.options, {
1508
+ ...input.options,
1509
+ stepTitle: stepValues[0],
1510
+ }),
1493
1511
  };
1494
1512
  }
1495
1513
  return input;
@@ -1586,4 +1604,4 @@ export const _testOnlyPlanCommand = {
1586
1604
  changedPlanMetadataFields,
1587
1605
  };
1588
1606
  //# sourceMappingURL=plan.js.map
1589
- //# debugId=49fd5730-99c2-5a93-a80e-83c806a124bf
1607
+ //# debugId=f7e870b6-fd80-5742-bc81-826d8f102d30
@@ -4,15 +4,15 @@
4
4
  * Implements the pm update many command surface and its agent-facing runtime behavior.
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]="7a157c2e-e9e6-5bce-b124-0a7d34e3c7dc")}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]="fada7a33-ad1d-54f1-ae03-c5f8e4568d75")}catch(e){}}();
8
8
  import { assertInitializedTracker } from "../environment/tracker-preflight.js";
9
- import { createCheckpointId, loadMutationCheckpoint, restoreCheckpointItems, writeMutationCheckpoint, toItemRecord, applyAcceptanceCriteriaMutations, applyTagRemovals, mergeAdditiveTags, parseOptionalNonNegativeInteger, parseTags, splitAcceptanceCriteria, resolvePriority, normalizeStatusInput, resolveItemTypeRegistry, resolveTypeName, collectRuntimeUpdateFieldValues, buildInvalidTypeError, resolveItemTypesFilePath, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, EXIT_CODE, PmCliError, toErrorMessage, stableValueEquals, nowIso, resolveIsoOrRelative, getActiveExtensionRegistrations, resolvePmRoot, readSettings, resolveAuthor, } from "../runtime-primitives.js";
9
+ import { createCheckpointId, loadMutationCheckpoint, restoreCheckpointItems, writeMutationCheckpoint, toItemRecord, applyAcceptanceCriteriaMutations, applyTagRemovals, mergeAdditiveTags, parseOptionalNonNegativeInteger, parseTags, splitAcceptanceCriteria, resolvePriority, normalizeStatusInput, resolveItemTypeRegistry, resolveTypeName, collectRuntimeUpdateFieldValues, buildInvalidTypeError, resolveItemTypesFilePath, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, EXIT_CODE, PmCliError, toErrorMessage, stableValueEquals, nowIso, preserveMutationStdinTokenLiterals, resolveIsoOrRelative, getActiveExtensionRegistrations, resolvePmRoot, readSettings, resolveAuthor, } from "../runtime-primitives.js";
10
10
  import { assertDependencyTargetsResolvable } from "../dependency-flag-validation.js";
11
11
  import { parseStatusFilterCsv } from "../../core/item/status-filter.js";
12
12
  import { hasListFilters } from "../query/list-filter-shared.js";
13
13
  import { runList, } from "../query/list.js";
14
14
  import { runRestore } from "./restore.js";
15
- import { assertUpdateMutationOptionCombinations, parseDependencyAdditions, runUpdate, } from "./update.js";
15
+ import { assertUpdateMutationOptionCombinations, parseDependencyAdditions, resolveUpdateTransportOptions, runUpdate, } from "./update.js";
16
16
  import { derivePmBulkMutationEffect, } from "../cli-contracts/command-exit-contracts.js";
17
17
  const UPDATE_MANY_CHECKPOINT_SCHEMA_VERSION = 1;
18
18
  const UPDATE_MANY_CHECKPOINT_SUBDIR = "update-many";
@@ -703,11 +703,12 @@ const applyUpdateManyRows = async (params) => {
703
703
  continue;
704
704
  }
705
705
  try {
706
- const result = await runUpdate(item.id, {
706
+ const rowUpdateOptions = preserveMutationStdinTokenLiterals({
707
707
  ...params.options.update,
708
708
  message: updateMessage,
709
709
  runtimeFieldCommands: ["update_many"],
710
- }, params.global);
710
+ });
711
+ const result = await runUpdate(item.id, rowUpdateOptions, params.global);
711
712
  rows.push({
712
713
  id: item.id,
713
714
  status: "updated",
@@ -786,6 +787,12 @@ const applyUpdateManyPlan = async (params) => {
786
787
  export const runUpdateMany = async (options, global) => {
787
788
  const runtime = await loadUpdateManyRuntimeContext(global);
788
789
  const rollbackId = typeof options.rollback === "string" ? options.rollback : undefined;
790
+ if (rollbackId === undefined) {
791
+ options = {
792
+ ...options,
793
+ update: preserveMutationStdinTokenLiterals(await resolveUpdateTransportOptions(options.update)),
794
+ };
795
+ }
789
796
  const updateSummary = sanitizeUpdateOptionsForSummary(options.update);
790
797
  rejectBlankIdsFilter(options.list);
791
798
  if (rollbackId !== undefined) {
@@ -797,8 +804,8 @@ export const runUpdateMany = async (options, global) => {
797
804
  updateSummary,
798
805
  });
799
806
  }
800
- if (!hasAnyUpdateMutationInput(options.update)) {
801
- throw new PmCliError(`No update-many mutation flags provided. Add at least one mutation flag (for example: ${UPDATE_MANY_MUTATION_FLAG_GUIDANCE}).`, EXIT_CODE.USAGE);
807
+ if (!hasAnyUpdateMutationInput(options.update) && options.dryRun !== true) {
808
+ throw new PmCliError(`No update-many mutation flags provided. Add at least one mutation flag (for example: ${UPDATE_MANY_MUTATION_FLAG_GUIDANCE}), or pass --dry-run for a filter-only preview.`, EXIT_CODE.USAGE);
802
809
  }
803
810
  assertPlannedUpdateValuesValid(options.update, runtime.settings, runtime.statusRegistry, runtime.pmRoot);
804
811
  assertUpdateMutationOptionCombinations(options.update);
@@ -852,4 +859,4 @@ export const _testOnlyUpdateManyCommand = {
852
859
  toComparablePreviewValue,
853
860
  };
854
861
  //# sourceMappingURL=update-many.js.map
855
- //# debugId=7a157c2e-e9e6-5bce-b124-0a7d34e3c7dc
862
+ //# debugId=fada7a33-ad1d-54f1-ae03-c5f8e4568d75
@@ -159,6 +159,8 @@ interface UpdateMutationContext {
159
159
  author: string;
160
160
  pmRoot: string;
161
161
  }
162
+ /** Resolve update stdin tokens once while preserving transport-marked literals. */
163
+ export declare function resolveUpdateTransportOptions(options: UpdateCommandOptions): Promise<UpdateCommandOptions>;
162
164
  /** Validate mutually exclusive and required update mutation option combinations. */
163
165
  export declare function assertUpdateMutationOptionCombinations(options: UpdateCommandOptions): void;
164
166
  type UpdateStatusMutationContext = Pick<UpdateMutationContext, "options" | "statusRegistry" | "clearItemMetadataKeys" | "nowIso">;