@unbrained/pm-cli 2026.8.12 → 2026.8.13

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 (173) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +22 -0
  3. package/dist/cli/error-guidance.js +4 -8
  4. package/dist/cli/main.js +3 -2
  5. package/dist/cli/register-assurance.js +28 -17
  6. package/dist/cli-bundle/bundle-manifest.json +161 -161
  7. package/dist/cli-bundle/chunks/chunk-3ZMOWAFM.js +2 -0
  8. package/dist/cli-bundle/chunks/chunk-DEDU3DG7.js +196 -0
  9. package/dist/cli-bundle/chunks/chunk-DL5M5J3V.js +13 -0
  10. package/dist/cli-bundle/chunks/chunk-F7FJYGK3.js +8 -0
  11. package/dist/cli-bundle/chunks/{chunk-RBTK5EZV.js → chunk-HIUZVCMN.js} +2 -2
  12. package/dist/cli-bundle/chunks/chunk-IMGIN7R6.js +2 -0
  13. package/dist/cli-bundle/chunks/{chunk-WLAHPSOX.js → chunk-Q47C67TQ.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-BM5YJ2UW.js → chunk-QGTUPEU5.js} +52 -52
  15. package/dist/cli-bundle/chunks/chunk-TF3TPKPR.js +34 -0
  16. package/dist/cli-bundle/chunks/{chunk-KOQMGCTA.js → chunk-YLBAPY22.js} +50 -50
  17. package/dist/cli-bundle/chunks/{register-list-query-XPCJRUUD.js → register-list-query-4HIZ7EA3.js} +2 -2
  18. package/dist/cli-bundle/chunks/{register-mutation-4RJCBKRS.js → register-mutation-W64FZ5HN.js} +2 -2
  19. package/dist/cli-bundle/chunks/register-operations-C44ET7R5.js +2 -0
  20. package/dist/cli-bundle/chunks/{register-setup-LLHAKP2V.js → register-setup-634MFRXU.js} +2 -2
  21. package/dist/cli-bundle/focused-chunks/chunk-27N23W6M.js +31 -0
  22. package/dist/cli-bundle/focused-chunks/{chunk-YIAXMC3T.js → chunk-2JP7W7GO.js} +2 -2
  23. package/dist/cli-bundle/focused-chunks/chunk-2RI2FESN.js +4 -0
  24. package/dist/cli-bundle/focused-chunks/chunk-3BNVU6LC.js +8 -0
  25. package/dist/cli-bundle/focused-chunks/{chunk-KHM2CS2C.js → chunk-3DJSGWVB.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/{chunk-2DALMVF7.js → chunk-6MLIRBLV.js} +2 -2
  27. package/dist/cli-bundle/focused-chunks/chunk-6XYLENDV.js +155 -0
  28. package/dist/cli-bundle/focused-chunks/chunk-CP4K4WFS.js +2 -0
  29. package/dist/cli-bundle/focused-chunks/{chunk-RWPAWUOT.js → chunk-E3AVJ655.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-5TAGTDRE.js → chunk-EBTNSFYE.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-KPSXVBDV.js → chunk-HC2OL2H2.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/{chunk-GQW4BPUT.js → chunk-I75MANL7.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/{chunk-ZMGWAYH7.js → chunk-IIS2FRKL.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/chunk-NFHFZH2Z.js +2 -0
  35. package/dist/cli-bundle/focused-chunks/chunk-OGC4XSBC.js +17 -0
  36. package/dist/cli-bundle/focused-chunks/{chunk-JAFRIWVF.js → chunk-OOYYKQWX.js} +4 -4
  37. package/dist/cli-bundle/focused-chunks/{chunk-KTLOKKCQ.js → chunk-PKPOZXLL.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/chunk-QDZUABWL.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/chunk-QQX5TDFT.js +16 -0
  40. package/dist/cli-bundle/focused-chunks/{chunk-NYLOUPOB.js → chunk-TEZIXMTH.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/chunk-WEH6NSL6.js +18 -0
  42. package/dist/cli-bundle/main.js +13 -13
  43. package/dist/cli-bundle/sdk-authoring.js +1 -1
  44. package/dist/cli-bundle/sdk-contracts.js +1 -1
  45. package/dist/cli-bundle/sdk-core.js +42 -41
  46. package/dist/cli-bundle/sdk-governance.js +1 -1
  47. package/dist/cli-bundle/sdk-graph.js +1 -1
  48. package/dist/cli-bundle/sdk-merge.js +1 -1
  49. package/dist/cli-bundle/sdk-query.js +1 -1
  50. package/dist/cli-bundle/sdk-runtime.js +1 -1
  51. package/dist/cli-bundle/sdk-testing.js +1 -1
  52. package/dist/cli-bundle/sdk.js +2 -2
  53. package/dist/core/checkpoint/checkpoint-gc.js +7 -12
  54. package/dist/core/extensions/activation-summary-markdown.js +5 -4
  55. package/dist/core/extensions/activation-summary.d.ts +2 -0
  56. package/dist/core/extensions/activation-summary.js +6 -2
  57. package/dist/core/extensions/capability-usage.d.ts +1 -1
  58. package/dist/core/extensions/capability-usage.js +4 -3
  59. package/dist/core/extensions/contribution-inventory.d.ts +1 -0
  60. package/dist/core/extensions/contribution-inventory.js +6 -2
  61. package/dist/core/extensions/extension-registries.js +3 -2
  62. package/dist/core/extensions/extension-types.d.ts +83 -1
  63. package/dist/core/extensions/extension-types.js +3 -2
  64. package/dist/core/extensions/loader.d.ts +2 -8
  65. package/dist/core/extensions/loader.js +53 -144
  66. package/dist/core/extensions/registration-values.d.ts +43 -0
  67. package/dist/core/extensions/registration-values.js +210 -0
  68. package/dist/core/extensions/runtime-registrations.d.ts +3 -1
  69. package/dist/core/extensions/runtime-registrations.js +12 -2
  70. package/dist/core/fs/fs-utils.d.ts +2 -0
  71. package/dist/core/fs/fs-utils.js +7 -3
  72. package/dist/core/history/drift-cache.js +4 -3
  73. package/dist/core/history/drift-scan.js +5 -11
  74. package/dist/core/lock/lock-gc.js +8 -13
  75. package/dist/core/lock/lock.js +5 -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/schemas/assurance-definition.d.ts +32 -0
  87. package/dist/sdk/cli-contracts/schemas/assurance-definition.js +25 -2
  88. package/dist/sdk/cli-contracts/tool-parameter-tables.js +35 -5
  89. package/dist/sdk/cli-contracts/tool-schema.js +17 -2
  90. package/dist/sdk/comments.js +4 -3
  91. package/dist/sdk/compile-cache.js +4 -3
  92. package/dist/sdk/compose.d.ts +3 -1
  93. package/dist/sdk/compose.js +16 -2
  94. package/dist/sdk/context-signal-store.js +4 -3
  95. package/dist/sdk/extension/install-runtime.js +4 -4
  96. package/dist/sdk/extension/managed-state.js +4 -3
  97. package/dist/sdk/extension-contracts.d.ts +1 -1
  98. package/dist/sdk/flag-invocation-contracts.js +5 -6
  99. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +14 -2
  100. package/dist/sdk/governance/assurance-action.d.ts +27 -3
  101. package/dist/sdk/governance/assurance-action.js +112 -28
  102. package/dist/sdk/governance/assurance-mutation-error.d.ts +7 -0
  103. package/dist/sdk/governance/assurance-mutation-error.js +25 -2
  104. package/dist/sdk/governance/assurance-presets.d.ts +54 -0
  105. package/dist/sdk/governance/assurance-presets.js +136 -0
  106. package/dist/sdk/governance/assurance-runtime.d.ts +4 -0
  107. package/dist/sdk/governance/assurance-runtime.js +109 -8
  108. package/dist/sdk/governance/assurance.d.ts +39 -0
  109. package/dist/sdk/governance/assurance.js +143 -4
  110. package/dist/sdk/governance/gc.js +5 -11
  111. package/dist/sdk/governance/health.js +5 -5
  112. package/dist/sdk/governance/validate.js +4 -4
  113. package/dist/sdk/graph/durable-cache.js +61 -3
  114. package/dist/sdk/graph/governance-contracts.d.ts +12 -0
  115. package/dist/sdk/graph/governance-contracts.js +27 -0
  116. package/dist/sdk/graph/governance.d.ts +30 -2
  117. package/dist/sdk/graph/governance.js +124 -5
  118. package/dist/sdk/guide.js +4 -4
  119. package/dist/sdk/index.d.ts +2 -1
  120. package/dist/sdk/index.js +4 -3
  121. package/dist/sdk/linked-artifacts.d.ts +2 -0
  122. package/dist/sdk/linked-artifacts.js +29 -4
  123. package/dist/sdk/merge/install.js +5 -4
  124. package/dist/sdk/query/activity.js +4 -3
  125. package/dist/sdk/relationship-history.js +5 -5
  126. package/dist/sdk/schema-migration.js +4 -4
  127. package/dist/sdk/test/execution.js +4 -4
  128. package/dist/sdk/workspace-memory.js +4 -4
  129. package/dist/sdk/workspace-snapshot.js +8 -14
  130. package/dist/sdk/workspace-transaction-gc.js +4 -9
  131. package/dist/sdk/workspace-transaction.js +4 -4
  132. package/dist/sdk/workspace.js +4 -3
  133. package/docs/ASSURANCE.md +154 -3
  134. package/docs/CONFIGURATION.md +2 -0
  135. package/docs/EXTENSIONS.md +11 -12
  136. package/docs/RELATIONSHIP_GRAPH.md +15 -0
  137. package/docs/SDK.md +17 -3
  138. package/docs/TESTING.md +24 -15
  139. package/marketplace.json +2 -2
  140. package/package.json +3 -3
  141. package/packages/pm-beads/package.json +1 -1
  142. package/packages/pm-calendar/package.json +1 -1
  143. package/packages/pm-command-kit/package.json +1 -1
  144. package/packages/pm-digital-twin/package.json +1 -1
  145. package/packages/pm-governance-audit/package.json +1 -1
  146. package/packages/pm-guide-shell/package.json +1 -1
  147. package/packages/pm-kanban/package.json +1 -1
  148. package/packages/pm-lifecycle-hooks/package.json +1 -1
  149. package/packages/pm-linked-test-adapters/package.json +1 -1
  150. package/packages/pm-search-advanced/package.json +1 -1
  151. package/packages/pm-templates/package.json +1 -1
  152. package/packages/pm-todos/package.json +1 -1
  153. package/packages/pm-vcs/package.json +1 -1
  154. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  155. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  156. package/sdk/public-surface.json +183 -33
  157. package/dist/cli-bundle/chunks/chunk-3PS7X6GS.js +0 -8
  158. package/dist/cli-bundle/chunks/chunk-7KL6KMWF.js +0 -13
  159. package/dist/cli-bundle/chunks/chunk-D55A5AEN.js +0 -33
  160. package/dist/cli-bundle/chunks/chunk-KIKDWECH.js +0 -196
  161. package/dist/cli-bundle/chunks/chunk-R76342NV.js +0 -2
  162. package/dist/cli-bundle/chunks/chunk-VLUQOIDT.js +0 -2
  163. package/dist/cli-bundle/chunks/register-operations-2OGISOVR.js +0 -2
  164. package/dist/cli-bundle/focused-chunks/chunk-5OQIMELN.js +0 -155
  165. package/dist/cli-bundle/focused-chunks/chunk-ECADZMVC.js +0 -18
  166. package/dist/cli-bundle/focused-chunks/chunk-EJGXRA6B.js +0 -2
  167. package/dist/cli-bundle/focused-chunks/chunk-FFGSZCPK.js +0 -16
  168. package/dist/cli-bundle/focused-chunks/chunk-ISKOBJCM.js +0 -2
  169. package/dist/cli-bundle/focused-chunks/chunk-LGYK3NUF.js +0 -8
  170. package/dist/cli-bundle/focused-chunks/chunk-NBLUKITQ.js +0 -4
  171. package/dist/cli-bundle/focused-chunks/chunk-Q4T463SD.js +0 -31
  172. package/dist/cli-bundle/focused-chunks/chunk-QVZVY53N.js +0 -2
  173. package/dist/cli-bundle/focused-chunks/chunk-UTEWXDEQ.js +0 -17
@@ -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
@@ -303,6 +303,7 @@ export declare const ASSURANCE_DEFINITION_SCHEMA: {
303
303
  negative_control?: undefined;
304
304
  assertion_ids?: undefined;
305
305
  triggers?: undefined;
306
+ provider_policy?: undefined;
306
307
  };
307
308
  oneOf?: undefined;
308
309
  allOf?: undefined;
@@ -463,6 +464,7 @@ export declare const ASSURANCE_DEFINITION_SCHEMA: {
463
464
  source?: undefined;
464
465
  assertion_ids?: undefined;
465
466
  triggers?: undefined;
467
+ provider_policy?: undefined;
466
468
  };
467
469
  } | {
468
470
  type: string;
@@ -491,6 +493,36 @@ export declare const ASSURANCE_DEFINITION_SCHEMA: {
491
493
  enum: string[];
492
494
  };
493
495
  };
496
+ provider_policy: {
497
+ type: string;
498
+ additionalProperties: boolean;
499
+ required: string[];
500
+ properties: {
501
+ allowed_providers: {
502
+ type: string;
503
+ items: {
504
+ type: string;
505
+ minLength: number;
506
+ };
507
+ };
508
+ triggers: {
509
+ type: string;
510
+ additionalProperties: {
511
+ type: string;
512
+ additionalProperties: boolean;
513
+ required: string[];
514
+ properties: {
515
+ max_cost_class: {
516
+ enum: string[];
517
+ };
518
+ allow_network: {
519
+ type: string;
520
+ };
521
+ };
522
+ };
523
+ };
524
+ };
525
+ };
494
526
  max_cost?: undefined;
495
527
  source?: undefined;
496
528
  measurement_id?: undefined;
@@ -4,7 +4,7 @@
4
4
  * Defines the strict JSON Schema accepted by assurance definition mutations.
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]="2d81fb20-890a-553b-b761-d60caf56b502")}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]="19a97f60-3b6e-5653-a652-02aebaf5afdd")}catch(e){}}();
8
8
  const ASSURANCE_VALUE_SCHEMA = {
9
9
  oneOf: [{ type: "number" }, { type: "array", items: { type: "string" } }],
10
10
  };
@@ -244,9 +244,32 @@ export const ASSURANCE_DEFINITION_SCHEMA = {
244
244
  ],
245
245
  },
246
246
  },
247
+ provider_policy: {
248
+ type: "object",
249
+ additionalProperties: false,
250
+ required: ["allowed_providers", "triggers"],
251
+ properties: {
252
+ allowed_providers: {
253
+ type: "array",
254
+ items: { type: "string", minLength: 1 },
255
+ },
256
+ triggers: {
257
+ type: "object",
258
+ additionalProperties: {
259
+ type: "object",
260
+ additionalProperties: false,
261
+ required: ["max_cost_class", "allow_network"],
262
+ properties: {
263
+ max_cost_class: { enum: ["low", "medium", "high"] },
264
+ allow_network: { type: "boolean" },
265
+ },
266
+ },
267
+ },
268
+ },
269
+ },
247
270
  },
248
271
  },
249
272
  ],
250
273
  };
251
274
  //# sourceMappingURL=assurance-definition.js.map
252
- //# debugId=2d81fb20-890a-553b-b761-d60caf56b502
275
+ //# debugId=19a97f60-3b6e-5653-a652-02aebaf5afdd
@@ -4,7 +4,7 @@
4
4
  * Defines SDK command-contract metadata for Tool Parameter Tables.
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]="6cdf1fd1-7328-5bae-9238-d317f6efba8a")}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]="9a679120-6f16-5588-b4d4-91c90a2fe385")}catch(e){}}();
8
8
  import { PLAN_HARNESS_VALUES, PLAN_MODE_VALUES, PLAN_STEP_LINK_KIND_VALUES, PLAN_STEP_STATUS_VALUES, } from "../../types/index.js";
9
9
  import { PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS } from "../read-output-session.js";
10
10
  import { ASSURANCE_DEFINITION_SCHEMA } from "./schemas/assurance-definition.js";
@@ -219,6 +219,8 @@ export const PM_TOOL_PARAMETER_PROPERTIES = {
219
219
  acceptanceCriteria: { type: "string" },
220
220
  author: { type: "string" },
221
221
  message: { type: "string" },
222
+ owner: { type: "string" },
223
+ enforcement: { type: "string" },
222
224
  assignee: { type: "string" },
223
225
  assigneeFilter: { type: "string", enum: ["assigned", "unassigned"] },
224
226
  parent: { type: "string" },
@@ -646,8 +648,24 @@ export const PM_TOOL_ACTION_SCOPED_PARAMETER_PROPERTIES = {
646
648
  },
647
649
  subcommand: {
648
650
  type: "string",
649
- enum: ["list", "show", "put", "remove", "run", "verdicts"],
651
+ enum: [
652
+ "list",
653
+ "show",
654
+ "put",
655
+ "remove",
656
+ "run",
657
+ "verdicts",
658
+ "presets",
659
+ "apply",
660
+ "derive",
661
+ "promote",
662
+ ],
663
+ },
664
+ preset: {
665
+ type: "string",
666
+ enum: ["software-delivery", "research", "agent-evaluation", "operations"],
650
667
  },
668
+ enforcement: { type: "string", enum: ["warn", "block"] },
651
669
  limit: { type: "integer", minimum: 1, maximum: 1000 },
652
670
  },
653
671
  activity: {
@@ -970,6 +988,14 @@ export const PM_TOOL_PARAMETER_METADATA = {
970
988
  description: "Stable assurance gate id used to filter durable verdict history.",
971
989
  examples: ["release-readiness"],
972
990
  },
991
+ owner: {
992
+ description: "pm item that owns preset or observation-derived assurance assertions.",
993
+ examples: ["pm-a1b2"],
994
+ },
995
+ enforcement: {
996
+ description: "Explicit next assurance enforcement level.",
997
+ examples: ["warn", "block"],
998
+ },
973
999
  runId: {
974
1000
  description: "Background test run identifier.",
975
1001
  examples: ["tr-kq9x3f-93acde"],
@@ -1850,8 +1876,8 @@ export const PM_TOOL_PARAMETER_METADATA = {
1850
1876
  export const PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
1851
1877
  assurance: {
1852
1878
  subcommand: {
1853
- description: "Assurance operation: list, show, put, remove, run, or verdicts.",
1854
- examples: ["list", "run", "verdicts"],
1879
+ description: "Assurance operation: list, show, put, remove, run, verdicts, presets, apply, derive, or promote.",
1880
+ examples: ["list", "run", "derive", "promote"],
1855
1881
  },
1856
1882
  kind: {
1857
1883
  description: "Assurance declaration kind for registry operations: measurement, assertion, or gate.",
@@ -1865,6 +1891,10 @@ export const PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
1865
1891
  description: "Maximum number of newest assurance verdicts returned.",
1866
1892
  examples: [10, 25],
1867
1893
  },
1894
+ preset: {
1895
+ description: "Built-in assurance project shape to preview or apply.",
1896
+ examples: ["software-delivery", "agent-evaluation"],
1897
+ },
1868
1898
  },
1869
1899
  update: {
1870
1900
  acceptanceCriteria: {
@@ -2019,4 +2049,4 @@ export const PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
2019
2049
  },
2020
2050
  };
2021
2051
  //# sourceMappingURL=tool-parameter-tables.js.map
2022
- //# debugId=6cdf1fd1-7328-5bae-9238-d317f6efba8a
2052
+ //# debugId=9a679120-6f16-5588-b4d4-91c90a2fe385
@@ -7,7 +7,7 @@
7
7
  * consumers from a single source of truth.
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]="5a184f36-a305-59f1-8c68-ef53cea1df1e")}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]="d4550d60-3907-528e-b984-c8ca90b7a4e8")}catch(e){}}();
11
11
  import { normalizeUniqueStringList } from "./string-lists.js";
12
12
  import { PM_TOOL_ACTIONS } from "./enum-contracts.js";
13
13
  import { TOOL_CREATE_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS, TOOL_CONTEXT_OPTION_CONTRACTS, TOOL_ACTIVITY_OPTION_CONTRACTS, TOOL_LIST_FILTER_OPTION_CONTRACTS, TOOL_AGGREGATE_OPTION_CONTRACTS, TOOL_SEARCH_FILTER_OPTION_CONTRACTS, TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS, } from "./tool-option-contracts.js";
@@ -1119,6 +1119,10 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
1119
1119
  "dryRun",
1120
1120
  "author",
1121
1121
  "message",
1122
+ "preset",
1123
+ "owner",
1124
+ "apply",
1125
+ "enforcement",
1122
1126
  ],
1123
1127
  conditionalRequired: [
1124
1128
  { property: "subcommand", value: "list", required: ["kind"] },
@@ -1130,6 +1134,17 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
1130
1134
  },
1131
1135
  { property: "subcommand", value: "remove", required: ["kind", "id"] },
1132
1136
  { property: "subcommand", value: "run", required: ["id", "trigger"] },
1137
+ {
1138
+ property: "subcommand",
1139
+ value: "apply",
1140
+ required: ["preset", "owner"],
1141
+ },
1142
+ { property: "subcommand", value: "derive", required: ["owner"] },
1143
+ {
1144
+ property: "subcommand",
1145
+ value: "promote",
1146
+ required: ["id", "enforcement"],
1147
+ },
1133
1148
  ],
1134
1149
  },
1135
1150
  gc: { optional: ["dryRun", "gcScope"] },
@@ -1558,4 +1573,4 @@ export const _testOnlyCliContracts = {
1558
1573
  withFlagAliasMetadata,
1559
1574
  };
1560
1575
  //# sourceMappingURL=tool-schema.js.map
1561
- //# debugId=5a184f36-a305-59f1-8c68-ef53cea1df1e
1576
+ //# debugId=d4550d60-3907-528e-b984-c8ca90b7a4e8
@@ -4,7 +4,8 @@
4
4
  * Implements the pm comments 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]="667218ac-866c-59b1-8309-18ad92434fca")}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]="a7687052-a04e-536e-ace5-a665ebd477e3")}catch(e){}}();
8
+ import { isFileAbsentError } from "../core/fs/fs-utils.js";
8
9
  import { readFile } from "node:fs/promises";
9
10
  import { EXIT_CODE, PmCliError, createStdinTokenResolver, } from "./runtime-primitives.js";
10
11
  import { isErrnoError, parseAnnotationTextInput, runAnnotationCommand, } from "./annotations.js";
@@ -36,7 +37,7 @@ async function resolveCommentTextSource(options, stdinResolver) {
36
37
  return { value: fileInput, emptyFlag: "--file" };
37
38
  }
38
39
  catch (error) {
39
- if (isErrnoError(error) && error.code === "ENOENT") {
40
+ if (isErrnoError(error) && isFileAbsentError(error)) {
40
41
  throw new PmCliError(`--file path not found: ${filePath}`, EXIT_CODE.USAGE);
41
42
  }
42
43
  const detail = error instanceof Error ? error.message : String(error);
@@ -122,4 +123,4 @@ export async function runComments(id, options, global) {
122
123
  });
123
124
  }
124
125
  //# sourceMappingURL=comments.js.map
125
- //# debugId=667218ac-866c-59b1-8309-18ad92434fca
126
+ //# debugId=a7687052-a04e-536e-ace5-a665ebd477e3
@@ -5,7 +5,8 @@
5
5
  * compile-cache generations.
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]="6748a283-bc93-5783-98c1-d1a7f2fdce4e")}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]="611e9aba-d08e-5c1a-89c9-c7fda0cc9bc9")}catch(e){}}();
9
+ import { isFileMissingError } from "../core/fs/fs-utils.js";
9
10
  import fs from "node:fs";
10
11
  import path from "node:path";
11
12
  const COMPILE_CACHE_CONCURRENT_GRACE_MS = 5 * 60 * 1000;
@@ -44,7 +45,7 @@ export function pruneCompileCacheGenerations(cacheRoot, currentGeneration) {
44
45
  catch (error) {
45
46
  if (error instanceof Error &&
46
47
  "code" in error &&
47
- error.code === "ENOENT") {
48
+ isFileMissingError(error)) {
48
49
  return [];
49
50
  }
50
51
  throw error;
@@ -70,4 +71,4 @@ export function pruneCompileCacheGenerations(cacheRoot, currentGeneration) {
70
71
  return { retained: normalizedGeneration, removed };
71
72
  }
72
73
  //# sourceMappingURL=compile-cache.js.map
73
- //# debugId=6748a283-bc93-5783-98c1-d1a7f2fdce4e
74
+ //# debugId=611e9aba-d08e-5c1a-89c9-c7fda0cc9bc9