@unbrained/pm-cli 2026.9.22 → 2026.9.23

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 (68) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +6 -0
  3. package/dist/cli-bundle/bundle-manifest.json +147 -147
  4. package/dist/cli-bundle/chunks/{chunk-AVWHZUNC.js → chunk-6WBR6GMW.js} +2 -2
  5. package/dist/cli-bundle/chunks/{chunk-CM57QHVK.js → chunk-7IABMUB6.js} +3 -3
  6. package/dist/cli-bundle/chunks/{chunk-UDNYAMCM.js → chunk-E6ZES2X7.js} +2 -2
  7. package/dist/cli-bundle/chunks/{chunk-BJBBOUYQ.js → chunk-KOUT5SAA.js} +2 -2
  8. package/dist/cli-bundle/chunks/{chunk-D2OV2UBV.js → chunk-NBGSRFZE.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-ZSPZJOMK.js → chunk-OBTHQ6UX.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-3OFFMS2N.js → chunk-PFWCAI4X.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-JSW33Q6R.js → chunk-SXRMM72R.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-SBTT42A4.js → chunk-VO7DHENB.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-4XOV7Q5R.js → chunk-WBB5B7G5.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-ML42DLI3.js → chunk-ZSVINTXT.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-GFTN5OS4.js → chunk-ZWSWR2GX.js} +2 -2
  16. package/dist/cli-bundle/chunks/{register-list-query-VOS5CBX4.js → register-list-query-IFPQ4YRD.js} +2 -2
  17. package/dist/cli-bundle/chunks/{register-mutation-LWZH6UFJ.js → register-mutation-C3O7OSXW.js} +2 -2
  18. package/dist/cli-bundle/chunks/{register-operations-YJK4DNFZ.js → register-operations-LGO7DBZ7.js} +2 -2
  19. package/dist/cli-bundle/chunks/{register-setup-Q3CYF67Q.js → register-setup-4EW2PPZD.js} +2 -2
  20. package/dist/cli-bundle/focused-chunks/{chunk-QYN77MQP.js → chunk-3JAEZ7WI.js} +2 -2
  21. package/dist/cli-bundle/focused-chunks/{chunk-LH24XUPJ.js → chunk-6CWR2QFM.js} +2 -2
  22. package/dist/cli-bundle/focused-chunks/{chunk-V2NARGRH.js → chunk-BKXYQQDT.js} +2 -2
  23. package/dist/cli-bundle/focused-chunks/{chunk-JCD5YESL.js → chunk-BQSKFRL2.js} +2 -2
  24. package/dist/cli-bundle/focused-chunks/{chunk-UAU4DJSR.js → chunk-BULUJEOL.js} +2 -2
  25. package/dist/cli-bundle/focused-chunks/{chunk-AO5FR7PN.js → chunk-E5AOEXF5.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/{chunk-PRMQTT7X.js → chunk-FIQYVDLL.js} +2 -2
  27. package/dist/cli-bundle/focused-chunks/{chunk-FKYUTTFL.js → chunk-HJA6OHWT.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/{chunk-IOL25GKH.js → chunk-KMNH4G6Y.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/{chunk-URH727T5.js → chunk-L554BKFH.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-QFEDRPPI.js → chunk-LZOEUNHR.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-UT7VS4X2.js → chunk-N2JYYEHM.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/{chunk-TSI73EEM.js → chunk-PIHQNL32.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/{chunk-MXESHALQ.js → chunk-QREDJ77O.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/{chunk-XR5EBU3B.js → chunk-S5JYIFFS.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/{chunk-CASXNCNQ.js → chunk-YE6F5HGF.js} +2 -2
  36. package/dist/cli-bundle/main.js +2 -2
  37. package/dist/cli-bundle/sdk-authoring.js +1 -1
  38. package/dist/cli-bundle/sdk-contracts.js +1 -1
  39. package/dist/cli-bundle/sdk-core.js +1 -1
  40. package/dist/cli-bundle/sdk-governance.js +1 -1
  41. package/dist/cli-bundle/sdk-graph.js +1 -1
  42. package/dist/cli-bundle/sdk-merge.js +2 -2
  43. package/dist/cli-bundle/sdk-query.js +1 -1
  44. package/dist/cli-bundle/sdk-runtime.js +1 -1
  45. package/dist/cli-bundle/sdk-testing.js +1 -1
  46. package/dist/cli-bundle/sdk.js +1 -1
  47. package/dist/sdk/cli-contracts/commander-types.d.ts +11 -11
  48. package/dist/sdk/cli-contracts/commander-types.js +1 -1
  49. package/dist/sdk/pagination.js +1 -1
  50. package/docs/QUALITY_EVIDENCE.md +70 -0
  51. package/docs/TESTING.md +8 -0
  52. package/marketplace.json +2 -2
  53. package/package.json +8 -3
  54. package/packages/pm-beads/package.json +1 -1
  55. package/packages/pm-calendar/package.json +1 -1
  56. package/packages/pm-command-kit/package.json +1 -1
  57. package/packages/pm-digital-twin/package.json +1 -1
  58. package/packages/pm-governance-audit/package.json +1 -1
  59. package/packages/pm-guide-shell/package.json +1 -1
  60. package/packages/pm-kanban/package.json +1 -1
  61. package/packages/pm-lifecycle-hooks/package.json +1 -1
  62. package/packages/pm-linked-test-adapters/package.json +1 -1
  63. package/packages/pm-search-advanced/package.json +1 -1
  64. package/packages/pm-templates/package.json +1 -1
  65. package/packages/pm-todos/package.json +1 -1
  66. package/packages/pm-vcs/package.json +1 -1
  67. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  68. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
@@ -1,2 +1,2 @@
1
- import{g as j,i as P}from"./chunk-JSW33Q6R.js";import{Ea as U,Ha as O,Qa as I,Va as L,Xa as T}from"./chunk-AVWHZUNC.js";import"./chunk-DEZPZOQ7.js";import{Ef as S,Eo as y,Hf as w,Ho as k,If as h,_a as D,ki as R,l as G,la as d,m as $,na as m}from"./chunk-CM57QHVK.js";import C from"node:fs/promises";import W 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]="b04d19bc-04b2-54e4-af48-5f930e1167dd")}catch{}})();var H={extension:"extension",package:void 0};async function _(e,t){if(!e)return;let o=G(e),a=y(t);await R(D(process.cwd(),a.path)).then(r=>r.ux.deprecation_hints)&&h($(o))}var V={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 X(e){let t=e.capability,o=typeof t=="string"?[t]:Array.isArray(t)?t.filter(i=>typeof i=="string"):[],a=[...new Set(o.map(i=>i.trim().toLowerCase()).filter(i=>i.length>0))];if(a.length>1)throw new m(`Multiple scaffold capabilities cannot be combined yet: ${a.join(", ")}. Choose one capability per scaffold.`,d.USAGE);return a[0]}function A(e,t,o="extension"){let a={...e};t!==void 0&&(a[V[t]]=!0);let i=(...c)=>c.some(s=>a[s]===!0),r=(...c)=>{for(let s of c)if(typeof a[s]=="string")return a[s]};return{init:i("init"),scaffold:i("scaffold"),install:i("install"),uninstall:i("uninstall"),explore:i("explore","list"),manage:i("manage"),describe:i("describe"),markdown:i("markdown"),reload:i("reload"),doctor:i("doctor"),catalog:i("catalog"),adopt:i("adopt"),adoptAll:i("adoptAll","adopt_all","adopt-all"),activate:i("activate"),deactivate:i("deactivate"),migrate:i("migrate"),project:i("project"),local:i("local"),global:i("global"),gh:r("gh"),github:r("github"),ref:r("ref"),capability:X(e),declarative:i("declarative"),fields:r("fields"),detail:r("detail"),output:r("output"),trace:i("trace"),watch:i("watch"),runtimeProbe:i("runtimeProbe","runtime_probe","runtime-probe"),fixManagedState:i("fixManagedState","fix_managed_state","fix-managed-state"),isolated:i("isolated"),ignoreGlobal:i("ignoreGlobal","ignore_global","ignore-global"),strictExit:i("strictExit","strict_exit","strict-exit"),failOnWarn:i("failOnWarn","fail_on_warn","fail-on-warn"),dryRun:i("dryRun","dry_run","dry-run"),vocabulary:o}}async function Y(e){let t=(await C.readdir(process.cwd())).filter(a=>!a.startsWith(".")).sort((a,i)=>a.localeCompare(i)),o=[...e].sort((a,i)=>a.localeCompare(i));return t.length===o.length&&t.every((a,i)=>a===o[i])}async function J(e){let t=(e??[]).map(o=>o.trim()).filter(o=>o.length>0);return t.length<=1?t.length===0?void 0:t:await Y(t)?["*"]:t}function M(e,t,o){let a=e.markdown===!0;if(o!==void 0&&o==="")throw new m("--output requires a non-empty file path.",d.USAGE);if(o!==void 0&&!a)throw new m("--output is only supported with --markdown describe output.",d.USAGE);if(a){if(t.json)throw new m("Cannot combine --json with --markdown.",d.USAGE);if(e.describe!==!0)throw new m("--markdown is only supported by the describe action.",d.USAGE)}}async function Q(e){let t=O(e.result.details,e.vocabulary);if(e.outputPath!==void 0){let o=W.resolve(e.outputPath);await C.mkdir(W.dirname(o),{recursive:!0}),await C.writeFile(o,t,"utf8")}if(!e.globalOptions.quiet){for(let o of e.result.warnings)h(`warning: ${o}`);e.outputPath===void 0&&S(t)}}function Z(e,t){let o=!!t.strictExit||!!t.failOnWarn;if(e.action!=="doctor"||!o)return;let a=e.details!==null&&typeof e.details=="object"?e.details:{},i=a.summary!==null&&typeof a.summary=="object"?a.summary:null,r=i&&typeof i.status=="string"?i.status:void 0;(e.warnings.length>0||r!==void 0&&r!=="ok")&&(process.exitCode=d.GENERIC_FAILURE)}async function p(e,t,o,a,i="extension"){let r=y(o),c=Date.now(),s=i==="extension"?"package":i;await _(H[i],o);let n=A(t,a,s),f=(typeof n.output=="string"?n.output:void 0)?.trim();M(n,r,f);let g=await I(e,n,r);n.markdown===!0?await Q({result:g,vocabulary:s,outputPath:f,globalOptions:r}):w(g,r),Z(g,n),g.ok===!1&&(process.exitCode=d.GENERIC_FAILURE),r.profile&&h(`profile:command=extension took_ms=${Date.now()-c}`)}function ee(e){return e.details!==null&&typeof e.details=="object"?e.details:{}}function te(e){return e instanceof m?{message:e.message,exit_code:e.exitCode,...e.context}:{message:e instanceof Error?e.message:String(e),exit_code:d.GENERIC_FAILURE}}async function oe(e,t,o){let a=[],i=[],r=d.GENERIC_FAILURE;for(let c of e)try{let s=await I(c,t,o),n=ee(s),l=Array.isArray(s.warnings)?s.warnings:[];i.push(...l);let f=s.ok===!0;a.push({target:c,ok:f,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,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,...f?{}:{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=te(s),l=n.exit_code;typeof l=="number"&&r===d.GENERIC_FAILURE&&l!==d.GENERIC_FAILURE&&(r=l),a.push({target:c,ok:!1,error:n})}return{rows:a,warnings:i,failureExitCode:r}}async function z(e,t,o,a){let i=a==="extension"?"package":a;await _(H[a],o);let r=await J(e);if(r===void 0||r.length<=1){await p(r?.[0],t,o,"install",i);return}let c=y(o),s=Date.now(),n=A(t,"install",i);if(M(n,c,void 0),[n.gh,n.github].some(b=>typeof b=="string"&&b.trim().length>0))throw new m("Multiple install targets cannot be combined with --gh/--github. Install one GitHub source per command, or pass multiple explicit local, bundled, or npm: targets.",d.USAGE,{code:"multi_target_github_install_ambiguous",required:"Use exactly one positional target with --gh/--github, or omit --gh/--github when installing multiple targets.",examples:["pm install --gh owner/repo","pm install npm:pm-guide-shell pm-todos"]});let{rows:f,warnings:g,failureExitCode:E}=await oe(r,n,c),v=f.filter(b=>b.ok!==!0).length,K={ok:v===0,action:"install",scope:n.global===!0?"global":"project",installed_count:n.dryRun===!0?0:f.length-v,...n.dryRun===!0?{dry_run:!0,planned_count:f.length-v}:{},failed_count:v,targets:f,warnings:[...new Set(g)].sort((b,B)=>b.localeCompare(B))};w(K,c),v>0&&(process.exitCode=E),c.profile&&h(`profile:command=extension took_ms=${Date.now()-s}`)}function ae(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 u(e,t){return t==="package"?x(e):ae(e)}function N(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 q(e,t,o){let a=y(t),i=Date.now();o&&await _("upgrade",t);let r=await P(e,t.optsWithGlobals(),a);w(r,a),r.ok||(process.exitCode=d.GENERIC_FAILURE),a.profile&&h(`profile:command=package-upgrade took_ms=${Date.now()-i}`)}function F(e,t){let o=t==="package"?"package":"extension",a=t==="package"?"packages":"extensions",i=t,r=e.command(i,{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)",k).option("--install",`Install a ${o} source`).option("--dry-run","Resolve install sources and estimate copying without destination writes or activation").option("--uninstall",`Uninstall an installed ${o}`).option("--explore",`List discovered ${a} in selected scope`).option("--list","Alias for --explore").option("--manage",`List managed ${a} with update-check metadata`).option("--describe",`Map every surface a loaded ${o} registers (optionally one by name)`).option("--markdown","Render describe output as a Markdown reference document (describe only)").option("--output <path>","Write describe Markdown to a file (requires --markdown)").option("--reload",`Reload ${a} with cache-busted module imports`).option("--watch","Use watch mode with --reload").option("--doctor",`Run consolidated ${o} diagnostics (summary/deep modes)`).option("--catalog",`List bundled first-party ${o} catalog metadata`).option("--adopt",`Adopt an existing unmanaged ${o} into managed metadata`).option("--adopt-all",`Adopt all unmanaged ${a} into managed metadata`).option("--activate",`Activate a ${o} in selected scope settings`).option("--deactivate",`Deactivate a ${o} in selected scope settings`).option("--project",`Use project ${o} scope (default)`).option("--local","Alias for --project").option("--global",`Use global ${o} scope`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").option("--detail <mode>",`${o[0].toUpperCase()}${o.slice(1)} diagnostics detail mode (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(t==="package"?"Manage package lifecycle in project or global scope.":"Manage extension lifecycle in project or global scope.").action(async(s,n,l)=>{await p(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)`,k).description(t==="package"?"Generate a starter package scaffold with package metadata, manifest, and entrypoint.":"Generate a starter extension scaffold with manifest and entrypoint.");t==="package"&&c.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"),u(c,t).action(async(s,n,l)=>{await p(s,l.optsWithGlobals(),l,"init",t)}),u(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 z(s,l.optsWithGlobals(),l,t)}),u(r.command("uninstall").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Uninstall an installed ${o}.`),t).action(async(s,n,l)=>{await p(s,l.optsWithGlobals(),l,"uninstall",t)}),u(r.command("explore").description(`List discovered ${a} in selected scope.`),t).action(async(s,n)=>{await p(void 0,n.optsWithGlobals(),n,"explore",t)}),u(r.command("manage").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).description(`List managed ${a} with update-check metadata.`),t).action(async(s,n)=>{await p(void 0,n.optsWithGlobals(),n,"manage",t)}),u(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 p(s,l.optsWithGlobals(),l,"describe",t)}),u(r.command("reload").option("--watch","Use watch mode for repeated reload checks").description(`Reload ${a} with cache-busted module imports.`),t).action(async(s,n)=>{await p(void 0,n.optsWithGlobals(),n,"reload",t)}),u(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 ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(`Run consolidated ${o} diagnostics (summary/deep modes).`),t).action(async(s,n)=>{await p(void 0,n.optsWithGlobals(),n,"doctor",t)}),u(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 p(void 0,n.optsWithGlobals(),n,"catalog",t)}),u(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 p(s,l.optsWithGlobals(),l,"adopt",t)}),u(r.command("adopt-all").description(`Adopt all unmanaged ${a} into managed metadata.`),t).action(async(s,n)=>{await p(void 0,n.optsWithGlobals(),n,"adopt-all",t)}),u(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 p(void 0,n.optsWithGlobals(),n,"migrate",t)}),u(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 p(s,l.optsWithGlobals(),l,"activate",t)}),u(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 p(s,l.optsWithGlobals(),l,"deactivate",t)}),t==="package"&&N(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 q(s,l,!1)})}async function ie(e,t,o){let a=y(o),i=Date.now(),r=await T(e,a,{idPrefix:typeof t.idPrefix=="string"?t.idPrefix:void 0,preset:typeof t.preset=="string"?t.preset:void 0,defaults:t.defaults===!0||t.yes===!0,author:typeof t.author=="string"?t.author:void 0,agentGuidance:typeof t.agentGuidance=="string"?t.agentGuidance:void 0,typePreset:typeof t.typePreset=="string"?t.typePreset:void 0,withPackages:t.withPackages===!0,mergeFence:t.mergeFence!==!1,force:t.force===!0,workspace:typeof t.workspace=="string"?t.workspace:void 0}),s=t.verbose===!0||a.json===!0;w(s?r:L(r,!0),a),a.profile&&h(`profile:command=init took_ms=${Date.now()-i}`)}function ne(e,t,o,a){let r=e!==void 0&&new Set(["get","set","list","export"]).has(e);return{resolvedScope:r?"project":e??"project",resolvedAction:r?e:t??"list",resolvedKey:r?t:o,resolvedValue:r?o:a}}function re(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 se(e,t,o,a,i,r){let c=y(r),s=Date.now(),{resolvedScope:n,resolvedAction:l,resolvedKey:f,resolvedValue:g}=ne(e,t,o,a),E=await j(n,l,f,re(i),c,typeof g=="string"?g:void 0);w(E,c),c.profile&&h(`profile:command=config took_ms=${Date.now()-s}`)}var Se={normalizeExtensionOptions:A};function Re(e){e.command("init").argument("[prefix-or-path]","Optional id prefix, or path-like tracker target such as ./pm-sandbox").option("--prefix, --id-prefix <value>","Set the item ID prefix (alias for the positional prefix)").option("--preset <value>","Governance preset for new setups: minimal|default|strict").option("--defaults","Use non-interactive setup defaults without opening the wizard").option("-y, --yes","Alias for --defaults (non-interactive setup)").option("--author <value>","Set the default mutation author for this project").option("--agent-guidance <mode>","Agent guidance mode: ask|add|skip|status").option("--type-preset <name>","Register domain item types during init: agile|ops|research").option("--with-packages","Install all bundled first-party packages during initialization").option("--no-merge-fence","Skip automatic merge-driver installation for a fresh Git-backed tracker").option("--workspace <dir>","Initialize repository-local tracker storage at <dir>/.agents/pm").option("--force","Allow initializing tracker files directly in a directory that looks like a workspace root").option("--verbose","Include the full resolved settings tree in the output (default output is a concise summary)").description("Initialize pm storage and defaults for the current workspace or a path-like tracker target.").action(async(t,o,a)=>{await ie(t,o,a)}),e.command("config").argument("[scope]","Config scope: project|global, or action shorthand list|export|get|set for project scope").argument("[action]","Config action: get|set|list|export").argument("[key]","Config key for get|set; use `pm config project list` for the complete typed inventory, including mutation-guard-* policies").argument("[value]",'Optional value for set: routed to the right typed flag by key (e.g. config set telemetry-tracking off, config set item-format toon, config set definition-of-done "Tests pass"). Equivalent to --policy/--format/--criterion. context keys still require --default-depth/--section-* flags.').option("--criterion <text>","Criteria value for definition-of-done, metadata-required-fields, or lifecycle pattern keys (repeatable for set)",k).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").option("--activity-limit <n>","Context default activity limit").option("--stale-threshold-days <n>","Context staleness cutoff in days").option("--section-hierarchy <value>","Enable/disable context hierarchy section (true|false)").option("--section-activity <value>","Enable/disable context activity section (true|false)").option("--section-progress <value>","Enable/disable context progress section (true|false)").option("--section-blockers <value>","Enable/disable context blockers section (true|false)").option("--section-files <value>","Enable/disable context files section (true|false)").option("--section-workload <value>","Enable/disable context workload section (true|false)").option("--section-staleness <value>","Enable/disable context staleness section (true|false)").option("--section-tests <value>","Enable/disable context tests section (true|false)").description("Read or update pm settings for the current workspace or global profile.").action(async(t,o,a,i,r,c)=>{await se(t,o,a,i,r,c)}),F(e,"extension"),F(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,a)=>{await _("install",a),await z(t,a.optsWithGlobals(),a,"package")}),N(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,a)=>{await q(t,a,!0)})}export{Se as _testOnlyRegisterSetup,Re as registerSetupCommands};
2
- //# sourceMappingURL=register-setup-Q3CYF67Q.js.map
1
+ import{g as j,i as P}from"./chunk-SXRMM72R.js";import{Ea as U,Ha as O,Qa as I,Va as L,Xa as T}from"./chunk-6WBR6GMW.js";import"./chunk-DEZPZOQ7.js";import{Ef as S,Eo as y,Hf as w,Ho as k,If as h,_a as D,ki as R,l as G,la as d,m as $,na as m}from"./chunk-7IABMUB6.js";import C from"node:fs/promises";import W 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]="b04d19bc-04b2-54e4-af48-5f930e1167dd")}catch{}})();var H={extension:"extension",package:void 0};async function _(e,t){if(!e)return;let o=G(e),a=y(t);await R(D(process.cwd(),a.path)).then(r=>r.ux.deprecation_hints)&&h($(o))}var V={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 X(e){let t=e.capability,o=typeof t=="string"?[t]:Array.isArray(t)?t.filter(i=>typeof i=="string"):[],a=[...new Set(o.map(i=>i.trim().toLowerCase()).filter(i=>i.length>0))];if(a.length>1)throw new m(`Multiple scaffold capabilities cannot be combined yet: ${a.join(", ")}. Choose one capability per scaffold.`,d.USAGE);return a[0]}function A(e,t,o="extension"){let a={...e};t!==void 0&&(a[V[t]]=!0);let i=(...c)=>c.some(s=>a[s]===!0),r=(...c)=>{for(let s of c)if(typeof a[s]=="string")return a[s]};return{init:i("init"),scaffold:i("scaffold"),install:i("install"),uninstall:i("uninstall"),explore:i("explore","list"),manage:i("manage"),describe:i("describe"),markdown:i("markdown"),reload:i("reload"),doctor:i("doctor"),catalog:i("catalog"),adopt:i("adopt"),adoptAll:i("adoptAll","adopt_all","adopt-all"),activate:i("activate"),deactivate:i("deactivate"),migrate:i("migrate"),project:i("project"),local:i("local"),global:i("global"),gh:r("gh"),github:r("github"),ref:r("ref"),capability:X(e),declarative:i("declarative"),fields:r("fields"),detail:r("detail"),output:r("output"),trace:i("trace"),watch:i("watch"),runtimeProbe:i("runtimeProbe","runtime_probe","runtime-probe"),fixManagedState:i("fixManagedState","fix_managed_state","fix-managed-state"),isolated:i("isolated"),ignoreGlobal:i("ignoreGlobal","ignore_global","ignore-global"),strictExit:i("strictExit","strict_exit","strict-exit"),failOnWarn:i("failOnWarn","fail_on_warn","fail-on-warn"),dryRun:i("dryRun","dry_run","dry-run"),vocabulary:o}}async function Y(e){let t=(await C.readdir(process.cwd())).filter(a=>!a.startsWith(".")).sort((a,i)=>a.localeCompare(i)),o=[...e].sort((a,i)=>a.localeCompare(i));return t.length===o.length&&t.every((a,i)=>a===o[i])}async function J(e){let t=(e??[]).map(o=>o.trim()).filter(o=>o.length>0);return t.length<=1?t.length===0?void 0:t:await Y(t)?["*"]:t}function M(e,t,o){let a=e.markdown===!0;if(o!==void 0&&o==="")throw new m("--output requires a non-empty file path.",d.USAGE);if(o!==void 0&&!a)throw new m("--output is only supported with --markdown describe output.",d.USAGE);if(a){if(t.json)throw new m("Cannot combine --json with --markdown.",d.USAGE);if(e.describe!==!0)throw new m("--markdown is only supported by the describe action.",d.USAGE)}}async function Q(e){let t=O(e.result.details,e.vocabulary);if(e.outputPath!==void 0){let o=W.resolve(e.outputPath);await C.mkdir(W.dirname(o),{recursive:!0}),await C.writeFile(o,t,"utf8")}if(!e.globalOptions.quiet){for(let o of e.result.warnings)h(`warning: ${o}`);e.outputPath===void 0&&S(t)}}function Z(e,t){let o=!!t.strictExit||!!t.failOnWarn;if(e.action!=="doctor"||!o)return;let a=e.details!==null&&typeof e.details=="object"?e.details:{},i=a.summary!==null&&typeof a.summary=="object"?a.summary:null,r=i&&typeof i.status=="string"?i.status:void 0;(e.warnings.length>0||r!==void 0&&r!=="ok")&&(process.exitCode=d.GENERIC_FAILURE)}async function p(e,t,o,a,i="extension"){let r=y(o),c=Date.now(),s=i==="extension"?"package":i;await _(H[i],o);let n=A(t,a,s),f=(typeof n.output=="string"?n.output:void 0)?.trim();M(n,r,f);let g=await I(e,n,r);n.markdown===!0?await Q({result:g,vocabulary:s,outputPath:f,globalOptions:r}):w(g,r),Z(g,n),g.ok===!1&&(process.exitCode=d.GENERIC_FAILURE),r.profile&&h(`profile:command=extension took_ms=${Date.now()-c}`)}function ee(e){return e.details!==null&&typeof e.details=="object"?e.details:{}}function te(e){return e instanceof m?{message:e.message,exit_code:e.exitCode,...e.context}:{message:e instanceof Error?e.message:String(e),exit_code:d.GENERIC_FAILURE}}async function oe(e,t,o){let a=[],i=[],r=d.GENERIC_FAILURE;for(let c of e)try{let s=await I(c,t,o),n=ee(s),l=Array.isArray(s.warnings)?s.warnings:[];i.push(...l);let f=s.ok===!0;a.push({target:c,ok:f,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,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,...f?{}:{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=te(s),l=n.exit_code;typeof l=="number"&&r===d.GENERIC_FAILURE&&l!==d.GENERIC_FAILURE&&(r=l),a.push({target:c,ok:!1,error:n})}return{rows:a,warnings:i,failureExitCode:r}}async function z(e,t,o,a){let i=a==="extension"?"package":a;await _(H[a],o);let r=await J(e);if(r===void 0||r.length<=1){await p(r?.[0],t,o,"install",i);return}let c=y(o),s=Date.now(),n=A(t,"install",i);if(M(n,c,void 0),[n.gh,n.github].some(b=>typeof b=="string"&&b.trim().length>0))throw new m("Multiple install targets cannot be combined with --gh/--github. Install one GitHub source per command, or pass multiple explicit local, bundled, or npm: targets.",d.USAGE,{code:"multi_target_github_install_ambiguous",required:"Use exactly one positional target with --gh/--github, or omit --gh/--github when installing multiple targets.",examples:["pm install --gh owner/repo","pm install npm:pm-guide-shell pm-todos"]});let{rows:f,warnings:g,failureExitCode:E}=await oe(r,n,c),v=f.filter(b=>b.ok!==!0).length,K={ok:v===0,action:"install",scope:n.global===!0?"global":"project",installed_count:n.dryRun===!0?0:f.length-v,...n.dryRun===!0?{dry_run:!0,planned_count:f.length-v}:{},failed_count:v,targets:f,warnings:[...new Set(g)].sort((b,B)=>b.localeCompare(B))};w(K,c),v>0&&(process.exitCode=E),c.profile&&h(`profile:command=extension took_ms=${Date.now()-s}`)}function ae(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 u(e,t){return t==="package"?x(e):ae(e)}function N(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 q(e,t,o){let a=y(t),i=Date.now();o&&await _("upgrade",t);let r=await P(e,t.optsWithGlobals(),a);w(r,a),r.ok||(process.exitCode=d.GENERIC_FAILURE),a.profile&&h(`profile:command=package-upgrade took_ms=${Date.now()-i}`)}function F(e,t){let o=t==="package"?"package":"extension",a=t==="package"?"packages":"extensions",i=t,r=e.command(i,{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)",k).option("--install",`Install a ${o} source`).option("--dry-run","Resolve install sources and estimate copying without destination writes or activation").option("--uninstall",`Uninstall an installed ${o}`).option("--explore",`List discovered ${a} in selected scope`).option("--list","Alias for --explore").option("--manage",`List managed ${a} with update-check metadata`).option("--describe",`Map every surface a loaded ${o} registers (optionally one by name)`).option("--markdown","Render describe output as a Markdown reference document (describe only)").option("--output <path>","Write describe Markdown to a file (requires --markdown)").option("--reload",`Reload ${a} with cache-busted module imports`).option("--watch","Use watch mode with --reload").option("--doctor",`Run consolidated ${o} diagnostics (summary/deep modes)`).option("--catalog",`List bundled first-party ${o} catalog metadata`).option("--adopt",`Adopt an existing unmanaged ${o} into managed metadata`).option("--adopt-all",`Adopt all unmanaged ${a} into managed metadata`).option("--activate",`Activate a ${o} in selected scope settings`).option("--deactivate",`Deactivate a ${o} in selected scope settings`).option("--project",`Use project ${o} scope (default)`).option("--local","Alias for --project").option("--global",`Use global ${o} scope`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").option("--detail <mode>",`${o[0].toUpperCase()}${o.slice(1)} diagnostics detail mode (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(t==="package"?"Manage package lifecycle in project or global scope.":"Manage extension lifecycle in project or global scope.").action(async(s,n,l)=>{await p(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)`,k).description(t==="package"?"Generate a starter package scaffold with package metadata, manifest, and entrypoint.":"Generate a starter extension scaffold with manifest and entrypoint.");t==="package"&&c.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"),u(c,t).action(async(s,n,l)=>{await p(s,l.optsWithGlobals(),l,"init",t)}),u(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 z(s,l.optsWithGlobals(),l,t)}),u(r.command("uninstall").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Uninstall an installed ${o}.`),t).action(async(s,n,l)=>{await p(s,l.optsWithGlobals(),l,"uninstall",t)}),u(r.command("explore").description(`List discovered ${a} in selected scope.`),t).action(async(s,n)=>{await p(void 0,n.optsWithGlobals(),n,"explore",t)}),u(r.command("manage").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).description(`List managed ${a} with update-check metadata.`),t).action(async(s,n)=>{await p(void 0,n.optsWithGlobals(),n,"manage",t)}),u(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 p(s,l.optsWithGlobals(),l,"describe",t)}),u(r.command("reload").option("--watch","Use watch mode for repeated reload checks").description(`Reload ${a} with cache-busted module imports.`),t).action(async(s,n)=>{await p(void 0,n.optsWithGlobals(),n,"reload",t)}),u(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 ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(`Run consolidated ${o} diagnostics (summary/deep modes).`),t).action(async(s,n)=>{await p(void 0,n.optsWithGlobals(),n,"doctor",t)}),u(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 p(void 0,n.optsWithGlobals(),n,"catalog",t)}),u(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 p(s,l.optsWithGlobals(),l,"adopt",t)}),u(r.command("adopt-all").description(`Adopt all unmanaged ${a} into managed metadata.`),t).action(async(s,n)=>{await p(void 0,n.optsWithGlobals(),n,"adopt-all",t)}),u(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 p(void 0,n.optsWithGlobals(),n,"migrate",t)}),u(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 p(s,l.optsWithGlobals(),l,"activate",t)}),u(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 p(s,l.optsWithGlobals(),l,"deactivate",t)}),t==="package"&&N(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 q(s,l,!1)})}async function ie(e,t,o){let a=y(o),i=Date.now(),r=await T(e,a,{idPrefix:typeof t.idPrefix=="string"?t.idPrefix:void 0,preset:typeof t.preset=="string"?t.preset:void 0,defaults:t.defaults===!0||t.yes===!0,author:typeof t.author=="string"?t.author:void 0,agentGuidance:typeof t.agentGuidance=="string"?t.agentGuidance:void 0,typePreset:typeof t.typePreset=="string"?t.typePreset:void 0,withPackages:t.withPackages===!0,mergeFence:t.mergeFence!==!1,force:t.force===!0,workspace:typeof t.workspace=="string"?t.workspace:void 0}),s=t.verbose===!0||a.json===!0;w(s?r:L(r,!0),a),a.profile&&h(`profile:command=init took_ms=${Date.now()-i}`)}function ne(e,t,o,a){let r=e!==void 0&&new Set(["get","set","list","export"]).has(e);return{resolvedScope:r?"project":e??"project",resolvedAction:r?e:t??"list",resolvedKey:r?t:o,resolvedValue:r?o:a}}function re(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 se(e,t,o,a,i,r){let c=y(r),s=Date.now(),{resolvedScope:n,resolvedAction:l,resolvedKey:f,resolvedValue:g}=ne(e,t,o,a),E=await j(n,l,f,re(i),c,typeof g=="string"?g:void 0);w(E,c),c.profile&&h(`profile:command=config took_ms=${Date.now()-s}`)}var Se={normalizeExtensionOptions:A};function Re(e){e.command("init").argument("[prefix-or-path]","Optional id prefix, or path-like tracker target such as ./pm-sandbox").option("--prefix, --id-prefix <value>","Set the item ID prefix (alias for the positional prefix)").option("--preset <value>","Governance preset for new setups: minimal|default|strict").option("--defaults","Use non-interactive setup defaults without opening the wizard").option("-y, --yes","Alias for --defaults (non-interactive setup)").option("--author <value>","Set the default mutation author for this project").option("--agent-guidance <mode>","Agent guidance mode: ask|add|skip|status").option("--type-preset <name>","Register domain item types during init: agile|ops|research").option("--with-packages","Install all bundled first-party packages during initialization").option("--no-merge-fence","Skip automatic merge-driver installation for a fresh Git-backed tracker").option("--workspace <dir>","Initialize repository-local tracker storage at <dir>/.agents/pm").option("--force","Allow initializing tracker files directly in a directory that looks like a workspace root").option("--verbose","Include the full resolved settings tree in the output (default output is a concise summary)").description("Initialize pm storage and defaults for the current workspace or a path-like tracker target.").action(async(t,o,a)=>{await ie(t,o,a)}),e.command("config").argument("[scope]","Config scope: project|global, or action shorthand list|export|get|set for project scope").argument("[action]","Config action: get|set|list|export").argument("[key]","Config key for get|set; use `pm config project list` for the complete typed inventory, including mutation-guard-* policies").argument("[value]",'Optional value for set: routed to the right typed flag by key (e.g. config set telemetry-tracking off, config set item-format toon, config set definition-of-done "Tests pass"). Equivalent to --policy/--format/--criterion. context keys still require --default-depth/--section-* flags.').option("--criterion <text>","Criteria value for definition-of-done, metadata-required-fields, or lifecycle pattern keys (repeatable for set)",k).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").option("--activity-limit <n>","Context default activity limit").option("--stale-threshold-days <n>","Context staleness cutoff in days").option("--section-hierarchy <value>","Enable/disable context hierarchy section (true|false)").option("--section-activity <value>","Enable/disable context activity section (true|false)").option("--section-progress <value>","Enable/disable context progress section (true|false)").option("--section-blockers <value>","Enable/disable context blockers section (true|false)").option("--section-files <value>","Enable/disable context files section (true|false)").option("--section-workload <value>","Enable/disable context workload section (true|false)").option("--section-staleness <value>","Enable/disable context staleness section (true|false)").option("--section-tests <value>","Enable/disable context tests section (true|false)").description("Read or update pm settings for the current workspace or global profile.").action(async(t,o,a,i,r,c)=>{await se(t,o,a,i,r,c)}),F(e,"extension"),F(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,a)=>{await _("install",a),await z(t,a.optsWithGlobals(),a,"package")}),N(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,a)=>{await q(t,a,!0)})}export{Se as _testOnlyRegisterSetup,Re as registerSetupCommands};
2
+ //# sourceMappingURL=register-setup-4EW2PPZD.js.map
@@ -1,4 +1,4 @@
1
- import{a as $o,c as Pr,d as Nr,e as Kc,g as Yc,h as Do,i as Xc,j as tn,k as nn,l as Zc,m as Qc,n as Po,o as nl,p as rn,q as on,r as rl,s as il,t as No}from"./chunk-QFEDRPPI.js";import{e as qr,f as Uo,h as zo}from"./chunk-LH24XUPJ.js";import{B as yl,C as zr,D as wl,E as jo,G as vl,H as bl,J as kl,K as Hr,M as Wr,a as Hc,g as To,i as Wc}from"./chunk-UT7VS4X2.js";import{K as Od}from"./chunk-AO5FR7PN.js";import{$ as ud,C as Go,D as ri,Ga as Sd,Ha as Ed,La as xd,Ma as Rd,S as ii,T as Ql,U as Jo,V as qn,X as Vo,aa as md,ba as fd,ca as pd,da as si,e as ql,f as Bl,fa as hd,g as Gl,ga as _d,ha as gd,ia as Ut,j as ni,ja as yd,jb as Cd,ka as mn,la as wd,lb as Xo,ma as Ko,mb as Td,n as Hn,na as fn,nb as $d,o as Jl,oa as vd,p as Vl,pa as bd,q as Wn,qa as kd,r as Kl,ra as Yo,t as Bo,u as Yl,vb as Zo,y as Xl}from"./chunk-UAU4DJSR.js";import{a as Bc,b as en,c as Oo,d as Gc,e as Jc,f as rt,g as Lr,h as Vc,i as vt}from"./chunk-TSI73EEM.js";import{$ as Mt,Aa as jl,Ab as it,Bb as jt,C as B,Ca as ln,D as Sl,Da as zn,Ea as Ul,Eb as dd,Fa as Yr,Fb as ot,G as Se,Ga as Ft,H as Ho,Ha as me,Ia as Xr,Ja as zl,Ka as qo,La as Zr,Ma as dn,N as El,Na as Qr,O as Br,Oa as Hl,Qa as Ee,R as Gr,Ra as Wl,S as Jr,Sa as T,Ta as ei,Tb as Bn,U as xl,Ua as ti,V as Pe,Vb as ai,Wa as Zl,X as kt,Y as Rl,Z as Il,_ as Al,aa as Cl,ac as Id,bb as ed,cb as td,dc as Ad,eb as nd,fa as Tl,fb as rd,ga as Wo,gb as St,ha as Vr,hb as id,ia as an,ib as od,ka as Kr,la as $l,lb as sd,ma as Ol,mb as ad,oa as Dl,qa as Pl,rb as oi,sa as Nl,tb as cd,ua as Ll,vb as te,wa as cn,wb as Ne,xa as Ml,xb as Le,yb as ld,za as Fl,zb as un}from"./chunk-FKYUTTFL.js";import{b as Zt,e as de,g as De,i as ke,j as Je,n as he,o as el,p as Mr,r as tl}from"./chunk-JCD5YESL.js";import{$ as g,$a as Dt,$d as ce,Aa as Oe,Ab as Ge,Ba as Tc,Bc as fl,Da as Q,Ga as $c,Jc as W,Ka as Oc,Kb as qc,Mc as ee,Oc as Ue,Pb as Fr,Pc as pl,Qa as Dc,Qb as ol,Qc as Ur,Ra as Pc,Rb as Lo,S as Sc,Sa as q,Sb as Mo,Sd as C,T as Ec,Tb as Fo,Td as gl,Ud as sn,V as xc,Vb as sl,Vd as bt,Wb as al,Wd as Lt,X as Rc,Xa as Un,Xc as hl,Y as Or,Ya as N,Yc as Ve,Z as Ic,Za as qe,Zb as cl,_a as Dr,_c as _l,a as Tr,aa as y,bb as Nc,cb as Pt,d as $r,eb as Lc,ec as ll,fb as Mc,gb as Fc,ha as Ac,i as vc,ka as Cc,l as bc,m as kc,ma as Ao,ob as jc,pb as Nt,qb as A,ra as jn,rb as Uc,sa as P,sb as be,ta as wt,ua as F,ub as Co,va as K,vb as zc,vc as dl,w as Io,wa as ae,wb as Qt,xc as jr,yb as Be,yc as ul,za as pe,zc as ml}from"./chunk-URH727T5.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]="00d2200c-d308-51a6-acc4-8da90afaf6d6")}catch{}})();var L=class extends TypeError{constructor(t){super(t),this.name="AssuranceMutationRefusalError"}},xe=class extends TypeError{context;constructor(t,n={}){super(t),this.name="AssuranceEvaluationRefusalError",this.context=n}},Ke=class extends TypeError{measurement_id;source_kind;field;check;constructor(t,n){super(t),this.name="AssuranceSourceResolutionError",this.measurement_id=n.measurement_id,this.source_kind=n.source_kind,this.field=n.field,this.check=n.check}};async function pn(e){try{return await e()}catch(t){throw t instanceof L?new y(t.message,g.USAGE,{code:"invalid_argument_value",reason:"assurance_mutation_refused"}):t}}async function Dd(e){try{return await e()}catch(t){throw t instanceof xe?new y(t.message,g.USAGE,{code:"invalid_argument_value",reason:"assurance_evaluation_refused",...t.context}):t}}import{createHash as og}from"node:crypto";import sg 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]="b00dcab2-22c6-55b7-b93d-f6f5413d4b04")}catch{}})();var hn=1e3;(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]="00ad9b34-4feb-5812-8755-801869cce3ad")}catch{}})();var Nd=1,zt=["pre-commit","pre-push","pre-merge","ci","pre-release","post-release","scheduled","on-claim","on-close"],Qo=["items","dependency_kind","prose_edge_gap","graph","validate","health","history","links","provider","derived"],ag=["ceiling","floor","equals","zero","monotone_nondecreasing","monotone_nonincreasing","subset_of"],cg=/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/,ci=30,li=5e3,Ld=4,lg=50;function st(e,t){if(!cg.test(e))throw new L(`${t} must be a stable lowercase id`)}function dg(e,t){if(!Number.isFinite(e)||e<0)throw new L(`${t} must be a finite non-negative number`)}function Gn(e){let t=ag.filter(i=>e[i]!==void 0);if(t.length!==1)throw new L(`assertion ${e.id} must declare exactly one polarity`);let n=t[0],r=e[n];return{polarity:n,value:n==="zero"?0:r}}function ts(e,t){return A(e)===A(t)}function Md(e,t){if(t.polarity==="equals")return ts(e,t.value);if(t.polarity==="subset_of"){if(!Array.isArray(e)||!Array.isArray(t.value))return!1;let r=t.value;return e.every(i=>r.includes(i))}if(typeof e!="number")return!1;let n=t.value;return t.polarity==="ceiling"||t.polarity==="monotone_nonincreasing"?e<=n:t.polarity==="floor"||t.polarity==="monotone_nondecreasing"?e>=n:e===0}function Fd(e){let t=Gn(e),n=e.negative_control.cases;return n.some(r=>r.expected==="pass")&&n.some(r=>r.expected==="fail")&&n.every(r=>Md(r.observed,t)===(r.expected==="pass"))}function ug(e,t){if(e.polarity!==t.polarity)return!0;if(typeof e.value=="number"&&typeof t.value=="number")return e.polarity==="ceiling"||e.polarity==="monotone_nonincreasing"?t.value>e.value:e.polarity==="floor"||e.polarity==="monotone_nondecreasing"?t.value<e.value:t.value!==e.value;if(e.polarity==="subset_of"){let n=e.value,r=t.value;return!Array.isArray(n)||!Array.isArray(r)||r.some(i=>!n.includes(i))}return!ts(e.value,t.value)}function mg(e,t){if(e.measurement_id!==t.measurement_id||e.owner_item_id!==t.owner_item_id||A(e.scope)!==A(t.scope))return!0;let n={observe:0,warn:1,block:2},r=(e.lifetime??"hold")==="hold"&&(t.lifetime??"hold")==="retire";return ug(Gn(e),Gn(t))||n[t.enforcement]<n[e.enforcement]||r}function fg(e){if(e.state!==void 0&&!(e.state==="present"||e.state==="missing"))throw new L("items source state must be present or missing");let t=Object.hasOwn(e,"equals"),n=e.state!==void 0,r=Number(t)+Number(n);if(e.field!==void 0&&r!==1)throw new L("items source with field requires exactly one of equals or state");if(e.field===void 0&&r!==0)throw new L("items source equals/state requires field")}function pg(e){if(typeof e.dependency_kind!="string"||e.dependency_kind.trim().length===0)throw new L("dependency_kind source requires dependency_kind");if([e.source_kind,e.source_kind_prefix,e.source_kind_state].filter(n=>n!==void 0).length>1)throw new L("dependency_kind source accepts at most one source_kind predicate");if(e.source_kind!==void 0&&e.source_kind.trim().length===0||e.source_kind_prefix!==void 0&&e.source_kind_prefix.trim().length===0)throw new L("dependency_kind source provenance values must not be empty");if(e.source_kind_state!==void 0&&e.source_kind_state!=="present"&&e.source_kind_state!=="missing")throw new L("dependency_kind source source_kind_state must be present or missing")}function hg(e){if(e.sample_limit!==void 0&&(!Number.isInteger(e.sample_limit)||e.sample_limit<1))throw new L("prose_edge_gap sample_limit must be a positive integer");for(let t of e.exemptions??[]){if(typeof t.holder_id!="string"||t.holder_id.trim().length===0||typeof t.reason!="string"||t.reason.trim().length===0)throw new L("prose_edge_gap exemptions require holder_id and reason");if(t.target_id!==void 0&&t.target_id.trim().length===0||t.text_contains!==void 0&&t.text_contains.trim().length===0)throw new L("prose_edge_gap exemption selectors must not be empty")}}function ns(e){st(e.id,"measurement.id"),e.max_cost!==void 0&&dg(e.max_cost,"measurement.max_cost");let t=e.source;if(Object.prototype.toString.call(t)!=="[object Object]")throw new L(`measurement.source.kind must be one of ${Qo.join(", ")}`);let n=Reflect.get(t,"kind");if(!Qo.includes(n))throw new L(`measurement.source.kind must be one of ${Qo.join(", ")}`);let r=t;if(r.kind==="items"&&fg(r),r.kind==="dependency_kind"&&pg(r),r.kind==="prose_edge_gap"&&hg(r),(r.kind==="graph"||r.kind==="validate"||r.kind==="health")&&(typeof r.field!="string"||r.field.trim().length===0))throw new L(`${r.kind} source requires field`);return r.kind==="provider"&&(st(r.provider,"provider source provider"),st(r.key,"provider source key")),e}function rs(e){if(st(e.id,"assertion.id"),st(e.measurement_id,"assertion.measurement_id"),typeof e.owner_item_id!="string"||e.owner_item_id.trim().length===0)throw new L("assertion.owner_item_id is required");let t=Gn(e);if(typeof t.value=="number"&&!Number.isFinite(t.value))throw new L(`assertion.${t.polarity} must be a finite number`);if(e.lifetime==="retire"&&(typeof e.retire_reason!="string"||e.retire_reason.trim().length===0))throw new L("retired assertion requires retire_reason");e.scope.kind==="filter"&&st(e.scope.measurement_id,"assertion.scope.measurement_id");let n=e.negative_control?.cases;if(!Array.isArray(n)||!n.some(r=>r.expected==="pass")||!n.some(r=>r.expected==="fail"))throw new L("assertion negative control requires pass and fail cases");if(!Fd(e))throw new L(`assertion ${e.id} negative control does not prove its bound`);return e}function _g(e){if(!Array.isArray(e.allowed_providers))throw new L("gate provider_policy.allowed_providers must be an array");for(let t of e.allowed_providers)st(t,"gate.provider_policy.allowed_provider");if(typeof e.triggers!="object"||e.triggers===null||Array.isArray(e.triggers))throw new L("gate provider_policy.triggers must be an object");for(let[t,n]of Object.entries(e.triggers)){if(!zt.includes(t))throw new L(`gate provider policy has unknown trigger ${t}`);if(typeof n!="object"||n===null||!["low","medium","high"].includes(n.max_cost_class)||typeof n.allow_network!="boolean")throw new L(`gate provider policy trigger ${t} is invalid`)}}function jd(e){if(st(e.id,"gate.id"),!Array.isArray(e.assertion_ids))throw new L("gate.assertion_ids is required and must be an array");if(e.assertion_ids.length===0)throw new L("gate requires at least one assertion");for(let t of e.assertion_ids)st(t,"gate.assertion_id");if(!Array.isArray(e.triggers))throw new L(`gate.triggers is required and must be an array of ${zt.join(", ")}`);if(e.triggers.length===0)throw new L("gate requires at least one trigger");for(let t of e.triggers)if(!zt.includes(t))throw new L(`gate trigger must be one of ${zt.join(", ")}`);return e.provider_policy&&_g(e.provider_policy),e}function _n(e){if(e.version!==Nd)throw new L(`unsupported assurance document version ${String(e.version)}`);let t=new Set;for(let r of e.measurements){if(ns(r),t.has(`measurement:${r.id}`))throw new L(`duplicate measurement ${r.id}`);t.add(`measurement:${r.id}`)}for(let r of e.assertions){if(rs(r),t.has(`assertion:${r.id}`))throw new L(`duplicate assertion ${r.id}`);t.add(`assertion:${r.id}`)}for(let r of e.gates){jd(r);let i=r.assertion_ids.filter(o=>!e.assertions.some(s=>s.id===o));if(i.length>0)throw new L(`gate ${r.id} references missing assertions: ${i.join(", ")}`);if(t.has(`gate:${r.id}`))throw new L(`duplicate gate ${r.id}`);t.add(`gate:${r.id}`)}let n=new Set(e.measurements.map(r=>r.id));for(let[r,i]of Ud(e))if(!n.has(r))throw new L(`${i.join(", ")} references missing measurement ${r}`);return e}function is(e,t){if("measurement"in e){t.push(e.measurement);return}if("operator"in e)for(let n of e.operands)is(n,t)}function Ud(e){let t=new Map,n=(r,i)=>{let o=t.get(r)??[];o.push(i),t.set(r,o)};for(let r of e.assertions)n(r.measurement_id,`assertion ${r.id}`),r.scope.kind==="filter"&&n(r.scope.measurement_id,`assertion ${r.id} scope`);for(let r of e.measurements){if(r.source.kind!=="derived")continue;let i=[];is(r.source.expression,i);for(let o of i)n(o,`derived measurement ${r.id}`)}return t}function gg(e,t){let n=e.assertion_ids.flatMap(o=>{let s=t.assertions.find(a=>a.id===o);return[s.measurement_id,...s.scope.kind==="filter"?[s.scope.measurement_id]:[]]}),r=new Set,i=new Set;for(;n.length>0;){let o=n.pop();if(r.has(o))continue;r.add(o);let s=t.measurements.find(a=>a.id===o);s.source.kind==="provider"?i.add(s.source.provider):s.source.kind==="derived"&&is(s.source.expression,n)}return i}function Jn(){return{version:Nd,measurements:[],assertions:[],gates:[]}}function yg(e,t){let n=t.items.filter(r=>(e.statuses===void 0||e.statuses.includes(r.status))&&(e.types===void 0||e.types.includes(r.type))&&(e.tags===void 0||e.tags.every(i=>r.tags?.includes(i)))&&(e.field===void 0||(()=>{let i=r[e.field];if(e.state!==void 0){let o=i==null||i===""||Array.isArray(i)&&i.length===0;return e.state==="missing"?o:!o}return ts(i,e.equals)})()));return{value:n.length,population_size:t.items.length,cost:t.items.length,contributors:n.map(r=>r.id)}}function wg(e,t){return e.source_kind!==void 0?t?.toLowerCase()===e.source_kind.trim().toLowerCase():e.source_kind_prefix!==void 0?t?.toLowerCase().startsWith(e.source_kind_prefix.trim().toLowerCase())===!0:e.source_kind_state==="present"?t!==void 0&&t.length>0:e.source_kind_state==="missing"?t===void 0||t.length===0:!0}function vg(e,t){let n=[],r=Ao(e.dependency_kind)??e.dependency_kind.trim().toLowerCase();for(let i of t.items)for(let o of i.dependencies??[]){let s=Ao(o.kind)??o.kind.trim().toLowerCase(),a=o.source_kind?.trim();s===r&&wg(e,a)&&n.push(`${i.id}->${o.id}${a?`@${a}`:""}`)}return{value:n.length,population_size:t.items.length,cost:t.items.length,contributors:n}}function bg(e){let t=[e.description,e.body].filter(n=>typeof n=="string").map(n=>n.trim()).filter(Boolean);for(let n of["comments","notes","learnings"]){let r=e[n];if(Array.isArray(r)){for(let i of r)if(typeof i=="string")t.push(i);else if(typeof i=="object"&&i!==null){let o=Reflect.get(i,"text");typeof o=="string"&&t.push(o)}}}return t}function kg(e,t,n,r){return e.some(i=>i.holder_id.trim().toLowerCase()===t.toLowerCase()&&(i.target_id===void 0||i.target_id.trim().toLowerCase()===n.toLowerCase())&&(i.text_contains===void 0||r.toLowerCase().includes(i.text_contains.trim().toLowerCase())))}function es(e,t){return[e.toLowerCase(),t.toLowerCase()].sort().join("\0")}function Sg(e){let t=new Map,n=new Set,r=[],i=/\b[a-z][a-z0-9]*-[a-z0-9]+\b/giu,o=0;for(let s of e){t.set(s.id.toLowerCase(),s.id);for(let a of s.dependencies??[])n.add(es(s.id,a.id));for(let a of[s.parent,s.blocked_by])typeof a=="string"&&n.add(es(s.id,a));for(let a of bg(s)){let c=[...a.matchAll(i)].map(l=>l[0]);o+=c.length,r.push({holder_id:s.id,segment:a,mentioned_ids:c})}}return{canonical_ids:t,linked_pairs:n,prose_mentions:r,mention_count:o}}function Eg(e,t){let n=Sg(t.items),r=new Map;for(let s of n.prose_mentions){let a=s.mentioned_ids.map(l=>n.canonical_ids.get(l.toLowerCase())).filter(l=>l!==void 0&&l!==s.holder_id),c=[...new Set(a)];for(let l of c){let d=es(s.holder_id,l);if(n.linked_pairs.has(d)||kg(e.exemptions??[],s.holder_id,l,s.segment))continue;let u=c.some(m=>m!==l);r.get(d)?.explicit===!0&&!u||r.set(d,{contributor:`${s.holder_id}->${l}|subject=${u?"explicit":"implicit"}`,explicit:u})}}let i=[...r.values()],o=i.map(s=>s.contributor).sort();return{value:o.length,population_size:n.canonical_ids.size,cost:t.items.length+n.linked_pairs.size+n.mention_count,contributors:o.slice(0,e.sample_limit??25),partitions:{explicit_subject:i.filter(s=>s.explicit).length,implicit_subject:i.filter(s=>!s.explicit).length}}}function xg(e,t){return{value:t.history.filter(r=>(e.op===void 0||r.op===e.op)&&(e.author===void 0||r.author===e.author)&&(e.harness===void 0||r.agent_harness===e.harness)&&(e.model===void 0||r.agent_model===e.model)).length,population_size:t.history.length,cost:t.history.length}}function Rg(e,t){let n=t.items.filter(r=>{let i=r[e.link],o=Array.isArray(i)&&i.length>0;return e.state==="present"?o:!o});return{value:n.length,population_size:t.items.length,cost:t.items.length,contributors:n.map(r=>r.id)}}function Ig(e,t){let n=e.source;return n.kind==="items"?yg(n,t):n.kind==="dependency_kind"?vg(n,t):n.kind==="prose_edge_gap"?Eg(n,t):n.kind==="history"?xg(n,t):n.kind==="links"?Rg(n,t):null}function zd(e,t){return e.reduce((n,r)=>({units:n.units+r.units,items_scanned:n.items_scanned+r.items_scanned,history_entries:n.history_entries+r.history_entries,provider_calls:n.provider_calls+r.provider_calls,duration_ms:t}),{units:0,items_scanned:0,history_entries:0,provider_calls:0,duration_ms:t})}function Ag(e,t){if(t.length===0)throw new TypeError(`derived ${e} requires operands`);if(e==="add")return t.reduce((n,r)=>n+r,0);if(e==="subtract")return t.slice(1).reduce((n,r)=>n-r,t[0]);if(e==="multiply")return t.reduce((n,r)=>n*r,1);if(e==="divide"){if(t.slice(1).includes(0))throw new TypeError("derived divide cannot divide by zero");return t.slice(1).reduce((n,r)=>n/r,t[0])}return e==="min"?Math.min(...t):Math.max(...t)}async function Hd(e,t,n){let r=new Array(e.length),i=0,o=Array.from({length:Math.min(t,e.length)},async()=>{for(;i<e.length;){let s=i;i+=1,r[s]=await n(e[s],s)}});return await Promise.all(o),r}async function Wd(e,t,n,r,i){if("literal"in e)return{value:e.literal,costs:[],population_size:0,contributors:[]};if("measurement"in e){let s=n.find(l=>l.id===e.measurement);if(!s)throw new TypeError(`derived measurement references missing ${e.measurement}`);let a=await qd(s,t,n,r,i);if(typeof a.value!="number")throw new TypeError(`derived measurement ${s.id} is not numeric`);let c=i.charged.has(s.id)?[]:[a.cost];return i.charged.add(s.id),{value:a.value,costs:c,population_size:a.population_size,contributors:a.contributors}}let o=await Hd(e.operands,Ld,s=>Wd(s,t,n,r,i));return{value:Ag(e.operator,o.map(s=>s.value)),costs:o.flatMap(s=>s.costs),population_size:Math.max(0,...o.map(s=>s.population_size)),contributors:[...new Set(o.flatMap(s=>s.contributors))]}}async function Cg(e,t,n,r,i){ns(e);let o=Date.now(),s,a=[],c=0;if(e.source.kind==="derived"){let u=await Wd(e.source.expression,t,n,[...r,e.id],i);s={value:u.value,population_size:u.population_size,cost:0,contributors:u.contributors},a=u.costs}else{let u=Ig(e,t);u!==null?s=u:(s=await t.external(e.source),c=1)}let l={units:s.cost,items_scanned:e.source.kind==="items"||e.source.kind==="dependency_kind"||e.source.kind==="prose_edge_gap"||e.source.kind==="links"?t.items.length:0,history_entries:e.source.kind==="history"?t.history.length:0,provider_calls:c,duration_ms:Date.now()-o},d=zd([...a,l],Date.now()-o);if(e.max_cost!==void 0&&d.units>e.max_cost)throw new xe(`measurement ${e.id} exceeded cost ceiling ${e.max_cost} with ${d.units}`);return{id:e.id,definition_fingerprint:`sha256:${og("sha256").update(A(e)).digest("hex")}`,value:s.value,population_size:s.population_size,cost:d,contributors:s.contributors??[],...s.partitions?{partitions:s.partitions}:{}}}function qd(e,t,n,r,i){if(r.includes(e.id))throw new TypeError(`derived measurement cycle: ${[...r,e.id].join(" -> ")}`);let o=i.cache.get(e.id);if(o)return o;let s=Cg(e,t,n,r,i).catch(a=>{if(a instanceof Ke&&a.measurement_id===void 0){let c={measurement_id:e.id,source_kind:a.source_kind,field:a.field,...a.check?{check:a.check}:{}},l=new Ke(a.message,c);throw l.cause=a,l}throw a});return i.cache.set(e.id,s),s}async function os(e,t,n=[e]){return qd(e,t,n,[],{cache:new Map,charged:new Set})}function Tg(e,t){return typeof e!="number"||typeof t.value!="number"?null:t.polarity==="ceiling"||t.polarity==="monotone_nonincreasing"?t.value-e:(t.polarity==="floor"||t.polarity==="monotone_nondecreasing",e-t.value)}function $g(e,t,n={}){rs(e);let r=Gn(e),i=e.lifetime==="retire"&&n.owner_terminal===!0;return{assertion_id:e.id,measurement_id:e.measurement_id,measurement_definition_fingerprint:t.definition_fingerprint,scope:e.scope,population_size:t.population_size,observed:t.value,bound:r,distance:Tg(t.value,r),verdict:i?"retired":Md(t.value,r)?"pass":"fail",enforcement:e.enforcement,negative_control_proven:Fd(e),cost:t.cost,contributors:t.contributors,...t.partitions?{partitions:t.partitions}:{}}}function Og(e,t,n,r){let i=gg(e,t);if(i.size===0)return;let o=e.provider_policy,s=o?.triggers[r];if(!o||!s)throw new xe(`assurance gate ${e.id} refuses provider execution at trigger ${r} without an explicit provider policy`);let a=new Set(o.allowed_providers),c={low:0,medium:1,high:2};for(let l of i){if(!a.has(l))throw new xe(`assurance gate ${e.id} refuses provider ${l}`);let d=n.provider_capabilities?.[l];if(!d)throw new xe(`assurance provider ${l} has no declared capabilities`);if(c[d.cost_class]>c[s.max_cost_class])throw new xe(`assurance gate ${e.id} refuses ${d.cost_class}-cost provider ${l} at trigger ${r}`);if(d.network&&!s.allow_network)throw new xe(`assurance gate ${e.id} refuses network provider ${l} at trigger ${r}`)}}async function Pd(e,t,n,r,i){try{return await os(n,r,i)}catch(o){if(o instanceof Ke){let s=o.check?` check ${o.check}`:"",a=o.measurement_id??n.id,c=new xe(`assurance gate ${e} assertion ${t} measurement ${a} source ${o.source_kind}${s} field ${o.field} could not resolve: ${o.message}`,{gate_id:e,assertion_id:t,measurement_id:a,source_kind:o.source_kind,field:o.field,...o.check?{check:o.check}:{}});throw c.cause=o,c}throw o}}async function Bd(e,t,n,r){_n(t);let i=t.gates.find(c=>c.id===e);if(!i)throw new xe(`assurance gate ${e} not found`);if(!i.triggers.includes(r.trigger))throw new xe(`assurance gate ${e} does not declare trigger ${r.trigger}`);Og(i,t,n,r.trigger);let o=await Hd(i.assertion_ids,Ld,async c=>{let l=t.assertions.find(p=>p.id===c),d=t.measurements.find(p=>p.id===l.measurement_id),u=n;if(l.scope.kind==="active"){let p=new Set(n.terminal_statuses??["closed","canceled"]);u={...n,items:n.items.filter(_=>!p.has(_.status))}}else if(l.scope.kind==="filter"){let p=l.scope.measurement_id,_=t.measurements.find(v=>v.id===p),h=await Pd(i.id,l.id,_,n,t.measurements),w=new Set(h.contributors);u={...n,items:n.items.filter(v=>w.has(v.id))}}let m=n.items.find(p=>p.id===l.owner_item_id),f=m!==void 0&&new Set(n.terminal_statuses??["closed","canceled"]).has(m.status);return $g(l,await Pd(i.id,l.id,d,u,t.measurements),{owner_terminal:f})}),s=o.some(c=>c.verdict==="fail"&&c.enforcement==="block"),a=o.some(c=>c.verdict==="fail"&&c.enforcement==="warn");return{gate_id:i.id,tree_id:n.tree_id,trigger:r.trigger,dry_run:r.dry_run===!0,evaluated_at:new Date().toISOString(),verdict:s?"block":a?"warn":"pass",exit_code:s?1:0,assertions:o,assertions_total:o.length,row_contract:{row_keys:["assertions"],jq_selector:".assertions[]"},cost:zd(o.map(c=>c.cost),Math.max(0,...o.map(c=>c.cost.duration_ms)))}}function di(e){return sg.join(e,"assurance.json")}async function Gd(e){let t=await K(di(e));return t===null?Jn():ui(t)}function ui(e){try{return _n(JSON.parse(e))}catch(t){throw new y("The assurance registry is invalid. Repair or restore .agents/pm/assurance.json and retry.",g.GENERIC_FAILURE,{code:"assurance_registry_invalid",reason:String(t),nextSteps:["Restore a valid assurance.json from version control or repair its declaration references.","Run pm assurance list measurement after the repair."]})}}function mi(e,t){return t==="measurement"?e.measurements:t==="assertion"?e.assertions:e.gates}function Dg(e,t){e==="measurement"?ns(t):e==="assertion"?rs(t):jd(t)}async function Vn(e,t){let n=structuredClone(mi(await Gd(e),t));return{items:n,count:n.length,row_contract:{row_keys:["items"],jq_selector:".items[]"}}}async function ss(e,t,n){let r=mi(await Gd(e),t).find(i=>i.id===n);if(!r)throw new TypeError(`assurance ${t} ${n} not found`);return structuredClone(r)}async function fi(e,t,n,r={}){Dg(t,n);let i=await T(e),o=B(r.author,i.author_default),s=await dn({pmRoot:e,filePath:di(e),op:`assurance:${t}:put`,author:o,message:r.message,lockTtlSeconds:ci,lockWaitMs:li,mutate:a=>{let c=a===null?Jn():ui(a),l=mi(c,t),d=l.findIndex(m=>m.id===n.id),u=d<0?"created":"updated";if(t==="assertion"&&d>=0&&mg(l[d],n)){let m=n.authorization_decision;if(!m||!r.authorized_decision_ids?.includes(m))throw new L(`loosening assertion ${n.id} requires a verified authorization_decision`)}return d<0?l.push(structuredClone(n)):l[d]=structuredClone(n),_n(c),{raw:`${JSON.stringify(c,null,2)}
1
+ import{a as $o,c as Pr,d as Nr,e as Kc,g as Yc,h as Do,i as Xc,j as tn,k as nn,l as Zc,m as Qc,n as Po,o as nl,p as rn,q as on,r as rl,s as il,t as No}from"./chunk-LZOEUNHR.js";import{e as qr,f as Uo,h as zo}from"./chunk-6CWR2QFM.js";import{B as yl,C as zr,D as wl,E as jo,G as vl,H as bl,J as kl,K as Hr,M as Wr,a as Hc,g as To,i as Wc}from"./chunk-N2JYYEHM.js";import{K as Od}from"./chunk-E5AOEXF5.js";import{$ as ud,C as Go,D as ri,Ga as Sd,Ha as Ed,La as xd,Ma as Rd,S as ii,T as Ql,U as Jo,V as qn,X as Vo,aa as md,ba as fd,ca as pd,da as si,e as ql,f as Bl,fa as hd,g as Gl,ga as _d,ha as gd,ia as Ut,j as ni,ja as yd,jb as Cd,ka as mn,la as wd,lb as Xo,ma as Ko,mb as Td,n as Hn,na as fn,nb as $d,o as Jl,oa as vd,p as Vl,pa as bd,q as Wn,qa as kd,r as Kl,ra as Yo,t as Bo,u as Yl,vb as Zo,y as Xl}from"./chunk-BULUJEOL.js";import{a as Bc,b as en,c as Oo,d as Gc,e as Jc,f as rt,g as Lr,h as Vc,i as vt}from"./chunk-PIHQNL32.js";import{$ as Mt,Aa as jl,Ab as it,Bb as jt,C as B,Ca as ln,D as Sl,Da as zn,Ea as Ul,Eb as dd,Fa as Yr,Fb as ot,G as Se,Ga as Ft,H as Ho,Ha as me,Ia as Xr,Ja as zl,Ka as qo,La as Zr,Ma as dn,N as El,Na as Qr,O as Br,Oa as Hl,Qa as Ee,R as Gr,Ra as Wl,S as Jr,Sa as T,Ta as ei,Tb as Bn,U as xl,Ua as ti,V as Pe,Vb as ai,Wa as Zl,X as kt,Y as Rl,Z as Il,_ as Al,aa as Cl,ac as Id,bb as ed,cb as td,dc as Ad,eb as nd,fa as Tl,fb as rd,ga as Wo,gb as St,ha as Vr,hb as id,ia as an,ib as od,ka as Kr,la as $l,lb as sd,ma as Ol,mb as ad,oa as Dl,qa as Pl,rb as oi,sa as Nl,tb as cd,ua as Ll,vb as te,wa as cn,wb as Ne,xa as Ml,xb as Le,yb as ld,za as Fl,zb as un}from"./chunk-HJA6OHWT.js";import{b as Zt,e as de,g as De,i as ke,j as Je,n as he,o as el,p as Mr,r as tl}from"./chunk-BQSKFRL2.js";import{$ as g,$a as Dt,$d as ce,Aa as Oe,Ab as Ge,Ba as Tc,Bc as fl,Da as Q,Ga as $c,Jc as W,Ka as Oc,Kb as qc,Mc as ee,Oc as Ue,Pb as Fr,Pc as pl,Qa as Dc,Qb as ol,Qc as Ur,Ra as Pc,Rb as Lo,S as Sc,Sa as q,Sb as Mo,Sd as C,T as Ec,Tb as Fo,Td as gl,Ud as sn,V as xc,Vb as sl,Vd as bt,Wb as al,Wd as Lt,X as Rc,Xa as Un,Xc as hl,Y as Or,Ya as N,Yc as Ve,Z as Ic,Za as qe,Zb as cl,_a as Dr,_c as _l,a as Tr,aa as y,bb as Nc,cb as Pt,d as $r,eb as Lc,ec as ll,fb as Mc,gb as Fc,ha as Ac,i as vc,ka as Cc,l as bc,m as kc,ma as Ao,ob as jc,pb as Nt,qb as A,ra as jn,rb as Uc,sa as P,sb as be,ta as wt,ua as F,ub as Co,va as K,vb as zc,vc as dl,w as Io,wa as ae,wb as Qt,xc as jr,yb as Be,yc as ul,za as pe,zc as ml}from"./chunk-L554BKFH.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]="00d2200c-d308-51a6-acc4-8da90afaf6d6")}catch{}})();var L=class extends TypeError{constructor(t){super(t),this.name="AssuranceMutationRefusalError"}},xe=class extends TypeError{context;constructor(t,n={}){super(t),this.name="AssuranceEvaluationRefusalError",this.context=n}},Ke=class extends TypeError{measurement_id;source_kind;field;check;constructor(t,n){super(t),this.name="AssuranceSourceResolutionError",this.measurement_id=n.measurement_id,this.source_kind=n.source_kind,this.field=n.field,this.check=n.check}};async function pn(e){try{return await e()}catch(t){throw t instanceof L?new y(t.message,g.USAGE,{code:"invalid_argument_value",reason:"assurance_mutation_refused"}):t}}async function Dd(e){try{return await e()}catch(t){throw t instanceof xe?new y(t.message,g.USAGE,{code:"invalid_argument_value",reason:"assurance_evaluation_refused",...t.context}):t}}import{createHash as og}from"node:crypto";import sg 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]="b00dcab2-22c6-55b7-b93d-f6f5413d4b04")}catch{}})();var hn=1e3;(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]="00ad9b34-4feb-5812-8755-801869cce3ad")}catch{}})();var Nd=1,zt=["pre-commit","pre-push","pre-merge","ci","pre-release","post-release","scheduled","on-claim","on-close"],Qo=["items","dependency_kind","prose_edge_gap","graph","validate","health","history","links","provider","derived"],ag=["ceiling","floor","equals","zero","monotone_nondecreasing","monotone_nonincreasing","subset_of"],cg=/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/,ci=30,li=5e3,Ld=4,lg=50;function st(e,t){if(!cg.test(e))throw new L(`${t} must be a stable lowercase id`)}function dg(e,t){if(!Number.isFinite(e)||e<0)throw new L(`${t} must be a finite non-negative number`)}function Gn(e){let t=ag.filter(i=>e[i]!==void 0);if(t.length!==1)throw new L(`assertion ${e.id} must declare exactly one polarity`);let n=t[0],r=e[n];return{polarity:n,value:n==="zero"?0:r}}function ts(e,t){return A(e)===A(t)}function Md(e,t){if(t.polarity==="equals")return ts(e,t.value);if(t.polarity==="subset_of"){if(!Array.isArray(e)||!Array.isArray(t.value))return!1;let r=t.value;return e.every(i=>r.includes(i))}if(typeof e!="number")return!1;let n=t.value;return t.polarity==="ceiling"||t.polarity==="monotone_nonincreasing"?e<=n:t.polarity==="floor"||t.polarity==="monotone_nondecreasing"?e>=n:e===0}function Fd(e){let t=Gn(e),n=e.negative_control.cases;return n.some(r=>r.expected==="pass")&&n.some(r=>r.expected==="fail")&&n.every(r=>Md(r.observed,t)===(r.expected==="pass"))}function ug(e,t){if(e.polarity!==t.polarity)return!0;if(typeof e.value=="number"&&typeof t.value=="number")return e.polarity==="ceiling"||e.polarity==="monotone_nonincreasing"?t.value>e.value:e.polarity==="floor"||e.polarity==="monotone_nondecreasing"?t.value<e.value:t.value!==e.value;if(e.polarity==="subset_of"){let n=e.value,r=t.value;return!Array.isArray(n)||!Array.isArray(r)||r.some(i=>!n.includes(i))}return!ts(e.value,t.value)}function mg(e,t){if(e.measurement_id!==t.measurement_id||e.owner_item_id!==t.owner_item_id||A(e.scope)!==A(t.scope))return!0;let n={observe:0,warn:1,block:2},r=(e.lifetime??"hold")==="hold"&&(t.lifetime??"hold")==="retire";return ug(Gn(e),Gn(t))||n[t.enforcement]<n[e.enforcement]||r}function fg(e){if(e.state!==void 0&&!(e.state==="present"||e.state==="missing"))throw new L("items source state must be present or missing");let t=Object.hasOwn(e,"equals"),n=e.state!==void 0,r=Number(t)+Number(n);if(e.field!==void 0&&r!==1)throw new L("items source with field requires exactly one of equals or state");if(e.field===void 0&&r!==0)throw new L("items source equals/state requires field")}function pg(e){if(typeof e.dependency_kind!="string"||e.dependency_kind.trim().length===0)throw new L("dependency_kind source requires dependency_kind");if([e.source_kind,e.source_kind_prefix,e.source_kind_state].filter(n=>n!==void 0).length>1)throw new L("dependency_kind source accepts at most one source_kind predicate");if(e.source_kind!==void 0&&e.source_kind.trim().length===0||e.source_kind_prefix!==void 0&&e.source_kind_prefix.trim().length===0)throw new L("dependency_kind source provenance values must not be empty");if(e.source_kind_state!==void 0&&e.source_kind_state!=="present"&&e.source_kind_state!=="missing")throw new L("dependency_kind source source_kind_state must be present or missing")}function hg(e){if(e.sample_limit!==void 0&&(!Number.isInteger(e.sample_limit)||e.sample_limit<1))throw new L("prose_edge_gap sample_limit must be a positive integer");for(let t of e.exemptions??[]){if(typeof t.holder_id!="string"||t.holder_id.trim().length===0||typeof t.reason!="string"||t.reason.trim().length===0)throw new L("prose_edge_gap exemptions require holder_id and reason");if(t.target_id!==void 0&&t.target_id.trim().length===0||t.text_contains!==void 0&&t.text_contains.trim().length===0)throw new L("prose_edge_gap exemption selectors must not be empty")}}function ns(e){st(e.id,"measurement.id"),e.max_cost!==void 0&&dg(e.max_cost,"measurement.max_cost");let t=e.source;if(Object.prototype.toString.call(t)!=="[object Object]")throw new L(`measurement.source.kind must be one of ${Qo.join(", ")}`);let n=Reflect.get(t,"kind");if(!Qo.includes(n))throw new L(`measurement.source.kind must be one of ${Qo.join(", ")}`);let r=t;if(r.kind==="items"&&fg(r),r.kind==="dependency_kind"&&pg(r),r.kind==="prose_edge_gap"&&hg(r),(r.kind==="graph"||r.kind==="validate"||r.kind==="health")&&(typeof r.field!="string"||r.field.trim().length===0))throw new L(`${r.kind} source requires field`);return r.kind==="provider"&&(st(r.provider,"provider source provider"),st(r.key,"provider source key")),e}function rs(e){if(st(e.id,"assertion.id"),st(e.measurement_id,"assertion.measurement_id"),typeof e.owner_item_id!="string"||e.owner_item_id.trim().length===0)throw new L("assertion.owner_item_id is required");let t=Gn(e);if(typeof t.value=="number"&&!Number.isFinite(t.value))throw new L(`assertion.${t.polarity} must be a finite number`);if(e.lifetime==="retire"&&(typeof e.retire_reason!="string"||e.retire_reason.trim().length===0))throw new L("retired assertion requires retire_reason");e.scope.kind==="filter"&&st(e.scope.measurement_id,"assertion.scope.measurement_id");let n=e.negative_control?.cases;if(!Array.isArray(n)||!n.some(r=>r.expected==="pass")||!n.some(r=>r.expected==="fail"))throw new L("assertion negative control requires pass and fail cases");if(!Fd(e))throw new L(`assertion ${e.id} negative control does not prove its bound`);return e}function _g(e){if(!Array.isArray(e.allowed_providers))throw new L("gate provider_policy.allowed_providers must be an array");for(let t of e.allowed_providers)st(t,"gate.provider_policy.allowed_provider");if(typeof e.triggers!="object"||e.triggers===null||Array.isArray(e.triggers))throw new L("gate provider_policy.triggers must be an object");for(let[t,n]of Object.entries(e.triggers)){if(!zt.includes(t))throw new L(`gate provider policy has unknown trigger ${t}`);if(typeof n!="object"||n===null||!["low","medium","high"].includes(n.max_cost_class)||typeof n.allow_network!="boolean")throw new L(`gate provider policy trigger ${t} is invalid`)}}function jd(e){if(st(e.id,"gate.id"),!Array.isArray(e.assertion_ids))throw new L("gate.assertion_ids is required and must be an array");if(e.assertion_ids.length===0)throw new L("gate requires at least one assertion");for(let t of e.assertion_ids)st(t,"gate.assertion_id");if(!Array.isArray(e.triggers))throw new L(`gate.triggers is required and must be an array of ${zt.join(", ")}`);if(e.triggers.length===0)throw new L("gate requires at least one trigger");for(let t of e.triggers)if(!zt.includes(t))throw new L(`gate trigger must be one of ${zt.join(", ")}`);return e.provider_policy&&_g(e.provider_policy),e}function _n(e){if(e.version!==Nd)throw new L(`unsupported assurance document version ${String(e.version)}`);let t=new Set;for(let r of e.measurements){if(ns(r),t.has(`measurement:${r.id}`))throw new L(`duplicate measurement ${r.id}`);t.add(`measurement:${r.id}`)}for(let r of e.assertions){if(rs(r),t.has(`assertion:${r.id}`))throw new L(`duplicate assertion ${r.id}`);t.add(`assertion:${r.id}`)}for(let r of e.gates){jd(r);let i=r.assertion_ids.filter(o=>!e.assertions.some(s=>s.id===o));if(i.length>0)throw new L(`gate ${r.id} references missing assertions: ${i.join(", ")}`);if(t.has(`gate:${r.id}`))throw new L(`duplicate gate ${r.id}`);t.add(`gate:${r.id}`)}let n=new Set(e.measurements.map(r=>r.id));for(let[r,i]of Ud(e))if(!n.has(r))throw new L(`${i.join(", ")} references missing measurement ${r}`);return e}function is(e,t){if("measurement"in e){t.push(e.measurement);return}if("operator"in e)for(let n of e.operands)is(n,t)}function Ud(e){let t=new Map,n=(r,i)=>{let o=t.get(r)??[];o.push(i),t.set(r,o)};for(let r of e.assertions)n(r.measurement_id,`assertion ${r.id}`),r.scope.kind==="filter"&&n(r.scope.measurement_id,`assertion ${r.id} scope`);for(let r of e.measurements){if(r.source.kind!=="derived")continue;let i=[];is(r.source.expression,i);for(let o of i)n(o,`derived measurement ${r.id}`)}return t}function gg(e,t){let n=e.assertion_ids.flatMap(o=>{let s=t.assertions.find(a=>a.id===o);return[s.measurement_id,...s.scope.kind==="filter"?[s.scope.measurement_id]:[]]}),r=new Set,i=new Set;for(;n.length>0;){let o=n.pop();if(r.has(o))continue;r.add(o);let s=t.measurements.find(a=>a.id===o);s.source.kind==="provider"?i.add(s.source.provider):s.source.kind==="derived"&&is(s.source.expression,n)}return i}function Jn(){return{version:Nd,measurements:[],assertions:[],gates:[]}}function yg(e,t){let n=t.items.filter(r=>(e.statuses===void 0||e.statuses.includes(r.status))&&(e.types===void 0||e.types.includes(r.type))&&(e.tags===void 0||e.tags.every(i=>r.tags?.includes(i)))&&(e.field===void 0||(()=>{let i=r[e.field];if(e.state!==void 0){let o=i==null||i===""||Array.isArray(i)&&i.length===0;return e.state==="missing"?o:!o}return ts(i,e.equals)})()));return{value:n.length,population_size:t.items.length,cost:t.items.length,contributors:n.map(r=>r.id)}}function wg(e,t){return e.source_kind!==void 0?t?.toLowerCase()===e.source_kind.trim().toLowerCase():e.source_kind_prefix!==void 0?t?.toLowerCase().startsWith(e.source_kind_prefix.trim().toLowerCase())===!0:e.source_kind_state==="present"?t!==void 0&&t.length>0:e.source_kind_state==="missing"?t===void 0||t.length===0:!0}function vg(e,t){let n=[],r=Ao(e.dependency_kind)??e.dependency_kind.trim().toLowerCase();for(let i of t.items)for(let o of i.dependencies??[]){let s=Ao(o.kind)??o.kind.trim().toLowerCase(),a=o.source_kind?.trim();s===r&&wg(e,a)&&n.push(`${i.id}->${o.id}${a?`@${a}`:""}`)}return{value:n.length,population_size:t.items.length,cost:t.items.length,contributors:n}}function bg(e){let t=[e.description,e.body].filter(n=>typeof n=="string").map(n=>n.trim()).filter(Boolean);for(let n of["comments","notes","learnings"]){let r=e[n];if(Array.isArray(r)){for(let i of r)if(typeof i=="string")t.push(i);else if(typeof i=="object"&&i!==null){let o=Reflect.get(i,"text");typeof o=="string"&&t.push(o)}}}return t}function kg(e,t,n,r){return e.some(i=>i.holder_id.trim().toLowerCase()===t.toLowerCase()&&(i.target_id===void 0||i.target_id.trim().toLowerCase()===n.toLowerCase())&&(i.text_contains===void 0||r.toLowerCase().includes(i.text_contains.trim().toLowerCase())))}function es(e,t){return[e.toLowerCase(),t.toLowerCase()].sort().join("\0")}function Sg(e){let t=new Map,n=new Set,r=[],i=/\b[a-z][a-z0-9]*-[a-z0-9]+\b/giu,o=0;for(let s of e){t.set(s.id.toLowerCase(),s.id);for(let a of s.dependencies??[])n.add(es(s.id,a.id));for(let a of[s.parent,s.blocked_by])typeof a=="string"&&n.add(es(s.id,a));for(let a of bg(s)){let c=[...a.matchAll(i)].map(l=>l[0]);o+=c.length,r.push({holder_id:s.id,segment:a,mentioned_ids:c})}}return{canonical_ids:t,linked_pairs:n,prose_mentions:r,mention_count:o}}function Eg(e,t){let n=Sg(t.items),r=new Map;for(let s of n.prose_mentions){let a=s.mentioned_ids.map(l=>n.canonical_ids.get(l.toLowerCase())).filter(l=>l!==void 0&&l!==s.holder_id),c=[...new Set(a)];for(let l of c){let d=es(s.holder_id,l);if(n.linked_pairs.has(d)||kg(e.exemptions??[],s.holder_id,l,s.segment))continue;let u=c.some(m=>m!==l);r.get(d)?.explicit===!0&&!u||r.set(d,{contributor:`${s.holder_id}->${l}|subject=${u?"explicit":"implicit"}`,explicit:u})}}let i=[...r.values()],o=i.map(s=>s.contributor).sort();return{value:o.length,population_size:n.canonical_ids.size,cost:t.items.length+n.linked_pairs.size+n.mention_count,contributors:o.slice(0,e.sample_limit??25),partitions:{explicit_subject:i.filter(s=>s.explicit).length,implicit_subject:i.filter(s=>!s.explicit).length}}}function xg(e,t){return{value:t.history.filter(r=>(e.op===void 0||r.op===e.op)&&(e.author===void 0||r.author===e.author)&&(e.harness===void 0||r.agent_harness===e.harness)&&(e.model===void 0||r.agent_model===e.model)).length,population_size:t.history.length,cost:t.history.length}}function Rg(e,t){let n=t.items.filter(r=>{let i=r[e.link],o=Array.isArray(i)&&i.length>0;return e.state==="present"?o:!o});return{value:n.length,population_size:t.items.length,cost:t.items.length,contributors:n.map(r=>r.id)}}function Ig(e,t){let n=e.source;return n.kind==="items"?yg(n,t):n.kind==="dependency_kind"?vg(n,t):n.kind==="prose_edge_gap"?Eg(n,t):n.kind==="history"?xg(n,t):n.kind==="links"?Rg(n,t):null}function zd(e,t){return e.reduce((n,r)=>({units:n.units+r.units,items_scanned:n.items_scanned+r.items_scanned,history_entries:n.history_entries+r.history_entries,provider_calls:n.provider_calls+r.provider_calls,duration_ms:t}),{units:0,items_scanned:0,history_entries:0,provider_calls:0,duration_ms:t})}function Ag(e,t){if(t.length===0)throw new TypeError(`derived ${e} requires operands`);if(e==="add")return t.reduce((n,r)=>n+r,0);if(e==="subtract")return t.slice(1).reduce((n,r)=>n-r,t[0]);if(e==="multiply")return t.reduce((n,r)=>n*r,1);if(e==="divide"){if(t.slice(1).includes(0))throw new TypeError("derived divide cannot divide by zero");return t.slice(1).reduce((n,r)=>n/r,t[0])}return e==="min"?Math.min(...t):Math.max(...t)}async function Hd(e,t,n){let r=new Array(e.length),i=0,o=Array.from({length:Math.min(t,e.length)},async()=>{for(;i<e.length;){let s=i;i+=1,r[s]=await n(e[s],s)}});return await Promise.all(o),r}async function Wd(e,t,n,r,i){if("literal"in e)return{value:e.literal,costs:[],population_size:0,contributors:[]};if("measurement"in e){let s=n.find(l=>l.id===e.measurement);if(!s)throw new TypeError(`derived measurement references missing ${e.measurement}`);let a=await qd(s,t,n,r,i);if(typeof a.value!="number")throw new TypeError(`derived measurement ${s.id} is not numeric`);let c=i.charged.has(s.id)?[]:[a.cost];return i.charged.add(s.id),{value:a.value,costs:c,population_size:a.population_size,contributors:a.contributors}}let o=await Hd(e.operands,Ld,s=>Wd(s,t,n,r,i));return{value:Ag(e.operator,o.map(s=>s.value)),costs:o.flatMap(s=>s.costs),population_size:Math.max(0,...o.map(s=>s.population_size)),contributors:[...new Set(o.flatMap(s=>s.contributors))]}}async function Cg(e,t,n,r,i){ns(e);let o=Date.now(),s,a=[],c=0;if(e.source.kind==="derived"){let u=await Wd(e.source.expression,t,n,[...r,e.id],i);s={value:u.value,population_size:u.population_size,cost:0,contributors:u.contributors},a=u.costs}else{let u=Ig(e,t);u!==null?s=u:(s=await t.external(e.source),c=1)}let l={units:s.cost,items_scanned:e.source.kind==="items"||e.source.kind==="dependency_kind"||e.source.kind==="prose_edge_gap"||e.source.kind==="links"?t.items.length:0,history_entries:e.source.kind==="history"?t.history.length:0,provider_calls:c,duration_ms:Date.now()-o},d=zd([...a,l],Date.now()-o);if(e.max_cost!==void 0&&d.units>e.max_cost)throw new xe(`measurement ${e.id} exceeded cost ceiling ${e.max_cost} with ${d.units}`);return{id:e.id,definition_fingerprint:`sha256:${og("sha256").update(A(e)).digest("hex")}`,value:s.value,population_size:s.population_size,cost:d,contributors:s.contributors??[],...s.partitions?{partitions:s.partitions}:{}}}function qd(e,t,n,r,i){if(r.includes(e.id))throw new TypeError(`derived measurement cycle: ${[...r,e.id].join(" -> ")}`);let o=i.cache.get(e.id);if(o)return o;let s=Cg(e,t,n,r,i).catch(a=>{if(a instanceof Ke&&a.measurement_id===void 0){let c={measurement_id:e.id,source_kind:a.source_kind,field:a.field,...a.check?{check:a.check}:{}},l=new Ke(a.message,c);throw l.cause=a,l}throw a});return i.cache.set(e.id,s),s}async function os(e,t,n=[e]){return qd(e,t,n,[],{cache:new Map,charged:new Set})}function Tg(e,t){return typeof e!="number"||typeof t.value!="number"?null:t.polarity==="ceiling"||t.polarity==="monotone_nonincreasing"?t.value-e:(t.polarity==="floor"||t.polarity==="monotone_nondecreasing",e-t.value)}function $g(e,t,n={}){rs(e);let r=Gn(e),i=e.lifetime==="retire"&&n.owner_terminal===!0;return{assertion_id:e.id,measurement_id:e.measurement_id,measurement_definition_fingerprint:t.definition_fingerprint,scope:e.scope,population_size:t.population_size,observed:t.value,bound:r,distance:Tg(t.value,r),verdict:i?"retired":Md(t.value,r)?"pass":"fail",enforcement:e.enforcement,negative_control_proven:Fd(e),cost:t.cost,contributors:t.contributors,...t.partitions?{partitions:t.partitions}:{}}}function Og(e,t,n,r){let i=gg(e,t);if(i.size===0)return;let o=e.provider_policy,s=o?.triggers[r];if(!o||!s)throw new xe(`assurance gate ${e.id} refuses provider execution at trigger ${r} without an explicit provider policy`);let a=new Set(o.allowed_providers),c={low:0,medium:1,high:2};for(let l of i){if(!a.has(l))throw new xe(`assurance gate ${e.id} refuses provider ${l}`);let d=n.provider_capabilities?.[l];if(!d)throw new xe(`assurance provider ${l} has no declared capabilities`);if(c[d.cost_class]>c[s.max_cost_class])throw new xe(`assurance gate ${e.id} refuses ${d.cost_class}-cost provider ${l} at trigger ${r}`);if(d.network&&!s.allow_network)throw new xe(`assurance gate ${e.id} refuses network provider ${l} at trigger ${r}`)}}async function Pd(e,t,n,r,i){try{return await os(n,r,i)}catch(o){if(o instanceof Ke){let s=o.check?` check ${o.check}`:"",a=o.measurement_id??n.id,c=new xe(`assurance gate ${e} assertion ${t} measurement ${a} source ${o.source_kind}${s} field ${o.field} could not resolve: ${o.message}`,{gate_id:e,assertion_id:t,measurement_id:a,source_kind:o.source_kind,field:o.field,...o.check?{check:o.check}:{}});throw c.cause=o,c}throw o}}async function Bd(e,t,n,r){_n(t);let i=t.gates.find(c=>c.id===e);if(!i)throw new xe(`assurance gate ${e} not found`);if(!i.triggers.includes(r.trigger))throw new xe(`assurance gate ${e} does not declare trigger ${r.trigger}`);Og(i,t,n,r.trigger);let o=await Hd(i.assertion_ids,Ld,async c=>{let l=t.assertions.find(p=>p.id===c),d=t.measurements.find(p=>p.id===l.measurement_id),u=n;if(l.scope.kind==="active"){let p=new Set(n.terminal_statuses??["closed","canceled"]);u={...n,items:n.items.filter(_=>!p.has(_.status))}}else if(l.scope.kind==="filter"){let p=l.scope.measurement_id,_=t.measurements.find(v=>v.id===p),h=await Pd(i.id,l.id,_,n,t.measurements),w=new Set(h.contributors);u={...n,items:n.items.filter(v=>w.has(v.id))}}let m=n.items.find(p=>p.id===l.owner_item_id),f=m!==void 0&&new Set(n.terminal_statuses??["closed","canceled"]).has(m.status);return $g(l,await Pd(i.id,l.id,d,u,t.measurements),{owner_terminal:f})}),s=o.some(c=>c.verdict==="fail"&&c.enforcement==="block"),a=o.some(c=>c.verdict==="fail"&&c.enforcement==="warn");return{gate_id:i.id,tree_id:n.tree_id,trigger:r.trigger,dry_run:r.dry_run===!0,evaluated_at:new Date().toISOString(),verdict:s?"block":a?"warn":"pass",exit_code:s?1:0,assertions:o,assertions_total:o.length,row_contract:{row_keys:["assertions"],jq_selector:".assertions[]"},cost:zd(o.map(c=>c.cost),Math.max(0,...o.map(c=>c.cost.duration_ms)))}}function di(e){return sg.join(e,"assurance.json")}async function Gd(e){let t=await K(di(e));return t===null?Jn():ui(t)}function ui(e){try{return _n(JSON.parse(e))}catch(t){throw new y("The assurance registry is invalid. Repair or restore .agents/pm/assurance.json and retry.",g.GENERIC_FAILURE,{code:"assurance_registry_invalid",reason:String(t),nextSteps:["Restore a valid assurance.json from version control or repair its declaration references.","Run pm assurance list measurement after the repair."]})}}function mi(e,t){return t==="measurement"?e.measurements:t==="assertion"?e.assertions:e.gates}function Dg(e,t){e==="measurement"?ns(t):e==="assertion"?rs(t):jd(t)}async function Vn(e,t){let n=structuredClone(mi(await Gd(e),t));return{items:n,count:n.length,row_contract:{row_keys:["items"],jq_selector:".items[]"}}}async function ss(e,t,n){let r=mi(await Gd(e),t).find(i=>i.id===n);if(!r)throw new TypeError(`assurance ${t} ${n} not found`);return structuredClone(r)}async function fi(e,t,n,r={}){Dg(t,n);let i=await T(e),o=B(r.author,i.author_default),s=await dn({pmRoot:e,filePath:di(e),op:`assurance:${t}:put`,author:o,message:r.message,lockTtlSeconds:ci,lockWaitMs:li,mutate:a=>{let c=a===null?Jn():ui(a),l=mi(c,t),d=l.findIndex(m=>m.id===n.id),u=d<0?"created":"updated";if(t==="assertion"&&d>=0&&mg(l[d],n)){let m=n.authorization_decision;if(!m||!r.authorized_decision_ids?.includes(m))throw new L(`loosening assertion ${n.id} requires a verified authorization_decision`)}return d<0?l.push(structuredClone(n)):l[d]=structuredClone(n),_n(c),{raw:`${JSON.stringify(c,null,2)}
2
2
  `,result:{changed:!0,action:u,kind:t,id:n.id}}}});return{...s.result,changed:s.changed}}async function as(e,t,n={}){let r=Jn();r.measurements=structuredClone(t.measurements),r.assertions=structuredClone(t.assertions),r.gates=structuredClone(t.gates),_n(r);let i=await T(e),o=B(n.author,i.author_default),s=await dn({pmRoot:e,filePath:di(e),op:"assurance:bundle:apply",author:o,message:n.message,lockTtlSeconds:ci,lockWaitMs:li,mutate:a=>{let c=a===null?Jn():ui(a),l=[],d=[],u=(m,f,p)=>{for(let _ of f){let h=m.find(w=>w.id===_.id);if(!h){m.push(structuredClone(_)),l.push(`${p}:${_.id}`);continue}if(A(h)!==A(_))throw new L(`assurance bundle refuses to replace divergent ${p} ${_.id}`);d.push(`${p}:${_.id}`)}};return u(c.measurements,r.measurements,"measurement"),u(c.assertions,r.assertions,"assertion"),u(c.gates,r.gates,"gate"),_n(c),{raw:`${JSON.stringify(c,null,2)}
3
3
  `,result:{changed:l.length>0,created_ids:l,unchanged_ids:d}}}});return{...s.result,changed:s.changed}}async function Jd(e,t,n,r={}){let i=await T(e),o=B(r.author,i.author_default),s=await dn({pmRoot:e,filePath:di(e),op:`assurance:${t}:remove`,author:o,message:r.message,lockTtlSeconds:ci,lockWaitMs:li,mutate:a=>{let c=a===null?Jn():ui(a);if(t==="measurement"){let u=Ud(c).get(n);if(u&&u.length>0)throw new L(`assurance measurement ${n} is referenced by ${u.join(", ")}`)}if(t==="assertion"&&c.gates.some(u=>u.assertion_ids.includes(n)))throw new L(`assurance assertion ${n} is referenced by gate`);let l=mi(c,t),d=l.findIndex(u=>u.id===n);if(d<0)throw new L(`assurance ${t} ${n} not found`);return l.splice(d,1),_n(c),{raw:`${JSON.stringify(c,null,2)}
4
4
  `,result:{changed:!0,action:"removed",kind:t,id:n}}}});return{...s.result,changed:s.changed}}async function Vd(e,t,n={}){if(t.dry_run)throw new TypeError("dry-run assurance verdicts are not persisted");let r=await T(e);await Zr({pmRoot:e,op:"assurance:gate:verdict",author:B(n.author,r.author_default),context:{assurance_verdict:t},message:n.message??`Assurance gate ${t.gate_id} returned ${t.verdict}`,lockTtlSeconds:ci,lockWaitMs:li})}async function Kd(e,t={}){let n=t.limit??lg;if(!Number.isInteger(n)||n<1||n>hn)throw new TypeError(`assurance verdict limit must be an integer from 1 through ${hn}`);return(await Mt(Xr(e),me)).reverse().filter(i=>i.op==="assurance:gate:verdict").map(i=>i.context?.assurance_verdict).filter(i=>typeof i=="object"&&i!==null&&"gate_id"in i).filter(i=>t.gate_id===void 0||i.gate_id===t.gate_id).slice(0,n)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0daf7c89-abc5-5c35-ba3f-9772a50408c0")}catch{}})();var Kn={type:"string",minLength:1,maxLength:128,pattern:"\\S"},pi={type:"array",minItems:1,maxItems:Lo,items:Kn},Yd={...pi,items:{...Kn,pattern:"^(?!(?:.*\\.)?(?:__proto__|constructor|prototype)(?:\\.|$))[a-zA-Z_][a-zA-Z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z0-9_]*){0,7}$"}},Pg={type:"object",additionalProperties:!1,required:["id","rule"],properties:{id:{type:"string",minLength:1,maxLength:128,pattern:"^[a-zA-Z0-9][a-zA-Z0-9._-]*$"},description:{type:"string",minLength:1,maxLength:500,pattern:"\\S"},effect:{enum:["advise","warn","refuse"]},subject:{type:"object",additionalProperties:!1,properties:{...Object.fromEntries(["types","tags","statuses","operations","parents"].map(e=>[e,pi])),dependency:{type:"object",additionalProperties:!1,required:["kind"],properties:{kind:Kn,id:Kn}}}},rule:{oneOf:[{type:"object",additionalProperties:!1,required:["kind","fields"],properties:{kind:{const:"require_fields"},fields:Yd}},{type:"object",additionalProperties:!1,required:["kind","authors"],properties:{kind:{const:"authors"},authors:pi}},...["field_writers","approval"].map(e=>({type:"object",additionalProperties:!1,required:["kind","fields","authors"],properties:{kind:{const:e},fields:Yd,authors:pi}})),{type:"object",additionalProperties:!1,required:["kind","allowed"],properties:{kind:{const:"transition"},allowed:{type:"array",maxItems:Lo,items:{type:"array",minItems:2,maxItems:2,items:Kn}}}}]}}},xC={$schema:"https://json-schema.org/draft/2020-12/schema",title:"pm workflow policy registry",type:"object",additionalProperties:!1,required:["version","policies"],properties:{version:{const:1},enforcement:{enum:["advise","refuse"],default:"advise"},policies:{type:"array",maxItems:ol,items:Pg}}};(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]="42dee0a5-d003-5e44-8b2d-d74a23d3f2ce")}catch{}})();async function Xd(e,t,n,r){let i=await St(e).catch(()=>null);return i===null?{check:{name:"completeness",status:"error",ok:!1,details:{policy_registry_readable:!1,policy_registry_path:"schema/policies.json",remediation_hint:"Repair schema/policies.json, then rerun pm validate."}},warnings:["validate_completeness_policy_registry_unreadable"]}:Zd(i,t,n,r)}function Ng(e,t,n){return e===0?"undeclared":t===0?"empty":n===0?"inapplicable":n===t?"covered":"partial"}function Zd(e,t,n=5,r=!1){let i=[],o=new Map,s=e.policies.filter(h=>h.rule.kind==="require_fields"),a=s.filter(h=>h.subject?.operations===void 0),c=new Set,l=0,d=0,u=0,m=0,f=0,p=cl(e);for(let h of t){let w=p({operation:"",author:"",before:h,after:h,completeness_only:!0});l+=+(w.decisions.length>0),d+=w.decisions.length,w.decisions.forEach(S=>c.add(S.policy_id));let v=w.decisions.filter(S=>!S.satisfied);if(v.length===0)continue;m+=1;let k=o.get(h.type)??{items:0,violations:0,missing_fields:0};k.items+=1;for(let S of v)u+=1,k.violations+=1,k.missing_fields+=S.missing_fields.length,S.effect==="refuse"&&(f+=1),i.length<n&&i.push({id:h.id,type:h.type,status:h.status,decision:S});o.set(h.type,k)}let _=r||f>0?"error":u>0?"warn":"ok";return{check:{name:"completeness",status:_,ok:_==="ok",details:{scope:"operation_independent_require_fields",declared_requirement_count:s.length,state_requirement_count:a.length,applicable_requirement_count:c.size,requirement_application_count:d,governed_items:l,ungoverned_items:t.length-l,contract_status:Ng(s.length,t.length,l),applied_policy_ids:[...c].sort().slice(0,Math.max(0,n)),applied_policy_ids_truncated:c.size>Math.max(0,n),checked_items:t.length,incomplete_items:m,violation_count:u,refused_violations:f,missing_by_type:Object.fromEntries(o),violations:i,violations_truncated:i.length<u,enforcement:e.enforcement}},warnings:[...u>0?[`validate_completeness_missing_fields:${u}`]:[],...r?["validate_completeness_source_incomplete"]:[]]}}import Lg 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]="f54fe358-8f4c-5bf4-ae2a-9c92cd08c953")}catch{}})();function Mg(){return{version:1,enforcement:"advise",policies:[...[["Epic",["goal","objective","body"]],["Story",["description","value","acceptance_criteria"]],["Decision",["body","resolution"]],["Feature",["acceptance_criteria","expected_result"]],["Task",["description"]],["Issue",["repro_steps","expected_result"]],["Chore",["description"]]].map(([t,n])=>({id:`completeness-${t.toLowerCase()}`,effect:"advise",description:`Evidence expected when ${t} work reaches completion.`,subject:{types:[t],statuses:["closed"]},rule:{kind:"require_fields",fields:[...n]}})),{id:"completeness-resolution",effect:"advise",subject:{statuses:["closed"]},rule:{kind:"require_fields",fields:["resolution","expected_result","actual_result"]}}]}}function tu(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch{throw new y("Policy definition must be valid JSON.",g.USAGE)}if(typeof t!="object"||t===null||Array.isArray(t))throw new y("Policy definition must be an object.",g.USAGE);return t}async function Fg(e,t){let n=N(process.cwd(),e.path);await te(n);let r=await T(n);return{pmRoot:n,settings:r,author:B(t,r.author_default)}}function Qd(e,t,n,r){if(e==="policy-mode")return Fo({...n,enforcement:t});let i=n.policies.filter(a=>a.id!==t);if(e==="policy-remove")return{...n,policies:i};let o=Mo(r.definition),s=Fo({...n,policies:[...i,o].sort((a,c)=>a.id.localeCompare(c.id))});if(Buffer.byteLength(`${JSON.stringify(s,null,2)}
@@ -56,4 +56,4 @@ ${o}`,g.GENERIC_FAILURE)}}function Eo(e){return typeof e.tag=="string"&&e.tag.tr
56
56
  `);le(e.progressEnabled,"writing keyword artifacts"),await ae(t,`${JSON.stringify(e.manifest,null,2)}
57
57
  `),await ae(n,`${i}
58
58
  `);let o=[];if(e.mode!=="keyword")try{le(e.progressEnabled,"writing vectorization status ledger"),await vd(e.pmRoot,e.vectorizationLedgerEntries,e.vectorizationEmbeddingMetadata)}catch(s){o.push(`search_vectorization_status_ledger_write_failed:${s instanceof Error?s.message:String(s)}`)}return o}async function vW(e,t){let n=q0(e.mode),r=W0(e),i=e.full===!0;le(r,`start mode=${n}`);let o=N(process.cwd(),t.path);await te(o);let s=ii(await T(o)).settings,a=null;try{a=await ce(o,Ql,s.locks.ttl_seconds,B(void 0,"pm-reindex"),!1,s.governance.force_required_for_stale_lock,s.locks.wait_ms)}catch(c){throw c instanceof y&&c.exitCode===g.CONFLICT?new y("Another pm reindex run is already active for this project. Wait for it to finish before starting a new keyword, semantic, or hybrid reindex.",g.CONFLICT,{code:"reindex_already_running",type:"urn:pm-cli:error:reindex_already_running",why:"Semantic reindex can be expensive and duplicate runs compete for the same local embedding model and vector store.",nextSteps:["Check active pm reindex processes before starting another reindex.","Rerun with --progress when you need non-interactive visibility."]}):c}try{let c=J0(s),l=V0(s),d=eC({requestedMode:n,pmRoot:o,settings:s,extensionEmbedding:c,extensionVectorAdapter:l}),u=n;le(r,"loading item corpus");let m=await tC({pmRoot:o,settings:s}),f=m.warnings,{documentCandidates:p,metadataDocuments:_}=m;le(r,`loaded_items=${_.length}`);let h=C(),w=Q0(u,h,_),v=Ir.join(o,_c),k=Ir.join(o,gc),S=u==="keyword"?await wc(o,p,s.schema,f):_,x=[],I={},E=null,b=Z0(u);if(u==="keyword"&&await nC({pmRoot:o,settings:s,forceFullSemantic:i,extensionEmbedding:c,reindexWarnings:f}),u!=="keyword"){let U=await lC({pmRoot:o,settings:s,requestedMode:n,activeEmbeddingProvider:d.activeEmbeddingProvider,activeVectorStore:d.activeVectorStore,extensionEmbedding:c,extensionVectorAdapter:l,documentCandidates:p,metadataDocuments:_,documentsForKeywordArtifacts:S,forceFullSemantic:i,reindexWarnings:f,semanticWarnings:x,semanticSummary:b,progressEnabled:r});S=U.documentsForKeywordArtifacts,I=U.vectorizationLedgerEntries,E=U.vectorizationEmbeddingMetadata}let D=await dC({pmRoot:o,mode:u,manifest:w,documentsForKeywordArtifacts:S,settings:s,vectorizationLedgerEntries:I,vectorizationEmbeddingMetadata:E,progressEnabled:r}),z=[...await ee({path:v,scope:"project",op:"reindex:manifest"}),...await ee({path:k,scope:"project",op:"reindex:embeddings"}),...await Ur({mode:u,total_items:_.length})];return le(r,"done"),{ok:!0,mode:u,total_items:_.length,semantic:b,artifacts:{manifest:_c,embeddings:gc},warnings:[...f,...x,...D,...z],generated_at:h}}finally{await a?.()}}export{L as a,xe as b,Ke as c,pn as d,Dd as e,Nd as f,zt as g,Qo as h,mg as i,ns as j,rs as k,jd as l,_n as m,Jn as n,os as o,$g as p,Bd as q,Vn as r,ss as s,fi as t,as as u,Jd as v,Vd as w,Kd as x,ym as y,nO as z,Yy as A,Xy as B,ct as C,EO as D,sw as E,Pg as F,xC as G,Zd as H,Mg as I,BC as J,Jw as K,AD as L,$D as M,OD as N,ir as O,DD as P,PD as Q,ND as R,LD as S,MD as T,FD as U,jD as V,UD as W,zD as X,HD as Y,WD as Z,Lf as _,na as $,ST as aa,$ as ba,oe as ca,ET as da,ds as ea,xT as fa,RT as ga,lu as ha,IT as ia,AT as ja,CT as ka,ey as la,TT as ma,$T as na,us as oa,OT as pa,DT as qa,ls as ra,PT as sa,NT as ta,uu as ua,LT as va,ny as wa,pu as xa,GT as ya,Zn as za,JT as Aa,ly as Ba,dy as Ca,VT as Da,uy as Ea,Dh as Fa,QT as Ga,bu as Ha,Nh as Ia,J1 as Ja,V1 as Ka,Qn as La,vi as Ma,Su as Na,Eu as Oa,xu as Pa,Ru as Qa,Tu as Ra,Ou as Sa,Du as Ta,Lu as Ua,Ct as Va,aM as Wa,cM as Xa,lM as Ya,dM as Za,bM as _a,bp as $a,ya as ab,zM as bb,ht as cb,HM as db,WM as eb,NE as fb,jE as gb,Np as hb,$y as ib,Fu as jb,ka as kb,LF as lb,MF as mb,ki as nb,Si as ob,sh as pb,Dj as qb,ah as rb,lh as sb,dh as tb,fh as ub,hh as vb,lI as wb,dI as xb,Z1 as yb,Q1 as zb,eU as Ab,tU as Bb,mI as Cb,fI as Db,pI as Eb,nU as Fb,Fh as Gb,_I as Hb,jh as Ib,Ha as Jb,zh as Kb,gI as Lb,yI as Mb,wI as Nb,Ga as Ob,Ja as Pb,mU as Qb,fU as Rb,pU as Sb,KI as Tb,gz as Ub,A_ as Vb,Er as Wb,$_ as Xb,O_ as Yb,D_ as Zb,cc as _b,r0 as $b,Zz as ac,bH as bc,CH as cc,B_ as dc,G_ as ec,J_ as fc,QH as gc,mW as hc,fW as ic,pW as jc,vW as kc};
59
- //# sourceMappingURL=chunk-QYN77MQP.js.map
59
+ //# sourceMappingURL=chunk-3JAEZ7WI.js.map
@@ -1,2 +1,2 @@
1
- import{Q as C}from"./chunk-UT7VS4X2.js";import{ab as c}from"./chunk-XR5EBU3B.js";import{Ed as A,Fd as m,Hd as O,lc as u}from"./chunk-URH727T5.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]="76a156ee-aebd-547e-b4c2-1ed1b172fd6b")}catch{}})();var _=[{target:"title",keys:["title"],option:"--title, -t <value>",description:"Item title [required] (or pass title as the first positional argument)"},{target:"id",keys:["id"],option:"--id <value>",description:"Explicit item id (normalized with the configured id_prefix)"},{target:"description",keys:["description"],option:"--description, -d <value>",description:"Item description (allow empty string)"},{target:"type",keys:["type"],option:"--type <value>",description:"Item type (built-ins plus any configured custom types)"},{target:"template",keys:["template"],option:"--template <value>",description:"Apply named create template defaults before explicit flags"},{target:"createMode",keys:["createMode","create_mode"],option:"--create-mode <value>",description:"Create required-option policy mode: strict|progressive",aliasOptions:[{option:"--create_mode <value>",description:"Alias for --create-mode"}]},{target:"schedulePreset",keys:["schedulePreset","schedule_preset"],option:"--schedule-preset <value>",description:"Scheduling preset for Reminder|Meeting|Event: lightweight",aliasOptions:[{option:"--schedule_preset <value>",description:"Alias for --schedule-preset"}]},{target:"status",keys:["status"],option:"--status, -s <value>",description:"Item status"},{target:"closeReason",keys:["closeReason","close_reason"],option:"--close-reason <value>",description:"Close reason when creating directly in a terminal status",aliasOptions:[{option:"--close_reason <value>",description:"Alias for --close-reason"}]},{target:"completedAt",keys:["completedAt","completed_at"],option:"--completed-at <value>",description:"Actual completion time for a terminal imported item",aliasOptions:[{option:"--completed_at <value>",description:"Alias for --completed-at"}]},{target:"priority",keys:["priority"],option:"--priority, -p <value>",description:"Priority 0..4"},{target:"tags",keys:["tags"],option:"--tags <value>",description:"Comma-separated tags"},{target:"addTags",keys:["addTags","add_tags"],option:"--add-tags <value>",description:"Add tags additively on top of --tags (repeatable; CSV accepted)",repeatable:!0,aliasOptions:[{option:"--add_tags <value>",description:"Alias for --add-tags"}]},{target:"body",keys:["body"],option:"--body, -b <value>",description:"Item markdown body (allow empty string)"},{target:"deadline",keys:["deadline"],option:"--deadline <value>",description:"Deadline (ISO/date string or relative +6h/+1d/+2w/+6m)"},{target:"estimatedMinutes",keys:["estimate","estimatedMinutes","estimated_minutes"],option:"--estimate, --estimated-minutes <value>",description:"Estimated minutes",aliasOptions:[{option:"--estimated_minutes <value>",description:"Alias for --estimated-minutes"}]},{target:"acceptanceCriteria",keys:["acceptanceCriteria","acceptance_criteria","ac"],option:"--acceptance-criteria <value>",description:"Acceptance criteria (repeatable; values join with '; '; allow empty string)",repeatable:!0,aliasOptions:[{option:"--acceptance_criteria <value>",description:"Alias for --acceptance-criteria"},{option:"--ac <value>",description:"Alias for --acceptance-criteria"}]},{target:"definitionOfReady",keys:["definitionOfReady","definition_of_ready"],option:"--definition-of-ready <value>",description:"Definition of ready (allow empty string)",aliasOptions:[{option:"--definition_of_ready <value>",description:"Alias for --definition-of-ready"}]},{target:"order",keys:["order"],option:"--order <value>",description:"Planning order/rank integer"},{target:"rank",keys:["rank"],option:"--rank <value>",description:"Alias for --order"},{target:"goal",keys:["goal"],option:"--goal <value>",description:"Goal identifier"},{target:"objective",keys:["objective"],option:"--objective <value>",description:"Objective identifier"},{target:"value",keys:["value"],option:"--value <value>",description:"Business value summary"},{target:"impact",keys:["impact"],option:"--impact <value>",description:"Business impact summary"},{target:"outcome",keys:["outcome"],option:"--outcome <value>",description:"Expected outcome summary"},{target:"whyNow",keys:["whyNow","why_now"],option:"--why-now <value>",description:"Why-now rationale",aliasOptions:[{option:"--why_now <value>",description:"Alias for --why-now"}]},{target:"author",keys:["author"],option:"--author <value>",description:"Mutation author"},{target:"message",keys:["message"],option:"--message <value>",description:"History message (allow empty string)"},{target:"assignee",keys:["assignee"],option:"--assignee <value>",description:"Item assignee"},{target:"parent",keys:["parent"],option:"--parent <value>",description:"Parent item ID"},{target:"allowMissingParent",keys:["allowMissingParent","allow_missing_parent"],option:"--allow-missing-parent",description:"Allow creating with an unresolved parent reference and emit a validation warning"},{target:"allowUnresolvedDeps",keys:["allowUnresolvedDeps","allow_unresolved_deps"],option:"--allow-unresolved-deps",description:"Allow unresolved local dependency targets and emit explicit warning receipts"},{target:"reviewer",keys:["reviewer"],option:"--reviewer <value>",description:"Reviewer"},{target:"risk",keys:["risk"],option:"--risk <value>",description:"Risk level: low|med|medium|high|critical (med persists as medium)"},{target:"confidence",keys:["confidence"],option:"--confidence <value>",description:"Confidence level: 0..100|low|med|medium|high (med persists as medium)"},{target:"sprint",keys:["sprint"],option:"--sprint <value>",description:"Sprint identifier"},{target:"release",keys:["release"],option:"--release <value>",description:"Release identifier"},{target:"blockedBy",keys:["blockedBy","blocked_by"],option:"--blocked-by <value>",description:"Set latest blocked-by item ID or reason; resolved item IDs append a blocked_by dependency edge",aliasOptions:[{option:"--blocked_by <value>",description:"Alias for --blocked-by"}]},{target:"blockedReason",keys:["blockedReason","blocked_reason"],option:"--blocked-reason <value>",description:"Blocked reason",aliasOptions:[{option:"--blocked_reason <value>",description:"Alias for --blocked-reason"}]},{target:"unblockNote",keys:["unblockNote","unblock_note"],option:"--unblock-note <value>",description:"Unblock rationale note",aliasOptions:[{option:"--unblock_note <value>",description:"Alias for --unblock-note"}]},{target:"reporter",keys:["reporter"],option:"--reporter <value>",description:"Issue reporter"},{target:"severity",keys:["severity"],option:"--severity <value>",description:"Issue severity: low|med|medium|high|critical (med persists as medium)"},{target:"environment",keys:["environment"],option:"--environment <value>",description:"Issue environment context"},{target:"reproSteps",keys:["reproSteps","repro_steps"],option:"--repro-steps <value>",description:"Issue reproduction steps",aliasOptions:[{option:"--repro_steps <value>",description:"Alias for --repro-steps"}]},{target:"resolution",keys:["resolution"],option:"--resolution <value>",description:"Issue resolution summary"},{target:"expectedResult",keys:["expectedResult","expected_result","expected"],option:"--expected-result <value>",description:"Issue expected behavior",aliasOptions:[{option:"--expected_result <value>",description:"Alias for --expected-result"},{option:"--expected <value>",description:"Short alias for --expected-result"}]},{target:"actualResult",keys:["actualResult","actual_result","actual"],option:"--actual-result <value>",description:"Issue observed behavior",aliasOptions:[{option:"--actual_result <value>",description:"Alias for --actual-result"},{option:"--actual <value>",description:"Short alias for --actual-result"}]},{target:"affectedVersion",keys:["affectedVersion","affected_version"],option:"--affected-version <value>",description:"Affected version identifier",aliasOptions:[{option:"--affected_version <value>",description:"Alias for --affected-version"}]},{target:"fixedVersion",keys:["fixedVersion","fixed_version"],option:"--fixed-version <value>",description:"Fixed version identifier",aliasOptions:[{option:"--fixed_version <value>",description:"Alias for --fixed-version"}]},{target:"component",keys:["component"],option:"--component <value>",description:"Issue component ownership"},{target:"regression",keys:["regression"],option:"--regression [value]",description:"Regression marker; bare flag means true, or pass true|false|1|0"},{target:"customerImpact",keys:["customerImpact","customer_impact"],option:"--customer-impact <value>",description:"Customer impact summary",aliasOptions:[{option:"--customer_impact <value>",description:"Alias for --customer-impact"}]},{target:"dep",keys:["dep"],option:"--dep <value>",description:"Seed dependency entry (key=value CSV, markdown key:value lines, or - for stdin; repeatable)",repeatable:!0},{target:"typeOption",keys:["typeOption","type_option"],option:"--type-option <value>",description:"Type option key=value or key=<name>,value=<value> (also accepts key:value and markdown pairs; use - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--type_option <value>",description:"Alias for --type-option"}]},{target:"field",keys:["field"],option:"--field <name=value>",description:"Set a field declared by an active extension registerItemFields registration (repeatable)",repeatable:!0},{target:"unset",keys:["unset"],option:"--unset <field>",description:"Clear scalar metadata field by name (repeatable)",repeatable:!0},{target:"reminder",keys:["reminder"],option:"--reminder <value>",description:"Seed reminder entry at=<iso|relative>,text=<text> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"event",keys:["event"],option:"--event <value>",description:"Seed event entry start=<iso|relative>,end=<iso|relative>,duration=<relative|30min|PT30M>,title=<text>,all_day=<true|false>,recur_* fields (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"comment",keys:["comment"],option:"--comment <value>",description:"Seed comment entry (text=<value> CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0},{target:"note",keys:["note"],option:"--note <value>",description:"Seed note entry (text=<value> CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0},{target:"learning",keys:["learning"],option:"--learning <value>",description:"Seed learning entry (text=<value> CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0},{target:"file",keys:["file","linkedFile"],option:"--file <value>",description:"Seed linked file entry (CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--linked-file <value>",description:"Alias for --file (cross-surface name)"}]},{target:"test",keys:["test","linkedTest"],option:"--test <value>",description:"Seed linked test entry (CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--linked-test <value>",description:"Alias for --test (cross-surface name)"}]},{target:"doc",keys:["doc"],option:"--doc <value>",description:"Seed linked doc entry (CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0}],v=_.filter(e=>e.repeatable!==!0).map(e=>({target:e.target,keys:e.keys})),y=_.filter(e=>e.repeatable===!0).map(e=>({target:e.target,keys:e.keys})),T=[{target:"title",keys:["title"],option:"--title, -t <value>",description:"Set title"},{target:"description",keys:["description"],option:"--description, -d <value>",description:"Set description"},{target:"body",keys:["body"],option:"--body, -b <value>",description:"Set body (allow empty string)"},{target:"status",keys:["status"],option:"--status, -s <value>",description:"Set status (use close command for closed)"},{target:"closeReason",keys:["closeReason","close_reason"],option:"--close-reason <value>",description:"Set close reason",aliasOptions:[{option:"--close_reason <value>",description:"Alias for --close-reason"}]},{target:"priority",keys:["priority"],option:"--priority, -p <value>",description:"Set priority"},{target:"type",keys:["type"],option:"--type <value>",description:"Set type"},{target:"tags",keys:["tags"],option:"--tags <value>",description:"Set comma-separated tags (replaces existing). Use --add-tags / --remove-tags to mutate additively."},{target:"addTags",keys:["addTags","add_tags"],option:"--add-tags <value>",description:"Add tags to the existing list without replacing it (repeatable; CSV accepted)",repeatable:!0,aliasOptions:[{option:"--add_tags <value>",description:"Alias for --add-tags"}]},{target:"removeTags",keys:["removeTags","remove_tags"],option:"--remove-tags <value>",description:"Remove tags from the existing list (repeatable; CSV accepted)",repeatable:!0,aliasOptions:[{option:"--remove_tags <value>",description:"Alias for --remove-tags"}]},{target:"deadline",keys:["deadline"],option:"--deadline <value>",description:"Set deadline (ISO/date string or relative)"},{target:"estimatedMinutes",keys:["estimate","estimatedMinutes","estimated_minutes"],option:"--estimate, --estimated-minutes <value>",description:"Set estimated minutes",aliasOptions:[{option:"--estimated_minutes <value>",description:"Alias for --estimated-minutes"}]},{target:"acceptanceCriteria",keys:["acceptanceCriteria","acceptance_criteria","ac"],option:"--acceptance-criteria <value>",description:"Replace the complete acceptance-criteria list (repeatable values join with '; '); use --remove-ac plus --add-ac for one-entry repair",repeatable:!0,aliasOptions:[{option:"--acceptance_criteria <value>",description:"Alias for --acceptance-criteria"},{option:"--ac <value>",description:"Alias for --acceptance-criteria"}]},{target:"addAc",keys:["addAc","add_ac"],option:"--add-ac <value>",description:"Add one semicolon-free acceptance criterion without replacing the existing list (repeatable)",repeatable:!0,aliasOptions:[{option:"--add_ac <value>",description:"Alias for --add-ac"}]},{target:"removeAc",keys:["removeAc","remove_ac"],option:"--remove-ac <value>",description:"Remove one semicolon-free acceptance criterion by exact text match; fails if any selector is unmatched (repeatable)",repeatable:!0,aliasOptions:[{option:"--remove_ac <value>",description:"Alias for --remove-ac"}]},{target:"definitionOfReady",keys:["definitionOfReady","definition_of_ready"],option:"--definition-of-ready <value>",description:"Set definition of ready",aliasOptions:[{option:"--definition_of_ready <value>",description:"Alias for --definition-of-ready"}]},{target:"order",keys:["order"],option:"--order <value>",description:"Set planning order/rank integer"},{target:"rank",keys:["rank"],option:"--rank <value>",description:"Alias for --order"},{target:"goal",keys:["goal"],option:"--goal <value>",description:"Set goal identifier"},{target:"objective",keys:["objective"],option:"--objective <value>",description:"Set objective identifier"},{target:"value",keys:["value"],option:"--value <value>",description:"Set business value summary"},{target:"impact",keys:["impact"],option:"--impact <value>",description:"Set business impact summary"},{target:"outcome",keys:["outcome"],option:"--outcome <value>",description:"Set expected outcome summary"},{target:"whyNow",keys:["whyNow","why_now"],option:"--why-now <value>",description:"Set why-now rationale",aliasOptions:[{option:"--why_now <value>",description:"Alias for --why-now"}]},{target:"author",keys:["author"],option:"--author <value>",description:"Mutation author"},{target:"message",keys:["message"],option:"--message <value>",description:"Mutation message"},{target:"assignee",keys:["assignee"],option:"--assignee <value>",description:"Set assignee"},{target:"parent",keys:["parent"],option:"--parent <value>",description:"Set parent item ID"},{target:"allowMissingParent",keys:["allowMissingParent","allow_missing_parent"],option:"--allow-missing-parent",description:"Allow updating to an unresolved parent reference and emit a validation warning"},{target:"allowUnresolvedDeps",keys:["allowUnresolvedDeps","allow_unresolved_deps"],option:"--allow-unresolved-deps",description:"Allow unresolved local dependency targets and emit explicit warning receipts"},{target:"completedAt",keys:["completedAt","completed_at"],option:"--completed-at <value>",description:"Correct the actual completion timestamp on a terminal item"},{target:"reviewer",keys:["reviewer"],option:"--reviewer <value>",description:"Set reviewer"},{target:"risk",keys:["risk"],option:"--risk <value>",description:"Set risk level: low|med|medium|high|critical (med persists as medium)"},{target:"confidence",keys:["confidence"],option:"--confidence <value>",description:"Set confidence level: 0..100|low|med|medium|high (med persists as medium)"},{target:"sprint",keys:["sprint"],option:"--sprint <value>",description:"Set sprint identifier"},{target:"release",keys:["release"],option:"--release <value>",description:"Set release identifier"},{target:"blockedBy",keys:["blockedBy","blocked_by"],option:"--blocked-by <value>",description:"Set latest blocked-by item ID or reason; resolved item IDs append a blocked_by dependency edge",aliasOptions:[{option:"--blocked_by <value>",description:"Alias for --blocked-by"}]},{target:"blockedReason",keys:["blockedReason","blocked_reason"],option:"--blocked-reason <value>",description:"Set blocked reason",aliasOptions:[{option:"--blocked_reason <value>",description:"Alias for --blocked-reason"}]},{target:"unblockNote",keys:["unblockNote","unblock_note"],option:"--unblock-note <value>",description:"Set unblock rationale note",aliasOptions:[{option:"--unblock_note <value>",description:"Alias for --unblock-note"}]},{target:"reporter",keys:["reporter"],option:"--reporter <value>",description:"Set issue reporter"},{target:"severity",keys:["severity"],option:"--severity <value>",description:"Set issue severity: low|med|medium|high|critical (med persists as medium)"},{target:"environment",keys:["environment"],option:"--environment <value>",description:"Set issue environment context"},{target:"reproSteps",keys:["reproSteps","repro_steps"],option:"--repro-steps <value>",description:"Set issue reproduction steps",aliasOptions:[{option:"--repro_steps <value>",description:"Alias for --repro-steps"}]},{target:"resolution",keys:["resolution"],option:"--resolution <value>",description:"Set issue resolution summary"},{target:"expectedResult",keys:["expectedResult","expected_result","expected"],option:"--expected-result <value>",description:"Set issue expected behavior",aliasOptions:[{option:"--expected_result <value>",description:"Alias for --expected-result"},{option:"--expected <value>",description:"Short alias for --expected-result"}]},{target:"actualResult",keys:["actualResult","actual_result","actual"],option:"--actual-result <value>",description:"Set issue observed behavior",aliasOptions:[{option:"--actual_result <value>",description:"Alias for --actual-result"},{option:"--actual <value>",description:"Short alias for --actual-result"}]},{target:"affectedVersion",keys:["affectedVersion","affected_version"],option:"--affected-version <value>",description:"Set affected version identifier",aliasOptions:[{option:"--affected_version <value>",description:"Alias for --affected-version"}]},{target:"fixedVersion",keys:["fixedVersion","fixed_version"],option:"--fixed-version <value>",description:"Set fixed version identifier",aliasOptions:[{option:"--fixed_version <value>",description:"Alias for --fixed-version"}]},{target:"component",keys:["component"],option:"--component <value>",description:"Set issue component ownership"},{target:"regression",keys:["regression"],option:"--regression [value]",description:"Set regression marker; bare flag means true, or pass true|false|1|0"},{target:"customerImpact",keys:["customerImpact","customer_impact"],option:"--customer-impact <value>",description:"Set customer impact summary",aliasOptions:[{option:"--customer_impact <value>",description:"Alias for --customer-impact"}]},{target:"dep",keys:["dep"],option:"--dep <value>",description:"Add dependency entries id=<id>,kind=<value>,author=<value>,created_at=<iso|now>,source_kind=<value> (repeatable)",repeatable:!0},{target:"depRemove",keys:["depRemove","dep_remove"],option:"--dep-remove <value>",description:"Remove by dependency id or exact row signature (repeatable)",repeatable:!0,aliasOptions:[{option:"--dep_remove <value>",description:"Alias for --dep-remove"}]},{target:"comment",keys:["comment"],option:"--comment <value>",description:"Append comment seed author=<value>,created_at=<iso|now>,text=<value> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"note",keys:["note"],option:"--note <value>",description:"Append note seed author=<value>,created_at=<iso|now>,text=<value> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"learning",keys:["learning"],option:"--learning <value>",description:"Append learning seed author=<value>,created_at=<iso|now>,text=<value> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"file",keys:["file","linkedFile"],option:"--file <value>",description:"Append linked file path=<value>,scope=<project|global>,note=<text> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--linked-file <value>",description:"Alias for --file (cross-surface name)"}]},{target:"test",keys:["test","linkedTest"],option:"--test <value>",description:"Append linked test command=<value>,path=<value>,scope=<project|global>,timeout_seconds=<n>,pm_context_mode=<schema|tracker|auto> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--linked-test <value>",description:"Alias for --test (cross-surface name)"}]},{target:"doc",keys:["doc"],option:"--doc <value>",description:"Append linked doc path=<value>,scope=<project|global>,note=<text> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"reminder",keys:["reminder"],option:"--reminder <value>",description:"Set reminders at=<iso|relative>,text=<text> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"event",keys:["event"],option:"--event <value>",description:"Set events start=<iso|relative>,end=<iso|relative>,duration=<relative|30min|PT30M>,title=<text>,all_day=<true|false>,recur_* fields (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"typeOption",keys:["typeOption","type_option"],option:"--type-option <value>",description:"Set type options key=value or key=<name>,value=<value> (also accepts key:value and markdown pairs; use - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--type_option <value>",description:"Alias for --type-option"}]},{target:"field",keys:["field"],option:"--field <name=value>",description:"Set a field declared by an active extension registerItemFields registration (repeatable)",repeatable:!0},{target:"unset",keys:["unset"],option:"--unset <field>",description:"Clear scalar metadata field by name (repeatable)",repeatable:!0}],N=T.filter(e=>e.repeatable!==!0).map(e=>({target:e.target,keys:e.keys})),R=T.filter(e=>e.repeatable===!0).map(e=>({target:e.target,keys:e.keys}));(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]="48efaa37-f28e-5f2a-a033-456bee15e294")}catch{}})();var E=new Set(["--author","--follow","--help","--lean","--token-accounting","--output-include","--output-limit","--output-budget","--output-format","--output-session","--output-cursor","--output-row-contract","--no-changed-fields","--no-extensions","--no-pager","--pm-path","--profile","--quiet","--interval-ms"]),k=new Set([...A,...m]),I=new Set(["--brief","--format","--full","--full-changed-fields","--id-only","--no-truncate","--stream"]),b=new Set(["--body-file","--file","--stdin-json"]),L=new Set(["--global","--local","--project"]),P=new Set(["--activity-limit","--default-depth","--section-activity","--section-blockers","--section-files","--section-hierarchy","--section-progress","--section-staleness","--section-tests","--section-workload","--stale-threshold-days"]),h=new Set(["action","fullChangedFields","idOnly","path","pmExecutable","timeoutMs"]),M=new Set(["configAction","id","name","query","reason","subcommand","target","text"]),w={assurance:{id:"<id>",kind:"<kind>",preset:"[kind]|[id]",subcommand:"<action>"},event:{title:"<title>"},files:{lookupPath:"lookup <path...>"},meet:{title:"<title>"},"item-reopen":{id:"<id>",reason:"<reason>"},merge:{subcommand:"<subcommand>"},remind:{title:"<title>"},workspace:{name:"<name>",subcommand:"snapshot",snapshotAction:"<snapshot-action>",target:"<target>"}},G={append:{"--text":"body"},assurance:{"--tree":"treeId","--owner":"owner","--apply":"apply","--enforcement":"enforcement"},init:{"--id-prefix":"idPrefix","--no-merge-fence":"mergeFence","--workspace":"workspace"},create:{"--ac":"acceptanceCriteria","--estimated-minutes":"estimate","--file":"linkedFile","--test":"linkedTest","--expected":"expectedResult","--actual":"actualResult"},update:{"--ac":"acceptanceCriteria","--estimated-minutes":"estimate","--file":"linkedFile","--test":"linkedTest","--expected":"expectedResult","--actual":"actualResult"},"update-many":{"--ac":"acceptanceCriteria","--estimated-minutes":"estimate","--file":"linkedFile","--test":"linkedTest","--expected":"expectedResult","--actual":"actualResult"},files:{"--note":"addNote"},docs:{"--note":"addNote"},comments:{"--full-history":"full"},notes:{"--file":"text","--full-history":"full"},learnings:{"--file":"text","--full-history":"full"},gc:{"--scope":"gcScope"},contracts:{"--action":"contractAction"},schema:{"--no-allow-unset":"allowUnset","--type":"fieldTypeScope"},"history-author-acknowledge":{"--event":"historyEvent","--all-actionable":"allActionable"},"extension-init":{"--capability":"capability"},"package-init":{"--capability":"capability"},"extension-install":{"--gh":"github"},"package-install":{"--gh":"github"},"extension-adopt":{"--gh":"github"},"package-adopt":{"--gh":"github"},extension:{"--gh":"github","--scaffold":"init"},package:{"--gh":"github","--scaffold":"init"},install:{"--gh":"github"}},D={"--pm-path":"path"},f={stats:{"--analytics":["measurements","metric","measurementLimit","observe","improvementDirection","measurementSource","measurementItem","measurementRevision","author","message","provenanceCoverage","fleetAttribution","since","eventLimit","minimumSample"]}};function F(e){return e.startsWith("extension-")?`extension ${e.slice(10)}`:e.startsWith("package-")?`package ${e.slice(8)}`:e.startsWith("item-")?`item ${e.slice(5)}`:e}function S(e,t){let i=G[e]?.[t]??D[t];return i!==void 0?i:t.replace(/^--/,"").replaceAll("_","-").replace(/-([a-z])/g,(r,o)=>o.toUpperCase())}function x(e){let t=new Set;return e.filter(({flag:i})=>!i.startsWith("--")||t.has(i)?!1:(t.add(i),!0))}function U(e,t){return t.find(({aliases:i})=>i?.includes(e))?.flag}function V(e,t,i,r){let o=f[e]?.[t.flag];if(o!==void 0&&o.every(a=>r.has(a)))return{surface:"cli",input:t.flag,counterpart:o[0],disposition:"shared",reason:"The validated CLI JSON object fans out across strict SDK parameters."};let n=S(e,t.flag);if(r.has(n))return{surface:"cli",input:t.flag,counterpart:n,disposition:"shared",reason:"The CLI flag maps directly to a strict SDK action parameter."};let s=U(t.flag,i);if(s!==void 0){let a=S(e,s);if(r.has(a))return{surface:"cli",input:t.flag,counterpart:a,disposition:"compatibility_alias",reason:`Compatibility spelling for ${s}.`}}return E.has(t.flag)?{surface:"cli",input:t.flag,disposition:"cli_transport",reason:"CLI process transport is supplied by the in-process SDK host."}:I.has(t.flag)?{surface:"cli",input:t.flag,disposition:"cli_presentation",reason:"CLI rendering or mutation projection does not alter the SDK result envelope."}:b.has(t.flag)?{surface:"cli",input:t.flag,disposition:"cli_adapter",reason:"Local file or stdin adaptation is a CLI boundary concern."}:P.has(t.flag)?{surface:"cli",input:t.flag,counterpart:"key",disposition:"compatibility_alias",reason:"CLI config shorthand normalizes to the SDK configAction/key/value contract."}:L.has(t.flag)?{surface:"cli",input:t.flag,counterpart:"scope",disposition:"cli_scope_selector",reason:"Mutually exclusive CLI scope switches normalize to the SDK scope parameter."}:{surface:"cli",input:t.flag,counterpart:n,disposition:"unclassified",reason:"The CLI flag has no strict SDK parameter or approved boundary classification."}}function B(e,t,i){let r=Object.entries(f[e]??{}).find(([s,a])=>a.includes(t)&&i.some(({input:p,disposition:d})=>p===s&&d==="shared"));if(r!==void 0)return{surface:"sdk",input:t,counterpart:r[0],disposition:"shared",reason:"The strict SDK parameter is reachable through the validated CLI JSON object."};let o=i.find(({counterpart:s,disposition:a})=>s===t&&(a==="shared"||a==="compatibility_alias"||a==="cli_scope_selector"));if(o!==void 0)return{surface:"sdk",input:t,counterpart:o.input,disposition:"shared",reason:"The strict SDK parameter is reachable from the CLI contract."};let n=w[e]?.[t];return n!==void 0?{surface:"sdk",input:t,counterpart:n,disposition:"shared",reason:"The strict SDK parameter maps to a canonical CLI positional argument."}:h.has(t)?{surface:"sdk",input:t,disposition:"sdk_transport",reason:"The SDK host supplies in-process transport and workspace selection."}:M.has(t)?{surface:"sdk",input:t,disposition:"cli_positional",reason:"The CLI accepts this SDK parameter as a positional command argument."}:{surface:"sdk",input:t,disposition:"sdk_native",reason:"The typed SDK exposes this structured input without a canonical CLI long flag."}}function X(e={}){let t=e.actions??u,i=e.resolveFlags??c,r=e.resolveParameters??C;return t.map(o=>{let n=F(o),s=x(i(n)).filter(({flag:l})=>O(o)!==void 0||!k.has(l)),a=new Set(r(o)??[]),p=s.map(l=>V(o,l,s,a)),d=[...a].sort((l,g)=>l.localeCompare(g)).map(l=>B(o,l,p));return{action:o,command:n,cli:p,sdk:d,unclassified:[...p,...d].filter(({disposition:l})=>l==="unclassified")}})}(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]="92c17dbe-3868-5fa5-a873-0744d3e7ca8e")}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]="63c96190-0df9-5803-aa61-b973493a7277")}catch{}})();var yo={format:"pm-history-attestation",version:1,stream_hash:"exact_file_bytes",rollup_hash:"stable_json_without_workspace_digest",ordering:"stream_id_code_unit_ascending",consistency:"per_stream_snapshot_with_change_detection",trust:"independently_retained_bundle"};export{_ as a,v as b,y as c,T as d,N as e,R as f,X as g,yo as h};
2
- //# sourceMappingURL=chunk-LH24XUPJ.js.map
1
+ import{Q as C}from"./chunk-N2JYYEHM.js";import{ab as c}from"./chunk-S5JYIFFS.js";import{Ed as A,Fd as m,Hd as O,lc as u}from"./chunk-L554BKFH.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]="76a156ee-aebd-547e-b4c2-1ed1b172fd6b")}catch{}})();var _=[{target:"title",keys:["title"],option:"--title, -t <value>",description:"Item title [required] (or pass title as the first positional argument)"},{target:"id",keys:["id"],option:"--id <value>",description:"Explicit item id (normalized with the configured id_prefix)"},{target:"description",keys:["description"],option:"--description, -d <value>",description:"Item description (allow empty string)"},{target:"type",keys:["type"],option:"--type <value>",description:"Item type (built-ins plus any configured custom types)"},{target:"template",keys:["template"],option:"--template <value>",description:"Apply named create template defaults before explicit flags"},{target:"createMode",keys:["createMode","create_mode"],option:"--create-mode <value>",description:"Create required-option policy mode: strict|progressive",aliasOptions:[{option:"--create_mode <value>",description:"Alias for --create-mode"}]},{target:"schedulePreset",keys:["schedulePreset","schedule_preset"],option:"--schedule-preset <value>",description:"Scheduling preset for Reminder|Meeting|Event: lightweight",aliasOptions:[{option:"--schedule_preset <value>",description:"Alias for --schedule-preset"}]},{target:"status",keys:["status"],option:"--status, -s <value>",description:"Item status"},{target:"closeReason",keys:["closeReason","close_reason"],option:"--close-reason <value>",description:"Close reason when creating directly in a terminal status",aliasOptions:[{option:"--close_reason <value>",description:"Alias for --close-reason"}]},{target:"completedAt",keys:["completedAt","completed_at"],option:"--completed-at <value>",description:"Actual completion time for a terminal imported item",aliasOptions:[{option:"--completed_at <value>",description:"Alias for --completed-at"}]},{target:"priority",keys:["priority"],option:"--priority, -p <value>",description:"Priority 0..4"},{target:"tags",keys:["tags"],option:"--tags <value>",description:"Comma-separated tags"},{target:"addTags",keys:["addTags","add_tags"],option:"--add-tags <value>",description:"Add tags additively on top of --tags (repeatable; CSV accepted)",repeatable:!0,aliasOptions:[{option:"--add_tags <value>",description:"Alias for --add-tags"}]},{target:"body",keys:["body"],option:"--body, -b <value>",description:"Item markdown body (allow empty string)"},{target:"deadline",keys:["deadline"],option:"--deadline <value>",description:"Deadline (ISO/date string or relative +6h/+1d/+2w/+6m)"},{target:"estimatedMinutes",keys:["estimate","estimatedMinutes","estimated_minutes"],option:"--estimate, --estimated-minutes <value>",description:"Estimated minutes",aliasOptions:[{option:"--estimated_minutes <value>",description:"Alias for --estimated-minutes"}]},{target:"acceptanceCriteria",keys:["acceptanceCriteria","acceptance_criteria","ac"],option:"--acceptance-criteria <value>",description:"Acceptance criteria (repeatable; values join with '; '; allow empty string)",repeatable:!0,aliasOptions:[{option:"--acceptance_criteria <value>",description:"Alias for --acceptance-criteria"},{option:"--ac <value>",description:"Alias for --acceptance-criteria"}]},{target:"definitionOfReady",keys:["definitionOfReady","definition_of_ready"],option:"--definition-of-ready <value>",description:"Definition of ready (allow empty string)",aliasOptions:[{option:"--definition_of_ready <value>",description:"Alias for --definition-of-ready"}]},{target:"order",keys:["order"],option:"--order <value>",description:"Planning order/rank integer"},{target:"rank",keys:["rank"],option:"--rank <value>",description:"Alias for --order"},{target:"goal",keys:["goal"],option:"--goal <value>",description:"Goal identifier"},{target:"objective",keys:["objective"],option:"--objective <value>",description:"Objective identifier"},{target:"value",keys:["value"],option:"--value <value>",description:"Business value summary"},{target:"impact",keys:["impact"],option:"--impact <value>",description:"Business impact summary"},{target:"outcome",keys:["outcome"],option:"--outcome <value>",description:"Expected outcome summary"},{target:"whyNow",keys:["whyNow","why_now"],option:"--why-now <value>",description:"Why-now rationale",aliasOptions:[{option:"--why_now <value>",description:"Alias for --why-now"}]},{target:"author",keys:["author"],option:"--author <value>",description:"Mutation author"},{target:"message",keys:["message"],option:"--message <value>",description:"History message (allow empty string)"},{target:"assignee",keys:["assignee"],option:"--assignee <value>",description:"Item assignee"},{target:"parent",keys:["parent"],option:"--parent <value>",description:"Parent item ID"},{target:"allowMissingParent",keys:["allowMissingParent","allow_missing_parent"],option:"--allow-missing-parent",description:"Allow creating with an unresolved parent reference and emit a validation warning"},{target:"allowUnresolvedDeps",keys:["allowUnresolvedDeps","allow_unresolved_deps"],option:"--allow-unresolved-deps",description:"Allow unresolved local dependency targets and emit explicit warning receipts"},{target:"reviewer",keys:["reviewer"],option:"--reviewer <value>",description:"Reviewer"},{target:"risk",keys:["risk"],option:"--risk <value>",description:"Risk level: low|med|medium|high|critical (med persists as medium)"},{target:"confidence",keys:["confidence"],option:"--confidence <value>",description:"Confidence level: 0..100|low|med|medium|high (med persists as medium)"},{target:"sprint",keys:["sprint"],option:"--sprint <value>",description:"Sprint identifier"},{target:"release",keys:["release"],option:"--release <value>",description:"Release identifier"},{target:"blockedBy",keys:["blockedBy","blocked_by"],option:"--blocked-by <value>",description:"Set latest blocked-by item ID or reason; resolved item IDs append a blocked_by dependency edge",aliasOptions:[{option:"--blocked_by <value>",description:"Alias for --blocked-by"}]},{target:"blockedReason",keys:["blockedReason","blocked_reason"],option:"--blocked-reason <value>",description:"Blocked reason",aliasOptions:[{option:"--blocked_reason <value>",description:"Alias for --blocked-reason"}]},{target:"unblockNote",keys:["unblockNote","unblock_note"],option:"--unblock-note <value>",description:"Unblock rationale note",aliasOptions:[{option:"--unblock_note <value>",description:"Alias for --unblock-note"}]},{target:"reporter",keys:["reporter"],option:"--reporter <value>",description:"Issue reporter"},{target:"severity",keys:["severity"],option:"--severity <value>",description:"Issue severity: low|med|medium|high|critical (med persists as medium)"},{target:"environment",keys:["environment"],option:"--environment <value>",description:"Issue environment context"},{target:"reproSteps",keys:["reproSteps","repro_steps"],option:"--repro-steps <value>",description:"Issue reproduction steps",aliasOptions:[{option:"--repro_steps <value>",description:"Alias for --repro-steps"}]},{target:"resolution",keys:["resolution"],option:"--resolution <value>",description:"Issue resolution summary"},{target:"expectedResult",keys:["expectedResult","expected_result","expected"],option:"--expected-result <value>",description:"Issue expected behavior",aliasOptions:[{option:"--expected_result <value>",description:"Alias for --expected-result"},{option:"--expected <value>",description:"Short alias for --expected-result"}]},{target:"actualResult",keys:["actualResult","actual_result","actual"],option:"--actual-result <value>",description:"Issue observed behavior",aliasOptions:[{option:"--actual_result <value>",description:"Alias for --actual-result"},{option:"--actual <value>",description:"Short alias for --actual-result"}]},{target:"affectedVersion",keys:["affectedVersion","affected_version"],option:"--affected-version <value>",description:"Affected version identifier",aliasOptions:[{option:"--affected_version <value>",description:"Alias for --affected-version"}]},{target:"fixedVersion",keys:["fixedVersion","fixed_version"],option:"--fixed-version <value>",description:"Fixed version identifier",aliasOptions:[{option:"--fixed_version <value>",description:"Alias for --fixed-version"}]},{target:"component",keys:["component"],option:"--component <value>",description:"Issue component ownership"},{target:"regression",keys:["regression"],option:"--regression [value]",description:"Regression marker; bare flag means true, or pass true|false|1|0"},{target:"customerImpact",keys:["customerImpact","customer_impact"],option:"--customer-impact <value>",description:"Customer impact summary",aliasOptions:[{option:"--customer_impact <value>",description:"Alias for --customer-impact"}]},{target:"dep",keys:["dep"],option:"--dep <value>",description:"Seed dependency entry (key=value CSV, markdown key:value lines, or - for stdin; repeatable)",repeatable:!0},{target:"typeOption",keys:["typeOption","type_option"],option:"--type-option <value>",description:"Type option key=value or key=<name>,value=<value> (also accepts key:value and markdown pairs; use - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--type_option <value>",description:"Alias for --type-option"}]},{target:"field",keys:["field"],option:"--field <name=value>",description:"Set a field declared by an active extension registerItemFields registration (repeatable)",repeatable:!0},{target:"unset",keys:["unset"],option:"--unset <field>",description:"Clear scalar metadata field by name (repeatable)",repeatable:!0},{target:"reminder",keys:["reminder"],option:"--reminder <value>",description:"Seed reminder entry at=<iso|relative>,text=<text> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"event",keys:["event"],option:"--event <value>",description:"Seed event entry start=<iso|relative>,end=<iso|relative>,duration=<relative|30min|PT30M>,title=<text>,all_day=<true|false>,recur_* fields (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"comment",keys:["comment"],option:"--comment <value>",description:"Seed comment entry (text=<value> CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0},{target:"note",keys:["note"],option:"--note <value>",description:"Seed note entry (text=<value> CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0},{target:"learning",keys:["learning"],option:"--learning <value>",description:"Seed learning entry (text=<value> CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0},{target:"file",keys:["file","linkedFile"],option:"--file <value>",description:"Seed linked file entry (CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--linked-file <value>",description:"Alias for --file (cross-surface name)"}]},{target:"test",keys:["test","linkedTest"],option:"--test <value>",description:"Seed linked test entry (CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--linked-test <value>",description:"Alias for --test (cross-surface name)"}]},{target:"doc",keys:["doc"],option:"--doc <value>",description:"Seed linked doc entry (CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0}],v=_.filter(e=>e.repeatable!==!0).map(e=>({target:e.target,keys:e.keys})),y=_.filter(e=>e.repeatable===!0).map(e=>({target:e.target,keys:e.keys})),T=[{target:"title",keys:["title"],option:"--title, -t <value>",description:"Set title"},{target:"description",keys:["description"],option:"--description, -d <value>",description:"Set description"},{target:"body",keys:["body"],option:"--body, -b <value>",description:"Set body (allow empty string)"},{target:"status",keys:["status"],option:"--status, -s <value>",description:"Set status (use close command for closed)"},{target:"closeReason",keys:["closeReason","close_reason"],option:"--close-reason <value>",description:"Set close reason",aliasOptions:[{option:"--close_reason <value>",description:"Alias for --close-reason"}]},{target:"priority",keys:["priority"],option:"--priority, -p <value>",description:"Set priority"},{target:"type",keys:["type"],option:"--type <value>",description:"Set type"},{target:"tags",keys:["tags"],option:"--tags <value>",description:"Set comma-separated tags (replaces existing). Use --add-tags / --remove-tags to mutate additively."},{target:"addTags",keys:["addTags","add_tags"],option:"--add-tags <value>",description:"Add tags to the existing list without replacing it (repeatable; CSV accepted)",repeatable:!0,aliasOptions:[{option:"--add_tags <value>",description:"Alias for --add-tags"}]},{target:"removeTags",keys:["removeTags","remove_tags"],option:"--remove-tags <value>",description:"Remove tags from the existing list (repeatable; CSV accepted)",repeatable:!0,aliasOptions:[{option:"--remove_tags <value>",description:"Alias for --remove-tags"}]},{target:"deadline",keys:["deadline"],option:"--deadline <value>",description:"Set deadline (ISO/date string or relative)"},{target:"estimatedMinutes",keys:["estimate","estimatedMinutes","estimated_minutes"],option:"--estimate, --estimated-minutes <value>",description:"Set estimated minutes",aliasOptions:[{option:"--estimated_minutes <value>",description:"Alias for --estimated-minutes"}]},{target:"acceptanceCriteria",keys:["acceptanceCriteria","acceptance_criteria","ac"],option:"--acceptance-criteria <value>",description:"Replace the complete acceptance-criteria list (repeatable values join with '; '); use --remove-ac plus --add-ac for one-entry repair",repeatable:!0,aliasOptions:[{option:"--acceptance_criteria <value>",description:"Alias for --acceptance-criteria"},{option:"--ac <value>",description:"Alias for --acceptance-criteria"}]},{target:"addAc",keys:["addAc","add_ac"],option:"--add-ac <value>",description:"Add one semicolon-free acceptance criterion without replacing the existing list (repeatable)",repeatable:!0,aliasOptions:[{option:"--add_ac <value>",description:"Alias for --add-ac"}]},{target:"removeAc",keys:["removeAc","remove_ac"],option:"--remove-ac <value>",description:"Remove one semicolon-free acceptance criterion by exact text match; fails if any selector is unmatched (repeatable)",repeatable:!0,aliasOptions:[{option:"--remove_ac <value>",description:"Alias for --remove-ac"}]},{target:"definitionOfReady",keys:["definitionOfReady","definition_of_ready"],option:"--definition-of-ready <value>",description:"Set definition of ready",aliasOptions:[{option:"--definition_of_ready <value>",description:"Alias for --definition-of-ready"}]},{target:"order",keys:["order"],option:"--order <value>",description:"Set planning order/rank integer"},{target:"rank",keys:["rank"],option:"--rank <value>",description:"Alias for --order"},{target:"goal",keys:["goal"],option:"--goal <value>",description:"Set goal identifier"},{target:"objective",keys:["objective"],option:"--objective <value>",description:"Set objective identifier"},{target:"value",keys:["value"],option:"--value <value>",description:"Set business value summary"},{target:"impact",keys:["impact"],option:"--impact <value>",description:"Set business impact summary"},{target:"outcome",keys:["outcome"],option:"--outcome <value>",description:"Set expected outcome summary"},{target:"whyNow",keys:["whyNow","why_now"],option:"--why-now <value>",description:"Set why-now rationale",aliasOptions:[{option:"--why_now <value>",description:"Alias for --why-now"}]},{target:"author",keys:["author"],option:"--author <value>",description:"Mutation author"},{target:"message",keys:["message"],option:"--message <value>",description:"Mutation message"},{target:"assignee",keys:["assignee"],option:"--assignee <value>",description:"Set assignee"},{target:"parent",keys:["parent"],option:"--parent <value>",description:"Set parent item ID"},{target:"allowMissingParent",keys:["allowMissingParent","allow_missing_parent"],option:"--allow-missing-parent",description:"Allow updating to an unresolved parent reference and emit a validation warning"},{target:"allowUnresolvedDeps",keys:["allowUnresolvedDeps","allow_unresolved_deps"],option:"--allow-unresolved-deps",description:"Allow unresolved local dependency targets and emit explicit warning receipts"},{target:"completedAt",keys:["completedAt","completed_at"],option:"--completed-at <value>",description:"Correct the actual completion timestamp on a terminal item"},{target:"reviewer",keys:["reviewer"],option:"--reviewer <value>",description:"Set reviewer"},{target:"risk",keys:["risk"],option:"--risk <value>",description:"Set risk level: low|med|medium|high|critical (med persists as medium)"},{target:"confidence",keys:["confidence"],option:"--confidence <value>",description:"Set confidence level: 0..100|low|med|medium|high (med persists as medium)"},{target:"sprint",keys:["sprint"],option:"--sprint <value>",description:"Set sprint identifier"},{target:"release",keys:["release"],option:"--release <value>",description:"Set release identifier"},{target:"blockedBy",keys:["blockedBy","blocked_by"],option:"--blocked-by <value>",description:"Set latest blocked-by item ID or reason; resolved item IDs append a blocked_by dependency edge",aliasOptions:[{option:"--blocked_by <value>",description:"Alias for --blocked-by"}]},{target:"blockedReason",keys:["blockedReason","blocked_reason"],option:"--blocked-reason <value>",description:"Set blocked reason",aliasOptions:[{option:"--blocked_reason <value>",description:"Alias for --blocked-reason"}]},{target:"unblockNote",keys:["unblockNote","unblock_note"],option:"--unblock-note <value>",description:"Set unblock rationale note",aliasOptions:[{option:"--unblock_note <value>",description:"Alias for --unblock-note"}]},{target:"reporter",keys:["reporter"],option:"--reporter <value>",description:"Set issue reporter"},{target:"severity",keys:["severity"],option:"--severity <value>",description:"Set issue severity: low|med|medium|high|critical (med persists as medium)"},{target:"environment",keys:["environment"],option:"--environment <value>",description:"Set issue environment context"},{target:"reproSteps",keys:["reproSteps","repro_steps"],option:"--repro-steps <value>",description:"Set issue reproduction steps",aliasOptions:[{option:"--repro_steps <value>",description:"Alias for --repro-steps"}]},{target:"resolution",keys:["resolution"],option:"--resolution <value>",description:"Set issue resolution summary"},{target:"expectedResult",keys:["expectedResult","expected_result","expected"],option:"--expected-result <value>",description:"Set issue expected behavior",aliasOptions:[{option:"--expected_result <value>",description:"Alias for --expected-result"},{option:"--expected <value>",description:"Short alias for --expected-result"}]},{target:"actualResult",keys:["actualResult","actual_result","actual"],option:"--actual-result <value>",description:"Set issue observed behavior",aliasOptions:[{option:"--actual_result <value>",description:"Alias for --actual-result"},{option:"--actual <value>",description:"Short alias for --actual-result"}]},{target:"affectedVersion",keys:["affectedVersion","affected_version"],option:"--affected-version <value>",description:"Set affected version identifier",aliasOptions:[{option:"--affected_version <value>",description:"Alias for --affected-version"}]},{target:"fixedVersion",keys:["fixedVersion","fixed_version"],option:"--fixed-version <value>",description:"Set fixed version identifier",aliasOptions:[{option:"--fixed_version <value>",description:"Alias for --fixed-version"}]},{target:"component",keys:["component"],option:"--component <value>",description:"Set issue component ownership"},{target:"regression",keys:["regression"],option:"--regression [value]",description:"Set regression marker; bare flag means true, or pass true|false|1|0"},{target:"customerImpact",keys:["customerImpact","customer_impact"],option:"--customer-impact <value>",description:"Set customer impact summary",aliasOptions:[{option:"--customer_impact <value>",description:"Alias for --customer-impact"}]},{target:"dep",keys:["dep"],option:"--dep <value>",description:"Add dependency entries id=<id>,kind=<value>,author=<value>,created_at=<iso|now>,source_kind=<value> (repeatable)",repeatable:!0},{target:"depRemove",keys:["depRemove","dep_remove"],option:"--dep-remove <value>",description:"Remove by dependency id or exact row signature (repeatable)",repeatable:!0,aliasOptions:[{option:"--dep_remove <value>",description:"Alias for --dep-remove"}]},{target:"comment",keys:["comment"],option:"--comment <value>",description:"Append comment seed author=<value>,created_at=<iso|now>,text=<value> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"note",keys:["note"],option:"--note <value>",description:"Append note seed author=<value>,created_at=<iso|now>,text=<value> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"learning",keys:["learning"],option:"--learning <value>",description:"Append learning seed author=<value>,created_at=<iso|now>,text=<value> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"file",keys:["file","linkedFile"],option:"--file <value>",description:"Append linked file path=<value>,scope=<project|global>,note=<text> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--linked-file <value>",description:"Alias for --file (cross-surface name)"}]},{target:"test",keys:["test","linkedTest"],option:"--test <value>",description:"Append linked test command=<value>,path=<value>,scope=<project|global>,timeout_seconds=<n>,pm_context_mode=<schema|tracker|auto> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--linked-test <value>",description:"Alias for --test (cross-surface name)"}]},{target:"doc",keys:["doc"],option:"--doc <value>",description:"Append linked doc path=<value>,scope=<project|global>,note=<text> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"reminder",keys:["reminder"],option:"--reminder <value>",description:"Set reminders at=<iso|relative>,text=<text> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"event",keys:["event"],option:"--event <value>",description:"Set events start=<iso|relative>,end=<iso|relative>,duration=<relative|30min|PT30M>,title=<text>,all_day=<true|false>,recur_* fields (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"typeOption",keys:["typeOption","type_option"],option:"--type-option <value>",description:"Set type options key=value or key=<name>,value=<value> (also accepts key:value and markdown pairs; use - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--type_option <value>",description:"Alias for --type-option"}]},{target:"field",keys:["field"],option:"--field <name=value>",description:"Set a field declared by an active extension registerItemFields registration (repeatable)",repeatable:!0},{target:"unset",keys:["unset"],option:"--unset <field>",description:"Clear scalar metadata field by name (repeatable)",repeatable:!0}],N=T.filter(e=>e.repeatable!==!0).map(e=>({target:e.target,keys:e.keys})),R=T.filter(e=>e.repeatable===!0).map(e=>({target:e.target,keys:e.keys}));(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]="48efaa37-f28e-5f2a-a033-456bee15e294")}catch{}})();var E=new Set(["--author","--follow","--help","--lean","--token-accounting","--output-include","--output-limit","--output-budget","--output-format","--output-session","--output-cursor","--output-row-contract","--no-changed-fields","--no-extensions","--no-pager","--pm-path","--profile","--quiet","--interval-ms"]),k=new Set([...A,...m]),I=new Set(["--brief","--format","--full","--full-changed-fields","--id-only","--no-truncate","--stream"]),b=new Set(["--body-file","--file","--stdin-json"]),L=new Set(["--global","--local","--project"]),P=new Set(["--activity-limit","--default-depth","--section-activity","--section-blockers","--section-files","--section-hierarchy","--section-progress","--section-staleness","--section-tests","--section-workload","--stale-threshold-days"]),h=new Set(["action","fullChangedFields","idOnly","path","pmExecutable","timeoutMs"]),M=new Set(["configAction","id","name","query","reason","subcommand","target","text"]),w={assurance:{id:"<id>",kind:"<kind>",preset:"[kind]|[id]",subcommand:"<action>"},event:{title:"<title>"},files:{lookupPath:"lookup <path...>"},meet:{title:"<title>"},"item-reopen":{id:"<id>",reason:"<reason>"},merge:{subcommand:"<subcommand>"},remind:{title:"<title>"},workspace:{name:"<name>",subcommand:"snapshot",snapshotAction:"<snapshot-action>",target:"<target>"}},G={append:{"--text":"body"},assurance:{"--tree":"treeId","--owner":"owner","--apply":"apply","--enforcement":"enforcement"},init:{"--id-prefix":"idPrefix","--no-merge-fence":"mergeFence","--workspace":"workspace"},create:{"--ac":"acceptanceCriteria","--estimated-minutes":"estimate","--file":"linkedFile","--test":"linkedTest","--expected":"expectedResult","--actual":"actualResult"},update:{"--ac":"acceptanceCriteria","--estimated-minutes":"estimate","--file":"linkedFile","--test":"linkedTest","--expected":"expectedResult","--actual":"actualResult"},"update-many":{"--ac":"acceptanceCriteria","--estimated-minutes":"estimate","--file":"linkedFile","--test":"linkedTest","--expected":"expectedResult","--actual":"actualResult"},files:{"--note":"addNote"},docs:{"--note":"addNote"},comments:{"--full-history":"full"},notes:{"--file":"text","--full-history":"full"},learnings:{"--file":"text","--full-history":"full"},gc:{"--scope":"gcScope"},contracts:{"--action":"contractAction"},schema:{"--no-allow-unset":"allowUnset","--type":"fieldTypeScope"},"history-author-acknowledge":{"--event":"historyEvent","--all-actionable":"allActionable"},"extension-init":{"--capability":"capability"},"package-init":{"--capability":"capability"},"extension-install":{"--gh":"github"},"package-install":{"--gh":"github"},"extension-adopt":{"--gh":"github"},"package-adopt":{"--gh":"github"},extension:{"--gh":"github","--scaffold":"init"},package:{"--gh":"github","--scaffold":"init"},install:{"--gh":"github"}},D={"--pm-path":"path"},f={stats:{"--analytics":["measurements","metric","measurementLimit","observe","improvementDirection","measurementSource","measurementItem","measurementRevision","author","message","provenanceCoverage","fleetAttribution","since","eventLimit","minimumSample"]}};function F(e){return e.startsWith("extension-")?`extension ${e.slice(10)}`:e.startsWith("package-")?`package ${e.slice(8)}`:e.startsWith("item-")?`item ${e.slice(5)}`:e}function S(e,t){let i=G[e]?.[t]??D[t];return i!==void 0?i:t.replace(/^--/,"").replaceAll("_","-").replace(/-([a-z])/g,(r,o)=>o.toUpperCase())}function x(e){let t=new Set;return e.filter(({flag:i})=>!i.startsWith("--")||t.has(i)?!1:(t.add(i),!0))}function U(e,t){return t.find(({aliases:i})=>i?.includes(e))?.flag}function V(e,t,i,r){let o=f[e]?.[t.flag];if(o!==void 0&&o.every(a=>r.has(a)))return{surface:"cli",input:t.flag,counterpart:o[0],disposition:"shared",reason:"The validated CLI JSON object fans out across strict SDK parameters."};let n=S(e,t.flag);if(r.has(n))return{surface:"cli",input:t.flag,counterpart:n,disposition:"shared",reason:"The CLI flag maps directly to a strict SDK action parameter."};let s=U(t.flag,i);if(s!==void 0){let a=S(e,s);if(r.has(a))return{surface:"cli",input:t.flag,counterpart:a,disposition:"compatibility_alias",reason:`Compatibility spelling for ${s}.`}}return E.has(t.flag)?{surface:"cli",input:t.flag,disposition:"cli_transport",reason:"CLI process transport is supplied by the in-process SDK host."}:I.has(t.flag)?{surface:"cli",input:t.flag,disposition:"cli_presentation",reason:"CLI rendering or mutation projection does not alter the SDK result envelope."}:b.has(t.flag)?{surface:"cli",input:t.flag,disposition:"cli_adapter",reason:"Local file or stdin adaptation is a CLI boundary concern."}:P.has(t.flag)?{surface:"cli",input:t.flag,counterpart:"key",disposition:"compatibility_alias",reason:"CLI config shorthand normalizes to the SDK configAction/key/value contract."}:L.has(t.flag)?{surface:"cli",input:t.flag,counterpart:"scope",disposition:"cli_scope_selector",reason:"Mutually exclusive CLI scope switches normalize to the SDK scope parameter."}:{surface:"cli",input:t.flag,counterpart:n,disposition:"unclassified",reason:"The CLI flag has no strict SDK parameter or approved boundary classification."}}function B(e,t,i){let r=Object.entries(f[e]??{}).find(([s,a])=>a.includes(t)&&i.some(({input:p,disposition:d})=>p===s&&d==="shared"));if(r!==void 0)return{surface:"sdk",input:t,counterpart:r[0],disposition:"shared",reason:"The strict SDK parameter is reachable through the validated CLI JSON object."};let o=i.find(({counterpart:s,disposition:a})=>s===t&&(a==="shared"||a==="compatibility_alias"||a==="cli_scope_selector"));if(o!==void 0)return{surface:"sdk",input:t,counterpart:o.input,disposition:"shared",reason:"The strict SDK parameter is reachable from the CLI contract."};let n=w[e]?.[t];return n!==void 0?{surface:"sdk",input:t,counterpart:n,disposition:"shared",reason:"The strict SDK parameter maps to a canonical CLI positional argument."}:h.has(t)?{surface:"sdk",input:t,disposition:"sdk_transport",reason:"The SDK host supplies in-process transport and workspace selection."}:M.has(t)?{surface:"sdk",input:t,disposition:"cli_positional",reason:"The CLI accepts this SDK parameter as a positional command argument."}:{surface:"sdk",input:t,disposition:"sdk_native",reason:"The typed SDK exposes this structured input without a canonical CLI long flag."}}function X(e={}){let t=e.actions??u,i=e.resolveFlags??c,r=e.resolveParameters??C;return t.map(o=>{let n=F(o),s=x(i(n)).filter(({flag:l})=>O(o)!==void 0||!k.has(l)),a=new Set(r(o)??[]),p=s.map(l=>V(o,l,s,a)),d=[...a].sort((l,g)=>l.localeCompare(g)).map(l=>B(o,l,p));return{action:o,command:n,cli:p,sdk:d,unclassified:[...p,...d].filter(({disposition:l})=>l==="unclassified")}})}(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]="92c17dbe-3868-5fa5-a873-0744d3e7ca8e")}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]="63c96190-0df9-5803-aa61-b973493a7277")}catch{}})();var yo={format:"pm-history-attestation",version:1,stream_hash:"exact_file_bytes",rollup_hash:"stable_json_without_workspace_digest",ordering:"stream_id_code_unit_ascending",consistency:"per_stream_snapshot_with_change_detection",trust:"independently_retained_bundle"};export{_ as a,v as b,y as c,T as d,N as e,R as f,X as g,yo as h};
2
+ //# sourceMappingURL=chunk-6CWR2QFM.js.map