@unbrained/pm-cli 2026.11.10 → 2026.11.11

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 (120) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +12 -0
  3. package/dist/cli/commander-usage.js +2 -2
  4. package/dist/cli/error-guidance.js +3 -3
  5. package/dist/cli/help-json-payload.js +1 -1
  6. package/dist/cli/main.js +4 -4
  7. package/dist/cli/runtime/refusal-credential-redaction.js +2 -0
  8. package/dist/cli-bundle/bundle-manifest.json +1 -1
  9. package/dist/cli-bundle/chunks/{chunk-NNE63MSM.js → chunk-4RHXGQMK.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-YSWD2NXB.js → chunk-5N3JMGXU.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-TBBWPEF5.js → chunk-DIWTFDU7.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-OJ2KEDUX.js → chunk-DV7WBAKQ.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-F6FBGLR7.js → chunk-EBAHNZJT.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-BSJSGDA3.js → chunk-FM375BHH.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-F7P2NZEG.js → chunk-GOLQYO6M.js} +4 -4
  16. package/dist/cli-bundle/chunks/chunk-GZ52WAY2.js +124 -0
  17. package/dist/cli-bundle/chunks/{chunk-EHDGHFMJ.js → chunk-JESMEJTD.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-CZETQYKO.js → chunk-JLQ7O6UV.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-FYD6LSJA.js → chunk-L3SA3354.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-U7LILCUN.js → chunk-NIOOJ3AG.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-WNEUWDUE.js → chunk-PZI6CR24.js} +46 -46
  22. package/dist/cli-bundle/chunks/{chunk-NZAFLDSH.js → chunk-QCTA2UFR.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-4FLAKTZW.js → chunk-SPERPX27.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-T2MNRM3S.js → chunk-SVVFJPNW.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-5CAMQHEW.js → chunk-WEAF3OY4.js} +2 -2
  26. package/dist/cli-bundle/chunks/{chunk-UL64P6MR.js → chunk-WWW5WHHJ.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-X7NM5HVQ.js → chunk-XJUYJXHZ.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-L4WWG2H6.js → chunk-XN2BRWDD.js} +2 -2
  29. package/dist/cli-bundle/chunks/chunk-Z4YEH7VQ.js +2 -0
  30. package/dist/cli-bundle/chunks/{chunk-7NAAW5EX.js → chunk-ZJDYBXMC.js} +2 -2
  31. package/dist/cli-bundle/chunks/{chunk-4AASUCHO.js → chunk-ZSL6U53K.js} +2 -2
  32. package/dist/cli-bundle/chunks/{item-revision-M7KXLQXF.js → item-revision-LNIHK36Q.js} +2 -2
  33. package/dist/cli-bundle/chunks/item-transaction-TMUYPSMR.js +2 -0
  34. package/dist/cli-bundle/chunks/{mutation-admission-374UR7NI.js → mutation-admission-WZY22LVH.js} +2 -2
  35. package/dist/cli-bundle/chunks/{register-list-query-GSB7PP5P.js → register-list-query-DYGPLVRL.js} +2 -2
  36. package/dist/cli-bundle/chunks/{register-mutation-ZBF6ITYK.js → register-mutation-MP5JCBAJ.js} +2 -2
  37. package/dist/cli-bundle/chunks/{register-operations-PWF6GOHE.js → register-operations-QEASK3EF.js} +2 -2
  38. package/dist/cli-bundle/chunks/{register-setup-QDZ2Y3CI.js → register-setup-G66U2WFV.js} +2 -2
  39. package/dist/cli-bundle/chunks/{stage-67WGPKPH.js → stage-VIDXGF3T.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/{chunk-WK773UVA.js → chunk-2ZS3I5ZP.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/chunk-33EK522E.js +26 -0
  42. package/dist/cli-bundle/focused-chunks/{chunk-BE2GK2G7.js → chunk-3A6XMQZJ.js} +2 -2
  43. package/dist/cli-bundle/focused-chunks/{chunk-PAGW6A2X.js → chunk-3FN4ON2Z.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/{chunk-3DWNH72D.js → chunk-3SH3L3DB.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/{chunk-ALLOWZSH.js → chunk-6ICHSVEY.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/{chunk-QK7FX4O5.js → chunk-6TJXTKZD.js} +4 -4
  47. package/dist/cli-bundle/focused-chunks/{chunk-QHGGO7SY.js → chunk-AXPRCCYM.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-UIZVD36C.js → chunk-DW5S67LO.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/{chunk-HTMQDNVC.js → chunk-GBW2EAAG.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/{chunk-ZBOCYFBE.js → chunk-HIKZYZ26.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/{chunk-QCHCEFTO.js → chunk-JYWVRXLD.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/chunk-M5FZTPFA.js +2 -0
  53. package/dist/cli-bundle/focused-chunks/{chunk-2SQUWQP3.js → chunk-MK7UQEE5.js} +18 -18
  54. package/dist/cli-bundle/focused-chunks/{chunk-2Y4H4LIX.js → chunk-NMU3QFAU.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/{chunk-LY3JXL25.js → chunk-NP5C2TQM.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-RFMKS7VD.js → chunk-NSOXVVQX.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/{chunk-WJHDUON5.js → chunk-NY65XTX7.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{chunk-67M7E2Z3.js → chunk-P6KYUJD4.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{chunk-LWMPQRJT.js → chunk-UCUESVFW.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{chunk-NZQYHPUN.js → chunk-V27M5UQH.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/{chunk-3K2MYE7R.js → chunk-VVGXPF4W.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{item-revision-XC4ZJ7MY.js → item-revision-B3BIG66B.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{item-transaction-CVGK4RJP.js → item-transaction-4JDWOXNB.js} +2 -2
  64. package/dist/cli-bundle/focused-chunks/{mutation-admission-N27D5H64.js → mutation-admission-577MXOGD.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/{stage-KPK2UHVO.js → stage-EKYWEU2Y.js} +2 -2
  66. package/dist/cli-bundle/main.js +32 -32
  67. package/dist/cli-bundle/sdk-authoring.js +1 -1
  68. package/dist/cli-bundle/sdk-contracts.js +1 -1
  69. package/dist/cli-bundle/sdk-core.js +1 -1
  70. package/dist/cli-bundle/sdk-governance.js +1 -1
  71. package/dist/cli-bundle/sdk-graph.js +1 -1
  72. package/dist/cli-bundle/sdk-merge.js +57 -57
  73. package/dist/cli-bundle/sdk-query.js +1 -1
  74. package/dist/cli-bundle/sdk-runtime.js +1 -1
  75. package/dist/cli-bundle/sdk-testing.js +1 -1
  76. package/dist/cli-bundle/sdk.js +11 -11
  77. package/dist/core/sentry/instrument.js +1 -1
  78. package/dist/core/shared/secret-rules.d.ts +18 -2
  79. package/dist/core/shared/secret-rules.js +4 -2
  80. package/dist/core/shared/url-credentials.d.ts +37 -0
  81. package/dist/core/shared/url-credentials.js +2 -0
  82. package/dist/core/telemetry/runtime.js +2 -2
  83. package/dist/sdk/command-line.d.ts +1 -1
  84. package/dist/sdk/command-line.js +1 -1
  85. package/dist/sdk/index.d.ts +1 -1
  86. package/dist/sdk/index.js +1 -1
  87. package/dist/sdk/lifecycle/item-revision.js +1 -1
  88. package/dist/sdk/public-surface.json +1 -1
  89. package/docs/CODEX_PLUGIN.md +2 -1
  90. package/docs/CONFIGURATION.md +16 -0
  91. package/docs/MUTATION_INTEGRITY.md +65 -0
  92. package/docs/README.md +2 -2
  93. package/docs/SDK.md +16 -0
  94. package/marketplace.json +1 -1
  95. package/package.json +2 -1
  96. package/packages/pm-beads/package.json +1 -1
  97. package/packages/pm-calendar/package.json +1 -1
  98. package/packages/pm-command-kit/package.json +1 -1
  99. package/packages/pm-digital-twin/package.json +1 -1
  100. package/packages/pm-governance-audit/package.json +1 -1
  101. package/packages/pm-guide-shell/package.json +1 -1
  102. package/packages/pm-kanban/package.json +1 -1
  103. package/packages/pm-lifecycle-hooks/package.json +1 -1
  104. package/packages/pm-linked-test-adapters/package.json +1 -1
  105. package/packages/pm-search-advanced/package.json +1 -1
  106. package/packages/pm-templates/package.json +1 -1
  107. package/packages/pm-todos/package.json +1 -1
  108. package/packages/pm-vcs/package.json +1 -1
  109. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  110. package/plugins/pm-claude/package.json +1 -1
  111. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  112. package/plugins/pm-codex/package.json +1 -1
  113. package/plugins/pm-codex/plugin.json +1 -1
  114. package/runtime-dependencies.json +1 -1
  115. package/dist/cli-bundle/chunks/chunk-D727C4RO.js +0 -122
  116. package/dist/cli-bundle/chunks/chunk-UFPLZ6LZ.js +0 -2
  117. package/dist/cli-bundle/chunks/item-transaction-4N5P34GO.js +0 -2
  118. package/dist/cli-bundle/focused-chunks/chunk-56MIAFEN.js +0 -24
  119. package/dist/cli-bundle/focused-chunks/chunk-U7HWWEJ2.js +0 -2
  120. package/docs/CHATGPT_CODEX_PLUGIN_IMPLEMENTATION.md +0 -776
@@ -1,8 +1,8 @@
1
- import{N as ge,Ua as ue,k as ce}from"./chunk-F7P2NZEG.js";import{x as le,y as fe}from"./chunk-UL64P6MR.js";import{m as R,ra as pe}from"./chunk-NZAFLDSH.js";import{R as ae,Y as se,Z as de,_ as me}from"./chunk-D727C4RO.js";import{Dc as q,Ec as U,Ic as V,Jc as z,Kc as G,Lc as W,Mc as Y,Nc as X,Oc as J,Pc as Q,Qc as Z,Rc as ee,Sc as re,Tc as te,Zc as ne,_c as oe,ed as ie,ic as v,lc as x,mc as H,nb as B,ob as D,yb as w,yc as K,zb as L}from"./chunk-WNEUWDUE.js";import{k as C}from"./chunk-O4ZLEN4T.js";(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]="52f6eff3-e226-56d9-893a-f16997d11c50")}catch{}})();function Dr(r){return r}function Lr(r){return r}function Se(r,e){for(let t of e.commands??[])r.registerCommand(t);for(let[t,n]of Object.entries(e.commandOverrides??{}))r.registerCommand(t,n);for(let[t,n]of Object.entries(e.flags??{}))r.registerFlags(t,n);for(let[t,n]of Object.entries(e.parsers??{}))r.registerParser(t,n);for(let[t,n]of Object.entries(e.renderers??{}))if(typeof n=="function")r.registerRenderer(t,n);else{let{run:a,...i}=n;r.registerRenderer(t,a,i)}for(let[t,n]of Object.entries(e.services??{}))r.registerService(t,n)}function Oe(r,e){for(let i of e.preflights??[])r.registerPreflight(i);let t=e.itemTypes??[];t.length>0&&r.registerItemTypes(t);let n=e.itemFields??[];n.length>0&&r.registerItemFields(n);let a=e.relationshipKinds??[];a.length>0&&r.registerRelationshipKinds(a);for(let i of e.migrations??[])r.registerMigration(i);for(let i of e.profiles??[])r.registerProfile(i)}function Ae(r,e){for(let t of e.searchProviders??[])r.registerSearchProvider(t);for(let t of e.vectorStoreAdapters??[])r.registerVectorStoreAdapter(t);for(let t of e.assuranceProviders??[])r.registerAssuranceMeasurementProvider(t);for(let t of e.importers??[])r.registerImporter(t.name,t.importer,t.options);for(let t of e.exporters??[])r.registerExporter(t.name,t.exporter,t.options)}function Fe(r,e){for(let t of e.beforeCommand??[])r.hooks.beforeCommand(t);for(let t of e.beforeMutation??[])r.hooks.beforeMutation(t);for(let t of e.afterCommand??[])r.hooks.afterCommand(t);for(let t of e.onWrite??[])r.hooks.onWrite(t);for(let t of e.onRead??[])r.hooks.onRead(t);for(let t of e.onIndex??[])r.hooks.onIndex(t)}function Te(r){let e={activate:async t=>{Se(t,r),Oe(t,r),Ae(t,r),Fe(t,r.hooks??{}),await r.activate?.(t)}};return r.manifest&&(e.manifest=r.manifest),r.deactivate&&(e.deactivate=r.deactivate),e}function h(r){let e=r.flatMap(t=>t??[]);return e.length>0?e:void 0}function _(r){let e=Object.assign({},...r.map(t=>t??{}));return Object.keys(e).length>0?e:void 0}function Pe(r){let e={};for(let t of r)for(let[n,a]of Object.entries(t??{}))e[n]=[...e[n]??[],...a];return Object.keys(e).length>0?e:void 0}var Ie=["beforeCommand","beforeMutation","afterCommand","onWrite","onRead","onIndex"];function Me(r,e,t){let n=e.map(i=>i?.[t]),a=h(n);if(a!==void 0){let i=r;i[t]=a}}function je(r){let e={};for(let t of Ie)Me(e,r,t);return Object.keys(e).length>0?e:void 0}function Hr(...r){let e={},t=(o,s)=>{s!==void 0&&(e[o]=s)};t("commands",h(r.map(o=>o.commands))),t("commandOverrides",_(r.map(o=>o.commandOverrides))),t("flags",Pe(r.map(o=>o.flags))),t("parsers",_(r.map(o=>o.parsers))),t("renderers",_(r.map(o=>o.renderers))),t("services",_(r.map(o=>o.services))),t("preflights",h(r.map(o=>o.preflights))),t("itemTypes",h(r.map(o=>o.itemTypes))),t("itemFields",h(r.map(o=>o.itemFields))),t("relationshipKinds",h(r.map(o=>o.relationshipKinds))),t("migrations",h(r.map(o=>o.migrations))),t("profiles",h(r.map(o=>o.profiles))),t("searchProviders",h(r.map(o=>o.searchProviders))),t("vectorStoreAdapters",h(r.map(o=>o.vectorStoreAdapters))),t("assuranceProviders",h(r.map(o=>o.assuranceProviders))),t("importers",h(r.map(o=>o.importers))),t("exporters",h(r.map(o=>o.exporters))),t("hooks",je(r.map(o=>o.hooks)));let n;for(let o of r)o.manifest&&(n=o.manifest);t("manifest",n);let a=r.some(o=>o.activate);t("activate",a?async o=>{for(let s of r)s.activate&&await s.activate(o)}:void 0);let i=r.some(o=>o.deactivate);return t("deactivate",i?async()=>{let o=[];for(let s of[...r].reverse())if(s.deactivate)try{await s.deactivate()}catch(d){o.push(d)}if(o.length>0)throw o.length>1?new AggregateError(o,"Multiple extension blueprint deactivate hooks failed."):o[0]}:void 0),e}var Be=[["commands","commands"],["commandOverrides","commands"],["flags","schema"],["itemTypes","schema"],["itemFields","schema"],["relationshipKinds","schema"],["migrations","schema"],["profiles","schema"],["parsers","parser"],["renderers","renderers"],["services","services"],["preflights","preflight"],["searchProviders","search"],["vectorStoreAdapters","search"],["assuranceProviders","services"],["importers","importers"],["exporters","importers"]];function $(r){return r?Array.isArray(r)?r.length>0:Object.keys(r).length>0:!1}function N(r){let e=new Set;for(let[a,i]of Be)$(r[a])&&e.add(i);(r.commands??[]).filter(E).some(a=>a.flags!==void 0)&&e.add("schema");let t=[...r.importers??[],...r.exporters??[]].filter(E);t.some(a=>a?.options?.flags!==void 0)&&e.add("schema"),t.some(a=>typeof a=="object")&&e.add("commands");let n=r.hooks??{};return[n.beforeCommand,n.beforeMutation,n.afterCommand,n.onWrite,n.onRead,n.onIndex].some($)&&e.add("hooks"),[...e].sort((a,i)=>a.localeCompare(i))}var De=[["beforeCommand","before_command"],["beforeMutation","before_mutation"],["afterCommand","after_command"],["onWrite","on_write"],["onRead","on_read"],["onIndex","on_index"]];function f(r){return[...new Set(r)].sort((e,t)=>e.localeCompare(t))}function E(r){return r!=null}function S(r){return v(`${r.name} import`)}function O(r){return v(`${r.name} export`)}function Le(r,e,t){return[...r.map(n=>v(n.name)),...e.filter(n=>n.options!==void 0).map(S),...t.filter(n=>n.options!==void 0).map(O)]}function He(r,e,t,n){return[...Object.keys(r.flags??{}).map(a=>v(a)),...e.filter(a=>a.flags!==void 0).map(a=>v(a.name)),...t.filter(a=>a.options?.flags!==void 0).map(S),...n.filter(a=>a.options?.flags!==void 0).map(O)]}function Ke(r){return De.filter(([e])=>(r[e]?.length??0)>0).map(([,e])=>e)}function qe(r){let e=Object.entries(r??{}).filter(([,t])=>typeof t!="function"&&((t.commands?.length??0)>0||t.resultDiscriminator!==void 0)).map(([t,n])=>{let a=n;return{format:t,commands:f((a.commands??[]).map(i=>v(i))),result_discriminator:a.resultDiscriminator!==void 0}}).sort((t,n)=>t.format.localeCompare(n.format));return e.length>0?{renderer_ownership:e}:{}}function Ue(r){return!r||r.length===0?{}:{assurance_providers:f(r.map(e=>e.id))}}function Ve(r,e,t){return{item_types:f((r.itemTypes??[]).map(n=>n.name)),item_fields:f((r.itemFields??[]).map(n=>n.name)),...(r.relationshipKinds?.length??0)>0?{relationship_kinds:f(r.relationshipKinds.map(n=>n.kind))}:{},migrations:f((r.migrations??[]).flatMap(n=>typeof n.id=="string"?[n.id]:[])),profiles:f((r.profiles??[]).map(n=>n.name)),importers:f(e.map(n=>v(n.name))),exporters:f(t.map(n=>v(n.name))),search_providers:f((r.searchProviders??[]).map(n=>n.name)),vector_store_adapters:f((r.vectorStoreAdapters??[]).map(n=>n.name)),...Ue(r.assuranceProviders),parser_overrides:f(Object.keys(r.parsers??{}).map(n=>v(n))),service_overrides:f(Object.keys(r.services??{}).map(n=>String(n).trim().toLowerCase())),renderer_overrides:f(Object.keys(r.renderers??{}).map(n=>String(n).trim().toLowerCase())),...qe(r.renderers),preflight_overrides:(r.preflights??[]).length,preflight_ownership:(r.preflights??[]).map(n=>({commands:[...n.commands??[]]}))}}function ze(r){let e=(r.commands??[]).filter(E),t=(r.importers??[]).filter(E),n=(r.exporters??[]).filter(E),a=t.map(S),i=n.map(O),o=Le(e,t,n),s=He(r,e,t,n),d=r.hooks??{},l=Ve(r,t,n);return{capabilities:N(r),commands:f(o),command_overrides:f(Object.keys(r.commandOverrides??{}).map(b=>v(b))),command_handlers:f([...o,...a,...i]),hooks:Ke(d),flag_commands:f(s),...l}}var Ge=["commands","commandOverrides","flags","parsers","renderers","services","preflights","itemTypes","itemFields","relationshipKinds","migrations","profiles","searchProviders","vectorStoreAdapters","assuranceProviders","importers","exporters"];function We(r){return(r.itemFields??[]).filter(e=>typeof e?.name=="string"&&ae.has(e.name.trim())).map(e=>({code:"reserved_item_field",severity:"error",message:`Item field "${e.name}" collides with reserved item metadata; rename it with an extension-specific prefix before publishing.`,field:e.name}))}function Ye(r){return[...Object.values(r.flags??{}).flat(),...(r.commands??[]).flatMap(e=>e.flags??[]),...(r.importers??[]).flatMap(e=>e.options?.flags??[]),...(r.exporters??[]).flatMap(e=>e.options?.flags??[])].flatMap(e=>{if(typeof e?.long!="string"&&typeof e?.short!="string")return[];let t=B(e.long,e.short);if(t===null)return[];let{token:n,failure:a}=t;return[{code:a,severity:"error",message:`Flag "${n}" ${D(n,a)}.`,field:n}]})}function he(r){let e=new Set;for(let t of r){let n=H(t)??x(t);n!==null&&e.add(n)}return[...e].sort((t,n)=>t.localeCompare(n))}function Xe(r,e){let t=[];if(e===null)return r.length>0&&t.push({code:"manifest_capabilities_absent",severity:"warning",message:`Blueprint exercises ${r.length===1?"capability":"capabilities"} [${r.join(", ")}] but declares none; set capabilities to deriveExtensionCapabilities(blueprint) so the manifest grant matches.`}),t;let n=new Set(e),a=new Set(r);for(let i of r)n.has(i)||t.push({code:"capability_undeclared",severity:"error",message:`Blueprint exercises capability "${i}" but it is absent from the declared capabilities; activation throws extension_capability_missing \u2014 add "${i}" to the manifest capabilities.`,capability:i});for(let i of e)a.has(i)||t.push({code:"capability_unused",severity:"warning",message:`Capability "${i}" is declared but no blueprint surface exercises it; drop it to keep the manifest least-privilege (pm package doctor reports this as extension_capability_unused).`,capability:i});return t}function Je(r){let e=[],t=new Map;for(let a of r.commands??[]){let i=v(a.name);t.set(i,(t.get(i)??0)+1)}for(let[a,i]of t)i>1&&e.push({code:"duplicate_command",severity:"warning",message:`Command "${a}" is declared ${i} times in commands; the later registration shadows the earlier one at dispatch.`,command:a});let n=new Set(Object.keys(r.commandOverrides??{}).map(a=>v(a)));for(let a of t.keys())n.has(a)&&e.push({code:"command_override_conflict",severity:"warning",message:`Command "${a}" is declared both as a new command definition and as a command override; register one or the other.`,command:a});return e}function Qe(r){let e=[];for(let t of Ge)t in r&&!$(r[t])&&e.push({code:"empty_surface",severity:"warning",message:`Blueprint field "${t}" is present but empty; remove it or populate it.`,field:t});if("hooks"in r){let t=r.hooks??{};[t.beforeCommand,t.beforeMutation,t.afterCommand,t.onWrite,t.onRead,t.onIndex].some($)||e.push({code:"empty_surface",severity:"warning",message:'Blueprint field "hooks" is present but registers no lifecycle hooks; remove it or populate it.',field:"hooks"})}return e}function k(r,e={}){let t=N(r),n=e.declaredCapabilities??r.manifest?.capabilities,a=Array.isArray(n)?he(n):null,i=[...Xe(t,a),...Je(r),...Ye(r),...We(r),...Qe(r)];return{ok:i.every(o=>o.severity!=="error"),findings:i,used:t,declared:a}}function ye(r,e){let{additionalCapabilities:t,...n}=e,a=Array.isArray(t)?he(t):[],i=[...new Set([...N(r),...a])].sort((o,s)=>o.localeCompare(s));return{...n,capabilities:i}}function Kr(r,e){let t=ye(r,e);return{module:Te({...r,manifest:t}),manifest:t}}function ve(r,e){if(r.status==="absent"||r.status==="ok")return null;let t=`${r.kind}_${r.status}`,n="";switch(t){case"pm_min_version_invalid":n=`pm_min_version "${r.required}" is not a valid version; the extension is treated as incompatible and the loader skips it.`;break;case"pm_min_version_unchecked":n=`pm_min_version "${r.required}" could not be compared against pm ${e}; compatibility is unverified.`;break;case"pm_min_version_unmet":n=`Requires pm >= ${r.required} but the target is pm ${e}; the loader skips the extension.`;break;case"pm_max_version_invalid":n=`pm_max_version "${r.required}" is not a valid inclusive upper bound (version ranges are not allowed); the extension is treated as incompatible and the loader skips it.`;break;case"pm_max_version_unchecked":n=`pm_max_version "${r.required}" could not be compared against pm ${e}; compatibility is unverified.`;break;case"pm_max_version_exceeded":n=`Allows pm <= ${r.required} but the target is pm ${e}; the loader skips the extension.`;break;case"pm_max_version_exceeded_warn":n=`Target pm ${e} is newer than pm_max_version ${r.required}, but the "warn" exceeded mode lets it load with a warning.`;break}return{code:t,severity:r.allowed?"warning":"error",constraint:r.kind,required:r.required,current:e,message:n}}function A(r,e){let t=q(r.pm_min_version,e.pmVersion),n=U(r.pm_max_version,e.pmVersion,e.pmMaxVersionExceededMode??"block"),a=K(r).findings.map(d=>({code:d.code,severity:"warning",constraint:"manifest",required:d.code==="manifest_unknown_key"?d.path:"pm_min_version",current:e.pmVersion,path:d.path,...d.suggested_key?{suggested_key:d.suggested_key}:{},message:d.message})),i=[],o=ve(t,e.pmVersion);o!==null&&i.push(o);let s=ve(n,e.pmVersion);return s!==null&&i.push(s),{compatible:t.allowed&&n.allowed,findings:[...a,...i],pmVersion:e.pmVersion}}var Ze=new Set(["capability_undeclared","capability_unused","manifest_capabilities_absent"]);function we(r,e={}){let t=k(r,{declaredCapabilities:e.declaredCapabilities}),n=e.identity?ye(r,e.identity):null,a=e.target?A(n??r.manifest??{},e.target):null,i=[...(n!==null&&e.declaredCapabilities===void 0?t.findings.filter(o=>!Ze.has(o.code)):t.findings).map(o=>({source:"blueprint",severity:o.severity,code:o.code,message:o.message})),...(a?.findings??[]).map(o=>({source:"compatibility",severity:o.severity,code:o.code,message:o.message}))];return{ok:i.every(o=>o.severity!=="error"),capabilities:t.used,blueprint:t,manifest:n,compatibility:a,findings:i}}import{decode as ot,encode as it}from"@toon-format/toon";(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]="65a4dbbe-c9a7-5092-a325-3ba73c0fc026")}catch{}})();var xe=Symbol.for("pm.sdk.testing.activatedFlagRegistrations");function er(r){return r[xe]}function u(r,e){return r.name??e??""}var rr={before_command:"beforeCommand",before_mutation:"beforeMutation",after_command:"afterCommand",on_read:"onRead",on_write:"onWrite",on_index:"onIndex"},F={before_command:"beforeCommand",after_command:"afterCommand",on_read:"onRead",on_write:"onWrite",on_index:"onIndex"};function p(r){return r.trim().toLowerCase()}function Ee(r){return p(r).replaceAll("-","_")}function g(r){return r?` from extension "${r}"`:""}function c(r){return[...new Set(r)].sort((e,t)=>e.localeCompare(t))}function y(r){if(typeof r!="string")throw new Error('A command name string is required. Pass it via the options object, e.g. runRegisteredCommandForTest(activation, { command: "my command" }) \u2014 positional command arguments are not supported.');return r.trim().toLowerCase().split(/\s+/).filter(e=>e.length>0).join(" ")}function m(r){return r.length>0?r.join(", "):"(none)"}function be(r,e,t){let n=new Set(r??[]),a=c(e.filter(i=>!n.has(i)));if(a.length>0)throw new Error(`Expected package manifest ${t} to include ${a.join(", ")}; available: ${m(c(r??[]))}`)}function _e(r){let e=new Set;for(let t of r)typeof t.long=="string"&&t.long.trim().length>0&&e.add(t.long.trim()),typeof t.short=="string"&&t.short.trim().length>0&&e.add(t.short.trim());return e}function T(r){let e=w(r);if(!e)return{};let t=w(e.manifest);if(t)return t;let n=w(e.default);return w(n?.manifest)||(n&&typeof e.default!="function"&&("name"in n||"capabilities"in n)?n:typeof r!="function"&&("name"in e||"capabilities"in e)?e:{})}function P(r,e){return e??(typeof r.name=="string"&&r.name.trim().length>0?r.name.trim():"test-extension")}function $e(r,e){return Array.isArray(e.capabilities)?[...e.capabilities]:Array.isArray(r.capabilities)?r.capabilities.filter(t=>typeof t=="string"):[]}function ke(r,e,t){return{disabled_by_flag:!1,roots:{global:"",project:""},configured_enabled:[],configured_disabled:[],discovered:[],effective:[],warnings:[],policy:t.policy,failed:[],loaded:[{layer:t.layer,directory:"",manifest_path:"",name:t.name,version:typeof e.version=="string"?e.version:"0.0.0",entry:typeof e.entry=="string"?e.entry:"./index.js",priority:typeof e.priority=="number"?e.priority:0,entry_path:"",capabilities:t.capabilities,manifest_version:typeof e.manifest_version=="number"?e.manifest_version:void 0,pm_min_version:typeof e.pm_min_version=="string"?e.pm_min_version:void 0,pm_max_version:typeof e.pm_max_version=="string"?e.pm_max_version:void 0,engines:e.engines,trusted:e.trusted,provenance:e.provenance,sandbox_profile:e.sandbox_profile,permissions:e.permissions,activation:e.activation,module:r}]}}async function tr(r,e={}){let t=T(r),n=await oe(ke(r,t,{name:P(t,e.name),layer:e.layer??"project",capabilities:$e(t,e),policy:e.policy??C()}));return Object.defineProperty(n.commands,xe,{value:n.registrations,enumerable:!1}),n}async function nr(r,e={}){let t=T(r);return ne(ke(r,t,{name:P(t,e.name),layer:e.layer??"project",capabilities:$e(t,{}),policy:C()}),e.activation,e.deactivateTimeoutMs===void 0?{}:{deactivate_timeout_ms:e.deactivateTimeoutMs})}async function I(r,e){let t=y(e.command);if(t.length===0)throw new Error("Expected command name must be a non-empty string");if(!r.handlers.some(d=>d.command===t)){let d=c(r.handlers.map(l=>l.command));throw new Error(`Expected a registered command handler for "${t}" to invoke. Available command handlers: ${m(d)}`)}if(e.sdk!==void 0&&e.sdkFactory!==void 0)throw new TypeError("runRegisteredCommandForTest accepts sdk or sdkFactory, not both");let n=e.pmRoot??"",a={json:!0,quiet:!0,noPager:!0,...e.global},i=e.sdk??e.sdkFactory?.({pmRoot:n,global:a})??(n.length>0?ce(n,new ue({pmRoot:n}),void 0,t):void 0),o=er(r),s=e.options?{...e.options}:{};return J(r,{command:t,args:e.args?[...e.args]:[],options:o===void 0?s:fe(s,le(o,t),t),global:a,pm_root:n,...i===void 0?{}:{sdk:i}})}async function or(r,e){if((r.beforeMutation?.length??0)===0)throw new Error("Expected a registered before_mutation hook to invoke");await z(r,e.context)}async function ir(r,e){let t=e.kind;if(t==="before_mutation")throw new Error("Invoke before_mutation hooks with runRegisteredMutationGuardForTest so denials and failures retain fail-closed semantics.");if((r[F[t]]?.length??0)===0){let n=c(Object.keys(F).filter(a=>(r[F[a]]?.length??0)>0));throw new Error(`Expected a registered "${t}" hook to invoke. Hook kinds with registrations: ${m(n)}`)}switch(e.kind){case"before_command":return V(r,e.context);case"after_command":return G(r,e.context);case"on_read":return Y(r,e.context);case"on_write":return W(r,e.context);case"on_index":return X(r,e.context)}}async function ar(r,e){let t=y(e.command);if(!r.overrides.some(n=>n.command===t))throw new Error(`Expected a registered parser override for command "${t}" to invoke. Available parser override commands: ${m(c(r.overrides.map(n=>n.command)))}`);return Q(r,e)}async function sr(r,e){if(r.overrides.length===0)throw new Error("Expected a registered preflight override to invoke, but none are registered.");return Z(r,e)}async function dr(r,e){let t=y(e.command);if(!r.overrides.some(n=>n.command===t))throw new Error(`Expected a registered command override for command "${t}" to invoke. Available command override commands: ${m(c(r.overrides.map(n=>n.command)))}`);return re(r,e)}async function mr(r,e){if(!r.overrides.some(t=>t.format===e.format))throw new Error(`Expected a registered renderer override for format "${e.format}" to invoke. Available renderer override formats: ${m(c(r.overrides.map(t=>t.format)))}`);return te(r,e)}async function cr(r,e){if(!r.overrides.some(t=>t.service===e.service))throw new Error(`Expected a registered service override for service "${e.service}" to invoke. Available service override services: ${m(c(r.overrides.map(t=>t.service)))}`);return ee(r,e)}var lr={query:["query"],embed:["embed"],embedBatch:["embedBatch","embed_batch"],queryExpansion:["queryExpansion","query_expansion"],rerank:["rerank"]};async function fr(r,e){let t=se(r,e.provider);if(!t){let i=c(r.search_providers.map(o=>o.definition.name));throw new Error(`Expected a registered search provider "${e.provider}" to invoke. Available search providers: ${m(i)}`)}let n=t.runtime_definition,a=lr[e.operation].map(i=>n[i]).find(i=>typeof i=="function");if(typeof a!="function")throw new Error(`Registered search provider "${e.provider}" does not implement the "${e.operation}" operation.`);return await a(e.context)}async function pr(r,e){let t=de(r,e.adapter);if(!t){let a=c(r.vector_store_adapters.map(i=>i.definition.name));throw new Error(`Expected a registered vector store adapter "${e.adapter}" to invoke. Available vector store adapters: ${m(a)}`)}let n=t.runtime_definition[e.operation];if(typeof n!="function")throw new Error(`Registered vector store adapter "${e.adapter}" does not implement the "${e.operation}" operation.`);return await n(e.context)}async function gr(r,e){let t=Ne(r,{migration:e.migration,extensionName:e.extensionName}),n=me(t).run;if(typeof n!="function")throw new Error(`Registered migration "${e.migration}" does not implement a run function to invoke.`);let a=t.definition.status,i={id:t.definition.id,command:"migration",layer:t.layer,extension:t.name,pm_root:e.pmRoot??"",status:(typeof a=="string"?a.trim().toLowerCase():"")||"pending"};return await n(i)}async function ur(r,e){let t=Ce(r.registrations,{importer:e.importer,extensionName:e.extensionName});return I(r.commands,{command:`${t.importer} import`,args:e.args,options:e.options,global:e.global,pmRoot:e.pmRoot})}async function vr(r,e){let t=Re(r.registrations,{exporter:e.exporter,extensionName:e.extensionName});return I(r.commands,{command:`${t.exporter} export`,args:e.args,options:e.options,global:e.global,pmRoot:e.pmRoot})}function at(r,e={}){let t=e.deactivated??1;if(r.deactivated!==t)throw new Error(`Expected ${t} extension${t===1?"":"s"} to deactivate cleanly, but ${r.deactivated} did.`);let n=e.failed??0;if(r.failed.length!==n){let a=r.failed.map(i=>`${i.layer}:${i.name} (${i.error})`).join(", ");throw new Error(`Expected ${n} teardown failure${n===1?"":"s"}, but observed ${r.failed.length}${a.length>0?`: ${a}`:""}.`)}return r}function st(r,e){if(e.packageName!==void 0&&r.package_name!==e.packageName)throw new Error(`Expected package manifest package_name to be "${e.packageName}"; received "${r.package_name??"(none)"}"`);if(e.aliases!==void 0&&be(r.aliases,e.aliases,"aliases"),e.resources!==void 0)for(let[t,n]of Object.entries(e.resources))be(r.resources[t],n,`pm.${t}`);return r}function hr(r,e){let t=y(u(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.commands.filter(o=>o.command===t),a=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!a){let o=r.commands.map(d=>d.command).sort((d,l)=>d.localeCompare(l)),s=e.extensionName?` from extension "${e.extensionName}"`:"";throw new Error(`Expected extension command "${t}"${s} to be registered. Available commands: ${m(o)}`)}if(e.action!==void 0&&a.action!==e.action)throw new Error(`Expected extension command "${t}" action "${e.action}", received "${a.action}"`);if(e.arguments!==void 0){let o=(a.arguments??[]).map(d=>d.name),s=e.arguments.filter(d=>!o.includes(d));if(s.length>0)throw new Error(`Expected extension command "${t}" arguments ${m(e.arguments)}; missing ${m(s)}; available ${m(o)}`)}let i=r.flags.filter(o=>o.target_command===t&&(e.extensionName===void 0||o.name===e.extensionName)).flatMap(o=>o.flags);if(e.flags!==void 0){let o=_e(i),s=e.flags.filter(d=>!o.has(d));if(s.length>0)throw new Error(`Expected extension command "${t}" flags ${m(e.flags)}; missing ${m(s)}; available ${m([...o].sort((d,l)=>d.localeCompare(l)))}`)}return{command:a,flags:i}}function yr(r,e){let t=y(u(e,e.targetCommand));if(t.length===0)throw new Error("Expected target command name must be a non-empty string");let n=r.flags.filter(i=>i.target_command===t),a;if(e.extensionName)a=n.find(i=>i.name===e.extensionName);else if(n.length===1)a=n[0];else if(n.length>1){let i=c(n.map(o=>o.name));throw new Error(`Expected flags for target command "${t}" matched multiple extensions: ${m(i)}. Specify extensionName to choose one registration.`)}if(!a){let i=c(r.flags.map(s=>s.target_command)),o=c(n.map(s=>s.name));throw new Error(`Expected flags for target command "${t}"${g(e.extensionName)} to be registered. Available flag target commands: ${m(i)}; matching extensions: ${m(o)}`)}if(e.flags!==void 0){let i=_e(a.flags),o=e.flags.filter(s=>!i.has(s));if(o.length>0)throw new Error(`Expected flags for target command "${t}" to include ${m(e.flags)}; missing ${m(o)}; available ${m([...i].sort((s,d)=>s.localeCompare(d)))}`)}return a}function wr(r,e){let t=rr[e.kind],n=r[t]??[],a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(n.map(o=>o.name));throw new Error(`Expected a "${e.kind}" hook${g(e.extensionName)} to be registered. Available "${e.kind}" hooks: ${m(i)}`)}return a}function Er(r,e){let t=p(u(e,e.provider));if(t.length===0)throw new Error("Expected search provider name must be a non-empty string");let n=r.search_providers.filter(i=>p(i.definition.name)===t),a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(r.search_providers.map(o=>o.definition.name));throw new Error(`Expected search provider "${t}"${g(e.extensionName)} to be registered. Available search providers: ${m(i)}`)}return a}function br(r,e){let t=p(u(e,e.adapter));if(t.length===0)throw new Error("Expected vector store adapter name must be a non-empty string");let n=r.vector_store_adapters.filter(i=>p(i.definition.name)===t),a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(r.vector_store_adapters.map(o=>o.definition.name));throw new Error(`Expected vector store adapter "${t}"${g(e.extensionName)} to be registered. Available vector store adapters: ${m(i)}`)}return a}function Ce(r,e){let t=p(u(e,e.importer));if(t.length===0)throw new Error("Expected importer name must be a non-empty string");let n=r.importers.filter(i=>p(i.importer)===t),a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(r.importers.map(o=>o.importer));throw new Error(`Expected importer "${t}"${g(e.extensionName)} to be registered. Available importers: ${m(i)}`)}return a}function Re(r,e){let t=p(u(e,e.exporter));if(t.length===0)throw new Error("Expected exporter name must be a non-empty string");let n=r.exporters.filter(i=>p(i.exporter)===t),a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(r.exporters.map(o=>o.exporter));throw new Error(`Expected exporter "${t}"${g(e.extensionName)} to be registered. Available exporters: ${m(i)}`)}return a}function xr(r,e){let t=p(u(e,e.field));if(t.length===0)throw new Error("Expected item field name must be a non-empty string");let n=r.item_fields.filter(a=>e.extensionName===void 0||a.name===e.extensionName).map(a=>({registration:a,field:a.fields.find(i=>p(i.name)===t)})).filter(a=>a.field!==void 0).find(a=>e.type===void 0||a.field.type===e.type);if(!n){let a=c(r.item_fields.flatMap(i=>i.fields.map(o=>`${o.name}:${o.type}`)));throw new Error(`Expected item field "${t}"${g(e.extensionName)} to be registered. Available item fields: ${m(a)}`)}return n}function _r(r,e){let t=p(u(e,e.itemType));if(t.length===0)throw new Error("Expected item type name must be a non-empty string");let n=r.item_types.filter(a=>e.extensionName===void 0||a.name===e.extensionName).map(a=>({registration:a,itemType:a.types.find(i=>p(i.name)===t)})).filter(a=>a.itemType!==void 0).find(a=>e.folder===void 0||a.itemType.folder===e.folder);if(!n){let a=c(r.item_types.flatMap(i=>i.types.map(o=>`${o.name}:${o.folder}`)));throw new Error(`Expected item type "${t}"${g(e.extensionName)} to be registered. Available item types: ${m(a)}`)}return n}function $r(r,e){let t=Ee(u(e,e.profile));if(t.length===0)throw new Error("Expected profile name must be a non-empty string");let n=r.profiles.filter(a=>e.extensionName===void 0||a.name===e.extensionName).find(a=>Ee(a.profile.name)===t);if(!n){let a=c(r.profiles.map(i=>i.profile.name));throw new Error(`Expected profile "${t}"${g(e.extensionName)} to be registered. Available profiles: ${m(a)}`)}return{registration:n,profile:n.profile}}function kr(r,e){let t=y(u(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.overrides.filter(i=>i.command===t),a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(r.overrides.map(o=>o.command));throw new Error(`Expected command override "${t}"${g(e.extensionName)} to be registered. Available command overrides: ${m(i)}`)}return a}function Cr(r,e){let t=y(u(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.overrides.filter(i=>i.command===t),a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(r.overrides.map(o=>o.command));throw new Error(`Expected parser override "${t}"${g(e.extensionName)} to be registered. Available parser overrides: ${m(i)}`)}return a}function Rr(r,e={}){let t=e.extensionName?r.overrides.find(n=>n.name===e.extensionName):r.overrides[0];if(!t){let n=c(r.overrides.map(a=>a.name));throw new Error(`Expected a preflight override${g(e.extensionName)} to be registered. Available preflight overrides: ${m(n)}`)}return t}function Nr(r,e){let t=p(u(e,e.format));if(t.length===0)throw new Error("Expected renderer format must be a non-empty string");let n=r.overrides.filter(i=>i.format===t),a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(r.overrides.map(o=>o.format));throw new Error(`Expected renderer override "${t}"${g(e.extensionName)} to be registered. Available renderer overrides: ${m(i)}`)}return a}function Sr(r,e){let t=p(u(e,e.service));if(t.length===0)throw new Error("Expected service name must be a non-empty string");let n=r.overrides.filter(i=>p(i.service)===t),a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(r.overrides.map(o=>o.service));throw new Error(`Expected service override "${t}"${g(e.extensionName)} to be registered. Available service overrides: ${m(i)}`)}return a}function Ne(r,e){let t=p(u(e,e.migration));if(t.length===0)throw new Error("Expected migration id must be a non-empty string");let n=r.migrations.filter(s=>(e.extensionName===void 0||s.name===e.extensionName)&&typeof s.definition.id=="string"&&p(s.definition.id)===t),a=n.find(s=>e.mandatory===void 0||(s.definition.mandatory??!1)===e.mandatory);if(a)return a;let i=n[0];if(i!==void 0)throw new Error(`Expected migration "${t}"${g(e.extensionName)} to have mandatory=${e.mandatory}, but it is mandatory=${i.definition.mandatory??!1}.`);let o=c(r.migrations.map(s=>`${typeof s.definition.id=="string"&&s.definition.id.trim().length>0?s.definition.id.trim():"(unnamed)"}:${s.definition.mandatory===!0}`));throw new Error(`Expected migration "${t}"${g(e.extensionName)} to be registered. Available migrations: ${m(o)}`)}function Or(r,e){let t=(d,l)=>{let b=new Set;for(let M of d){let j=x(M);if(j===null)throw new Error(`Expected ${l} capability "${M}" to be a known extension capability. Use canonical capability names (see manifest.capabilities).`);b.add(j)}return b},n=[...t(e.declared,"declared")].sort((d,l)=>d.localeCompare(l)),a=t(e.allowUnused??[],"allowUnused"),i=ie(r,{extensionName:e.extensionName}),o=new Set(i),s=n.filter(d=>!o.has(d)&&!a.has(d));if(s.length>0){let d=g(e.extensionName);throw new Error(`Expected every declared capability${d} to be exercised, but [${s.join(", ")}] ${s.length===1?"is":"are"} declared yet never registered against. Remove ${s.length===1?"it":"them"} from manifest.capabilities for least privilege, or pass allowUnused for capabilities registered only behind a runtime flag.`)}return{declared:n,used:i,unused:s}}function dt(r,e={}){let t=k(r,e);if(!t.ok){let n=t.findings.filter(a=>a.severity==="error");throw new Error(`Extension blueprint failed preflight with ${n.length} ${n.length===1?"error":"errors"}:
1
+ import{N as ge,Ua as ue,k as ce}from"./chunk-GOLQYO6M.js";import{x as le,y as fe}from"./chunk-WWW5WHHJ.js";import{m as R,ra as pe}from"./chunk-QCTA2UFR.js";import{R as ae,Y as se,Z as de,_ as me}from"./chunk-GZ52WAY2.js";import{Db as w,Dc as K,Eb as L,Ic as q,Jc as U,Nc as V,Oc as z,Pc as G,Qc as W,Rc as Y,Sc as X,Tc as J,Uc as Q,Vc as Z,Wc as ee,Xc as re,Yc as te,cd as ne,dd as oe,jd as ie,nc as v,qc as x,rc as H,sb as B,tb as D}from"./chunk-PZI6CR24.js";import{k as C}from"./chunk-O4ZLEN4T.js";(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]="52f6eff3-e226-56d9-893a-f16997d11c50")}catch{}})();function Dr(r){return r}function Lr(r){return r}function Se(r,e){for(let t of e.commands??[])r.registerCommand(t);for(let[t,n]of Object.entries(e.commandOverrides??{}))r.registerCommand(t,n);for(let[t,n]of Object.entries(e.flags??{}))r.registerFlags(t,n);for(let[t,n]of Object.entries(e.parsers??{}))r.registerParser(t,n);for(let[t,n]of Object.entries(e.renderers??{}))if(typeof n=="function")r.registerRenderer(t,n);else{let{run:a,...i}=n;r.registerRenderer(t,a,i)}for(let[t,n]of Object.entries(e.services??{}))r.registerService(t,n)}function Oe(r,e){for(let i of e.preflights??[])r.registerPreflight(i);let t=e.itemTypes??[];t.length>0&&r.registerItemTypes(t);let n=e.itemFields??[];n.length>0&&r.registerItemFields(n);let a=e.relationshipKinds??[];a.length>0&&r.registerRelationshipKinds(a);for(let i of e.migrations??[])r.registerMigration(i);for(let i of e.profiles??[])r.registerProfile(i)}function Ae(r,e){for(let t of e.searchProviders??[])r.registerSearchProvider(t);for(let t of e.vectorStoreAdapters??[])r.registerVectorStoreAdapter(t);for(let t of e.assuranceProviders??[])r.registerAssuranceMeasurementProvider(t);for(let t of e.importers??[])r.registerImporter(t.name,t.importer,t.options);for(let t of e.exporters??[])r.registerExporter(t.name,t.exporter,t.options)}function Fe(r,e){for(let t of e.beforeCommand??[])r.hooks.beforeCommand(t);for(let t of e.beforeMutation??[])r.hooks.beforeMutation(t);for(let t of e.afterCommand??[])r.hooks.afterCommand(t);for(let t of e.onWrite??[])r.hooks.onWrite(t);for(let t of e.onRead??[])r.hooks.onRead(t);for(let t of e.onIndex??[])r.hooks.onIndex(t)}function Te(r){let e={activate:async t=>{Se(t,r),Oe(t,r),Ae(t,r),Fe(t,r.hooks??{}),await r.activate?.(t)}};return r.manifest&&(e.manifest=r.manifest),r.deactivate&&(e.deactivate=r.deactivate),e}function h(r){let e=r.flatMap(t=>t??[]);return e.length>0?e:void 0}function _(r){let e=Object.assign({},...r.map(t=>t??{}));return Object.keys(e).length>0?e:void 0}function Pe(r){let e={};for(let t of r)for(let[n,a]of Object.entries(t??{}))e[n]=[...e[n]??[],...a];return Object.keys(e).length>0?e:void 0}var Ie=["beforeCommand","beforeMutation","afterCommand","onWrite","onRead","onIndex"];function Me(r,e,t){let n=e.map(i=>i?.[t]),a=h(n);if(a!==void 0){let i=r;i[t]=a}}function je(r){let e={};for(let t of Ie)Me(e,r,t);return Object.keys(e).length>0?e:void 0}function Hr(...r){let e={},t=(o,s)=>{s!==void 0&&(e[o]=s)};t("commands",h(r.map(o=>o.commands))),t("commandOverrides",_(r.map(o=>o.commandOverrides))),t("flags",Pe(r.map(o=>o.flags))),t("parsers",_(r.map(o=>o.parsers))),t("renderers",_(r.map(o=>o.renderers))),t("services",_(r.map(o=>o.services))),t("preflights",h(r.map(o=>o.preflights))),t("itemTypes",h(r.map(o=>o.itemTypes))),t("itemFields",h(r.map(o=>o.itemFields))),t("relationshipKinds",h(r.map(o=>o.relationshipKinds))),t("migrations",h(r.map(o=>o.migrations))),t("profiles",h(r.map(o=>o.profiles))),t("searchProviders",h(r.map(o=>o.searchProviders))),t("vectorStoreAdapters",h(r.map(o=>o.vectorStoreAdapters))),t("assuranceProviders",h(r.map(o=>o.assuranceProviders))),t("importers",h(r.map(o=>o.importers))),t("exporters",h(r.map(o=>o.exporters))),t("hooks",je(r.map(o=>o.hooks)));let n;for(let o of r)o.manifest&&(n=o.manifest);t("manifest",n);let a=r.some(o=>o.activate);t("activate",a?async o=>{for(let s of r)s.activate&&await s.activate(o)}:void 0);let i=r.some(o=>o.deactivate);return t("deactivate",i?async()=>{let o=[];for(let s of[...r].reverse())if(s.deactivate)try{await s.deactivate()}catch(d){o.push(d)}if(o.length>0)throw o.length>1?new AggregateError(o,"Multiple extension blueprint deactivate hooks failed."):o[0]}:void 0),e}var Be=[["commands","commands"],["commandOverrides","commands"],["flags","schema"],["itemTypes","schema"],["itemFields","schema"],["relationshipKinds","schema"],["migrations","schema"],["profiles","schema"],["parsers","parser"],["renderers","renderers"],["services","services"],["preflights","preflight"],["searchProviders","search"],["vectorStoreAdapters","search"],["assuranceProviders","services"],["importers","importers"],["exporters","importers"]];function $(r){return r?Array.isArray(r)?r.length>0:Object.keys(r).length>0:!1}function N(r){let e=new Set;for(let[a,i]of Be)$(r[a])&&e.add(i);(r.commands??[]).filter(E).some(a=>a.flags!==void 0)&&e.add("schema");let t=[...r.importers??[],...r.exporters??[]].filter(E);t.some(a=>a?.options?.flags!==void 0)&&e.add("schema"),t.some(a=>typeof a=="object")&&e.add("commands");let n=r.hooks??{};return[n.beforeCommand,n.beforeMutation,n.afterCommand,n.onWrite,n.onRead,n.onIndex].some($)&&e.add("hooks"),[...e].sort((a,i)=>a.localeCompare(i))}var De=[["beforeCommand","before_command"],["beforeMutation","before_mutation"],["afterCommand","after_command"],["onWrite","on_write"],["onRead","on_read"],["onIndex","on_index"]];function f(r){return[...new Set(r)].sort((e,t)=>e.localeCompare(t))}function E(r){return r!=null}function S(r){return v(`${r.name} import`)}function O(r){return v(`${r.name} export`)}function Le(r,e,t){return[...r.map(n=>v(n.name)),...e.filter(n=>n.options!==void 0).map(S),...t.filter(n=>n.options!==void 0).map(O)]}function He(r,e,t,n){return[...Object.keys(r.flags??{}).map(a=>v(a)),...e.filter(a=>a.flags!==void 0).map(a=>v(a.name)),...t.filter(a=>a.options?.flags!==void 0).map(S),...n.filter(a=>a.options?.flags!==void 0).map(O)]}function Ke(r){return De.filter(([e])=>(r[e]?.length??0)>0).map(([,e])=>e)}function qe(r){let e=Object.entries(r??{}).filter(([,t])=>typeof t!="function"&&((t.commands?.length??0)>0||t.resultDiscriminator!==void 0)).map(([t,n])=>{let a=n;return{format:t,commands:f((a.commands??[]).map(i=>v(i))),result_discriminator:a.resultDiscriminator!==void 0}}).sort((t,n)=>t.format.localeCompare(n.format));return e.length>0?{renderer_ownership:e}:{}}function Ue(r){return!r||r.length===0?{}:{assurance_providers:f(r.map(e=>e.id))}}function Ve(r,e,t){return{item_types:f((r.itemTypes??[]).map(n=>n.name)),item_fields:f((r.itemFields??[]).map(n=>n.name)),...(r.relationshipKinds?.length??0)>0?{relationship_kinds:f(r.relationshipKinds.map(n=>n.kind))}:{},migrations:f((r.migrations??[]).flatMap(n=>typeof n.id=="string"?[n.id]:[])),profiles:f((r.profiles??[]).map(n=>n.name)),importers:f(e.map(n=>v(n.name))),exporters:f(t.map(n=>v(n.name))),search_providers:f((r.searchProviders??[]).map(n=>n.name)),vector_store_adapters:f((r.vectorStoreAdapters??[]).map(n=>n.name)),...Ue(r.assuranceProviders),parser_overrides:f(Object.keys(r.parsers??{}).map(n=>v(n))),service_overrides:f(Object.keys(r.services??{}).map(n=>String(n).trim().toLowerCase())),renderer_overrides:f(Object.keys(r.renderers??{}).map(n=>String(n).trim().toLowerCase())),...qe(r.renderers),preflight_overrides:(r.preflights??[]).length,preflight_ownership:(r.preflights??[]).map(n=>({commands:[...n.commands??[]]}))}}function ze(r){let e=(r.commands??[]).filter(E),t=(r.importers??[]).filter(E),n=(r.exporters??[]).filter(E),a=t.map(S),i=n.map(O),o=Le(e,t,n),s=He(r,e,t,n),d=r.hooks??{},l=Ve(r,t,n);return{capabilities:N(r),commands:f(o),command_overrides:f(Object.keys(r.commandOverrides??{}).map(b=>v(b))),command_handlers:f([...o,...a,...i]),hooks:Ke(d),flag_commands:f(s),...l}}var Ge=["commands","commandOverrides","flags","parsers","renderers","services","preflights","itemTypes","itemFields","relationshipKinds","migrations","profiles","searchProviders","vectorStoreAdapters","assuranceProviders","importers","exporters"];function We(r){return(r.itemFields??[]).filter(e=>typeof e?.name=="string"&&ae.has(e.name.trim())).map(e=>({code:"reserved_item_field",severity:"error",message:`Item field "${e.name}" collides with reserved item metadata; rename it with an extension-specific prefix before publishing.`,field:e.name}))}function Ye(r){return[...Object.values(r.flags??{}).flat(),...(r.commands??[]).flatMap(e=>e.flags??[]),...(r.importers??[]).flatMap(e=>e.options?.flags??[]),...(r.exporters??[]).flatMap(e=>e.options?.flags??[])].flatMap(e=>{if(typeof e?.long!="string"&&typeof e?.short!="string")return[];let t=B(e.long,e.short);if(t===null)return[];let{token:n,failure:a}=t;return[{code:a,severity:"error",message:`Flag "${n}" ${D(n,a)}.`,field:n}]})}function he(r){let e=new Set;for(let t of r){let n=H(t)??x(t);n!==null&&e.add(n)}return[...e].sort((t,n)=>t.localeCompare(n))}function Xe(r,e){let t=[];if(e===null)return r.length>0&&t.push({code:"manifest_capabilities_absent",severity:"warning",message:`Blueprint exercises ${r.length===1?"capability":"capabilities"} [${r.join(", ")}] but declares none; set capabilities to deriveExtensionCapabilities(blueprint) so the manifest grant matches.`}),t;let n=new Set(e),a=new Set(r);for(let i of r)n.has(i)||t.push({code:"capability_undeclared",severity:"error",message:`Blueprint exercises capability "${i}" but it is absent from the declared capabilities; activation throws extension_capability_missing \u2014 add "${i}" to the manifest capabilities.`,capability:i});for(let i of e)a.has(i)||t.push({code:"capability_unused",severity:"warning",message:`Capability "${i}" is declared but no blueprint surface exercises it; drop it to keep the manifest least-privilege (pm package doctor reports this as extension_capability_unused).`,capability:i});return t}function Je(r){let e=[],t=new Map;for(let a of r.commands??[]){let i=v(a.name);t.set(i,(t.get(i)??0)+1)}for(let[a,i]of t)i>1&&e.push({code:"duplicate_command",severity:"warning",message:`Command "${a}" is declared ${i} times in commands; the later registration shadows the earlier one at dispatch.`,command:a});let n=new Set(Object.keys(r.commandOverrides??{}).map(a=>v(a)));for(let a of t.keys())n.has(a)&&e.push({code:"command_override_conflict",severity:"warning",message:`Command "${a}" is declared both as a new command definition and as a command override; register one or the other.`,command:a});return e}function Qe(r){let e=[];for(let t of Ge)t in r&&!$(r[t])&&e.push({code:"empty_surface",severity:"warning",message:`Blueprint field "${t}" is present but empty; remove it or populate it.`,field:t});if("hooks"in r){let t=r.hooks??{};[t.beforeCommand,t.beforeMutation,t.afterCommand,t.onWrite,t.onRead,t.onIndex].some($)||e.push({code:"empty_surface",severity:"warning",message:'Blueprint field "hooks" is present but registers no lifecycle hooks; remove it or populate it.',field:"hooks"})}return e}function k(r,e={}){let t=N(r),n=e.declaredCapabilities??r.manifest?.capabilities,a=Array.isArray(n)?he(n):null,i=[...Xe(t,a),...Je(r),...Ye(r),...We(r),...Qe(r)];return{ok:i.every(o=>o.severity!=="error"),findings:i,used:t,declared:a}}function ye(r,e){let{additionalCapabilities:t,...n}=e,a=Array.isArray(t)?he(t):[],i=[...new Set([...N(r),...a])].sort((o,s)=>o.localeCompare(s));return{...n,capabilities:i}}function Kr(r,e){let t=ye(r,e);return{module:Te({...r,manifest:t}),manifest:t}}function ve(r,e){if(r.status==="absent"||r.status==="ok")return null;let t=`${r.kind}_${r.status}`,n="";switch(t){case"pm_min_version_invalid":n=`pm_min_version "${r.required}" is not a valid version; the extension is treated as incompatible and the loader skips it.`;break;case"pm_min_version_unchecked":n=`pm_min_version "${r.required}" could not be compared against pm ${e}; compatibility is unverified.`;break;case"pm_min_version_unmet":n=`Requires pm >= ${r.required} but the target is pm ${e}; the loader skips the extension.`;break;case"pm_max_version_invalid":n=`pm_max_version "${r.required}" is not a valid inclusive upper bound (version ranges are not allowed); the extension is treated as incompatible and the loader skips it.`;break;case"pm_max_version_unchecked":n=`pm_max_version "${r.required}" could not be compared against pm ${e}; compatibility is unverified.`;break;case"pm_max_version_exceeded":n=`Allows pm <= ${r.required} but the target is pm ${e}; the loader skips the extension.`;break;case"pm_max_version_exceeded_warn":n=`Target pm ${e} is newer than pm_max_version ${r.required}, but the "warn" exceeded mode lets it load with a warning.`;break}return{code:t,severity:r.allowed?"warning":"error",constraint:r.kind,required:r.required,current:e,message:n}}function A(r,e){let t=q(r.pm_min_version,e.pmVersion),n=U(r.pm_max_version,e.pmVersion,e.pmMaxVersionExceededMode??"block"),a=K(r).findings.map(d=>({code:d.code,severity:"warning",constraint:"manifest",required:d.code==="manifest_unknown_key"?d.path:"pm_min_version",current:e.pmVersion,path:d.path,...d.suggested_key?{suggested_key:d.suggested_key}:{},message:d.message})),i=[],o=ve(t,e.pmVersion);o!==null&&i.push(o);let s=ve(n,e.pmVersion);return s!==null&&i.push(s),{compatible:t.allowed&&n.allowed,findings:[...a,...i],pmVersion:e.pmVersion}}var Ze=new Set(["capability_undeclared","capability_unused","manifest_capabilities_absent"]);function we(r,e={}){let t=k(r,{declaredCapabilities:e.declaredCapabilities}),n=e.identity?ye(r,e.identity):null,a=e.target?A(n??r.manifest??{},e.target):null,i=[...(n!==null&&e.declaredCapabilities===void 0?t.findings.filter(o=>!Ze.has(o.code)):t.findings).map(o=>({source:"blueprint",severity:o.severity,code:o.code,message:o.message})),...(a?.findings??[]).map(o=>({source:"compatibility",severity:o.severity,code:o.code,message:o.message}))];return{ok:i.every(o=>o.severity!=="error"),capabilities:t.used,blueprint:t,manifest:n,compatibility:a,findings:i}}import{decode as ot,encode as it}from"@toon-format/toon";(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]="65a4dbbe-c9a7-5092-a325-3ba73c0fc026")}catch{}})();var xe=Symbol.for("pm.sdk.testing.activatedFlagRegistrations");function er(r){return r[xe]}function u(r,e){return r.name??e??""}var rr={before_command:"beforeCommand",before_mutation:"beforeMutation",after_command:"afterCommand",on_read:"onRead",on_write:"onWrite",on_index:"onIndex"},F={before_command:"beforeCommand",after_command:"afterCommand",on_read:"onRead",on_write:"onWrite",on_index:"onIndex"};function p(r){return r.trim().toLowerCase()}function Ee(r){return p(r).replaceAll("-","_")}function g(r){return r?` from extension "${r}"`:""}function c(r){return[...new Set(r)].sort((e,t)=>e.localeCompare(t))}function y(r){if(typeof r!="string")throw new Error('A command name string is required. Pass it via the options object, e.g. runRegisteredCommandForTest(activation, { command: "my command" }) \u2014 positional command arguments are not supported.');return r.trim().toLowerCase().split(/\s+/).filter(e=>e.length>0).join(" ")}function m(r){return r.length>0?r.join(", "):"(none)"}function be(r,e,t){let n=new Set(r??[]),a=c(e.filter(i=>!n.has(i)));if(a.length>0)throw new Error(`Expected package manifest ${t} to include ${a.join(", ")}; available: ${m(c(r??[]))}`)}function _e(r){let e=new Set;for(let t of r)typeof t.long=="string"&&t.long.trim().length>0&&e.add(t.long.trim()),typeof t.short=="string"&&t.short.trim().length>0&&e.add(t.short.trim());return e}function T(r){let e=w(r);if(!e)return{};let t=w(e.manifest);if(t)return t;let n=w(e.default);return w(n?.manifest)||(n&&typeof e.default!="function"&&("name"in n||"capabilities"in n)?n:typeof r!="function"&&("name"in e||"capabilities"in e)?e:{})}function P(r,e){return e??(typeof r.name=="string"&&r.name.trim().length>0?r.name.trim():"test-extension")}function $e(r,e){return Array.isArray(e.capabilities)?[...e.capabilities]:Array.isArray(r.capabilities)?r.capabilities.filter(t=>typeof t=="string"):[]}function ke(r,e,t){return{disabled_by_flag:!1,roots:{global:"",project:""},configured_enabled:[],configured_disabled:[],discovered:[],effective:[],warnings:[],policy:t.policy,failed:[],loaded:[{layer:t.layer,directory:"",manifest_path:"",name:t.name,version:typeof e.version=="string"?e.version:"0.0.0",entry:typeof e.entry=="string"?e.entry:"./index.js",priority:typeof e.priority=="number"?e.priority:0,entry_path:"",capabilities:t.capabilities,manifest_version:typeof e.manifest_version=="number"?e.manifest_version:void 0,pm_min_version:typeof e.pm_min_version=="string"?e.pm_min_version:void 0,pm_max_version:typeof e.pm_max_version=="string"?e.pm_max_version:void 0,engines:e.engines,trusted:e.trusted,provenance:e.provenance,sandbox_profile:e.sandbox_profile,permissions:e.permissions,activation:e.activation,module:r}]}}async function tr(r,e={}){let t=T(r),n=await oe(ke(r,t,{name:P(t,e.name),layer:e.layer??"project",capabilities:$e(t,e),policy:e.policy??C()}));return Object.defineProperty(n.commands,xe,{value:n.registrations,enumerable:!1}),n}async function nr(r,e={}){let t=T(r);return ne(ke(r,t,{name:P(t,e.name),layer:e.layer??"project",capabilities:$e(t,{}),policy:C()}),e.activation,e.deactivateTimeoutMs===void 0?{}:{deactivate_timeout_ms:e.deactivateTimeoutMs})}async function I(r,e){let t=y(e.command);if(t.length===0)throw new Error("Expected command name must be a non-empty string");if(!r.handlers.some(d=>d.command===t)){let d=c(r.handlers.map(l=>l.command));throw new Error(`Expected a registered command handler for "${t}" to invoke. Available command handlers: ${m(d)}`)}if(e.sdk!==void 0&&e.sdkFactory!==void 0)throw new TypeError("runRegisteredCommandForTest accepts sdk or sdkFactory, not both");let n=e.pmRoot??"",a={json:!0,quiet:!0,noPager:!0,...e.global},i=e.sdk??e.sdkFactory?.({pmRoot:n,global:a})??(n.length>0?ce(n,new ue({pmRoot:n}),void 0,t):void 0),o=er(r),s=e.options?{...e.options}:{};return J(r,{command:t,args:e.args?[...e.args]:[],options:o===void 0?s:fe(s,le(o,t),t),global:a,pm_root:n,...i===void 0?{}:{sdk:i}})}async function or(r,e){if((r.beforeMutation?.length??0)===0)throw new Error("Expected a registered before_mutation hook to invoke");await z(r,e.context)}async function ir(r,e){let t=e.kind;if(t==="before_mutation")throw new Error("Invoke before_mutation hooks with runRegisteredMutationGuardForTest so denials and failures retain fail-closed semantics.");if((r[F[t]]?.length??0)===0){let n=c(Object.keys(F).filter(a=>(r[F[a]]?.length??0)>0));throw new Error(`Expected a registered "${t}" hook to invoke. Hook kinds with registrations: ${m(n)}`)}switch(e.kind){case"before_command":return V(r,e.context);case"after_command":return G(r,e.context);case"on_read":return Y(r,e.context);case"on_write":return W(r,e.context);case"on_index":return X(r,e.context)}}async function ar(r,e){let t=y(e.command);if(!r.overrides.some(n=>n.command===t))throw new Error(`Expected a registered parser override for command "${t}" to invoke. Available parser override commands: ${m(c(r.overrides.map(n=>n.command)))}`);return Q(r,e)}async function sr(r,e){if(r.overrides.length===0)throw new Error("Expected a registered preflight override to invoke, but none are registered.");return Z(r,e)}async function dr(r,e){let t=y(e.command);if(!r.overrides.some(n=>n.command===t))throw new Error(`Expected a registered command override for command "${t}" to invoke. Available command override commands: ${m(c(r.overrides.map(n=>n.command)))}`);return re(r,e)}async function mr(r,e){if(!r.overrides.some(t=>t.format===e.format))throw new Error(`Expected a registered renderer override for format "${e.format}" to invoke. Available renderer override formats: ${m(c(r.overrides.map(t=>t.format)))}`);return te(r,e)}async function cr(r,e){if(!r.overrides.some(t=>t.service===e.service))throw new Error(`Expected a registered service override for service "${e.service}" to invoke. Available service override services: ${m(c(r.overrides.map(t=>t.service)))}`);return ee(r,e)}var lr={query:["query"],embed:["embed"],embedBatch:["embedBatch","embed_batch"],queryExpansion:["queryExpansion","query_expansion"],rerank:["rerank"]};async function fr(r,e){let t=se(r,e.provider);if(!t){let i=c(r.search_providers.map(o=>o.definition.name));throw new Error(`Expected a registered search provider "${e.provider}" to invoke. Available search providers: ${m(i)}`)}let n=t.runtime_definition,a=lr[e.operation].map(i=>n[i]).find(i=>typeof i=="function");if(typeof a!="function")throw new Error(`Registered search provider "${e.provider}" does not implement the "${e.operation}" operation.`);return await a(e.context)}async function pr(r,e){let t=de(r,e.adapter);if(!t){let a=c(r.vector_store_adapters.map(i=>i.definition.name));throw new Error(`Expected a registered vector store adapter "${e.adapter}" to invoke. Available vector store adapters: ${m(a)}`)}let n=t.runtime_definition[e.operation];if(typeof n!="function")throw new Error(`Registered vector store adapter "${e.adapter}" does not implement the "${e.operation}" operation.`);return await n(e.context)}async function gr(r,e){let t=Ne(r,{migration:e.migration,extensionName:e.extensionName}),n=me(t).run;if(typeof n!="function")throw new Error(`Registered migration "${e.migration}" does not implement a run function to invoke.`);let a=t.definition.status,i={id:t.definition.id,command:"migration",layer:t.layer,extension:t.name,pm_root:e.pmRoot??"",status:(typeof a=="string"?a.trim().toLowerCase():"")||"pending"};return await n(i)}async function ur(r,e){let t=Ce(r.registrations,{importer:e.importer,extensionName:e.extensionName});return I(r.commands,{command:`${t.importer} import`,args:e.args,options:e.options,global:e.global,pmRoot:e.pmRoot})}async function vr(r,e){let t=Re(r.registrations,{exporter:e.exporter,extensionName:e.extensionName});return I(r.commands,{command:`${t.exporter} export`,args:e.args,options:e.options,global:e.global,pmRoot:e.pmRoot})}function at(r,e={}){let t=e.deactivated??1;if(r.deactivated!==t)throw new Error(`Expected ${t} extension${t===1?"":"s"} to deactivate cleanly, but ${r.deactivated} did.`);let n=e.failed??0;if(r.failed.length!==n){let a=r.failed.map(i=>`${i.layer}:${i.name} (${i.error})`).join(", ");throw new Error(`Expected ${n} teardown failure${n===1?"":"s"}, but observed ${r.failed.length}${a.length>0?`: ${a}`:""}.`)}return r}function st(r,e){if(e.packageName!==void 0&&r.package_name!==e.packageName)throw new Error(`Expected package manifest package_name to be "${e.packageName}"; received "${r.package_name??"(none)"}"`);if(e.aliases!==void 0&&be(r.aliases,e.aliases,"aliases"),e.resources!==void 0)for(let[t,n]of Object.entries(e.resources))be(r.resources[t],n,`pm.${t}`);return r}function hr(r,e){let t=y(u(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.commands.filter(o=>o.command===t),a=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!a){let o=r.commands.map(d=>d.command).sort((d,l)=>d.localeCompare(l)),s=e.extensionName?` from extension "${e.extensionName}"`:"";throw new Error(`Expected extension command "${t}"${s} to be registered. Available commands: ${m(o)}`)}if(e.action!==void 0&&a.action!==e.action)throw new Error(`Expected extension command "${t}" action "${e.action}", received "${a.action}"`);if(e.arguments!==void 0){let o=(a.arguments??[]).map(d=>d.name),s=e.arguments.filter(d=>!o.includes(d));if(s.length>0)throw new Error(`Expected extension command "${t}" arguments ${m(e.arguments)}; missing ${m(s)}; available ${m(o)}`)}let i=r.flags.filter(o=>o.target_command===t&&(e.extensionName===void 0||o.name===e.extensionName)).flatMap(o=>o.flags);if(e.flags!==void 0){let o=_e(i),s=e.flags.filter(d=>!o.has(d));if(s.length>0)throw new Error(`Expected extension command "${t}" flags ${m(e.flags)}; missing ${m(s)}; available ${m([...o].sort((d,l)=>d.localeCompare(l)))}`)}return{command:a,flags:i}}function yr(r,e){let t=y(u(e,e.targetCommand));if(t.length===0)throw new Error("Expected target command name must be a non-empty string");let n=r.flags.filter(i=>i.target_command===t),a;if(e.extensionName)a=n.find(i=>i.name===e.extensionName);else if(n.length===1)a=n[0];else if(n.length>1){let i=c(n.map(o=>o.name));throw new Error(`Expected flags for target command "${t}" matched multiple extensions: ${m(i)}. Specify extensionName to choose one registration.`)}if(!a){let i=c(r.flags.map(s=>s.target_command)),o=c(n.map(s=>s.name));throw new Error(`Expected flags for target command "${t}"${g(e.extensionName)} to be registered. Available flag target commands: ${m(i)}; matching extensions: ${m(o)}`)}if(e.flags!==void 0){let i=_e(a.flags),o=e.flags.filter(s=>!i.has(s));if(o.length>0)throw new Error(`Expected flags for target command "${t}" to include ${m(e.flags)}; missing ${m(o)}; available ${m([...i].sort((s,d)=>s.localeCompare(d)))}`)}return a}function wr(r,e){let t=rr[e.kind],n=r[t]??[],a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(n.map(o=>o.name));throw new Error(`Expected a "${e.kind}" hook${g(e.extensionName)} to be registered. Available "${e.kind}" hooks: ${m(i)}`)}return a}function Er(r,e){let t=p(u(e,e.provider));if(t.length===0)throw new Error("Expected search provider name must be a non-empty string");let n=r.search_providers.filter(i=>p(i.definition.name)===t),a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(r.search_providers.map(o=>o.definition.name));throw new Error(`Expected search provider "${t}"${g(e.extensionName)} to be registered. Available search providers: ${m(i)}`)}return a}function br(r,e){let t=p(u(e,e.adapter));if(t.length===0)throw new Error("Expected vector store adapter name must be a non-empty string");let n=r.vector_store_adapters.filter(i=>p(i.definition.name)===t),a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(r.vector_store_adapters.map(o=>o.definition.name));throw new Error(`Expected vector store adapter "${t}"${g(e.extensionName)} to be registered. Available vector store adapters: ${m(i)}`)}return a}function Ce(r,e){let t=p(u(e,e.importer));if(t.length===0)throw new Error("Expected importer name must be a non-empty string");let n=r.importers.filter(i=>p(i.importer)===t),a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(r.importers.map(o=>o.importer));throw new Error(`Expected importer "${t}"${g(e.extensionName)} to be registered. Available importers: ${m(i)}`)}return a}function Re(r,e){let t=p(u(e,e.exporter));if(t.length===0)throw new Error("Expected exporter name must be a non-empty string");let n=r.exporters.filter(i=>p(i.exporter)===t),a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(r.exporters.map(o=>o.exporter));throw new Error(`Expected exporter "${t}"${g(e.extensionName)} to be registered. Available exporters: ${m(i)}`)}return a}function xr(r,e){let t=p(u(e,e.field));if(t.length===0)throw new Error("Expected item field name must be a non-empty string");let n=r.item_fields.filter(a=>e.extensionName===void 0||a.name===e.extensionName).map(a=>({registration:a,field:a.fields.find(i=>p(i.name)===t)})).filter(a=>a.field!==void 0).find(a=>e.type===void 0||a.field.type===e.type);if(!n){let a=c(r.item_fields.flatMap(i=>i.fields.map(o=>`${o.name}:${o.type}`)));throw new Error(`Expected item field "${t}"${g(e.extensionName)} to be registered. Available item fields: ${m(a)}`)}return n}function _r(r,e){let t=p(u(e,e.itemType));if(t.length===0)throw new Error("Expected item type name must be a non-empty string");let n=r.item_types.filter(a=>e.extensionName===void 0||a.name===e.extensionName).map(a=>({registration:a,itemType:a.types.find(i=>p(i.name)===t)})).filter(a=>a.itemType!==void 0).find(a=>e.folder===void 0||a.itemType.folder===e.folder);if(!n){let a=c(r.item_types.flatMap(i=>i.types.map(o=>`${o.name}:${o.folder}`)));throw new Error(`Expected item type "${t}"${g(e.extensionName)} to be registered. Available item types: ${m(a)}`)}return n}function $r(r,e){let t=Ee(u(e,e.profile));if(t.length===0)throw new Error("Expected profile name must be a non-empty string");let n=r.profiles.filter(a=>e.extensionName===void 0||a.name===e.extensionName).find(a=>Ee(a.profile.name)===t);if(!n){let a=c(r.profiles.map(i=>i.profile.name));throw new Error(`Expected profile "${t}"${g(e.extensionName)} to be registered. Available profiles: ${m(a)}`)}return{registration:n,profile:n.profile}}function kr(r,e){let t=y(u(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.overrides.filter(i=>i.command===t),a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(r.overrides.map(o=>o.command));throw new Error(`Expected command override "${t}"${g(e.extensionName)} to be registered. Available command overrides: ${m(i)}`)}return a}function Cr(r,e){let t=y(u(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.overrides.filter(i=>i.command===t),a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(r.overrides.map(o=>o.command));throw new Error(`Expected parser override "${t}"${g(e.extensionName)} to be registered. Available parser overrides: ${m(i)}`)}return a}function Rr(r,e={}){let t=e.extensionName?r.overrides.find(n=>n.name===e.extensionName):r.overrides[0];if(!t){let n=c(r.overrides.map(a=>a.name));throw new Error(`Expected a preflight override${g(e.extensionName)} to be registered. Available preflight overrides: ${m(n)}`)}return t}function Nr(r,e){let t=p(u(e,e.format));if(t.length===0)throw new Error("Expected renderer format must be a non-empty string");let n=r.overrides.filter(i=>i.format===t),a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(r.overrides.map(o=>o.format));throw new Error(`Expected renderer override "${t}"${g(e.extensionName)} to be registered. Available renderer overrides: ${m(i)}`)}return a}function Sr(r,e){let t=p(u(e,e.service));if(t.length===0)throw new Error("Expected service name must be a non-empty string");let n=r.overrides.filter(i=>p(i.service)===t),a=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!a){let i=c(r.overrides.map(o=>o.service));throw new Error(`Expected service override "${t}"${g(e.extensionName)} to be registered. Available service overrides: ${m(i)}`)}return a}function Ne(r,e){let t=p(u(e,e.migration));if(t.length===0)throw new Error("Expected migration id must be a non-empty string");let n=r.migrations.filter(s=>(e.extensionName===void 0||s.name===e.extensionName)&&typeof s.definition.id=="string"&&p(s.definition.id)===t),a=n.find(s=>e.mandatory===void 0||(s.definition.mandatory??!1)===e.mandatory);if(a)return a;let i=n[0];if(i!==void 0)throw new Error(`Expected migration "${t}"${g(e.extensionName)} to have mandatory=${e.mandatory}, but it is mandatory=${i.definition.mandatory??!1}.`);let o=c(r.migrations.map(s=>`${typeof s.definition.id=="string"&&s.definition.id.trim().length>0?s.definition.id.trim():"(unnamed)"}:${s.definition.mandatory===!0}`));throw new Error(`Expected migration "${t}"${g(e.extensionName)} to be registered. Available migrations: ${m(o)}`)}function Or(r,e){let t=(d,l)=>{let b=new Set;for(let M of d){let j=x(M);if(j===null)throw new Error(`Expected ${l} capability "${M}" to be a known extension capability. Use canonical capability names (see manifest.capabilities).`);b.add(j)}return b},n=[...t(e.declared,"declared")].sort((d,l)=>d.localeCompare(l)),a=t(e.allowUnused??[],"allowUnused"),i=ie(r,{extensionName:e.extensionName}),o=new Set(i),s=n.filter(d=>!o.has(d)&&!a.has(d));if(s.length>0){let d=g(e.extensionName);throw new Error(`Expected every declared capability${d} to be exercised, but [${s.join(", ")}] ${s.length===1?"is":"are"} declared yet never registered against. Remove ${s.length===1?"it":"them"} from manifest.capabilities for least privilege, or pass allowUnused for capabilities registered only behind a runtime flag.`)}return{declared:n,used:i,unused:s}}function dt(r,e={}){let t=k(r,e);if(!t.ok){let n=t.findings.filter(a=>a.severity==="error");throw new Error(`Extension blueprint failed preflight with ${n.length} ${n.length===1?"error":"errors"}:
2
2
  `+n.map(a=>` - [${a.code}] ${a.message}`).join(`
3
3
  `))}return t}function mt(r,e={}){let t=ge(r),n=t.findings.filter(a=>a.severity==="error"||e.strict===!0&&a.severity==="warning");if(n.length>0)throw new Error(`Project profile "${t.profile}" failed lint with ${n.length} ${n.length===1?"issue":"issues"}:
4
4
  `+n.map(a=>` - ${a.severity} [${a.code}] ${a.message}`).join(`
5
5
  `));return t}function ct(r,e){let t=Array.isArray(r.capabilities)?r.capabilities:[],n=k(e,{declaredCapabilities:t}),a=n.declared,i=new Set(a),o=new Set(n.used),s=n.used.filter(l=>!i.has(l)),d=a.filter(l=>!o.has(l));if(s.length>0||d.length>0){let l=[];throw s.length>0&&l.push(`missing [${s.join(", ")}] (the blueprint registers ${s.length===1?"a surface":"surfaces"} requiring ${s.length===1?"it":"them"}; activation throws extension_capability_missing)`),d.length>0&&l.push(`unused [${d.join(", ")}] (declared but no surface exercises ${d.length===1?"it":"them"}; drop for least privilege)`),new Error(`Manifest capabilities do not match the blueprint: ${l.join("; ")}. Set capabilities to synthesizeExtensionManifest(blueprint, identity).capabilities to stay in sync.`)}return{used:n.used,declared:a,missing:s,unused:d,findings:n.findings}}function lt(r,e){let t=A(r,e),n=t.findings.filter(a=>a.severity==="error");if(n.length>0)throw new Error(`Extension manifest is not compatible with pm ${t.pmVersion}: ${n.map(a=>a.message).join("; ")}`);return t}function ft(r,e={}){let t=we(r,e);if(!t.ok){let n=t.findings.filter(a=>a.severity==="error");throw new Error(`Extension failed preflight with ${n.length} ${n.length===1?"error":"errors"}:
6
6
  `+n.map(a=>` - [${a.source}:${a.code}] ${a.message}`).join(`
7
7
  `))}return t}function Ar(r){if(!L(r))throw new Error("createExtensionTestHarness received a module with no activate export. Pass the extension module (with an activate(api) function on the module or its default export) as the first argument, and options second.")}async function pt(r,e={}){Ar(r);let t=T(r),n=P(t,e.name),a=e.layer??"project",i=await tr(r,e);if(i.failed.length>0){let o=i.failed.map(s=>{let d=s.trace?.missing_capability,l=d?`${s.error}; missing capability "${d}"`:s.error;return`${s.layer}:${s.name} (${l})`}).join(", ");throw new Error(`createExtensionTestHarness could not activate the extension cleanly: ${o}. Declare the required capability in the manifest (or pass it via options.capabilities), or use activateExtensionForTest directly to inspect a failed activation.`)}return{module:r,name:n,layer:a,activation:i,activationSummary(o){return R(i,o)},renderMarkdown(o={}){let{extensionName:s,...d}=o??{};return pe(R(i,{extensionName:s}),d)},assertCommandContract(o){return hr(i.registrations,o)},assertFlags(o){return yr(i.registrations,o)},assertItemField(o){return xr(i.registrations,o)},assertItemType(o){return _r(i.registrations,o)},assertProfile(o){return $r(i.registrations,o)},assertHook(o){return wr(i.hooks,o)},assertCommandOverride(o){return kr(i.commands,o)},assertParserOverride(o){return Cr(i.parsers,o)},assertPreflightOverride(o){return Rr(i.preflight,o)},assertRendererOverride(o){return Nr(i.renderers,o)},assertServiceOverride(o){return Sr(i.services,o)},assertSearchProvider(o){return Er(i.registrations,o)},assertVectorStoreAdapter(o){return br(i.registrations,o)},assertImporter(o){return Ce(i.registrations,o)},assertExporter(o){return Re(i.registrations,o)},assertMigration(o){return Ne(i.registrations,o)},assertCapabilityUsage(o){return Or(i,o)},runCommand(o){return I(i.commands,o)},runHook(o){return ir(i.hooks,o)},runMutationGuard(o){return or(i.hooks,o)},runCommandOverride(o){return dr(i.commands,o)},runParserOverride(o){return ar(i.parsers,o)},runPreflightOverride(o){return sr(i.preflight,o)},runRendererOverride(o){return mr(i.renderers,o)},runServiceOverride(o){return cr(i.services,o)},runSearchProvider(o){return fr(i.registrations,o)},runVectorStoreAdapter(o){return pr(i.registrations,o)},runMigration(o){return gr(i.registrations,o)},runImporter(o){return ur(i,o)},runExporter(o){return vr(i,o)},deactivate(o={}){return nr(r,{name:n,layer:a,activation:i,deactivateTimeoutMs:o.deactivateTimeoutMs})}}}export{Dr as a,Lr as b,Te as c,Hr as d,N as e,ze as f,k as g,ye as h,Kr as i,A as j,we as k,ot as l,it as m,tr as n,nr as o,I as p,or as q,ir as r,ar as s,sr as t,dr as u,mr as v,cr as w,fr as x,pr as y,gr as z,ur as A,vr as B,at as C,st as D,hr as E,yr as F,wr as G,Er as H,br as I,Ce as J,Re as K,xr as L,_r as M,$r as N,kr as O,Cr as P,Rr as Q,Nr as R,Sr as S,Ne as T,Or as U,dt as V,mt as W,ct as X,lt as Y,ft as Z,pt as _};
8
- //# sourceMappingURL=chunk-7NAAW5EX.js.map
8
+ //# sourceMappingURL=chunk-ZJDYBXMC.js.map
@@ -1,2 +1,2 @@
1
- import{Gb as b,ia as s,ja as w}from"./chunk-D727C4RO.js";import{Fa as y,Na as u,Ta as i,Ui as g,ej as h,pd as I}from"./chunk-WNEUWDUE.js";import{A as c,C as l,E as p}from"./chunk-O4ZLEN4T.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="59842825-3a81-53f4-845d-db2257ec6286")}catch{}})();async function R(o){let t=u(process.cwd(),o);await h(t);let r=await g(t),n=y(r,I());return{pmRoot:t,settings:r,typeRegistry:n}}async function C(o,t,r,n){i(o,s(t));let e=await b(o,t,r.id_prefix,r.item_format,n);if(e)return{id:e.id,historyPath:i(o,e.id),located:e};let a=w(t,r.id_prefix),d=s(t),_=a===d?[a]:[a,d];for(let f of _){let m=i(o,f);if(await p(m))return{id:f,historyPath:m,located:null}}throw new l(`Item ${t} not found`,c.NOT_FOUND)}export{R as a,C as b};
2
- //# sourceMappingURL=chunk-4AASUCHO.js.map
1
+ import{Gb as b,ia as s,ja as w}from"./chunk-GZ52WAY2.js";import{Fa as y,Na as u,Ta as i,Zi as g,jj as h,ud as I}from"./chunk-PZI6CR24.js";import{A as c,C as l,E as p}from"./chunk-O4ZLEN4T.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="59842825-3a81-53f4-845d-db2257ec6286")}catch{}})();async function R(o){let t=u(process.cwd(),o);await h(t);let r=await g(t),n=y(r,I());return{pmRoot:t,settings:r,typeRegistry:n}}async function C(o,t,r,n){i(o,s(t));let e=await b(o,t,r.id_prefix,r.item_format,n);if(e)return{id:e.id,historyPath:i(o,e.id),located:e};let a=w(t,r.id_prefix),d=s(t),_=a===d?[a]:[a,d];for(let f of _){let m=i(o,f);if(await p(m))return{id:f,historyPath:m,located:null}}throw new l(`Item ${t} not found`,c.NOT_FOUND)}export{R as a,C as b};
2
+ //# sourceMappingURL=chunk-ZSL6U53K.js.map
@@ -1,2 +1,2 @@
1
- import{A as u,B as v,C as w,D as x,E as y,k as e,l as f,m as g,n as h,o as i,p as j,q as k,r as l,s as m,t as n,u as o,v as p,w as q,x as r,y as s,z as t}from"./chunk-UFPLZ6LZ.js";import"./chunk-4AASUCHO.js";import"./chunk-IB7UB5TE.js";import{gb as a,hb as b,ib as c,jb as d}from"./chunk-D727C4RO.js";import"./chunk-WNEUWDUE.js";import"./chunk-O4ZLEN4T.js";import"./chunk-XAWE4EAK.js";export{f as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,e as ITEM_REVISION_CONFLICT_CODE,w as assertExpectHashAdmissible,t as bindExpectedItemRevisions,c as bindItemRevisionScope,a as createItemRevisionScope,k as describeItemRevisionChanges,y as dispatchWithExpectedItemRevisions,q as enrichItemRevisionConflict,o as expectHashInvocationRewrittenError,x as expectHashRequiresMutationError,m as isItemRevisionConflict,u as isTrackerRevisionGuarded,l as itemRevisionConflictRowFields,d as itemRevisionScopeReceipt,v as itemRevisionUncheckedWarning,g as normalizeExpectedItemHash,h as parseExpectHashSpecs,i as readItemRevision,j as resolveExpectedItemRevisions,r as runWithBoundItemRevisionScope,b as runWithItemRevisionScope,p as scopeItemRevisionConflict,n as throwFirstItemRevisionConflict,s as withExpectedItemRevisions};
2
- //# sourceMappingURL=item-revision-M7KXLQXF.js.map
1
+ import{A as u,B as v,C as w,D as x,E as y,k as e,l as f,m as g,n as h,o as i,p as j,q as k,r as l,s as m,t as n,u as o,v as p,w as q,x as r,y as s,z as t}from"./chunk-Z4YEH7VQ.js";import"./chunk-ZSL6U53K.js";import"./chunk-IB7UB5TE.js";import{gb as a,hb as b,ib as c,jb as d}from"./chunk-GZ52WAY2.js";import"./chunk-PZI6CR24.js";import"./chunk-O4ZLEN4T.js";import"./chunk-XAWE4EAK.js";export{f as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,e as ITEM_REVISION_CONFLICT_CODE,w as assertExpectHashAdmissible,t as bindExpectedItemRevisions,c as bindItemRevisionScope,a as createItemRevisionScope,k as describeItemRevisionChanges,y as dispatchWithExpectedItemRevisions,q as enrichItemRevisionConflict,o as expectHashInvocationRewrittenError,x as expectHashRequiresMutationError,m as isItemRevisionConflict,u as isTrackerRevisionGuarded,l as itemRevisionConflictRowFields,d as itemRevisionScopeReceipt,v as itemRevisionUncheckedWarning,g as normalizeExpectedItemHash,h as parseExpectHashSpecs,i as readItemRevision,j as resolveExpectedItemRevisions,r as runWithBoundItemRevisionScope,b as runWithItemRevisionScope,p as scopeItemRevisionConflict,n as throwFirstItemRevisionConflict,s as withExpectedItemRevisions};
2
+ //# sourceMappingURL=item-revision-LNIHK36Q.js.map
@@ -0,0 +1,2 @@
1
+ import{i as a,j as b,k as c,l as d,m as e,n as f,o as g,p as h,q as i,r as j}from"./chunk-NIOOJ3AG.js";import"./chunk-GOLQYO6M.js";import"./chunk-WEAF3OY4.js";import"./chunk-XN2BRWDD.js";import"./chunk-WWW5WHHJ.js";import"./chunk-UJMQP2HP.js";import"./chunk-DIWTFDU7.js";import"./chunk-QCTA2UFR.js";import"./chunk-L3SA3354.js";import"./chunk-JLQ7O6UV.js";import"./chunk-JESMEJTD.js";import"./chunk-SVVFJPNW.js";import"./chunk-Z4YEH7VQ.js";import"./chunk-ZSL6U53K.js";import"./chunk-IB7UB5TE.js";import"./chunk-GZ52WAY2.js";import"./chunk-PZI6CR24.js";import"./chunk-SPPHDVZE.js";import"./chunk-RSAN2YUU.js";import"./chunk-VS565KBX.js";import"./chunk-O4ZLEN4T.js";import"./chunk-XAWE4EAK.js";export{h as _testOnlyItemTransaction,j as abandonItemTransaction,f as buildItemCompletionMutations,g as commitItemCompletion,e as commitItemMutations,b as listUpsertKeyCandidates,c as loadGuardedRuntimeSchema,d as previewItemMutations,i as readItemTransaction,a as resolveTransactionSchema};
2
+ //# sourceMappingURL=item-transaction-TMUYPSMR.js.map
@@ -1,2 +1,2 @@
1
- import{r as E,w as N}from"./chunk-TBBWPEF5.js";import{Na as y,Ta as C,vb as R,yb as A}from"./chunk-T2MNRM3S.js";import"./chunk-D727C4RO.js";import{Na as g,Rb as _,Ui as O,Zd as h,_d as w,ee as T}from"./chunk-WNEUWDUE.js";import{C as f}from"./chunk-O4ZLEN4T.js";import"./chunk-XAWE4EAK.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="d19ff816-7570-5e8a-a4de-ad2ca48f0df0")}catch{}})();function b(t,o,r,a=!1){let d=[...r].map(n=>({candidate:n,distance:_(o,n,3)})).filter(n=>n.distance!==null).sort((n,i)=>n.distance-i.distance||n.candidate.localeCompare(i.candidate))[0]?.candidate,s=a?`Put mutation fields under options (options.${o}).`:d?`Did you mean "${d}"?`:"Use the declared command options or the field option for registered item fields.";throw new f(`Unknown ${t} ${a?"argument":"option"} "${o}". ${s} No changes were made.`,2,{code:"invalid_argument_value",reason:"unknown_mutation_option",changed:!1,field:o,required:s,nextSteps:[s]})}async function j(t,o,r,a,d){if(E(o))return;let s=t==="create"?R:A,n=(t==="create"?y:C).map(({flag:e})=>e.slice(2).replace(/-([a-z])/gu,(m,v)=>v.toUpperCase())),i=new Set([...s.flatMap(e=>[e.target,...e.keys]),...n]),l=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor"];for(let e of["author","message","force","fullChangedFields","idOnly",...l])i.add(e);let S=new Set(["action","options","path","cwd","author","force","noExtensions","no_extensions","fullChangedFields","idOnly",...l,...d,...t==="update"?["id"]:[]]);for(let e of Object.keys(o))S.has(e)||b(t,e,i,i.has(e));let u=o.options;if(u!==void 0&&!N(u))throw new f("Mutation options must be an object. No changes were made.",2,{code:"invalid_argument_value",changed:!1});let c=[...new Set([...Object.keys(u??{}),...Object.keys(r)])].filter(e=>!i.has(e));if(c.length===0)return;let p=h((await O(g(process.cwd(),a))).schema).command_to_fields.get(t)??[];for(let e of p)i.add(w(e));for(let e of c)p.some(m=>T({[e]:!0},m)===!0)||b(t,e,i)}export{j as assertNativeMutationOptions};
2
- //# sourceMappingURL=mutation-admission-374UR7NI.js.map
1
+ import{r as E,w as N}from"./chunk-DIWTFDU7.js";import{Na as y,Ta as C,vb as R,yb as A}from"./chunk-SVVFJPNW.js";import"./chunk-GZ52WAY2.js";import{Na as g,Wb as _,Zi as O,ce as h,de as w,je as T}from"./chunk-PZI6CR24.js";import{C as f}from"./chunk-O4ZLEN4T.js";import"./chunk-XAWE4EAK.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="d19ff816-7570-5e8a-a4de-ad2ca48f0df0")}catch{}})();function b(t,o,r,a=!1){let d=[...r].map(n=>({candidate:n,distance:_(o,n,3)})).filter(n=>n.distance!==null).sort((n,i)=>n.distance-i.distance||n.candidate.localeCompare(i.candidate))[0]?.candidate,s=a?`Put mutation fields under options (options.${o}).`:d?`Did you mean "${d}"?`:"Use the declared command options or the field option for registered item fields.";throw new f(`Unknown ${t} ${a?"argument":"option"} "${o}". ${s} No changes were made.`,2,{code:"invalid_argument_value",reason:"unknown_mutation_option",changed:!1,field:o,required:s,nextSteps:[s]})}async function j(t,o,r,a,d){if(E(o))return;let s=t==="create"?R:A,n=(t==="create"?y:C).map(({flag:e})=>e.slice(2).replace(/-([a-z])/gu,(m,v)=>v.toUpperCase())),i=new Set([...s.flatMap(e=>[e.target,...e.keys]),...n]),l=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor"];for(let e of["author","message","force","fullChangedFields","idOnly",...l])i.add(e);let S=new Set(["action","options","path","cwd","author","force","noExtensions","no_extensions","fullChangedFields","idOnly",...l,...d,...t==="update"?["id"]:[]]);for(let e of Object.keys(o))S.has(e)||b(t,e,i,i.has(e));let u=o.options;if(u!==void 0&&!N(u))throw new f("Mutation options must be an object. No changes were made.",2,{code:"invalid_argument_value",changed:!1});let c=[...new Set([...Object.keys(u??{}),...Object.keys(r)])].filter(e=>!i.has(e));if(c.length===0)return;let p=h((await O(g(process.cwd(),a))).schema).command_to_fields.get(t)??[];for(let e of p)i.add(w(e));for(let e of c)p.some(m=>T({[e]:!0},m)===!0)||b(t,e,i)}export{j as assertNativeMutationOptions};
2
+ //# sourceMappingURL=mutation-admission-WZY22LVH.js.map
@@ -1,4 +1,4 @@
1
- import{a as ce}from"./chunk-BSJSGDA3.js";import"./chunk-DEZPZOQ7.js";import{b as g,c as S,d as F}from"./chunk-YSWD2NXB.js";import{L as ie,P as ae,U as re,n as oe,u as D,w as ne}from"./chunk-L4WWG2H6.js";import{Bc as X,Dc as Y,Fc as Z,Ha as V,Hb as K,Ic as ee,Jc as te,Lc as se,Mc as le,Nc as de,U as Q,pc as W}from"./chunk-CZETQYKO.js";import"./chunk-EHDGHFMJ.js";import{Ac as l,Gc as L,Hc as M,Ic as $,Jc as B,Kc as N,Lc as U,Mc as P,Nc as z,Oc as H,Pc as J,d as G,vc as y,yc as s}from"./chunk-T2MNRM3S.js";import"./chunk-UFPLZ6LZ.js";import"./chunk-4AASUCHO.js";import"./chunk-IB7UB5TE.js";import{ya as T,za as R}from"./chunk-D727C4RO.js";import{Bh as A,Na as C,Ph as h,Sh as f,Th as m,Ui as q,ud as k,y as O,z as j}from"./chunk-WNEUWDUE.js";import"./chunk-SPPHDVZE.js";import{A as c,C as u}from"./chunk-O4ZLEN4T.js";import"./chunk-XAWE4EAK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="19d28e23-5337-5ec0-83e6-6e43b462ece7")}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]="69ca287f-eeb9-5e65-a3ba-be47ab223c04")}catch{}})();async function ye(e,t){let o=y(t),i=Date.now();if([e.raw,e.compact,e.full,e.provenance].filter(d=>d===!0).length>1)throw new u("Activity projection options are mutually exclusive. Use --raw, --compact, --provenance, or --full.",c.USAGE);let a=z(e.stream);if(a&&!o.json)throw new u("--stream requires --json output mode.",c.USAGE);let n=P(e),r=await K(a&&e.full!==!0&&e.provenance!==!0?{...n,raw:!0,compact:!0}:n,o);a?B(r,n,o):f(r,o),o.profile&&m(`profile:command=activity took_ms=${Date.now()-i}`)}function E(e){e.option("--id <value>","Filter by item ID").option("--op <value>","Filter by history operation").option("--author <value>","Filter by history author").option("--from <value>","Inclusive lower time bound (ISO or relative)").option("--to <value>","Exclusive upper time bound (ISO or relative)").option("--limit <n>","Maximum activity rows").option("--after <cursor>","Continue a fixed-window page").option("--unbounded","Return every matching row").option("--compact","Show compact event rows").option("--raw","Show the legacy compact per-event stream instead of the item digest").option("--full","Show full activity entries with JSON Patch payloads").option("--provenance","Show patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include provenance counts").option("--harness <value>","Filter by harness (repeatable)",s).option("--agent-instance <value>","Filter by agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter exact provenance values (repeatable)",s).option("--stream [mode]","Emit line-delimited JSON rows (requires --json): rows|ndjson|jsonl").description("Show recent activity across items.").action(ye)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1a62fe05-4407-5e76-87fa-5109dcca5640")}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]="25c5349b-60d7-505b-98b0-3ed19e44b791")}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]="b40cde4c-ca5a-522d-a731-52503c7e4fe0")}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]="9212f45c-798d-5774-87ce-bb7d6ff5514a")}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]="deee1339-ac17-5ae9-8add-a9dd766d182e")}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]="de0fbee0-0bcf-5a46-9013-f7f883d3d0a3")}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]="b662e21b-a163-5834-8789-65243f4c7c9c")}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]="5cc1722c-b797-5b95-a493-3925003ba72e")}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]="35c679a2-9d47-51fa-8bd2-175a4ec48d6b")}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]="0c5c45ff-de13-5724-9037-86d54d0168ef")}catch{}})();function ve(e,t){return!t||t.size===0?!0:e==="context"?t.has("context")||t.has("ctx"):t.has(e)}function ue(e){if(e===void 0)return;if(typeof e!="string")throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE);let t=e.trim().toLowerCase();if(t==="csv"||t==="table"||t==="json"||t==="ndjson"||t==="toon")return t;throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE)}function _(e,t,o,i=!1){if(t===void 0)return o;if(typeof t!="string")throw new u(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,c.USAGE);let a=t.trim().toLowerCase();if(a!=="json"&&(a!=="ndjson"||!i)&&a!=="toon")throw new u(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,c.USAGE);if(o.json===!0&&a==="toon")throw new u(`${e} cannot combine --json with --format toon`,c.USAGE);return{...o,json:a==="json"||a==="ndjson"}}function he(e,t){G[t]==="brief"&&e.includeBody!==!0&&e.compact!==!0&&e.brief!==!0&&e.full!==!0&&e.fields===void 0&&(e.brief=!0)}function pe(e){e.option("--has-notes","Show only items that have notes").option("--has-learnings","Show only items that have learnings").option("--has-files","Show only items that have linked files").option("--has-docs","Show only items that have linked docs").option("--has-tests","Show only items that have linked tests").option("--has-comments","Show only items that have comments").option("--has-deps","Show only items that have dependencies").option("--has-body","Show only items that have a non-empty body").option("--has-linked-command","Show only items whose linked tests carry a runnable command").option("--no-notes","Show only items that have no notes").option("--no-learnings","Show only items that have no learnings").option("--no-files","Show only items that have no linked files").option("--filter-files-missing","Alias for --no-files").option("--no-docs","Show only items that have no linked docs").option("--filter-docs-missing","Alias for --no-docs").option("--no-tests","Show only items that have no linked tests").option("--no-comments","Show only items that have no comments").option("--no-deps","Show only items that have no dependencies").option("--empty-body","Show only items with an empty body").option("--no-linked-command","Show only items whose linked tests carry no runnable command").option("--filter-reviewer-missing","Show only items missing reviewer").option("--filter-risk-missing","Show only items missing risk").option("--filter-confidence-missing","Show only items missing confidence").option("--filter-sprint-missing","Show only items missing sprint").option("--filter-release-missing","Show only items missing release")}var ge={draft:{name:"list-draft",dependencyBlocked:!1},open:{name:"list-open",dependencyBlocked:!1},in_progress:{name:"list-in-progress",dependencyBlocked:!1},blocked:{name:"list-blocked",dependencyBlocked:!0},closed:{name:"list-closed",dependencyBlocked:!1},canceled:{name:"list-canceled",dependencyBlocked:!1}};function be(e,t){let o=e.stream===!0,i=ue(e.format),a=i==="csv"||i==="table",n=i==="json"||i==="ndjson"||i==="toon"?_("List",e.format,t,!0):t;if(o&&!n.json)throw new u("--stream requires --json output mode.",c.USAGE);if((a||i==="ndjson")&&o)throw new u("--format csv|table|ndjson cannot be combined with --stream.",c.USAGE);return{streamMode:o,listFormat:i,effectiveGlobal:n}}function we(e,t,o){if(o.listFormat==="csv"||o.listFormat==="table"){k(t);let i=t.items,a=o.listFormat==="csv"?T(i):R(i);!o.effectiveGlobal.quiet&&a.length>0&&h(`${a}
1
+ import{a as ce}from"./chunk-FM375BHH.js";import"./chunk-DEZPZOQ7.js";import{b as g,c as S,d as F}from"./chunk-5N3JMGXU.js";import{L as ie,P as ae,U as re,n as oe,u as D,w as ne}from"./chunk-XN2BRWDD.js";import{Bc as X,Dc as Y,Fc as Z,Ha as V,Hb as K,Ic as ee,Jc as te,Lc as se,Mc as le,Nc as de,U as Q,pc as W}from"./chunk-JLQ7O6UV.js";import"./chunk-JESMEJTD.js";import{Ac as l,Gc as L,Hc as M,Ic as $,Jc as B,Kc as N,Lc as U,Mc as P,Nc as z,Oc as H,Pc as J,d as G,vc as y,yc as s}from"./chunk-SVVFJPNW.js";import"./chunk-Z4YEH7VQ.js";import"./chunk-ZSL6U53K.js";import"./chunk-IB7UB5TE.js";import{ya as T,za as R}from"./chunk-GZ52WAY2.js";import{Gh as A,Na as C,Uh as h,Xh as f,Yh as m,Zi as q,y as O,z as j,zd as k}from"./chunk-PZI6CR24.js";import"./chunk-SPPHDVZE.js";import{A as c,C as u}from"./chunk-O4ZLEN4T.js";import"./chunk-XAWE4EAK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="19d28e23-5337-5ec0-83e6-6e43b462ece7")}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]="69ca287f-eeb9-5e65-a3ba-be47ab223c04")}catch{}})();async function ye(e,t){let o=y(t),i=Date.now();if([e.raw,e.compact,e.full,e.provenance].filter(d=>d===!0).length>1)throw new u("Activity projection options are mutually exclusive. Use --raw, --compact, --provenance, or --full.",c.USAGE);let a=z(e.stream);if(a&&!o.json)throw new u("--stream requires --json output mode.",c.USAGE);let n=P(e),r=await K(a&&e.full!==!0&&e.provenance!==!0?{...n,raw:!0,compact:!0}:n,o);a?B(r,n,o):f(r,o),o.profile&&m(`profile:command=activity took_ms=${Date.now()-i}`)}function E(e){e.option("--id <value>","Filter by item ID").option("--op <value>","Filter by history operation").option("--author <value>","Filter by history author").option("--from <value>","Inclusive lower time bound (ISO or relative)").option("--to <value>","Exclusive upper time bound (ISO or relative)").option("--limit <n>","Maximum activity rows").option("--after <cursor>","Continue a fixed-window page").option("--unbounded","Return every matching row").option("--compact","Show compact event rows").option("--raw","Show the legacy compact per-event stream instead of the item digest").option("--full","Show full activity entries with JSON Patch payloads").option("--provenance","Show patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include provenance counts").option("--harness <value>","Filter by harness (repeatable)",s).option("--agent-instance <value>","Filter by agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter exact provenance values (repeatable)",s).option("--stream [mode]","Emit line-delimited JSON rows (requires --json): rows|ndjson|jsonl").description("Show recent activity across items.").action(ye)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1a62fe05-4407-5e76-87fa-5109dcca5640")}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]="25c5349b-60d7-505b-98b0-3ed19e44b791")}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]="b40cde4c-ca5a-522d-a731-52503c7e4fe0")}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]="9212f45c-798d-5774-87ce-bb7d6ff5514a")}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]="deee1339-ac17-5ae9-8add-a9dd766d182e")}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]="de0fbee0-0bcf-5a46-9013-f7f883d3d0a3")}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]="b662e21b-a163-5834-8789-65243f4c7c9c")}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]="5cc1722c-b797-5b95-a493-3925003ba72e")}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]="35c679a2-9d47-51fa-8bd2-175a4ec48d6b")}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]="0c5c45ff-de13-5724-9037-86d54d0168ef")}catch{}})();function ve(e,t){return!t||t.size===0?!0:e==="context"?t.has("context")||t.has("ctx"):t.has(e)}function ue(e){if(e===void 0)return;if(typeof e!="string")throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE);let t=e.trim().toLowerCase();if(t==="csv"||t==="table"||t==="json"||t==="ndjson"||t==="toon")return t;throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE)}function _(e,t,o,i=!1){if(t===void 0)return o;if(typeof t!="string")throw new u(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,c.USAGE);let a=t.trim().toLowerCase();if(a!=="json"&&(a!=="ndjson"||!i)&&a!=="toon")throw new u(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,c.USAGE);if(o.json===!0&&a==="toon")throw new u(`${e} cannot combine --json with --format toon`,c.USAGE);return{...o,json:a==="json"||a==="ndjson"}}function he(e,t){G[t]==="brief"&&e.includeBody!==!0&&e.compact!==!0&&e.brief!==!0&&e.full!==!0&&e.fields===void 0&&(e.brief=!0)}function pe(e){e.option("--has-notes","Show only items that have notes").option("--has-learnings","Show only items that have learnings").option("--has-files","Show only items that have linked files").option("--has-docs","Show only items that have linked docs").option("--has-tests","Show only items that have linked tests").option("--has-comments","Show only items that have comments").option("--has-deps","Show only items that have dependencies").option("--has-body","Show only items that have a non-empty body").option("--has-linked-command","Show only items whose linked tests carry a runnable command").option("--no-notes","Show only items that have no notes").option("--no-learnings","Show only items that have no learnings").option("--no-files","Show only items that have no linked files").option("--filter-files-missing","Alias for --no-files").option("--no-docs","Show only items that have no linked docs").option("--filter-docs-missing","Alias for --no-docs").option("--no-tests","Show only items that have no linked tests").option("--no-comments","Show only items that have no comments").option("--no-deps","Show only items that have no dependencies").option("--empty-body","Show only items with an empty body").option("--no-linked-command","Show only items whose linked tests carry no runnable command").option("--filter-reviewer-missing","Show only items missing reviewer").option("--filter-risk-missing","Show only items missing risk").option("--filter-confidence-missing","Show only items missing confidence").option("--filter-sprint-missing","Show only items missing sprint").option("--filter-release-missing","Show only items missing release")}var ge={draft:{name:"list-draft",dependencyBlocked:!1},open:{name:"list-open",dependencyBlocked:!1},in_progress:{name:"list-in-progress",dependencyBlocked:!1},blocked:{name:"list-blocked",dependencyBlocked:!0},closed:{name:"list-closed",dependencyBlocked:!1},canceled:{name:"list-canceled",dependencyBlocked:!1}};function be(e,t){let o=e.stream===!0,i=ue(e.format),a=i==="csv"||i==="table",n=i==="json"||i==="ndjson"||i==="toon"?_("List",e.format,t,!0):t;if(o&&!n.json)throw new u("--stream requires --json output mode.",c.USAGE);if((a||i==="ndjson")&&o)throw new u("--format csv|table|ndjson cannot be combined with --stream.",c.USAGE);return{streamMode:o,listFormat:i,effectiveGlobal:n}}function we(e,t,o){if(o.listFormat==="csv"||o.listFormat==="table"){k(t);let i=t.items,a=o.listFormat==="csv"?T(i):R(i);!o.effectiveGlobal.quiet&&a.length>0&&h(`${a}
2
2
  `)}else if(o.listFormat==="ndjson"){k(t);let i=S(t.items);!o.effectiveGlobal.quiet&&i.length>0&&h(`${i}
3
3
  `)}else o.streamMode?$(e,t,o.effectiveGlobal):f(t,o.effectiveGlobal)}function I(e,t,o,i=[]){if(o.outputBudget===void 0)return A(e,t,i);let{outputBudget:a,...n}=A(e,{...t,outputBudget:o.outputBudget},i);return n}async function xe(e){let t=y(e.actionCommand),o=e.aliasContract?{...t,command:e.aliasContract.canonical}:t,i=Date.now();e.aliasContract?.lifecycle==="deprecated"&&await q(C(process.cwd(),o.path)).then(fe=>fe.ux.deprecation_hints)&&m(j(e.aliasContract));let a=I("list",e.options,o),n=L(a),r=ke(e,n),{effectiveName:d,effectiveStatus:v,effectiveDependencyBlocked:p,effectiveExcludeTerminal:w}=r;he(n,e.name),Object.assign(n,{projectionCommand:d}),w&&(n.excludeTerminal=!0),n.dependencyBlocked=p;let x=be(a,o),me=await Q(p?void 0:v,n,o);we("list",me,x),o.profile&&m(`profile:command=list took_ms=${Date.now()-i}`)}function ke(e,t){let o=e.name,i=e.status,a=e.dependencyBlocked===!0,n=e.excludeTerminal===!0,r=t.status?.trim().toLowerCase(),d=e.name==="list"&&r!==void 0?ge[r]:void 0;return e.name==="list"&&(e.options.all===!0||r==="all"?(o="list-all",n=!1,t.status=void 0):r!==void 0&&d!==void 0&&(o=d.name,i=r,a=d.dependencyBlocked,n=!1,t.status=void 0)),(o==="list-open"||o==="list-in-progress")&&(t.lifecycleBucket=o==="list-open"?"open":"in_progress",i=void 0),{effectiveName:o,effectiveStatus:i,effectiveDependencyBlocked:a,effectiveExcludeTerminal:n}}function _e(e,t){let{name:o,description:i,status:a,excludeTerminal:n,allowStatusFilter:r,dependencyBlocked:d,aliasContract:v}=t,p=e.command(o,{hidden:v?.hidden===!0}).description(i);r&&p.option("--status <value>","Filter by status (repeatable or comma-separated; matches any; all selects every status)",s),o==="list"&&p.option("--all","Include every lifecycle status"),p.option("--for <intent>",`Apply a declared context intent projection. ${g("list","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--type <value>","Filter by item type (repeatable or comma-separated; matches any)",s).option("--tag <value>","Filter by tag (repeatable or comma-separated; matches any)",s).option("--priority <value>","Filter by priority (repeatable or comma-separated; matches any)",s).option("--deadline-before <value>","Filter by deadline upper bound (ISO/date string or relative)").option("--deadline-after <value>","Filter by deadline lower bound (ISO/date string or relative)").option("--today","Filter to items updated since local midnight today").option("--recent","Filter to items updated in the last 7 days").option("--updated-after <value>","Updated since ISO timestamp or signed relative (-2h/-7d for past); use last-window ISO").option("--updated-before <value>","Filter by updated_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-after <value>","Filter by created_at lower bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-before <value>","Filter by created_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--ids <value>","Filter by explicit item IDs (comma-separated or repeatable)").option("--assignee <value>","Filter by assignee",s).option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--parent <value>","Filter by parent item ID").option("--sprint <value>","Filter by sprint",s).option("--release <value>","Filter by release",s).option("--filter-ac-missing","Show only items missing acceptance_criteria").option("--filter-estimates-missing","Show only items missing estimated_minutes").option("--filter-resolution-missing","Show only terminal items missing resolution").option("--filter-metadata-missing","Show only items missing any tracked metadata (AC, estimate, or resolution)").option("--limit <n>","Alias for --output-limit; --output-budget may cap rows").option("--offset <n>","Skip the first n matching rows before limit is applied").option("--after <cursor>","Query next_cursor; output_cursor uses --output-cursor").option("--no-truncate","Disable default token cap; explicit --limit and --output-budget apply").option("--include-body","Include item body in each returned list row").option("--strict-read","Fail closed if any item document or item directory cannot be read").option("--compact","Render compact list projection fields (mutually exclusive with --brief/--full/--fields)").option("--brief","Brief rows: id, status, type, title and leading sort field (priority by default; excludes --compact/--full/--fields)").option("--full","Render full list projection fields (mutually exclusive with --compact/--brief/--fields)").option("--fields <value>",`Render custom comma-separated list fields (mutually exclusive with --compact/--brief/--full). ${g(o,"--fields")}`).option("--sort <value>","Sort field: priority|deadline|updated_at|created_at|title|parent (aliases: updated, created)").option("--order <value>","Sort order: asc|desc (requires --sort)").option("--tree","Render rows in parent/child tree order").option("--tree-depth <n>","Maximum recursion depth with --tree (0 keeps root rows only)").option("--format <value>","Output render mode: csv|table (human export) or json|ndjson|toon (machine output override)").option("--stream","Emit line-delimited JSON rows (requires --json)"),pe(p),p.action(async(w,x)=>{await xe({name:o,status:a,excludeTerminal:n,dependencyBlocked:d,options:w,actionCommand:x,aliasContract:v})}),l(p,"--tags <value>","Alias for --tag"),l(p,"--assignee_filter <value>","Alias for --assignee-filter"),l(p,"--tree_depth <n>","Alias for --tree-depth"),l(p,"--token_budget <n>","Alias for --token-budget"),l(p,"--filter-estimate-missing","Alias for --filter-estimates-missing")}async function Se(e,t){let o=y(t),i=Date.now(),a=await oe(M(e),o);f(a,o),o.profile&&m(`profile:command=aggregate took_ms=${Date.now()-i}`)}async function Ie(e,t){let o=y(t),i=Date.now(),a=H(I("context",e,o)),n=await Y(a,o),r=W(a,o);if(r==="markdown")o.quiet||h(`${X(n)}
4
4
  `);else if(r==="ndjson"){k(n);let d=S([...n.high_level,...n.low_level,...n.blocked_fallback]);!o.quiet&&d.length>0&&h(`${d}
@@ -8,4 +8,4 @@ import{a as ce}from"./chunk-BSJSGDA3.js";import"./chunk-DEZPZOQ7.js";import{b as
8
8
  `);return}for await(let a of le({...e,intervalMs:i}))o||h(`${F(a.events,{count:a.count,has_more:a.has_more,next_cursor:a.next_cursor??null,source:a.source,integrity:a.integrity,...a.verified_streams===void 0?{}:{verified_streams:a.verified_streams},heartbeat:a.count===0})}
9
9
  `)}function Te(e){return e.cursor_mode==="row"?S(e.events):F(e.events,{count:e.count,has_more:e.has_more,next_cursor:e.next_cursor??null,source:e.source,integrity:e.integrity,...e.verified_streams===void 0?{}:{verified_streams:e.verified_streams},...e.provenance_summary===void 0?{}:{provenance_summary:e.provenance_summary}})}async function Re(e,t){let o=y(t),i=Date.now(),a=je(e,o.path);if(e.follow===!0){await Ce(a,e,o.quiet===!0);return}let n=await se(a);if(k(n),o.json){f(n,o),o.profile&&m(`profile:command=events took_ms=${Date.now()-i}`);return}let r=Te(n);!o.quiet&&r.length>0&&h(`${r}
10
10
  `),o.profile&&m(`profile:command=events took_ms=${Date.now()-i}`)}async function qe(e,t,o,i,a){let n=y(a),r=Date.now(),d=await V(e,t,o,{...Array.isArray(i.kind)?{kind:i.kind}:{},maxDepth:typeof i.maxDepth=="string"?i.maxDepth:void 0,limit:typeof i.limit=="string"?i.limit:void 0,after:typeof i.after=="string"?i.after:void 0,direction:typeof i.direction=="string"?i.direction:void 0,maxPaths:typeof i.maxPaths=="string"?i.maxPaths:void 0,sample:typeof i.sample=="string"?i.sample:void 0,...Array.isArray(i.exemptIsolate)?{exemptIsolate:i.exemptIsolate}:{},...Array.isArray(i.exemptIsolateType)?{exemptIsolateType:i.exemptIsolateType}:{},saveBaseline:i.saveBaseline===!0,rebuild:i.rebuild===!0,clear:i.clear===!0,summary:i.summary===!0,full:i.full===!0},n);f(d,n),n.profile&&m(`profile:command=graph took_ms=${Date.now()-r}`)}function Dt(e,t){let o=t?.commandFilter,i=n=>ve(n,o),a=[{name:"list",description:"List active items with optional lifecycle-status and project filters.",excludeTerminal:!0,allowStatusFilter:!0},{name:"list-all",description:"List all items with optional filters.",excludeTerminal:!1,allowStatusFilter:!0},{name:"list-draft",description:"List draft items with optional filters.",status:"draft"},{name:"list-open",description:"List open items with optional filters.",status:"open",excludeTerminal:!1,allowStatusFilter:!1},{name:"list-in-progress",description:"List in-progress items with optional filters.",status:"in_progress",excludeTerminal:!1,allowStatusFilter:!1},{name:"list-blocked",description:"List blocked items (blocked status or open blocked_by dependencies, matching pm next) with optional filters.",dependencyBlocked:!0,excludeTerminal:!1,allowStatusFilter:!1},{name:"list-closed",description:"List closed items with optional filters.",status:"closed"},{name:"list-canceled",description:"List canceled items with optional filters.",status:"canceled"}];for(let n of a)if(i(n.name)){let r=O(n.name);_e(e,{...n,...r?.registration==="commander"?{aliasContract:r}:{}})}if(i("aggregate")){let n=e.command("aggregate").description("Group item counts and numeric measures.").option("--set-mode <value>","Set grouping: element (default)|tuple").option("--limit <value>","Group page size (default: 50)").option("--after <value>","Continue with next_after cursor").option("--group-by <value>","Fields: parent,type,priority,status,assignee,tags,sprint,release (comma-separated)").option("--count","Counts (default)").option("--completion","Status counts and completion_pct").option("--sum <field>","Group numeric sum").option("--avg <field>","Group numeric average").option("--include-unparented","Keep unparented group").option("--status <value>","Item status").option("--type <value>","Item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Latest deadline (ISO/date or relative)").option("--deadline-after <value>","Earliest deadline (ISO/date or relative)").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Assignee presence: assigned|unassigned").option("--parent <value>","Parent ID").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release");l(n,"--include_unparented","Alias for --include-unparented"),l(n,"--assignee_filter <value>","Alias for --assignee-filter"),n.action(Se)}if(i("context")){let n=e.command("context").alias("ctx").description("Show a token-efficient project context snapshot for next-work decisions.").option("--for <intent>",`Apply a declared context intent projection. ${g("context","--for")}`).option("--date <value>","Anchor date/time for agenda window calculations (ISO/date string or relative)").option("--from <value>","Agenda lower bound (ISO/date string or relative)").option("--to <value>","Agenda upper bound (ISO/date string or relative)").option("--past","Include past agenda entries in bounded windows").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <id>","Scope the snapshot to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit focus and agenda rows per section").option("--after <cursor>","Query next_cursor; output_cursor uses --output-cursor").option("--format <value>","Context output format override: markdown|toon|json|ndjson").option("--depth <value>","Context depth: brief|standard|deep|full (full = every section, no per-section cap)").option("--section <value...>","Include specific sections (repeatable; overrides --depth)").option("--fields <value>","Project focus rows to a comma-separated field subset (e.g. id,title,priority)").option("--activity-limit <n>","Limit recent activity entries (default: settings or 10)").option("--stale-threshold <value>","Staleness cutoff in days (e.g. 7 or 7d; default: settings or 7)").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked candidate ids").option("--token-budget <n>","Complete JSON/TOON response token ceiling").option("--no-extension-health","Omit the installed extension health summary").option("--no-tags","Omit tag arrays from context focus rows");l(n,"--assignee_filter <value>","Alias for --assignee-filter"),l(n,"--max-items <n>","Alias for --limit"),l(n,"--explain_ranking","Alias for --explain-ranking"),l(n,"--token_budget <n>","Alias for --token-budget"),n.action(Ie)}if(i("next")){let n=e.command("next").description("Recommend the next actionable (unblocked, ready) work item with rationale + blocked companion.").option("--for <intent>",`Apply a declared context intent projection. ${g("next","--for")}`).option("--type <value>","Filter candidate items by type").option("--tag <value>","Filter candidate items by tag").option("--priority <value>","Filter candidate items by priority").option("--assignee <value>","Filter candidate items by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter candidate items by sprint").option("--release <value>","Filter candidate items by release").option("--parent <id>","Scope to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit ready rows (default: 5; non-positive falls back to default)").option("--blocked-limit <n>","Limit blocked rows (default: same as --limit)").option("--ready-only","Omit the blocked companion list").option("--include-decisions","Include human-gated Decision items in the claimable ready queue").option("--include-gates","Include outcome gates in the ready queue").option("--include-containers","Include containers with unfinished descendants in the ready queue").option("--format <value>","Next output format override: markdown|toon|json").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked ready ids").option("--token-budget <n>","Maximum estimated tokens spent on the ranked ready queue");l(n,"--assignee_filter <value>","Alias for --assignee-filter"),l(n,"--blocked_limit <n>","Alias for --blocked-limit"),l(n,"--ready_only","Alias for --ready-only"),l(n,"--explain_ranking","Alias for --explain-ranking"),l(n,"--token_budget <n>","Alias for --token-budget"),n.action(Ae)}if(i("search")){let n=e.command("search").argument("<keywords...>","Keyword query tokens").description("Search items with keyword, semantic, or hybrid retrieval. Inline field:value tokens (tag:/status:/type:/priority:) in the query are parsed as filters, e.g. 'auth tag:area:search status:open'.").option("--for <intent>",`Apply a declared context intent projection. ${g("search","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--mode <value>","Search mode: keyword|semantic|hybrid (default: auto)").option("--semantic","Shorthand for --mode semantic").option("--hybrid","Shorthand for --mode hybrid").option("--match-mode <value>","Token match mode: and|or|exact (default: or with all-terms ranking bonus; and = hard-require every token; exact = exact phrase)").option("--min-score <value>","Per-query minimum score threshold (finite number >= 0); overrides settings search.score_threshold for this query only").option("--count","Return only the count of matching items (post-filter/threshold, pre-limit); skips hit rows").option("--semantic-weight <value>","Override hybrid semantic weight for this query (0..1); invalid values fall back to settings").option("--include-linked","Include linked files, docs, and tests in the searchable corpus").option("--title-exact","Require exact normalized title match for the full query string").option("--phrase-exact","Require exact normalized phrase match in searchable text").option("--highlight","Emit per-field matched-text snippets (wrapped in \xAB\u2026\xBB) on each hit; off by default").option("--status <value>","Filter by status before query (all, open/closed/canceled aliases, or configured status id; CSV)").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Filter by deadline upper bound (ISO/date string or relative)").option("--deadline-after <value>","Filter by deadline lower bound (ISO/date string or relative)").option("--updated-after <value>",'Filter by updated_at lower bound: ISO timestamp or signed relative (e.g. "-2h"/"-7d" for the past)').option("--updated-before <value>","Filter by updated_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-after <value>","Filter by created_at lower bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-before <value>","Filter by created_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--assignee <value>","Filter by assignee").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <value>","Filter by parent item ID").option("--compact","Render compact search hits (default; mutually exclusive with --full/--fields)").option("--full","Render full search hits with nested item payloads (mutually exclusive with --compact/--fields)").option("--fields <value>",`Render custom comma-separated search hit fields (mutually exclusive with --compact/--full). ${g("search","--fields")}`).option("--format <value>","Search output format override: json|ndjson|toon").option("--limit <n>","Limit returned item count").option("--after <cursor>","Query next_cursor; output_cursor uses --output-cursor");pe(n),n.action(De),l(n,"--tags <value>","Alias for --tag"),l(n,"--token_budget <n>","Alias for --token-budget")}if(i("eval")&&e.command("eval").description("Evaluate search relevance against a curated golden-query set: reports nDCG@k, MRR@k, precision@k, and recall@k per query plus the macro average. Use --fail-under as a CI gate.").option("--mode <value>","Default retrieval mode for queries without their own: keyword|semantic|hybrid (default: keyword)").option("--k <n>","Metric cutoff @k (positive integer; default: 10)").option("--fail-under <value>","Exit non-zero when aggregate nDCG@k falls below this threshold (0..1); CI gate").option("--queries <path>",`Query JSON (${ae}); default: search/eval-queries.json; errors show an example`).option("--format <value>","Eval output format override: json|toon").action(Fe),i("get")){let n=e.command("get").argument("<id>","Item id").option("--for <intent>",`Apply a declared context intent projection. ${g("get","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--depth <value>","brief|standard|deep|full (default: standard)").option("--full","Full details and children for any type; excludes --depth/--fields").option("--fields <value>",`Render custom comma-separated item metadata fields. ${g("get","--fields")}`).option("--tree","Include descendants rooted at the requested item").option("--tree-depth <n>","Maximum subtree depth for --tree descendants").option("--at <version-or-timestamp>","Reconstruct a verified historical item state without mutating it").option("--format <value>","Get output format override: json|toon").description("Show item details by ID.").action(Ee);l(n,"--tree_depth <n>","Alias for --tree-depth"),l(n,"--token_budget <n>","Alias for --token-budget")}if(i("history")){let n=e.command("history").enablePositionalOptions().argument("<id>","Item id").option("--limit <n>","Latest N; keeps order").option("--order <value>","oldest_first|newest_first").option("--compact","Summary (default newest_first)").option("--full","Patches (default oldest_first)").option("--provenance","Authors (default newest_first)").option("--provenance-summary","Count provenance completeness").option("--harness <value>","Harness (repeatable)",s).option("--agent-instance <value>","Instance (repeatable)",s).option("--provenance-filter <dimension=value>","Provenance (repeatable)",s).option("--diff","Before/after field diffs").option("--field <name>","Filter changed field; implies --diff").option("--verify","Verify full chain and replay").option("--strict-exit","With --verify, fail on integrity errors").option("--fail-on-warn","Alias for --strict-exit").option("--format <value>","Output: json|toon").description("Read history.").action(Oe);ce(n,!0),E(n.command("activity"))}i("events")&&e.command("events").option("--since <cursor-or-timestamp>","Resume strictly after a durable cursor, or include events from an ISO timestamp").option("--type <value>","Filter by mutation operation (repeatable or comma-separated)",s).option("--author <value>","Filter by mutation author (repeatable or comma-separated)",s).option("--item <value>","Filter by item or workspace stream id (repeatable or comma-separated)",s).option("--limit <n>","Return at most 1,000 events (default: 100)").option("--cursor-mode <mode>","Cursors: batch trailer (default) or per-row").option("--full","Include each complete authoritative history entry").option("--verify","Verify selected authoritative history chains").option("--provenance","Include patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include bounded provenance completeness counts").option("--harness <value>","Filter by recorded or vocabulary-resolved harness (repeatable)",s).option("--agent-instance <value>","Filter by privacy-safe agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter by an exact declared provenance value (repeatable)",s).option("--follow","Follow committed events as NDJSON").option("--interval-ms <n>","Empty-read delay while following (minimum: 10ms; default: 250ms)").description("Read mutation events as NDJSON with resumable cursors.").action(Re),i("activity")&&E(e.command("activity",{hidden:!0})),i("graph")&&e.command("graph").argument("<subcommand>","Graph query (ancestors, descendants, predecessors, successors, paths, impact, analyze, audit, communities, redundancy, dominators, slack, centrality, articulation, plan, index)").argument("[id]","Root item id (traversals, paths, impact, and dominators)").argument("[target]","Target item id (paths only)").option("--kind <value>","Restrict traversal to registered relationship kinds (repeatable or comma-separated)",s).option("--max-depth <value>","Maximum traversal depth (non-negative integer)").option("--limit <value>","Maximum returned rows per bounded collection").option("--after <value>","Resume a traversal after this previously returned node id").option("--direction <value>","Edge orientation for paths/impact (outgoing, incoming, or both)").option("--max-paths <value>","Maximum enumerated paths (paths only)").option("--sample <value>","Maximum evidence sample entries per audit finding (audit only)").option("--exempt-isolate <value>","Item ids treated as explicitly valid isolates by the audit (repeatable or comma-separated)",s).option("--exempt-isolate-type <value>","Item types whose active isolates are policy-valid for the audit (repeatable or comma-separated)",s).option("--save-baseline","Persist the audit census as the change-since-baseline comparison point (audit only)").option("--rebuild","Rebuild and warm the durable graph index (index only)").option("--clear","Delete the durable graph index (index only)").option("--summary","Return counts-first envelopes without row collections").option("--full","Return the complete graph row projection").description("Bounded workspace relationship-graph queries, analytics, and governance audit.").action(qe)}var Ft={resolveReadCommandOutputFormat:_,parseListFormat:ue};export{Ft as _testOnlyRegisterListQuery,Dt as registerListQueryCommands};
11
- //# sourceMappingURL=register-list-query-GSB7PP5P.js.map
11
+ //# sourceMappingURL=register-list-query-DYGPLVRL.js.map