@unbrained/pm-cli 2026.9.11 → 2026.9.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +42 -0
  3. package/dist/cli/command-namespaces.js +1 -1
  4. package/dist/cli/commander-usage.js +2 -2
  5. package/dist/cli/error-guidance.d.ts +10 -0
  6. package/dist/cli/error-guidance.js +1 -1
  7. package/dist/cli/main.js +2 -2
  8. package/dist/cli/option-values.d.ts +3 -0
  9. package/dist/cli/option-values.js +2 -0
  10. package/dist/cli/register-mutation.d.ts +5 -0
  11. package/dist/cli/register-mutation.js +2 -16
  12. package/dist/cli/schema/registration.d.ts +4 -0
  13. package/dist/cli/schema/registration.js +16 -0
  14. package/dist/cli-bundle/bundle-manifest.json +160 -152
  15. package/dist/cli-bundle/chunks/{chunk-TDKWJQD7.js → chunk-3DWX3CKN.js} +2 -2
  16. package/dist/cli-bundle/chunks/chunk-6KHYW3FH.js +235 -0
  17. package/dist/cli-bundle/chunks/chunk-AKTBOX6U.js +2 -0
  18. package/dist/cli-bundle/chunks/chunk-GBK5MV6N.js +29 -0
  19. package/dist/cli-bundle/chunks/{chunk-JMQKJ7CJ.js → chunk-GQQR6JAL.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-QER6OSOP.js → chunk-KM4XVZR7.js} +53 -53
  21. package/dist/cli-bundle/chunks/{chunk-VFKBNGF6.js → chunk-LA44JECQ.js} +2 -2
  22. package/dist/cli-bundle/chunks/{chunk-DAWH7TGV.js → chunk-XEZOGC3P.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-TFVKBJJ4.js → chunk-XM7RWQLM.js} +103 -103
  24. package/dist/cli-bundle/chunks/{chunk-RJQSCK74.js → chunk-YDSV4QIQ.js} +6 -6
  25. package/dist/cli-bundle/chunks/chunk-YQTJACN5.js +20 -0
  26. package/dist/cli-bundle/chunks/{chunk-BN5QVWNY.js → chunk-ZZI7IHMM.js} +2 -2
  27. package/dist/cli-bundle/chunks/{register-list-query-U6MY437C.js → register-list-query-WMJTBWNW.js} +2 -2
  28. package/dist/cli-bundle/chunks/register-mutation-EXGOXP3D.js +20 -0
  29. package/dist/cli-bundle/chunks/{register-operations-EHWIZW3X.js → register-operations-2H4CDRGU.js} +2 -2
  30. package/dist/cli-bundle/chunks/{register-setup-BZYL3HBL.js → register-setup-NYBWGPOS.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-TWE3GPQM.js → chunk-7JR6M2JR.js} +17 -17
  32. package/dist/cli-bundle/focused-chunks/{chunk-GKUF7TM5.js → chunk-B6JAANOH.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/{chunk-UJCQXUD2.js → chunk-DSJYL4VP.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/{chunk-VS6MR2HT.js → chunk-F66QJWI4.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/{chunk-MOT32PR2.js → chunk-FBCLVOBE.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/{chunk-HM6JS6Q3.js → chunk-FPNI4U2B.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/chunk-HFAW3FJQ.js +2 -0
  38. package/dist/cli-bundle/focused-chunks/chunk-KP3N6PVZ.js +164 -0
  39. package/dist/cli-bundle/focused-chunks/chunk-LQ67C7ZO.js +2 -0
  40. package/dist/cli-bundle/focused-chunks/{chunk-TGMSSI3Z.js → chunk-OENAWWP4.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/{chunk-7WISPJRZ.js → chunk-SDQCJF4H.js} +53 -53
  42. package/dist/cli-bundle/focused-chunks/chunk-TUHRUFID.js +2 -0
  43. package/dist/cli-bundle/focused-chunks/{chunk-6JF66HAG.js → chunk-V7PSTKHD.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/{chunk-FJDEFA64.js → chunk-XCCM7P7V.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/chunk-YUXBHIUV.js +20 -0
  46. package/dist/cli-bundle/focused-chunks/{chunk-BEQAW7OT.js → chunk-ZAMG7HBB.js} +4 -4
  47. package/dist/cli-bundle/focused-chunks/chunk-ZF5PXK6A.js +2 -0
  48. package/dist/cli-bundle/main.js +20 -20
  49. package/dist/cli-bundle/sdk-authoring.js +1 -1
  50. package/dist/cli-bundle/sdk-contracts.js +2 -2
  51. package/dist/cli-bundle/sdk-core.js +34 -34
  52. package/dist/cli-bundle/sdk-governance.js +1 -1
  53. package/dist/cli-bundle/sdk-graph.js +1 -1
  54. package/dist/cli-bundle/sdk-merge.js +42 -42
  55. package/dist/cli-bundle/sdk-query.js +1 -1
  56. package/dist/cli-bundle/sdk-runtime.js +1 -1
  57. package/dist/cli-bundle/sdk-testing.js +1 -1
  58. package/dist/cli-bundle/sdk.js +8 -8
  59. package/dist/core/history/history.js +1 -1
  60. package/dist/core/history/operation-contract.d.ts +30 -0
  61. package/dist/core/history/operation-contract.js +2 -0
  62. package/dist/core/history/tombstone.d.ts +3 -0
  63. package/dist/core/history/tombstone.js +2 -0
  64. package/dist/core/item/id.d.ts +8 -7
  65. package/dist/core/item/id.js +1 -1
  66. package/dist/core/output/mutation-projection.d.ts +1 -0
  67. package/dist/core/output/mutation-projection.js +1 -1
  68. package/dist/core/sentry/instrument.js +1 -1
  69. package/dist/core/shared/command-line.d.ts +10 -0
  70. package/dist/core/shared/command-line.js +2 -0
  71. package/dist/core/shared/errors.d.ts +13 -0
  72. package/dist/core/shared/errors.js +1 -1
  73. package/dist/core/store/item-store.d.ts +5 -1
  74. package/dist/core/store/item-store.js +1 -1
  75. package/dist/core/telemetry/consent.d.ts +1 -1
  76. package/dist/core/telemetry/consent.js +2 -2
  77. package/dist/core/telemetry/policy.d.ts +10 -0
  78. package/dist/core/telemetry/policy.js +2 -0
  79. package/dist/core/telemetry/runtime.d.ts +11 -9
  80. package/dist/core/telemetry/runtime.js +3 -3
  81. package/dist/sdk/agent/command-suggestions.js +1 -1
  82. package/dist/sdk/agent/item-addressing.js +1 -1
  83. package/dist/sdk/agent-capability-contracts.js +1 -1
  84. package/dist/sdk/cli-bootstrap.js +1 -1
  85. package/dist/sdk/cli-contracts/command-aliases.js +1 -1
  86. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  87. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  88. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
  89. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +3 -0
  90. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  91. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  92. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  93. package/dist/sdk/command-line.d.ts +1 -6
  94. package/dist/sdk/command-line.js +1 -1
  95. package/dist/sdk/comments.js +1 -1
  96. package/dist/sdk/completion.js +1 -1
  97. package/dist/sdk/contracts.d.ts +1 -0
  98. package/dist/sdk/contracts.js +1 -1
  99. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  100. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  101. package/dist/sdk/governance/health.js +1 -1
  102. package/dist/sdk/governance/storage-integrity.js +1 -1
  103. package/dist/sdk/governance/workflow-completeness.js +1 -1
  104. package/dist/sdk/governance/workflow-policy.js +2 -2
  105. package/dist/sdk/index.d.ts +1 -0
  106. package/dist/sdk/index.js +1 -1
  107. package/dist/sdk/learnings.js +1 -1
  108. package/dist/sdk/lifecycle/claim.d.ts +2 -0
  109. package/dist/sdk/lifecycle/claim.js +1 -1
  110. package/dist/sdk/lifecycle/mcp-actions.d.ts +4 -0
  111. package/dist/sdk/lifecycle/mcp-actions.js +1 -1
  112. package/dist/sdk/lifecycle/task-composition.d.ts +2 -0
  113. package/dist/sdk/lifecycle/task-composition.js +1 -1
  114. package/dist/sdk/merge/reconcile.js +1 -1
  115. package/dist/sdk/merge/three-way.js +2 -2
  116. package/dist/sdk/notes.js +1 -1
  117. package/dist/sdk/public-surface.json +1 -1
  118. package/dist/sdk/query/projection-contracts.d.ts +1 -1
  119. package/dist/sdk/query/projection-contracts.js +1 -1
  120. package/dist/sdk/runtime.js +1 -1
  121. package/dist/sdk/telemetry.d.ts +5 -0
  122. package/dist/sdk/telemetry.js +1 -1
  123. package/docs/AGENT_UX_CONTRACTS.md +8 -0
  124. package/docs/ARCHITECTURE.md +7 -0
  125. package/docs/CLI_GRAMMAR.md +31 -0
  126. package/docs/COMMAND_NAMESPACES.md +7 -4
  127. package/docs/CONFIGURATION.md +13 -2
  128. package/docs/HISTORY_OPERATIONS.md +46 -0
  129. package/docs/HISTORY_RECOVERY.md +27 -2
  130. package/docs/LIFECYCLE_COMMANDS.md +19 -2
  131. package/docs/MERGE_SAFETY.md +64 -3
  132. package/docs/WORKFLOW_POLICIES.md +47 -3
  133. package/docs/generated/AGENT_CAPABILITY_ROUTING.md +4 -4
  134. package/docs/generated/AGENT_COMMAND_SURFACE.md +10 -0
  135. package/docs/generated/FLAG_LEXICON_BUDGETS.md +11 -1
  136. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +8 -5
  137. package/marketplace.json +2 -2
  138. package/package.json +1 -1
  139. package/packages/pm-beads/package.json +1 -1
  140. package/packages/pm-calendar/package.json +1 -1
  141. package/packages/pm-command-kit/package.json +1 -1
  142. package/packages/pm-digital-twin/package.json +1 -1
  143. package/packages/pm-governance-audit/README.md +22 -0
  144. package/packages/pm-governance-audit/package.json +1 -1
  145. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +13 -26
  146. package/packages/pm-guide-shell/package.json +1 -1
  147. package/packages/pm-kanban/package.json +1 -1
  148. package/packages/pm-lifecycle-hooks/package.json +1 -1
  149. package/packages/pm-linked-test-adapters/package.json +1 -1
  150. package/packages/pm-search-advanced/package.json +1 -1
  151. package/packages/pm-templates/package.json +1 -1
  152. package/packages/pm-todos/package.json +1 -1
  153. package/packages/pm-vcs/package.json +1 -1
  154. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  155. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  156. package/dist/cli-bundle/chunks/chunk-FBY6PEIR.js +0 -20
  157. package/dist/cli-bundle/chunks/chunk-IRUNFLLG.js +0 -2
  158. package/dist/cli-bundle/chunks/chunk-RJZFAXBW.js +0 -235
  159. package/dist/cli-bundle/chunks/chunk-SGAKQIGQ.js +0 -29
  160. package/dist/cli-bundle/chunks/register-mutation-HAPHD4S7.js +0 -20
  161. package/dist/cli-bundle/focused-chunks/chunk-3JVTLBCW.js +0 -20
  162. package/dist/cli-bundle/focused-chunks/chunk-DZ3ATEFS.js +0 -2
  163. package/dist/cli-bundle/focused-chunks/chunk-M74YW332.js +0 -164
  164. package/dist/cli-bundle/focused-chunks/chunk-ONDKO4EL.js +0 -2
  165. package/dist/cli-bundle/focused-chunks/chunk-YOPNRWSX.js +0 -2
@@ -0,0 +1,2 @@
1
+ import{$ as L,O as p,Ph as B,Q as h,Ze as M,_ as N,_e as _,_n as y,da as F,g as O,h as m,k as P,oa as I,pf as w,qf as E,rf as D,sf as S,tf as b,uf as v,xf as V}from"./chunk-6KHYW3FH.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]="69117358-9878-589b-8918-e71599e6c7df")}catch{}})();var f=Object.freeze({clock:"PM_CLOCK",tickMs:"PM_CLOCK_TICK_MS",seed:"PM_SEED"});function C(e,t,n,o){return new h(e,p.USAGE,{code:"invalid_reproducible_process_environment",reason:t,field:n,required:`${f.clock} and ${f.seed}; ${f.tickMs} is optional`,nextSteps:[`Set ${f.clock} to an ISO-8601 instant with Z or a numeric UTC offset and ${f.seed} to a non-empty reproducibility seed.`,`Optionally set ${f.tickMs} to a non-negative integer; it defaults to 1.`,"Unset all three variables to retain normal wall-clock and cryptographic-random behavior."],recovery:{recovery_mode:"compact",provided_fields:o,missing_required_fields:t==="incomplete"?[f.clock,f.seed].filter(i=>!o.includes(i)):void 0}})}function H(e){let t=e[f.clock],n=e[f.tickMs],o=e[f.seed],i=[[f.clock,t],[f.tickMs,n],[f.seed,o]].filter(a=>a[1]!==void 0).map(([a])=>a);if(i.length===0)return;if(t===void 0||o===void 0)throw C("Reproducible process execution requires PM_CLOCK and PM_SEED together.","incomplete",t===void 0?f.clock:f.seed,i);if(o.trim().length===0)throw C(`${f.seed} must not be empty.`,"invalid_value",f.seed,i);if(!F(t))throw C(`${f.clock} must be a valid ISO-8601 instant with Z or a numeric UTC offset.`,"invalid_value",f.clock,i);let s=n===void 0?1:Number(n);if(n?.trim().length===0||!Number.isSafeInteger(s)||s<0)throw C(`${f.tickMs} must be a non-negative integer.`,"invalid_value",f.tickMs,i);return N({clock:t,seed:o,tickMs:s})}function J(e){let t=H(e);return t===void 0?n=>n():L(t)}async function Ue(e,t){return J(e)(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]="e1db7644-e481-5049-a773-fcffa09f1779")}catch{}})();var R=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"]),$=new Map([["files","discover"],["item","complete"]]),Q=new Map([["append",1],["close",1],["close-task",1],["comments",1],["item complete",1],["learnings",1],["notes",1],["restore",1]]);function z(e){let t=m(e?.trim().toLowerCase()??"");return R.has(t)||$.has(t)}function ee(e,t,n){let o=R.has(n)?t+1:void 0,i=b(e.slice(t+1));if(i===void 0)return o;let s=t+1+i,a=`${n} ${e[s]}`,r=m(a);return r===a?n==="item"&&e[s]==="complete"?s+1:o:z(r)?A(e,s,r):void 0}function A(e,t,n){if(["history","context","ctx","update","close","item"].includes(n))return ee(e,t,n);let o=$.get(n);if(o===void 0)return t+1;let i=e[t+1]?.toLowerCase()===o;return t+(i?2:1)}function te(e){let t=new Map;for(let n of y(e))for(let o of[n.flag,n.short,...n.aliases??[]])o&&t.set(o,n);return t}function ne(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 oe(e,t,n){if(e.indexOf("=")>=0||t===void 0||t.startsWith("-"))return!1;let i=n.get(e);return i!==void 0&&i.value_type!=="boolean"}function ie(e,t,n,o,i){let s=0;for(let a=t;a<e.length;a+=1){let r=e[a];if(r==="--")break;if(r==="--id"){a+=1;continue}if(!r.startsWith("--id=")){if(!r.startsWith("-")){if(a<o)return!0;s+=1;continue}oe(r,e[a+1],i)&&(a+=1)}}return s>(Q.get(m(n))??0)}function G(e){let t=b(e),n=t===void 0?void 0:e[t]?.toLowerCase();if(n!=="context"&&n!=="ctx"&&!z(n))return{argv:[...e],changed:!1,conflict:!1};let o=A(e,t,n);if(o===void 0)return{argv:[...e],changed:!1,conflict:!1};let i=o>t+1?`${m(e.slice(t,o-1).join(" "))} ${e[o-1]}`:n,s=te(i),a=ne(e),r=a[0];if(!r||!r.value?.trim())return{argv:[...e],changed:!1,conflict:!1};if(a.length>1||ie(e,o,i,r.index,s))return{argv:[...e],changed:!1,conflict:!0,itemId:r.value};let c=[...e.slice(0,r.index),...e.slice(r.index+r.consumed)],l=b(c),u=A(c,l,n);return c.splice(u,0,r.value),{argv:c,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]="8ef3b254-0494-57bc-8bbf-8ee58eb7d152")}catch{}})();var se=new Set(["--output-include","--output-limit","--output-budget","--output-format","--output-session","--output-cursor"]);function re(e,t,n){let o=e[t];if(E.has(o))return n.booleanFlags.add(o),1;let i=o.indexOf("="),s=i>0?o.slice(0,i):o;if(!w.has(s))return 1;let a=i>0?o.slice(i+1):void 0,r=a===void 0&&S(s,e[t+1]),c=a??(r?e[t+1]:void 0);return s==="--author"?n.author=c??"":typeof c=="string"&&c.length>0&&(se.has(s)?n.outputValues:n.pathValues).set(s,c),r?2:1}function ae(e){let t={booleanFlags:new Set,outputValues:new Map,pathValues:new Map},n=0;for(;n<e.length&&e[n]!=="--";)n+=re(e,n,t);return{path:t.pathValues.get("--pm-path")??t.pathValues.get("--path"),noExtensions:t.booleanFlags.has("--no-extensions")||["history attest","history-attest"].includes(Y(e)??""),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 q(e){let t=[],n=0;for(;n<e.length;){let o=e[n];if(o==="--")break;if(E.has(o)||o==="--profile"||o==="--id-only"||o==="--full-changed-fields"||o==="--explain"){n+=1;continue}if(w.has(o)){n+=S(o,e[n+1])?2:1;continue}if(D(o)){n+=1;continue}t.push(o),n+=1}return t}function ce(e){let t=q(e);if(t[0]?.trim().toLowerCase()==="help"){let s=[];for(let a=1;a<t.length;a+=1){let r=t[a];if(r.startsWith("-"))break;s.push(r.trim().toLowerCase())}return{requested:!0,commandPathTokens:s}}if(t.findIndex(s=>s==="--help"||s==="-h")<0)return{requested:!1,commandPathTokens:[]};let i=[];for(let s of t){if(s.startsWith("-"))break;i.push(s.trim().toLowerCase())}return{requested:!0,commandPathTokens:i}}function k(e){return b(e)}function le(e){return v(e)}function ue(e,t){return t.noPager?!0:process.stdout.isTTY===!0?!1:ce(e).requested}function rt(e){let t=["PAGER","MANPAGER","GIT_PAGER","LESS"],n=t.map(s=>process.env[s]),o=()=>{for(let[s,a]of t.entries()){let r=n[s];r===void 0?delete process.env[a]:process.env[a]=r}},i=ae(e);return ue(e,i)&&(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 de=new Set(["install","uninstall","explore","manage","doctor","adopt","adopt-all","activate","deactivate"]);function fe(e){let t=k(e);if(t===void 0||e[t]!=="extension")return[...e];let n=e[t+1];if(!n||n.startsWith("-"))return[...e];if(!de.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 pe=new Set(["pm","pm-cli"]);function me(e,t){let n=k(e);if(n===void 0)return e;let o=e[n];return pe.has(o.trim().toLowerCase())?(t.push({from:o,to:[],reason:"executable_alias",confidence:"high"}),[...e.slice(0,n),...e.slice(n+1)]):e}function he(e,t){let n=k(e);if(n!==void 0&&e[n]==="help"){let r=k(e.slice(n+1));n=r===void 0?void 0:n+1+r}if(n===void 0)return e;let o=e[n],i=P[o.trim().toLowerCase()];if(!i)return e;let s=i.split(" "),a=[...e.slice(0,n),...s,...e.slice(n+1)];return t.push({from:o,to:s,reason:"command_alias",confidence:"high"}),a}function x(e){return e.replace(/^--?/,"").replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function U(e){return x(e).replace(/-/g,"")}function W(e,t,n){let o=e.get(t);if(o===void 0){e.set(t,n);return}o!==n&&e.set(t,null)}function ge(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 be(e,t){let n=t??y(e),o=new Map,i=new Map,s=new Map,a=new Set;for(let r of n){let c=ge(r);if(c.length===0)continue;let l=`--${x(c[0])}`;for(let d of c)W(o,x(d),l),W(i,U(d),l);let u=U(l);s.has(l)||s.set(l,u),r.list===!0&&a.add(l)}return{canonicalByNormalized:o,canonicalByCompact:i,canonicalComparables:[...s.entries()].map(([r,c])=>({canonicalFlag:r,comparable:c})),listCanonicalFlags:a}}function j(e,t){let n=x(e),o=t.canonicalByNormalized.get(n);if(typeof o=="string")return{flag:o,reason:"flag_alias",confidence:"high"};let i=n.replace(/-/g,""),s=t.canonicalByCompact.get(i);if(typeof s=="string")return{flag:s,reason:"flag_alias",confidence:"high"};let a=i.length>=8?2:1,r=Number.POSITIVE_INFINITY,c,l=!1;for(let u of t.canonicalComparables){let d=I(i,u.comparable,a);if(d!==null){if(d<r){r=d,c=u.canonicalFlag,l=!1;continue}d===r&&c!==u.canonicalFlag&&(l=!0)}}return!c||l||!Number.isFinite(r)||r<=0?null:{flag:c,reason:"flag_typo",confidence:r>=2?"medium":"high"}}function at(e){let t=[`${e}s`];return e.endsWith("y")&&e.length>1&&t.push(`${e.slice(0,-1)}ies`),t}function ye(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],i=n[3];return i.length===0?null:{key:o,value:i}}function we(e,t,n=!1){if(n||!e.startsWith("--"))return{tokens:[e]};let o=e.indexOf("="),i=o>=0?e.slice(0,o):e,s=o>=0?e.slice(o+1):void 0,a=j(i,t);if(!a)return{tokens:[e]};let r=s===void 0?a.flag:`${a.flag}=${s}`;return r===e?{tokens:[e]}:{tokens:[r],event:{from:e,to:[r],reason:a.reason,confidence:a.confidence}}}function Ie(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 i=e[o];n=i==="--path"||i==="--pm-path"}return t}function _e(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 ve(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 Ce(e,t,n,o){if(n.inlineValue!==void 0)return{originalTokens:[e[t]],value:n.inlineValue,consumed:1};let i=[],s=t+1;for(;s<e.length&&e[s]!=="--"&&!e[s].startsWith("-")&&(i.length===0||o.has(n.flag));)i.push(e[s]),s+=1;let a=i.length===0?1:1+i.length;return{originalTokens:e.slice(t,t+a),value:i.length===0?void 0:i.join(","),consumed:a}}function ke(e,t,n,o){let i=e.get(n);if(i){i.values.push(o.value),i.occurrences+=1;return}e.set(n,{outputIndex:t.length,originalTokens:o.originalTokens,values:[o.value],occurrences:1}),t.push(null)}function xe(e,t){let n=[],o=[];for(let[i,s]of e){if(!(s.occurrences>=2||t.has(i)&&s.originalTokens.length>2)){o.push({outputIndex:s.outputIndex,tokens:s.originalTokens});continue}let r=`${i}=${s.values.join(",")}`;o.push({outputIndex:s.outputIndex,tokens:[r]}),n.push({from:`${i} (x${s.occurrences})`,to:[r],reason:"list_merge",confidence:"high"})}return{events:n,splices:o}}function Te(e,t){t.sort((n,o)=>o.outputIndex-n.outputIndex);for(let n of t)e.splice(n.outputIndex,1,...n.tokens)}function Ee(e,t,n=new Set,o=new Set){if(t.size===0)return{argv:[...e],events:[]};let i=[],s=new Map,a=0;for(;a<e.length;){let l=e[a];if(l==="--"){i.push(...e.slice(a));break}if(n.has(l)){a=ve(e,a,i);continue}let u=_e(l);if(!u||!t.has(u.flag)){i.push(l),a+=1;continue}let d=Ce(e,a,u,o);if(d.value===void 0){i.push(l),a+=d.consumed;continue}ke(s,i,u.flag,{originalTokens:d.originalTokens,value:d.value}),a+=d.consumed}let{events:r,splices:c}=xe(s,o);return Te(i,c),{argv:i,events:r}}var K=new Map([["--add",new Set(["command","cmd","path"])],["--remove",new Set(["command","path"])]]);function Se(e,t){if(e!=="test"||t.length<2)return!1;let n=t[t.length-1],o=t[t.length-2],i=K.get(o);return i!==void 0&&i.has(n)}function Ae(e,t){return e==="search"||Se(e,t)}function Oe(e,t,n){if(t!=="test")return e;let o=[],i=0;for(;i<e.length;){let s=e[i];if(s==="--")return o.push(...e.slice(i)),o;let a=K.get(s),r=a?e[i+1]:void 0;if(!a||typeof r!="string"||!a.has(r)){o.push(s),i+=1;continue}let c=i+2;for(;c<e.length&&!e[c].startsWith("-");)c+=1;if(c-(i+2)!==1){o.push(s),i+=1;continue}let l=e[i+2],u=`${r}=${l}`;o.push(s,u),n.push({from:`${s} ${r} ${l}`,to:[s,u],reason:"bare_key_value",confidence:"high"}),i+=3}return o}function Pe(e,t,n,o){let i=[],s=Ie(e);for(let a=0;a<e.length;a+=1){let r=e[a];if(r==="--"){i.push(...e.slice(a));break}let c=s.has(a),l=i[i.length-1];if(r.startsWith("--")){let d=we(r,t,c);i.push(...d.tokens),d.event&&o.push(d.event);continue}let u=ye(r,c);if(u&&!(typeof l=="string"&&l.startsWith("-"))&&!Ae(n,i)){let d=j(u.key,t);if(d){let g=[d.flag,u.value];i.push(...g),o.push({from:r,to:g,reason:"bare_key_value",confidence:d.confidence});continue}}i.push(r)}return i}function Ne(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")break;if(n==="--verify"){let o=e[t+1];if(o===void 0||o==="--")throw new h("history attest --verify requires a bundle file.",p.USAGE);e.splice(t,2,`--verify=${o}`)}else(w.has(n)||n==="--output"||n==="--hash-algorithm")&&(t+=1)}}function ct(e){let t=[],n=me(e,t),o=fe(n);(o.length!==n.length||o.some((T,Z)=>T!==n[Z]))&&t.push({from:n.join(" "),to:[...o],reason:"legacy_extension_action",confidence:"high"});let i=he(o,t),s=G(i);if(s.conflict)throw new h("Provide the item id either positionally or with --id, not both.",p.USAGE);s.changed&&t.push({from:`--id ${s.itemId}`,to:[s.itemId],reason:"item_id_alias",confidence:"high"});let a=le(s.argv),r=Y(s.argv),c=m(r??a??""),l=be(r??a),u=Pe(s.argv,l,c,t),d=Oe(u,c,t),g=Ee(d,l.listCanonicalFlags,w,a==="create"?new Set(["--tags"]):new Set);for(let T of g.events)t.push(T);return r==="history attest"&&Ne(g.argv),{argv:g.argv,commandName:a,trace:t}}function Y(e){let t=q(e),n=t[0]?.trim().toLowerCase(),o=t[1]?.trim().toLowerCase(),i=O(t);return i?i.canonical:(n==="extension"||n==="package"||n==="packages")&&typeof o=="string"&&o.length>0&&!o.startsWith("-")?`${n} ${o}`:n}function lt(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]="4f7274c6-547e-5590-b7c9-a4d6418bf860")}catch{}})();function X(e){return e.trim().match(/--[a-z0-9][a-z0-9_-]*/i)?.[0]?.replaceAll("_","-").toLowerCase()}function mt(e){if(!(!Array.isArray(e)||e.length===0))return v(e)}function Le(e,t){let n=X(t);if(!n)return;let o=y(e).find(i=>i.flag===n||i.aliases?.includes(n));return o?o.value_type==="boolean"?null:`<${o.value_name??"value"}>`:"<value>"}function ht(e,t,n){let o=[...e],i=o.indexOf("--"),s=i<0?o.length:i;for(let a of n){let r=X(a);if(!r||o.slice(0,s).some(u=>u===r||u.startsWith(`${r}=`)))continue;let c=Le(t,r),l=c?[r,c]:[r];o.splice(s,0,...l),s+=l.length}return o.length===e.length?void 0:V(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]="bd9a8d3b-bc6f-5309-a3fb-7e5f41ef9dab")}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]="bdf3dec8-63d1-5ea6-a413-64be0ae8f69f")}catch{}})();function vt(e){return e instanceof h||e instanceof Error?e.message:"Unknown failure"}function Fe(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 Me(e){let t=Math.trunc(e);return t>p.SUCCESS?t:p.GENERIC_FAILURE}function Ct(e){return typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="string"&&e.code.startsWith("commander.")}function kt(e,t){if(e instanceof Error)return e;let n=new Error(t),o=Fe(e);return o!==void 0&&(n.exitCode=Me(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]="d22b586a-5c12-518e-b1ee-4baa0d04243b")}catch{}})();function At(e){if(e===void 0)return()=>{};let t=e.trim();if(t.length===0)throw new h("--author requires a non-empty value.",p.USAGE,{code:"missing_required_argument",nextSteps:["Pass an explicit author identifier with --author <id>."]});let n=M();_(t);let o=!1;return()=>{o||(o=!0,n===void 0?_(void 0):_(n))}}import{Command as De}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]="a8da6368-489f-579a-8a64-a9bb025f95e7")}catch{}})();function Lt(e){return new De().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=>{B(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("--all","Reveal every public command and compatibility alias").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]="54cfd2e9-acc0-5d3b-b763-b89b6ac637ed")}catch{}})();var Ve={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 Be(e,t){let n=e.trim().toLowerCase(),o=t.trim().toLowerCase();if(o.length===0)return Number.POSITIVE_INFINITY;let i=n.split(" "),s=Ve[o]?.indexOf(m(n));if(s!==void 0&&s>=0)return s;if(n===o)return 10;if(i.includes(o))return 11;if(i.some(c=>c.startsWith(o)))return 12;let a=o.length>=5?2:1,r=Number.POSITIVE_INFINITY;for(let c of i){let l=I(c,o,a);l!==null&&(r=Math.min(r,l))}return Number.isFinite(r)?20+r:n.includes(o)?30:Number.POSITIVE_INFINITY}function Vt(e,t){return e.map(n=>({path:n,score:Be(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{f as a,H as b,J as c,Ue as d,z as e,G as f,ae as g,q as h,ce as i,k as j,le as k,rt as l,fe as m,at as n,Ee as o,Oe as p,ct as q,lt as r,mt as s,Le as t,ht as u,vt as v,Fe as w,Me as x,Ct as y,kt as z,At as A,Lt as B,Be as C,Vt as D};
2
+ //# sourceMappingURL=chunk-AKTBOX6U.js.map