@unbrained/pm-cli 2026.9.15 → 2026.9.16
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.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +52 -0
- package/dist/cli/error-guidance.d.ts +1 -1
- package/dist/cli/error-guidance.js +1 -1
- package/dist/cli/register-setup.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +143 -143
- package/dist/cli-bundle/chunks/{chunk-BOZ4HVYL.js → chunk-3UXLVJIM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WDF7PP4P.js → chunk-A5EKLGOU.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UKLOSZV6.js → chunk-C3MFMGCR.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WLJJ4MAU.js → chunk-CPFBDM53.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3RB6Z7XE.js → chunk-DLVCGXO6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3AHONKLL.js → chunk-GA73HHQG.js} +19 -19
- package/dist/cli-bundle/chunks/{chunk-5P5PYCZX.js → chunk-GX5XSANL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RM2OGG65.js → chunk-LD2FH2YE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YMMLKKEP.js → chunk-PTMZALZM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RKPUO75B.js → chunk-Q6KPZGMP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Y2P3DSSO.js → chunk-T526C5DX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-J4DRE3WN.js → chunk-UJSB6NO6.js} +76 -76
- package/dist/cli-bundle/chunks/{register-list-query-IWSPNFFD.js → register-list-query-ISM35VIX.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-3DVF4R64.js → register-mutation-PA5M3X77.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-LXP3MECQ.js → register-operations-MBSG5D22.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-KFQSNBDX.js → register-setup-S6MMYN4D.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-533DCWPY.js → chunk-267N774W.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ZHX3433X.js → chunk-5FSGN4MP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BMATJLPT.js → chunk-5KYHDFDN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-SHF57M2H.js → chunk-7S7XWMXC.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-JKJYXCT6.js → chunk-BFUXTNZU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-PBJC2ZNA.js → chunk-G4TKJZ4A.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ZOE2NSJB.js → chunk-GKSAMNBG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-6C3CUU2G.js → chunk-JZSLDLR4.js} +20 -20
- package/dist/cli-bundle/focused-chunks/{chunk-YBQTVE5S.js → chunk-LNM3BS45.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-5SBU4QDC.js → chunk-NOK652OP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-OGGF2RBL.js → chunk-OCTTDZOU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MD7ADLME.js → chunk-OWDDVMAP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-AXDAIBT3.js → chunk-SSG62L7U.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-63YRRGKX.js → chunk-WHL5CQG3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UACMCSCC.js → chunk-WUMGGQYN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-4YTDKIPF.js → chunk-Z4PWEIMX.js} +21 -21
- package/dist/cli-bundle/main.js +11 -10
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +2 -2
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +28 -28
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +2 -2
- package/dist/core/store/tracker-preflight.js +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/init.d.ts +22 -1
- package/dist/sdk/init.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/read-output-budget.d.ts +2 -0
- package/dist/sdk/read-output-budget.js +1 -1
- package/dist/sdk/read-output-contracts.d.ts +4 -0
- package/dist/sdk/read-output-contracts.js +1 -1
- package/docs/QUICKSTART.md +16 -0
- package/docs/READ_OUTPUT_CONTRACTS.md +14 -0
- package/marketplace.json +2 -2
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Pe,b as Oe,c as Fe,d as Ae,e as Re,f as Te,g as Me,h as Be,i as L,j as $,k as j,l as K,m as H,p as U,q,w as G,x as Y,y as X,z as J}from"./focused-chunks/chunk-BMATJLPT.js";import{a as M,b as B,c as D,d as N,u as Q}from"./focused-chunks/chunk-YBQTVE5S.js";import"./focused-chunks/chunk-UACMCSCC.js";import"./focused-chunks/chunk-5SBU4QDC.js";import"./focused-chunks/chunk-SHF57M2H.js";import{a as h}from"./focused-chunks/chunk-OGGF2RBL.js";import{b as Ie,c as we,ca as x,d as Se,da as C,ea as b,fa as I,ga as A,ha as w,j as E,k,n as d,nb as R,ob as T,vc as V,xc as z,yc as W}from"./focused-chunks/chunk-4YTDKIPF.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="c06f3fb3-4b1f-5fdb-a9ce-bce8f88704aa")}catch{}})();function He(e){return e}function Ue(e){return e}function Z(e,o){for(let r of o.commands??[])e.registerCommand(r);for(let[r,t]of Object.entries(o.commandOverrides??{}))e.registerCommand(r,t);for(let[r,t]of Object.entries(o.flags??{}))e.registerFlags(r,t);for(let[r,t]of Object.entries(o.parsers??{}))e.registerParser(r,t);for(let[r,t]of Object.entries(o.renderers??{}))if(typeof t=="function")e.registerRenderer(r,t);else{let{run:i,...s}=t;e.registerRenderer(r,i,s)}for(let[r,t]of Object.entries(o.services??{}))e.registerService(r,t)}function ee(e,o){for(let s of o.preflights??[])e.registerPreflight(s);let r=o.itemTypes??[];r.length>0&&e.registerItemTypes(r);let t=o.itemFields??[];t.length>0&&e.registerItemFields(t);let i=o.relationshipKinds??[];i.length>0&&e.registerRelationshipKinds(i);for(let s of o.migrations??[])e.registerMigration(s);for(let s of o.profiles??[])e.registerProfile(s)}function re(e,o){for(let r of o.searchProviders??[])e.registerSearchProvider(r);for(let r of o.vectorStoreAdapters??[])e.registerVectorStoreAdapter(r);for(let r of o.assuranceProviders??[])e.registerAssuranceMeasurementProvider(r);for(let r of o.importers??[])e.registerImporter(r.name,r.importer,r.options);for(let r of o.exporters??[])e.registerExporter(r.name,r.exporter,r.options)}function oe(e,o){for(let r of o.beforeCommand??[])e.hooks.beforeCommand(r);for(let r of o.beforeMutation??[])e.hooks.beforeMutation(r);for(let r of o.afterCommand??[])e.hooks.afterCommand(r);for(let r of o.onWrite??[])e.hooks.onWrite(r);for(let r of o.onRead??[])e.hooks.onRead(r);for(let r of o.onIndex??[])e.hooks.onIndex(r)}function te(e){let r={activate:async t=>{Z(t,e),ee(t,e),re(t,e),oe(t,e.hooks??{}),await e.activate?.(t)}};return e.manifest&&(r.manifest=e.manifest),e.deactivate&&(r.deactivate=e.deactivate),r}function f(e){let o=e.flatMap(r=>r??[]);return o.length>0?o:void 0}function u(e){let o=Object.assign({},...e.map(r=>r??{}));return Object.keys(o).length>0?o:void 0}function ne(e){let o={};for(let r of e)for(let[t,i]of Object.entries(r??{}))o[t]=[...o[t]??[],...i];return Object.keys(o).length>0?o:void 0}var ie=["beforeCommand","beforeMutation","afterCommand","onWrite","onRead","onIndex"];function se(e,o,r){let t=o.map(s=>s?.[r]),i=f(t);if(i!==void 0){let s=e;s[r]=i}}function ae(e){let o={};for(let r of ie)se(o,e,r);return Object.keys(o).length>0?o:void 0}function qe(...e){let o={},r=(n,a)=>{a!==void 0&&(o[n]=a)};r("commands",f(e.map(n=>n.commands))),r("commandOverrides",u(e.map(n=>n.commandOverrides))),r("flags",ne(e.map(n=>n.flags))),r("parsers",u(e.map(n=>n.parsers))),r("renderers",u(e.map(n=>n.renderers))),r("services",u(e.map(n=>n.services))),r("preflights",f(e.map(n=>n.preflights))),r("itemTypes",f(e.map(n=>n.itemTypes))),r("itemFields",f(e.map(n=>n.itemFields))),r("relationshipKinds",f(e.map(n=>n.relationshipKinds))),r("migrations",f(e.map(n=>n.migrations))),r("profiles",f(e.map(n=>n.profiles))),r("searchProviders",f(e.map(n=>n.searchProviders))),r("vectorStoreAdapters",f(e.map(n=>n.vectorStoreAdapters))),r("assuranceProviders",f(e.map(n=>n.assuranceProviders))),r("importers",f(e.map(n=>n.importers))),r("exporters",f(e.map(n=>n.exporters))),r("hooks",ae(e.map(n=>n.hooks)));let t;for(let n of e)n.manifest&&(t=n.manifest);r("manifest",t);let i=e.some(n=>n.activate);r("activate",i?async n=>{for(let a of e)a.activate&&await a.activate(n)}:void 0);let s=e.some(n=>n.deactivate);return r("deactivate",s?async()=>{let n=[];for(let a of[...e].reverse())if(a.deactivate)try{await a.deactivate()}catch(c){n.push(c)}if(n.length>0)throw n.length>1?new AggregateError(n,"Multiple extension blueprint deactivate hooks failed."):n[0]}:void 0),o}var ce=[["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 g(e){return e?Array.isArray(e)?e.length>0:Object.keys(e).length>0:!1}function v(e){let o=new Set;for(let[i,s]of ce)g(e[i])&&o.add(s);(e.commands??[]).filter(p).some(i=>i.flags!==void 0)&&o.add("schema");let r=[...e.importers??[],...e.exporters??[]].filter(p);r.some(i=>i?.options?.flags!==void 0)&&o.add("schema"),r.some(i=>typeof i=="object")&&o.add("commands");let t=e.hooks??{};return[t.beforeCommand,t.beforeMutation,t.afterCommand,t.onWrite,t.onRead,t.onIndex].some(g)&&o.add("hooks"),[...o].sort((i,s)=>i.localeCompare(s))}var me=[["beforeCommand","before_command"],["beforeMutation","before_mutation"],["afterCommand","after_command"],["onWrite","on_write"],["onRead","on_read"],["onIndex","on_index"]];function m(e){return[...new Set(e)].sort((o,r)=>o.localeCompare(r))}function p(e){return e!=null}function _(e){return d(`${e.name} import`)}function y(e){return d(`${e.name} export`)}function de(e,o,r){return[...e.map(t=>d(t.name)),...o.filter(t=>t.options!==void 0).map(_),...r.filter(t=>t.options!==void 0).map(y)]}function fe(e,o,r,t){return[...Object.keys(e.flags??{}).map(i=>d(i)),...o.filter(i=>i.flags!==void 0).map(i=>d(i.name)),...r.filter(i=>i.options?.flags!==void 0).map(_),...t.filter(i=>i.options?.flags!==void 0).map(y)]}function le(e){return me.filter(([o])=>(e[o]?.length??0)>0).map(([,o])=>o)}function pe(e){let o=Object.entries(e??{}).filter(([,r])=>typeof r!="function"&&((r.commands?.length??0)>0||r.resultDiscriminator!==void 0)).map(([r,t])=>{let i=t;return{format:r,commands:m((i.commands??[]).map(s=>d(s))),result_discriminator:i.resultDiscriminator!==void 0}}).sort((r,t)=>r.format.localeCompare(t.format));return o.length>0?{renderer_ownership:o}:{}}function ue(e){return!e||e.length===0?{}:{assurance_providers:m(e.map(o=>o.id))}}function ge(e,o,r){return{item_types:m((e.itemTypes??[]).map(t=>t.name)),item_fields:m((e.itemFields??[]).map(t=>t.name)),...(e.relationshipKinds?.length??0)>0?{relationship_kinds:m(e.relationshipKinds.map(t=>t.kind))}:{},migrations:m((e.migrations??[]).flatMap(t=>typeof t.id=="string"?[t.id]:[])),profiles:m((e.profiles??[]).map(t=>t.name)),importers:m(o.map(t=>d(t.name))),exporters:m(r.map(t=>d(t.name))),search_providers:m((e.searchProviders??[]).map(t=>t.name)),vector_store_adapters:m((e.vectorStoreAdapters??[]).map(t=>t.name)),...ue(e.assuranceProviders),parser_overrides:m(Object.keys(e.parsers??{}).map(t=>d(t))),service_overrides:m(Object.keys(e.services??{}).map(t=>String(t).trim().toLowerCase())),renderer_overrides:m(Object.keys(e.renderers??{}).map(t=>String(t).trim().toLowerCase())),...pe(e.renderers),preflight_overrides:(e.preflights??[]).length,preflight_ownership:(e.preflights??[]).map(t=>({commands:[...t.commands??[]]}))}}function Ve(e){let o=(e.commands??[]).filter(p),r=(e.importers??[]).filter(p),t=(e.exporters??[]).filter(p),i=r.map(_),s=t.map(y),n=de(o,r,t),a=fe(e,o,r,t),c=e.hooks??{},l=ge(e,r,t);return{capabilities:v(e),commands:m(n),command_overrides:m(Object.keys(e.commandOverrides??{}).map(F=>d(F))),command_handlers:m([...n,...i,...s]),hooks:le(c),flag_commands:m(a),...l}}var he=["commands","commandOverrides","flags","parsers","renderers","services","preflights","itemTypes","itemFields","relationshipKinds","migrations","profiles","searchProviders","vectorStoreAdapters","assuranceProviders","importers","exporters"];function ve(e){return(e.itemFields??[]).filter(o=>typeof o?.name=="string"&&h.has(o.name.trim())).map(o=>({code:"reserved_item_field",severity:"error",message:`Item field "${o.name}" collides with reserved item metadata; rename it with an extension-specific prefix before publishing.`,field:o.name}))}function _e(e){return[...Object.values(e.flags??{}).flat(),...(e.commands??[]).flatMap(r=>r.flags??[]),...(e.importers??[]).flatMap(r=>r.options?.flags??[]),...(e.exporters??[]).flatMap(r=>r.options?.flags??[])].flatMap(r=>{if(typeof r?.long!="string"&&typeof r?.short!="string")return[];let t=x(r.long,r.short);if(t===null)return[];let{token:i,failure:s}=t;return[{code:s,severity:"error",message:`Flag "${i}" ${C(i,s)}.`,field:i}]})}function P(e){let o=new Set;for(let r of e){let t=k(r)??E(r);t!==null&&o.add(t)}return[...o].sort((r,t)=>r.localeCompare(t))}function ye(e,o){let r=[];if(o===null)return e.length>0&&r.push({code:"manifest_capabilities_absent",severity:"warning",message:`Blueprint exercises ${e.length===1?"capability":"capabilities"} [${e.join(", ")}] but declares none; set capabilities to deriveExtensionCapabilities(blueprint) so the manifest grant matches.`}),r;let t=new Set(o),i=new Set(e);for(let s of e)t.has(s)||r.push({code:"capability_undeclared",severity:"error",message:`Blueprint exercises capability "${s}" but it is absent from the declared capabilities; activation throws extension_capability_missing \u2014 add "${s}" to the manifest capabilities.`,capability:s});for(let s of o)i.has(s)||r.push({code:"capability_unused",severity:"warning",message:`Capability "${s}" 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:s});return r}function Ee(e){let o=[],r=new Map;for(let i of e.commands??[]){let s=d(i.name);r.set(s,(r.get(s)??0)+1)}for(let[i,s]of r)s>1&&o.push({code:"duplicate_command",severity:"warning",message:`Command "${i}" is declared ${s} times in commands; the later registration shadows the earlier one at dispatch.`,command:i});let t=new Set(Object.keys(e.commandOverrides??{}).map(i=>d(i)));for(let i of r.keys())t.has(i)&&o.push({code:"command_override_conflict",severity:"warning",message:`Command "${i}" is declared both as a new command definition and as a command override; register one or the other.`,command:i});return o}function ke(e){let o=[];for(let r of he)r in e&&!g(e[r])&&o.push({code:"empty_surface",severity:"warning",message:`Blueprint field "${r}" is present but empty; remove it or populate it.`,field:r});if("hooks"in e){let r=e.hooks??{};[r.beforeCommand,r.beforeMutation,r.afterCommand,r.onWrite,r.onRead,r.onIndex].some(g)||o.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 o}function xe(e,o={}){let r=v(e),t=o.declaredCapabilities??e.manifest?.capabilities,i=Array.isArray(t)?P(t):null,s=[...ye(r,i),...Ee(e),..._e(e),...ve(e),...ke(e)];return{ok:s.every(n=>n.severity!=="error"),findings:s,used:r,declared:i}}function O(e,o){let{additionalCapabilities:r,...t}=o,i=Array.isArray(r)?P(r):[],s=[...new Set([...v(e),...i])].sort((n,a)=>n.localeCompare(a));return{...t,capabilities:s}}function ze(e,o){let r=O(e,o);return{module:te({...e,manifest:r}),manifest:r}}function S(e,o){if(e.status==="absent"||e.status==="ok")return null;let r=`${e.kind}_${e.status}`,t="";switch(r){case"pm_min_version_invalid":t=`pm_min_version "${e.required}" is not a valid version; the extension is treated as incompatible and the loader skips it.`;break;case"pm_min_version_unchecked":t=`pm_min_version "${e.required}" could not be compared against pm ${o}; compatibility is unverified.`;break;case"pm_min_version_unmet":t=`Requires pm >= ${e.required} but the target is pm ${o}; the loader skips the extension.`;break;case"pm_max_version_invalid":t=`pm_max_version "${e.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":t=`pm_max_version "${e.required}" could not be compared against pm ${o}; compatibility is unverified.`;break;case"pm_max_version_exceeded":t=`Allows pm <= ${e.required} but the target is pm ${o}; the loader skips the extension.`;break;case"pm_max_version_exceeded_warn":t=`Target pm ${o} is newer than pm_max_version ${e.required}, but the "warn" exceeded mode lets it load with a warning.`;break}return{code:r,severity:e.allowed?"warning":"error",constraint:e.kind,required:e.required,current:o,message:t}}function Ce(e,o){let r=b(e.pm_min_version,o.pmVersion),t=I(e.pm_max_version,o.pmVersion,o.pmMaxVersionExceededMode??"block"),s=w(e).findings.map(l=>({code:l.code,severity:"warning",constraint:"manifest",required:l.code==="manifest_unknown_key"?l.path:"pm_min_version",current:o.pmVersion,path:l.path,...l.suggested_key?{suggested_key:l.suggested_key}:{},message:l.message})),n=[],a=S(r,o.pmVersion);a!==null&&n.push(a);let c=S(t,o.pmVersion);return c!==null&&n.push(c),{compatible:r.allowed&&t.allowed,findings:[...s,...n],pmVersion:o.pmVersion}}var be=new Set(["capability_undeclared","capability_unused","manifest_capabilities_absent"]);function We(e,o={}){let r=xe(e,{declaredCapabilities:o.declaredCapabilities}),t=o.identity?O(e,o.identity):null,i=o.target?Ce(t??e.manifest??{},o.target):null,a=[...(t!==null&&o.declaredCapabilities===void 0?r.findings.filter(c=>!be.has(c.code)):r.findings).map(c=>({source:"blueprint",severity:c.severity,code:c.code,message:c.message})),...(i?.findings??[]).map(c=>({source:"compatibility",severity:c.severity,code:c.code,message:c.message}))];return{ok:a.every(c=>c.severity!=="error"),capabilities:r.used,blueprint:r,manifest:t,compatibility:i,findings:a}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="a169a68c-13d0-5a3a-b231-abdf1a34ef6a")}catch{}})();function Ye(e){return e}function Xe(e){return e}function Je(e){return e}function Qe(e){return e}function Ze(e){return e}function er(e){return e}function rr(e){return e}function or(e){return e}function tr(e){return e}function nr(e){return e}function ir(e){return e}function sr(e){return e}function ar(e){return e}function cr(e){return{handled:!0,result:e}}function mr(){return{handled:!1}}function dr(e){return e}function fr(e){return e}function lr(e){return e}function pr(e){return e}function ur(e){return e}function gr(e){return e}function hr(e){return e}function vr(e){return e}function _r(e){return e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="af4da99c-f557-5bf7-a439-c14878e4970d")}catch{}})();export{$ as BUILTIN_PROFILES,Pe as EXTENSION_CAPABILITIES,Se as EXTENSION_CAPABILITY_CONTRACT,Ie as EXTENSION_CAPABILITY_CONTRACT_VERSION,we as EXTENSION_CAPABILITY_LEGACY_ALIASES,V as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,Oe as EXTENSION_POLICY_MODES,Fe as EXTENSION_POLICY_SURFACES,Re as EXTENSION_SANDBOX_PROFILES,Ae as EXTENSION_TRUST_MODES,Me as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,B as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,M as PM_PACKAGE_RESOURCE_KINDS,Y as PROFILE_LINT_CODES,G as PROFILE_LINT_DIMENSIONS,L as PROFILE_NAMES,h as RESERVED_ITEM_FIELD_NAMES,Be as SEARCH_EXTENSION_FLAG_DEFINITIONS,Ce as checkExtensionManifestCompatibility,N as collectPackageExtensionDirectories,z as collectUsedExtensionCapabilities,te as composeExtension,ze as composeExtensionPackage,T as createExtensionContributionInventory,mr as declineServiceOverride,gr as defineAfterCommandHook,pr as defineBeforeCommandHook,ur as defineBeforeMutationHook,Je as defineCommand,nr as defineCommandOverride,lr as defineExporter,He as defineExtension,Ue as defineExtensionBlueprint,Ye as defineExtensionManifest,Qe as defineFlag,fr as defineImporter,er as defineItemField,Ze as defineItemType,rr as defineMigration,_r as defineOnIndexHook,vr as defineOnReadHook,hr as defineOnWriteHook,ir as defineParserOverride,sr as definePreflightOverride,Xe as defineProjectProfile,dr as defineRendererOverride,or as defineSearchProvider,ar as defineServiceOverride,tr as defineVectorStoreAdapter,v as deriveExtensionCapabilities,Ve as describeExtensionBlueprint,U as describeProfileComposition,q as describeProjectProfile,cr as handleServiceOverride,A as inspectExtensionManifestSchema,xe as lintExtensionBlueprint,w as lintExtensionManifestSchema,X as lintProjectProfile,H as listProfiles,qe as mergeExtensionBlueprints,R as normalizeExtensionContributionInventory,j as normalizeProfileName,J as planProfileApplication,We as preflightExtension,D as readPmPackageManifest,W as reconcileExtensionCapabilityUsage,Q as renderExtensionSurfaceMarkdown,K as resolveProfile,O as synthesizeExtensionManifest,Te as toExtensionFlagDefinitions};
|
|
1
|
+
import{a as Pe,b as Oe,c as Fe,d as Ae,e as Re,f as Te,g as Me,h as Be,i as L,j as $,k as j,l as K,m as H,p as U,q,w as G,x as Y,y as X,z as J}from"./focused-chunks/chunk-5KYHDFDN.js";import{a as M,b as B,c as D,d as N,u as Q}from"./focused-chunks/chunk-LNM3BS45.js";import"./focused-chunks/chunk-WUMGGQYN.js";import"./focused-chunks/chunk-NOK652OP.js";import"./focused-chunks/chunk-7S7XWMXC.js";import{a as h}from"./focused-chunks/chunk-OCTTDZOU.js";import{b as Ie,c as we,ca as x,d as Se,da as C,ea as b,fa as I,ga as A,ha as w,j as E,k,n as d,nb as R,ob as T,vc as V,xc as z,yc as W}from"./focused-chunks/chunk-Z4PWEIMX.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="c06f3fb3-4b1f-5fdb-a9ce-bce8f88704aa")}catch{}})();function He(e){return e}function Ue(e){return e}function Z(e,o){for(let r of o.commands??[])e.registerCommand(r);for(let[r,t]of Object.entries(o.commandOverrides??{}))e.registerCommand(r,t);for(let[r,t]of Object.entries(o.flags??{}))e.registerFlags(r,t);for(let[r,t]of Object.entries(o.parsers??{}))e.registerParser(r,t);for(let[r,t]of Object.entries(o.renderers??{}))if(typeof t=="function")e.registerRenderer(r,t);else{let{run:i,...s}=t;e.registerRenderer(r,i,s)}for(let[r,t]of Object.entries(o.services??{}))e.registerService(r,t)}function ee(e,o){for(let s of o.preflights??[])e.registerPreflight(s);let r=o.itemTypes??[];r.length>0&&e.registerItemTypes(r);let t=o.itemFields??[];t.length>0&&e.registerItemFields(t);let i=o.relationshipKinds??[];i.length>0&&e.registerRelationshipKinds(i);for(let s of o.migrations??[])e.registerMigration(s);for(let s of o.profiles??[])e.registerProfile(s)}function re(e,o){for(let r of o.searchProviders??[])e.registerSearchProvider(r);for(let r of o.vectorStoreAdapters??[])e.registerVectorStoreAdapter(r);for(let r of o.assuranceProviders??[])e.registerAssuranceMeasurementProvider(r);for(let r of o.importers??[])e.registerImporter(r.name,r.importer,r.options);for(let r of o.exporters??[])e.registerExporter(r.name,r.exporter,r.options)}function oe(e,o){for(let r of o.beforeCommand??[])e.hooks.beforeCommand(r);for(let r of o.beforeMutation??[])e.hooks.beforeMutation(r);for(let r of o.afterCommand??[])e.hooks.afterCommand(r);for(let r of o.onWrite??[])e.hooks.onWrite(r);for(let r of o.onRead??[])e.hooks.onRead(r);for(let r of o.onIndex??[])e.hooks.onIndex(r)}function te(e){let r={activate:async t=>{Z(t,e),ee(t,e),re(t,e),oe(t,e.hooks??{}),await e.activate?.(t)}};return e.manifest&&(r.manifest=e.manifest),e.deactivate&&(r.deactivate=e.deactivate),r}function f(e){let o=e.flatMap(r=>r??[]);return o.length>0?o:void 0}function u(e){let o=Object.assign({},...e.map(r=>r??{}));return Object.keys(o).length>0?o:void 0}function ne(e){let o={};for(let r of e)for(let[t,i]of Object.entries(r??{}))o[t]=[...o[t]??[],...i];return Object.keys(o).length>0?o:void 0}var ie=["beforeCommand","beforeMutation","afterCommand","onWrite","onRead","onIndex"];function se(e,o,r){let t=o.map(s=>s?.[r]),i=f(t);if(i!==void 0){let s=e;s[r]=i}}function ae(e){let o={};for(let r of ie)se(o,e,r);return Object.keys(o).length>0?o:void 0}function qe(...e){let o={},r=(n,a)=>{a!==void 0&&(o[n]=a)};r("commands",f(e.map(n=>n.commands))),r("commandOverrides",u(e.map(n=>n.commandOverrides))),r("flags",ne(e.map(n=>n.flags))),r("parsers",u(e.map(n=>n.parsers))),r("renderers",u(e.map(n=>n.renderers))),r("services",u(e.map(n=>n.services))),r("preflights",f(e.map(n=>n.preflights))),r("itemTypes",f(e.map(n=>n.itemTypes))),r("itemFields",f(e.map(n=>n.itemFields))),r("relationshipKinds",f(e.map(n=>n.relationshipKinds))),r("migrations",f(e.map(n=>n.migrations))),r("profiles",f(e.map(n=>n.profiles))),r("searchProviders",f(e.map(n=>n.searchProviders))),r("vectorStoreAdapters",f(e.map(n=>n.vectorStoreAdapters))),r("assuranceProviders",f(e.map(n=>n.assuranceProviders))),r("importers",f(e.map(n=>n.importers))),r("exporters",f(e.map(n=>n.exporters))),r("hooks",ae(e.map(n=>n.hooks)));let t;for(let n of e)n.manifest&&(t=n.manifest);r("manifest",t);let i=e.some(n=>n.activate);r("activate",i?async n=>{for(let a of e)a.activate&&await a.activate(n)}:void 0);let s=e.some(n=>n.deactivate);return r("deactivate",s?async()=>{let n=[];for(let a of[...e].reverse())if(a.deactivate)try{await a.deactivate()}catch(c){n.push(c)}if(n.length>0)throw n.length>1?new AggregateError(n,"Multiple extension blueprint deactivate hooks failed."):n[0]}:void 0),o}var ce=[["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 g(e){return e?Array.isArray(e)?e.length>0:Object.keys(e).length>0:!1}function v(e){let o=new Set;for(let[i,s]of ce)g(e[i])&&o.add(s);(e.commands??[]).filter(p).some(i=>i.flags!==void 0)&&o.add("schema");let r=[...e.importers??[],...e.exporters??[]].filter(p);r.some(i=>i?.options?.flags!==void 0)&&o.add("schema"),r.some(i=>typeof i=="object")&&o.add("commands");let t=e.hooks??{};return[t.beforeCommand,t.beforeMutation,t.afterCommand,t.onWrite,t.onRead,t.onIndex].some(g)&&o.add("hooks"),[...o].sort((i,s)=>i.localeCompare(s))}var me=[["beforeCommand","before_command"],["beforeMutation","before_mutation"],["afterCommand","after_command"],["onWrite","on_write"],["onRead","on_read"],["onIndex","on_index"]];function m(e){return[...new Set(e)].sort((o,r)=>o.localeCompare(r))}function p(e){return e!=null}function _(e){return d(`${e.name} import`)}function y(e){return d(`${e.name} export`)}function de(e,o,r){return[...e.map(t=>d(t.name)),...o.filter(t=>t.options!==void 0).map(_),...r.filter(t=>t.options!==void 0).map(y)]}function fe(e,o,r,t){return[...Object.keys(e.flags??{}).map(i=>d(i)),...o.filter(i=>i.flags!==void 0).map(i=>d(i.name)),...r.filter(i=>i.options?.flags!==void 0).map(_),...t.filter(i=>i.options?.flags!==void 0).map(y)]}function le(e){return me.filter(([o])=>(e[o]?.length??0)>0).map(([,o])=>o)}function pe(e){let o=Object.entries(e??{}).filter(([,r])=>typeof r!="function"&&((r.commands?.length??0)>0||r.resultDiscriminator!==void 0)).map(([r,t])=>{let i=t;return{format:r,commands:m((i.commands??[]).map(s=>d(s))),result_discriminator:i.resultDiscriminator!==void 0}}).sort((r,t)=>r.format.localeCompare(t.format));return o.length>0?{renderer_ownership:o}:{}}function ue(e){return!e||e.length===0?{}:{assurance_providers:m(e.map(o=>o.id))}}function ge(e,o,r){return{item_types:m((e.itemTypes??[]).map(t=>t.name)),item_fields:m((e.itemFields??[]).map(t=>t.name)),...(e.relationshipKinds?.length??0)>0?{relationship_kinds:m(e.relationshipKinds.map(t=>t.kind))}:{},migrations:m((e.migrations??[]).flatMap(t=>typeof t.id=="string"?[t.id]:[])),profiles:m((e.profiles??[]).map(t=>t.name)),importers:m(o.map(t=>d(t.name))),exporters:m(r.map(t=>d(t.name))),search_providers:m((e.searchProviders??[]).map(t=>t.name)),vector_store_adapters:m((e.vectorStoreAdapters??[]).map(t=>t.name)),...ue(e.assuranceProviders),parser_overrides:m(Object.keys(e.parsers??{}).map(t=>d(t))),service_overrides:m(Object.keys(e.services??{}).map(t=>String(t).trim().toLowerCase())),renderer_overrides:m(Object.keys(e.renderers??{}).map(t=>String(t).trim().toLowerCase())),...pe(e.renderers),preflight_overrides:(e.preflights??[]).length,preflight_ownership:(e.preflights??[]).map(t=>({commands:[...t.commands??[]]}))}}function Ve(e){let o=(e.commands??[]).filter(p),r=(e.importers??[]).filter(p),t=(e.exporters??[]).filter(p),i=r.map(_),s=t.map(y),n=de(o,r,t),a=fe(e,o,r,t),c=e.hooks??{},l=ge(e,r,t);return{capabilities:v(e),commands:m(n),command_overrides:m(Object.keys(e.commandOverrides??{}).map(F=>d(F))),command_handlers:m([...n,...i,...s]),hooks:le(c),flag_commands:m(a),...l}}var he=["commands","commandOverrides","flags","parsers","renderers","services","preflights","itemTypes","itemFields","relationshipKinds","migrations","profiles","searchProviders","vectorStoreAdapters","assuranceProviders","importers","exporters"];function ve(e){return(e.itemFields??[]).filter(o=>typeof o?.name=="string"&&h.has(o.name.trim())).map(o=>({code:"reserved_item_field",severity:"error",message:`Item field "${o.name}" collides with reserved item metadata; rename it with an extension-specific prefix before publishing.`,field:o.name}))}function _e(e){return[...Object.values(e.flags??{}).flat(),...(e.commands??[]).flatMap(r=>r.flags??[]),...(e.importers??[]).flatMap(r=>r.options?.flags??[]),...(e.exporters??[]).flatMap(r=>r.options?.flags??[])].flatMap(r=>{if(typeof r?.long!="string"&&typeof r?.short!="string")return[];let t=x(r.long,r.short);if(t===null)return[];let{token:i,failure:s}=t;return[{code:s,severity:"error",message:`Flag "${i}" ${C(i,s)}.`,field:i}]})}function P(e){let o=new Set;for(let r of e){let t=k(r)??E(r);t!==null&&o.add(t)}return[...o].sort((r,t)=>r.localeCompare(t))}function ye(e,o){let r=[];if(o===null)return e.length>0&&r.push({code:"manifest_capabilities_absent",severity:"warning",message:`Blueprint exercises ${e.length===1?"capability":"capabilities"} [${e.join(", ")}] but declares none; set capabilities to deriveExtensionCapabilities(blueprint) so the manifest grant matches.`}),r;let t=new Set(o),i=new Set(e);for(let s of e)t.has(s)||r.push({code:"capability_undeclared",severity:"error",message:`Blueprint exercises capability "${s}" but it is absent from the declared capabilities; activation throws extension_capability_missing \u2014 add "${s}" to the manifest capabilities.`,capability:s});for(let s of o)i.has(s)||r.push({code:"capability_unused",severity:"warning",message:`Capability "${s}" 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:s});return r}function Ee(e){let o=[],r=new Map;for(let i of e.commands??[]){let s=d(i.name);r.set(s,(r.get(s)??0)+1)}for(let[i,s]of r)s>1&&o.push({code:"duplicate_command",severity:"warning",message:`Command "${i}" is declared ${s} times in commands; the later registration shadows the earlier one at dispatch.`,command:i});let t=new Set(Object.keys(e.commandOverrides??{}).map(i=>d(i)));for(let i of r.keys())t.has(i)&&o.push({code:"command_override_conflict",severity:"warning",message:`Command "${i}" is declared both as a new command definition and as a command override; register one or the other.`,command:i});return o}function ke(e){let o=[];for(let r of he)r in e&&!g(e[r])&&o.push({code:"empty_surface",severity:"warning",message:`Blueprint field "${r}" is present but empty; remove it or populate it.`,field:r});if("hooks"in e){let r=e.hooks??{};[r.beforeCommand,r.beforeMutation,r.afterCommand,r.onWrite,r.onRead,r.onIndex].some(g)||o.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 o}function xe(e,o={}){let r=v(e),t=o.declaredCapabilities??e.manifest?.capabilities,i=Array.isArray(t)?P(t):null,s=[...ye(r,i),...Ee(e),..._e(e),...ve(e),...ke(e)];return{ok:s.every(n=>n.severity!=="error"),findings:s,used:r,declared:i}}function O(e,o){let{additionalCapabilities:r,...t}=o,i=Array.isArray(r)?P(r):[],s=[...new Set([...v(e),...i])].sort((n,a)=>n.localeCompare(a));return{...t,capabilities:s}}function ze(e,o){let r=O(e,o);return{module:te({...e,manifest:r}),manifest:r}}function S(e,o){if(e.status==="absent"||e.status==="ok")return null;let r=`${e.kind}_${e.status}`,t="";switch(r){case"pm_min_version_invalid":t=`pm_min_version "${e.required}" is not a valid version; the extension is treated as incompatible and the loader skips it.`;break;case"pm_min_version_unchecked":t=`pm_min_version "${e.required}" could not be compared against pm ${o}; compatibility is unverified.`;break;case"pm_min_version_unmet":t=`Requires pm >= ${e.required} but the target is pm ${o}; the loader skips the extension.`;break;case"pm_max_version_invalid":t=`pm_max_version "${e.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":t=`pm_max_version "${e.required}" could not be compared against pm ${o}; compatibility is unverified.`;break;case"pm_max_version_exceeded":t=`Allows pm <= ${e.required} but the target is pm ${o}; the loader skips the extension.`;break;case"pm_max_version_exceeded_warn":t=`Target pm ${o} is newer than pm_max_version ${e.required}, but the "warn" exceeded mode lets it load with a warning.`;break}return{code:r,severity:e.allowed?"warning":"error",constraint:e.kind,required:e.required,current:o,message:t}}function Ce(e,o){let r=b(e.pm_min_version,o.pmVersion),t=I(e.pm_max_version,o.pmVersion,o.pmMaxVersionExceededMode??"block"),s=w(e).findings.map(l=>({code:l.code,severity:"warning",constraint:"manifest",required:l.code==="manifest_unknown_key"?l.path:"pm_min_version",current:o.pmVersion,path:l.path,...l.suggested_key?{suggested_key:l.suggested_key}:{},message:l.message})),n=[],a=S(r,o.pmVersion);a!==null&&n.push(a);let c=S(t,o.pmVersion);return c!==null&&n.push(c),{compatible:r.allowed&&t.allowed,findings:[...s,...n],pmVersion:o.pmVersion}}var be=new Set(["capability_undeclared","capability_unused","manifest_capabilities_absent"]);function We(e,o={}){let r=xe(e,{declaredCapabilities:o.declaredCapabilities}),t=o.identity?O(e,o.identity):null,i=o.target?Ce(t??e.manifest??{},o.target):null,a=[...(t!==null&&o.declaredCapabilities===void 0?r.findings.filter(c=>!be.has(c.code)):r.findings).map(c=>({source:"blueprint",severity:c.severity,code:c.code,message:c.message})),...(i?.findings??[]).map(c=>({source:"compatibility",severity:c.severity,code:c.code,message:c.message}))];return{ok:a.every(c=>c.severity!=="error"),capabilities:r.used,blueprint:r,manifest:t,compatibility:i,findings:a}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="a169a68c-13d0-5a3a-b231-abdf1a34ef6a")}catch{}})();function Ye(e){return e}function Xe(e){return e}function Je(e){return e}function Qe(e){return e}function Ze(e){return e}function er(e){return e}function rr(e){return e}function or(e){return e}function tr(e){return e}function nr(e){return e}function ir(e){return e}function sr(e){return e}function ar(e){return e}function cr(e){return{handled:!0,result:e}}function mr(){return{handled:!1}}function dr(e){return e}function fr(e){return e}function lr(e){return e}function pr(e){return e}function ur(e){return e}function gr(e){return e}function hr(e){return e}function vr(e){return e}function _r(e){return e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="af4da99c-f557-5bf7-a439-c14878e4970d")}catch{}})();export{$ as BUILTIN_PROFILES,Pe as EXTENSION_CAPABILITIES,Se as EXTENSION_CAPABILITY_CONTRACT,Ie as EXTENSION_CAPABILITY_CONTRACT_VERSION,we as EXTENSION_CAPABILITY_LEGACY_ALIASES,V as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,Oe as EXTENSION_POLICY_MODES,Fe as EXTENSION_POLICY_SURFACES,Re as EXTENSION_SANDBOX_PROFILES,Ae as EXTENSION_TRUST_MODES,Me as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,B as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,M as PM_PACKAGE_RESOURCE_KINDS,Y as PROFILE_LINT_CODES,G as PROFILE_LINT_DIMENSIONS,L as PROFILE_NAMES,h as RESERVED_ITEM_FIELD_NAMES,Be as SEARCH_EXTENSION_FLAG_DEFINITIONS,Ce as checkExtensionManifestCompatibility,N as collectPackageExtensionDirectories,z as collectUsedExtensionCapabilities,te as composeExtension,ze as composeExtensionPackage,T as createExtensionContributionInventory,mr as declineServiceOverride,gr as defineAfterCommandHook,pr as defineBeforeCommandHook,ur as defineBeforeMutationHook,Je as defineCommand,nr as defineCommandOverride,lr as defineExporter,He as defineExtension,Ue as defineExtensionBlueprint,Ye as defineExtensionManifest,Qe as defineFlag,fr as defineImporter,er as defineItemField,Ze as defineItemType,rr as defineMigration,_r as defineOnIndexHook,vr as defineOnReadHook,hr as defineOnWriteHook,ir as defineParserOverride,sr as definePreflightOverride,Xe as defineProjectProfile,dr as defineRendererOverride,or as defineSearchProvider,ar as defineServiceOverride,tr as defineVectorStoreAdapter,v as deriveExtensionCapabilities,Ve as describeExtensionBlueprint,U as describeProfileComposition,q as describeProjectProfile,cr as handleServiceOverride,A as inspectExtensionManifestSchema,xe as lintExtensionBlueprint,w as lintExtensionManifestSchema,X as lintProjectProfile,H as listProfiles,qe as mergeExtensionBlueprints,R as normalizeExtensionContributionInventory,j as normalizeProfileName,J as planProfileApplication,We as preflightExtension,D as readPmPackageManifest,W as reconcileExtensionCapabilityUsage,Q as renderExtensionSurfaceMarkdown,K as resolveProfile,O as synthesizeExtensionManifest,Te as toExtensionFlagDefinitions};
|
|
2
2
|
//# sourceMappingURL=sdk-authoring.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as hi,b as wi,c as xi,d as k,e as ki,f as I,g as $i,h as Ti,i as vi,j as Ci,k as Ei,l as ji,m as Oi,n as Si,o as P,p as Ai,q as F,u as N,v as Mi,w as Di,x as z,y as Ii,z as Pi}from"./focused-chunks/chunk-
|
|
1
|
+
import{a as hi,b as wi,c as xi,d as k,e as ki,f as I,g as $i,h as Ti,i as vi,j as Ci,k as Ei,l as ji,m as Oi,n as Si,o as P,p as Ai,q as F,u as N,v as Mi,w as Di,x as z,y as Ii,z as Pi}from"./focused-chunks/chunk-SSG62L7U.js";import{a as ui,b as fi,c as _i,d as mi,e as gi,f as yi,g as bi,h as Fi}from"./focused-chunks/chunk-G4TKJZ4A.js";import{A as co,L as ei,M as ti,N as ri,O as oi,P as ii,R as ni,S as si,T as di,U as ai,V as ci,W as li,X as pi,a as le,b as pe,c as ue,d as fe,e as _e,f as me,g as ge,h as ye,i as be,j as Jr,k as Kr,l as Xr,m as Yr,n as Hr,o as Vr,p as Wr,q as Qr,r as Zr,s as eo,t as to,u as ro,v as oo,w as io,x as no,y as so,z as ao}from"./focused-chunks/chunk-WUMGGQYN.js";import{c as R,d as L,f as q,h as G}from"./focused-chunks/chunk-267N774W.js";import{$ as vt,$a as S,A as Ze,Aa as Qt,B as et,Ba as Zt,C as tt,Ca as er,D as rt,Da as tr,E as ot,Ea as rr,F as it,Fa as or,Ga as ir,H as nt,Ha as nr,I as st,Ia as sr,J as dt,Ja as dr,K as at,Ka as ar,L as ct,La as cr,M as lt,Ma as lr,N as pt,Na as pr,O as ut,Oa as ur,P as ft,Pa as fr,Q as _t,Qa as _r,R as mt,Ra as mr,S as gt,Sa as gr,T as yt,Ta as yr,U as bt,Ua as br,V as ht,Va as hr,W as wt,Wa as wr,X as xt,Xa as xr,Y as kt,Z as $t,Za as kr,_ as Tt,aa as Ct,ab as A,b as je,ba as Et,bb as $r,c as Oe,ca as jt,d as Se,da as Ot,e as Ae,ea as St,f as Me,fa as At,g as De,ga as Mt,h as Ie,ha as Dt,i as Pe,ia as It,j as Fe,ja as Pt,k as Ne,ka as Ft,l as ze,la as Nt,m as Re,ma as zt,n as Le,na as Rt,o as qe,oa as Lt,p as Ge,pa as qt,q as Be,qa as Gt,r as Ue,ra as Bt,s as Je,sa as Ut,t as Ke,ta as Jt,u as Xe,ua as Kt,v as Ye,va as Xt,w as He,wa as Yt,x as Ve,xa as Ht,y as We,ya as Vt,z as Qe,za as Wt}from"./focused-chunks/chunk-7S7XWMXC.js";import{a as Ni,b as zi,c as Ri,d as Li,e as qi,f as Gi,g as Bi,h as Ui}from"./focused-chunks/chunk-HFAW3FJQ.js";import{$ as w,$b as Cr,Ad as Eo,Bb as he,Bd as jo,Cb as we,Cd as Oo,Db as xe,Dd as So,Eb as ke,Ed as Ao,Fb as j,Fd as Mo,Gb as $e,Gd as Do,Hb as _,Hd as Io,Ib as O,Id as Po,Jb as Te,Jd as Fo,Kb as ve,Kd as No,Lb as Ce,Ld as zo,Mb as Ee,Md as Ro,Nd as Lo,Od as qo,Pd as Go,Uc as M,Vc as D,Zb as Tr,_b as vr,ac as Er,bc as jr,cc as Or,dc as Sr,fc as Ar,gc as Mr,hc as Dr,ic as Ir,jc as Pr,jd as lo,kc as Fr,kd as po,ke as x,lc as Nr,ld as uo,le as Bo,mc as zr,md as fo,me as Uo,nc as Rr,nd as _o,ne as Jo,oc as Lr,od as mo,oe as Ko,pc as qr,pd as go,pe as Xo,qc as Gr,qd as yo,qe as Yo,rc as Br,rd as bo,re as Ho,sc as Ur,sd as ho,se as Vo,td as wo,te as Wo,ud as xo,ue as Qo,vd as ko,wd as $o,xd as To,yd as vo,ye as Zo,zd as Co}from"./focused-chunks/chunk-Z4PWEIMX.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]="3bb9b0da-78ce-5793-96e2-2de27b8f18fa")}catch{}})();var m,V=Object.freeze({list:"list-item-projection","list-all":"list-item-projection","list-draft":"list-item-projection","list-open":"list-item-projection","list-in-progress":"list-item-projection","list-blocked":"list-item-projection","list-closed":"list-item-projection","list-canceled":"list-item-projection",get:"get-item-projection",graph:"graph-detail-projection",search:"search-result-projection",history:"history-entry-projection",events:"mutation-event-projection",activity:"activity-entry-projection",deps:"dependency-graph-projection",health:"health-diagnostic-projection",validate:"validation-diagnostic-projection",contracts:"contract-catalog-projection"});function W(e,t){if(t==="--limit")return"result-row-limit";if(t==="--node-limit")return"graph-node-limit";if(t==="--edge-limit")return"graph-edge-limit";if(t==="--output-limit")return"rendered-output-row-limit";if(t==="--output-budget")return"rendered-output-byte-budget";if(t==="--token-budget")return"context-intent-token-budget";if(t==="--full"){let i=V[_(e)];if(i===void 0)throw new Error(`Command ${e} exposes --full without a registered projection concept.`);return i}return t!=="--file"?t.slice(2):["create","update","update-many"].includes(_(e))?"linked-file-path":["comments","notes","learnings"].includes(_(e))?"entry-file-input":"plan-definition-file"}function g(){if(m!==void 0)return m;let t=F.filter(({command:o})=>S(o)).flatMap(({command:o,family:s})=>P(o,A(o)).map(a=>({command:o,family:s,concept:W(o,a.flag),flag:a.flag,aliases:Object.freeze([...a.aliases??[]]),value_kind:a.repeatable?"list":a.flag==="--limit"?"number":a.value_type}))),i=new Set(t.flatMap(o=>o.aliases.map(s=>`${o.command}:${s}`))),n=t.filter(o=>!i.has(`${o.command}:${o.flag}`)),r=new Map;for(let o of n){let s=r.get(o.concept)??new Set;s.add(o.value_kind),r.set(o.concept,s)}return m=Object.freeze(n.map(o=>Object.freeze({...o,concept:r.get(o.concept)?.size===1?o.concept:`${o.concept}@${o.command}`}))),m}function Hi(){return Object.freeze(g().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var B=Object.freeze({init:30,item:20,config:36,extension:54,package:55,packages:55,install:27,upgrade:29,create:100,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:35,events:33,"history-attest":23,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:27,schema:43,profile:22,activity:35,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:31,notes:35,learnings:31,files:39,docs:30,deps:32,plan:109,test:53,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:39,release:24,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),U=Object.freeze({...B,...Object.fromEntries(j.flatMap(({alias:e,canonical:t})=>{let i=B[e];return i===void 0?[]:[[t,i]]}))});function J(){let e=new Map(Object.keys(U).map(t=>[t,0]));for(let{command:t}of g())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(U).map(([t,i])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:i})))}function Q(e,t,i){for(let n of e)for(let r of n.aliases){let o=t.get(`${n.command}:${r}`);o===void 0||o.flag===n.flag||i.push({code:"alias_collision",command:n.command,detail:`${r} aliases ${n.flag} but is canonical for ${o.flag}.`})}}function Z(e,t,i){let n=new Set(t.map(({command:r})=>r));for(let r of e.keys())n.has(r)||i.push({code:"missing_budget",command:r,detail:`${r} has canonical flags but no persisted budget.`});for(let r of t){let o=e.get(r.command)??0;o===0&&i.push({code:"stale_budget",command:r.command,detail:`${r.command} has a persisted budget but no canonical flags.`}),!(o<=r.maximum)&&i.push({code:"budget_exceeded",command:r.command,detail:`${o} canonical flags exceed the ratcheted maximum ${r.maximum}.`})}}function ee(e,t,i){let n=new Map(e.map(r=>[`${r.command}:${r.flag}`,r]));for(let r of t){let o=`${r.command}:${r.canonical_flag}`,s=n.get(o);if(!s){i.push({code:"removed_canonical_spelling",command:r.command,detail:`${r.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let d of r.accepted_spellings)a.has(d)||i.push({code:"removed_compatibility_spelling",command:r.command,detail:`${d} no longer resolves to ${r.canonical_flag}.`})}}function Vi(e=g(),t=J(),i=[]){let n=[],r=new Map,o=new Map,s=new Map,a=new Map;for(let d of e){let c=`${d.command}:${d.flag}`;r.has(c)?n.push({code:"duplicate_canonical_flag",command:d.command,detail:`${d.flag} has more than one canonical row.`}):r.set(c,d),a.set(d.command,(a.get(d.command)??0)+1);let l=o.get(d.concept);l!==void 0&&l!==d.value_kind?n.push({code:"inconsistent_concept_kind",command:d.command,detail:`${d.concept} uses both ${l} and ${d.value_kind}.`}):o.set(d.concept,d.value_kind);let p=s.get(d.concept);p!==void 0&&p!==d.flag?n.push({code:"semantic_spelling_collision",command:d.command,detail:`${d.concept} is canonicalized by both ${p} and ${d.flag}.`}):s.set(d.concept,d.flag)}return Q(e,r,n),Z(a,t,n),ee(e,i,n),n.sort((d,c)=>d.command.localeCompare(c.command)||d.code.localeCompare(c.code)||d.detail.localeCompare(c.detail)),{ok:n.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:d})=>d)).size,baseline_entry_count:i.length,findings:n}}function Wi(){let e=g(),t=J(),i=new Map(t.map(({command:r})=>[r,"unknown"]));for(let{command:r,family:o}of e)i.set(r,o);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:r,current:o,maximum:s})=>{let a=i.get(r);return`| \`${r}\` | ${a} | ${o} | ${s} |`}),""].join(`
|
|
2
2
|
`)}(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]="4d2bee02-8003-578c-9d25-32755534f8ff")}catch{}})();var $=2,te=["self_reported","independent_transport"];function y(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function f(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function K(e,t,i=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((n,r)=>{let o=f(n,`${t}[${String(r)}]`);return i?n:o})}function T(e,t){return e===void 0?void 0:f(e,t)}function re(e,t){if(e===void 0)return;if(!y(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let i=Object.entries(e).map(([n,r])=>{if(n.length===0||n.split(".").some(o=>o.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(r!==null&&typeof r!="string"&&typeof r!="boolean"&&(typeof r!="number"||!Number.isFinite(r)))throw new TypeError(`${t} values must be JSON primitives`);return[n,r]});return Object.fromEntries(i)}function oe(e,t,i,n,r,o){if(n==="refusal"){if(k(i)||r===void 0||o===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(r!==void 0||o!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let s=M(t);if(s===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[s].trim().toLowerCase();if(a==="history"){let l=D(t.slice(s+1));l!==void 0&&(a=O(`history ${l}`))}let d=I(a);if(!k(i)||i!==0&&!d?.exit_codes.some(l=>l===i))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let c=z(a).kind;if(n!==c)throw new TypeError(`${e} expected ${n}, but ${a} declares ${c}`)}function ie(e,t,i){if(!y(e))throw new TypeError(`tasks.${t}.steps[${String(i)}] must be an object`);let n=`tasks.${t}.steps[${String(i)}]`,r=f(e.id,`${n}.id`),o=K(e.args,`${n}.args`,!0),s=e.expected_exit_code;if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`${n}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!N.includes(a))throw new TypeError(`${n}.expected_output_kind is unsupported`);let d=a,c=e.expected_accounting_mode;if(!te.includes(c))throw new TypeError(`${n}.expected_accounting_mode is unsupported`);let l=c;if(l==="independent_transport"&&d!=="refusal")throw new TypeError(`${n} independent_transport accounting is supported only for refusal steps`);let p=K(e.required_fields,`${n}.required_fields`);if(p.some(Y=>Y.split(".").some(H=>H.length===0)))throw new TypeError(`${n}.required_fields must contain dot-separated own-property paths`);let C=re(e.expected_field_values,`${n}.expected_field_values`),b=T(e.expected_error_code,`${n}.expected_error_code`),h=T(e.expected_refusal_surface,`${n}.expected_refusal_surface`),E=T(e.recovery_for,`${n}.recovery_for`);return oe(n,o,s,d,b,h),{id:r,args:o,expected_exit_code:s,expected_output_kind:d,expected_accounting_mode:l,required_fields:p,...C?{expected_field_values:C}:{},...b?{expected_error_code:b}:{},...h?{expected_refusal_surface:h}:{},...E?{recovery_for:E}:{}}}function ne(e,t){if(!y(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let i=f(e.id,`tasks[${String(t)}].id`),n=f(e.description,`tasks.${i}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${i}.steps must be a non-empty array`);let r=e.steps.map((s,a)=>ie(s,i,a)),o=new Map;for(let s of r){if(o.has(s.id))throw new TypeError(`tasks.${i} contains duplicate step id ${s.id}`);if(s.recovery_for!==void 0&&(o.get(s.recovery_for)?.expected_output_kind!=="refusal"||s.expected_output_kind==="refusal"))throw new TypeError(`tasks.${i}.${s.id} recovery_for must reference an earlier refusal and declare successful output`);o.set(s.id,s)}if(r.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${i} completed task must terminate with successful output`);for(let s of r)if(s.expected_output_kind==="refusal"&&!r.some(a=>a.recovery_for===s.id))throw new TypeError(`tasks.${i}.${s.id} refusal must have a later successful recovery_for step`);return{id:i,description:n,steps:r}}function on(e){if(!y(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==$)throw new TypeError(`agent-task transcript corpus version must be ${String($)}`);if(!Array.isArray(e.tasks)||e.tasks.length===0)throw new TypeError("agent-task transcript corpus tasks must be non-empty");let t=e.tasks.map((n,r)=>ne(n,r)),i=new Set;for(let n of t){if(i.has(n.id))throw new TypeError(`duplicate agent-task transcript id ${n.id}`);i.add(n.id)}return{version:$,tasks:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6ecdd8cf-3153-5ed9-abd4-e8a73da6662a")}catch{}})();function se(e){return[e.expected_error_code!==void 0&&e.error_code!==e.expected_error_code?{code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected error code ${e.expected_error_code}, received ${e.error_code??"<missing>"}.`}:void 0,e.expected_allowed_values!==void 0&&JSON.stringify([...e.allowed_values].sort())!==JSON.stringify([...e.expected_allowed_values].sort())?{code:"incomplete_allowed_values",probe_id:e.probe_id,detail:"The refusal's accepted domain differs from the SDK-owned domain contract."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)===0?{code:"missing_suggested_retry_args",probe_id:e.probe_id,detail:"The refusal omitted shell-free suggested retry arguments."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)>0&&JSON.stringify(e.suggested_retry_args)!==JSON.stringify(e.expected_suggested_retry_args)?{code:"suggested_retry_args_mismatch",probe_id:e.probe_id,detail:"The refusal's suggested retry arguments differ from the SDK-owned contract."}:void 0]}function de(e){return[e.exit_code!==w.USAGE?{code:"non_refusal_exit",probe_id:e.probe_id,detail:`${e.entrypoint} returned exit code ${e.exit_code}; a structured usage refusal must return ${w.USAGE}.`}:void 0,e.allowed_values_required!==!1&&e.allowed_values.length===0?{code:"missing_allowed_values",probe_id:e.probe_id,detail:"The refusal omitted its complete accepted value domain."}:void 0,e.allowed_values.includes(e.rejected_value)?{code:"accepted_rejected_value",probe_id:e.probe_id,detail:`${e.rejected_value} is both rejected and advertised as allowed.`}:void 0,e.suggested_retry.trim().length===0?{code:"missing_suggested_retry",probe_id:e.probe_id,detail:"The refusal omitted an executable suggested retry."}:void 0,e.retry_succeeded?void 0:{code:"retry_failed",probe_id:e.probe_id,detail:"The advertised suggested retry did not succeed."},...se(e)]}function dn(e){let t=[],i=new Set,n=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let r of e){if(i.has(r.probe_id)){t.push({code:"duplicate_probe",probe_id:r.probe_id,detail:`${r.probe_id} was supplied more than once.`});continue}i.add(r.probe_id);let o=t.length;for(let s of de(r))s!==void 0&&t.push(s);t.length===o&&(n+=1)}return t.sort((r,o)=>r.probe_id!==o.probe_id?r.probe_id.localeCompare(o.probe_id):r.code.localeCompare(o.code)),{ok:t.length===0,probe_count:i.size,closed_probe_count:n,closure_fraction:i.size===0?0:n/i.size,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4b0b0999-9172-51f5-9645-bab74d30cb3d")}catch{}})();var X="not-a-declared-intent",u="not-a-declared-field";function ae(){let e={get:["pm-domain"],search:["Domain query"]},t=[...new Set(x.map(({command:o})=>o))].map(o=>{let s=x.filter(c=>c.command===o),a=s[0],d=e[a.command]??[];return{probe_id:`${a.command}-invalid-intent`,command:a.command,flag:"--for",rejected_value:X,refusal_args:[a.command,...d,"--for",X],allowed_values:s.map(({intent:c})=>c).sort(),suggested_retry_args:[a.command,...d,"--for",a.intent],error_code:"unknown_context_intent"}}),i=L(),n=Object.keys(R).map(o=>({probe_id:`${o}-invalid-field`,command:o,flag:"--fields",rejected_value:u,refusal_args:[o,"--fields",u],allowed_values:i,suggested_retry_args:[o,"--fields","id,title,status","--limit","10"],error_code:"unknown_field_projection"}));return[...t,...n,{probe_id:"get-invalid-field",command:"get",flag:"--fields",rejected_value:u,refusal_args:["get","pm-domain","--fields",u],allowed_values:q(),suggested_retry_args:["get","pm-domain","--fields","id,title,status"],error_code:"unknown_field_projection"},{probe_id:"list-mutually-exclusive-projection",command:"list",flag:"--projection",rejected_value:"--brief+--full",refusal_args:["list","--brief","--full"],allowed_values:[],suggested_retry_args:["list","--brief"],error_code:"projection_options_mutually_exclusive",allowed_values_required:!1},{probe_id:"get-mutually-exclusive-projection",command:"get",flag:"--projection",rejected_value:"--full+--fields",refusal_args:["get","pm-domain","--full","--fields","id"],allowed_values:[],suggested_retry_args:["get","pm-domain","--full"],error_code:"projection_options_mutually_exclusive",allowed_values_required:!1},{probe_id:"search-mutually-exclusive-projection",command:"search",flag:"--projection",rejected_value:"--full+--fields",refusal_args:["search","Domain query","--full","--fields","id"],allowed_values:[],suggested_retry_args:["search","Domain query","--full"],error_code:"projection_options_mutually_exclusive",allowed_values_required:!1},{probe_id:"package-upgrade-mutually-exclusive-modes",command:"package upgrade",flag:"--cli-only/--packages-only",rejected_value:"--cli-only+--packages-only",refusal_args:["package","upgrade","--cli-only","--packages-only","--dry-run"],allowed_values:[],suggested_retry_args:["package","upgrade","--packages-only","--dry-run"],error_code:"package_upgrade_modes_mutually_exclusive",allowed_values_required:!1},{probe_id:"search-invalid-field",command:"search",flag:"--fields",rejected_value:u,refusal_args:["search","Domain query","--fields",u],allowed_values:G(),suggested_retry_args:["search","Domain query","--fields","id,title,status,score"],error_code:"unknown_field_projection"}].sort((o,s)=>o.probe_id.localeCompare(s.probe_id))}function pn(e,t){let i=ae().find(o=>o.command===e&&o.flag===t);if(!i)return"No stable core values are declared.";let n=i.allowed_values.filter(o=>!o.startsWith("item.")),r=t==="--fields"?" item.<field> aliases and configured runtime metadata fields are also accepted.":" Configured package and workspace intents may extend this domain.";return`Allowed core values: ${n.join("|")}.${r}`}(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]="5053cc84-63e5-50d3-9a4c-00c2a485ed69")}catch{}})();var v=[{probe_id:"tracker-root-missing",failure_kind:"missing_root",expected_error_code:"tracker_root_missing",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-settings-missing",failure_kind:"settings_missing",expected_error_code:"tracker_not_initialized",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-not-directory",failure_kind:"not_directory",expected_error_code:"tracker_root_not_directory",expected_exit_code:2,recovery_kind:"select_directory"},{probe_id:"tracker-root-unreadable",failure_kind:"unreadable_root",expected_error_code:"tracker_root_unreadable",expected_exit_code:1,recovery_kind:"repair_permissions"}];function fn(){return v.map(e=>({...e}))}function ce(e,t){let i=[];t.error_code!==e.expected_error_code&&i.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&i.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&i.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let n=t.suggested_retry_args.indexOf("init"),r=n===0||n===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!r&&i.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&i.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||i.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),i}function _n(e){let t=new Map(e.map(r=>[r.probe_id,r])),i=[],n=0;for(let r of v){let o=t.get(r.probe_id);if(o===void 0){i.push({code:"missing_probe",probe_id:r.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=ce(r,o);i.push(...s),s.length===0&&(n+=1)}return i.sort((r,o)=>r.probe_id.localeCompare(o.probe_id)||r.code.localeCompare(o.code)),{ok:i.length===0,probe_count:v.length,closed_probe_count:n,findings:i}}(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]="3aa255ff-062b-5d25-9589-20b2911e86f9")}catch{}})();export{me as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,cr as ACTIVITY_FLAG_CONTRACTS,Xe as AGGREGATE_FLAG_CONTRACTS,Dt as APPEND_FLAG_CONTRACTS,Zt as ASSURANCE_FLAG_CONTRACTS,ue as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,ar as CALENDAR_FLAG_CONTRACTS,It as CLAIM_FLAG_CONTRACTS,oi as CLOSE_ACTION_OPTION_KEYS,At as CLOSE_FLAG_CONTRACTS,Mt as CLOSE_MANY_FLAG_CONTRACTS,Lt as CLOSE_TASK_FLAG_CONTRACTS,Ye as COMMENTS_FLAG_CONTRACTS,xr as COMPLETION_FLAG_CONTRACTS,ct as CONFIG_FLAG_CONTRACTS,fe as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,pr as CONTEXT_FLAG_CONTRACTS,wr as CONTRACTS_FLAG_CONTRACTS,ir as COPY_FLAG_CONTRACTS,ui as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,_i as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,fi as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,er as CREATE_FLAG_CONTRACTS,Ft as DELETE_FLAG_CONTRACTS,_r as DEPS_FLAG_CONTRACTS,Qe as DOCS_FLAG_CONTRACTS,Vt as DUPLICATES_FLAG_CONTRACTS,gr as EVAL_FLAG_CONTRACTS,lr as EVENTS_FLAG_CONTRACTS,Gt as EVENT_FLAG_CONTRACTS,ve as EXECUTABLE_COMMAND_ALIASES,wt as EXTENSION_ACTIVATE_FLAG_CONTRACTS,ht as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Et as EXTENSION_ADOPT_FLAG_CONTRACTS,Ct as EXTENSION_CATALOG_FLAG_CONTRACTS,xt as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,bt as EXTENSION_DESCRIBE_FLAG_CONTRACTS,vt as EXTENSION_DOCTOR_FLAG_CONTRACTS,yt as EXTENSION_EXPLORE_FLAG_CONTRACTS,lt as EXTENSION_FLAG_CONTRACTS,ut as EXTENSION_INIT_FLAG_CONTRACTS,mt as EXTENSION_INSTALL_FLAG_CONTRACTS,$t as EXTENSION_MANAGE_FLAG_CONTRACTS,kt as EXTENSION_MIGRATE_FLAG_CONTRACTS,Tt as EXTENSION_RELOAD_FLAG_CONTRACTS,pt as EXTENSION_SCOPE_FLAG_CONTRACTS,gt as EXTENSION_UNINSTALL_FLAG_CONTRACTS,We as FILES_FLAG_CONTRACTS,nr as FOCUS_FLAG_CONTRACTS,Yt as GC_FLAG_CONTRACTS,ur as GET_FLAG_CONTRACTS,Je as GLOBAL_FLAG_CONTRACTS,mr as GRAPH_FLAG_CONTRACTS,fr as GUIDE_FLAG_CONTRACTS,Wt as HEALTH_FLAG_CONTRACTS,ot as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,it as HISTORY_COMPACT_FLAG_CONTRACTS,Ze as HISTORY_FLAG_CONTRACTS,tt as HISTORY_REDACT_FLAG_CONTRACTS,rt as HISTORY_REPAIR_FLAG_CONTRACTS,at as INIT_FLAG_CONTRACTS,jt as INSTALL_FLAG_CONTRACTS,rr as ITEM_COMPLETE_FLAG_CONTRACTS,tr as ITEM_MUTATE_FLAG_CONTRACTS,or as ITEM_REOPEN_FLAG_CONTRACTS,Ve as LEARNINGS_FLAG_CONTRACTS,le as LIST_COMMANDER_STRING_OPTION_CONTRACTS,Ke as LIST_FILTER_FLAG_CONTRACTS,qt as MEET_FLAG_CONTRACTS,et as MERGE_FLAG_CONTRACTS,Ar as MERGE_SUBCOMMAND_VALUES,_e as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,br as NEXT_FLAG_CONTRACTS,He as NOTES_FLAG_CONTRACTS,ft as PACKAGE_FLAG_CONTRACTS,_t as PACKAGE_INIT_FLAG_CONTRACTS,Rt as PAUSE_TASK_FLAG_CONTRACTS,ri as PLAN_CREATE_METADATA_PARAMETER_KEYS,dt as PLAN_FLAG_CONTRACTS,te as PM_AGENT_TASK_ACCOUNTING_MODES,$ as PM_AGENT_TASK_TRANSCRIPT_VERSION,xe as PM_BULK_LIFECYCLE_COMMAND_ALIASES,Fe as PM_CLI_GRAMMAR_CONTRACT,je as PM_CLI_GRAMMAR_NOUNS,Pr as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,Oe as PM_CLI_SHARED_VERBS,Te as PM_COMMAND_ALIAS_CONTRACTS,Ie as PM_COMMAND_DESTINATION_CONTRACTS,wi as PM_COMMAND_EXIT_CONTRACTS,hi as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,bo as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,Di as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,Pe as PM_COMMAND_POSITIONAL_CONTRACTS,x as PM_CONTEXT_INTENT_CONTRACTS,we as PM_CONTEXT_OPS_COMMAND_ALIASES,Sr as PM_CORE_COMMAND_NAMES,Nr as PM_DEPRECATED_TOOL_ACTIONS,fo as PM_DIAGNOSTIC_DEGRADATION_STEPS,_o as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,uo as PM_DIAGNOSTIC_OUTPUT_CLASSES,zr as PM_DISCOVERABLE_TOOL_ACTIONS,Oi as PM_ERROR_CODE_CATALOG,vi as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,Tr as PM_EXTENSION_CAPABILITY_CONTRACTS,Mr as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,Cr as PM_EXTENSION_POLICY_MODE_CONTRACTS,Or as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,jr as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,vr as PM_EXTENSION_SERVICE_NAME_CONTRACTS,Er as PM_EXTENSION_TRUST_MODE_CONTRACTS,Fi as PM_HISTORY_ATTESTATION_CONTRACT,he as PM_HISTORY_COMMAND_ALIASES,Ri as PM_HISTORY_OPERATION_ALIASES,qi as PM_HISTORY_OPERATION_CONTRACT,Li as PM_HISTORY_OPERATION_PATTERNS,Ir as PM_ITEM_ACTION_SUBCOMMANDS,Ni as PM_ITEM_HISTORY_OPERATIONS,j as PM_NAMESPACED_COMMAND_ALIASES,po as PM_OUTPUT_BUDGET_CLASSES,lo as PM_OUTPUT_DEGRADATION_STEPS,N as PM_OUTPUT_ENVELOPE_KINDS,Dr as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Se as PM_POSITIONAL_ACTION_CONTRACTS,li as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,ai as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,Ao as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,To as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,jo as PM_READ_OUTPUT_DIMENSIONS,So as PM_READ_OUTPUT_OPTION_FLAGS,Oo as PM_READ_OUTPUT_SURFACES,Mo as PM_READ_OUTPUT_SURFACE_CONTRACTS,ke as PM_RELOCATED_COMMAND_ALIASES,xi as PM_SUCCESS_EXIT_CODES,Fr as PM_TOOL_ACTIONS,ii as PM_TOOL_ACTION_PARAMETER_CONTRACTS,ci as PM_TOOL_PARAMETERS_SCHEMA,di as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,si as PM_TOOL_PARAMETERS_SCHEMA_VERSION,ei as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,zi as PM_WORKSPACE_HISTORY_OPERATIONS,st as PROFILE_FLAG_CONTRACTS,St as REINDEX_FLAG_CONTRACTS,Nt as RELEASE_FLAG_CONTRACTS,Bt as REMIND_FLAG_CONTRACTS,Pt as RESTORE_FLAG_CONTRACTS,nt as SCHEMA_FLAG_CONTRACTS,pe as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,hr as SEARCH_FLAG_CONTRACTS,zt as START_TASK_FLAG_CONTRACTS,Ht as STATS_FLAG_CONTRACTS,Ue as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,Kt as TELEMETRY_FLAG_CONTRACTS,Jt as TEST_ALL_FLAG_CONTRACTS,Ut as TEST_FLAG_CONTRACTS,Xt as TEST_RUNS_FLAG_CONTRACTS,no as TOOL_ACTIVITY_OPTION_CONTRACTS,Xr as TOOL_AGGREGATE_OPTION_CONTRACTS,to as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,io as TOOL_CALENDAR_OPTION_CONTRACTS,oo as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,so as TOOL_CONTEXT_OPTION_CONTRACTS,Qr as TOOL_CREATE_OPTION_CONTRACTS,Wr as TOOL_CREATE_OPTION_CONTRACT_SOURCE,ao as TOOL_DEPS_OPTION_CONTRACTS,co as TOOL_GRAPH_OPTION_CONTRACTS,Kr as TOOL_LIST_FILTER_OPTION_CONTRACTS,Yr as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Vr as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Hr as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,ro as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,eo as TOOL_UPDATE_OPTION_CONTRACTS,Zr as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,mi as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,yi as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,gi as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,sr as UPDATE_FLAG_CONTRACTS,dr as UPDATE_MANY_FLAG_CONTRACTS,Ot as UPGRADE_FLAG_CONTRACTS,Qt as VALIDATE_FLAG_CONTRACTS,yr as WORKSPACE_FLAG_CONTRACTS,pi as _testOnlyCliContracts,$i as analyzePmCommandExitConformance,Rr as analyzePmToolActionParity,bi as analyzeSdkCliParameterCompleteness,Xo as applyContextIntentProjection,Lo as applyReadOutputDimensions,Fo as applyReadOutputIncludeModes,Vo as attachContextIntentReceipt,Qo as attachOutputTokenAccounting,Wo as attachReadOutputContracts,ni as buildPmActionToolInputSchema,Be as compactFlagAliasContracts,Jo as composeContextIntentContracts,Ho as contextIntentRowId,go as createPmCommandOutputBudget,Yo as decodeContextIntentCursor,Eo as decodeReadOutputContinuationCursor,yo as definePmCommandOutputBudget,Mi as definePmCommandOutputEnvelope,Ci as definePmErrorCodeCatalog,Ti as derivePmBulkMutationEffect,Co as encodeReadOutputContinuationCursor,Si as enrichCliFlagInvocationContract,P as enrichCliFlagInvocationContracts,wo as estimatePmOutputTokens,$e as findPmNamespacedCommand,De as formatPmPositionalActionFlagTip,Bo as getActiveContextIntentContracts,S as hasSubcommandFlagContractsForCommand,mo as inferPmOutputBudgetClass,qr as isPmExtensionCapabilityContract,Br as isPmExtensionPolicyModeContract,Ur as isPmExtensionPolicySurfaceContract,Gr as isPmExtensionServiceNameContract,ki as isPmKnownExitCode,Ii as isPmMutationReceipt,k as isPmSuccessfulExitCode,Lr as isPmToolAction,qo as isReadOutputBudgetExceeded,ae as listCoreClosedDomainContracts,J as listPmCommandFlagBudgets,g as listPmFlagLexicon,Hi as listPmFlagSpellingInventory,fn as listTrackerPreflightRecoveryContracts,Ui as normalizeHistoryOperationForWrite,No as normalizeReadOutputIncludeModeOptions,Pi as parseMutationReceipt,on as parsePmAgentTaskTranscriptCorpus,ze as positionalShapeKey,Re as positionalSignatureKey,ko as projectPmDiagnosticOutput,$o as projectPmDiagnosticText,ge as readFirstStringFromCommanderOptions,ye as readFirstValueFromCommanderOptions,vo as readOutputCollectionFingerprint,Po as readOutputIncludeModeOptions,be as readStringArrayFromCommanderOptions,pn as renderPmClosedDomainHelp,Ee as renderPmCommandAliasMigrationHint,Wi as renderPmFlagLexiconMarkdown,Bi as requireHistoryOperation,Ei as resolveCanonicalPmErrorCodeContract,Ko as resolveContextIntentContract,Gi as resolveHistoryOperation,Ce as resolvePmCommandAlias,I as resolvePmCommandExitContract,_ as resolvePmCommandOperation,ho as resolvePmCommandOutputBudget,z as resolvePmCommandOutputEnvelope,Ae as resolvePmCommandPositionalContract,xo as resolvePmDiagnosticOutputBudget,ji as resolvePmErrorCodeContract,W as resolvePmFlagSemanticConcept,O as resolvePmHistoryOperation,Me as resolvePmPositionalActionContract,kr as resolvePmPositionalActionFlagContracts,ti as resolvePmToolCustomFieldCollision,zo as resolveReadOutputDimensions,Go as resolveReadOutputEncoding,Zo as resolveReadOutputRecoveryBudget,Do as resolveReadOutputSurface,A as resolveSubcommandFlagContractsForCommand,Uo as runWithContextIntentContracts,dn as scorePmRefusalClosure,_n as scoreTrackerPreflightRecoveryClosure,Ro as stabilizeReadOutputReceiptEstimates,$r as toCompletionFlagString,Io as validateReadOutputOptions,Ai as verifyCliFlagInvocationParity,Ne as verifyExplicitPositionalSlotCensus,qe as verifyPmCliGrammar,Le as verifyPmCommandPositionalContracts,Vi as verifyPmFlagLexicon,Jr as verifyToolOptionCliParity,Ge as withFlagAliasMetadata};
|
|
3
3
|
//# sourceMappingURL=sdk-contracts.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as au,o as Ko,p as uu,q as pu,r as ga,s as Ho,t as fu,u as ya,v as Vo,y as ju,z as qu}from"./focused-chunks/chunk-BMATJLPT.js";import{a as Hu,f as Vu,h as Zt,m as Wu,o as mr,r as ei,s as Yu,t as Ju,x as Xu}from"./focused-chunks/chunk-AXDAIBT3.js";import{$ as ff,$a as Vf,Aa as Tf,Ab as rc,Ba as Cf,Bb as oc,Ca as Rf,Cb as Ii,Da as If,Db as ic,Ea as Of,Eb as a_,Fa as xf,Fb as sc,Ga as Pf,Gb as Oi,H as Gt,Ha as Lf,Hb as Dn,I as w,Ia as Nf,Ib as ac,J as af,Ja as Mf,Jb as cc,K as cf,Ka as $f,Kb as c_,L as qe,La as Fn,Lb as l_,M as lf,Mb as d_,N as Ya,Nb as Un,O as df,Ob as lc,P as Ja,Pa as Ff,Pb as m_,Q as Si,Qa as Df,R as Xa,Ra as Uf,S as $n,Sa as Gf,Sb as xi,T as mf,Ta as jf,U as Qa,Ua as qf,V as Te,Va as Kf,W as Za,Wa as tn,X as be,Xa as zf,Y as uf,Ya as Bf,Z as pf,Za as Ai,Zb as __,_ as ec,_a as Hf,a as Na,aa as tc,ab as Wf,b as Up,bb as Yf,bc as g_,cb as Jf,cc as y_,db as Ti,dc as v_,eb as jt,ec as w_,fb as Xf,gb as Ci,i as nf,ia as _f,j as rf,jb as Sr,ka as kr,la as hf,ma as Ei,na as gf,nb as Qf,oa as yf,ob as Ri,pb as Jb,qb as Zf,rb as e_,sb as nc,ta as vf,tb as t_,ua as wf,ub as n_,va as bf,vb as r_,wa as kf,wb as o_,xa as Sf,xb as i_,ya as Ef,yb as s_,za as Af,zb as Er}from"./focused-chunks/chunk-63YRRGKX.js";import{e as ou,g as iu,h as su,k as cu,q as mu}from"./focused-chunks/chunk-YBQTVE5S.js";import{b as Ku,c as Zo,e as zu,f as Bu,g as Lb}from"./focused-chunks/chunk-PBJC2ZNA.js";import{R as La,V as Gu,a as Yd,b as Jd,c as Xd,d as Qd,f as Zd}from"./focused-chunks/chunk-UACMCSCC.js";import{a as $p,b as Fp,c as Ni}from"./focused-chunks/chunk-JKJYXCT6.js";import{K as sf,b as Dp}from"./focused-chunks/chunk-MD7ADLME.js";import{$ as Zb,Ca as fc,Sa as Rr,Ta as _c,W as Xb,X as mc,Y as uc,Z as Li,_ as Qb,c as Ka,e as za,g as Mp,h as Jp,i as Xp,j as Qp,k as Zp,l as ef,m as tf,n as Tr,o as dc,ra as pc,wa as Cr,ya as h_}from"./focused-chunks/chunk-ZHX3433X.js";import{A as Dt,B as _e,C as Ln,D as fi,E as _i,H as hi,I as gi,J as qp,Ja as Mn,K as yi,Ka as Hp,L as vi,La as Wa,M as Nn,Ma as Vp,N as Va,O as wi,P as Kp,Pa as Wp,Q as zp,Qa as Yp,R as vr,Za as Pi,a as yr,ab as p_,b as en,bb as Ar,c as ii,d as si,e as ai,eb as f_,f as ci,j as li,k as Ft,l as xn,m as di,mb as gt,n as Pn,o as mi,ob as Mi,p as le,q as ui,r as Ba,s as He,t as Ha,ta as Bp,tb as Gn,u as Gp,v as Ae,x as ht,y as jp,z as pi}from"./focused-chunks/chunk-ZOE2NSJB.js";import{c as tu,f as nu,g as ru,i as qo,j as xt,k as _u,l as hu,m as gu}from"./focused-chunks/chunk-5SBU4QDC.js";import{a as Zu,b as ep,c as tp}from"./focused-chunks/chunk-533DCWPY.js";import{$ as Cm,A as yo,Aa as Vm,B as am,Ba as Wm,C as cm,Ca as Ro,D as lm,Da as Ym,E as vo,Ea as Jm,F as dm,Fa as Xm,G as mm,Ga as Io,H as um,Ha as Oo,I as pm,Ia as xo,J as wo,Ja as Po,K as bo,Ka as cr,L as fm,La as Qm,M as ko,Ma as Lo,Na as lr,O as _m,Oa as No,P as sr,Pa as Mo,Q as hm,Qa as $o,R as gm,Ra as Fo,S as ym,Sa as Zm,T as vm,Ta as It,U as wm,Ua as Do,V as bm,Va as Uo,W as km,Wa as Go,X as Sm,Xa as jo,Y as Em,Z as Am,_ as Tm,_a as eu,aa as Rm,ab as Ot,ba as Im,bb as N,ca as Om,d as fa,da as ar,e as em,ea as xm,fa as Pm,ga as So,h as fo,ha as Eo,i as _a,ia as Lm,j as Xt,ja as Nm,ka as Mm,l as tm,la as $m,ma as Fm,na as Dm,oa as Um,pa as Gm,q as ha,ra as jm,s as _o,sa as qm,t as ho,ta as Km,u as go,ua as zm,v as nm,va as Bm,w as rm,wa as Hm,x as om,xa as Ao,y as im,ya as To,z as sm,za as Co}from"./focused-chunks/chunk-SHF57M2H.js";import{$ as up,$a as qa,A as Yb,Ab as Pp,B as Rn,Bb as oi,C,Cb as _t,Db as Lp,Eb as se,Fb as Np,G as ft,Ga as bp,Gb as Ne,Hb as wr,Ia as ja,Ib as br,Jb as bi,K as op,Kb as Ut,L as ri,La as kp,M as ip,Ma as Sp,N as sp,Na as nt,O as ap,P as cp,Pb as ki,Q as lp,Qa as Ep,Ra as Ap,S as ee,Sa as A,T as Ma,Ta as Le,U as ne,Ua as Nt,W as $a,Wa as je,X as dp,Xa as hr,Y as Be,Ya as In,Z as et,Za as Tp,_ as mp,_a as On,a as Nb,ab as Cp,b as Mb,ba as pp,c as $b,ca as fp,d as Fb,da as Fa,ec as of,ga as Da,gb as gr,ia as _p,ib as Rp,ic as u_,j as ti,ja as hp,jb as Ip,k as np,ka as gp,l as rp,la as yp,m as Cn,ma as vp,n as ur,o as Db,p as Ub,pb as Mt,q as Gb,qa as Pe,r as jb,ra as Lt,rb as $t,s as qb,t as Kb,ta as Ua,tb as Op,u as zb,ua as pr,ub as R,v as Bb,va as fr,vb as q,w as Hb,wa as Ga,wb as ie,x as ni,xa as tt,xb as xp,y as Vb,ya as wp,z as Wb,za as _r,zb as fe}from"./focused-chunks/chunk-6C3CUU2G.js";import{b as Ct,c as co,d as lo,f as ut,h as zo,i as pt,j as Pt,k as lu,m as F,n as Bo,o as Ze,q as du}from"./focused-chunks/chunk-OGGF2RBL.js";import{e as Qu}from"./focused-chunks/chunk-HFAW3FJQ.js";import{$ as l,$a as Ud,$b as wu,Aa as x,Ab as or,Ad as bb,Ae as Ib,B as Rd,Ba as we,Bc as ka,Bd as kb,Be as Ob,C as Id,Ca as mo,Cc as Sa,Ce as xb,D as Od,Da as bn,Dc as Ea,Dd as Sb,De as Pb,E as xd,Ea as tr,Ec as Aa,Ed as Eb,Ee as Qo,F as Pd,Fa as Md,Fb as Ge,Fc as Ta,Fd as Oa,Fe as Uu,G as Ld,Ga as E,Gc as Ca,Gd as xa,H as oa,Ha as $d,Hb as Y,Hc as Ra,Hd as Pa,I as ia,Ia as lt,Ic as O,Id as Pu,J as sa,Ja as pe,Jb as ir,Jc as En,K as aa,Ka as dt,Kc as Qt,Kd as Lu,L as ca,Lc as J,Ld as Ab,M as la,Ma as Qe,Mc as Wo,Na as uo,Nc as An,Nd as Tb,Ob as Sn,Od as Cb,P as ao,Pd as Rb,Qc as Yo,Rd as S,Sc as Se,Ta as kn,Tc as Jo,U as da,Va as Fd,Vd as Xo,W as Nd,Xa as ua,Xc as dr,Xd as oe,Ya as nr,Z as Tt,Za as Dd,Zb as yu,_b as vu,_d as Ee,aa as d,ac as bu,bb as po,bc as ku,cc as Su,db as Gd,dc as va,eb as jd,ec as Eu,ee as Nu,gb as qd,gc as Au,hb as Kd,hc as Tu,ib as zd,ja as L,jb as Bd,jd as Ou,ka as Yt,kb as Hd,kc as wa,la as Rt,lb as Vd,lc as Cu,le as Mu,ma as Z,mb as Wd,mc as ba,me as $u,na as te,nd as xu,o as oo,p as Cd,pa as wn,pb as Jt,pe as Tn,q as io,qb as mt,r as ra,sd as Ia,tc as Ru,te as Fu,v as Wt,va as ma,w as ct,wa as er,x as yn,xa as ke,xe as Du,y as vn,yb as rr,z as so,zb as pa,zc as Iu,zd as wb}from"./focused-chunks/chunk-4YTDKIPF.js";import{AsyncLocalStorage as YM}from"node:async_hooks";(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]="176b4ac2-2c47-50d6-beee-62e1d3dc9281")}catch{}})();function b_(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ek(e){return e.brief===!0?"brief":typeof e.fields=="string"&&e.fields.trim().length>0||Array.isArray(e.fields)&&e.fields.length>0?"fields":e.compact===!0?"compact":"full"}function hc(e,t){let n=ek(t),r=n==="brief"?n:b_(e.projection)&&typeof e.projection.mode=="string"?e.projection.mode:n;return{...e,query_summary:{filters:b_(e.filters)?e.filters:{},projection:r}}}(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]="3046466c-614c-5e2b-a156-df96fba8c483")}catch{}})();async function k_(e,t){let n=E(t??process.cwd(),e),r=await A(n);return fe(n,r.item_format,x(r,null).type_to_folder,void 0,r.schema)}(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]="0c84b11c-502f-5c33-a757-5757402357b4")}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]="e8137f8b-745a-5ef5-9e7e-14b7d032c1ea")}catch{}})();var tk=new Map;function gc(){tk.clear()}(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]="b841f903-6276-5067-842f-6a6bff114cec")}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]="0c7a926a-46a2-560c-ae95-33b92b8c820e")}catch{}})();var nk={"list-all":{action:"list",options:{excludeTerminal:!1}},"list-draft":{action:"list",options:{status:"draft",excludeTerminal:!1}},"list-open":{action:"list",options:{status:"open",excludeTerminal:!1}},"list-in-progress":{action:"list",options:{status:"in_progress",excludeTerminal:!1}},"list-blocked":{action:"list",options:{status:"blocked",excludeTerminal:!1}},"list-closed":{action:"list",options:{status:"closed",excludeTerminal:!1}},"list-canceled":{action:"list",options:{status:"canceled",excludeTerminal:!1}}};function S_(e){return Object.fromEntries(Au.map(t=>[`${e}-${t}`,{action:e,options:{[t==="adopt-all"?"adoptAll":t]:!0,...e==="package"?{vocabulary:"package"}:{}}}]))}var E_={ctx:{action:"context"},...nk,...S_("extension"),...S_("package"),...Object.fromEntries(Tu.map(e=>[`package-${e}`,{action:e}]))};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9133d39d-b2fb-5f99-8fd3-87a7d2f8df6d")}catch{}})();var yc="PmCliError";function rk(e){if(!Number.isFinite(e))throw new TypeError("createPmCliExpectedError options.exitCode must be a finite number");let t=Math.trunc(e);if(t<=l.SUCCESS)throw new TypeError("createPmCliExpectedError options.exitCode must be a positive exit code");return t}function A_(e,t={}){if(typeof e!="string"||e.trim().length===0)throw new TypeError("createPmCliExpectedError message must be a non-empty string");let n=new d(e,rk(t.exitCode??l.USAGE),t.context??{});return"cause"in t&&Object.defineProperty(n,"cause",{value:t.cause,enumerable:!1,configurable:!0,writable:!0}),n}function $i(e){if(!(e instanceof Error)||e.name!==yc)return!1;let t=e;return typeof t.exitCode=="number"&&Number.isFinite(t.exitCode)}(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]="3113ad4b-282a-50af-a836-8e9abfde7d7e")}catch{}})();function vc(e){let t=Ud();for(let n of e)t.register(n);return t}function T_(e,t){return{client:t,isItemNotFoundError:n=>$i(n)&&n.exitCode===l.NOT_FOUND,getItemAt:(n,r)=>Mp(n,r,{pmRoot:e}),openRelationshipEventStore:n=>Fp.open({pmRoot:e,nodes:n.nodes,registry:vc(n.definitions),...n.relativePath===void 0?{}:{relativePath:n.relativePath}}),createRelationshipGraph:n=>new jd(n.nodes,n.edges,vc(n.definitions)),analyzeRelationshipImpact:(n,r,o)=>Dp(n,r,o),validateRelationshipEvents:n=>{let r=new $p(n.nodes,{registry:vc(n.definitions)});return n.events.map(o=>r.append({...o,expectedVersion:r.version}))},commitWorkspaceTransaction:n=>Up({...n,pmRoot:e})}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c2766f4e-6354-55bb-9e40-676273ee901f")}catch{}})();async function C_(e,t,n=Nu){try{await n({pmRoot:e,result:t})}catch{if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let r=t,o=Array.isArray(r.warnings)?r.warnings.filter(i=>typeof i=="string"):[];r.warnings=[...new Set([...o,"context_usage_feedback_write_failed"])].sort()}}}import{readFile as ok}from"node:fs/promises";import ik from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c64f304d-9081-5bad-8187-7bf6b65e4a07")}catch{}})();var wc="context-intents.json";function Fi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function sk(e,t,n){if(!Fi(e))throw new TypeError(`${t} context intent at index ${String(n)} must be an object`);let r=e.included_field_groups;if(typeof e.command!="string"||typeof e.intent!="string"||typeof e.description!="string"||!Array.isArray(r)||!r.every(o=>typeof o=="string")||typeof e.token_budget!="number")throw new TypeError(`${t} context intent at index ${String(n)} has an invalid contract shape`);return{command:e.command,intent:e.intent,description:e.description,included_field_groups:r,token_budget:e.token_budget}}function R_(e,t){let n=Array.isArray(e)?e:Fi(e)&&Array.isArray(e.intents)?e.intents:void 0;if(!n)throw new TypeError(`${t} context intents must be an array or an object with an intents array`);return n.map((r,o)=>sk(r,t,o))}async function ak(e){let t=ik.join(e,wc),n;try{n=await ok(t,"utf8")}catch(o){if(Yt(o))return[];throw await Op(e),o}let r;try{r=JSON.parse(n)}catch(o){let i=o instanceof Error?o.message:String(o);throw new TypeError(`Invalid ${wc}: ${i}`,{cause:o})}return R_(r,wc)}function ck(e){if(!Fi(e))return;let t=e.contextIntents??e.context_intents;if(t!==void 0)return t;let n=e.default;return Fi(n)?n.contextIntents??n.context_intents:void 0}function lk(e){return e.flatMap(t=>{let n=ck(t.module);return n===void 0?[]:R_(n,`package ${t.name}`)})}async function dk(e){let t=await ak(e.pmRoot),n=lk(e.packages??[]);return{workspaceContracts:t,packageContracts:n}}async function bc(e,t){let n=await dk(e);return await $u(n,t)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="663579ae-aebb-524c-81c9-9aed44e40f35")}catch{}})();async function I_(e,t,n){if(t.body===void 0)throw new d("Missing required --body text",l.USAGE);let r=Dt(),o=E(process.cwd(),n.path);await R(o);let i=await A(o),s=C(t.author,i.author_default),c=(await r.resolveValue(t.body,"--body",jp(t,"body"))).trim();if(c.length===0)throw new d("--body text cannot be empty; append requires non-blank content and empty appends would only rewrite updated_at.",l.USAGE,{code:"append_empty_body",required:"Provide non-empty body text positionally, via --body, or with - for stdin.",examples:['pm append pm-a1b2 --body "Progress note"',"pm append pm-a1b2 --body -"]});let m=await se({pmRoot:o,settings:i,id:e,op:"append",author:s,message:t.message,force:t.force,mutate(u){let p=u.body.trim().length>0?`
|
|
1
|
+
import{n as au,o as Ko,p as uu,q as pu,r as ga,s as Ho,t as fu,u as ya,v as Vo,y as ju,z as qu}from"./focused-chunks/chunk-5KYHDFDN.js";import{a as Hu,f as Vu,h as Zt,m as Wu,o as mr,r as ei,s as Yu,t as Ju,x as Xu}from"./focused-chunks/chunk-SSG62L7U.js";import{$ as ff,$a as Vf,Aa as Tf,Ab as rc,Ba as Cf,Bb as oc,Ca as Rf,Cb as Ii,Da as If,Db as ic,Ea as Of,Eb as a_,Fa as xf,Fb as sc,Ga as Pf,Gb as Oi,H as Gt,Ha as Lf,Hb as Dn,I as w,Ia as Nf,Ib as ac,J as af,Ja as Mf,Jb as cc,K as cf,Ka as $f,Kb as c_,L as qe,La as Fn,Lb as l_,M as lf,Mb as d_,N as Ya,Nb as Un,O as df,Ob as lc,P as Ja,Pa as Ff,Pb as m_,Q as Si,Qa as Df,R as Xa,Ra as Uf,S as $n,Sa as Gf,Sb as xi,T as mf,Ta as jf,U as Qa,Ua as qf,V as Te,Va as Kf,W as Za,Wa as tn,X as be,Xa as zf,Y as uf,Ya as Bf,Z as pf,Za as Ai,Zb as __,_ as ec,_a as Hf,a as Na,aa as tc,ab as Wf,b as Up,bb as Yf,bc as g_,cb as Jf,cc as y_,db as Ti,dc as v_,eb as jt,ec as w_,fb as Xf,gb as Ci,i as nf,ia as _f,j as rf,jb as Sr,ka as kr,la as hf,ma as Ei,na as gf,nb as Qf,oa as yf,ob as Ri,pb as Jb,qb as Zf,rb as e_,sb as nc,ta as vf,tb as t_,ua as wf,ub as n_,va as bf,vb as r_,wa as kf,wb as o_,xa as Sf,xb as i_,ya as Ef,yb as s_,za as Af,zb as Er}from"./focused-chunks/chunk-WHL5CQG3.js";import{e as ou,g as iu,h as su,k as cu,q as mu}from"./focused-chunks/chunk-LNM3BS45.js";import{b as Ku,c as Zo,e as zu,f as Bu,g as Lb}from"./focused-chunks/chunk-G4TKJZ4A.js";import{R as La,V as Gu,a as Yd,b as Jd,c as Xd,d as Qd,f as Zd}from"./focused-chunks/chunk-WUMGGQYN.js";import{a as $p,b as Fp,c as Ni}from"./focused-chunks/chunk-BFUXTNZU.js";import{K as sf,b as Dp}from"./focused-chunks/chunk-OWDDVMAP.js";import{$ as Zb,Ca as fc,Sa as Rr,Ta as _c,W as Xb,X as mc,Y as uc,Z as Li,_ as Qb,c as Ka,e as za,g as Mp,h as Jp,i as Xp,j as Qp,k as Zp,l as ef,m as tf,n as Tr,o as dc,ra as pc,wa as Cr,ya as h_}from"./focused-chunks/chunk-5FSGN4MP.js";import{A as Dt,B as _e,C as Ln,D as fi,E as _i,H as hi,I as gi,J as qp,Ja as Mn,K as yi,Ka as Hp,L as vi,La as Wa,M as Nn,Ma as Vp,N as Va,O as wi,P as Kp,Pa as Wp,Q as zp,Qa as Yp,R as vr,Za as Pi,a as yr,ab as p_,b as en,bb as Ar,c as ii,d as si,e as ai,eb as f_,f as ci,j as li,k as Ft,l as xn,m as di,mb as gt,n as Pn,o as mi,ob as Mi,p as le,q as ui,r as Ba,s as He,t as Ha,ta as Bp,tb as Gn,u as Gp,v as Ae,x as ht,y as jp,z as pi}from"./focused-chunks/chunk-GKSAMNBG.js";import{c as tu,f as nu,g as ru,i as qo,j as xt,k as _u,l as hu,m as gu}from"./focused-chunks/chunk-NOK652OP.js";import{a as Zu,b as ep,c as tp}from"./focused-chunks/chunk-267N774W.js";import{$ as Cm,A as yo,Aa as Vm,B as am,Ba as Wm,C as cm,Ca as Ro,D as lm,Da as Ym,E as vo,Ea as Jm,F as dm,Fa as Xm,G as mm,Ga as Io,H as um,Ha as Oo,I as pm,Ia as xo,J as wo,Ja as Po,K as bo,Ka as cr,L as fm,La as Qm,M as ko,Ma as Lo,Na as lr,O as _m,Oa as No,P as sr,Pa as Mo,Q as hm,Qa as $o,R as gm,Ra as Fo,S as ym,Sa as Zm,T as vm,Ta as It,U as wm,Ua as Do,V as bm,Va as Uo,W as km,Wa as Go,X as Sm,Xa as jo,Y as Em,Z as Am,_ as Tm,_a as eu,aa as Rm,ab as Ot,ba as Im,bb as N,ca as Om,d as fa,da as ar,e as em,ea as xm,fa as Pm,ga as So,h as fo,ha as Eo,i as _a,ia as Lm,j as Xt,ja as Nm,ka as Mm,l as tm,la as $m,ma as Fm,na as Dm,oa as Um,pa as Gm,q as ha,ra as jm,s as _o,sa as qm,t as ho,ta as Km,u as go,ua as zm,v as nm,va as Bm,w as rm,wa as Hm,x as om,xa as Ao,y as im,ya as To,z as sm,za as Co}from"./focused-chunks/chunk-7S7XWMXC.js";import{$ as up,$a as qa,A as Yb,Ab as Pp,B as Rn,Bb as oi,C,Cb as _t,Db as Lp,Eb as se,Fb as Np,G as ft,Ga as bp,Gb as Ne,Hb as wr,Ia as ja,Ib as br,Jb as bi,K as op,Kb as Ut,L as ri,La as kp,M as ip,Ma as Sp,N as sp,Na as nt,O as ap,P as cp,Pb as ki,Q as lp,Qa as Ep,Ra as Ap,S as ee,Sa as A,T as Ma,Ta as Le,U as ne,Ua as Nt,W as $a,Wa as je,X as dp,Xa as hr,Y as Be,Ya as In,Z as et,Za as Tp,_ as mp,_a as On,a as Nb,ab as Cp,b as Mb,ba as pp,c as $b,ca as fp,d as Fb,da as Fa,ec as of,ga as Da,gb as gr,ia as _p,ib as Rp,ic as u_,j as ti,ja as hp,jb as Ip,k as np,ka as gp,l as rp,la as yp,m as Cn,ma as vp,n as ur,o as Db,p as Ub,pb as Mt,q as Gb,qa as Pe,r as jb,ra as Lt,rb as $t,s as qb,t as Kb,ta as Ua,tb as Op,u as zb,ua as pr,ub as R,v as Bb,va as fr,vb as q,w as Hb,wa as Ga,wb as ie,x as ni,xa as tt,xb as xp,y as Vb,ya as wp,z as Wb,za as _r,zb as fe}from"./focused-chunks/chunk-JZSLDLR4.js";import{b as Ct,c as co,d as lo,f as ut,h as zo,i as pt,j as Pt,k as lu,m as F,n as Bo,o as Ze,q as du}from"./focused-chunks/chunk-OCTTDZOU.js";import{e as Qu}from"./focused-chunks/chunk-HFAW3FJQ.js";import{$ as l,$a as Ud,$b as wu,Aa as x,Ab as or,Ad as bb,Ae as Ib,B as Rd,Ba as we,Bc as ka,Bd as kb,Be as Ob,C as Id,Ca as mo,Cc as Sa,Ce as xb,D as Od,Da as bn,Dc as Ea,Dd as Sb,De as Pb,E as xd,Ea as tr,Ec as Aa,Ed as Eb,Ee as Qo,F as Pd,Fa as Md,Fb as Ge,Fc as Ta,Fd as Oa,Fe as Uu,G as Ld,Ga as E,Gc as Ca,Gd as xa,H as oa,Ha as $d,Hb as Y,Hc as Ra,Hd as Pa,I as ia,Ia as lt,Ic as O,Id as Pu,J as sa,Ja as pe,Jb as ir,Jc as En,K as aa,Ka as dt,Kc as Qt,Kd as Lu,L as ca,Lc as J,Ld as Ab,M as la,Ma as Qe,Mc as Wo,Na as uo,Nc as An,Nd as Tb,Ob as Sn,Od as Cb,P as ao,Pd as Rb,Qc as Yo,Rd as S,Sc as Se,Ta as kn,Tc as Jo,U as da,Va as Fd,Vd as Xo,W as Nd,Xa as ua,Xc as dr,Xd as oe,Ya as nr,Z as Tt,Za as Dd,Zb as yu,_b as vu,_d as Ee,aa as d,ac as bu,bb as po,bc as ku,cc as Su,db as Gd,dc as va,eb as jd,ec as Eu,ee as Nu,gb as qd,gc as Au,hb as Kd,hc as Tu,ib as zd,ja as L,jb as Bd,jd as Ou,ka as Yt,kb as Hd,kc as wa,la as Rt,lb as Vd,lc as Cu,le as Mu,ma as Z,mb as Wd,mc as ba,me as $u,na as te,nd as xu,o as oo,p as Cd,pa as wn,pb as Jt,pe as Tn,q as io,qb as mt,r as ra,sd as Ia,tc as Ru,te as Fu,v as Wt,va as ma,w as ct,wa as er,x as yn,xa as ke,xe as Du,y as vn,yb as rr,z as so,zb as pa,zc as Iu,zd as wb}from"./focused-chunks/chunk-Z4PWEIMX.js";import{AsyncLocalStorage as YM}from"node:async_hooks";(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]="176b4ac2-2c47-50d6-beee-62e1d3dc9281")}catch{}})();function b_(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ek(e){return e.brief===!0?"brief":typeof e.fields=="string"&&e.fields.trim().length>0||Array.isArray(e.fields)&&e.fields.length>0?"fields":e.compact===!0?"compact":"full"}function hc(e,t){let n=ek(t),r=n==="brief"?n:b_(e.projection)&&typeof e.projection.mode=="string"?e.projection.mode:n;return{...e,query_summary:{filters:b_(e.filters)?e.filters:{},projection:r}}}(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]="3046466c-614c-5e2b-a156-df96fba8c483")}catch{}})();async function k_(e,t){let n=E(t??process.cwd(),e),r=await A(n);return fe(n,r.item_format,x(r,null).type_to_folder,void 0,r.schema)}(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]="0c84b11c-502f-5c33-a757-5757402357b4")}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]="e8137f8b-745a-5ef5-9e7e-14b7d032c1ea")}catch{}})();var tk=new Map;function gc(){tk.clear()}(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]="b841f903-6276-5067-842f-6a6bff114cec")}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]="0c7a926a-46a2-560c-ae95-33b92b8c820e")}catch{}})();var nk={"list-all":{action:"list",options:{excludeTerminal:!1}},"list-draft":{action:"list",options:{status:"draft",excludeTerminal:!1}},"list-open":{action:"list",options:{status:"open",excludeTerminal:!1}},"list-in-progress":{action:"list",options:{status:"in_progress",excludeTerminal:!1}},"list-blocked":{action:"list",options:{status:"blocked",excludeTerminal:!1}},"list-closed":{action:"list",options:{status:"closed",excludeTerminal:!1}},"list-canceled":{action:"list",options:{status:"canceled",excludeTerminal:!1}}};function S_(e){return Object.fromEntries(Au.map(t=>[`${e}-${t}`,{action:e,options:{[t==="adopt-all"?"adoptAll":t]:!0,...e==="package"?{vocabulary:"package"}:{}}}]))}var E_={ctx:{action:"context"},...nk,...S_("extension"),...S_("package"),...Object.fromEntries(Tu.map(e=>[`package-${e}`,{action:e}]))};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9133d39d-b2fb-5f99-8fd3-87a7d2f8df6d")}catch{}})();var yc="PmCliError";function rk(e){if(!Number.isFinite(e))throw new TypeError("createPmCliExpectedError options.exitCode must be a finite number");let t=Math.trunc(e);if(t<=l.SUCCESS)throw new TypeError("createPmCliExpectedError options.exitCode must be a positive exit code");return t}function A_(e,t={}){if(typeof e!="string"||e.trim().length===0)throw new TypeError("createPmCliExpectedError message must be a non-empty string");let n=new d(e,rk(t.exitCode??l.USAGE),t.context??{});return"cause"in t&&Object.defineProperty(n,"cause",{value:t.cause,enumerable:!1,configurable:!0,writable:!0}),n}function $i(e){if(!(e instanceof Error)||e.name!==yc)return!1;let t=e;return typeof t.exitCode=="number"&&Number.isFinite(t.exitCode)}(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]="3113ad4b-282a-50af-a836-8e9abfde7d7e")}catch{}})();function vc(e){let t=Ud();for(let n of e)t.register(n);return t}function T_(e,t){return{client:t,isItemNotFoundError:n=>$i(n)&&n.exitCode===l.NOT_FOUND,getItemAt:(n,r)=>Mp(n,r,{pmRoot:e}),openRelationshipEventStore:n=>Fp.open({pmRoot:e,nodes:n.nodes,registry:vc(n.definitions),...n.relativePath===void 0?{}:{relativePath:n.relativePath}}),createRelationshipGraph:n=>new jd(n.nodes,n.edges,vc(n.definitions)),analyzeRelationshipImpact:(n,r,o)=>Dp(n,r,o),validateRelationshipEvents:n=>{let r=new $p(n.nodes,{registry:vc(n.definitions)});return n.events.map(o=>r.append({...o,expectedVersion:r.version}))},commitWorkspaceTransaction:n=>Up({...n,pmRoot:e})}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c2766f4e-6354-55bb-9e40-676273ee901f")}catch{}})();async function C_(e,t,n=Nu){try{await n({pmRoot:e,result:t})}catch{if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let r=t,o=Array.isArray(r.warnings)?r.warnings.filter(i=>typeof i=="string"):[];r.warnings=[...new Set([...o,"context_usage_feedback_write_failed"])].sort()}}}import{readFile as ok}from"node:fs/promises";import ik from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c64f304d-9081-5bad-8187-7bf6b65e4a07")}catch{}})();var wc="context-intents.json";function Fi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function sk(e,t,n){if(!Fi(e))throw new TypeError(`${t} context intent at index ${String(n)} must be an object`);let r=e.included_field_groups;if(typeof e.command!="string"||typeof e.intent!="string"||typeof e.description!="string"||!Array.isArray(r)||!r.every(o=>typeof o=="string")||typeof e.token_budget!="number")throw new TypeError(`${t} context intent at index ${String(n)} has an invalid contract shape`);return{command:e.command,intent:e.intent,description:e.description,included_field_groups:r,token_budget:e.token_budget}}function R_(e,t){let n=Array.isArray(e)?e:Fi(e)&&Array.isArray(e.intents)?e.intents:void 0;if(!n)throw new TypeError(`${t} context intents must be an array or an object with an intents array`);return n.map((r,o)=>sk(r,t,o))}async function ak(e){let t=ik.join(e,wc),n;try{n=await ok(t,"utf8")}catch(o){if(Yt(o))return[];throw await Op(e),o}let r;try{r=JSON.parse(n)}catch(o){let i=o instanceof Error?o.message:String(o);throw new TypeError(`Invalid ${wc}: ${i}`,{cause:o})}return R_(r,wc)}function ck(e){if(!Fi(e))return;let t=e.contextIntents??e.context_intents;if(t!==void 0)return t;let n=e.default;return Fi(n)?n.contextIntents??n.context_intents:void 0}function lk(e){return e.flatMap(t=>{let n=ck(t.module);return n===void 0?[]:R_(n,`package ${t.name}`)})}async function dk(e){let t=await ak(e.pmRoot),n=lk(e.packages??[]);return{workspaceContracts:t,packageContracts:n}}async function bc(e,t){let n=await dk(e);return await $u(n,t)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="663579ae-aebb-524c-81c9-9aed44e40f35")}catch{}})();async function I_(e,t,n){if(t.body===void 0)throw new d("Missing required --body text",l.USAGE);let r=Dt(),o=E(process.cwd(),n.path);await R(o);let i=await A(o),s=C(t.author,i.author_default),c=(await r.resolveValue(t.body,"--body",jp(t,"body"))).trim();if(c.length===0)throw new d("--body text cannot be empty; append requires non-blank content and empty appends would only rewrite updated_at.",l.USAGE,{code:"append_empty_body",required:"Provide non-empty body text positionally, via --body, or with - for stdin.",examples:['pm append pm-a1b2 --body "Progress note"',"pm append pm-a1b2 --body -"]});let m=await se({pmRoot:o,settings:i,id:e,op:"append",author:s,message:t.message,force:t.force,mutate(u){let p=u.body.trim().length>0?`
|
|
2
2
|
|
|
3
3
|
`:"";return u.body=`${u.body.trimEnd()}${p}${c}
|
|
4
4
|
`,{changedFields:["body"]}}});return{item:m.item,appended:c,changed_fields:m.changedFields}}import{readFile as mk}from"node:fs/promises";(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]="0a5fc27e-3f5a-59e0-998e-be5da72913dd")}catch{}})();function Ui(e){let t={...e,...e.full===!0?{fullHistory:!0}:{}};return delete t.full,Ae(e,t)}function O_(e,t){if(typeof e=="object"&&e!==null&&"format"in e&&e.format==="json")throw new d(`Structured context events are append-only and cannot be ${t}.`,l.USAGE,{code:"structured_event_immutable"})}function kc(e,t){return t===void 0?e:t===0?[]:e.slice(Math.max(0,e.length-t))}function nn(e,t){let n=e[t];return Array.isArray(n)?n:[]}function jn(e,t={}){let n=e.trim();if(!n)return"";let r=/^(?:[-*+]\s*)?text\s*[:=]/i.exec(n);if(t.stripPlainTextPrefix===!0&&r&&!n.startsWith("```"))return n.slice(r[0].length).trim()||n;if(!(/^(?:[-*+]\s*)?text\s*[:=]/im.test(n)||n.startsWith("```")))return n;try{let i=le(n,"--add");return Object.keys(i).map(c=>c.trim().toLowerCase()).some(c=>c!=="text")?n:i.text?.trim()||n}catch{return n}}function Sc(e){return typeof e=="object"&&e!==null&&"code"in e}function xr(e,t){if(!ht(e))throw new d(`${t} cannot read process stdin through the MCP JSON-RPC transport. Pass annotation text in options.add instead.`,l.USAGE,{code:"mcp_stdin_unavailable",required:"Pass annotation text as JSON data; the MCP protocol already owns process stdin."})}async function uk(e,t){if(+(e.add!==void 0)+ +(e.stdin===!0)+ +(typeof e.file=="string")>1)throw new d(`Specify ${t} text using only one input source: --add, --stdin, or --file`,l.USAGE);let r=Dt(),o=ht(e);if(e.add!==void 0)return{value:await r.resolveValue(e.add,"--add",o)??"",rawValue:e.add,emptyFlag:"--add"};if(e.stdin===!0)return xr(e,"--stdin"),{value:await r.resolveValue("-","--stdin")??"",emptyFlag:"--stdin"};if(typeof e.file!="string")return;let i=e.file.trim();if(!i)throw new d("--file path cannot be empty",l.USAGE);if(i==="-")return xr(e,"--file -"),{value:await r.resolveValue("-","--file")??"",emptyFlag:"--file"};try{return{value:await mk(i,"utf8"),emptyFlag:"--file"}}catch(s){if(Sc(s)&&Yt(s))throw new d(`--file path not found: ${i}. Use --file - to read stdin.`,l.USAGE);let a=s instanceof Error?s.message:String(s);throw new d(`Failed to read --file path "${i}": ${a}. Use --file - to read stdin.`,l.USAGE)}}async function Gi(e,t){if(e.edit!==void 0&&e.delete!==void 0)throw new d("Specify only one of --edit or --delete",l.USAGE);if(e.delete!==void 0){if(e.add!==void 0||e.stdin===!0||typeof e.file=="string")throw new d("--delete cannot be combined with replacement text",l.USAGE);if(!Number.isInteger(e.delete)||e.delete<1)throw new d("--delete must be a positive integer",l.USAGE);return{mode:"delete",index:e.delete}}if(e.edit!==void 0&&(!Number.isInteger(e.edit)||e.edit<1))throw new d("--edit must be a positive integer",l.USAGE);let n=await uk(e,t);if(e.edit!==void 0){if(!n)throw new d("--edit requires replacement text from --add, --stdin, or --file",l.USAGE);return{mode:"edit",index:e.edit,...n}}return n?{mode:"add",...n}:{mode:"list"}}function Or(e,t){throw e instanceof d&&e.exitCode===l.CONFLICT&&e.message.includes("is assigned to")&&e.message.includes("Use --force to override")?new d(e.message,e.exitCode,{code:"ownership_conflict",required:t.required,examples:t.examples,nextSteps:t.nextSteps}):e}function P_(e){return e==="comments"?"--stdin":"--add -"}function pk(e,t){if((t.input.emptyFlag??"--add")!=="--add")return;let r=e.trim();if(!/^-{1,2}[A-Za-z][\w-]*(?:=.*)?$/.test(r))return;let o=P_(t.collectionKey),i=t.input.mode==="edit"?`pm ${t.collectionKey} <id> --edit <index>`:`pm ${t.collectionKey} <id>`;throw new d(`--add value "${r}" looks like an option, not annotation text. Use ${o} to read stdin, or use text=${r} for literal dash-leading text.`,l.USAGE,{code:"annotation_flag_like_value",required:`Use ${o} for stdin input, pass plain text, or use text=${r} when the text really starts with "-".`,examples:[`${i} ${o}`,`${i} --add text=${r}`]})}function fk(e,t){if(t.ifAbsent===!0&&!["add","stdin","file"].includes(e.input.mode))throw new d(`--if-absent requires a ${e.collectionKey.replace(/s$/,"")} append`,l.USAGE,{code:"annotation_if_absent_without_append",required:"Combine --if-absent with one append text source; omit it for list, edit, and delete operations."});if(e.input.mode!=="list"||t.message===void 0)return;let n=e.collectionKey.replace(/s$/,"");throw new d(`--message labels a ${n} mutation but does not provide ${n} text. Pass text positionally or with --add, --stdin, or --file.`,l.USAGE,{code:"annotation_message_without_text",required:`Provide ${n} text through a content source; --message only annotates the history entry of a mutation.`,examples:[`pm ${e.collectionKey} <id> --add "text" --message "why"`,`pm ${e.collectionKey} <id> ${P_(e.collectionKey)}`]})}function _k(e,t,n,r,o,i){let s=nn(e.metadata,t),a=o?s.findIndex(c=>c.author===n&&c.text===r):-1;return a>=0?{changedFields:[],entryIndex:a+1}:(s.push(i({created_at:S(),author:n,text:r})),e.metadata[t]=s,{changedFields:[t],entryIndex:s.length})}async function qn(e,t,n,r){fk(r,t);let o=E(process.cwd(),n.path);await R(o);let i=await A(o),s=x(i,O()),a=vr(t.limit);if(r.input.mode==="list"){let h=await q(o,e,i.id_prefix,i.item_format,s.type_to_folder);if(!h)throw new d(`Item ${e} not found`,l.NOT_FOUND);let y=await ie(h,{schema:i.schema}),g=nn(y.document.metadata,r.collectionKey);return Di(h.id,r.collectionKey,g,a,t.includeMeta===!0)}let c=C(t.author,i.author_default);if(r.input.mode==="delete"){let h=r.deleteOp??r.op,y;try{y=await se({pmRoot:o,settings:i,id:e,op:h,author:c,message:t.message,force:t.force,bypassAssigneeConflict:r.bypassOwnershipConflict,mutate(v){let b=nn(v.metadata,r.collectionKey),k=x_(r.input.index,b.length,r.collectionKey);return O_(b[k],"deleted"),b.splice(k,1),v.metadata[r.collectionKey]=b,{changedFields:[r.collectionKey]}}})}catch(v){Or(v,r.conflictGuidance)}let g=nn(y.item,r.collectionKey);return Di(y.item.id,r.collectionKey,g,a,t.includeMeta===!0,{action:"delete",entryIndex:r.input.index},t.fullHistory===!0)}let m=r.input.rawValue??r.input.value??"";pk(m,r);let u=r.parseText(r.input.value??"");if(!u.trim())throw new d(`${r.input.emptyFlag??"--add"} text cannot be empty`,l.USAGE);if(r.input.mode==="edit"){let h=r.editOp??r.op,y;try{y=await se({pmRoot:o,settings:i,id:e,op:h,author:c,message:t.message,force:t.force,bypassAssigneeConflict:r.bypassOwnershipConflict,mutate(v){let b=nn(v.metadata,r.collectionKey),k=x_(r.input.index,b.length,r.collectionKey),T=b[k];return O_(T,"edited"),b[k]={...T,text:u,edited_at:S()},v.metadata[r.collectionKey]=b,{changedFields:[r.collectionKey]}}})}catch(v){Or(v,r.conflictGuidance)}let g=nn(y.item,r.collectionKey);return Di(y.item.id,r.collectionKey,g,a,t.includeMeta===!0,{action:"edit",entryIndex:r.input.index,entry:g[r.input.index-1]},t.fullHistory===!0)}let p,f=0;try{p=await se({pmRoot:o,settings:i,id:e,op:r.op,author:c,message:t.message,force:t.force,bypassAssigneeConflict:r.bypassOwnershipConflict,skipNoop:t.ifAbsent===!0,mutate(h){let y=_k(h,r.collectionKey,c,u,t.ifAbsent===!0,r.createEntry);return f=y.entryIndex,{changedFields:y.changedFields}}})}catch(h){Or(h,r.conflictGuidance)}let _=nn(p.item,r.collectionKey);return Di(p.item.id,r.collectionKey,_,a,t.includeMeta===!0,{action:"add",entryIndex:f,entry:_[f-1],changedCount:t.ifAbsent===!0?Math.min(p.changedFields.length,1):void 0},t.fullHistory===!0)}function x_(e,t,n){if(e===void 0||!Number.isInteger(e)||e<1||e>t){let r=n.replace(/s$/,""),o=`${r.charAt(0).toUpperCase()}${r.slice(1)}`,i=t===1?`1 ${r}`:`${t} ${n}`;throw new d(`${o} index ${e??"(missing)"} out of range (item has ${i})`,l.USAGE)}return e-1}function hk(e,t,n){return t===void 0?{}:{mutation_receipt:{action:t.action,entry_index:t.entryIndex,changed_count:t.changedCount??1,full_history_included:!n},omission_receipt:{has_omissions:n,omitted_field_group_count:n?1:0,omitted_field_groups:n?[{name:`${e}_history`,restore_with:{selector:"full_history",cli_flag:"--full-history",sdk_option:"fullHistory",mcp_option:"full"}}]:[]}}}function Di(e,t,n,r,o,i,s=!1){let a=i===void 0||s?kc(n,i!==void 0&&s?void 0:r):i.entry===void 0?[]:[i.entry],c=i!==void 0&&a.length<n.length;return{id:e,[t]:a,count:a.length,...i?.changedCount===void 0?{}:{changed:i.changedCount===1},...[o,i!==void 0].includes(!0)?{total_count:n.length,returned_count:a.length,has_more:c||a.length<n.length,...r!==void 0?{limit:r}:{}}:{},...hk(t,i,c)}}(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]="f366dd76-73b4-55c4-8c63-2913d0a0c380")}catch{}})();async function L_(e,t,n){return[...await Promise.resolve().then(()=>up(Qe(e,t),t)).catch(()=>[])].reverse().find(i=>i.patch.some(s=>s.path==="/metadata/assignee"))?.op==="claim"?`claimed by ${n}`:`assigned to ${n}`}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f2901314-4044-5a91-ad72-6b4bebde16c2")}catch{}})();var N_="no_available_next_item";function M_(e){if(!(e instanceof Error)||e.name!=="PmCliError")return!1;let t=e.context;return typeof t=="object"&&t!==null&&"code"in t&&t.code==="already_claimed_by"}async function Pr(e,t,n,r={}){let o=E(process.cwd(),n.path);await R(o);let i=await A(o),s=F(i.schema),a=C(r.author,i.author_default),c=Rn(a),m=null,u=!1,p=[],f=await se({pmRoot:o,settings:i,id:e,op:"claim",author:a,message:r.message,force:t,skipNoop:!0,async mutate(_){let y=_.metadata.assignee??"",g=_.metadata.claim_principal?.trim()||y;if(m=y.trim().length>0?y:null,du(_.metadata.status,s)&&!t)throw new d(`Cannot claim terminal item ${_.metadata.id} without --force`,l.CONFLICT);if(m!==null&&g!==c){if(r.ifAvailable===!0)return u=!0,p.push(`claim_skipped_held_by:${m}`),{changedFields:[]};if(!t){let T=await L_(o,_.metadata.id,y);throw new d(`Item ${_.metadata.id} is already ${T}. Use --force to take over, or --if-available to skip without failing.`,l.CONFLICT,{code:"already_claimed_by",why:"Claim is an atomic test-and-set so parallel agents never proceed believing they own the same item.",nextSteps:["Run pm next to pick a different unclaimed item.","Re-run with --if-available to treat a held item as a no-op skip.","Re-run with --force only when taking over the item is coordinated."]})}p.push(`claim_takeover:${m}->${a}`)}let b={assignee:a,claim_principal:c},k=["assignee","claim_principal"].filter(T=>_.metadata[T]!==b[T]);return Object.assign(_.metadata,b),{changedFields:k,warnings:p}}});return u||await mc({pmRoot:o,settings:i,principal:c,itemId:f.item.id}),{item:f.item,changed_fields:f.changedFields,claimed_by:u&&m!==null?m:a,previous_assignee:m,forced:t,...u?{skipped:!0}:{},...p.length>0?{warnings:p}:{}}}async function $_(e,t,n={},r={}){let o=gk(n.maxAttempts),i=await A(E(process.cwd(),t.path)),s={...n,author:C(n.author,i.author_default)},a=await Cr({...r,callerAuthor:s.author,limit:String(o)},t),c=[a.recommended,...a.ready].filter(m=>m!==null).map(m=>({...m,reasons:"reasons"in m?m.reasons:["ranked ready candidate"]}));return yk(c.slice(0,o),e,t,s)}function gk(e){if(e===void 0)return 10;let t=Number(e);if(!Number.isSafeInteger(t)||t<1||t>100)throw new d("--max-attempts must be an integer from 1 to 100",l.USAGE);return t}async function yk(e,t,n,r={},o=Pr){let i=0;for(let a of e){i+=1;try{let c=await o(a.id,t,n,r),m={...c,recommendation:a,attempts:i,available:!0};if(!c.skipped)return m}catch(c){if(!M_(c))throw c}}if(r.ifAvailable===!0)return{available:!1,item:null,claimed_by:C(r.author,""),previous_assignee:null,forced:t,skipped:!0,recommendation:null,attempts:i,warnings:[N_]};let s=i===0;throw new d(s?"No actionable items matched the selection filters":"No actionable item remained available to claim",s?l.NOT_FOUND:l.CONFLICT,{code:N_,why:s?"No ready items matched the specified filters or selection criteria.":"Every ranked candidate was claimed by another agent before this atomic selection completed.",nextSteps:[s?"Verify the filters or run pm next to inspect all ready work.":"Run pm claim --next again to refresh the ranked candidate set."]})}async function Lr(e,t,n,r={}){let o=E(process.cwd(),n.path);await R(o);let i=await A(o),s=C(r.author,i.author_default),a=Rn(s),c=r.ownershipReleaseBypass===!0,m=null,u;try{u=await se({pmRoot:o,settings:i,id:e,op:"release",author:s,message:r.message,force:t,bypassAssigneeConflict:c,mutate(_){return m=_.metadata.assignee??null,!m&&!_.metadata.claim_principal?{changedFields:[]}:(delete _.metadata.assignee,delete _.metadata.claim_principal,{changedFields:["assignee","claim_principal"]})}})}catch(_){Or(_,{required:"For approved non-owner handoffs, prefer the ownership-release bypass before considering --force.",examples:['pm release pm-a1b2 --author "reviewer" --force'],nextSteps:["Use the package-provided ownership-release bypass for handoffs that only clear assignee metadata.","Use --force only when an explicit override is approved for broader ownership conflicts."]})}await uc({pmRoot:o,principal:a,itemId:u.item.id});let p=F(i.schema),f=Ma(u.item.status,p)===Ma(p.in_progress_status,p);return{item:u.item,released_by:s,changed_fields:u.changedFields,previous_assignee:m,forced:t,...f?{warnings:["released_unclaimed_in_progress"],suggestions:[`${u.item.id} remains ${u.item.status} and unclaimed. If work is paused, run pm release ${u.item.id} --pause to move it to ${p.open_status}.`]}:{}}}(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]="e63a8049-309b-57f2-ba48-cd0a550c11ab")}catch{}})();var vk=Object.freeze({requireCloseReason:!0,orderingEdges:"preserve"});function F_(e){let t=[{source:"explicit",value:e.explicit},{source:"duplicate",value:e.duplicateOf===void 0?void 0:`Duplicate of ${e.duplicateOf}`},{source:"resolution",value:e.resolution},{source:"message",value:e.message}];for(let n of t){let r=n.value?.trim();if(r)return{closeReason:r,source:n.source}}return{source:"none"}}function Ec(e,t){return Ac(e,t,{operation:"close"})}function Ac(e,t,n){let r=F_(e);if(!t||r.closeReason!==void 0)return r;let o=n.operation==="create"?[`pm create --title "<title>" --type <type> --status ${n.status??"closed"} --close-reason "<closing summary>"`,`pm create --title "<title>" --type <type> --status ${n.status??"closed"} --resolution "<resolution summary>"`,"pm create --stdin-json < item.json"]:['pm close <id> "Done: <what changed and why>"','pm close <id> --reason "<closing summary>"','pm close <id> -m "<closing summary>"',"pm close <id> --duplicate-of <canonical-id>"];throw new d("Close reason text is required because governance.require_close_reason is enabled",l.USAGE,{code:"close_reason_required",required:"Provide an author-controlled closing summary as the reason, message, resolution, or duplicate target.",why:"governance.require_close_reason is enabled, so tools must not invent immutable closure evidence.",examples:o,nextSteps:[`Re-run the ${n.operation} operation with a closing summary.`,"To stop requiring reasons, run: pm config set governance-require-close-reason --policy disabled"]})}function Tc(e,t){let n=typeof e.blocked_by=="string"?e.blocked_by.trim():"",r=e.blocked_by!==void 0,o=e.dependencies??[],i=o.filter(m=>m.kind==="blocked_by"),s=e.blocked_reason!==void 0,a=[];if(r&&(delete e.blocked_by,a.push("blocked_by")),s&&(delete e.blocked_reason,a.push("blocked_reason")),t.orderingEdges==="remove"&&i.length>0){let m=o.filter(u=>u.kind!=="blocked_by");m.length>0?e.dependencies=m:delete e.dependencies,a.push("dependencies")}let c=[...new Set([...n?[n]:[],...i.map(m=>m.id)])];return c.length===0?{changedFields:a,warnings:[]}:{changedFields:a,warnings:[t.orderingEdges==="preserve"?`closed_preserved_predecessors:${e.id}:${c.join(",")}`:`closed_removed_predecessors:${e.id}:${c.join(",")}`]}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="49e375b7-49a8-5b6f-89c8-be70d334b78f")}catch{}})();var wk=[{key:"resolution",label:"resolution (--resolution)"},{key:"expected_result",label:"expected_result (--expected-result)"},{key:"actual_result",label:"actual_result (--actual-result)"}];function bk(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(t.length===0||t==="warn")return"warn";if(t==="off"||t==="none"||t==="disabled")return"off";if(t==="strict")return"strict";throw new d(`Invalid --validate-close mode "${e}" (expected "off", "warn", or "strict")`,l.USAGE)}function D_(e){let t=[];for(let n of wk){let r=e[n.key];(typeof r!="string"||r.trim().length===0)&&t.push(n)}return t}function U_(e,t,n={}){let r=D_(e);if(r.length===0)return;let o={resolution:n.resolution,expected_result:n.expectedResult,actual_result:n.actualResult},i=r.map(a=>`--${a.key.replaceAll("_","-")}`),s=["--pm-path",t,"update",e.id,...r.flatMap((a,c)=>[i[c],o[a.key]?.trim()||"<value>"])];return{missing:i,suggested_retry:dr(s),suggested_retry_args:s}}async function kk(e,t,n){let r=new Set,o=t;for(;typeof o=="string"&&o.trim().length>0;){let i=o.trim();if(i===n)return!0;if(r.has(i))return!1;r.add(i),o=(await e(i))?.duplicate_of}return!1}function Sk(e){return typeof e!="string"||e.trim().length===0}async function Ek(e,t,n,r){let o=n?.trim();if(!o)return;if(o===r)throw new d("An item cannot be closed as a duplicate of itself.",l.USAGE,{code:"duplicate_target_self",why:"--duplicate-of must identify the canonical item that should remain open or already represent the work."});let i=x(t,O()),s=new Map,a=async m=>{if(s.has(m))return s.get(m)??null;let u=await q(e,m,t.id_prefix,t.item_format,i.type_to_folder);if(!u)return s.set(m,null),null;let{document:p}=await ie(u,{schema:t.schema});return s.set(m,p.metadata),p.metadata},c=await a(o);if(!c)throw new d(`Duplicate target "${o}" was not found. Create or locate the canonical item first.`,l.USAGE,{code:"duplicate_target_missing",why:"Duplicate closure should point at a real canonical pm item so future dedupe and changelog tooling can trace the relationship.",examples:[`pm close ${r} "Duplicate of ${o}" --duplicate-of ${o}`],nextSteps:["Run pm search/list to find the canonical item, then retry with --duplicate-of <id>."]});if(await kk(a,c.duplicate_of,r))throw new d(`Circular duplicate reference detected. Target "${o}" points back to "${r}".`,l.USAGE,{code:"duplicate_target_circular",why:"Circular duplicate relationships create loops for dedupe and status propagation tooling.",nextSteps:["Choose the existing canonical item, or clear the target duplicate_of metadata before closing this item as a duplicate."]});if(typeof c.duplicate_of=="string"&&c.duplicate_of.trim().length>0)throw new d(`Duplicate target "${o}" is already marked as a duplicate of "${c.duplicate_of.trim()}".`,l.USAGE,{code:"duplicate_target_is_duplicate",why:"Duplicate closure should point directly at the canonical item, not another duplicate.",examples:[`pm close ${r} "Duplicate of ${c.duplicate_of.trim()}" --duplicate-of ${c.duplicate_of.trim()}`],nextSteps:["Use the canonical item referenced by duplicate_of as the --duplicate-of target."]});return c.id}function Ak(e,t,n){return e.filter(r=>r.parent===t&&!ne(r.status,n)).map(r=>r.id).sort((r,o)=>r.localeCompare(o))}function Tk(e,t,n){let r=new Map(e.map(a=>[a.id.trim().toLowerCase(),a])),o=u_(e),i=t.trim().toLowerCase(),s=n.blocked_statuses;return e.filter(a=>s.has(a.status)).map(a=>({item:a,blockerIds:o.get(a.id.trim().toLowerCase())})).filter(({blockerIds:a})=>a.includes(i)).filter(({blockerIds:a})=>a.every(c=>{if(c===i)return!0;let m=r.get(c);return m!==void 0&&ne(m.status,n)})).map(({item:a,blockerIds:c})=>({id:a.id,blocker_ids:c})).sort((a,c)=>a.id.localeCompare(c.id))}async function Ck(e,t,n,r,o,i){let s=Tk(n,r,i),a=[];for(let c of s)try{let m=await se({pmRoot:e,settings:t,id:c.id,op:"update",author:o,message:`Auto-unblocked after blocker ${r} closed`,mutate(u){let p=u.metadata.dependencies??[],f=p.filter(h=>{let y=h.id.trim().toLowerCase();return h.kind!=="blocked_by"||!c.blocker_ids.includes(y)});u.metadata.status=i.open_status,delete u.metadata.blocked_by,delete u.metadata.blocked_reason,u.metadata.unblock_note=`Auto-unblocked after blocker ${r} closed; all blockers resolved (${c.blocker_ids.join(", ")}).`,f.length>0?u.metadata.dependencies=f:delete u.metadata.dependencies;let _=["status","blocked_by","blocked_reason","unblock_note"];return f.length!==p.length&&_.push("dependencies"),{changedFields:_}}});a.push(`auto_unblocked:${m.item.id}:resolved_blockers=${c.blocker_ids.join(",")}`)}catch(m){let u=m instanceof Error?m.message.replace(/\s+/g," ").trim():"unknown";a.push(`auto_unblock_failed:${c.id}:${u}`)}return a}function Rk(e,t){let n=[],r=[{option:t.resolution,key:"resolution"},{option:t.expectedResult,key:"expected_result"},{option:t.actualResult,key:"actual_result"}];for(let{option:o,key:i}of r){if(typeof o!="string")continue;let s=o.trim();s.length!==0&&(e[i]=s,n.push(i))}return n}function Ik(e,t){if(t===void 0)return[];e.duplicate_of=t;let n=[],r=[{key:"resolution",value:`Duplicate of ${t}`},{key:"expected_result",value:`Canonical item ${t} tracks the work.`},{key:"actual_result",value:`Closed as duplicate of ${t}.`}];for(let{key:o,value:i}of r)Sk(e[o])&&(e[o]=i,n.push(o));return n}function Ok(e,t,n,r){let o=[];if(t!=="off"){let i=D_(e);if(i.length>0){let s=i.map(a=>a.label);if(t==="strict"){let a=i.map(m=>`--${m.key.replaceAll("_","-")}`),c=["--pm-path",r,"update",e.id,...a.flatMap(m=>[m,"<value>"])];throw new d(`Cannot close item ${e.id}: missing ${s.join(", ")}. Populate fields or use --validate-close warn.`,l.USAGE,{code:"close_validation_missing_fields",recovery:{missing:a,suggested_retry:dr(c)},nextSteps:["Run the suggested pm update, then retry the original pm close invocation.","Use --validate-close warn only when governance permits an evidenced exception."]})}o.push(`close_validation_missing_fields:${e.id}:${s.join(",")}`)}if(n.length>0){if(t==="strict")throw new d(`Cannot close item ${e.id}: active child items remain open (${n.join(", ")}). Close, cancel, or re-parent them first, or use --validate-close warn.`,l.USAGE);o.push(`close_validation_active_children:${e.id}:${n.join(",")}`)}return o}return n.length>0&&o.push(`closed_with_active_children:${e.id}:${n.join(",")}`),o}function xk(e,t){return t!==void 0?(e.close_reason=t,["close_reason"]):[]}function Pk(e){return e.assignee===void 0?[]:(delete e.assignee,["assignee"])}function Lk(e,t){if(ne(e.status,t.statusRegistry)&&!t.force)throw new d(`Item ${e.id} is already terminal; use pm update to append acceptance evidence, or --force only for an intentional repeat closure.`,l.CONFLICT,{recovery:U_(e,t.pmRoot,t.options)});let n=Rk(e,t.options),r=Ik(e,t.duplicateOf),o=Ok(e,t.validateCloseMode,t.activeChildIds,t.pmRoot);e.status=t.statusRegistry.close_status,e.closed_at=t.closedAt;let i=t.options.completedAt!==void 0||e.completed_at===void 0;i&&(e.completed_at=t.completedAt);let s=["status","closed_at",...i?["completed_at"]:[],...xk(e,t.closeReason),...n];if(Vp(e)&&(e.plan_mode="completed",s.push("plan_mode")),t.duplicateOf!==void 0){s.push("duplicate_of");for(let c of r)s.includes(c)||s.push(c)}s.push(...Pk(e));let a=Tc(e,t.lifecyclePolicy);return s.push(...a.changedFields),o.push(...a.warnings),{changedFields:s,...o.length>0?{warnings:o}:{}}}async function G_(e,t,n,r){let o=E(process.cwd(),r.path);await R(o);let i=await A(o),s=F(i.schema),a=C(n.author,i.author_default),c=x(i,O()).type_to_folder,m=await q(o,e,i.id_prefix,i.item_format,c);if(!m)throw await _t(o,e,i.id_prefix,c);let u=await Ek(o,i,n.duplicateOf,m.id),p={requireCloseReason:n.lifecyclePolicy?.requireCloseReason??i.governance.require_close_reason,orderingEdges:n.lifecyclePolicy?.orderingEdges??"preserve"},f=Ec({explicit:t,duplicateOf:u,resolution:n.resolution,message:n.message},p.requireCloseReason).closeReason,_=bk(n.validateClose)??i.governance.close_validation_default,h=await fe(o,i.item_format,c,void 0,i.schema),y=Ak(h,m.id,s),g=S(),v=n.completedAt===void 0?g:oe(n.completedAt,new Date(g),"completed-at"),b=await se({pmRoot:o,settings:i,id:m.id,op:"close",author:a,message:n.message,force:n.force,mutate(T){return Lk(T.metadata,{pmRoot:o,statusRegistry:s,force:n.force,options:n,duplicateOf:u,validateCloseMode:_,activeChildIds:y,closeReason:f,closedAt:g,completedAt:v,lifecyclePolicy:p})}}),k=_==="warn"?U_(b.item,o):void 0;return{item:b.item,changed_fields:b.changedFields,...k?{recovery:k}:{},warnings:[...b.warnings,...await Ck(o,i,h,m.id,a,s)]}}function yt(e,t,n,r){return G_(e,t,n,r)}(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]="c45ead8e-c9ed-5b59-84e5-b8e077e84010")}catch{}})();function ji(e){let t=e.trim();return t.toLowerCase()==="med"?"medium":t}function qi(e){let t=e.trim();return t.toLowerCase()==="med"?"medium":t}function Ki(e){let t=e.trim().toLowerCase();if(t==="med")return"medium";if(so.includes(t))return t;let n=_e(e,"confidence");if(!Number.isInteger(n)||n<0||n>100)throw new d("Confidence must be an integer 0..100 or one of low|med|medium|high",l.USAGE);return n}function zi(e){let t=e.trim().toLowerCase();if(t==="true"||t==="1")return!0;if(t==="false"||t==="0")return!1;throw new d("Regression must be one of true|false|1|0",l.USAGE)}(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]="add1928e-08d1-5ead-9a4e-0f1a9b6580fc")}catch{}})();var Nk=new Set(["none","null"]);function Bi(e={}){return[{optionKey:"dep",clearFlagKey:"clearDeps",valueFlag:"--dep",clearFlag:"--clear-deps",...e.depDisableFlagKey===void 0?{}:{disableFlagKey:e.depDisableFlagKey}},{optionKey:"comment",clearFlagKey:"clearComments",valueFlag:"--comment",clearFlag:"--clear-comments"},{optionKey:"note",clearFlagKey:"clearNotes",valueFlag:"--note",clearFlag:"--clear-notes"},{optionKey:"learning",clearFlagKey:"clearLearnings",valueFlag:"--learning",clearFlag:"--clear-learnings"},{optionKey:"file",clearFlagKey:"clearFiles",valueFlag:"--file",clearFlag:"--clear-files",...e.fileDisableFlagKey===void 0?{}:{disableFlagKey:e.fileDisableFlagKey}},{optionKey:"test",clearFlagKey:"clearTests",valueFlag:"--test",clearFlag:"--clear-tests",...e.testDisableFlagKey===void 0?{}:{disableFlagKey:e.testDisableFlagKey}},{optionKey:"doc",clearFlagKey:"clearDocs",valueFlag:"--doc",clearFlag:"--clear-docs",...e.docDisableFlagKey===void 0?{}:{disableFlagKey:e.docDisableFlagKey}},{optionKey:"reminder",clearFlagKey:"clearReminders",valueFlag:"--reminder",clearFlag:"--clear-reminders"},{optionKey:"event",clearFlagKey:"clearEvents",valueFlag:"--event",clearFlag:"--clear-events"},{optionKey:"typeOption",clearFlagKey:"clearTypeOptions",valueFlag:"--type-option",clearFlag:"--clear-type-options"}]}function Ve(e){return e===void 0?!1:Nk.has(e.trim().toLowerCase())}function Hi(e,t,n){if(!Ve(e))return;let r=n?` ${n}`:"";throw new d(`${t} no longer accepts "none" or "null".${r}`.trim(),l.USAGE)}function Ce(e,t,n){if(!e||e.length===0||!e.some(i=>Ve(i)))return;let o=n?` ${n}`:"";throw new d(`${t} no longer accepts "none" or "null".${o}`.trim(),l.USAGE)}function Vi(e,t){for(let n of t){let r=e[n.optionKey];if(!Array.isArray(r)||r.length===0)continue;if(!r.every(a=>typeof a=="string"))throw new d(`${n.valueFlag} entries must be strings.`,l.USAGE);let o=r;if(!o.some(a=>Ve(a)))continue;if(o.filter(a=>!Ve(a)).length>0)throw new d(`Cannot mix legacy clear token "none"/"null" with concrete ${n.valueFlag} entries. Use ${n.clearFlag} to clear or provide explicit entries.`,l.USAGE);e[n.optionKey]=void 0,e[n.clearFlagKey]=!0,n.disableFlagKey&&(e[n.disableFlagKey]=!1)}return e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="49f970c3-e408-52d5-bb4d-8cea0c7f8ef4")}catch{}})();function q_(e,t){let n=e.trim().toLowerCase();if(n==="true"||n==="1"||n==="yes")return!0;if(n==="false"||n==="0"||n==="no")return!1;throw new d(`${t} must be one of true|false|1|0|yes|no`,l.USAGE)}function Cc(e){return e?e.split("|").map(t=>t.trim()).filter(t=>t.length>0):[]}function Re(e,t,n,r=n){if(!t.includes(e))throw new d(`Invalid ${n} value "${e}". Allowed: ${t.join(", ")}`,l.USAGE,{field:r,required:`${n} must be one of: ${t.join(", ")}.`,nextSteps:[`Choose an allowed ${n} and retry the mutation.`]});return e}var K_=["recur_freq","recur_interval","recur_count","recur_until","recur_by_weekday","recur_by_month_day","recur_exdates"];function Mk(e,t){return t==="defined"?e!==void 0:!!e}function j_(e,t,n){if(!Mk(e,n))return;let r=_e(e,`event ${t}`);if(!Number.isInteger(r)||r<1)throw new d(`--event ${t} must be an integer >= 1`,l.USAGE);return r}function $k(e,t,n){let r=e?oe(e,n,"event.recur_until"):void 0;if(r&&r<t)throw new d("--event recur_until must be at or after start",l.USAGE);return r}function Fk(e){return Array.from(new Set(Cc(e).map(t=>Re(t.toLowerCase(),Ld,"event weekday")))).sort((t,n)=>oa(t)-oa(n))}function Dk(e){return Array.from(new Set(Cc(e).map(t=>{let n=_e(t,"event recur_by_month_day");if(!Number.isInteger(n)||n<1||n>31)throw new d("--event recur_by_month_day values must be integers 1..31",l.USAGE);return n}))).sort((t,n)=>t-n)}function Uk(e,t){return Array.from(new Set(Cc(e).map(n=>oe(n,t,"event.recur_exdates")))).sort((n,r)=>n.localeCompare(r))}function z_(e,t,n,r){let o=e.recur_freq?.trim(),i=e.recur_interval?.trim(),s=e.recur_count?.trim(),a=e.recur_until?.trim(),c=e.recur_by_weekday?.trim(),m=e.recur_by_month_day?.trim(),u=e.recur_exdates?.trim();if(![o,i,s,a,c,m,u].some(k=>k!==void 0))return;if(!o)throw new d("--event recurrence fields require recur_freq=<daily|weekly|monthly|yearly>",l.USAGE);let f=Re(o.toLowerCase(),Pd,"event recurrence frequency"),_=j_(i,"recur_interval",r),h=j_(s,"recur_count",r),y=$k(a,t,n),g=Fk(c),v=Dk(m),b=Uk(u,n);return{freq:f,interval:_,count:h,until:y,by_weekday:g.length>0?g:void 0,by_month_day:v.length>0?v:void 0,exdates:b.length>0?b:void 0}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ae7fdf9b-e2d5-511e-90db-cf0bc121628d")}catch{}})();var B_="--event end must be strictly after start. Equal start/end timestamps are treated as an instant event (end is dropped); an end earlier than start is rejected. Omit end for an instant event or set end later than start.",Gk="--event end and duration are mutually exclusive; provide only one (use duration=<relative> like duration=2h, duration=30min, or duration=PT30M, or set an explicit end).",jk=/^([+-]?)(\d+)(min|mins|minute|minutes)$/i,qk=/^([+-]?)[Pp][Tt](?:(\d+)[Hh])?(?:(\d+)[Mm])?(?:(\d+)[Ss])?$/,V_=1e3,Rc=60*V_,Kk=60*Rc;function H_(e,t){let n=new Date(e);if(!Number.isFinite(n.getTime()))throw new d(`Invalid event.duration value "${t}". Duration is out of supported timestamp range.`,l.USAGE);return n.toISOString()}function zk(e,t){let n=new Date(e),r=t.trim(),o=jk.exec(r);if(o){let a=o[1]==="-"?-1:1,c=Number.parseInt(o[2],10)*a;return H_(n.getTime()+c*Rc,r)}let i=qk.exec(r);if(i){let[,a,c,m,u]=i;if(c||m||u){let f=a==="-"?-1:1,_=Number.parseInt(c??"0",10),h=Number.parseInt(m??"0",10),y=Number.parseInt(u??"0",10),g=_*Kk+h*Rc+y*V_;return H_(n.getTime()+f*g,r)}}let s=r.startsWith("+")||r.startsWith("-")?r:`+${r}`;return oe(s,n,"event.duration")}function W_(e,t,n,r){if(t&&n)throw new d(Gk,l.USAGE);if(n){let i=zk(e,n);if(i<e)throw new d(B_,l.USAGE);return i===e?void 0:i}if(!t)return;let o=oe(t,r,"event.end");if(o<e)throw new d(B_,l.USAGE);if(o!==e)return o}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="dfce9924-8453-5ded-a5df-47477caa9fe7")}catch{}})();var Bk=["at","date","text","title"],Hk=["start","date","end","duration","title","description","location","timezone","all_day",...K_],Vk=["key","value"];function Y_(e,t){return t==="trimmed"?e?.trim():e}function Wk(e,t){return t==="defined"?e!==void 0:!!e}function Wi(e,t,n){return e.map(r=>{let o=le(r,"--reminder");He(o,"--reminder",Bk);let i=Y_(o.at??o.date,n.valueMode),s=Y_(o.text??o.title,n.valueMode);if(!i||!s)throw new d("--reminder requires at=<iso|relative> or date=<iso|relative>, plus text=<value> or title=<value>",l.USAGE);let a=s.trim();if(!a)throw new d("--reminder text must not be empty",l.USAGE);return{at:oe(i,t,"reminder.at"),text:a}})}function Yi(e,t,n){return e.map(r=>{let o=le(r,"--event");He(o,"--event",Hk);let i=(o.start??o.date)?.trim();if(!i)throw new d("--event requires start=<iso|relative> or date=<iso|relative>",l.USAGE);let s=oe(i,t,"event.start"),a=o.end?.trim(),c=o.duration?.trim(),m=W_(s,a,c,t),u=o.title,p=o.description,f=o.location,_=o.timezone,h=u?.trim(),y=p?.trim(),g=f?.trim(),v=_?.trim(),b=[["title",u,h],["description",p,y],["location",f,g],["timezone",_,v]];for(let[M,$,K]of b)if($!==void 0&&!K)throw new d(`--event ${M} must not be empty`,l.USAGE);let k=o.all_day?.trim(),T=z_(o,s,t,n.recurrenceEmptyNumericGuard),I=Wk(k,n.allDayEmptyGuard)?q_(k,"--event all_day"):void 0;return{start_at:s,end_at:m,title:h,description:y,location:g,all_day:I,timezone:v,recurrence:T}})}function Ji(e){let t={};for(let n of e){let r=n.trim();if(r.length===0)throw new d("--type-option values must not be empty",l.USAGE);let o,i;if(r.includes(",")||r.includes(`
|
|
@@ -18,7 +18,7 @@ import{n as au,o as Ko,p as uu,q as pu,r as ga,s as Ho,t as fu,u as ya,v as Vo,y
|
|
|
18
18
|
Agent guidance check
|
|
19
19
|
`),ws.write(`No AGENTS.md/CLAUDE.md file currently contains compact pm workflow guidance.
|
|
20
20
|
`);let n=await t.question(`Add a compact pm workflow section to ${e}? [Y/n] `);return ws.write(`
|
|
21
|
-
`),lI(n,!0)}finally{t.close()}}function Cg(e){let t=e.agent_guidance;return{prompt_completed:t?.prompt_completed===!0,declined:t?.declined===!0,declined_at:typeof t?.declined_at=="string"?t.declined_at:"",template_version:typeof t?.template_version=="number"&&Number.isInteger(t.template_version)&&t.template_version>0?t.template_version:El,last_checked_files:Array.isArray(t?.last_checked_files)?[...new Set(t.last_checked_files.map(n=>n.trim()).filter(n=>n.length>0))].sort((n,r)=>n.localeCompare(r)):[]}}async function Rg(e){let t=[];for(let n of YR){let r=me.join(e,n),o=await L(r);if(!o){t.push({file_path:r,exists:o,has_guidance:!1,has_marker:!1});continue}let i=await Sl.readFile(r,"utf8"),s=i.toLowerCase(),a=JR.filter(m=>s.includes(m)),c=nI(i);t.push({file_path:r,exists:o,has_guidance:c||a.length>=XR,has_marker:c})}return t}function jr(e,t){e.includes(t)||e.push(t)}function mI(e,t){let n=Cg(e),r=JSON.stringify(n)!==JSON.stringify(t);return r&&(e.agent_guidance=t),{changed:r,state:t}}async function uI(e,t=me.dirname(e)){let r=await L(e)?await Sl.readFile(e,"utf8"):"",o=oI(r,await iI(t));return o.changed?(await te(e,o.next_content),{changed:!0,warnings:await J({path:e,scope:"project",op:"init:agent_guidance_file"})}):{changed:!1,warnings:[]}}function pI(e){return{mode:e.mode,present:e.scans.some(t=>t.has_guidance),prompted:e.prompted,applied:e.applied,skipped:e.skipped,declined:e.state.declined,prompt_completed:e.state.prompt_completed,template_version:e.state.template_version,target_file:e.targetRelativePath,checked_files:e.scans.map(t=>Dr(e.projectRoot,t.file_path)),files_with_guidance:e.scans.filter(t=>t.has_guidance).map(t=>Dr(e.projectRoot,t.file_path)),missing_files:e.scans.filter(t=>!t.exists).map(t=>Dr(e.projectRoot,t.file_path))}}async function fI(e,t,n){return e?await Rg(n):t}function Ur(e,t,n){e.state={...e.state,...n,template_version:El,last_checked_files:t}}async function Ig(e,t){if(t.presentBefore)return;let n=await uI(t.targetPath,t.projectRoot);e.warnings.push(...n.warnings),n.changed&&(e.applied=!0,e.warnings.push(`agent_guidance:added:${t.targetRelativePath}`))}function _I(e,t){t||(e.warnings.push("agent_guidance:missing"),jr(e.nextSteps,Gr))}function hI(e,t){e.skipped=!0,Ur(e,t,{prompt_completed:!0,declined:!0,declined_at:e.state.declined_at||new Date().toISOString()}),e.warnings.push("agent_guidance:explicit_skip"),jr(e.nextSteps,Gr)}async function gI(e,t){await Ig(e,t),Ur(e,t.checkedFiles,{prompt_completed:!0,declined:!1,declined_at:""})}function yI(e,t){e.state.declined&&Ur(e,t,{prompt_completed:!0,declined:!1,declined_at:""})}function vI(e){e.skipped=!0,e.warnings.push("agent_guidance:skipped_declined"),jr(e.nextSteps,Gr)}async function wI(e,t){if(e.prompted=!0,await dI(t.targetRelativePath)){await Ig(e,t),Ur(e,t.checkedFiles,{prompt_completed:!0,declined:!1,declined_at:""});return}e.skipped=!0,Ur(e,t.checkedFiles,{prompt_completed:!0,declined:!0,declined_at:new Date().toISOString()}),e.warnings.push("agent_guidance:declined"),jr(e.nextSteps,Gr)}function bI(e){e.warnings.push("agent_guidance:missing_non_interactive"),jr(e.nextSteps,Gr)}async function kI(e,t){let n={warnings:[],nextSteps:[],prompted:!1,applied:!1,skipped:!1,state:e};return t.mode==="status"?(_I(n,t.presentBefore),n):t.mode==="skip"?(hI(n,t.checkedFiles),n):t.mode==="add"?(await gI(n,t),n):t.presentBefore?(yI(n,t.checkedFiles),n):n.state.prompt_completed&&n.state.declined?(vI(n),n):t.interactive?(await wI(n,t),n):(bI(n),n)}async function Og(e){let t=aI(e.pm_root,e.cwd),n=await Rg(t),r=cI(n,t),o=Dr(t,r),i=n.map(u=>Dr(t,u.file_path)),s=n.some(u=>u.has_guidance),a=await kI(Cg(e.settings),{mode:e.mode,interactive:e.interactive,targetPath:r,targetRelativePath:o,checkedFiles:i,presentBefore:s,projectRoot:t}),c=mI(e.settings,a.state);return n=await fI(a.applied,n,t),{summary:pI({mode:e.mode,scans:n,projectRoot:t,targetRelativePath:o,prompted:a.prompted,applied:a.applied,skipped:a.skipped,state:a.state}),warnings:a.warnings,next_steps:a.nextSteps,settings_changed:c.changed}}(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]="
|
|
21
|
+
`),lI(n,!0)}finally{t.close()}}function Cg(e){let t=e.agent_guidance;return{prompt_completed:t?.prompt_completed===!0,declined:t?.declined===!0,declined_at:typeof t?.declined_at=="string"?t.declined_at:"",template_version:typeof t?.template_version=="number"&&Number.isInteger(t.template_version)&&t.template_version>0?t.template_version:El,last_checked_files:Array.isArray(t?.last_checked_files)?[...new Set(t.last_checked_files.map(n=>n.trim()).filter(n=>n.length>0))].sort((n,r)=>n.localeCompare(r)):[]}}async function Rg(e){let t=[];for(let n of YR){let r=me.join(e,n),o=await L(r);if(!o){t.push({file_path:r,exists:o,has_guidance:!1,has_marker:!1});continue}let i=await Sl.readFile(r,"utf8"),s=i.toLowerCase(),a=JR.filter(m=>s.includes(m)),c=nI(i);t.push({file_path:r,exists:o,has_guidance:c||a.length>=XR,has_marker:c})}return t}function jr(e,t){e.includes(t)||e.push(t)}function mI(e,t){let n=Cg(e),r=JSON.stringify(n)!==JSON.stringify(t);return r&&(e.agent_guidance=t),{changed:r,state:t}}async function uI(e,t=me.dirname(e)){let r=await L(e)?await Sl.readFile(e,"utf8"):"",o=oI(r,await iI(t));return o.changed?(await te(e,o.next_content),{changed:!0,warnings:await J({path:e,scope:"project",op:"init:agent_guidance_file"})}):{changed:!1,warnings:[]}}function pI(e){return{mode:e.mode,present:e.scans.some(t=>t.has_guidance),prompted:e.prompted,applied:e.applied,skipped:e.skipped,declined:e.state.declined,prompt_completed:e.state.prompt_completed,template_version:e.state.template_version,target_file:e.targetRelativePath,checked_files:e.scans.map(t=>Dr(e.projectRoot,t.file_path)),files_with_guidance:e.scans.filter(t=>t.has_guidance).map(t=>Dr(e.projectRoot,t.file_path)),missing_files:e.scans.filter(t=>!t.exists).map(t=>Dr(e.projectRoot,t.file_path))}}async function fI(e,t,n){return e?await Rg(n):t}function Ur(e,t,n){e.state={...e.state,...n,template_version:El,last_checked_files:t}}async function Ig(e,t){if(t.presentBefore)return;let n=await uI(t.targetPath,t.projectRoot);e.warnings.push(...n.warnings),n.changed&&(e.applied=!0,e.warnings.push(`agent_guidance:added:${t.targetRelativePath}`))}function _I(e,t){t||(e.warnings.push("agent_guidance:missing"),jr(e.nextSteps,Gr))}function hI(e,t){e.skipped=!0,Ur(e,t,{prompt_completed:!0,declined:!0,declined_at:e.state.declined_at||new Date().toISOString()}),e.warnings.push("agent_guidance:explicit_skip"),jr(e.nextSteps,Gr)}async function gI(e,t){await Ig(e,t),Ur(e,t.checkedFiles,{prompt_completed:!0,declined:!1,declined_at:""})}function yI(e,t){e.state.declined&&Ur(e,t,{prompt_completed:!0,declined:!1,declined_at:""})}function vI(e){e.skipped=!0,e.warnings.push("agent_guidance:skipped_declined"),jr(e.nextSteps,Gr)}async function wI(e,t){if(e.prompted=!0,await dI(t.targetRelativePath)){await Ig(e,t),Ur(e,t.checkedFiles,{prompt_completed:!0,declined:!1,declined_at:""});return}e.skipped=!0,Ur(e,t.checkedFiles,{prompt_completed:!0,declined:!0,declined_at:new Date().toISOString()}),e.warnings.push("agent_guidance:declined"),jr(e.nextSteps,Gr)}function bI(e){e.warnings.push("agent_guidance:missing_non_interactive"),jr(e.nextSteps,Gr)}async function kI(e,t){let n={warnings:[],nextSteps:[],prompted:!1,applied:!1,skipped:!1,state:e};return t.mode==="status"?(_I(n,t.presentBefore),n):t.mode==="skip"?(hI(n,t.checkedFiles),n):t.mode==="add"?(await gI(n,t),n):t.presentBefore?(yI(n,t.checkedFiles),n):n.state.prompt_completed&&n.state.declined?(vI(n),n):t.interactive?(await wI(n,t),n):(bI(n),n)}async function Og(e){let t=aI(e.pm_root,e.cwd),n=await Rg(t),r=cI(n,t),o=Dr(t,r),i=n.map(u=>Dr(t,u.file_path)),s=n.some(u=>u.has_guidance),a=await kI(Cg(e.settings),{mode:e.mode,interactive:e.interactive,targetPath:r,targetRelativePath:o,checkedFiles:i,presentBefore:s,projectRoot:t}),c=mI(e.settings,a.state);return n=await fI(a.applied,n,t),{summary:pI({mode:e.mode,scans:n,projectRoot:t,targetRelativePath:o,prompted:a.prompted,applied:a.applied,skipped:a.skipped,state:a.state}),warnings:a.warnings,next_steps:a.nextSteps,settings_changed:c.changed}}(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]="231597cc-2166-5029-9b3a-476587a33941")}catch{}})();var Tl=Symbol.for("pm.sdk.init-invocation-cwd");var TI=()=>EI.createInterface({input:AI,output:Fe});function CI(){return structuredClone(Tt)}var RI=["minimal","default","strict"];function Pg(e){if(e===void 0)return;let t=e.trim().toLowerCase().replaceAll("-","_");if(t.length===0)throw new d("--preset must not be empty",l.USAGE);if(t==="minimal"||t==="default"||t==="strict")return t;if(t==="lite"||t==="minimum")return"minimal";throw new d(`Invalid --preset value "${e}". Allowed: ${RI.join(", ")}`,l.USAGE)}function II(e){if(e!==void 0){if(e.trim().length===0)throw new d("--type-preset must not be empty",l.USAGE);try{return iu(e)}catch{throw new d(`Invalid --type-preset value "${e}". Allowed: ${ou.join(", ")}`,l.USAGE)}}}function OI(e){if(e===void 0)return;let t=e.trim();if(t.length===0)throw new d("--author must not be empty",l.USAGE);return t}function Al(e){if(e===void 0)return!1;let t=e.trim();return t.length===0?!1:Q.isAbsolute(t)||/^[a-z]:/iu.test(t)||t.startsWith(".")||t.includes("/")||t.includes("\\")}function xI(e,t,n,r){let o=r?.trim();if(r!==void 0&&o?.length===0)throw new d("--workspace must not be empty",l.USAGE);if(o!==void 0){if(t.path!==void 0||Al(n))throw new d("--workspace cannot be combined with --pm-path/--path or a path-like positional target.",l.USAGE);let m=Q.resolve(e,o),u=Q.join(m,".agents","pm");return{pmRoot:u,prefixArg:n,target:{mode:"workspace-path",tracker_root:u,workspace_root:m}}}if(t.path===void 0&&Al(n)){let m=Q.resolve(e,n.trim());return{pmRoot:m,prefixArg:void 0,target:{mode:"tracker-path",tracker_root:m}}}let i=E(e,t.path),s=Q.join(Q.resolve(e),".agents","pm"),a=Q.dirname(Q.dirname(i)),c=Q.resolve(i)===s?"current":"ancestor";return{pmRoot:i,prefixArg:n,target:t.path===void 0?{mode:"workspace-discovery",tracker_root:i,workspace_root:a,discovery:c,requested_cwd:Q.resolve(e),...c==="ancestor"?{suggested_current_tracker_root:s}:{}}:{mode:"tracker-path",tracker_root:i}}}function PI(e,t){if(t===void 0)return e;if(t.trim().length===0)throw new d("--id-prefix must not be empty",l.USAGE);if(Al(t))throw new d(`--id-prefix accepts an item ID prefix, not a tracker path: "${t}".`,l.USAGE,{code:"init_id_prefix_path_like",required:"Pass the tracker path positionally or with the global --path option.",examples:[`pm init ${t}`,`pm --path ${t} init`]});if(e!==void 0&&Nt(e)!==Nt(t))throw new d(`Conflicting id prefixes: positional "${e}" and --id-prefix "${t}".`,l.USAGE,{code:"init_id_prefix_conflict",required:"Use either the positional id prefix or --id-prefix with one value.",examples:[`pm init ${Nt(e)}`,`pm init --id-prefix ${Nt(t)}`]});return t}function LI(e){if(e===void 0)return"ask";let t=e.trim().toLowerCase().replaceAll("-","_");if(t.length===0)throw new d("--agent-guidance must not be empty",l.USAGE);if(t==="ask"||t==="add"||t==="skip"||t==="status")return t;throw new d(`Invalid --agent-guidance value "${e}". Allowed: ${Ag.join(", ")}`,l.USAGE)}function NI(e,t){let n=e.trim().toLowerCase();return n.length===0?t:n==="y"||n==="yes"?!0:n==="n"||n==="no"?!1:t}function Lg(e,t){let n=Nd[t];e.governance={preset:t,...n},e.validation.parent_reference=n.parent_reference,e.validation.metadata_profile=n.metadata_profile}function MI(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function $I(e){let t=e.details;return{installed_all:t.installed_all===!0,installed_count:typeof t.installed_count=="number"?t.installed_count:0,packages:Array.isArray(t.packages)?t.packages.filter(MI).map(n=>({alias:typeof n.alias=="string"?n.alias:"",ok:n.ok===!0})):[]}}async function FI(e,t,n){let r=zo(t.schema),o=pt(e,r.files.types,ut.types),s=nu(await Z(o)),a=[],c=[];for(let m of su(n)){let u=ru(s,m);s=u.file,(u.replaced?c:a).push(u.definition.name)}return await nt({pmRoot:e,filePath:o,raw:qo(s),op:"init:type-preset",author:C(void 0,t.author_default),lockTtlSeconds:t.locks.ttl_seconds,lockWaitMs:t.locks.wait_ms}),{name:n,registered:a,updated:c,file:o}}async function DI(e){let t=[".git","package.json","pnpm-workspace.yaml","AGENTS.md",Q.join(".agents","pm")];for(let n of t)if(await L(Q.join(e,n)))return!0;return!1}async function UI(e,t,n){if(!t||n||await L(Q.join(e,"settings.json"))||!await DI(e))return;let r=Q.join(e,".agents","pm");throw new d(`Refusing to initialize tracker files directly in workspace root "${e}".`,l.USAGE,{code:"workspace_root_pm_path",type:"urn:pm-cli:error:workspace_root_pm_path",why:"Path-like init targets and --pm-path/--path point at the tracker storage directory itself, not the repository workspace. Point at .agents/pm, use --workspace, or pass --force if you intentionally want root-level tracker files.",examples:[`pm --pm-path ${r} init --yes`,"pm init --yes",`pm --pm-path ${e} init --yes --force`],nextSteps:["Use --pm-path <repo>/.agents/pm for repository-local tracker storage.","Use PM_PATH only for sandboxed tests or explicit tracker roots.","Pass --force only when root-level tracker files are intentional."],recovery:{next_best_command:`pm --pm-path ${r} init --yes`}})}async function Ng(e,t){let n=[],r=[];for(let o of t){let i=o?Q.join(e,o):e,s=await L(i);await SI.mkdir(i,{recursive:!0}),s?r.push(`already_exists:${i}`):n.push(i),r.push(...await J({path:i,scope:"project",op:"init:ensure_dir"}))}return{createdDirs:n,warnings:r}}async function GI(e,t){let n=TI();try{Fe.write(`pm init setup wizard (agent-optimized)
|
|
22
22
|
`),Fe.write(`This walkthrough is non-destructive and each choice can be changed later with pm config.
|
|
23
23
|
|
|
24
24
|
`),Fe.write(`1/3 Item ID prefix
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$b as ki,A as Ie,B as $e,C as Be,D as Ce,E as De,F as Ne,G as Oe,Ma as Xe,Na as Le,Oa as Qe,Qb as ai,Rb as di,Sb as ui,Tb as si,Ub as fi,Vb as pi,Wb as ci,Xb as _i,Yb as li,Zb as mi,_b as gi,ac as Ai,ba as Ue,bc as Ei,c as oe,ca as Pe,cc as _,d as ae,da as je,db as Me,dc as Ri,e as de,ea as Fe,ec as Si,f as ue,fa as qe,fc as Ti,g as se,ga as ze,gc as Ii,h as fe,ha as Je,hb as ei,hc as l,i as pe,ia as We,ib as ii,j as ce,ja as Ze,jb as ri,k as _e,kb as ti,l as le,lb as ni,m as me,mb as oi,n as xe,o as ve,p as be,pa as Ge,q as ye,qa as He,r as he,ra as Ve,s as we,sa as Ye,t as ge,ta as Ke,u as ke,v as Ae,w as Ee,x as Re,y as Se,z as Te}from"./focused-chunks/chunk-
|
|
1
|
+
import{$b as ki,A as Ie,B as $e,C as Be,D as Ce,E as De,F as Ne,G as Oe,Ma as Xe,Na as Le,Oa as Qe,Qb as ai,Rb as di,Sb as ui,Tb as si,Ub as fi,Vb as pi,Wb as ci,Xb as _i,Yb as li,Zb as mi,_b as gi,ac as Ai,ba as Ue,bc as Ei,c as oe,ca as Pe,cc as _,d as ae,da as je,db as Me,dc as Ri,e as de,ea as Fe,ec as Si,f as ue,fa as qe,fc as Ti,g as se,ga as ze,gc as Ii,h as fe,ha as Je,hb as ei,hc as l,i as pe,ia as We,ib as ii,j as ce,ja as Ze,jb as ri,k as _e,kb as ti,l as le,lb as ni,m as me,mb as oi,n as xe,o as ve,p as be,pa as Ge,q as ye,qa as He,r as he,ra as Ve,s as we,sa as Ye,t as ge,ta as Ke,u as ke,v as Ae,w as Ee,x as Re,y as Se,z as Te}from"./focused-chunks/chunk-WHL5CQG3.js";import"./focused-chunks/chunk-LNM3BS45.js";import{h as j}from"./focused-chunks/chunk-G4TKJZ4A.js";import{E as B,F as C,G as D,H as N,I as O,J as U,K as P}from"./focused-chunks/chunk-WUMGGQYN.js";import"./focused-chunks/chunk-OWDDVMAP.js";import{Ba as L,Ca as Q,Da as M,Ea as ee,Fa as ie,Ga as re,Ha as te,Ia as ne,ob as xi,pb as vi,qb as bi,rb as yi,sb as hi,tb as wi,ua as G,va as H,wa as V,xa as Y,ya as K,za as X}from"./focused-chunks/chunk-GKSAMNBG.js";import"./focused-chunks/chunk-NOK652OP.js";import"./focused-chunks/chunk-267N774W.js";import"./focused-chunks/chunk-7S7XWMXC.js";import{D as F,E as q,F as z,G as J,H as W,db as Z}from"./focused-chunks/chunk-JZSLDLR4.js";import"./focused-chunks/chunk-OCTTDZOU.js";import"./focused-chunks/chunk-HFAW3FJQ.js";import{Ob as h,Pb as w,Qb as g,Rb as k,Sb as A,Tb as E,Td as c,Ub as R,Vb as S,Wb as T,Xb as I,Yb as $}from"./focused-chunks/chunk-Z4PWEIMX.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new e.Error().stack;i&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[i]="aa6b9997-a4c6-5bfb-8804-45b34afd9e01")}catch{}})();var m=["captured_redacted","captured_verbatim"],x=[{label:"home directory",pattern:/(?:\/home\/|\/Users\/)[^/\s"']+/u},{label:"GitHub token",pattern:/\b(?:gh[oprsu]_[A-Za-z0-9_]{20,})\b/u},{label:"npm token",pattern:/\bnpm_[A-Za-z0-9]{20,}\b/u},{label:"private key",pattern:/-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/u}];function n(e){return typeof e=="string"&&e.trim().length>0}function v(e,i){if(typeof i!="object"||i===null||Array.isArray(i))return[{boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} must contain a JSON object.`}];let r=i,t=[];r.boundary_id!==e.id&&t.push({boundary_id:e.id,kind:"fixture_boundary_mismatch",detail:`${e.fixture_path} names ${String(r.boundary_id)} instead of ${e.id}.`}),(r.version!==1||!m.includes(r.capture_source)||!n(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(n)||!("input"in r)||!("observed"in r))&&t.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let a=JSON.stringify(i);for(let s of x)s.pattern.test(a)&&t.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${s.label}.`});return t}function b(e,i){let r=Date.parse(e.waiver_expires_at),t=n(e.waiver_reason)&&n(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&c(e.waiver_expires_at)&&Number.isFinite(r);return{captured:0,waived:t&&r>=i?1:0,findings:t?r<i?[{boundary_id:e.id,kind:"expired_waiver",detail:`Boundary ${e.id} waiver expired at ${e.waiver_expires_at}.`}]:[]:[{boundary_id:e.id,kind:"invalid_waiver",detail:`Boundary ${e.id} waiver requires reason, owner, and an RFC 3339 UTC expiry.`}]}}function y(e,i,r){if(!n(e.id)||!n(e.producer)||!n(e.consumer)||!n(e.format))return{captured:0,waived:0,findings:[{boundary_id:n(e.id)?e.id:"unknown",kind:"invalid_boundary",detail:"Each boundary requires non-empty id, producer, consumer, and format."}]};if("fixture_path"in e){let t=i[e.fixture_path],a=n(e.fixture_path)&&e.fixture_path in i?v(e,t):[{boundary_id:e.id,kind:"missing_fixture",detail:`Boundary ${e.id} fixture ${String(e.fixture_path)} is missing.`}];return{captured:a.length===0?1:0,waived:0,findings:a}}return b(e,r)}function Bi(e,i,r=new Date){let t=[];if(e.version!==1||!n(e.inventory_scope)||!Array.isArray(e.boundaries))return{ok:!1,boundary_count:0,captured_count:0,waived_count:0,findings:[{boundary_id:"registry",kind:"invalid_registry",detail:"Boundary registry requires version 1, inventory_scope, and boundaries."}]};let a=new Set,s=0,p=0;for(let o of e.boundaries){if(typeof o!="object"||o===null||Array.isArray(o)){t.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let d=o,u=n(d.id)?d.id:void 0;if(u!==void 0&&a.has(u)){t.push({boundary_id:u,kind:"duplicate_boundary",detail:`Boundary ${u} is inventoried more than once.`});continue}u!==void 0&&a.add(u);let f=y(d,i,r.getTime());s+=f.captured,p+=f.waived,t.push(...f.findings)}return t.sort((o,d)=>o.boundary_id!==d.boundary_id?o.boundary_id.localeCompare(d.boundary_id):o.kind.localeCompare(d.kind)),{ok:t.length===0,boundary_count:e.boundaries.length,captured_count:s,waived_count:p,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new e.Error().stack;i&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[i]="ae8f06a0-a2e6-5f91-99f7-e822270b491d")}catch{}})();export{ci as ASSURANCE_ACTIONS,_i as ASSURANCE_DECLARATION_KINDS,fe as ASSURANCE_DOCUMENT_VERSION,pe as ASSURANCE_GATE_TRIGGERS,ce as ASSURANCE_MEASUREMENT_SOURCE_KINDS,Ie as ASSURANCE_PRESET_IDS,ae as AssuranceEvaluationRefusalError,oe as AssuranceMutationRefusalError,de as AssuranceSourceResolutionError,m as BOUNDARY_FIXTURE_CAPTURE_SOURCES,z as CURRENT_HISTORY_HASH_ALGORITHM,B as DEFECT_ESCAPE_CLASSES,C as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Ue as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,F as HISTORY_HASH_ALGORITHMS,q as LEGACY_HISTORY_HASH_ALGORITHM,w as MAX_WORKFLOW_POLICIES,g as MAX_WORKFLOW_POLICY_TERMS,j as PM_HISTORY_ATTESTATION_CONTRACT,G as PM_MUTATION_ACTION_CONTRACTS,h as WORKFLOW_POLICY_ACTIONS,He as WORKFLOW_POLICY_DOCUMENT_SCHEMA,Ge as WORKFLOW_POLICY_SCHEMA,ti as _testOnlyHealthCommand,vi as _testOnlySimilarity,di as _testOnlyValidateCommand,Ii as _testOnlyWorkspacePosition,De as acceptAssuranceProposals,Ze as acknowledgeUnknownAuthorHistoryEvents,We as acknowledgeUnknownAuthorHistoryEventsFromTransport,N as analyzeDefectChangeRisk,pi as analyzeDefectRecurrenceCoverage,yi as analyzeDuplicateItems,Be as applyAssurancePreset,_e as assuranceAssertionUpdateIsLoosening,D as buildDefectRecurrenceIndex,ni as buildLinkedFileRepairReport,ii as buildStatusRoleWarnings,Ve as buildWorkflowCompletenessCheck,Pe as classifyHistoryAuthorEvent,$e as createAssurancePreset,si as createAssuranceWorkspaceContext,be as createEmptyAssuranceDocument,Ye as createLifecycleCompletenessPolicies,$ as createWorkflowPolicyEvaluator,Ce as deriveAssuranceProposals,he as evaluateAssuranceAssertion,we as evaluateAssuranceGate,Bi as evaluateBoundaryFixtures,O as evaluateDefectGateEvidence,ye as evaluateMeasurement,V as evaluateMutationGuard,wi as evaluateSimilarityGovernance,I as evaluateWorkflowPolicies,ki as exportAttestation,hi as findDuplicateClusters,bi as findSimilarItems,Ti as formatWorkspacePositionHuman,ke as getAssuranceDeclaration,X as getMutationActionContract,W as historyDigest,je as inspectHistoryAuthorStream,te as inspectStaleInProgressItems,ei as inspectStatusRoleAssignments,Y as isMutationAction,L as jaccardSimilarity,ge as listAssuranceDeclarations,Te as listAssuranceVerdicts,Le as listInvalidProvenanceHistoryStreamIds,K as listMutationActions,se as normalizeAssuranceEvaluation,ue as normalizeAssuranceMutation,Xe as normalizeInvalidHistoryProvenance,Q as normalizeSimilarityText,P as parseDefectChangeRiskRequest,fi as parseDefectRecurrenceCoverageRequest,U as parseDefectRecurrencePolicy,gi as parseHistoryAttestation,Je as parseUnknownAuthorHistoryEventCoordinates,k as parseWorkflowPolicy,A as parseWorkflowPolicyDocument,qe as planUnknownAuthorHistoryAcknowledgment,ee as prepareSimilarityText,ai as projectValidateCounts,Ne as promoteAssuranceAssertion,Ae as putAssuranceDeclaration,Ee as putAssuranceDeclarationBundle,Z as readWorkflowPolicies,E as readWorkflowPolicyField,Si as readWorkspacePosition,Se as recordAssuranceVerdict,Re as removeAssuranceDeclaration,J as resolveHistoryHashAlgorithm,ze as resolveUnknownAuthorAcknowledgmentSelector,li as runAssuranceAction,mi as runAssuranceDispatch,Ri as runGc,ri as runHealth,Ei as runHistoryAttest,Me as runHistoryMaintenance,l as runReindex,_ as runUpgrade,ui as runValidate,Ke as runWorkflowPolicyAction,Oe as scanExtensionHostVersions,Fe as scanHistoryAuthorAttribution,H as scanMutationSecrets,Qe as scanProvenanceResolverHealth,ne as scanStaleInProgressItems,oi as scanStorageIntegrity,ie as scoreItemSimilarity,re as scorePreparedItemSimilarity,xi as similarityAdvisoryWarnings,M as tokenizeSimilarityText,me as validateAssertionDefinition,ve as validateAssuranceDocument,xe as validateGateDefinition,le as validateMeasurementDefinition,Ai as verifyAttestation,S as workflowApprovalFingerprint,T as workflowPolicyApplies,R as workflowPolicyFingerprint};
|
|
2
2
|
//# sourceMappingURL=sdk-governance.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Be,b as ze,c as Ie}from"./focused-chunks/chunk-JKJYXCT6.js";import{A as me,B as ye,C as we,D as be,E as Re,F as _e,G as ke,H as Ae,I as Ge,J as Se,K as Ee,a as We,b as je,c as Fe,d as Ue,e as q,f as J,g as Z,h as Q,i as X,j as Y,k as ee,l as te,m as re,n as ne,o as ie,p as se,q as oe,r as ae,s as pe,t as ce,u as de,v as le,w as he,x as fe,y as ge,z as ue}from"./focused-chunks/chunk-MD7ADLME.js";import{$b as Le,Kb as $,Lb as v,Mb as H,Nb as P,Ob as M,Pb as N,Qb as B,Rb as z,Sb as W,Tb as j,Ub as F,Wb as k,Xb as U,Yb as L,Zb as V,_b as K,fc as Ve,gc as Ke,hc as qe,ic as Je,jc as Ze,kc as Qe,lc as Xe,mc as Ye,nc as et}from"./focused-chunks/chunk-6C3CUU2G.js";import"./focused-chunks/chunk-OGGF2RBL.js";import"./focused-chunks/chunk-HFAW3FJQ.js";import{$a as E,Za as $e,_a as _,ab as ve,bb as He,cb as Pe,db as Me,eb as f,ec as x,fb as Ne,pb as b}from"./focused-chunks/chunk-4YTDKIPF.js";import{createHash as De}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eb475dcd-d16c-51fb-b248-b14cf5ade4de")}catch{}})();var A=1;function g(e){e?.throwIfAborted()}function l(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function u(e,t,r={}){let n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let i=e.nodes(),a=e.edges(),s=t.list();return Object.freeze({version:A,fingerprint:De("sha256").update(b({nodes:i,edges:a,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:i,edges:a,kinds:s})}function Te(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function y(e){if(!Te(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==A)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(i=>typeof i!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new _([]);for(let i of e.kinds)t.register(i);let r=new f(e.nodes,e.edges,t),n=u(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function d(e,t){l(e.name,"adapter name");let r=l(t.workspace,"workspace");g(t.signal);let n=await e.read({...t,workspace:r});return g(t.signal),n===null?null:y(n)}async function R(e,t){let r=l(t.workspace,"workspace"),n=y(t.snapshot).snapshot,i=await d(e,{workspace:r,signal:t.signal});if(i?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:i.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(g(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:i?.snapshot.fingerprint??null}),(await d(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...i?{previous_fingerprint:i.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function Ce(e,t={}){let r=e.map(y),n=new Map;for(let s of r)for(let o of s.snapshot.kinds){let c=n.get(o.kind);if(c&&b(c)!==b(o))throw new TypeError(`Conflicting federated relationship kind: ${o.kind}`);n.set(o.kind,o)}let i=new _([...n.values()].sort((s,o)=>s.kind.localeCompare(o.kind))),a=new f(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),i);return u(a,i,t)}var m=class{name;#e=new Map;constructor(t="memory"){this.name=l(t,"adapter name")}async read(t){g(t.signal);let r=this.#e.get(l(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){g(t.signal);let r=l(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(y(t.snapshot).snapshot))}async clear(t){g(t.signal);let r=l(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(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]="9a60b8c0-37d1-5c04-a079-e1351caf6e09")}catch{}})();function I(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Oe(e){let t=I(e.nodeCount,"nodeCount"),r=I(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let i=(e.kind??"related").trim(),a=(e.idPrefix??"node").trim();if(!i||!a)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let o=0;o<t;o+=1)yield`${a}-${o}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let o=r;o<t;o+=r)yield{source:`${a}-${n==="star"?0:o-r}`,target:`${a}-${o}`,kind:i}}}}}function h(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function D(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=E(),i=u(new f(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),a=u(new f(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];h(await d(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let o=await R(e,{workspace:r,snapshot:i});h(o.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),h((await d(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),h((await R(e,{workspace:r,snapshot:i})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:a,expected_fingerprint:i.fingerprint}),h((await d(e,{workspace:r}))?.snapshot.fingerprint===a.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let w=!1;try{await e.replace({workspace:r,snapshot:i,expected_fingerprint:i.fingerprint})}catch{w=!0}return h(w,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:a.fingerprint}),h(await d(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function xe(e){return D(new m,e?{workspace:e}:{})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c59413c4-8955-5560-8bc6-f1dc9c8c5042")}catch{}})();import{createHash as T}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="41ef1735-c534-5b84-8367-1278007cb7c6")}catch{}})();function C(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function Et(e,t){let r=C(t.migrationId,"migrationId"),n=C(t.author,"author"),i=Date.parse(t.timestamp);if(!Number.isFinite(i))throw new TypeError("Relationship backfill timestamp must be valid");let a=new Date(i).toISOString(),s=k(e,void 0,t.registry),o=s.graph.nodes(),c=s.graph.edges().map(p=>{let S=T("sha256").update(JSON.stringify([r,p.kind,p.source,p.target,p.createdAt??null,p.author??null,p.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${S}`,relationshipId:`migration:${r}:${S}`,action:"add",edge:p,author:n,timestamp:a,reason:`Backfill ${r} from legacy item metadata`})}),w=T("sha256").update(JSON.stringify({migrationId:r,nodes:o,events:c})).digest("hex"),O=new Set([...t.existingEventIds??[]].filter(p=>typeof p=="string").map(p=>p.trim()).filter(Boolean)),G=c.filter(p=>!O.has(p.eventId));return Object.freeze({migration_id:r,fingerprint:w,nodes:o,events:Object.freeze(G),edge_count:c.length,skipped_existing_count:c.length-G.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}(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]="3160880c-9d85-52c5-ae1d-ada213f56ce6")}catch{}})();export{Ke as ACTIONABILITY_ORDERING_KINDS,$e as BUILTIN_RELATIONSHIP_KINDS,ge as GRAPH_DURABLE_CACHE_MIN_ITEMS,fe as GRAPH_DURABLE_CACHE_VERSION,x as GRAPH_SUBCOMMAND_VALUES,m as MemoryRelationshipGraphAdapter,A as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Be as RelationshipEventLog,ze as RelationshipEventStore,f as RelationshipGraph,_ as RelationshipKindRegistry,L as WorkspaceGraphCache,je as analyzeGraphImpact,H as analyzeHierarchyIntegrity,Fe as analyzeKnowledgeGraph,We as analyzeRelationshipExecution,se as analyzeRelationshipSchedule,k as assembleWorkspaceRelationshipGraph,N as assertHierarchyMutationAllowed,xe as assertMemoryRelationshipGraphAdapterConformance,Me as assertRelationshipEdgeAllowed,D as assertRelationshipGraphAdapterConformance,le as auditWorkspaceRelationshipGraph,Le as buildRelationshipContext,ve as canonicalizeRelationshipKind,be as clearDurableGraphCache,qe as collectBlockedByIds,Ze as collectBlockedByIdsFromCorpus,j as collectDanglingDependencyReferences,Xe as collectDependencyBlockedIds,z as collectDuplicateDependencyRows,de as collectDuplicateRelationshipEdgeGroups,v as collectHierarchyRelations,F as collectMissingDependencyTargetIds,Ie as collectNewOrderingCycleWarnings,ae as collectOrderingCycles,W as collectOrderingStorageContradictions,Ue as compareRelationshipSnapshots,et as computeActionabilityReport,ne as computeRelationshipCentrality,re as computeRelationshipDominators,U as computeWorkspaceGraphFingerprint,Oe as createRelationshipGraphScaleFixture,u as createRelationshipGraphSnapshot,E as createRelationshipKindRegistry,Ne as dependencyToRelationship,oe as deriveRelationshipDeadlines,ee as detectRelationshipCommunities,he as diffRelationshipAuditSnapshots,ue as durableGraphCachePath,Re as durableGraphCacheStatus,X as enumerateRelationshipPaths,Ce as federateRelationshipGraphSnapshots,te as findRedundantRelationshipEdges,ie as findRelationshipCutStructure,Y as forEachMatchedRelationshipEdge,ce as formatDuplicateEdgeGroup,P as formatHierarchyRelation,pe as formatOrderingStorageContradiction,me as graphAuditBaselinePath,q as hierarchyAncestors,J as hierarchyDescendants,Je as indexBlockedByIds,M as indexHierarchyRelations,Pe as isOrderingRelationshipKind,ke as loadGraphAuditBaseline,d as loadRelationshipGraphAdapter,B as normalizeDependencyGraphTarget,ye as openDurableGraphCache,Z as orderingPredecessors,Q as orderingSuccessors,Se as parseGraphSubcommand,y as parseRelationshipGraphSnapshot,we as persistDurableGraphResult,Et as planRelationshipEventBackfill,Ge as planRelationshipRemediation,K as resetWorkspaceGraphCache,He as resolveCanonicalRelationshipKind,Qe as resolveItemBlockers,Ve as resolveItemExecutionRole,$ as resolveWorkspaceRelationshipKindRegistry,Ee as runGraph,Ae as saveGraphAuditBaseline,Ye as selectActionableEntries,_e as shouldPersistDurableGraphCache,R as syncRelationshipGraphAdapter,V as workspaceGraphCache};
|
|
1
|
+
import{a as Be,b as ze,c as Ie}from"./focused-chunks/chunk-BFUXTNZU.js";import{A as me,B as ye,C as we,D as be,E as Re,F as _e,G as ke,H as Ae,I as Ge,J as Se,K as Ee,a as We,b as je,c as Fe,d as Ue,e as q,f as J,g as Z,h as Q,i as X,j as Y,k as ee,l as te,m as re,n as ne,o as ie,p as se,q as oe,r as ae,s as pe,t as ce,u as de,v as le,w as he,x as fe,y as ge,z as ue}from"./focused-chunks/chunk-OWDDVMAP.js";import{$b as Le,Kb as $,Lb as v,Mb as H,Nb as P,Ob as M,Pb as N,Qb as B,Rb as z,Sb as W,Tb as j,Ub as F,Wb as k,Xb as U,Yb as L,Zb as V,_b as K,fc as Ve,gc as Ke,hc as qe,ic as Je,jc as Ze,kc as Qe,lc as Xe,mc as Ye,nc as et}from"./focused-chunks/chunk-JZSLDLR4.js";import"./focused-chunks/chunk-OCTTDZOU.js";import"./focused-chunks/chunk-HFAW3FJQ.js";import{$a as E,Za as $e,_a as _,ab as ve,bb as He,cb as Pe,db as Me,eb as f,ec as x,fb as Ne,pb as b}from"./focused-chunks/chunk-Z4PWEIMX.js";import{createHash as De}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eb475dcd-d16c-51fb-b248-b14cf5ade4de")}catch{}})();var A=1;function g(e){e?.throwIfAborted()}function l(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function u(e,t,r={}){let n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let i=e.nodes(),a=e.edges(),s=t.list();return Object.freeze({version:A,fingerprint:De("sha256").update(b({nodes:i,edges:a,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:i,edges:a,kinds:s})}function Te(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function y(e){if(!Te(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==A)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(i=>typeof i!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new _([]);for(let i of e.kinds)t.register(i);let r=new f(e.nodes,e.edges,t),n=u(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function d(e,t){l(e.name,"adapter name");let r=l(t.workspace,"workspace");g(t.signal);let n=await e.read({...t,workspace:r});return g(t.signal),n===null?null:y(n)}async function R(e,t){let r=l(t.workspace,"workspace"),n=y(t.snapshot).snapshot,i=await d(e,{workspace:r,signal:t.signal});if(i?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:i.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(g(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:i?.snapshot.fingerprint??null}),(await d(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...i?{previous_fingerprint:i.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function Ce(e,t={}){let r=e.map(y),n=new Map;for(let s of r)for(let o of s.snapshot.kinds){let c=n.get(o.kind);if(c&&b(c)!==b(o))throw new TypeError(`Conflicting federated relationship kind: ${o.kind}`);n.set(o.kind,o)}let i=new _([...n.values()].sort((s,o)=>s.kind.localeCompare(o.kind))),a=new f(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),i);return u(a,i,t)}var m=class{name;#e=new Map;constructor(t="memory"){this.name=l(t,"adapter name")}async read(t){g(t.signal);let r=this.#e.get(l(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){g(t.signal);let r=l(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(y(t.snapshot).snapshot))}async clear(t){g(t.signal);let r=l(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(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]="9a60b8c0-37d1-5c04-a079-e1351caf6e09")}catch{}})();function I(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Oe(e){let t=I(e.nodeCount,"nodeCount"),r=I(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let i=(e.kind??"related").trim(),a=(e.idPrefix??"node").trim();if(!i||!a)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let o=0;o<t;o+=1)yield`${a}-${o}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let o=r;o<t;o+=r)yield{source:`${a}-${n==="star"?0:o-r}`,target:`${a}-${o}`,kind:i}}}}}function h(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function D(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=E(),i=u(new f(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),a=u(new f(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];h(await d(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let o=await R(e,{workspace:r,snapshot:i});h(o.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),h((await d(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),h((await R(e,{workspace:r,snapshot:i})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:a,expected_fingerprint:i.fingerprint}),h((await d(e,{workspace:r}))?.snapshot.fingerprint===a.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let w=!1;try{await e.replace({workspace:r,snapshot:i,expected_fingerprint:i.fingerprint})}catch{w=!0}return h(w,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:a.fingerprint}),h(await d(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function xe(e){return D(new m,e?{workspace:e}:{})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c59413c4-8955-5560-8bc6-f1dc9c8c5042")}catch{}})();import{createHash as T}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="41ef1735-c534-5b84-8367-1278007cb7c6")}catch{}})();function C(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function Et(e,t){let r=C(t.migrationId,"migrationId"),n=C(t.author,"author"),i=Date.parse(t.timestamp);if(!Number.isFinite(i))throw new TypeError("Relationship backfill timestamp must be valid");let a=new Date(i).toISOString(),s=k(e,void 0,t.registry),o=s.graph.nodes(),c=s.graph.edges().map(p=>{let S=T("sha256").update(JSON.stringify([r,p.kind,p.source,p.target,p.createdAt??null,p.author??null,p.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${S}`,relationshipId:`migration:${r}:${S}`,action:"add",edge:p,author:n,timestamp:a,reason:`Backfill ${r} from legacy item metadata`})}),w=T("sha256").update(JSON.stringify({migrationId:r,nodes:o,events:c})).digest("hex"),O=new Set([...t.existingEventIds??[]].filter(p=>typeof p=="string").map(p=>p.trim()).filter(Boolean)),G=c.filter(p=>!O.has(p.eventId));return Object.freeze({migration_id:r,fingerprint:w,nodes:o,events:Object.freeze(G),edge_count:c.length,skipped_existing_count:c.length-G.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}(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]="3160880c-9d85-52c5-ae1d-ada213f56ce6")}catch{}})();export{Ke as ACTIONABILITY_ORDERING_KINDS,$e as BUILTIN_RELATIONSHIP_KINDS,ge as GRAPH_DURABLE_CACHE_MIN_ITEMS,fe as GRAPH_DURABLE_CACHE_VERSION,x as GRAPH_SUBCOMMAND_VALUES,m as MemoryRelationshipGraphAdapter,A as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Be as RelationshipEventLog,ze as RelationshipEventStore,f as RelationshipGraph,_ as RelationshipKindRegistry,L as WorkspaceGraphCache,je as analyzeGraphImpact,H as analyzeHierarchyIntegrity,Fe as analyzeKnowledgeGraph,We as analyzeRelationshipExecution,se as analyzeRelationshipSchedule,k as assembleWorkspaceRelationshipGraph,N as assertHierarchyMutationAllowed,xe as assertMemoryRelationshipGraphAdapterConformance,Me as assertRelationshipEdgeAllowed,D as assertRelationshipGraphAdapterConformance,le as auditWorkspaceRelationshipGraph,Le as buildRelationshipContext,ve as canonicalizeRelationshipKind,be as clearDurableGraphCache,qe as collectBlockedByIds,Ze as collectBlockedByIdsFromCorpus,j as collectDanglingDependencyReferences,Xe as collectDependencyBlockedIds,z as collectDuplicateDependencyRows,de as collectDuplicateRelationshipEdgeGroups,v as collectHierarchyRelations,F as collectMissingDependencyTargetIds,Ie as collectNewOrderingCycleWarnings,ae as collectOrderingCycles,W as collectOrderingStorageContradictions,Ue as compareRelationshipSnapshots,et as computeActionabilityReport,ne as computeRelationshipCentrality,re as computeRelationshipDominators,U as computeWorkspaceGraphFingerprint,Oe as createRelationshipGraphScaleFixture,u as createRelationshipGraphSnapshot,E as createRelationshipKindRegistry,Ne as dependencyToRelationship,oe as deriveRelationshipDeadlines,ee as detectRelationshipCommunities,he as diffRelationshipAuditSnapshots,ue as durableGraphCachePath,Re as durableGraphCacheStatus,X as enumerateRelationshipPaths,Ce as federateRelationshipGraphSnapshots,te as findRedundantRelationshipEdges,ie as findRelationshipCutStructure,Y as forEachMatchedRelationshipEdge,ce as formatDuplicateEdgeGroup,P as formatHierarchyRelation,pe as formatOrderingStorageContradiction,me as graphAuditBaselinePath,q as hierarchyAncestors,J as hierarchyDescendants,Je as indexBlockedByIds,M as indexHierarchyRelations,Pe as isOrderingRelationshipKind,ke as loadGraphAuditBaseline,d as loadRelationshipGraphAdapter,B as normalizeDependencyGraphTarget,ye as openDurableGraphCache,Z as orderingPredecessors,Q as orderingSuccessors,Se as parseGraphSubcommand,y as parseRelationshipGraphSnapshot,we as persistDurableGraphResult,Et as planRelationshipEventBackfill,Ge as planRelationshipRemediation,K as resetWorkspaceGraphCache,He as resolveCanonicalRelationshipKind,Qe as resolveItemBlockers,Ve as resolveItemExecutionRole,$ as resolveWorkspaceRelationshipKindRegistry,Ee as runGraph,Ae as saveGraphAuditBaseline,Ye as selectActionableEntries,_e as shouldPersistDurableGraphCache,R as syncRelationshipGraphAdapter,V as workspaceGraphCache};
|
|
2
2
|
//# sourceMappingURL=sdk-graph.js.map
|