@unbrained/pm-cli 2026.11.17 → 2026.11.19

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 (124) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/cli-bundle/bundle-manifest.json +1 -1
  3. package/dist/cli-bundle/chunks/chunk-2UTJ5QIE.js +71 -0
  4. package/dist/cli-bundle/chunks/{chunk-VLKCFZY6.js → chunk-4FNMPZ7Y.js} +2 -2
  5. package/dist/cli-bundle/chunks/chunk-723PMYNX.js +125 -0
  6. package/dist/cli-bundle/chunks/{chunk-77MGDTK4.js → chunk-AGPFANRX.js} +3 -3
  7. package/dist/cli-bundle/chunks/{chunk-RXNBNF6O.js → chunk-AMHD7WIV.js} +2 -2
  8. package/dist/cli-bundle/chunks/{chunk-7K2RUKMK.js → chunk-AOV5HG3Y.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-36R3JTAD.js → chunk-CNMGGAZO.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-XPBADEUK.js → chunk-CTOE26W4.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-FXSLODOK.js → chunk-GQCMICAL.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-ABFHWRLE.js → chunk-IQKCRLQP.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-QANUQMDL.js → chunk-IUTN67EB.js} +2 -2
  14. package/dist/cli-bundle/chunks/chunk-M76BEWTT.js +31 -0
  15. package/dist/cli-bundle/chunks/{chunk-ADKDFCVT.js → chunk-N2CPCFSN.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-KIQNEOKJ.js → chunk-NMVPQTZI.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-XP35IEHT.js → chunk-O7IFAJ76.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-X5TFNFTS.js → chunk-OESI2ETD.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-ACLBUVQG.js → chunk-P4A5RFLX.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-QZNL5XDT.js → chunk-PRVT7ITI.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-O4ZSIMNC.js → chunk-Q32Q3LRH.js} +2 -2
  22. package/dist/cli-bundle/chunks/{chunk-DXSZL3T6.js → chunk-XPBPGDFW.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-4FIN2XWC.js → chunk-Z5LHCEXG.js} +2 -2
  24. package/dist/cli-bundle/chunks/{item-revision-7RVMVXTE.js → item-revision-YJKGOYBR.js} +2 -2
  25. package/dist/cli-bundle/chunks/item-transaction-K4YZ7GWR.js +2 -0
  26. package/dist/cli-bundle/chunks/{mutation-admission-3PKQOAYK.js → mutation-admission-JLMQJ2M5.js} +2 -2
  27. package/dist/cli-bundle/chunks/{register-list-query-TPZLHFHQ.js → register-list-query-4AXLLXK7.js} +2 -2
  28. package/dist/cli-bundle/chunks/{register-mutation-JG5AEBRJ.js → register-mutation-FJIXGGF4.js} +2 -2
  29. package/dist/cli-bundle/chunks/{register-operations-3CNXP46P.js → register-operations-W4E2KEMA.js} +2 -2
  30. package/dist/cli-bundle/chunks/{register-setup-4N56VL2P.js → register-setup-RYRIBNSN.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-VBA4BIHN.js → chunk-2XULTI5B.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/{chunk-2MQNIDKG.js → chunk-4S7I342K.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/{chunk-GD2YWUAD.js → chunk-77CDWGBW.js} +55 -54
  34. package/dist/cli-bundle/focused-chunks/{chunk-BNLLST32.js → chunk-7A4VIRIU.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/{chunk-SESMRMEE.js → chunk-D72EQN7Z.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/{chunk-YWPLBFPC.js → chunk-GAOWBALE.js} +23 -23
  37. package/dist/cli-bundle/focused-chunks/chunk-N64BUB63.js +27 -0
  38. package/dist/cli-bundle/focused-chunks/{chunk-XJS4COL2.js → chunk-OF4UM5B6.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-6JQXDGHM.js → chunk-P4TG4VMJ.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/{item-revision-U7GDVAH7.js → item-revision-32HFGFYG.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/{item-transaction-7C4BH47O.js → item-transaction-C4VW3SHX.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/{mutation-admission-SKXVITP5.js → mutation-admission-PNK6ORZR.js} +2 -2
  43. package/dist/cli-bundle/main.js +2 -2
  44. package/dist/cli-bundle/sdk-authoring.js +1 -1
  45. package/dist/cli-bundle/sdk-core.js +1 -1
  46. package/dist/cli-bundle/sdk-governance.js +1 -1
  47. package/dist/cli-bundle/sdk-merge.js +58 -58
  48. package/dist/cli-bundle/sdk-query.js +1 -1
  49. package/dist/cli-bundle/sdk-runtime.js +1 -1
  50. package/dist/cli-bundle/sdk-testing.js +1 -1
  51. package/dist/cli-bundle/sdk.js +11 -11
  52. package/dist/core/fs/file-glob.js +2 -0
  53. package/dist/core/shared/process-tree.js +3 -0
  54. package/dist/core/shared/secret-rules.d.ts +94 -4
  55. package/dist/core/shared/secret-rules.js +5 -4
  56. package/dist/sdk/extension/managed-state.d.ts +3 -1
  57. package/dist/sdk/extension/managed-state.js +1 -1
  58. package/dist/sdk/extension/managed-update-status.js +1 -1
  59. package/dist/sdk/extension/update-check.d.ts +42 -6
  60. package/dist/sdk/extension/update-check.js +1 -1
  61. package/dist/sdk/extension.d.ts +3 -1
  62. package/dist/sdk/extension.js +1 -1
  63. package/dist/sdk/index.d.ts +1 -1
  64. package/dist/sdk/index.js +1 -1
  65. package/dist/sdk/linked-artifacts.js +2 -2
  66. package/dist/sdk/mutation-guard.d.ts +146 -5
  67. package/dist/sdk/mutation-guard.js +1 -1
  68. package/dist/sdk/public-surface.json +1 -1
  69. package/dist/sdk/test/execution.js +2 -2
  70. package/docs/COMMANDS.md +33 -0
  71. package/docs/CONFIGURATION.md +1 -0
  72. package/docs/DEFECT_RECURRENCE.md +3 -2
  73. package/docs/MUTATION_INTEGRITY.md +259 -7
  74. package/docs/PACKAGE_EVIDENCE.md +66 -0
  75. package/marketplace.json +1 -1
  76. package/package.json +1 -3
  77. package/packages/pm-beads/package.json +1 -1
  78. package/packages/pm-calendar/package.json +1 -1
  79. package/packages/pm-command-kit/package.json +1 -1
  80. package/packages/pm-digital-twin/package.json +1 -1
  81. package/packages/pm-governance-audit/package.json +1 -1
  82. package/packages/pm-guide-shell/package.json +1 -1
  83. package/packages/pm-kanban/package.json +1 -1
  84. package/packages/pm-lifecycle-hooks/package.json +1 -1
  85. package/packages/pm-linked-test-adapters/package.json +1 -1
  86. package/packages/pm-search-advanced/package.json +1 -1
  87. package/packages/pm-templates/package.json +1 -1
  88. package/packages/pm-todos/package.json +1 -1
  89. package/packages/pm-vcs/package.json +1 -1
  90. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  91. package/plugins/pm-claude/package.json +1 -1
  92. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  93. package/plugins/pm-codex/package.json +1 -1
  94. package/plugins/pm-codex/plugin.json +1 -1
  95. package/runtime-dependencies.json +1 -1
  96. package/dist/cli-bundle/chunks/chunk-2WHXFKMY.js +0 -31
  97. package/dist/cli-bundle/chunks/chunk-3IU2S5UQ.js +0 -70
  98. package/dist/cli-bundle/chunks/chunk-AM26RAG7.js +0 -124
  99. package/dist/cli-bundle/chunks/item-transaction-NVX6P3FK.js +0 -2
  100. package/dist/cli-bundle/focused-chunks/chunk-ZDY5L2C2.js +0 -26
  101. package/node_modules/fdir/LICENSE +0 -7
  102. package/node_modules/fdir/README.md +0 -91
  103. package/node_modules/fdir/dist/index.cjs +0 -588
  104. package/node_modules/fdir/dist/index.d.cts +0 -155
  105. package/node_modules/fdir/dist/index.d.mts +0 -155
  106. package/node_modules/fdir/dist/index.mjs +0 -570
  107. package/node_modules/fdir/package.json +0 -106
  108. package/node_modules/picomatch/LICENSE +0 -21
  109. package/node_modules/picomatch/README.md +0 -743
  110. package/node_modules/picomatch/index.js +0 -17
  111. package/node_modules/picomatch/lib/constants.js +0 -184
  112. package/node_modules/picomatch/lib/parse.js +0 -1425
  113. package/node_modules/picomatch/lib/picomatch.js +0 -361
  114. package/node_modules/picomatch/lib/scan.js +0 -403
  115. package/node_modules/picomatch/lib/utils.js +0 -72
  116. package/node_modules/picomatch/package.json +0 -83
  117. package/node_modules/picomatch/posix.js +0 -3
  118. package/node_modules/tinyglobby/LICENSE +0 -21
  119. package/node_modules/tinyglobby/README.md +0 -25
  120. package/node_modules/tinyglobby/dist/index.cjs +0 -335
  121. package/node_modules/tinyglobby/dist/index.d.cts +0 -148
  122. package/node_modules/tinyglobby/dist/index.d.mts +0 -148
  123. package/node_modules/tinyglobby/dist/index.mjs +0 -307
  124. package/node_modules/tinyglobby/package.json +0 -70
@@ -1,2 +1,2 @@
1
- import{a as se}from"./chunk-ADKDFCVT.js";import"./chunk-DEZPZOQ7.js";import{Ea as M,Mb as V,Nd as te,Qd as ae,Sd as ne,Yd as oe,Zd as re,_d as C,cc as N,cd as U,dd as $,ed as H,ee as ie,fd as W,gd as j,hd as G,ic as q,id as B,kd as I,lc as J,ld as z,md as Y,nb as F,nd as K,od as X,pd as Q,rd as Z,sd as ee}from"./chunk-2WHXFKMY.js";import"./chunk-HQYIKAC6.js";import"./chunk-36R3JTAD.js";import"./chunk-3IU2S5UQ.js";import"./chunk-H64BNM4A.js";import"./chunk-Y4LXVPA5.js";import"./chunk-X5TFNFTS.js";import"./chunk-RXNBNF6O.js";import{Cc as c,Fc as f,Gc as i,Hc as g,Xc as y,wc as O,xc as L,yc as P}from"./chunk-7K2RUKMK.js";import"./chunk-VLKCFZY6.js";import"./chunk-4FIN2XWC.js";import"./chunk-IB7UB5TE.js";import{R as x}from"./chunk-AM26RAG7.js";import{v as _}from"./chunk-CR5GC3VO.js";import{$g as s,A as E,Sa as v,ae as R,ah as d,hj as A,z as T}from"./chunk-7UUPLMCU.js";import"./chunk-VS565KBX.js";import"./chunk-SPPHDVZE.js";import{A as u,C as p}from"./chunk-5OFMWP3Q.js";import"./chunk-XAWE4EAK.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]="c3d9f24a-7089-5d60-ab12-93d03b86da80")}catch{}})();var le=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"]]),be=new Set(["higher","lower","target"]),ve=[...le.keys()].sort((e,t)=>e.localeCompare(t)).join(", ");function xe(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(a=>typeof a=="string"):e==="direction"&&be.has(t)}function ce(e){if(e===void 0)return{};let t;try{t=JSON.parse(e)}catch(a){throw new p(`--analytics must be valid JSON: ${String(a)}`,u.USAGE)}if(t===null||typeof t!="object"||Array.isArray(t))throw new p("--analytics must be a JSON object.",u.USAGE);for(let[a,n]of Object.entries(t)){let o=le.get(a);if(!xe(o,n))throw new p(o===void 0?`Unknown --analytics field "${a}". Accepted fields: ${ve}.`:`--analytics field "${a}" must be ${o.replace("_"," ")}.`,u.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]="dcd8c925-34ee-5faa-9132-1be43961c749")}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]="29db968f-30ad-5f3c-bf95-e33be18614c6")}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]="524ade8e-33d6-5353-b01d-c7baddc956e8")}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]="02e10fe1-c111-5c09-8dbe-a67f2b97f0d0")}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]="3d4a8db3-8a53-50b4-a96c-1affff2207a3")}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]="d008ca8f-41bf-54fb-9b56-bc1d4af9f226")}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]="de197522-9007-5e21-8f9c-06cbf63707d1")}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]="a5e0162a-bbf1-50fe-8912-a820de155e90")}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]="9ee008b9-3751-5794-8d01-1f6d3123d6cd")}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]="b6fa277d-ccf2-5413-95d5-0790283203d5")}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]="2d59e10e-c85b-542a-8859-b20a08e809fa")}catch{}})();var de=(e,t)=>N(e,t,{runUpdate:(a,n,o)=>se(a,n,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]="3952425a-adce-59dd-84b6-97ac571eaa73")}catch{}})();async function Ae(e,t,a,n,o){let r=c(o),l=e==="run",m=e==="verdicts",h=e==="presets"||e==="apply",b=e==="promote",k=await q({action:e,...l||m||h||b?{}:{kind:t},id:l||m||b?a??t:a,preset:h?a??t:void 0,definition:i(n,"definition"),trigger:i(n,"trigger"),tree:i(n,"tree"),gate:i(n,"gate"),limit:i(n,"limit"),dry_run:n.dryRun===!0,fullChangedFields:r.fullChangedFields,idOnly:r.idOnly,author:i(n,"author"),message:i(n,"message"),owner:i(n,"owner"),apply:n.apply===!0,enforcement:i(n,"enforcement")},r);s(k,r),typeof k=="object"&&k!==null&&"exit_code"in k&&k.exit_code===1&&(process.exitCode=1)}function ue(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(Ae)}(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]="465324c9-c5c2-5093-b979-3fa1a9979911")}catch{}})();function _e(e,t){let a=e?.trim().toLowerCase(),n=t?.trim().toLowerCase();if(a===void 0||a.length===0)return n;if(a==="local-analytics")return n&&n.length>0?n:"status";if(n!==void 0&&n.length>0)throw x({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 a}function Ie(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 fe(e,t){if(e.background===!0){if(e.run!==!0)throw new p("--background requires --run",u.USAGE);if(e.acknowledgeLinkedTests===!0)throw new p("--background cannot be combined with --acknowledge-linked-tests; acknowledgement is a non-executing foreground operation",u.USAGE);if(e.update!==void 0||e.updateIndex!==void 0||e.setJson!==void 0||t.addValues.length>0||t.addJsonValues.length>0||t.removeValues.length>0||t.removeIndexValues.length>0)throw new p("--background does not support --add/--add-json/--remove/--remove-index or metadata edits; update linked tests first, then run in background",u.USAGE)}}async function Ce(e,t,a,n){let o=await C({kind:"test",commandArgs:O(e,{...t,add:n.addValues,addJson:n.addJsonValues,remove:n.removeValues,removeIndex:n.removeIndexValues}),targetId:e,author:typeof t.author=="string"?t.author:void 0,noExtensions:a.noExtensions===!0},a);s(o,a)}function De(e){return{update:typeof e.update=="string"?e.update:void 0,updateIndex:typeof e.updateIndex=="string"||typeof e.updateIndex=="number"?e.updateIndex:void 0,setJson:typeof e.setJson=="string"?e.setJson:void 0}}function D(e,t){return{add:t.addValues,addJson:t.addJsonValues,remove:t.removeValues,removeIndex:t.removeIndexValues,...De(e),list:!!e.list,fullHistory:e.fullHistory===!0,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,workspaceContext:typeof e.workspaceContext=="string"?e.workspaceContext:void 0,overrideLinkedWorkspaceContext:!!e.overrideLinkedWorkspaceContext,allowUntrustedLinkedTests:!!e.allowUntrustedLinkedTests,acknowledgeLinkedTests:!!e.acknowledgeLinkedTests,failOnContextMismatch:!!e.failOnContextMismatch,failOnSkipped:!!e.failOnSkipped,failOnEmptyTestRun:!!e.failOnEmptyTestRun,requireAssertionsForPm:!!e.requireAssertionsForPm,checkContext:!!e.checkContext,fullOutput:!!e.fullOutput,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}}var qt={buildRunTestOptions:D,buildRunTestAllOptions:pe,runWorkspacePositionAction:ye,validateBackgroundTestOptions:fe};async function Se(e,t,a,n){let o=await oe(e,D(t,n),a);(t.update!==void 0||t.updateIndex!==void 0||t.setJson!==void 0||n.addValues.length>0||n.addJsonValues.length>0||n.removeValues.length>0||t.run===!0||n.removeIndexValues.length>0)&&await y(a,o),s(o,a),(o.run_results.some(r=>r.status==="failed"||r.status==="refused")||o.fail_on_skipped_triggered===!0)&&(process.exitCode=u.DEPENDENCY_FAILED)}async function Te(e,t,a){let n=c(a),o=Date.now(),r=Ie(t);t.background===!0&&ne(e,D(t,r),n,v(process.cwd(),n.path),!0),fe(t,r),t.background===!0?await Ce(e,t,n,r):await Se(e,t,n,r),n.profile&&d(`profile:command=test took_ms=${Date.now()-o}`)}function w(e){let t=i(e,"author"),a=i(e,"assignee");if(t!==void 0&&a!==void 0&&t!==a)throw new p("Lifecycle ownership received conflicting --author and --assignee values; use one actor value for both aliases.",u.USAGE,{code:"conflicting_lifecycle_owner",examples:["pm claim pm-123","pm claim pm-123 --start","pm release pm-123"]});return{author:t??a,message:i(e,"message")}}async function Ee(e,t){let a=c(t),n=Date.now();if(e.background===!0){let r=await C({kind:"test-all",commandArgs:L(e),statusFilter:i(e,"status"),noExtensions:a.noExtensions===!0},a);s(r,a),a.profile&&d(`profile:command=test-all took_ms=${Date.now()-n}`);return}let o=await re(pe(e),a);await y(a,{ids:o.results.map(r=>r.id)}),s(o,a),(o.failed>0||o.fail_on_skipped_triggered===!0)&&(process.exitCode=u.DEPENDENCY_FAILED),a.profile&&d(`profile:command=test-all took_ms=${Date.now()-n}`)}function pe(e){return{status:i(e,"status"),limit:i(e,"limit"),offset:i(e,"offset"),timeout:i(e,"timeout"),progress:!!e.progress,envSet:Array.isArray(e.envSet)?e.envSet:[],envClear:Array.isArray(e.envClear)?e.envClear:[],sharedHostSafe:!!e.sharedHostSafe,pmContext:i(e,"pmContext"),overrideLinkedPmContext:!!e.overrideLinkedPmContext,workspaceContext:i(e,"workspaceContext"),overrideLinkedWorkspaceContext:!!e.overrideLinkedWorkspaceContext,allowUntrustedLinkedTests:!!e.allowUntrustedLinkedTests,failOnContextMismatch:!!e.failOnContextMismatch,failOnSkipped:!!e.failOnSkipped,failOnEmptyTestRun:!!e.failOnEmptyTestRun,requireAssertionsForPm:!!e.requireAssertionsForPm,checkContext:!!e.checkContext,fullOutput:!!e.fullOutput,autoPmContext:!!e.autoPmContext}}async function Re(e,t,a,n){let o=c(n),r=Date.now(),l=await ae({subcommand:_e(e,t),limit:i(a,"limit")},o);s(l,o),o.profile&&d(`profile:command=telemetry took_ms=${Date.now()-r}`)}async function Oe(e,t){let a=c(t),n=Date.now(),o=ce(i(e,"analytics")),r=await te(a,{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:i(e,"tagPrefix"),fieldUtilization:e.fieldUtilization===!0,...o});r.recorded_observations?.some(l=>l.changed)===!0&&await y(a,{ids:r.recorded_observations?.flatMap(l=>l.observation.item_id?[l.observation.item_id]:[])}),s(r,a),a.profile&&d(`profile:command=stats took_ms=${Date.now()-n}`)}async function Le(e,t){let a=c(t),n=Date.now(),o=i(e,"threshold"),r=i(e,"limit"),l=await F(a,{...e.exhaustive===!0?{exhaustive:!0}:{},status:Array.isArray(e.status)&&e.status.length>0?e.status:void 0,since:i(e,"since"),...o===void 0?{}:{threshold:Number(o)},...r===void 0?{}:{limit:Number(r)}});s(l,a),a.profile&&d(`profile:command=duplicates took_ms=${Date.now()-n}`)}async function Pe(e,t){let a=c(t),n=Date.now(),o=!!e.strictExit||!!e.failOnWarn,r=await V(a,{strictExit:o,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&&e.full!==!0,skipVectors:!!e.skipVectors,skipIntegrity:!!e.skipIntegrity,skipDrift:!!e.skipDrift,full:!!e.full});s(r,a),o&&!r.ok&&(A({...r,exit_code:u.GENERIC_FAILURE,error_code:"health_findings",error_category:"validation",command_resolution:"health_findings",resolution_stage:"execute"}),process.exitCode=u.GENERIC_FAILURE),a.profile&&d(`profile:command=health took_ms=${Date.now()-n}`)}async function Me(e,t){let a=c(t),n=Date.now(),o=await de({checkMetadata:!!e.checkMetadata,metadataProfile:i(e,"metadataProfile"),checkResolution:!!e.checkResolution,checkCompleteness:!!e.checkCompleteness,checkLifecycle:!!e.checkLifecycle,checkStaleBlockers:!!e.checkStaleBlockers,dependencyCycleSeverity:i(e,"dependencyCycleSeverity"),parentCycleSeverity:i(e,"parentCycleSeverity"),checkFiles:!!e.checkFiles,checkCommandReferences:!!e.checkCommandReferences,scanMode:i(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},a);s(o,a),(e.strictExit||e.failOnWarn)&&(o.has_warnings||!o.ok)&&(A({...o,exit_code:u.GENERIC_FAILURE,error_code:"validation_findings",error_category:"validation",command_resolution:"validation_findings",resolution_stage:"execute"}),process.exitCode=u.GENERIC_FAILURE),a.profile&&d(`profile:command=validate took_ms=${Date.now()-n}`)}async function Fe(e,t){let a=c(t),n=Date.now(),o=await J(a,{dryRun:e.dryRun===!0,scope:Array.isArray(e.scope)?e.scope:[]});s(o,a),a.profile&&d(`profile:command=gc took_ms=${Date.now()-n}`)}async function Ve(e,t,a,n){let o=c(n),r=v(process.cwd(),o.path),l=e.trim().toLowerCase();if(!I.some(m=>m===l))throw x({command_path:"workspace snapshot",token:e,allowed:I,display_name:"workspace snapshot",token_kind:"action",examples:["pm workspace snapshot create before-migration","pm workspace snapshot restore before-migration"]});if(l==="list"){s(await K(r),o);return}if(l==="create"){s(await z(r,t===void 0?{}:{name:t}),o);return}if(t===void 0)throw new p(`pm workspace snapshot ${l} requires a snapshot name or fingerprint`,u.USAGE);if(l==="inspect"){s(await Y(r,t),o);return}if(l==="restore"){if(a.dryRun===!0){s(await X(r,t),o);return}let m=await _(r);s(await Q(r,t,{force:a.force===!0,author:R(i(a,"author"),m.author_default),message:i(a,"message"),lockTtlSeconds:m.locks.ttl_seconds,lockWaitMs:m.locks.wait_ms}),o);return}s(await Z(r,t),o)}async function ye(e,t){let a=c(t);s(await ee(a),a)}async function Ne(e,t){let a=c(t),n=Date.now(),o=await M({action:i(e,"action"),command:i(e,"command"),summary:!!e.summary,schemaOnly:!!e.schemaOnly,flagsOnly:!!e.flagsOnly,availabilityOnly:!!e.availabilityOnly,runtimeOnly:!!e.runtimeOnly||!!e.activeOnly,full:!!e.full},a);s(o,a),a.profile&&d(`profile:command=contracts took_ms=${Date.now()-n}`)}async function qe(e,t,a){let n=t.next===!0,o=t.start===!0;if(o&&e){await ge(e,t,a);return}$(e,n,o);let r=c(a),l=Date.now(),m={...w(t),ifAvailable:t.ifAvailable===!0,...t.takeoverStale===!0?{takeoverStale:!0}:{},maxAttempts:t.maxAttempts,...o?{start:!0}:{}},h=n?await H(!!t.force,r,m,Je(t)):await U(e,!!t.force,r,m);await y(r,h),s(h,r),r.profile&&d(`profile:command=claim took_ms=${Date.now()-l}`)}function Je(e){return{type:i(e,"type"),tag:i(e,"tag"),priority:e.priority,assigneeFilter:i(e,"assigneeFilter"),parent:i(e,"parent"),sprint:i(e,"sprint"),release:i(e,"release"),includeDecisions:e.includeDecisions===!0,includeGates:e.includeGates===!0,includeContainers:e.includeContainers===!0,tokenBudget:e.tokenBudget??e.token_budget,explainRanking:e.explainRanking===!0||e.explain_ranking===!0}}async function Ue(e,t,a){if(t.pause===!0){await he(e,t,a);return}let n=c(a),o=Date.now(),r=await W(e,!!t.force,n,{...w(t),ownershipReleaseBypass:t.ownershipReleaseBypass===!0,handoff:t.handoff});await y(n,r),s(await P("release",[e],t,n,r),n),n.profile&&d(`profile:command=release took_ms=${Date.now()-o}`)}async function S(e){let t=c(e),a=T(e.name());!a||t.json||t.quiet||(await _(v(process.cwd(),t.path))).ux?.deprecation_hints&&d(E(a))}async function ge(e,t,a){await S(a);let n=c(a),o=Date.now(),r=await j(e,{...w(t),force:!!t.force,next:t.next===!0,ifAvailable:t.ifAvailable===!0,...t.takeoverStale===!0?{takeoverStale:!0}:{}},n);await y(n,r.update),s(r,n),n.profile&&d(`profile:command=start-task took_ms=${Date.now()-o}`)}async function he(e,t,a){await S(a);let n=c(a),o=Date.now(),r=await G(e,{...w(t),handoff:i(t,"handoff"),force:!!t.force},n);await y(n,r.release),s(r,n),n.profile&&d(`profile:command=pause-task took_ms=${Date.now()-o}`)}async function $e(e,t,a,n){await S(n);let o=c(n),r=Date.now(),l=await B(e,t,{...w(a),validateClose:i(a,"validateClose"),force:!!a.force},o);await y(o,l.release),s(l,o),o.profile&&d(`profile:command=close-task took_ms=${Date.now()-r}`)}function me(e){return e.option("--background","Run linked tests in managed background mode").option("--timeout <seconds>","Default run timeout in seconds (requires --run)").option("--progress","Emit stderr run progress (requires --run; automatic in TTY)").option("--env-set <value>","Set run environment (KEY=VALUE, repeatable)",f).option("--env-clear <value>","Clear run environment (NAME, repeatable)",f).option("--shared-host-safe","Apply additive shared-host-safe run defaults").option("--pm-context <mode>","PM test context: schema|tracker|auto|none (default: schema)").option("--override-linked-pm-context","Override stored context with --pm-context").option("--workspace-context <mode>","Source-workspace mode: source|isolated|snapshot (default: source)").option("--override-linked-workspace-context","Override stored context with --workspace-context").option("--allow-untrusted-linked-tests","Execute untrusted linked commands when project policy also permits it").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","Fail successful commands reporting zero executed tests").option("--require-assertions-for-pm","Require assertion metadata for linked PM command tests").option("--check-context","Check PM context before execution and report the full execution context").option("--full-output","Report full stdout/stderr of passing rows").option("--auto-pm-context","Route mismatched PM tracker reads through tracker context")}function Jt(e){ue(e);let t=e.command("test").argument("<id>","Item id").option("--add <value>","Link isolated test; runs only with --run (CSV/markdown or stdin)",f).option("--add-json <value>","Link isolated test; runs only with --run (JSON object/array or stdin)",f).option("--remove <value>","Remove exact command/path (command=<value>, path=<value>, or stdin -)",f).option("--remove-index <n>","Remove 1-based --list position (repeatable)",f).option("--list","List linked tests without mutating").option("--update <value>","Edit exact command or path=<value>").option("--update-index <n>","Edit current 1-based --list position").option("--set-json <value>","Metadata patch; null clears optional fields").option("--run","Run linked test commands").option("--match <value>","Run matching command/path substring").option("--only-index <n>","Run 1-based --list position").option("--only-last","Run most recently added test").option("--full-history","Return all linked tests after a write");t.option("--acknowledge-linked-tests","Trust current commands in this clone without execution"),me(t).option("--measure <value>","Record name=value[,unit=...][,threshold=...]; requires --run",f).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(Te);let a=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");me(a).action(Ee),e.command("test-runs-worker",{hidden:!0}).argument("<runId>","Background run id").description("Internal background worker command.").action(async(b,k,ke)=>{let we=c(ke);await ie(b,we)}),e.command("telemetry").argument("[namespace-or-subcommand]","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(Re),e.command("duplicates").description("Find duplicate clusters across all statuses.").option("--status <value>","Statuses (repeatable or comma-separated)",f,[]).option("--since <value>","Created at or after this time").option("--threshold <value>","Minimum similarity (0-1)").option("--limit <n>","Maximum clusters").option("--exhaustive","Score all pairs within the safety bound").action(Le),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(Oe),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 status and warning count, also with --full").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 every check (slow integrity, drift, vectors too); keeps --summary/--brief").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(Pe),e.command("validate").description("Validate metadata, lifecycle policies, files, command references, and history.").option("--check-metadata","Run metadata completeness checks").option("--metadata-profile <value>","Metadata profile (core|strict|custom)").option("--check-resolution","Run closed-item resolution metadata checks").option("--check-completeness","Check declarative lifecycle field requirements").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 diagnostic ID lists").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 safe, deterministic field backfills").option("--dry-run","Preview planned --auto-fix/--prune-missing fixes without applying them").option("--fix-scope <scope>","Grant --auto-fix scopes (metadata, resolution, estimates, timestamps, lifecycle; comma-separated or repeatable). Default: metadata, resolution; other scopes require explicit opt-in",f).option("--prune-missing","Remove deleted-path file/doc links; preserves 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(Me),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",f).description("Delete optional cache artifacts by default (including expired lock debris) and show a summary.").action(Fe);let n=e.command("workspace").description("Inspect workspace state and snapshots.");n.command("position").description("Show merge and history readiness.").action(ye),n.command("snapshot").argument("<action>","Action: create, list, inspect, restore, delete").argument("[target]","Optional name for create; name or fingerprint otherwise").description("Manage 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(Ve),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(Ne);let o=e.command("claim").option("--start","Claim and start (id or --next)").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 another author's claim (skipped=true)").option("--takeover-stale","Take over an idle claim (stale-work policy)").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("--include-gates","Allow --next to claim outcome gates").option("--include-containers","Allow --next to claim containers with unfinished descendants").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(qe);g(o,"--assignee <value>","Alias for --author on lifecycle ownership commands"),g(o,"--token_budget <n>","Alias for --token-budget"),g(o,"--explain_ranking","Alias for --explain-ranking");let r=e.command("release").option("--pause","Use open status").option("--handoff <status>","Needs --message").argument("<id>","Item id").option("--author <value>","Author").option("--message <value>","Message").option("--force","Override ownership").description("Release ownership.").action(Ue);g(r,"--assignee <value>","Alias for --author on lifecycle ownership commands");let l=e.command("start-task",{hidden:!0}).argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership or terminal override when required").option("--takeover-stale","Take over an idle claim (stale-work policy)").description("Lifecycle alias: claim an item and move it to in_progress.").action(ge);g(l,"--assignee <value>","Alias for --author on lifecycle ownership commands");let m=e.command("pause-task",{hidden:!0}).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(he);g(m,"--assignee <value>","Alias for --author on lifecycle ownership commands");let h=e.command("close-task",{hidden:!0}).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($e);g(h,"--assignee <value>","Alias for --author on lifecycle ownership commands")}export{qt as _testOnlyRegisterOperations,Jt as registerOperationCommands,$ as requireClaimTarget};
2
- //# sourceMappingURL=register-operations-3CNXP46P.js.map
1
+ import{a as se}from"./chunk-N2CPCFSN.js";import"./chunk-DEZPZOQ7.js";import{Ea as M,Mb as V,Nd as te,Qd as ae,Sd as ne,Yd as oe,Zd as re,_d as C,cc as N,cd as U,dd as $,ed as H,ee as ie,fd as W,gd as j,hd as G,ic as q,id as B,kd as I,lc as J,ld as z,md as Y,nb as F,nd as K,od as X,pd as Q,rd as Z,sd as ee}from"./chunk-M76BEWTT.js";import"./chunk-HQYIKAC6.js";import"./chunk-CNMGGAZO.js";import"./chunk-2UTJ5QIE.js";import"./chunk-H64BNM4A.js";import"./chunk-Y4LXVPA5.js";import"./chunk-OESI2ETD.js";import"./chunk-AMHD7WIV.js";import{Cc as c,Fc as f,Gc as i,Hc as g,Xc as y,wc as O,xc as L,yc as P}from"./chunk-AOV5HG3Y.js";import"./chunk-4FNMPZ7Y.js";import"./chunk-Z5LHCEXG.js";import"./chunk-IB7UB5TE.js";import{R as x}from"./chunk-723PMYNX.js";import{v as _}from"./chunk-CR5GC3VO.js";import{$g as s,A as E,Sa as v,ae as R,ah as d,hj as A,z as T}from"./chunk-7UUPLMCU.js";import"./chunk-VS565KBX.js";import"./chunk-SPPHDVZE.js";import{A as u,C as p}from"./chunk-5OFMWP3Q.js";import"./chunk-XAWE4EAK.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]="c3d9f24a-7089-5d60-ab12-93d03b86da80")}catch{}})();var le=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"]]),be=new Set(["higher","lower","target"]),ve=[...le.keys()].sort((e,t)=>e.localeCompare(t)).join(", ");function xe(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(a=>typeof a=="string"):e==="direction"&&be.has(t)}function ce(e){if(e===void 0)return{};let t;try{t=JSON.parse(e)}catch(a){throw new p(`--analytics must be valid JSON: ${String(a)}`,u.USAGE)}if(t===null||typeof t!="object"||Array.isArray(t))throw new p("--analytics must be a JSON object.",u.USAGE);for(let[a,n]of Object.entries(t)){let o=le.get(a);if(!xe(o,n))throw new p(o===void 0?`Unknown --analytics field "${a}". Accepted fields: ${ve}.`:`--analytics field "${a}" must be ${o.replace("_"," ")}.`,u.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]="dcd8c925-34ee-5faa-9132-1be43961c749")}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]="29db968f-30ad-5f3c-bf95-e33be18614c6")}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]="524ade8e-33d6-5353-b01d-c7baddc956e8")}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]="02e10fe1-c111-5c09-8dbe-a67f2b97f0d0")}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]="3d4a8db3-8a53-50b4-a96c-1affff2207a3")}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]="d008ca8f-41bf-54fb-9b56-bc1d4af9f226")}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]="de197522-9007-5e21-8f9c-06cbf63707d1")}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]="a5e0162a-bbf1-50fe-8912-a820de155e90")}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]="9ee008b9-3751-5794-8d01-1f6d3123d6cd")}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]="b6fa277d-ccf2-5413-95d5-0790283203d5")}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]="2d59e10e-c85b-542a-8859-b20a08e809fa")}catch{}})();var de=(e,t)=>N(e,t,{runUpdate:(a,n,o)=>se(a,n,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]="3952425a-adce-59dd-84b6-97ac571eaa73")}catch{}})();async function Ae(e,t,a,n,o){let r=c(o),l=e==="run",m=e==="verdicts",h=e==="presets"||e==="apply",b=e==="promote",k=await q({action:e,...l||m||h||b?{}:{kind:t},id:l||m||b?a??t:a,preset:h?a??t:void 0,definition:i(n,"definition"),trigger:i(n,"trigger"),tree:i(n,"tree"),gate:i(n,"gate"),limit:i(n,"limit"),dry_run:n.dryRun===!0,fullChangedFields:r.fullChangedFields,idOnly:r.idOnly,author:i(n,"author"),message:i(n,"message"),owner:i(n,"owner"),apply:n.apply===!0,enforcement:i(n,"enforcement")},r);s(k,r),typeof k=="object"&&k!==null&&"exit_code"in k&&k.exit_code===1&&(process.exitCode=1)}function ue(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(Ae)}(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]="465324c9-c5c2-5093-b979-3fa1a9979911")}catch{}})();function _e(e,t){let a=e?.trim().toLowerCase(),n=t?.trim().toLowerCase();if(a===void 0||a.length===0)return n;if(a==="local-analytics")return n&&n.length>0?n:"status";if(n!==void 0&&n.length>0)throw x({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 a}function Ie(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 fe(e,t){if(e.background===!0){if(e.run!==!0)throw new p("--background requires --run",u.USAGE);if(e.acknowledgeLinkedTests===!0)throw new p("--background cannot be combined with --acknowledge-linked-tests; acknowledgement is a non-executing foreground operation",u.USAGE);if(e.update!==void 0||e.updateIndex!==void 0||e.setJson!==void 0||t.addValues.length>0||t.addJsonValues.length>0||t.removeValues.length>0||t.removeIndexValues.length>0)throw new p("--background does not support --add/--add-json/--remove/--remove-index or metadata edits; update linked tests first, then run in background",u.USAGE)}}async function Ce(e,t,a,n){let o=await C({kind:"test",commandArgs:O(e,{...t,add:n.addValues,addJson:n.addJsonValues,remove:n.removeValues,removeIndex:n.removeIndexValues}),targetId:e,author:typeof t.author=="string"?t.author:void 0,noExtensions:a.noExtensions===!0},a);s(o,a)}function De(e){return{update:typeof e.update=="string"?e.update:void 0,updateIndex:typeof e.updateIndex=="string"||typeof e.updateIndex=="number"?e.updateIndex:void 0,setJson:typeof e.setJson=="string"?e.setJson:void 0}}function D(e,t){return{add:t.addValues,addJson:t.addJsonValues,remove:t.removeValues,removeIndex:t.removeIndexValues,...De(e),list:!!e.list,fullHistory:e.fullHistory===!0,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,workspaceContext:typeof e.workspaceContext=="string"?e.workspaceContext:void 0,overrideLinkedWorkspaceContext:!!e.overrideLinkedWorkspaceContext,allowUntrustedLinkedTests:!!e.allowUntrustedLinkedTests,acknowledgeLinkedTests:!!e.acknowledgeLinkedTests,failOnContextMismatch:!!e.failOnContextMismatch,failOnSkipped:!!e.failOnSkipped,failOnEmptyTestRun:!!e.failOnEmptyTestRun,requireAssertionsForPm:!!e.requireAssertionsForPm,checkContext:!!e.checkContext,fullOutput:!!e.fullOutput,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}}var qt={buildRunTestOptions:D,buildRunTestAllOptions:pe,runWorkspacePositionAction:ye,validateBackgroundTestOptions:fe};async function Se(e,t,a,n){let o=await oe(e,D(t,n),a);(t.update!==void 0||t.updateIndex!==void 0||t.setJson!==void 0||n.addValues.length>0||n.addJsonValues.length>0||n.removeValues.length>0||t.run===!0||n.removeIndexValues.length>0)&&await y(a,o),s(o,a),(o.run_results.some(r=>r.status==="failed"||r.status==="refused")||o.fail_on_skipped_triggered===!0)&&(process.exitCode=u.DEPENDENCY_FAILED)}async function Te(e,t,a){let n=c(a),o=Date.now(),r=Ie(t);t.background===!0&&ne(e,D(t,r),n,v(process.cwd(),n.path),!0),fe(t,r),t.background===!0?await Ce(e,t,n,r):await Se(e,t,n,r),n.profile&&d(`profile:command=test took_ms=${Date.now()-o}`)}function w(e){let t=i(e,"author"),a=i(e,"assignee");if(t!==void 0&&a!==void 0&&t!==a)throw new p("Lifecycle ownership received conflicting --author and --assignee values; use one actor value for both aliases.",u.USAGE,{code:"conflicting_lifecycle_owner",examples:["pm claim pm-123","pm claim pm-123 --start","pm release pm-123"]});return{author:t??a,message:i(e,"message")}}async function Ee(e,t){let a=c(t),n=Date.now();if(e.background===!0){let r=await C({kind:"test-all",commandArgs:L(e),statusFilter:i(e,"status"),noExtensions:a.noExtensions===!0},a);s(r,a),a.profile&&d(`profile:command=test-all took_ms=${Date.now()-n}`);return}let o=await re(pe(e),a);await y(a,{ids:o.results.map(r=>r.id)}),s(o,a),(o.failed>0||o.fail_on_skipped_triggered===!0)&&(process.exitCode=u.DEPENDENCY_FAILED),a.profile&&d(`profile:command=test-all took_ms=${Date.now()-n}`)}function pe(e){return{status:i(e,"status"),limit:i(e,"limit"),offset:i(e,"offset"),timeout:i(e,"timeout"),progress:!!e.progress,envSet:Array.isArray(e.envSet)?e.envSet:[],envClear:Array.isArray(e.envClear)?e.envClear:[],sharedHostSafe:!!e.sharedHostSafe,pmContext:i(e,"pmContext"),overrideLinkedPmContext:!!e.overrideLinkedPmContext,workspaceContext:i(e,"workspaceContext"),overrideLinkedWorkspaceContext:!!e.overrideLinkedWorkspaceContext,allowUntrustedLinkedTests:!!e.allowUntrustedLinkedTests,failOnContextMismatch:!!e.failOnContextMismatch,failOnSkipped:!!e.failOnSkipped,failOnEmptyTestRun:!!e.failOnEmptyTestRun,requireAssertionsForPm:!!e.requireAssertionsForPm,checkContext:!!e.checkContext,fullOutput:!!e.fullOutput,autoPmContext:!!e.autoPmContext}}async function Re(e,t,a,n){let o=c(n),r=Date.now(),l=await ae({subcommand:_e(e,t),limit:i(a,"limit")},o);s(l,o),o.profile&&d(`profile:command=telemetry took_ms=${Date.now()-r}`)}async function Oe(e,t){let a=c(t),n=Date.now(),o=ce(i(e,"analytics")),r=await te(a,{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:i(e,"tagPrefix"),fieldUtilization:e.fieldUtilization===!0,...o});r.recorded_observations?.some(l=>l.changed)===!0&&await y(a,{ids:r.recorded_observations?.flatMap(l=>l.observation.item_id?[l.observation.item_id]:[])}),s(r,a),a.profile&&d(`profile:command=stats took_ms=${Date.now()-n}`)}async function Le(e,t){let a=c(t),n=Date.now(),o=i(e,"threshold"),r=i(e,"limit"),l=await F(a,{...e.exhaustive===!0?{exhaustive:!0}:{},status:Array.isArray(e.status)&&e.status.length>0?e.status:void 0,since:i(e,"since"),...o===void 0?{}:{threshold:Number(o)},...r===void 0?{}:{limit:Number(r)}});s(l,a),a.profile&&d(`profile:command=duplicates took_ms=${Date.now()-n}`)}async function Pe(e,t){let a=c(t),n=Date.now(),o=!!e.strictExit||!!e.failOnWarn,r=await V(a,{strictExit:o,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&&e.full!==!0,skipVectors:!!e.skipVectors,skipIntegrity:!!e.skipIntegrity,skipDrift:!!e.skipDrift,full:!!e.full});s(r,a),o&&!r.ok&&(A({...r,exit_code:u.GENERIC_FAILURE,error_code:"health_findings",error_category:"validation",command_resolution:"health_findings",resolution_stage:"execute"}),process.exitCode=u.GENERIC_FAILURE),a.profile&&d(`profile:command=health took_ms=${Date.now()-n}`)}async function Me(e,t){let a=c(t),n=Date.now(),o=await de({checkMetadata:!!e.checkMetadata,metadataProfile:i(e,"metadataProfile"),checkResolution:!!e.checkResolution,checkCompleteness:!!e.checkCompleteness,checkLifecycle:!!e.checkLifecycle,checkStaleBlockers:!!e.checkStaleBlockers,dependencyCycleSeverity:i(e,"dependencyCycleSeverity"),parentCycleSeverity:i(e,"parentCycleSeverity"),checkFiles:!!e.checkFiles,checkCommandReferences:!!e.checkCommandReferences,scanMode:i(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},a);s(o,a),(e.strictExit||e.failOnWarn)&&(o.has_warnings||!o.ok)&&(A({...o,exit_code:u.GENERIC_FAILURE,error_code:"validation_findings",error_category:"validation",command_resolution:"validation_findings",resolution_stage:"execute"}),process.exitCode=u.GENERIC_FAILURE),a.profile&&d(`profile:command=validate took_ms=${Date.now()-n}`)}async function Fe(e,t){let a=c(t),n=Date.now(),o=await J(a,{dryRun:e.dryRun===!0,scope:Array.isArray(e.scope)?e.scope:[]});s(o,a),a.profile&&d(`profile:command=gc took_ms=${Date.now()-n}`)}async function Ve(e,t,a,n){let o=c(n),r=v(process.cwd(),o.path),l=e.trim().toLowerCase();if(!I.some(m=>m===l))throw x({command_path:"workspace snapshot",token:e,allowed:I,display_name:"workspace snapshot",token_kind:"action",examples:["pm workspace snapshot create before-migration","pm workspace snapshot restore before-migration"]});if(l==="list"){s(await K(r),o);return}if(l==="create"){s(await z(r,t===void 0?{}:{name:t}),o);return}if(t===void 0)throw new p(`pm workspace snapshot ${l} requires a snapshot name or fingerprint`,u.USAGE);if(l==="inspect"){s(await Y(r,t),o);return}if(l==="restore"){if(a.dryRun===!0){s(await X(r,t),o);return}let m=await _(r);s(await Q(r,t,{force:a.force===!0,author:R(i(a,"author"),m.author_default),message:i(a,"message"),lockTtlSeconds:m.locks.ttl_seconds,lockWaitMs:m.locks.wait_ms}),o);return}s(await Z(r,t),o)}async function ye(e,t){let a=c(t);s(await ee(a),a)}async function Ne(e,t){let a=c(t),n=Date.now(),o=await M({action:i(e,"action"),command:i(e,"command"),summary:!!e.summary,schemaOnly:!!e.schemaOnly,flagsOnly:!!e.flagsOnly,availabilityOnly:!!e.availabilityOnly,runtimeOnly:!!e.runtimeOnly||!!e.activeOnly,full:!!e.full},a);s(o,a),a.profile&&d(`profile:command=contracts took_ms=${Date.now()-n}`)}async function qe(e,t,a){let n=t.next===!0,o=t.start===!0;if(o&&e){await ge(e,t,a);return}$(e,n,o);let r=c(a),l=Date.now(),m={...w(t),ifAvailable:t.ifAvailable===!0,...t.takeoverStale===!0?{takeoverStale:!0}:{},maxAttempts:t.maxAttempts,...o?{start:!0}:{}},h=n?await H(!!t.force,r,m,Je(t)):await U(e,!!t.force,r,m);await y(r,h),s(h,r),r.profile&&d(`profile:command=claim took_ms=${Date.now()-l}`)}function Je(e){return{type:i(e,"type"),tag:i(e,"tag"),priority:e.priority,assigneeFilter:i(e,"assigneeFilter"),parent:i(e,"parent"),sprint:i(e,"sprint"),release:i(e,"release"),includeDecisions:e.includeDecisions===!0,includeGates:e.includeGates===!0,includeContainers:e.includeContainers===!0,tokenBudget:e.tokenBudget??e.token_budget,explainRanking:e.explainRanking===!0||e.explain_ranking===!0}}async function Ue(e,t,a){if(t.pause===!0){await he(e,t,a);return}let n=c(a),o=Date.now(),r=await W(e,!!t.force,n,{...w(t),ownershipReleaseBypass:t.ownershipReleaseBypass===!0,handoff:t.handoff});await y(n,r),s(await P("release",[e],t,n,r),n),n.profile&&d(`profile:command=release took_ms=${Date.now()-o}`)}async function S(e){let t=c(e),a=T(e.name());!a||t.json||t.quiet||(await _(v(process.cwd(),t.path))).ux?.deprecation_hints&&d(E(a))}async function ge(e,t,a){await S(a);let n=c(a),o=Date.now(),r=await j(e,{...w(t),force:!!t.force,next:t.next===!0,ifAvailable:t.ifAvailable===!0,...t.takeoverStale===!0?{takeoverStale:!0}:{}},n);await y(n,r.update),s(r,n),n.profile&&d(`profile:command=start-task took_ms=${Date.now()-o}`)}async function he(e,t,a){await S(a);let n=c(a),o=Date.now(),r=await G(e,{...w(t),handoff:i(t,"handoff"),force:!!t.force},n);await y(n,r.release),s(r,n),n.profile&&d(`profile:command=pause-task took_ms=${Date.now()-o}`)}async function $e(e,t,a,n){await S(n);let o=c(n),r=Date.now(),l=await B(e,t,{...w(a),validateClose:i(a,"validateClose"),force:!!a.force},o);await y(o,l.release),s(l,o),o.profile&&d(`profile:command=close-task took_ms=${Date.now()-r}`)}function me(e){return e.option("--background","Run linked tests in managed background mode").option("--timeout <seconds>","Default run timeout in seconds (requires --run)").option("--progress","Emit stderr run progress (requires --run; automatic in TTY)").option("--env-set <value>","Set run environment (KEY=VALUE, repeatable)",f).option("--env-clear <value>","Clear run environment (NAME, repeatable)",f).option("--shared-host-safe","Apply additive shared-host-safe run defaults").option("--pm-context <mode>","PM test context: schema|tracker|auto|none (default: schema)").option("--override-linked-pm-context","Override stored context with --pm-context").option("--workspace-context <mode>","Source-workspace mode: source|isolated|snapshot (default: source)").option("--override-linked-workspace-context","Override stored context with --workspace-context").option("--allow-untrusted-linked-tests","Execute untrusted linked commands when project policy also permits it").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","Fail successful commands reporting zero executed tests").option("--require-assertions-for-pm","Require assertion metadata for linked PM command tests").option("--check-context","Check PM context before execution and report the full execution context").option("--full-output","Report full stdout/stderr of passing rows").option("--auto-pm-context","Route mismatched PM tracker reads through tracker context")}function Jt(e){ue(e);let t=e.command("test").argument("<id>","Item id").option("--add <value>","Link isolated test; runs only with --run (CSV/markdown or stdin)",f).option("--add-json <value>","Link isolated test; runs only with --run (JSON object/array or stdin)",f).option("--remove <value>","Remove exact command/path (command=<value>, path=<value>, or stdin -)",f).option("--remove-index <n>","Remove 1-based --list position (repeatable)",f).option("--list","List linked tests without mutating").option("--update <value>","Edit exact command or path=<value>").option("--update-index <n>","Edit current 1-based --list position").option("--set-json <value>","Metadata patch; null clears optional fields").option("--run","Run linked test commands").option("--match <value>","Run matching command/path substring").option("--only-index <n>","Run 1-based --list position").option("--only-last","Run most recently added test").option("--full-history","Return all linked tests after a write");t.option("--acknowledge-linked-tests","Trust current commands in this clone without execution"),me(t).option("--measure <value>","Record name=value[,unit=...][,threshold=...]; requires --run",f).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(Te);let a=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");me(a).action(Ee),e.command("test-runs-worker",{hidden:!0}).argument("<runId>","Background run id").description("Internal background worker command.").action(async(b,k,ke)=>{let we=c(ke);await ie(b,we)}),e.command("telemetry").argument("[namespace-or-subcommand]","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(Re),e.command("duplicates").description("Find duplicate clusters across all statuses.").option("--status <value>","Statuses (repeatable or comma-separated)",f,[]).option("--since <value>","Created at or after this time").option("--threshold <value>","Minimum similarity (0-1)").option("--limit <n>","Maximum clusters").option("--exhaustive","Score all pairs within the safety bound").action(Le),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(Oe),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 status and warning count, also with --full").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 every check (slow integrity, drift, vectors too); keeps --summary/--brief").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(Pe),e.command("validate").description("Validate metadata, lifecycle policies, files, command references, and history.").option("--check-metadata","Run metadata completeness checks").option("--metadata-profile <value>","Metadata profile (core|strict|custom)").option("--check-resolution","Run closed-item resolution metadata checks").option("--check-completeness","Check declarative lifecycle field requirements").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 diagnostic ID lists").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 safe, deterministic field backfills").option("--dry-run","Preview planned --auto-fix/--prune-missing fixes without applying them").option("--fix-scope <scope>","Grant --auto-fix scopes (metadata, resolution, estimates, timestamps, lifecycle; comma-separated or repeatable). Default: metadata, resolution; other scopes require explicit opt-in",f).option("--prune-missing","Remove deleted-path file/doc links; preserves 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(Me),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",f).description("Delete optional cache artifacts by default (including expired lock debris) and show a summary.").action(Fe);let n=e.command("workspace").description("Inspect workspace state and snapshots.");n.command("position").description("Show merge and history readiness.").action(ye),n.command("snapshot").argument("<action>","Action: create, list, inspect, restore, delete").argument("[target]","Optional name for create; name or fingerprint otherwise").description("Manage 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(Ve),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(Ne);let o=e.command("claim").option("--start","Claim and start (id or --next)").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 another author's claim (skipped=true)").option("--takeover-stale","Take over an idle claim (stale-work policy)").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("--include-gates","Allow --next to claim outcome gates").option("--include-containers","Allow --next to claim containers with unfinished descendants").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(qe);g(o,"--assignee <value>","Alias for --author on lifecycle ownership commands"),g(o,"--token_budget <n>","Alias for --token-budget"),g(o,"--explain_ranking","Alias for --explain-ranking");let r=e.command("release").option("--pause","Use open status").option("--handoff <status>","Needs --message").argument("<id>","Item id").option("--author <value>","Author").option("--message <value>","Message").option("--force","Override ownership").description("Release ownership.").action(Ue);g(r,"--assignee <value>","Alias for --author on lifecycle ownership commands");let l=e.command("start-task",{hidden:!0}).argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership or terminal override when required").option("--takeover-stale","Take over an idle claim (stale-work policy)").description("Lifecycle alias: claim an item and move it to in_progress.").action(ge);g(l,"--assignee <value>","Alias for --author on lifecycle ownership commands");let m=e.command("pause-task",{hidden:!0}).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(he);g(m,"--assignee <value>","Alias for --author on lifecycle ownership commands");let h=e.command("close-task",{hidden:!0}).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($e);g(h,"--assignee <value>","Alias for --author on lifecycle ownership commands")}export{qt as _testOnlyRegisterOperations,Jt as registerOperationCommands,$ as requireClaimTarget};
2
+ //# sourceMappingURL=register-operations-W4E2KEMA.js.map
@@ -1,2 +1,2 @@
1
- import"./chunk-DEZPZOQ7.js";import{a as W}from"./chunk-KIQNEOKJ.js";import{g as T,i as P}from"./chunk-DXSZL3T6.js";import{Da as I,Ia as O,Ka as j,ra as U,ua as L}from"./chunk-3IU2S5UQ.js";import"./chunk-H64BNM4A.js";import"./chunk-Y4LXVPA5.js";import"./chunk-RXNBNF6O.js";import{Cc as b,Fc as v}from"./chunk-7K2RUKMK.js";import"./chunk-4FIN2XWC.js";import"./chunk-IB7UB5TE.js";import{X as S}from"./chunk-AM26RAG7.js";import{v as R}from"./chunk-CR5GC3VO.js";import{$g as w,A as G,Sa as E,Wg as D,ah as y,z as $}from"./chunk-7UUPLMCU.js";import"./chunk-VS565KBX.js";import{A as d,C as h}from"./chunk-5OFMWP3Q.js";import"./chunk-XAWE4EAK.js";import C from"node:fs/promises";import F 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]="26ea7f42-d5f7-5ada-afd9-389dadc4d138")}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]="0b0e08e0-f6e7-59c4-ac96-9f47b172727a")}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]="d975120a-964e-5b19-ae10-8ba011ba9bf8")}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]="108609fa-51fc-5bd0-ac54-de2ad14a66c6")}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]="b36466e6-5574-5509-909a-e8599f11664c")}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]="e5e1e242-6864-5a72-adb9-0eda4c65a0c3")}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]="7462433c-f34c-5b30-a676-a296dc3e3428")}catch{}})();var H={extension:"extension",package:void 0};async function _(e,t){if(!e)return;let o=$(e),i=b(t);await R(E(process.cwd(),i.path)).then(a=>a.ux.deprecation_hints)&&y(G(o))}var X={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 Y(e){let t=e.capability,o=typeof t=="string"?[t]:Array.isArray(t)?t.filter(a=>typeof a=="string"):[],i=[...new Set(o.map(a=>a.trim().toLowerCase()).filter(a=>a.length>0))];if(i.length>1)throw new h(`Multiple scaffold capabilities cannot be combined yet: ${i.join(", ")}. Choose one capability per scaffold.`,d.USAGE);return i[0]}function A(e,t,o="extension"){let i={...e};t!==void 0&&(i[X[t]]=!0);let a=(...c)=>c.some(s=>i[s]===!0),r=(...c)=>{for(let s of c)if(typeof i[s]=="string")return i[s]};return{init:a("init"),scaffold:a("scaffold"),install:a("install"),uninstall:a("uninstall"),explore:a("explore","list"),manage:a("manage"),describe:a("describe"),markdown:a("markdown"),reload:a("reload"),doctor:a("doctor"),catalog:a("catalog"),adopt:a("adopt"),adoptAll:a("adoptAll","adopt_all","adopt-all"),activate:a("activate"),deactivate:a("deactivate"),migrate:a("migrate"),project:a("project"),local:a("local"),global:a("global"),gh:r("gh"),github:r("github"),ref:r("ref"),capability:Y(e),declarative:a("declarative"),fields:r("fields"),detail:r("detail"),output:r("output"),trace:a("trace"),watch:a("watch"),runtimeProbe:a("runtimeProbe","runtime_probe","runtime-probe"),offline:a("offline"),fixManagedState:a("fixManagedState","fix_managed_state","fix-managed-state"),isolated:a("isolated"),ignoreGlobal:a("ignoreGlobal","ignore_global","ignore-global"),strictExit:a("strictExit","strict_exit","strict-exit"),failOnWarn:a("failOnWarn","fail_on_warn","fail-on-warn"),dryRun:a("dryRun","dry_run","dry-run"),vocabulary:o}}async function J(e){let t=(await C.readdir(process.cwd())).filter(i=>!i.startsWith(".")).sort((i,a)=>i.localeCompare(a)),o=[...e].sort((i,a)=>i.localeCompare(a));return t.length===o.length&&t.every((i,a)=>i===o[a])}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 J(t)?["*"]:t}function z(e,t,o){let i=e.markdown===!0;if(o!==void 0&&o==="")throw new h("--output requires a non-empty file path.",d.USAGE);if(o!==void 0&&!i)throw new h("--output is only supported with --markdown describe output.",d.USAGE);if(i){if(t.json)throw new h("Cannot combine --json with --markdown.",d.USAGE);if(e.describe!==!0)throw new h("--markdown is only supported by the describe action.",d.USAGE)}}async function Z(e){let t=L(e.result.details,e.vocabulary);if(e.outputPath!==void 0){let o=F.resolve(e.outputPath);await C.mkdir(F.dirname(o),{recursive:!0}),await C.writeFile(o,t,"utf8")}if(!e.globalOptions.quiet){for(let o of e.result.warnings)y(`warning: ${o}`);e.outputPath===void 0&&D(t)}}function ee(e,t){let o=!!t.strictExit||!!t.failOnWarn;if(e.action!=="doctor"||!o)return;let i=e.details!==null&&typeof e.details=="object"?e.details:{},a=i.summary!==null&&typeof i.summary=="object"?i.summary:null,r=a&&typeof a.status=="string"?a.status:void 0;(e.warnings.length>0||r!==void 0&&r!=="ok")&&(process.exitCode=d.GENERIC_FAILURE)}async function g(e,t,o,i,a="extension"){let r=b(o),c=Date.now(),s=a==="extension"?"package":a;await _(H[a],o);let n=A(t,i,s),l=(typeof n.output=="string"?n.output:void 0)?.trim();z(n,r,l);let u=await I(e,n,r);n.markdown===!0?await Z({result:u,vocabulary:s,outputPath:l,globalOptions:r}):w(u,r),ee(u,n),u.ok===!1&&(process.exitCode=d.GENERIC_FAILURE),r.profile&&y(`profile:command=extension took_ms=${Date.now()-c}`)}function te(e){return e.details!==null&&typeof e.details=="object"?e.details:{}}function oe(e){return e instanceof h?{message:e.message,exit_code:e.exitCode,...e.context}:{message:e instanceof Error?e.message:String(e),exit_code:d.GENERIC_FAILURE}}async function ae(e,t,o){let i=[],a=[],r=d.GENERIC_FAILURE;for(let c of e)try{let s=await I(c,t,o),n=te(s),l=Array.isArray(s.warnings)?s.warnings:[];a.push(...l);let u=s.ok===!0;i.push({target:c,ok:u,extension:n.extension,source:n.source,install_plan:n.install_plan,dry_run:n.dry_run,destination_path:n.destination_path,activated:n.activated,settings_changed:n.settings_changed,previous_state_preserved:n.previous_state_preserved,rollback:n.rollback,command_paths:n.command_paths,action_paths:n.action_paths,runtime_activation_status:n.runtime_activation_status,activation_diagnostics:n.activation_diagnostics,command_discovery:n.command_discovery,verification:n.verification,warnings:l,...u?{}:{error:{message:"Extension install returned ok=false without throwing an error.",exit_code:d.GENERIC_FAILURE,code:"extension_install_soft_failed"}}})}catch(s){let n=oe(s),l=n.exit_code;typeof l=="number"&&r===d.GENERIC_FAILURE&&l!==d.GENERIC_FAILURE&&(r=l),i.push({target:c,ok:!1,error:n})}return{rows:i,warnings:a,failureExitCode:r}}async function N(e,t,o,i){let a=i==="extension"?"package":i;await _(H[i],o);let r=await Q(e);if(r===void 0||r.length<=1){await g(r?.[0],t,o,"install",a);return}let c=b(o),s=Date.now(),n=A(t,"install",a);if(z(n,c,void 0),[n.gh,n.github].some(k=>typeof k=="string"&&k.trim().length>0))throw new h("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 package install --gh owner/repo","pm package install npm:pm-guide-shell pm-todos"]});let{rows:l,warnings:u,failureExitCode:m}=await ae(r,n,c),f=l.filter(k=>k.ok!==!0).length,B={ok:f===0,action:"install",scope:n.global===!0?"global":"project",installed_count:n.dryRun===!0?0:l.length-f,...n.dryRun===!0?{dry_run:!0,planned_count:l.length-f}:{},failed_count:f,targets:l,warnings:[...new Set(u)].sort((k,V)=>k.localeCompare(V))};w(B,c),f>0&&(process.exitCode=m),c.profile&&y(`profile:command=extension took_ms=${Date.now()-s}`)}function ie(e){return e.option("--project","Use project extension scope (default)").option("--local","Alias for --project").option("--global","Use global extension scope")}function x(e){return e.option("--project","Use project package scope (default)").option("--local","Alias for --project").option("--global","Use global package scope")}function p(e,t){return t==="package"?x(e):ie(e)}function q(e){return e.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")}async function K(e,t,o){let i=b(t),a=Date.now();o&&await _("upgrade",t);let r=await P(e,t.optsWithGlobals(),i);w(r,i),r.ok||(process.exitCode=d.GENERIC_FAILURE),i.profile&&y(`profile:command=package-upgrade took_ms=${Date.now()-a}`)}function M(e,t){let o=t==="package"?"package":"extension",i=t==="package"?"packages":"extensions",a=t,r=e.command(a,{hidden:t==="extension"}).argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} source, name, or scaffold path`).option("--init",`Generate a starter ${o} scaffold at target path`).option("--scaffold","Alias for --init").option("--capability <kind>","Starter capability for --init (default: commands)",v).option("--install",`Install a ${o} source`).option("--dry-run","Preview install without writes or activation").option("--uninstall",`Uninstall an installed ${o}`).option("--explore",`List discovered ${i} in selected scope`).option("--list","Alias for --explore").option("--manage",`List managed ${i} and updates`).option("--offline","Skip remote freshness checks during manage").option("--describe",`Show surfaces registered by a loaded ${o}`).option("--markdown","Render describe as Markdown").option("--output <path>","Write Markdown to a file").option("--reload",`Reload ${i} without import cache`).option("--watch","Use watch mode with --reload").option("--doctor",`Run ${o} diagnostics`).option("--catalog",`List bundled first-party ${o} catalog metadata`).option("--adopt",`Adopt unmanaged ${o}`).option("--adopt-all",`Adopt all unmanaged ${i}`).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 ${i} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${i} 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 in project or global scope.":"Manage extension lifecycle in project or global scope.").action(async(s,n,l)=>{await g(s,l.optsWithGlobals(),l,void 0,t)});t==="package"&&(r.alias("packages"),r.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"));let c=r.command("init").alias("scaffold").argument("<target>","Scaffold target directory path").option("--capability <kind>",`Capability the starter targets (${U.join("|")}; default commands)`,v).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)"),p(c,t).action(async(s,n,l)=>{await g(s,l.optsWithGlobals(),l,"init",t)}),p(r.command("install").option("--dry-run","Resolve sources and estimate copying without destination writes or activation").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(s,n,l)=>{await N(s,l.optsWithGlobals(),l,t)}),p(r.command("uninstall").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Uninstall an installed ${o}.`),t).action(async(s,n,l)=>{await g(s,l.optsWithGlobals(),l,"uninstall",t)}),p(r.command("explore").description(`List discovered ${i} in selected scope.`),t).action(async(s,n)=>{await g(void 0,n.optsWithGlobals(),n,"explore",t)}),p(r.command("inventory").argument("[name]",`${o[0].toUpperCase()}${o.slice(1)} name or directory to inspect`).description(`Read configured ${o} install and enablement state without activating extension code.`),t).action(async(s,n,l)=>{let u=b(l),m=l.optsWithGlobals();if(m.global===!0&&(m.project===!0||m.local===!0))throw new h("--global and --project/--local are mutually exclusive.",d.USAGE);let f=await W({pmRoot:E(process.cwd(),u.path),scope:m.global===!0?"global":"project",name:s});w(f,u),f.complete||(process.exitCode=d.GENERIC_FAILURE)}),p(r.command("manage").option("--offline","Skip remote freshness checks and report unknown update availability").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${i} before diagnostics/update checks`).description(`List managed ${i} with update-check metadata.`),t).action(async(s,n)=>{await g(void 0,n.optsWithGlobals(),n,"manage",t)}),p(r.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(s,n,l)=>{await g(s,l.optsWithGlobals(),l,"describe",t)}),p(r.command("reload").option("--watch","Use watch mode for repeated reload checks").description(`Reload ${i} with cache-busted module imports.`),t).action(async(s,n)=>{await g(void 0,n.optsWithGlobals(),n,"reload",t)}),p(r.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 ${i} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${i} 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(s,n)=>{await g(void 0,n.optsWithGlobals(),n,"doctor",t)}),p(r.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(s,n)=>{await g(void 0,n.optsWithGlobals(),n,"catalog",t)}),p(r.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(s,n,l)=>{await g(s,l.optsWithGlobals(),l,"adopt",t)}),p(r.command("adopt-all").description(`Adopt all unmanaged ${i} into managed metadata.`),t).action(async(s,n)=>{await g(void 0,n.optsWithGlobals(),n,"adopt-all",t)}),p(r.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(s,n)=>{await g(void 0,n.optsWithGlobals(),n,"migrate",t)}),p(r.command("activate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Activate a ${o} in selected scope settings.`),t).action(async(s,n,l)=>{await g(s,l.optsWithGlobals(),l,"activate",t)}),p(r.command("deactivate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Deactivate a ${o} in selected scope settings.`),t).action(async(s,n,l)=>{await g(s,l.optsWithGlobals(),l,"deactivate",t)}),t==="package"&&q(x(r.command("upgrade").argument("[target]","Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages").description("Upgrade the pm CLI/SDK and refresh managed installable pm packages."))).action(async(s,n,l)=>{await K(s,l,!1)})}async function ne(e,t,o){let i=b(o),a=Date.now(),r=await j(e,i,{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}),c=t.verbose===!0||i.json===!0;w(c?r:O(r,!0),i),i.profile&&y(`profile:command=init took_ms=${Date.now()-a}`)}function re(e,t,o,i){let a=e!==void 0&&new Set(["get","set","list","export"]).has(e);return{resolvedScope:a?S(t):e??"project",resolvedAction:a?e:t??"list",resolvedKey:a?t:o,resolvedValue:a?o:i}}function se(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 le(e,t,o,i,a,r){let c=b(r),s=Date.now(),{resolvedScope:n,resolvedAction:l,resolvedKey:u,resolvedValue:m}=re(e,t,o,i),f=await T(n,l,u,se(a),c,typeof m=="string"?m:void 0);w(f,c),c.profile&&y(`profile:command=config took_ms=${Date.now()-s}`)}var Ue={normalizeExtensionOptions:A};function Le(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,i)=>{await ne(t,o,i)}),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]","Value for set, validated by key. Dotted leaves accept values (e.g. context.default_depth deep); the context group takes --default-depth/--section-* flags.").option("--criterion <text>","Criteria value for definition-of-done, metadata-required-fields, or lifecycle pattern keys (repeatable for set)",v).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; untrusted-linked-test-execution=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|full").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,i,a,r,c)=>{await le(t,o,i,a,r,c)}),M(e,"extension"),M(e,"package"),x(e.command("install",{hidden:!0}).option("--dry-run","Resolve sources and estimate copying without destination writes or activation").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,i)=>{await _("install",i),await N(t,i.optsWithGlobals(),i,"package")}),q(x(e.command("upgrade",{hidden:!0}).argument("[target]","Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages").description("Upgrade the pm CLI/SDK and refresh managed installable pm packages."))).action(async(t,o,i)=>{await K(t,i,!0)})}export{Ue as _testOnlyRegisterSetup,Le as registerSetupCommands};
2
- //# sourceMappingURL=register-setup-4N56VL2P.js.map
1
+ import"./chunk-DEZPZOQ7.js";import{a as W}from"./chunk-NMVPQTZI.js";import{g as T,i as P}from"./chunk-XPBPGDFW.js";import{Ea as I,Ja as O,La as j,ra as U,ua as L}from"./chunk-2UTJ5QIE.js";import"./chunk-H64BNM4A.js";import"./chunk-Y4LXVPA5.js";import"./chunk-AMHD7WIV.js";import{Cc as b,Fc as v}from"./chunk-AOV5HG3Y.js";import"./chunk-Z5LHCEXG.js";import"./chunk-IB7UB5TE.js";import{X as S}from"./chunk-723PMYNX.js";import{v as R}from"./chunk-CR5GC3VO.js";import{$g as w,A as G,Sa as E,Wg as D,ah as y,z as $}from"./chunk-7UUPLMCU.js";import"./chunk-VS565KBX.js";import{A as d,C as h}from"./chunk-5OFMWP3Q.js";import"./chunk-XAWE4EAK.js";import C from"node:fs/promises";import F 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]="26ea7f42-d5f7-5ada-afd9-389dadc4d138")}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]="0b0e08e0-f6e7-59c4-ac96-9f47b172727a")}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]="d975120a-964e-5b19-ae10-8ba011ba9bf8")}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]="108609fa-51fc-5bd0-ac54-de2ad14a66c6")}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]="b36466e6-5574-5509-909a-e8599f11664c")}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]="e5e1e242-6864-5a72-adb9-0eda4c65a0c3")}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]="7462433c-f34c-5b30-a676-a296dc3e3428")}catch{}})();var H={extension:"extension",package:void 0};async function _(e,t){if(!e)return;let o=$(e),i=b(t);await R(E(process.cwd(),i.path)).then(a=>a.ux.deprecation_hints)&&y(G(o))}var X={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 Y(e){let t=e.capability,o=typeof t=="string"?[t]:Array.isArray(t)?t.filter(a=>typeof a=="string"):[],i=[...new Set(o.map(a=>a.trim().toLowerCase()).filter(a=>a.length>0))];if(i.length>1)throw new h(`Multiple scaffold capabilities cannot be combined yet: ${i.join(", ")}. Choose one capability per scaffold.`,d.USAGE);return i[0]}function A(e,t,o="extension"){let i={...e};t!==void 0&&(i[X[t]]=!0);let a=(...c)=>c.some(s=>i[s]===!0),r=(...c)=>{for(let s of c)if(typeof i[s]=="string")return i[s]};return{init:a("init"),scaffold:a("scaffold"),install:a("install"),uninstall:a("uninstall"),explore:a("explore","list"),manage:a("manage"),describe:a("describe"),markdown:a("markdown"),reload:a("reload"),doctor:a("doctor"),catalog:a("catalog"),adopt:a("adopt"),adoptAll:a("adoptAll","adopt_all","adopt-all"),activate:a("activate"),deactivate:a("deactivate"),migrate:a("migrate"),project:a("project"),local:a("local"),global:a("global"),gh:r("gh"),github:r("github"),ref:r("ref"),capability:Y(e),declarative:a("declarative"),fields:r("fields"),detail:r("detail"),output:r("output"),trace:a("trace"),watch:a("watch"),runtimeProbe:a("runtimeProbe","runtime_probe","runtime-probe"),offline:a("offline"),fixManagedState:a("fixManagedState","fix_managed_state","fix-managed-state"),isolated:a("isolated"),ignoreGlobal:a("ignoreGlobal","ignore_global","ignore-global"),strictExit:a("strictExit","strict_exit","strict-exit"),failOnWarn:a("failOnWarn","fail_on_warn","fail-on-warn"),dryRun:a("dryRun","dry_run","dry-run"),vocabulary:o}}async function J(e){let t=(await C.readdir(process.cwd())).filter(i=>!i.startsWith(".")).sort((i,a)=>i.localeCompare(a)),o=[...e].sort((i,a)=>i.localeCompare(a));return t.length===o.length&&t.every((i,a)=>i===o[a])}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 J(t)?["*"]:t}function z(e,t,o){let i=e.markdown===!0;if(o!==void 0&&o==="")throw new h("--output requires a non-empty file path.",d.USAGE);if(o!==void 0&&!i)throw new h("--output is only supported with --markdown describe output.",d.USAGE);if(i){if(t.json)throw new h("Cannot combine --json with --markdown.",d.USAGE);if(e.describe!==!0)throw new h("--markdown is only supported by the describe action.",d.USAGE)}}async function Z(e){let t=L(e.result.details,e.vocabulary);if(e.outputPath!==void 0){let o=F.resolve(e.outputPath);await C.mkdir(F.dirname(o),{recursive:!0}),await C.writeFile(o,t,"utf8")}if(!e.globalOptions.quiet){for(let o of e.result.warnings)y(`warning: ${o}`);e.outputPath===void 0&&D(t)}}function ee(e,t){let o=!!t.strictExit||!!t.failOnWarn;if(e.action!=="doctor"||!o)return;let i=e.details!==null&&typeof e.details=="object"?e.details:{},a=i.summary!==null&&typeof i.summary=="object"?i.summary:null,r=a&&typeof a.status=="string"?a.status:void 0;(e.warnings.length>0||r!==void 0&&r!=="ok")&&(process.exitCode=d.GENERIC_FAILURE)}async function g(e,t,o,i,a="extension"){let r=b(o),c=Date.now(),s=a==="extension"?"package":a;await _(H[a],o);let n=A(t,i,s),l=(typeof n.output=="string"?n.output:void 0)?.trim();z(n,r,l);let u=await I(e,n,r);n.markdown===!0?await Z({result:u,vocabulary:s,outputPath:l,globalOptions:r}):w(u,r),ee(u,n),u.ok===!1&&(process.exitCode=d.GENERIC_FAILURE),r.profile&&y(`profile:command=extension took_ms=${Date.now()-c}`)}function te(e){return e.details!==null&&typeof e.details=="object"?e.details:{}}function oe(e){return e instanceof h?{message:e.message,exit_code:e.exitCode,...e.context}:{message:e instanceof Error?e.message:String(e),exit_code:d.GENERIC_FAILURE}}async function ae(e,t,o){let i=[],a=[],r=d.GENERIC_FAILURE;for(let c of e)try{let s=await I(c,t,o),n=te(s),l=Array.isArray(s.warnings)?s.warnings:[];a.push(...l);let u=s.ok===!0;i.push({target:c,ok:u,extension:n.extension,source:n.source,install_plan:n.install_plan,dry_run:n.dry_run,destination_path:n.destination_path,activated:n.activated,settings_changed:n.settings_changed,previous_state_preserved:n.previous_state_preserved,rollback:n.rollback,command_paths:n.command_paths,action_paths:n.action_paths,runtime_activation_status:n.runtime_activation_status,activation_diagnostics:n.activation_diagnostics,command_discovery:n.command_discovery,verification:n.verification,warnings:l,...u?{}:{error:{message:"Extension install returned ok=false without throwing an error.",exit_code:d.GENERIC_FAILURE,code:"extension_install_soft_failed"}}})}catch(s){let n=oe(s),l=n.exit_code;typeof l=="number"&&r===d.GENERIC_FAILURE&&l!==d.GENERIC_FAILURE&&(r=l),i.push({target:c,ok:!1,error:n})}return{rows:i,warnings:a,failureExitCode:r}}async function N(e,t,o,i){let a=i==="extension"?"package":i;await _(H[i],o);let r=await Q(e);if(r===void 0||r.length<=1){await g(r?.[0],t,o,"install",a);return}let c=b(o),s=Date.now(),n=A(t,"install",a);if(z(n,c,void 0),[n.gh,n.github].some(k=>typeof k=="string"&&k.trim().length>0))throw new h("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 package install --gh owner/repo","pm package install npm:pm-guide-shell pm-todos"]});let{rows:l,warnings:u,failureExitCode:m}=await ae(r,n,c),f=l.filter(k=>k.ok!==!0).length,B={ok:f===0,action:"install",scope:n.global===!0?"global":"project",installed_count:n.dryRun===!0?0:l.length-f,...n.dryRun===!0?{dry_run:!0,planned_count:l.length-f}:{},failed_count:f,targets:l,warnings:[...new Set(u)].sort((k,V)=>k.localeCompare(V))};w(B,c),f>0&&(process.exitCode=m),c.profile&&y(`profile:command=extension took_ms=${Date.now()-s}`)}function ie(e){return e.option("--project","Use project extension scope (default)").option("--local","Alias for --project").option("--global","Use global extension scope")}function x(e){return e.option("--project","Use project package scope (default)").option("--local","Alias for --project").option("--global","Use global package scope")}function p(e,t){return t==="package"?x(e):ie(e)}function q(e){return e.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")}async function K(e,t,o){let i=b(t),a=Date.now();o&&await _("upgrade",t);let r=await P(e,t.optsWithGlobals(),i);w(r,i),r.ok||(process.exitCode=d.GENERIC_FAILURE),i.profile&&y(`profile:command=package-upgrade took_ms=${Date.now()-a}`)}function M(e,t){let o=t==="package"?"package":"extension",i=t==="package"?"packages":"extensions",a=t,r=e.command(a,{hidden:t==="extension"}).argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} source, name, or scaffold path`).option("--init",`Generate a starter ${o} scaffold at target path`).option("--scaffold","Alias for --init").option("--capability <kind>","Starter capability for --init (default: commands)",v).option("--install",`Install a ${o} source`).option("--dry-run","Preview install without writes or activation").option("--uninstall",`Uninstall an installed ${o}`).option("--explore",`List discovered ${i} in selected scope`).option("--list","Alias for --explore").option("--manage",`List managed ${i} and updates`).option("--offline","Skip remote freshness checks during manage").option("--describe",`Show surfaces registered by a loaded ${o}`).option("--markdown","Render describe as Markdown").option("--output <path>","Write Markdown to a file").option("--reload",`Reload ${i} without import cache`).option("--watch","Use watch mode with --reload").option("--doctor",`Run ${o} diagnostics`).option("--catalog",`List bundled first-party ${o} catalog metadata`).option("--adopt",`Adopt unmanaged ${o}`).option("--adopt-all",`Adopt all unmanaged ${i}`).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 ${i} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${i} 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 in project or global scope.":"Manage extension lifecycle in project or global scope.").action(async(s,n,l)=>{await g(s,l.optsWithGlobals(),l,void 0,t)});t==="package"&&(r.alias("packages"),r.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"));let c=r.command("init").alias("scaffold").argument("<target>","Scaffold target directory path").option("--capability <kind>",`Capability the starter targets (${U.join("|")}; default commands)`,v).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)"),p(c,t).action(async(s,n,l)=>{await g(s,l.optsWithGlobals(),l,"init",t)}),p(r.command("install").option("--dry-run","Resolve sources and estimate copying without destination writes or activation").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(s,n,l)=>{await N(s,l.optsWithGlobals(),l,t)}),p(r.command("uninstall").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Uninstall an installed ${o}.`),t).action(async(s,n,l)=>{await g(s,l.optsWithGlobals(),l,"uninstall",t)}),p(r.command("explore").description(`List discovered ${i} in selected scope.`),t).action(async(s,n)=>{await g(void 0,n.optsWithGlobals(),n,"explore",t)}),p(r.command("inventory").argument("[name]",`${o[0].toUpperCase()}${o.slice(1)} name or directory to inspect`).description(`Read configured ${o} install and enablement state without activating extension code.`),t).action(async(s,n,l)=>{let u=b(l),m=l.optsWithGlobals();if(m.global===!0&&(m.project===!0||m.local===!0))throw new h("--global and --project/--local are mutually exclusive.",d.USAGE);let f=await W({pmRoot:E(process.cwd(),u.path),scope:m.global===!0?"global":"project",name:s});w(f,u),f.complete||(process.exitCode=d.GENERIC_FAILURE)}),p(r.command("manage").option("--offline","Skip remote freshness checks and report unknown update availability").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${i} before diagnostics/update checks`).description(`List managed ${i} with update-check metadata.`),t).action(async(s,n)=>{await g(void 0,n.optsWithGlobals(),n,"manage",t)}),p(r.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(s,n,l)=>{await g(s,l.optsWithGlobals(),l,"describe",t)}),p(r.command("reload").option("--watch","Use watch mode for repeated reload checks").description(`Reload ${i} with cache-busted module imports.`),t).action(async(s,n)=>{await g(void 0,n.optsWithGlobals(),n,"reload",t)}),p(r.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 ${i} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${i} 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(s,n)=>{await g(void 0,n.optsWithGlobals(),n,"doctor",t)}),p(r.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(s,n)=>{await g(void 0,n.optsWithGlobals(),n,"catalog",t)}),p(r.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(s,n,l)=>{await g(s,l.optsWithGlobals(),l,"adopt",t)}),p(r.command("adopt-all").description(`Adopt all unmanaged ${i} into managed metadata.`),t).action(async(s,n)=>{await g(void 0,n.optsWithGlobals(),n,"adopt-all",t)}),p(r.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(s,n)=>{await g(void 0,n.optsWithGlobals(),n,"migrate",t)}),p(r.command("activate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Activate a ${o} in selected scope settings.`),t).action(async(s,n,l)=>{await g(s,l.optsWithGlobals(),l,"activate",t)}),p(r.command("deactivate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Deactivate a ${o} in selected scope settings.`),t).action(async(s,n,l)=>{await g(s,l.optsWithGlobals(),l,"deactivate",t)}),t==="package"&&q(x(r.command("upgrade").argument("[target]","Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages").description("Upgrade the pm CLI/SDK and refresh managed installable pm packages."))).action(async(s,n,l)=>{await K(s,l,!1)})}async function ne(e,t,o){let i=b(o),a=Date.now(),r=await j(e,i,{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}),c=t.verbose===!0||i.json===!0;w(c?r:O(r,!0),i),i.profile&&y(`profile:command=init took_ms=${Date.now()-a}`)}function re(e,t,o,i){let a=e!==void 0&&new Set(["get","set","list","export"]).has(e);return{resolvedScope:a?S(t):e??"project",resolvedAction:a?e:t??"list",resolvedKey:a?t:o,resolvedValue:a?o:i}}function se(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 le(e,t,o,i,a,r){let c=b(r),s=Date.now(),{resolvedScope:n,resolvedAction:l,resolvedKey:u,resolvedValue:m}=re(e,t,o,i),f=await T(n,l,u,se(a),c,typeof m=="string"?m:void 0);w(f,c),c.profile&&y(`profile:command=config took_ms=${Date.now()-s}`)}var Ue={normalizeExtensionOptions:A};function Le(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,i)=>{await ne(t,o,i)}),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]","Value for set, validated by key. Dotted leaves accept values (e.g. context.default_depth deep); the context group takes --default-depth/--section-* flags.").option("--criterion <text>","Criteria value for definition-of-done, metadata-required-fields, or lifecycle pattern keys (repeatable for set)",v).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; untrusted-linked-test-execution=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|full").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,i,a,r,c)=>{await le(t,o,i,a,r,c)}),M(e,"extension"),M(e,"package"),x(e.command("install",{hidden:!0}).option("--dry-run","Resolve sources and estimate copying without destination writes or activation").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,i)=>{await _("install",i),await N(t,i.optsWithGlobals(),i,"package")}),q(x(e.command("upgrade",{hidden:!0}).argument("[target]","Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages").description("Upgrade the pm CLI/SDK and refresh managed installable pm packages."))).action(async(t,o,i)=>{await K(t,i,!0)})}export{Ue as _testOnlyRegisterSetup,Le as registerSetupCommands};
2
+ //# sourceMappingURL=register-setup-RYRIBNSN.js.map
@@ -1,2 +1,2 @@
1
- import{S as b,T as B,U as j,V as I,W as G,X as V,Y as M,a as se,ba as F,g as L,i as W,o as R,q as P,s as U}from"./chunk-FPPYE6CY.js";import{E as le,F as ce,H as v,I as de,W as H,fa as Z,o as D,oa as ue,p as X}from"./chunk-ZDY5L2C2.js";import{ja as O}from"./chunk-A2CLYPDA.js";import{A as p,z as f}from"./chunk-IXYBN6D2.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]="202cbe4e-7d36-5b12-be9d-d35608a6b36d")}catch{}})();var Ie=new Set(["none","null"]);function Tt(e={}){return[{optionKey:"dep",clearFlagKey:"clearDeps",valueFlag:"--dep",clearFlag:"--clear-deps",...e.depDisableFlagKey===void 0?{}:{disableFlagKey:e.depDisableFlagKey}},{optionKey:"comment",clearFlagKey:"clearComments",valueFlag:"--comment",clearFlag:"--clear-comments"},{optionKey:"note",clearFlagKey:"clearNotes",valueFlag:"--note",clearFlag:"--clear-notes"},{optionKey:"learning",clearFlagKey:"clearLearnings",valueFlag:"--learning",clearFlag:"--clear-learnings"},{optionKey:"file",clearFlagKey:"clearFiles",valueFlag:"--file",clearFlag:"--clear-files",...e.fileDisableFlagKey===void 0?{}:{disableFlagKey:e.fileDisableFlagKey}},{optionKey:"test",clearFlagKey:"clearTests",valueFlag:"--test",clearFlag:"--clear-tests",...e.testDisableFlagKey===void 0?{}:{disableFlagKey:e.testDisableFlagKey}},{optionKey:"doc",clearFlagKey:"clearDocs",valueFlag:"--doc",clearFlag:"--clear-docs",...e.docDisableFlagKey===void 0?{}:{disableFlagKey:e.docDisableFlagKey}},{optionKey:"reminder",clearFlagKey:"clearReminders",valueFlag:"--reminder",clearFlag:"--clear-reminders"},{optionKey:"event",clearFlagKey:"clearEvents",valueFlag:"--event",clearFlag:"--clear-events"},{optionKey:"typeOption",clearFlagKey:"clearTypeOptions",valueFlag:"--type-option",clearFlag:"--clear-type-options"}]}function N(e){return e===void 0?!1:Ie.has(e.trim().toLowerCase())}function Ct(e,t,r){if(!N(e))return;let n=r?` ${r}`:"";throw new p(`${t} no longer accepts "none" or "null".${n}`.trim(),f.USAGE)}function St(e,t,r){if(!e||e.length===0||X(e)||!e.some(o=>N(o)))return;let n=r?` ${r}`:"";throw new p(`${t} no longer accepts "none" or "null".${n}`.trim(),f.USAGE)}function Rt(e,t){for(let r of t){let n=e[r.optionKey];if(!Array.isArray(n)||n.length===0)continue;if(!n.every(a=>typeof a=="string"))throw new p(`${r.valueFlag} entries must be strings.`,f.USAGE);if(X(n))continue;let o=n;if(o.some(a=>N(a))){if(o.filter(a=>!N(a)).length>0)throw new p(`Cannot mix legacy clear token "none"/"null" with concrete ${r.valueFlag} entries. Use ${r.clearFlag} to clear or provide explicit entries.`,f.USAGE);e[r.optionKey]=void 0,e[r.clearFlagKey]=!0,r.disableFlagKey&&(e[r.disableFlagKey]=!1)}}return 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]="5146346c-df7b-5011-9d55-c59a7ff88f29")}catch{}})();var Me=["close_reason","close-reason"],fe=[{canonical:"tags",aliases:["tags"],optionKey:"tags",metadataKey:"tags"}],pe=[{canonical:"deadline",aliases:["deadline"],optionKey:"deadline",metadataKey:"deadline"},{canonical:"estimate",aliases:["estimate","estimated_minutes","estimated-minutes"],optionKey:"estimatedMinutes",metadataKey:"estimated_minutes"},{canonical:"acceptance-criteria",aliases:["acceptance_criteria","acceptance-criteria","ac"],optionKey:"acceptanceCriteria",metadataKey:"acceptance_criteria"},{canonical:"definition-of-ready",aliases:["definition_of_ready","definition-of-ready"],optionKey:"definitionOfReady",metadataKey:"definition_of_ready"},{canonical:"order",aliases:["order","rank"],optionKey:"order",metadataKey:"order"},{canonical:"goal",aliases:["goal"],optionKey:"goal",metadataKey:"goal"},{canonical:"objective",aliases:["objective"],optionKey:"objective",metadataKey:"objective"},{canonical:"value",aliases:["value"],optionKey:"value",metadataKey:"value"},{canonical:"impact",aliases:["impact"],optionKey:"impact",metadataKey:"impact"},{canonical:"outcome",aliases:["outcome"],optionKey:"outcome",metadataKey:"outcome"},{canonical:"why-now",aliases:["why_now","why-now"],optionKey:"whyNow",metadataKey:"why_now"}],Fe=[...fe,...pe],ye=[{canonical:"assignee",aliases:["assignee"],optionKey:"assignee",metadataKey:"assignee"},{canonical:"parent",aliases:["parent"],optionKey:"parent",metadataKey:"parent"},{canonical:"reviewer",aliases:["reviewer"],optionKey:"reviewer",metadataKey:"reviewer"},{canonical:"risk",aliases:["risk"],optionKey:"risk",metadataKey:"risk"},{canonical:"confidence",aliases:["confidence"],optionKey:"confidence",metadataKey:"confidence"},{canonical:"sprint",aliases:["sprint"],optionKey:"sprint",metadataKey:"sprint"},{canonical:"release",aliases:["release"],optionKey:"release",metadataKey:"release"},{canonical:"blocked-by",aliases:["blocked_by","blocked-by"],optionKey:"blockedBy",metadataKey:"blocked_by"},{canonical:"blocked-reason",aliases:["blocked_reason","blocked-reason"],optionKey:"blockedReason",metadataKey:"blocked_reason"},{canonical:"unblock-note",aliases:["unblock_note","unblock-note"],optionKey:"unblockNote",metadataKey:"unblock_note"},{canonical:"reporter",aliases:["reporter"],optionKey:"reporter",metadataKey:"reporter"},{canonical:"severity",aliases:["severity"],optionKey:"severity",metadataKey:"severity"},{canonical:"environment",aliases:["environment"],optionKey:"environment",metadataKey:"environment"},{canonical:"repro-steps",aliases:["repro_steps","repro-steps"],optionKey:"reproSteps",metadataKey:"repro_steps"},{canonical:"resolution",aliases:["resolution"],optionKey:"resolution",metadataKey:"resolution"},{canonical:"expected-result",aliases:["expected_result","expected-result"],optionKey:"expectedResult",metadataKey:"expected_result"},{canonical:"actual-result",aliases:["actual_result","actual-result"],optionKey:"actualResult",metadataKey:"actual_result"},{canonical:"affected-version",aliases:["affected_version","affected-version"],optionKey:"affectedVersion",metadataKey:"affected_version"},{canonical:"fixed-version",aliases:["fixed_version","fixed-version"],optionKey:"fixedVersion",metadataKey:"fixed_version"},{canonical:"component",aliases:["component"],optionKey:"component",metadataKey:"component"},{canonical:"regression",aliases:["regression"],optionKey:"regression",metadataKey:"regression"},{canonical:"customer-impact",aliases:["customer_impact","customer-impact"],optionKey:"customerImpact",metadataKey:"customer_impact"}],ee=[...Fe,{canonical:"author",aliases:["author"],optionKey:"author",metadataKey:"author"},...ye],De=[...fe,{canonical:"close-reason",aliases:Me,optionKey:"closeReason",metadataKey:"close_reason"},...pe,...ye],Ke=new Set(["none","null","-"]);function me(e){return e==="create"?ee:De}function $(e,t){let r=t.unset;if(r!==void 0&&typeof r!="string"&&!Array.isArray(r))return;let n=[];for(let o of me(e))o.optionKey==="author"||!Object.hasOwn(t,o.optionKey)||t[o.optionKey]!==null||(Reflect.deleteProperty(t,o.optionKey),n.push(o.canonical));n.length!==0&&(t.unset=[...r===void 0?[]:typeof r=="string"?[r]:r,...n])}function Q(e){return typeof e=="string"&&Ke.has(e.trim().toLowerCase())}function wt(e,t,r,n){return r?me(e).flatMap(o=>{let a=t[o.optionKey],i=n[o.metadataKey];return Q(a)&&(Q(i)||Array.isArray(i)&&i.some(Q))?[`literal_sentinel_stored:${o.canonical}:${a.trim()}`]:[]}):[]}function xe(e,t){return e.flatMap(r=>r.includes(",")&&t(r)?[r]:r.split(","))}function Le(e){let t=new Set,r=new Set;if(!e.raw||e.raw.length===0)return{metadataKeys:t,optionKeys:r};let n=xe(e.raw,o=>e.resolveDefinition(o.trim().toLowerCase())!==void 0);for(let o of n){let a=o.trim().toLowerCase();if(!a)throw new p("--unset values must not be empty; name each field once, for example --unset parent,release",f.USAGE);if(N(a))throw new p('--unset no longer accepts "none" or "null". Specify concrete field names such as --unset deadline',f.USAGE);let i=e.resolveDefinition(a);if(!i)throw new p(`Unsupported --unset field "${o}". Supported fields: ${e.supportedFields}`,f.USAGE);t.add(i.metadataKey),r.add(i.optionKey)}return{metadataKeys:t,optionKeys:r}}function Pe(e,t,r){let n=e.trim().toLowerCase();if(!r)return;let o=r.command_to_fields?.get(t)??[];for(let a of o){if(a.allow_unset===!1)continue;let i=new Set;if(typeof a.key=="string"&&a.key.length>0&&i.add(a.key.toLowerCase()),typeof a.metadata_key=="string"&&a.metadata_key.length>0&&i.add(a.metadata_key.toLowerCase()),typeof a.cli_flag=="string"&&a.cli_flag.length>0&&(i.add(a.cli_flag.replaceAll("-","_").toLowerCase()),i.add(a.cli_flag.toLowerCase())),Array.isArray(a.cli_aliases))for(let l of a.cli_aliases)typeof l!="string"||l.length===0||(i.add(l.replaceAll("-","_").toLowerCase()),i.add(l.toLowerCase()));if(i.has(n))return{optionKey:a.key,metadataKey:a.metadata_key}}}var Ue=(()=>{let e=new Map;for(let t of ee)for(let r of t.aliases)e.set(r,{optionKey:t.optionKey,metadataKey:t.metadataKey});return e})(),Be=ee.map(e=>e.canonical).sort((e,t)=>e.localeCompare(t)).join(", ");function kt(e,t){return Le({raw:e,supportedFields:Be,resolveDefinition:r=>Ue.get(r)??Pe(r,"create",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]="837a5c2d-6447-5696-b0de-32641cde14cd")}catch{}})();var je={create:'client.create({ type: "Task", title: "Example", createMode: "progressive" })',update:'client.update(id, { estimatedMinutes: "45", force: false })',append:'client.append(id, "Body text")',reopen:'client.reopen(id, "The work recurred", { expectedResult: "Verified recovery" })'};function E(e,t,r){let n=`${e} ${t} must be ${r}.`;throw new p(n,f.USAGE,{code:"invalid_argument_value",reason:"invalid_mutation_option_value",field:t,changed:!1,required:n,examples:[je[e]]})}function K(e,t,r){typeof e!="string"&&E(t,r,"a string")}function te(e,t){(e===null||typeof e!="object"||Array.isArray(e))&&E(t,"options","an object")}function ge(e,t){(e==="append"||e==="update")&&t.id!==void 0&&K(t.id,e,"id"),e==="item-reopen"&&(t.id!==void 0&&K(t.id,"reopen","id"),t.reason!==void 0&&K(t.reason,"reopen","reason"),t.options!==void 0&&Ge(t.options))}function Gt(e){te(e,"append");for(let t of["body","author","message"])e[t]!==void 0&&K(e[t],"append",t);e.force!==void 0&&typeof e.force!="boolean"&&E("append","force","a boolean")}function Ge(e){te(e,"reopen");for(let t of F["item-reopen"].optional){let r=e[t];r!==void 0&&(O(Reflect.get(b,t)).type==="boolean"?typeof r!="boolean"&&E("reopen",t,"a boolean"):K(r,"reopen",t))}}function Ve(e,t){return e?t?"a string or string array":"a string array":"a string"}function He(e,t,r,n,o,a){r===void 0||typeof r=="string"&&(!o||a)||n==="priority"&&typeof r=="number"&&Number.isFinite(r)||o&&Array.isArray(r)&&Array.from(r).every(i=>typeof i=="string")||E(e,t,Ve(o,a))}function $e(e,t,r){let n=e==="create"?P:U;for(let{param:o}of[...n,...R,{param:"force"}]){if(O(Reflect.get(b,o)).type!=="boolean")continue;let a=r.find(i=>i.keys.includes(o))?.keys??[o];for(let i of a)t[i]!==void 0&&typeof t[i]!="boolean"&&E(e,i,"a boolean")}}function re(e,t,r=!0,n=!1){let o=e==="create"?B:G;for(let{target:a,keys:i,repeatable:l}of o)if(O(Reflect.get(b,a)).type!=="boolean")for(let y of i){let S=n&&y!==a,h=l===!0&&(a!=="acceptanceCriteria"||S);He(e,y,t[y],a,h,r||S)}$e(e,t,o)}function Vt(e,t){te(t,e);let r=le(t),n=D(r);return n||$(e,r),re(e,r,!1,n),r}import{Option as ur}from"commander";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="96013340-cb63-5e96-a1b0-b810100ab080")}catch{}})();function A(e,t,r){if(typeof r!="string")return;let n=r.trim();n.length!==0&&e.push(t,n)}function m(e,t,r){r===!0&&e.push(t)}function T(e,t,r){if(Array.isArray(r))for(let n of r){if(typeof n!="string")continue;let o=n.trim();o.length!==0&&e.push(t,o)}}function ze(e,t){let r=["test",e,"--run","--json","--progress"];return T(r,"--add",t.add),T(r,"--add-json",t.addJson),T(r,"--remove",t.remove),T(r,"--remove-index",Array.isArray(t.removeIndex)?t.removeIndex.map(n=>typeof n=="number"?String(n):n):t.removeIndex),A(r,"--match",t.match),A(r,"--only-index",typeof t.onlyIndex=="number"?String(t.onlyIndex):t.onlyIndex),m(r,"--only-last",t.onlyLast),m(r,"--full-history",t.fullHistory),T(r,"--measure",t.measure),A(r,"--metric-below",t.metricBelow),A(r,"--metric-diff",t.metricDiff),qe(r,t),A(r,"--author",t.author),A(r,"--message",t.message),m(r,"--force",t.force),r}function qe(e,t){A(e,"--timeout",t.timeout),T(e,"--env-set",t.envSet),T(e,"--env-clear",t.envClear),m(e,"--shared-host-safe",t.sharedHostSafe),A(e,"--pm-context",t.pmContext),m(e,"--override-linked-pm-context",t.overrideLinkedPmContext),A(e,"--workspace-context",t.workspaceContext),m(e,"--override-linked-workspace-context",t.overrideLinkedWorkspaceContext),m(e,"--allow-untrusted-linked-tests",t.allowUntrustedLinkedTests),m(e,"--fail-on-context-mismatch",t.failOnContextMismatch),m(e,"--fail-on-skipped",t.failOnSkipped),m(e,"--fail-on-empty-test-run",t.failOnEmptyTestRun),m(e,"--require-assertions-for-pm",t.requireAssertionsForPm),m(e,"--check-context",t.checkContext),m(e,"--full-output",t.fullOutput),m(e,"--auto-pm-context",t.autoPmContext)}(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]="e9ccd0e6-fb99-5650-b819-ee03bf99a863")}catch{}})();function he(e,t){let r=[],n=new Set;for(let o of t.keys){if(!Object.hasOwn(e,o))continue;let a=e[o];if(a!=null){if(typeof a=="string"){r.push(a);continue}if(!Array.isArray(a)||!a.every(i=>typeof i=="string"))return;n.has(a)||(n.add(a),r.push(...a))}}return r.length>0?r.join("; "):void 0}function C(e,t){return e.find(r=>r.target===t)??{target:t,keys:[t]}}function s(e,t){return e[t]===!0?!0:void 0}function _(e,t){return e[t]===!1?!0:void 0}function z(e,t){return t.some(r=>e[r]===!0)?!0:void 0}function ne(e,t){for(let[r,n]of Object.entries(t))r==="__proto__"||r==="constructor"||r==="prototype"||Object.hasOwn(e,r)||(e[r]=n)}function Ae(e,t={}){let r=i=>L(e,C(j,i)),n=i=>W(e,C(I,i)),o=r("type");if(t.requireType!==!1&&o===void 0)throw new p("Missing required option --type <value>. Why required: create resolves runtime schema fields/workflow from item type. Retry: add --type <built-in or configured custom type> (example: --type Task).",f.USAGE);let a={title:r("title"),description:r("description"),type:o,template:r("template"),createMode:r("createMode"),defer:n("defer"),deferReason:r("deferReason"),schedulePreset:r("schedulePreset"),status:r("status"),closeReason:r("closeReason"),completedAt:r("completedAt"),priority:r("priority"),tags:r("tags"),addTags:n("addTags"),body:r("body"),deadline:r("deadline"),estimatedMinutes:r("estimatedMinutes"),acceptanceCriteria:he(e,C(I,"acceptanceCriteria")),definitionOfReady:r("definitionOfReady"),order:r("order"),rank:r("rank"),goal:r("goal"),objective:r("objective"),value:r("value"),impact:r("impact"),outcome:r("outcome"),whyNow:r("whyNow"),author:r("author"),message:r("message"),assignee:r("assignee"),parent:r("parent"),inheritFocus:e.inheritFocus,allowMissingParent:z(e,["allowMissingParent","allow_missing_parent"])===!0,allowUnresolvedDeps:z(e,["allowUnresolvedDeps","allow_unresolved_deps"])===!0,allowDuplicate:s(e,"allowDuplicate")===!0,reviewer:r("reviewer"),risk:r("risk"),confidence:r("confidence"),sprint:r("sprint"),release:r("release"),blockedBy:r("blockedBy"),blockedReason:r("blockedReason"),unblockNote:r("unblockNote"),reporter:r("reporter"),severity:r("severity"),environment:r("environment"),reproSteps:r("reproSteps"),resolution:r("resolution"),expectedResult:r("expectedResult"),actualResult:r("actualResult"),affectedVersion:r("affectedVersion"),fixedVersion:r("fixedVersion"),component:r("component"),regression:e.regression===!0?"true":r("regression"),customerImpact:r("customerImpact"),dep:n("dep"),comment:n("comment"),note:n("note"),learning:n("learning"),file:n("file"),test:n("test"),doc:n("doc"),reminder:n("reminder"),event:n("event"),typeOption:n("typeOption"),field:n("field"),unset:n("unset"),clearDeps:s(e,"clearDeps"),clearComments:s(e,"clearComments"),clearNotes:s(e,"clearNotes"),clearLearnings:s(e,"clearLearnings"),clearFiles:s(e,"clearFiles"),clearTests:s(e,"clearTests"),clearDocs:s(e,"clearDocs"),clearReminders:s(e,"clearReminders"),clearEvents:s(e,"clearEvents"),clearTypeOptions:s(e,"clearTypeOptions")};return ne(a,e),v(e,a)}function _e(e){let t=o=>L(e,C(V,o)),r=o=>W(e,C(M,o)),n={title:t("title"),description:t("description"),body:t("body"),status:t("status"),closeReason:t("closeReason"),priority:t("priority"),type:t("type"),tags:t("tags"),addTags:r("addTags"),removeTags:r("removeTags"),deadline:t("deadline"),estimatedMinutes:t("estimatedMinutes"),acceptanceCriteria:he(e,C(M,"acceptanceCriteria")),addAc:r("addAc"),removeAc:r("removeAc"),definitionOfReady:t("definitionOfReady"),order:t("order"),rank:t("rank"),goal:t("goal"),objective:t("objective"),value:t("value"),impact:t("impact"),outcome:t("outcome"),whyNow:t("whyNow"),author:t("author"),message:t("message"),force:!!e.force,ownershipMetadataBypass:e.ownershipMetadataBypass===!0?!0:void 0,ownershipDependencyBypass:e.ownershipDependencyBypass===!0?!0:void 0,assignee:t("assignee"),parent:t("parent"),allowUnresolvedDeps:z(e,["allowUnresolvedDeps","allow_unresolved_deps"])===!0,reviewer:t("reviewer"),risk:t("risk"),confidence:t("confidence"),sprint:t("sprint"),release:t("release"),blockedBy:t("blockedBy"),blockedReason:t("blockedReason"),unblockNote:t("unblockNote"),reporter:t("reporter"),severity:t("severity"),environment:t("environment"),reproSteps:t("reproSteps"),resolution:t("resolution"),expectedResult:t("expectedResult"),actualResult:t("actualResult"),affectedVersion:t("affectedVersion"),fixedVersion:t("fixedVersion"),component:t("component"),regression:e.regression===!0?"true":t("regression"),customerImpact:t("customerImpact"),dep:r("dep"),depRemove:r("depRemove"),replaceDeps:s(e,"replaceDeps"),replaceTests:s(e,"replaceTests"),replaceFiles:s(e,"replaceFiles"),replaceDocs:s(e,"replaceDocs"),comment:r("comment"),note:r("note"),learning:r("learning"),file:r("file"),test:r("test"),doc:r("doc"),reminder:r("reminder"),event:r("event"),typeOption:r("typeOption"),field:r("field"),unset:r("unset"),clearDeps:s(e,"clearDeps"),clearComments:s(e,"clearComments"),clearNotes:s(e,"clearNotes"),clearLearnings:s(e,"clearLearnings"),clearFiles:s(e,"clearFiles"),clearTests:s(e,"clearTests"),clearDocs:s(e,"clearDocs"),clearReminders:s(e,"clearReminders"),clearEvents:s(e,"clearEvents"),clearTypeOptions:s(e,"clearTypeOptions")};return ne(n,e),v(e,n)}function d(e,t){let r=C(se,t),n=L(e,r);if(n!==void 0)return n;for(let o of r.keys){let a=e[o];if(Array.isArray(a)){let i=a.filter(l=>typeof l=="string");if(i.length>0)return i.join(",")}if(t==="ids"&&typeof a=="string")return a;if(typeof a=="number"&&Number.isFinite(a))return String(a)}}function Ye(e){let t=s(e,"filterFilesMissing"),r=s(e,"filterDocsMissing");return{filterReviewerMissing:s(e,"filterReviewerMissing"),filterRiskMissing:s(e,"filterRiskMissing"),filterConfidenceMissing:s(e,"filterConfidenceMissing"),filterSprintMissing:s(e,"filterSprintMissing"),filterReleaseMissing:s(e,"filterReleaseMissing"),hasNotes:s(e,"hasNotes"),hasLearnings:s(e,"hasLearnings"),hasFiles:s(e,"hasFiles"),hasDocs:s(e,"hasDocs"),hasTests:s(e,"hasTests"),hasComments:s(e,"hasComments"),hasDeps:s(e,"hasDeps"),hasBody:s(e,"hasBody"),hasLinkedCommand:s(e,"hasLinkedCommand"),noNotes:_(e,"notes"),noLearnings:_(e,"learnings"),noFiles:_(e,"files")??t,filterFilesMissing:t,noDocs:_(e,"docs")??r,filterDocsMissing:r,noTests:_(e,"tests"),noComments:_(e,"comments"),noDeps:_(e,"deps"),emptyBody:s(e,"emptyBody"),noLinkedCommand:_(e,"linkedCommand")}}function ve(e){let t={status:d(e,"status"),type:d(e,"type"),tag:d(e,"tag"),priority:d(e,"priority"),deadlineBefore:d(e,"deadlineBefore"),deadlineAfter:d(e,"deadlineAfter"),updatedAfter:d(e,"updatedAfter"),updatedBefore:d(e,"updatedBefore"),createdAfter:d(e,"createdAfter"),createdBefore:d(e,"createdBefore"),today:s(e,"today"),recent:s(e,"recent"),ids:d(e,"ids"),assignee:d(e,"assignee"),assigneeFilter:d(e,"assigneeFilter"),parent:d(e,"parent"),sprint:d(e,"sprint"),release:d(e,"release"),limit:d(e,"limit"),offset:d(e,"offset"),noTruncate:_(e,"truncate"),includeBody:s(e,"includeBody"),strictRead:s(e,"strictRead"),compact:s(e,"compact"),brief:s(e,"brief"),full:s(e,"full"),fields:d(e,"fields"),sort:d(e,"sort"),order:d(e,"order"),tree:s(e,"tree"),treeDepth:d(e,"treeDepth"),filterAcMissing:s(e,"filterAcMissing"),filterEstimatesMissing:z(e,["filterEstimatesMissing","filterEstimateMissing"]),filterResolutionMissing:s(e,"filterResolutionMissing"),filterMetadataMissing:s(e,"filterMetadataMissing"),...Ye(e)};return ne(t,e),t}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="63a51994-4328-5a65-938c-d0de377ac338")}catch{}})();var Je=Symbol("pm.mcp-mutation-transport"),We=new Set(["create","update","append"]),J={create:{parameters:P,aliases:B,strings:j,repeatables:I},update:{parameters:U,aliases:G,strings:V,repeatables:M}},Xe=new Set(["activity","aggregate","context","contracts","deps","files-discover","files-lookup","get","graph","health","history","history-attest","list","next","search","stats","telemetry","validate"]);function x(e){return Je in e}function Y(e,t){return x(e)?ce(t):v(e,t)}function Mr(e,t,r=[]){let n=v(e,{...e,...t});for(let o of r)Reflect.deleteProperty(n,o);return n}function c(e,t){let r=e[t];return typeof r=="string"&&r.trim().length>0?r:void 0}function u(e,t){let r=e[t];return typeof r=="string"?r.trim().length>0?r:void 0:typeof r=="number"&&Number.isFinite(r)?String(r):void 0}function Fr(e,t){let r=e[t];return typeof r=="string"?r:typeof r=="number"&&Number.isFinite(r)?String(r):void 0}function g(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Dr(e,t){if(typeof e=="number"){if(!Number.isInteger(e))throw new p(`${t} must be a finite integer.`,f.USAGE);return e}if(typeof e=="string"&&e.trim().length>0){let r=Number(e);if(!Number.isInteger(r))throw new p(`${t} must be a finite integer.`,f.USAGE);return r}}function Kr(e,t){return typeof e.limit=="number"&&Number.isFinite(e.limit)?e.limit:typeof t.limit=="number"&&Number.isFinite(t.limit)?t.limit:c(e,"limit")??c(t,"limit")}function xr(e){let t=c(e,"outputFormat");return{json:!0,quiet:!0,author:c(e,"author"),path:c(e,"path"),noExtensions:e.noExtensions===!0||e.no_extensions===!0,noPager:!0,outputInclude:c(e,"outputInclude"),outputLimit:u(e,"outputLimit"),outputBudget:u(e,"outputBudget"),outputSession:c(e,"outputSession"),outputCursor:c(e,"outputCursor"),outputFormat:t==="json"||t==="toon"?t:void 0}}var Ce=new Set(["tags","blockedBy","blocked_by","skills","fields"]),Se=new Set(["comment","note","learning","reminder","event","dep","depRemove","dep_remove","file","doc","test","unset","addGlob","add_glob","migrate","envSet","env_set","envClear","env_clear"]),Ze=new Set([...Se].filter(e=>e!=="file")),Qe=new Set(["files","files-discover","docs","test","test-all"]),oe=new Set(["comments","notes","learnings"]);function et(e,t){if(!(!oe.has(e)||!Object.prototype.hasOwnProperty.call(t,"file")))throw new p(`MCP ${e} does not accept options.file. Pass annotation text in options.add instead.`,f.USAGE,{code:"mcp_annotation_file_unavailable",required:"Pass annotation text as JSON data; MCP annotation actions cannot read server-local files."})}var tt=new Set(["claim","release","start-task","pause-task","close-task"]),Re={history:["order"],"history-attest":["verify","output","hashAlgorithm"],list:["status","type","tag","priority","limit","offset"],search:["mode","status","type","tag","priority","limit"],create:["title","type","status","description","body","priority","tags","parent","createMode","create_mode","allowMissingParent","allowDuplicate","inheritFocus"],update:["parent","allowMissingParent","completedAt"],copy:["allowDuplicate"],close:["duplicateOf","completedAt","releaseAssignment"],claim:["start","next","ifAvailable","takeoverStale"],"start-task":["takeoverStale"],release:["pause","handoff"],comments:["ifAbsent"],notes:["ifAbsent"],learnings:["ifAbsent"],extension:["dryRun","offline"],package:["dryRun","offline"],install:["dryRun"],upgrade:["scope","dryRun","cliOnly","packagesOnly","repair","tag","packageName"],append:["body"]},rt=new Set(["context","get","list","next","search","comments","notes","learnings","files","docs","test"]),nt=new Set(["query","keywords","id","text"]);function at(e){return rt.has(e)?F[e].optional.filter(t=>!nt.has(t)):[]}var it=new Set(["claim","start-task","comments","notes","learnings","files","docs","test"]);function ot(e,t){if(!it.has(e??""))return t;let r={...t};for(let n of F[e].optional){let o=n.replace(/[A-Z]/gu,a=>`_${a.toLowerCase()}`);o===n||r[o]===void 0||(r[n]??=r[o],delete r[o])}return r}function st(e,t,r){if(!oe.has(e??""))return r;let n=r,o=n.text??t.text;if(o===void 0)return n;if(n.add!==void 0&&n.add!==o){let i=e.replace(/s$/u,"");throw new p(`Specify ${i} text either as text or with add, not both.`,f.USAGE,{code:"annotation_text_source_conflict",field:"text",required:`Pass the ${i} text once: text and add are the same source.`})}let a={...n,add:o};return delete a.text,a}function lt(e,t){let r=t.replace(/[A-Z]/gu,n=>`_${n.toLowerCase()}`);return e[t]!==void 0||e[r]!==void 0}function ct(e){return[...Re[e]??[],...at(e),...be]}var be=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor"];function Ne(e,t=""){let r={},n=Qe.has(t),o=t==="files"||t==="files-discover"||t==="docs",a=oe.has(t)?Ze:Se;for(let[i,l]of Object.entries(e)){if(Array.isArray(l)&&Ce.has(i)){r[i]=l.join(",");continue}if(i==="note"&&o){r[i]=l;continue}if(typeof l=="string"&&a.has(i)){r[i]=[l];continue}if(typeof l=="string"&&n&&(i==="add"||i==="remove")){r[i]=[l];continue}r[i]=l}return Object.assign(r,Object.fromEntries(Object.getOwnPropertySymbols(e).map(i=>[i,Reflect.get(e,i)]))),r}function dt(e,t,r){let n=c(e,"author");return n!==void 0?n:r!==void 0&&tt.has(r)?c(e,"assignee")??c(t,"assignee"):void 0}function ut(e,t){return t!==void 0&&e.author===void 0?{...e,author:t}:e}function ft(e,t,r){let n={},o=J[e],a=new Set([...o.parameters.map(({param:i})=>i),...R.map(({param:i})=>i),...Re[e],...be,"force"]);for(let i of a){let l=o.aliases.find(y=>y.keys.includes(i))?.keys??[i];t[i]===void 0||l.some(y=>r[y]!==void 0)||(n[i]=t[i])}return n}function w(e,t){throw new p(`Invalid MCP ${e} value for "${t}". No changes were made.`,f.USAGE,{code:"invalid_argument_value",reason:"invalid_mutation_option_value",changed:!1,field:t,required:`Provide valid ${e} field values and an options object; inspect the pm_${e} input schema for supported types.`})}function pt(e,t,r){let n=J[e],o=[...n.parameters,...R,{param:"force"}];for(let{param:a}of o){if(O(b[a]).type!=="boolean")continue;let i=(n.aliases.find(l=>l.keys.includes(a))?.keys??[a]).find(l=>r[l]!==void 0&&typeof r[l]!="boolean");i!==void 0&&w(e,i)}for(let a of["idOnly","fullChangedFields"])t[a]!==void 0&&typeof t[a]!="boolean"&&w(e,a)}function yt(e,t,r){t.options!==void 0&&!g(t.options)&&w(e,"options"),pt(e,t,r);for(let i of Ce){let l=r[i];Array.isArray(l)&&l.some(y=>typeof y!="string")&&w(e,i)}let n=ke(r,e),o=J[e];for(let{keys:i,target:l}of o.strings)i.some(y=>r[y]!==void 0)&&n[l]===void 0&&w(e,l);let a=o.repeatables.flatMap(({keys:i})=>i).find(i=>{let l=r[i];return l!==void 0&&typeof l!="string"&&(!Array.isArray(l)||l.some(y=>typeof y!="string"))});return a!==void 0&&w(e,a),n}function mt(e,t,r,n,o){let a=(t==="create"||t==="update")&&x(e),i={...a?ft(t,e,n):r,...n};if((t==="create"||t==="update")&&!a){let l=g(e.options)&&D(e.options);l||$(t,i),re(t,i,!0,l)}return a?yt(t,e,i):o?Ne(i,t):i}function gt(e,t){return!We.has(e??"")||D(t)?t:ue(t)}function Lr(e,t,{nativeAction:r=!0}={}){ge(t,e);let n=g(e.options)?e.options:void 0,o=O(e.options),a={},i=h=>{lt(o,h)||e[h]===void 0||(a[h]=e[h])};for(let h of ct(t??""))i(h);t!==void 0&&x(e)&&et(t,o);let l=st(t,e,ot(t,mt(e,t,a,o,r)));if(t==="history-attest"&&x(e)&&(l.output!==void 0||typeof l.verify=="string"))throw new p("MCP history attest does not accept server-local proof paths. Export the returned JSON bundle and pass that JSON object as verify.",f.USAGE);let y=x(e)?e:n??e,S=Y(y,ut(l,dt(e,l,t)));return gt(t,S)}function Pr(e){if(e.addNote===void 0)return e;let t={...e};return t.note===void 0&&typeof t.addNote=="string"&&(t.note=t.addNote),delete t.addNote,t}function Ur(e){let t={...e};return t.discoveryNote!==void 0&&t.note===void 0&&typeof t.discoveryNote=="string"&&(t.note=t.discoveryNote),delete t.discover,delete t.discoveryNote,t}function ht(e){let t=[],r=!0;for(let n of e.trim().toLowerCase()){if(n>="a"&&n<="z"||n>="0"&&n<="9"){t.push(n),r=!1;continue}r||(t.push("-"),r=!0)}return t.at(-1)==="-"&&t.pop(),t.join("")}function Br(e){return!Xe.has(ht(e))}function jr(e){return e.trim().toLowerCase().split(/\s+/).filter(Boolean).join(" ")}function At(e){return Array.isArray(e)?e.map(t=>String(t)).filter(t=>t.length>0):[]}function Gr(e,t){let r=new Set(["action","args","author","cwd","fullChangedFields","id","options","path","query","reason","target"]),n={};for(let[a,i]of Object.entries(e))r.has(a)||(n[a]=i);let o={...n,...t};return delete o.args,delete o.author,o}function Vr(e,t){let r=Y(t??{},{...t});return{changedFields:e.fullChangedFields===!0?"full":"compact",idOnly:e.idOnly===!0,runnerOptions:r}}function ie(e){return{type:u(e,"filterType"),tag:u(e,"filterTag"),priority:u(e,"filterPriority"),deadlineBefore:u(e,"filterDeadlineBefore"),deadlineAfter:u(e,"filterDeadlineAfter"),updatedAfter:u(e,"filterUpdatedAfter"),updatedBefore:u(e,"filterUpdatedBefore"),createdAfter:u(e,"filterCreatedAfter"),createdBefore:u(e,"filterCreatedBefore"),ids:Z(e.ids),assignee:u(e,"filterAssignee"),assigneeFilter:u(e,"filterAssigneeFilter")??u(e,"filterAssignee_filter"),parent:u(e,"filterParent"),sprint:u(e,"filterSprint"),release:u(e,"filterRelease"),limit:u(e,"limit"),offset:u(e,"offset")}}function ae(e){if(typeof e=="string"&&e.trim().length>0)return e;if(Array.isArray(e))return At(e)}function q(e){if(typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim().length>0)return e}function Hr(e){let t=ae(e.kind),r=ae(e.exemptIsolate),n=ae(e.exemptIsolateType);return{...t===void 0?{}:{kind:t},maxDepth:q(e.maxDepth),limit:q(e.limit),after:c(e,"after"),direction:c(e,"direction"),maxPaths:q(e.maxPaths),sample:q(e.sample),...r===void 0?{}:{exemptIsolate:r},...n===void 0?{}:{exemptIsolateType:n},saveBaseline:e.saveBaseline===!0,rebuild:e.rebuild===!0,clear:e.clear===!0,summary:e.summary===!0,...e.full===!0?{full:!0}:{}}}function Ee(e){let t=ve(e);return e.ids!==void 0&&(t.ids=Z(e.ids)),t}function $r(e){return{status:c(e,"filterStatus"),list:g(e.list)?Ee(e.list):ie(e),reason:c(e,"reason"),completedAt:c(e,"completedAt")??c(e,"completed_at"),resolution:c(e,"resolution"),expectedResult:c(e,"expectedResult")??c(e,"expected_result")??c(e,"expected"),actualResult:c(e,"actualResult")??c(e,"actual_result")??c(e,"actual"),validateClose:c(e,"validateClose")??c(e,"validate_close"),author:c(e,"author"),message:c(e,"message"),force:e.force===!0?!0:void 0,dryRun:e.dryRun===!0||e.dry_run===!0?!0:void 0,rollback:H(e.rollback),checkpoint:e.checkpoint===!1||e.noCheckpoint===!0||e.no_checkpoint===!0?!1:void 0}}var _t=new Set(["filterStatus","filterType","filterTag","filterPriority","filterDeadlineBefore","filterDeadlineAfter","filterUpdatedAfter","filterUpdatedBefore","filterCreatedAfter","filterCreatedBefore","filterAssignee","filterAssigneeFilter","filterAssignee_filter","filterParent","filterSprint","filterRelease","ids","list","update","limit","offset","dryRun","dry_run","rollback","checkpoint","noCheckpoint","no_checkpoint"]);function Oe(e){let t={};for(let[r,n]of Object.entries(e))_t.has(r)||(t[r]=n);return we(t)}function we(e){return ke(e,"update")}function ke(e,t){let r=Ne(e,t),n=J[t],o=new Set([...n.parameters,...R].filter(({booleanish:a})=>a===!0).map(({param:a})=>a));for(let{keys:a}of n.repeatables)for(let i of a)typeof r[i]=="string"&&(r[i]=[r[i]]);for(let a of n.strings)for(let i of a.keys){let l=r[i];(typeof l=="number"&&Number.isFinite(l)||l===!1&&o.has(i))&&(r[i]=String(l))}return t==="create"?{...Ae(r,{requireType:!1})}:_e(r)}function zr(e){if(g(e.list)||g(e.update)){let t=g(e.update)?e.update:Oe(e),r=Y(e,we(t));return{status:u(e,"filterStatus"),list:g(e.list)?Ee(e.list):ie(e),update:de(t,r),dryRun:e.dryRun===!0||e.dry_run===!0?!0:void 0,rollback:H(e.rollback),checkpoint:e.checkpoint===!1||e.noCheckpoint===!0||e.no_checkpoint===!0?!1:void 0}}return{status:u(e,"filterStatus"),list:ie(e),update:Y(e,Oe(e)),dryRun:e.dryRun===!0||e.dry_run===!0?!0:void 0,rollback:H(e.rollback),checkpoint:e.checkpoint===!1||e.noCheckpoint===!0||e.no_checkpoint===!0?!1:void 0}}function Te(e){return"expectHash"in e||"expect_hash"in e}function qr(e){if(!Te(e)&&!(g(e.options)&&Te(e.options)))return{expectHash:void 0,dispatchArgs:e};let{expectHash:t,expect_hash:r,...n}=e,o=g(n.options)?n.options:{},{expectHash:a,expect_hash:i,...l}=o,y=[t,r,a,i].filter(k=>k!==void 0),S=y.length>1?y.flatMap(k=>Array.isArray(k)?k:[k]):y[0],h=v(e,"options"in n?{...n,options:g(n.options)?v(n.options,l):n.options}:n);return{expectHash:S,dispatchArgs:h}}export{Tt as a,N as b,Ct as c,St as d,Rt as e,Me as f,ee as g,De as h,wt as i,xe as j,Le as k,Pe as l,kt as m,K as n,te as o,Gt as p,Ge as q,Vt as r,ze as s,x as t,Mr as u,c as v,u as w,Fr as x,g as y,Dr as z,Kr as A,xr as B,Re as C,Ne as D,Lr as E,Pr as F,Ur as G,ht as H,Br as I,jr as J,At as K,Gr as L,Vr as M,ie as N,Hr as O,$r as P,we as Q,zr as R,qr as S};
2
- //# sourceMappingURL=chunk-VBA4BIHN.js.map
1
+ import{S as b,T as B,U as j,V as I,W as G,X as V,Y as M,a as se,ba as F,g as L,i as W,o as R,q as P,s as U}from"./chunk-FPPYE6CY.js";import{E as le,F as ce,H as v,I as de,W as H,fa as Z,o as D,oa as ue,p as X}from"./chunk-N64BUB63.js";import{ja as O}from"./chunk-A2CLYPDA.js";import{A as p,z as f}from"./chunk-IXYBN6D2.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]="202cbe4e-7d36-5b12-be9d-d35608a6b36d")}catch{}})();var Ie=new Set(["none","null"]);function Tt(e={}){return[{optionKey:"dep",clearFlagKey:"clearDeps",valueFlag:"--dep",clearFlag:"--clear-deps",...e.depDisableFlagKey===void 0?{}:{disableFlagKey:e.depDisableFlagKey}},{optionKey:"comment",clearFlagKey:"clearComments",valueFlag:"--comment",clearFlag:"--clear-comments"},{optionKey:"note",clearFlagKey:"clearNotes",valueFlag:"--note",clearFlag:"--clear-notes"},{optionKey:"learning",clearFlagKey:"clearLearnings",valueFlag:"--learning",clearFlag:"--clear-learnings"},{optionKey:"file",clearFlagKey:"clearFiles",valueFlag:"--file",clearFlag:"--clear-files",...e.fileDisableFlagKey===void 0?{}:{disableFlagKey:e.fileDisableFlagKey}},{optionKey:"test",clearFlagKey:"clearTests",valueFlag:"--test",clearFlag:"--clear-tests",...e.testDisableFlagKey===void 0?{}:{disableFlagKey:e.testDisableFlagKey}},{optionKey:"doc",clearFlagKey:"clearDocs",valueFlag:"--doc",clearFlag:"--clear-docs",...e.docDisableFlagKey===void 0?{}:{disableFlagKey:e.docDisableFlagKey}},{optionKey:"reminder",clearFlagKey:"clearReminders",valueFlag:"--reminder",clearFlag:"--clear-reminders"},{optionKey:"event",clearFlagKey:"clearEvents",valueFlag:"--event",clearFlag:"--clear-events"},{optionKey:"typeOption",clearFlagKey:"clearTypeOptions",valueFlag:"--type-option",clearFlag:"--clear-type-options"}]}function N(e){return e===void 0?!1:Ie.has(e.trim().toLowerCase())}function Ct(e,t,r){if(!N(e))return;let n=r?` ${r}`:"";throw new p(`${t} no longer accepts "none" or "null".${n}`.trim(),f.USAGE)}function St(e,t,r){if(!e||e.length===0||X(e)||!e.some(o=>N(o)))return;let n=r?` ${r}`:"";throw new p(`${t} no longer accepts "none" or "null".${n}`.trim(),f.USAGE)}function Rt(e,t){for(let r of t){let n=e[r.optionKey];if(!Array.isArray(n)||n.length===0)continue;if(!n.every(a=>typeof a=="string"))throw new p(`${r.valueFlag} entries must be strings.`,f.USAGE);if(X(n))continue;let o=n;if(o.some(a=>N(a))){if(o.filter(a=>!N(a)).length>0)throw new p(`Cannot mix legacy clear token "none"/"null" with concrete ${r.valueFlag} entries. Use ${r.clearFlag} to clear or provide explicit entries.`,f.USAGE);e[r.optionKey]=void 0,e[r.clearFlagKey]=!0,r.disableFlagKey&&(e[r.disableFlagKey]=!1)}}return 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]="5146346c-df7b-5011-9d55-c59a7ff88f29")}catch{}})();var Me=["close_reason","close-reason"],fe=[{canonical:"tags",aliases:["tags"],optionKey:"tags",metadataKey:"tags"}],pe=[{canonical:"deadline",aliases:["deadline"],optionKey:"deadline",metadataKey:"deadline"},{canonical:"estimate",aliases:["estimate","estimated_minutes","estimated-minutes"],optionKey:"estimatedMinutes",metadataKey:"estimated_minutes"},{canonical:"acceptance-criteria",aliases:["acceptance_criteria","acceptance-criteria","ac"],optionKey:"acceptanceCriteria",metadataKey:"acceptance_criteria"},{canonical:"definition-of-ready",aliases:["definition_of_ready","definition-of-ready"],optionKey:"definitionOfReady",metadataKey:"definition_of_ready"},{canonical:"order",aliases:["order","rank"],optionKey:"order",metadataKey:"order"},{canonical:"goal",aliases:["goal"],optionKey:"goal",metadataKey:"goal"},{canonical:"objective",aliases:["objective"],optionKey:"objective",metadataKey:"objective"},{canonical:"value",aliases:["value"],optionKey:"value",metadataKey:"value"},{canonical:"impact",aliases:["impact"],optionKey:"impact",metadataKey:"impact"},{canonical:"outcome",aliases:["outcome"],optionKey:"outcome",metadataKey:"outcome"},{canonical:"why-now",aliases:["why_now","why-now"],optionKey:"whyNow",metadataKey:"why_now"}],Fe=[...fe,...pe],ye=[{canonical:"assignee",aliases:["assignee"],optionKey:"assignee",metadataKey:"assignee"},{canonical:"parent",aliases:["parent"],optionKey:"parent",metadataKey:"parent"},{canonical:"reviewer",aliases:["reviewer"],optionKey:"reviewer",metadataKey:"reviewer"},{canonical:"risk",aliases:["risk"],optionKey:"risk",metadataKey:"risk"},{canonical:"confidence",aliases:["confidence"],optionKey:"confidence",metadataKey:"confidence"},{canonical:"sprint",aliases:["sprint"],optionKey:"sprint",metadataKey:"sprint"},{canonical:"release",aliases:["release"],optionKey:"release",metadataKey:"release"},{canonical:"blocked-by",aliases:["blocked_by","blocked-by"],optionKey:"blockedBy",metadataKey:"blocked_by"},{canonical:"blocked-reason",aliases:["blocked_reason","blocked-reason"],optionKey:"blockedReason",metadataKey:"blocked_reason"},{canonical:"unblock-note",aliases:["unblock_note","unblock-note"],optionKey:"unblockNote",metadataKey:"unblock_note"},{canonical:"reporter",aliases:["reporter"],optionKey:"reporter",metadataKey:"reporter"},{canonical:"severity",aliases:["severity"],optionKey:"severity",metadataKey:"severity"},{canonical:"environment",aliases:["environment"],optionKey:"environment",metadataKey:"environment"},{canonical:"repro-steps",aliases:["repro_steps","repro-steps"],optionKey:"reproSteps",metadataKey:"repro_steps"},{canonical:"resolution",aliases:["resolution"],optionKey:"resolution",metadataKey:"resolution"},{canonical:"expected-result",aliases:["expected_result","expected-result"],optionKey:"expectedResult",metadataKey:"expected_result"},{canonical:"actual-result",aliases:["actual_result","actual-result"],optionKey:"actualResult",metadataKey:"actual_result"},{canonical:"affected-version",aliases:["affected_version","affected-version"],optionKey:"affectedVersion",metadataKey:"affected_version"},{canonical:"fixed-version",aliases:["fixed_version","fixed-version"],optionKey:"fixedVersion",metadataKey:"fixed_version"},{canonical:"component",aliases:["component"],optionKey:"component",metadataKey:"component"},{canonical:"regression",aliases:["regression"],optionKey:"regression",metadataKey:"regression"},{canonical:"customer-impact",aliases:["customer_impact","customer-impact"],optionKey:"customerImpact",metadataKey:"customer_impact"}],ee=[...Fe,{canonical:"author",aliases:["author"],optionKey:"author",metadataKey:"author"},...ye],De=[...fe,{canonical:"close-reason",aliases:Me,optionKey:"closeReason",metadataKey:"close_reason"},...pe,...ye],Ke=new Set(["none","null","-"]);function me(e){return e==="create"?ee:De}function $(e,t){let r=t.unset;if(r!==void 0&&typeof r!="string"&&!Array.isArray(r))return;let n=[];for(let o of me(e))o.optionKey==="author"||!Object.hasOwn(t,o.optionKey)||t[o.optionKey]!==null||(Reflect.deleteProperty(t,o.optionKey),n.push(o.canonical));n.length!==0&&(t.unset=[...r===void 0?[]:typeof r=="string"?[r]:r,...n])}function Q(e){return typeof e=="string"&&Ke.has(e.trim().toLowerCase())}function wt(e,t,r,n){return r?me(e).flatMap(o=>{let a=t[o.optionKey],i=n[o.metadataKey];return Q(a)&&(Q(i)||Array.isArray(i)&&i.some(Q))?[`literal_sentinel_stored:${o.canonical}:${a.trim()}`]:[]}):[]}function xe(e,t){return e.flatMap(r=>r.includes(",")&&t(r)?[r]:r.split(","))}function Le(e){let t=new Set,r=new Set;if(!e.raw||e.raw.length===0)return{metadataKeys:t,optionKeys:r};let n=xe(e.raw,o=>e.resolveDefinition(o.trim().toLowerCase())!==void 0);for(let o of n){let a=o.trim().toLowerCase();if(!a)throw new p("--unset values must not be empty; name each field once, for example --unset parent,release",f.USAGE);if(N(a))throw new p('--unset no longer accepts "none" or "null". Specify concrete field names such as --unset deadline',f.USAGE);let i=e.resolveDefinition(a);if(!i)throw new p(`Unsupported --unset field "${o}". Supported fields: ${e.supportedFields}`,f.USAGE);t.add(i.metadataKey),r.add(i.optionKey)}return{metadataKeys:t,optionKeys:r}}function Pe(e,t,r){let n=e.trim().toLowerCase();if(!r)return;let o=r.command_to_fields?.get(t)??[];for(let a of o){if(a.allow_unset===!1)continue;let i=new Set;if(typeof a.key=="string"&&a.key.length>0&&i.add(a.key.toLowerCase()),typeof a.metadata_key=="string"&&a.metadata_key.length>0&&i.add(a.metadata_key.toLowerCase()),typeof a.cli_flag=="string"&&a.cli_flag.length>0&&(i.add(a.cli_flag.replaceAll("-","_").toLowerCase()),i.add(a.cli_flag.toLowerCase())),Array.isArray(a.cli_aliases))for(let l of a.cli_aliases)typeof l!="string"||l.length===0||(i.add(l.replaceAll("-","_").toLowerCase()),i.add(l.toLowerCase()));if(i.has(n))return{optionKey:a.key,metadataKey:a.metadata_key}}}var Ue=(()=>{let e=new Map;for(let t of ee)for(let r of t.aliases)e.set(r,{optionKey:t.optionKey,metadataKey:t.metadataKey});return e})(),Be=ee.map(e=>e.canonical).sort((e,t)=>e.localeCompare(t)).join(", ");function kt(e,t){return Le({raw:e,supportedFields:Be,resolveDefinition:r=>Ue.get(r)??Pe(r,"create",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]="837a5c2d-6447-5696-b0de-32641cde14cd")}catch{}})();var je={create:'client.create({ type: "Task", title: "Example", createMode: "progressive" })',update:'client.update(id, { estimatedMinutes: "45", force: false })',append:'client.append(id, "Body text")',reopen:'client.reopen(id, "The work recurred", { expectedResult: "Verified recovery" })'};function E(e,t,r){let n=`${e} ${t} must be ${r}.`;throw new p(n,f.USAGE,{code:"invalid_argument_value",reason:"invalid_mutation_option_value",field:t,changed:!1,required:n,examples:[je[e]]})}function K(e,t,r){typeof e!="string"&&E(t,r,"a string")}function te(e,t){(e===null||typeof e!="object"||Array.isArray(e))&&E(t,"options","an object")}function ge(e,t){(e==="append"||e==="update")&&t.id!==void 0&&K(t.id,e,"id"),e==="item-reopen"&&(t.id!==void 0&&K(t.id,"reopen","id"),t.reason!==void 0&&K(t.reason,"reopen","reason"),t.options!==void 0&&Ge(t.options))}function Gt(e){te(e,"append");for(let t of["body","author","message"])e[t]!==void 0&&K(e[t],"append",t);e.force!==void 0&&typeof e.force!="boolean"&&E("append","force","a boolean")}function Ge(e){te(e,"reopen");for(let t of F["item-reopen"].optional){let r=e[t];r!==void 0&&(O(Reflect.get(b,t)).type==="boolean"?typeof r!="boolean"&&E("reopen",t,"a boolean"):K(r,"reopen",t))}}function Ve(e,t){return e?t?"a string or string array":"a string array":"a string"}function He(e,t,r,n,o,a){r===void 0||typeof r=="string"&&(!o||a)||n==="priority"&&typeof r=="number"&&Number.isFinite(r)||o&&Array.isArray(r)&&Array.from(r).every(i=>typeof i=="string")||E(e,t,Ve(o,a))}function $e(e,t,r){let n=e==="create"?P:U;for(let{param:o}of[...n,...R,{param:"force"}]){if(O(Reflect.get(b,o)).type!=="boolean")continue;let a=r.find(i=>i.keys.includes(o))?.keys??[o];for(let i of a)t[i]!==void 0&&typeof t[i]!="boolean"&&E(e,i,"a boolean")}}function re(e,t,r=!0,n=!1){let o=e==="create"?B:G;for(let{target:a,keys:i,repeatable:l}of o)if(O(Reflect.get(b,a)).type!=="boolean")for(let y of i){let S=n&&y!==a,h=l===!0&&(a!=="acceptanceCriteria"||S);He(e,y,t[y],a,h,r||S)}$e(e,t,o)}function Vt(e,t){te(t,e);let r=le(t),n=D(r);return n||$(e,r),re(e,r,!1,n),r}import{Option as ur}from"commander";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="96013340-cb63-5e96-a1b0-b810100ab080")}catch{}})();function A(e,t,r){if(typeof r!="string")return;let n=r.trim();n.length!==0&&e.push(t,n)}function m(e,t,r){r===!0&&e.push(t)}function T(e,t,r){if(Array.isArray(r))for(let n of r){if(typeof n!="string")continue;let o=n.trim();o.length!==0&&e.push(t,o)}}function ze(e,t){let r=["test",e,"--run","--json","--progress"];return T(r,"--add",t.add),T(r,"--add-json",t.addJson),T(r,"--remove",t.remove),T(r,"--remove-index",Array.isArray(t.removeIndex)?t.removeIndex.map(n=>typeof n=="number"?String(n):n):t.removeIndex),A(r,"--match",t.match),A(r,"--only-index",typeof t.onlyIndex=="number"?String(t.onlyIndex):t.onlyIndex),m(r,"--only-last",t.onlyLast),m(r,"--full-history",t.fullHistory),T(r,"--measure",t.measure),A(r,"--metric-below",t.metricBelow),A(r,"--metric-diff",t.metricDiff),qe(r,t),A(r,"--author",t.author),A(r,"--message",t.message),m(r,"--force",t.force),r}function qe(e,t){A(e,"--timeout",t.timeout),T(e,"--env-set",t.envSet),T(e,"--env-clear",t.envClear),m(e,"--shared-host-safe",t.sharedHostSafe),A(e,"--pm-context",t.pmContext),m(e,"--override-linked-pm-context",t.overrideLinkedPmContext),A(e,"--workspace-context",t.workspaceContext),m(e,"--override-linked-workspace-context",t.overrideLinkedWorkspaceContext),m(e,"--allow-untrusted-linked-tests",t.allowUntrustedLinkedTests),m(e,"--fail-on-context-mismatch",t.failOnContextMismatch),m(e,"--fail-on-skipped",t.failOnSkipped),m(e,"--fail-on-empty-test-run",t.failOnEmptyTestRun),m(e,"--require-assertions-for-pm",t.requireAssertionsForPm),m(e,"--check-context",t.checkContext),m(e,"--full-output",t.fullOutput),m(e,"--auto-pm-context",t.autoPmContext)}(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]="e9ccd0e6-fb99-5650-b819-ee03bf99a863")}catch{}})();function he(e,t){let r=[],n=new Set;for(let o of t.keys){if(!Object.hasOwn(e,o))continue;let a=e[o];if(a!=null){if(typeof a=="string"){r.push(a);continue}if(!Array.isArray(a)||!a.every(i=>typeof i=="string"))return;n.has(a)||(n.add(a),r.push(...a))}}return r.length>0?r.join("; "):void 0}function C(e,t){return e.find(r=>r.target===t)??{target:t,keys:[t]}}function s(e,t){return e[t]===!0?!0:void 0}function _(e,t){return e[t]===!1?!0:void 0}function z(e,t){return t.some(r=>e[r]===!0)?!0:void 0}function ne(e,t){for(let[r,n]of Object.entries(t))r==="__proto__"||r==="constructor"||r==="prototype"||Object.hasOwn(e,r)||(e[r]=n)}function Ae(e,t={}){let r=i=>L(e,C(j,i)),n=i=>W(e,C(I,i)),o=r("type");if(t.requireType!==!1&&o===void 0)throw new p("Missing required option --type <value>. Why required: create resolves runtime schema fields/workflow from item type. Retry: add --type <built-in or configured custom type> (example: --type Task).",f.USAGE);let a={title:r("title"),description:r("description"),type:o,template:r("template"),createMode:r("createMode"),defer:n("defer"),deferReason:r("deferReason"),schedulePreset:r("schedulePreset"),status:r("status"),closeReason:r("closeReason"),completedAt:r("completedAt"),priority:r("priority"),tags:r("tags"),addTags:n("addTags"),body:r("body"),deadline:r("deadline"),estimatedMinutes:r("estimatedMinutes"),acceptanceCriteria:he(e,C(I,"acceptanceCriteria")),definitionOfReady:r("definitionOfReady"),order:r("order"),rank:r("rank"),goal:r("goal"),objective:r("objective"),value:r("value"),impact:r("impact"),outcome:r("outcome"),whyNow:r("whyNow"),author:r("author"),message:r("message"),assignee:r("assignee"),parent:r("parent"),inheritFocus:e.inheritFocus,allowMissingParent:z(e,["allowMissingParent","allow_missing_parent"])===!0,allowUnresolvedDeps:z(e,["allowUnresolvedDeps","allow_unresolved_deps"])===!0,allowDuplicate:s(e,"allowDuplicate")===!0,reviewer:r("reviewer"),risk:r("risk"),confidence:r("confidence"),sprint:r("sprint"),release:r("release"),blockedBy:r("blockedBy"),blockedReason:r("blockedReason"),unblockNote:r("unblockNote"),reporter:r("reporter"),severity:r("severity"),environment:r("environment"),reproSteps:r("reproSteps"),resolution:r("resolution"),expectedResult:r("expectedResult"),actualResult:r("actualResult"),affectedVersion:r("affectedVersion"),fixedVersion:r("fixedVersion"),component:r("component"),regression:e.regression===!0?"true":r("regression"),customerImpact:r("customerImpact"),dep:n("dep"),comment:n("comment"),note:n("note"),learning:n("learning"),file:n("file"),test:n("test"),doc:n("doc"),reminder:n("reminder"),event:n("event"),typeOption:n("typeOption"),field:n("field"),unset:n("unset"),clearDeps:s(e,"clearDeps"),clearComments:s(e,"clearComments"),clearNotes:s(e,"clearNotes"),clearLearnings:s(e,"clearLearnings"),clearFiles:s(e,"clearFiles"),clearTests:s(e,"clearTests"),clearDocs:s(e,"clearDocs"),clearReminders:s(e,"clearReminders"),clearEvents:s(e,"clearEvents"),clearTypeOptions:s(e,"clearTypeOptions")};return ne(a,e),v(e,a)}function _e(e){let t=o=>L(e,C(V,o)),r=o=>W(e,C(M,o)),n={title:t("title"),description:t("description"),body:t("body"),status:t("status"),closeReason:t("closeReason"),priority:t("priority"),type:t("type"),tags:t("tags"),addTags:r("addTags"),removeTags:r("removeTags"),deadline:t("deadline"),estimatedMinutes:t("estimatedMinutes"),acceptanceCriteria:he(e,C(M,"acceptanceCriteria")),addAc:r("addAc"),removeAc:r("removeAc"),definitionOfReady:t("definitionOfReady"),order:t("order"),rank:t("rank"),goal:t("goal"),objective:t("objective"),value:t("value"),impact:t("impact"),outcome:t("outcome"),whyNow:t("whyNow"),author:t("author"),message:t("message"),force:!!e.force,ownershipMetadataBypass:e.ownershipMetadataBypass===!0?!0:void 0,ownershipDependencyBypass:e.ownershipDependencyBypass===!0?!0:void 0,assignee:t("assignee"),parent:t("parent"),allowUnresolvedDeps:z(e,["allowUnresolvedDeps","allow_unresolved_deps"])===!0,reviewer:t("reviewer"),risk:t("risk"),confidence:t("confidence"),sprint:t("sprint"),release:t("release"),blockedBy:t("blockedBy"),blockedReason:t("blockedReason"),unblockNote:t("unblockNote"),reporter:t("reporter"),severity:t("severity"),environment:t("environment"),reproSteps:t("reproSteps"),resolution:t("resolution"),expectedResult:t("expectedResult"),actualResult:t("actualResult"),affectedVersion:t("affectedVersion"),fixedVersion:t("fixedVersion"),component:t("component"),regression:e.regression===!0?"true":t("regression"),customerImpact:t("customerImpact"),dep:r("dep"),depRemove:r("depRemove"),replaceDeps:s(e,"replaceDeps"),replaceTests:s(e,"replaceTests"),replaceFiles:s(e,"replaceFiles"),replaceDocs:s(e,"replaceDocs"),comment:r("comment"),note:r("note"),learning:r("learning"),file:r("file"),test:r("test"),doc:r("doc"),reminder:r("reminder"),event:r("event"),typeOption:r("typeOption"),field:r("field"),unset:r("unset"),clearDeps:s(e,"clearDeps"),clearComments:s(e,"clearComments"),clearNotes:s(e,"clearNotes"),clearLearnings:s(e,"clearLearnings"),clearFiles:s(e,"clearFiles"),clearTests:s(e,"clearTests"),clearDocs:s(e,"clearDocs"),clearReminders:s(e,"clearReminders"),clearEvents:s(e,"clearEvents"),clearTypeOptions:s(e,"clearTypeOptions")};return ne(n,e),v(e,n)}function d(e,t){let r=C(se,t),n=L(e,r);if(n!==void 0)return n;for(let o of r.keys){let a=e[o];if(Array.isArray(a)){let i=a.filter(l=>typeof l=="string");if(i.length>0)return i.join(",")}if(t==="ids"&&typeof a=="string")return a;if(typeof a=="number"&&Number.isFinite(a))return String(a)}}function Ye(e){let t=s(e,"filterFilesMissing"),r=s(e,"filterDocsMissing");return{filterReviewerMissing:s(e,"filterReviewerMissing"),filterRiskMissing:s(e,"filterRiskMissing"),filterConfidenceMissing:s(e,"filterConfidenceMissing"),filterSprintMissing:s(e,"filterSprintMissing"),filterReleaseMissing:s(e,"filterReleaseMissing"),hasNotes:s(e,"hasNotes"),hasLearnings:s(e,"hasLearnings"),hasFiles:s(e,"hasFiles"),hasDocs:s(e,"hasDocs"),hasTests:s(e,"hasTests"),hasComments:s(e,"hasComments"),hasDeps:s(e,"hasDeps"),hasBody:s(e,"hasBody"),hasLinkedCommand:s(e,"hasLinkedCommand"),noNotes:_(e,"notes"),noLearnings:_(e,"learnings"),noFiles:_(e,"files")??t,filterFilesMissing:t,noDocs:_(e,"docs")??r,filterDocsMissing:r,noTests:_(e,"tests"),noComments:_(e,"comments"),noDeps:_(e,"deps"),emptyBody:s(e,"emptyBody"),noLinkedCommand:_(e,"linkedCommand")}}function ve(e){let t={status:d(e,"status"),type:d(e,"type"),tag:d(e,"tag"),priority:d(e,"priority"),deadlineBefore:d(e,"deadlineBefore"),deadlineAfter:d(e,"deadlineAfter"),updatedAfter:d(e,"updatedAfter"),updatedBefore:d(e,"updatedBefore"),createdAfter:d(e,"createdAfter"),createdBefore:d(e,"createdBefore"),today:s(e,"today"),recent:s(e,"recent"),ids:d(e,"ids"),assignee:d(e,"assignee"),assigneeFilter:d(e,"assigneeFilter"),parent:d(e,"parent"),sprint:d(e,"sprint"),release:d(e,"release"),limit:d(e,"limit"),offset:d(e,"offset"),noTruncate:_(e,"truncate"),includeBody:s(e,"includeBody"),strictRead:s(e,"strictRead"),compact:s(e,"compact"),brief:s(e,"brief"),full:s(e,"full"),fields:d(e,"fields"),sort:d(e,"sort"),order:d(e,"order"),tree:s(e,"tree"),treeDepth:d(e,"treeDepth"),filterAcMissing:s(e,"filterAcMissing"),filterEstimatesMissing:z(e,["filterEstimatesMissing","filterEstimateMissing"]),filterResolutionMissing:s(e,"filterResolutionMissing"),filterMetadataMissing:s(e,"filterMetadataMissing"),...Ye(e)};return ne(t,e),t}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="63a51994-4328-5a65-938c-d0de377ac338")}catch{}})();var Je=Symbol("pm.mcp-mutation-transport"),We=new Set(["create","update","append"]),J={create:{parameters:P,aliases:B,strings:j,repeatables:I},update:{parameters:U,aliases:G,strings:V,repeatables:M}},Xe=new Set(["activity","aggregate","context","contracts","deps","files-discover","files-lookup","get","graph","health","history","history-attest","list","next","search","stats","telemetry","validate"]);function x(e){return Je in e}function Y(e,t){return x(e)?ce(t):v(e,t)}function Mr(e,t,r=[]){let n=v(e,{...e,...t});for(let o of r)Reflect.deleteProperty(n,o);return n}function c(e,t){let r=e[t];return typeof r=="string"&&r.trim().length>0?r:void 0}function u(e,t){let r=e[t];return typeof r=="string"?r.trim().length>0?r:void 0:typeof r=="number"&&Number.isFinite(r)?String(r):void 0}function Fr(e,t){let r=e[t];return typeof r=="string"?r:typeof r=="number"&&Number.isFinite(r)?String(r):void 0}function g(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Dr(e,t){if(typeof e=="number"){if(!Number.isInteger(e))throw new p(`${t} must be a finite integer.`,f.USAGE);return e}if(typeof e=="string"&&e.trim().length>0){let r=Number(e);if(!Number.isInteger(r))throw new p(`${t} must be a finite integer.`,f.USAGE);return r}}function Kr(e,t){return typeof e.limit=="number"&&Number.isFinite(e.limit)?e.limit:typeof t.limit=="number"&&Number.isFinite(t.limit)?t.limit:c(e,"limit")??c(t,"limit")}function xr(e){let t=c(e,"outputFormat");return{json:!0,quiet:!0,author:c(e,"author"),path:c(e,"path"),noExtensions:e.noExtensions===!0||e.no_extensions===!0,noPager:!0,outputInclude:c(e,"outputInclude"),outputLimit:u(e,"outputLimit"),outputBudget:u(e,"outputBudget"),outputSession:c(e,"outputSession"),outputCursor:c(e,"outputCursor"),outputFormat:t==="json"||t==="toon"?t:void 0}}var Ce=new Set(["tags","blockedBy","blocked_by","skills","fields"]),Se=new Set(["comment","note","learning","reminder","event","dep","depRemove","dep_remove","file","doc","test","unset","addGlob","add_glob","migrate","envSet","env_set","envClear","env_clear"]),Ze=new Set([...Se].filter(e=>e!=="file")),Qe=new Set(["files","files-discover","docs","test","test-all"]),oe=new Set(["comments","notes","learnings"]);function et(e,t){if(!(!oe.has(e)||!Object.prototype.hasOwnProperty.call(t,"file")))throw new p(`MCP ${e} does not accept options.file. Pass annotation text in options.add instead.`,f.USAGE,{code:"mcp_annotation_file_unavailable",required:"Pass annotation text as JSON data; MCP annotation actions cannot read server-local files."})}var tt=new Set(["claim","release","start-task","pause-task","close-task"]),Re={history:["order"],"history-attest":["verify","output","hashAlgorithm"],list:["status","type","tag","priority","limit","offset"],search:["mode","status","type","tag","priority","limit"],create:["title","type","status","description","body","priority","tags","parent","createMode","create_mode","allowMissingParent","allowDuplicate","inheritFocus"],update:["parent","allowMissingParent","completedAt"],copy:["allowDuplicate"],close:["duplicateOf","completedAt","releaseAssignment"],claim:["start","next","ifAvailable","takeoverStale"],"start-task":["takeoverStale"],release:["pause","handoff"],comments:["ifAbsent"],notes:["ifAbsent"],learnings:["ifAbsent"],extension:["dryRun","offline"],package:["dryRun","offline"],install:["dryRun"],upgrade:["scope","dryRun","cliOnly","packagesOnly","repair","tag","packageName"],append:["body"]},rt=new Set(["context","get","list","next","search","comments","notes","learnings","files","docs","test"]),nt=new Set(["query","keywords","id","text"]);function at(e){return rt.has(e)?F[e].optional.filter(t=>!nt.has(t)):[]}var it=new Set(["claim","start-task","comments","notes","learnings","files","docs","test"]);function ot(e,t){if(!it.has(e??""))return t;let r={...t};for(let n of F[e].optional){let o=n.replace(/[A-Z]/gu,a=>`_${a.toLowerCase()}`);o===n||r[o]===void 0||(r[n]??=r[o],delete r[o])}return r}function st(e,t,r){if(!oe.has(e??""))return r;let n=r,o=n.text??t.text;if(o===void 0)return n;if(n.add!==void 0&&n.add!==o){let i=e.replace(/s$/u,"");throw new p(`Specify ${i} text either as text or with add, not both.`,f.USAGE,{code:"annotation_text_source_conflict",field:"text",required:`Pass the ${i} text once: text and add are the same source.`})}let a={...n,add:o};return delete a.text,a}function lt(e,t){let r=t.replace(/[A-Z]/gu,n=>`_${n.toLowerCase()}`);return e[t]!==void 0||e[r]!==void 0}function ct(e){return[...Re[e]??[],...at(e),...be]}var be=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor"];function Ne(e,t=""){let r={},n=Qe.has(t),o=t==="files"||t==="files-discover"||t==="docs",a=oe.has(t)?Ze:Se;for(let[i,l]of Object.entries(e)){if(Array.isArray(l)&&Ce.has(i)){r[i]=l.join(",");continue}if(i==="note"&&o){r[i]=l;continue}if(typeof l=="string"&&a.has(i)){r[i]=[l];continue}if(typeof l=="string"&&n&&(i==="add"||i==="remove")){r[i]=[l];continue}r[i]=l}return Object.assign(r,Object.fromEntries(Object.getOwnPropertySymbols(e).map(i=>[i,Reflect.get(e,i)]))),r}function dt(e,t,r){let n=c(e,"author");return n!==void 0?n:r!==void 0&&tt.has(r)?c(e,"assignee")??c(t,"assignee"):void 0}function ut(e,t){return t!==void 0&&e.author===void 0?{...e,author:t}:e}function ft(e,t,r){let n={},o=J[e],a=new Set([...o.parameters.map(({param:i})=>i),...R.map(({param:i})=>i),...Re[e],...be,"force"]);for(let i of a){let l=o.aliases.find(y=>y.keys.includes(i))?.keys??[i];t[i]===void 0||l.some(y=>r[y]!==void 0)||(n[i]=t[i])}return n}function w(e,t){throw new p(`Invalid MCP ${e} value for "${t}". No changes were made.`,f.USAGE,{code:"invalid_argument_value",reason:"invalid_mutation_option_value",changed:!1,field:t,required:`Provide valid ${e} field values and an options object; inspect the pm_${e} input schema for supported types.`})}function pt(e,t,r){let n=J[e],o=[...n.parameters,...R,{param:"force"}];for(let{param:a}of o){if(O(b[a]).type!=="boolean")continue;let i=(n.aliases.find(l=>l.keys.includes(a))?.keys??[a]).find(l=>r[l]!==void 0&&typeof r[l]!="boolean");i!==void 0&&w(e,i)}for(let a of["idOnly","fullChangedFields"])t[a]!==void 0&&typeof t[a]!="boolean"&&w(e,a)}function yt(e,t,r){t.options!==void 0&&!g(t.options)&&w(e,"options"),pt(e,t,r);for(let i of Ce){let l=r[i];Array.isArray(l)&&l.some(y=>typeof y!="string")&&w(e,i)}let n=ke(r,e),o=J[e];for(let{keys:i,target:l}of o.strings)i.some(y=>r[y]!==void 0)&&n[l]===void 0&&w(e,l);let a=o.repeatables.flatMap(({keys:i})=>i).find(i=>{let l=r[i];return l!==void 0&&typeof l!="string"&&(!Array.isArray(l)||l.some(y=>typeof y!="string"))});return a!==void 0&&w(e,a),n}function mt(e,t,r,n,o){let a=(t==="create"||t==="update")&&x(e),i={...a?ft(t,e,n):r,...n};if((t==="create"||t==="update")&&!a){let l=g(e.options)&&D(e.options);l||$(t,i),re(t,i,!0,l)}return a?yt(t,e,i):o?Ne(i,t):i}function gt(e,t){return!We.has(e??"")||D(t)?t:ue(t)}function Lr(e,t,{nativeAction:r=!0}={}){ge(t,e);let n=g(e.options)?e.options:void 0,o=O(e.options),a={},i=h=>{lt(o,h)||e[h]===void 0||(a[h]=e[h])};for(let h of ct(t??""))i(h);t!==void 0&&x(e)&&et(t,o);let l=st(t,e,ot(t,mt(e,t,a,o,r)));if(t==="history-attest"&&x(e)&&(l.output!==void 0||typeof l.verify=="string"))throw new p("MCP history attest does not accept server-local proof paths. Export the returned JSON bundle and pass that JSON object as verify.",f.USAGE);let y=x(e)?e:n??e,S=Y(y,ut(l,dt(e,l,t)));return gt(t,S)}function Pr(e){if(e.addNote===void 0)return e;let t={...e};return t.note===void 0&&typeof t.addNote=="string"&&(t.note=t.addNote),delete t.addNote,t}function Ur(e){let t={...e};return t.discoveryNote!==void 0&&t.note===void 0&&typeof t.discoveryNote=="string"&&(t.note=t.discoveryNote),delete t.discover,delete t.discoveryNote,t}function ht(e){let t=[],r=!0;for(let n of e.trim().toLowerCase()){if(n>="a"&&n<="z"||n>="0"&&n<="9"){t.push(n),r=!1;continue}r||(t.push("-"),r=!0)}return t.at(-1)==="-"&&t.pop(),t.join("")}function Br(e){return!Xe.has(ht(e))}function jr(e){return e.trim().toLowerCase().split(/\s+/).filter(Boolean).join(" ")}function At(e){return Array.isArray(e)?e.map(t=>String(t)).filter(t=>t.length>0):[]}function Gr(e,t){let r=new Set(["action","args","author","cwd","fullChangedFields","id","options","path","query","reason","target"]),n={};for(let[a,i]of Object.entries(e))r.has(a)||(n[a]=i);let o={...n,...t};return delete o.args,delete o.author,o}function Vr(e,t){let r=Y(t??{},{...t});return{changedFields:e.fullChangedFields===!0?"full":"compact",idOnly:e.idOnly===!0,runnerOptions:r}}function ie(e){return{type:u(e,"filterType"),tag:u(e,"filterTag"),priority:u(e,"filterPriority"),deadlineBefore:u(e,"filterDeadlineBefore"),deadlineAfter:u(e,"filterDeadlineAfter"),updatedAfter:u(e,"filterUpdatedAfter"),updatedBefore:u(e,"filterUpdatedBefore"),createdAfter:u(e,"filterCreatedAfter"),createdBefore:u(e,"filterCreatedBefore"),ids:Z(e.ids),assignee:u(e,"filterAssignee"),assigneeFilter:u(e,"filterAssigneeFilter")??u(e,"filterAssignee_filter"),parent:u(e,"filterParent"),sprint:u(e,"filterSprint"),release:u(e,"filterRelease"),limit:u(e,"limit"),offset:u(e,"offset")}}function ae(e){if(typeof e=="string"&&e.trim().length>0)return e;if(Array.isArray(e))return At(e)}function q(e){if(typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim().length>0)return e}function Hr(e){let t=ae(e.kind),r=ae(e.exemptIsolate),n=ae(e.exemptIsolateType);return{...t===void 0?{}:{kind:t},maxDepth:q(e.maxDepth),limit:q(e.limit),after:c(e,"after"),direction:c(e,"direction"),maxPaths:q(e.maxPaths),sample:q(e.sample),...r===void 0?{}:{exemptIsolate:r},...n===void 0?{}:{exemptIsolateType:n},saveBaseline:e.saveBaseline===!0,rebuild:e.rebuild===!0,clear:e.clear===!0,summary:e.summary===!0,...e.full===!0?{full:!0}:{}}}function Ee(e){let t=ve(e);return e.ids!==void 0&&(t.ids=Z(e.ids)),t}function $r(e){return{status:c(e,"filterStatus"),list:g(e.list)?Ee(e.list):ie(e),reason:c(e,"reason"),completedAt:c(e,"completedAt")??c(e,"completed_at"),resolution:c(e,"resolution"),expectedResult:c(e,"expectedResult")??c(e,"expected_result")??c(e,"expected"),actualResult:c(e,"actualResult")??c(e,"actual_result")??c(e,"actual"),validateClose:c(e,"validateClose")??c(e,"validate_close"),author:c(e,"author"),message:c(e,"message"),force:e.force===!0?!0:void 0,dryRun:e.dryRun===!0||e.dry_run===!0?!0:void 0,rollback:H(e.rollback),checkpoint:e.checkpoint===!1||e.noCheckpoint===!0||e.no_checkpoint===!0?!1:void 0}}var _t=new Set(["filterStatus","filterType","filterTag","filterPriority","filterDeadlineBefore","filterDeadlineAfter","filterUpdatedAfter","filterUpdatedBefore","filterCreatedAfter","filterCreatedBefore","filterAssignee","filterAssigneeFilter","filterAssignee_filter","filterParent","filterSprint","filterRelease","ids","list","update","limit","offset","dryRun","dry_run","rollback","checkpoint","noCheckpoint","no_checkpoint"]);function Oe(e){let t={};for(let[r,n]of Object.entries(e))_t.has(r)||(t[r]=n);return we(t)}function we(e){return ke(e,"update")}function ke(e,t){let r=Ne(e,t),n=J[t],o=new Set([...n.parameters,...R].filter(({booleanish:a})=>a===!0).map(({param:a})=>a));for(let{keys:a}of n.repeatables)for(let i of a)typeof r[i]=="string"&&(r[i]=[r[i]]);for(let a of n.strings)for(let i of a.keys){let l=r[i];(typeof l=="number"&&Number.isFinite(l)||l===!1&&o.has(i))&&(r[i]=String(l))}return t==="create"?{...Ae(r,{requireType:!1})}:_e(r)}function zr(e){if(g(e.list)||g(e.update)){let t=g(e.update)?e.update:Oe(e),r=Y(e,we(t));return{status:u(e,"filterStatus"),list:g(e.list)?Ee(e.list):ie(e),update:de(t,r),dryRun:e.dryRun===!0||e.dry_run===!0?!0:void 0,rollback:H(e.rollback),checkpoint:e.checkpoint===!1||e.noCheckpoint===!0||e.no_checkpoint===!0?!1:void 0}}return{status:u(e,"filterStatus"),list:ie(e),update:Y(e,Oe(e)),dryRun:e.dryRun===!0||e.dry_run===!0?!0:void 0,rollback:H(e.rollback),checkpoint:e.checkpoint===!1||e.noCheckpoint===!0||e.no_checkpoint===!0?!1:void 0}}function Te(e){return"expectHash"in e||"expect_hash"in e}function qr(e){if(!Te(e)&&!(g(e.options)&&Te(e.options)))return{expectHash:void 0,dispatchArgs:e};let{expectHash:t,expect_hash:r,...n}=e,o=g(n.options)?n.options:{},{expectHash:a,expect_hash:i,...l}=o,y=[t,r,a,i].filter(k=>k!==void 0),S=y.length>1?y.flatMap(k=>Array.isArray(k)?k:[k]):y[0],h=v(e,"options"in n?{...n,options:g(n.options)?v(n.options,l):n.options}:n);return{expectHash:S,dispatchArgs:h}}export{Tt as a,N as b,Ct as c,St as d,Rt as e,Me as f,ee as g,De as h,wt as i,xe as j,Le as k,Pe as l,kt as m,K as n,te as o,Gt as p,Ge as q,Vt as r,ze as s,x as t,Mr as u,c as v,u as w,Fr as x,g as y,Dr as z,Kr as A,xr as B,Re as C,Ne as D,Lr as E,Pr as F,Ur as G,ht as H,Br as I,jr as J,At as K,Gr as L,Vr as M,ie as N,Hr as O,$r as P,we as Q,zr as R,qr as S};
2
+ //# sourceMappingURL=chunk-2XULTI5B.js.map