@unbrained/pm-cli 2026.9.21 → 2026.9.22

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 (250) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +21 -1
  3. package/dist/cli/commander-usage.d.ts +5 -1
  4. package/dist/cli/commander-usage.js +2 -2
  5. package/dist/cli/commands/annotations/comments.d.ts +2 -0
  6. package/dist/cli/commands/{comments.js → annotations/comments.js} +1 -1
  7. package/dist/cli/commands/{docs.d.ts → annotations/docs.d.ts} +2 -2
  8. package/dist/cli/commands/{docs.js → annotations/docs.js} +1 -1
  9. package/dist/cli/commands/{files.d.ts → annotations/files.d.ts} +2 -2
  10. package/dist/cli/commands/{files.js → annotations/files.js} +1 -1
  11. package/dist/cli/commands/annotations/learnings.d.ts +2 -0
  12. package/dist/cli/commands/{learnings.js → annotations/learnings.js} +1 -1
  13. package/dist/cli/commands/annotations/notes.d.ts +2 -0
  14. package/dist/cli/commands/{notes.js → annotations/notes.js} +1 -1
  15. package/dist/cli/commands/extension/extension.d.ts +6 -0
  16. package/dist/cli/commands/{extension.js → extension/extension.js} +1 -1
  17. package/dist/cli/commands/{gc.d.ts → governance/gc.d.ts} +2 -2
  18. package/dist/cli/commands/{gc.js → governance/gc.js} +1 -1
  19. package/dist/cli/commands/governance/health.d.ts +6 -0
  20. package/dist/cli/commands/{deps.js → governance/health.js} +2 -2
  21. package/dist/cli/commands/governance/telemetry.d.ts +6 -0
  22. package/dist/cli/commands/{telemetry.js → governance/telemetry.js} +1 -1
  23. package/dist/cli/commands/governance/validate.d.ts +9 -0
  24. package/dist/cli/commands/governance/validate.js +2 -0
  25. package/dist/cli/commands/history/activity.d.ts +6 -0
  26. package/dist/cli/commands/{activity.js → history/activity.js} +1 -1
  27. package/dist/cli/commands/history/history-compact.d.ts +7 -0
  28. package/dist/cli/commands/{history-compact.js → history/history-compact.js} +1 -1
  29. package/dist/cli/commands/{history-redact.d.ts → history/history-redact.d.ts} +2 -2
  30. package/dist/cli/commands/history/history-redact.js +2 -0
  31. package/dist/cli/commands/{history-repair.d.ts → history/history-repair.d.ts} +2 -2
  32. package/dist/cli/commands/{history-repair.js → history/history-repair.js} +1 -1
  33. package/dist/cli/commands/history/history.d.ts +2 -0
  34. package/dist/cli/commands/{history.js → history/history.js} +1 -1
  35. package/dist/cli/commands/history/restore.d.ts +6 -0
  36. package/dist/cli/commands/history/restore.js +2 -0
  37. package/dist/cli/commands/lifecycle/append.d.ts +2 -0
  38. package/dist/cli/commands/{append.js → lifecycle/append.js} +1 -1
  39. package/dist/cli/commands/lifecycle/claim.d.ts +2 -0
  40. package/dist/cli/commands/{claim.js → lifecycle/claim.js} +1 -1
  41. package/dist/cli/commands/lifecycle/close-many.d.ts +2 -0
  42. package/dist/cli/commands/{close-many.js → lifecycle/close-many.js} +1 -1
  43. package/dist/cli/commands/lifecycle/close.d.ts +6 -0
  44. package/dist/cli/commands/lifecycle/close.js +2 -0
  45. package/dist/cli/commands/lifecycle/copy.d.ts +6 -0
  46. package/dist/cli/commands/lifecycle/copy.js +2 -0
  47. package/dist/cli/commands/lifecycle/create.d.ts +6 -0
  48. package/dist/cli/commands/{create.js → lifecycle/create.js} +1 -1
  49. package/dist/cli/commands/lifecycle/delete.d.ts +6 -0
  50. package/dist/cli/commands/{delete.js → lifecycle/delete.js} +1 -1
  51. package/dist/cli/commands/lifecycle/focus.d.ts +6 -0
  52. package/dist/cli/commands/lifecycle/focus.js +2 -0
  53. package/dist/cli/commands/lifecycle/plan.d.ts +6 -0
  54. package/dist/cli/commands/{plan.js → lifecycle/plan.js} +1 -1
  55. package/dist/cli/commands/lifecycle/update-many.d.ts +2 -0
  56. package/dist/cli/commands/lifecycle/update-many.js +2 -0
  57. package/dist/cli/commands/lifecycle/update.d.ts +6 -0
  58. package/dist/cli/commands/{copy.js → lifecycle/update.js} +2 -2
  59. package/dist/cli/commands/query/aggregate.d.ts +2 -0
  60. package/dist/cli/commands/{aggregate.js → query/aggregate.js} +1 -1
  61. package/dist/cli/commands/query/context.d.ts +6 -0
  62. package/dist/cli/commands/{focus.js → query/context.js} +2 -2
  63. package/dist/cli/commands/{deps.d.ts → query/deps.d.ts} +2 -2
  64. package/dist/cli/commands/query/deps.js +2 -0
  65. package/dist/cli/commands/query/duplicates.d.ts +6 -0
  66. package/dist/cli/commands/{duplicates.js → query/duplicates.js} +1 -1
  67. package/dist/cli/commands/{eval.d.ts → query/eval.d.ts} +2 -2
  68. package/dist/cli/commands/{eval.js → query/eval.js} +1 -1
  69. package/dist/cli/commands/query/get.d.ts +6 -0
  70. package/dist/cli/commands/{get.js → query/get.js} +1 -1
  71. package/dist/cli/commands/{graph.d.ts → query/graph.d.ts} +2 -2
  72. package/dist/cli/commands/{graph.js → query/graph.js} +1 -1
  73. package/dist/cli/commands/{list.d.ts → query/list.d.ts} +2 -2
  74. package/dist/cli/commands/{list.js → query/list.js} +1 -1
  75. package/dist/cli/commands/{next.d.ts → query/next.d.ts} +2 -2
  76. package/dist/cli/commands/{next.js → query/next.js} +1 -1
  77. package/dist/cli/commands/query/search.d.ts +6 -0
  78. package/dist/cli/commands/{search.js → query/search.js} +1 -1
  79. package/dist/cli/commands/query/stats.d.ts +6 -0
  80. package/dist/cli/commands/{stats.js → query/stats.js} +1 -1
  81. package/dist/cli/commands/{test-all.d.ts → test/test-all.d.ts} +2 -2
  82. package/dist/cli/commands/{test-all.js → test/test-all.js} +1 -1
  83. package/dist/cli/commands/{test-runs.d.ts → test/test-runs.d.ts} +2 -2
  84. package/dist/cli/commands/{test-runs.js → test/test-runs.js} +1 -1
  85. package/dist/cli/commands/{test.d.ts → test/test.d.ts} +2 -2
  86. package/dist/cli/commands/{test.js → test/test.js} +1 -1
  87. package/dist/cli/commands/{config.d.ts → workspace/config.d.ts} +2 -2
  88. package/dist/cli/commands/{config.js → workspace/config.js} +1 -1
  89. package/dist/cli/commands/workspace/contracts.d.ts +2 -0
  90. package/dist/cli/commands/{contracts.js → workspace/contracts.js} +1 -1
  91. package/dist/cli/commands/{init.d.ts → workspace/init.d.ts} +2 -2
  92. package/dist/cli/commands/{update.js → workspace/init.js} +2 -2
  93. package/dist/cli/commands/workspace/merge.d.ts +8 -0
  94. package/dist/cli/commands/workspace/merge.js +2 -0
  95. package/dist/cli/commands/{profile.d.ts → workspace/profile.d.ts} +2 -2
  96. package/dist/cli/commands/{profile.js → workspace/profile.js} +1 -1
  97. package/dist/cli/commands/workspace/schema.d.ts +7 -0
  98. package/dist/cli/commands/workspace/schema.js +2 -0
  99. package/dist/cli/commands/workspace/upgrade.d.ts +2 -0
  100. package/dist/cli/commands/{update-many.js → workspace/upgrade.js} +2 -2
  101. package/dist/cli/register-annotations.js +1 -1
  102. package/dist/cli/register-history-activity.js +1 -1
  103. package/dist/cli/register-history-maintenance.js +1 -1
  104. package/dist/cli/register-list-query.js +1 -1
  105. package/dist/cli/register-mutation.js +1 -1
  106. package/dist/cli/register-operations.js +1 -1
  107. package/dist/cli/register-setup.js +1 -1
  108. package/dist/cli/schema/registration.js +1 -1
  109. package/dist/cli/stats-analytics-json.d.ts +1 -1
  110. package/dist/cli/stats-analytics-json.js +1 -1
  111. package/dist/cli-bundle/bundle-manifest.json +154 -154
  112. package/dist/cli-bundle/chunks/{chunk-GRHSNUQO.js → chunk-3OFFMS2N.js} +2 -2
  113. package/dist/cli-bundle/chunks/{chunk-QZTS23BV.js → chunk-4XOV7Q5R.js} +2 -2
  114. package/dist/cli-bundle/chunks/{chunk-2QLXN6HZ.js → chunk-AVWHZUNC.js} +26 -26
  115. package/dist/cli-bundle/chunks/{chunk-2UNYUB4A.js → chunk-BJBBOUYQ.js} +2 -2
  116. package/dist/cli-bundle/chunks/{chunk-JBJUOOJI.js → chunk-CM57QHVK.js} +5 -5
  117. package/dist/cli-bundle/chunks/{chunk-NHRB3L5T.js → chunk-D2OV2UBV.js} +2 -2
  118. package/dist/cli-bundle/chunks/{chunk-4SI67A2F.js → chunk-GFTN5OS4.js} +2 -2
  119. package/dist/cli-bundle/chunks/{chunk-HAFSMFJK.js → chunk-JSW33Q6R.js} +3 -3
  120. package/dist/cli-bundle/chunks/{chunk-FBWAECBI.js → chunk-ML42DLI3.js} +3 -3
  121. package/dist/cli-bundle/chunks/{chunk-SDLBF4PY.js → chunk-SBTT42A4.js} +2 -2
  122. package/dist/cli-bundle/chunks/chunk-SGFQQXFD.js +2 -0
  123. package/dist/cli-bundle/chunks/{chunk-7YUYLYJQ.js → chunk-UDNYAMCM.js} +6 -6
  124. package/dist/cli-bundle/chunks/{chunk-K7RWRJLT.js → chunk-ZSPZJOMK.js} +2 -2
  125. package/dist/cli-bundle/chunks/{register-list-query-5V43MYPN.js → register-list-query-VOS5CBX4.js} +2 -2
  126. package/dist/cli-bundle/chunks/register-mutation-LWZH6UFJ.js +20 -0
  127. package/dist/cli-bundle/chunks/{register-operations-LJU5H2CU.js → register-operations-YJK4DNFZ.js} +2 -2
  128. package/dist/cli-bundle/chunks/{register-setup-HJUNGYBB.js → register-setup-Q3CYF67Q.js} +2 -2
  129. package/dist/cli-bundle/focused-chunks/{chunk-L6L4XCLY.js → chunk-AO5FR7PN.js} +2 -2
  130. package/dist/cli-bundle/focused-chunks/{chunk-K5ZCBC6Y.js → chunk-CASXNCNQ.js} +2 -2
  131. package/dist/cli-bundle/focused-chunks/{chunk-FXAZPSU6.js → chunk-FKYUTTFL.js} +2 -2
  132. package/dist/cli-bundle/focused-chunks/{chunk-DPBTIFW7.js → chunk-IOL25GKH.js} +2 -2
  133. package/dist/cli-bundle/focused-chunks/{chunk-N6KI3LWF.js → chunk-JCD5YESL.js} +2 -2
  134. package/dist/cli-bundle/focused-chunks/{chunk-6MNKQKT6.js → chunk-LH24XUPJ.js} +2 -2
  135. package/dist/cli-bundle/focused-chunks/{chunk-IA5CCSBB.js → chunk-MXESHALQ.js} +2 -2
  136. package/dist/cli-bundle/focused-chunks/{chunk-3XPBKIV6.js → chunk-PRMQTT7X.js} +12 -12
  137. package/dist/cli-bundle/focused-chunks/{chunk-ISEOBALS.js → chunk-QFEDRPPI.js} +2 -2
  138. package/dist/cli-bundle/focused-chunks/{chunk-UIS5FVHH.js → chunk-QYN77MQP.js} +49 -49
  139. package/dist/cli-bundle/focused-chunks/{chunk-5BLRMUMK.js → chunk-TSI73EEM.js} +3 -3
  140. package/dist/cli-bundle/focused-chunks/{chunk-PC6ZZVNP.js → chunk-UAU4DJSR.js} +3 -3
  141. package/dist/cli-bundle/focused-chunks/{chunk-RQL5WLNZ.js → chunk-URH727T5.js} +2 -2
  142. package/dist/cli-bundle/focused-chunks/{chunk-U2SB2BMM.js → chunk-UT7VS4X2.js} +2 -2
  143. package/dist/cli-bundle/focused-chunks/{chunk-HYPK5OPA.js → chunk-V2NARGRH.js} +2 -2
  144. package/dist/cli-bundle/focused-chunks/{chunk-DRNXMOSV.js → chunk-XR5EBU3B.js} +2 -2
  145. package/dist/cli-bundle/main.js +18 -18
  146. package/dist/cli-bundle/sdk-authoring.js +1 -1
  147. package/dist/cli-bundle/sdk-contracts.js +1 -1
  148. package/dist/cli-bundle/sdk-core.js +3 -3
  149. package/dist/cli-bundle/sdk-governance.js +1 -1
  150. package/dist/cli-bundle/sdk-graph.js +1 -1
  151. package/dist/cli-bundle/sdk-merge.js +38 -38
  152. package/dist/cli-bundle/sdk-query.js +1 -1
  153. package/dist/cli-bundle/sdk-runtime.js +1 -1
  154. package/dist/cli-bundle/sdk-testing.js +1 -1
  155. package/dist/cli-bundle/sdk.js +1 -1
  156. package/dist/core/config/positional-value.d.ts +0 -2
  157. package/dist/core/config/positional-value.js +1 -1
  158. package/dist/core/history/history-diff.js +1 -1
  159. package/dist/core/schema/type-workflows.d.ts +1 -1
  160. package/dist/core/schema/type-workflows.js +1 -1
  161. package/dist/core/search/eval.d.ts +1 -1
  162. package/dist/core/search/eval.js +1 -1
  163. package/dist/core/shared/item-metadata-contract.d.ts +0 -4
  164. package/dist/core/shared/item-metadata-contract.js +1 -1
  165. package/dist/sdk/extension/shared.d.ts +2 -2
  166. package/dist/sdk/extension/shared.js +1 -1
  167. package/dist/sdk/governance/upgrade.d.ts +2 -0
  168. package/dist/sdk/governance/upgrade.js +2 -2
  169. package/dist/sdk/public-surface.json +1 -1
  170. package/dist/sdk/query/search-contracts.d.ts +0 -1
  171. package/dist/sdk/query/search-contracts.js +1 -1
  172. package/dist/sdk/schema.d.ts +8 -4
  173. package/dist/sdk/schema.js +1 -1
  174. package/docs/ARCHITECTURE.md +31 -4
  175. package/docs/BUILD_AND_RELEASE_ACCEPTANCE.md +50 -1
  176. package/docs/COMMANDS.md +1 -1
  177. package/docs/EXTENSIONS.md +1 -1
  178. package/docs/READ_OUTPUT_CONTRACTS.md +1 -1
  179. package/docs/RELEASING.md +7 -1
  180. package/docs/SDK_CONTEXT_INTEGRITY_PRIMITIVES.md +1 -1
  181. package/marketplace.json +2 -2
  182. package/package.json +6 -4
  183. package/packages/pm-beads/package.json +1 -1
  184. package/packages/pm-calendar/package.json +1 -1
  185. package/packages/pm-command-kit/package.json +1 -1
  186. package/packages/pm-digital-twin/package.json +1 -1
  187. package/packages/pm-governance-audit/package.json +1 -1
  188. package/packages/pm-guide-shell/package.json +1 -1
  189. package/packages/pm-kanban/package.json +1 -1
  190. package/packages/pm-lifecycle-hooks/package.json +1 -1
  191. package/packages/pm-linked-test-adapters/package.json +1 -1
  192. package/packages/pm-search-advanced/package.json +1 -1
  193. package/packages/pm-templates/package.json +1 -1
  194. package/packages/pm-todos/package.json +1 -1
  195. package/packages/pm-vcs/package.json +1 -1
  196. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  197. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  198. package/scripts/build-lease.mjs +27 -0
  199. package/dist/cli/commands/activity.d.ts +0 -6
  200. package/dist/cli/commands/aggregate.d.ts +0 -2
  201. package/dist/cli/commands/append.d.ts +0 -2
  202. package/dist/cli/commands/claim.d.ts +0 -2
  203. package/dist/cli/commands/close-many.d.ts +0 -2
  204. package/dist/cli/commands/close.d.ts +0 -6
  205. package/dist/cli/commands/close.js +0 -2
  206. package/dist/cli/commands/comments.d.ts +0 -2
  207. package/dist/cli/commands/context.d.ts +0 -6
  208. package/dist/cli/commands/context.js +0 -2
  209. package/dist/cli/commands/contracts.d.ts +0 -2
  210. package/dist/cli/commands/copy.d.ts +0 -6
  211. package/dist/cli/commands/create.d.ts +0 -6
  212. package/dist/cli/commands/delete.d.ts +0 -6
  213. package/dist/cli/commands/duplicates.d.ts +0 -6
  214. package/dist/cli/commands/extension.d.ts +0 -6
  215. package/dist/cli/commands/focus.d.ts +0 -6
  216. package/dist/cli/commands/get.d.ts +0 -6
  217. package/dist/cli/commands/health.d.ts +0 -6
  218. package/dist/cli/commands/health.js +0 -2
  219. package/dist/cli/commands/history-compact.d.ts +0 -7
  220. package/dist/cli/commands/history-redact.js +0 -2
  221. package/dist/cli/commands/history.d.ts +0 -2
  222. package/dist/cli/commands/index.d.ts +0 -55
  223. package/dist/cli/commands/index.js +0 -2
  224. package/dist/cli/commands/init-agent-guidance.d.ts +0 -6
  225. package/dist/cli/commands/init-agent-guidance.js +0 -2
  226. package/dist/cli/commands/init.js +0 -2
  227. package/dist/cli/commands/learnings.d.ts +0 -2
  228. package/dist/cli/commands/lifecycle-transitions.d.ts +0 -2
  229. package/dist/cli/commands/lifecycle-transitions.js +0 -2
  230. package/dist/cli/commands/merge.d.ts +0 -8
  231. package/dist/cli/commands/merge.js +0 -2
  232. package/dist/cli/commands/notes.d.ts +0 -2
  233. package/dist/cli/commands/plan.d.ts +0 -6
  234. package/dist/cli/commands/restore.d.ts +0 -6
  235. package/dist/cli/commands/restore.js +0 -2
  236. package/dist/cli/commands/scheduling-shortcuts.d.ts +0 -6
  237. package/dist/cli/commands/scheduling-shortcuts.js +0 -2
  238. package/dist/cli/commands/schema.d.ts +0 -7
  239. package/dist/cli/commands/schema.js +0 -2
  240. package/dist/cli/commands/search.d.ts +0 -6
  241. package/dist/cli/commands/stats.d.ts +0 -6
  242. package/dist/cli/commands/telemetry.d.ts +0 -6
  243. package/dist/cli/commands/update-many.d.ts +0 -2
  244. package/dist/cli/commands/update.d.ts +0 -6
  245. package/dist/cli/commands/upgrade.d.ts +0 -2
  246. package/dist/cli/commands/upgrade.js +0 -2
  247. package/dist/cli/commands/validate.d.ts +0 -9
  248. package/dist/cli/commands/validate.js +0 -2
  249. package/dist/cli-bundle/chunks/chunk-T3AMFUCN.js +0 -2
  250. package/dist/cli-bundle/chunks/register-mutation-DXES37MA.js +0 -20
@@ -1,6 +1,6 @@
1
- import{c as w}from"./chunk-5BLRMUMK.js";import{e as a,h as I}from"./chunk-N6KI3LWF.js";import{$ as f,P as k,aa as u,r as h,s as _,sa as m,t as b,za as T}from"./chunk-RQL5WLNZ.js";import C from"node:fs/promises";import p from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8269d712-f438-5f18-8137-ed9a0358e23b")}catch{}})();var U=["extensions","docs","examples","assets","prompts"],R=Object.freeze({extensions:Object.freeze([".agents/pm/extensions","extensions",".custom/pm-extensions",".custom/pm-extension"]),docs:Object.freeze(["docs","documentation"]),examples:Object.freeze(["examples","docs/examples"]),assets:Object.freeze(["assets",".agents/pm/assets"]),prompts:Object.freeze(["prompts",".agents/pm/prompts"])});function q(e){return U.includes(e)}function G(e,t){if(t==null)return[];let n=Array.isArray(t)?t:[t],o=[];for(let r of n){if(typeof r!="string"||r.trim().length===0)throw new u(`Package manifest field pm.${e} must contain string paths.`,f.USAGE);o.push(r.trim())}return[...new Set(o)].sort((r,i)=>r.localeCompare(i))}function J(e){if(e==null)return{};if(typeof e!="object"||Array.isArray(e))throw new u("Package manifest field pm must be an object.",f.USAGE);let t={},n=e;for(let[o,r]of Object.entries(n)){if(!q(o))continue;let i=G(o,r);i.length>0&&(t[o]=i)}return t}function d(e,t){let n=e[t];return typeof n=="string"&&n.trim().length>0?n.trim():void 0}function E(e){if(!Array.isArray(e))return;let t=e.map(n=>typeof n=="string"?n.trim():"").filter(n=>n.length>0);return t.length>0?[...new Set(t)].sort((n,o)=>n.localeCompare(o)):void 0}function x(e){if(typeof e=="string"&&e.trim().length>0)return e.trim();if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let t=e.url;return typeof t=="string"&&t.trim().length>0?t.trim():void 0}}function K(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={docs:d(t,"docs"),npm:d(t,"npm"),repository:d(t,"repository"),report:d(t,"report")};return Object.values(n).some(o=>typeof o=="string")?n:void 0}function V(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={image:d(t,"image"),video:d(t,"video")};return Object.values(n).some(o=>typeof o=="string")?n:void 0}function Y(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={display_name:d(t,"display_name")??d(t,"displayName"),category:d(t,"category"),summary:d(t,"summary"),links:K(t.links),media:V(t.media),tags:E(t.tags)};return Object.values(n).some(o=>o!==void 0)?n:void 0}async function B(e){let t=p.join(e,"package.json");if(!await m(t))return{source:"convention",resources:{}};let n;try{n=JSON.parse(await C.readFile(t,"utf8"))}catch(l){throw new u(`Failed to parse package manifest at "${t}": ${String(l)}`,f.USAGE)}if(typeof n!="object"||n===null||Array.isArray(n))throw new u(`Package manifest at "${t}" must be a JSON object.`,f.USAGE);let o=n,r=o.pm,i=r!=null,s=typeof r=="object"&&r!==null&&!Array.isArray(r)?r:{};return{source:i?"pm":"convention",package_json_path:t,package_name:typeof o.name=="string"?o.name:void 0,package_version:typeof o.version=="string"?o.version:void 0,package_private:o.private===!0,package_description:typeof o.description=="string"?o.description:void 0,package_keywords:E(o.keywords),package_homepage:typeof o.homepage=="string"?o.homepage:void 0,package_repository_url:x(o.repository),package_bugs_url:x(o.bugs),aliases:E(s.aliases),resources:J(r),catalog:Y(s.catalog)}}async function j(e){if(!await m(e))return[];let t=await C.readdir(e,{withFileTypes:!0}),n=[];for(let o of t){if(!o.isDirectory())continue;let r=p.join(e,o.name);await m(p.join(r,"manifest.json"))&&n.push(r)}return n.sort((o,r)=>o.localeCompare(r))}async function ve(e){if(await m(p.join(e,"manifest.json")))return[e];let n=(await B(e)).resources.extensions??[],o=new Set;for(let r of n){if(r.includes("*")||r.startsWith("!"))throw new u(`Package extension entry "${r}" uses a glob/exclusion pattern. pm package installs currently require concrete extension paths or directories.`,f.USAGE);let i=p.resolve(e,r);if(!T(e,i))throw new u(`Package extension entry "${r}" resolves outside package root.`,f.USAGE);if(await m(p.join(i,"manifest.json"))){o.add(i);continue}for(let s of await j(i))o.add(s)}if(n.length===0)for(let r of R.extensions)for(let i of await j(p.join(e,r)))o.add(i);return[...o].sort((r,i)=>r.localeCompare(i))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2bc00b8e-0d9f-5af8-9667-d46136ff52b0")}catch{}})();var D=1,S=6,$=[["commands","Commands"],["command_overrides","Command overrides"],["flag_commands","Flag commands"],["item_types","Item types"],["item_fields","Item fields"],["migrations","Migrations"],["profiles","Profiles"],["importers","Importers"],["exporters","Exporters"],["search_providers","Search providers"],["vector_store_adapters","Vector store adapters"],["assurance_providers","Assurance measurement providers"],["hooks","Lifecycle hooks"],["parser_overrides","Parser overrides"],["service_overrides","Service overrides"],["renderer_overrides","Renderer overrides"]];function A(e){return"#".repeat(e)}function F(e){if(!e.includes("`"))return`\`${e}\``;let t=0,n=0;for(let i of e)n=i==="`"?n+1:0,t=Math.max(t,n);let o="`".repeat(t+1),r=e.startsWith("`")||e.endsWith("`")?" ":"";return`${o}${r}${e}${r}${o}`}function W(e){return e.length===0?"Capabilities: _none registered_":`Capabilities: ${e.map(F).join(", ")}`}function H(e,t,n){let o=[`${A(t)} ${e}`,""];return n.length===0?(o.push("_None._",""),o):(o.push(...n.map(r=>`- ${F(r)}`),""),o)}function X(e,t,n){return e===0&&!n?[]:[`${A(t)} Preflight overrides`,"",e>0?`- ${e} registered (this surface carries no per-entry identifier)`:"_None._",""]}function be(e,t={}){let n=t.headingLevel??2;if(!Number.isInteger(n)||n<D||n>S)throw new RangeError(`headingLevel must be an integer in [${D}, ${S}], received ${String(t.headingLevel)}`);let o=Math.min(n+1,S),r=t.includeEmpty===!0,i=t.title??"Extension surfaces",s=[`${A(n)} ${i}`,""];(r||e.capabilities.length>0)&&s.push(W(e.capabilities),"");for(let[c,y]of $){let g=e[c]??[];g.length===0&&!r||s.push(...H(y,o,g))}return s.push(...X(e.preflight_overrides,o,r)),!(e.preflight_overrides>0||$.some(([c])=>(e[c]?.length??0)>0))&&!r&&s.push("_This extension registers no surfaces._",""),`${s.join(`
1
+ import{c as w}from"./chunk-TSI73EEM.js";import{e as a,h as I}from"./chunk-JCD5YESL.js";import{$ as f,P as k,aa as u,r as h,s as _,sa as m,t as b,za as T}from"./chunk-URH727T5.js";import C from"node:fs/promises";import p from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8269d712-f438-5f18-8137-ed9a0358e23b")}catch{}})();var U=["extensions","docs","examples","assets","prompts"],R=Object.freeze({extensions:Object.freeze([".agents/pm/extensions","extensions",".custom/pm-extensions",".custom/pm-extension"]),docs:Object.freeze(["docs","documentation"]),examples:Object.freeze(["examples","docs/examples"]),assets:Object.freeze(["assets",".agents/pm/assets"]),prompts:Object.freeze(["prompts",".agents/pm/prompts"])});function q(e){return U.includes(e)}function G(e,t){if(t==null)return[];let n=Array.isArray(t)?t:[t],o=[];for(let r of n){if(typeof r!="string"||r.trim().length===0)throw new u(`Package manifest field pm.${e} must contain string paths.`,f.USAGE);o.push(r.trim())}return[...new Set(o)].sort((r,i)=>r.localeCompare(i))}function J(e){if(e==null)return{};if(typeof e!="object"||Array.isArray(e))throw new u("Package manifest field pm must be an object.",f.USAGE);let t={},n=e;for(let[o,r]of Object.entries(n)){if(!q(o))continue;let i=G(o,r);i.length>0&&(t[o]=i)}return t}function d(e,t){let n=e[t];return typeof n=="string"&&n.trim().length>0?n.trim():void 0}function E(e){if(!Array.isArray(e))return;let t=e.map(n=>typeof n=="string"?n.trim():"").filter(n=>n.length>0);return t.length>0?[...new Set(t)].sort((n,o)=>n.localeCompare(o)):void 0}function x(e){if(typeof e=="string"&&e.trim().length>0)return e.trim();if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let t=e.url;return typeof t=="string"&&t.trim().length>0?t.trim():void 0}}function K(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={docs:d(t,"docs"),npm:d(t,"npm"),repository:d(t,"repository"),report:d(t,"report")};return Object.values(n).some(o=>typeof o=="string")?n:void 0}function V(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={image:d(t,"image"),video:d(t,"video")};return Object.values(n).some(o=>typeof o=="string")?n:void 0}function Y(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={display_name:d(t,"display_name")??d(t,"displayName"),category:d(t,"category"),summary:d(t,"summary"),links:K(t.links),media:V(t.media),tags:E(t.tags)};return Object.values(n).some(o=>o!==void 0)?n:void 0}async function B(e){let t=p.join(e,"package.json");if(!await m(t))return{source:"convention",resources:{}};let n;try{n=JSON.parse(await C.readFile(t,"utf8"))}catch(l){throw new u(`Failed to parse package manifest at "${t}": ${String(l)}`,f.USAGE)}if(typeof n!="object"||n===null||Array.isArray(n))throw new u(`Package manifest at "${t}" must be a JSON object.`,f.USAGE);let o=n,r=o.pm,i=r!=null,s=typeof r=="object"&&r!==null&&!Array.isArray(r)?r:{};return{source:i?"pm":"convention",package_json_path:t,package_name:typeof o.name=="string"?o.name:void 0,package_version:typeof o.version=="string"?o.version:void 0,package_private:o.private===!0,package_description:typeof o.description=="string"?o.description:void 0,package_keywords:E(o.keywords),package_homepage:typeof o.homepage=="string"?o.homepage:void 0,package_repository_url:x(o.repository),package_bugs_url:x(o.bugs),aliases:E(s.aliases),resources:J(r),catalog:Y(s.catalog)}}async function j(e){if(!await m(e))return[];let t=await C.readdir(e,{withFileTypes:!0}),n=[];for(let o of t){if(!o.isDirectory())continue;let r=p.join(e,o.name);await m(p.join(r,"manifest.json"))&&n.push(r)}return n.sort((o,r)=>o.localeCompare(r))}async function ve(e){if(await m(p.join(e,"manifest.json")))return[e];let n=(await B(e)).resources.extensions??[],o=new Set;for(let r of n){if(r.includes("*")||r.startsWith("!"))throw new u(`Package extension entry "${r}" uses a glob/exclusion pattern. pm package installs currently require concrete extension paths or directories.`,f.USAGE);let i=p.resolve(e,r);if(!T(e,i))throw new u(`Package extension entry "${r}" resolves outside package root.`,f.USAGE);if(await m(p.join(i,"manifest.json"))){o.add(i);continue}for(let s of await j(i))o.add(s)}if(n.length===0)for(let r of R.extensions)for(let i of await j(p.join(e,r)))o.add(i);return[...o].sort((r,i)=>r.localeCompare(i))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2bc00b8e-0d9f-5af8-9667-d46136ff52b0")}catch{}})();var D=1,S=6,$=[["commands","Commands"],["command_overrides","Command overrides"],["flag_commands","Flag commands"],["item_types","Item types"],["item_fields","Item fields"],["migrations","Migrations"],["profiles","Profiles"],["importers","Importers"],["exporters","Exporters"],["search_providers","Search providers"],["vector_store_adapters","Vector store adapters"],["assurance_providers","Assurance measurement providers"],["hooks","Lifecycle hooks"],["parser_overrides","Parser overrides"],["service_overrides","Service overrides"],["renderer_overrides","Renderer overrides"]];function A(e){return"#".repeat(e)}function F(e){if(!e.includes("`"))return`\`${e}\``;let t=0,n=0;for(let i of e)n=i==="`"?n+1:0,t=Math.max(t,n);let o="`".repeat(t+1),r=e.startsWith("`")||e.endsWith("`")?" ":"";return`${o}${r}${e}${r}${o}`}function W(e){return e.length===0?"Capabilities: _none registered_":`Capabilities: ${e.map(F).join(", ")}`}function H(e,t,n){let o=[`${A(t)} ${e}`,""];return n.length===0?(o.push("_None._",""),o):(o.push(...n.map(r=>`- ${F(r)}`),""),o)}function X(e,t,n){return e===0&&!n?[]:[`${A(t)} Preflight overrides`,"",e>0?`- ${e} registered (this surface carries no per-entry identifier)`:"_None._",""]}function be(e,t={}){let n=t.headingLevel??2;if(!Number.isInteger(n)||n<D||n>S)throw new RangeError(`headingLevel must be an integer in [${D}, ${S}], received ${String(t.headingLevel)}`);let o=Math.min(n+1,S),r=t.includeEmpty===!0,i=t.title??"Extension surfaces",s=[`${A(n)} ${i}`,""];(r||e.capabilities.length>0)&&s.push(W(e.capabilities),"");for(let[c,y]of $){let g=e[c]??[];g.length===0&&!r||s.push(...H(y,o,g))}return s.push(...X(e.preflight_overrides,o,r)),!(e.preflight_overrides>0||$.some(([c])=>(e[c]?.length??0)>0))&&!r&&s.push("_This extension registers no surfaces._",""),`${s.join(`
2
2
  `).trimEnd()}
3
3
  `}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ebcb45a2-996a-5194-8086-efe882dbcacc")}catch{}})();var Q=["agile","ops","research"],Z={agile:[{name:"Story",description:"User-facing outcome or capability slice expressed from a stakeholder perspective.",defaultStatus:"open",folder:"stories",aliases:["user-story"]},{name:"Spike",description:"Time-boxed investigation used to reduce uncertainty before implementation.",defaultStatus:"open",folder:"spikes",aliases:["research-spike"]}],ops:[{name:"Incident",description:"Operational disruption, degradation, or support escalation with recovery tracking.",defaultStatus:"open",folder:"incidents",aliases:["outage"]},{name:"Runbook",description:"Repeatable operational procedure, diagnostic path, or response playbook.",defaultStatus:"open",folder:"runbooks",aliases:["playbook"]}],research:[{name:"Experiment",description:"Validated-learning activity with hypothesis, method, and outcome tracking.",defaultStatus:"open",folder:"experiments",aliases:["study"]},{name:"Hypothesis",description:"Testable claim or assumption that should be supported, rejected, or refined.",defaultStatus:"open",folder:"hypotheses",aliases:["assumption"]}]};function Ae(e){if(e===void 0)return;let t=e.trim().toLowerCase().replaceAll("-","_");if(t.length===0)throw new Error("Type preset name must not be empty.");if(t==="agile"||t==="ops"||t==="research")return t;throw new Error(`Invalid type preset "${e}". Allowed: ${Q.join(", ")}.`)}function ke(e){return Z[e].map(t=>w(t))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f9535c02-9214-5d5e-bac0-2dabbe5d395e")}catch{}})();var ee=new Set(_),te=new Set(b),N=new Set([...k.filter(e=>e!=="severity"),"id","title","type","status","priority","tags","assignee","parent","description","body","created_at","updated_at","closed_at","completed_at","author","deadline","estimate","sprint","release","risk","confidence","reviewer","resolution","expected","actual"]),ne=["create","update"];function M(e){if(typeof e!="string")return"";let t=e.trim().toLowerCase().replaceAll(/[\s_]+/g,"-");return t.startsWith("--")?t.slice(2):t}function O(e){return e.replaceAll("_","-")}function oe(e,t){let n=new Set;for(let o of e){let r=M(o);r.length>0&&r!==t&&n.add(r)}return[...n].sort((o,r)=>o.localeCompare(r))}function re(e){let t=new Set;for(let n of e??[]){let o=n.trim();o.length>0&&t.add(o)}return[...t].sort((n,o)=>n.localeCompare(o))}function ie(e){let t=new Set,n=[];for(let o of e??[]){let r=o.trim().toLowerCase();if(r.length!==0){if(!te.has(r))throw new Error(`Invalid field command "${o}". Allowed: ${b.join(", ")}.`);t.has(r)||(t.add(r),n.push(r))}}return e===void 0||n.length===0?[...ne]:n}function Ce(e){let t=a(e.key);if(t.length===0)throw new Error("Field key must not be empty.");if(N.has(t))throw new Error(`Cannot define custom field "${t}": custom schema field "${t}" collides with built-in item metadata "${t}". Rename the custom field with a project-specific prefix. Reserved fields: ${[...N].sort((g,P)=>g.localeCompare(P)).join(", ")}.`);let n=typeof e.type=="string"&&e.type.trim().length>0?e.type.trim().toLowerCase():"string";if(!ee.has(n))throw new Error(`Invalid field type "${e.type}". Allowed: ${_.join(", ")}.`);let o=n,r=ie(e.commands),i=M(e.cliFlag),s=i.length>0&&i!==O(t)?i:void 0,l=s??O(t),c=oe(e.aliases??[],l),y=e.description?.trim();return{key:t,type:o,commands:r,description:y&&y.length>0?y:void 0,cliFlag:s,cliAliases:c,required:e.required===!0,requiredOnCreate:e.requiredOnCreate===!0,allowUnset:e.allowUnset!==!1,requiredTypes:re(e.requiredTypes)}}function se(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.fields))return t.fields;if(Array.isArray(t.definitions))return t.definitions}function ae(e){let t=se(e);if(!t)return[];let n=[];for(let o of t){if(typeof o!="object"||o===null||Array.isArray(o))continue;let r=o;typeof r.key!="string"||r.key.trim().length===0||n.push(r)}return n}function De(e){if(e==null||e.trim().length===0)return{fields:[]};let t;try{t=JSON.parse(e)}catch{throw new Error("schema/fields.json contains invalid JSON.")}return{fields:ae(t)}}function $e(e){return`${JSON.stringify({fields:e.fields},null,2)}
4
4
  `}function Fe(e,t){let n=e.fields.find(s=>a(s.key)===t.key),o=n!==void 0,r=e.fields.filter(s=>a(s.key)!==t.key),i={...n,key:t.key,type:t.type,commands:[...t.commands]};return L(i,"description",t.description),L(i,"cli_flag",t.cliFlag),t.cliAliases.length>0?i.cli_aliases=[...t.cliAliases]:delete i.cli_aliases,z(i,"required",t.required),z(i,"required_on_create",t.requiredOnCreate),t.allowUnset===!1?i.allow_unset=!1:delete i.allow_unset,t.requiredTypes.length>0?i.required_types=[...t.requiredTypes]:delete i.required_types,r.push(i),r.sort((s,l)=>a(s.key).localeCompare(a(l.key))),{file:{fields:r},definition:i,replaced:o}}function Ne(e,t){let n=a(t);if(n.length===0)throw new Error("Field key must not be empty.");let o=[],r=e.fields.filter(i=>a(i.key)===n?(o.push(i),!1):!0);return o.length===0?{file:{fields:r},removed:!1}:{file:{fields:r},removed:!0,definition:o[0]}}function L(e,t,n){let o=e;n!==void 0&&n.length>0?o[t]=n:delete o[t]}function z(e,t,n){let o=e;n?o[t]=!0:delete o[t]}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e3a1e65b-55d7-5206-b3e7-cac3ac29745c")}catch{}})();var le=new Set(h),v=new Set(I.map(e=>a(e.id)).filter(e=>e.length>0));function ce(e){let t=new Set;for(let n of e){let o=a(n);o.length>0&&t.add(o)}return[...t].sort((n,o)=>n.localeCompare(o))}function Ue(e){let t=a(e.id);if(t.length===0)throw new Error("Status id must not be empty.");if(v.has(t))throw new Error(`Cannot add-status the built-in status "${t}". Built-in statuses are reserved: ${[...v].join(", ")}.`);let n;if(e.roles!==void 0){n=[];let s=new Set;for(let l of e.roles){let c=typeof l=="string"?l.trim().toLowerCase():"";if(c.length!==0){if(!le.has(c))throw new Error(`Invalid status role "${l}". Allowed roles: ${h.join(", ")}.`);s.has(c)||(s.add(c),n.push(c))}}if(n.length===0)throw new Error(`Status role must include at least one lifecycle role. Allowed roles: ${h.join(", ")}.`)}let o=e.aliases===void 0?void 0:ce(e.aliases).filter(s=>s!==t),r=e.description?.trim(),i=typeof e.order=="number"&&Number.isFinite(e.order)?Math.trunc(e.order):void 0;return{id:t,roles:n,aliases:o,description:r&&r.length>0?r:void 0,order:i}}function de(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.statuses))return t.statuses;if(Array.isArray(t.definitions))return t.definitions}function fe(e){let t=de(e);if(!t)return[];let n=[];for(let o of t){if(typeof o!="object"||o===null||Array.isArray(o))continue;let r=o;typeof r.id!="string"||r.id.trim().length===0||n.push(r)}return n}function Re(e){if(e==null||e.trim().length===0)return{statuses:[]};let t;try{t=JSON.parse(e)}catch{throw new Error("schema/statuses.json contains invalid JSON.")}return{statuses:fe(t)}}function qe(e){return`${JSON.stringify({statuses:e.statuses},null,2)}
5
5
  `}function Ge(e,t,n){let o=e.statuses.slice(),r=o.findIndex(l=>a(l.id)===t.id),i=r>=0?o[r]:n,s={...i,id:t.id};return t.roles!==void 0&&(t.roles.length>0?s.roles=[...t.roles]:s.roles!==void 0&&delete s.roles),t.aliases!==void 0&&(t.aliases.length>0?s.aliases=[...t.aliases]:s.aliases!==void 0&&delete s.aliases),t.description!==void 0&&(s.description=t.description),t.order!==void 0&&(s.order=t.order),r>=0?o[r]=s:o.push(s),{file:{statuses:o},definition:s,replaced:i!==void 0}}function Je(e,t){let n=a(t);if(n.length===0)throw new Error("Status id must not be empty.");if(v.has(n))throw new Error(`Cannot remove built-in status "${n}". Built-in statuses are reserved: ${[...v].join(", ")}.`);let o=e.statuses.slice(),r=o.findIndex(s=>a(s.id)===n);if(r<0)return{file:{statuses:o},removed:!1};let[i]=o.splice(r,1);return{file:{statuses:o},removed:!0,definition:i}}function Ke(e,t){let n=[e.id,...e.aliases??[]];for(let o of n){let r=a(o);if(r.length===0)continue;let i=t.get(r);if(i!==void 0&&i!==e.id)throw new Error(`Status token "${r}" already belongs to status "${i}". Choose a different id/alias to avoid shadowing it.`)}}export{U as a,R as b,B as c,ve as d,Q as e,Z as f,Ae as g,ke as h,Ce as i,De as j,$e as k,Fe as l,Ne as m,v as n,Ue as o,Re as p,qe as q,Ge as r,Je as s,Ke as t,be as u};
6
- //# sourceMappingURL=chunk-ISEOBALS.js.map
6
+ //# sourceMappingURL=chunk-QFEDRPPI.js.map