@unbrained/pm-cli 2026.8.17 → 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 (157) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/AGENTS.md +4 -3
  3. package/CHANGELOG.md +35 -3
  4. package/README.md +3 -3
  5. package/dist/cli/error-guidance.js +7 -4
  6. package/dist/cli/register-list-query.js +132 -51
  7. package/dist/cli-bundle/bundle-manifest.json +146 -146
  8. package/dist/cli-bundle/chunks/chunk-5UZZAJKR.js +3 -0
  9. package/dist/cli-bundle/chunks/{chunk-YM2YAMF7.js → chunk-ALDJGKAK.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-HBJAS566.js → chunk-BSK2IN3C.js} +2 -2
  11. package/dist/cli-bundle/chunks/chunk-DY4DMUMC.js +197 -0
  12. package/dist/cli-bundle/chunks/{chunk-JOKATURE.js → chunk-GNFAFIJI.js} +9 -9
  13. package/dist/cli-bundle/chunks/chunk-L5Q2CLPE.js +35 -0
  14. package/dist/cli-bundle/chunks/{chunk-TPXZIBIV.js → chunk-PVRUN5ZS.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-7IBRGCHX.js → chunk-RZQTVMRQ.js} +2 -2
  16. package/dist/cli-bundle/chunks/chunk-SARFF5H5.js +3 -0
  17. package/dist/cli-bundle/chunks/chunk-UYCLQVL2.js +13 -0
  18. package/dist/cli-bundle/chunks/{chunk-3UEGXBMR.js → chunk-YRGOLZA7.js} +58 -54
  19. package/dist/cli-bundle/chunks/register-list-query-I23LALEE.js +11 -0
  20. package/dist/cli-bundle/chunks/{register-mutation-4WBRPXLV.js → register-mutation-6YGU3GPH.js} +2 -2
  21. package/dist/cli-bundle/chunks/{register-operations-SSENDH5B.js → register-operations-4HTFC6J7.js} +2 -2
  22. package/dist/cli-bundle/chunks/{register-setup-DOSFBGKE.js → register-setup-PPPEF3SN.js} +2 -2
  23. package/dist/cli-bundle/focused-chunks/chunk-2PN4TJXH.js +2 -0
  24. package/dist/cli-bundle/focused-chunks/{chunk-ZQPGZZWQ.js → chunk-3TKWMNKF.js} +3 -3
  25. package/dist/cli-bundle/focused-chunks/chunk-5AF3ZBNB.js +155 -0
  26. package/dist/cli-bundle/focused-chunks/chunk-C5IW2NDA.js +2 -0
  27. package/dist/cli-bundle/focused-chunks/{chunk-SYZENPIT.js → chunk-EUEGXZ2A.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/{chunk-XKAMP5OU.js → chunk-EX6MKP2X.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/{chunk-CYFK5UPB.js → chunk-K43KKAFS.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-ATEY76SX.js → chunk-M62NO7EI.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-SALH6B6K.js → chunk-ODOVCP45.js} +5 -5
  32. package/dist/cli-bundle/focused-chunks/chunk-RNDNMARJ.js +16 -0
  33. package/dist/cli-bundle/focused-chunks/chunk-TN4AE665.js +26 -0
  34. package/dist/cli-bundle/focused-chunks/chunk-TVV2DONO.js +2 -0
  35. package/dist/cli-bundle/focused-chunks/chunk-UI6AJ5TD.js +4 -0
  36. package/dist/cli-bundle/focused-chunks/{chunk-MHPIL773.js → chunk-V5XTGLK7.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-KP2VQQVQ.js → chunk-WGHQVU6P.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/chunk-XYNBXTDQ.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/chunk-Z56ECT7I.js +2 -0
  40. package/dist/cli-bundle/main.js +7 -7
  41. package/dist/cli-bundle/sdk-authoring.js +1 -1
  42. package/dist/cli-bundle/sdk-contracts.js +1 -1
  43. package/dist/cli-bundle/sdk-core.js +31 -31
  44. package/dist/cli-bundle/sdk-governance.js +1 -1
  45. package/dist/cli-bundle/sdk-graph.js +1 -1
  46. package/dist/cli-bundle/sdk-merge.js +32 -32
  47. package/dist/cli-bundle/sdk-query.js +1 -1
  48. package/dist/cli-bundle/sdk-runtime.js +1 -1
  49. package/dist/cli-bundle/sdk-testing.js +1 -1
  50. package/dist/cli-bundle/sdk.js +4 -4
  51. package/dist/core/config/nested-settings.js +8 -2
  52. package/dist/core/extensions/exporter-output-contract.d.ts +12 -0
  53. package/dist/core/extensions/exporter-output-contract.js +67 -0
  54. package/dist/core/extensions/extension-types.d.ts +36 -1
  55. package/dist/core/extensions/extension-types.js +2 -2
  56. package/dist/core/extensions/loader.js +35 -44
  57. package/dist/core/history/event-index.d.ts +5 -0
  58. package/dist/core/history/event-index.js +133 -27
  59. package/dist/core/sentry/helpers.js +3 -3
  60. package/dist/core/shared/constants.js +5 -2
  61. package/dist/core/store/settings-validator.d.ts +4 -0
  62. package/dist/core/store/settings-validator.js +3 -2
  63. package/dist/core/store/settings.js +8 -2
  64. package/dist/mcp/tool-definitions.js +12 -7
  65. package/dist/sdk/agent/refusal-reachability.js +4 -4
  66. package/dist/sdk/authoring.d.ts +1 -1
  67. package/dist/sdk/authoring.js +2 -2
  68. package/dist/sdk/cli-bootstrap.d.ts +2 -2
  69. package/dist/sdk/cli-bootstrap.js +4 -4
  70. package/dist/sdk/cli-contracts/command-aliases.d.ts +34 -2
  71. package/dist/sdk/cli-contracts/command-aliases.js +64 -13
  72. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -0
  73. package/dist/sdk/cli-contracts/enum-contracts.js +9 -2
  74. package/dist/sdk/cli-contracts/flag-contracts.js +11 -7
  75. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +70 -0
  76. package/dist/sdk/cli-contracts/grammar-contracts.js +345 -0
  77. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +19 -2
  78. package/dist/sdk/cli-contracts/runtime-contracts.js +61 -14
  79. package/dist/sdk/cli-contracts/tool-parameter-tables.js +7 -2
  80. package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
  81. package/dist/sdk/cli-contracts/tool-schema.js +20 -11
  82. package/dist/sdk/cli-contracts.d.ts +2 -2
  83. package/dist/sdk/cli-contracts.js +4 -4
  84. package/dist/sdk/completion.js +13 -15
  85. package/dist/sdk/compose.d.ts +3 -3
  86. package/dist/sdk/compose.js +2 -2
  87. package/dist/sdk/contracts.d.ts +1 -0
  88. package/dist/sdk/contracts.js +3 -2
  89. package/dist/sdk/core.d.ts +1 -1
  90. package/dist/sdk/core.js +3 -3
  91. package/dist/sdk/environment/host-environment-errors.js +3 -3
  92. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +54 -14
  93. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +50 -14
  94. package/dist/sdk/guide-topics.js +5 -5
  95. package/dist/sdk/index.d.ts +4 -3
  96. package/dist/sdk/index.js +6 -5
  97. package/dist/sdk/init-agent-guidance.js +3 -3
  98. package/dist/sdk/mutation-events.d.ts +18 -2
  99. package/dist/sdk/mutation-events.js +59 -16
  100. package/dist/sdk/output.d.ts +44 -0
  101. package/dist/sdk/output.js +28 -2
  102. package/dist/sdk/query/complete-list.d.ts +94 -0
  103. package/dist/sdk/query/complete-list.js +173 -0
  104. package/dist/sdk/query/list.js +5 -2
  105. package/dist/sdk/query.d.ts +1 -0
  106. package/dist/sdk/query.js +3 -2
  107. package/dist/sdk/read-output-contracts.d.ts +2 -2
  108. package/dist/sdk/read-output-contracts.js +36 -9
  109. package/dist/sdk/runtime-extended-actions.js +10 -2
  110. package/dist/sdk/runtime.d.ts +8 -2
  111. package/dist/sdk/runtime.js +11 -8
  112. package/dist/types.d.ts +5 -0
  113. package/dist/types.js +2 -2
  114. package/docs/AGENT_GUIDE.md +25 -9
  115. package/docs/CLI_GRAMMAR.md +106 -0
  116. package/docs/COMMANDS.md +23 -23
  117. package/docs/ONBOARDING.md +4 -4
  118. package/docs/QUICKSTART.md +1 -1
  119. package/docs/README.md +2 -0
  120. package/docs/RELEASING.md +30 -6
  121. package/docs/SDK.md +36 -2
  122. package/docs/SDK_ARTIFACT_OUTPUT.md +72 -0
  123. package/docs/SDK_CONTEXT_COORDINATION.md +46 -12
  124. package/docs/agent-task-token-baseline.json +5 -5
  125. package/marketplace.json +2 -2
  126. package/package.json +3 -2
  127. package/packages/pm-beads/package.json +1 -1
  128. package/packages/pm-calendar/package.json +1 -1
  129. package/packages/pm-command-kit/package.json +1 -1
  130. package/packages/pm-digital-twin/package.json +1 -1
  131. package/packages/pm-governance-audit/package.json +1 -1
  132. package/packages/pm-guide-shell/package.json +1 -1
  133. package/packages/pm-kanban/package.json +1 -1
  134. package/packages/pm-lifecycle-hooks/package.json +1 -1
  135. package/packages/pm-linked-test-adapters/package.json +1 -1
  136. package/packages/pm-search-advanced/package.json +1 -1
  137. package/packages/pm-templates/package.json +1 -1
  138. package/packages/pm-todos/package.json +1 -1
  139. package/packages/pm-vcs/package.json +1 -1
  140. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  141. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  142. package/sdk/public-surface.json +652 -31
  143. package/dist/cli-bundle/chunks/chunk-2QLOXC3V.js +0 -3
  144. package/dist/cli-bundle/chunks/chunk-4JPYF536.js +0 -35
  145. package/dist/cli-bundle/chunks/chunk-6VDLG2FC.js +0 -13
  146. package/dist/cli-bundle/chunks/chunk-ION3E43Q.js +0 -197
  147. package/dist/cli-bundle/chunks/chunk-OAC5NIV4.js +0 -3
  148. package/dist/cli-bundle/chunks/register-list-query-Q7KII4G5.js +0 -10
  149. package/dist/cli-bundle/focused-chunks/chunk-267MUUS6.js +0 -16
  150. package/dist/cli-bundle/focused-chunks/chunk-2NNFLLNG.js +0 -2
  151. package/dist/cli-bundle/focused-chunks/chunk-2QSAKMIH.js +0 -2
  152. package/dist/cli-bundle/focused-chunks/chunk-BUCG4ZI2.js +0 -2
  153. package/dist/cli-bundle/focused-chunks/chunk-EHXIKD6K.js +0 -2
  154. package/dist/cli-bundle/focused-chunks/chunk-KGEXTMPG.js +0 -2
  155. package/dist/cli-bundle/focused-chunks/chunk-POEEAD2V.js +0 -4
  156. package/dist/cli-bundle/focused-chunks/chunk-XPIC53VA.js +0 -26
  157. package/dist/cli-bundle/focused-chunks/chunk-ZT2DJS27.js +0 -155
@@ -1,2 +1,2 @@
1
- import"./chunk-QWRRFYK3.js";import{Qc as Q,Ta as V,cb as N,ec as x,gc as q,hc as H,hd as Z,ic as J,id as ee,jc as z,kd as te,oc as G,pb as B,pc as j,qb as $,qc as W,qd as ne,ra as L,rb as D,rc as Y,rd as ae,sc as K,sd as oe,td as E,uc as X,yb as U,zd as ie}from"./chunk-4JPYF536.js";import"./chunk-JOKATURE.js";import"./chunk-6VDLG2FC.js";import"./chunk-WYRZZ5ZE.js";import{$c as R,Bl as w,C as m,Cl as s,Dl as k,E as b,Fl as M,Gl as F,If as l,Jf as d,Sa as _,Ud as O,Vl as p,ca as S,oh as I,ul as P,xc as C,yl as c}from"./chunk-ION3E43Q.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]="13159f49-7756-58b8-ac32-7ddd571e7d09")}catch{}})();var re=new Map([["measurements","boolean"],["metric","string"],["measurementLimit","number"],["observe","string_array"],["direction","direction"],["measurementSource","string"],["measurementItem","string"],["measurementRevision","string"],["author","string"],["message","string"],["provenanceCoverage","boolean"],["fleetAttribution","boolean"],["since","string"],["eventLimit","number"],["minimumSample","number"]]),me=new Set(["higher","lower","target"]),fe=[...re.keys()].sort((e,t)=>e.localeCompare(t)).join(", ");function pe(e,t){return e==="boolean"?typeof t=="boolean":e==="string"?typeof t=="string":e==="number"?typeof t=="number":e==="string_array"?Array.isArray(t)&&t.every(n=>typeof n=="string"):e==="direction"&&me.has(t)}function se(e){if(e===void 0)return{};let t;try{t=JSON.parse(e)}catch(n){throw new b(`--analytics must be valid JSON: ${String(n)}`,m.USAGE)}if(t===null||typeof t!="object"||Array.isArray(t))throw new b("--analytics must be a JSON object.",m.USAGE);for(let[n,a]of Object.entries(t)){let o=re.get(n);if(!pe(o,a))throw new b(o===void 0?`Unknown --analytics field "${n}". Accepted fields: ${fe}.`:`--analytics field "${n}" must be ${o.replace("_"," ")}.`,m.USAGE)}return 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]="eee25545-a7e9-54be-abc0-dbccc9b41e74")}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]="b0095f00-00bd-5b28-933c-b63a1711a73d")}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]="99355d20-090b-503e-8079-b858291938e3")}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]="35276f20-abc5-54e2-8251-35971f1fcb4f")}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]="8fa4af33-ba9f-5a19-a359-c64143287b5d")}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]="52c4154e-2761-5230-942c-6ac5e83a830c")}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]="c3fceb32-e0b9-5690-8653-4c699f865c0f")}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]="1e42a508-5568-522f-843d-61febc0bad27")}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]="43769e60-ed80-521d-9375-c28ee5b0ac06")}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]="3f1deb3b-e341-533a-a349-eca48f347600")}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]="91a42861-f8cb-575b-8596-53870f6275c6")}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]="c85956ff-383f-5482-96a9-0ef38949859c")}catch{}})();var le=(e,t)=>V(e,t,{runUpdate:(n,a,o)=>x(n,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]="41d01430-1e95-5f09-9a2f-7e7f8fad8184")}catch{}})();async function ye(e,t,n,a,o){let i=c(o),r=e==="run",u=e==="verdicts",g=e==="presets"||e==="apply",f=e==="promote",h=await N({action:e,...r||u||g||f?{}:{kind:t},id:r||u||f?n??t:n,preset:g?n??t:void 0,definition:s(a,"definition"),trigger:s(a,"trigger"),tree:s(a,"tree"),gate:s(a,"gate"),limit:s(a,"limit"),dry_run:a.dryRun===!0,fullChangedFields:i.fullChangedFields,idOnly:i.idOnly,author:s(a,"author"),message:s(a,"message"),owner:s(a,"owner"),apply:a.apply===!0,enforcement:s(a,"enforcement")},i);l(h,i),typeof h=="object"&&h!==null&&"exit_code"in h&&h.exit_code===1&&(process.exitCode=1)}function ce(e){e.command("assurance").argument("<action>","Action; inspect `pm contracts --command assurance`").argument("[kind]","Declaration kind or run gate id").argument("[id]","Declaration/gate id").description("Manage SDK-owned assurance contracts.").option("--definition <json>","Put declaration JSON").option("--trigger <value>","Gate trigger").option("--tree <value>","Revision identity").option("--gate <id>","Verdict gate filter").option("--limit <number>","Verdict limit").option("--dry-run","Evaluate without recording").option("--author <value>","Mutation author").option("--message <value>","Mutation rationale").option("--owner <item-id>","Preset/derivation owner").option("--apply","Persist derived proposals").option("--enforcement <level>","Promote to warn or block").action(ye)}(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]="dec5fb7d-416f-5da6-bd97-c05c25dbf769")}catch{}})();function ge(e,t){let n=e?.trim().toLowerCase(),a=t?.trim().toLowerCase();if(n===void 0||n.length===0)return a;if(n==="local-analytics")return a&&a.length>0?a:"status";if(a!==void 0&&a.length>0)throw S({command_path:"telemetry",token:`${e} ${t}`,allowed:["status","flush","stats","clear","local-analytics"],token_kind:"path",examples:["pm telemetry stats --limit 10","pm telemetry local-analytics status --json"]});return n}function he(e){return{addValues:Array.isArray(e.add)?e.add:[],addJsonValues:Array.isArray(e.addJson)?e.addJson:[],removeValues:Array.isArray(e.remove)?e.remove:[],removeIndexValues:Array.isArray(e.removeIndex)?e.removeIndex:[]}}function be(e,t){if(e.background===!0){if(e.run!==!0)throw new b("--background requires --run",m.USAGE);if(t.addValues.length>0||t.addJsonValues.length>0||t.removeValues.length>0||t.removeIndexValues.length>0)throw new b("--background does not support --add/--add-json/--remove/--remove-index; update linked tests first, then run in background",m.USAGE)}}async function we(e,t,n,a){let o=await E({kind:"test",commandArgs:M(e,{...t,add:a.addValues,addJson:a.addJsonValues,remove:a.removeValues,removeIndex:a.removeIndexValues}),targetId:e,author:typeof t.author=="string"?t.author:void 0,noExtensions:n.noExtensions===!0},n);l(o,n)}function ke(e,t){return{add:t.addValues,addJson:t.addJsonValues,remove:t.removeValues,removeIndex:t.removeIndexValues,list:!!e.list,run:!!e.run,match:typeof e.match=="string"?e.match:void 0,onlyIndex:typeof e.onlyIndex=="string"||typeof e.onlyIndex=="number"?e.onlyIndex:void 0,onlyLast:!!e.onlyLast,timeout:typeof e.timeout=="string"?e.timeout:void 0,progress:!!e.progress,envSet:Array.isArray(e.envSet)?e.envSet:[],envClear:Array.isArray(e.envClear)?e.envClear:[],sharedHostSafe:!!e.sharedHostSafe,pmContext:typeof e.pmContext=="string"?e.pmContext:void 0,overrideLinkedPmContext:!!e.overrideLinkedPmContext,failOnContextMismatch:!!e.failOnContextMismatch,failOnSkipped:!!e.failOnSkipped,failOnEmptyTestRun:!!e.failOnEmptyTestRun,requireAssertionsForPm:!!e.requireAssertionsForPm,checkContext:!!e.checkContext,autoPmContext:!!e.autoPmContext,author:typeof e.author=="string"?e.author:void 0,message:typeof e.message=="string"?e.message:void 0,force:!!e.force,measure:Array.isArray(e.measure)?e.measure:[],metricBelow:typeof e.metricBelow=="string"?e.metricBelow:void 0,metricDiff:typeof e.metricDiff=="string"?e.metricDiff:void 0}}async function ve(e,t,n,a){let o=await ne(e,ke(t,a),n);(a.addValues.length>0||a.addJsonValues.length>0||a.removeValues.length>0||t.run===!0||a.removeIndexValues.length>0)&&await p(n,o),l(o,n),(o.run_results.some(i=>i.status==="failed")||o.fail_on_skipped_triggered===!0)&&(process.exitCode=m.DEPENDENCY_FAILED)}async function xe(e,t,n){let a=c(n),o=Date.now(),i=he(t);be(t,i),t.background===!0?await we(e,t,a,i):await ve(e,t,a,i),a.profile&&d(`profile:command=test took_ms=${Date.now()-o}`)}function A(e){let t=s(e,"author"),n=s(e,"assignee");if(t!==void 0&&n!==void 0&&t!==n)throw new b("Lifecycle ownership received conflicting --author and --assignee values; use one actor value for both aliases.",m.USAGE,{code:"conflicting_lifecycle_owner",examples:["pm claim pm-123","pm start-task pm-123","pm release pm-123"]});return{author:t??n,message:s(e,"message")}}async function Ae(e,t){let n=c(t),a=Date.now();if(e.background===!0){let r=await E({kind:"test-all",commandArgs:F(e),statusFilter:s(e,"status"),noExtensions:n.noExtensions===!0},n);l(r,n),n.profile&&d(`profile:command=test-all took_ms=${Date.now()-a}`);return}let i=await ae({status:s(e,"status"),limit:s(e,"limit"),offset:s(e,"offset"),timeout:s(e,"timeout"),progress:!!e.progress,envSet:Array.isArray(e.envSet)?e.envSet:[],envClear:Array.isArray(e.envClear)?e.envClear:[],sharedHostSafe:!!e.sharedHostSafe,pmContext:s(e,"pmContext"),overrideLinkedPmContext:!!e.overrideLinkedPmContext,failOnContextMismatch:!!e.failOnContextMismatch,failOnSkipped:!!e.failOnSkipped,failOnEmptyTestRun:!!e.failOnEmptyTestRun,requireAssertionsForPm:!!e.requireAssertionsForPm,checkContext:!!e.checkContext,autoPmContext:!!e.autoPmContext},n);await p(n,{ids:i.results.map(r=>r.id)}),l(i,n),(i.failed>0||i.fail_on_skipped_triggered===!0)&&(process.exitCode=m.DEPENDENCY_FAILED),n.profile&&d(`profile:command=test-all took_ms=${Date.now()-a}`)}async function _e(e,t,n,a){let o=c(a),i=Date.now(),r=await te({subcommand:ge(e,t),limit:s(n,"limit")},o);l(r,o),o.profile&&d(`profile:command=telemetry took_ms=${Date.now()-i}`)}async function Ie(e,t){let n=c(t),a=Date.now(),o=se(s(e,"analytics")),i=await Z(n,{includeEmpty:e.includeEmpty===!0,storage:e.storage===!0,metadataCoverage:e.metadataCoverage===!0,byAssignee:e.byAssignee===!0,byTag:e.byTag===!0,byPriority:e.byPriority===!0,tagPrefix:s(e,"tagPrefix"),fieldUtilization:e.fieldUtilization===!0,...o});i.recorded_observations?.some(r=>r.changed)===!0&&await p(n,{ids:i.recorded_observations?.flatMap(r=>r.observation.item_id?[r.observation.item_id]:[])}),l(i,n),n.profile&&d(`profile:command=stats took_ms=${Date.now()-a}`)}async function De(e,t){let n=c(t),a=Date.now(),o=s(e,"threshold"),i=s(e,"limit"),r=await ee(n,{status:Array.isArray(e.status)&&e.status.length>0?e.status:void 0,since:s(e,"since"),...o===void 0?{}:{threshold:Number(o)},...i===void 0?{}:{limit:Number(i)}});l(r,n),n.profile&&d(`profile:command=duplicates took_ms=${Date.now()-a}`)}async function Se(e,t){let n=c(t),a=Date.now(),o=!!e.strictExit||!!e.failOnWarn,i=await L(n,{strictDirectories:!!e.strictDirectories,requireMergeDrivers:!!e.requireMergeDrivers,checkOnly:!!e.checkOnly,checkTelemetry:!!e.checkTelemetry,noRefresh:!!e.noRefresh,refreshVectors:!!e.refreshVectors,verboseStaleItems:!!e.verboseStaleItems,verboseAuthorEvents:!!e.verboseAuthorEvents,brief:!!e.brief,summary:!!e.summary||o,skipVectors:!!e.skipVectors,skipIntegrity:!!e.skipIntegrity,skipDrift:!!e.skipDrift,full:!!e.full});l(i,n),o&&!i.ok&&(C({...i,exit_code:m.GENERIC_FAILURE,error_code:"health_findings",error_category:"validation",command_resolution:"health_findings",resolution_stage:"execute"}),process.exitCode=m.GENERIC_FAILURE),n.profile&&d(`profile:command=health took_ms=${Date.now()-a}`)}async function Ce(e,t){let n=c(t),a=Date.now(),o=await le({checkMetadata:!!e.checkMetadata,metadataProfile:s(e,"metadataProfile"),checkResolution:!!e.checkResolution,checkLifecycle:!!e.checkLifecycle,checkStaleBlockers:!!e.checkStaleBlockers,dependencyCycleSeverity:s(e,"dependencyCycleSeverity"),parentCycleSeverity:s(e,"parentCycleSeverity"),checkFiles:!!e.checkFiles,checkCommandReferences:!!e.checkCommandReferences,scanMode:s(e,"scanMode"),includePmInternals:!!e.includePmInternals,verboseFileLists:!!e.verboseFileLists,verboseDiagnostics:!!e.verboseDiagnostics,allAffectedIds:!!e.allAffectedIds,checkHistoryDrift:!!e.checkHistoryDrift,checkStorageIntegrity:!!e.checkStorageIntegrity,fixHints:!!e.fixHints,autoFix:!!e.autoFix,dryRun:!!e.dryRun,fixScope:Array.isArray(e.fixScope)?e.fixScope:void 0,pruneMissing:!!e.pruneMissing,counts:!!e.counts,full:!!e.full},n);l(o,n),(e.strictExit||e.failOnWarn)&&(o.has_warnings||!o.ok)&&(C({...o,exit_code:m.GENERIC_FAILURE,error_code:"validation_findings",error_category:"validation",command_resolution:"validation_findings",resolution_stage:"execute"}),process.exitCode=m.GENERIC_FAILURE),n.profile&&d(`profile:command=validate took_ms=${Date.now()-a}`)}async function Re(e,t){let n=c(t),a=Date.now(),o=await q(n,{dryRun:e.dryRun===!0,scope:Array.isArray(e.scope)?e.scope:[]});l(o,n),n.profile&&d(`profile:command=gc took_ms=${Date.now()-a}`)}async function Be(e,t,n,a){let o=c(a),i=_(process.cwd(),o.path),r=e.trim().toLowerCase();if(!["create","list","inspect","restore","delete"].includes(r))throw S({command_path:"workspace snapshot",token:e,allowed:["create","list","inspect","restore","delete"],display_name:"workspace snapshot",token_kind:"action",examples:["pm workspace snapshot create before-migration","pm workspace snapshot restore before-migration"]});if(r==="list"){l(await W(i),o);return}if(r==="create"){l(await G(i,t===void 0?{}:{name:t}),o);return}if(t===void 0)throw new b(`pm workspace snapshot ${r} requires a snapshot name or fingerprint`,m.USAGE);if(r==="inspect"){l(await j(i,t),o);return}if(r==="restore"){if(n.dryRun===!0){l(await Y(i,t),o);return}let u=await I(i);l(await K(i,t,{force:n.force===!0,author:O(s(n,"author"),u.author_default),message:s(n,"message"),lockTtlSeconds:u.locks.ttl_seconds,lockWaitMs:u.locks.wait_ms}),o);return}l(await X(i,t),o)}async function Ee(e,t){let n=c(t),a=Date.now(),o=await Q({action:s(e,"action"),command:s(e,"command"),summary:!!e.summary,schemaOnly:!!e.schemaOnly,flagsOnly:!!e.flagsOnly,availabilityOnly:!!e.availabilityOnly,runtimeOnly:!!e.runtimeOnly||!!e.activeOnly,full:!!e.full},n);l(o,n),n.profile&&d(`profile:command=contracts took_ms=${Date.now()-a}`)}async function Te(e,t,n){let a=c(n),o=Date.now(),i={...A(t),ifAvailable:t.ifAvailable===!0,maxAttempts:t.maxAttempts};Oe(e,t.next===!0);let r=t.next===!0?await $(!!t.force,a,i,{type:typeof t.type=="string"?t.type:void 0,tag:typeof t.tag=="string"?t.tag:void 0,priority:t.priority,assigneeFilter:typeof t.assigneeFilter=="string"?t.assigneeFilter:void 0,parent:typeof t.parent=="string"?t.parent:void 0,sprint:typeof t.sprint=="string"?t.sprint:void 0,release:typeof t.release=="string"?t.release:void 0,includeDecisions:t.includeDecisions===!0,tokenBudget:t.tokenBudget??t.token_budget,explainRanking:t.explainRanking===!0||t.explain_ranking===!0}):await B(e,!!t.force,a,i);await p(a,r),l(r,a),a.profile&&d(`profile:command=claim took_ms=${Date.now()-o}`)}function Oe(e,t){if(!t&&!e)throw new b("Specify an item id or pass --next",m.USAGE);if(t&&e)throw new b("Specify either an item id or --next, not both",m.USAGE)}async function Pe(e,t,n){let a=c(n),o=Date.now(),i=await D(e,!!t.force,a,{...A(t),ownershipReleaseBypass:t.ownershipReleaseBypass===!0});await p(a,i),l(await P("release",[e],t,a,i),a),a.profile&&d(`profile:command=release took_ms=${Date.now()-o}`)}async function Me(e,t,n){let a=c(n),o=Date.now(),i=_(process.cwd(),a.path),r=await I(i),u=R(r.schema),g=oe(u),f=!!t.force,h=A(t),v=await B(e,f,a,h);await p(a,v);let T=await x(e,{...h,status:g,force:f},a);await p(a,T),l({id:e,action:"start_task",claim:v,update:T},a),a.profile&&d(`profile:command=start-task took_ms=${Date.now()-o}`)}async function Fe(e,t,n){let a=c(n),o=Date.now(),i=_(process.cwd(),a.path),r=await I(i),u=R(r.schema),g=!!t.force,f=A(t),h=await x(e,{...f,status:u.open_status,force:g},a);await p(a,h);let v=await D(e,g,a,f);await p(a,v),l({id:e,action:"pause_task",update:h,release:v},a),a.profile&&d(`profile:command=pause-task took_ms=${Date.now()-o}`)}async function Le(e,t,n,a){let o=c(a),i=Date.now(),r=!!n.force,u=A(n),g=await U(e,t,{...u,validateClose:s(n,"validateClose"),force:r},o);await p(o,g);let f=await D(e,r,o,u);await p(o,f),l({id:e,action:"close_task",close:g,release:f},o),o.profile&&d(`profile:command=close-task took_ms=${Date.now()-i}`)}function de(e){return e.option("--background","Run linked tests in managed background mode").option("--timeout <seconds>","Default run timeout in seconds").option("--progress","Emit linked-test progress to stderr (always shown in TTY, opt-in for non-TTY)").option("--env-set <value>","Set environment variable(s) for linked-test runs (KEY=VALUE, repeatable)",w).option("--env-clear <value>","Clear environment variable(s) for linked-test runs (NAME, repeatable)",w).option("--shared-host-safe","Apply additive shared-host-safe runtime defaults for linked-test runs").option("--pm-context <mode>","PM linked-test context mode: schema|tracker|auto (default: schema)").option("--override-linked-pm-context","Force run-level --pm-context to override per-linked-test pm_context_mode metadata").option("--fail-on-context-mismatch","Fail linked PM commands when context item counts differ").option("--fail-on-skipped","Treat skipped linked tests as dependency failures").option("--fail-on-empty-test-run","Treat successful linked-test commands that report zero executed tests as failures").option("--require-assertions-for-pm","Require assertion metadata for linked PM command tests").option("--check-context","Preflight linked PM command context diagnostics before executing commands").option("--auto-pm-context","Auto-remediate PM tracker-read context mismatches by routing those linked commands through tracker context")}function Lt(e){ce(e);let t=e.command("test").argument("<id>","Item id").option("--add <value>","Add linked test entry (CSV/markdown pairs or - for stdin)",w).option("--add-json <value>","Add linked test entry from JSON object/array (or - for stdin)",w).option("--remove <value>","Remove linked test entry by exact command/path (command=<value> and path=<value> preserve commas and equals signs; or - for stdin)",w).option("--remove-index <n>","Remove the 1-based linked-test index from --list order (repeatable)",w).option("--list","List linked tests without mutating").option("--run","Run linked test commands").option("--match <value>","Run only linked tests whose command/path contains this substring").option("--only-index <n>","Run only the 1-based linked-test index from --list order").option("--only-last","Run only the most recently added linked test");de(t).option("--measure <value>","Record name=value[,unit=...][,threshold=...] evidence; repeatable",w).option("--metric-below <value>","Return evidence below name=value").option("--metric-diff <name>","Diff the latest two values").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").description("Manage tests linked to an item and optionally run them.").action(xe);let n=e.command("test-all").description("Run linked tests across matching items.").option("--status <value>","Filter items by status before running tests").option("--limit <n>","Limit matching items before running linked tests").option("--offset <n>","Skip matching items before running linked tests");de(n).action(Ae),e.command("test-runs-worker",{hidden:!0}).argument("<runId>","Background run id").description("Internal background worker command.").action(async(g,f,h)=>{let v=c(h);await ie(g,v)}),e.command("telemetry").argument("[namespaceOrSubcommand]","Telemetry subcommand: status, flush, stats, clear (default: status)").argument("[subcommand]","Compatibility alias target for local-analytics: status, flush, stats, clear").option("--limit <n>","Maximum command groups returned by telemetry stats").description("Inspect and manage local telemetry queue/runtime state.").action(_e),e.command("duplicates").description("Find existing duplicate clusters across all statuses without creating an item.").option("--status <value>","Lifecycle status to include (repeatable or comma-separated)",w,[]).option("--since <value>","Only inspect items created at or after this time").option("--threshold <value>","Minimum similarity score from 0 through 1").option("--limit <n>","Maximum duplicate clusters to return").action(De),e.command("stats").description("Show project tracker statistics.").option("--include-empty","Restore zero-count registered item-type and lifecycle-status buckets").option("--storage","Include aggregate history-stream storage metrics (total streams/lines/bytes, largest + deepest streams, oldest/newest entries)").option("--metadata-coverage","Include metadata coverage % (acceptance_criteria, estimated_minutes, resolution, tags, parent) overall and by type").option("--by-assignee","Include a lifecycle-bucketed item breakdown grouped by assignee").option("--by-tag","Include a lifecycle-bucketed item breakdown grouped by tag").option("--by-priority","Include a lifecycle-bucketed item breakdown grouped by priority").option("--tag-prefix <value>","With --by-tag: only count tags starting with this prefix (e.g. domain:)").option("--field-utilization","Report content-field utilization rates (notes/learnings/files/docs/tests/comments/deps/body) for governance analysis").option("--analytics <json>","Improvement ledger/history analytics JSON").action(Ie),e.command("health").description("Show project tracker health checks.").option("--strict-directories","Treat optional item-type directories as required failures").option("--require-merge-drivers","Treat absent clone-local merge drivers as a required health failure").option("--check-only","Run read-only health diagnostics without refreshing vectors").option("--check-telemetry","Probe telemetry endpoint health and include network diagnostics").option("--no-refresh","Disable automatic vector refresh attempts during health checks").option("--refresh-vectors","Explicitly enable vector refresh attempts during health checks").option("--verbose-stale-items","Include full stale vectorization ID lists in health output").option("--verbose-author-events","Include every actionable unknown-author event coordinate for review or disposition").option("--brief","Emit compact health details for low-token agent checks").option("--summary","Emit one-line-style health status with check names and warning count").option("--skip-vectors","Skip vectorization check for a faster run").option("--skip-integrity","Skip item/history file integrity check for a faster run").option("--skip-drift","Skip history drift hash check for a faster run").option("--full","Run all checks including slow integrity, drift, and vectorization checks").option("--strict-exit","Return non-zero exit when health is not ok and default to actionable summary output; use --full for complete details").option("--fail-on-warn","Alias for --strict-exit").action(Se),e.command("validate").description("Run standalone metadata, resolution, lifecycle, files, linked-command reference, and history drift validation checks.").option("--check-metadata","Run metadata completeness checks").option("--metadata-profile <value>","Select metadata validation profile for --check-metadata (core|strict|custom)").option("--check-resolution","Run closed-item resolution metadata checks").option("--check-lifecycle","Run active-item lifecycle governance drift checks").option("--check-stale-blockers","Include stale blocker-pattern diagnostics in lifecycle checks").option("--dependency-cycle-severity <value>","Set dependency-cycle warning policy for lifecycle checks (off|warn|error)").option("--parent-cycle-severity <value>","Set parent-hierarchy cycle warning policy for lifecycle checks (off|warn|error)").option("--check-files","Run linked-file and orphaned-file checks").option("--check-command-references","Run linked-command PM-ID reference checks").option("--scan-mode <value>","Select file candidate scan mode for --check-files (default|tracked-all|tracked-all-strict)").option("--include-pm-internals","Include PM storage internals in tracked-all candidate scans").option("--verbose-file-lists","Include full file-path lists for validate --check-files details").option("--verbose-diagnostics","Include full validate diagnostic ID lists instead of compact summaries").option("--all-affected-ids","Emit complete missing_* affected-ID lists with no truncation (implied by --json)").option("--strict-exit","Return non-zero exit when validation warnings are present").option("--fail-on-warn","Alias for --strict-exit").option("--fix-hints","Add a machine-executable fix_hints[] of pm commands to each failing check's details").option("--auto-fix","Apply the safe, deterministic subset of fix-hint remediations (field backfills) automatically").option("--dry-run","Preview planned --auto-fix/--prune-missing fixes without applying them").option("--fix-scope <scope>","Grant --auto-fix scopes (metadata, resolution, lifecycle; comma-separated or repeatable). Default: metadata, resolution; lifecycle must be named explicitly",w).option("--prune-missing","Remove stale linked-file/doc LINKS whose paths classified as deleted (never touches real files)").option("--check-history-drift","Run item/history hash drift checks").option("--check-storage-integrity","Run the post-merge storage-integrity check (unreadable items, history conflict markers, resurrected deletes, unparseable config/schema)").option("--counts","Keep validation counts and totals while omitting per-item diagnostic arrays").option("--full","Return the complete validation diagnostic projection").action(Ce),e.command("gc").option("--dry-run","Preview cleanup targets without deleting files; without this flag, pm gc deletes matched artifacts").option("--scope <value>","Limit cleanup to one or more scopes (comma-separated or repeatable): index, embeddings, runtime, locks, checkpoints, transactions",w).description("Delete optional cache artifacts by default (including expired lock debris) and show a summary.").action(Re),e.command("workspace").description("Manage portable workspace-level SDK primitives.").command("snapshot").argument("<action>","Snapshot action: create, list, inspect, restore, delete").argument("[target]","Optional name for create; name or fingerprint otherwise").description("Create, inspect, list, restore, or delete content-addressed tracker snapshots.").option("--dry-run","Preview restore file, item, stream, and history-entry impact without mutating state").option("--force","Explicitly confirm a whole-workspace snapshot restore").option("--author <value>","Actor recorded on the restore audit event").option("--message <value>","Human-readable restore rationale").action(Be),e.command("contracts").description("Show machine-readable command and schema contracts for agents.").option("--action <value>","Filter tool schema branches to a specific action").option("--command <value>","Scope contracts output to one CLI command (narrow-by-default)").option("--summary","Return one command+intent row per top-level command for cheap agent bootstrap").option("--schema-only","Return schema-focused output only").option("--flags-only","Return command flag contracts only").option("--availability-only","Return action availability surface only").option("--runtime-only","Include only actions invocable in the current runtime").option("--active-only","Alias for --runtime-only").option("--full","Include full schema and command-flag surfaces (large; default brief output omits heavy sections for unfiltered queries)").action(Ee);let a=e.command("claim").argument("[id]","Item id (omit with --next)").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force claim override").option("--if-available","Skip silently when the item is already claimed by another author (returns skipped=true)").option("--next","Atomically claim the next caller-available actionable item").option("--type <value>","Filter --next candidates by type").option("--tag <value>","Filter --next candidates by tag").option("--priority <value>","Filter --next candidates by priority").option("--assignee-filter <value>","Filter --next candidates: assigned|unassigned").option("--parent <id>","Scope --next candidates to a subtree").option("--sprint <value>","Filter --next candidates by sprint").option("--release <value>","Filter --next candidates by release").option("--max-attempts <n>","Bound the --next candidate walk (default 10; maximum 100)").option("--include-decisions","Allow --next to claim human-gated Decision items").option("--token-budget <n>","Bound the estimated tokens used to rank --next candidates").option("--explain-ranking","Include ranking provenance for --next selection").description("Claim an item for active work.").action(Te);k(a,"--assignee <value>","Alias for --author on lifecycle ownership commands"),k(a,"--token_budget <n>","Alias for --token-budget"),k(a,"--explain_ranking","Alias for --explain-ranking");let o=e.command("release").argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force release override").description("Release an item's active claim.").action(Pe);k(o,"--assignee <value>","Alias for --author on lifecycle ownership commands");let i=e.command("start-task").argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership or terminal override when required").description("Lifecycle alias: claim an item and move it to in_progress.").action(Me);k(i,"--assignee <value>","Alias for --author on lifecycle ownership commands");let r=e.command("pause-task").argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override when required").description("Lifecycle alias: move an item to open and release its claim.").action(Fe);k(r,"--assignee <value>","Alias for --author on lifecycle ownership commands");let u=e.command("close-task").argument("<id>","Item id").argument("[reason]","Close reason text").option("--author <value>","Mutation author").option("--message <value>","History message").option("--validate-close <value>","Close-time validation mode: off|warn|strict").option("--force","Force ownership or terminal override when required").description("Lifecycle alias: close an item and release assignment metadata.").action(Le);k(u,"--assignee <value>","Alias for --author on lifecycle ownership commands"),Ve(e)}function y(e){return typeof e=="string"?e:void 0}function ue(e){return{parent:y(e.parent),allowMissingParent:e.allowMissingParent===!0?!0:void 0,tags:y(e.tags),priority:y(e.priority),body:y(e.body),description:y(e.description),author:y(e.author),message:y(e.message)}}function Ve(e){for(let{name:t,describe:n}of[{name:"meet",describe:"Shortcut: create a Meeting with a start time and duration."},{name:"event",describe:"Shortcut: create an Event with a start time and duration."}])e.command(t).argument("<title>","Item title").option("--start <when>","Start time (ISO, 'now', or relative like +1h/+2d); defaults to now").option("--duration <span>","Duration from start (relative like 1h/2d); defaults to 1h when --end is omitted").option("--end <when>","End time (ISO or relative); overrides --duration").option("--location <value>","Location").option("--timezone <value>","IANA timezone (for example America/New_York)").option("--all-day","Mark as an all-day event").option("--parent <id>","Parent item id").option("--allow-missing-parent","Permit a parent id that does not exist yet").option("--tags <list>","Comma-separated tags").option("--priority <value>","Priority").option("--body <text>","Body/markdown content").option("--description <text>","Short description").option("--author <value>","Mutation author").option("--message <value>","History message").description(n).action(async(a,o,i)=>{let r=c(i),u=Date.now(),f=await(t==="meet"?H:J)(a,{...ue(o),start:y(o.start),duration:y(o.duration),end:y(o.end),location:y(o.location),timezone:y(o.timezone),allDay:o.allDay===!0?!0:void 0},r);await p(r,f),l(f,r),r.profile&&d(`profile:command=${t} took_ms=${Date.now()-u}`)});e.command("remind").argument("<title>","Item title").option("--at <when>","Reminder time (ISO, 'now', or relative like +2d); defaults to +1d").option("--text <value>","Reminder text; defaults to the title").option("--parent <id>","Parent item id").option("--allow-missing-parent","Permit a parent id that does not exist yet").option("--tags <list>","Comma-separated tags").option("--priority <value>","Priority").option("--body <text>","Body/markdown content").option("--description <text>","Short description").option("--author <value>","Mutation author").option("--message <value>","History message").description("Shortcut: create a Reminder from a single point in time.").action(async(t,n,a)=>{let o=c(a),i=Date.now(),r=await z(t,{...ue(n),at:y(n.at),text:y(n.text)},o);await p(o,r),l(r,o),o.profile&&d(`profile:command=remind took_ms=${Date.now()-i}`)})}export{Lt as registerOperationCommands,Oe as requireClaimTarget};
2
- //# sourceMappingURL=register-operations-SSENDH5B.js.map
1
+ import"./chunk-QWRRFYK3.js";import{Ed as ie,Ta as V,Vc as Q,cb as N,ec as x,gc as q,hc as H,ic as J,jc as z,md as Z,nd as ee,oc as G,pb as B,pc as j,pd as te,qb as $,qc as W,ra as L,rb as D,rc as Y,sc as K,uc as X,vd as ne,wd as ae,xd as oe,yb as U,yd as E}from"./chunk-L5Q2CLPE.js";import"./chunk-GNFAFIJI.js";import"./chunk-UYCLQVL2.js";import"./chunk-WYRZZ5ZE.js";import{$l as p,Ac as C,Al as P,C as m,E as b,El as c,Hl as w,Il as s,Jl as k,Ll as M,Ml as F,Pf as l,Qf as d,Va as _,Xd as O,ca as S,cd as R,vh as I}from"./chunk-DY4DMUMC.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]="13159f49-7756-58b8-ac32-7ddd571e7d09")}catch{}})();var re=new Map([["measurements","boolean"],["metric","string"],["measurementLimit","number"],["observe","string_array"],["direction","direction"],["measurementSource","string"],["measurementItem","string"],["measurementRevision","string"],["author","string"],["message","string"],["provenanceCoverage","boolean"],["fleetAttribution","boolean"],["since","string"],["eventLimit","number"],["minimumSample","number"]]),me=new Set(["higher","lower","target"]),fe=[...re.keys()].sort((e,t)=>e.localeCompare(t)).join(", ");function pe(e,t){return e==="boolean"?typeof t=="boolean":e==="string"?typeof t=="string":e==="number"?typeof t=="number":e==="string_array"?Array.isArray(t)&&t.every(n=>typeof n=="string"):e==="direction"&&me.has(t)}function se(e){if(e===void 0)return{};let t;try{t=JSON.parse(e)}catch(n){throw new b(`--analytics must be valid JSON: ${String(n)}`,m.USAGE)}if(t===null||typeof t!="object"||Array.isArray(t))throw new b("--analytics must be a JSON object.",m.USAGE);for(let[n,a]of Object.entries(t)){let o=re.get(n);if(!pe(o,a))throw new b(o===void 0?`Unknown --analytics field "${n}". Accepted fields: ${fe}.`:`--analytics field "${n}" must be ${o.replace("_"," ")}.`,m.USAGE)}return 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]="eee25545-a7e9-54be-abc0-dbccc9b41e74")}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]="b0095f00-00bd-5b28-933c-b63a1711a73d")}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]="99355d20-090b-503e-8079-b858291938e3")}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]="35276f20-abc5-54e2-8251-35971f1fcb4f")}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]="8fa4af33-ba9f-5a19-a359-c64143287b5d")}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]="52c4154e-2761-5230-942c-6ac5e83a830c")}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]="c3fceb32-e0b9-5690-8653-4c699f865c0f")}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]="1e42a508-5568-522f-843d-61febc0bad27")}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]="43769e60-ed80-521d-9375-c28ee5b0ac06")}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]="3f1deb3b-e341-533a-a349-eca48f347600")}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]="91a42861-f8cb-575b-8596-53870f6275c6")}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]="c85956ff-383f-5482-96a9-0ef38949859c")}catch{}})();var le=(e,t)=>V(e,t,{runUpdate:(n,a,o)=>x(n,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]="41d01430-1e95-5f09-9a2f-7e7f8fad8184")}catch{}})();async function ye(e,t,n,a,o){let i=c(o),r=e==="run",u=e==="verdicts",g=e==="presets"||e==="apply",f=e==="promote",h=await N({action:e,...r||u||g||f?{}:{kind:t},id:r||u||f?n??t:n,preset:g?n??t:void 0,definition:s(a,"definition"),trigger:s(a,"trigger"),tree:s(a,"tree"),gate:s(a,"gate"),limit:s(a,"limit"),dry_run:a.dryRun===!0,fullChangedFields:i.fullChangedFields,idOnly:i.idOnly,author:s(a,"author"),message:s(a,"message"),owner:s(a,"owner"),apply:a.apply===!0,enforcement:s(a,"enforcement")},i);l(h,i),typeof h=="object"&&h!==null&&"exit_code"in h&&h.exit_code===1&&(process.exitCode=1)}function ce(e){e.command("assurance").argument("<action>","Action; inspect `pm contracts --command assurance`").argument("[kind]","Declaration kind or run gate id").argument("[id]","Declaration/gate id").description("Manage SDK-owned assurance contracts.").option("--definition <json>","Put declaration JSON").option("--trigger <value>","Gate trigger").option("--tree <value>","Revision identity").option("--gate <id>","Verdict gate filter").option("--limit <number>","Verdict limit").option("--dry-run","Evaluate without recording").option("--author <value>","Mutation author").option("--message <value>","Mutation rationale").option("--owner <item-id>","Preset/derivation owner").option("--apply","Persist derived proposals").option("--enforcement <level>","Promote to warn or block").action(ye)}(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]="dec5fb7d-416f-5da6-bd97-c05c25dbf769")}catch{}})();function ge(e,t){let n=e?.trim().toLowerCase(),a=t?.trim().toLowerCase();if(n===void 0||n.length===0)return a;if(n==="local-analytics")return a&&a.length>0?a:"status";if(a!==void 0&&a.length>0)throw S({command_path:"telemetry",token:`${e} ${t}`,allowed:["status","flush","stats","clear","local-analytics"],token_kind:"path",examples:["pm telemetry stats --limit 10","pm telemetry local-analytics status --json"]});return n}function he(e){return{addValues:Array.isArray(e.add)?e.add:[],addJsonValues:Array.isArray(e.addJson)?e.addJson:[],removeValues:Array.isArray(e.remove)?e.remove:[],removeIndexValues:Array.isArray(e.removeIndex)?e.removeIndex:[]}}function be(e,t){if(e.background===!0){if(e.run!==!0)throw new b("--background requires --run",m.USAGE);if(t.addValues.length>0||t.addJsonValues.length>0||t.removeValues.length>0||t.removeIndexValues.length>0)throw new b("--background does not support --add/--add-json/--remove/--remove-index; update linked tests first, then run in background",m.USAGE)}}async function we(e,t,n,a){let o=await E({kind:"test",commandArgs:M(e,{...t,add:a.addValues,addJson:a.addJsonValues,remove:a.removeValues,removeIndex:a.removeIndexValues}),targetId:e,author:typeof t.author=="string"?t.author:void 0,noExtensions:n.noExtensions===!0},n);l(o,n)}function ke(e,t){return{add:t.addValues,addJson:t.addJsonValues,remove:t.removeValues,removeIndex:t.removeIndexValues,list:!!e.list,run:!!e.run,match:typeof e.match=="string"?e.match:void 0,onlyIndex:typeof e.onlyIndex=="string"||typeof e.onlyIndex=="number"?e.onlyIndex:void 0,onlyLast:!!e.onlyLast,timeout:typeof e.timeout=="string"?e.timeout:void 0,progress:!!e.progress,envSet:Array.isArray(e.envSet)?e.envSet:[],envClear:Array.isArray(e.envClear)?e.envClear:[],sharedHostSafe:!!e.sharedHostSafe,pmContext:typeof e.pmContext=="string"?e.pmContext:void 0,overrideLinkedPmContext:!!e.overrideLinkedPmContext,failOnContextMismatch:!!e.failOnContextMismatch,failOnSkipped:!!e.failOnSkipped,failOnEmptyTestRun:!!e.failOnEmptyTestRun,requireAssertionsForPm:!!e.requireAssertionsForPm,checkContext:!!e.checkContext,autoPmContext:!!e.autoPmContext,author:typeof e.author=="string"?e.author:void 0,message:typeof e.message=="string"?e.message:void 0,force:!!e.force,measure:Array.isArray(e.measure)?e.measure:[],metricBelow:typeof e.metricBelow=="string"?e.metricBelow:void 0,metricDiff:typeof e.metricDiff=="string"?e.metricDiff:void 0}}async function ve(e,t,n,a){let o=await ne(e,ke(t,a),n);(a.addValues.length>0||a.addJsonValues.length>0||a.removeValues.length>0||t.run===!0||a.removeIndexValues.length>0)&&await p(n,o),l(o,n),(o.run_results.some(i=>i.status==="failed")||o.fail_on_skipped_triggered===!0)&&(process.exitCode=m.DEPENDENCY_FAILED)}async function xe(e,t,n){let a=c(n),o=Date.now(),i=he(t);be(t,i),t.background===!0?await we(e,t,a,i):await ve(e,t,a,i),a.profile&&d(`profile:command=test took_ms=${Date.now()-o}`)}function A(e){let t=s(e,"author"),n=s(e,"assignee");if(t!==void 0&&n!==void 0&&t!==n)throw new b("Lifecycle ownership received conflicting --author and --assignee values; use one actor value for both aliases.",m.USAGE,{code:"conflicting_lifecycle_owner",examples:["pm claim pm-123","pm start-task pm-123","pm release pm-123"]});return{author:t??n,message:s(e,"message")}}async function Ae(e,t){let n=c(t),a=Date.now();if(e.background===!0){let r=await E({kind:"test-all",commandArgs:F(e),statusFilter:s(e,"status"),noExtensions:n.noExtensions===!0},n);l(r,n),n.profile&&d(`profile:command=test-all took_ms=${Date.now()-a}`);return}let i=await ae({status:s(e,"status"),limit:s(e,"limit"),offset:s(e,"offset"),timeout:s(e,"timeout"),progress:!!e.progress,envSet:Array.isArray(e.envSet)?e.envSet:[],envClear:Array.isArray(e.envClear)?e.envClear:[],sharedHostSafe:!!e.sharedHostSafe,pmContext:s(e,"pmContext"),overrideLinkedPmContext:!!e.overrideLinkedPmContext,failOnContextMismatch:!!e.failOnContextMismatch,failOnSkipped:!!e.failOnSkipped,failOnEmptyTestRun:!!e.failOnEmptyTestRun,requireAssertionsForPm:!!e.requireAssertionsForPm,checkContext:!!e.checkContext,autoPmContext:!!e.autoPmContext},n);await p(n,{ids:i.results.map(r=>r.id)}),l(i,n),(i.failed>0||i.fail_on_skipped_triggered===!0)&&(process.exitCode=m.DEPENDENCY_FAILED),n.profile&&d(`profile:command=test-all took_ms=${Date.now()-a}`)}async function _e(e,t,n,a){let o=c(a),i=Date.now(),r=await te({subcommand:ge(e,t),limit:s(n,"limit")},o);l(r,o),o.profile&&d(`profile:command=telemetry took_ms=${Date.now()-i}`)}async function Ie(e,t){let n=c(t),a=Date.now(),o=se(s(e,"analytics")),i=await Z(n,{includeEmpty:e.includeEmpty===!0,storage:e.storage===!0,metadataCoverage:e.metadataCoverage===!0,byAssignee:e.byAssignee===!0,byTag:e.byTag===!0,byPriority:e.byPriority===!0,tagPrefix:s(e,"tagPrefix"),fieldUtilization:e.fieldUtilization===!0,...o});i.recorded_observations?.some(r=>r.changed)===!0&&await p(n,{ids:i.recorded_observations?.flatMap(r=>r.observation.item_id?[r.observation.item_id]:[])}),l(i,n),n.profile&&d(`profile:command=stats took_ms=${Date.now()-a}`)}async function De(e,t){let n=c(t),a=Date.now(),o=s(e,"threshold"),i=s(e,"limit"),r=await ee(n,{status:Array.isArray(e.status)&&e.status.length>0?e.status:void 0,since:s(e,"since"),...o===void 0?{}:{threshold:Number(o)},...i===void 0?{}:{limit:Number(i)}});l(r,n),n.profile&&d(`profile:command=duplicates took_ms=${Date.now()-a}`)}async function Se(e,t){let n=c(t),a=Date.now(),o=!!e.strictExit||!!e.failOnWarn,i=await L(n,{strictDirectories:!!e.strictDirectories,requireMergeDrivers:!!e.requireMergeDrivers,checkOnly:!!e.checkOnly,checkTelemetry:!!e.checkTelemetry,noRefresh:!!e.noRefresh,refreshVectors:!!e.refreshVectors,verboseStaleItems:!!e.verboseStaleItems,verboseAuthorEvents:!!e.verboseAuthorEvents,brief:!!e.brief,summary:!!e.summary||o,skipVectors:!!e.skipVectors,skipIntegrity:!!e.skipIntegrity,skipDrift:!!e.skipDrift,full:!!e.full});l(i,n),o&&!i.ok&&(C({...i,exit_code:m.GENERIC_FAILURE,error_code:"health_findings",error_category:"validation",command_resolution:"health_findings",resolution_stage:"execute"}),process.exitCode=m.GENERIC_FAILURE),n.profile&&d(`profile:command=health took_ms=${Date.now()-a}`)}async function Ce(e,t){let n=c(t),a=Date.now(),o=await le({checkMetadata:!!e.checkMetadata,metadataProfile:s(e,"metadataProfile"),checkResolution:!!e.checkResolution,checkLifecycle:!!e.checkLifecycle,checkStaleBlockers:!!e.checkStaleBlockers,dependencyCycleSeverity:s(e,"dependencyCycleSeverity"),parentCycleSeverity:s(e,"parentCycleSeverity"),checkFiles:!!e.checkFiles,checkCommandReferences:!!e.checkCommandReferences,scanMode:s(e,"scanMode"),includePmInternals:!!e.includePmInternals,verboseFileLists:!!e.verboseFileLists,verboseDiagnostics:!!e.verboseDiagnostics,allAffectedIds:!!e.allAffectedIds,checkHistoryDrift:!!e.checkHistoryDrift,checkStorageIntegrity:!!e.checkStorageIntegrity,fixHints:!!e.fixHints,autoFix:!!e.autoFix,dryRun:!!e.dryRun,fixScope:Array.isArray(e.fixScope)?e.fixScope:void 0,pruneMissing:!!e.pruneMissing,counts:!!e.counts,full:!!e.full},n);l(o,n),(e.strictExit||e.failOnWarn)&&(o.has_warnings||!o.ok)&&(C({...o,exit_code:m.GENERIC_FAILURE,error_code:"validation_findings",error_category:"validation",command_resolution:"validation_findings",resolution_stage:"execute"}),process.exitCode=m.GENERIC_FAILURE),n.profile&&d(`profile:command=validate took_ms=${Date.now()-a}`)}async function Re(e,t){let n=c(t),a=Date.now(),o=await q(n,{dryRun:e.dryRun===!0,scope:Array.isArray(e.scope)?e.scope:[]});l(o,n),n.profile&&d(`profile:command=gc took_ms=${Date.now()-a}`)}async function Be(e,t,n,a){let o=c(a),i=_(process.cwd(),o.path),r=e.trim().toLowerCase();if(!["create","list","inspect","restore","delete"].includes(r))throw S({command_path:"workspace snapshot",token:e,allowed:["create","list","inspect","restore","delete"],display_name:"workspace snapshot",token_kind:"action",examples:["pm workspace snapshot create before-migration","pm workspace snapshot restore before-migration"]});if(r==="list"){l(await W(i),o);return}if(r==="create"){l(await G(i,t===void 0?{}:{name:t}),o);return}if(t===void 0)throw new b(`pm workspace snapshot ${r} requires a snapshot name or fingerprint`,m.USAGE);if(r==="inspect"){l(await j(i,t),o);return}if(r==="restore"){if(n.dryRun===!0){l(await Y(i,t),o);return}let u=await I(i);l(await K(i,t,{force:n.force===!0,author:O(s(n,"author"),u.author_default),message:s(n,"message"),lockTtlSeconds:u.locks.ttl_seconds,lockWaitMs:u.locks.wait_ms}),o);return}l(await X(i,t),o)}async function Ee(e,t){let n=c(t),a=Date.now(),o=await Q({action:s(e,"action"),command:s(e,"command"),summary:!!e.summary,schemaOnly:!!e.schemaOnly,flagsOnly:!!e.flagsOnly,availabilityOnly:!!e.availabilityOnly,runtimeOnly:!!e.runtimeOnly||!!e.activeOnly,full:!!e.full},n);l(o,n),n.profile&&d(`profile:command=contracts took_ms=${Date.now()-a}`)}async function Te(e,t,n){let a=c(n),o=Date.now(),i={...A(t),ifAvailable:t.ifAvailable===!0,maxAttempts:t.maxAttempts};Oe(e,t.next===!0);let r=t.next===!0?await $(!!t.force,a,i,{type:typeof t.type=="string"?t.type:void 0,tag:typeof t.tag=="string"?t.tag:void 0,priority:t.priority,assigneeFilter:typeof t.assigneeFilter=="string"?t.assigneeFilter:void 0,parent:typeof t.parent=="string"?t.parent:void 0,sprint:typeof t.sprint=="string"?t.sprint:void 0,release:typeof t.release=="string"?t.release:void 0,includeDecisions:t.includeDecisions===!0,tokenBudget:t.tokenBudget??t.token_budget,explainRanking:t.explainRanking===!0||t.explain_ranking===!0}):await B(e,!!t.force,a,i);await p(a,r),l(r,a),a.profile&&d(`profile:command=claim took_ms=${Date.now()-o}`)}function Oe(e,t){if(!t&&!e)throw new b("Specify an item id or pass --next",m.USAGE);if(t&&e)throw new b("Specify either an item id or --next, not both",m.USAGE)}async function Pe(e,t,n){let a=c(n),o=Date.now(),i=await D(e,!!t.force,a,{...A(t),ownershipReleaseBypass:t.ownershipReleaseBypass===!0});await p(a,i),l(await P("release",[e],t,a,i),a),a.profile&&d(`profile:command=release took_ms=${Date.now()-o}`)}async function Me(e,t,n){let a=c(n),o=Date.now(),i=_(process.cwd(),a.path),r=await I(i),u=R(r.schema),g=oe(u),f=!!t.force,h=A(t),v=await B(e,f,a,h);await p(a,v);let T=await x(e,{...h,status:g,force:f},a);await p(a,T),l({id:e,action:"start_task",claim:v,update:T},a),a.profile&&d(`profile:command=start-task took_ms=${Date.now()-o}`)}async function Fe(e,t,n){let a=c(n),o=Date.now(),i=_(process.cwd(),a.path),r=await I(i),u=R(r.schema),g=!!t.force,f=A(t),h=await x(e,{...f,status:u.open_status,force:g},a);await p(a,h);let v=await D(e,g,a,f);await p(a,v),l({id:e,action:"pause_task",update:h,release:v},a),a.profile&&d(`profile:command=pause-task took_ms=${Date.now()-o}`)}async function Le(e,t,n,a){let o=c(a),i=Date.now(),r=!!n.force,u=A(n),g=await U(e,t,{...u,validateClose:s(n,"validateClose"),force:r},o);await p(o,g);let f=await D(e,r,o,u);await p(o,f),l({id:e,action:"close_task",close:g,release:f},o),o.profile&&d(`profile:command=close-task took_ms=${Date.now()-i}`)}function de(e){return e.option("--background","Run linked tests in managed background mode").option("--timeout <seconds>","Default run timeout in seconds").option("--progress","Emit linked-test progress to stderr (always shown in TTY, opt-in for non-TTY)").option("--env-set <value>","Set environment variable(s) for linked-test runs (KEY=VALUE, repeatable)",w).option("--env-clear <value>","Clear environment variable(s) for linked-test runs (NAME, repeatable)",w).option("--shared-host-safe","Apply additive shared-host-safe runtime defaults for linked-test runs").option("--pm-context <mode>","PM linked-test context mode: schema|tracker|auto (default: schema)").option("--override-linked-pm-context","Force run-level --pm-context to override per-linked-test pm_context_mode metadata").option("--fail-on-context-mismatch","Fail linked PM commands when context item counts differ").option("--fail-on-skipped","Treat skipped linked tests as dependency failures").option("--fail-on-empty-test-run","Treat successful linked-test commands that report zero executed tests as failures").option("--require-assertions-for-pm","Require assertion metadata for linked PM command tests").option("--check-context","Preflight linked PM command context diagnostics before executing commands").option("--auto-pm-context","Auto-remediate PM tracker-read context mismatches by routing those linked commands through tracker context")}function Lt(e){ce(e);let t=e.command("test").argument("<id>","Item id").option("--add <value>","Add linked test entry (CSV/markdown pairs or - for stdin)",w).option("--add-json <value>","Add linked test entry from JSON object/array (or - for stdin)",w).option("--remove <value>","Remove linked test entry by exact command/path (command=<value> and path=<value> preserve commas and equals signs; or - for stdin)",w).option("--remove-index <n>","Remove the 1-based linked-test index from --list order (repeatable)",w).option("--list","List linked tests without mutating").option("--run","Run linked test commands").option("--match <value>","Run only linked tests whose command/path contains this substring").option("--only-index <n>","Run only the 1-based linked-test index from --list order").option("--only-last","Run only the most recently added linked test");de(t).option("--measure <value>","Record name=value[,unit=...][,threshold=...] evidence; repeatable",w).option("--metric-below <value>","Return evidence below name=value").option("--metric-diff <name>","Diff the latest two values").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").description("Manage tests linked to an item and optionally run them.").action(xe);let n=e.command("test-all").description("Run linked tests across matching items.").option("--status <value>","Filter items by status before running tests").option("--limit <n>","Limit matching items before running linked tests").option("--offset <n>","Skip matching items before running linked tests");de(n).action(Ae),e.command("test-runs-worker",{hidden:!0}).argument("<runId>","Background run id").description("Internal background worker command.").action(async(g,f,h)=>{let v=c(h);await ie(g,v)}),e.command("telemetry").argument("[namespaceOrSubcommand]","Telemetry subcommand: status, flush, stats, clear (default: status)").argument("[subcommand]","Compatibility alias target for local-analytics: status, flush, stats, clear").option("--limit <n>","Maximum command groups returned by telemetry stats").description("Inspect and manage local telemetry queue/runtime state.").action(_e),e.command("duplicates").description("Find existing duplicate clusters across all statuses without creating an item.").option("--status <value>","Lifecycle status to include (repeatable or comma-separated)",w,[]).option("--since <value>","Only inspect items created at or after this time").option("--threshold <value>","Minimum similarity score from 0 through 1").option("--limit <n>","Maximum duplicate clusters to return").action(De),e.command("stats").description("Show project tracker statistics.").option("--include-empty","Restore zero-count registered item-type and lifecycle-status buckets").option("--storage","Include aggregate history-stream storage metrics (total streams/lines/bytes, largest + deepest streams, oldest/newest entries)").option("--metadata-coverage","Include metadata coverage % (acceptance_criteria, estimated_minutes, resolution, tags, parent) overall and by type").option("--by-assignee","Include a lifecycle-bucketed item breakdown grouped by assignee").option("--by-tag","Include a lifecycle-bucketed item breakdown grouped by tag").option("--by-priority","Include a lifecycle-bucketed item breakdown grouped by priority").option("--tag-prefix <value>","With --by-tag: only count tags starting with this prefix (e.g. domain:)").option("--field-utilization","Report content-field utilization rates (notes/learnings/files/docs/tests/comments/deps/body) for governance analysis").option("--analytics <json>","Improvement ledger/history analytics JSON").action(Ie),e.command("health").description("Show project tracker health checks.").option("--strict-directories","Treat optional item-type directories as required failures").option("--require-merge-drivers","Treat absent clone-local merge drivers as a required health failure").option("--check-only","Run read-only health diagnostics without refreshing vectors").option("--check-telemetry","Probe telemetry endpoint health and include network diagnostics").option("--no-refresh","Disable automatic vector refresh attempts during health checks").option("--refresh-vectors","Explicitly enable vector refresh attempts during health checks").option("--verbose-stale-items","Include full stale vectorization ID lists in health output").option("--verbose-author-events","Include every actionable unknown-author event coordinate for review or disposition").option("--brief","Emit compact health details for low-token agent checks").option("--summary","Emit one-line-style health status with check names and warning count").option("--skip-vectors","Skip vectorization check for a faster run").option("--skip-integrity","Skip item/history file integrity check for a faster run").option("--skip-drift","Skip history drift hash check for a faster run").option("--full","Run all checks including slow integrity, drift, and vectorization checks").option("--strict-exit","Return non-zero exit when health is not ok and default to actionable summary output; use --full for complete details").option("--fail-on-warn","Alias for --strict-exit").action(Se),e.command("validate").description("Run standalone metadata, resolution, lifecycle, files, linked-command reference, and history drift validation checks.").option("--check-metadata","Run metadata completeness checks").option("--metadata-profile <value>","Select metadata validation profile for --check-metadata (core|strict|custom)").option("--check-resolution","Run closed-item resolution metadata checks").option("--check-lifecycle","Run active-item lifecycle governance drift checks").option("--check-stale-blockers","Include stale blocker-pattern diagnostics in lifecycle checks").option("--dependency-cycle-severity <value>","Set dependency-cycle warning policy for lifecycle checks (off|warn|error)").option("--parent-cycle-severity <value>","Set parent-hierarchy cycle warning policy for lifecycle checks (off|warn|error)").option("--check-files","Run linked-file and orphaned-file checks").option("--check-command-references","Run linked-command PM-ID reference checks").option("--scan-mode <value>","Select file candidate scan mode for --check-files (default|tracked-all|tracked-all-strict)").option("--include-pm-internals","Include PM storage internals in tracked-all candidate scans").option("--verbose-file-lists","Include full file-path lists for validate --check-files details").option("--verbose-diagnostics","Include full validate diagnostic ID lists instead of compact summaries").option("--all-affected-ids","Emit complete missing_* affected-ID lists with no truncation (implied by --json)").option("--strict-exit","Return non-zero exit when validation warnings are present").option("--fail-on-warn","Alias for --strict-exit").option("--fix-hints","Add a machine-executable fix_hints[] of pm commands to each failing check's details").option("--auto-fix","Apply the safe, deterministic subset of fix-hint remediations (field backfills) automatically").option("--dry-run","Preview planned --auto-fix/--prune-missing fixes without applying them").option("--fix-scope <scope>","Grant --auto-fix scopes (metadata, resolution, lifecycle; comma-separated or repeatable). Default: metadata, resolution; lifecycle must be named explicitly",w).option("--prune-missing","Remove stale linked-file/doc LINKS whose paths classified as deleted (never touches real files)").option("--check-history-drift","Run item/history hash drift checks").option("--check-storage-integrity","Run the post-merge storage-integrity check (unreadable items, history conflict markers, resurrected deletes, unparseable config/schema)").option("--counts","Keep validation counts and totals while omitting per-item diagnostic arrays").option("--full","Return the complete validation diagnostic projection").action(Ce),e.command("gc").option("--dry-run","Preview cleanup targets without deleting files; without this flag, pm gc deletes matched artifacts").option("--scope <value>","Limit cleanup to one or more scopes (comma-separated or repeatable): index, embeddings, runtime, locks, checkpoints, transactions",w).description("Delete optional cache artifacts by default (including expired lock debris) and show a summary.").action(Re),e.command("workspace").description("Manage portable workspace-level SDK primitives.").command("snapshot").argument("<action>","Snapshot action: create, list, inspect, restore, delete").argument("[target]","Optional name for create; name or fingerprint otherwise").description("Create, inspect, list, restore, or delete content-addressed tracker snapshots.").option("--dry-run","Preview restore file, item, stream, and history-entry impact without mutating state").option("--force","Explicitly confirm a whole-workspace snapshot restore").option("--author <value>","Actor recorded on the restore audit event").option("--message <value>","Human-readable restore rationale").action(Be),e.command("contracts").description("Show machine-readable command and schema contracts for agents.").option("--action <value>","Filter tool schema branches to a specific action").option("--command <value>","Scope contracts output to one CLI command (narrow-by-default)").option("--summary","Return one command+intent row per top-level command for cheap agent bootstrap").option("--schema-only","Return schema-focused output only").option("--flags-only","Return command flag contracts only").option("--availability-only","Return action availability surface only").option("--runtime-only","Include only actions invocable in the current runtime").option("--active-only","Alias for --runtime-only").option("--full","Include full schema and command-flag surfaces (large; default brief output omits heavy sections for unfiltered queries)").action(Ee);let a=e.command("claim").argument("[id]","Item id (omit with --next)").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force claim override").option("--if-available","Skip silently when the item is already claimed by another author (returns skipped=true)").option("--next","Atomically claim the next caller-available actionable item").option("--type <value>","Filter --next candidates by type").option("--tag <value>","Filter --next candidates by tag").option("--priority <value>","Filter --next candidates by priority").option("--assignee-filter <value>","Filter --next candidates: assigned|unassigned").option("--parent <id>","Scope --next candidates to a subtree").option("--sprint <value>","Filter --next candidates by sprint").option("--release <value>","Filter --next candidates by release").option("--max-attempts <n>","Bound the --next candidate walk (default 10; maximum 100)").option("--include-decisions","Allow --next to claim human-gated Decision items").option("--token-budget <n>","Bound the estimated tokens used to rank --next candidates").option("--explain-ranking","Include ranking provenance for --next selection").description("Claim an item for active work.").action(Te);k(a,"--assignee <value>","Alias for --author on lifecycle ownership commands"),k(a,"--token_budget <n>","Alias for --token-budget"),k(a,"--explain_ranking","Alias for --explain-ranking");let o=e.command("release").argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force release override").description("Release an item's active claim.").action(Pe);k(o,"--assignee <value>","Alias for --author on lifecycle ownership commands");let i=e.command("start-task").argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership or terminal override when required").description("Lifecycle alias: claim an item and move it to in_progress.").action(Me);k(i,"--assignee <value>","Alias for --author on lifecycle ownership commands");let r=e.command("pause-task").argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override when required").description("Lifecycle alias: move an item to open and release its claim.").action(Fe);k(r,"--assignee <value>","Alias for --author on lifecycle ownership commands");let u=e.command("close-task").argument("<id>","Item id").argument("[reason]","Close reason text").option("--author <value>","Mutation author").option("--message <value>","History message").option("--validate-close <value>","Close-time validation mode: off|warn|strict").option("--force","Force ownership or terminal override when required").description("Lifecycle alias: close an item and release assignment metadata.").action(Le);k(u,"--assignee <value>","Alias for --author on lifecycle ownership commands"),Ve(e)}function y(e){return typeof e=="string"?e:void 0}function ue(e){return{parent:y(e.parent),allowMissingParent:e.allowMissingParent===!0?!0:void 0,tags:y(e.tags),priority:y(e.priority),body:y(e.body),description:y(e.description),author:y(e.author),message:y(e.message)}}function Ve(e){for(let{name:t,describe:n}of[{name:"meet",describe:"Shortcut: create a Meeting with a start time and duration."},{name:"event",describe:"Shortcut: create an Event with a start time and duration."}])e.command(t).argument("<title>","Item title").option("--start <when>","Start time (ISO, 'now', or relative like +1h/+2d); defaults to now").option("--duration <span>","Duration from start (relative like 1h/2d); defaults to 1h when --end is omitted").option("--end <when>","End time (ISO or relative); overrides --duration").option("--location <value>","Location").option("--timezone <value>","IANA timezone (for example America/New_York)").option("--all-day","Mark as an all-day event").option("--parent <id>","Parent item id").option("--allow-missing-parent","Permit a parent id that does not exist yet").option("--tags <list>","Comma-separated tags").option("--priority <value>","Priority").option("--body <text>","Body/markdown content").option("--description <text>","Short description").option("--author <value>","Mutation author").option("--message <value>","History message").description(n).action(async(a,o,i)=>{let r=c(i),u=Date.now(),f=await(t==="meet"?H:J)(a,{...ue(o),start:y(o.start),duration:y(o.duration),end:y(o.end),location:y(o.location),timezone:y(o.timezone),allDay:o.allDay===!0?!0:void 0},r);await p(r,f),l(f,r),r.profile&&d(`profile:command=${t} took_ms=${Date.now()-u}`)});e.command("remind").argument("<title>","Item title").option("--at <when>","Reminder time (ISO, 'now', or relative like +2d); defaults to +1d").option("--text <value>","Reminder text; defaults to the title").option("--parent <id>","Parent item id").option("--allow-missing-parent","Permit a parent id that does not exist yet").option("--tags <list>","Comma-separated tags").option("--priority <value>","Priority").option("--body <text>","Body/markdown content").option("--description <text>","Short description").option("--author <value>","Mutation author").option("--message <value>","History message").description("Shortcut: create a Reminder from a single point in time.").action(async(t,n,a)=>{let o=c(a),i=Date.now(),r=await z(t,{...ue(n),at:y(n.at),text:y(n.text)},o);await p(o,r),l(r,o),o.profile&&d(`profile:command=remind took_ms=${Date.now()-i}`)})}export{Lt as registerOperationCommands,Oe as requireClaimTarget};
2
+ //# sourceMappingURL=register-operations-4HTFC6J7.js.map
@@ -1,2 +1,2 @@
1
- import{a as R,f as O}from"./chunk-2QLOXC3V.js";import{Aa as U,Ka as C,Oa as j,Qa as T,xa as I}from"./chunk-JOKATURE.js";import"./chunk-WYRZZ5ZE.js";import{Bl as E,C as d,E as b,Gf as S,If as _,Jf as y,yl as v}from"./chunk-ION3E43Q.js";import A from"node:fs/promises";import L 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]="054789eb-fabe-5042-8166-19961f30ebf1")}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]="3e4ba524-10cf-58e7-81ea-f48f30ca1250")}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]="defd826a-ac9b-54e4-b2a3-00d022090a10")}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]="4344c493-be53-584f-b25d-4b41bfee5079")}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]="08f5b31f-c756-577c-94e8-7b4268ba12ab")}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]="59c52ff5-9763-5244-bed3-146a547c3551")}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]="d498a64c-9680-52a9-981d-4ce86949784d")}catch{}})();var z={init:"init",install:"install",uninstall:"uninstall",explore:"explore",manage:"manage",describe:"describe",reload:"reload",doctor:"doctor",catalog:"catalog",adopt:"adopt","adopt-all":"adoptAll",activate:"activate",deactivate:"deactivate",migrate:"migrate"};function H(e){let t=e.capability,o=typeof t=="string"?[t]:Array.isArray(t)?t.filter(i=>typeof i=="string"):[],a=[...new Set(o.map(i=>i.trim().toLowerCase()).filter(i=>i.length>0))];if(a.length>1)throw new b(`Multiple scaffold capabilities cannot be combined yet: ${a.join(", ")}. Choose one capability per scaffold.`,d.USAGE);return a[0]}function G(e,t,o="extension"){let a={...e};t!==void 0&&(a[z[t]]=!0);let i=(...c)=>c.some(r=>a[r]===!0),n=(...c)=>{for(let r of c)if(typeof a[r]=="string")return a[r]};return{init:i("init"),scaffold:i("scaffold"),install:i("install"),uninstall:i("uninstall"),explore:i("explore","list"),manage:i("manage"),describe:i("describe"),markdown:i("markdown"),reload:i("reload"),doctor:i("doctor"),catalog:i("catalog"),adopt:i("adopt"),adoptAll:i("adoptAll","adopt_all","adopt-all"),activate:i("activate"),deactivate:i("deactivate"),migrate:i("migrate"),project:i("project"),local:i("local"),global:i("global"),gh:n("gh"),github:n("github"),ref:n("ref"),capability:H(e),declarative:i("declarative"),fields:n("fields"),detail:n("detail"),output:n("output"),trace:i("trace"),watch:i("watch"),runtimeProbe:i("runtimeProbe","runtime_probe","runtime-probe"),fixManagedState:i("fixManagedState","fix_managed_state","fix-managed-state"),isolated:i("isolated"),ignoreGlobal:i("ignoreGlobal","ignore_global","ignore-global"),strictExit:i("strictExit","strict_exit","strict-exit"),failOnWarn:i("failOnWarn","fail_on_warn","fail-on-warn"),dryRun:i("dryRun","dry_run","dry-run"),vocabulary:o}}async function N(e){let t=(await A.readdir(process.cwd())).filter(a=>!a.startsWith(".")).sort((a,i)=>a.localeCompare(i)),o=[...e].sort((a,i)=>a.localeCompare(i));return t.length===o.length&&t.every((a,i)=>a===o[i])}async function q(e){let t=(e??[]).map(o=>o.trim()).filter(o=>o.length>0);return t.length<=1?t.length===0?void 0:t:await N(t)?["*"]:t}function P(e,t,o){let a=e.markdown===!0;if(o!==void 0&&o==="")throw new b("--output requires a non-empty file path.",d.USAGE);if(o!==void 0&&!a)throw new b("--output is only supported with --markdown describe output.",d.USAGE);if(a){if(t.json)throw new b("Cannot combine --json with --markdown.",d.USAGE);if(e.describe!==!0)throw new b("--markdown is only supported by the describe action.",d.USAGE)}}async function B(e){let t=U(e.result.details,e.vocabulary);if(e.outputPath!==void 0){let o=L.resolve(e.outputPath);await A.mkdir(L.dirname(o),{recursive:!0}),await A.writeFile(o,t,"utf8")}if(!e.globalOptions.quiet){for(let o of e.result.warnings)y(`warning: ${o}`);e.outputPath===void 0&&S(t)}}function K(e,t){let o=!!t.strictExit||!!t.failOnWarn;if(e.action!=="doctor"||!o)return;let a=e.details!==null&&typeof e.details=="object"?e.details:{},i=a.summary!==null&&typeof a.summary=="object"?a.summary:null,n=i&&typeof i.status=="string"?i.status:void 0;(e.warnings.length>0||n!==void 0&&n!=="ok")&&(process.exitCode=d.GENERIC_FAILURE)}async function p(e,t,o,a,i="extension"){let n=v(o),c=Date.now(),r=G(t,a,i),s=(typeof r.output=="string"?r.output:void 0)?.trim();P(r,n,s);let m=await C(e,r,n);r.markdown===!0?await B({result:m,vocabulary:i,outputPath:s,globalOptions:n}):_(m,n),K(m,r),m.ok===!1&&(process.exitCode=d.GENERIC_FAILURE),n.profile&&y(`profile:command=extension took_ms=${Date.now()-c}`)}function V(e){return e.details!==null&&typeof e.details=="object"?e.details:{}}function X(e){return e instanceof b?{message:e.message,exit_code:e.exitCode,...e.context}:{message:e instanceof Error?e.message:String(e),exit_code:d.GENERIC_FAILURE}}async function F(e,t,o,a){let i=await q(e);if(i===void 0||i.length<=1){await p(i?.[0],t,o,"install",a);return}let n=v(o),c=Date.now(),r=G(t,"install",a);if(P(r,n,void 0),[r.gh,r.github].some(g=>typeof g=="string"&&g.trim().length>0))throw new b("Multiple install targets cannot be combined with --gh/--github. Install one GitHub source per command, or pass multiple explicit local, bundled, or npm: targets.",d.USAGE,{code:"multi_target_github_install_ambiguous",required:"Use exactly one positional target with --gh/--github, or omit --gh/--github when installing multiple targets.",examples:["pm install --gh owner/repo","pm install npm:pm-guide-shell pm-todos"]});let s=[],m=[],w=d.GENERIC_FAILURE;for(let g of i)try{let h=await C(g,r,n),f=V(h),x=Array.isArray(h.warnings)?h.warnings:[];m.push(...x);let D=h.ok===!0;s.push({target:g,ok:D,extension:f.extension,source:f.source,destination_path:f.destination_path,activated:f.activated,settings_changed:f.settings_changed,command_paths:f.command_paths,action_paths:f.action_paths,runtime_activation_status:f.runtime_activation_status,activation_diagnostics:f.activation_diagnostics,command_discovery:f.command_discovery,verification:f.verification,warnings:x,...D?{}:{error:{message:"Extension install returned ok=false without throwing an error.",exit_code:d.GENERIC_FAILURE,code:"extension_install_soft_failed"}}})}catch(h){let f=X(h),x=f.exit_code;typeof x=="number"&&w===d.GENERIC_FAILURE&&x!==d.GENERIC_FAILURE&&(w=x),s.push({target:g,ok:!1,error:f})}let k=s.filter(g=>g.ok!==!0).length,M={ok:k===0,action:"install",scope:r.global===!0?"global":"project",installed_count:s.length-k,failed_count:k,targets:s,warnings:[...new Set(m)].sort((g,h)=>g.localeCompare(h))};_(M,n),k>0&&(process.exitCode=w),n.profile&&y(`profile:command=extension took_ms=${Date.now()-c}`)}function Y(e){return e.option("--project","Use project extension scope (default)").option("--local","Alias for --project").option("--global","Use global extension scope")}function $(e){return e.option("--project","Use project package scope (default)").option("--local","Alias for --project").option("--global","Use global package scope")}function u(e,t){return t==="package"?$(e):Y(e)}function W(e,t){let o=t==="package"?"package":"extension",a=t==="package"?"packages":"extensions",i=t,n=e.command(i).argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} source/name or scaffold target path (for --init/--scaffold)`).option("--init",`Generate a starter ${o} scaffold at target path`).option("--scaffold","Alias for --init").option("--capability <kind>",`Capability the --init starter targets (${I.join("|")}; default commands)`,E).option("--install",`Install ${o} from local path, bundled alias, npm: source, wildcard, or GitHub source`).option("--uninstall",`Uninstall an installed ${o}`).option("--explore",`List discovered ${a} in selected scope`).option("--list","Alias for --explore").option("--manage",`List managed ${a} with update-check metadata`).option("--describe",`Map every surface a loaded ${o} registers (optionally one by name)`).option("--markdown","Render describe output as a Markdown reference document (describe only)").option("--output <path>","Write describe Markdown to a file (requires --markdown)").option("--reload",`Reload ${a} with cache-busted module imports`).option("--watch","Use watch mode with --reload").option("--doctor",`Run consolidated ${o} diagnostics (summary/deep modes)`).option("--catalog",`List bundled first-party ${o} catalog metadata`).option("--adopt",`Adopt an existing unmanaged ${o} into managed metadata`).option("--adopt-all",`Adopt all unmanaged ${a} into managed metadata`).option("--activate",`Activate a ${o} in selected scope settings`).option("--deactivate",`Deactivate a ${o} in selected scope settings`).option("--project",`Use project ${o} scope (default)`).option("--local","Alias for --project").option("--global",`Use global ${o} scope`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").option("--detail <mode>",`${o[0].toUpperCase()}${o.slice(1)} diagnostics detail mode (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(t==="package"?"Manage package lifecycle operations for project or global scope. Backward-compatible with extension packages.":"Manage extension lifecycle operations for project or global scope.").action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,void 0,t)});t==="package"&&(n.alias("packages"),n.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"));let c=n.command("init").alias("scaffold").argument("<target>","Scaffold target directory path").option("--capability <kind>",`Capability the starter targets (${I.join("|")}; default commands)`,E).description(t==="package"?"Generate a starter package scaffold with package metadata, manifest, and entrypoint.":"Generate a starter extension scaffold with manifest and entrypoint.");t==="package"&&c.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"),u(c,t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"init",t)}),u(n.command("install").argument("[targets...]",`${o[0].toUpperCase()}${o.slice(1)} source (local path, bundled alias, npm: source, wildcard, or GitHub source)`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").description(`Install ${o} from local path, bundled alias, npm: source, wildcard, or GitHub source.`),t).action(async(r,l,s)=>{await F(r,s.optsWithGlobals(),s,t)}),u(n.command("uninstall").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Uninstall an installed ${o}.`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"uninstall",t)}),u(n.command("explore").description(`List discovered ${a} in selected scope.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"explore",t)}),u(n.command("manage").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).description(`List managed ${a} with update-check metadata.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"manage",t)}),u(n.command("describe").argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} name to describe (omit for every loaded ${o})`).option("--markdown","Render the surface map as a Markdown reference document instead of toon/json").option("--output <path>","Write Markdown output to a file (requires --markdown)").description(`Map every surface a loaded ${o} registers (commands, hooks, item types, providers, overrides, ...).`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"describe",t)}),u(n.command("reload").option("--watch","Use watch mode for repeated reload checks").description(`Reload ${a} with cache-busted module imports.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"reload",t)}),u(n.command("doctor").option("--detail <mode>",`Detail mode for ${o} diagnostics (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(`Run consolidated ${o} diagnostics (summary/deep modes).`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"doctor",t)}),u(n.command("catalog").alias("list").option("--fields <value>","Render compact comma-separated catalog fields, for example: alias,installed,install_command").description(`List bundled first-party ${o} catalog metadata.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"catalog",t)}),u(n.command("adopt").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).option("--gh <owner/repo[/path]>",`GitHub provenance shorthand for adopted ${o}`).option("--github <owner/repo[/path]>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub shorthand source").description(`Adopt an existing unmanaged ${o} into managed metadata.`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"adopt",t)}),u(n.command("adopt-all").description(`Adopt all unmanaged ${a} into managed metadata.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"adopt-all",t)}),u(n.command("migrate").option("--dry-run","Plan active migrations without invoking extension code").description(`Plan or apply active ${o} migrations with durable receipts.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"migrate",t)}),u(n.command("activate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Activate a ${o} in selected scope settings.`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"activate",t)}),u(n.command("deactivate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Deactivate a ${o} in selected scope settings.`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"deactivate",t)})}async function J(e,t,o){let a=v(o),i=Date.now(),n=await T(e,a,{idPrefix:typeof t.idPrefix=="string"?t.idPrefix:void 0,preset:typeof t.preset=="string"?t.preset:void 0,defaults:t.defaults===!0||t.yes===!0,author:typeof t.author=="string"?t.author:void 0,agentGuidance:typeof t.agentGuidance=="string"?t.agentGuidance:void 0,typePreset:typeof t.typePreset=="string"?t.typePreset:void 0,withPackages:t.withPackages===!0,mergeFence:t.mergeFence!==!1,force:t.force===!0,workspace:typeof t.workspace=="string"?t.workspace:void 0}),r=t.verbose===!0||a.json===!0;_(r?n:j(n),a),a.profile&&y(`profile:command=init took_ms=${Date.now()-i}`)}function Q(e,t,o,a){let n=e!==void 0&&new Set(["get","set","list","export"]).has(e);return{resolvedScope:n?"project":e??"project",resolvedAction:n?e:t??"list",resolvedKey:n?t:o,resolvedValue:n?o:a}}function Z(e){return{criterion:Array.isArray(e.criterion)?e.criterion:[],format:typeof e.format=="string"?e.format:void 0,policy:typeof e.policy=="string"?e.policy:void 0,value:typeof e.value=="string"?e.value:void 0,clearCriteria:e.clearCriteria===!0,defaultDepth:typeof e.defaultDepth=="string"?e.defaultDepth:void 0,activityLimit:typeof e.activityLimit=="string"?e.activityLimit:void 0,staleThresholdDays:typeof e.staleThresholdDays=="string"?e.staleThresholdDays:void 0,sectionHierarchy:typeof e.sectionHierarchy=="string"?e.sectionHierarchy:void 0,sectionActivity:typeof e.sectionActivity=="string"?e.sectionActivity:void 0,sectionProgress:typeof e.sectionProgress=="string"?e.sectionProgress:void 0,sectionBlockers:typeof e.sectionBlockers=="string"?e.sectionBlockers:void 0,sectionFiles:typeof e.sectionFiles=="string"?e.sectionFiles:void 0,sectionWorkload:typeof e.sectionWorkload=="string"?e.sectionWorkload:void 0,sectionStaleness:typeof e.sectionStaleness=="string"?e.sectionStaleness:void 0,sectionTests:typeof e.sectionTests=="string"?e.sectionTests:void 0}}async function ee(e,t,o,a,i,n){let c=v(n),r=Date.now(),{resolvedScope:l,resolvedAction:s,resolvedKey:m,resolvedValue:w}=Q(e,t,o,a),k=await O(l,s,m,Z(i),c,typeof w=="string"?w:void 0);_(k,c),c.profile&&y(`profile:command=config took_ms=${Date.now()-r}`)}var ve={normalizeExtensionOptions:G};function Ee(e){e.command("init").argument("[prefix-or-path]","Optional id prefix, or path-like tracker target such as ./pm-sandbox").option("--prefix, --id-prefix <value>","Set the item ID prefix (alias for the positional prefix)").option("--preset <value>","Governance preset for new setups: minimal|default|strict").option("--defaults","Use non-interactive setup defaults without opening the wizard").option("-y, --yes","Alias for --defaults (non-interactive setup)").option("--author <value>","Set the default mutation author for this project").option("--agent-guidance <mode>","Agent guidance mode: ask|add|skip|status").option("--type-preset <name>","Register domain item types during init: agile|ops|research").option("--with-packages","Install all bundled first-party packages during initialization").option("--no-merge-fence","Skip automatic merge-driver installation for a fresh Git-backed tracker").option("--workspace <dir>","Initialize repository-local tracker storage at <dir>/.agents/pm").option("--force","Allow initializing tracker files directly in a directory that looks like a workspace root").option("--verbose","Include the full resolved settings tree in the output (default output is a concise summary)").description("Initialize pm storage and defaults for the current workspace or a path-like tracker target.").action(async(t,o,a)=>{await J(t,o,a)}),e.command("config").argument("[scope]","Config scope: project|global, or action shorthand list|export|get|set for project scope").argument("[action]","Config action: get|set|list|export").argument("[key]","Config key for get|set; use `pm config project list` for the complete typed inventory, including mutation-guard-* policies").argument("[value]",'Optional value for set: routed to the right typed flag by key (e.g. config set telemetry-tracking off, config set item-format toon, config set definition-of-done "Tests pass"). Equivalent to --policy/--format/--criterion. context keys still require --default-depth/--section-* flags.').option("--criterion <text>","Criteria value for definition-of-done, metadata-required-fields, or lifecycle pattern keys (repeatable for set)",E).option("--clear-criteria","Clear criteria-list keys for config set operations").option("--format <value>","Item format for item-format key: toon").option("--policy <value>","Policy key values: history-missing-stream-policy=auto_create|strict_error; sprint-release-format-policy=warn|strict_error; parent-reference-policy=warn|strict_error; governance-preset=minimal|default|strict|custom; governance-ownership-enforcement=none|warn|strict; governance-create-mode-default=progressive|strict; governance-close-validation-default=off|warn|strict; governance-require-close-reason=enabled|disabled; governance-parent-reference-policy=warn|strict_error; governance-metadata-validation-profile=core|strict|custom; governance-force-required-for-stale-lock=enabled|disabled; governance-duplicate-detection-mode=off|advisory|strict; test-result-tracking=enabled|disabled; telemetry-tracking=enabled|disabled").option("--value <value>","Typed nested setting value. Mutation guards: require-attributed-author=true|false, secret-guard=off|advise|block, stale-in-progress-hours=integer>=1. Kebab-case is preferred; underscore aliases remain accepted.").option("--default-depth <value>","Context default depth: brief|standard|deep").option("--activity-limit <n>","Context default activity limit").option("--stale-threshold-days <n>","Context staleness cutoff in days").option("--section-hierarchy <value>","Enable/disable context hierarchy section (true|false)").option("--section-activity <value>","Enable/disable context activity section (true|false)").option("--section-progress <value>","Enable/disable context progress section (true|false)").option("--section-blockers <value>","Enable/disable context blockers section (true|false)").option("--section-files <value>","Enable/disable context files section (true|false)").option("--section-workload <value>","Enable/disable context workload section (true|false)").option("--section-staleness <value>","Enable/disable context staleness section (true|false)").option("--section-tests <value>","Enable/disable context tests section (true|false)").description("Read or update pm settings for the current workspace or global profile.").action(async(t,o,a,i,n,c)=>{await ee(t,o,a,i,n,c)}),W(e,"extension"),W(e,"package"),$(e.command("install").argument("[targets...]","Package source (local path, bundled alias, npm: source, wildcard, or GitHub source)").option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").description("Install a pm package into the project package scope by default.")).action(async(t,o,a)=>{await F(t,a.optsWithGlobals(),a,"package")}),$(e.command("upgrade").argument("[target]","Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages").option("--dry-run","Plan CLI/package upgrades without running npm or reinstalling packages").option("--cli-only","Upgrade only the pm CLI/SDK npm package").option("--packages-only","Upgrade only managed pm packages").option("--repair","Force npm global reinstall when upgrading the pm CLI/SDK").option("--tag <value>","npm dist-tag/version for CLI and registry package upgrades").option("--package-name <value>","Override the CLI package name for self-upgrade testing").description("Upgrade the pm CLI/SDK and refresh managed installable pm packages.")).action(async(t,o,a)=>{let i=v(a),n=Date.now(),c=await R(t,a.opts(),i);_(c,i),c.ok||(process.exitCode=d.GENERIC_FAILURE),i.profile&&y(`profile:command=upgrade took_ms=${Date.now()-n}`)})}export{ve as _testOnlyRegisterSetup,Ee as registerSetupCommands};
2
- //# sourceMappingURL=register-setup-DOSFBGKE.js.map
1
+ import{a as R,f as O}from"./chunk-5UZZAJKR.js";import{Aa as U,Ka as C,Oa as j,Qa as T,xa as I}from"./chunk-GNFAFIJI.js";import"./chunk-WYRZZ5ZE.js";import{C as d,E as b,El as v,Hl as E,Nf as S,Pf as _,Qf as y}from"./chunk-DY4DMUMC.js";import A from"node:fs/promises";import L 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]="054789eb-fabe-5042-8166-19961f30ebf1")}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]="3e4ba524-10cf-58e7-81ea-f48f30ca1250")}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]="defd826a-ac9b-54e4-b2a3-00d022090a10")}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]="4344c493-be53-584f-b25d-4b41bfee5079")}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]="08f5b31f-c756-577c-94e8-7b4268ba12ab")}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]="59c52ff5-9763-5244-bed3-146a547c3551")}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]="d498a64c-9680-52a9-981d-4ce86949784d")}catch{}})();var z={init:"init",install:"install",uninstall:"uninstall",explore:"explore",manage:"manage",describe:"describe",reload:"reload",doctor:"doctor",catalog:"catalog",adopt:"adopt","adopt-all":"adoptAll",activate:"activate",deactivate:"deactivate",migrate:"migrate"};function H(e){let t=e.capability,o=typeof t=="string"?[t]:Array.isArray(t)?t.filter(i=>typeof i=="string"):[],a=[...new Set(o.map(i=>i.trim().toLowerCase()).filter(i=>i.length>0))];if(a.length>1)throw new b(`Multiple scaffold capabilities cannot be combined yet: ${a.join(", ")}. Choose one capability per scaffold.`,d.USAGE);return a[0]}function G(e,t,o="extension"){let a={...e};t!==void 0&&(a[z[t]]=!0);let i=(...c)=>c.some(r=>a[r]===!0),n=(...c)=>{for(let r of c)if(typeof a[r]=="string")return a[r]};return{init:i("init"),scaffold:i("scaffold"),install:i("install"),uninstall:i("uninstall"),explore:i("explore","list"),manage:i("manage"),describe:i("describe"),markdown:i("markdown"),reload:i("reload"),doctor:i("doctor"),catalog:i("catalog"),adopt:i("adopt"),adoptAll:i("adoptAll","adopt_all","adopt-all"),activate:i("activate"),deactivate:i("deactivate"),migrate:i("migrate"),project:i("project"),local:i("local"),global:i("global"),gh:n("gh"),github:n("github"),ref:n("ref"),capability:H(e),declarative:i("declarative"),fields:n("fields"),detail:n("detail"),output:n("output"),trace:i("trace"),watch:i("watch"),runtimeProbe:i("runtimeProbe","runtime_probe","runtime-probe"),fixManagedState:i("fixManagedState","fix_managed_state","fix-managed-state"),isolated:i("isolated"),ignoreGlobal:i("ignoreGlobal","ignore_global","ignore-global"),strictExit:i("strictExit","strict_exit","strict-exit"),failOnWarn:i("failOnWarn","fail_on_warn","fail-on-warn"),dryRun:i("dryRun","dry_run","dry-run"),vocabulary:o}}async function N(e){let t=(await A.readdir(process.cwd())).filter(a=>!a.startsWith(".")).sort((a,i)=>a.localeCompare(i)),o=[...e].sort((a,i)=>a.localeCompare(i));return t.length===o.length&&t.every((a,i)=>a===o[i])}async function q(e){let t=(e??[]).map(o=>o.trim()).filter(o=>o.length>0);return t.length<=1?t.length===0?void 0:t:await N(t)?["*"]:t}function P(e,t,o){let a=e.markdown===!0;if(o!==void 0&&o==="")throw new b("--output requires a non-empty file path.",d.USAGE);if(o!==void 0&&!a)throw new b("--output is only supported with --markdown describe output.",d.USAGE);if(a){if(t.json)throw new b("Cannot combine --json with --markdown.",d.USAGE);if(e.describe!==!0)throw new b("--markdown is only supported by the describe action.",d.USAGE)}}async function B(e){let t=U(e.result.details,e.vocabulary);if(e.outputPath!==void 0){let o=L.resolve(e.outputPath);await A.mkdir(L.dirname(o),{recursive:!0}),await A.writeFile(o,t,"utf8")}if(!e.globalOptions.quiet){for(let o of e.result.warnings)y(`warning: ${o}`);e.outputPath===void 0&&S(t)}}function K(e,t){let o=!!t.strictExit||!!t.failOnWarn;if(e.action!=="doctor"||!o)return;let a=e.details!==null&&typeof e.details=="object"?e.details:{},i=a.summary!==null&&typeof a.summary=="object"?a.summary:null,n=i&&typeof i.status=="string"?i.status:void 0;(e.warnings.length>0||n!==void 0&&n!=="ok")&&(process.exitCode=d.GENERIC_FAILURE)}async function p(e,t,o,a,i="extension"){let n=v(o),c=Date.now(),r=G(t,a,i),s=(typeof r.output=="string"?r.output:void 0)?.trim();P(r,n,s);let m=await C(e,r,n);r.markdown===!0?await B({result:m,vocabulary:i,outputPath:s,globalOptions:n}):_(m,n),K(m,r),m.ok===!1&&(process.exitCode=d.GENERIC_FAILURE),n.profile&&y(`profile:command=extension took_ms=${Date.now()-c}`)}function V(e){return e.details!==null&&typeof e.details=="object"?e.details:{}}function X(e){return e instanceof b?{message:e.message,exit_code:e.exitCode,...e.context}:{message:e instanceof Error?e.message:String(e),exit_code:d.GENERIC_FAILURE}}async function F(e,t,o,a){let i=await q(e);if(i===void 0||i.length<=1){await p(i?.[0],t,o,"install",a);return}let n=v(o),c=Date.now(),r=G(t,"install",a);if(P(r,n,void 0),[r.gh,r.github].some(g=>typeof g=="string"&&g.trim().length>0))throw new b("Multiple install targets cannot be combined with --gh/--github. Install one GitHub source per command, or pass multiple explicit local, bundled, or npm: targets.",d.USAGE,{code:"multi_target_github_install_ambiguous",required:"Use exactly one positional target with --gh/--github, or omit --gh/--github when installing multiple targets.",examples:["pm install --gh owner/repo","pm install npm:pm-guide-shell pm-todos"]});let s=[],m=[],w=d.GENERIC_FAILURE;for(let g of i)try{let h=await C(g,r,n),f=V(h),x=Array.isArray(h.warnings)?h.warnings:[];m.push(...x);let D=h.ok===!0;s.push({target:g,ok:D,extension:f.extension,source:f.source,destination_path:f.destination_path,activated:f.activated,settings_changed:f.settings_changed,command_paths:f.command_paths,action_paths:f.action_paths,runtime_activation_status:f.runtime_activation_status,activation_diagnostics:f.activation_diagnostics,command_discovery:f.command_discovery,verification:f.verification,warnings:x,...D?{}:{error:{message:"Extension install returned ok=false without throwing an error.",exit_code:d.GENERIC_FAILURE,code:"extension_install_soft_failed"}}})}catch(h){let f=X(h),x=f.exit_code;typeof x=="number"&&w===d.GENERIC_FAILURE&&x!==d.GENERIC_FAILURE&&(w=x),s.push({target:g,ok:!1,error:f})}let k=s.filter(g=>g.ok!==!0).length,M={ok:k===0,action:"install",scope:r.global===!0?"global":"project",installed_count:s.length-k,failed_count:k,targets:s,warnings:[...new Set(m)].sort((g,h)=>g.localeCompare(h))};_(M,n),k>0&&(process.exitCode=w),n.profile&&y(`profile:command=extension took_ms=${Date.now()-c}`)}function Y(e){return e.option("--project","Use project extension scope (default)").option("--local","Alias for --project").option("--global","Use global extension scope")}function $(e){return e.option("--project","Use project package scope (default)").option("--local","Alias for --project").option("--global","Use global package scope")}function u(e,t){return t==="package"?$(e):Y(e)}function W(e,t){let o=t==="package"?"package":"extension",a=t==="package"?"packages":"extensions",i=t,n=e.command(i).argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} source/name or scaffold target path (for --init/--scaffold)`).option("--init",`Generate a starter ${o} scaffold at target path`).option("--scaffold","Alias for --init").option("--capability <kind>",`Capability the --init starter targets (${I.join("|")}; default commands)`,E).option("--install",`Install ${o} from local path, bundled alias, npm: source, wildcard, or GitHub source`).option("--uninstall",`Uninstall an installed ${o}`).option("--explore",`List discovered ${a} in selected scope`).option("--list","Alias for --explore").option("--manage",`List managed ${a} with update-check metadata`).option("--describe",`Map every surface a loaded ${o} registers (optionally one by name)`).option("--markdown","Render describe output as a Markdown reference document (describe only)").option("--output <path>","Write describe Markdown to a file (requires --markdown)").option("--reload",`Reload ${a} with cache-busted module imports`).option("--watch","Use watch mode with --reload").option("--doctor",`Run consolidated ${o} diagnostics (summary/deep modes)`).option("--catalog",`List bundled first-party ${o} catalog metadata`).option("--adopt",`Adopt an existing unmanaged ${o} into managed metadata`).option("--adopt-all",`Adopt all unmanaged ${a} into managed metadata`).option("--activate",`Activate a ${o} in selected scope settings`).option("--deactivate",`Deactivate a ${o} in selected scope settings`).option("--project",`Use project ${o} scope (default)`).option("--local","Alias for --project").option("--global",`Use global ${o} scope`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").option("--detail <mode>",`${o[0].toUpperCase()}${o.slice(1)} diagnostics detail mode (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(t==="package"?"Manage package lifecycle operations for project or global scope. Backward-compatible with extension packages.":"Manage extension lifecycle operations for project or global scope.").action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,void 0,t)});t==="package"&&(n.alias("packages"),n.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"));let c=n.command("init").alias("scaffold").argument("<target>","Scaffold target directory path").option("--capability <kind>",`Capability the starter targets (${I.join("|")}; default commands)`,E).description(t==="package"?"Generate a starter package scaffold with package metadata, manifest, and entrypoint.":"Generate a starter extension scaffold with manifest and entrypoint.");t==="package"&&c.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"),u(c,t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"init",t)}),u(n.command("install").argument("[targets...]",`${o[0].toUpperCase()}${o.slice(1)} source (local path, bundled alias, npm: source, wildcard, or GitHub source)`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").description(`Install ${o} from local path, bundled alias, npm: source, wildcard, or GitHub source.`),t).action(async(r,l,s)=>{await F(r,s.optsWithGlobals(),s,t)}),u(n.command("uninstall").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Uninstall an installed ${o}.`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"uninstall",t)}),u(n.command("explore").description(`List discovered ${a} in selected scope.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"explore",t)}),u(n.command("manage").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).description(`List managed ${a} with update-check metadata.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"manage",t)}),u(n.command("describe").argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} name to describe (omit for every loaded ${o})`).option("--markdown","Render the surface map as a Markdown reference document instead of toon/json").option("--output <path>","Write Markdown output to a file (requires --markdown)").description(`Map every surface a loaded ${o} registers (commands, hooks, item types, providers, overrides, ...).`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"describe",t)}),u(n.command("reload").option("--watch","Use watch mode for repeated reload checks").description(`Reload ${a} with cache-busted module imports.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"reload",t)}),u(n.command("doctor").option("--detail <mode>",`Detail mode for ${o} diagnostics (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(`Run consolidated ${o} diagnostics (summary/deep modes).`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"doctor",t)}),u(n.command("catalog").alias("list").option("--fields <value>","Render compact comma-separated catalog fields, for example: alias,installed,install_command").description(`List bundled first-party ${o} catalog metadata.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"catalog",t)}),u(n.command("adopt").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).option("--gh <owner/repo[/path]>",`GitHub provenance shorthand for adopted ${o}`).option("--github <owner/repo[/path]>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub shorthand source").description(`Adopt an existing unmanaged ${o} into managed metadata.`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"adopt",t)}),u(n.command("adopt-all").description(`Adopt all unmanaged ${a} into managed metadata.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"adopt-all",t)}),u(n.command("migrate").option("--dry-run","Plan active migrations without invoking extension code").description(`Plan or apply active ${o} migrations with durable receipts.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"migrate",t)}),u(n.command("activate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Activate a ${o} in selected scope settings.`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"activate",t)}),u(n.command("deactivate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Deactivate a ${o} in selected scope settings.`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"deactivate",t)})}async function J(e,t,o){let a=v(o),i=Date.now(),n=await T(e,a,{idPrefix:typeof t.idPrefix=="string"?t.idPrefix:void 0,preset:typeof t.preset=="string"?t.preset:void 0,defaults:t.defaults===!0||t.yes===!0,author:typeof t.author=="string"?t.author:void 0,agentGuidance:typeof t.agentGuidance=="string"?t.agentGuidance:void 0,typePreset:typeof t.typePreset=="string"?t.typePreset:void 0,withPackages:t.withPackages===!0,mergeFence:t.mergeFence!==!1,force:t.force===!0,workspace:typeof t.workspace=="string"?t.workspace:void 0}),r=t.verbose===!0||a.json===!0;_(r?n:j(n),a),a.profile&&y(`profile:command=init took_ms=${Date.now()-i}`)}function Q(e,t,o,a){let n=e!==void 0&&new Set(["get","set","list","export"]).has(e);return{resolvedScope:n?"project":e??"project",resolvedAction:n?e:t??"list",resolvedKey:n?t:o,resolvedValue:n?o:a}}function Z(e){return{criterion:Array.isArray(e.criterion)?e.criterion:[],format:typeof e.format=="string"?e.format:void 0,policy:typeof e.policy=="string"?e.policy:void 0,value:typeof e.value=="string"?e.value:void 0,clearCriteria:e.clearCriteria===!0,defaultDepth:typeof e.defaultDepth=="string"?e.defaultDepth:void 0,activityLimit:typeof e.activityLimit=="string"?e.activityLimit:void 0,staleThresholdDays:typeof e.staleThresholdDays=="string"?e.staleThresholdDays:void 0,sectionHierarchy:typeof e.sectionHierarchy=="string"?e.sectionHierarchy:void 0,sectionActivity:typeof e.sectionActivity=="string"?e.sectionActivity:void 0,sectionProgress:typeof e.sectionProgress=="string"?e.sectionProgress:void 0,sectionBlockers:typeof e.sectionBlockers=="string"?e.sectionBlockers:void 0,sectionFiles:typeof e.sectionFiles=="string"?e.sectionFiles:void 0,sectionWorkload:typeof e.sectionWorkload=="string"?e.sectionWorkload:void 0,sectionStaleness:typeof e.sectionStaleness=="string"?e.sectionStaleness:void 0,sectionTests:typeof e.sectionTests=="string"?e.sectionTests:void 0}}async function ee(e,t,o,a,i,n){let c=v(n),r=Date.now(),{resolvedScope:l,resolvedAction:s,resolvedKey:m,resolvedValue:w}=Q(e,t,o,a),k=await O(l,s,m,Z(i),c,typeof w=="string"?w:void 0);_(k,c),c.profile&&y(`profile:command=config took_ms=${Date.now()-r}`)}var ve={normalizeExtensionOptions:G};function Ee(e){e.command("init").argument("[prefix-or-path]","Optional id prefix, or path-like tracker target such as ./pm-sandbox").option("--prefix, --id-prefix <value>","Set the item ID prefix (alias for the positional prefix)").option("--preset <value>","Governance preset for new setups: minimal|default|strict").option("--defaults","Use non-interactive setup defaults without opening the wizard").option("-y, --yes","Alias for --defaults (non-interactive setup)").option("--author <value>","Set the default mutation author for this project").option("--agent-guidance <mode>","Agent guidance mode: ask|add|skip|status").option("--type-preset <name>","Register domain item types during init: agile|ops|research").option("--with-packages","Install all bundled first-party packages during initialization").option("--no-merge-fence","Skip automatic merge-driver installation for a fresh Git-backed tracker").option("--workspace <dir>","Initialize repository-local tracker storage at <dir>/.agents/pm").option("--force","Allow initializing tracker files directly in a directory that looks like a workspace root").option("--verbose","Include the full resolved settings tree in the output (default output is a concise summary)").description("Initialize pm storage and defaults for the current workspace or a path-like tracker target.").action(async(t,o,a)=>{await J(t,o,a)}),e.command("config").argument("[scope]","Config scope: project|global, or action shorthand list|export|get|set for project scope").argument("[action]","Config action: get|set|list|export").argument("[key]","Config key for get|set; use `pm config project list` for the complete typed inventory, including mutation-guard-* policies").argument("[value]",'Optional value for set: routed to the right typed flag by key (e.g. config set telemetry-tracking off, config set item-format toon, config set definition-of-done "Tests pass"). Equivalent to --policy/--format/--criterion. context keys still require --default-depth/--section-* flags.').option("--criterion <text>","Criteria value for definition-of-done, metadata-required-fields, or lifecycle pattern keys (repeatable for set)",E).option("--clear-criteria","Clear criteria-list keys for config set operations").option("--format <value>","Item format for item-format key: toon").option("--policy <value>","Policy key values: history-missing-stream-policy=auto_create|strict_error; sprint-release-format-policy=warn|strict_error; parent-reference-policy=warn|strict_error; governance-preset=minimal|default|strict|custom; governance-ownership-enforcement=none|warn|strict; governance-create-mode-default=progressive|strict; governance-close-validation-default=off|warn|strict; governance-require-close-reason=enabled|disabled; governance-parent-reference-policy=warn|strict_error; governance-metadata-validation-profile=core|strict|custom; governance-force-required-for-stale-lock=enabled|disabled; governance-duplicate-detection-mode=off|advisory|strict; test-result-tracking=enabled|disabled; telemetry-tracking=enabled|disabled").option("--value <value>","Typed nested setting value. Mutation guards: require-attributed-author=true|false, secret-guard=off|advise|block, stale-in-progress-hours=integer>=1. Kebab-case is preferred; underscore aliases remain accepted.").option("--default-depth <value>","Context default depth: brief|standard|deep").option("--activity-limit <n>","Context default activity limit").option("--stale-threshold-days <n>","Context staleness cutoff in days").option("--section-hierarchy <value>","Enable/disable context hierarchy section (true|false)").option("--section-activity <value>","Enable/disable context activity section (true|false)").option("--section-progress <value>","Enable/disable context progress section (true|false)").option("--section-blockers <value>","Enable/disable context blockers section (true|false)").option("--section-files <value>","Enable/disable context files section (true|false)").option("--section-workload <value>","Enable/disable context workload section (true|false)").option("--section-staleness <value>","Enable/disable context staleness section (true|false)").option("--section-tests <value>","Enable/disable context tests section (true|false)").description("Read or update pm settings for the current workspace or global profile.").action(async(t,o,a,i,n,c)=>{await ee(t,o,a,i,n,c)}),W(e,"extension"),W(e,"package"),$(e.command("install").argument("[targets...]","Package source (local path, bundled alias, npm: source, wildcard, or GitHub source)").option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").description("Install a pm package into the project package scope by default.")).action(async(t,o,a)=>{await F(t,a.optsWithGlobals(),a,"package")}),$(e.command("upgrade").argument("[target]","Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages").option("--dry-run","Plan CLI/package upgrades without running npm or reinstalling packages").option("--cli-only","Upgrade only the pm CLI/SDK npm package").option("--packages-only","Upgrade only managed pm packages").option("--repair","Force npm global reinstall when upgrading the pm CLI/SDK").option("--tag <value>","npm dist-tag/version for CLI and registry package upgrades").option("--package-name <value>","Override the CLI package name for self-upgrade testing").description("Upgrade the pm CLI/SDK and refresh managed installable pm packages.")).action(async(t,o,a)=>{let i=v(a),n=Date.now(),c=await R(t,a.opts(),i);_(c,i),c.ok||(process.exitCode=d.GENERIC_FAILURE),i.profile&&y(`profile:command=upgrade took_ms=${Date.now()-n}`)})}export{ve as _testOnlyRegisterSetup,Ee as registerSetupCommands};
2
+ //# sourceMappingURL=register-setup-PPPEF3SN.js.map
@@ -0,0 +1,2 @@
1
+ (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]="a54549aa-2f6c-5092-a3eb-5b36ee698ea4")}catch{}})();var j=["commands","renderers","hooks","schema","importers","search","parser","preflight","services"],Ge=2,ze=Object.freeze({migration:"schema",validation:"schema"}),hn=Object.freeze({version:Ge,capabilities:[...j],legacy_aliases:{...ze}}),se=["off","warn","enforce"],ie=["off","warn","enforce"],ae=["none","restricted","strict"],bn=["block","warn"],ue=["commands.override","commands.handler","hooks.beforecommand","hooks.beforemutation","hooks.aftercommand","hooks.onwrite","hooks.onread","hooks.onindex","schema.flags","schema.itemfields","schema.itemtypes","schema.relationshipkinds","schema.migrations","schema.profiles","parser.override","preflight.override","services.override","renderers.override","importers.importer","importers.exporter","search.provider","search.vectorstore","services.assuranceprovider"],ce=["output_format","error_format","help_format","lock_acquire","lock_release","history_append","item_store_write","item_store_delete","context_relevance","command_result"];function de(){return{mode:"off",trust_mode:"off",require_provenance:!1,trusted_extensions:[],default_sandbox_profile:"none",allowed_extensions:[],blocked_extensions:[],allowed_capabilities:[],blocked_capabilities:[],allowed_surfaces:[],blocked_surfaces:[],allowed_commands:[],blocked_commands:[],allowed_actions:[],blocked_actions:[],allowed_services:[],blocked_services:[],extension_overrides:[]}}(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]="f6ab5bae-53b3-5feb-b89f-46e64afe7058")}catch{}})();var $e=["Epic","Feature","Task","Chore","Issue","Decision","Event","Reminder","Milestone","Meeting","Plan"],On=$e,An=["draft","open","in_progress","blocked","closed","canceled"],Sn=["draft","active","blocked","terminal","terminal_done","terminal_canceled","default_open","default_close","default_cancel"],wn=["string","number","boolean","string_array","array","object"],Tn=["create","update","update_many","list","search","calendar","context"],kn=["allow","warn","reject"],xn=["blocks","parent","child","parent_child","child_of","related","related_to","discovered_from","blocked_by","incident_from","epic","implements","recurs_from","supersedes","task","verifies"],Rn=["project","global"],In=["low","medium","high","critical"],Nn=["low","medium","high","critical"],Cn=["low","medium","high"];var vn=["minimal","default","strict","custom"],Dn=["none","warn","strict"],Mn=["progressive","strict"],Un=["off","warn","strict"],Ln=["off","warn","strict"];var Pn=["daily","weekly","monthly","yearly"],Ke=["mon","tue","wed","thu","fri","sat","sun"];function jn(e){return Ke.indexOf(e)}var Vn=["draft","research","review","approved","executing","paused","completed","superseded"],Fn=["pending","in_progress","completed","blocked","skipped","superseded"],Bn=["codex","claude-code","cursor","generic"],Gn=["related","blocks","blocked_by","depends_on","discovered_from","implements","recurs_from","verifies","supersedes"],zn=["brief","standard","deep","full"],$n=["hierarchy","activity","progress","recently_created","unparented","blockers","files","workload","staleness","tests"];(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]="45e1dcb9-d2d6-52d7-b0b0-a57556a3fb03")}catch{}})();var Xe=Object.freeze([{id:"draft",roles:["draft"]},{id:"open",roles:["active","default_open"]},{id:"in_progress",aliases:["in-progress"],roles:["active"]},{id:"blocked",roles:["blocked"]},{id:"closed",roles:["terminal","terminal_done","default_close"]},{id:"canceled",aliases:["cancelled"],roles:["terminal","terminal_canceled","default_cancel"]}]),Ye=Object.freeze({draft_status:"draft",open_status:"open",in_progress_status:"in_progress",blocked_status:"blocked",close_status:"closed",canceled_status:"canceled"}),Yn=".agents/pm",qn="settings.json";var qe=["","epics","features","tasks","chores","issues","schema","history","search","extensions","locks"],We=["decisions","events","reminders","milestones","meetings","plans"],Wn=[...qe,...We],Qn={Epic:"epics",Feature:"features",Task:"tasks",Chore:"chores",Issue:"issues",Decision:"decisions",Event:"events",Reminder:"reminders",Milestone:"milestones",Meeting:"meetings",Plan:"plans"},Qe=["goal","objective","value","impact","outcome","why_now","parent","reviewer","risk","confidence","sprint","release","blocked_by","blocked_reason","unblock_note","reporter","severity","environment","repro_steps","resolution","expected_result","actual_result"],Hn=["id","title","description","type","pm_format_version","source_type","type_options","status","priority","tags","created_at","updated_at","deadline","reminders","events","closed_at","completed_at","assignee","claim_principal","source_owner","author","estimated_minutes","acceptance_criteria","design","external_ref","definition_of_ready","order",...Qe,"affected_version","fixed_version","component","regression","customer_impact","dependencies","comments","notes","learnings","files","tests","test_runs","docs","close_reason","duplicate_of","plan_mode","plan_scope","plan_harness","plan_resume_context","plan_validation","plan_decisions","plan_discoveries","plan_steps"],He={minimal:{ownership_enforcement:"none",create_mode_default:"progressive",close_validation_default:"off",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!1,duplicate_detection_mode:"off",duplicate_detection_threshold:.8,duplicate_detection_limit:3},default:{ownership_enforcement:"warn",create_mode_default:"progressive",close_validation_default:"warn",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3},strict:{ownership_enforcement:"strict",create_mode_default:"strict",close_validation_default:"strict",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"strict",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3}},Je=["no active blocker","ready for planned execution sequencing","work completed","work is closed"],V={blocked_reason:["no active blocker because work is closed","work is closed"],resolution:["closed with implementation evidence","closed with verification evidence","work completed and recorded","work is closed"],actual_result:["closed and recorded","work completed","work completed and recorded"]};function le(e){return e?[...e]:void 0}var Jn={version:1,id_prefix:"pm-",ids:{token_length:4},author_default:"",agent_identity:{probes_enabled:!0,identity_vocabulary:{version:1,aliases:{}},harness_signals:[]},mutation_guard:{require_attributed_author:!1,secret_guard:"advise",stale_in_progress_hours:72},item_format:"toon",locks:{ttl_seconds:1800,wait_ms:3e3},checkpoints:{retention_days:14},output:{default_format:"toon"},ux:{deprecation_hints:!0},history:{missing_stream:"auto_create",compact_policy:{enabled:!1,max_entries:500,trigger:"health_warn"}},validation:{sprint_release_format:"warn",parent_reference:"warn",metadata_profile:"core",metadata_required_fields:[],lifecycle_stale_blocker_reason_patterns:[...Je],lifecycle_closure_like_blocked_reason_patterns:[...V.blocked_reason],lifecycle_closure_like_resolution_patterns:[...V.resolution],lifecycle_closure_like_actual_result_patterns:[...V.actual_result],estimate_defaults_by_type:{}},governance:{preset:"minimal",...He.minimal},workflow:{definition_of_done:[]},testing:{record_results_to_items:!1},telemetry:{enabled:!0,first_run_prompt_completed:!1,capture_level:"redacted",endpoint:"https://pm-cli.unbrained.dev/v1/events",installation_id:"",retention_days:365},agent_guidance:{prompt_completed:!1,declined:!1,declined_at:"",template_version:1,last_checked_files:[]},item_types:{definitions:[]},schema:{version:1,files:{types:"schema/types.json",statuses:"schema/statuses.json",fields:"schema/fields.json",workflows:"schema/workflows.json"},statuses:Xe.map(e=>({...e,aliases:le(e.aliases),roles:le(e.roles)})),fields:[],workflow:{...Ye},unknown_field_policy:"allow"},extensions:{enabled:[],disabled:[],policy:de()},search:{score_threshold:0,hybrid_semantic_weight:.7,max_results:50,embedding_model:"",embedding_batch_size:32,embedding_timeout_ms:3e4,scanner_max_batch_retries:3,provider:"",mutation_refresh_policy:"semantic_configured",query_expansion:{enabled:!1,provider:""},rerank:{enabled:!1,model:"",top_k:20}},providers:{openai:{base_url:"",api_key:"",model:""},ollama:{base_url:"",model:""}},context:{default_depth:"brief",activity_limit:10,stale_threshold_days:7,sections:{hierarchy:!0,activity:!0,progress:!0,recently_created:!0,unparented:!0,blockers:!0,files:!0,workload:!0,staleness:!0,tests:!0}},vector_store:{adapter:"",collection_name:"pm_items",qdrant:{url:"",api_key:""},lancedb:{path:""}}},Zn={metadata:{},body:""},p={SUCCESS:0,GENERIC_FAILURE:1,USAGE:2,NOT_FOUND:3,CONFLICT:4,DEPENDENCY_FAILED:5,NO_EFFECT:6,PARTIAL_EFFECT:7},eo=Object.freeze({unknown_command:"usage",unknown_option:"usage",missing_required_option:"usage",missing_required_argument:"usage",invalid_command_usage:"usage",linked_test_value_not_quoted:"usage",invalid_argument_value:"validation",health_findings:"validation",validation_findings:"validation",close_through_update:"validation",no_update_fields:"validation",unsupported_update_option:"validation",tracker_not_initialized:"validation",item_not_found:"validation",ownership_conflict:"conflict",lock_conflict:"conflict",terminal_state_conflict:"conflict",dependency_failed:"runtime",init_gitignore_unwritable:"runtime",merge_git_config_unwritable:"runtime",command_failed:"runtime",unknown_error:"runtime"});(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]="c863f07f-428b-5b7f-a5f7-23e7f5fa749a")}catch{}})();var _=class extends Error{exitCode;code;context;constructor(t,n,o={}){super(t),this.name="PmCliError",this.exitCode=n,this.context=o,this.code=o.code}};(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]="cde15ba9-270e-5e05-baba-7dafbe1bd5da")}catch{}})();var x=[...[["fetch","get"],["read","get"],["show","get"],["view","get"],["comment","comments"],["note","notes"],["learning","learnings"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:[t],lifecycle:"permanent",hidden:!1,registration:"bootstrap",owner:"pm-pbyu"})),{alias:"list-all",canonical:"list",canonical_argv:["list","--all"],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-pfqi"},...[["list-draft","draft"],["list-open","open"],["list-in-progress","in_progress"],["list-blocked","blocked"],["list-closed","closed"],["list-canceled","canceled"]].map(([e,t])=>({alias:e,canonical:"list",canonical_argv:["list","--status",t],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-pfqi"}))],oo=Object.fromEntries(x.filter(e=>e.registration==="bootstrap").map(e=>[e.alias,e.canonical]));function ro(e){let t=e.trim().toLowerCase();return x.find(n=>n.alias===t)}function so(e){return`Deprecated command \`${e.alias}\`; use \`pm ${e.canonical_argv.join(" ")}\`.`}(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]="d05ce92b-bee8-5cce-afc2-8c7901306a30")}catch{}})();var Ze=[...j],et=[...ce],tt=[...se],co=[...ie],lo=[...ae],nt=[...ue],R=["init","config","extension","package","packages","install","upgrade","create","item","copy","focus","list","list-all","list-draft","list-open","list-in-progress","list-blocked","list-closed","list-canceled","aggregate","context","ctx","get","graph","search","duplicates","eval","next","history","events","history-redact","history-repair","history-compact","history-author-acknowledge","merge","schema","profile","activity","restore","update","update-many","close","close-many","delete","append","comments","notes","learnings","files","docs","deps","plan","test","test-all","telemetry","stats","health","validate","assurance","gc","workspace","contracts","claim","release","start-task","pause-task","close-task","meet","event","remind","help"],fo=["ancestors","descendants","predecessors","successors","paths","impact","analyze","audit","communities","redundancy","dominators","slack","centrality","articulation","plan","index"],ot=["init","install","uninstall","explore","manage","describe","reload","doctor","catalog","adopt","adopt-all","activate","deactivate"],fe={help:"Commander help rendering has no SDK operation result.",item:"The item namespace only groups lifecycle subcommands already exposed as actions.",packages:"The plural package alias only renders package-oriented help."},I=Object.freeze(R.flatMap(e=>e in fe?[]:e==="extension"||e==="package"?[...ot.map(t=>`${e}-${t}`),e]:[e])),rt=Object.freeze(x.filter(e=>e.lifecycle==="deprecated"&&e.registration==="commander"&&I.includes(e.alias)).map(e=>e.alias)),_o=Object.freeze(I.filter(e=>!rt.includes(e)));function po(e=R,t=I,n=fe){let o=new Set(t),r=new Set(e);return{missing_cli_actions:e.filter(s=>!o.has(s)&&n[s]===void 0),waived_cli_actions:e.filter(s=>!o.has(s)&&n[s]!==void 0),stale_waivers:Object.keys(n).filter(s=>!r.has(s)||o.has(s))}}function mo(e){return I.includes(e)}function go(e){return Ze.includes(e)}function yo(e){return et.includes(e)}function ho(e){return tt.includes(e)}function bo(e){return nt.includes(e)}(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]="0c69ff43-7bbc-5128-9533-bbf15365126b")}catch{}})();var st=new Set(["applied_bound","completeness","budget_retention_policy","continuation_contract","continuation_kind","continuation_path","filters","omission_receipt","output_budget_truncation","projection","read_output","read_session","row_contract","sorting"]);function N(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function it(e,t){let n=e;for(let o of t.split(".")){if(!N(n))return;n=n[o]}return n}function F(e,t,n){let o=t.split("."),r={...e},s=e,a=r;for(let i of o.slice(0,-1)){let u=s[i],c={...u};a[i]=c,s=u,a=c}return a[o.at(-1)]=n,r}function _e(e,t,n){let o=g(e).find(s=>s.path===t);if(!o)return e;let r=Array.isArray(o.value)?o.value.slice(n):Object.fromEntries(Object.entries(o.value).slice(n));return F(e,t,r)}function B(e){let t=e.row_contract;return N(t)&&Array.isArray(t.row_keys)?t.row_keys.filter(n=>typeof n=="string"&&n.trim().length>0):Object.entries(e).filter(([,n])=>Array.isArray(n)).map(([n])=>n)}function g(e){return B(e).flatMap(t=>{let n=it(e,t);return Array.isArray(n)||N(n)?[{path:t,value:n}]:[]})}function pe(e){let t=g(e),n=new Set(t.map(r=>r.path)),o=(r,s)=>{if(Array.isArray(r)){n.has(s)||t.push({path:s,value:r}),r.forEach((a,i)=>o(a,`${s}.${i}`));return}if(N(r))for(let[a,i]of Object.entries(r))s.length===0&&st.has(a)||o(i,s.length===0?a:`${s}.${a}`)};return o(e,""),t}function C(e){return g(e).reduce((t,n)=>t+(Array.isArray(n.value)?n.value.length:Object.keys(n.value).length),0)}function S(e,t){let n=e;for(let o of g(n)){let r=Array.isArray(o.value)?o.value.map((s,a)=>t(s,o.path,a)):Object.fromEntries(Object.entries(o.value).map(([s,a],i)=>[s,t(a,o.path,i)]));n=F(n,o.path,r)}return n}function me(e,t){let n=e,o=!1;for(let r of g(n)){let s=Array.isArray(r.value)?r.value:Object.entries(r.value);if(s.length<=t)continue;o=!0;let a=Array.isArray(r.value)?s.slice(0,t):Object.fromEntries(s.slice(0,t));n=F(n,r.path,a)}return{result:n,truncated: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]="642f6dec-c0b2-5377-a401-dfa4f8ef6a2a")}catch{}})();var G=256,z=1e4,at=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$/u,ut=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u,ct=new Set(["version","id","token_budget","spent_tokens","seen_item_ids"]),dt=[{valid:e=>e.version===1,reason:"version must equal 1."},{valid:e=>typeof e.id=="string"&&at.test(e.id),reason:"id must be 1-64 portable identifier characters."},{valid:e=>Number.isSafeInteger(e.token_budget)&&e.token_budget>=G,reason:`token_budget must be a safe integer of at least ${G}.`},{valid:e=>Number.isSafeInteger(e.spent_tokens)&&e.spent_tokens>=0&&e.spent_tokens<=e.token_budget,reason:"spent_tokens must be a non-negative safe integer no larger than token_budget."},{valid:e=>Array.isArray(e.seen_item_ids)&&e.seen_item_ids.length<=z&&e.seen_item_ids.every(t=>typeof t=="string"&&ut.test(t)),reason:`seen_item_ids must contain at most ${z} portable item identifiers.`}];function D(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function v(e){throw new _(`--output-session ${e}`,p.USAGE,{code:"invalid_read_output_session",field:"outputSession"})}function M(e){if(e===void 0)return;let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch{v("must be a valid JSON object.")}D(t)||v("must be a JSON object.");let n=Object.keys(t).filter(s=>!ct.has(s));n.length>0&&v(`contains unknown field "${n.sort()[0]}".`);let o=dt.find(s=>!s.valid(t));o!==void 0&&v(o.reason);let r=[...new Set(t.seen_item_ids)].sort();return{version:1,id:t.id,token_budget:t.token_budget,spent_tokens:t.spent_tokens,seen_item_ids:r}}function ge(e){if(D(e))return typeof e.id=="string"?e.id:typeof e.item_id=="string"?e.item_id:D(e.item)&&typeof e.item.id=="string"?e.item.id:void 0}function lt(e){let t=new Set,n=0;for(let o of g(e)){let r=Array.isArray(o.value)?o.value:Object.values(o.value);for(let s of r){if(!D(s))continue;if(typeof s.context_ref=="string"){n+=1;continue}let a=ge(s);a!==void 0&&t.add(a)}}return{deliveredIds:t,suppressedRepeatCount:n}}function ye(e,t){let n=new Set(t.seen_item_ids);return S(e,o=>{let r=ge(o);return r!==void 0&&n.has(r)?{id:r,context_ref:`session:${t.id}:${r}`}:o})}function $(e,t){let{deliveredIds:n,suppressedRepeatCount:o}=lt(e),r=new Set(t.seen_item_ids),s=[...n].filter(m=>!r.has(m)).sort(),a=s.slice(0,z-t.seen_item_ids.length),i=[...t.seen_item_ids,...a].sort(),u=s.length-a.length,c={contract_version:1,id:t.id,measurement_scope:"complete_read_envelope",estimator:"ceil(utf8_bytes / 4)",token_budget:t.token_budget,spent_before_tokens:t.spent_tokens,spent_this_call_tokens:0,charged_this_call_tokens:0,spent_total_tokens:t.spent_tokens,remaining_tokens:t.token_budget-t.spent_tokens,exhausted:!1,seen_before_count:t.seen_item_ids.length,new_item_count:n.size,...u===0?{}:{seen_item_overflow_count:u},suppressed_repeat_count:o,reference_format:"session:<session-id>:<item-id>",restore_reference_with:"pm get <item-id> --brief",next_state:{version:1,id:t.id,token_budget:t.token_budget,spent_tokens:t.spent_tokens,seen_item_ids:i}},f={...e,read_session:c},d=m=>{c.spent_this_call_tokens=m,c.charged_this_call_tokens=Math.min(t.token_budget-t.spent_tokens,m),c.spent_total_tokens=Math.min(t.token_budget,t.spent_tokens+c.charged_this_call_tokens),c.remaining_tokens=Math.max(0,t.token_budget-c.spent_total_tokens),c.exhausted=c.remaining_tokens<G,c.next_state.spent_tokens=c.spent_total_tokens},y=0,l=0;for(let m=0;m<8;m+=1){d(y);let k=Math.ceil(Buffer.byteLength(JSON.stringify(f),"utf8")/4);if(k===y)return f;l=Math.max(l,k),y=k}return d(l),f}function he(e){return Math.max(0,e.token_budget-e.spent_tokens)}(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]="23b3a820-f205-506b-9507-dbd60087f62e")}catch{}})();var ft=["full","compact","brief","summary","counts"],xo=["mutation","read","discovery","governance"],_t=new Set(["append","claim","close","close-many","close-task","comments","config","copy","create","delete","docs","event","files","focus","history-author-acknowledge","history-compact","history-redact","history-repair","init","item","learnings","meet","notes","pause-task","release","remind","restore","schema","start-task","update","update-many"]),pt=new Set(["contracts","extension","help","install","package","packages","profile","upgrade"]),mt=new Set(["gc","health","merge","stats","telemetry","test","test-all","validate"]),gt={mutation:2e3,read:4e3,discovery:3e3,governance:6e3},yt=3,ht=2;function bt(e){let[t=""]=e.trim().split(/\s+/u);return _t.has(t)?"mutation":pt.has(t)?"discovery":mt.has(t)?"governance":"read"}function be(e,t=bt(e)){let n=e.trim().replace(/\s+/gu," ");if(n.length===0)throw new TypeError("command must be a non-empty command path");let o=gt[t];return Et({command:n,budget_class:t,default_max_estimated_tokens:o,default_max_estimated_tokens_by_format:{toon:o,json:Math.ceil(o*yt/ht)},degradation_ladder:ft,allows_unbounded_opt_out:!0,token_estimate:"ceil(utf8_bytes / 4)"})}function Et(e){if(!Number.isSafeInteger(e.default_max_estimated_tokens)||e.default_max_estimated_tokens<=0)throw new RangeError("default_max_estimated_tokens must be a positive safe integer");for(let[t,n]of Object.entries(e.default_max_estimated_tokens_by_format))if(!Number.isSafeInteger(n)||n<=0)throw new RangeError(`default_max_estimated_tokens_by_format.${t} must be a positive safe integer`);return e}var Ot=R.map(e=>be(e)),At=new Map(Ot.map(e=>[e.command,e]));function Ee(e,t={}){let n=e.trim().replace(/\s+/gu," "),[o]=n.split(" "),r=At.get(o);return r?{...r,command:n}:t.generateFallback?be(n):null}function Ro(e){return Math.ceil(Math.max(0,e)/4)}import{createHash as mn}from"node:crypto";(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]="737ac274-c165-5d1a-8b8e-cb5d57a81c46")}catch{}})();var St=8,wt=64;function X(e){return Math.ceil(Buffer.byteLength(JSON.stringify(e),"utf8")/4)}function Tt(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function K(e,t){return typeof e=="string"?e.length<=240?e:(t.compacted=!0,`${e.slice(0,240)}\u2026`):Array.isArray(e)?e.map(n=>K(n,t)):Tt(e)?Object.fromEntries(Object.entries(e).map(([n,o])=>[n,K(o,t)])):e}function b(e,t){let n=t.estimated_tokens;for(let o=0;o<St;o+=1){t.estimated_tokens=n;let r=X(e);if(r===n)return;n=r}t.estimated_tokens=n}function kt(e,t,n,o){for(let r=0;r<wt;r+=1){if(b(e,t),t.estimated_tokens<=n)return;let s=pe(e).filter(i=>(Array.isArray(i.value)?i.value.length:Object.keys(i.value).length)>Math.max(1,o.get(i.path)??0)).map(i=>({collection:i,length:Array.isArray(i.value)?i.value.length:Object.keys(i.value).length})).sort((i,u)=>u.length-i.length||i.collection.path.localeCompare(u.collection.path))[0]?.collection;if(!s)return;let a=Math.max(1,o.get(s.path)??0);if(Array.isArray(s.value))s.value.splice(-Math.min(s.value.length-a,Math.max(1,Math.ceil(s.value.length/2))));else{let i=Object.keys(s.value);for(let u of i.slice(-Math.min(i.length-a,Math.max(1,Math.ceil(i.length/2)))))delete s.value[u]}t.rows_compacted=!0,t.compacted_row_paths=[...new Set([...t.compacted_row_paths??[],s.path])].sort((i,u)=>i.localeCompare(u)),e.has_more=!0,e.truncated=!0,typeof e.count=="number"&&(e.count=C(e))}}function Oe(e,t,n,o=new Map){let r={compacted:!1},s=K(e,r);return t.strings_compacted=r.compacted,s.read_output=t,kt(s,t,n,o),b(s,t),s}import{createHash as Pt}from"node:crypto";import xt from"node:crypto";(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]="83232698-197a-5aef-be7c-aa37f3c56822")}catch{}})();function Rt(e){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return e.toString();if(e===void 0)return"undefined";if(typeof e=="symbol")return e.toString();if(typeof e=="function")return`[function:${e.name||"anonymous"}]`}function It(e){let t=Object.keys(e).sort(),n={};for(let o of t){let r=e[o];r!==void 0&&(n[o]=U(r))}return n}function U(e){let t=Rt(e);if(t!==void 0)return t;if(Array.isArray(e))return e.map(o=>U(o));if(e instanceof Date)return e.toISOString();let n=e;if(typeof n.toJSON=="function"){let o=n.toJSON();if(o!==e)return U(o)}return It(e)}function Ae(e){return JSON.stringify(U(e))}function Se(e,t,n,o){for(let r=0;r<t.length;r+=1)if(!n.has(r)&&o(e,t[r]))return n.add(r),!0;return!1}function Nt(e,t){if(e instanceof RegExp||t instanceof RegExp)return e instanceof RegExp&&t instanceof RegExp&&e.toString()===t.toString()}function Ct(e,t){if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}function vt(e,t){if(!(e instanceof Set||t instanceof Set))return;if(!(e instanceof Set&&t instanceof Set)||e.size!==t.size)return!1;let n=[...t],o=new Set;for(let r of e)if(!Se(r,n,o,w))return!1;return!0}function Dt(e,t){if(!(e instanceof Map||t instanceof Map))return;if(!(e instanceof Map&&t instanceof Map)||e.size!==t.size)return!1;let n=[...t.entries()],o=new Set;for(let[r,s]of e.entries())if(!Se([r,s],n,o,([i,u],[c,f])=>w(i,c)&&w(u,f)))return!1;return!0}function Mt(e,t){if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((n,o)=>w(n,t[o]))}function Ut(e,t){let n=Object.keys(e).sort((r,s)=>r.localeCompare(s)),o=Object.keys(t).sort((r,s)=>r.localeCompare(s));if(n.length!==o.length)return!1;for(let r=0;r<n.length;r+=1){let s=n[r];if(s!==o[r]||!w(e[s],t[s]))return!1}return!0}var Lt=[Nt,Ct,vt,Dt,Mt];function w(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;for(let n of Lt){let o=n(e,t);if(o!==void 0)return o}return Ut(e,t)}function Do(e){return xt.createHash("sha256").update(e,"utf8").digest("hex")}function Mo(e,t){let n={};for(let r of t){let s=e[r];s!==void 0&&(n[r]=s)}let o=Object.keys(e).filter(r=>!t.includes(r)).sort((r,s)=>r.localeCompare(s));for(let r of o){let s=e[r];s!==void 0&&(n[r]=s)}return 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]="d3329fac-693d-566c-a30a-43f8fb37938f")}catch{}})();var Y=1,Te=4096,jt=/^[A-Za-z0-9_-]+$/;function we(e){return e.replace(/^--/u,"").replace(/[-_]([a-z0-9])/gu,(t,n)=>n.toUpperCase())}function Fo(e,t){let n=new Set;for(let o of t)if(o.cursor_semantics==="presentation"){n.add(we(o.flag));for(let r of o.aliases??[])n.add(we(r))}return Object.fromEntries(Object.entries(e).filter(([o])=>!n.has(o)))}function Bo(e,t){return Pt("sha256").update(e).update("\0").update(Ae(t)).digest("hex").slice(0,24)}function q(e,t,n,o){return Buffer.from(JSON.stringify({version:Y,fingerprint:e,after_id:t,...n===void 0?{}:{after_index:n},...o===void 0?{}:{snapshot:o}})).toString("base64url")}function E(e){return new _(e,p.USAGE,{code:"invalid_query_cursor",nextSteps:["Repeat the original query without --after to obtain a fresh cursor."]})}function Vt(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e;return t.version===Y&&typeof t.fingerprint=="string"&&typeof t.after_id=="string"&&t.after_id.length>0&&(t.after_index===void 0||Number.isSafeInteger(t.after_index)&&t.after_index>=0)&&(t.snapshot===void 0||typeof t.snapshot=="string"&&t.snapshot.length>0)}function W(e){if(typeof e!="string")throw E("Query cursor is malformed.");let t=e.trim();if(t.length===0||t.length>Te||!jt.test(t))throw E("Query cursor is malformed.");let n;try{n=JSON.parse(Buffer.from(t,"base64url").toString("utf8"))}catch{throw E("Query cursor is malformed.")}if(!Vt(n))throw E("Query cursor version or payload is unsupported.");return n}function Q(e,t){let n=W(e);if(n.fingerprint!==t)throw E(`Query cursor does not match the current filters, sort, or query (${n.fingerprint} != ${t}).`);return{after_id:n.after_id,...n.after_index===void 0?{}:{after_index:n.after_index},...n.snapshot===void 0?{}:{snapshot:n.snapshot}}}function Go(e,t){return Q(e,t).after_id}function Ft(e,t,n,o){if(t===void 0)return 0;let r=Q(t,n),s=e.findIndex(a=>o(a)===r.after_id);if(s<0){if(r.after_index!==void 0)return Math.min(r.after_index,e.length);throw E(`Query cursor item ${r.after_id} is no longer present in this result set.`)}return s+1}function zo(e,t){if(t.cursor!==void 0&&Q(t.cursor,t.fingerprint).snapshot!==t.snapshot)throw E("Query cursor does not match the requested snapshot.");let n=Ft(e,t.cursor,t.fingerprint,t.readId),o=e.slice(n,n+t.limit),r=o.length>0&&n+o.length<e.length,s=o.at(-1);return{rows:o,has_more:r,...r&&s!==void 0?{next_cursor:q(t.fingerprint,t.readId(s),n+o.length-1,t.snapshot)}:{}}}var $o=Object.freeze({version:Y,max_length:Te});(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]="db1d54b0-ff27-51f5-a179-14556ced24eb")}catch{}})();var O=["include","amount","cost","encoding"],De=["list","context","search","get","next","health","deps","graph","history","activity","validate","events","contracts","comments","notes","files","docs","stats","aggregate","package-catalog","package-manage","comments-audit","assurance"],Me=["canonical","legacy","intent","default"],ee={include:"--output-include",amount:"--output-limit",cost:"--output-budget",encoding:"--output-format"},er=Object.freeze(O.map(e=>ee[e])),tr=Object.freeze(["--output-session","--output-cursor","--output-row-contract"]),Ue={list:{include:["--brief","--compact","--fields","--full"],amount:["--after","--limit","--no-truncate"],cost:["--token-budget"],encoding:["--format","--stream"]},context:{include:["--fields","--section"],amount:["--after","--depth","--limit"],cost:["--token-budget"],encoding:["--format"]},search:{include:["--compact","--fields","--full"],amount:["--after","--limit"],cost:["--token-budget"],encoding:["--format"]},get:{include:["--fields","--full"],amount:["--depth"],cost:["--token-budget"],encoding:["--format"]},next:{amount:["--blocked-limit","--limit"],cost:["--token-budget"],encoding:["--format"]},health:{include:["--brief","--check-only","--full","--summary"]},deps:{include:["--collapse","--full","--summary"],amount:["--edge-limit","--max-depth","--node-limit"],cost:["--token-budget"],encoding:["--format"]},graph:{include:["--full","--summary"],amount:["--after","--limit","--max-depth","--max-paths"]},history:{include:["--compact","--full"],amount:["--limit"],encoding:["--format"]},activity:{include:["--compact","--full"],amount:["--limit","--unbounded"],encoding:["--stream"]},validate:{include:["--counts","--full"]},events:{include:["--full"],amount:["--limit"],encoding:["--follow"]},contracts:{include:["--full","--summary"]},comments:{amount:["--limit"]},notes:{amount:["--limit"]},files:{amount:["--limit","--no-truncate","--offset"]},docs:{},stats:{},aggregate:{},"package-catalog":{},"package-manage":{},"comments-audit":{},assurance:{}},Le=new Set(["--collapse","--fields","--section"]),te=Object.freeze({"--after":"--after retains cursor-position semantics; use --output-limit <n> separately to bound returned rows.","--check-only":"--check-only retains health side-effect semantics; --output-include does not suppress vector refresh.","--collapse":"--collapse retains dependency grouping semantics; --output-include does not replace it.","--depth":"--depth retains traversal or detail-depth semantics; --output-limit does not replace it.","--follow":"--follow retains event-tail semantics; --output-format does not enable following.","--max-depth":"--max-depth retains graph traversal-depth semantics; --output-limit does not replace it.","--max-paths":"--max-paths retains graph path-search semantics; use --output-limit separately to bound returned rows.","--no-truncate":"--no-truncate is a compatibility alias; prefer --output-limit unbounded.","--offset":"--offset retains positional pagination semantics; use --output-limit separately to bound returned rows.","--stream":"--stream retains command streaming semantics; --output-format selects only static result encoding.","--unbounded":"--unbounded is a compatibility alias; prefer --output-limit unbounded."});function ne(e){return e.slice(2).replaceAll("-","_")}function Bt(e,t){let n=te[e];if(n!==void 0)return n;let o=t==="include"?Le.has(e)?"<csv>":ne(e):t==="amount"?"<n>":t==="cost"?"<tokens>":"<toon|json>";return`${e} is a compatibility alias; prefer ${ee[t]} ${o}.`}function Gt(e){let t=Ue[e],n=Object.freeze(Object.fromEntries(O.map(o=>[o,Object.freeze({dimension:o,canonical_option:ee[o],applicable:!0,inapplicable_reason:null,legacy_aliases:Object.freeze((t[o]??[]).map(r=>Object.freeze({flag:r,semantics:te[r]===void 0?"replacement":"behavior_preserving",migration_hint:Bt(r,o),visibility:"hidden_alias"})))})])));return Object.freeze({command:e,dimensions:n,precedence:Me,budget_retention_policy:e==="assurance"?"verdict_priority":"ordered_prefix"})}var zt=Object.freeze(De.map(Gt)),$t=new Map(zt.map(e=>[e.command,e]));function T(e,t={}){let n=e.trim().toLowerCase().replaceAll(/\s+/gu," "),r=n==="package catalog"||n==="packages catalog"||n==="package-catalog"||(n==="package"||n==="packages"||n==="extension")&&(t.catalog===!0||t.target==="catalog"||t.action==="catalog")?"package-catalog":n==="package manage"||n==="package-manage"?"package-manage":n.split(" ")[0],s=r.startsWith("list-")?"list":r==="ctx"?"context":r;return De.includes(s)?s:void 0}var Kt=["outputInclude","output_include","outputLimit","output_limit","outputBudget","output_budget","outputFormat","output_format","outputSession","output_session","outputCursor","output_cursor","outputRowContract","output_row_contract"],Xt={comments:["add","body","stdin","file","edit","delete"],notes:["add","addJson","stdin","file","edit","delete"],files:["add","addGlob","remove","migrate","apply","note"],docs:["add","addGlob","remove","migrate","note"],"package-catalog":["activate","adopt","adoptAll","deactivate","doctor","init","install","manage","migrate","reload","scaffold","uninstall"]};function Yt(e){return Kt.some(t=>e[t]!==void 0)}var qt=[{keys:["outputInclude","output_include"],valid:e=>L(e)!==void 0,message:"--output-include requires at least one comma-separated field or section."},{keys:["outputLimit","output_limit"],valid:e=>e==="unbounded"||A(e)!==void 0,message:"--output-limit must be a positive integer or unbounded."},{keys:["outputBudget","output_budget"],valid:e=>e==="unbounded"||A(e)!==void 0,message:"--output-budget must be a positive integer or unbounded."},{keys:["outputFormat","output_format"],valid:e=>e==="toon"||e==="json",message:"--output-format must be toon or json."},{keys:["outputSession","output_session"],valid:e=>(M(e),!0),message:"--output-session must be a valid session-state object."},{keys:["outputCursor","output_cursor"],valid:e=>typeof e=="string"&&e.trim().length>0,message:"--output-cursor requires a non-empty continuation cursor."}];function nr(e,t){if(!Yt(t))return;let n=T(e,t);if(!n)throw new _(`Universal output controls apply only to read commands; ${e||"this command"} is not a read surface.`,p.USAGE);if((Xt[n]??[]).some(o=>t[o]!==void 0&&t[o]!==!1))throw new _(`Universal output controls cannot be combined with a ${n} mutation.`,p.USAGE);for(let o of qt){let r=o.keys.map(s=>t[s]).find(s=>s!==void 0);if(r!==void 0&&!o.valid(r))throw new _(o.message,p.USAGE)}}function Pe(e){let t=T(e);return t?new Map((Ue[t].include??[]).filter(n=>!Le.has(n)&&te[n]===void 0).map(n=>[ne(n),je(n)])):new Map}function Wt(e,t,n){let o=L(t)??[],r=Pe(e),s=[],a=[];for(let i of o){let u=r.get(i);if(u===void 0){s.push(i);continue}n[u]=!0,a.push(i)}return{selectors:s,modes:a}}function or(e,t){let n=t.outputInclude??t.output_include;if(n===void 0)return;let{selectors:o,modes:r}=Wt(e,n,t);if(r.length===0)return;let s=o.length>0?o.join(","):void 0;t.outputInclude=s,Object.hasOwn(t,"output_include")&&(t.output_include=s)}function je(e){return e.slice(2).replace(/-([a-z])/gu,(t,n)=>n.toUpperCase())}function Qt(e,t){let n=je(t);if(Object.hasOwn(e,n))return e[n];let o=t.slice(2).replaceAll("-","_");if(Object.hasOwn(e,o))return e[o];if(t==="--no-truncate"&&e.truncate===!1)return!0}function Ht(e){return e!==void 0&&e!==!1&&e!==null}function L(e){let n=(Array.isArray(e)?e:[e]).flatMap(o=>typeof o=="string"?o.split(","):[]).map(o=>o.trim()).filter(Boolean);return n.length>0?[...new Set(n)]:void 0}function A(e){let t=typeof e=="number"?e:typeof e=="string"&&/^\d+$/u.test(e.trim())?Number(e):Number.NaN;return Number.isSafeInteger(t)&&t>0?t:void 0}function Jt(e,t,n){for(let o of e.legacy_aliases){let r=Qt(t,o.flag),s={value:r,flag:o.flag};if(Ht(r)&&n(s))return s}}function ke(e,t){let n=L(e);if(n)return{source:"canonical",value:n};if(t)return{source:"legacy",value:L(t.value)??[ne(t.flag)]}}function xe(e,t){if(e==="unbounded")return{source:"canonical",value:"unbounded"};let n=A(e);if(n!==void 0)return{source:"canonical",value:n};if(!t)return;if(t.flag==="--no-truncate"||t.flag==="--unbounded")return{source:"legacy",value:"unbounded"};let o=A(t.value);return o===void 0?void 0:{source:"legacy",value:o}}function Re(e,t){if(e==="unbounded")return{source:"canonical",value:"unbounded"};let n=A(e);if(n!==void 0)return{source:"canonical",value:n};if(!t)return;let o=A(t.value);return o===void 0?void 0:{source:"legacy",value:o}}function Ie(e,t){if(e==="json"||e==="toon")return{source:"canonical",value:e};if(t)return t.flag==="--stream"||t.flag==="--follow"?{source:"legacy",value:"stream"}:t.value==="json"||t.value==="toon"?{source:"legacy",value:t.value}:void 0}function Ve(e,t){let n=T(e,t);if(!n)return;let o=$t.get(n),r={include:l=>ke(void 0,l),amount:l=>xe(void 0,l),cost:l=>Re(void 0,l),encoding:l=>Ie(void 0,l)},s=Object.fromEntries(O.map(l=>[l,Jt(o.dimensions[l],t,m=>r[l](m)!==void 0)])),a=O.flatMap(l=>{let m=s[l];return m?[m.flag]:[]}),i=O.flatMap(l=>{let m=s[l];return m?[o.dimensions[l].legacy_aliases.find(Be=>Be.flag===m.flag).migration_hint]:[]}),u=Ie(t.outputFormat??t.output_format,s.encoding),c=Re(t.outputBudget??t.output_budget,s.cost),f=e.trim().toLowerCase().replaceAll(/\s+/gu," ").split(" ")[0]==="list-all"||s.amount?.flag==="--no-truncate"||s.include?.flag==="--full",d=Ee(e,{generateFallback:!0}),y=u?.value==="json"||t.resolvedOutputFormat==="json"?"json":"toon";return{command:n,include:ke(t.outputInclude??t.output_include,s.include),amount:xe(t.outputLimit??t.output_limit,s.amount),cost:c??(f?{source:"intent",value:"unbounded"}:{source:"default",value:d.default_max_estimated_tokens_by_format[y]}),encoding:u,legacy_aliases_used:a,migration_hints:i,precedence:Me}}function h(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var oe=new Set(["applied_bound","applied_limit","completeness","continuation_kind","continuation_path","continuation_contract","count","filters","has_more","next_cursor","now","omission_receipt","projection","budget_retention_policy","row_contract","sorting","total","truncated"]),Zt=["collection_counts","notes_count","tests_count"];function Fe(e,t){let n=new Set(t.map(o=>o.split(".")[0]));return Object.fromEntries(Object.entries(e).filter(([o])=>n.has(o)))}function en(e){let t=h(e.item)?e.item:{},n=[...new Set([...Object.keys(t),...Zt.filter(r=>Object.hasOwn(t,r))])].sort((r,s)=>r.localeCompare(s)),o=Object.keys(e).filter(r=>r!=="item"&&r!=="read_output"&&!oe.has(r)).sort((r,s)=>r.localeCompare(s));return{item:t,itemFields:n,sections:o,valid:[...n,"item",...n.map(r=>`item.${r}`),...o]}}function tn(e,t){let n=en(e),o=t.filter(d=>!n.valid.includes(d));if(o.length>0)throw new _(`Unknown --output-include selector(s) for get: ${o.join(", ")}. Valid selectors: ${n.valid.join(", ")}.`,p.USAGE);let r=t.includes("item"),s=t.flatMap(d=>d.startsWith("item.")?[d.slice(5)]:n.itemFields.includes(d)?[d]:[]).filter((d,y,l)=>l.indexOf(d)===y);if(r&&s.length>0)throw new _("--output-include cannot mix a full item with projected item fields; use item or item.<field>, not both.",p.USAGE);let a=new Set(t.filter(d=>n.sections.includes(d))),i=Object.fromEntries(Object.entries(e).filter(([d])=>oe.has(d)||a.has(d)));r?i.item=n.item:s.length>0&&(i.item=Fe(n.item,s));let u=[...r?[]:s.length>0?n.itemFields.filter(d=>!s.includes(d)).map(d=>({name:`item.${d}`,restore_with:`--output-include item.${d}`})):[{name:"item",restore_with:"--output-include item"}],...n.sections.filter(d=>!a.has(d)).map(d=>({name:d,restore_with:`--output-include ${d}`}))],f=[...h(i.omission_receipt)&&Array.isArray(i.omission_receipt.omitted_field_groups)?i.omission_receipt.omitted_field_groups:[],...u];return i.omission_receipt={has_omissions:f.length>0,omitted_field_group_count:f.length,omitted_field_groups:f},i}function Ne(e){let t=0;return S({...e},n=>(h(n)&&Object.keys(n).length>0&&(t+=1),n)),t}function nn(e,t,n,o){if(Ne(t)===0||Ne(n)>0)return;let r=[...Pe(e).keys()],s=r.length>0?` Declared ${e} projection modes: ${r.join(", ")}.`:` The ${e} surface declares no projection modes; name row fields instead.`;throw new _(`Unknown --output-include selector(s) for ${e}: ${o.join(", ")}. No selector matched any returned row field.${s}`,p.USAGE)}function on(e,t,n){if(e==="get")return tn(t,n);let o=B(t),r=n.flatMap(a=>o.flatMap(i=>a.startsWith(`${i}.`)?[a.slice(i.length+1)]:[])),s=n.some(a=>Object.hasOwn(t,a.split(".")[0])&&!o.some(i=>a.startsWith(`${i}.`)));if(o.length>0&&(!s||r.length>0)){let a={...t},i=r.length>0?r:n,u=S(a,c=>h(c)?Fe(c,i):c);return nn(e,t,u,i),u}return Object.fromEntries(Object.entries(t).filter(([a])=>n.some(i=>i.split(".")[0]===a)||oe.has(a)))}function rn(e,t){if(t==="unbounded")return e;let{result:n,truncated:o}=me(e,t);return o&&(n.has_more=!0,n.truncated=!0,typeof n.count=="number"&&(n.count=C(n)),n.applied_bound={kind:"output_limit",source:"explicit",value:t}),n}function sn(e){return O.filter(t=>e[t]!==void 0&&e[t]?.source!=="default")}function P(e,t,n){let o=$(e,t);for(let r=0;r<8;r+=1){let s=n.estimated_tokens,a=o.read_session.spent_this_call_tokens;b(o,n),o=$(o,t);let i=o.read_session.spent_this_call_tokens;if(n.estimated_tokens===s&&i===a)return o}return o}function rr(e,t){if(!h(e.read_output))return e;let n=e.read_output,o=M(t.outputSession??t.output_session);return o===void 0?(b(e,n),e):P(e,o,n)}function an(e,t,n,o){let r={...e};return t.include?.source==="canonical"&&(r=on(t.command,r,t.include.value)),t.command==="assurance"&&(r=Ce(r)),r=ve(r,t.command,o),t.amount?.source==="canonical"&&(r=rn(r,t.amount.value)),n===void 0?r:ye(r,n)}function un(e,t){return[...e.cost!==void 0&&e.cost.value!=="unbounded"&&(e.cost.source==="canonical"||e.cost.source==="default")?[{source:e.cost.source,tokens:e.cost.value}]:[],...t===void 0?[]:[{source:"session",tokens:he(t)}]].sort((o,r)=>o.tokens-r.tokens)[0]}function cn(e,t,n,o,r){let s={contract_version:1,command:e.command,requested_dimensions:t,...o.source==="default"?{budget_source:o.source,budget_tokens:o.tokens}:{},precedence:e.precedence,legacy_aliases_used:[],migration_hints:[],estimated_tokens:0,within_budget:!1,strings_compacted:!1,rows_compacted:!1,result_omitted:!0,...n===void 0?{omitted_result_estimated_tokens:r}:{}},a={output_budget_exceeded:{omitted_result:!0,reason:"requested_budget_infeasible",restore_with:"Unbounded",recovery:{outputBudget:"unbounded"}},read_output:s},i=n===void 0?a:P(a,n,s);if(n===void 0&&b(i,s),n!==void 0&&s.estimated_tokens>o.tokens)throw new _("The remaining output-session budget cannot fit its mandatory receipts; start a new session with a larger token_budget.",p.USAGE);return i}function dn(e,t,n,o){if(n!==void 0)return!1;let r=t.filter(s=>e[s]?.source==="canonical").length;return e.cost?.value==="unbounded"?r===(e.cost.source==="canonical"?1:0):e.cost?.source==="legacy"&&r===0?!0:r===0&&(e.cost===void 0||X(o)<=e.cost.value)}function ln(e,t,n,o,r,s){if(!n.rows_compacted)return;let a=t.amount?.value==="unbounded"?["amount"]:[],i=new Map(g(e).map(f=>[f.path,Array.isArray(f.value)?f.value.length:Object.keys(f.value).length])),u=[...s.entries()].flatMap(([f,d])=>{let y=i.get(f);if(y>=d.rows)return[];let l=d.baseOffset+y;return[{path:f,cursor:J({command:t.command,path:f,offset:l,total_rows:d.totalRows,fingerprint:d.fingerprint}),retained_rows:y,remaining_rows:d.totalRows-l,total_rows:d.totalRows}]}),c=u[0];c&&typeof e.next_cursor!="string"&&(e.next_cursor=c.cursor),e.continuation_kind=r?"producer_cursor":c?"output_cursor":"none",e.output_budget_truncation={reason:"output_budget_reached",budget_source:o.source,budget_tokens:o.tokens,overridden_dimensions:a,compacted_row_paths:n.compacted_row_paths,continuation_cursor_rebased:r,continuation_available:u.length>0,recovery_budget_multiplier:1,continuations:u,restore_with:c?"Use recovery binding.":"Increase --output-budget because no declared row collection can be continued.",recovery:c?{cursor:c.cursor,cli:"--output-cursor",sdk:"outputCursor",mcp:"outputCursor"}:{cli:"--output-budget 1200",sdk:{outputBudget:1200},mcp:{outputBudget:1200}}}}function fn(e,t,n,o){if(typeof n!="string"||!Array.isArray(e.items))return!1;let r=e.items.length;if(r===0||r>=t)return!1;let s;try{s=W(n)}catch{return!1}let a=s.after_index;if(a===void 0)return!1;let i=e.items.at(-1);if(Object.prototype.toString.call(i)!=="[object Object]")return!1;let u=Reflect.get(i,"id");if(typeof u!="string"||u.length===0)return!1;let c=o?a-(t-r):a+r;return c<0?!1:(e.next_cursor=q(s.fingerprint,u,c,s.snapshot),typeof e.applied_limit=="number"&&(e.applied_limit=r),!0)}function _n(e,t,n){let o=new Map(g(e).map(s=>{let a=Array.isArray(s.value)?s.value.length:Object.keys(s.value).length,i=t?.path===s.path;return[s.path,{rows:a,totalRows:i?t.total_rows:a,baseOffset:i?t.offset:0,fingerprint:i?t.fingerprint:H(s.path,s.value)}]})),r=typeof e.next_cursor=="string";return{collectionsBeforeBudget:o,originalItemCount:Array.isArray(e.items)?e.items.length:0,cursorContinuesExistingPage:r,cursorSource:r?e.next_cursor:n.after}}function pn(e,t,n,o,r,s){let a=t.command==="assurance"&&Array.isArray(e.assertions)?e.assertions.filter(c=>h(c)&&c.verdict!=="pass").length:0,i=Oe(e,n,o.tokens,a>0?new Map([["assertions",a]]):new Map),u=fn(i,s.originalItemCount,s.cursorSource,s.cursorContinuesExistingPage);return ln(i,t,n,o,u,s.collectionsBeforeBudget),r!==void 0&&(i=P(i,r,n)),i}function sr(e,t,n){let o=Ve(e,t);if(!o)return n;let r=M(t.outputSession??t.output_session),s=t.outputCursor??t.output_cursor,a=typeof s=="string"?Z(s):void 0,i=sn(o);if(a===void 0&&dn(o,i,r,n))return n;let u=un(o,r),c=an(n,o,r,a),f=_n(c,a,t),d={contract_version:1,command:o.command,requested_dimensions:i,...u?.source==="default"?{budget_source:u.source,budget_tokens:u.tokens}:{},precedence:o.precedence,legacy_aliases_used:o.legacy_aliases_used,migration_hints:o.migration_hints,estimated_tokens:0,within_budget:!0,strings_compacted:!1,rows_compacted:!1,result_omitted:!1};return c.read_output=d,c=r===void 0?c:P(c,r,d),b(c,d),u!==void 0&&d.estimated_tokens>u.tokens&&(c=pn(c,o,d,u,r,f)),u!==void 0&&d.estimated_tokens>u.tokens?cn(o,i,r,u,d.estimated_tokens):c}function ir(e){return h(e)&&h(e.output_budget_exceeded)&&e.output_budget_exceeded.omitted_result===!0&&e.output_budget_exceeded.reason==="requested_budget_infeasible"}function ar(e,t){let n=Ve(e,t)?.encoding;return n?.value==="json"||n?.value==="toon"?n.value:void 0}(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]="8e523bbc-5745-514e-a1d8-a6ad6ece001a")}catch{}})();var gn=4096;function re(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function H(e,t){let n=Array.isArray(t)?t.map((o,r)=>{if(!re(o))return`index:${String(r)}`;for(let s of["id","assertion_id","measurement_id","event_id"]){let a=o[s];if(typeof a=="string"&&a.length>0)return`${s}:${a}`}return`index:${String(r)}`}):Object.keys(t);return mn("sha256").update(JSON.stringify({path:e,identities:n})).digest("base64url").slice(0,16)}function J(e){return Buffer.from(JSON.stringify({v:1,c:e.command,p:e.path,o:e.offset,n:e.total_rows,f:e.fingerprint}),"utf8").toString("base64url")}function Z(e){if(e.length>gn)throw new _("The read-output continuation cursor is malformed or unsupported.",p.USAGE,{code:"read_output_cursor_invalid"});let t;try{t=JSON.parse(Buffer.from(e,"base64url").toString("utf8"))}catch{t=null}if(!re(t)||t.v!==1||T(String(t.c??""))!==t.c||typeof t.p!="string"||t.p.length===0||!Number.isSafeInteger(t.o)||t.o<0||!Number.isSafeInteger(t.n)||t.n<1||typeof t.f!="string"||t.f.length===0)throw new _("The read-output continuation cursor is malformed or unsupported.",p.USAGE,{code:"read_output_cursor_invalid"});return{version:1,command:t.c,path:t.p,offset:t.o,total_rows:t.n,fingerprint:t.f}}function Ce(e){if(!Array.isArray(e.assertions))return e;let t=n=>!re(n)||n.verdict==="pass"?4:n.verdict==="retired"?3:n.enforcement==="block"?0:n.enforcement==="warn"?1:2;return{...e,assertions:e.assertions.map((n,o)=>({row:n,index:o})).sort((n,o)=>t(n.row)-t(o.row)||n.index-o.index).map(({row:n})=>n),budget_retention_policy:"verdict_priority"}}function ve(e,t,n){if(!n)return e;if(n.command!==t)throw new _(`The read-output cursor belongs to ${n.command}, not ${t}.`,p.USAGE,{code:"read_output_cursor_command_mismatch"});let o=g(e).find(s=>s.path===n.path),r=o?Array.isArray(o.value)?o.value.length:Object.keys(o.value).length:0;if(!o||r!==n.total_rows||n.offset>r||H(n.path,o.value)!==n.fingerprint)throw new _("The read-output continuation no longer matches the declared row collection; restart the bounded read.",p.USAGE,{code:"read_output_cursor_stale"});return _e(e,n.path,n.offset)}(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]="f6e82c93-54e8-53a7-94df-10a573aae933")}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]="08ee7e43-8811-57ed-8bfe-0345ee5d3308")}catch{}})();var yn=Object.freeze([{flag:"--json"},{flag:"--lean"},{flag:"--token-accounting"},{flag:"--output-include",value_name:"fields"},{flag:"--output-limit",value_name:"count"},{flag:"--output-budget",value_name:"tokens"},{flag:"--output-format",value_name:"toon|json"},{flag:"--output-session",value_name:"state"},{flag:"--output-cursor",value_name:"cursor"},{flag:"--output-row-contract"},{flag:"--quiet"},{flag:"--no-changed-fields"},{flag:"--full-changed-fields"},{flag:"--id-only"},{flag:"--pm-path",aliases:["--path"]},{flag:"--no-extensions"},{flag:"--no-pager"},{flag:"--profile"},{flag:"--help"},{flag:"--author",value_name:"id"}]),hr=new Set(yn.flatMap(e=>[e.flag,...e.aliases??[]]));export{j as a,Ge as b,ze as c,hn as d,se as e,ie as f,ae as g,bn as h,ue as i,ce as j,de as k,$e as l,On as m,An as n,Sn as o,wn as p,Tn as q,kn as r,xn as s,Rn as t,In as u,Nn as v,Cn as w,vn as x,Dn as y,Mn as z,Un as A,Ln as B,Pn as C,Ke as D,jn as E,Vn as F,Fn as G,Bn as H,Gn as I,zn as J,$n as K,Xe as L,Ye as M,Yn as N,qn as O,qe as P,Wn as Q,Qn as R,Hn as S,He as T,Je as U,V,Jn as W,Zn as X,p as Y,_ as Z,yn as _,hr as $,Ae as aa,w as ba,Do as ca,Mo as da,x as ea,oo as fa,ro as ga,so as ha,Ze as ia,et as ja,tt as ka,co as la,lo as ma,nt as na,R as oa,fo as pa,ot as qa,fe as ra,I as sa,rt as ta,_o as ua,po as va,mo as wa,go as xa,yo as ya,ho as za,bo as Aa,z as Ba,M as Ca,ye as Da,$ as Ea,he as Fa,ft as Ga,xo as Ha,bt as Ia,be as Ja,Et as Ka,Ot as La,Ee as Ma,Ro as Na,J as Oa,Z as Pa,Fo as Qa,Bo as Ra,q as Sa,W as Ta,Q as Ua,Go as Va,Ft as Wa,zo as Xa,$o as Ya,O as Za,De as _a,er as $a,tr as ab,zt as bb,T as cb,nr as db,Pe as eb,Wt as fb,or as gb,Ve as hb,rr as ib,sr as jb,ir as kb,ar as lb};
2
+ //# sourceMappingURL=chunk-2PN4TJXH.js.map