@unbrained/pm-cli 2026.8.12 → 2026.8.14

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 (218) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +162 -111
  3. package/dist/cli/error-guidance.js +4 -8
  4. package/dist/cli/main.js +40 -3
  5. package/dist/cli/register-assurance.js +28 -17
  6. package/dist/cli-bundle/bundle-manifest.json +141 -173
  7. package/dist/cli-bundle/chunks/chunk-BBOFSVAK.js +197 -0
  8. package/dist/cli-bundle/chunks/chunk-BFALV3YP.js +5 -0
  9. package/dist/cli-bundle/chunks/{chunk-WLAHPSOX.js → chunk-FIW4P64F.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-BM5YJ2UW.js → chunk-G5JUB66K.js} +52 -52
  11. package/dist/cli-bundle/chunks/chunk-SBRKH6OR.js +2 -0
  12. package/dist/cli-bundle/chunks/chunk-TMJ7URWS.js +13 -0
  13. package/dist/cli-bundle/chunks/chunk-TXMEUUUY.js +8 -0
  14. package/dist/cli-bundle/chunks/{chunk-KOQMGCTA.js → chunk-XAVMOK6B.js} +50 -50
  15. package/dist/cli-bundle/chunks/chunk-YAMTJL6Y.js +34 -0
  16. package/dist/cli-bundle/chunks/chunk-YSVSMJ2B.js +2 -0
  17. package/dist/cli-bundle/chunks/{register-list-query-XPCJRUUD.js → register-list-query-T3EHHNNV.js} +2 -2
  18. package/dist/cli-bundle/chunks/{register-mutation-4RJCBKRS.js → register-mutation-E27WCLSZ.js} +2 -2
  19. package/dist/cli-bundle/chunks/register-operations-4R6I7CPY.js +2 -0
  20. package/dist/cli-bundle/chunks/{register-setup-LLHAKP2V.js → register-setup-3YXZ444E.js} +2 -2
  21. package/dist/cli-bundle/focused-chunks/{chunk-JAFRIWVF.js → chunk-4DQ2YERC.js} +4 -4
  22. package/dist/cli-bundle/focused-chunks/chunk-F43TT2QQ.js +8 -0
  23. package/dist/cli-bundle/focused-chunks/chunk-K7RWWOAG.js +4 -0
  24. package/dist/cli-bundle/focused-chunks/chunk-KFSZ3BP6.js +16 -0
  25. package/dist/cli-bundle/focused-chunks/{chunk-KHM2CS2C.js → chunk-KSEDUWVZ.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/chunk-KYUQGTSB.js +2 -0
  27. package/dist/cli-bundle/focused-chunks/{chunk-ZMGWAYH7.js → chunk-LZ4MV3RH.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/chunk-PGXJQLCT.js +155 -0
  29. package/dist/cli-bundle/focused-chunks/{chunk-RWPAWUOT.js → chunk-PPFGQDSI.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/chunk-Q4YY3XNF.js +2 -0
  31. package/dist/cli-bundle/focused-chunks/chunk-QK753U3U.js +46 -0
  32. package/dist/cli-bundle/focused-chunks/chunk-QUMB2J27.js +2 -0
  33. package/dist/cli-bundle/focused-chunks/chunk-SM7MTG27.js +2 -0
  34. package/dist/cli-bundle/focused-chunks/{chunk-GQW4BPUT.js → chunk-WCVE2NIG.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/chunk-XDNAW5OI.js +18 -0
  36. package/dist/cli-bundle/focused-chunks/{chunk-YIAXMC3T.js → chunk-YOOI3UZX.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/chunk-ZM6TZVHC.js +2 -0
  38. package/dist/cli-bundle/main.js +13 -13
  39. package/dist/cli-bundle/sdk-authoring.js +1 -1
  40. package/dist/cli-bundle/sdk-contracts.js +1 -1
  41. package/dist/cli-bundle/sdk-core.js +45 -41
  42. package/dist/cli-bundle/sdk-governance.js +1 -1
  43. package/dist/cli-bundle/sdk-graph.js +1 -1
  44. package/dist/cli-bundle/sdk-merge.js +109 -1
  45. package/dist/cli-bundle/sdk-query.js +1 -1
  46. package/dist/cli-bundle/sdk-runtime.js +1 -1
  47. package/dist/cli-bundle/sdk-testing.js +1 -1
  48. package/dist/cli-bundle/sdk.js +2 -2
  49. package/dist/core/checkpoint/checkpoint-gc.js +7 -12
  50. package/dist/core/extensions/activation-summary-markdown.js +5 -4
  51. package/dist/core/extensions/activation-summary.d.ts +2 -0
  52. package/dist/core/extensions/activation-summary.js +6 -2
  53. package/dist/core/extensions/capability-usage.d.ts +1 -1
  54. package/dist/core/extensions/capability-usage.js +4 -3
  55. package/dist/core/extensions/contribution-inventory.d.ts +1 -0
  56. package/dist/core/extensions/contribution-inventory.js +6 -2
  57. package/dist/core/extensions/extension-registries.js +3 -2
  58. package/dist/core/extensions/extension-types.d.ts +83 -1
  59. package/dist/core/extensions/extension-types.js +3 -2
  60. package/dist/core/extensions/loader.d.ts +2 -8
  61. package/dist/core/extensions/loader.js +53 -144
  62. package/dist/core/extensions/registration-values.d.ts +43 -0
  63. package/dist/core/extensions/registration-values.js +210 -0
  64. package/dist/core/extensions/runtime-registrations.d.ts +3 -1
  65. package/dist/core/extensions/runtime-registrations.js +12 -2
  66. package/dist/core/fs/fs-utils.d.ts +2 -0
  67. package/dist/core/fs/fs-utils.js +7 -3
  68. package/dist/core/history/drift-cache.js +4 -3
  69. package/dist/core/history/drift-scan.d.ts +6 -0
  70. package/dist/core/history/drift-scan.js +76 -58
  71. package/dist/core/history/workspace-history.d.ts +59 -0
  72. package/dist/core/history/workspace-history.js +197 -10
  73. package/dist/core/lock/lock-gc.js +8 -13
  74. package/dist/core/lock/lock.js +5 -4
  75. package/dist/core/output/output.js +12 -4
  76. package/dist/core/search/vector-stores.js +6 -11
  77. package/dist/core/store/item-metadata-cache.js +4 -4
  78. package/dist/core/telemetry/runtime.d.ts +6 -0
  79. package/dist/core/telemetry/runtime.js +101 -30
  80. package/dist/sdk/agent/command-recovery.d.ts +2 -0
  81. package/dist/sdk/agent/command-recovery.js +10 -2
  82. package/dist/sdk/annotations.js +4 -4
  83. package/dist/sdk/cli-contracts/completeness.js +9 -3
  84. package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
  85. package/dist/sdk/cli-contracts/flag-contracts.js +6 -3
  86. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +6 -1
  87. package/dist/sdk/cli-contracts/runtime-contracts.js +155 -60
  88. package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +32 -0
  89. package/dist/sdk/cli-contracts/schemas/assurance-definition.js +25 -2
  90. package/dist/sdk/cli-contracts/tool-parameter-tables.js +35 -5
  91. package/dist/sdk/cli-contracts/tool-schema.js +17 -2
  92. package/dist/sdk/cli-program.js +3 -3
  93. package/dist/sdk/comments.js +4 -3
  94. package/dist/sdk/compile-cache.js +4 -3
  95. package/dist/sdk/compose.d.ts +3 -1
  96. package/dist/sdk/compose.js +16 -2
  97. package/dist/sdk/context-relevance.js +12 -4
  98. package/dist/sdk/context-signal-store.js +4 -3
  99. package/dist/sdk/extension/install-runtime.js +4 -4
  100. package/dist/sdk/extension/managed-state.js +4 -3
  101. package/dist/sdk/extension-contracts.d.ts +1 -1
  102. package/dist/sdk/flag-invocation-contracts.js +5 -6
  103. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +14 -2
  104. package/dist/sdk/governance/assurance-action.d.ts +27 -3
  105. package/dist/sdk/governance/assurance-action.js +112 -28
  106. package/dist/sdk/governance/assurance-mutation-error.d.ts +7 -0
  107. package/dist/sdk/governance/assurance-mutation-error.js +25 -2
  108. package/dist/sdk/governance/assurance-presets.d.ts +54 -0
  109. package/dist/sdk/governance/assurance-presets.js +136 -0
  110. package/dist/sdk/governance/assurance-runtime.d.ts +4 -0
  111. package/dist/sdk/governance/assurance-runtime.js +109 -8
  112. package/dist/sdk/governance/assurance.d.ts +39 -0
  113. package/dist/sdk/governance/assurance.js +145 -6
  114. package/dist/sdk/governance/gc.js +5 -11
  115. package/dist/sdk/governance/health.js +18 -6
  116. package/dist/sdk/governance/validate-history-drift.d.ts +7 -0
  117. package/dist/sdk/governance/validate-history-drift.js +68 -0
  118. package/dist/sdk/governance/validate.js +6 -48
  119. package/dist/sdk/graph/assembly.d.ts +23 -0
  120. package/dist/sdk/graph/assembly.js +54 -2
  121. package/dist/sdk/graph/durable-cache.js +91 -3
  122. package/dist/sdk/graph/governance-contracts.d.ts +12 -0
  123. package/dist/sdk/graph/governance-contracts.js +29 -0
  124. package/dist/sdk/graph/governance.d.ts +51 -3
  125. package/dist/sdk/graph/governance.js +216 -35
  126. package/dist/sdk/graph/index.d.ts +2 -2
  127. package/dist/sdk/graph/index.js +4 -4
  128. package/dist/sdk/graph/mutation-advisory.js +15 -7
  129. package/dist/sdk/graph/remediation.js +12 -2
  130. package/dist/sdk/guide.js +4 -4
  131. package/dist/sdk/history-read.d.ts +8 -0
  132. package/dist/sdk/history-read.js +2 -2
  133. package/dist/sdk/index.d.ts +3 -2
  134. package/dist/sdk/index.js +5 -4
  135. package/dist/sdk/linked-artifacts.d.ts +2 -0
  136. package/dist/sdk/linked-artifacts.js +29 -4
  137. package/dist/sdk/merge/install.js +5 -4
  138. package/dist/sdk/query/activity.js +4 -3
  139. package/dist/sdk/query/history.js +20 -3
  140. package/dist/sdk/read-output-budget.d.ts +2 -0
  141. package/dist/sdk/read-output-budget.js +12 -5
  142. package/dist/sdk/read-output-contracts.d.ts +61 -5
  143. package/dist/sdk/read-output-contracts.js +210 -28
  144. package/dist/sdk/read-output-rows.d.ts +11 -0
  145. package/dist/sdk/read-output-rows.js +47 -2
  146. package/dist/sdk/relationship-history.js +5 -5
  147. package/dist/sdk/runtime-primitives.d.ts +1 -1
  148. package/dist/sdk/runtime-primitives.js +3 -3
  149. package/dist/sdk/runtime.js +5 -3
  150. package/dist/sdk/schema-migration.js +4 -4
  151. package/dist/sdk/test/execution.js +4 -4
  152. package/dist/sdk/workspace-memory.js +4 -4
  153. package/dist/sdk/workspace-snapshot.js +8 -14
  154. package/dist/sdk/workspace-transaction-gc.js +4 -9
  155. package/dist/sdk/workspace-transaction.js +4 -4
  156. package/dist/sdk/workspace.js +4 -3
  157. package/docs/ASSURANCE.md +163 -3
  158. package/docs/COMMANDS.md +31 -2
  159. package/docs/CONFIGURATION.md +2 -0
  160. package/docs/EXTENSIONS.md +11 -12
  161. package/docs/READ_OUTPUT_CONTRACTS.md +44 -8
  162. package/docs/RELATIONSHIP_GRAPH.md +34 -4
  163. package/docs/SDK.md +29 -8
  164. package/docs/SDK_CONTEXT_INTEGRITY.md +32 -1
  165. package/docs/TESTING.md +47 -16
  166. package/docs/performance/sdk-entrypoint-import-costs.md +20 -13
  167. package/marketplace.json +2 -2
  168. package/package.json +6 -6
  169. package/packages/pm-beads/extensions/beads/index.ts +1 -0
  170. package/packages/pm-beads/package.json +1 -1
  171. package/packages/pm-calendar/extensions/calendar/index.ts +1 -0
  172. package/packages/pm-calendar/package.json +1 -1
  173. package/packages/pm-command-kit/package.json +1 -1
  174. package/packages/pm-digital-twin/extensions/digital-twin/index.ts +7 -0
  175. package/packages/pm-digital-twin/package.json +1 -1
  176. package/packages/pm-governance-audit/extensions/governance-audit/index.ts +4 -0
  177. package/packages/pm-governance-audit/package.json +1 -1
  178. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +5 -0
  179. package/packages/pm-guide-shell/package.json +1 -1
  180. package/packages/pm-kanban/package.json +1 -1
  181. package/packages/pm-lifecycle-hooks/package.json +1 -1
  182. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.ts +6 -0
  183. package/packages/pm-linked-test-adapters/package.json +1 -1
  184. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +2 -0
  185. package/packages/pm-search-advanced/package.json +1 -1
  186. package/packages/pm-templates/extensions/templates/index.ts +4 -0
  187. package/packages/pm-templates/package.json +1 -1
  188. package/packages/pm-todos/extensions/todos/index.ts +2 -0
  189. package/packages/pm-todos/package.json +1 -1
  190. package/packages/pm-vcs/extensions/vcs/index.ts +7 -0
  191. package/packages/pm-vcs/package.json +1 -1
  192. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  193. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  194. package/scripts/bundle-cli.mjs +17 -4
  195. package/sdk/public-surface.json +390 -60
  196. package/dist/cli-bundle/chunks/chunk-3PS7X6GS.js +0 -8
  197. package/dist/cli-bundle/chunks/chunk-7KL6KMWF.js +0 -13
  198. package/dist/cli-bundle/chunks/chunk-D55A5AEN.js +0 -33
  199. package/dist/cli-bundle/chunks/chunk-KIKDWECH.js +0 -196
  200. package/dist/cli-bundle/chunks/chunk-R76342NV.js +0 -2
  201. package/dist/cli-bundle/chunks/chunk-RBTK5EZV.js +0 -5
  202. package/dist/cli-bundle/chunks/chunk-VLUQOIDT.js +0 -2
  203. package/dist/cli-bundle/chunks/register-operations-2OGISOVR.js +0 -2
  204. package/dist/cli-bundle/focused-chunks/chunk-2DALMVF7.js +0 -5
  205. package/dist/cli-bundle/focused-chunks/chunk-5OQIMELN.js +0 -155
  206. package/dist/cli-bundle/focused-chunks/chunk-5TAGTDRE.js +0 -2
  207. package/dist/cli-bundle/focused-chunks/chunk-ECADZMVC.js +0 -18
  208. package/dist/cli-bundle/focused-chunks/chunk-EJGXRA6B.js +0 -2
  209. package/dist/cli-bundle/focused-chunks/chunk-FFGSZCPK.js +0 -16
  210. package/dist/cli-bundle/focused-chunks/chunk-ISKOBJCM.js +0 -2
  211. package/dist/cli-bundle/focused-chunks/chunk-KPSXVBDV.js +0 -2
  212. package/dist/cli-bundle/focused-chunks/chunk-KTLOKKCQ.js +0 -2
  213. package/dist/cli-bundle/focused-chunks/chunk-LGYK3NUF.js +0 -8
  214. package/dist/cli-bundle/focused-chunks/chunk-NBLUKITQ.js +0 -4
  215. package/dist/cli-bundle/focused-chunks/chunk-NYLOUPOB.js +0 -2
  216. package/dist/cli-bundle/focused-chunks/chunk-Q4T463SD.js +0 -31
  217. package/dist/cli-bundle/focused-chunks/chunk-QVZVY53N.js +0 -2
  218. package/dist/cli-bundle/focused-chunks/chunk-UTEWXDEQ.js +0 -17
@@ -4,7 +4,8 @@
4
4
  * Coordinates tracker lock ownership and cleanup for Lock.
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]="c638b65d-148a-5b42-8f24-d6fa9d5ac7d3")}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]="a9ad8a9f-de6e-5bce-8685-844f1129d5fb")}catch(e){}}();
8
+ import { isFileMissingError } from "../fs/fs-utils.js";
8
9
  import fs from "node:fs/promises";
9
10
  import path from "node:path";
10
11
  import { randomUUID } from "node:crypto";
@@ -70,7 +71,7 @@ async function readLockInfo(lockPath) {
70
71
  return parseLockInfo(raw);
71
72
  }
72
73
  catch (error) {
73
- if (isErrno(error, "ENOENT")) {
74
+ if (isFileMissingError(error)) {
74
75
  return {
75
76
  info: null,
76
77
  warnings: [],
@@ -294,7 +295,7 @@ async function removeExpiredStaleCleanupGate(gatePath) {
294
295
  }
295
296
  }
296
297
  catch (error) {
297
- return isErrno(error, "ENOENT");
298
+ return isFileMissingError(error);
298
299
  }
299
300
  const owner = await readStaleCleanupGateOwner(gatePath);
300
301
  if (owner !== null &&
@@ -446,4 +447,4 @@ export async function acquireLock(pmRoot, id, ttlSeconds, owner, force = false,
446
447
  }
447
448
  }
448
449
  //# sourceMappingURL=lock.js.map
449
- //# debugId=c638b65d-148a-5b42-8f24-d6fa9d5ac7d3
450
+ //# debugId=a9ad8a9f-de6e-5bce-8685-844f1129d5fb
@@ -4,7 +4,7 @@
4
4
  * Formats compact human and machine output for Output.
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]="5aaf8b90-5b95-5102-9ea4-b877c696d593")}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]="88eb8f29-72a2-536f-8fc9-394ed3e0e0fb")}catch(e){}}();
8
8
  import { getActiveCommandContext, runActiveCommandOverride, runActiveRendererOverride, runActiveServiceOverrideSync, setActiveCommandResult, } from "../extensions/index.js";
9
9
  import { EXIT_CODE } from "../shared/constants.js";
10
10
  import { isHostOutputSuppressed } from "./output-control.js";
@@ -371,7 +371,15 @@ function formatEffectiveOutput(effectiveResult, nativeOutput, options) {
371
371
  };
372
372
  const format = resolveReadOutputEncoding(command ?? "", commandOptions) ??
373
373
  resolveOutputFormat(options);
374
- const effectiveOptions = { ...options, command, commandOptions };
374
+ const resolvedCommandOptions = {
375
+ ...commandOptions,
376
+ resolvedOutputFormat: format,
377
+ };
378
+ const effectiveOptions = {
379
+ ...options,
380
+ command,
381
+ commandOptions: resolvedCommandOptions,
382
+ };
375
383
  const service = resolveOutputService(effectiveResult, nativeOutput, effectiveOptions, format);
376
384
  if (service.rendered !== null)
377
385
  return service.rendered;
@@ -379,7 +387,7 @@ function formatEffectiveOutput(effectiveResult, nativeOutput, options) {
379
387
  const projectedOutputResult = command === "test"
380
388
  ? projectLinkedTestEvidence(outputResult, options.lean === true)
381
389
  : outputResult;
382
- const intentOutputResult = attachReadOutputContracts(command, commandOptions, projectedOutputResult);
390
+ const intentOutputResult = attachReadOutputContracts(command, resolvedCommandOptions, projectedOutputResult);
383
391
  const renderResolvedOutput = (value) => {
384
392
  if (format === "toon") {
385
393
  const markdownDefault = renderDefaultMarkdownResult(value);
@@ -456,4 +464,4 @@ export const outputTestOnly = {
456
464
  renderToonValue,
457
465
  };
458
466
  //# sourceMappingURL=output.js.map
459
- //# debugId=5aaf8b90-5b95-5102-9ea4-b877c696d593
467
+ //# debugId=88eb8f29-72a2-536f-8fc9-394ed3e0e0fb
@@ -1,10 +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]="7bac9506-dcad-5e52-848b-3e2631d4936c")}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]="98c8d03c-bdde-5ac4-b80d-395d885f7442")}catch(e){}}();
3
3
  import { mkdir, readFile, stat, unlink } from "node:fs/promises";
4
4
  import { basename, dirname, isAbsolute, join, resolve } from "node:path";
5
5
  import { executeSearchJsonRequest, normalizeSearchHttpTimeoutMs, resolveSearchHttpFetcher, } from "./http-client.js";
6
6
  import { isFiniteNumberArray, toErrorMessage, toNonEmptyString, trimTrailingSlashes, } from "../shared/primitives.js";
7
- import { writeFileAtomic } from "../fs/fs-utils.js";
7
+ import { isFileMissingError, writeFileAtomic } from "../fs/fs-utils.js";
8
8
  const DEFAULT_COLLECTION = "pm_items";
9
9
  const COLLECTION_SANITIZE_PATTERN = /[^a-zA-Z0-9_-]/g;
10
10
  const MAX_COLLECTION_NAME_LENGTH = 128;
@@ -200,11 +200,6 @@ function getLanceDbLocalTableKey(storePath, table) {
200
200
  function getLanceDbSnapshotPath(storePath, table) {
201
201
  return join(resolve(storePath), LANCE_DB_LOCAL_SNAPSHOT_DIR, `${table}.json`);
202
202
  }
203
- function isNodeErrorWithCode(error, code) {
204
- return (typeof error === "object" &&
205
- error !== null &&
206
- error.code === code);
207
- }
208
203
  function normalizeSnapshotRecord(entry, index, snapshotPath) {
209
204
  const id = toNonEmptyString(entry.id);
210
205
  if (!id) {
@@ -261,7 +256,7 @@ async function readLanceDbSnapshotStats(snapshotPath) {
261
256
  return { mtimeMs: stats.mtimeMs, size: stats.size };
262
257
  }
263
258
  catch (error) {
264
- if (!isNodeErrorWithCode(error, "ENOENT")) {
259
+ if (!isFileMissingError(error)) {
265
260
  throw error;
266
261
  }
267
262
  return null;
@@ -306,7 +301,7 @@ async function loadLanceDbLocalTable(storePath, table) {
306
301
  loaded = parseLanceDbSnapshot(snapshotPath, table, raw);
307
302
  }
308
303
  catch (error) {
309
- if (!isNodeErrorWithCode(error, "ENOENT")) {
304
+ if (!isFileMissingError(error)) {
310
305
  throw error;
311
306
  }
312
307
  }
@@ -331,7 +326,7 @@ async function removeSnapshotFile(snapshotPath) {
331
326
  await unlink(snapshotPath);
332
327
  }
333
328
  catch (error) {
334
- if (!isNodeErrorWithCode(error, "ENOENT")) {
329
+ if (!isFileMissingError(error)) {
335
330
  throw new Error(`LanceDB local snapshot delete failed at '${snapshotPath}': ${toErrorMessage(error)}`);
336
331
  }
337
332
  }
@@ -667,4 +662,4 @@ export async function executeVectorReset(store, knownIds = [], options = {}, vec
667
662
  return await executeVectorDelete(store, idsToDelete, options);
668
663
  }
669
664
  //# sourceMappingURL=vector-stores.js.map
670
- //# debugId=7bac9506-dcad-5e52-848b-3e2631d4936c
665
+ //# debugId=98c8d03c-bdde-5ac4-b80d-395d885f7442
@@ -4,7 +4,7 @@
4
4
  * Reads and writes tracker storage with format-aware helpers for the item metadata cache.
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]="58d1ab81-16b6-5c93-ade4-ba189ea48c9b")}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]="8b8c705a-8d80-576f-8642-f6f686cdbed9")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { createHash, randomUUID } from "node:crypto";
@@ -12,7 +12,7 @@ import { getActiveExtensionRegistrations, hasActiveOnReadHooks, runActiveOnReadH
12
12
  import { collectRegisteredItemFieldNames } from "../extensions/item-fields.js";
13
13
  import { parseItemDocument } from "../item/item-format.js";
14
14
  import { evictOldestMemoEntries } from "../shared/memo.js";
15
- import { writeFileAtomic } from "../fs/fs-utils.js";
15
+ import { isFileMissingError, writeFileAtomic } from "../fs/fs-utils.js";
16
16
  import { acquireLock } from "../lock/lock.js";
17
17
  import { ITEM_FILE_EXTENSIONS, getItemFormatFromPath } from "./paths.js";
18
18
  import { rebuildItemMetadataQueryIndex, removeItemMetadataQueryIndex, updateItemMetadataQueryIndex, } from "./item-metadata-query-index.js";
@@ -442,7 +442,7 @@ async function readItemDirectoryFiles(pmRoot, folder, warnings) {
442
442
  if (typeof error === "object" &&
443
443
  error !== null &&
444
444
  "code" in error &&
445
- error.code !== "ENOENT") {
445
+ !isFileMissingError(error)) {
446
446
  appendWarning(warnings, `item_list_directory_read_failed:${folder}`);
447
447
  }
448
448
  return { folder, dirPath, files: [] };
@@ -1114,4 +1114,4 @@ export async function listAllDocumentsCachedLight(pmRoot, preferredFormat, typeT
1114
1114
  }));
1115
1115
  }
1116
1116
  //# sourceMappingURL=item-metadata-cache.js.map
1117
- //# debugId=58d1ab81-16b6-5c93-ade4-ba189ea48c9b
1117
+ //# debugId=8b8c705a-8d80-576f-8642-f6f686cdbed9
@@ -171,6 +171,10 @@ declare function sanitizeValue(value: unknown, keyHint?: string, captureLevel?:
171
171
  declare function sanitizeCommandArgs(args: string[], captureLevel?: Exclude<TelemetryCaptureLevel, "minimal">): string[];
172
172
  declare function normalizeCaptureLevel(value: string | undefined): TelemetryCaptureLevel;
173
173
  declare function parseBooleanTrueLike(value: string | undefined): boolean;
174
+ /** Resolve the background event and OTLP request timeout within the flush-lock safety envelope. */
175
+ declare function resolveTelemetryHttpTimeoutMs(): number;
176
+ /** POST a JSON payload with one total timeout that covers DNS, connection, TLS, and response completion. */
177
+ declare function postTelemetryJson(endpoint: string, headers: Record<string, string>, body: string): Promise<number>;
174
178
  declare function normalizePmVersion(value: string | undefined): string;
175
179
  declare function normalizeTelemetryErrorCode(value: string | undefined): string | undefined;
176
180
  declare function normalizeTelemetryExitCode(exitCode: number | undefined, ok: boolean): number;
@@ -335,11 +339,13 @@ export declare const _testOnly: {
335
339
  looksLikeEmailToken: typeof looksLikeEmailToken;
336
340
  otelSpansQueuePath: typeof otelSpansQueuePath;
337
341
  parseBooleanTrueLike: typeof parseBooleanTrueLike;
342
+ postTelemetryJson: typeof postTelemetryJson;
338
343
  parsePendingOtelSpanLines: typeof parsePendingOtelSpanLines;
339
344
  prunePendingOtelSpans: typeof prunePendingOtelSpans;
340
345
  reconcilePendingOtelSpansAfterFlush: typeof reconcilePendingOtelSpansAfterFlush;
341
346
  retentionCutoffMs: typeof retentionCutoffMs;
342
347
  resolveOtelTracesEndpoint: typeof resolveOtelTracesEndpoint;
348
+ resolveTelemetryHttpTimeoutMs: typeof resolveTelemetryHttpTimeoutMs;
343
349
  rewritePendingOtelSpans: typeof rewritePendingOtelSpans;
344
350
  normalizeForHash: typeof normalizeForHash;
345
351
  normalizeCaptureLevel: typeof normalizeCaptureLevel;
@@ -4,15 +4,17 @@
4
4
  * Captures consent-aware telemetry and observability events 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]="fea9d81b-3deb-51f4-9ec3-76396ae1307d")}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]="26ea62d9-874d-5826-9822-83c5523b673b")}catch(e){}}();
8
8
  import crypto from "node:crypto";
9
9
  import { spawn } from "node:child_process";
10
10
  import { mkdirSync, rmSync, statSync } from "node:fs";
11
11
  import { mkdir, readdir, rm, stat } from "node:fs/promises";
12
+ import { request as httpRequest } from "node:http";
13
+ import { request as httpsRequest } from "node:https";
12
14
  import os from "node:os";
13
15
  import path from "node:path";
14
16
  import { resolvePmPackageRootFromModule } from "../packages/root.js";
15
- import { appendLineAtomic, readFileIfExists, writeFileAtomic, } from "../fs/fs-utils.js";
17
+ import { isFileMissingError, appendLineAtomic, readFileIfExists, writeFileAtomic, } from "../fs/fs-utils.js";
16
18
  import { resolveTelemetryErrorCategory, } from "../shared/constants.js";
17
19
  import { nowIso } from "../shared/time.js";
18
20
  import { detectAgentIdentity, readAuthorEnvironment, } from "../shared/author.js";
@@ -22,11 +24,10 @@ import { deriveTelemetryCommandResolution, deriveTelemetryCommandTaxonomy, infer
22
24
  const TELEMETRY_QUEUE_RELATIVE_PATH = path.join("runtime", "telemetry", "events.jsonl");
23
25
  const TELEMETRY_STATE_RELATIVE_PATH = path.join("runtime", "telemetry", "state.json");
24
26
  const TELEMETRY_OTEL_SPANS_RELATIVE_PATH = path.join("runtime", "telemetry", "otel-spans.jsonl");
25
- // Kept small so a worst-case batch against a blackholed collector
26
- // (TELEMETRY_OTEL_SPANS_FLUSH_BATCH_SIZE * TELEMETRY_HTTP_TIMEOUT_MS plus the
27
- // preceding event flush) stays well under TELEMETRY_FLUSH_LOCK_STALE_MS (60s).
28
- // Otherwise a later command could treat the still-held flush lock as stale and
29
- // start a second concurrent worker.
27
+ // OTLP requests run concurrently, while event and OTLP phases run sequentially.
28
+ // The maximum configurable HTTP timeout therefore keeps two worst-case network
29
+ // phases below TELEMETRY_FLUSH_LOCK_STALE_MS (60s), preventing a later command
30
+ // from treating a live worker's lock as stale and starting a second worker.
30
31
  const TELEMETRY_OTEL_SPANS_FLUSH_BATCH_SIZE = 8;
31
32
  const TELEMETRY_OTEL_SPANS_MAX_PENDING = 500;
32
33
  /** Public contract for telemetry schema version, shared by SDK and presentation-layer consumers. */
@@ -35,7 +36,9 @@ const TELEMETRY_CLIENT_SCHEMA_VERSION = 1;
35
36
  const TELEMETRY_FLUSH_BATCH_SIZE = 100;
36
37
  const TELEMETRY_MAX_RETRY_DELAY_MS = 3_600_000;
37
38
  const TELEMETRY_RETRY_BASE_DELAY_MS = 30_000;
38
- const TELEMETRY_HTTP_TIMEOUT_MS = 5_000;
39
+ const TELEMETRY_HTTP_TIMEOUT_DEFAULT_MS = 20_000;
40
+ const TELEMETRY_HTTP_TIMEOUT_MIN_MS = 1_000;
41
+ const TELEMETRY_HTTP_TIMEOUT_MAX_MS = 25_000;
39
42
  const MILLISECONDS_PER_DAY = 86_400_000;
40
43
  const TELEMETRY_MAX_EVENT_BYTES = 65_536;
41
44
  const TELEMETRY_SANITIZE_MAX_DEPTH = 6;
@@ -58,6 +61,8 @@ const PM_TELEMETRY_OTEL_DISABLED_VALUES = new Set(["1", "true", "yes", "on"]);
58
61
  const PM_TELEMETRY_INLINE_FLUSH_ENV = "PM_TELEMETRY_INLINE_FLUSH";
59
62
  const PM_TELEMETRY_FLUSH_CHILD_ENV = "PM_TELEMETRY_FLUSH_CHILD";
60
63
  const PM_TELEMETRY_SOURCE_CONTEXT_ENV = "PM_TELEMETRY_SOURCE_CONTEXT";
64
+ const PM_TELEMETRY_HTTP_TIMEOUT_MS_ENV = "PM_TELEMETRY_HTTP_TIMEOUT_MS";
65
+ const NATIVE_FETCH = globalThis.fetch;
61
66
  /** Supported values accepted by the pm telemetry source context contract. */
62
67
  export const PM_TELEMETRY_SOURCE_CONTEXT_VALUES = [
63
68
  "user",
@@ -390,6 +395,80 @@ function normalizeCaptureLevel(value) {
390
395
  function parseBooleanTrueLike(value) {
391
396
  return BOOLEAN_TRUE_VALUES.has((value ?? "").trim().toLowerCase());
392
397
  }
398
+ /** Resolve the background event and OTLP request timeout within the flush-lock safety envelope. */
399
+ function resolveTelemetryHttpTimeoutMs() {
400
+ const rawConfigured = process.env[PM_TELEMETRY_HTTP_TIMEOUT_MS_ENV]?.trim();
401
+ if (!rawConfigured) {
402
+ return TELEMETRY_HTTP_TIMEOUT_DEFAULT_MS;
403
+ }
404
+ const configured = Number(rawConfigured);
405
+ if (!Number.isFinite(configured)) {
406
+ return TELEMETRY_HTTP_TIMEOUT_DEFAULT_MS;
407
+ }
408
+ return Math.min(TELEMETRY_HTTP_TIMEOUT_MAX_MS, Math.max(TELEMETRY_HTTP_TIMEOUT_MIN_MS, Math.trunc(configured)));
409
+ }
410
+ /** POST a JSON payload with one total timeout that covers DNS, connection, TLS, and response completion. */
411
+ async function postTelemetryJson(endpoint, headers, body) {
412
+ const url = new URL(endpoint);
413
+ // A replaced global fetch is an intentional runtime adapter used by the
414
+ // repository's deterministic tests and by embedders that instrument network
415
+ // traffic. Production retains the native HTTP transport below so Node's
416
+ // independent built-in-fetch connect timeout cannot preempt our bound.
417
+ if (globalThis.fetch !== NATIVE_FETCH) {
418
+ const controller = new AbortController();
419
+ let timeout;
420
+ const deadline = new Promise((_resolve, reject) => {
421
+ timeout = setTimeout(() => {
422
+ controller.abort();
423
+ reject(new Error("telemetry_http_timeout"));
424
+ }, resolveTelemetryHttpTimeoutMs());
425
+ });
426
+ try {
427
+ const response = await Promise.race([
428
+ globalThis.fetch(endpoint, {
429
+ method: "POST",
430
+ headers,
431
+ body,
432
+ signal: controller.signal,
433
+ }),
434
+ deadline,
435
+ ]);
436
+ return response.status;
437
+ }
438
+ finally {
439
+ clearTimeout(timeout);
440
+ }
441
+ }
442
+ const request = url.protocol === "https:"
443
+ ? httpsRequest
444
+ : url.protocol === "http:"
445
+ ? httpRequest
446
+ : undefined;
447
+ if (!request) {
448
+ throw new Error(`telemetry_http_protocol_unsupported_${url.protocol}`);
449
+ }
450
+ return new Promise((resolve, reject) => {
451
+ const timeoutMs = resolveTelemetryHttpTimeoutMs();
452
+ const requestOptions = {
453
+ method: "POST",
454
+ headers: {
455
+ ...headers,
456
+ "content-length": Buffer.byteLength(body),
457
+ },
458
+ signal: AbortSignal.timeout(timeoutMs),
459
+ autoSelectFamilyAttemptTimeout: Math.min(5_000, timeoutMs),
460
+ };
461
+ const clientRequest = request(url, requestOptions, (response) => {
462
+ response.once("error", reject);
463
+ // Client responses always carry an HTTP status code; Node's shared
464
+ // IncomingMessage type is also used for server requests where it is absent.
465
+ response.once("end", () => resolve(response.statusCode));
466
+ response.resume();
467
+ });
468
+ clientRequest.once("error", reject);
469
+ clientRequest.end(body);
470
+ });
471
+ }
393
472
  function normalizePmVersion(value) {
394
473
  const trimmed = typeof value === "string" ? value.trim() : "";
395
474
  return trimmed.length > 0 ? trimmed : "0.0.0";
@@ -1214,14 +1293,9 @@ async function flushPendingOtelSpans(globalPmRoot, retentionDays) {
1214
1293
  // and safe under Node's single-threaded event loop.
1215
1294
  await Promise.all(due.map(async (span) => {
1216
1295
  try {
1217
- const response = await fetch(span.endpoint, {
1218
- method: "POST",
1219
- headers: { "content-type": "application/json" },
1220
- body: JSON.stringify(span.payload),
1221
- signal: AbortSignal.timeout(TELEMETRY_HTTP_TIMEOUT_MS),
1222
- });
1223
- if (!response.ok) {
1224
- throw new Error(`local_otel_export_http_${response.status}`);
1296
+ const status = await postTelemetryJson(span.endpoint, { "content-type": "application/json" }, JSON.stringify(span.payload));
1297
+ if (status < 200 || status >= 300) {
1298
+ throw new Error(`local_otel_export_http_${status}`);
1225
1299
  }
1226
1300
  succeededIds.add(span.id);
1227
1301
  succeededCount += 1;
@@ -1398,17 +1472,12 @@ async function flushQueue(globalPmRoot, endpoint, retentionDays) {
1398
1472
  requestHeaders["x-pm-telemetry-key"] = ingestKey;
1399
1473
  }
1400
1474
  try {
1401
- const response = await fetch(normalizedEndpoint, {
1402
- method: "POST",
1403
- headers: requestHeaders,
1404
- body: JSON.stringify({
1405
- schema_version: TELEMETRY_SCHEMA_VERSION,
1406
- events: dueEntries.map((entry) => entry.event),
1407
- }),
1408
- signal: AbortSignal.timeout(TELEMETRY_HTTP_TIMEOUT_MS),
1409
- });
1410
- if (!response.ok) {
1411
- throw new Error(`telemetry_flush_http_${response.status}`);
1475
+ const status = await postTelemetryJson(normalizedEndpoint, requestHeaders, JSON.stringify({
1476
+ schema_version: TELEMETRY_SCHEMA_VERSION,
1477
+ events: dueEntries.map((entry) => entry.event),
1478
+ }));
1479
+ if (status < 200 || status >= 300) {
1480
+ throw new Error(`telemetry_flush_http_${status}`);
1412
1481
  }
1413
1482
  }
1414
1483
  catch (error) {
@@ -1519,7 +1588,7 @@ function createDirectoryLock(lockPath) {
1519
1588
  if (code === "EEXIST") {
1520
1589
  return false;
1521
1590
  }
1522
- if (code !== "ENOENT") {
1591
+ if (!isFileMissingError(error)) {
1523
1592
  return false;
1524
1593
  }
1525
1594
  }
@@ -1547,7 +1616,7 @@ function acquireTelemetryFlushSpawnGate(globalPmRoot) {
1547
1616
  removeDirectoryLockBestEffort(lockPath);
1548
1617
  }
1549
1618
  catch (error) {
1550
- if (errorCode(error) !== "ENOENT") {
1619
+ if (!isFileMissingError(error)) {
1551
1620
  return false;
1552
1621
  }
1553
1622
  }
@@ -1586,11 +1655,13 @@ export const _testOnly = {
1586
1655
  looksLikeEmailToken,
1587
1656
  otelSpansQueuePath,
1588
1657
  parseBooleanTrueLike,
1658
+ postTelemetryJson,
1589
1659
  parsePendingOtelSpanLines,
1590
1660
  prunePendingOtelSpans,
1591
1661
  reconcilePendingOtelSpansAfterFlush,
1592
1662
  retentionCutoffMs,
1593
1663
  resolveOtelTracesEndpoint,
1664
+ resolveTelemetryHttpTimeoutMs,
1594
1665
  rewritePendingOtelSpans,
1595
1666
  normalizeForHash,
1596
1667
  normalizeCaptureLevel,
@@ -1915,4 +1986,4 @@ export async function emitTelemetryErrorEvent(context) {
1915
1986
  }
1916
1987
  }
1917
1988
  //# sourceMappingURL=runtime.js.map
1918
- //# debugId=fea9d81b-3deb-51f4-9ec3-76396ae1307d
1989
+ //# debugId=26ea62d9-874d-5826-9822-83c5523b673b
@@ -1,3 +1,5 @@
1
+ /** Resolve a recovery command without interpreting global option values as command tokens. */
2
+ export declare function resolveRecoveryCommandName(invocationArgv: string[] | undefined): string | undefined;
1
3
  /** Resolve the truthful placeholder for a missing flag from its contract. */
2
4
  export declare function resolveMissingOptionPlaceholder(commandName: string, missingLabel: string): string | null | undefined;
3
5
  /** Preserve an attempted argv vector and insert each missing option before `--`. */
@@ -6,13 +6,21 @@
6
6
  * supplied arguments are preserved byte-for-token.
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]="ab87f46c-c9b4-51d1-a712-fbce7c79fca9")}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]="4973a995-60f0-5990-9927-371dc6716063")}catch(e){}}();
10
10
  import { renderPmCommand } from "../command-line.js";
11
11
  import { resolveSubcommandFlagContractsForCommand } from "../cli-contracts.js";
12
+ import { parseBootstrapCommandName } from "../cli-bootstrap.js";
12
13
  function normalizeMissingFlag(label) {
13
14
  const match = label.trim().match(/--[a-z0-9][a-z0-9_-]*/i);
14
15
  return match?.[0]?.replaceAll("_", "-").toLowerCase();
15
16
  }
17
+ /** Resolve a recovery command without interpreting global option values as command tokens. */
18
+ export function resolveRecoveryCommandName(invocationArgv) {
19
+ if (!Array.isArray(invocationArgv) || invocationArgv.length === 0) {
20
+ return undefined;
21
+ }
22
+ return parseBootstrapCommandName(invocationArgv);
23
+ }
16
24
  /** Resolve the truthful placeholder for a missing flag from its contract. */
17
25
  export function resolveMissingOptionPlaceholder(commandName, missingLabel) {
18
26
  const flag = normalizeMissingFlag(missingLabel);
@@ -49,4 +57,4 @@ export function renderMissingOptionRetry(invocationArgv, commandName, missingLab
49
57
  : renderPmCommand(retry);
50
58
  }
51
59
  //# sourceMappingURL=command-recovery.js.map
52
- //# debugId=ab87f46c-c9b4-51d1-a712-fbce7c79fca9
60
+ //# debugId=4973a995-60f0-5990-9927-371dc6716063
@@ -4,9 +4,9 @@
4
4
  * Implements the pm annotation command 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]="13cf8bd9-0aee-5838-a6eb-de9f87ddfac7")}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]="0af9967c-ca72-563a-9518-2e68da0c0fe0")}catch(e){}}();
8
8
  import { readFile } from "node:fs/promises";
9
- import { pathExists } from "../core/fs/fs-utils.js";
9
+ import { isFileAbsentError, pathExists } from "../core/fs/fs-utils.js";
10
10
  import { getActiveExtensionRegistrations } from "../core/extensions/index.js";
11
11
  import { resolveItemTypeRegistry } from "../core/item/type-registry.js";
12
12
  import { createStdinTokenResolver, parseCsvKv } from "../core/item/parse.js";
@@ -114,7 +114,7 @@ async function resolveAnnotationTextSource(options, noun) {
114
114
  return { value: await readFile(filePath, "utf8"), emptyFlag: "--file" };
115
115
  }
116
116
  catch (error) {
117
- if (isErrnoError(error) && error.code === "ENOENT") {
117
+ if (isErrnoError(error) && isFileAbsentError(error)) {
118
118
  throw new PmCliError(`--file path not found: ${filePath}`, EXIT_CODE.USAGE);
119
119
  }
120
120
  const detail = error instanceof Error ? error.message : String(error);
@@ -399,4 +399,4 @@ function renderAnnotationResult(id, collectionKey, allEntries, limit, includeMet
399
399
  };
400
400
  }
401
401
  //# sourceMappingURL=annotations.js.map
402
- //# debugId=13cf8bd9-0aee-5838-a6eb-de9f87ddfac7
402
+ //# debugId=0af9967c-ca72-563a-9518-2e68da0c0fe0
@@ -7,7 +7,7 @@
7
7
  * a hand-picked test list.
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]="13847453-3016-5855-a816-2cadc2ca4870")}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]="cf238c71-1626-5e48-9207-7acf22c0d680")}catch(e){}}();
11
11
  import { PM_TOOL_ACTIONS } from "./enum-contracts.js";
12
12
  import { resolveSubcommandFlagContractsForCommand, } from "./flag-contracts.js";
13
13
  import { pmToolActionParameterKeys } from "./tool-schema.js";
@@ -80,6 +80,7 @@ const ACTION_POSITIONAL_PARAMETERS = {
80
80
  assurance: {
81
81
  id: "<id>",
82
82
  kind: "<kind>",
83
+ preset: "[kind]|[id]",
83
84
  subcommand: "<action>",
84
85
  },
85
86
  event: { title: "<title>" },
@@ -95,7 +96,12 @@ const ACTION_POSITIONAL_PARAMETERS = {
95
96
  },
96
97
  };
97
98
  const ACTION_FLAG_PARAMETER_OVERRIDES = {
98
- assurance: { "--tree": "treeId" },
99
+ assurance: {
100
+ "--tree": "treeId",
101
+ "--owner": "owner",
102
+ "--apply": "apply",
103
+ "--enforcement": "enforcement",
104
+ },
99
105
  init: {
100
106
  "--id-prefix": "idPrefix",
101
107
  "--no-merge-fence": "mergeFence",
@@ -377,4 +383,4 @@ export function analyzeSdkCliParameterCompleteness(source = {}) {
377
383
  });
378
384
  }
379
385
  //# sourceMappingURL=completeness.js.map
380
- //# debugId=13847453-3016-5855-a816-2cadc2ca4870
386
+ //# debugId=cf238c71-1626-5e48-9207-7acf22c0d680
@@ -19,7 +19,7 @@ export declare const PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS: readonly ["none", "
19
19
  /** Restricts pm extension sandbox profile contract values accepted by command, SDK, and storage contracts. */
20
20
  export type PmExtensionSandboxProfileContract = (typeof PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS)[number];
21
21
  /** Public contract for pm extension policy surface contracts, shared by SDK and presentation-layer consumers. */
22
- export declare const PM_EXTENSION_POLICY_SURFACE_CONTRACTS: readonly ["commands.override", "commands.handler", "hooks.beforecommand", "hooks.beforemutation", "hooks.aftercommand", "hooks.onwrite", "hooks.onread", "hooks.onindex", "schema.flags", "schema.itemfields", "schema.itemtypes", "schema.relationshipkinds", "schema.migrations", "schema.profiles", "parser.override", "preflight.override", "services.override", "renderers.override", "importers.importer", "importers.exporter", "search.provider", "search.vectorstore"];
22
+ export declare const PM_EXTENSION_POLICY_SURFACE_CONTRACTS: readonly ["commands.override", "commands.handler", "hooks.beforecommand", "hooks.beforemutation", "hooks.aftercommand", "hooks.onwrite", "hooks.onread", "hooks.onindex", "schema.flags", "schema.itemfields", "schema.itemtypes", "schema.relationshipkinds", "schema.migrations", "schema.profiles", "parser.override", "preflight.override", "services.override", "renderers.override", "importers.importer", "importers.exporter", "search.provider", "search.vectorstore", "services.assuranceprovider"];
23
23
  /** Restricts pm extension policy surface contract values accepted by command, SDK, and storage contracts. */
24
24
  export type PmExtensionPolicySurfaceContract = (typeof PM_EXTENSION_POLICY_SURFACE_CONTRACTS)[number];
25
25
  /** Public contract for pm core command names, shared by SDK and presentation-layer consumers. */
@@ -7,7 +7,7 @@
7
7
  * flag surface stays single-sourced across the CLI, SDK, and MCP boundaries.
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]="40309a44-7d45-5333-9003-6fc740e827c8")}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]="a5a2c81f-8870-5111-b13c-74c362098d54")}catch(e){}}();
11
11
  import { normalizeUniqueStringList } from "./string-lists.js";
12
12
  import { RESERVED_EXTENSION_HOST_FLAGS } from "../../core/extensions/reserved-host-flags.js";
13
13
  function normalizeFlagAliasKey(flag) {
@@ -392,7 +392,7 @@ export const SCHEMA_FLAG_CONTRACTS = [
392
392
  // add-type --infer flags (title-prefix type inference).
393
393
  { flag: "--infer" },
394
394
  { flag: "--min-count" },
395
- { flag: "--apply" },
395
+ { flag: "--apply", value_type: "boolean" },
396
396
  // Lossless schema evolution flags.
397
397
  { flag: "--to" },
398
398
  { flag: "--migration-id", aliases: ["--migration_id"] },
@@ -1018,6 +1018,9 @@ export const ASSURANCE_FLAG_CONTRACTS = [
1018
1018
  { flag: "--dry-run" },
1019
1019
  { flag: "--author", value_name: "value" },
1020
1020
  { flag: "--message", value_name: "value" },
1021
+ { flag: "--owner", value_name: "item-id" },
1022
+ { flag: "--apply", value_type: "boolean" },
1023
+ { flag: "--enforcement", value_name: "level" },
1021
1024
  ];
1022
1025
  const ITEM_OWNERSHIP_AND_ISSUE_FLAG_CONTRACTS = [
1023
1026
  { flag: "--assignee" },
@@ -1814,4 +1817,4 @@ export function toCompletionFlagString(flagContracts, includeGlobal = true) {
1814
1817
  return normalizeUniqueStringList(all).join(" ");
1815
1818
  }
1816
1819
  //# sourceMappingURL=flag-contracts.js.map
1817
- //# debugId=40309a44-7d45-5333-9003-6fc740e827c8
1820
+ //# debugId=a5a2c81f-8870-5111-b13c-74c362098d54
@@ -231,8 +231,13 @@ interface CommandSummarySurface {
231
231
  command: string;
232
232
  aliases?: string[];
233
233
  intent: string;
234
+ intent_source: "command" | "description" | "generated";
234
235
  flags?: string[];
235
236
  default_max_estimated_tokens: number;
237
+ default_max_estimated_tokens_by_format: {
238
+ toon: number;
239
+ json: number;
240
+ };
236
241
  }
237
242
  declare function packageOwnedActionForCommand(command: string): string;
238
243
  declare function resolveActionCommandPath(action: PmToolAction): string | null;
@@ -275,7 +280,7 @@ declare function toRuntimeShortFlagToken(token: string): string | null;
275
280
  declare function buildRuntimeFieldFlagContracts(fieldRegistry: RuntimeFieldRegistry): Map<string, CliFlagContract[]>;
276
281
  declare function attachCreateRequiredOptionContracts(schema: Record<string, unknown>, metadata: Record<string, unknown>): Record<string, unknown>;
277
282
  declare function readContractsSettings(pmRoot: string, readSettingsFn?: typeof readSettings): Promise<Awaited<ReturnType<typeof readSettings>>>;
278
- declare function buildCommandSummarySurface(commands: readonly string[]): CommandSummarySurface[];
283
+ declare function buildCommandSummarySurface(commands: readonly string[], extensionContracts?: readonly ExtensionCommandContract[]): CommandSummarySurface[];
279
284
  declare function buildCommandOutputContracts(commands: readonly string[]): NonNullable<ContractsResult["command_output_contracts"]>;
280
285
  declare function buildCommandExitContractGroups(commands: readonly string[]): NonNullable<ContractsResult["command_exit_contracts"]>["command_sets"];
281
286
  /** Implements run contracts for the public runtime surface of this module. */