@unbrained/pm-cli 2026.8.11 → 2026.8.12

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 (184) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +52 -21
  3. package/dist/cli/commander-usage.js +37 -11
  4. package/dist/cli/error-guidance.d.ts +2 -0
  5. package/dist/cli/error-guidance.js +80 -13
  6. package/dist/cli/main.js +34 -19
  7. package/dist/cli/register-annotations.js +56 -3
  8. package/dist/cli/register-list-query.js +10 -7
  9. package/dist/cli/register-operations.js +16 -6
  10. package/dist/cli-bundle/bundle-manifest.json +157 -157
  11. package/dist/cli-bundle/chunks/{chunk-2OOU2AFH.js → chunk-3PS7X6GS.js} +2 -2
  12. package/dist/cli-bundle/chunks/chunk-7KL6KMWF.js +13 -0
  13. package/dist/cli-bundle/chunks/{chunk-WMEZHCFI.js → chunk-BM5YJ2UW.js} +51 -43
  14. package/dist/cli-bundle/chunks/chunk-D55A5AEN.js +33 -0
  15. package/dist/cli-bundle/chunks/chunk-KIKDWECH.js +196 -0
  16. package/dist/cli-bundle/chunks/{chunk-ZU34C3LH.js → chunk-KOQMGCTA.js} +2 -2
  17. package/dist/cli-bundle/chunks/chunk-R76342NV.js +2 -0
  18. package/dist/cli-bundle/chunks/chunk-RBTK5EZV.js +5 -0
  19. package/dist/cli-bundle/chunks/{chunk-IUNRVDAI.js → chunk-VLUQOIDT.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-A2SJGHSI.js → chunk-WLAHPSOX.js} +2 -2
  21. package/dist/cli-bundle/chunks/register-list-query-XPCJRUUD.js +10 -0
  22. package/dist/cli-bundle/chunks/register-mutation-4RJCBKRS.js +20 -0
  23. package/dist/cli-bundle/chunks/register-operations-2OGISOVR.js +2 -0
  24. package/dist/cli-bundle/chunks/{register-setup-NOCOOWQY.js → register-setup-LLHAKP2V.js} +2 -2
  25. package/dist/cli-bundle/focused-chunks/chunk-2DALMVF7.js +5 -0
  26. package/dist/cli-bundle/focused-chunks/chunk-5OQIMELN.js +155 -0
  27. package/dist/cli-bundle/focused-chunks/chunk-5TAGTDRE.js +2 -0
  28. package/dist/cli-bundle/focused-chunks/{chunk-FPSYO5ZG.js → chunk-ECADZMVC.js} +11 -11
  29. package/dist/cli-bundle/focused-chunks/chunk-EJGXRA6B.js +2 -0
  30. package/dist/cli-bundle/focused-chunks/chunk-FFGSZCPK.js +16 -0
  31. package/dist/cli-bundle/focused-chunks/{chunk-BKPIY34S.js → chunk-GQW4BPUT.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/chunk-ISKOBJCM.js +2 -0
  33. package/dist/cli-bundle/focused-chunks/{chunk-UDAZWT25.js → chunk-JAFRIWVF.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/{chunk-2DL3MRTD.js → chunk-KHM2CS2C.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/{chunk-J5EKAIVD.js → chunk-KPSXVBDV.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/{chunk-23FTGO3W.js → chunk-KTLOKKCQ.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/chunk-LGYK3NUF.js +8 -0
  38. package/dist/cli-bundle/focused-chunks/{chunk-KDH5OX3D.js → chunk-NBLUKITQ.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-55BIB6DV.js → chunk-NYLOUPOB.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/{chunk-DPO7TEFX.js → chunk-Q4T463SD.js} +28 -28
  41. package/dist/cli-bundle/focused-chunks/chunk-QVZVY53N.js +2 -0
  42. package/dist/cli-bundle/focused-chunks/{chunk-TL5M2PAY.js → chunk-RWPAWUOT.js} +2 -2
  43. package/dist/cli-bundle/focused-chunks/chunk-UTEWXDEQ.js +17 -0
  44. package/dist/cli-bundle/focused-chunks/{chunk-4H5IA6AV.js → chunk-YIAXMC3T.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/chunk-ZMGWAYH7.js +2 -0
  46. package/dist/cli-bundle/main.js +13 -13
  47. package/dist/cli-bundle/sdk-authoring.js +1 -1
  48. package/dist/cli-bundle/sdk-contracts.js +1 -1
  49. package/dist/cli-bundle/sdk-core.js +40 -40
  50. package/dist/cli-bundle/sdk-governance.js +1 -1
  51. package/dist/cli-bundle/sdk-graph.js +1 -1
  52. package/dist/cli-bundle/sdk-merge.js +1 -1
  53. package/dist/cli-bundle/sdk-query.js +1 -1
  54. package/dist/cli-bundle/sdk-runtime.js +1 -1
  55. package/dist/cli-bundle/sdk-testing.js +1 -1
  56. package/dist/cli-bundle/sdk.js +2 -2
  57. package/dist/core/extensions/reserved-host-flags.js +3 -2
  58. package/dist/core/history/drift-scan.js +13 -8
  59. package/dist/core/history/history.d.ts +8 -0
  60. package/dist/core/history/history.js +57 -7
  61. package/dist/core/history/replay.d.ts +9 -1
  62. package/dist/core/history/replay.js +48 -13
  63. package/dist/core/output/output.d.ts +2 -0
  64. package/dist/core/output/output.js +46 -14
  65. package/dist/core/shared/command-types.d.ts +2 -0
  66. package/dist/core/shared/command-types.js +2 -2
  67. package/dist/core/shared/errors.d.ts +5 -0
  68. package/dist/core/shared/errors.js +2 -2
  69. package/dist/core/store/item-metadata-cache.d.ts +1 -1
  70. package/dist/core/store/item-metadata-cache.js +14 -7
  71. package/dist/sdk/cli-bootstrap.d.ts +2 -0
  72. package/dist/sdk/cli-bootstrap.js +6 -2
  73. package/dist/sdk/cli-contracts/completeness.js +3 -2
  74. package/dist/sdk/cli-contracts/flag-contracts.js +5 -2
  75. package/dist/sdk/cli-contracts/registration-helpers.d.ts +20 -3
  76. package/dist/sdk/cli-contracts/registration-helpers.js +18 -12
  77. package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +8 -6
  78. package/dist/sdk/cli-contracts/schemas/assurance-definition.js +4 -3
  79. package/dist/sdk/cli-contracts/tool-option-contracts.js +3 -2
  80. package/dist/sdk/cli-contracts/tool-parameter-tables.js +22 -2
  81. package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
  82. package/dist/sdk/cli-contracts/tool-schema.js +7 -4
  83. package/dist/sdk/cli-program.js +3 -2
  84. package/dist/sdk/completion.js +16 -7
  85. package/dist/sdk/context-intent-contracts.js +45 -4
  86. package/dist/sdk/core.d.ts +1 -0
  87. package/dist/sdk/core.js +3 -2
  88. package/dist/sdk/generated/generated-error-code-catalog-part-1.d.ts +8 -0
  89. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1585 -0
  90. package/dist/sdk/generated/generated-error-code-catalog-part-2.d.ts +8 -0
  91. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1608 -0
  92. package/dist/sdk/generated-error-code-catalog.js +6 -3140
  93. package/dist/sdk/governance/assurance-action.js +9 -7
  94. package/dist/sdk/governance/assurance-mutation-error.d.ts +7 -0
  95. package/dist/sdk/governance/assurance-mutation-error.js +35 -0
  96. package/dist/sdk/governance/assurance-runtime.js +11 -8
  97. package/dist/sdk/governance/assurance.d.ts +12 -6
  98. package/dist/sdk/governance/assurance.js +181 -66
  99. package/dist/sdk/governance/health.d.ts +3 -1
  100. package/dist/sdk/governance/health.js +21 -4
  101. package/dist/sdk/governance/validate-item-reader.js +3 -3
  102. package/dist/sdk/governance/validate.d.ts +2 -0
  103. package/dist/sdk/governance/validate.js +13 -3
  104. package/dist/sdk/graph/durable-cache.d.ts +1 -1
  105. package/dist/sdk/graph/durable-cache.js +98 -29
  106. package/dist/sdk/graph/governance.d.ts +14 -0
  107. package/dist/sdk/graph/governance.js +34 -9
  108. package/dist/sdk/index.d.ts +1 -1
  109. package/dist/sdk/index.js +3 -3
  110. package/dist/sdk/lifecycle/claim.js +10 -3
  111. package/dist/sdk/merge/driver.d.ts +2 -2
  112. package/dist/sdk/merge/driver.js +3 -3
  113. package/dist/sdk/merge/receipts.d.ts +6 -4
  114. package/dist/sdk/merge/receipts.js +7 -5
  115. package/dist/sdk/merge/three-way.d.ts +2 -2
  116. package/dist/sdk/merge/three-way.js +3 -3
  117. package/dist/sdk/output-projection.d.ts +9 -1
  118. package/dist/sdk/output-projection.js +45 -9
  119. package/dist/sdk/query/activity.d.ts +49 -2
  120. package/dist/sdk/query/activity.js +183 -37
  121. package/dist/sdk/query/get.js +19 -2
  122. package/dist/sdk/read-output-contracts.d.ts +5 -1
  123. package/dist/sdk/read-output-contracts.js +17 -2
  124. package/dist/sdk/read-output-session.d.ts +2 -0
  125. package/dist/sdk/read-output-session.js +12 -5
  126. package/dist/sdk/runtime-primitives.d.ts +3 -3
  127. package/dist/sdk/runtime-primitives.js +5 -5
  128. package/dist/sdk/runtime-stats-options.js +3 -2
  129. package/dist/sdk/runtime.js +5 -9
  130. package/dist/sdk/stats.d.ts +36 -3
  131. package/dist/sdk/stats.js +55 -15
  132. package/dist/sdk/test/execution.d.ts +4 -0
  133. package/dist/sdk/test/execution.js +86 -21
  134. package/dist/types.d.ts +2 -0
  135. package/dist/types.js +2 -2
  136. package/docs/ASSURANCE.md +17 -12
  137. package/docs/COMMANDS.md +29 -8
  138. package/docs/CONFIGURATION.md +7 -0
  139. package/docs/DEPENDENCY_KIND_CONTRACT.md +10 -8
  140. package/docs/MERGE_SAFETY.md +3 -1
  141. package/docs/OUTPUT_PROJECTION_CONTRACTS.md +26 -13
  142. package/docs/README.md +2 -0
  143. package/docs/READ_OUTPUT_CONTRACTS.md +17 -2
  144. package/docs/SDK_AGENT_SESSION_CONTEXT.md +12 -1
  145. package/docs/SDK_CONTEXT_EVIDENCE_CONTRACTS.md +53 -0
  146. package/docs/SDK_CONTEXT_INTEGRITY.md +28 -1
  147. package/docs/TRUSTWORTHY_CONTEXT_EVIDENCE.md +106 -0
  148. package/docs/performance/sdk-entrypoint-import-costs.md +6 -2
  149. package/marketplace.json +2 -2
  150. package/package.json +5 -5
  151. package/packages/pm-beads/package.json +1 -1
  152. package/packages/pm-calendar/package.json +1 -1
  153. package/packages/pm-command-kit/package.json +1 -1
  154. package/packages/pm-digital-twin/package.json +1 -1
  155. package/packages/pm-governance-audit/package.json +1 -1
  156. package/packages/pm-guide-shell/package.json +1 -1
  157. package/packages/pm-kanban/package.json +1 -1
  158. package/packages/pm-lifecycle-hooks/package.json +1 -1
  159. package/packages/pm-linked-test-adapters/package.json +1 -1
  160. package/packages/pm-search-advanced/package.json +1 -1
  161. package/packages/pm-templates/package.json +1 -1
  162. package/packages/pm-todos/package.json +1 -1
  163. package/packages/pm-vcs/package.json +1 -1
  164. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  165. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  166. package/sdk/public-surface.json +203 -52
  167. package/dist/cli-bundle/chunks/chunk-2RA2YTHJ.js +0 -33
  168. package/dist/cli-bundle/chunks/chunk-DSKYD4LG.js +0 -13
  169. package/dist/cli-bundle/chunks/chunk-HC3GM6YY.js +0 -194
  170. package/dist/cli-bundle/chunks/chunk-W7CPZGSB.js +0 -2
  171. package/dist/cli-bundle/chunks/chunk-ZXOC6HG5.js +0 -5
  172. package/dist/cli-bundle/chunks/register-list-query-HAUXVUPY.js +0 -10
  173. package/dist/cli-bundle/chunks/register-mutation-7Y5U7ABT.js +0 -20
  174. package/dist/cli-bundle/chunks/register-operations-EQX3DLAZ.js +0 -2
  175. package/dist/cli-bundle/focused-chunks/chunk-3AYKXMYX.js +0 -2
  176. package/dist/cli-bundle/focused-chunks/chunk-4AHEC74N.js +0 -2
  177. package/dist/cli-bundle/focused-chunks/chunk-4SV3ZKG3.js +0 -16
  178. package/dist/cli-bundle/focused-chunks/chunk-6JW6Z2P5.js +0 -8
  179. package/dist/cli-bundle/focused-chunks/chunk-D4PIWE6D.js +0 -2
  180. package/dist/cli-bundle/focused-chunks/chunk-E3KCL7AY.js +0 -5
  181. package/dist/cli-bundle/focused-chunks/chunk-ERAAFLPS.js +0 -153
  182. package/dist/cli-bundle/focused-chunks/chunk-F6E4JZKG.js +0 -2
  183. package/dist/cli-bundle/focused-chunks/chunk-OJ3LVVIS.js +0 -2
  184. package/dist/cli-bundle/focused-chunks/chunk-VABB4L5Y.js +0 -17
@@ -4,7 +4,7 @@
4
4
  * Implements the pm activity 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]="a7efa5e0-5610-51ca-8288-4f5410dbcf51")}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]="27a71d4d-f496-5d0a-9771-caa43b81e1f7")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { getActiveExtensionRegistrations, runActiveOnReadHooks, pathExists, enforceHistoryStreamPolicyForItems, resolveItemTypeRegistry, EXIT_CODE, PmCliError, compareTimestampStrings, nowIso, resolveIsoOrRelative, listAllItemMetadataLight, getSettingsPath, resolvePmRoot, readSettings, } from "../runtime-primitives.js";
@@ -14,6 +14,27 @@ import { resolveModePairedOutputOmissionReceipt, } from "../output-projection.js
14
14
  import { compileHistoryProvenanceMatcher, projectHistoryProvenance, resolveHistoryProvenanceDimensions, summarizeHistoryProvenance, } from "../history-provenance.js";
15
15
  const DEFAULT_COMPACT_ACTIVITY_LIMIT = 20;
16
16
  const DEFAULT_FULL_ACTIVITY_LIMIT = 5;
17
+ const DEFAULT_DIGEST_ACTIVITY_LIMIT = 15;
18
+ const DEFAULT_DIGEST_WINDOW = "-24h";
19
+ /** Normalize raw and full aliases into one explicit activity row projection. */
20
+ export function normalizeActivityProjectionOptions(options) {
21
+ const normalized = { ...options };
22
+ if (normalized.full === true) {
23
+ normalized.raw = true;
24
+ normalized.compact = false;
25
+ }
26
+ else if (normalized.raw === true && normalized.compact === undefined) {
27
+ normalized.compact = true;
28
+ }
29
+ delete normalized.full;
30
+ return normalized;
31
+ }
32
+ const ACTIVITY_ROW_KEY_BY_MODE = {
33
+ digest: "activity_digest",
34
+ compact: "compact_activity",
35
+ provenance: "provenance_activity",
36
+ full: "activity",
37
+ };
17
38
  function parseNonEmptyFilter(raw, flagLabel) {
18
39
  if (raw === undefined)
19
40
  return undefined;
@@ -92,10 +113,36 @@ async function listHistoryFiles(historyDir) {
92
113
  throw error;
93
114
  }
94
115
  }
95
- function resolveActivityFilters(options) {
116
+ function resolveActivityProjectionMode(options) {
117
+ if (options.raw !== true &&
118
+ options.compact !== true &&
119
+ options.provenance !== true) {
120
+ return "digest";
121
+ }
122
+ if (options.provenance === true)
123
+ return "provenance";
124
+ if (options.compact === true ||
125
+ (options.raw === true && options.compact !== false)) {
126
+ return "compact";
127
+ }
128
+ return "full";
129
+ }
130
+ function resolveActivityLimit(options, explicitLimit, projectionMode) {
131
+ if (options.unbounded === true)
132
+ return undefined;
133
+ if (explicitLimit !== undefined)
134
+ return explicitLimit;
135
+ if (projectionMode === "digest")
136
+ return DEFAULT_DIGEST_ACTIVITY_LIMIT;
137
+ if (projectionMode === "compact")
138
+ return DEFAULT_COMPACT_ACTIVITY_LIMIT;
139
+ return DEFAULT_FULL_ACTIVITY_LIMIT;
140
+ }
141
+ function resolveActivityFilters(options, projectionMode) {
96
142
  const nowValue = nowIso();
97
- const from = parseRangeBound(options.from, nowValue, "--from");
98
- const to = parseRangeBound(options.to, nowValue, "--to");
143
+ const digest = projectionMode === "digest";
144
+ const to = parseRangeBound(options.to ?? (digest ? nowValue : undefined), nowValue, "--to");
145
+ const from = parseRangeBound(options.from ?? (digest ? DEFAULT_DIGEST_WINDOW : undefined), options.from === undefined && digest ? to : nowValue, "--from");
99
146
  if (from && to && compareTimestampStrings(from, to) >= 0) {
100
147
  throw new PmCliError("Activity --from must be before --to", EXIT_CODE.USAGE);
101
148
  }
@@ -109,12 +156,7 @@ function resolveActivityFilters(options) {
109
156
  author: parseNonEmptyFilter(options.author, "Activity --author"),
110
157
  from,
111
158
  to,
112
- limit: options.unbounded === true
113
- ? undefined
114
- : (explicitLimit ??
115
- (options.compact === true
116
- ? DEFAULT_COMPACT_ACTIVITY_LIMIT
117
- : DEFAULT_FULL_ACTIVITY_LIMIT)),
159
+ limit: resolveActivityLimit(options, explicitLimit, projectionMode),
118
160
  limitSource: options.unbounded === true || explicitLimit !== undefined
119
161
  ? "explicit"
120
162
  : "default",
@@ -147,7 +189,13 @@ async function prepareActivityHistoryRead(context) {
147
189
  path: historyDir,
148
190
  scope: "project",
149
191
  });
150
- return historyDir;
192
+ return {
193
+ historyDir,
194
+ itemsById: new Map(items.map((item) => [
195
+ item.id,
196
+ { title: item.title, type: item.type, status: item.status },
197
+ ])),
198
+ };
151
199
  }
152
200
  function includeActivityEntry(entry, candidate, filters) {
153
201
  // Preserve legacy filter semantics: op/author filters compare the raw
@@ -186,6 +234,105 @@ function formatCompactActivity(activity) {
186
234
  ...(entry.message ? { msg: entry.message } : {}),
187
235
  }));
188
236
  }
237
+ function boundedOperationSummary(counts) {
238
+ const ordered = [...counts.entries()].sort(([leftOp, leftCount], [rightOp, rightCount]) => rightCount - leftCount || leftOp.localeCompare(rightOp));
239
+ const visible = ordered.slice(0, 4).map(([op, count]) => `${op}:${count}`);
240
+ if (ordered.length > visible.length) {
241
+ visible.push(`+${ordered.length - visible.length}`);
242
+ }
243
+ return visible.join(",");
244
+ }
245
+ function buildActivityDigest(activity, itemsById) {
246
+ const grouped = new Map();
247
+ for (const entry of activity) {
248
+ const current = grouped.get(entry.id);
249
+ if (current === undefined) {
250
+ grouped.set(entry.id, {
251
+ firstTs: entry.ts,
252
+ lastTs: entry.ts,
253
+ eventCount: 1,
254
+ operations: new Map([[entry.op, 1]]),
255
+ });
256
+ continue;
257
+ }
258
+ current.eventCount += 1;
259
+ if (compareTimestampStrings(entry.ts, current.firstTs) < 0) {
260
+ current.firstTs = entry.ts;
261
+ }
262
+ if (compareTimestampStrings(entry.ts, current.lastTs) > 0) {
263
+ current.lastTs = entry.ts;
264
+ }
265
+ current.operations.set(entry.op, (current.operations.get(entry.op) ?? 0) + 1);
266
+ }
267
+ return [...grouped.entries()]
268
+ .map(([id, summary]) => {
269
+ const item = itemsById.get(id);
270
+ return {
271
+ id,
272
+ type: item?.type ?? "unknown",
273
+ status: item?.status ?? "unknown",
274
+ title: (item?.title ?? "(item metadata unavailable)").slice(0, 160),
275
+ event_count: summary.eventCount,
276
+ first_ts: summary.firstTs,
277
+ last_ts: summary.lastTs,
278
+ operations: boundedOperationSummary(summary.operations),
279
+ };
280
+ })
281
+ .sort((left, right) => compareTimestampStrings(right.last_ts, left.last_ts) ||
282
+ left.id.localeCompare(right.id));
283
+ }
284
+ function activityOperationCounts(activity) {
285
+ const counts = new Map();
286
+ for (const entry of activity) {
287
+ counts.set(entry.op, (counts.get(entry.op) ?? 0) + 1);
288
+ }
289
+ const ordered = [...counts.entries()].sort((left, right) => right[1] - left[1] || left[0].localeCompare(right[0]));
290
+ const visible = ordered.slice(0, 8);
291
+ if (visible.length < ordered.length) {
292
+ visible.push([
293
+ `+${String(ordered.length - visible.length)}`,
294
+ ordered
295
+ .slice(visible.length)
296
+ .reduce((total, [, count]) => total + count, 0),
297
+ ]);
298
+ }
299
+ return Object.fromEntries(visible);
300
+ }
301
+ function projectActivityRows(projectionMode, matchingActivity, limit, itemsById, projectProvenance) {
302
+ if (projectionMode === "digest") {
303
+ const matchingDigest = buildActivityDigest(matchingActivity, itemsById);
304
+ const activityDigest = limitEntries(matchingDigest, limit);
305
+ return {
306
+ rows: { activity_digest: activityDigest },
307
+ compact: false,
308
+ totalRows: matchingDigest.length,
309
+ returnedRows: activityDigest.length,
310
+ };
311
+ }
312
+ const activity = limitEntries(matchingActivity, limit);
313
+ if (projectionMode === "compact") {
314
+ return {
315
+ rows: { compact_activity: formatCompactActivity(activity) },
316
+ compact: true,
317
+ totalRows: matchingActivity.length,
318
+ returnedRows: activity.length,
319
+ };
320
+ }
321
+ if (projectionMode === "provenance") {
322
+ return {
323
+ rows: { provenance_activity: activity.map(projectProvenance) },
324
+ compact: false,
325
+ totalRows: matchingActivity.length,
326
+ returnedRows: activity.length,
327
+ };
328
+ }
329
+ return {
330
+ rows: { activity },
331
+ compact: false,
332
+ totalRows: matchingActivity.length,
333
+ returnedRows: activity.length,
334
+ };
335
+ }
189
336
  /** Public contract for test only, shared by SDK and presentation-layer consumers. */
190
337
  export const _testOnly = {
191
338
  parseNonEmptyFilter,
@@ -196,12 +343,15 @@ export const _testOnly = {
196
343
  normalizeActivityEntry,
197
344
  sortActivity,
198
345
  listHistoryFiles,
346
+ buildActivityDigest,
347
+ activityOperationCounts,
199
348
  };
200
349
  /** Implements run activity for the public runtime surface of this module. */
201
350
  export async function runActivity(options, global) {
202
351
  const context = await resolveActivityRuntimeContext(global);
203
- const filters = resolveActivityFilters(options);
204
- const historyDir = await prepareActivityHistoryRead(context);
352
+ const projectionMode = resolveActivityProjectionMode(options);
353
+ const filters = resolveActivityFilters(options, projectionMode);
354
+ const prepared = await prepareActivityHistoryRead(context);
205
355
  const provenanceDimensions = resolveHistoryProvenanceDimensions(context.settings.agent_identity.harness_signals);
206
356
  const vocabulary = context.settings.agent_identity.identity_vocabulary;
207
357
  const matchesProvenance = compileHistoryProvenanceMatcher({
@@ -209,37 +359,33 @@ export async function runActivity(options, global) {
209
359
  agentInstance: filters.agentInstance,
210
360
  provenance: filters.provenance,
211
361
  }, vocabulary, provenanceDimensions);
212
- const matchingActivity = sortActivity(await collectActivityEntries(historyDir, filters)).filter(matchesProvenance);
213
- const activity = limitEntries(matchingActivity, filters.limit);
214
- const compact = options.compact === true;
215
- const compactActivity = compact ? formatCompactActivity(activity) : undefined;
216
- const provenanceActivity = options.provenance === true
217
- ? activity.map((entry) => projectHistoryProvenance(entry, vocabulary, { itemId: entry.id }))
218
- : undefined;
219
- const omittedCount = matchingActivity.length - activity.length;
220
- const projectionMode = options.provenance === true ? "provenance" : compact ? "compact" : "full";
221
- const rowProjection = {
222
- compact: { compact_activity: compactActivity },
223
- provenance: { provenance_activity: provenanceActivity },
224
- full: { activity },
225
- }[projectionMode];
362
+ const matchingActivity = sortActivity(await collectActivityEntries(prepared.historyDir, filters)).filter(matchesProvenance);
363
+ const projected = projectActivityRows(projectionMode, matchingActivity, filters.limit, prepared.itemsById, (entry) => projectHistoryProvenance(entry, vocabulary, { itemId: entry.id }));
364
+ const omittedCount = projected.totalRows - projected.returnedRows;
226
365
  return {
227
- ...rowProjection,
228
- compact,
366
+ ...projected.rows,
367
+ compact: projected.compact,
229
368
  projection: {
230
369
  mode: projectionMode,
231
- row_key: projectionMode === "compact"
232
- ? "compact_activity"
233
- : projectionMode === "provenance"
234
- ? "provenance_activity"
235
- : "activity",
370
+ row_key: ACTIVITY_ROW_KEY_BY_MODE[projectionMode],
236
371
  },
237
372
  omission_receipt: resolveModePairedOutputOmissionReceipt("activity", projectionMode),
238
- count: activity.length,
239
- total_count: matchingActivity.length,
373
+ count: projected.returnedRows,
374
+ total_count: projected.totalRows,
240
375
  limit: filters.limit ?? null,
241
376
  omitted_count: omittedCount,
242
377
  has_more: omittedCount > 0,
378
+ ...(projectionMode === "digest"
379
+ ? {
380
+ activity_summary: {
381
+ window: { from: filters.from, to: filters.to },
382
+ event_count: matchingActivity.length,
383
+ item_count: projected.totalRows,
384
+ author_count: new Set(matchingActivity.map((entry) => entry.author)).size,
385
+ operation_counts: activityOperationCounts(matchingActivity),
386
+ },
387
+ }
388
+ : {}),
243
389
  ...(options.provenanceSummary === true
244
390
  ? {
245
391
  provenance_summary: summarizeHistoryProvenance(matchingActivity, vocabulary, provenanceDimensions),
@@ -253,4 +399,4 @@ export async function runActivity(options, global) {
253
399
  };
254
400
  }
255
401
  //# sourceMappingURL=activity.js.map
256
- //# debugId=a7efa5e0-5610-51ca-8288-4f5410dbcf51
402
+ //# debugId=27a71d4d-f496-5d0a-9771-caa43b81e1f7
@@ -4,7 +4,7 @@
4
4
  * Implements the SDK-owned item query shared by every surface.
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]="f68f4074-51ba-5065-8cca-fe16acd48927")}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]="89176e36-40ea-5ec2-b291-d1cf042c4140")}catch(e){}}();
8
8
  import { pathExists, getActiveExtensionRegistrations, toItemRecord, resolveItemTypeRegistry, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, EXIT_CODE, ITEM_METADATA_KEY_ORDER, TYPE_TO_FOLDER, PmCliError, buildItemNotFoundError, listAllItemMetadataLight, locateItem, readLocatedItem, getHistoryPath, getSettingsPath, resolvePmRoot, readSettings, resolveAuthor, } from "../runtime-primitives.js";
9
9
  import { readHistoryEntries } from "../history-read.js";
10
10
  import { recordContextUsageTouches } from "../context-usage.js";
@@ -13,6 +13,7 @@ import { buildItemSchedule, } from "../item-schedule.js";
13
13
  import { getItemAt } from "../history-read.js";
14
14
  import { parseIntegerLimit } from "./parsers.js";
15
15
  import { runList } from "./list.js";
16
+ import { registerOutputMaterialFieldGroups } from "../output-projection.js";
16
17
  const GET_DEPTH_VALUES = ["brief", "standard", "deep"];
17
18
  const AUTOMATIC_CHILD_ROLLUP_TYPES = new Set([
18
19
  "epic",
@@ -38,6 +39,21 @@ function itemCollectionCounts(item) {
38
39
  ]));
39
40
  return lengths;
40
41
  }
42
+ function itemMaterialFieldGroups(item, body) {
43
+ const collectionCounts = itemCollectionCounts(item);
44
+ return [
45
+ ...(body.length > 0 ? ["body"] : []),
46
+ ...Object.entries(collectionCounts).flatMap(([name, count]) => count > 0 ? [name] : []),
47
+ ...(collectionCounts.files + collectionCounts.tests + collectionCounts.docs > 0
48
+ ? ["linked"]
49
+ : []),
50
+ "children",
51
+ ...(typeof item.assignee === "string" && item.assignee.trim().length > 0
52
+ ? ["claim_state"]
53
+ : []),
54
+ ...(buildItemSchedule(item) ? ["schedule"] : []),
55
+ ];
56
+ }
41
57
  /** Decide whether a normal read should pay for a workspace-wide child projection. */
42
58
  function shouldAutoIncludeGetChildren(itemType) {
43
59
  const normalizedType = itemType.trim().toLowerCase();
@@ -414,6 +430,7 @@ export async function runGet(id, global, options = {}) {
414
430
  // Derived usage feedback must never make the source-of-truth read fail.
415
431
  }
416
432
  }
433
+ registerOutputMaterialFieldGroups(result, itemMaterialFieldGroups(context.metadata, context.body));
417
434
  return result;
418
435
  }
419
436
  /** Public contract for test-only get command policy helpers. */
@@ -421,4 +438,4 @@ export const _testOnlyGetCommand = {
421
438
  shouldAutoIncludeGetChildren,
422
439
  };
423
440
  //# sourceMappingURL=get.js.map
424
- //# debugId=f68f4074-51ba-5065-8cca-fe16acd48927
441
+ //# debugId=89176e36-40ea-5ec2-b291-d1cf042c4140
@@ -19,6 +19,8 @@ export interface PmReadOutputOptions {
19
19
  outputFormat?: "json" | "toon";
20
20
  /** Caller-carried cross-call budget and served-fact state. */
21
21
  outputSession?: string | PmReadOutputSessionState;
22
+ /** Include row selector and encoding discovery metadata. */
23
+ outputRowContract?: boolean;
22
24
  }
23
25
  /** Compatibility spelling retained for a command-specific output control. */
24
26
  export interface PmReadOutputLegacyAlias {
@@ -130,7 +132,7 @@ export type PmReadOutputResultFor<Result, Options> = "outputBudget" extends keyo
130
132
  /** Canonical CLI flags that opt a read invocation into universal output shaping. */
131
133
  export declare const PM_READ_OUTPUT_OPTION_FLAGS: readonly string[];
132
134
  /** Canonical control that composes the four per-call dimensions across reads. */
133
- export declare const PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS: readonly ["--output-session"];
135
+ export declare const PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS: readonly ["--output-session", "--output-row-contract"];
134
136
  /** Universal output contract for every built-in read surface. */
135
137
  export declare const PM_READ_OUTPUT_SURFACE_CONTRACTS: readonly PmReadOutputSurfaceContract[];
136
138
  /** Resolve a command or list/context alias to its canonical read-output surface. */
@@ -139,6 +141,8 @@ export declare function resolveReadOutputSurface(command: string): PmReadOutputS
139
141
  export declare function validateReadOutputOptions(command: string, options: Record<string, unknown>): void;
140
142
  /** Resolve canonical and compatibility controls into the universal dimension set. */
141
143
  export declare function resolveReadOutputDimensions(command: string, options: Record<string, unknown>): PmResolvedReadOutputDimensions | undefined;
144
+ /** Recompute read and optional session receipts after a final envelope projection. */
145
+ export declare function stabilizeReadOutputReceiptEstimates(result: Record<string, unknown>, options: Record<string, unknown>): Record<string, unknown>;
142
146
  /** Apply universal field, row, and token bounds and attach an exact receipt. */
143
147
  export declare function applyReadOutputDimensions<Result extends Record<string, unknown>>(command: string, options: Record<string, unknown>, result: Result): PmReadOutputResult<Result>;
144
148
  /** Narrow a universal read result to its budget-omission branch. */
@@ -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]="819ac44d-0add-581c-90e8-ac6e8247b04b")}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]="0ab0c72c-cac0-5670-93d1-7a446f8a2301")}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, updateReadOutputReceiptEstimate, } from "./read-output-budget.js";
@@ -58,6 +58,7 @@ export const PM_READ_OUTPUT_OPTION_FLAGS = Object.freeze(PM_READ_OUTPUT_DIMENSIO
58
58
  /** Canonical control that composes the four per-call dimensions across reads. */
59
59
  export const PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS = Object.freeze([
60
60
  "--output-session",
61
+ "--output-row-contract",
61
62
  ]);
62
63
  const LEGACY_FLAGS_BY_COMMAND = {
63
64
  list: {
@@ -216,6 +217,8 @@ const CANONICAL_OPTION_KEYS = [
216
217
  "output_format",
217
218
  "outputSession",
218
219
  "output_session",
220
+ "outputRowContract",
221
+ "output_row_contract",
219
222
  ];
220
223
  const HYBRID_READ_MUTATION_KEYS = {
221
224
  comments: ["add", "body", "stdin", "file", "edit", "delete"],
@@ -580,6 +583,18 @@ function attachReadOutputSessionContracts(result, state, receipt) {
580
583
  }
581
584
  return withSession;
582
585
  }
586
+ /** Recompute read and optional session receipts after a final envelope projection. */
587
+ export function stabilizeReadOutputReceiptEstimates(result, options) {
588
+ if (!isRecord(result.read_output))
589
+ return result;
590
+ const receipt = result.read_output;
591
+ const session = parseReadOutputSession(options.outputSession ?? options.output_session);
592
+ if (session === undefined) {
593
+ updateReadOutputReceiptEstimate(result, receipt);
594
+ return result;
595
+ }
596
+ return attachReadOutputSessionContracts(result, session, receipt);
597
+ }
583
598
  /** Apply field, amount, and repeat projections to every declared row path. */
584
599
  function projectReadOutputRows(result, resolved, session) {
585
600
  let projected = { ...result };
@@ -695,4 +710,4 @@ export function resolveReadOutputEncoding(command, options) {
695
710
  : undefined;
696
711
  }
697
712
  //# sourceMappingURL=read-output-contracts.js.map
698
- //# debugId=819ac44d-0add-581c-90e8-ac6e8247b04b
713
+ //# debugId=0ab0c72c-cac0-5670-93d1-7a446f8a2301
@@ -46,6 +46,8 @@ export interface PmReadOutputSessionReceipt {
46
46
  seen_before_count: number;
47
47
  /** Number of newly delivered item facts retained in this envelope. */
48
48
  new_item_count: number;
49
+ /** Newly delivered identities omitted from next_state after its capacity filled. */
50
+ seen_item_overflow_count?: number;
49
51
  /** Number of repeated item rows replaced by references. */
50
52
  suppressed_repeat_count: number;
51
53
  /** Stable reference syntax used by suppressed rows. */
@@ -5,7 +5,7 @@
5
5
  * budgets and resolvable references to item facts served by earlier reads.
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]="04ad0d11-1fb7-5eb4-8ff0-d81a7090c4ff")}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]="642f6dec-c0b2-5377-a401-dfa4f8ef6a2a")}catch(e){}}();
9
9
  import { EXIT_CODE } from "../core/shared/constants.js";
10
10
  import { PmCliError } from "../core/shared/errors.js";
11
11
  import { mapReadOutputRows, readOutputRowCollections, } from "./read-output-rows.js";
@@ -141,9 +141,13 @@ export function applyReadOutputSessionReferences(result, state) {
141
141
  /** Attach a fixed-point session receipt and return the exact charged tokens. */
142
142
  export function attachReadOutputSessionReceipt(result, state) {
143
143
  const { deliveredIds, suppressedRepeatCount } = summarizeReadOutputSessionRows(result);
144
- const nextSeen = [
145
- ...new Set([...state.seen_item_ids, ...deliveredIds]),
146
- ].sort();
144
+ const alreadySeen = new Set(state.seen_item_ids);
145
+ const newlySeen = [...deliveredIds]
146
+ .filter((id) => !alreadySeen.has(id))
147
+ .sort();
148
+ const retainedNewIds = newlySeen.slice(0, PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS - state.seen_item_ids.length);
149
+ const nextSeen = [...state.seen_item_ids, ...retainedNewIds].sort();
150
+ const seenItemOverflowCount = newlySeen.length - retainedNewIds.length;
147
151
  const receipt = {
148
152
  contract_version: 1,
149
153
  id: state.id,
@@ -158,6 +162,9 @@ export function attachReadOutputSessionReceipt(result, state) {
158
162
  exhausted: false,
159
163
  seen_before_count: state.seen_item_ids.length,
160
164
  new_item_count: deliveredIds.size,
165
+ ...(seenItemOverflowCount === 0
166
+ ? {}
167
+ : { seen_item_overflow_count: seenItemOverflowCount }),
161
168
  suppressed_repeat_count: suppressedRepeatCount,
162
169
  reference_format: "session:<session-id>:<item-id>",
163
170
  restore_reference_with: "pm get <item-id> --brief",
@@ -197,4 +204,4 @@ export function readOutputSessionRemainingTokens(state) {
197
204
  return Math.max(0, state.token_budget - state.spent_tokens);
198
205
  }
199
206
  //# sourceMappingURL=read-output-session.js.map
200
- //# debugId=04ad0d11-1fb7-5eb4-8ff0-d81a7090c4ff
207
+ //# debugId=642f6dec-c0b2-5377-a401-dfa4f8ef6a2a
@@ -16,10 +16,10 @@ export { resolveRegisteredSearchProvider, resolveRegisteredVectorStoreAdapter, }
16
16
  export { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic, } from "../core/fs/fs-utils.js";
17
17
  export { type HistoryDiffValueEntry, computeHistoryDiff, patchPathToChangedField, } from "../core/history/history-diff.js";
18
18
  export { enforceHistoryStreamPolicyForItem, enforceHistoryStreamPolicyForItems, } from "../core/history/history-stream-policy.js";
19
- export { appendHistoryEntry, createHistoryEntry, hashDocument, hashEmptyDocument, } from "../core/history/history.js";
19
+ export { appendHistoryEntry, CURRENT_HISTORY_ITEM_HASH_VERSION, createHistoryEntry, hashDocument, hashDocumentForVersion, hashEmptyDocument, SUPPORTED_HISTORY_ITEM_HASH_VERSIONS, type HistoryItemHashVersion, } from "../core/history/history.js";
20
20
  export { readHistoryEntries } from "../core/history/read.js";
21
21
  export { appendWorkspaceAuditEvent, appendWorkspaceHistoryChange, getWorkspaceHistoryPath, mutateWorkspaceJsonWithHistory, WORKSPACE_HISTORY_ID, writeWorkspaceJsonWithHistory, type WorkspaceAuditEventOptions, type WorkspaceHistoryChange, type WorkspaceJsonMutation, type WorkspaceJsonMutationOptions, type WorkspaceJsonWriteOptions, } from "../core/history/workspace-history.js";
22
- export { normalizeReplayPatchOps, replayToCanonicalItemDocument, replayToItemDocument, toReplayDocument, verifyHistoryChain, } from "../core/history/replay.js";
22
+ export { normalizeReplayPatchOps, replayToCanonicalItemDocument, replayToItemDocument, toReplayDocument, verifyHistoryChain, verifyHistoryChainWithVersion, } from "../core/history/replay.js";
23
23
  export { resolveBodyFileContent } from "../core/io/body-file.js";
24
24
  export { generateItemId, normalizeItemId, normalizeRawItemId, } from "../core/item/id.js";
25
25
  export { canonicalDocument, normalizeItemMetadata, parseItemDocument, serializeItemDocument, } from "../core/item/item-format.js";
@@ -72,7 +72,7 @@ export { splitCommaList } from "../core/shared/split-comma-list.js";
72
72
  export { compareTimestampStrings, nowIso, resolveIsoOrRelative, } from "../core/shared/time.js";
73
73
  export { migrateItemFilesToFormat } from "../core/store/item-format-migration.js";
74
74
  export { type CachedDocumentCandidate, listAllDocumentCandidatesCached, } from "../core/store/item-metadata-cache.js";
75
- export { buildItemNotFoundError, createMutationGuardSdk, deleteItem, listAllItemMetadataLight, locateItem, mutateItem, readLocatedItem, } from "../core/store/item-store.js";
75
+ export { buildItemNotFoundError, createMutationGuardSdk, deleteItem, listAllItemMetadata, listAllItemMetadataLight, locateItem, mutateItem, readLocatedItem, } from "../core/store/item-store.js";
76
76
  export { isTerminalPlanMode, shouldCompletePlanOnClose, } from "../core/item/plan-lifecycle.js";
77
77
  export { getHistoryPath, getItemPath, getSettingsPath, resolveImplicitPmRoot, resolvePmRoot, } from "../core/store/paths.js";
78
78
  export { persistSelectedItemFormat, readSettings, readSettingsWithMetadata, writeSettings, } from "../core/store/settings.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]="16d4bbae-03b7-5316-8e26-77f33affdcf6")}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]="78779372-1987-54d0-9ae4-775b52641a26")}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";
@@ -18,10 +18,10 @@ export { resolveRegisteredSearchProvider, resolveRegisteredVectorStoreAdapter, }
18
18
  export { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic, } from "../core/fs/fs-utils.js";
19
19
  export { computeHistoryDiff, patchPathToChangedField, } from "../core/history/history-diff.js";
20
20
  export { enforceHistoryStreamPolicyForItem, enforceHistoryStreamPolicyForItems, } from "../core/history/history-stream-policy.js";
21
- export { appendHistoryEntry, createHistoryEntry, hashDocument, hashEmptyDocument, } from "../core/history/history.js";
21
+ export { appendHistoryEntry, CURRENT_HISTORY_ITEM_HASH_VERSION, createHistoryEntry, hashDocument, hashDocumentForVersion, hashEmptyDocument, SUPPORTED_HISTORY_ITEM_HASH_VERSIONS, } from "../core/history/history.js";
22
22
  export { readHistoryEntries } from "../core/history/read.js";
23
23
  export { appendWorkspaceAuditEvent, appendWorkspaceHistoryChange, getWorkspaceHistoryPath, mutateWorkspaceJsonWithHistory, WORKSPACE_HISTORY_ID, writeWorkspaceJsonWithHistory, } from "../core/history/workspace-history.js";
24
- export { normalizeReplayPatchOps, replayToCanonicalItemDocument, replayToItemDocument, toReplayDocument, verifyHistoryChain, } from "../core/history/replay.js";
24
+ export { normalizeReplayPatchOps, replayToCanonicalItemDocument, replayToItemDocument, toReplayDocument, verifyHistoryChain, verifyHistoryChainWithVersion, } from "../core/history/replay.js";
25
25
  export { resolveBodyFileContent } from "../core/io/body-file.js";
26
26
  export { generateItemId, normalizeItemId, normalizeRawItemId, } from "../core/item/id.js";
27
27
  export { canonicalDocument, normalizeItemMetadata, parseItemDocument, serializeItemDocument, } from "../core/item/item-format.js";
@@ -73,7 +73,7 @@ export { splitCommaList } from "../core/shared/split-comma-list.js";
73
73
  export { compareTimestampStrings, nowIso, resolveIsoOrRelative, } from "../core/shared/time.js";
74
74
  export { migrateItemFilesToFormat } from "../core/store/item-format-migration.js";
75
75
  export { listAllDocumentCandidatesCached, } from "../core/store/item-metadata-cache.js";
76
- export { buildItemNotFoundError, createMutationGuardSdk, deleteItem, listAllItemMetadataLight, locateItem, mutateItem, readLocatedItem, } from "../core/store/item-store.js";
76
+ export { buildItemNotFoundError, createMutationGuardSdk, deleteItem, listAllItemMetadata, listAllItemMetadataLight, locateItem, mutateItem, readLocatedItem, } from "../core/store/item-store.js";
77
77
  export { isTerminalPlanMode, shouldCompletePlanOnClose, } from "../core/item/plan-lifecycle.js";
78
78
  export { getHistoryPath, getItemPath, getSettingsPath, resolveImplicitPmRoot, resolvePmRoot, } from "../core/store/paths.js";
79
79
  export { persistSelectedItemFormat, readSettings, readSettingsWithMetadata, writeSettings, } from "../core/store/settings.js";
@@ -81,4 +81,4 @@ export { maybeRunFirstUseTelemetryPrompt } from "../core/telemetry/consent.js";
81
81
  export { deriveTelemetryCommandResolution, } from "../core/telemetry/observability.js";
82
82
  export { emitTelemetryErrorEvent, finishTelemetryCommand, startTelemetryCommand, } from "../core/telemetry/runtime.js";
83
83
  //# sourceMappingURL=runtime-primitives.js.map
84
- //# debugId=16d4bbae-03b7-5316-8e26-77f33affdcf6
84
+ //# debugId=78779372-1987-54d0-9ae4-775b52641a26
@@ -1,9 +1,10 @@
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]="dbabff08-1bb7-539b-b1c1-c10584aa0a67")}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]="0e63298a-d2d7-5217-af50-a206348b4cd4")}catch(e){}}();
3
3
  import { readRuntimeString, readRuntimeStringArray } from "./runtime-input.js";
4
4
  /** Convert a flat runtime option bag into the canonical typed stats payload. */
5
5
  export function statsCommandOptionsFromRuntime(options) {
6
6
  return {
7
+ includeEmpty: options.includeEmpty === true,
7
8
  storage: options.storage === true,
8
9
  metadataCoverage: options.metadataCoverage === true,
9
10
  fieldUtilization: options.fieldUtilization === true,
@@ -35,4 +36,4 @@ export function statsCommandOptionsFromRuntime(options) {
35
36
  };
36
37
  }
37
38
  //# sourceMappingURL=runtime-stats-options.js.map
38
- //# debugId=dbabff08-1bb7-539b-b1c1-c10584aa0a67
39
+ //# debugId=0e63298a-d2d7-5217-af50-a206348b4cd4
@@ -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]="a294f940-5bb9-55a4-bf2c-64842a3a177b")}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]="7c27b516-1714-5f2b-8304-98e8372280be")}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
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -33,7 +33,7 @@ import { applyContextIntentProjection, attachReadOutputContracts, } from "./cont
33
33
  import { runWithDiscoveredContextIntentContracts, } from "./context-intent-runtime.js";
34
34
  import { validateReadOutputOptions, } from "./read-output-contracts.js";
35
35
  export { clearWorkspaceContractsCache } from "./workspace-contracts-cache.js";
36
- import { runActivity } from "./query/activity.js";
36
+ import { normalizeActivityProjectionOptions, runActivity, } from "./query/activity.js";
37
37
  import { runAssuranceDispatch } from "./governance/assurance-action.js";
38
38
  import { runAggregate, } from "./query/aggregate.js";
39
39
  import { runAppend } from "./lifecycle/append.js";
@@ -1456,12 +1456,8 @@ function runMcpConfigAction(ctx) {
1456
1456
  "project", configAction, readString(ctx.args, "key") ?? readString(ctx.options, "key"), ctx.options, ctx.global, readString(ctx.args, "value") ?? readString(ctx.options, "value"));
1457
1457
  }
1458
1458
  function runMcpActivityAction(ctx) {
1459
- const activityOptions = { ...ctx.options };
1460
- if (activityOptions.compact === undefined) {
1461
- activityOptions.compact = activityOptions.full === true ? false : true;
1462
- }
1463
- delete activityOptions.full;
1464
- return runActivity(activityOptions, ctx.global);
1459
+ const options = ctx.options;
1460
+ return runActivity(normalizeActivityProjectionOptions(options), ctx.global);
1465
1461
  }
1466
1462
  function parseMcpIntegerPrefix(value, label) {
1467
1463
  if (typeof value === "number") {
@@ -1934,4 +1930,4 @@ async function loadWorkspaceExtensionRegistrations(pmRoot, settings, cwd) {
1934
1930
  }
1935
1931
  }
1936
1932
  //# sourceMappingURL=runtime.js.map
1937
- //# debugId=a294f940-5bb9-55a4-bf2c-64842a3a177b
1933
+ //# debugId=7c27b516-1714-5f2b-8304-98e8372280be