@unbrained/pm-cli 2026.10.8 → 2026.10.9

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 (90) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +17 -0
  3. package/dist/cli/register-list-query.js +2 -2
  4. package/dist/cli-bundle/bundle-manifest.json +151 -151
  5. package/dist/cli-bundle/chunks/{chunk-ZHIMZ65M.js → chunk-55MK3QQM.js} +30 -30
  6. package/dist/cli-bundle/chunks/{chunk-34L2BS2Z.js → chunk-5MOFELIF.js} +2 -2
  7. package/dist/cli-bundle/chunks/{chunk-ZBVAZ7XX.js → chunk-5NR6TDYB.js} +2 -2
  8. package/dist/cli-bundle/chunks/{chunk-OG66KEOF.js → chunk-5TCQ5J3V.js} +74 -78
  9. package/dist/cli-bundle/chunks/{chunk-K6E2FFUT.js → chunk-CPZOW6L2.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-TNU56MZI.js → chunk-E4XR5LKU.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-RCFZ6H2Y.js → chunk-KOGF6O6W.js} +3 -3
  12. package/dist/cli-bundle/chunks/{chunk-JDTBPW4Y.js → chunk-N7GKWO4G.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-L7U5FSZ5.js → chunk-NIF7JOPW.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-MJVRF67I.js → chunk-P5NS7EFC.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-HFCIAXLP.js → chunk-QQHNXCO3.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-FOLSEOJ2.js → chunk-XW3BLWFF.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-UGFN5NJ2.js → chunk-ZNXRGATT.js} +2 -2
  18. package/dist/cli-bundle/chunks/{register-list-query-PYVSPGPV.js → register-list-query-2YOWMNWY.js} +7 -7
  19. package/dist/cli-bundle/chunks/{register-mutation-WXP3YLIN.js → register-mutation-ILOWFMTV.js} +2 -2
  20. package/dist/cli-bundle/chunks/{register-operations-WL25C3NP.js → register-operations-BMK65YM3.js} +2 -2
  21. package/dist/cli-bundle/chunks/{register-setup-PFKYNEQI.js → register-setup-24TFFK6N.js} +2 -2
  22. package/dist/cli-bundle/focused-chunks/{chunk-PEBOVLEG.js → chunk-2ATAD56F.js} +2 -2
  23. package/dist/cli-bundle/focused-chunks/{chunk-6TKAFFEB.js → chunk-2CJWTLQG.js} +2 -2
  24. package/dist/cli-bundle/focused-chunks/{chunk-EOUORVJA.js → chunk-362645PL.js} +2 -2
  25. package/dist/cli-bundle/focused-chunks/{chunk-V3EPBB6V.js → chunk-AU6VJGTY.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/{chunk-L3CZNKZE.js → chunk-B3YW6H2I.js} +16 -20
  27. package/dist/cli-bundle/focused-chunks/{chunk-XT7JAVHI.js → chunk-DMSADMEU.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/{chunk-2KSPGWLH.js → chunk-DSLNUL2Q.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/{chunk-A3W6HFFO.js → chunk-EZ4367G4.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-MW2TQHZ3.js → chunk-IARAEFMA.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-OSKXYRYZ.js → chunk-MCVWZUGK.js} +27 -27
  32. package/dist/cli-bundle/focused-chunks/{chunk-F2ME5MJY.js → chunk-PBCYGO7X.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/{chunk-PBPPIGUL.js → chunk-PLTTMQAW.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/{chunk-OLCJ2PJS.js → chunk-SAN3KPX4.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/{chunk-DRHJOG5X.js → chunk-W5AE7GKZ.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/{chunk-LZQGEVKT.js → chunk-WAOXID5J.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-BDT5EALU.js → chunk-WOEZJUA2.js} +2 -2
  38. package/dist/cli-bundle/main.js +2 -2
  39. package/dist/cli-bundle/sdk-authoring.js +1 -1
  40. package/dist/cli-bundle/sdk-contracts.js +1 -1
  41. package/dist/cli-bundle/sdk-core.js +22 -22
  42. package/dist/cli-bundle/sdk-governance.js +1 -1
  43. package/dist/cli-bundle/sdk-graph.js +1 -1
  44. package/dist/cli-bundle/sdk-merge.js +50 -50
  45. package/dist/cli-bundle/sdk-query.js +1 -1
  46. package/dist/cli-bundle/sdk-runtime.js +1 -1
  47. package/dist/cli-bundle/sdk-testing.js +1 -1
  48. package/dist/cli-bundle/sdk.js +7 -7
  49. package/dist/core/history/event-index.d.ts +1 -2
  50. package/dist/core/history/event-index.js +2 -2
  51. package/dist/core/output/output.d.ts +16 -14
  52. package/dist/core/output/output.js +6 -10
  53. package/dist/core/store/item-metadata-query-index.d.ts +1 -2
  54. package/dist/core/store/item-metadata-query-index.js +1 -1
  55. package/dist/core/store/sqlite-runtime.d.ts +15 -0
  56. package/dist/core/store/sqlite-runtime.js +2 -0
  57. package/dist/sdk/output/table-rows.d.ts +37 -0
  58. package/dist/sdk/output/table-rows.js +2 -0
  59. package/dist/sdk/output.d.ts +1 -0
  60. package/dist/sdk/output.js +2 -2
  61. package/dist/sdk/public-surface.json +1 -1
  62. package/dist/sdk/read-output-contracts.d.ts +3 -3
  63. package/dist/sdk/read-output-contracts.js +1 -1
  64. package/dist/sdk/test/workspace-snapshot.d.ts +1 -1
  65. package/dist/sdk/test/workspace-snapshot.js +1 -1
  66. package/docs/AGENT_OUTPUT_ENCODINGS.md +119 -0
  67. package/docs/PACKAGE_GATE_ACCEPTANCE.md +56 -0
  68. package/docs/README.md +2 -0
  69. package/docs/TESTING.md +11 -3
  70. package/marketplace.json +2 -2
  71. package/package.json +1 -1
  72. package/packages/pm-beads/package.json +1 -1
  73. package/packages/pm-calendar/package.json +1 -1
  74. package/packages/pm-command-kit/package.json +1 -1
  75. package/packages/pm-digital-twin/package.json +1 -1
  76. package/packages/pm-governance-audit/package.json +1 -1
  77. package/packages/pm-guide-shell/package.json +1 -1
  78. package/packages/pm-kanban/package.json +1 -1
  79. package/packages/pm-lifecycle-hooks/package.json +1 -1
  80. package/packages/pm-linked-test-adapters/package.json +1 -1
  81. package/packages/pm-search-advanced/package.json +1 -1
  82. package/packages/pm-templates/package.json +1 -1
  83. package/packages/pm-todos/package.json +1 -1
  84. package/packages/pm-vcs/package.json +1 -1
  85. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  86. package/plugins/pm-claude/package.json +2 -2
  87. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  88. package/plugins/pm-codex/package.json +2 -2
  89. package/plugins/pm-codex/plugin.json +1 -1
  90. package/runtime-dependencies.json +2 -2
@@ -1,3 +1,3 @@
1
- import{$ as y,O as V,P as W,Q as K,R as G,Rb as Y,aa as _,q as C,r as x,s as $,sa as J,t as P,u as q,va as H}from"./chunk-L3CZNKZE.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]="3b307f5a-3d23-5463-b90c-efbc4febe5dd")}catch{}})();var k=new Set(W),D=Object.freeze({get size(){return k.size},has(e){return k.has(e)},entries(){return k.entries()},keys(){return k.keys()},values(){return k.values()},forEach(e,t){k.forEach(r=>e.call(t,r,r,D))},[Symbol.iterator](){return k.values()}});function X(e){if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}function B(e){return typeof e!="string"?null:V(e)}function de(e){try{return structuredClone(e)}catch{return e}}function ue(e){let t=e.trim(),r=t.indexOf("=");if(r<=0)throw new _(`--field entries must use name=value syntax, received: ${e}`,y.USAGE);let s=t.slice(0,r).trim(),n=t.slice(r+1);return{key:s,value:n}}function fe(e,t,r){try{let s=JSON.parse(e);if(r==="array"&&Array.isArray(s)||r==="object"&&typeof s=="object"&&s!==null&&!Array.isArray(s))return s}catch{}throw new _(`--field ${t}=... must be valid JSON ${r}`,y.USAGE)}function ce(e,t,r){if(t==="string")return r;if(t==="number"){let s=r.trim();if(s.length===0)throw new _(`--field ${e}=... must be a number`,y.USAGE);let n=Number(s);if(!Number.isFinite(n))throw new _(`--field ${e}=... must be a number`,y.USAGE);return n}if(t==="boolean"){let s=r.trim().toLowerCase();if(s==="true"||s==="1"||s==="yes")return!0;if(s==="false"||s==="0"||s==="no")return!1;throw new _(`--field ${e}=... must be one of true|false|1|0|yes|no`,y.USAGE)}return t==="string_array"?r.split(/[\n,|]/u).map(s=>s.trim()).filter(s=>s.length>0):fe(r,e,t)}function U(e){let t=new Map;if(!e)return t;for(let r of e.item_fields)for(let s of r.fields){let n=X(s.name),i=B(s.type);if(!n||!i)continue;let a=t.get(n);if(a&&a.type!==i)throw new _(`Extension item field "${n}" is declared with conflicting types: ${a.type}, ${i}`,y.USAGE,{code:"extension_item_field_type_conflict",nextSteps:["Make every active extension declaration for this field use the same type."]});t.set(n,{name:n,type:i})}return t}function Z(e){if(D.has(e))throw new _(`Extension item field "${e}" collides with built-in item metadata "${e}"; rename the extension field with an extension-specific prefix. Reserved fields: ${[...D].sort((t,r)=>t.localeCompare(r)).join(", ")}.`,y.USAGE,{code:"extension_item_field_reserved",nextSteps:["Rename the extension item field, preferably with an extension-specific prefix."]})}function Be(e){return[...U(e).keys()].sort((t,r)=>t.localeCompare(r))}function Ze(e,t){if(!e||e.length===0)return{};let r=U(t),s={};for(let n of e){let{key:i,value:a}=ue(n),l=r.get(i);if(!l){if(D.has(i)){let d=`--${i.replaceAll("_","-")}`;throw new _(`--field ${i} is a core item field, not an extension field`,y.USAGE,{code:"core_item_field_requires_dedicated_flag",field:i,recovery:{provided_fields:[i],suggested_flags:[d]},nextSteps:[`Set the core field with its dedicated flag: pm update <id> ${d} <value>`,`When closing an item, pm close <id> also accepts ${d} <value>.`]})}let o=[...r.keys()].sort((d,f)=>d.localeCompare(f));throw new _(`--field ${i} is not declared by an active extension item-field registration`,y.USAGE,{code:"extension_item_field_unknown",field:i,recovery:{provided_fields:[i]},nextSteps:o.length>0?[`Use one of the declared fields: ${o.join(", ")}`]:["Activate an extension that calls registerItemFields before setting extension fields."]})}Z(l.name),s[l.name]=ce(l.name,l.type,a)}return s}function me(e,t){return t==="string"?typeof e=="string":t==="number"?typeof e=="number"&&Number.isFinite(e):t==="boolean"?typeof e=="boolean":t==="array"?Array.isArray(e):t==="string_array"?Array.isArray(e)&&e.every(r=>typeof r=="string"):typeof e=="object"&&e!==null&&!Array.isArray(e)}function ye(e,t){return!t||t.length===0?!0:t.some(r=>Object.is(r,e))}function Qe(e,t,r={}){if(t){U(t);for(let s of t.item_fields)for(let n of s.fields){let i=X(n.name);if(!i)continue;Z(i),!(i in e)&&!r.skipDefaultFields?.has(i)&&Object.prototype.hasOwnProperty.call(n,"default")&&(e[i]=de(n.default));let a=e[i];if(a===void 0)continue;let l=B(n.type);if(l&&!me(a,l))throw new TypeError(`Item field "${i}" must be of type ${l}`);let o=Array.isArray(n.values)?n.values:void 0;if(!ye(a,o))throw new TypeError(`Item field "${i}" must match one of the configured allowed values`)}}}(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]="2075887b-6d4b-582f-9da2-bab13198f9a5")}catch{}})();var _e=2e3,z=new Map;function S(e){if(typeof e!="string")return"";let t=z.get(e);if(t!==void 0)return t;let r=e.trim().toLowerCase().replaceAll(/[\s-]+/g,"_");return z.size>=_e&&Y(z),z.set(e,r),r}import ee from"node:path";import{link as pe,mkdir as we,mkdtemp as he,rm as ge,writeFile as Se}from"node:fs/promises";import N 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]="71c2fed9-81e1-5723-8e34-e6327c07a130")}catch{}})();async function Q(e,t){let r=N.dirname(e);await we(r,{recursive:!0});let s=await he(N.join(r,".pm-seed-")),n=N.join(s,"value");try{await Se(n,t,"utf8");try{return await pe(n,e),!0}catch(i){if(i.code==="EEXIST")return!1;throw i}}finally{await ge(s,{recursive:!0,force:!0})}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6e07b1b6-1757-54dd-8833-9d3f984ccf79")}catch{}})();var p=Object.freeze({types:"schema/types.json",statuses:"schema/statuses.json",fields:"schema/fields.json",workflows:"schema/workflows.json"}),se=G,L=K,Ae=["create","update"],be=new Set(x),Ee=new Set($),ke=new Set(P),ve=new Set(q),Fe=new Set(["string","number","boolean","array","object"]),Te=16;function ne(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Ie=[e=>e.type===void 0||typeof e.type=="string"&&Fe.has(e.type),e=>!Object.hasOwn(e,"const")||O(e.const),e=>e.enum===void 0||Array.isArray(e.enum)&&e.enum.every(t=>O(t)),e=>e.min_length===void 0||Number.isInteger(e.min_length)&&e.min_length>=0,e=>e.min_items===void 0||Number.isInteger(e.min_items)&&e.min_items>=0,e=>e.format===void 0||e.format==="date-time",e=>e.required===void 0||Array.isArray(e.required)&&e.required.every(t=>typeof t=="string"&&t.length>0),e=>e.additional_properties===void 0||typeof e.additional_properties=="boolean",e=>e.properties===void 0||ne(e.properties),e=>e.one_of===void 0||Array.isArray(e.one_of)&&e.one_of.length>0];function O(e,t=new Set){if(e===null||typeof e=="string"||typeof e=="boolean")return!0;if(typeof e=="number")return Number.isFinite(e);if(typeof e!="object"||t.has(e))return!1;t.add(e);let r=Array.isArray(e)?e.every(s=>O(s,t)):Object.values(e).every(s=>O(s,t));return t.delete(e),r}function R(e,t=0,r=new Set){if(!ne(e)||t>Te||r.has(e))return;r.add(e);let s=e,n=s.type,i=s.enum,a=s.one_of,l=s.properties,o=s.items,d=s.required,f=s.min_length,u=s.min_items,w=s.format,g=s.additional_properties;if(!Ie.every(c=>c(s))){r.delete(e);return}let A=l===void 0?void 0:Object.fromEntries(Object.entries(l).map(([c,v])=>[c,R(v,t+1,r)])),b=o===void 0?void 0:R(o,t+1,r),E=a===void 0?void 0:a.map(c=>R(c,t+1,r));if([...Object.values(A??{}),...o===void 0?[]:[b],...E??[]].some(c=>c===void 0)){r.delete(e);return}return r.delete(e),Object.fromEntries(Object.entries({type:n,const:Object.hasOwn(s,"const")?s.const:void 0,enum:i,min_length:f,min_items:u,format:w,properties:A,required:d===void 0?void 0:[...new Set(d)],additional_properties:g,items:b,one_of:E}).filter(([,c])=>c!==void 0))}function T(e){let t=Array.isArray(e)?e:[];return[...new Set(t.map(r=>typeof r=="string"?r.trim():"").filter(r=>r.length>0))].sort((r,s)=>r.localeCompare(s))}function m(e){if(typeof e!="string"||e.length===0)return;let t=S(e);return t.length>0?t:void 0}function De(e){return e.startsWith("--")?e.slice(2):e}function te(e){return typeof e=="string"?De(e.trim().toLowerCase().replaceAll(/[\s_]+/g,"-")):""}function ie(e){return e.replaceAll("_","-")}function ze(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g," ").trim().split(/\s+/).filter(n=>n.length>0).map(n=>n.toLowerCase());if(t.length===0)return e;let[r,...s]=t;return`${r}${s.map(n=>`${n.slice(0,1).toUpperCase()}${n.slice(1)}`).join("")}`}function M(e,t){let r=m(e.id);if(!r)return null;let s=[...new Set(T(e.aliases).map(S).filter(l=>l.length>0))].sort((l,o)=>l.localeCompare(o)),n=T(e.roles).filter(l=>be.has(l)),i=e.description?.trim(),a=typeof e.order=="number"&&Number.isFinite(e.order)?e.order:t;return{id:r,aliases:s,roles:n,description:i&&i.length>0?i:void 0,order:a}}function Re(e){return{draft_status:m(e?.draft_status),open_status:m(e?.open_status),in_progress_status:m(e?.in_progress_status),blocked_status:m(e?.blocked_status),close_status:m(e?.close_status),canceled_status:m(e?.canceled_status)}}function oe(e,t){if(!Array.isArray(t)||t.length!==2)return;let r=S(t[0]),s=S(t[1]);r.length===0||s.length===0||e.pairs.some(n=>n[0]===r&&n[1]===s)||e.pairs.push([r,s])}function Oe(e){let t=typeof e?.type=="string"?e.type.trim():"";if(t.length===0||!Array.isArray(e?.allowed_transitions))return null;let r={type:t,pairs:[],denyAll:e.allowed_transitions.length===0};for(let s of e.allowed_transitions)oe(r,s);return{typeKey:t.toLowerCase(),record:r}}function Ue(e){if(!Array.isArray(e)||e.length===0)return;let t=new Map;for(let s of e){let n=Oe(s);if(n===null)continue;let i=t.get(n.typeKey)??n.record;i.denyAll||=n.record.denyAll;for(let a of n.record.pairs)oe(i,a);t.set(n.typeKey,i)}let r=[];for(let s of t.values())(s.pairs.length>0||s.denyAll)&&r.push({type:s.type,allowed_transitions:s.pairs});return r.sort((s,n)=>s.type.localeCompare(n.type)),r.length>0?r:void 0}function ae(e){let t=S(e.key??"");if(!t)return null;let r=S(e.metadata_key??e.front_matter_key??t),s=te(e.cli_flag??ie(t));if(!s)return null;let n=T(e.cli_aliases).map(u=>te(u)).filter(u=>u.length>0&&u!==s),i=typeof e.type=="string"?e.type.trim().toLowerCase():"string",a=Ee.has(i)?i:"string",l=(()=>{let u=T(e.commands).filter(w=>ke.has(w));return u.length>0?u:[...Ae]})(),o=e.description?.trim(),d=T(e.required_types),f=e.value_schema===void 0?void 0:R(e.value_schema);return e.value_schema!==void 0&&f===void 0?null:{key:t,metadata_key:r,cli_flag:s,cli_aliases:n,description:o&&o.length>0?o:void 0,type:a,commands:l,repeatable:[e.repeatable===!0,a==="string_array"].includes(!0),required:e.required===!0,required_on_create:e.required_on_create===!0,required_types:d,allow_unset:e.allow_unset!==!1,value_schema:f}}function Ne(e){let t=new Map;for(let[s,n]of e.entries()){let i=M(n,s);i&&t.set(i.id,i)}let r=re([...t.values()]);return r.length>0?r:re(L.map((s,n)=>M(s,n)).filter(s=>s!==null))}function re(e){return e.sort((t,r)=>t.order===r.order?t.id.localeCompare(r.id):t.order-r.order)}function Me(e){let t=new Map;for(let r of e??[]){let s=ae(r);s&&t.set(s.key,s)}return[...t.values()].sort((r,s)=>r.key.localeCompare(s.key))}function Le(e){return{id:e.id,aliases:e.aliases.length>0?[...e.aliases]:void 0,roles:e.roles.length>0?[...e.roles]:void 0,description:e.description,order:e.order}}function je(e){return{key:e.key,metadata_key:e.metadata_key!==e.key?e.metadata_key:void 0,cli_flag:e.cli_flag!==ie(e.key)?e.cli_flag:void 0,cli_aliases:e.cli_aliases.length>0?[...e.cli_aliases]:void 0,description:e.description,type:e.type,commands:[...e.commands],repeatable:e.repeatable===!0?!0:void 0,required:e.required===!0?!0:void 0,required_on_create:e.required_on_create===!0?!0:void 0,required_types:e.required_types.length>0?[...e.required_types]:void 0,allow_unset:e.allow_unset===!1?!1:void 0,value_schema:e.value_schema}}function Ce(e){let t=typeof e=="string"?e.trim().toLowerCase():"allow";return ve.has(t)?t:"allow"}function I(e){let t={...p,...e?.files},r=e?.statuses&&e.statuses.length>0?e.statuses:L,s=Ne(r),n=Me(e?.fields);return{version:typeof e?.version=="number"&&Number.isFinite(e.version)?Math.floor(e.version):1,files:t,statuses:s.map(Le),fields:n.map(je),workflow:{...se,...Re(e?.workflow)},type_workflows:Ue(e?.type_workflows),unknown_field_policy:Ce(e?.unknown_field_policy)}}function xe(e,t,r){try{return JSON.parse(e)}catch{r.push(t);return}}function $e(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.definitions))return t.definitions;if(typeof t.item_types=="object"&&t.item_types!==null){let r=t.item_types;if(Array.isArray(r.definitions))return r.definitions}}function Pe(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.statuses))return t.statuses;if(Array.isArray(t.definitions))return t.definitions}function qe(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.fields))return t.fields;if(Array.isArray(t.definitions))return t.definitions}function Ve(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e;return typeof t.workflow=="object"&&t.workflow!==null&&!Array.isArray(t.workflow)?t.workflow:typeof t.workflows=="object"&&t.workflows!==null&&!Array.isArray(t.workflows)?t.workflows:t}function We(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e;if(Array.isArray(t.type_workflows))return t.type_workflows}function h(e,t,r){let s=t?.trim()||r;return ee.isAbsolute(s)?s:ee.join(e,s)}function ct(e,t){return h(e,t.files.types,p.types)}async function mt(e,t){let r=I(t),s=[{path:h(e,r.files.types,p.types),seed:{definitions:[]}},{path:h(e,r.files.statuses,p.statuses),seed:{statuses:L}},{path:h(e,r.files.fields,p.fields),seed:{fields:[]}},{path:h(e,r.files.workflows,p.workflows),seed:{workflow:se}}],n=[];for(let i of s)await J(i.path)||await Q(i.path,`${JSON.stringify(i.seed,null,2)}
1
+ import{$ as y,O as V,P as W,Q as K,R as G,Rb as Y,aa as _,q as C,r as x,s as $,sa as J,t as P,u as q,va as H}from"./chunk-B3YW6H2I.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]="3b307f5a-3d23-5463-b90c-efbc4febe5dd")}catch{}})();var k=new Set(W),D=Object.freeze({get size(){return k.size},has(e){return k.has(e)},entries(){return k.entries()},keys(){return k.keys()},values(){return k.values()},forEach(e,t){k.forEach(r=>e.call(t,r,r,D))},[Symbol.iterator](){return k.values()}});function X(e){if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}function B(e){return typeof e!="string"?null:V(e)}function de(e){try{return structuredClone(e)}catch{return e}}function ue(e){let t=e.trim(),r=t.indexOf("=");if(r<=0)throw new _(`--field entries must use name=value syntax, received: ${e}`,y.USAGE);let s=t.slice(0,r).trim(),n=t.slice(r+1);return{key:s,value:n}}function fe(e,t,r){try{let s=JSON.parse(e);if(r==="array"&&Array.isArray(s)||r==="object"&&typeof s=="object"&&s!==null&&!Array.isArray(s))return s}catch{}throw new _(`--field ${t}=... must be valid JSON ${r}`,y.USAGE)}function ce(e,t,r){if(t==="string")return r;if(t==="number"){let s=r.trim();if(s.length===0)throw new _(`--field ${e}=... must be a number`,y.USAGE);let n=Number(s);if(!Number.isFinite(n))throw new _(`--field ${e}=... must be a number`,y.USAGE);return n}if(t==="boolean"){let s=r.trim().toLowerCase();if(s==="true"||s==="1"||s==="yes")return!0;if(s==="false"||s==="0"||s==="no")return!1;throw new _(`--field ${e}=... must be one of true|false|1|0|yes|no`,y.USAGE)}return t==="string_array"?r.split(/[\n,|]/u).map(s=>s.trim()).filter(s=>s.length>0):fe(r,e,t)}function U(e){let t=new Map;if(!e)return t;for(let r of e.item_fields)for(let s of r.fields){let n=X(s.name),i=B(s.type);if(!n||!i)continue;let a=t.get(n);if(a&&a.type!==i)throw new _(`Extension item field "${n}" is declared with conflicting types: ${a.type}, ${i}`,y.USAGE,{code:"extension_item_field_type_conflict",nextSteps:["Make every active extension declaration for this field use the same type."]});t.set(n,{name:n,type:i})}return t}function Z(e){if(D.has(e))throw new _(`Extension item field "${e}" collides with built-in item metadata "${e}"; rename the extension field with an extension-specific prefix. Reserved fields: ${[...D].sort((t,r)=>t.localeCompare(r)).join(", ")}.`,y.USAGE,{code:"extension_item_field_reserved",nextSteps:["Rename the extension item field, preferably with an extension-specific prefix."]})}function Be(e){return[...U(e).keys()].sort((t,r)=>t.localeCompare(r))}function Ze(e,t){if(!e||e.length===0)return{};let r=U(t),s={};for(let n of e){let{key:i,value:a}=ue(n),l=r.get(i);if(!l){if(D.has(i)){let d=`--${i.replaceAll("_","-")}`;throw new _(`--field ${i} is a core item field, not an extension field`,y.USAGE,{code:"core_item_field_requires_dedicated_flag",field:i,recovery:{provided_fields:[i],suggested_flags:[d]},nextSteps:[`Set the core field with its dedicated flag: pm update <id> ${d} <value>`,`When closing an item, pm close <id> also accepts ${d} <value>.`]})}let o=[...r.keys()].sort((d,f)=>d.localeCompare(f));throw new _(`--field ${i} is not declared by an active extension item-field registration`,y.USAGE,{code:"extension_item_field_unknown",field:i,recovery:{provided_fields:[i]},nextSteps:o.length>0?[`Use one of the declared fields: ${o.join(", ")}`]:["Activate an extension that calls registerItemFields before setting extension fields."]})}Z(l.name),s[l.name]=ce(l.name,l.type,a)}return s}function me(e,t){return t==="string"?typeof e=="string":t==="number"?typeof e=="number"&&Number.isFinite(e):t==="boolean"?typeof e=="boolean":t==="array"?Array.isArray(e):t==="string_array"?Array.isArray(e)&&e.every(r=>typeof r=="string"):typeof e=="object"&&e!==null&&!Array.isArray(e)}function ye(e,t){return!t||t.length===0?!0:t.some(r=>Object.is(r,e))}function Qe(e,t,r={}){if(t){U(t);for(let s of t.item_fields)for(let n of s.fields){let i=X(n.name);if(!i)continue;Z(i),!(i in e)&&!r.skipDefaultFields?.has(i)&&Object.prototype.hasOwnProperty.call(n,"default")&&(e[i]=de(n.default));let a=e[i];if(a===void 0)continue;let l=B(n.type);if(l&&!me(a,l))throw new TypeError(`Item field "${i}" must be of type ${l}`);let o=Array.isArray(n.values)?n.values:void 0;if(!ye(a,o))throw new TypeError(`Item field "${i}" must match one of the configured allowed values`)}}}(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]="2075887b-6d4b-582f-9da2-bab13198f9a5")}catch{}})();var _e=2e3,z=new Map;function S(e){if(typeof e!="string")return"";let t=z.get(e);if(t!==void 0)return t;let r=e.trim().toLowerCase().replaceAll(/[\s-]+/g,"_");return z.size>=_e&&Y(z),z.set(e,r),r}import ee from"node:path";import{link as pe,mkdir as we,mkdtemp as he,rm as ge,writeFile as Se}from"node:fs/promises";import N 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]="71c2fed9-81e1-5723-8e34-e6327c07a130")}catch{}})();async function Q(e,t){let r=N.dirname(e);await we(r,{recursive:!0});let s=await he(N.join(r,".pm-seed-")),n=N.join(s,"value");try{await Se(n,t,"utf8");try{return await pe(n,e),!0}catch(i){if(i.code==="EEXIST")return!1;throw i}}finally{await ge(s,{recursive:!0,force:!0})}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6e07b1b6-1757-54dd-8833-9d3f984ccf79")}catch{}})();var p=Object.freeze({types:"schema/types.json",statuses:"schema/statuses.json",fields:"schema/fields.json",workflows:"schema/workflows.json"}),se=G,L=K,Ae=["create","update"],be=new Set(x),Ee=new Set($),ke=new Set(P),ve=new Set(q),Fe=new Set(["string","number","boolean","array","object"]),Te=16;function ne(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Ie=[e=>e.type===void 0||typeof e.type=="string"&&Fe.has(e.type),e=>!Object.hasOwn(e,"const")||O(e.const),e=>e.enum===void 0||Array.isArray(e.enum)&&e.enum.every(t=>O(t)),e=>e.min_length===void 0||Number.isInteger(e.min_length)&&e.min_length>=0,e=>e.min_items===void 0||Number.isInteger(e.min_items)&&e.min_items>=0,e=>e.format===void 0||e.format==="date-time",e=>e.required===void 0||Array.isArray(e.required)&&e.required.every(t=>typeof t=="string"&&t.length>0),e=>e.additional_properties===void 0||typeof e.additional_properties=="boolean",e=>e.properties===void 0||ne(e.properties),e=>e.one_of===void 0||Array.isArray(e.one_of)&&e.one_of.length>0];function O(e,t=new Set){if(e===null||typeof e=="string"||typeof e=="boolean")return!0;if(typeof e=="number")return Number.isFinite(e);if(typeof e!="object"||t.has(e))return!1;t.add(e);let r=Array.isArray(e)?e.every(s=>O(s,t)):Object.values(e).every(s=>O(s,t));return t.delete(e),r}function R(e,t=0,r=new Set){if(!ne(e)||t>Te||r.has(e))return;r.add(e);let s=e,n=s.type,i=s.enum,a=s.one_of,l=s.properties,o=s.items,d=s.required,f=s.min_length,u=s.min_items,w=s.format,g=s.additional_properties;if(!Ie.every(c=>c(s))){r.delete(e);return}let A=l===void 0?void 0:Object.fromEntries(Object.entries(l).map(([c,v])=>[c,R(v,t+1,r)])),b=o===void 0?void 0:R(o,t+1,r),E=a===void 0?void 0:a.map(c=>R(c,t+1,r));if([...Object.values(A??{}),...o===void 0?[]:[b],...E??[]].some(c=>c===void 0)){r.delete(e);return}return r.delete(e),Object.fromEntries(Object.entries({type:n,const:Object.hasOwn(s,"const")?s.const:void 0,enum:i,min_length:f,min_items:u,format:w,properties:A,required:d===void 0?void 0:[...new Set(d)],additional_properties:g,items:b,one_of:E}).filter(([,c])=>c!==void 0))}function T(e){let t=Array.isArray(e)?e:[];return[...new Set(t.map(r=>typeof r=="string"?r.trim():"").filter(r=>r.length>0))].sort((r,s)=>r.localeCompare(s))}function m(e){if(typeof e!="string"||e.length===0)return;let t=S(e);return t.length>0?t:void 0}function De(e){return e.startsWith("--")?e.slice(2):e}function te(e){return typeof e=="string"?De(e.trim().toLowerCase().replaceAll(/[\s_]+/g,"-")):""}function ie(e){return e.replaceAll("_","-")}function ze(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g," ").trim().split(/\s+/).filter(n=>n.length>0).map(n=>n.toLowerCase());if(t.length===0)return e;let[r,...s]=t;return`${r}${s.map(n=>`${n.slice(0,1).toUpperCase()}${n.slice(1)}`).join("")}`}function M(e,t){let r=m(e.id);if(!r)return null;let s=[...new Set(T(e.aliases).map(S).filter(l=>l.length>0))].sort((l,o)=>l.localeCompare(o)),n=T(e.roles).filter(l=>be.has(l)),i=e.description?.trim(),a=typeof e.order=="number"&&Number.isFinite(e.order)?e.order:t;return{id:r,aliases:s,roles:n,description:i&&i.length>0?i:void 0,order:a}}function Re(e){return{draft_status:m(e?.draft_status),open_status:m(e?.open_status),in_progress_status:m(e?.in_progress_status),blocked_status:m(e?.blocked_status),close_status:m(e?.close_status),canceled_status:m(e?.canceled_status)}}function oe(e,t){if(!Array.isArray(t)||t.length!==2)return;let r=S(t[0]),s=S(t[1]);r.length===0||s.length===0||e.pairs.some(n=>n[0]===r&&n[1]===s)||e.pairs.push([r,s])}function Oe(e){let t=typeof e?.type=="string"?e.type.trim():"";if(t.length===0||!Array.isArray(e?.allowed_transitions))return null;let r={type:t,pairs:[],denyAll:e.allowed_transitions.length===0};for(let s of e.allowed_transitions)oe(r,s);return{typeKey:t.toLowerCase(),record:r}}function Ue(e){if(!Array.isArray(e)||e.length===0)return;let t=new Map;for(let s of e){let n=Oe(s);if(n===null)continue;let i=t.get(n.typeKey)??n.record;i.denyAll||=n.record.denyAll;for(let a of n.record.pairs)oe(i,a);t.set(n.typeKey,i)}let r=[];for(let s of t.values())(s.pairs.length>0||s.denyAll)&&r.push({type:s.type,allowed_transitions:s.pairs});return r.sort((s,n)=>s.type.localeCompare(n.type)),r.length>0?r:void 0}function ae(e){let t=S(e.key??"");if(!t)return null;let r=S(e.metadata_key??e.front_matter_key??t),s=te(e.cli_flag??ie(t));if(!s)return null;let n=T(e.cli_aliases).map(u=>te(u)).filter(u=>u.length>0&&u!==s),i=typeof e.type=="string"?e.type.trim().toLowerCase():"string",a=Ee.has(i)?i:"string",l=(()=>{let u=T(e.commands).filter(w=>ke.has(w));return u.length>0?u:[...Ae]})(),o=e.description?.trim(),d=T(e.required_types),f=e.value_schema===void 0?void 0:R(e.value_schema);return e.value_schema!==void 0&&f===void 0?null:{key:t,metadata_key:r,cli_flag:s,cli_aliases:n,description:o&&o.length>0?o:void 0,type:a,commands:l,repeatable:[e.repeatable===!0,a==="string_array"].includes(!0),required:e.required===!0,required_on_create:e.required_on_create===!0,required_types:d,allow_unset:e.allow_unset!==!1,value_schema:f}}function Ne(e){let t=new Map;for(let[s,n]of e.entries()){let i=M(n,s);i&&t.set(i.id,i)}let r=re([...t.values()]);return r.length>0?r:re(L.map((s,n)=>M(s,n)).filter(s=>s!==null))}function re(e){return e.sort((t,r)=>t.order===r.order?t.id.localeCompare(r.id):t.order-r.order)}function Me(e){let t=new Map;for(let r of e??[]){let s=ae(r);s&&t.set(s.key,s)}return[...t.values()].sort((r,s)=>r.key.localeCompare(s.key))}function Le(e){return{id:e.id,aliases:e.aliases.length>0?[...e.aliases]:void 0,roles:e.roles.length>0?[...e.roles]:void 0,description:e.description,order:e.order}}function je(e){return{key:e.key,metadata_key:e.metadata_key!==e.key?e.metadata_key:void 0,cli_flag:e.cli_flag!==ie(e.key)?e.cli_flag:void 0,cli_aliases:e.cli_aliases.length>0?[...e.cli_aliases]:void 0,description:e.description,type:e.type,commands:[...e.commands],repeatable:e.repeatable===!0?!0:void 0,required:e.required===!0?!0:void 0,required_on_create:e.required_on_create===!0?!0:void 0,required_types:e.required_types.length>0?[...e.required_types]:void 0,allow_unset:e.allow_unset===!1?!1:void 0,value_schema:e.value_schema}}function Ce(e){let t=typeof e=="string"?e.trim().toLowerCase():"allow";return ve.has(t)?t:"allow"}function I(e){let t={...p,...e?.files},r=e?.statuses&&e.statuses.length>0?e.statuses:L,s=Ne(r),n=Me(e?.fields);return{version:typeof e?.version=="number"&&Number.isFinite(e.version)?Math.floor(e.version):1,files:t,statuses:s.map(Le),fields:n.map(je),workflow:{...se,...Re(e?.workflow)},type_workflows:Ue(e?.type_workflows),unknown_field_policy:Ce(e?.unknown_field_policy)}}function xe(e,t,r){try{return JSON.parse(e)}catch{r.push(t);return}}function $e(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.definitions))return t.definitions;if(typeof t.item_types=="object"&&t.item_types!==null){let r=t.item_types;if(Array.isArray(r.definitions))return r.definitions}}function Pe(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.statuses))return t.statuses;if(Array.isArray(t.definitions))return t.definitions}function qe(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.fields))return t.fields;if(Array.isArray(t.definitions))return t.definitions}function Ve(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e;return typeof t.workflow=="object"&&t.workflow!==null&&!Array.isArray(t.workflow)?t.workflow:typeof t.workflows=="object"&&t.workflows!==null&&!Array.isArray(t.workflows)?t.workflows:t}function We(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e;if(Array.isArray(t.type_workflows))return t.type_workflows}function h(e,t,r){let s=t?.trim()||r;return ee.isAbsolute(s)?s:ee.join(e,s)}function ct(e,t){return h(e,t.files.types,p.types)}async function mt(e,t){let r=I(t),s=[{path:h(e,r.files.types,p.types),seed:{definitions:[]}},{path:h(e,r.files.statuses,p.statuses),seed:{statuses:L}},{path:h(e,r.files.fields,p.fields),seed:{fields:[]}},{path:h(e,r.files.workflows,p.workflows),seed:{workflow:se}}],n=[];for(let i of s)await J(i.path)||await Q(i.path,`${JSON.stringify(i.seed,null,2)}
2
2
  `)&&n.push(i.path);return{created_paths:n}}async function yt(e,t){let r=I(t),s=[],n=h(e,r.files.types,p.types),i=h(e,r.files.statuses,p.statuses),a=h(e,r.files.fields,p.fields),l=h(e,r.files.workflows,p.workflows),o,d,f,u,w,g=async(v,le)=>{let j=await H(v);if(j!==null)return xe(j,le,s)},A=await g(n,"runtime_schema_types_invalid_json");A!==void 0&&(o=$e(A),o===void 0&&s.push("runtime_schema_types_invalid_shape"));let b=await g(i,"runtime_schema_statuses_invalid_json");b!==void 0&&(d=Pe(b),d===void 0&&s.push("runtime_schema_statuses_invalid_shape"));let E=await g(a,"runtime_schema_fields_invalid_json");E!==void 0&&(f=qe(E),f===void 0&&s.push("runtime_schema_fields_invalid_shape"));let c=await g(l,"runtime_schema_workflows_invalid_json");return c!==void 0&&(u=Ve(c),u===void 0&&s.push("runtime_schema_workflows_invalid_shape"),w=We(c)),{schema:I({...r,statuses:[...r.statuses,...d??[]],fields:[...r.fields,...f??[]],workflow:{...r.workflow,...u},type_workflows:[...r.type_workflows??[],...w??[]]}),type_definitions_from_file:o,warnings:s,created_paths:[]}}function F(e,t,r,s=!1){let n=r.map(a=>m(a)).filter(a=>typeof a=="string").find(a=>e.some(l=>l.id===a));if(s&&n!==void 0)return n;let i=e.find(a=>a.roles.includes(t));return i!==void 0?i.id:n??e[0]?.id}function Ke(e){let t=new Map,r=new Map;for(let s of e){r.set(s.id,s),t.set(s.id,s.id),t.set(s.id.replaceAll("_","-"),s.id),t.set(s.id.replaceAll("_"," "),s.id);for(let n of s.aliases)t.set(n,s.id),t.set(n.replaceAll("_","-"),s.id),t.set(n.replaceAll("_"," "),s.id)}return{aliasToId:t,byId:r}}function Ge(e){let t={activeStatuses:new Set,blockedStatuses:new Set,draftStatuses:new Set,terminalCanceledStatuses:new Set,terminalDoneStatuses:new Set,terminalStatuses:new Set};for(let r of e){let s=new Set(r.roles);(s.has("terminal")||s.has("terminal_done")||s.has("terminal_canceled"))&&t.terminalStatuses.add(r.id),s.has("terminal_done")&&t.terminalDoneStatuses.add(r.id),s.has("terminal_canceled")&&t.terminalCanceledStatuses.add(r.id),s.has("active")&&t.activeStatuses.add(r.id),s.has("blocked")&&t.blockedStatuses.add(r.id),s.has("draft")&&t.draftStatuses.add(r.id)}return t}function _t(e){let t=I(e),r=t.statuses.map((c,v)=>M(c,v)).filter(c=>c!==null),{aliasToId:s,byId:n}=Ke(r),{activeStatuses:i,blockedStatuses:a,draftStatuses:l,terminalCanceledStatuses:o,terminalDoneStatuses:d,terminalStatuses:f}=Ge(r),u=t.workflow,w=m(u.open_status)??F(r,"default_open",["open","in_progress",C[0]]),g=m(u.in_progress_status)??F(r,"active",["in_progress","in-progress",w],!0),A=m(u.blocked_status)??F(r,"blocked",["blocked"]),b=m(u.close_status)??F(r,"default_close",["closed","done","complete"]),E=m(u.canceled_status)??F(r,"default_cancel",["canceled","cancelled"]);return{definitions:r,by_id:n,alias_to_id:s,terminal_statuses:f,terminal_done_statuses:d,terminal_canceled_statuses:o,active_statuses:i,blocked_statuses:a,draft_statuses:l,open_status:w,in_progress_status:g,blocked_status:A,close_status:b,canceled_status:E}}function Je(e,t){let r=S(e);if(r)return t.alias_to_id.get(r)}function pt(e){let t=I(e),r=new Map,s=t.fields.map(o=>ae(o)).filter(o=>o!==null);for(let o of s)r.set(o.key,o);let n=[...r.values()].sort((o,d)=>o.key.localeCompare(d.key)),i=new Map,a=new Map,l=new Map;for(let o of n){i.set(o.key,o),a.set(o.cli_flag,o);for(let d of o.cli_aliases)a.set(d,o);for(let d of o.commands){let f=l.get(d)??[];f.push(o),l.set(d,f)}}for(let[o,d]of l.entries())d.sort((f,u)=>f.key.localeCompare(u.key)),l.set(o,d);return{definitions:n,by_key:i,by_cli_token:a,command_to_fields:l}}function wt(e){return ze(e.key)}function ht(e,t){let r=Je(e,t);return r?t.terminal_statuses.has(r):!1}export{D as a,Be as b,Ze as c,Qe as d,S as e,Q as f,p as g,L as h,I as i,h as j,ct as k,mt as l,yt as m,_t as n,Je as o,pt as p,wt as q,ht as r};
3
- //# sourceMappingURL=chunk-F2ME5MJY.js.map
3
+ //# sourceMappingURL=chunk-PBCYGO7X.js.map
@@ -1,3 +1,3 @@
1
- import{e as c}from"./chunk-F2ME5MJY.js";import{Ta as w,Ua as u,o as d}from"./chunk-L3CZNKZE.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]="158d5065-075c-5355-a65c-f3edc9c5f1f0")}catch{}})();var _=new Map(d.map(e=>[e.toLowerCase(),e])),$=/^[A-Za-z][A-Za-z0-9_-]*$/;function g(e,t){if(!$.test(e))throw new Error(`${t} "${e}" is not a valid identifier. Use a single letter-led token of letters, digits, hyphen, or underscore with no spaces or punctuation (e.g. "Spike" or "code-review").`)}function y(e){return _.get(e.trim().toLowerCase())}function A(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function I(e){return e.replace(/[\\"`$]/g,t=>`\\${t}`)}function b(e){let t=new Map;for(let o of e){let n=o.trim();if(n.length===0)continue;let i=n.toLowerCase();t.has(i)||t.set(i,n)}return[...t.values()].sort((o,n)=>o.localeCompare(n))}function S(e){let t=(e.name??"").trim();if(t.length===0)throw new Error("Type name must not be empty.");g(t,"Type name");let o=y(t);if(o)throw new Error(`Cannot redefine built-in item type "${o}". Built-in types are reserved: ${d.join(", ")}.`);let n=e.description?.trim(),i=e.defaultStatus?.trim(),r=e.folder?.trim(),a=r&&r.length>0?u(r):void 0,s=b(e.aliases??[]);for(let l of s){g(l,"Alias");let f=y(l);if(f)throw new Error(`Alias "${l}" collides with built-in item type "${f}". Built-in types are reserved: ${d.join(", ")}.`)}return{name:t,description:n&&n.length>0?n:void 0,defaultStatus:i&&i.length>0?i:void 0,folder:a,aliases:s}}function x(e,t){let o=e.name.toLowerCase(),n=new Map;for(let r of t.definitions){if(typeof r.name!="string")continue;let a=r.name.trim();if(!(a.length===0||a.toLowerCase()===o)){n.set(a.toLowerCase(),a);for(let s of A(r.aliases))s.trim().length>0&&n.set(s.trim().toLowerCase(),a)}}let i=n.get(o);if(i)throw new Error(`Type name "${e.name}" collides with an alias of existing item type "${i}".`);for(let r of e.aliases){let a=n.get(r.toLowerCase());if(a)throw new Error(`Alias "${r}" already maps to existing item type "${a}".`)}}function h(e,t){return typeof t=="string"&&t.trim().length>0?u(t).toLowerCase():w(e).toLowerCase()}function D(e,t,o){let n=e.name.toLowerCase(),i=h(e.name,e.folder),r=s=>{throw new Error(`Item type "${e.name}" would store items in folder "${i}", which already belongs to existing item type "${s}". Pass a distinct --folder to keep their storage separate.`)};for(let s of t.definitions){if(typeof s.name!="string")continue;let l=s.name.trim();l.length===0||l.toLowerCase()===n||h(l,s.folder)===i&&r(l)}let a=o?.get(i);a!==void 0&&a.toLowerCase()!==n&&r(a)}function j(e){if(e==null||e.trim().length===0)return{definitions:[]};let t;try{t=JSON.parse(e)}catch{throw new Error("schema/types.json contains invalid JSON.")}return{definitions:L(t)}}function L(e){let t=C(e);if(!t)return[];let o=[];for(let n of t){if(typeof n!="object"||n===null||Array.isArray(n))continue;let i=n;typeof i.name!="string"||i.name.trim().length===0||o.push(i)}return o}function C(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.definitions))return t.definitions;if(typeof t.item_types=="object"&&t.item_types!==null){let o=t.item_types;if(Array.isArray(o.definitions))return o.definitions}}function z(e,t){let o=t.name.toLowerCase(),n=e.definitions.slice(),i=n.findIndex(l=>typeof l.name=="string"&&l.name.trim().toLowerCase()===o),r=i>=0?n[i]:void 0,a=b([...A(r?.aliases),...t.aliases]),s={...r,name:t.name};return t.folder!==void 0&&(s.folder=t.folder),a.length>0?s.aliases=a:s.aliases!==void 0&&delete s.aliases,T(s,"description",t.description),T(s,"default_status",t.defaultStatus),i>=0?n[i]=s:n.push(s),n.sort((l,f)=>l.name.localeCompare(f.name)),{file:{definitions:n},definition:s,replaced:i>=0,...r&&typeof r.name=="string"?{previousName:r.name}:{}}}function F(e,t){let o=(t??"").trim();if(o.length===0)throw new Error("Type name must not be empty.");let n=y(o);if(n)throw new Error(`Cannot remove built-in item type "${n}". Built-in types are reserved: ${d.join(", ")}.`);let i=o.toLowerCase(),r=e.definitions.slice(),a=r.findIndex(l=>typeof l.name=="string"&&l.name.trim().toLowerCase()===i);if(a<0)return{file:{definitions:r},removed:!1};let[s]=r.splice(a,1);return{file:{definitions:r},removed:!0,definition:s}}function T(e,t,o){let n=e;o!==void 0&&(n[t]=o)}function M(e){return`${JSON.stringify({definitions:e.definitions},null,2)}
1
+ import{e as c}from"./chunk-PBCYGO7X.js";import{Ta as w,Ua as u,o as d}from"./chunk-B3YW6H2I.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]="158d5065-075c-5355-a65c-f3edc9c5f1f0")}catch{}})();var _=new Map(d.map(e=>[e.toLowerCase(),e])),$=/^[A-Za-z][A-Za-z0-9_-]*$/;function g(e,t){if(!$.test(e))throw new Error(`${t} "${e}" is not a valid identifier. Use a single letter-led token of letters, digits, hyphen, or underscore with no spaces or punctuation (e.g. "Spike" or "code-review").`)}function y(e){return _.get(e.trim().toLowerCase())}function A(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function I(e){return e.replace(/[\\"`$]/g,t=>`\\${t}`)}function b(e){let t=new Map;for(let o of e){let n=o.trim();if(n.length===0)continue;let i=n.toLowerCase();t.has(i)||t.set(i,n)}return[...t.values()].sort((o,n)=>o.localeCompare(n))}function S(e){let t=(e.name??"").trim();if(t.length===0)throw new Error("Type name must not be empty.");g(t,"Type name");let o=y(t);if(o)throw new Error(`Cannot redefine built-in item type "${o}". Built-in types are reserved: ${d.join(", ")}.`);let n=e.description?.trim(),i=e.defaultStatus?.trim(),r=e.folder?.trim(),a=r&&r.length>0?u(r):void 0,s=b(e.aliases??[]);for(let l of s){g(l,"Alias");let f=y(l);if(f)throw new Error(`Alias "${l}" collides with built-in item type "${f}". Built-in types are reserved: ${d.join(", ")}.`)}return{name:t,description:n&&n.length>0?n:void 0,defaultStatus:i&&i.length>0?i:void 0,folder:a,aliases:s}}function x(e,t){let o=e.name.toLowerCase(),n=new Map;for(let r of t.definitions){if(typeof r.name!="string")continue;let a=r.name.trim();if(!(a.length===0||a.toLowerCase()===o)){n.set(a.toLowerCase(),a);for(let s of A(r.aliases))s.trim().length>0&&n.set(s.trim().toLowerCase(),a)}}let i=n.get(o);if(i)throw new Error(`Type name "${e.name}" collides with an alias of existing item type "${i}".`);for(let r of e.aliases){let a=n.get(r.toLowerCase());if(a)throw new Error(`Alias "${r}" already maps to existing item type "${a}".`)}}function h(e,t){return typeof t=="string"&&t.trim().length>0?u(t).toLowerCase():w(e).toLowerCase()}function D(e,t,o){let n=e.name.toLowerCase(),i=h(e.name,e.folder),r=s=>{throw new Error(`Item type "${e.name}" would store items in folder "${i}", which already belongs to existing item type "${s}". Pass a distinct --folder to keep their storage separate.`)};for(let s of t.definitions){if(typeof s.name!="string")continue;let l=s.name.trim();l.length===0||l.toLowerCase()===n||h(l,s.folder)===i&&r(l)}let a=o?.get(i);a!==void 0&&a.toLowerCase()!==n&&r(a)}function j(e){if(e==null||e.trim().length===0)return{definitions:[]};let t;try{t=JSON.parse(e)}catch{throw new Error("schema/types.json contains invalid JSON.")}return{definitions:L(t)}}function L(e){let t=C(e);if(!t)return[];let o=[];for(let n of t){if(typeof n!="object"||n===null||Array.isArray(n))continue;let i=n;typeof i.name!="string"||i.name.trim().length===0||o.push(i)}return o}function C(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.definitions))return t.definitions;if(typeof t.item_types=="object"&&t.item_types!==null){let o=t.item_types;if(Array.isArray(o.definitions))return o.definitions}}function z(e,t){let o=t.name.toLowerCase(),n=e.definitions.slice(),i=n.findIndex(l=>typeof l.name=="string"&&l.name.trim().toLowerCase()===o),r=i>=0?n[i]:void 0,a=b([...A(r?.aliases),...t.aliases]),s={...r,name:t.name};return t.folder!==void 0&&(s.folder=t.folder),a.length>0?s.aliases=a:s.aliases!==void 0&&delete s.aliases,T(s,"description",t.description),T(s,"default_status",t.defaultStatus),i>=0?n[i]=s:n.push(s),n.sort((l,f)=>l.name.localeCompare(f.name)),{file:{definitions:n},definition:s,replaced:i>=0,...r&&typeof r.name=="string"?{previousName:r.name}:{}}}function F(e,t){let o=(t??"").trim();if(o.length===0)throw new Error("Type name must not be empty.");let n=y(o);if(n)throw new Error(`Cannot remove built-in item type "${n}". Built-in types are reserved: ${d.join(", ")}.`);let i=o.toLowerCase(),r=e.definitions.slice(),a=r.findIndex(l=>typeof l.name=="string"&&l.name.trim().toLowerCase()===i);if(a<0)return{file:{definitions:r},removed:!1};let[s]=r.splice(a,1);return{file:{definitions:r},removed:!0,definition:s}}function T(e,t,o){let n=e;o!==void 0&&(n[t]=o)}function M(e){return`${JSON.stringify({definitions:e.definitions},null,2)}
2
2
  `}function E(e,t){let o=e.trim().length>0?e.trim():e,n=t?.trim()||".agents/pm/schema/types.json";return`To register a custom type, run: pm schema add-type "${I(o)}" (writes ${n}).`}function O(e,t,o){return`Invalid type value "${e}". Allowed: ${t.join(", ")}. ${E(e,o)}`}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="be646cfd-4742-5e15-9df1-648f1d250a99")}catch{}})();function v(e){return typeof e=="string"?e.trim().toLowerCase():""}function m(e,t){let o=c(e);return o.length===0?"":t?.alias_to_id?.get(o)??o}function U(e){let t=Array.isArray(e?.type_workflows)?e.type_workflows:[],o=new Map;for(let n of t){let i=v(n?.type);if(i.length===0||!Array.isArray(n?.allowed_transitions))continue;let r=n.allowed_transitions,a=o.get(i)??{pairs:[],denyAll:!1};r.length===0&&(a.denyAll=!0);for(let s of r){if(!Array.isArray(s)||s.length!==2)continue;let l=c(s[0]),f=c(s[1]);l.length===0||f.length===0||a.pairs.some(p=>p[0]===l&&p[1]===f)||a.pairs.push([l,f])}o.set(i,a)}return[...o.entries()].filter(([,n])=>n.pairs.length>0||n.denyAll).map(([n,i])=>({type:n,allowed_transitions:i.pairs})).sort((n,i)=>n.type.localeCompare(i.type))}function J(e){let t=v(e.typeName),o=e.typeWorkflows.find(r=>r.type===t);if(!o)return{allowed:!0,hasRule:!1,allowedTransitions:[]};let n=m(e.fromStatus,e.statusRegistry),i=m(e.toStatus,e.statusRegistry);return n.length>0&&n===i?{allowed:!0,hasRule:!0,allowedTransitions:o.allowed_transitions}:{allowed:o.allowed_transitions.some(r=>{let a=m(r[0],e.statusRegistry),s=m(r[1],e.statusRegistry);return a===n&&s===i}),hasRule:!0,allowedTransitions:o.allowed_transitions}}function W(e){return e.length===0?"(no transitions allowed)":e.map(t=>`${t[0]} -> ${t[1]}`).join(", ")}export{y as a,I as b,S as c,x as d,D as e,j as f,z as g,F as h,M as i,O as j,U as k,J as l,W as m};
3
- //# sourceMappingURL=chunk-PBPPIGUL.js.map
3
+ //# sourceMappingURL=chunk-PLTTMQAW.js.map
@@ -1,8 +1,8 @@
1
- import{r as D,s as q}from"./chunk-EOUORVJA.js";import{Yb as N,cc as z,ec as _}from"./chunk-OSKXYRYZ.js";import{fd as C,fe as x,id as L,ka as k,ld as j,pa as m,tb as O,ua as b,ya as S}from"./chunk-L3CZNKZE.js";import{constants as p}from"node:fs";import{lstat as M,mkdir as $,open as F}from"node:fs/promises";import h from"node:path";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new r.Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="5434ff6f-95af-5983-88cb-fd360d95cb9e")}catch{}})();function E(r,e){if(typeof r!="string"||r.trim().length===0)throw new TypeError(`Relationship event ${e} must be non-empty`);return r.trim()}function I(r,e){let t=e.require(r.kind),i=t.direction==="undirected"?[r.source,r.target].sort().join("\0"):`${r.source}\0${r.target}`;return`${t.kind}\0${i}`}function H(r){return Object.freeze({...r,...r.payload===void 0?{}:{payload:Object.freeze(structuredClone(r.payload))}})}function J(r,e,t,i){let n=t.require(r.kind),o=i.outgoingOne.get(`${n.kind}\0${r.source}`);if(o!==void 0&&o!==e)throw new TypeError(`Relationship outgoing cardinality exceeded for ${n.kind}`);let s=i.incomingOne.get(`${n.kind}\0${r.target}`);if(s!==void 0&&s!==e)throw new TypeError(`Relationship incoming cardinality exceeded for ${n.kind}`);let c=I(r,t),a=i.identities.get(c);if(a!==void 0&&a!==e)throw new TypeError(`Relationship edge already active: ${c}`)}function K(r){let e=new Map;for(let t of r)t.action==="remove"?e.delete(t.relationshipId):e.set(t.relationshipId,t.edge);return e}function G(r,e,t){if(r.expectedVersion!==void 0&&r.expectedVersion!==e)throw new TypeError(`Relationship event version conflict: expected ${r.expectedVersion}, current ${e}`);let i=E(r.eventId,"eventId");if(t.has(i))throw new TypeError(`Relationship event already exists: ${i}`);if(r.action!=="add"&&r.action!=="remove"&&r.action!=="supersede")throw new TypeError(`Unknown relationship event action: ${r.action}`);if(!Number.isFinite(Date.parse(r.timestamp)))throw new TypeError("Relationship event timestamp must be valid");return{eventId:i,relationshipId:E(r.relationshipId,"relationshipId"),author:E(r.author,"author"),timestamp:new Date(r.timestamp).toISOString()}}function Q(r,e,t,i,n,o){let s=t.has(e);if(r.action==="add"&&s)throw new TypeError(`Relationship is already active: ${e}`);if(r.action!=="add"&&!s)throw new TypeError(`Relationship is not active: ${e}`);if(r.action==="remove")return;if(!r.edge)throw new TypeError(`Relationship ${r.action} event requires an edge`);let c=typeof r.edge.source=="string"?r.edge.source.trim():"",a=typeof r.edge.target=="string"?r.edge.target.trim():"";if(!i.has(c)||!i.has(a))throw new TypeError(`Relationship endpoint not found: ${c} -> ${a}`);let d=new m([c,a],[r.edge],n).edges()[0];return J(d,e,n,o),H(d)}var T=class{#t;#i;#r=[];#o=new Set;#e=new Map;#n={identities:new Map,outgoingOne:new Map,incomingOne:new Map};constructor(e,t={}){this.#t=new Set([...e].filter(i=>typeof i=="string").map(i=>i.trim()).filter(Boolean)),this.#i=t.registry??k()}get version(){return this.#r.length}events(){return Object.freeze([...this.#r])}*stream(e={}){let t=e.fromVersion??1,i=e.toVersion??this.version,n=e.batchSize??100;if(!Number.isInteger(t)||t<1)throw new TypeError("Relationship event stream fromVersion must be positive");if(!Number.isInteger(i)||i<0||i>this.version)throw new TypeError(`Relationship event stream toVersion out of range: ${i}`);if(!Number.isInteger(n)||n<1)throw new TypeError("Relationship event stream batchSize must be positive");if(t>i+1)throw new TypeError("Relationship event stream fromVersion exceeds the selected prefix");for(let o=t-1;o<i;o+=n)yield Object.freeze(this.#r.slice(o,Math.min(o+n,i)))}project(e,t,i={}){if(typeof t!="function")throw new TypeError("Relationship event projection requires a reducer");let n=e,o=0,s;for(let c of this.stream({...i,batchSize:256}))for(let a of c)n=t(n,a),o+=1,s=a;return Object.freeze({state:n,version:s?.sequence??Math.max(0,(i.fromVersion??1)-1),processed:o,...s===void 0?{}:{asOf:s.timestamp}})}#s(e,t){let i=this.#i.require(t.kind);this.#n.identities.set(I(t,this.#i),e),i.outgoing==="one"&&this.#n.outgoingOne.set(`${i.kind}\0${t.source}`,e),i.incoming==="one"&&this.#n.incomingOne.set(`${i.kind}\0${t.target}`,e)}#a(e){let t=this.#i.require(e.kind);this.#n.identities.delete(I(e,this.#i)),t.outgoing==="one"&&this.#n.outgoingOne.delete(`${t.kind}\0${e.source}`),t.incoming==="one"&&this.#n.incomingOne.delete(`${t.kind}\0${e.target}`)}append(e){let t=G(e,this.version,this.#o),i=this.#e.get(t.relationshipId),n=Q(e,t.relationshipId,this.#e,this.#t,this.#i,this.#n),o=Object.freeze({eventId:t.eventId,relationshipId:t.relationshipId,action:e.action,...n===void 0?{}:{edge:n},author:t.author,timestamp:t.timestamp,...e.reason?.trim()?{reason:e.reason.trim()}:{},sequence:this.version+1});return this.#r.push(o),this.#o.add(t.eventId),i&&this.#a(i),e.action==="remove"?this.#e.delete(t.relationshipId):(this.#e.set(t.relationshipId,n),this.#s(t.relationshipId,n)),o}snapshot(e={}){if(e.atVersion!==void 0&&e.atTimestamp!==void 0)throw new TypeError("Relationship snapshot accepts one target");let t;if(e.atTimestamp!==void 0){let o=Date.parse(e.atTimestamp);if(!Number.isFinite(o))throw new TypeError("Relationship snapshot timestamp must be valid");t=this.#r.filter(s=>Date.parse(s.timestamp)<=o)}else{let o=e.atVersion??this.version;if(!Number.isInteger(o)||o<0||o>this.version)throw new TypeError(`Relationship snapshot version out of range: ${o}`);t=this.#r.slice(0,o)}let i=K(t),n=new m(this.#t,i.values(),this.#i);return Object.freeze({version:t.at(-1)?.sequence??0,...t.at(-1)?{asOf:t.at(-1).timestamp}:{},edges:n.edges(),graph:n})}page(e){if(!Number.isInteger(e.limit)||e.limit<1)throw new TypeError("Relationship event page limit must be positive");let t=C("relationship-events",{order:"append-sequence"}),i=e.cursor===void 0?this.version:Number(L(e.cursor,t).snapshot);if(!Number.isSafeInteger(i)||i<0||i>this.version)throw new TypeError("Relationship event cursor snapshot version is invalid");let n=j(this.#r.slice(0,i),{cursor:e.cursor,fingerprint:t,limit:e.limit,readId:o=>o.eventId,snapshot:String(i)});return{version:i,events:n.rows,hasMore:n.has_more,...n.next_cursor?{nextCursor:n.next_cursor}:{}}}},Y="relationship-event-store",A=p.O_NOFOLLOW;function g(r){return x(r,Y,30,`relationship-store:${process.pid}`,!1,!1,3e3)}async function f(r,e="relationships/events.jsonl"){let t=h.resolve(r),i=h.resolve(t,e),n=h.relative(t,i);if(n.length===0)throw new TypeError("Relationship event path must name a file within the tracker root");if(n===".."||n.startsWith(`..${h.sep}`)||h.isAbsolute(n))throw new TypeError("Relationship event path must stay within the tracker root");if(await $(t,{recursive:!0}),(await M(t)).isSymbolicLink())throw new TypeError("Relationship event tracker root must not be a symbolic link");let o=t;for(let s of n.split(h.sep)){o=h.join(o,s);try{if((await M(o)).isSymbolicLink())throw new TypeError("Relationship event path must not contain symbolic links")}catch(c){if(b(c))break;throw c}}return i}async function w(r,e,t){let i=new T(e,{registry:t}),n,o;try{o=await F(r,p.O_RDONLY|A),n=await o.readFile("utf8")}catch(c){if(b(c))return{log:i,raw:""};throw c}finally{await o?.close()}let s=n.split(`
1
+ import{r as D,s as q}from"./chunk-362645PL.js";import{Yb as N,cc as z,ec as _}from"./chunk-MCVWZUGK.js";import{fd as C,fe as x,id as L,ka as k,ld as j,pa as m,tb as O,ua as b,ya as S}from"./chunk-B3YW6H2I.js";import{constants as p}from"node:fs";import{lstat as M,mkdir as $,open as F}from"node:fs/promises";import h from"node:path";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new r.Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="5434ff6f-95af-5983-88cb-fd360d95cb9e")}catch{}})();function E(r,e){if(typeof r!="string"||r.trim().length===0)throw new TypeError(`Relationship event ${e} must be non-empty`);return r.trim()}function I(r,e){let t=e.require(r.kind),i=t.direction==="undirected"?[r.source,r.target].sort().join("\0"):`${r.source}\0${r.target}`;return`${t.kind}\0${i}`}function H(r){return Object.freeze({...r,...r.payload===void 0?{}:{payload:Object.freeze(structuredClone(r.payload))}})}function J(r,e,t,i){let n=t.require(r.kind),o=i.outgoingOne.get(`${n.kind}\0${r.source}`);if(o!==void 0&&o!==e)throw new TypeError(`Relationship outgoing cardinality exceeded for ${n.kind}`);let s=i.incomingOne.get(`${n.kind}\0${r.target}`);if(s!==void 0&&s!==e)throw new TypeError(`Relationship incoming cardinality exceeded for ${n.kind}`);let c=I(r,t),a=i.identities.get(c);if(a!==void 0&&a!==e)throw new TypeError(`Relationship edge already active: ${c}`)}function K(r){let e=new Map;for(let t of r)t.action==="remove"?e.delete(t.relationshipId):e.set(t.relationshipId,t.edge);return e}function G(r,e,t){if(r.expectedVersion!==void 0&&r.expectedVersion!==e)throw new TypeError(`Relationship event version conflict: expected ${r.expectedVersion}, current ${e}`);let i=E(r.eventId,"eventId");if(t.has(i))throw new TypeError(`Relationship event already exists: ${i}`);if(r.action!=="add"&&r.action!=="remove"&&r.action!=="supersede")throw new TypeError(`Unknown relationship event action: ${r.action}`);if(!Number.isFinite(Date.parse(r.timestamp)))throw new TypeError("Relationship event timestamp must be valid");return{eventId:i,relationshipId:E(r.relationshipId,"relationshipId"),author:E(r.author,"author"),timestamp:new Date(r.timestamp).toISOString()}}function Q(r,e,t,i,n,o){let s=t.has(e);if(r.action==="add"&&s)throw new TypeError(`Relationship is already active: ${e}`);if(r.action!=="add"&&!s)throw new TypeError(`Relationship is not active: ${e}`);if(r.action==="remove")return;if(!r.edge)throw new TypeError(`Relationship ${r.action} event requires an edge`);let c=typeof r.edge.source=="string"?r.edge.source.trim():"",a=typeof r.edge.target=="string"?r.edge.target.trim():"";if(!i.has(c)||!i.has(a))throw new TypeError(`Relationship endpoint not found: ${c} -> ${a}`);let d=new m([c,a],[r.edge],n).edges()[0];return J(d,e,n,o),H(d)}var T=class{#t;#i;#r=[];#o=new Set;#e=new Map;#n={identities:new Map,outgoingOne:new Map,incomingOne:new Map};constructor(e,t={}){this.#t=new Set([...e].filter(i=>typeof i=="string").map(i=>i.trim()).filter(Boolean)),this.#i=t.registry??k()}get version(){return this.#r.length}events(){return Object.freeze([...this.#r])}*stream(e={}){let t=e.fromVersion??1,i=e.toVersion??this.version,n=e.batchSize??100;if(!Number.isInteger(t)||t<1)throw new TypeError("Relationship event stream fromVersion must be positive");if(!Number.isInteger(i)||i<0||i>this.version)throw new TypeError(`Relationship event stream toVersion out of range: ${i}`);if(!Number.isInteger(n)||n<1)throw new TypeError("Relationship event stream batchSize must be positive");if(t>i+1)throw new TypeError("Relationship event stream fromVersion exceeds the selected prefix");for(let o=t-1;o<i;o+=n)yield Object.freeze(this.#r.slice(o,Math.min(o+n,i)))}project(e,t,i={}){if(typeof t!="function")throw new TypeError("Relationship event projection requires a reducer");let n=e,o=0,s;for(let c of this.stream({...i,batchSize:256}))for(let a of c)n=t(n,a),o+=1,s=a;return Object.freeze({state:n,version:s?.sequence??Math.max(0,(i.fromVersion??1)-1),processed:o,...s===void 0?{}:{asOf:s.timestamp}})}#s(e,t){let i=this.#i.require(t.kind);this.#n.identities.set(I(t,this.#i),e),i.outgoing==="one"&&this.#n.outgoingOne.set(`${i.kind}\0${t.source}`,e),i.incoming==="one"&&this.#n.incomingOne.set(`${i.kind}\0${t.target}`,e)}#a(e){let t=this.#i.require(e.kind);this.#n.identities.delete(I(e,this.#i)),t.outgoing==="one"&&this.#n.outgoingOne.delete(`${t.kind}\0${e.source}`),t.incoming==="one"&&this.#n.incomingOne.delete(`${t.kind}\0${e.target}`)}append(e){let t=G(e,this.version,this.#o),i=this.#e.get(t.relationshipId),n=Q(e,t.relationshipId,this.#e,this.#t,this.#i,this.#n),o=Object.freeze({eventId:t.eventId,relationshipId:t.relationshipId,action:e.action,...n===void 0?{}:{edge:n},author:t.author,timestamp:t.timestamp,...e.reason?.trim()?{reason:e.reason.trim()}:{},sequence:this.version+1});return this.#r.push(o),this.#o.add(t.eventId),i&&this.#a(i),e.action==="remove"?this.#e.delete(t.relationshipId):(this.#e.set(t.relationshipId,n),this.#s(t.relationshipId,n)),o}snapshot(e={}){if(e.atVersion!==void 0&&e.atTimestamp!==void 0)throw new TypeError("Relationship snapshot accepts one target");let t;if(e.atTimestamp!==void 0){let o=Date.parse(e.atTimestamp);if(!Number.isFinite(o))throw new TypeError("Relationship snapshot timestamp must be valid");t=this.#r.filter(s=>Date.parse(s.timestamp)<=o)}else{let o=e.atVersion??this.version;if(!Number.isInteger(o)||o<0||o>this.version)throw new TypeError(`Relationship snapshot version out of range: ${o}`);t=this.#r.slice(0,o)}let i=K(t),n=new m(this.#t,i.values(),this.#i);return Object.freeze({version:t.at(-1)?.sequence??0,...t.at(-1)?{asOf:t.at(-1).timestamp}:{},edges:n.edges(),graph:n})}page(e){if(!Number.isInteger(e.limit)||e.limit<1)throw new TypeError("Relationship event page limit must be positive");let t=C("relationship-events",{order:"append-sequence"}),i=e.cursor===void 0?this.version:Number(L(e.cursor,t).snapshot);if(!Number.isSafeInteger(i)||i<0||i>this.version)throw new TypeError("Relationship event cursor snapshot version is invalid");let n=j(this.#r.slice(0,i),{cursor:e.cursor,fingerprint:t,limit:e.limit,readId:o=>o.eventId,snapshot:String(i)});return{version:i,events:n.rows,hasMore:n.has_more,...n.next_cursor?{nextCursor:n.next_cursor}:{}}}},Y="relationship-event-store",A=p.O_NOFOLLOW;function g(r){return x(r,Y,30,`relationship-store:${process.pid}`,!1,!1,3e3)}async function f(r,e="relationships/events.jsonl"){let t=h.resolve(r),i=h.resolve(t,e),n=h.relative(t,i);if(n.length===0)throw new TypeError("Relationship event path must name a file within the tracker root");if(n===".."||n.startsWith(`..${h.sep}`)||h.isAbsolute(n))throw new TypeError("Relationship event path must stay within the tracker root");if(await $(t,{recursive:!0}),(await M(t)).isSymbolicLink())throw new TypeError("Relationship event tracker root must not be a symbolic link");let o=t;for(let s of n.split(h.sep)){o=h.join(o,s);try{if((await M(o)).isSymbolicLink())throw new TypeError("Relationship event path must not contain symbolic links")}catch(c){if(b(c))break;throw c}}return i}async function w(r,e,t){let i=new T(e,{registry:t}),n,o;try{o=await F(r,p.O_RDONLY|A),n=await o.readFile("utf8")}catch(c){if(b(c))return{log:i,raw:""};throw c}finally{await o?.close()}let s=n.split(`
2
2
  `);for(let c=0;c<s.length;c+=1){let a=s[c].trim();if(!a)continue;let d;try{d=JSON.parse(a)}catch{throw new TypeError(`Invalid relationship event JSONL at line ${c+1}`)}if(d.sequence!==i.version+1)throw new TypeError(`Invalid relationship event sequence at line ${c+1}`);i.append({eventId:d.eventId,relationshipId:d.relationshipId,action:d.action,...d.edge===void 0?{}:{edge:d.edge},author:d.author,timestamp:d.timestamp,...d.reason===void 0?{}:{reason:d.reason},expectedVersion:i.version})}return{log:i,raw:n}}function U(r,e,t,i){let n=Date.parse(e.timestamp),o;return e.action!=="remove"&&e.edge!==void 0&&(o=new m(t,[e.edge],i).edges()[0]),r.eventId===e.eventId.trim()&&r.relationshipId===e.relationshipId.trim()&&r.action===e.action&&r.author===e.author.trim()&&Number.isFinite(n)&&r.timestamp===new Date(n).toISOString()&&r.reason===(e.reason?.trim()||void 0)&&O(r.edge)===O(o)}var V=class r{#t;#i;#r;#o;#e;constructor(e,t,i,n){this.#t=e.pmRoot,this.#i=t,this.#r=e.registry,this.#o=i,this.#e=n}static async open(e){let t=Object.freeze([...e.nodes]),i=await f(e.pmRoot,e.relativePath),n=await g(e.pmRoot);try{await f(e.pmRoot,i);let{log:o}=await w(i,t,e.registry);return new r(e,t,i,o)}finally{await n()}}get path(){return this.#o}async currentVersion(){return this.#e=await this.#n(),this.#e.version}async append(e){let t=await g(this.#t);try{let i=await f(this.#t,this.#o),{log:n}=await w(i,this.#i,this.#r),o=n.append(e);await $(h.dirname(i),{recursive:!0}),await f(this.#t,i);let s=await F(i,p.O_APPEND|p.O_CREAT|p.O_WRONLY|A);try{await s.appendFile(`${JSON.stringify(o)}
3
3
  `,"utf8")}finally{await s.close()}return this.#e=n,o}finally{await t()}}async appendBatch(e,t={}){let i=await g(this.#t);try{let n=await f(this.#t,this.#o),{log:o,raw:s}=await w(n,this.#i,this.#r),c=o.version,a=new Map(o.events().map(l=>[l.eventId,l])),d=[],R=[];for(let l of e){let u=l.eventId.trim(),v=a.get(u);if(v!==void 0){if(t.existingEventPolicy==="skip_identical"&&U(v,l,this.#i,this.#r)){R.push(v.eventId);continue}if(t.existingEventPolicy==="skip_identical")throw new TypeError(`Relationship event id collision with different content: ${u}`)}let y=o.append(l);a.set(y.eventId,y),d.push(y)}if(d.length>0){let l=s.length===0||s.endsWith(`
4
4
  `)?s:`${s}
5
5
  `;await $(h.dirname(n),{recursive:!0}),await f(this.#t,n),await S(n,`${l}${d.map(u=>JSON.stringify(u)).join(`
6
6
  `)}
7
7
  `)}return this.#e=o,Object.freeze({version_before:c,version_after:o.version,appended:Object.freeze(d),skipped_event_ids:Object.freeze(R)})}finally{await i()}}async snapshot(e={}){return this.#e=await this.#n(),this.#e.snapshot(e)}async page(e){return this.#e=await this.#n(),this.#e.page(e)}async*stream(e={}){this.#e=await this.#n(),yield*this.#e.stream(e)}async project(e,t,i={}){return this.#e=await this.#n(),this.#e.project(e,t,i)}async#n(){let e=await g(this.#t);try{let t=await f(this.#t,this.#o);return(await w(t,this.#i,this.#r)).log}finally{await e()}}};(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new r.Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="73852fdf-f072-51ab-9449-d7922712eeb4")}catch{}})();function P(r){return[...r].sort().join("\0")}function X(r,e,t){let i=r.successors.get(e);i?i.push(t):r.successors.set(e,[t]);let n=r.predecessors.get(t);n?n.push(e):r.predecessors.set(t,[e])}function W(r,e,t,i,n){let o=e.resolve(n);if(o?.ordering!==!0)return;let s=z(i),c=s===void 0?void 0:r.canonicalIds.get(s.toLowerCase());if(c===void 0)return;let a=(o.precedence??"source_before_target")==="source_before_target";X(r,a?t:c,a?c:t)}function Z(r,e){let t={successors:new Map,predecessors:new Map,canonicalIds:new Map},i=r.filter(n=>typeof n?.id=="string"&&n.id.trim().length>0);for(let n of i){let o=n.id.trim();t.canonicalIds.set(o.toLowerCase(),o)}for(let n of i){let o=n.id.trim();W(t,e,o,n.blocked_by,"blocked_by");for(let s of n.dependencies??[])typeof s!="object"||s===null||W(t,e,o,s.id,typeof s.kind=="string"?s.kind:"related")}for(let n of[t.successors,t.predecessors])for(let o of n.values())o.sort();return t}function ee(r,e){let t=new Set([e]),i=[e];for(;i.length>0;){let n=i.pop();for(let o of[r.successors,r.predecessors])for(let s of o.get(n)??[])t.has(s)||(t.add(s),i.push(s))}return t}function te(r,e){let t=new Map;for(let i of e){let n=(r.successors.get(i)??[]).filter(o=>e.has(o));n.length>0&&t.set(i,n)}return t}function B(r,e,t){let i=Z(r,e),n=i.canonicalIds.get(t.trim().toLowerCase());if(n===void 0)return{cycles:[],successors:new Map,canonical:t};let o=te(i,ee(i,n));return{cycles:D(o).filter(s=>s.includes(n)),successors:o,canonical:n}}function ie(r,e,t){let i=new Set(e),n=i.has(t)?t:e[0];if(r.get(n)?.includes(n))return[n,n];for(let o of r.get(n)??[]){if(!i.has(o))continue;let s=re(r,i,n,o);if(s)return s}return[...e,e[0]]}function re(r,e,t,i){let n=[[i]],o=new Set([t,i]);for(;n.length>0;){let s=n.shift(),c=s.at(-1);for(let a of r.get(c)??[]){if(a===t)return[t,...s,t];!e.has(a)||o.has(a)||(o.add(a),n.push([...s,a]))}}}function me(r,e,t){let i=N(),n=B(r,i,t),o=B(e,i,t),s=new Set(n.cycles.map(P)),c=new Set(_(r,void 0,i).map(a=>`${a.holder_id.toLowerCase()}\0${a.target_id.toLowerCase()}\0${a.dependency_kind}`));return[..._(e,void 0,i).filter(a=>a.holder_id.toLowerCase()===t.trim().toLowerCase()&&!c.has(`${a.holder_id.toLowerCase()}\0${a.target_id.toLowerCase()}\0${a.dependency_kind}`)).map(a=>`ordering_storage_contradiction_created:${q(a)}:remove_contradicting_dependency_row:run_pm_graph_audit`),...o.cycles.filter(a=>!s.has(P(a))).map(a=>`ordering_cycle_created:${ie(o.successors,a,o.canonical).join(" -> ")}:items_will_not_be_ready:run_pm_graph_audit`)]}export{T as a,V as b,me as c};
8
- //# sourceMappingURL=chunk-OLCJ2PJS.js.map
8
+ //# sourceMappingURL=chunk-SAN3KPX4.js.map
@@ -1,6 +1,6 @@
1
- import{c as k}from"./chunk-PBPPIGUL.js";import{e as a,h as w}from"./chunk-F2ME5MJY.js";import{$ as f,Ba as A,P as S,aa as u,r as g,s as _,sa as y,t as b}from"./chunk-L3CZNKZE.js";import x from"node:fs/promises";import p 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]="74b72dd8-0877-55a4-9c80-d043f19e1f96")}catch{}})();var M=["extensions","docs","examples","assets","prompts"],P=Object.freeze({extensions:Object.freeze([".agents/pm/extensions","extensions",".custom/pm-extensions",".custom/pm-extension"]),docs:Object.freeze(["docs","documentation"]),examples:Object.freeze(["examples","docs/examples"]),assets:Object.freeze(["assets",".agents/pm/assets"]),prompts:Object.freeze(["prompts",".agents/pm/prompts"])});function U(e){return M.includes(e)}function R(e,t){if(t==null)return[];let n=Array.isArray(t)?t:[t],r=[];for(let o of n){if(typeof o!="string"||o.trim().length===0)throw new u(`Package manifest field pm.${e} must contain string paths.`,f.USAGE);r.push(o.trim())}return[...new Set(r)].sort((o,i)=>o.localeCompare(i))}function q(e){if(e==null)return{};if(typeof e!="object"||Array.isArray(e))throw new u("Package manifest field pm must be an object.",f.USAGE);let t={},n=e;for(let[r,o]of Object.entries(n)){if(!U(r))continue;let i=R(r,o);i.length>0&&(t[r]=i)}return t}function d(e,t){let n=e[t];return typeof n=="string"&&n.trim().length>0?n.trim():void 0}function v(e){if(!Array.isArray(e))return;let t=e.map(n=>typeof n=="string"?n.trim():"").filter(n=>n.length>0);return t.length>0?[...new Set(t)].sort((n,r)=>n.localeCompare(r)):void 0}function T(e){if(typeof e=="string"&&e.trim().length>0)return e.trim();if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let t=e.url;return typeof t=="string"&&t.trim().length>0?t.trim():void 0}}function G(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={docs:d(t,"docs"),npm:d(t,"npm"),repository:d(t,"repository"),report:d(t,"report")};return Object.values(n).some(r=>typeof r=="string")?n:void 0}function J(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={image:d(t,"image"),video:d(t,"video")};return Object.values(n).some(r=>typeof r=="string")?n:void 0}function K(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={display_name:d(t,"display_name")??d(t,"displayName"),category:d(t,"category"),summary:d(t,"summary"),links:G(t.links),media:J(t.media),tags:v(t.tags)};return Object.values(n).some(r=>r!==void 0)?n:void 0}async function V(e){let t=p.join(e,"package.json");if(!await y(t))return{source:"convention",resources:{}};let n;try{n=JSON.parse(await x.readFile(t,"utf8"))}catch(l){throw new u(`Failed to parse package manifest at "${t}": ${String(l)}`,f.USAGE)}if(typeof n!="object"||n===null||Array.isArray(n))throw new u(`Package manifest at "${t}" must be a JSON object.`,f.USAGE);let r=n,o=r.pm,i=o!=null,s=typeof o=="object"&&o!==null&&!Array.isArray(o)?o:{};return{source:i?"pm":"convention",package_json_path:t,package_name:typeof r.name=="string"?r.name:void 0,package_version:typeof r.version=="string"?r.version:void 0,package_private:r.private===!0,package_description:typeof r.description=="string"?r.description:void 0,package_keywords:v(r.keywords),package_homepage:typeof r.homepage=="string"?r.homepage:void 0,package_repository_url:T(r.repository),package_bugs_url:T(r.bugs),aliases:v(s.aliases),resources:q(o),catalog:K(s.catalog)}}async function I(e){if(!await y(e))return[];let t=await x.readdir(e,{withFileTypes:!0}),n=[];for(let r of t){if(!r.isDirectory())continue;let o=p.join(e,r.name);await y(p.join(o,"manifest.json"))&&n.push(o)}return n.sort((r,o)=>r.localeCompare(o))}async function ge(e){if(await y(p.join(e,"manifest.json")))return[e];let t=(await V(e)).resources.extensions??[],n=new Set;for(let r of t){if(r.includes("*")||r.startsWith("!"))throw new u(`Package extension entry "${r}" uses a glob/exclusion pattern. pm package installs currently require concrete extension paths or directories.`,f.USAGE);let o=p.resolve(e,r);if(!A(e,o))throw new u(`Package extension entry "${r}" resolves outside package root.`,f.USAGE);if(await y(p.join(o,"manifest.json"))){n.add(o);continue}for(let i of await I(o))n.add(i)}if(t.length===0)for(let r of P.extensions)for(let o of await I(p.join(e,r)))n.add(o);return[...n].sort((r,o)=>r.localeCompare(o))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3984f1ef-1703-5a83-a4fa-ec1cdc738572")}catch{}})();var j=[["commands","Commands"],["command_overrides","Command overrides"],["flag_commands","Flag commands"],["item_types","Item types"],["item_fields","Item fields"],["migrations","Migrations"],["profiles","Profiles"],["importers","Importers"],["exporters","Exporters"],["search_providers","Search providers"],["vector_store_adapters","Vector store adapters"],["assurance_providers","Assurance measurement providers"],["hooks","Lifecycle hooks"],["parser_overrides","Parser overrides"],["service_overrides","Service overrides"],["renderer_overrides","Renderer overrides"]];function E(e){return"#".repeat(e)}function C(e){if(!e.includes("`"))return`\`${e}\``;let t=0,n=0;for(let i of e)n=i==="`"?n+1:0,t=Math.max(t,n);let r="`".repeat(t+1),o=e.startsWith("`")||e.endsWith("`")?" ":"";return`${r}${o}${e}${o}${r}`}function Y(e){return e.length===0?"Capabilities: _none registered_":`Capabilities: ${e.map(C).join(", ")}`}function B(e,t,n){let r=[`${E(t)} ${e}`,""];return n.length===0?(r.push("_None._",""),r):(r.push(...n.map(o=>`- ${C(o)}`),""),r)}function W(e,t,n){return e===0&&!n?[]:[`${E(t)} Preflight overrides`,"",e>0?`- ${e} registered (this surface carries no per-entry identifier)`:"_None._",""]}function _e(e,t={}){let n=t.headingLevel??2;if(!Number.isInteger(n)||n<1||n>6)throw new RangeError(`headingLevel must be an integer in [1, 6], received ${String(t.headingLevel)}`);let r=Math.min(n+1,6),o=t.includeEmpty===!0,i=t.title??"Extension surfaces",s=[`${E(n)} ${i}`,""];(o||e.capabilities.length>0)&&s.push(Y(e.capabilities),"");for(let[l,c]of j){let m=e[l]??[];m.length===0&&!o||s.push(...B(c,r,m))}return s.push(...W(e.preflight_overrides,r,o)),!(e.preflight_overrides>0||j.some(([l])=>(e[l]?.length??0)>0))&&!o&&s.push("_This extension registers no surfaces._",""),`${s.join(`
1
+ import{c as k}from"./chunk-PLTTMQAW.js";import{e as a,h as w}from"./chunk-PBCYGO7X.js";import{$ as f,Ba as A,P as S,aa as u,r as g,s as _,sa as y,t as b}from"./chunk-B3YW6H2I.js";import x from"node:fs/promises";import p 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]="74b72dd8-0877-55a4-9c80-d043f19e1f96")}catch{}})();var M=["extensions","docs","examples","assets","prompts"],P=Object.freeze({extensions:Object.freeze([".agents/pm/extensions","extensions",".custom/pm-extensions",".custom/pm-extension"]),docs:Object.freeze(["docs","documentation"]),examples:Object.freeze(["examples","docs/examples"]),assets:Object.freeze(["assets",".agents/pm/assets"]),prompts:Object.freeze(["prompts",".agents/pm/prompts"])});function U(e){return M.includes(e)}function R(e,t){if(t==null)return[];let n=Array.isArray(t)?t:[t],r=[];for(let o of n){if(typeof o!="string"||o.trim().length===0)throw new u(`Package manifest field pm.${e} must contain string paths.`,f.USAGE);r.push(o.trim())}return[...new Set(r)].sort((o,i)=>o.localeCompare(i))}function q(e){if(e==null)return{};if(typeof e!="object"||Array.isArray(e))throw new u("Package manifest field pm must be an object.",f.USAGE);let t={},n=e;for(let[r,o]of Object.entries(n)){if(!U(r))continue;let i=R(r,o);i.length>0&&(t[r]=i)}return t}function d(e,t){let n=e[t];return typeof n=="string"&&n.trim().length>0?n.trim():void 0}function v(e){if(!Array.isArray(e))return;let t=e.map(n=>typeof n=="string"?n.trim():"").filter(n=>n.length>0);return t.length>0?[...new Set(t)].sort((n,r)=>n.localeCompare(r)):void 0}function T(e){if(typeof e=="string"&&e.trim().length>0)return e.trim();if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let t=e.url;return typeof t=="string"&&t.trim().length>0?t.trim():void 0}}function G(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={docs:d(t,"docs"),npm:d(t,"npm"),repository:d(t,"repository"),report:d(t,"report")};return Object.values(n).some(r=>typeof r=="string")?n:void 0}function J(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={image:d(t,"image"),video:d(t,"video")};return Object.values(n).some(r=>typeof r=="string")?n:void 0}function K(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={display_name:d(t,"display_name")??d(t,"displayName"),category:d(t,"category"),summary:d(t,"summary"),links:G(t.links),media:J(t.media),tags:v(t.tags)};return Object.values(n).some(r=>r!==void 0)?n:void 0}async function V(e){let t=p.join(e,"package.json");if(!await y(t))return{source:"convention",resources:{}};let n;try{n=JSON.parse(await x.readFile(t,"utf8"))}catch(l){throw new u(`Failed to parse package manifest at "${t}": ${String(l)}`,f.USAGE)}if(typeof n!="object"||n===null||Array.isArray(n))throw new u(`Package manifest at "${t}" must be a JSON object.`,f.USAGE);let r=n,o=r.pm,i=o!=null,s=typeof o=="object"&&o!==null&&!Array.isArray(o)?o:{};return{source:i?"pm":"convention",package_json_path:t,package_name:typeof r.name=="string"?r.name:void 0,package_version:typeof r.version=="string"?r.version:void 0,package_private:r.private===!0,package_description:typeof r.description=="string"?r.description:void 0,package_keywords:v(r.keywords),package_homepage:typeof r.homepage=="string"?r.homepage:void 0,package_repository_url:T(r.repository),package_bugs_url:T(r.bugs),aliases:v(s.aliases),resources:q(o),catalog:K(s.catalog)}}async function I(e){if(!await y(e))return[];let t=await x.readdir(e,{withFileTypes:!0}),n=[];for(let r of t){if(!r.isDirectory())continue;let o=p.join(e,r.name);await y(p.join(o,"manifest.json"))&&n.push(o)}return n.sort((r,o)=>r.localeCompare(o))}async function ge(e){if(await y(p.join(e,"manifest.json")))return[e];let t=(await V(e)).resources.extensions??[],n=new Set;for(let r of t){if(r.includes("*")||r.startsWith("!"))throw new u(`Package extension entry "${r}" uses a glob/exclusion pattern. pm package installs currently require concrete extension paths or directories.`,f.USAGE);let o=p.resolve(e,r);if(!A(e,o))throw new u(`Package extension entry "${r}" resolves outside package root.`,f.USAGE);if(await y(p.join(o,"manifest.json"))){n.add(o);continue}for(let i of await I(o))n.add(i)}if(t.length===0)for(let r of P.extensions)for(let o of await I(p.join(e,r)))n.add(o);return[...n].sort((r,o)=>r.localeCompare(o))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3984f1ef-1703-5a83-a4fa-ec1cdc738572")}catch{}})();var j=[["commands","Commands"],["command_overrides","Command overrides"],["flag_commands","Flag commands"],["item_types","Item types"],["item_fields","Item fields"],["migrations","Migrations"],["profiles","Profiles"],["importers","Importers"],["exporters","Exporters"],["search_providers","Search providers"],["vector_store_adapters","Vector store adapters"],["assurance_providers","Assurance measurement providers"],["hooks","Lifecycle hooks"],["parser_overrides","Parser overrides"],["service_overrides","Service overrides"],["renderer_overrides","Renderer overrides"]];function E(e){return"#".repeat(e)}function C(e){if(!e.includes("`"))return`\`${e}\``;let t=0,n=0;for(let i of e)n=i==="`"?n+1:0,t=Math.max(t,n);let r="`".repeat(t+1),o=e.startsWith("`")||e.endsWith("`")?" ":"";return`${r}${o}${e}${o}${r}`}function Y(e){return e.length===0?"Capabilities: _none registered_":`Capabilities: ${e.map(C).join(", ")}`}function B(e,t,n){let r=[`${E(t)} ${e}`,""];return n.length===0?(r.push("_None._",""),r):(r.push(...n.map(o=>`- ${C(o)}`),""),r)}function W(e,t,n){return e===0&&!n?[]:[`${E(t)} Preflight overrides`,"",e>0?`- ${e} registered (this surface carries no per-entry identifier)`:"_None._",""]}function _e(e,t={}){let n=t.headingLevel??2;if(!Number.isInteger(n)||n<1||n>6)throw new RangeError(`headingLevel must be an integer in [1, 6], received ${String(t.headingLevel)}`);let r=Math.min(n+1,6),o=t.includeEmpty===!0,i=t.title??"Extension surfaces",s=[`${E(n)} ${i}`,""];(o||e.capabilities.length>0)&&s.push(Y(e.capabilities),"");for(let[l,c]of j){let m=e[l]??[];m.length===0&&!o||s.push(...B(c,r,m))}return s.push(...W(e.preflight_overrides,r,o)),!(e.preflight_overrides>0||j.some(([l])=>(e[l]?.length??0)>0))&&!o&&s.push("_This extension registers no surfaces._",""),`${s.join(`
2
2
  `).trimEnd()}
3
3
  `}(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]="abb182c9-6d6c-5be4-a2ad-c91b00a098d0")}catch{}})();var H=["agile","ops","research"],X={agile:[{name:"Story",description:"User-facing outcome or capability slice expressed from a stakeholder perspective.",defaultStatus:"open",folder:"stories",aliases:["user-story"]},{name:"Spike",description:"Time-boxed investigation used to reduce uncertainty before implementation.",defaultStatus:"open",folder:"spikes",aliases:["research-spike"]}],ops:[{name:"Incident",description:"Operational disruption, degradation, or support escalation with recovery tracking.",defaultStatus:"open",folder:"incidents",aliases:["outage"]},{name:"Runbook",description:"Repeatable operational procedure, diagnostic path, or response playbook.",defaultStatus:"open",folder:"runbooks",aliases:["playbook"]}],research:[{name:"Experiment",description:"Validated-learning activity with hypothesis, method, and outcome tracking.",defaultStatus:"open",folder:"experiments",aliases:["study"]},{name:"Hypothesis",description:"Testable claim or assumption that should be supported, rejected, or refined.",defaultStatus:"open",folder:"hypotheses",aliases:["assumption"]}]};function Ee(e){if(e===void 0)return;let t=e.trim().toLowerCase().replaceAll("-","_");if(t.length===0)throw new Error("Type preset name must not be empty.");if(t==="agile"||t==="ops"||t==="research")return t;throw new Error(`Invalid type preset "${e}". Allowed: ${H.join(", ")}.`)}function Se(e){return X[e].map(t=>k(t))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="68be16cc-4cb4-5df6-90f0-897d4fe82339")}catch{}})();var Q=new Set(_),Z=new Set(b),D=new Set([...S.filter(e=>e!=="severity"),"id","title","type","status","priority","tags","assignee","parent","description","body","created_at","updated_at","closed_at","completed_at","author","deadline","estimate","sprint","release","risk","confidence","reviewer","resolution","expected","actual"]),ee=["create","update"];function O(e){if(typeof e!="string")return"";let t=e.trim().toLowerCase().replaceAll(/[\s_]+/g,"-");return t.startsWith("--")?t.slice(2):t}function $(e){return e.replaceAll("_","-")}function te(e,t){let n=new Set;for(let r of e){let o=O(r);o.length>0&&o!==t&&n.add(o)}return[...n].sort((r,o)=>r.localeCompare(o))}function re(e){let t=new Set;for(let n of e??[]){let r=n.trim();r.length>0&&t.add(r)}return[...t].sort((n,r)=>n.localeCompare(r))}function ne(e){let t=new Set,n=[];for(let r of e??[]){let o=r.trim().toLowerCase();if(o.length!==0){if(!Z.has(o))throw new Error(`Invalid field command "${r}". Allowed: ${b.join(", ")}.`);t.has(o)||(t.add(o),n.push(o))}}return e===void 0||n.length===0?[...ee]:n}function xe(e){let t=a(e.key);if(t.length===0)throw new Error("Field key must not be empty.");if(D.has(t))throw new Error(`Cannot define custom field "${t}": custom schema field "${t}" collides with built-in item metadata "${t}". Rename the custom field with a project-specific prefix. Reserved fields: ${[...D].sort((L,z)=>L.localeCompare(z)).join(", ")}.`);let n=typeof e.type=="string"&&e.type.trim().length>0?e.type.trim().toLowerCase():"string";if(!Q.has(n))throw new Error(`Invalid field type "${e.type}". Allowed: ${_.join(", ")}.`);let r=n,o=ne(e.commands),i=O(e.cliFlag),s=i.length>0&&i!==$(t)?i:void 0,l=s??$(t),c=te(e.aliases??[],l),m=e.description?.trim();return{key:t,type:r,commands:o,description:m&&m.length>0?m:void 0,cliFlag:s,cliAliases:c,required:e.required===!0,requiredOnCreate:e.requiredOnCreate===!0,allowUnset:e.allowUnset!==!1,requiredTypes:re(e.requiredTypes)}}function oe(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.fields))return t.fields;if(Array.isArray(t.definitions))return t.definitions}function ie(e){let t=oe(e);if(!t)return[];let n=[];for(let r of t){if(typeof r!="object"||r===null||Array.isArray(r))continue;let o=r;typeof o.key!="string"||o.key.trim().length===0||n.push(o)}return n}function je(e){if(e==null||e.trim().length===0)return{fields:[]};let t;try{t=JSON.parse(e)}catch{throw new Error("schema/fields.json contains invalid JSON.")}return{fields:ie(t)}}function Ce(e){return`${JSON.stringify({fields:e.fields},null,2)}
4
4
  `}function De(e,t){let n=e.fields.find(s=>a(s.key)===t.key),r=n!==void 0,o=e.fields.filter(s=>a(s.key)!==t.key),i={...n,key:t.key,type:t.type,commands:[...t.commands]};return F(i,"description",t.description),F(i,"cli_flag",t.cliFlag),t.cliAliases.length>0?i.cli_aliases=[...t.cliAliases]:delete i.cli_aliases,N(i,"required",t.required),N(i,"required_on_create",t.requiredOnCreate),t.allowUnset===!1?i.allow_unset=!1:delete i.allow_unset,t.requiredTypes.length>0?i.required_types=[...t.requiredTypes]:delete i.required_types,o.push(i),o.sort((s,l)=>a(s.key).localeCompare(a(l.key))),{file:{fields:o},definition:i,replaced:r}}function $e(e,t){let n=a(t);if(n.length===0)throw new Error("Field key must not be empty.");let r=[],o=e.fields.filter(i=>a(i.key)===n?(r.push(i),!1):!0);return r.length===0?{file:{fields:o},removed:!1}:{file:{fields:o},removed:!0,definition:r[0]}}function F(e,t,n){let r=e;n!==void 0&&n.length>0?r[t]=n:delete r[t]}function N(e,t,n){let r=e;n?r[t]=!0:delete r[t]}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b1e4c04e-0ade-5d24-95e3-b8dca3832c5a")}catch{}})();var se=new Set(g),h=new Set(w.map(e=>a(e.id)).filter(e=>e.length>0));function ae(e){let t=new Set;for(let n of e){let r=a(n);r.length>0&&t.add(r)}return[...t].sort((n,r)=>n.localeCompare(r))}function Me(e){let t=a(e.id);if(t.length===0)throw new Error("Status id must not be empty.");if(h.has(t))throw new Error(`Cannot add-status the built-in status "${t}". Built-in statuses are reserved: ${[...h].join(", ")}.`);let n;if(e.roles!==void 0){n=[];let s=new Set;for(let l of e.roles){let c=typeof l=="string"?l.trim().toLowerCase():"";if(c.length!==0){if(!se.has(c))throw new Error(`Invalid status role "${l}". Allowed roles: ${g.join(", ")}.`);s.has(c)||(s.add(c),n.push(c))}}if(n.length===0)throw new Error(`Status role must include at least one lifecycle role. Allowed roles: ${g.join(", ")}.`)}let r=e.aliases===void 0?void 0:ae(e.aliases).filter(s=>s!==t),o=e.description?.trim(),i=typeof e.order=="number"&&Number.isFinite(e.order)?Math.trunc(e.order):void 0;return{id:t,roles:n,aliases:r,description:o&&o.length>0?o:void 0,order:i}}function le(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.statuses))return t.statuses;if(Array.isArray(t.definitions))return t.definitions}function de(e){let t=le(e);if(!t)return[];let n=[];for(let r of t){if(typeof r!="object"||r===null||Array.isArray(r))continue;let o=r;typeof o.id!="string"||o.id.trim().length===0||n.push(o)}return n}function Pe(e){if(e==null||e.trim().length===0)return{statuses:[]};let t;try{t=JSON.parse(e)}catch{throw new Error("schema/statuses.json contains invalid JSON.")}return{statuses:de(t)}}function Ue(e){return`${JSON.stringify({statuses:e.statuses},null,2)}
5
5
  `}function Re(e,t,n){let r=e.statuses.slice(),o=r.findIndex(l=>a(l.id)===t.id),i=o>=0?r[o]:n,s={...i,id:t.id};return t.roles!==void 0&&(t.roles.length>0?s.roles=[...t.roles]:s.roles!==void 0&&delete s.roles),t.aliases!==void 0&&(t.aliases.length>0?s.aliases=[...t.aliases]:s.aliases!==void 0&&delete s.aliases),t.description!==void 0&&(s.description=t.description),t.order!==void 0&&(s.order=t.order),o>=0?r[o]=s:r.push(s),{file:{statuses:r},definition:s,replaced:i!==void 0}}function qe(e,t){let n=a(t);if(n.length===0)throw new Error("Status id must not be empty.");if(h.has(n))throw new Error(`Cannot remove built-in status "${n}". Built-in statuses are reserved: ${[...h].join(", ")}.`);let r=e.statuses.slice(),o=r.findIndex(s=>a(s.id)===n);if(o<0)return{file:{statuses:r},removed:!1};let[i]=r.splice(o,1);return{file:{statuses:r},removed:!0,definition:i}}function Ge(e,t){let n=[e.id,...e.aliases??[]];for(let r of n){let o=a(r);if(o.length===0)continue;let i=t.get(o);if(i!==void 0&&i!==e.id)throw new Error(`Status token "${o}" already belongs to status "${i}". Choose a different id/alias to avoid shadowing it.`)}}export{M as a,P as b,V as c,ge as d,H as e,X as f,Ee as g,Se as h,xe as i,je as j,Ce as k,De as l,$e as m,h as n,Me as o,Pe as p,Ue as q,Re as r,qe as s,Ge as t,_e as u};
6
- //# sourceMappingURL=chunk-DRHJOG5X.js.map
6
+ //# sourceMappingURL=chunk-W5AE7GKZ.js.map
@@ -1,2 +1,2 @@
1
- import{Q as C}from"./chunk-6TKAFFEB.js";import{ab as c}from"./chunk-BDT5EALU.js";import{Kd as A,Ld as m,Nd as O,oc as _}from"./chunk-L3CZNKZE.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]="583b80c2-9d6a-554a-8ce8-9f6f7b5403ac")}catch{}})();var u=[{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=u.filter(e=>e.repeatable!==!0).map(e=>({target:e.target,keys:e.keys})),y=u.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 test command=<value>,path=<value>,scope=<project|global>,timeout_seconds=<n>,pm_context_mode=<schema|tracker|auto|none> (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]="6dff1fa2-fd7a-5a94-b49e-dd8a2fd804b9")}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,a)=>a.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 a=f[e]?.[t.flag];if(a!==void 0&&a.every(o=>r.has(o)))return{surface:"cli",input:t.flag,counterpart:a[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 o=S(e,s);if(r.has(o))return{surface:"cli",input:t.flag,counterpart:o,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,o])=>o.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 a=i.find(({counterpart:s,disposition:o})=>s===t&&(o==="shared"||o==="compatibility_alias"||o==="cli_scope_selector"));if(a!==void 0)return{surface:"sdk",input:t,counterpart:a.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??_,i=e.resolveFlags??c,r=e.resolveParameters??C;return t.map(a=>{let n=F(a),s=x(i(n)).filter(({flag:l})=>O(a)!==void 0||!k.has(l)),o=new Set(r(a)??[]),p=s.map(l=>V(a,l,s,o)),d=[...o].sort((l,g)=>l.localeCompare(g)).map(l=>B(a,l,p));return{action:a,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 va={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{u as a,v as b,y as c,T as d,N as e,R as f,X as g,va as h};
2
- //# sourceMappingURL=chunk-LZQGEVKT.js.map
1
+ import{Q as C}from"./chunk-2CJWTLQG.js";import{ab as c}from"./chunk-WOEZJUA2.js";import{Kd as A,Ld as m,Nd as O,oc as _}from"./chunk-B3YW6H2I.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]="583b80c2-9d6a-554a-8ce8-9f6f7b5403ac")}catch{}})();var u=[{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=u.filter(e=>e.repeatable!==!0).map(e=>({target:e.target,keys:e.keys})),y=u.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 test command=<value>,path=<value>,scope=<project|global>,timeout_seconds=<n>,pm_context_mode=<schema|tracker|auto|none> (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]="6dff1fa2-fd7a-5a94-b49e-dd8a2fd804b9")}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,a)=>a.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 a=f[e]?.[t.flag];if(a!==void 0&&a.every(o=>r.has(o)))return{surface:"cli",input:t.flag,counterpart:a[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 o=S(e,s);if(r.has(o))return{surface:"cli",input:t.flag,counterpart:o,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,o])=>o.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 a=i.find(({counterpart:s,disposition:o})=>s===t&&(o==="shared"||o==="compatibility_alias"||o==="cli_scope_selector"));if(a!==void 0)return{surface:"sdk",input:t,counterpart:a.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??_,i=e.resolveFlags??c,r=e.resolveParameters??C;return t.map(a=>{let n=F(a),s=x(i(n)).filter(({flag:l})=>O(a)!==void 0||!k.has(l)),o=new Set(r(a)??[]),p=s.map(l=>V(a,l,s,o)),d=[...o].sort((l,g)=>l.localeCompare(g)).map(l=>B(a,l,p));return{action:a,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 va={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{u as a,v as b,y as c,T as d,N as e,R as f,X as g,va as h};
2
+ //# sourceMappingURL=chunk-WAOXID5J.js.map