@unbrained/pm-cli 2026.8.16 → 2026.8.18

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 (225) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/AGENTS.md +4 -3
  3. package/CHANGELOG.md +65 -6
  4. package/README.md +16 -16
  5. package/dist/cli/error-guidance.js +7 -4
  6. package/dist/cli/public.d.ts +2 -0
  7. package/dist/cli/public.js +21 -0
  8. package/dist/cli/register-list-query.js +132 -51
  9. package/dist/cli/register-mutation.js +4 -4
  10. package/dist/cli-bundle/bundle-manifest.json +148 -148
  11. package/dist/cli-bundle/chunks/chunk-5UZZAJKR.js +3 -0
  12. package/dist/cli-bundle/chunks/chunk-ALDJGKAK.js +2 -0
  13. package/dist/cli-bundle/chunks/chunk-BSK2IN3C.js +8 -0
  14. package/dist/cli-bundle/chunks/chunk-DY4DMUMC.js +197 -0
  15. package/dist/cli-bundle/chunks/{chunk-73UGEBRS.js → chunk-GNFAFIJI.js} +10 -10
  16. package/dist/cli-bundle/chunks/chunk-L5Q2CLPE.js +35 -0
  17. package/dist/cli-bundle/chunks/{chunk-RIS565OA.js → chunk-PVRUN5ZS.js} +5 -5
  18. package/dist/cli-bundle/chunks/chunk-RZQTVMRQ.js +2 -0
  19. package/dist/cli-bundle/chunks/chunk-SARFF5H5.js +3 -0
  20. package/dist/cli-bundle/chunks/chunk-UYCLQVL2.js +13 -0
  21. package/dist/cli-bundle/chunks/{chunk-URW4QRMI.js → chunk-YRGOLZA7.js} +59 -55
  22. package/dist/cli-bundle/chunks/register-list-query-I23LALEE.js +11 -0
  23. package/dist/cli-bundle/chunks/register-mutation-6YGU3GPH.js +20 -0
  24. package/dist/cli-bundle/chunks/{register-operations-KGDNRMCL.js → register-operations-4HTFC6J7.js} +2 -2
  25. package/dist/cli-bundle/chunks/{register-setup-NVXBOD5I.js → register-setup-PPPEF3SN.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/chunk-2PN4TJXH.js +2 -0
  27. package/dist/cli-bundle/focused-chunks/{chunk-C7JUBRFP.js → chunk-3TKWMNKF.js} +3 -3
  28. package/dist/cli-bundle/focused-chunks/chunk-5AF3ZBNB.js +155 -0
  29. package/dist/cli-bundle/focused-chunks/chunk-C5IW2NDA.js +2 -0
  30. package/dist/cli-bundle/focused-chunks/{chunk-CODV5LUT.js → chunk-EUEGXZ2A.js} +3 -3
  31. package/dist/cli-bundle/focused-chunks/{chunk-4JPEBFFC.js → chunk-EX6MKP2X.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/{chunk-SSNDYZTM.js → chunk-K43KKAFS.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/{chunk-6ROKKT4X.js → chunk-M62NO7EI.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/{chunk-T46KLOIB.js → chunk-ODOVCP45.js} +47 -47
  35. package/dist/cli-bundle/focused-chunks/chunk-RNDNMARJ.js +16 -0
  36. package/dist/cli-bundle/focused-chunks/chunk-TN4AE665.js +26 -0
  37. package/dist/cli-bundle/focused-chunks/chunk-TVV2DONO.js +2 -0
  38. package/dist/cli-bundle/focused-chunks/chunk-UI6AJ5TD.js +4 -0
  39. package/dist/cli-bundle/focused-chunks/chunk-V5XTGLK7.js +2 -0
  40. package/dist/cli-bundle/focused-chunks/chunk-WGHQVU6P.js +2 -0
  41. package/dist/cli-bundle/focused-chunks/chunk-XYNBXTDQ.js +2 -0
  42. package/dist/cli-bundle/focused-chunks/chunk-Z56ECT7I.js +2 -0
  43. package/dist/cli-bundle/main.js +7 -7
  44. package/dist/cli-bundle/sdk-authoring.js +1 -1
  45. package/dist/cli-bundle/sdk-contracts.js +1 -1
  46. package/dist/cli-bundle/sdk-core.js +31 -31
  47. package/dist/cli-bundle/sdk-governance.js +1 -1
  48. package/dist/cli-bundle/sdk-graph.js +1 -1
  49. package/dist/cli-bundle/sdk-merge.js +32 -32
  50. package/dist/cli-bundle/sdk-query.js +1 -1
  51. package/dist/cli-bundle/sdk-runtime.js +1 -1
  52. package/dist/cli-bundle/sdk-testing.js +1 -1
  53. package/dist/cli-bundle/sdk.js +4 -2
  54. package/dist/core/config/nested-settings.js +8 -2
  55. package/dist/core/extensions/exporter-output-contract.d.ts +12 -0
  56. package/dist/core/extensions/exporter-output-contract.js +67 -0
  57. package/dist/core/extensions/extension-types.d.ts +36 -1
  58. package/dist/core/extensions/extension-types.js +2 -2
  59. package/dist/core/extensions/loader.js +43 -48
  60. package/dist/core/extensions/manifest-schema.d.ts +20 -0
  61. package/dist/core/extensions/manifest-schema.js +52 -0
  62. package/dist/core/history/event-index.d.ts +5 -0
  63. package/dist/core/history/event-index.js +133 -27
  64. package/dist/core/history/replay.js +32 -14
  65. package/dist/core/schema/fields-file.d.ts +1 -1
  66. package/dist/core/schema/fields-file.js +2 -2
  67. package/dist/core/schema/runtime-field-values.js +115 -9
  68. package/dist/core/schema/runtime-schema.d.ts +3 -1
  69. package/dist/core/schema/runtime-schema.js +124 -3
  70. package/dist/core/sentry/helpers.js +3 -3
  71. package/dist/core/shared/constants.js +5 -2
  72. package/dist/core/shared/errors.d.ts +10 -0
  73. package/dist/core/shared/errors.js +2 -2
  74. package/dist/core/shared/time.d.ts +2 -0
  75. package/dist/core/shared/time.js +27 -2
  76. package/dist/core/store/settings-validator.d.ts +4 -0
  77. package/dist/core/store/settings-validator.js +3 -2
  78. package/dist/core/store/settings.js +8 -2
  79. package/dist/mcp/tool-definitions.js +12 -7
  80. package/dist/sdk/agent/refusal-reachability.d.ts +46 -6
  81. package/dist/sdk/agent/refusal-reachability.js +350 -8
  82. package/dist/sdk/authoring.d.ts +1 -1
  83. package/dist/sdk/authoring.js +2 -2
  84. package/dist/sdk/cli-bootstrap.d.ts +2 -2
  85. package/dist/sdk/cli-bootstrap.js +4 -4
  86. package/dist/sdk/cli-contracts/command-aliases.d.ts +34 -2
  87. package/dist/sdk/cli-contracts/command-aliases.js +64 -13
  88. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -0
  89. package/dist/sdk/cli-contracts/enum-contracts.js +9 -2
  90. package/dist/sdk/cli-contracts/flag-contracts.js +11 -7
  91. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +70 -0
  92. package/dist/sdk/cli-contracts/grammar-contracts.js +345 -0
  93. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +19 -2
  94. package/dist/sdk/cli-contracts/runtime-contracts.js +61 -14
  95. package/dist/sdk/cli-contracts/tool-parameter-tables.js +10 -4
  96. package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
  97. package/dist/sdk/cli-contracts/tool-schema.js +20 -11
  98. package/dist/sdk/cli-contracts.d.ts +2 -2
  99. package/dist/sdk/cli-contracts.js +4 -4
  100. package/dist/sdk/completion.js +13 -15
  101. package/dist/sdk/compose.d.ts +9 -5
  102. package/dist/sdk/compose.js +33 -3
  103. package/dist/sdk/context-intent-contracts.d.ts +8 -4
  104. package/dist/sdk/context-intent-contracts.js +76 -31
  105. package/dist/sdk/contracts.d.ts +1 -0
  106. package/dist/sdk/contracts.js +3 -2
  107. package/dist/sdk/core.d.ts +1 -1
  108. package/dist/sdk/core.js +3 -3
  109. package/dist/sdk/dependency-flag-validation.d.ts +9 -2
  110. package/dist/sdk/dependency-flag-validation.js +101 -35
  111. package/dist/sdk/environment/host-environment-errors.js +25 -7
  112. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +78 -14
  113. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +62 -14
  114. package/dist/sdk/governance/assurance-action.d.ts +3 -7
  115. package/dist/sdk/governance/assurance-action.js +97 -2
  116. package/dist/sdk/governance/boundary-fixtures.d.ts +86 -0
  117. package/dist/sdk/governance/boundary-fixtures.js +201 -0
  118. package/dist/sdk/governance/defect-recurrence-signals.d.ts +10 -0
  119. package/dist/sdk/governance/defect-recurrence-signals.js +25 -0
  120. package/dist/sdk/governance/defect-recurrence.d.ts +242 -0
  121. package/dist/sdk/governance/defect-recurrence.js +523 -0
  122. package/dist/sdk/governance.d.ts +2 -0
  123. package/dist/sdk/governance.js +4 -2
  124. package/dist/sdk/graph/governance.js +3 -2
  125. package/dist/sdk/guide-topics.js +193 -4
  126. package/dist/sdk/index.d.ts +7 -3
  127. package/dist/sdk/index.js +8 -5
  128. package/dist/sdk/init-agent-guidance.js +3 -3
  129. package/dist/sdk/lifecycle/create.js +4 -2
  130. package/dist/sdk/lifecycle/update-many.js +15 -2
  131. package/dist/sdk/lifecycle/update.js +5 -2
  132. package/dist/sdk/linked-artifacts.js +63 -14
  133. package/dist/sdk/mutation-events.d.ts +18 -2
  134. package/dist/sdk/mutation-events.js +59 -16
  135. package/dist/sdk/output.d.ts +44 -0
  136. package/dist/sdk/output.js +28 -2
  137. package/dist/sdk/query/complete-list.d.ts +94 -0
  138. package/dist/sdk/query/complete-list.js +173 -0
  139. package/dist/sdk/query/get.d.ts +2 -0
  140. package/dist/sdk/query/get.js +32 -7
  141. package/dist/sdk/query/list.js +5 -2
  142. package/dist/sdk/query.d.ts +1 -0
  143. package/dist/sdk/query.js +3 -2
  144. package/dist/sdk/read-output-contracts.d.ts +2 -2
  145. package/dist/sdk/read-output-contracts.js +36 -9
  146. package/dist/sdk/relationship-analytics.js +90 -14
  147. package/dist/sdk/relationship-kinds/contract.d.ts +4 -0
  148. package/dist/sdk/relationship-kinds/contract.js +3 -2
  149. package/dist/sdk/relationships.d.ts +1 -1
  150. package/dist/sdk/relationships.js +11 -2
  151. package/dist/sdk/runtime-extended-actions.js +10 -2
  152. package/dist/sdk/runtime.d.ts +8 -2
  153. package/dist/sdk/runtime.js +11 -8
  154. package/dist/sdk/schema.d.ts +1 -0
  155. package/dist/sdk/schema.js +2 -2
  156. package/dist/sdk/test/execution.d.ts +6 -2
  157. package/dist/sdk/test/execution.js +39 -13
  158. package/dist/types.d.ts +34 -2
  159. package/dist/types.js +4 -2
  160. package/docs/AGENT_GUIDE.md +25 -9
  161. package/docs/CLI_GRAMMAR.md +106 -0
  162. package/docs/COMMANDS.md +23 -23
  163. package/docs/CONFIGURATION.md +58 -1
  164. package/docs/CONTEXT_INTEGRITY_CONTRACTS.md +58 -0
  165. package/docs/DEFECT_RECURRENCE.md +134 -0
  166. package/docs/DEPENDENCY_KIND_CONTRACT.md +12 -2
  167. package/docs/ONBOARDING.md +4 -4
  168. package/docs/QUICKSTART.md +1 -1
  169. package/docs/README.md +4 -0
  170. package/docs/RELATIONSHIP_GRAPH.md +16 -2
  171. package/docs/RELEASING.md +30 -6
  172. package/docs/SDK.md +74 -7
  173. package/docs/SDK_ARTIFACT_OUTPUT.md +72 -0
  174. package/docs/SDK_CONTEXT_COORDINATION.md +46 -12
  175. package/docs/SDK_RUNTIME_BOUNDARIES.md +9 -1
  176. package/docs/TESTING.md +18 -1
  177. package/docs/TRUSTWORTHY_CONTEXT_EVIDENCE.md +1 -1
  178. package/docs/agent-task-token-baseline.json +5 -5
  179. package/marketplace.json +2 -2
  180. package/package.json +8 -5
  181. package/packages/pm-beads/package.json +1 -1
  182. package/packages/pm-calendar/package.json +1 -1
  183. package/packages/pm-command-kit/package.json +1 -1
  184. package/packages/pm-digital-twin/package.json +1 -1
  185. package/packages/pm-governance-audit/package.json +1 -1
  186. package/packages/pm-guide-shell/package.json +1 -1
  187. package/packages/pm-kanban/package.json +1 -1
  188. package/packages/pm-lifecycle-hooks/package.json +1 -1
  189. package/packages/pm-linked-test-adapters/package.json +1 -1
  190. package/packages/pm-search-advanced/package.json +1 -1
  191. package/packages/pm-templates/package.json +1 -1
  192. package/packages/pm-todos/package.json +1 -1
  193. package/packages/pm-vcs/package.json +1 -1
  194. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  195. package/plugins/pm-claude/skills/pm-audit/SKILL.md +26 -0
  196. package/plugins/pm-claude/skills/pm-developer/SKILL.md +26 -0
  197. package/plugins/pm-claude/skills/pm-planner/SKILL.md +26 -0
  198. package/plugins/pm-claude/skills/pm-release/SKILL.md +26 -0
  199. package/plugins/pm-claude/skills/pm-workflow/SKILL.md +26 -0
  200. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  201. package/plugins/pm-codex/skills/pm-auditor/SKILL.md +26 -0
  202. package/plugins/pm-codex/skills/pm-native/SKILL.md +26 -0
  203. package/plugins/pm-codex/skills/pm-release/SKILL.md +26 -0
  204. package/sdk/public-surface.json +1243 -54
  205. package/dist/cli-bundle/chunks/chunk-47OQEOQB.js +0 -2
  206. package/dist/cli-bundle/chunks/chunk-HCIYWD6M.js +0 -35
  207. package/dist/cli-bundle/chunks/chunk-I2LUWWR5.js +0 -3
  208. package/dist/cli-bundle/chunks/chunk-IC5W2T34.js +0 -2
  209. package/dist/cli-bundle/chunks/chunk-OAC5NIV4.js +0 -3
  210. package/dist/cli-bundle/chunks/chunk-PANOOBIS.js +0 -13
  211. package/dist/cli-bundle/chunks/chunk-TK6N7HGM.js +0 -8
  212. package/dist/cli-bundle/chunks/chunk-TOFG2URD.js +0 -197
  213. package/dist/cli-bundle/chunks/register-list-query-EYCXHZAG.js +0 -10
  214. package/dist/cli-bundle/chunks/register-mutation-7YVIG54J.js +0 -20
  215. package/dist/cli-bundle/focused-chunks/chunk-5NMFSX26.js +0 -155
  216. package/dist/cli-bundle/focused-chunks/chunk-725JSCMP.js +0 -2
  217. package/dist/cli-bundle/focused-chunks/chunk-DQ6SMTBF.js +0 -2
  218. package/dist/cli-bundle/focused-chunks/chunk-HAACPSUW.js +0 -2
  219. package/dist/cli-bundle/focused-chunks/chunk-J4UFYHOD.js +0 -2
  220. package/dist/cli-bundle/focused-chunks/chunk-JX5Z344Q.js +0 -2
  221. package/dist/cli-bundle/focused-chunks/chunk-L4RDYBIQ.js +0 -2
  222. package/dist/cli-bundle/focused-chunks/chunk-NJ5RLEFD.js +0 -26
  223. package/dist/cli-bundle/focused-chunks/chunk-QYZERYR5.js +0 -4
  224. package/dist/cli-bundle/focused-chunks/chunk-TZATVC4G.js +0 -16
  225. package/dist/cli-bundle/focused-chunks/chunk-WY3WRPVN.js +0 -2
@@ -1,2 +0,0 @@
1
- import{k as A}from"./chunk-73UGEBRS.js";import{$ as b,C as f,E as h,Ef as E,Nd as k,Od as y,Ti as S,el as m}from"./chunk-TOFG2URD.js";(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]="271cf7c1-f84b-5f59-aa13-ed8cb4ee232f")}catch{}})();var F=new Set(["append","claim","close","close-task","comments","copy","delete","deps","docs","files","focus","get","history","history-compact","history-redact","history-repair","learnings","notes","pause-task","release","restore","start-task","test","update"]),x=new Map([["files","discover"],["item","complete"]]),G=new Set(["--author","--output-budget","--output-format","--output-include","--output-limit","--output-session","--path","--pm-path"]),$=new Map([["append",1],["close",1],["close-task",1],["comments",1],["item complete",1],["learnings",1],["notes",1],["restore",1]]);function R(e){let t=e?.trim().toLowerCase()??"";return F.has(t)||x.has(t)}function L(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")return;if(G.has(n)){t+=1;continue}if(!n.startsWith("-"))return t}}function O(e,t,n){let o=x.get(n);if(o===void 0)return t+1;let s=e[t+1]?.toLowerCase()===o;if(!(!s&&!F.has(n)))return t+(s?2:1)}function U(e){let t=new Map;for(let n of m(e))for(let o of[n.flag,n.short,...n.aliases??[]])o&&t.set(o,n);return t}function q(e){let t=[];for(let n=0;n<e.length;n+=1){let o=e[n];if(o==="--")break;o==="--id"?(t.push({index:n,consumed:2,value:e[n+1]}),n+=1):o.startsWith("--id=")&&t.push({index:n,consumed:1,value:o.slice(5)})}return t}function j(e,t,n){if(e.indexOf("=")>=0||t===void 0||t.startsWith("-"))return!1;let s=n.get(e);return s!==void 0&&s.value_type!=="boolean"}function K(e,t,n,o,s){let i=0;for(let r=t;r<e.length;r+=1){let a=e[r];if(a==="--")break;if(a==="--id"){r+=1;continue}if(!a.startsWith("--id=")){if(!a.startsWith("-")){if(r<o)return!0;i+=1;continue}j(a,e[r+1],s)&&(r+=1)}}return i>($.get(n)??0)}function N(e){let t=L(e),n=t===void 0?void 0:e[t]?.toLowerCase();if(!R(n))return{argv:[...e],changed:!1,conflict:!1};let o=x.get(n)===e[t+1]?.toLowerCase()?`${n} ${e[t+1]?.toLowerCase()}`:n,s=U(o),i=q(e),r=i[0];if(!r||!r.value?.trim())return{argv:[...e],changed:!1,conflict:!1};let a=O(e,t,n);if(a===void 0)return{argv:[...e],changed:!1,conflict:!1};if(i.length>1||K(e,a,o,r.index,s))return{argv:[...e],changed:!1,conflict:!0,itemId:r.value};let u=[...e.slice(0,r.index),...e.slice(r.index+r.consumed)],c=L(u),l=O(u,c,n);return u.splice(l,0,r.value),{argv:u,changed:!0,conflict:!1,itemId:r.value}}(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]="eccdb2d2-da6f-555b-ba1b-8339f9b64f1a")}catch{}})();var g=new Set(["--pm-path","--path","--author","--output-include","--output-limit","--output-budget","--output-format","--output-session","--output-cursor"]),Y=new Set(["--output-include","--output-limit","--output-budget","--output-format","--output-session","--output-cursor"]),D=e=>{let t=e.indexOf("=");return t>0&&g.has(e.slice(0,t))},_=(e,t)=>typeof t!="string"?!1:e==="--path"||e==="--pm-path"||!t.startsWith("-"),T=new Set(["--no-extensions","--no-pager","--json","--quiet","--lean","--token-accounting","--output-row-contract"]);function X(e,t,n){let o=e[t];if(T.has(o))return n.booleanFlags.add(o),1;let s=o.indexOf("="),i=s>0?o.slice(0,s):o;if(!g.has(i))return 1;let r=s>0?o.slice(s+1):void 0,a=r===void 0&&_(i,e[t+1]),u=r??(a?e[t+1]:void 0);return i==="--author"?n.author=u??"":typeof u=="string"&&u.length>0&&(Y.has(i)?n.outputValues:n.pathValues).set(i,u),a?2:1}function J(e){let t={booleanFlags:new Set,outputValues:new Map,pathValues:new Map},n=0;for(;n<e.length&&e[n]!=="--";)n+=X(e,n,t);return{path:t.pathValues.get("--pm-path")??t.pathValues.get("--path"),noExtensions:t.booleanFlags.has("--no-extensions"),noPager:t.booleanFlags.has("--no-pager"),json:t.booleanFlags.has("--json"),quiet:t.booleanFlags.has("--quiet"),lean:t.booleanFlags.has("--lean"),tokenAccounting:t.booleanFlags.has("--token-accounting"),...t.booleanFlags.has("--output-row-contract")?{outputRowContract:!0}:{},...t.outputValues.get("--output-include")===void 0?{}:{outputInclude:t.outputValues.get("--output-include")},...t.outputValues.get("--output-limit")===void 0?{}:{outputLimit:t.outputValues.get("--output-limit")},...t.outputValues.get("--output-budget")===void 0?{}:{outputBudget:t.outputValues.get("--output-budget")},...t.outputValues.get("--output-format")==="toon"||t.outputValues.get("--output-format")==="json"?{outputFormat:t.outputValues.get("--output-format")}:{},...t.outputValues.get("--output-session")===void 0?{}:{outputSession:t.outputValues.get("--output-session")},...t.outputValues.get("--output-cursor")===void 0?{}:{outputCursor:t.outputValues.get("--output-cursor")},...t.author===""?{authorMissingValue:!0}:t.author!==void 0?{author:t.author}:{}}}function M(e){let t=[],n=0;for(;n<e.length;){let o=e[n];if(o==="--")break;if(T.has(o)||o==="--profile"||o==="--id-only"||o==="--full-changed-fields"||o==="--explain"){n+=1;continue}if(g.has(o)){n+=_(o,e[n+1])?2:1;continue}if(D(o)){n+=1;continue}t.push(o),n+=1}return t}function Z(e){let t=M(e);if(t[0]?.trim().toLowerCase()==="help"){let i=[];for(let r=1;r<t.length;r+=1){let a=t[r];if(a.startsWith("-"))break;i.push(a.trim().toLowerCase())}return{requested:!0,commandPathTokens:i}}if(t.findIndex(i=>i==="--help"||i==="-h")<0)return{requested:!1,commandPathTokens:[]};let s=[];for(let i of t){if(i.startsWith("-"))break;s.push(i.trim().toLowerCase())}return{requested:!0,commandPathTokens:s}}function I(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")return;if(g.has(n)){t+=_(n,e[t+1])?1:0;continue}if(!(D(n)||T.has(n)||n==="--profile"||n==="--id-only"||n==="--explain")&&!n.startsWith("-"))return t}}function C(e){let t=I(e);return t===void 0?void 0:e[t].trim().toLowerCase()}function H(e,t){return t.noPager?!0:process.stdout.isTTY===!0?!1:Z(e).requested}function Ve(e){let t=["PAGER","MANPAGER","GIT_PAGER","LESS"],n=t.map(i=>process.env[i]),o=()=>{for(let[i,r]of t.entries()){let a=n[i];a===void 0?delete process.env[r]:process.env[r]=a}},s=J(e);return H(e,s)&&(process.env.PAGER="cat",process.env.MANPAGER="cat",process.env.GIT_PAGER="cat",(typeof process.env.LESS!="string"||process.env.LESS.trim().length===0)&&(process.env.LESS="FRX")),o}var Q=new Set(["install","uninstall","explore","manage","doctor","adopt","adopt-all","activate","deactivate"]);function ee(e){let t=I(e);if(t===void 0||e[t]!=="extension")return[...e];let n=e[t+1];if(!n||n.startsWith("-"))return[...e];if(!Q.has(n))return[...e];if(e.includes("--help")||e.includes("-h"))return[...e];let o=`--${n}`;return e.includes(o)?[...e]:[...e.slice(0,t+1),o,...e.slice(t+2)]}var te=new Set(["pm","pm-cli"]);function ne(e,t){let n=I(e);if(n===void 0)return e;let o=e[n];return te.has(o.trim().toLowerCase())?(t.push({from:o,to:[],reason:"executable_alias",confidence:"high"}),[...e.slice(0,n),...e.slice(n+1)]):e}function oe(e,t){let n=I(e);if(n===void 0)return e;let o=e[n],s=S[o.trim().toLowerCase()];if(!s)return e;let i=[...e];return i[n]=s,t.push({from:o,to:[s],reason:"command_alias",confidence:"high"}),i}function w(e){return e.replace(/^--?/,"").replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function P(e){return w(e).replace(/-/g,"")}function V(e,t,n){let o=e.get(t);if(o===void 0){e.set(t,n);return}o!==n&&e.set(t,null)}function se(e){let t=[],n=o=>{typeof o=="string"&&o.startsWith("--")&&t.push(o)};n(e.flag);for(let o of e.aliases??[])n(o);return t}function ie(e,t){let n=t??m(e),o=new Map,s=new Map,i=new Map,r=new Set;for(let a of n){let u=se(a);if(u.length===0)continue;let c=`--${w(u[0])}`;for(let d of u)V(o,w(d),c),V(s,P(d),c);let l=P(c);i.has(c)||i.set(c,l),a.list===!0&&r.add(c)}return{canonicalByNormalized:o,canonicalByCompact:s,canonicalComparables:[...i.entries()].map(([a,u])=>({canonicalFlag:a,comparable:u})),listCanonicalFlags:r}}function B(e,t){let n=w(e),o=t.canonicalByNormalized.get(n);if(typeof o=="string")return{flag:o,reason:"flag_alias",confidence:"high"};let s=n.replace(/-/g,""),i=t.canonicalByCompact.get(s);if(typeof i=="string")return{flag:i,reason:"flag_alias",confidence:"high"};let r=s.length>=8?2:1,a=Number.POSITIVE_INFINITY,u,c=!1;for(let l of t.canonicalComparables){let d=b(s,l.comparable,r);if(d!==null){if(d<a){a=d,u=l.canonicalFlag,c=!1;continue}d===a&&u!==l.canonicalFlag&&(c=!0)}}return!u||c||!Number.isFinite(a)||a<=0?null:{flag:u,reason:"flag_typo",confidence:a>=2?"medium":"high"}}function De(e){let t=[`${e}s`];return e.endsWith("y")&&e.length>1&&t.push(`${e.slice(0,-1)}ies`),t}function re(e,t=!1){if(t||e.includes("://"))return null;let n=e.match(/^([A-Za-z][A-Za-z0-9_-]{1,63})([:=])(.*)$/);if(!n)return null;let o=n[1],s=n[3];return s.length===0?null:{key:o,value:s}}function ae(e,t,n=!1){if(n||!e.startsWith("--"))return{tokens:[e]};let o=e.indexOf("="),s=o>=0?e.slice(0,o):e,i=o>=0?e.slice(o+1):void 0,r=B(s,t);if(!r)return{tokens:[e]};let a=i===void 0?r.flag:`${r.flag}=${i}`;return a===e?{tokens:[e]}:{tokens:[a],event:{from:e,to:[a],reason:r.reason,confidence:r.confidence}}}function ue(e){let t=new Set,n=!1;for(let o=0;o<e.length;o+=1){if(n){t.add(o),n=!1;continue}let s=e[o];n=s==="--path"||s==="--pm-path"}return t}function ce(e){if(!e.startsWith("--"))return null;let t=e.indexOf("=");return t<0?{flag:e}:{flag:e.slice(0,t),inlineValue:e.slice(t+1)}}function le(e,t,n){n.push(e[t]);let o=e[t+1];return typeof o=="string"&&o!=="--"?(n.push(o),t+2):t+1}function de(e,t,n,o){if(n.inlineValue!==void 0)return{originalTokens:[e[t]],value:n.inlineValue,consumed:1};let s=[],i=t+1;for(;i<e.length&&e[i]!=="--"&&!e[i].startsWith("-")&&(s.length===0||o.has(n.flag));)s.push(e[i]),i+=1;let r=s.length===0?1:1+s.length;return{originalTokens:e.slice(t,t+r),value:s.length===0?void 0:s.join(","),consumed:r}}function fe(e,t,n,o){let s=e.get(n);if(s){s.values.push(o.value),s.occurrences+=1;return}e.set(n,{outputIndex:t.length,originalTokens:o.originalTokens,values:[o.value],occurrences:1}),t.push(null)}function pe(e,t){let n=[],o=[];for(let[s,i]of e){if(!(i.occurrences>=2||t.has(s)&&i.originalTokens.length>2)){o.push({outputIndex:i.outputIndex,tokens:i.originalTokens});continue}let a=`${s}=${i.values.join(",")}`;o.push({outputIndex:i.outputIndex,tokens:[a]}),n.push({from:`${s} (x${i.occurrences})`,to:[a],reason:"list_merge",confidence:"high"})}return{events:n,splices:o}}function he(e,t){t.sort((n,o)=>o.outputIndex-n.outputIndex);for(let n of t)e.splice(n.outputIndex,1,...n.tokens)}function me(e,t,n=new Set,o=new Set){if(t.size===0)return{argv:[...e],events:[]};let s=[],i=new Map,r=0;for(;r<e.length;){let c=e[r];if(c==="--"){s.push(...e.slice(r));break}if(n.has(c)){r=le(e,r,s);continue}let l=ce(c);if(!l||!t.has(l.flag)){s.push(c),r+=1;continue}let d=de(e,r,l,o);if(d.value===void 0){s.push(c),r+=d.consumed;continue}fe(i,s,l.flag,{originalTokens:d.originalTokens,value:d.value}),r+=d.consumed}let{events:a,splices:u}=pe(i,o);return he(s,u),{argv:s,events:a}}var v=new Map([["--add",new Set(["command","cmd","path"])],["--remove",new Set(["command","path"])]]);function ge(e,t){if(e!=="test"||t.length<2)return!1;let n=t[t.length-1],o=t[t.length-2],s=v.get(o);return s!==void 0&&s.has(n)}function be(e,t){return e==="search"||ge(e,t)}function ye(e,t,n){if(t!=="test")return e;let o=[],s=0;for(;s<e.length;){let i=e[s];if(i==="--")return o.push(...e.slice(s)),o;let r=v.get(i),a=r?e[s+1]:void 0;if(!r||typeof a!="string"||!r.has(a)){o.push(i),s+=1;continue}let u=s+2;for(;u<e.length&&!e[u].startsWith("-");)u+=1;if(u-(s+2)!==1){o.push(i),s+=1;continue}let c=e[s+2],l=`${a}=${c}`;o.push(i,l),n.push({from:`${i} ${a} ${c}`,to:[i,l],reason:"bare_key_value",confidence:"high"}),s+=3}return o}function we(e,t,n,o){let s=[],i=ue(e);for(let r=0;r<e.length;r+=1){let a=e[r];if(a==="--"){s.push(...e.slice(r));break}let u=i.has(r),c=s[s.length-1];if(a.startsWith("--")){let d=ae(a,t,u);s.push(...d.tokens),d.event&&o.push(d.event);continue}let l=re(a,u);if(l&&!(typeof c=="string"&&c.startsWith("-"))&&!be(n,s)){let d=B(l.key,t);if(d){let p=[d.flag,l.value];s.push(...p),o.push({from:a,to:p,reason:"bare_key_value",confidence:d.confidence});continue}}s.push(a)}return s}function Me(e){let t=[],n=ne(e,t),o=ee(n);(o.length!==n.length||o.some((p,W)=>p!==n[W]))&&t.push({from:n.join(" "),to:[...o],reason:"legacy_extension_action",confidence:"high"});let s=oe(o,t),i=N(s);if(i.conflict)throw new h("Provide the item id either positionally or with --id, not both.",f.USAGE);i.changed&&t.push({from:`--id ${i.itemId}`,to:[i.itemId],reason:"item_id_alias",confidence:"high"});let r=C(i.argv),a=Ie(i.argv),u=ie(a??r),c=we(i.argv,u,r,t),l=ye(c,r,t),d=me(l,u.listCanonicalFlags,g,r==="create"?new Set(["--tags"]):new Set);for(let p of d.events)t.push(p);return{argv:d.argv,commandName:r,trace:t}}function Ie(e){let t=M(e),n=t[0]?.trim().toLowerCase(),o=t[1]?.trim().toLowerCase();return(n==="extension"||n==="package"||n==="packages")&&typeof o=="string"&&o.length>0&&!o.startsWith("-")?`${n} ${o}`:n}function Be(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")break;if(n==="--type"){let o=e[t+1];if(typeof o=="string"&&o.trim().length>0)return o.trim();continue}if(n.startsWith("--type=")){let o=n.slice(7).trim();if(o.length>0)return o}}}(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]="4973a995-60f0-5990-9927-371dc6716063")}catch{}})();function z(e){return e.trim().match(/--[a-z0-9][a-z0-9_-]*/i)?.[0]?.replaceAll("_","-").toLowerCase()}function $e(e){if(!(!Array.isArray(e)||e.length===0))return C(e)}function xe(e,t){let n=z(t);if(!n)return;let o=m(e).find(s=>s.flag===n||s.aliases?.includes(n));return o?o.value_type==="boolean"?null:`<${o.value_name??"value"}>`:"<value>"}function Re(e,t,n){let o=[...e],s=o.indexOf("--"),i=s<0?o.length:s;for(let r of n){let a=z(r);if(!a||o.slice(0,i).some(l=>l===a||l.startsWith(`${a}=`)))continue;let u=xe(t,a),c=u?[a,u]:[a];o.splice(i,0,...c),i+=c.length}return o.length===e.length?void 0:A(o)}(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]="d82065d1-488d-523e-9df2-a30056f29603")}catch{}})();(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]="5810cf1d-fc9a-597b-a47e-a914009fadfa")}catch{}})();function Je(e){return e instanceof h||e instanceof Error?e.message:"Unknown failure"}function _e(e){if(typeof e!="object"||e===null||!("exitCode"in e))return;let t=e.exitCode;return typeof t=="number"&&Number.isFinite(t)?t:void 0}function Te(e){let t=Math.trunc(e);return t>f.SUCCESS?t:f.GENERIC_FAILURE}function Ze(e){return typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="string"&&e.code.startsWith("commander.")}function He(e,t){if(e instanceof Error)return e;let n=new Error(t),o=_e(e);return o!==void 0&&(n.exitCode=Te(o)),n}(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]="8f7cca3d-9b19-53b4-a510-5290aaf75e12")}catch{}})();function ot(e){if(e===void 0)return()=>{};let t=e.trim();if(t.length===0)throw new h("--author requires a non-empty value.",f.USAGE,{code:"missing_required_argument",nextSteps:["Pass an explicit author identifier with --author <id>."]});let n=k();y(t);let o=!1;return()=>{o||(o=!0,n===void 0?y(void 0):y(n))}}import{Command as Ce}from"commander";(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]="03d46cbf-73bc-50c9-b4e6-e7329ee53076")}catch{}})();function at(e){return new Ce().name("pm").description("Universal, flexible, extensible, agent-optimized project management CLI for any project or programming language.").version(e).showHelpAfterError(!1).allowExcessArguments(!1).allowUnknownOption(!1).configureOutput({writeOut:t=>{E(t)},writeErr:()=>{}}).option("--json","Output JSON instead of TOON; mutations emit a flat receipt with top-level id/status/changed_field_count while reads use documented entity or collection envelopes").option("--lean","Omit null and empty containers from JSON output").option("--token-accounting","Attach a bounded per-section token-cost receipt to command output").option("--output-include <fields>","Retain comma-separated fields or sections in read output").option("--output-limit <count>","Bound rows in read output").option("--output-budget <tokens|unbounded>","Bound estimated tokens in read output or explicitly disable the default ceiling").option("--output-format <toon|json>","Select the read-output encoding").option("--output-session <state>","Carry a JSON session budget and served-item ledger across read calls").option("--output-cursor <cursor>","Resume a budget-compacted declared row collection").option("--output-row-contract","Include the machine-readable row selector and TOON encoding contract").option("--quiet","Suppress stdout output").option("--no-changed-fields","Omit the changed_fields array from mutation output (keeps changed_field_count)").option("--full-changed-fields","Restore the legacy full mutation envelope and changed_fields array").option("--id-only","Print only id and status for single-item mutation output").option("--pm-path <dir>","Explicit tracker storage path for this command (preferred over --path)").option("--path <dir>","Backward-compatible alias for --pm-path; this is the tracker storage path, not a workspace cwd").option("--no-extensions","Disable extension loading").option("--no-pager","Disable pager integration for help and long output").option("--explain","Render extended rationale and examples in help output").option("--profile","Print deterministic timing diagnostics").option("--author <id>","Override mutation author for this invocation").exitOverride()}(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]="71e5a870-f62f-5252-b4e9-e1a42e36009f")}catch{}})();var ke={add:["create","append"],fetch:["get"],inspect:["get","health"],log:["history","comments","notes"],ls:["list"],pause:["release"],read:["get"],remove:["delete"],rm:["delete"],show:["get"]};function Ee(e,t){let n=e.trim().toLowerCase(),o=t.trim().toLowerCase();if(o.length===0)return Number.POSITIVE_INFINITY;let s=n.split(" "),i=ke[o]?.indexOf(n);if(i!==void 0&&i>=0)return i;if(n===o)return 10;if(s.includes(o))return 11;if(s.some(u=>u.startsWith(o)))return 12;let r=o.length>=5?2:1,a=Number.POSITIVE_INFINITY;for(let u of s){let c=b(u,o,r);c!==null&&(a=Math.min(a,c))}return Number.isFinite(a)?20+a:n.includes(o)?30:Number.POSITIVE_INFINITY}function lt(e,t){return e.map(n=>({path:n,score:Ee(n,t)})).filter(n=>Number.isFinite(n.score)).sort((n,o)=>n.score!==o.score?n.score-o.score:n.path===o.path?0:n.path<o.path?-1:1).map(n=>n.path)}export{R as a,N as b,J as c,M as d,Z as e,I as f,C as g,Ve as h,ee as i,De as j,me as k,ye as l,Me as m,Be as n,$e as o,xe as p,Re as q,Je as r,_e as s,Te as t,Ze as u,He as v,ot as w,at as x,Ee as y,lt as z};
2
- //# sourceMappingURL=chunk-47OQEOQB.js.map