@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
@@ -3,6 +3,10 @@ import type { CloseManyCommandOptions } from "./lifecycle/close-many.js";
3
3
  import type { UpdateManyCommandOptions } from "./lifecycle/update-many.js";
4
4
  import type { GraphCommandOptions } from "./graph/run.js";
5
5
  import type { ListOptions } from "./query/list.js";
6
+ /** Mark an action object decoded from the MCP JSON-RPC transport. */
7
+ export declare function markMcpMutationTransportInput<T extends object>(input: T): T;
8
+ /** Clone mutation options with overrides while retaining stdin provenance. */
9
+ export declare function mutationOptionsWithOverrides<Source extends object, Overrides extends object>(source: Source, overrides: Overrides, omittedKeys?: readonly PropertyKey[]): Source & Overrides;
6
10
  /** Read a non-empty string without altering its caller-provided whitespace. */
7
11
  export declare function readRuntimeString(args: Record<string, unknown>, key: string): string | undefined;
8
12
  /** Normalize a non-empty string or finite number into a scalar string. */
@@ -5,12 +5,41 @@
5
5
  * primitives are shared by native action dispatchers and MCP-specific adapters.
6
6
  */
7
7
 
8
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0e153ece-4fc0-5134-97f0-c2315aff0031")}catch(e){}}();
8
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2a1e986f-304d-50f6-a405-6afc221bdad5")}catch(e){}}();
9
9
  import { EXIT_CODE } from "../core/shared/constants.js";
10
10
  import { PmCliError } from "../core/shared/errors.js";
11
11
  import { asRecordClone } from "../core/shared/primitives.js";
12
12
  import { normalizeListOptions, normalizeUpdateOptions, } from "./cli-contracts/registration-helpers.js";
13
13
  import { UPDATE_COMMANDER_STRING_OPTION_CONTRACTS } from "./cli-contracts/commander-mutation-options.js";
14
+ import { normalizeBulkIdsValue, } from "../core/io/bulk-ids-input.js";
15
+ import { overlayMutationStdinTokenPolicy, preserveMutationStdinTokenLiterals, transferMutationStdinTokenPolicy, } from "../core/item/parse.js";
16
+ const MCP_MUTATION_TRANSPORT = Symbol("pm.mcp-mutation-transport");
17
+ /** Mark an action object decoded from the MCP JSON-RPC transport. */
18
+ export function markMcpMutationTransportInput(input) {
19
+ Object.defineProperty(input, MCP_MUTATION_TRANSPORT, {
20
+ value: true,
21
+ enumerable: true,
22
+ });
23
+ return input;
24
+ }
25
+ function isMcpMutationTransportInput(input) {
26
+ return MCP_MUTATION_TRANSPORT in input;
27
+ }
28
+ function preserveTransportLiteralOptions(source, options) {
29
+ return isMcpMutationTransportInput(source)
30
+ ? preserveMutationStdinTokenLiterals(options)
31
+ : transferMutationStdinTokenPolicy(source, options);
32
+ }
33
+ /** Clone mutation options with overrides while retaining stdin provenance. */
34
+ export function mutationOptionsWithOverrides(source, overrides, omittedKeys = []) {
35
+ const options = transferMutationStdinTokenPolicy(source, {
36
+ ...source,
37
+ ...overrides,
38
+ });
39
+ for (const key of omittedKeys)
40
+ Reflect.deleteProperty(options, key);
41
+ return options;
42
+ }
14
43
  /** Read a non-empty string without altering its caller-provided whitespace. */
15
44
  export function readRuntimeString(args, key) {
16
45
  const value = args[key];
@@ -119,6 +148,7 @@ const SCALAR_TO_ARRAY_FIELDS = new Set([
119
148
  "envClear",
120
149
  "env_clear",
121
150
  ]);
151
+ const ANNOTATION_SCALAR_TO_ARRAY_FIELDS = new Set([...SCALAR_TO_ARRAY_FIELDS].filter((field) => field !== "file"));
122
152
  // Actions where the linked-resource fields `add` and `remove` are string[] arrays.
123
153
  // For other actions (comments/notes/learnings) `add` and `remove` are scalar strings
124
154
  // and must NOT be auto-promoted.
@@ -129,6 +159,21 @@ const ARRAY_ADD_REMOVE_ACTIONS = new Set([
129
159
  "test",
130
160
  "test-all",
131
161
  ]);
162
+ const SCALAR_ANNOTATION_SOURCE_ACTIONS = new Set([
163
+ "comments",
164
+ "notes",
165
+ "learnings",
166
+ ]);
167
+ function assertMcpAnnotationFileUnavailable(action, options) {
168
+ if (!SCALAR_ANNOTATION_SOURCE_ACTIONS.has(action) ||
169
+ !Object.prototype.hasOwnProperty.call(options, "file")) {
170
+ return;
171
+ }
172
+ throw new PmCliError(`MCP ${action} does not accept options.file. Pass annotation text in options.add instead.`, EXIT_CODE.USAGE, {
173
+ code: "mcp_annotation_file_unavailable",
174
+ required: "Pass annotation text as JSON data; MCP annotation actions cannot read server-local files.",
175
+ });
176
+ }
132
177
  /** Lifecycle actions where a top-level assignee argument aliases the author. */
133
178
  const LIFECYCLE_AUTHOR_ALIAS_ACTIONS = new Set([
134
179
  "claim",
@@ -171,10 +216,13 @@ const UNIVERSAL_READ_OUTPUT_OPTION_KEYS = [
171
216
  "outputCursor",
172
217
  ];
173
218
  /** Reconcile MCP array/scalar option spellings with CLI flag expectations. */
174
- export function normalizeMcpOptionsArrays(options, action) {
219
+ export function normalizeMcpOptionsArrays(options, action = "") {
175
220
  const result = {};
176
- const promoteAddRemove = action !== undefined && ARRAY_ADD_REMOVE_ACTIONS.has(action);
221
+ const promoteAddRemove = ARRAY_ADD_REMOVE_ACTIONS.has(action);
177
222
  const preserveStandaloneNote = action === "files" || action === "files-discover" || action === "docs";
223
+ const scalarToArrayFields = SCALAR_ANNOTATION_SOURCE_ACTIONS.has(action)
224
+ ? ANNOTATION_SCALAR_TO_ARRAY_FIELDS
225
+ : SCALAR_TO_ARRAY_FIELDS;
178
226
  for (const [key, value] of Object.entries(options)) {
179
227
  if (Array.isArray(value) && ARRAY_TO_CSV_FIELDS.has(key)) {
180
228
  result[key] = value.join(",");
@@ -184,7 +232,8 @@ export function normalizeMcpOptionsArrays(options, action) {
184
232
  result[key] = value;
185
233
  continue;
186
234
  }
187
- if (typeof value === "string" && SCALAR_TO_ARRAY_FIELDS.has(key)) {
235
+ if (typeof value === "string" &&
236
+ scalarToArrayFields.has(key)) {
188
237
  result[key] = [value];
189
238
  continue;
190
239
  }
@@ -198,8 +247,28 @@ export function normalizeMcpOptionsArrays(options, action) {
198
247
  }
199
248
  return result;
200
249
  }
250
+ /** Resolve the explicit or lifecycle-assignee author accepted by MCP actions. */
251
+ function resolveMcpActionAuthor(args, options, action) {
252
+ const author = readRuntimeString(args, "author");
253
+ if (author !== undefined) {
254
+ return author;
255
+ }
256
+ return action !== undefined && LIFECYCLE_AUTHOR_ALIAS_ACTIONS.has(action)
257
+ ? (readRuntimeString(args, "assignee") ??
258
+ readRuntimeString(options, "assignee"))
259
+ : undefined;
260
+ }
261
+ /** Add a resolved author only when the normalized options do not provide one. */
262
+ function withResolvedAuthor(options, author) {
263
+ return author !== undefined && options.author === undefined
264
+ ? { ...options, author }
265
+ : options;
266
+ }
201
267
  /** Merge hoisted top-level action arguments and author aliases into options. */
202
268
  export function optionsWithAuthor(args, action) {
269
+ const sourceOptions = isRuntimeRecord(args.options)
270
+ ? args.options
271
+ : undefined;
203
272
  const baseOptions = asRecordClone(args.options);
204
273
  const hoistedTopLevel = {};
205
274
  const hoistKey = (key) => {
@@ -214,19 +283,14 @@ export function optionsWithAuthor(args, action) {
214
283
  for (const key of UNIVERSAL_READ_OUTPUT_OPTION_KEYS) {
215
284
  hoistKey(key);
216
285
  }
217
- const options = normalizeMcpOptionsArrays({ ...hoistedTopLevel, ...baseOptions }, action);
218
- const author = readRuntimeString(args, "author");
219
- const authorFromAssignee = action !== undefined && LIFECYCLE_AUTHOR_ALIAS_ACTIONS.has(action)
220
- ? (readRuntimeString(args, "assignee") ??
221
- readRuntimeString(options, "assignee"))
222
- : undefined;
223
- if (author && options.author === undefined) {
224
- return { ...options, author };
225
- }
226
- if (authorFromAssignee && options.author === undefined) {
227
- return { ...options, author: authorFromAssignee };
286
+ if (action !== undefined && isMcpMutationTransportInput(args)) {
287
+ assertMcpAnnotationFileUnavailable(action, baseOptions);
228
288
  }
229
- return options;
289
+ const options = normalizeMcpOptionsArrays({ ...hoistedTopLevel, ...baseOptions }, action);
290
+ const stdinPolicySource = isMcpMutationTransportInput(args)
291
+ ? args
292
+ : (sourceOptions ?? args);
293
+ return preserveTransportLiteralOptions(stdinPolicySource, withResolvedAuthor(options, resolveMcpActionAuthor(args, options, action)));
230
294
  }
231
295
  // GH-170 (pm-pfnx): the narrow pm_files/pm_docs tools spell the CLI --note flag
232
296
  // as `addNote` (the shared `note` parameter is the array-typed create/update
@@ -318,10 +382,13 @@ export function extensionOptionsFromArgs(args, options) {
318
382
  }
319
383
  /** Mutation tools (create/update/close/append/update-many) return a verbose `changed_fields` array. On the agent path we drop it to a `changed_field_count` by default for token efficiency, restoring the full array only when the caller explicitly passes the MCP-level fullChangedFields=true control. Mutation options are forwarded unchanged so runtime fields named `full` remain valid user data. */
320
384
  export function withMutationCompaction(args, options) {
385
+ const runnerOptions = preserveTransportLiteralOptions(options ?? {}, {
386
+ ...options,
387
+ });
321
388
  return {
322
389
  changedFields: args.fullChangedFields === true ? "full" : "compact",
323
390
  idOnly: args.idOnly === true,
324
- runnerOptions: { ...options },
391
+ runnerOptions,
325
392
  };
326
393
  }
327
394
  /** Translate flat MCP filter parameters into the shared list-option shape. */
@@ -336,7 +403,7 @@ export function mutationListOptions(options) {
336
403
  updatedBefore: readRuntimeScalarString(options, "filterUpdatedBefore"),
337
404
  createdAfter: readRuntimeScalarString(options, "filterCreatedAfter"),
338
405
  createdBefore: readRuntimeScalarString(options, "filterCreatedBefore"),
339
- ids: readRuntimeScalarStringAllowBlank(options, "ids"),
406
+ ids: normalizeBulkIdsValue(options.ids),
340
407
  assignee: readRuntimeScalarString(options, "filterAssignee"),
341
408
  assigneeFilter: readRuntimeScalarString(options, "filterAssigneeFilter") ??
342
409
  readRuntimeScalarString(options, "filterAssignee_filter"),
@@ -385,12 +452,19 @@ export function graphOptionsFromFlat(options) {
385
452
  ...(options.full === true ? { full: true } : {}),
386
453
  };
387
454
  }
455
+ function normalizeBulkMutationListOptions(options) {
456
+ const normalized = normalizeListOptions(options);
457
+ if (options.ids !== undefined) {
458
+ normalized.ids = normalizeBulkIdsValue(options.ids);
459
+ }
460
+ return normalized;
461
+ }
388
462
  /** Build close-many command options from one flat MCP parameter payload. */
389
463
  export function closeManyOptionsFromFlat(options) {
390
464
  return {
391
465
  status: readRuntimeString(options, "filterStatus"),
392
466
  list: isRuntimeRecord(options.list)
393
- ? normalizeListOptions(options.list)
467
+ ? normalizeBulkMutationListOptions(options.list)
394
468
  : mutationListOptions(options),
395
469
  reason: readRuntimeString(options, "reason"),
396
470
  resolution: readRuntimeString(options, "resolution"),
@@ -474,12 +548,13 @@ export function updateManyOptionsFromFlat(options) {
474
548
  const updateSource = isRuntimeRecord(options.update)
475
549
  ? options.update
476
550
  : updateManyUpdateOptionsFromFlat(options);
551
+ const normalizedUpdate = preserveTransportLiteralOptions(options, normalizeMcpUpdateOptions(updateSource));
477
552
  return {
478
553
  status: readRuntimeScalarString(options, "filterStatus"),
479
554
  list: isRuntimeRecord(options.list)
480
- ? normalizeListOptions(options.list)
555
+ ? normalizeBulkMutationListOptions(options.list)
481
556
  : mutationListOptions(options),
482
- update: normalizeMcpUpdateOptions(updateSource),
557
+ update: overlayMutationStdinTokenPolicy(updateSource, normalizedUpdate),
483
558
  dryRun: options.dryRun === true || options.dry_run === true ? true : undefined,
484
559
  rollback: readRuntimeString(options, "rollback"),
485
560
  checkpoint: options.checkpoint === false ||
@@ -492,7 +567,7 @@ export function updateManyOptionsFromFlat(options) {
492
567
  return {
493
568
  status: readRuntimeScalarString(options, "filterStatus"),
494
569
  list: mutationListOptions(options),
495
- update: updateManyUpdateOptionsFromFlat(options),
570
+ update: preserveTransportLiteralOptions(options, updateManyUpdateOptionsFromFlat(options)),
496
571
  dryRun: options.dryRun === true || options.dry_run === true ? true : undefined,
497
572
  rollback: readRuntimeString(options, "rollback"),
498
573
  checkpoint: options.checkpoint === false ||
@@ -503,4 +578,4 @@ export function updateManyOptionsFromFlat(options) {
503
578
  };
504
579
  }
505
580
  //# sourceMappingURL=runtime-input.js.map
506
- //# debugId=0e153ece-4fc0-5134-97f0-c2315aff0031
581
+ //# debugId=2a1e986f-304d-50f6-a405-6afc221bdad5
@@ -14,6 +14,7 @@ export { applyRegisteredItemFieldDefaultsAndValidation, collectRegisteredItemFie
14
14
  export { resolveExtensionRoots } from "../core/extensions/loader.js";
15
15
  export { resolveRegisteredSearchProvider, resolveRegisteredVectorStoreAdapter, } from "../core/extensions/runtime-registrations.js";
16
16
  export { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic, } from "../core/fs/fs-utils.js";
17
+ export { normalizeBulkIdsValue, parseBulkIdsText, resolveCliBulkIdsInput, type BulkIdsFileReader, type BulkIdsInputReaders, type BulkIdsStdinReader, type BulkIdsValue, } from "../core/io/bulk-ids-input.js";
17
18
  export { type HistoryDiffValueEntry, computeHistoryDiff, patchPathToChangedField, } from "../core/history/history-diff.js";
18
19
  export { enforceHistoryStreamPolicyForItem, enforceHistoryStreamPolicyForItems, } from "../core/history/history-stream-policy.js";
19
20
  export { appendHistoryEntry, CURRENT_HISTORY_ITEM_HASH_VERSION, createHistoryEntry, hashDocument, hashDocumentForVersion, hashEmptyDocument, SUPPORTED_HISTORY_ITEM_HASH_VERSIONS, type HistoryItemHashVersion, } from "../core/history/history.js";
@@ -25,7 +26,7 @@ export { generateItemId, normalizeItemId, normalizeRawItemId, } from "../core/it
25
26
  export { canonicalDocument, normalizeItemMetadata, parseItemDocument, serializeItemDocument, } from "../core/item/item-format.js";
26
27
  export { toItemRecord } from "../core/item/item-record.js";
27
28
  export { assertParentReferenceIsNotSelf, isPlaceholderReferenceToken, normalizeParentReferenceValue, validateMissingParentReference, } from "../core/item/parent-reference-policy.js";
28
- export { applyAcceptanceCriteriaMutations, applyTagRemovals, assertNoUnknownCsvKeys, createStdinTokenResolver, looksLikeGenericKeyValueEntry, mergeAdditiveTags, parseCsvKv, parseOptionalNonNegativeInteger, parseOptionalNumber, parseTags, splitAcceptanceCriteria, } from "../core/item/parse.js";
29
+ export { applyAcceptanceCriteriaMutations, applyTagRemovals, assertNoUnknownCsvKeys, createStdinTokenResolver, looksLikeGenericKeyValueEntry, mergeAdditiveTags, parseCsvKv, parseOptionalNonNegativeInteger, parseOptionalNumber, parseTags, preserveMutationStdinTokenFields, preserveMutationStdinTokenLiterals, transferMutationStdinTokenPolicy, shouldResolveMutationStdinTokenField, shouldResolveMutationStdinTokens, splitAcceptanceCriteria, } from "../core/item/parse.js";
29
30
  export { resolvePriority } from "../core/item/priority.js";
30
31
  export { validateSprintOrReleaseValue } from "../core/item/sprint-release-format.js";
31
32
  export { parseStatusFilterCsv } from "../core/item/status-filter.js";
@@ -53,7 +54,7 @@ export { type VectorizationEmbeddingIdentity, type VectorizationEmbeddingMetadat
53
54
  export { sentryCaptureCliError, sentryFinishCommandSpan, sentryFlush, sentryLogCliUsageError, sentrySetCommandContext, sentryStartCommandSpan, } from "../core/sentry/helpers.js";
54
55
  export { ensureSentryInit } from "../core/sentry/instrument.js";
55
56
  export { clearFocusedItem, getFocusedItem, setFocusedItem, } from "../core/session/session-state.js";
56
- export { readAuthorEnvironment, diagnoseAgentIdentity, resolveAuthor, resolveClaimPrincipal, runWithHarnessDetectionSignals, runWithWorkspaceHarnessSignalDescriptors, type AgentClientInfo, writeAuthorEnvironment, } from "../core/shared/author.js";
57
+ export { readAuthorEnvironment, diagnoseAgentIdentity, resolveAuthor, resolveClaimPrincipal, runWithHarnessDetectionSignals, runWithWorkspaceHarnessSignalDescriptors, BUILTIN_AGENT_PROVENANCE_ADAPTERS, listAgentProvenanceAdapters, normalizeAgentProvenanceAdapterValue, registerAgentProvenanceAdapters, type AgentProvenanceAdapter, type AgentClientInfo, writeAuthorEnvironment, } from "../core/shared/author.js";
57
58
  export { agentSessionEnvironment, boundAgentEpisodeIdentity, runWithAgentSessionContext, resolveAgentSessionContextFromSignals, type AgentEpisodeIdentity, type AgentSessionContext, } from "../core/shared/agent-session-context.js";
58
59
  export { evaluateMutationGuard, isMutationAction, listMutationActions, scanMutationSecrets, type EvaluateMutationGuardOptions, type MutationGuardResult, type MutationGuardSettings, type SecretGuardFinding, type SecretGuardMode, } from "./mutation-guard.js";
59
60
  export { jaccardSimilarity, normalizeSimilarityText, scoreItemSimilarity, tokenizeSimilarityText, type ItemSimilarityScore, } from "./similarity-scoring.js";
@@ -7,7 +7,7 @@
7
7
  * prefer the typed operations exported by the main SDK barrel.
8
8
  */
9
9
 
10
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1bcfba24-e761-571c-96e6-36bbc12d2814")}catch(e){}}();
10
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="be6f7869-f197-5d38-b8d9-faf8f390cd56")}catch(e){}}();
11
11
  export { createCheckpointId, loadMutationCheckpoint, restoreCheckpointItems, writeMutationCheckpoint, } from "../core/checkpoint/mutation-checkpoint.js";
12
12
  export { flattenFlagListValue, resolveFlagValueKind, } from "../core/extensions/flag-value-types.js";
13
13
  export { createUnknownSubcommandError, } from "./agent/subcommand-recovery.js";
@@ -16,6 +16,7 @@ export { applyRegisteredItemFieldDefaultsAndValidation, collectRegisteredItemFie
16
16
  export { resolveExtensionRoots } from "../core/extensions/loader.js";
17
17
  export { resolveRegisteredSearchProvider, resolveRegisteredVectorStoreAdapter, } from "../core/extensions/runtime-registrations.js";
18
18
  export { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic, } from "../core/fs/fs-utils.js";
19
+ export { normalizeBulkIdsValue, parseBulkIdsText, resolveCliBulkIdsInput, } from "../core/io/bulk-ids-input.js";
19
20
  export { computeHistoryDiff, patchPathToChangedField, } from "../core/history/history-diff.js";
20
21
  export { enforceHistoryStreamPolicyForItem, enforceHistoryStreamPolicyForItems, } from "../core/history/history-stream-policy.js";
21
22
  export { appendHistoryEntry, CURRENT_HISTORY_ITEM_HASH_VERSION, createHistoryEntry, hashDocument, hashDocumentForVersion, hashEmptyDocument, SUPPORTED_HISTORY_ITEM_HASH_VERSIONS, } from "../core/history/history.js";
@@ -27,7 +28,7 @@ export { generateItemId, normalizeItemId, normalizeRawItemId, } from "../core/it
27
28
  export { canonicalDocument, normalizeItemMetadata, parseItemDocument, serializeItemDocument, } from "../core/item/item-format.js";
28
29
  export { toItemRecord } from "../core/item/item-record.js";
29
30
  export { assertParentReferenceIsNotSelf, isPlaceholderReferenceToken, normalizeParentReferenceValue, validateMissingParentReference, } from "../core/item/parent-reference-policy.js";
30
- export { applyAcceptanceCriteriaMutations, applyTagRemovals, assertNoUnknownCsvKeys, createStdinTokenResolver, looksLikeGenericKeyValueEntry, mergeAdditiveTags, parseCsvKv, parseOptionalNonNegativeInteger, parseOptionalNumber, parseTags, splitAcceptanceCriteria, } from "../core/item/parse.js";
31
+ export { applyAcceptanceCriteriaMutations, applyTagRemovals, assertNoUnknownCsvKeys, createStdinTokenResolver, looksLikeGenericKeyValueEntry, mergeAdditiveTags, parseCsvKv, parseOptionalNonNegativeInteger, parseOptionalNumber, parseTags, preserveMutationStdinTokenFields, preserveMutationStdinTokenLiterals, transferMutationStdinTokenPolicy, shouldResolveMutationStdinTokenField, shouldResolveMutationStdinTokens, splitAcceptanceCriteria, } from "../core/item/parse.js";
31
32
  export { resolvePriority } from "../core/item/priority.js";
32
33
  export { validateSprintOrReleaseValue } from "../core/item/sprint-release-format.js";
33
34
  export { parseStatusFilterCsv } from "../core/item/status-filter.js";
@@ -55,7 +56,7 @@ export { buildVectorizationEmbeddingIdentity, buildVectorizationEmbeddingMetadat
55
56
  export { sentryCaptureCliError, sentryFinishCommandSpan, sentryFlush, sentryLogCliUsageError, sentrySetCommandContext, sentryStartCommandSpan, } from "../core/sentry/helpers.js";
56
57
  export { ensureSentryInit } from "../core/sentry/instrument.js";
57
58
  export { clearFocusedItem, getFocusedItem, setFocusedItem, } from "../core/session/session-state.js";
58
- export { readAuthorEnvironment, diagnoseAgentIdentity, resolveAuthor, resolveClaimPrincipal, runWithHarnessDetectionSignals, runWithWorkspaceHarnessSignalDescriptors, writeAuthorEnvironment, } from "../core/shared/author.js";
59
+ export { readAuthorEnvironment, diagnoseAgentIdentity, resolveAuthor, resolveClaimPrincipal, runWithHarnessDetectionSignals, runWithWorkspaceHarnessSignalDescriptors, BUILTIN_AGENT_PROVENANCE_ADAPTERS, listAgentProvenanceAdapters, normalizeAgentProvenanceAdapterValue, registerAgentProvenanceAdapters, writeAuthorEnvironment, } from "../core/shared/author.js";
59
60
  export { agentSessionEnvironment, boundAgentEpisodeIdentity, runWithAgentSessionContext, resolveAgentSessionContextFromSignals, } from "../core/shared/agent-session-context.js";
60
61
  export { evaluateMutationGuard, isMutationAction, listMutationActions, scanMutationSecrets, } from "./mutation-guard.js";
61
62
  export { jaccardSimilarity, normalizeSimilarityText, scoreItemSimilarity, tokenizeSimilarityText, } from "./similarity-scoring.js";
@@ -81,4 +82,4 @@ export { maybeRunFirstUseTelemetryPrompt } from "../core/telemetry/consent.js";
81
82
  export { deriveTelemetryCommandResolution, } from "../core/telemetry/observability.js";
82
83
  export { emitTelemetryErrorEvent, finishTelemetryCommand, startTelemetryCommand, } from "../core/telemetry/runtime.js";
83
84
  //# sourceMappingURL=runtime-primitives.js.map
84
- //# debugId=1bcfba24-e761-571c-96e6-36bbc12d2814
85
+ //# debugId=be6f7869-f197-5d38-b8d9-faf8f390cd56
@@ -4,7 +4,7 @@
4
4
  * Defines public SDK APIs and package-author helpers for Runtime.
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]="a27b9b88-a8de-5e38-ab7f-dfcc61d1fad6")}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]="72111aa2-52b2-53da-a1c8-07ba53a74944")}catch(e){}}();
8
8
  export { PM_GITIGNORE_END, PM_GITIGNORE_START, ensurePmGitignore, getPmGitignoreBlock, } from "./workspace.js";
9
9
  export { SEARCH_EXTENSION_FLAG_DEFINITIONS } from "./extension-contracts.js";
10
10
  export * from "./cli-contracts/agent-output-contracts.js";
@@ -72,7 +72,7 @@ import { PROFILE_SUBCOMMANDS, runProfileApply, runProfileLint, runProfileList, r
72
72
  import { runHistoryRedact, } from "./history-redact.js";
73
73
  import { runMcpHistoryCompactAction, runMcpHistoryRepairAction, } from "./history-mcp.js";
74
74
  import { runMcpCloseAction, runMcpReopenAction } from "./lifecycle/mcp-actions.js";
75
- import { actionGlobalOptions as globalOptions, closeManyOptionsFromFlat, extensionOptionsFromArgs, graphOptionsFromFlat, mutationListOptions, normalizeActionName, normalizeCommandPath, normalizeMcpOptionsArrays, normalizeMcpUpdateOptions, optionsWithAuthor, parseRuntimeInteger as parseMcpInteger, readRuntimeScalarString as readScalarString, readRuntimeScalarStringAllowBlank as readScalarStringAllowBlank, readRuntimeString as readString, readRuntimeStringArray as readStringArray, resolveRuntimeLimit, updateManyOptionsFromFlat, withAddNoteOption, withFilesDiscoveryOptions, withMutationCompaction, } from "./runtime-input.js";
75
+ import { actionGlobalOptions as globalOptions, closeManyOptionsFromFlat, extensionOptionsFromArgs, graphOptionsFromFlat, mutationListOptions, mutationOptionsWithOverrides, normalizeActionName, normalizeCommandPath, normalizeMcpOptionsArrays, normalizeMcpUpdateOptions, optionsWithAuthor, parseRuntimeInteger as parseMcpInteger, readRuntimeScalarString as readScalarString, readRuntimeScalarStringAllowBlank as readScalarStringAllowBlank, readRuntimeString as readString, readRuntimeStringArray as readStringArray, resolveRuntimeLimit, updateManyOptionsFromFlat, withAddNoteOption, withFilesDiscoveryOptions, withMutationCompaction, } from "./runtime-input.js";
76
76
  import { runDeps } from "./dependencies.js";
77
77
  import { runDocs } from "./docs.js";
78
78
  import { runGraph, } from "./graph/run.js";
@@ -252,7 +252,7 @@ export class PmClient {
252
252
  append(id, body, options = {}) {
253
253
  return this.runTyped("append", {
254
254
  id,
255
- ...splitFullClientMutationOptions({ ...options, body }),
255
+ ...splitFullClientMutationOptions(mutationOptionsWithOverrides(options, { body })),
256
256
  });
257
257
  }
258
258
  /** Initialize a workspace with the same semantics as `pm init`. */
@@ -461,7 +461,7 @@ export class PmClient {
461
461
  ...(id === undefined ? {} : { id }),
462
462
  ...(stepRef === undefined ? {} : { stepRef }),
463
463
  ...(reorderTo === undefined ? {} : { reorderTo }),
464
- options: { ...options, subcommand },
464
+ options: mutationOptionsWithOverrides(options, { subcommand }),
465
465
  });
466
466
  }
467
467
  /** Create a durable plan with optional ordered seed steps. */
@@ -1457,12 +1457,13 @@ function runMcpConfigAction(ctx) {
1457
1457
  const configAction = readString(ctx.args, "configAction") ??
1458
1458
  readString(ctx.options, "configAction") ??
1459
1459
  readString(ctx.options, "action");
1460
- if (configAction === undefined) {
1460
+ if (configAction === undefined)
1461
1461
  throw new PmCliError("Missing required argument: configAction", 64);
1462
- }
1462
+ const value = readString(ctx.args, "value") ?? readString(ctx.options, "value");
1463
+ const options = readString(ctx.options, "policy") !== undefined && value !== undefined ? { ...ctx.options, value } : ctx.options;
1463
1464
  return runConfig(readString(ctx.args, "scope") ??
1464
1465
  readString(ctx.options, "scope") ??
1465
- "project", configAction, readString(ctx.args, "key") ?? readString(ctx.options, "key"), ctx.options, ctx.global, readString(ctx.args, "value") ?? readString(ctx.options, "value"));
1466
+ "project", configAction, readString(ctx.args, "key") ?? readString(ctx.options, "key"), options, ctx.global, readString(ctx.options, "policy") === undefined ? value : undefined);
1466
1467
  }
1467
1468
  function runMcpActivityAction(ctx) {
1468
1469
  const options = ctx.options;
@@ -1717,22 +1718,13 @@ async function runMcpRestoreAction(ctx) {
1717
1718
  idOnly,
1718
1719
  });
1719
1720
  }
1720
- function withoutLifecycleAssigneeAlias(options) {
1721
- const updateOptions = { ...options };
1722
- delete updateOptions.assignee;
1723
- return updateOptions;
1724
- }
1725
1721
  async function runMcpStartTaskAction(ctx) {
1726
1722
  const pmRoot = resolvePmRoot(process.cwd(), ctx.global.path);
1727
1723
  const settings = await readSettings(pmRoot);
1728
1724
  const inProgressStatus = resolveStartTaskInProgressStatus(resolveRuntimeStatusRegistry(settings.schema));
1729
1725
  const id = requireMcpItemId(ctx);
1730
1726
  const claimResult = await runClaim(id, ctx.force, ctx.global, ctx.options);
1731
- const updateResult = await runUpdate(id, {
1732
- ...withoutLifecycleAssigneeAlias(ctx.options),
1733
- status: inProgressStatus,
1734
- force: ctx.force,
1735
- }, ctx.global);
1727
+ const updateResult = await runUpdate(id, mutationOptionsWithOverrides(ctx.options, { status: inProgressStatus, force: ctx.force }, ["assignee"]), ctx.global);
1736
1728
  return { id, action: "start_task", claim: claimResult, update: updateResult };
1737
1729
  }
1738
1730
  async function runMcpPauseTaskAction(ctx) {
@@ -1740,11 +1732,7 @@ async function runMcpPauseTaskAction(ctx) {
1740
1732
  const settings = await readSettings(pmRoot);
1741
1733
  const id = requireMcpItemId(ctx);
1742
1734
  const openStatus = resolveRuntimeStatusRegistry(settings.schema).open_status;
1743
- const updateResult = await runUpdate(id, {
1744
- ...withoutLifecycleAssigneeAlias(ctx.options),
1745
- status: openStatus,
1746
- force: ctx.force,
1747
- }, ctx.global);
1735
+ const updateResult = await runUpdate(id, mutationOptionsWithOverrides(ctx.options, { status: openStatus, force: ctx.force }, ["assignee"]), ctx.global);
1748
1736
  const releaseResult = await runRelease(id, ctx.force, ctx.global, ctx.options);
1749
1737
  return {
1750
1738
  id,
@@ -1945,4 +1933,4 @@ async function loadWorkspaceExtensionRegistrations(pmRoot, settings, cwd) {
1945
1933
  }
1946
1934
  }
1947
1935
  //# sourceMappingURL=runtime.js.map
1948
- //# debugId=a27b9b88-a8de-5e38-ab7f-dfcc61d1fad6
1936
+ //# debugId=72111aa2-52b2-53da-a1c8-07ba53a74944
@@ -1,5 +1,6 @@
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]="32223457-5f57-5049-99cf-c5d766413fb6")}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]="c7c75b13-7317-5089-9869-7e6e22ed95b2")}catch(e){}}();
3
+ import { transferMutationStdinTokenPolicy, } from "./runtime-primitives.js";
3
4
  import { runCreate, } from "./lifecycle/create.js";
4
5
  const DEFAULT_DURATION = "1h";
5
6
  const DEFAULT_START = "now";
@@ -10,7 +11,7 @@ function appendQuotedPair(pairs, key, value) {
10
11
  }
11
12
  }
12
13
  function buildCommonOptions(type, title, options) {
13
- return {
14
+ const createOptions = {
14
15
  type,
15
16
  title,
16
17
  schedulePreset: "lightweight",
@@ -23,6 +24,7 @@ function buildCommonOptions(type, title, options) {
23
24
  author: options.author,
24
25
  message: options.message,
25
26
  };
27
+ return transferMutationStdinTokenPolicy(options, createOptions);
26
28
  }
27
29
  async function createMeetingOrEvent(type, title, options, global) {
28
30
  const createOptions = buildCommonOptions(type, title, options);
@@ -59,4 +61,4 @@ export function runRemind(title, options, global) {
59
61
  return runCreate(createOptions, global);
60
62
  }
61
63
  //# sourceMappingURL=scheduling-shortcuts.js.map
62
- //# debugId=32223457-5f57-5049-99cf-c5d766413fb6
64
+ //# debugId=c7c75b13-7317-5089-9869-7e6e22ed95b2
@@ -5,9 +5,10 @@
5
5
  * transaction contract and normalizes full item documents for CLI round trips.
6
6
  */
7
7
 
8
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="07876c03-63a8-5c69-9c6c-c3446076a382")}catch(e){}}();
8
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3f348972-0c8f-52da-abeb-46690df967d8")}catch(e){}}();
9
9
  import crypto from "node:crypto";
10
10
  import { normalizeItemId, normalizePrefix } from "../core/item/id.js";
11
+ import { preserveMutationStdinTokenLiterals } from "../core/item/parse.js";
11
12
  import { EXIT_CODE, ITEM_PROJECT_CONTEXT_KEYS, } from "../core/shared/constants.js";
12
13
  import { PmCliError } from "../core/shared/errors.js";
13
14
  import { levenshteinDistanceWithinLimit } from "../core/shared/levenshtein.js";
@@ -244,7 +245,13 @@ export function parseItemMutationBatch(input) {
244
245
  if (rows === undefined || rows.length === 0) {
245
246
  throw new PmCliError("Mutation batch must be a non-empty JSON array or an object with a non-empty mutations array.", EXIT_CODE.USAGE);
246
247
  }
247
- return rows.map((row, index) => validateMutationRow(row, index));
248
+ return rows.map((row, index) => {
249
+ const mutation = validateMutationRow(row, index);
250
+ if (mutation.options !== undefined) {
251
+ preserveMutationStdinTokenLiterals(mutation.options);
252
+ }
253
+ return mutation;
254
+ });
248
255
  }
249
256
  function deriveReferencedItemId(transactionId, reference, idPrefix) {
250
257
  const digest = crypto
@@ -571,4 +578,4 @@ export function validateItemMutationRows(value) {
571
578
  return parseItemMutationBatch(JSON.stringify(value));
572
579
  }
573
580
  //# sourceMappingURL=structured-mutations.js.map
574
- //# debugId=07876c03-63a8-5c69-9c6c-c3446076a382
581
+ //# debugId=3f348972-0c8f-52da-abeb-46690df967d8
@@ -25,6 +25,12 @@ export interface TestAllCommandOptions {
25
25
  pmContext?: string;
26
26
  /** Value that configures or reports override linked pm context for this contract. */
27
27
  overrideLinkedPmContext?: boolean;
28
+ /** Source-workspace visibility and working-directory mode. */
29
+ workspaceContext?: string;
30
+ /** Force run-level source-workspace mode over linked metadata. */
31
+ overrideLinkedWorkspaceContext?: boolean;
32
+ /** Explicitly permit untrusted commands when project policy also permits them. */
33
+ allowUntrustedLinkedTests?: boolean;
28
34
  /** Value that configures or reports fail on context mismatch for this contract. */
29
35
  failOnContextMismatch?: boolean;
30
36
  /** Value that configures or reports fail on skipped for this contract. */
@@ -4,7 +4,7 @@
4
4
  * Implements the pm test all 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]="bb2758a5-a5c1-5f6e-be42-0e173fe16fe3")}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]="5d3405c0-14e6-51f5-97a1-355438fd0199")}catch(e){}}();
8
8
  import { assertInitializedTracker } from "../environment/tracker-preflight.js";
9
9
  import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
10
10
  import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
@@ -80,6 +80,10 @@ const normalizePmContextModeSignature = (value) => {
80
80
  const normalized = value?.trim().toLowerCase();
81
81
  return normalized && normalized.length > 0 ? normalized : "none";
82
82
  };
83
+ const normalizeWorkspaceContextModeSignature = (value) => {
84
+ const normalized = value?.trim().toLowerCase();
85
+ return normalized && normalized.length > 0 ? normalized : "source";
86
+ };
83
87
  /** Sorts and deduplicates optional assertion string lists. */
84
88
  const normalizeAssertionStrings = (values) => [...new Set(values ?? [])].sort((left, right) => left.localeCompare(right));
85
89
  /** Sorts optional assertion maps into deterministic key order. */
@@ -110,9 +114,10 @@ const buildLinkedTestKey = (test) => {
110
114
  const envSet = normalizeEnvSetSignature(test.env_set);
111
115
  const envClear = normalizeEnvClearSignature(test.env_clear);
112
116
  const pmContextMode = normalizePmContextModeSignature(test.pm_context_mode);
117
+ const workspaceContextMode = normalizeWorkspaceContextModeSignature(test.workspace_context_mode);
113
118
  const sharedHostSafe = test.shared_host_safe === true ? "true" : "false";
114
119
  const assertions = normalizeAssertionSignature(test);
115
- return `${resolveLinkedTestTargetSignature(test)}:${envSet}:${envClear}:${pmContextMode}:${sharedHostSafe}:${assertions}`;
120
+ return `${resolveLinkedTestTargetSignature(test)}:${envSet}:${envClear}:${pmContextMode}:${workspaceContextMode}:${sharedHostSafe}:${assertions}`;
116
121
  };
117
122
  const maxTimeoutSeconds = (current, candidate) => {
118
123
  if (candidate === undefined) {
@@ -227,6 +232,11 @@ const runTestAllItem = async (entry, context) => {
227
232
  requireAssertionsForPm: context.options.requireAssertionsForPm,
228
233
  checkContext: context.options.checkContext,
229
234
  autoPmContext: context.options.autoPmContext,
235
+ workspaceContext: context.options.workspaceContext,
236
+ overrideLinkedWorkspaceContext: context.options.overrideLinkedWorkspaceContext,
237
+ pmRoot: context.pmRoot,
238
+ allowUntrustedLinkedTests: context.options.allowUntrustedLinkedTests,
239
+ untrustedLinkedTestsPolicyEnabled: context.settings.testing.allow_untrusted_linked_tests,
230
240
  })
231
241
  : [];
232
242
  let executedIndex = 0;
@@ -307,6 +317,8 @@ const appendTestAllItemTracking = async (entry, summary, runResults, context) =>
307
317
  command: result.command.trim(),
308
318
  requested_pm_context_mode: result.execution_context?.requested_pm_context_mode,
309
319
  pm_context_mode: result.execution_context?.pm_context_mode,
320
+ workspace_context_mode: result.execution_context?.workspace_context_mode,
321
+ trust_reason: result.execution_context?.trust.reason,
310
322
  })),
311
323
  },
312
324
  });
@@ -495,4 +507,4 @@ export const _testOnlyTestAll = {
495
507
  formatTrackingError,
496
508
  };
497
509
  //# sourceMappingURL=batch.js.map
498
- //# debugId=bb2758a5-a5c1-5f6e-be42-0e173fe16fe3
510
+ //# debugId=5d3405c0-14e6-51f5-97a1-355438fd0199
@@ -1,5 +1,5 @@
1
1
  /** Public contract for structured linked test keys, shared by SDK and presentation-layer consumers. */
2
- export declare const STRUCTURED_LINKED_TEST_KEYS: readonly ["command", "cmd", "path", "scope", "timeout", "timeout_seconds", "pm_context_mode", "env_set", "env_clear", "shared_host_safe", "assert_stdout_contains", "assert_stdout_regex", "assert_stderr_contains", "assert_stderr_regex", "assert_stdout_min_lines", "assert_json_field_equals", "assert_json_field_gte", "note"];
2
+ export declare const STRUCTURED_LINKED_TEST_KEYS: readonly ["command", "cmd", "path", "scope", "timeout", "timeout_seconds", "pm_context_mode", "workspace_context_mode", "env_set", "env_clear", "shared_host_safe", "assert_stdout_contains", "assert_stdout_regex", "assert_stderr_contains", "assert_stderr_regex", "assert_stdout_min_lines", "assert_json_field_equals", "assert_json_field_gte", "note"];
3
3
  /** Implements looks like structured linked test entry for the public runtime surface of this module. */
4
4
  export declare function looksLikeStructuredLinkedTestEntry(raw: string): boolean;
5
5
  /** Implements normalize structured linked test entry for the public runtime surface of this module. */
@@ -4,7 +4,7 @@
4
4
  * Implements the pm linked test entry 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]="2b20ab37-ffbe-5c65-ac0f-800abf876e16")}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]="44e6a87d-0ca5-53af-b199-b66bb2b98fb5")}catch(e){}}();
8
8
  import { EXIT_CODE } from "../../core/shared/constants.js";
9
9
  import { PmCliError } from "../../core/shared/errors.js";
10
10
  // Keys accepted inside a structured linked-test entry. `cmd` is an alias for
@@ -18,6 +18,7 @@ export const STRUCTURED_LINKED_TEST_KEYS = [
18
18
  "timeout",
19
19
  "timeout_seconds",
20
20
  "pm_context_mode",
21
+ "workspace_context_mode",
21
22
  "env_set",
22
23
  "env_clear",
23
24
  "shared_host_safe",
@@ -71,4 +72,4 @@ export function normalizeStructuredLinkedTestEntry(kv, optionName) {
71
72
  return normalizedKv;
72
73
  }
73
74
  //# sourceMappingURL=entry.js.map
74
- //# debugId=2b20ab37-ffbe-5c65-ac0f-800abf876e16
75
+ //# debugId=44e6a87d-0ca5-53af-b199-b66bb2b98fb5