@unbrained/pm-cli 2026.8.26 → 2026.8.28

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 (196) hide show
  1. package/.agents/skills/HARNESS_COMPATIBILITY.md +32 -0
  2. package/.agents/skills/README.md +47 -0
  3. package/.agents/skills/pm-developer/SKILL.md +117 -0
  4. package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +49 -0
  5. package/.agents/skills/pm-developer/references/GRAPH_AND_RELATIONSHIPS.md +91 -0
  6. package/.agents/skills/pm-developer/references/MULTI_AGENT_MERGE.md +72 -0
  7. package/.agents/skills/pm-developer/references/PROMPTS.md +17 -0
  8. package/.agents/skills/pm-developer/references/SCRIPTING_COMPOSITION.md +82 -0
  9. package/.agents/skills/pm-developer/references/TOKEN_BUDGETS.md +85 -0
  10. package/.agents/skills/pm-extensions/SKILL.md +106 -0
  11. package/.agents/skills/pm-extensions/references/AUTHORING.md +95 -0
  12. package/.agents/skills/pm-extensions/references/LIFECYCLE.md +40 -0
  13. package/.agents/skills/pm-extensions/references/TROUBLESHOOTING.md +25 -0
  14. package/.agents/skills/pm-sdk/SKILL.md +107 -0
  15. package/.agents/skills/pm-sdk/references/DOMAIN_MODELING.md +78 -0
  16. package/.agents/skills/pm-sdk/references/INTEGRATION_CHECKLIST.md +31 -0
  17. package/.agents/skills/pm-sdk/references/PROMPTS.md +13 -0
  18. package/.agents/skills/pm-sdk/references/SURFACE_MAP.md +82 -0
  19. package/.agents/skills/pm-user/SKILL.md +111 -0
  20. package/.agents/skills/pm-user/references/BACKLOG_SHAPING.md +105 -0
  21. package/.agents/skills/pm-user/references/PROMPTS.md +17 -0
  22. package/.agents/skills/pm-user/references/WORKFLOWS.md +35 -0
  23. package/.claude-plugin/marketplace.json +2 -2
  24. package/CHANGELOG.md +50 -4
  25. package/README.md +8 -5
  26. package/dist/cli/commander-usage.js +11 -7
  27. package/dist/cli/error-guidance.js +62 -8
  28. package/dist/cli/help-content.d.ts +2 -0
  29. package/dist/cli/help-content.js +53 -17
  30. package/dist/cli/help-json-payload.d.ts +8 -2
  31. package/dist/cli/help-json-payload.js +46 -12
  32. package/dist/cli/main.js +52 -74
  33. package/dist/cli/register-annotations.js +83 -60
  34. package/dist/cli/register-setup.js +98 -57
  35. package/dist/cli-bundle/bundle-manifest.json +151 -151
  36. package/dist/cli-bundle/chunks/{chunk-UKBCRPA2.js → chunk-BY2FQ2NI.js} +2 -2
  37. package/dist/cli-bundle/chunks/chunk-E73FDIWT.js +3 -0
  38. package/dist/cli-bundle/chunks/{chunk-WRHJ3MB6.js → chunk-FEVBFFCQ.js} +2 -2
  39. package/dist/cli-bundle/chunks/{chunk-KBFP3E4E.js → chunk-M7OXRQE3.js} +66 -44
  40. package/dist/cli-bundle/chunks/{chunk-S4U76VZF.js → chunk-NBCBFVZI.js} +2 -2
  41. package/dist/cli-bundle/chunks/{chunk-ZNRLJ54C.js → chunk-NTXZHRKA.js} +45 -45
  42. package/dist/cli-bundle/chunks/chunk-QE6WQXFO.js +3 -0
  43. package/dist/cli-bundle/chunks/chunk-TIQ6AMH2.js +13 -0
  44. package/dist/cli-bundle/chunks/chunk-X2RROGZE.js +2 -0
  45. package/dist/cli-bundle/chunks/{chunk-E2GCFJSU.js → chunk-XRVVYRRO.js} +33 -33
  46. package/dist/cli-bundle/chunks/chunk-XWEQGHHG.js +202 -0
  47. package/dist/cli-bundle/chunks/{register-list-query-EMCPMICY.js → register-list-query-J35ZPQQ5.js} +2 -2
  48. package/dist/cli-bundle/chunks/{register-mutation-OJ67ABCB.js → register-mutation-J6XJJOGU.js} +4 -4
  49. package/dist/cli-bundle/chunks/{register-operations-H2GLP7LT.js → register-operations-AE3JEMFT.js} +2 -2
  50. package/dist/cli-bundle/chunks/register-setup-OQERLLWE.js +2 -0
  51. package/dist/cli-bundle/focused-chunks/{chunk-72T6JGAE.js → chunk-4ZDRZYYJ.js} +43 -43
  52. package/dist/cli-bundle/focused-chunks/{chunk-OHIHZ7HS.js → chunk-6GCRSLPG.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-UYBA57GY.js → chunk-AD6ULRAF.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{chunk-FXDLT6FL.js → chunk-AHAM2HAU.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/{chunk-LV5N3LK5.js → chunk-FC2AXLB5.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-IBHXMFE7.js → chunk-HC7ODMH3.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/{chunk-4K2II4TV.js → chunk-HVQ22RC4.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{chunk-MMXUPDDJ.js → chunk-JZYPPMXF.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/chunk-LLNTHF5X.js +2 -0
  60. package/dist/cli-bundle/focused-chunks/chunk-LYFWQMVC.js +2 -0
  61. package/dist/cli-bundle/focused-chunks/{chunk-A644DUFQ.js → chunk-MEASX544.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{chunk-YO3ZF3FI.js → chunk-THEPQMLX.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{chunk-57XY346D.js → chunk-XDPYBQCF.js} +9 -9
  64. package/dist/cli-bundle/focused-chunks/{chunk-TMJDFHVD.js → chunk-Y3JJXRVK.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/{chunk-66VGB23P.js → chunk-Y5A7SJJ7.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/chunk-YJLDHJOD.js +2 -0
  67. package/dist/cli-bundle/focused-chunks/{chunk-P2E6LDAE.js → chunk-YVVZ3LQ6.js} +3 -3
  68. package/dist/cli-bundle/focused-chunks/chunk-Z2USIBR2.js +5 -0
  69. package/dist/cli-bundle/main.js +15 -14
  70. package/dist/cli-bundle/sdk-authoring.js +1 -1
  71. package/dist/cli-bundle/sdk-contracts.js +2 -2
  72. package/dist/cli-bundle/sdk-core.js +31 -31
  73. package/dist/cli-bundle/sdk-governance.js +1 -1
  74. package/dist/cli-bundle/sdk-graph.js +1 -1
  75. package/dist/cli-bundle/sdk-merge.js +31 -31
  76. package/dist/cli-bundle/sdk-query.js +1 -1
  77. package/dist/cli-bundle/sdk-runtime.js +1 -1
  78. package/dist/cli-bundle/sdk-testing.js +1 -1
  79. package/dist/cli-bundle/sdk.js +32 -7
  80. package/dist/core/governance/issue-codes.d.ts +11 -2
  81. package/dist/core/governance/issue-codes.js +29 -10
  82. package/dist/core/item/item-format.js +3 -3
  83. package/dist/core/store/item-store.js +12 -5
  84. package/dist/mcp/server.js +123 -9
  85. package/dist/mcp/tool-definitions.d.ts +2 -0
  86. package/dist/mcp/tool-definitions.js +5 -5
  87. package/dist/sdk/agent/closed-domain-contracts.d.ts +1 -1
  88. package/dist/sdk/agent/closed-domain-contracts.js +24 -2
  89. package/dist/sdk/agent/command-recovery.js +3 -3
  90. package/dist/sdk/agent/task-transcript-contracts.d.ts +52 -0
  91. package/dist/sdk/agent/task-transcript-contracts.js +198 -0
  92. package/dist/sdk/agent-capability-contracts.js +6 -2
  93. package/dist/sdk/annotations.d.ts +5 -2
  94. package/dist/sdk/annotations.js +66 -36
  95. package/dist/sdk/cli-bootstrap.d.ts +2 -8
  96. package/dist/sdk/cli-bootstrap.js +7 -66
  97. package/dist/sdk/cli-contracts/bootstrap-command-scanner.d.ts +23 -0
  98. package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +80 -0
  99. package/dist/sdk/cli-contracts/command-aliases.js +15 -2
  100. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -1
  101. package/dist/sdk/cli-contracts/enum-contracts.js +7 -2
  102. package/dist/sdk/cli-contracts/flag-contracts.js +12 -5
  103. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +5 -5
  104. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +3 -3
  105. package/dist/sdk/cli-contracts/grammar-contracts.js +24 -17
  106. package/dist/sdk/cli-contracts/runtime-contracts.js +13 -11
  107. package/dist/sdk/cli-contracts/tool-parameter-tables.js +15 -2
  108. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  109. package/dist/sdk/cli-contracts/tool-schema.js +32 -16
  110. package/dist/sdk/cli-contracts.d.ts +1 -1
  111. package/dist/sdk/cli-contracts.js +3 -3
  112. package/dist/sdk/cli-program.js +3 -2
  113. package/dist/sdk/comments.d.ts +4 -0
  114. package/dist/sdk/comments.js +2 -2
  115. package/dist/sdk/completion.js +47 -16
  116. package/dist/sdk/contracts.d.ts +1 -0
  117. package/dist/sdk/contracts.js +3 -2
  118. package/dist/sdk/extension/install-sources.d.ts +13 -0
  119. package/dist/sdk/extension/install-sources.js +62 -30
  120. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +26 -2
  121. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +38 -14
  122. package/dist/sdk/governance/upgrade.d.ts +2 -0
  123. package/dist/sdk/governance/upgrade.js +30 -8
  124. package/dist/sdk/governance/validate.js +8 -6
  125. package/dist/sdk/guide-topics.js +6 -6
  126. package/dist/sdk/index.d.ts +5 -2
  127. package/dist/sdk/index.js +6 -3
  128. package/dist/sdk/learnings.d.ts +4 -0
  129. package/dist/sdk/learnings.js +7 -4
  130. package/dist/sdk/lifecycle/close.js +4 -3
  131. package/dist/sdk/mcp/apps.d.ts +70 -0
  132. package/dist/sdk/mcp/apps.js +154 -0
  133. package/dist/sdk/mcp/skills.d.ts +127 -0
  134. package/dist/sdk/mcp/skills.js +390 -0
  135. package/dist/sdk/notes.d.ts +4 -0
  136. package/dist/sdk/notes.js +2 -2
  137. package/dist/sdk/read-output-contracts.js +16 -3
  138. package/dist/sdk/runtime-action-aliases.js +7 -3
  139. package/dist/sdk/runtime-input.js +15 -4
  140. package/dist/sdk/runtime-primitives.d.ts +1 -1
  141. package/dist/sdk/runtime-primitives.js +3 -3
  142. package/dist/sdk/runtime.d.ts +6 -6
  143. package/dist/sdk/runtime.js +8 -8
  144. package/docs/CLI_GRAMMAR.md +7 -1
  145. package/docs/COMMANDS.md +5 -4
  146. package/docs/EXTENSIONS.md +33 -32
  147. package/docs/MCP_2026_07_28.md +24 -2
  148. package/docs/MCP_2026_07_28_CONFORMANCE.md +4 -4
  149. package/docs/MCP_SKILLS_AND_APPS.md +107 -0
  150. package/docs/OUTPUT_TOKEN_ACCOUNTING.md +20 -7
  151. package/docs/QUICKSTART.md +15 -15
  152. package/docs/README.md +1 -0
  153. package/docs/RELEASING.md +20 -4
  154. package/docs/SDK.md +12 -0
  155. package/docs/SDK_CONTEXT_INTEGRITY.md +18 -1
  156. package/docs/SDK_EVIDENCE_TRACEABILITY.md +9 -1
  157. package/docs/SDK_RUNTIME_BOUNDARIES.md +10 -0
  158. package/docs/TESTING.md +6 -2
  159. package/docs/agent-task-token-baseline.json +97 -11
  160. package/docs/agent-task-transcripts.json +211 -0
  161. package/docs/generated/AGENT_CAPABILITY_ROUTING.md +1 -1
  162. package/docs/generated/FLAG_LEXICON_BUDGETS.md +3 -3
  163. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +11 -7
  164. package/docs/performance/cli-transport-overhead.md +10 -2
  165. package/marketplace.json +2 -2
  166. package/package.json +10 -8
  167. package/packages/pm-beads/README.md +12 -6
  168. package/packages/pm-beads/docs/MIGRATION.md +53 -0
  169. package/packages/pm-beads/extensions/beads/index.ts +8 -0
  170. package/packages/pm-beads/extensions/beads/runtime.ts +671 -112
  171. package/packages/pm-beads/package.json +1 -1
  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/package.json +1 -1
  175. package/packages/pm-governance-audit/package.json +1 -1
  176. package/packages/pm-guide-shell/package.json +1 -1
  177. package/packages/pm-kanban/package.json +1 -1
  178. package/packages/pm-lifecycle-hooks/package.json +1 -1
  179. package/packages/pm-linked-test-adapters/package.json +1 -1
  180. package/packages/pm-search-advanced/package.json +1 -1
  181. package/packages/pm-templates/package.json +1 -1
  182. package/packages/pm-todos/package.json +1 -1
  183. package/packages/pm-vcs/package.json +1 -1
  184. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  185. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  186. package/sdk/public-surface.json +430 -36
  187. package/dist/cli-bundle/chunks/chunk-ES25LX3D.js +0 -202
  188. package/dist/cli-bundle/chunks/chunk-FRDWWB6R.js +0 -3
  189. package/dist/cli-bundle/chunks/chunk-ICQ3RVIY.js +0 -2
  190. package/dist/cli-bundle/chunks/chunk-IV64RJVE.js +0 -13
  191. package/dist/cli-bundle/chunks/chunk-MVYLQ67M.js +0 -3
  192. package/dist/cli-bundle/chunks/register-setup-GLZAHLVI.js +0 -2
  193. package/dist/cli-bundle/focused-chunks/chunk-4XNH2HM7.js +0 -2
  194. package/dist/cli-bundle/focused-chunks/chunk-7I23XGWO.js +0 -2
  195. package/dist/cli-bundle/focused-chunks/chunk-7YCDTCBC.js +0 -2
  196. package/dist/cli-bundle/focused-chunks/chunk-LMKG3DFE.js +0 -5
@@ -21,6 +21,15 @@ export interface IssueCodeItem {
21
21
  parent?: string | null;
22
22
  /** The id of the canonical item this one was closed as a duplicate of, when set. A closed-as-duplicate item has already been adjudicated, so it is excluded from collision detection entirely (GH-278) — re-flagging a resolved duplicate is permanent noise that erodes trust in `validate`. */
23
23
  duplicate_of?: string | null;
24
+ /** Optional body evidence used to disambiguate mixed-case prose compounds. */
25
+ body?: string | null;
26
+ }
27
+ /** Explicit classifier inputs for repository-specific issue-code formats. */
28
+ export interface IssueCodeDetectionOptions {
29
+ /** Prefixes configured by the repository, compared case-insensitively. */
30
+ configuredPrefixes?: readonly string[];
31
+ /** Item body used only for explicit code markers or backtick references. */
32
+ evidenceText?: string | null;
24
33
  }
25
34
  /** A logical issue code shared by two or more items. */
26
35
  export interface DuplicateIssueCode {
@@ -42,7 +51,7 @@ export interface DuplicateIssueCode {
42
51
  * Accepts unknown-ish input defensively (exported helper SDK consumers may call
43
52
  * from untyped JS): a non-string or empty title resolves to `null`.
44
53
  */
45
- export declare function extractIssueCode(title: string | null | undefined): string | null;
54
+ export declare function extractIssueCode(title: string | null | undefined, options?: IssueCodeDetectionOptions): string | null;
46
55
  /**
47
56
  * Find logical issue codes used by 2+ items. Any item whose title begins with a
48
57
  * conventional issue code contributes; codes used by a single item are not
@@ -67,4 +76,4 @@ export declare function extractIssueCode(title: string | null | undefined): stri
67
76
  * given (id) is used; duplicate ids (should not occur for a valid corpus) are
68
77
  * de-duplicated so an item never inflates its own code's count.
69
78
  */
70
- export declare function findDuplicateIssueCodes(items: readonly IssueCodeItem[]): DuplicateIssueCode[];
79
+ export declare function findDuplicateIssueCodes(items: readonly IssueCodeItem[], options?: Omit<IssueCodeDetectionOptions, "evidenceText">): DuplicateIssueCode[];
@@ -22,8 +22,8 @@
22
22
  * (digit immediately followed by a letter — no boundary) does not match.
23
23
  */
24
24
 
25
- !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]="087bac58-e32d-5cb8-8fda-0e09075c3f35")}catch(e){}}();
26
- const ISSUE_CODE_PATTERN = /^([A-Z][A-Z0-9]*-\d+)\b/;
25
+ !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]="8a7fbaf1-917f-5067-b9b6-a9f27c80e291")}catch(e){}}();
26
+ const ISSUE_CODE_PATTERN = /^([A-Z][A-Z0-9]*-\d+)\b/iu;
27
27
  /**
28
28
  * Extract the leading logical issue code from a title, or `null` when the title
29
29
  * does not begin with one. The title is trimmed and upper-cased before matching
@@ -33,16 +33,32 @@ const ISSUE_CODE_PATTERN = /^([A-Z][A-Z0-9]*-\d+)\b/;
33
33
  * Accepts unknown-ish input defensively (exported helper SDK consumers may call
34
34
  * from untyped JS): a non-string or empty title resolves to `null`.
35
35
  */
36
- export function extractIssueCode(title) {
36
+ export function extractIssueCode(title, options = {}) {
37
37
  if (typeof title !== "string") {
38
38
  return null;
39
39
  }
40
- const normalized = title.trim().toUpperCase();
41
- if (normalized.length === 0) {
40
+ const trimmed = title.trim();
41
+ if (trimmed.length === 0) {
42
42
  return null;
43
43
  }
44
- const match = ISSUE_CODE_PATTERN.exec(normalized);
45
- return match ? match[1] : null;
44
+ const match = ISSUE_CODE_PATTERN.exec(trimmed);
45
+ if (!match)
46
+ return null;
47
+ const rawCode = match[1];
48
+ const normalized = rawCode.toUpperCase();
49
+ const rawPrefix = rawCode.slice(0, rawCode.lastIndexOf("-"));
50
+ const configured = new Set((options.configuredPrefixes ?? []).map((prefix) => prefix.trim().replace(/-+$/u, "").toUpperCase()));
51
+ const remainder = trimmed.slice(rawCode.length);
52
+ const evidence = options.evidenceText?.toUpperCase() ?? "";
53
+ const hasExplicitBodyEvidence = evidence.includes(`ISSUE CODE: ${normalized}`) ||
54
+ evidence.includes(`ISSUE CODE \`${normalized}\``) ||
55
+ evidence.includes(`\`${normalized}\``) ||
56
+ evidence.includes(`[${normalized}]`);
57
+ const structurallyQualified = rawPrefix === rawPrefix.toUpperCase() ||
58
+ /^\s*(?::|—|–|\])/u.test(remainder) ||
59
+ configured.has(rawPrefix.toUpperCase()) ||
60
+ hasExplicitBodyEvidence;
61
+ return structurallyQualified ? normalized : null;
46
62
  }
47
63
  /** Test whether a value is a usable (non-empty after trim) item-id reference. */
48
64
  function isNonEmptyIdReference(value) {
@@ -72,7 +88,7 @@ function isNonEmptyIdReference(value) {
72
88
  * given (id) is used; duplicate ids (should not occur for a valid corpus) are
73
89
  * de-duplicated so an item never inflates its own code's count.
74
90
  */
75
- export function findDuplicateIssueCodes(items) {
91
+ export function findDuplicateIssueCodes(items, options = {}) {
76
92
  const byCode = new Map();
77
93
  for (const item of items) {
78
94
  // A non-string title can never carry a code, so skip it before extraction;
@@ -84,7 +100,10 @@ export function findDuplicateIssueCodes(items) {
84
100
  if (isNonEmptyIdReference(item.duplicate_of)) {
85
101
  continue;
86
102
  }
87
- const code = extractIssueCode(item.title);
103
+ const code = extractIssueCode(item.title, {
104
+ ...options,
105
+ evidenceText: item.body,
106
+ });
88
107
  if (code === null) {
89
108
  continue;
90
109
  }
@@ -130,4 +149,4 @@ export function findDuplicateIssueCodes(items) {
130
149
  return duplicates.sort((left, right) => left.code.localeCompare(right.code));
131
150
  }
132
151
  //# sourceMappingURL=issue-codes.js.map
133
- //# debugId=087bac58-e32d-5cb8-8fda-0e09075c3f35
152
+ //# debugId=8a7fbaf1-917f-5067-b9b6-a9f27c80e291
@@ -4,7 +4,7 @@
4
4
  * Defines item parsing, formatting, and lifecycle helpers for Item Format.
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]="65a90a42-eecb-57d3-9f78-3a5f1bc3abd3")}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]="051655a4-8ba7-5118-9758-d9ca377fa7e4")}catch(e){}}();
8
8
  import { encode as encodeToon } from "@toon-format/toon";
9
9
  import { isDeepStrictEqual } from "node:util";
10
10
  import { CONFIDENCE_TEXT_VALUES, ISSUE_SEVERITY_VALUES, PLAN_STEP_STATUS_VALUES, RECURRENCE_FREQUENCY_VALUES, RECURRENCE_WEEKDAY_VALUES, STATUS_VALUES, weekdayOrderIndex, } from "../../types/index.js";
@@ -422,7 +422,7 @@ function sortDependencies(values) {
422
422
  return undefined;
423
423
  return [...values]
424
424
  .map((value) => ({
425
- id: value.id.trim().toLowerCase(),
425
+ id: value.id.trim(),
426
426
  kind: value.kind,
427
427
  created_at: value.created_at,
428
428
  author: value.author?.trim() || undefined,
@@ -1472,4 +1472,4 @@ export const _testOnlyItemFormat = {
1472
1472
  sortTests,
1473
1473
  };
1474
1474
  //# sourceMappingURL=item-format.js.map
1475
- //# debugId=65a90a42-eecb-57d3-9f78-3a5f1bc3abd3
1475
+ //# debugId=051655a4-8ba7-5118-9758-d9ca377fa7e4
@@ -4,7 +4,7 @@
4
4
  * Reads and writes tracker storage with format-aware helpers for Item Store.
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]="f49b5141-f348-5954-a87e-8fd957593113")}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]="bffd3114-3e85-58ae-90c7-eea5069cdb89")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { getActiveExtensionRegistrations, projectAfterCommandItemSnapshot, recordAfterCommandAffectedItem, runActiveOnReadHooks, runActiveBeforeMutationHooks, runActiveOnWriteHooks, runActiveServiceOverride, } from "../extensions/index.js";
@@ -63,11 +63,18 @@ function resolveItemFormatSearchOrder(preferredFormat) {
63
63
  }
64
64
  /** Implements locate item for the public runtime surface of this module. */
65
65
  export async function locateItem(pmRoot, rawId, idPrefix = "pm-", preferredFormat, typeToFolder = TYPE_TO_FOLDER) {
66
+ const trimmedRawId = rawId.trim();
67
+ const exactRawId = trimmedRawId.startsWith("#")
68
+ ? trimmedRawId.slice(1)
69
+ : trimmedRawId;
70
+ if (exactRawId.length === 0) {
71
+ return null;
72
+ }
66
73
  const normalizedId = normalizeItemId(rawId, idPrefix);
67
74
  const rawNormalizedId = normalizeRawItemId(rawId);
68
- const candidateIds = normalizedId === rawNormalizedId
69
- ? [normalizedId]
70
- : [normalizedId, rawNormalizedId];
75
+ const candidateIds = [
76
+ ...new Set([exactRawId, normalizedId, rawNormalizedId]),
77
+ ].filter((candidateId) => candidateId.length > 0);
71
78
  const entries = Object.entries(typeToFolder);
72
79
  const searchOrder = resolveItemFormatSearchOrder(preferredFormat);
73
80
  for (const candidateId of candidateIds) {
@@ -642,4 +649,4 @@ export async function deleteItem(params) {
642
649
  }
643
650
  }
644
651
  //# sourceMappingURL=item-store.js.map
645
- //# debugId=f49b5141-f348-5954-a87e-8fd957593113
652
+ //# debugId=bffd3114-3e85-58ae-90c7-eea5069cdb89
@@ -5,7 +5,7 @@
5
5
  * Runs the MCP server adapter that exposes pm actions and contracts to external agents.
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]="2621052e-5b3f-5ab2-b587-036f375ee187")}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]="77067047-62fc-54e8-9047-ad30580d6125")}catch(e){}}();
9
9
  import { realpathSync } from "node:fs";
10
10
  import { readFile } from "node:fs/promises";
11
11
  import path from "node:path";
@@ -22,13 +22,15 @@ import { isRuntimeRecord, markMcpMutationTransportInput, } from "../sdk/runtime-
22
22
  import { attachOutputTokenAccounting } from "../sdk/output-token-accounting.js";
23
23
  import { createReproducibleProcessRunner, runWithReproducibleProcessEnvironment, } from "../sdk/reproducibility/process.js";
24
24
  import { parseAtomicMutationControls, resolveItemMutationDocument, } from "../sdk/structured-mutations.js";
25
- import { resolveAuthor, resolvePmRoot } from "../sdk/runtime-primitives.js";
25
+ import { resolveAuthor, resolvePmRoot, resolveWorkspaceRoot, } from "../sdk/runtime-primitives.js";
26
26
  import { PM_MCP_ERROR_CODES, PM_MCP_META_KEYS, PM_MCP_PROTOCOL_VERSION, PmMcpProtocolError, attachMcpServerInfo, buildMcpCompleteResult, buildMcpDiscoverResult, hasMcpClientExtension, isMcpRecord, resolveMcpRequestContext, } from "../sdk/mcp/protocol.js";
27
27
  import { PmMcpInputRequiredError, buildMcpInputRequiredResult, parseMcpInputResponses, validateMcpJsonSchema, withMcpCachePolicy, } from "../sdk/mcp/interactions.js";
28
28
  import { PM_MCP_TASKS_EXTENSION, createMcpTaskStore, } from "../sdk/mcp/tasks.js";
29
29
  import { PmMcpSubscriptionRegistry, } from "../sdk/mcp/subscriptions.js";
30
30
  import { extractMcpTraceContext, runWithMcpTraceContext, } from "../sdk/mcp/authorization.js";
31
31
  import { LegacyMcpAdapter } from "./legacy-adapter.js";
32
+ import { PM_MCP_APP_CONTRACTS, PM_MCP_APP_MIME_TYPE, PM_MCP_APPS_EXTENSION, PM_MCP_APPS_SERVER_CAPABILITY, decoratePmMcpToolsWithApps, findPmMcpAppByUri, hasPmMcpAppsCapability, renderPmMcpAppHtml, } from "../sdk/mcp/apps.js";
33
+ import { PM_MCP_SKILLS_EXTENSION, PM_MCP_SKILLS_SERVER_CAPABILITY, PmMcpSkillRegistry, assertPmMcpSkillsCapability, } from "../sdk/mcp/skills.js";
32
34
  function runMcpAction(args) {
33
35
  return runAction(markMcpMutationTransportInput(args));
34
36
  }
@@ -53,7 +55,11 @@ const PM_MCP_SERVER_CAPABILITIES = {
53
55
  prompts: { listChanged: true },
54
56
  resources: { listChanged: true, subscribe: true },
55
57
  tools: { listChanged: true },
56
- extensions: { [PM_MCP_TASKS_EXTENSION]: {} },
58
+ extensions: {
59
+ [PM_MCP_TASKS_EXTENSION]: {},
60
+ [PM_MCP_APPS_EXTENSION]: PM_MCP_APPS_SERVER_CAPABILITY,
61
+ [PM_MCP_SKILLS_EXTENSION]: PM_MCP_SKILLS_SERVER_CAPABILITY,
62
+ },
57
63
  };
58
64
  const PM_MCP_SUBSCRIPTIONS = new Map();
59
65
  function createMcpSubscriptionRegistry() {
@@ -87,6 +93,11 @@ const PM_MCP_RUN_TASK_ACTIONS = new Set([
87
93
  "test-all",
88
94
  "validate",
89
95
  ]);
96
+ const PM_MCP_SKILL_METHODS = new Set([
97
+ "skills/list",
98
+ "skills/get",
99
+ "resources/directory/read",
100
+ ]);
90
101
  const PM_MCP_INSTRUCTIONS = "You have access to native pm CLI tools for git-based project management. " +
91
102
  "Use pm_next to pick the next actionable item, or pm_context or pm_search before creating new work. " +
92
103
  "Prefer narrow tools (pm_next, pm_context, pm_list, pm_get, pm_search, pm_events, pm_create, pm_mutate, pm_copy, pm_focus, pm_update, pm_append, pm_claim, pm_release, pm_close, pm_comments, pm_files, pm_docs, pm_notes, pm_learnings, pm_deps, pm_graph, pm_test, pm_validate, pm_health, pm_contracts, pm_schema, pm_profile, pm_config, pm_plan) over pm_run when they cover the operation. " +
@@ -524,6 +535,16 @@ async function readWorkspaceResource(uri, params) {
524
535
  ],
525
536
  };
526
537
  }
538
+ async function loadRequestSkillRegistry(params) {
539
+ const args = requestWorkspaceArgs(params);
540
+ const cwd = typeof args.cwd === "string" ? args.cwd : process.cwd();
541
+ const workspaceRoot = resolveWorkspaceRoot(resolvePmRoot(cwd, typeof args.path === "string" ? args.path : undefined));
542
+ return PmMcpSkillRegistry.load({
543
+ packageRoot: resolvePmPackageRoot(),
544
+ workspaceRoot,
545
+ packageVersion: PM_MCP_SERVER_VERSION,
546
+ });
547
+ }
527
548
  function renderWorkflowPrompt(params) {
528
549
  const paramsRecord = asRecordClone(params);
529
550
  const name = readRequiredString(paramsRecord, "name");
@@ -705,7 +726,11 @@ async function dispatchMcpTaskMethod(request, requestContext) {
705
726
  async function dispatchModernToolMethod(request, requestContext, clientInfo) {
706
727
  if (request.method === "tools/list") {
707
728
  const surface = await resolveMcpToolSurface(TOOLS, requestWorkspaceArgs(request.params));
708
- return buildMcpCompleteResult(withMcpCachePolicy({ tools: deterministicMcpTools(surface.tools) }, PM_MCP_CACHE_POLICIES.tools), PM_MCP_SERVER_INFO);
729
+ return buildMcpCompleteResult(withMcpCachePolicy({
730
+ tools: hasCompatiblePmMcpAppsCapability(requestContext)
731
+ ? decoratePmMcpToolsWithApps(deterministicMcpTools(surface.tools))
732
+ : deterministicMcpTools(surface.tools),
733
+ }, PM_MCP_CACHE_POLICIES.tools), PM_MCP_SERVER_INFO);
709
734
  }
710
735
  if (shouldCreateMcpTask(request.params, requestContext)) {
711
736
  return createMcpTaskForToolCall(request.params, requestContext);
@@ -724,16 +749,59 @@ async function dispatchModernToolMethod(request, requestContext, clientInfo) {
724
749
  });
725
750
  }
726
751
  }
727
- async function dispatchModernResourceMethod(request) {
752
+ async function dispatchModernResourceMethod(request, requestContext) {
728
753
  if (request.method === "resources/list") {
729
- const resources = [...PM_MCP_RESOURCE_CONTRACTS].sort((left, right) => left.uri.localeCompare(right.uri));
754
+ const resources = [
755
+ ...PM_MCP_RESOURCE_CONTRACTS,
756
+ ...(hasCompatiblePmMcpAppsCapability(requestContext)
757
+ ? PM_MCP_APP_CONTRACTS.map((contract) => ({
758
+ uri: contract.uri,
759
+ name: contract.name,
760
+ description: contract.description,
761
+ mimeType: PM_MCP_APP_MIME_TYPE,
762
+ _meta: { ui: contract.resourceMeta },
763
+ }))
764
+ : []),
765
+ ].sort((left, right) => left.uri.localeCompare(right.uri));
730
766
  return buildMcpCompleteResult(withMcpCachePolicy({ resources }, PM_MCP_CACHE_POLICIES.resources), PM_MCP_SERVER_INFO);
731
767
  }
732
768
  if (request.method === "resources/templates/list") {
733
769
  return buildMcpCompleteResult(withMcpCachePolicy({ resourceTemplates: [] }, PM_MCP_CACHE_POLICIES.resources), PM_MCP_SERVER_INFO);
734
770
  }
735
771
  try {
736
- const resource = await readWorkspaceResource(readRequiredString(asRecordClone(request.params), "uri"), request.params);
772
+ const uri = readRequiredString(asRecordClone(request.params), "uri");
773
+ const app = findPmMcpAppByUri(uri);
774
+ let resource;
775
+ if (app) {
776
+ if (!hasPmMcpAppsCapability(requestContext)) {
777
+ throw new PmMcpProtocolError("MCP App resource requires negotiated client capability", PM_MCP_ERROR_CODES.missingRequiredClientCapability, {
778
+ requiredCapabilities: {
779
+ extensions: {
780
+ [PM_MCP_APPS_EXTENSION]: PM_MCP_APPS_SERVER_CAPABILITY,
781
+ },
782
+ },
783
+ });
784
+ }
785
+ resource = {
786
+ contents: [
787
+ {
788
+ uri,
789
+ mimeType: PM_MCP_APP_MIME_TYPE,
790
+ text: renderPmMcpAppHtml(app),
791
+ _meta: { ui: app.resourceMeta },
792
+ },
793
+ ],
794
+ };
795
+ }
796
+ else if (uri.startsWith("skill://")) {
797
+ assertPmMcpSkillsCapability(requestContext);
798
+ resource = {
799
+ ...(await loadRequestSkillRegistry(request.params)).read(uri),
800
+ };
801
+ }
802
+ else {
803
+ resource = await readWorkspaceResource(uri, request.params);
804
+ }
737
805
  return buildMcpCompleteResult(withMcpCachePolicy(resource, PM_MCP_CACHE_POLICIES.resource), PM_MCP_SERVER_INFO);
738
806
  }
739
807
  catch (error) {
@@ -744,6 +812,49 @@ async function dispatchModernResourceMethod(request) {
744
812
  throw new PmMcpProtocolError(error.message, PM_MCP_ERROR_CODES.invalidParams, { field: "uri" });
745
813
  }
746
814
  }
815
+ /** Treat an incompatible optional Apps declaration as absent during discovery. */
816
+ function hasCompatiblePmMcpAppsCapability(requestContext) {
817
+ try {
818
+ return hasPmMcpAppsCapability(requestContext);
819
+ }
820
+ catch (error) {
821
+ if (error instanceof PmMcpProtocolError)
822
+ return false;
823
+ throw error;
824
+ }
825
+ }
826
+ /** Validate Skills pagination inputs before handing them to the SDK registry. */
827
+ function readSkillPageOptions(params) {
828
+ if (params.cursor !== undefined && typeof params.cursor !== "string") {
829
+ throw new PmMcpProtocolError("Skills cursor must be a string", PM_MCP_ERROR_CODES.invalidParams, { field: "cursor" });
830
+ }
831
+ if (params.limit !== undefined && typeof params.limit !== "number") {
832
+ throw new PmMcpProtocolError("Skills limit must be a number", PM_MCP_ERROR_CODES.invalidParams, { field: "limit" });
833
+ }
834
+ return {
835
+ ...(typeof params.cursor === "string" ? { cursor: params.cursor } : {}),
836
+ ...(typeof params.limit === "number" ? { limit: params.limit } : {}),
837
+ };
838
+ }
839
+ async function dispatchModernSkillMethod(request, requestContext) {
840
+ const directoryRead = request.method === "resources/directory/read";
841
+ assertPmMcpSkillsCapability(requestContext, directoryRead);
842
+ const params = asRecordClone(request.params);
843
+ const registry = await loadRequestSkillRegistry(request.params);
844
+ let result;
845
+ if (request.method === "skills/list") {
846
+ result = { ...registry.list(readSkillPageOptions(params)) };
847
+ }
848
+ else if (request.method === "skills/get") {
849
+ result = { skill: registry.get(readRequiredString(params, "uri")) };
850
+ }
851
+ else {
852
+ result = {
853
+ ...registry.readDirectory(readRequiredString(params, "uri"), readSkillPageOptions(params)),
854
+ };
855
+ }
856
+ return buildMcpCompleteResult(withMcpCachePolicy(result, PM_MCP_CACHE_POLICIES.resource), PM_MCP_SERVER_INFO);
857
+ }
747
858
  function dispatchModernPromptMethod(request) {
748
859
  const result = request.method === "prompts/list"
749
860
  ? withMcpCachePolicy({
@@ -773,6 +884,9 @@ async function dispatchModernMcpRequest(request, meta) {
773
884
  removedIn: PM_MCP_PROTOCOL_VERSION,
774
885
  });
775
886
  }
887
+ if (PM_MCP_SKILL_METHODS.has(request.method ?? "")) {
888
+ return dispatchModernSkillMethod(request, requestContext);
889
+ }
776
890
  if (request.method === "tasks/get" ||
777
891
  request.method === "tasks/update" ||
778
892
  request.method === "tasks/cancel") {
@@ -784,7 +898,7 @@ async function dispatchModernMcpRequest(request, meta) {
784
898
  if (request.method === "resources/list" ||
785
899
  request.method === "resources/templates/list" ||
786
900
  request.method === "resources/read") {
787
- return dispatchModernResourceMethod(request);
901
+ return dispatchModernResourceMethod(request, requestContext);
788
902
  }
789
903
  if (request.method === "prompts/list" || request.method === "prompts/get") {
790
904
  return dispatchModernPromptMethod(request);
@@ -1048,4 +1162,4 @@ if (isInvokedAsMcpMainModule(process.argv[1], import.meta.url)) {
1048
1162
  }
1049
1163
  /* c8 ignore stop */
1050
1164
  //# sourceMappingURL=server.js.map
1051
- //# debugId=2621052e-5b3f-5ab2-b587-036f375ee187
1165
+ //# debugId=77067047-62fc-54e8-9047-ad30580d6125
@@ -14,6 +14,8 @@ export interface ToolDefinition {
14
14
  description: string;
15
15
  /** Value that configures or reports input schema for this contract. */
16
16
  inputSchema: Record<string, unknown>;
17
+ /** Optional negotiated extension metadata projected during tools/list. */
18
+ _meta?: Record<string, unknown>;
17
19
  }
18
20
  /** MCP transport parameters layered over every canonical action schema. */
19
21
  export declare const TOOL_SCHEMA_BASE: {
@@ -4,7 +4,7 @@
4
4
  * Defines the Tool Definitions module for pm CLI source.
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]="90896fb6-ee3e-575d-b103-bbc1a83c6672")}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]="41396cb5-7faf-5642-8746-8d94edb01d86")}catch(e){}}();
8
8
  import { GRAPH_SUBCOMMAND_VALUES, PM_DISCOVERABLE_TOOL_ACTIONS, } from "../sdk/cli-contracts/enum-contracts.js";
9
9
  import { buildPmActionToolInputSchema } from "../sdk/cli-contracts/tool-schema.js";
10
10
  import { RUNTIME_STATUS_ROLE_VALUES } from "../types.js";
@@ -413,7 +413,7 @@ const RAW_TOOLS = [
413
413
  },
414
414
  {
415
415
  name: "pm_comments",
416
- description: "List, add, edit, or delete comments on a pm item. Use options.add to append, options.edit=<1-based index> with replacement text to fix a comment, or options.delete=<1-based index> to remove one. " +
416
+ description: "List, add, edit, or delete comments on a pm item. Use options.add to append, options.edit=<1-based index> with replacement text to fix a comment, or options.delete=<1-based index> to remove one. options.ifAbsent applies only to options.add for retry-safe author-and-text deduplication and cannot combine with options.edit or options.delete. " +
417
417
  "List calls default to the most recent 20 comments with total_count/has_more metadata for token efficiency. " +
418
418
  "Pass options.limit=N to choose a page size, options.limit=0 for summary-only metadata, or options.full=true for full history.",
419
419
  inputSchema: objectSchema({ id: idSchema, options: { type: "object" } }, [
@@ -436,14 +436,14 @@ const RAW_TOOLS = [
436
436
  },
437
437
  {
438
438
  name: "pm_notes",
439
- description: "List or add structured notes on a pm item. Use options.add to append a note; omit it to list existing notes.",
439
+ description: "List, add, edit, or delete structured notes on a pm item. options.ifAbsent applies only to options.add for retry-safe author-and-text deduplication and cannot combine with options.edit or options.delete. Omit mutation options to list existing notes.",
440
440
  inputSchema: objectSchema({ id: idSchema, options: { type: "object" } }, [
441
441
  "id",
442
442
  ]),
443
443
  },
444
444
  {
445
445
  name: "pm_learnings",
446
- description: "List or add learnings on a pm item. Use options.add to capture a learning/insight; omit it to list existing learnings.",
446
+ description: "List, add, edit, or delete learnings on a pm item. options.ifAbsent applies only to options.add for retry-safe author-and-text deduplication and cannot combine with options.edit or options.delete. Omit mutation options to list existing learnings.",
447
447
  inputSchema: objectSchema({ id: idSchema, options: { type: "object" } }, [
448
448
  "id",
449
449
  ]),
@@ -748,4 +748,4 @@ export function buildMcpToolContracts() {
748
748
  }).sort((left, right) => left.name.localeCompare(right.name));
749
749
  }
750
750
  //# sourceMappingURL=tool-definitions.js.map
751
- //# debugId=90896fb6-ee3e-575d-b103-bbc1a83c6672
751
+ //# debugId=41396cb5-7faf-5642-8746-8d94edb01d86
@@ -15,7 +15,7 @@ export interface PmClosedDomainContract {
15
15
  /** Exact argv expected in the refusal's executable recovery. */
16
16
  suggested_retry_args: readonly string[];
17
17
  /** Stable machine-readable error code that owns the refusal. */
18
- error_code: "projection_options_mutually_exclusive" | "unknown_context_intent" | "unknown_field_projection";
18
+ error_code: "package_upgrade_modes_mutually_exclusive" | "projection_options_mutually_exclusive" | "unknown_context_intent" | "unknown_field_projection";
19
19
  /** Whether a complete accepted-value domain is required in the refusal. */
20
20
  allowed_values_required?: boolean;
21
21
  }
@@ -6,7 +6,7 @@
6
6
  * without changing the stable core corpus.
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]="35d4f3d7-7ec2-5a8b-bd96-f7e73c658737")}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]="95833d58-d6b9-5ab4-b447-5ce003643fd5")}catch(e){}}();
10
10
  import { PM_CONTEXT_INTENT_CONTRACTS } from "../context-intent-contracts.js";
11
11
  import { LIST_COMMAND_DEFAULT_PROJECTIONS, listGetProjectionFields, listListProjectionFields, listSearchProjectionFields, } from "../query/projection-contracts.js";
12
12
  const REJECTED_INTENT = "not-a-declared-intent";
@@ -107,6 +107,28 @@ export function listCoreClosedDomainContracts() {
107
107
  error_code: "projection_options_mutually_exclusive",
108
108
  allowed_values_required: false,
109
109
  },
110
+ {
111
+ probe_id: "package-upgrade-mutually-exclusive-modes",
112
+ command: "package upgrade",
113
+ flag: "--cli-only/--packages-only",
114
+ rejected_value: "--cli-only+--packages-only",
115
+ refusal_args: [
116
+ "package",
117
+ "upgrade",
118
+ "--cli-only",
119
+ "--packages-only",
120
+ "--dry-run",
121
+ ],
122
+ allowed_values: [],
123
+ suggested_retry_args: [
124
+ "package",
125
+ "upgrade",
126
+ "--packages-only",
127
+ "--dry-run",
128
+ ],
129
+ error_code: "package_upgrade_modes_mutually_exclusive",
130
+ allowed_values_required: false,
131
+ },
110
132
  {
111
133
  probe_id: "search-invalid-field",
112
134
  command: "search",
@@ -137,4 +159,4 @@ export function renderPmClosedDomainHelp(command, flag) {
137
159
  return `Allowed core values: ${canonicalValues.join("|")}.${runtimeSuffix}`;
138
160
  }
139
161
  //# sourceMappingURL=closed-domain-contracts.js.map
140
- //# debugId=35d4f3d7-7ec2-5a8b-bd96-f7e73c658737
162
+ //# debugId=95833d58-d6b9-5ab4-b447-5ce003643fd5
@@ -6,10 +6,10 @@
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]="4973a995-60f0-5990-9927-371dc6716063")}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]="6084a18e-ccda-57f9-a7d8-45572799c021")}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
+ import { parseBootstrapCommandName } from "../cli-contracts/bootstrap-command-scanner.js";
13
13
  function normalizeMissingFlag(label) {
14
14
  const match = label.trim().match(/--[a-z0-9][a-z0-9_-]*/i);
15
15
  return match?.[0]?.replaceAll("_", "-").toLowerCase();
@@ -57,4 +57,4 @@ export function renderMissingOptionRetry(invocationArgv, commandName, missingLab
57
57
  : renderPmCommand(retry);
58
58
  }
59
59
  //# sourceMappingURL=command-recovery.js.map
60
- //# debugId=4973a995-60f0-5990-9927-371dc6716063
60
+ //# debugId=6084a18e-ccda-57f9-a7d8-45572799c021
@@ -0,0 +1,52 @@
1
+ import { type PmOutputEnvelopeKind } from "../output-contracts.js";
2
+ /** Stable schema version for replayable agent-task transcript corpora. */
3
+ export declare const PM_AGENT_TASK_TRANSCRIPT_VERSION: 2;
4
+ /** Supported strategies for measuring one transcript step's output cost. */
5
+ export declare const PM_AGENT_TASK_ACCOUNTING_MODES: readonly ["self_reported", "independent_transport"];
6
+ /** Token-accounting strategy a replayed transcript step must preserve. */
7
+ export type PmAgentTaskAccountingMode = (typeof PM_AGENT_TASK_ACCOUNTING_MODES)[number];
8
+ /** Scalar value that a replayed transcript must observe at one output path. */
9
+ export type PmAgentTaskExpectedFieldValue = string | number | boolean | null;
10
+ /** Output family expected from one replayed agent-task step. */
11
+ export type PmAgentTaskStepOutputKind = PmOutputEnvelopeKind | "refusal";
12
+ /** Declares one real CLI invocation within a replayable agent task. */
13
+ export interface PmAgentTaskTranscriptStep {
14
+ /** Stable step identifier unique within its task. */
15
+ id: string;
16
+ /** Shell-free CLI arguments, excluding the pm executable, preserved exactly. */
17
+ args: readonly string[];
18
+ /** Process status required for the step to satisfy the transcript. */
19
+ expected_exit_code: number;
20
+ /** Semantic output family required from the transport. */
21
+ expected_output_kind: PmAgentTaskStepOutputKind;
22
+ /** Accounting strategy required from the measured transport. */
23
+ expected_accounting_mode: PmAgentTaskAccountingMode;
24
+ /** Dot-separated own-property paths proving required context was consumed. */
25
+ required_fields: readonly string[];
26
+ /** Exact terminal scalar values required at selected output paths. */
27
+ expected_field_values?: Readonly<Record<string, PmAgentTaskExpectedFieldValue>>;
28
+ /** Stable diagnostic code required from a refusal step. */
29
+ expected_error_code?: string;
30
+ /** Exact command or flag required in a refusal identity. */
31
+ expected_refusal_surface?: string;
32
+ /** Earlier refusal step whose recovery this successful step executes. */
33
+ recovery_for?: string;
34
+ }
35
+ /** Versioned multi-step agent workflow suitable for deterministic replay. */
36
+ export interface PmAgentTaskTranscript {
37
+ /** Stable task identifier used by baselines and reports. */
38
+ id: string;
39
+ /** Human-readable task outcome represented by the transcript. */
40
+ description: string;
41
+ /** Ordered invocations whose shared workspace state completes the task. */
42
+ steps: readonly PmAgentTaskTranscriptStep[];
43
+ }
44
+ /** Published collection of replayable agent workflows. */
45
+ export interface PmAgentTaskTranscriptCorpus {
46
+ /** Schema version governing every transcript in the corpus. */
47
+ version: typeof PM_AGENT_TASK_TRANSCRIPT_VERSION;
48
+ /** Complete ordered task set evaluated by the release gate. */
49
+ tasks: readonly PmAgentTaskTranscript[];
50
+ }
51
+ /** Parse and fail closed on malformed or internally inconsistent transcripts. */
52
+ export declare function parsePmAgentTaskTranscriptCorpus(value: unknown): PmAgentTaskTranscriptCorpus;