@unbrained/pm-cli 2026.8.23 → 2026.8.25

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 (172) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +27 -1
  3. package/dist/cli/description-stdin.js +5 -4
  4. package/dist/cli/extension-command-help.d.ts +5 -0
  5. package/dist/cli/extension-command-help.js +6 -2
  6. package/dist/cli/help-content.d.ts +5 -0
  7. package/dist/cli/help-content.js +56 -3
  8. package/dist/cli/help-json-payload.d.ts +5 -2
  9. package/dist/cli/help-json-payload.js +57 -17
  10. package/dist/cli/main.d.ts +3 -0
  11. package/dist/cli/main.js +28 -3
  12. package/dist/cli/register-annotations.js +5 -5
  13. package/dist/cli/register-mutation.js +73 -27
  14. package/dist/cli-bundle/bundle-manifest.json +152 -152
  15. package/dist/cli-bundle/chunks/{chunk-HWZ6CELB.js → chunk-244MI4GS.js} +3 -3
  16. package/dist/cli-bundle/chunks/{chunk-QDVHNHAQ.js → chunk-2F3LUFMW.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-EG6CLDZT.js → chunk-5I5RWIJC.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-KPH73XXJ.js → chunk-65MHLHAA.js} +2 -2
  19. package/dist/cli-bundle/chunks/chunk-6C7GIMIL.js +13 -0
  20. package/dist/cli-bundle/chunks/chunk-OWHNAR2B.js +2 -0
  21. package/dist/cli-bundle/chunks/chunk-QKGMHGEI.js +202 -0
  22. package/dist/cli-bundle/chunks/chunk-QLUORNIB.js +2092 -0
  23. package/dist/cli-bundle/chunks/{chunk-JB4KZWBF.js → chunk-T2ENPRXF.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-F3AI2JFL.js → chunk-TPQIBSL2.js} +2 -2
  25. package/dist/cli-bundle/chunks/chunk-YQMYF3YD.js +35 -0
  26. package/dist/cli-bundle/chunks/{register-list-query-UJB5FMV2.js → register-list-query-XVN2ZLI7.js} +2 -2
  27. package/dist/cli-bundle/chunks/register-mutation-QCKAEGIJ.js +20 -0
  28. package/dist/cli-bundle/chunks/{register-operations-RXIJIYXC.js → register-operations-SDEAXE7E.js} +2 -2
  29. package/dist/cli-bundle/chunks/{register-setup-GFUZEKRE.js → register-setup-LXVBRCJ3.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-QGFNI65N.js → chunk-2UIWOP3O.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/chunk-42S3GGZ7.js +50 -0
  32. package/dist/cli-bundle/focused-chunks/{chunk-OGLQBL46.js → chunk-7I23XGWO.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/chunk-7YCDTCBC.js +2 -0
  34. package/dist/cli-bundle/focused-chunks/{chunk-OFVUGTLJ.js → chunk-A644DUFQ.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/{chunk-AUFH5H35.js → chunk-GQR3WH3F.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/{chunk-3UPTYG44.js → chunk-H5JZEIQV.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/chunk-IBZZZGK3.js +2 -0
  38. package/dist/cli-bundle/focused-chunks/chunk-LMKG3DFE.js +5 -0
  39. package/dist/cli-bundle/focused-chunks/{chunk-LYVSW5VM.js → chunk-N7W67YIG.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/{chunk-37Z4OEAP.js → chunk-NOOZGIXP.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/{chunk-FZS4H32O.js → chunk-OHIHZ7HS.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/chunk-ONYQCALA.js +19 -0
  43. package/dist/cli-bundle/focused-chunks/chunk-OVJL6NZE.js +4 -0
  44. package/dist/cli-bundle/focused-chunks/chunk-RAFKLNZX.js +16 -0
  45. package/dist/cli-bundle/focused-chunks/{chunk-IFLWKY2R.js → chunk-VXWATRFL.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/{chunk-R27IDGHD.js → chunk-XUQPEKRN.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/{chunk-JOWDB2MH.js → chunk-YO3ZF3FI.js} +2 -2
  48. package/dist/cli-bundle/main.js +18 -17
  49. package/dist/cli-bundle/sdk-authoring.js +1 -1
  50. package/dist/cli-bundle/sdk-contracts.js +2 -2
  51. package/dist/cli-bundle/sdk-core.js +32 -32
  52. package/dist/cli-bundle/sdk-governance.js +1 -1
  53. package/dist/cli-bundle/sdk-graph.js +1 -1
  54. package/dist/cli-bundle/sdk-merge.js +32 -33
  55. package/dist/cli-bundle/sdk-query.js +1 -1
  56. package/dist/cli-bundle/sdk-runtime.js +1 -1
  57. package/dist/cli-bundle/sdk-testing.js +1 -1
  58. package/dist/cli-bundle/sdk.js +6 -5
  59. package/dist/core/diagnostics/remediation.js +17 -2
  60. package/dist/core/extensions/command-metadata-contract.d.ts +10 -0
  61. package/dist/core/extensions/command-metadata-contract.js +23 -0
  62. package/dist/core/extensions/command-visibility-tier.js +12 -2
  63. package/dist/core/extensions/extension-types.d.ts +6 -0
  64. package/dist/core/extensions/extension-types.js +2 -2
  65. package/dist/core/extensions/loader.js +4 -3
  66. package/dist/core/io/body-file.js +7 -2
  67. package/dist/core/io/bulk-ids-input.d.ts +24 -0
  68. package/dist/core/io/bulk-ids-input.js +113 -0
  69. package/dist/core/item/parse.d.ts +22 -2
  70. package/dist/core/item/parse.js +97 -4
  71. package/dist/mcp/server.d.ts +3 -2
  72. package/dist/mcp/server.js +16 -9
  73. package/dist/sdk/agent/refusal-closure-census.d.ts +66 -0
  74. package/dist/sdk/agent/refusal-closure-census.js +144 -0
  75. package/dist/sdk/agent-capability-contracts.d.ts +34 -1
  76. package/dist/sdk/agent-capability-contracts.js +104 -6
  77. package/dist/sdk/annotations.d.ts +2 -0
  78. package/dist/sdk/annotations.js +25 -7
  79. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +10 -0
  80. package/dist/sdk/cli-contracts/runtime-contracts.js +20 -3
  81. package/dist/sdk/cli-contracts/tool-parameter-tables.js +38 -2
  82. package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +4 -1
  83. package/dist/sdk/cli-contracts/typed-action-inputs.js +2 -2
  84. package/dist/sdk/comments.js +15 -7
  85. package/dist/sdk/flag-invocation-contracts.d.ts +2 -0
  86. package/dist/sdk/flag-invocation-contracts.js +28 -3
  87. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +109 -52
  88. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +62 -2
  89. package/dist/sdk/governance/health.js +98 -11
  90. package/dist/sdk/governance/validate.js +15 -9
  91. package/dist/sdk/guide-topics.d.ts +0 -5
  92. package/dist/sdk/guide-topics.js +28 -2
  93. package/dist/sdk/history-compact.d.ts +2 -1
  94. package/dist/sdk/history-compact.js +24 -5
  95. package/dist/sdk/history-mcp.js +11 -10
  96. package/dist/sdk/history-repair.d.ts +24 -0
  97. package/dist/sdk/history-repair.js +145 -4
  98. package/dist/sdk/index.d.ts +1 -0
  99. package/dist/sdk/index.js +3 -2
  100. package/dist/sdk/item-transaction.js +19 -12
  101. package/dist/sdk/lifecycle/append.js +4 -4
  102. package/dist/sdk/lifecycle/close-many.js +16 -7
  103. package/dist/sdk/lifecycle/create.js +29 -21
  104. package/dist/sdk/lifecycle/plan.js +24 -6
  105. package/dist/sdk/lifecycle/update-many.js +15 -8
  106. package/dist/sdk/lifecycle/update.d.ts +2 -0
  107. package/dist/sdk/lifecycle/update.js +34 -24
  108. package/dist/sdk/merge/driver.js +25 -4
  109. package/dist/sdk/merge/receipt-file-boundary.d.ts +21 -0
  110. package/dist/sdk/merge/receipt-file-boundary.js +47 -0
  111. package/dist/sdk/merge/receipts.d.ts +24 -1
  112. package/dist/sdk/merge/receipts.js +342 -36
  113. package/dist/sdk/merge/reconcile.js +117 -47
  114. package/dist/sdk/read-output/continuation.d.ts +15 -2
  115. package/dist/sdk/read-output/continuation.js +86 -6
  116. package/dist/sdk/read-output-contracts.d.ts +4 -1
  117. package/dist/sdk/read-output-contracts.js +9 -6
  118. package/dist/sdk/runtime-extended-actions.js +5 -3
  119. package/dist/sdk/runtime-input.d.ts +4 -0
  120. package/dist/sdk/runtime-input.js +98 -23
  121. package/dist/sdk/runtime-primitives.d.ts +2 -1
  122. package/dist/sdk/runtime-primitives.js +4 -3
  123. package/dist/sdk/runtime.js +7 -20
  124. package/dist/sdk/scheduling-shortcuts.js +5 -3
  125. package/dist/sdk/structured-mutations.js +10 -3
  126. package/dist/sdk/workspace-contracts.d.ts +3 -0
  127. package/dist/sdk/workspace-contracts.js +3 -2
  128. package/docs/MERGE_SAFETY.md +34 -5
  129. package/docs/OUTPUT_PROJECTION_CONTRACTS.md +13 -1
  130. package/docs/README.md +2 -0
  131. package/docs/READ_OUTPUT_CONTRACTS.md +25 -2
  132. package/docs/RELEASING.md +40 -21
  133. package/docs/SCRIPTING.md +62 -3
  134. package/docs/SDK.md +8 -0
  135. package/docs/generated/AGENT_CAPABILITY_ROUTING.md +17 -0
  136. package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -1
  137. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +359 -0
  138. package/marketplace.json +2 -2
  139. package/package.json +1 -1
  140. package/packages/pm-beads/package.json +1 -1
  141. package/packages/pm-calendar/package.json +1 -1
  142. package/packages/pm-command-kit/README.md +9 -11
  143. package/packages/pm-command-kit/extensions/command-kit/index.ts +3 -1
  144. package/packages/pm-command-kit/package.json +1 -1
  145. package/packages/pm-digital-twin/package.json +1 -1
  146. package/packages/pm-governance-audit/package.json +1 -1
  147. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +10 -0
  148. package/packages/pm-guide-shell/package.json +1 -1
  149. package/packages/pm-kanban/package.json +1 -1
  150. package/packages/pm-lifecycle-hooks/package.json +1 -1
  151. package/packages/pm-linked-test-adapters/package.json +1 -1
  152. package/packages/pm-search-advanced/package.json +1 -1
  153. package/packages/pm-templates/package.json +1 -1
  154. package/packages/pm-todos/package.json +1 -1
  155. package/packages/pm-vcs/package.json +1 -1
  156. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  157. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  158. package/scripts/generate-agent-capability-surfaces.mjs +27 -1
  159. package/sdk/public-surface.json +351 -26
  160. package/dist/cli-bundle/chunks/chunk-3ENVHX6C.js +0 -36
  161. package/dist/cli-bundle/chunks/chunk-DW2CGEMU.js +0 -2
  162. package/dist/cli-bundle/chunks/chunk-HZBMLSZI.js +0 -201
  163. package/dist/cli-bundle/chunks/chunk-KXPMB2YL.js +0 -2092
  164. package/dist/cli-bundle/chunks/chunk-TFI5V5N2.js +0 -13
  165. package/dist/cli-bundle/chunks/register-mutation-NX5XE4VX.js +0 -20
  166. package/dist/cli-bundle/focused-chunks/chunk-5S7E72FY.js +0 -16
  167. package/dist/cli-bundle/focused-chunks/chunk-E7X25GC3.js +0 -2
  168. package/dist/cli-bundle/focused-chunks/chunk-FQCSTBWE.js +0 -4
  169. package/dist/cli-bundle/focused-chunks/chunk-MRCNF3U6.js +0 -2
  170. package/dist/cli-bundle/focused-chunks/chunk-OY7QAV4Y.js +0 -51
  171. package/dist/cli-bundle/focused-chunks/chunk-UYRFYCDQ.js +0 -5
  172. package/dist/cli-bundle/focused-chunks/chunk-ZHVA42R5.js +0 -18
@@ -1,6 +1,19 @@
1
1
  import type { PmReadOutputCursorEnvelope, PmReadOutputSurface } from "../read-output-contracts.js";
2
- /** Fingerprint the complete canonical row snapshot so changed evidence fails closed. */
3
- export declare function readOutputCollectionFingerprint(path: string, value: unknown[] | Record<string, unknown>): string;
2
+ /** Stable snapshot policy for a read surface whose probes refresh observation metadata. */
3
+ export interface PmReadOutputContinuationFingerprintPolicy {
4
+ /** Version included in fingerprints so policy changes invalidate older cursors. */
5
+ version: 3;
6
+ /** Declared continuation row paths governed by this policy. */
7
+ paths: readonly string[];
8
+ /** Exact direct detail fields excluded for each named dynamic row. */
9
+ ignored_detail_field_names_by_row: Readonly<Record<string, readonly string[]>>;
10
+ /** Promise that verdicts, stable configuration, and nonvolatile evidence remain bound. */
11
+ guarantee: "nonvolatile_snapshot_and_stable_configuration";
12
+ }
13
+ /** Command-specific exceptions to complete-row continuation fingerprinting. */
14
+ export declare const PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES: Readonly<Partial<Record<PmReadOutputSurface, PmReadOutputContinuationFingerprintPolicy>>>;
15
+ /** Fingerprint the policy-normalized row snapshot so stable evidence changes fail closed. */
16
+ export declare function readOutputCollectionFingerprint(path: string, value: unknown[] | Record<string, unknown>, command?: PmReadOutputSurface): string;
4
17
  /** Encode one stable declared-row continuation for CLI, SDK, and MCP callers. */
5
18
  export declare function encodeReadOutputContinuationCursor(cursor: Omit<PmReadOutputCursorEnvelope, "version">): string;
6
19
  /** Decode and validate one universal declared-row continuation cursor. */
@@ -6,7 +6,7 @@
6
6
  * resolution and budget policy.
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]="1c73c31e-6246-5730-8c8a-d3ba7c9ec112")}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]="9e63b4b0-09a5-50bf-9f56-5f239c75ffe5")}catch(e){}}();
10
10
  import { createHash } from "node:crypto";
11
11
  import { EXIT_CODE } from "../../core/shared/constants.js";
12
12
  import { PmCliError } from "../../core/shared/errors.js";
@@ -14,13 +14,93 @@ import { stableStringify } from "../../core/shared/serialization.js";
14
14
  import { resolveReadOutputSurface } from "../read-output-contracts.js";
15
15
  import { readOutputContinuationRowCollections, sliceReadOutputRowCollection, } from "../read-output-rows.js";
16
16
  const MAX_READ_OUTPUT_CURSOR_LENGTH = 4096;
17
+ const HEALTH_TELEMETRY_VOLATILE_DETAIL_FIELDS = Object.freeze([
18
+ "queue_draining",
19
+ "queue_entries",
20
+ "queue_exists",
21
+ "queue_high_retry_entries",
22
+ "queue_invalid_rows",
23
+ "queue_max_attempts",
24
+ "queue_rows_total",
25
+ "queue_size_bytes",
26
+ "pending_otel_spans",
27
+ "last_attempted_flush_at",
28
+ "last_failed_flush_at",
29
+ "last_otel_attempt_at",
30
+ "last_otel_failure_at",
31
+ "last_otel_success_at",
32
+ "last_successful_flush_at",
33
+ ]);
34
+ /** Command-specific exceptions to complete-row continuation fingerprinting. */
35
+ export const PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES = Object.freeze({
36
+ health: Object.freeze({
37
+ version: 3,
38
+ paths: Object.freeze(["checks"]),
39
+ ignored_detail_field_names_by_row: Object.freeze({
40
+ telemetry: HEALTH_TELEMETRY_VOLATILE_DETAIL_FIELDS,
41
+ }),
42
+ guarantee: "nonvolatile_snapshot_and_stable_configuration",
43
+ }),
44
+ });
17
45
  function isRecord(value) {
18
46
  return value !== null && typeof value === "object" && !Array.isArray(value);
19
47
  }
20
- /** Fingerprint the complete canonical row snapshot so changed evidence fails closed. */
21
- export function readOutputCollectionFingerprint(path, value) {
48
+ function normalizeReadOutputFingerprintValue(value) {
49
+ if (Array.isArray(value)) {
50
+ return value.map(normalizeReadOutputFingerprintValue);
51
+ }
52
+ if (!isRecord(value))
53
+ return value;
54
+ return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
55
+ key,
56
+ normalizeReadOutputFingerprintValue(entry),
57
+ ]));
58
+ }
59
+ function normalizeReadOutputFingerprintRow(value, policy) {
60
+ if (!isRecord(value))
61
+ return normalizeReadOutputFingerprintValue(value);
62
+ const rowName = typeof value.name === "string" ? value.name : undefined;
63
+ const ignoredDetailFields = rowName !== undefined &&
64
+ Object.hasOwn(policy.ignored_detail_field_names_by_row, rowName)
65
+ ? policy.ignored_detail_field_names_by_row[rowName]
66
+ : undefined;
67
+ return Object.fromEntries(Object.entries(value)
68
+ .map(([key, entry]) => {
69
+ if (key !== "details" || !ignoredDetailFields || !isRecord(entry)) {
70
+ return [key, normalizeReadOutputFingerprintValue(entry)];
71
+ }
72
+ return [
73
+ key,
74
+ Object.fromEntries(Object.entries(entry)
75
+ .filter(([detailKey]) => !ignoredDetailFields.includes(detailKey))
76
+ .map(([detailKey, detailValue]) => [
77
+ detailKey,
78
+ normalizeReadOutputFingerprintValue(detailValue),
79
+ ])),
80
+ ];
81
+ }));
82
+ }
83
+ function normalizeReadOutputFingerprintSnapshot(value, policy) {
84
+ return Array.isArray(value)
85
+ ? value.map((row) => normalizeReadOutputFingerprintRow(row, policy))
86
+ : normalizeReadOutputFingerprintRow(value, policy);
87
+ }
88
+ /** Fingerprint the policy-normalized row snapshot so stable evidence changes fail closed. */
89
+ export function readOutputCollectionFingerprint(path, value, command) {
90
+ const policy = command
91
+ ? PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES[command]
92
+ : undefined;
93
+ const policyApplies = policy?.paths.includes(path) === true;
22
94
  return createHash("sha256")
23
- .update(stableStringify({ path, value }))
95
+ .update(stableStringify({
96
+ path,
97
+ value: policyApplies
98
+ ? normalizeReadOutputFingerprintSnapshot(value, policy)
99
+ : value,
100
+ ...(policyApplies
101
+ ? { fingerprint_policy_version: policy.version }
102
+ : {}),
103
+ }))
24
104
  .digest("base64url")
25
105
  .slice(0, 16);
26
106
  }
@@ -105,11 +185,11 @@ export function applyReadOutputContinuation(result, command, cursor) {
105
185
  if (!collection ||
106
186
  totalRows !== cursor.total_rows ||
107
187
  cursor.offset > totalRows ||
108
- readOutputCollectionFingerprint(cursor.path, collection.value) !==
188
+ readOutputCollectionFingerprint(cursor.path, collection.value, command) !==
109
189
  cursor.fingerprint) {
110
190
  throw new PmCliError("The read-output continuation no longer matches the declared row collection; restart the bounded read.", EXIT_CODE.USAGE, { code: "read_output_cursor_stale" });
111
191
  }
112
192
  return sliceReadOutputRowCollection(result, cursor.path, cursor.offset);
113
193
  }
114
194
  //# sourceMappingURL=continuation.js.map
115
- //# debugId=1c73c31e-6246-5730-8c8a-d3ba7c9ec112
195
+ //# debugId=9e63b4b0-09a5-50bf-9f56-5f239c75ffe5
@@ -1,6 +1,7 @@
1
1
  export { resolveReadOutputRecoveryBudget } from "./read-output-budget.js";
2
2
  export type { PmReadOutputRecoveryBudget, PmReadOutputRecoveryBudgetInput, } from "./read-output-budget.js";
3
- export { decodeReadOutputContinuationCursor, encodeReadOutputContinuationCursor, } from "./read-output/continuation.js";
3
+ export { decodeReadOutputContinuationCursor, encodeReadOutputContinuationCursor, PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES, readOutputCollectionFingerprint, } from "./read-output/continuation.js";
4
+ export type { PmReadOutputContinuationFingerprintPolicy } from "./read-output/continuation.js";
4
5
  import { type PmReadOutputSessionReceipt, type PmReadOutputSessionState } from "./read-output-session.js";
5
6
  /** Stable output dimensions shared by every read surface. */
6
7
  export declare const PM_READ_OUTPUT_DIMENSIONS: readonly ["include", "amount", "cost", "encoding"];
@@ -61,6 +62,8 @@ export interface PmReadOutputSurfaceContract {
61
62
  precedence: readonly ["canonical", "legacy", "intent", "default"];
62
63
  /** Stable policy used before budget compaction selects retained rows. */
63
64
  budget_retention_policy: "ordered_prefix" | "verdict_priority";
65
+ /** Exact command-local whole-result modes accepted by `outputInclude`. */
66
+ projection_modes?: readonly string[];
64
67
  }
65
68
  /** Source that selected an effective output dimension. */
66
69
  export type PmReadOutputDimensionSource = "canonical" | "legacy" | "intent" | "default";
@@ -5,7 +5,7 @@
5
5
  * surface without coupling package authors to command-specific option names.
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]="76c9c2d0-951d-579e-916e-e8d54d4a8be9")}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]="d084da05-c967-58f1-afe4-069f09838e6f")}catch(e){}}();
9
9
  import { EXIT_CODE } from "../core/shared/constants.js";
10
10
  import { PmCliError } from "../core/shared/errors.js";
11
11
  import { compactReadOutputToBudget, estimateReadOutputTokens, resolveReadOutputRecoveryBudget, updateReadOutputReceiptEstimate, } from "./read-output-budget.js";
@@ -13,7 +13,7 @@ export { resolveReadOutputRecoveryBudget } from "./read-output-budget.js";
13
13
  import { resolvePmCommandOutputBudget } from "./cli-contracts/agent-output-contracts.js";
14
14
  import { boundReadOutputRows, countReadOutputRows, mapReadOutputRows, readOutputBudgetCollections, readOutputContinuationRowCollections, readOutputRowPaths, } from "./read-output-rows.js";
15
15
  import { applyReadOutputContinuation, decodeReadOutputContinuationCursor, encodeReadOutputContinuationCursor, prioritizeAssuranceAssertions, readOutputCollectionFingerprint, } from "./read-output/continuation.js";
16
- export { decodeReadOutputContinuationCursor, encodeReadOutputContinuationCursor, } from "./read-output/continuation.js";
16
+ export { decodeReadOutputContinuationCursor, encodeReadOutputContinuationCursor, PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES, readOutputCollectionFingerprint, } from "./read-output/continuation.js";
17
17
  import { applyReadOutputSessionReferences, attachReadOutputSessionReceipt, parseReadOutputSession, readOutputSessionRemainingTokens, } from "./read-output-session.js";
18
18
  import { decodeQueryCursorEnvelope, encodeQueryCursor } from "./pagination.js";
19
19
  /** Stable output dimensions shared by every read surface. */
@@ -205,6 +205,9 @@ function buildSurfaceContract(command) {
205
205
  dimensions,
206
206
  precedence: READ_OUTPUT_PRECEDENCE,
207
207
  budget_retention_policy: command === "assurance" ? "verdict_priority" : "ordered_prefix",
208
+ projection_modes: Object.freeze([
209
+ ...readOutputIncludeModeOptions(command).keys(),
210
+ ]),
208
211
  });
209
212
  }
210
213
  /** Universal output contract for every built-in read surface. */
@@ -1092,7 +1095,7 @@ function rebaseBudgetCompactedCursor(projected, originalItemCount, cursorSource,
1092
1095
  }
1093
1096
  return true;
1094
1097
  }
1095
- function captureReadOutputContinuationState(projected, cursor, options) {
1098
+ function captureReadOutputContinuationState(projected, command, cursor, options) {
1096
1099
  const collectionsBeforeBudget = new Map(readOutputContinuationRowCollections(projected).map((collection) => {
1097
1100
  const rows = Array.isArray(collection.value)
1098
1101
  ? collection.value.length
@@ -1106,7 +1109,7 @@ function captureReadOutputContinuationState(projected, cursor, options) {
1106
1109
  baseOffset: continued ? cursor.offset : 0,
1107
1110
  fingerprint: continued
1108
1111
  ? cursor.fingerprint
1109
- : readOutputCollectionFingerprint(collection.path, collection.value),
1112
+ : readOutputCollectionFingerprint(collection.path, collection.value, command),
1110
1113
  },
1111
1114
  ];
1112
1115
  }));
@@ -1154,7 +1157,7 @@ export function applyReadOutputDimensions(command, options, result) {
1154
1157
  const continuationReadyResult = attachValidateDiagnosticRowContract(resolved.command, result);
1155
1158
  const bindingBudget = resolveBindingReadOutputBudget(resolved, session);
1156
1159
  let projected = projectReadOutputRows(continuationReadyResult, resolved, session, cursor);
1157
- const continuationState = captureReadOutputContinuationState(projected, cursor, options);
1160
+ const continuationState = captureReadOutputContinuationState(projected, resolved.command, cursor, options);
1158
1161
  const receipt = {
1159
1162
  contract_version: 1,
1160
1163
  command: resolved.command,
@@ -1207,4 +1210,4 @@ export function resolveReadOutputEncoding(command, options) {
1207
1210
  : undefined;
1208
1211
  }
1209
1212
  //# sourceMappingURL=read-output-contracts.js.map
1210
- //# debugId=76c9c2d0-951d-579e-916e-e8d54d4a8be9
1213
+ //# debugId=d084da05-c967-58f1-afe4-069f09838e6f
@@ -1,7 +1,8 @@
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]="0492d773-2af2-5072-8164-9f8aab536191")}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]="8a3a82a1-9e3d-555f-9111-3c3e19887f75")}catch(e){}}();
3
3
  import { EXIT_CODE } from "../core/shared/constants.js";
4
4
  import { PmCliError } from "../core/shared/errors.js";
5
+ import { transferMutationStdinTokenPolicy, } from "./runtime-primitives.js";
5
6
  import { createUnknownSubcommandError } from "./agent/subcommand-recovery.js";
6
7
  import { resolvePmRoot } from "../core/store/paths.js";
7
8
  import { runEval } from "./eval.js";
@@ -14,7 +15,8 @@ import { parseRuntimeInteger, readRuntimeString, readRuntimeStringArray, } from
14
15
  import { runEvent, runMeet, runRemind, } from "./scheduling-shortcuts.js";
15
16
  import { createWorkspaceSnapshot, deleteWorkspaceSnapshot, inspectWorkspaceSnapshot, listWorkspaceSnapshots, planWorkspaceSnapshotRestore, restoreWorkspaceSnapshotWithRecovery, } from "./workspace-snapshot.js";
16
17
  function mergedInput(context) {
17
- return { ...context.args, ...context.options };
18
+ const input = { ...context.args, ...context.options };
19
+ return transferMutationStdinTokenPolicy(context.options, input);
18
20
  }
19
21
  function requiredString(input, key) {
20
22
  const value = readRuntimeString(input, key);
@@ -169,4 +171,4 @@ export function runRuntimeSchedulingAction(context) {
169
171
  return runRemind(title, input, context.global);
170
172
  }
171
173
  //# sourceMappingURL=runtime-extended-actions.js.map
172
- //# debugId=0492d773-2af2-5072-8164-9f8aab536191
174
+ //# debugId=8a3a82a1-9e3d-555f-9111-3c3e19887f75
@@ -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";
@@ -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]="472ea74c-138f-584f-b363-e76e100e124c")}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";
@@ -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=472ea74c-138f-584f-b363-e76e100e124c
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]="600f391a-c960-5dda-a85a-04d3fa8b1a51")}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. */
@@ -1718,22 +1718,13 @@ async function runMcpRestoreAction(ctx) {
1718
1718
  idOnly,
1719
1719
  });
1720
1720
  }
1721
- function withoutLifecycleAssigneeAlias(options) {
1722
- const updateOptions = { ...options };
1723
- delete updateOptions.assignee;
1724
- return updateOptions;
1725
- }
1726
1721
  async function runMcpStartTaskAction(ctx) {
1727
1722
  const pmRoot = resolvePmRoot(process.cwd(), ctx.global.path);
1728
1723
  const settings = await readSettings(pmRoot);
1729
1724
  const inProgressStatus = resolveStartTaskInProgressStatus(resolveRuntimeStatusRegistry(settings.schema));
1730
1725
  const id = requireMcpItemId(ctx);
1731
1726
  const claimResult = await runClaim(id, ctx.force, ctx.global, ctx.options);
1732
- const updateResult = await runUpdate(id, {
1733
- ...withoutLifecycleAssigneeAlias(ctx.options),
1734
- status: inProgressStatus,
1735
- force: ctx.force,
1736
- }, ctx.global);
1727
+ const updateResult = await runUpdate(id, mutationOptionsWithOverrides(ctx.options, { status: inProgressStatus, force: ctx.force }, ["assignee"]), ctx.global);
1737
1728
  return { id, action: "start_task", claim: claimResult, update: updateResult };
1738
1729
  }
1739
1730
  async function runMcpPauseTaskAction(ctx) {
@@ -1741,11 +1732,7 @@ async function runMcpPauseTaskAction(ctx) {
1741
1732
  const settings = await readSettings(pmRoot);
1742
1733
  const id = requireMcpItemId(ctx);
1743
1734
  const openStatus = resolveRuntimeStatusRegistry(settings.schema).open_status;
1744
- const updateResult = await runUpdate(id, {
1745
- ...withoutLifecycleAssigneeAlias(ctx.options),
1746
- status: openStatus,
1747
- force: ctx.force,
1748
- }, ctx.global);
1735
+ const updateResult = await runUpdate(id, mutationOptionsWithOverrides(ctx.options, { status: openStatus, force: ctx.force }, ["assignee"]), ctx.global);
1749
1736
  const releaseResult = await runRelease(id, ctx.force, ctx.global, ctx.options);
1750
1737
  return {
1751
1738
  id,
@@ -1946,4 +1933,4 @@ async function loadWorkspaceExtensionRegistrations(pmRoot, settings, cwd) {
1946
1933
  }
1947
1934
  }
1948
1935
  //# sourceMappingURL=runtime.js.map
1949
- //# debugId=600f391a-c960-5dda-a85a-04d3fa8b1a51
1936
+ //# debugId=72111aa2-52b2-53da-a1c8-07ba53a74944