@unbrained/pm-cli 2026.9.19 → 2026.9.21
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 +954 -924
- package/dist/cli/main.d.ts +10 -76
- package/dist/cli/main.js +1 -2
- package/dist/cli/register-operations.js +1 -1
- package/dist/cli/runtime/activation.d.ts +51 -0
- package/dist/cli/runtime/activation.js +2 -0
- package/dist/cli/runtime/invocation-options.d.ts +41 -0
- package/dist/cli/runtime/invocation-options.js +2 -0
- package/dist/cli/runtime/selection.d.ts +29 -0
- package/dist/cli/runtime/selection.js +2 -0
- package/dist/cli/runtime/telemetry-outcome.d.ts +20 -0
- package/dist/cli/runtime/telemetry-outcome.js +2 -0
- package/dist/cli-bundle/bundle-manifest.json +150 -150
- package/dist/cli-bundle/chunks/{chunk-QA4GUEKJ.js → chunk-2QLXN6HZ.js} +46 -46
- package/dist/cli-bundle/chunks/chunk-2UNYUB4A.js +2 -0
- package/dist/cli-bundle/chunks/chunk-4SI67A2F.js +8 -0
- package/dist/cli-bundle/chunks/chunk-7YUYLYJQ.js +6 -0
- package/dist/cli-bundle/chunks/{chunk-7CN53F4S.js → chunk-FBWAECBI.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-GRHSNUQO.js +20 -0
- package/dist/cli-bundle/chunks/chunk-HAFSMFJK.js +3 -0
- package/dist/cli-bundle/chunks/chunk-JBJUOOJI.js +238 -0
- package/dist/cli-bundle/chunks/chunk-K7RWRJLT.js +29 -0
- package/dist/cli-bundle/chunks/chunk-NHRB3L5T.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-CCLWCESZ.js → chunk-QZTS23BV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-K4VAU4HU.js → chunk-SDLBF4PY.js} +1252 -1252
- package/dist/cli-bundle/chunks/{register-list-query-RMZNHSII.js → register-list-query-5V43MYPN.js} +6 -6
- package/dist/cli-bundle/chunks/{register-mutation-HJGSGX3H.js → register-mutation-DXES37MA.js} +4 -4
- package/dist/cli-bundle/chunks/register-operations-LJU5H2CU.js +2 -0
- package/dist/cli-bundle/chunks/register-setup-HJUNGYBB.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-3XPBKIV6.js +12 -0
- package/dist/cli-bundle/focused-chunks/{chunk-7Y7PAC56.js → chunk-5BLRMUMK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-5SZ4JSPZ.js → chunk-6MNKQKT6.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-IKPR4VVN.js → chunk-DPBTIFW7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-J3GN4SQT.js → chunk-DRNXMOSV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-P4BA7OX7.js → chunk-FXAZPSU6.js} +7 -7
- package/dist/cli-bundle/focused-chunks/{chunk-ARK4FIO4.js → chunk-HYPK5OPA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-I4WDON3K.js → chunk-IA5CCSBB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-CJ4QA4RW.js → chunk-ISEOBALS.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ZI2YBJFH.js → chunk-K5ZCBC6Y.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{chunk-V3YMNAO7.js → chunk-L6L4XCLY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-TDHVROGL.js → chunk-N6KI3LWF.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-PC6ZZVNP.js +20 -0
- package/dist/cli-bundle/focused-chunks/chunk-RQL5WLNZ.js +30 -0
- package/dist/cli-bundle/focused-chunks/{chunk-ZDBKYZFE.js → chunk-U2SB2BMM.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-YDFEWXXZ.js → chunk-UIS5FVHH.js} +53 -53
- package/dist/cli-bundle/main.js +26 -27
- 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 +39 -39
- 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 +42 -42
- 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 +8 -8
- package/dist/core/diagnostics/remediation.js +1 -1
- package/dist/core/extensions/extension-types.d.ts +2 -2
- package/dist/core/extensions/loader.d.ts +9 -15
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/extensions/manifest-parser.d.ts +5 -0
- package/dist/core/extensions/manifest-parser.js +2 -0
- package/dist/core/extensions/registration-contracts.d.ts +34 -0
- package/dist/core/extensions/registration-contracts.js +2 -0
- package/dist/core/governance/issue-codes.d.ts +10 -1
- package/dist/core/governance/issue-codes.js +1 -1
- package/dist/core/validate/fix-planning.d.ts +3 -3
- package/dist/core/validate/fix-planning.js +1 -1
- package/dist/sdk/agent/refusal-reachability.d.ts +1 -1
- package/dist/sdk/completion/bash.d.ts +3 -0
- package/dist/sdk/completion/bash.js +2 -0
- package/dist/sdk/completion/fish.d.ts +3 -0
- package/dist/sdk/completion/fish.js +1054 -0
- package/dist/sdk/completion/shared.d.ts +103 -0
- package/dist/sdk/completion/shared.js +2 -0
- package/dist/sdk/completion/zsh.d.ts +3 -0
- package/dist/sdk/completion/zsh.js +1109 -0
- package/dist/sdk/completion.d.ts +5 -30
- package/dist/sdk/completion.js +1 -2160
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/governance/closure-timestamps.d.ts +32 -0
- package/dist/sdk/governance/closure-timestamps.js +2 -0
- package/dist/sdk/governance/validate-normalization.d.ts +2 -0
- package/dist/sdk/governance/validate-normalization.js +1 -1
- package/dist/sdk/governance/validate.js +1 -1
- package/dist/sdk/governance.d.ts +1 -0
- package/dist/sdk/governance.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/search/corpus.d.ts +27 -0
- package/dist/sdk/query/search/corpus.js +2 -0
- package/dist/sdk/query/search/filters.d.ts +27 -0
- package/dist/sdk/query/search/filters.js +2 -0
- package/dist/sdk/query/search/input.d.ts +28 -0
- package/dist/sdk/query/search/input.js +2 -0
- package/dist/sdk/query/search/lexical.d.ts +34 -0
- package/dist/sdk/query/search/lexical.js +2 -0
- package/dist/sdk/query/search/response.d.ts +34 -0
- package/dist/sdk/query/search/response.js +2 -0
- package/dist/sdk/query/search/semantic.d.ts +229 -0
- package/dist/sdk/query/search/semantic.js +3 -0
- package/dist/sdk/query/search/types.d.ts +123 -0
- package/dist/sdk/query/search/types.js +2 -0
- package/dist/sdk/query/search.d.ts +13 -364
- package/dist/sdk/query/search.js +1 -2
- package/dist/sdk/runtime/actions.d.ts +4 -0
- package/dist/sdk/runtime/actions.js +2 -0
- package/dist/sdk/runtime/context.d.ts +38 -0
- package/dist/sdk/runtime/context.js +2 -0
- package/dist/sdk/runtime/schema.d.ts +4 -0
- package/dist/sdk/runtime/schema.js +2 -0
- package/dist/sdk/runtime.d.ts +90 -95
- package/dist/sdk/runtime.js +1 -1
- package/docs/ARCHITECTURE.md +68 -0
- package/docs/HISTORY_GOVERNANCE_REPAIR.md +66 -0
- package/docs/README.md +2 -0
- package/docs/VALIDATION_PORTABILITY.md +82 -0
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +4 -3
- package/marketplace.json +2 -2
- package/package.json +6 -6
- 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/extensions/guide-shell/runtime.ts +23 -17
- 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
- package/dist/cli-bundle/chunks/chunk-AACGU5IA.js +0 -3
- package/dist/cli-bundle/chunks/chunk-J7NP7QLW.js +0 -6
- package/dist/cli-bundle/chunks/chunk-KHN4NMKT.js +0 -238
- package/dist/cli-bundle/chunks/chunk-KYG2QKNY.js +0 -29
- package/dist/cli-bundle/chunks/chunk-OQS2Y6VN.js +0 -2
- package/dist/cli-bundle/chunks/chunk-QTHR3LXF.js +0 -20
- package/dist/cli-bundle/chunks/chunk-RVMDPIGD.js +0 -2
- package/dist/cli-bundle/chunks/chunk-WASMH647.js +0 -8
- package/dist/cli-bundle/chunks/register-operations-LBEMFUMM.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-MU557JAA.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-I32L3FWW.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-OOZHQFBF.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-QL4MO5M2.js +0 -30
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{$b as W,Tb as x,Ub as F,Wb as b,Zb as J,_a as B,ac as V}from"./chunk-K4VAU4HU.js";import{b as K}from"./chunk-QA4GUEKJ.js";import{Bd as C,D as O,Gl as j,Jl as P,Ni as D,O as c,Pi as G,Q as d,ec as $,ff as U,hn as L,nn as z,oa as k,zd as N}from"./chunk-KHN4NMKT.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]="4175f7f5-a689-5d05-982a-f92e21bc83e7")}catch{}})();import ce 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]="d6ceb51a-6085-5d65-aebe-31d09ea4d1d6")}catch{}})();var R=["op","id","reason","options"],Y=[...R,"ref"],q=["schema_version","mutations"],oe="[a-z][a-z0-9._-]{0,63}",H=new RegExp(`^${oe}$`,"u"),re=new RegExp(`(^|,)id=@(${oe})(?=,|$)`,"gu"),X=e=>e.slice(2).replaceAll(/-([a-z])/gu,(t,o)=>o.toUpperCase()),E=["item","linked","schedule","claim_state","children","omission_receipt","row_contract","context_intent"],ne=new Set(["created_at","updated_at","closed_at","version","format_version","path","author","collection_counts","notes_count","tests_count"]),de=new Set([...ne,"completed_at","id"]),_=new Set(["id","title","description","type","status","priority","tags","body","deadline","estimated_minutes","acceptance_criteria","definition_of_ready","order","rank","assignee",...O,"affected_version","fixed_version","component","regression","customer_impact","close_reason","completed_at","dependencies","comments","notes","learnings","files","tests","docs","reminders","events","type_options"]),Z={create:j.map(e=>e.target),update:P.map(e=>e.target),close:L.map(e=>X(e.flag)).filter(e=>e!=="reason"),release:z.map(e=>X(e.flag))};function St(e){let t={},o=e.createCompensation;if(o!==void 0){if(o!=="close"&&o!=="delete")throw new d("createCompensation must be close or delete.",c.USAGE);t.createCompensation=o}for(let r of["lockTtlSeconds","lockWaitMs"]){let n=e[r];if(n===void 0)continue;let i=typeof n=="number"||typeof n=="string"&&n.trim().length>0?Number(n):Number.NaN;if(!Number.isSafeInteger(i)||i<=0)throw new d(`${r} must be a positive safe integer.`,c.USAGE);t[r]=i}return t}function p(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function g(e,t){let o=Math.max(1,Math.min(3,Math.floor(e.length/4)+1)),r;for(let n of t){let i=k(e,n,o);i!==null&&(r===void 0||i<r.distance)&&(r={key:n,distance:i})}return r?.key}function y(e,t,o){let r=g(t,o);return new d(r===void 0?`${e} does not recognize key "${t}". Allowed keys: ${o.join(", ")}.`:`${e} does not recognize key "${t}". Did you mean "${r}"?`,c.USAGE,{code:"stdin_json_unknown_key",required:`Use documented ${e} keys only.`,why:"Strict structured input prevents silent typos from creating incomplete or unintended mutations.",nextSteps:[r===void 0?`Remove or correct "${t}".`:`Replace "${t}" with "${r}".`]})}function I(e,t){try{return JSON.parse(e)}catch(o){let r=o instanceof Error?o.message:String(o);throw new d(`${t} must be valid JSON: ${r}`,c.USAGE,{code:"stdin_json_invalid",required:`Pipe one valid JSON ${t.toLowerCase()} into stdin.`,why:"Structured mutation input must parse deterministically before any tracker write begins."})}}function ue(e,t){if(!p(e))throw new d(`Mutation ${t+1} must be an object.`,c.USAGE);for(let o of Object.keys(e))if(!R.includes(o))throw y(`mutation ${t+1}`,o,R);return e}function pe(e,t,o){if(e!==void 0){if(!p(e))throw new d(`Mutation ${o+1} options must be an object.`,c.USAGE);for(let r of Object.keys(e))if(!Z[t].includes(r))throw y(`mutation ${o+1} ${t} options`,r,Z[t]);return e}}function le(e,t){let o=ue(e,t),{op:r,id:n,reason:i}=o;if(r!=="create"&&r!=="update"&&r!=="close"&&r!=="release")throw new d(`Mutation ${t+1} op must be create, update, close, or release.`,c.USAGE);let s=pe(o.options,r,t);if(typeof n!="string"||n.trim().length===0)throw new d(`Mutation ${t+1} requires a non-empty id.`,c.USAGE);let a=n.trim();if(r==="close"){if(typeof i!="string"||i.trim().length===0)throw new d(`Mutation ${t+1} close requires a non-empty reason.`,c.USAGE);return{op:r,id:a,reason:i.trim(),...s===void 0?{}:{options:s}}}if(r==="release")return{op:r,id:a,...s===void 0?{}:{options:s}};if(!p(s))throw new d(`Mutation ${t+1} ${r} requires an options object.`,c.USAGE);return{op:r,id:a,options:s}}function ie(e){let t=I(e,"Mutation batch"),o=Array.isArray(t)?t:p(t)&&Array.isArray(t.mutations)?t.mutations:void 0;if(o===void 0||o.length===0)throw new d("Mutation batch must be a non-empty JSON array or an object with a non-empty mutations array.",c.USAGE);return o.map((r,n)=>{let i=le(r,n);return i.options!==void 0&&N(i.options),i})}function me(e,t,o){let r=ce.createHash("sha256").update(e).update("\0").update(t).digest("hex"),n=BigInt(`0x${r.slice(0,16)}`).toString(36).padStart(13,"0").slice(-12);return`${D(o)}${n}`}function Q(e,t){if(typeof e!="string"||!e.startsWith("@"))return e;let o=e.slice(1),r=t[o];if(r===void 0)throw new d(`Unknown mutation reference "${e}".`,c.USAGE);return r}function ee(e,t){if(typeof e!="string")return e;let o=e.replace(re,(r,n,i)=>{let s=t[i];if(s===void 0)throw new d(`Unknown mutation reference "@${i}".`,c.USAGE);return`${n}id=${s}`});if(/(^|,)id=@/u.test(o))throw new d(`Malformed mutation reference in dependency "${e}".`,c.USAGE);return o}function fe(e){return typeof e!="string"?[]:e.startsWith("@")?[e.slice(1)]:[...e.matchAll(re)].map(t=>t[1]).filter(t=>t!==void 0)}function ye(e){let t=new Map;for(let i of e){if(i.op!=="create"||typeof i.ref!="string")continue;let s=p(i.options)?i.options:{},a=Array.isArray(s.dep)?s.dep:s.dep===void 0?[]:[s.dep];t.set(i.ref,[s.parent,s.blockedBy,...a].flatMap(fe))}let o=new Set,r=new Set,n=i=>{if(o.has(i))throw new d(`Mutation reference cycle includes "@${i}".`,c.USAGE);if(!r.has(i)){o.add(i);for(let s of t.get(i))t.has(s)&&n(s);o.delete(i),r.add(i)}};for(let i of t.keys())n(i)}function he(e){let t=I(e,"Mutation document"),o=Array.isArray(t)?{schema_version:1,mutations:t}:t;if(!p(o))throw new d("Mutation document must be a JSON array or object.",c.USAGE);for(let r of Object.keys(o))if(!q.includes(r))throw y("mutation document",r,q);if(o.schema_version!==void 0&&o.schema_version!==1)throw new d("Mutation document schema_version must be 1.",c.USAGE);if(!Array.isArray(o.mutations)||o.mutations.length===0)throw new d("Mutation document requires a non-empty mutations array.",c.USAGE);return o.mutations.map((r,n)=>{if(!p(r))throw new d(`Mutation ${n+1} must be an object.`,c.USAGE);for(let i of Object.keys(r))if(!Y.includes(i))throw y(`mutation ${n+1}`,i,Y);return{...r}})}function we(e,t){let o=Object.create(null);for(let[r,n]of e.entries())if(n.ref!==void 0){if(n.op!=="create")throw new d(`Mutation ${r+1} ref is only valid for create operations.`,c.USAGE);if(typeof n.ref!="string"||!H.test(n.ref))throw new d(`Mutation ${r+1} ref must match ${H.source}.`,c.USAGE);if(o[n.ref]!==void 0)throw new d(`Duplicate mutation ref "${n.ref}".`,c.USAGE);o[n.ref]=typeof n.id=="string"&&n.id.trim().length>0?G(n.id,t.idPrefix):me(t.transactionId,n.ref,t.idPrefix)}return o}function bt(e,t){let o=he(e),r=we(o,t);ye(o);let n=o.map(a=>{let u={...a},f=typeof u.ref=="string"?u.ref:void 0;if(delete u.ref,f!==void 0?u.id=r[f]:u.id=Q(u.id,r),p(u.options)){let l={...u.options};for(let w of["parent","blockedBy"])l[w]!==void 0&&(l[w]=Q(l[w],r));Array.isArray(l.dep)?l.dep=l.dep.map(w=>ee(w,r)):l.dep!==void 0&&(l.dep=ee(l.dep,r)),u.options=l}return u}),i=ie(JSON.stringify(n)),s=i.filter(a=>a.op==="create").map(a=>a.id);if(new Set(s).size!==s.length)throw new d("Duplicate resolved create id in mutation document.",c.USAGE);return{schema_version:1,mutations:i,references:r}}function se(e,t){return t.filter(o=>e[o]!==void 0&&e[o]!==null).map(o=>{let r=String(e[o]);return`${o}=${/[",\n\r\\]/u.test(r)?JSON.stringify(r):r}`}).join(",")}function _e(e,t,o){if(e!==void 0){if(!Array.isArray(e)||!e.every(p))throw new d(`${o} must be an array of objects.`,c.USAGE);return e.map(r=>se(r,t))}}function Ee(e,t){return e==="tags"&&Array.isArray(t)&&t.every(o=>typeof o=="string")?JSON.stringify(t):typeof t=="number"||typeof t=="boolean"?String(t):t}function te(e,t,o=!1){let r=[["dependencies","dep",["id","kind","created_at","author","source_kind"]],["comments","comment",["text","created_at","author"]],["notes","note",["text","created_at","author"]],["learnings","learning",["text","created_at","author"]],["files","file",["path","scope","note"]],["tests","test",["command","scope","timeout_seconds"]],["docs","doc",["path","scope","note"]],["reminders","reminder",["at","text","created_at"]],["events","event",["start_at","end_at","title","location"]],["type_options","typeOption",["key","value"]]];for(let[n,i,s]of r){let a=t[n],u=_e(o&&["comments","notes","learnings"].includes(n)&&Array.isArray(a)?a.filter(f=>!p(f)||f.created_at===void 0):a,s,n);u!==void 0&&u.length>0&&(e[i]=u)}}function ge(e,t){for(let o of Object.keys(e)){if(t){if(!E.includes(o))throw y("item envelope",o,E);continue}if(!_.has(o)&&g(o,[..._])===void 0&&g(o,E)==="item")throw y("item envelope",o,E)}}function Ae(e){let t=Object.hasOwn(e,"item");ge(e,t);let o=t?e.item:e;if(!p(o))throw new d("Item document item must be an object.",c.USAGE);return{item:o,...t&&p(e.linked)?{linked:e.linked}:{}}}function Te(e,t,o,r){if(!(r==="update"?de:ne).has(t)){if(!_.has(t)){if(g(t,[..._])!==void 0)throw y("item document",t,[..._]);let s=Array.isArray(e.field)?e.field:[];s.push(se({key:t,value:typeof o=="string"?o:JSON.stringify(o)},["key","value"])),e.field=s;return}["dependencies","comments","notes","learnings","files","tests","docs","reminders","events","type_options"].includes(t)||(e[t.replaceAll(/_([a-z])/gu,(i,s)=>s.toUpperCase())]=Ee(t,o))}}function Rt(e,t,o={}){let r=I(e,"Item document");if(!p(r))throw new d("Item document must be a JSON object.",c.USAGE);let{item:n,linked:i}=Ae(r),s={};for(let[a,u]of Object.entries(n))Te(s,a,u,t);return te(s,n,t==="update"),i!==void 0&&te(s,i),{...s,...Object.fromEntries(Object.entries(o).filter(([,a])=>a!==void 0)),stdinJson:void 0}}function It(e){return ie(JSON.stringify(e))}import Se from"node:crypto";import be 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]="4b7656bd-36a9-5b97-971f-60f717e8e81f")}catch{}})();function A(e,t){let o={...e,...t};return e===void 0?o:C(e,o)}async function m(e,t){try{let r=(await B(t,{},{pmRoot:e})).item;return{id:r.id,closedAt:r.closed_at,updatedAt:r.updated_at,assignee:r.assignee,claimPrincipal:r.claim_principal}}catch(o){if(o instanceof d&&o.exitCode===c.NOT_FOUND)return;throw o}}function v(e,t){let o=e.id.replaceAll(/[^a-zA-Z0-9._-]/gu,"_"),r=Se.createHash("sha256").update($(e)).digest("hex").slice(0,12);return`${t+1}-${e.op}-${o}-${r}`}function Re(e,t){let o=e.id.replaceAll(/[^a-zA-Z0-9._-]/gu,"_");return`${t+1}-${e.op}-${o}`}function h(e,t,o){return`bulk-item-transaction ${e} ${t} ${o}`}async function T(e,t,o,r){let n=await U(be.join(e,"history",`${t}.jsonl`),t),i=h(o,r,"apply"),s=h(o,r,"compensate");for(let a=n.length-1;a>=0;a-=1){let u=n[a].message;if(u===i)return!0;if(u===s)return!1}return!1}async function M(e,t){let o=await m(e,t.id);if(o?.updatedAt===void 0)throw new d(`Bulk ${t.op} target ${t.id} does not exist or has no restorable version`,c.NOT_FOUND);return{target_updated_at:o.updatedAt}}async function S(e,t,o,r){let n=r!==null&&typeof r=="object"&&!Array.isArray(r)?r.target_updated_at:void 0;typeof n=="string"&&await m(e.pmRoot,t)!==void 0&&await V(t,n,{force:!0,author:e.author,message:h(e.transactionId,o,"compensate")},{pmRoot:e.pmRoot})}function ae(e,t,o){return{id:o,async inspect(){let r=await m(e.pmRoot,t.id);return r===void 0?{state:"pending"}:{state:"applied",result:{id:r.id,op:"create"}}},async apply(){let n=(await x(A(t.options,{author:e.author,id:t.id}),{pmRoot:e.pmRoot})).item;return{id:String(n.id),op:"create"}},async compensate(){let r=await m(e.pmRoot,t.id);if(r!==void 0){if(e.createCompensation==="delete"){await W(t.id,{force:!0,author:e.author,message:`Compensate interrupted bulk transaction ${e.transactionId}`},{pmRoot:e.pmRoot});return}r.closedAt===void 0&&await b(t.id,`Compensated: interrupted bulk transaction ${e.transactionId}`,{force:!0,author:e.author},{pmRoot:e.pmRoot})}}}}function Ie(e,t,o){return{id:o,async inspect(){let r=await m(e.pmRoot,t.id);return r===void 0?{state:"pending"}:await T(e.pmRoot,r.id,e.transactionId,o)?{state:"applied",result:{id:r.id,op:"update"}}:{state:"pending"}},async prepareCompensation(){return M(e.pmRoot,t)},async apply(){let n=(await F(t.id,A(t.options,{author:e.author,message:h(e.transactionId,o,"apply")}),{pmRoot:e.pmRoot})).item;return{id:String(n.id),op:"update"}},async compensate(r){await S(e,t.id,o,r)}}}function ve(e,t,o){return{id:o,async inspect(){let r=await m(e.pmRoot,t.id);return r===void 0?{state:"pending"}:await T(e.pmRoot,r.id,e.transactionId,o)?{state:"applied",result:{id:r.id,op:"close"}}:r.closedAt===void 0?{state:"pending"}:{state:"applied",result:{id:r.id,op:"close"}}},async prepareCompensation(){return M(e.pmRoot,t)},async apply(){let n=(await b(t.id,t.reason,A(t.options,{author:e.author,message:h(e.transactionId,o,"apply")}),{pmRoot:e.pmRoot})).item;return{id:String(n.id),op:"close"}},async compensate(r){await S(e,t.id,o,r)}}}function Me(e,t,o){return{id:o,async inspect(){let r=await m(e.pmRoot,t.id);return r===void 0?{state:"pending"}:await T(e.pmRoot,r.id,e.transactionId,o)?{state:"applied",result:{id:r.id,op:"release"}}:r.assignee!==void 0||r.claimPrincipal!==void 0?{state:"pending"}:{state:"applied",result:{id:r.id,op:"release"}}},async prepareCompensation(){return M(e.pmRoot,t)},async apply(){let n=(await J(t.id,A(t.options,{author:e.author,message:h(e.transactionId,o,"apply")}),{pmRoot:e.pmRoot})).item;return{id:String(n.id),op:"release"}},async compensate(r){await S(e,t.id,o,r)}}}function Oe(e,t,o){let r=v(t,o);switch(t.op){case"create":return ae(e,t,r);case"update":return Ie(e,t,r);case"close":return ve(e,t,r);case"release":return Me(e,t,r)}}function ke(e,t){if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`Bulk mutation ${t+1} must be an object`);if(!["create","update","close","release"].includes(e.op))throw new TypeError(`Bulk mutation ${t+1} op must be create, update, close, or release`);if(typeof e.id!="string"||e.id.trim().length===0)throw new TypeError(`Bulk mutation ${t+1} requires a non-empty id`);if(e.op==="close"&&(typeof e.reason!="string"||e.reason.trim().length===0))throw new TypeError(`Bulk close mutation ${t+1} requires a non-empty reason`)}async function $e(e){let t=[...e.mutations];if(t.length===0)throw new TypeError("Bulk item transaction requires at least one mutation");for(let[s,a]of t.entries())ke(a,s);let o=e.createCompensation??"close";if(!["close","delete"].includes(o))throw new TypeError("Bulk item transaction createCompensation must be close or delete");let r={pmRoot:e.pmRoot,author:e.author,transactionId:e.transactionId,createCompensation:o},n=await K({pmRoot:e.pmRoot,transactionId:e.transactionId,author:e.author,steps:t.map((s,a)=>Oe(r,s,a)),...e.lockTtlSeconds===void 0?{}:{lockTtlSeconds:e.lockTtlSeconds},...e.lockWaitMs===void 0?{}:{lockWaitMs:e.lockWaitMs},...e.onTransition===void 0?{}:{onTransition:e.onTransition}}),i={};for(let[s,a]of t.entries()){let u=v(a,s),f=n.results[u];i[Re(a,s)]=f}return{transactionId:n.transactionId,status:"committed",recovered:n.recovered,results:i}}function Ne(e){let t=[];return e.evidence!==void 0&&Object.keys(e.evidence).length>0&&t.push({op:"update",id:e.id,options:e.evidence}),t.push({op:"close",id:e.id,reason:e.reason,...e.closeOptions===void 0?{}:{options:e.closeOptions}},{op:"release",id:e.id,...e.releaseOptions===void 0?{}:{options:e.releaseOptions}}),t}function jt(e){return $e({pmRoot:e.pmRoot,transactionId:e.transactionId,author:e.author,mutations:Ne(e),...e.lockTtlSeconds===void 0?{}:{lockTtlSeconds:e.lockTtlSeconds},...e.lockWaitMs===void 0?{}:{lockWaitMs:e.lockWaitMs},...e.onTransition===void 0?{}:{onTransition:e.onTransition}})}var Pt={buildCreateStep:ae,bulkHistoryMarker:h,compensateByRestore:S,deriveStepId:v,isUpdateMarkerApplied:T,readItemSnapshot:m};export{St as a,ie as b,bt as c,Rt as d,It as e,$e as f,Ne as g,jt as h,Pt as i};
|
|
2
|
-
//# sourceMappingURL=chunk-RVMDPIGD.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{Va as pe,ca as le,f as ce}from"./chunk-K4VAU4HU.js";import{Aa as fe,h as R}from"./chunk-QA4GUEKJ.js";import{Ac as oe,C,Db as v,Eb as D,Fb as H,Gb as L,Gc as ie,Hb as K,Rb as x,Sb as q,X as b,Y as B,dc as U,hc as V,hd as se,ic as z,jc as W,kc as G,lc as Y,mc as X,md as ae,nc as J,nd as de,oc as Q,od as me,pc as Z,qc as ee,rc as re,sc as te,zc as ne}from"./chunk-KHN4NMKT.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new r.Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="c06f3fb3-4b1f-5fdb-a9ce-bce8f88704aa")}catch{}})();function Ir(r){return r}function Mr(r){return r}function Ce(r,e){for(let t of e.commands??[])r.registerCommand(t);for(let[t,n]of Object.entries(e.commandOverrides??{}))r.registerCommand(t,n);for(let[t,n]of Object.entries(e.flags??{}))r.registerFlags(t,n);for(let[t,n]of Object.entries(e.parsers??{}))r.registerParser(t,n);for(let[t,n]of Object.entries(e.renderers??{}))if(typeof n=="function")r.registerRenderer(t,n);else{let{run:s,...o}=n;r.registerRenderer(t,s,o)}for(let[t,n]of Object.entries(e.services??{}))r.registerService(t,n)}function Re(r,e){for(let o of e.preflights??[])r.registerPreflight(o);let t=e.itemTypes??[];t.length>0&&r.registerItemTypes(t);let n=e.itemFields??[];n.length>0&&r.registerItemFields(n);let s=e.relationshipKinds??[];s.length>0&&r.registerRelationshipKinds(s);for(let o of e.migrations??[])r.registerMigration(o);for(let o of e.profiles??[])r.registerProfile(o)}function Ne(r,e){for(let t of e.searchProviders??[])r.registerSearchProvider(t);for(let t of e.vectorStoreAdapters??[])r.registerVectorStoreAdapter(t);for(let t of e.assuranceProviders??[])r.registerAssuranceMeasurementProvider(t);for(let t of e.importers??[])r.registerImporter(t.name,t.importer,t.options);for(let t of e.exporters??[])r.registerExporter(t.name,t.exporter,t.options)}function Se(r,e){for(let t of e.beforeCommand??[])r.hooks.beforeCommand(t);for(let t of e.beforeMutation??[])r.hooks.beforeMutation(t);for(let t of e.afterCommand??[])r.hooks.afterCommand(t);for(let t of e.onWrite??[])r.hooks.onWrite(t);for(let t of e.onRead??[])r.hooks.onRead(t);for(let t of e.onIndex??[])r.hooks.onIndex(t)}function Oe(r){let t={activate:async n=>{Ce(n,r),Re(n,r),Ne(n,r),Se(n,r.hooks??{}),await r.activate?.(n)}};return r.manifest&&(t.manifest=r.manifest),r.deactivate&&(t.deactivate=r.deactivate),t}function h(r){let e=r.flatMap(t=>t??[]);return e.length>0?e:void 0}function _(r){let e=Object.assign({},...r.map(t=>t??{}));return Object.keys(e).length>0?e:void 0}function Ae(r){let e={};for(let t of r)for(let[n,s]of Object.entries(t??{}))e[n]=[...e[n]??[],...s];return Object.keys(e).length>0?e:void 0}var Fe=["beforeCommand","beforeMutation","afterCommand","onWrite","onRead","onIndex"];function Pe(r,e,t){let n=e.map(o=>o?.[t]),s=h(n);if(s!==void 0){let o=r;o[t]=s}}function Te(r){let e={};for(let t of Fe)Pe(e,r,t);return Object.keys(e).length>0?e:void 0}function jr(...r){let e={},t=(i,a)=>{a!==void 0&&(e[i]=a)};t("commands",h(r.map(i=>i.commands))),t("commandOverrides",_(r.map(i=>i.commandOverrides))),t("flags",Ae(r.map(i=>i.flags))),t("parsers",_(r.map(i=>i.parsers))),t("renderers",_(r.map(i=>i.renderers))),t("services",_(r.map(i=>i.services))),t("preflights",h(r.map(i=>i.preflights))),t("itemTypes",h(r.map(i=>i.itemTypes))),t("itemFields",h(r.map(i=>i.itemFields))),t("relationshipKinds",h(r.map(i=>i.relationshipKinds))),t("migrations",h(r.map(i=>i.migrations))),t("profiles",h(r.map(i=>i.profiles))),t("searchProviders",h(r.map(i=>i.searchProviders))),t("vectorStoreAdapters",h(r.map(i=>i.vectorStoreAdapters))),t("assuranceProviders",h(r.map(i=>i.assuranceProviders))),t("importers",h(r.map(i=>i.importers))),t("exporters",h(r.map(i=>i.exporters))),t("hooks",Te(r.map(i=>i.hooks)));let n;for(let i of r)i.manifest&&(n=i.manifest);t("manifest",n);let s=r.some(i=>i.activate);t("activate",s?async i=>{for(let a of r)a.activate&&await a.activate(i)}:void 0);let o=r.some(i=>i.deactivate);return t("deactivate",o?async()=>{let i=[];for(let a of[...r].reverse())if(a.deactivate)try{await a.deactivate()}catch(d){i.push(d)}if(i.length>0)throw i.length>1?new AggregateError(i,"Multiple extension blueprint deactivate hooks failed."):i[0]}:void 0),e}var Ie=[["commands","commands"],["commandOverrides","commands"],["flags","schema"],["itemTypes","schema"],["itemFields","schema"],["relationshipKinds","schema"],["migrations","schema"],["profiles","schema"],["parsers","parser"],["renderers","renderers"],["services","services"],["preflights","preflight"],["searchProviders","search"],["vectorStoreAdapters","search"],["assuranceProviders","services"],["importers","importers"],["exporters","importers"]];function $(r){return r?Array.isArray(r)?r.length>0:Object.keys(r).length>0:!1}function N(r){let e=new Set;for(let[s,o]of Ie)$(r[s])&&e.add(o);(r.commands??[]).filter(w).some(s=>s.flags!==void 0)&&e.add("schema");let t=[...r.importers??[],...r.exporters??[]].filter(w);t.some(s=>s?.options?.flags!==void 0)&&e.add("schema"),t.some(s=>typeof s=="object")&&e.add("commands");let n=r.hooks??{};return[n.beforeCommand,n.beforeMutation,n.afterCommand,n.onWrite,n.onRead,n.onIndex].some($)&&e.add("hooks"),[...e].sort((s,o)=>s.localeCompare(o))}var Me=[["beforeCommand","before_command"],["beforeMutation","before_mutation"],["afterCommand","after_command"],["onWrite","on_write"],["onRead","on_read"],["onIndex","on_index"]];function l(r){return[...new Set(r)].sort((e,t)=>e.localeCompare(t))}function w(r){return r!=null}function S(r){return v(`${r.name} import`)}function O(r){return v(`${r.name} export`)}function je(r,e,t){return[...r.map(n=>v(n.name)),...e.filter(n=>n.options!==void 0).map(S),...t.filter(n=>n.options!==void 0).map(O)]}function Be(r,e,t,n){return[...Object.keys(r.flags??{}).map(s=>v(s)),...e.filter(s=>s.flags!==void 0).map(s=>v(s.name)),...t.filter(s=>s.options?.flags!==void 0).map(S),...n.filter(s=>s.options?.flags!==void 0).map(O)]}function De(r){return Me.filter(([e])=>(r[e]?.length??0)>0).map(([,e])=>e)}function He(r){let e=Object.entries(r??{}).filter(([,t])=>typeof t!="function"&&((t.commands?.length??0)>0||t.resultDiscriminator!==void 0)).map(([t,n])=>{let s=n;return{format:t,commands:l((s.commands??[]).map(o=>v(o))),result_discriminator:s.resultDiscriminator!==void 0}}).sort((t,n)=>t.format.localeCompare(n.format));return e.length>0?{renderer_ownership:e}:{}}function Le(r){return!r||r.length===0?{}:{assurance_providers:l(r.map(e=>e.id))}}function Ke(r,e,t){return{item_types:l((r.itemTypes??[]).map(n=>n.name)),item_fields:l((r.itemFields??[]).map(n=>n.name)),...(r.relationshipKinds?.length??0)>0?{relationship_kinds:l(r.relationshipKinds.map(n=>n.kind))}:{},migrations:l((r.migrations??[]).flatMap(n=>typeof n.id=="string"?[n.id]:[])),profiles:l((r.profiles??[]).map(n=>n.name)),importers:l(e.map(n=>v(n.name))),exporters:l(t.map(n=>v(n.name))),search_providers:l((r.searchProviders??[]).map(n=>n.name)),vector_store_adapters:l((r.vectorStoreAdapters??[]).map(n=>n.name)),...Le(r.assuranceProviders),parser_overrides:l(Object.keys(r.parsers??{}).map(n=>v(n))),service_overrides:l(Object.keys(r.services??{}).map(n=>String(n).trim().toLowerCase())),renderer_overrides:l(Object.keys(r.renderers??{}).map(n=>String(n).trim().toLowerCase())),...He(r.renderers),preflight_overrides:(r.preflights??[]).length,preflight_ownership:(r.preflights??[]).map(n=>({commands:[...n.commands??[]]}))}}function qe(r){let e=(r.commands??[]).filter(w),t=(r.importers??[]).filter(w),n=(r.exporters??[]).filter(w),s=t.map(S),o=n.map(O),i=je(e,t,n),a=Be(r,e,t,n),d=r.hooks??{},c=Ke(r,t,n);return{capabilities:N(r),commands:l(i),command_overrides:l(Object.keys(r.commandOverrides??{}).map(E=>v(E))),command_handlers:l([...i,...s,...o]),hooks:De(d),flag_commands:l(a),...c}}var Ue=["commands","commandOverrides","flags","parsers","renderers","services","preflights","itemTypes","itemFields","relationshipKinds","migrations","profiles","searchProviders","vectorStoreAdapters","assuranceProviders","importers","exporters"];function Ve(r){return(r.itemFields??[]).filter(e=>typeof e?.name=="string"&&se.has(e.name.trim())).map(e=>({code:"reserved_item_field",severity:"error",message:`Item field "${e.name}" collides with reserved item metadata; rename it with an extension-specific prefix before publishing.`,field:e.name}))}function ze(r){return[...Object.values(r.flags??{}).flat(),...(r.commands??[]).flatMap(t=>t.flags??[]),...(r.importers??[]).flatMap(t=>t.options?.flags??[]),...(r.exporters??[]).flatMap(t=>t.options?.flags??[])].flatMap(t=>{if(typeof t?.long!="string"&&typeof t?.short!="string")return[];let n=D(t.long,t.short);if(n===null)return[];let{token:s,failure:o}=n;return[{code:o,severity:"error",message:`Flag "${s}" ${H(s,o)}.`,field:s}]})}function ge(r){let e=new Set;for(let t of r){let n=q(t)??x(t);n!==null&&e.add(n)}return[...e].sort((t,n)=>t.localeCompare(n))}function We(r,e){let t=[];if(e===null)return r.length>0&&t.push({code:"manifest_capabilities_absent",severity:"warning",message:`Blueprint exercises ${r.length===1?"capability":"capabilities"} [${r.join(", ")}] but declares none; set capabilities to deriveExtensionCapabilities(blueprint) so the manifest grant matches.`}),t;let n=new Set(e),s=new Set(r);for(let o of r)n.has(o)||t.push({code:"capability_undeclared",severity:"error",message:`Blueprint exercises capability "${o}" but it is absent from the declared capabilities; activation throws extension_capability_missing \u2014 add "${o}" to the manifest capabilities.`,capability:o});for(let o of e)s.has(o)||t.push({code:"capability_unused",severity:"warning",message:`Capability "${o}" 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:o});return t}function Ge(r){let e=[],t=new Map;for(let s of r.commands??[]){let o=v(s.name);t.set(o,(t.get(o)??0)+1)}for(let[s,o]of t)o>1&&e.push({code:"duplicate_command",severity:"warning",message:`Command "${s}" is declared ${o} times in commands; the later registration shadows the earlier one at dispatch.`,command:s});let n=new Set(Object.keys(r.commandOverrides??{}).map(s=>v(s)));for(let s of t.keys())n.has(s)&&e.push({code:"command_override_conflict",severity:"warning",message:`Command "${s}" is declared both as a new command definition and as a command override; register one or the other.`,command:s});return e}function Ye(r){let e=[];for(let t of Ue)t in r&&!$(r[t])&&e.push({code:"empty_surface",severity:"warning",message:`Blueprint field "${t}" is present but empty; remove it or populate it.`,field:t});if("hooks"in r){let t=r.hooks??{};[t.beforeCommand,t.beforeMutation,t.afterCommand,t.onWrite,t.onRead,t.onIndex].some($)||e.push({code:"empty_surface",severity:"warning",message:'Blueprint field "hooks" is present but registers no lifecycle hooks; remove it or populate it.',field:"hooks"})}return e}function k(r,e={}){let t=N(r),n=e.declaredCapabilities??r.manifest?.capabilities,s=Array.isArray(n)?ge(n):null,o=[...We(t,s),...Ge(r),...ze(r),...Ve(r),...Ye(r)];return{ok:o.every(i=>i.severity!=="error"),findings:o,used:t,declared:s}}function ve(r,e){let{additionalCapabilities:t,...n}=e,s=Array.isArray(t)?ge(t):[],o=[...new Set([...N(r),...s])].sort((i,a)=>i.localeCompare(a));return{...n,capabilities:o}}function Br(r,e){let t=ve(r,e);return{module:Oe({...r,manifest:t}),manifest:t}}function ue(r,e){if(r.status==="absent"||r.status==="ok")return null;let t=`${r.kind}_${r.status}`,n="";switch(t){case"pm_min_version_invalid":n=`pm_min_version "${r.required}" is not a valid version; the extension is treated as incompatible and the loader skips it.`;break;case"pm_min_version_unchecked":n=`pm_min_version "${r.required}" could not be compared against pm ${e}; compatibility is unverified.`;break;case"pm_min_version_unmet":n=`Requires pm >= ${r.required} but the target is pm ${e}; the loader skips the extension.`;break;case"pm_max_version_invalid":n=`pm_max_version "${r.required}" is not a valid inclusive upper bound (version ranges are not allowed); the extension is treated as incompatible and the loader skips it.`;break;case"pm_max_version_unchecked":n=`pm_max_version "${r.required}" could not be compared against pm ${e}; compatibility is unverified.`;break;case"pm_max_version_exceeded":n=`Allows pm <= ${r.required} but the target is pm ${e}; the loader skips the extension.`;break;case"pm_max_version_exceeded_warn":n=`Target pm ${e} is newer than pm_max_version ${r.required}, but the "warn" exceeded mode lets it load with a warning.`;break}return{code:t,severity:r.allowed?"warning":"error",constraint:r.kind,required:r.required,current:e,message:n}}function A(r,e){let t=L(r.pm_min_version,e.pmVersion),n=K(r.pm_max_version,e.pmVersion,e.pmMaxVersionExceededMode??"block"),o=U(r).findings.map(c=>({code:c.code,severity:"warning",constraint:"manifest",required:c.code==="manifest_unknown_key"?c.path:"pm_min_version",current:e.pmVersion,path:c.path,...c.suggested_key?{suggested_key:c.suggested_key}:{},message:c.message})),i=[],a=ue(t,e.pmVersion);a!==null&&i.push(a);let d=ue(n,e.pmVersion);return d!==null&&i.push(d),{compatible:t.allowed&&n.allowed,findings:[...o,...i],pmVersion:e.pmVersion}}var Xe=new Set(["capability_undeclared","capability_unused","manifest_capabilities_absent"]);function he(r,e={}){let t=k(r,{declaredCapabilities:e.declaredCapabilities}),n=e.identity?ve(r,e.identity):null,s=e.target?A(n??r.manifest??{},e.target):null,a=[...(n!==null&&e.declaredCapabilities===void 0?t.findings.filter(d=>!Xe.has(d.code)):t.findings).map(d=>({source:"blueprint",severity:d.severity,code:d.code,message:d.message})),...(s?.findings??[]).map(d=>({source:"compatibility",severity:d.severity,code:d.code,message:d.message}))];return{ok:a.every(d=>d.severity!=="error"),capabilities:t.used,blueprint:t,manifest:n,compatibility:s,findings:a}}(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new r.Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="fa9e95e5-7782-509d-96af-093a47daaed7")}catch{}})();function g(r,e){return r.name??e??""}var Je={before_command:"beforeCommand",before_mutation:"beforeMutation",after_command:"afterCommand",on_read:"onRead",on_write:"onWrite",on_index:"onIndex"},F={before_command:"beforeCommand",after_command:"afterCommand",on_read:"onRead",on_write:"onWrite",on_index:"onIndex"};function p(r){return r.trim().toLowerCase()}function ye(r){return p(r).replaceAll("-","_")}function u(r){return r?` from extension "${r}"`:""}function f(r){return[...new Set(r)].sort((e,t)=>e.localeCompare(t))}function y(r){if(typeof r!="string")throw new Error('A command name string is required. Pass it via the options object, e.g. runRegisteredCommandForTest(activation, { command: "my command" }) \u2014 positional command arguments are not supported.');return r.trim().toLowerCase().split(/\s+/).filter(e=>e.length>0).join(" ")}function m(r){return r.length>0?r.join(", "):"(none)"}function be(r,e,t){let n=new Set(r??[]),s=f(e.filter(o=>!n.has(o)));if(s.length>0)throw new Error(`Expected package manifest ${t} to include ${s.join(", ")}; available: ${m(f(r??[]))}`)}function we(r){let e=new Set;for(let t of r)typeof t.long=="string"&&t.long.trim().length>0&&e.add(t.long.trim()),typeof t.short=="string"&&t.short.trim().length>0&&e.add(t.short.trim());return e}function P(r){let e=b(r);if(!e)return{};let t=b(e.manifest);if(t)return t;let n=b(e.default),s=b(n?.manifest);return s||(n&&typeof e.default!="function"&&("name"in n||"capabilities"in n)?n:typeof r!="function"&&("name"in e||"capabilities"in e)?e:{})}function T(r,e){return e??(typeof r.name=="string"&&r.name.trim().length>0?r.name.trim():"test-extension")}function Ee(r,e){return Array.isArray(e.capabilities)?[...e.capabilities]:Array.isArray(r.capabilities)?r.capabilities.filter(t=>typeof t=="string"):[]}function xe(r,e,t){return{disabled_by_flag:!1,roots:{global:"",project:""},configured_enabled:[],configured_disabled:[],discovered:[],effective:[],warnings:[],policy:t.policy,failed:[],loaded:[{layer:t.layer,directory:"",manifest_path:"",name:t.name,version:typeof e.version=="string"?e.version:"0.0.0",entry:typeof e.entry=="string"?e.entry:"./index.js",priority:typeof e.priority=="number"?e.priority:0,entry_path:"",capabilities:t.capabilities,manifest_version:typeof e.manifest_version=="number"?e.manifest_version:void 0,pm_min_version:typeof e.pm_min_version=="string"?e.pm_min_version:void 0,pm_max_version:typeof e.pm_max_version=="string"?e.pm_max_version:void 0,engines:e.engines,trusted:e.trusted,provenance:e.provenance,sandbox_profile:e.sandbox_profile,permissions:e.permissions,activation:e.activation,module:r}]}}async function Qe(r,e={}){let t=P(r);return oe(xe(r,t,{name:T(t,e.name),layer:e.layer??"project",capabilities:Ee(t,e),policy:e.policy??C()}))}async function Ze(r,e={}){let t=P(r);return ne(xe(r,t,{name:T(t,e.name),layer:e.layer??"project",capabilities:Ee(t,{}),policy:C()}),e.activation,e.deactivateTimeoutMs===void 0?{}:{deactivate_timeout_ms:e.deactivateTimeoutMs})}async function I(r,e){let t=y(e.command);if(t.length===0)throw new Error("Expected command name must be a non-empty string");if(!r.handlers.some(a=>a.command===t)){let a=f(r.handlers.map(d=>d.command));throw new Error(`Expected a registered command handler for "${t}" to invoke. Available command handlers: ${m(a)}`)}if(e.sdk!==void 0&&e.sdkFactory!==void 0)throw new TypeError("runRegisteredCommandForTest accepts sdk or sdkFactory, not both");let s=e.pmRoot??"",o={json:!0,quiet:!0,noPager:!0,...e.global},i=e.sdk??e.sdkFactory?.({pmRoot:s,global:o})??(s.length>0?ce(s,new pe({pmRoot:s})):void 0);return J(r,{command:t,args:e.args?[...e.args]:[],options:e.options?{...e.options}:{},global:o,pm_root:s,...i===void 0?{}:{sdk:i}})}async function er(r,e){if((r.beforeMutation?.length??0)===0)throw new Error("Expected a registered before_mutation hook to invoke");await z(r,e.context)}async function rr(r,e){let t=e.kind;if(t==="before_mutation")throw new Error("Invoke before_mutation hooks with runRegisteredMutationGuardForTest so denials and failures retain fail-closed semantics.");if((r[F[t]]?.length??0)===0){let n=f(Object.keys(F).filter(s=>(r[F[s]]?.length??0)>0));throw new Error(`Expected a registered "${t}" hook to invoke. Hook kinds with registrations: ${m(n)}`)}switch(e.kind){case"before_command":return V(r,e.context);case"after_command":return W(r,e.context);case"on_read":return Y(r,e.context);case"on_write":return G(r,e.context);case"on_index":return X(r,e.context)}}async function tr(r,e){let t=y(e.command);if(!r.overrides.some(n=>n.command===t))throw new Error(`Expected a registered parser override for command "${t}" to invoke. Available parser override commands: ${m(f(r.overrides.map(n=>n.command)))}`);return Q(r,e)}async function nr(r,e){if(r.overrides.length===0)throw new Error("Expected a registered preflight override to invoke, but none are registered.");return Z(r,e)}async function or(r,e){let t=y(e.command);if(!r.overrides.some(n=>n.command===t))throw new Error(`Expected a registered command override for command "${t}" to invoke. Available command override commands: ${m(f(r.overrides.map(n=>n.command)))}`);return re(r,e)}async function ir(r,e){if(!r.overrides.some(t=>t.format===e.format))throw new Error(`Expected a registered renderer override for format "${e.format}" to invoke. Available renderer override formats: ${m(f(r.overrides.map(t=>t.format)))}`);return te(r,e)}async function sr(r,e){if(!r.overrides.some(t=>t.service===e.service))throw new Error(`Expected a registered service override for service "${e.service}" to invoke. Available service override services: ${m(f(r.overrides.map(t=>t.service)))}`);return ee(r,e)}var ar={query:["query"],embed:["embed"],embedBatch:["embedBatch","embed_batch"],queryExpansion:["queryExpansion","query_expansion"],rerank:["rerank"]};async function dr(r,e){let t=ae(r,e.provider);if(!t){let o=f(r.search_providers.map(i=>i.definition.name));throw new Error(`Expected a registered search provider "${e.provider}" to invoke. Available search providers: ${m(o)}`)}let n=t.runtime_definition,s=ar[e.operation].map(o=>n[o]).find(o=>typeof o=="function");if(typeof s!="function")throw new Error(`Registered search provider "${e.provider}" does not implement the "${e.operation}" operation.`);return await s(e.context)}async function mr(r,e){let t=de(r,e.adapter);if(!t){let s=f(r.vector_store_adapters.map(o=>o.definition.name));throw new Error(`Expected a registered vector store adapter "${e.adapter}" to invoke. Available vector store adapters: ${m(s)}`)}let n=t.runtime_definition[e.operation];if(typeof n!="function")throw new Error(`Registered vector store adapter "${e.adapter}" does not implement the "${e.operation}" operation.`);return await n(e.context)}async function cr(r,e){let t=ke(r,{migration:e.migration,extensionName:e.extensionName}),n=me(t).run;if(typeof n!="function")throw new Error(`Registered migration "${e.migration}" does not implement a run function to invoke.`);let s=t.definition.status,o={id:t.definition.id,command:"migration",layer:t.layer,extension:t.name,pm_root:e.pmRoot??"",status:(typeof s=="string"?s.trim().toLowerCase():"")||"pending"};return await n(o)}async function fr(r,e){let t=_e(r.registrations,{importer:e.importer,extensionName:e.extensionName});return I(r.commands,{command:`${t.importer} import`,args:e.args,options:e.options,global:e.global,pmRoot:e.pmRoot})}async function lr(r,e){let t=$e(r.registrations,{exporter:e.exporter,extensionName:e.extensionName});return I(r.commands,{command:`${t.exporter} export`,args:e.args,options:e.options,global:e.global,pmRoot:e.pmRoot})}function Qr(r,e={}){let t=e.deactivated??1;if(r.deactivated!==t)throw new Error(`Expected ${t} extension${t===1?"":"s"} to deactivate cleanly, but ${r.deactivated} did.`);let n=e.failed??0;if(r.failed.length!==n){let s=r.failed.map(o=>`${o.layer}:${o.name} (${o.error})`).join(", ");throw new Error(`Expected ${n} teardown failure${n===1?"":"s"}, but observed ${r.failed.length}${s.length>0?`: ${s}`:""}.`)}return r}function Zr(r,e){if(e.packageName!==void 0&&r.package_name!==e.packageName)throw new Error(`Expected package manifest package_name to be "${e.packageName}"; received "${r.package_name??"(none)"}"`);if(e.aliases!==void 0&&be(r.aliases,e.aliases,"aliases"),e.resources!==void 0)for(let[t,n]of Object.entries(e.resources))be(r.resources[t],n,`pm.${t}`);return r}function pr(r,e){let t=y(g(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.commands.filter(i=>i.command===t),s=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!s){let i=r.commands.map(d=>d.command).sort((d,c)=>d.localeCompare(c)),a=e.extensionName?` from extension "${e.extensionName}"`:"";throw new Error(`Expected extension command "${t}"${a} to be registered. Available commands: ${m(i)}`)}if(e.action!==void 0&&s.action!==e.action)throw new Error(`Expected extension command "${t}" action "${e.action}", received "${s.action}"`);if(e.arguments!==void 0){let i=(s.arguments??[]).map(d=>d.name),a=e.arguments.filter(d=>!i.includes(d));if(a.length>0)throw new Error(`Expected extension command "${t}" arguments ${m(e.arguments)}; missing ${m(a)}; available ${m(i)}`)}let o=r.flags.filter(i=>i.target_command===t&&(e.extensionName===void 0||i.name===e.extensionName)).flatMap(i=>i.flags);if(e.flags!==void 0){let i=we(o),a=e.flags.filter(d=>!i.has(d));if(a.length>0)throw new Error(`Expected extension command "${t}" flags ${m(e.flags)}; missing ${m(a)}; available ${m([...i].sort((d,c)=>d.localeCompare(c)))}`)}return{command:s,flags:o}}function ur(r,e){let t=y(g(e,e.targetCommand));if(t.length===0)throw new Error("Expected target command name must be a non-empty string");let n=r.flags.filter(o=>o.target_command===t),s;if(e.extensionName)s=n.find(o=>o.name===e.extensionName);else if(n.length===1)s=n[0];else if(n.length>1){let o=f(n.map(i=>i.name));throw new Error(`Expected flags for target command "${t}" matched multiple extensions: ${m(o)}. Specify extensionName to choose one registration.`)}if(!s){let o=f(r.flags.map(a=>a.target_command)),i=f(n.map(a=>a.name));throw new Error(`Expected flags for target command "${t}"${u(e.extensionName)} to be registered. Available flag target commands: ${m(o)}; matching extensions: ${m(i)}`)}if(e.flags!==void 0){let o=we(s.flags),i=e.flags.filter(a=>!o.has(a));if(i.length>0)throw new Error(`Expected flags for target command "${t}" to include ${m(e.flags)}; missing ${m(i)}; available ${m([...o].sort((a,d)=>a.localeCompare(d)))}`)}return s}function gr(r,e){let t=Je[e.kind],n=r[t]??[],s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(n.map(i=>i.name));throw new Error(`Expected a "${e.kind}" hook${u(e.extensionName)} to be registered. Available "${e.kind}" hooks: ${m(o)}`)}return s}function vr(r,e){let t=p(g(e,e.provider));if(t.length===0)throw new Error("Expected search provider name must be a non-empty string");let n=r.search_providers.filter(o=>p(o.definition.name)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.search_providers.map(i=>i.definition.name));throw new Error(`Expected search provider "${t}"${u(e.extensionName)} to be registered. Available search providers: ${m(o)}`)}return s}function hr(r,e){let t=p(g(e,e.adapter));if(t.length===0)throw new Error("Expected vector store adapter name must be a non-empty string");let n=r.vector_store_adapters.filter(o=>p(o.definition.name)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.vector_store_adapters.map(i=>i.definition.name));throw new Error(`Expected vector store adapter "${t}"${u(e.extensionName)} to be registered. Available vector store adapters: ${m(o)}`)}return s}function _e(r,e){let t=p(g(e,e.importer));if(t.length===0)throw new Error("Expected importer name must be a non-empty string");let n=r.importers.filter(o=>p(o.importer)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.importers.map(i=>i.importer));throw new Error(`Expected importer "${t}"${u(e.extensionName)} to be registered. Available importers: ${m(o)}`)}return s}function $e(r,e){let t=p(g(e,e.exporter));if(t.length===0)throw new Error("Expected exporter name must be a non-empty string");let n=r.exporters.filter(o=>p(o.exporter)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.exporters.map(i=>i.exporter));throw new Error(`Expected exporter "${t}"${u(e.extensionName)} to be registered. Available exporters: ${m(o)}`)}return s}function yr(r,e){let t=p(g(e,e.field));if(t.length===0)throw new Error("Expected item field name must be a non-empty string");let s=r.item_fields.filter(o=>e.extensionName===void 0||o.name===e.extensionName).map(o=>({registration:o,field:o.fields.find(i=>p(i.name)===t)})).filter(o=>o.field!==void 0).find(o=>e.type===void 0||o.field.type===e.type);if(!s){let o=f(r.item_fields.flatMap(i=>i.fields.map(a=>`${a.name}:${a.type}`)));throw new Error(`Expected item field "${t}"${u(e.extensionName)} to be registered. Available item fields: ${m(o)}`)}return s}function br(r,e){let t=p(g(e,e.itemType));if(t.length===0)throw new Error("Expected item type name must be a non-empty string");let s=r.item_types.filter(o=>e.extensionName===void 0||o.name===e.extensionName).map(o=>({registration:o,itemType:o.types.find(i=>p(i.name)===t)})).filter(o=>o.itemType!==void 0).find(o=>e.folder===void 0||o.itemType.folder===e.folder);if(!s){let o=f(r.item_types.flatMap(i=>i.types.map(a=>`${a.name}:${a.folder}`)));throw new Error(`Expected item type "${t}"${u(e.extensionName)} to be registered. Available item types: ${m(o)}`)}return s}function wr(r,e){let t=ye(g(e,e.profile));if(t.length===0)throw new Error("Expected profile name must be a non-empty string");let n=r.profiles.filter(s=>e.extensionName===void 0||s.name===e.extensionName).find(s=>ye(s.profile.name)===t);if(!n){let s=f(r.profiles.map(o=>o.profile.name));throw new Error(`Expected profile "${t}"${u(e.extensionName)} to be registered. Available profiles: ${m(s)}`)}return{registration:n,profile:n.profile}}function Er(r,e){let t=y(g(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.overrides.filter(o=>o.command===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.overrides.map(i=>i.command));throw new Error(`Expected command override "${t}"${u(e.extensionName)} to be registered. Available command overrides: ${m(o)}`)}return s}function xr(r,e){let t=y(g(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.overrides.filter(o=>o.command===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.overrides.map(i=>i.command));throw new Error(`Expected parser override "${t}"${u(e.extensionName)} to be registered. Available parser overrides: ${m(o)}`)}return s}function _r(r,e={}){let t=e.extensionName?r.overrides.find(n=>n.name===e.extensionName):r.overrides[0];if(!t){let n=f(r.overrides.map(s=>s.name));throw new Error(`Expected a preflight override${u(e.extensionName)} to be registered. Available preflight overrides: ${m(n)}`)}return t}function $r(r,e){let t=p(g(e,e.format));if(t.length===0)throw new Error("Expected renderer format must be a non-empty string");let n=r.overrides.filter(o=>o.format===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.overrides.map(i=>i.format));throw new Error(`Expected renderer override "${t}"${u(e.extensionName)} to be registered. Available renderer overrides: ${m(o)}`)}return s}function kr(r,e){let t=p(g(e,e.service));if(t.length===0)throw new Error("Expected service name must be a non-empty string");let n=r.overrides.filter(o=>p(o.service)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.overrides.map(i=>i.service));throw new Error(`Expected service override "${t}"${u(e.extensionName)} to be registered. Available service overrides: ${m(o)}`)}return s}function ke(r,e){let t=p(g(e,e.migration));if(t.length===0)throw new Error("Expected migration id must be a non-empty string");let n=r.migrations.filter(a=>(e.extensionName===void 0||a.name===e.extensionName)&&typeof a.definition.id=="string"&&p(a.definition.id)===t),s=n.find(a=>e.mandatory===void 0||(a.definition.mandatory??!1)===e.mandatory);if(s)return s;let o=n[0];if(o!==void 0)throw new Error(`Expected migration "${t}"${u(e.extensionName)} to have mandatory=${e.mandatory}, but it is mandatory=${o.definition.mandatory??!1}.`);let i=f(r.migrations.map(a=>`${typeof a.definition.id=="string"&&a.definition.id.trim().length>0?a.definition.id.trim():"(unnamed)"}:${a.definition.mandatory===!0}`));throw new Error(`Expected migration "${t}"${u(e.extensionName)} to be registered. Available migrations: ${m(i)}`)}function Cr(r,e){let t=(d,c)=>{let E=new Set;for(let M of d){let j=x(M);if(j===null)throw new Error(`Expected ${c} capability "${M}" to be a known extension capability. Use canonical capability names (see manifest.capabilities).`);E.add(j)}return E},n=[...t(e.declared,"declared")].sort((d,c)=>d.localeCompare(c)),s=t(e.allowUnused??[],"allowUnused"),o=ie(r,{extensionName:e.extensionName}),i=new Set(o),a=n.filter(d=>!i.has(d)&&!s.has(d));if(a.length>0){let d=u(e.extensionName);throw new Error(`Expected every declared capability${d} to be exercised, but [${a.join(", ")}] ${a.length===1?"is":"are"} declared yet never registered against. Remove ${a.length===1?"it":"them"} from manifest.capabilities for least privilege, or pass allowUnused for capabilities registered only behind a runtime flag.`)}return{declared:n,used:o,unused:a}}function et(r,e={}){let t=k(r,e);if(!t.ok){let n=t.findings.filter(s=>s.severity==="error");throw new Error(`Extension blueprint failed preflight with ${n.length} ${n.length===1?"error":"errors"}:
|
|
2
|
-
`+n.map(s=>` - [${s.code}] ${s.message}`).join(`
|
|
3
|
-
`))}return t}function rt(r,e={}){let t=le(r),n=t.findings.filter(s=>s.severity==="error"||e.strict===!0&&s.severity==="warning");if(n.length>0)throw new Error(`Project profile "${t.profile}" failed lint with ${n.length} ${n.length===1?"issue":"issues"}:
|
|
4
|
-
`+n.map(s=>` - ${s.severity} [${s.code}] ${s.message}`).join(`
|
|
5
|
-
`));return t}function tt(r,e){let t=Array.isArray(r.capabilities)?r.capabilities:[],n=k(e,{declaredCapabilities:t}),s=n.declared,o=new Set(s),i=new Set(n.used),a=n.used.filter(c=>!o.has(c)),d=s.filter(c=>!i.has(c));if(a.length>0||d.length>0){let c=[];throw a.length>0&&c.push(`missing [${a.join(", ")}] (the blueprint registers ${a.length===1?"a surface":"surfaces"} requiring ${a.length===1?"it":"them"}; activation throws extension_capability_missing)`),d.length>0&&c.push(`unused [${d.join(", ")}] (declared but no surface exercises ${d.length===1?"it":"them"}; drop for least privilege)`),new Error(`Manifest capabilities do not match the blueprint: ${c.join("; ")}. Set capabilities to synthesizeExtensionManifest(blueprint, identity).capabilities to stay in sync.`)}return{used:n.used,declared:s,missing:a,unused:d,findings:n.findings}}function nt(r,e){let t=A(r,e),n=t.findings.filter(s=>s.severity==="error");if(n.length>0)throw new Error(`Extension manifest is not compatible with pm ${t.pmVersion}: ${n.map(s=>s.message).join("; ")}`);return t}function ot(r,e={}){let t=he(r,e);if(!t.ok){let n=t.findings.filter(s=>s.severity==="error");throw new Error(`Extension failed preflight with ${n.length} ${n.length===1?"error":"errors"}:
|
|
6
|
-
`+n.map(s=>` - [${s.source}:${s.code}] ${s.message}`).join(`
|
|
7
|
-
`))}return t}function Rr(r){if(!B(r))throw new Error("createExtensionTestHarness received a module with no activate export. Pass the extension module (with an activate(api) function on the module or its default export) as the first argument, and options second.")}async function it(r,e={}){Rr(r);let t=P(r),n=T(t,e.name),s=e.layer??"project",o=await Qe(r,e);if(o.failed.length>0){let i=o.failed.map(a=>{let d=a.trace?.missing_capability,c=d?`${a.error}; missing capability "${d}"`:a.error;return`${a.layer}:${a.name} (${c})`}).join(", ");throw new Error(`createExtensionTestHarness could not activate the extension cleanly: ${i}. Declare the required capability in the manifest (or pass it via options.capabilities), or use activateExtensionForTest directly to inspect a failed activation.`)}return{module:r,name:n,layer:s,activation:o,activationSummary(i){return R(o,i)},renderMarkdown(i={}){let{extensionName:a,...d}=i??{};return fe(R(o,{extensionName:a}),d)},assertCommandContract(i){return pr(o.registrations,i)},assertFlags(i){return ur(o.registrations,i)},assertItemField(i){return yr(o.registrations,i)},assertItemType(i){return br(o.registrations,i)},assertProfile(i){return wr(o.registrations,i)},assertHook(i){return gr(o.hooks,i)},assertCommandOverride(i){return Er(o.commands,i)},assertParserOverride(i){return xr(o.parsers,i)},assertPreflightOverride(i){return _r(o.preflight,i)},assertRendererOverride(i){return $r(o.renderers,i)},assertServiceOverride(i){return kr(o.services,i)},assertSearchProvider(i){return vr(o.registrations,i)},assertVectorStoreAdapter(i){return hr(o.registrations,i)},assertImporter(i){return _e(o.registrations,i)},assertExporter(i){return $e(o.registrations,i)},assertMigration(i){return ke(o.registrations,i)},assertCapabilityUsage(i){return Cr(o,i)},runCommand(i){return I(o.commands,i)},runHook(i){return rr(o.hooks,i)},runMutationGuard(i){return er(o.hooks,i)},runCommandOverride(i){return or(o.commands,i)},runParserOverride(i){return tr(o.parsers,i)},runPreflightOverride(i){return nr(o.preflight,i)},runRendererOverride(i){return ir(o.renderers,i)},runServiceOverride(i){return sr(o.services,i)},runSearchProvider(i){return dr(o.registrations,i)},runVectorStoreAdapter(i){return mr(o.registrations,i)},runMigration(i){return cr(o.registrations,i)},runImporter(i){return fr(o,i)},runExporter(i){return lr(o,i)},deactivate(i={}){return Ze(r,{name:n,layer:s,activation:o,deactivateTimeoutMs:i.deactivateTimeoutMs})}}}export{Ir as a,Mr as b,Oe as c,jr as d,N as e,qe as f,k as g,ve as h,Br as i,A as j,he as k,Qe as l,Ze as m,I as n,er as o,rr as p,tr as q,nr as r,or as s,ir as t,sr as u,dr as v,mr as w,cr as x,fr as y,lr as z,Qr as A,Zr as B,pr as C,ur as D,gr as E,vr as F,hr as G,_e as H,$e as I,yr as J,br as K,wr as L,Er as M,xr as N,_r as O,$r as P,kr as Q,ke as R,Cr as S,et as T,rt as U,tt as V,nt as W,ot as X,it as Y};
|
|
8
|
-
//# sourceMappingURL=chunk-WASMH647.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./chunk-T3AMFUCN.js";import{Ac as j,Bc as z,Bd as Z,Cc as Y,Cd as ee,Ec as K,Ed as te,Fc as X,Ld as ne,Md as ae,Nd as C,Td as oe,bb as L,gc as U,hb as M,id as Q,jc as $,kc as q,lc as G,sa as P,vb as F,vc as H,wb as V,xb as N,xc as I,yc as W,zc as J}from"./chunk-KYG2QKNY.js";import"./chunk-QA4GUEKJ.js";import"./chunk-QTHR3LXF.js";import"./chunk-DEZPZOQ7.js";import{Bo as E,Fo as c,Io as f,Jo as i,Ko as g,Mo as R,No as O,O as d,Q as m,Th as l,Uc as A,Uh as u,ap as y,df as T,ib as x,l as S,m as B,qa as v,xj as _}from"./chunk-KHN4NMKT.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]="5197f5ed-ed11-536e-b0da-00fe90a1a1a1")}catch{}})();var re=new Map([["measurements","boolean"],["metric","string"],["measurementLimit","number"],["observe","string_array"],["direction","direction"],["measurementSource","string"],["measurementItem","string"],["measurementRevision","string"],["author","string"],["message","string"],["provenanceCoverage","boolean"],["fleetAttribution","boolean"],["since","string"],["eventLimit","number"],["minimumSample","number"]]),be=new Set(["higher","lower","target"]),we=[...re.keys()].sort((e,t)=>e.localeCompare(t)).join(", ");function ve(e,t){return e==="boolean"?typeof t=="boolean":e==="string"?typeof t=="string":e==="number"?typeof t=="number":e==="string_array"?Array.isArray(t)&&t.every(n=>typeof n=="string"):e==="direction"&&be.has(t)}function ie(e){if(e===void 0)return{};let t;try{t=JSON.parse(e)}catch(n){throw new m(`--analytics must be valid JSON: ${String(n)}`,d.USAGE)}if(t===null||typeof t!="object"||Array.isArray(t))throw new m("--analytics must be a JSON object.",d.USAGE);for(let[n,a]of Object.entries(t)){let o=re.get(n);if(!ve(o,a))throw new m(o===void 0?`Unknown --analytics field "${n}". Accepted fields: ${we}.`:`--analytics field "${n}" must be ${o.replace("_"," ")}.`,d.USAGE)}return t}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a9de2504-ed7f-5a51-9da9-628e2f4a7159")}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]="ae73a8aa-9ba6-58cc-9bcd-912682cadfdc")}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]="0954af2d-98d8-5425-9264-cd44252bb7ef")}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]="6b76c88f-912f-59a0-ac2c-6cd6e221737b")}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]="d413f650-10c4-55c1-8403-90a7783ef5e9")}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]="c9656d1f-25d1-5e20-b5e1-0b96390e0b62")}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]="42a381ad-a47b-5990-a2c7-0fdade7c25b3")}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]="ac5c3cc6-b0a4-5dad-b6ed-f1e627f6bb1d")}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]="5f81d2b7-3693-553e-bfe8-17344cd3a6c3")}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]="41d39122-3247-54ea-9eaf-43f002910880")}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]="fdb6bf22-0e41-530c-9d50-c56ab36effa4")}catch{}})();var se=(e,t)=>L(e,t,{runUpdate:(n,a,o)=>U(n,a,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]="70a8a9b3-0fe4-5903-8e9c-85db1f0ca522")}catch{}})();async function xe(e,t,n,a,o){let r=c(o),s=e==="run",p=e==="verdicts",b=e==="presets"||e==="apply",w=e==="promote",h=await M({action:e,...s||p||b||w?{}:{kind:t},id:s||p||w?n??t:n,preset:b?n??t:void 0,definition:i(a,"definition"),trigger:i(a,"trigger"),tree:i(a,"tree"),gate:i(a,"gate"),limit:i(a,"limit"),dry_run:a.dryRun===!0,fullChangedFields:r.fullChangedFields,idOnly:r.idOnly,author:i(a,"author"),message:i(a,"message"),owner:i(a,"owner"),apply:a.apply===!0,enforcement:i(a,"enforcement")},r);l(h,r),typeof h=="object"&&h!==null&&"exit_code"in h&&h.exit_code===1&&(process.exitCode=1)}function le(e){e.command("assurance").argument("<action>","Action; inspect `pm contracts --command assurance`").argument("[kind]","Declaration kind or run gate id").argument("[id]","Declaration/gate id").description("Manage SDK-owned assurance contracts.").option("--definition <json>","Put declaration JSON").option("--trigger <value>","Gate trigger").option("--tree <value>","Revision identity").option("--gate <id>","Verdict gate filter").option("--limit <number>","Verdict limit").option("--dry-run","Evaluate without recording").option("--author <value>","Mutation author").option("--message <value>","Mutation rationale").option("--owner <item-id>","Preset/derivation owner").option("--apply","Persist derived proposals").option("--enforcement <level>","Promote to warn or block").action(xe)}(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]="8428a95f-24d1-546c-82b6-40b182b491de")}catch{}})();function Ae(e,t){let n=e?.trim().toLowerCase(),a=t?.trim().toLowerCase();if(n===void 0||n.length===0)return a;if(n==="local-analytics")return a&&a.length>0?a:"status";if(a!==void 0&&a.length>0)throw v({command_path:"telemetry",token:`${e} ${t}`,allowed:["status","flush","stats","clear","local-analytics"],token_kind:"path",examples:["pm telemetry stats --limit 10","pm telemetry local-analytics status --json"]});return n}function _e(e){return{addValues:Array.isArray(e.add)?e.add:[],addJsonValues:Array.isArray(e.addJson)?e.addJson:[],removeValues:Array.isArray(e.remove)?e.remove:[],removeIndexValues:Array.isArray(e.removeIndex)?e.removeIndex:[]}}function ue(e,t){if(e.background===!0){if(e.run!==!0)throw new m("--background requires --run",d.USAGE);if(e.acknowledgeLinkedTests===!0)throw new m("--background cannot be combined with --acknowledge-linked-tests; acknowledgement is a non-executing foreground operation",d.USAGE);if(t.addValues.length>0||t.addJsonValues.length>0||t.removeValues.length>0||t.removeIndexValues.length>0)throw new m("--background does not support --add/--add-json/--remove/--remove-index; update linked tests first, then run in background",d.USAGE)}}async function Ie(e,t,n,a){let o=await C({kind:"test",commandArgs:R(e,{...t,add:a.addValues,addJson:a.addJsonValues,remove:a.removeValues,removeIndex:a.removeIndexValues}),targetId:e,author:typeof t.author=="string"?t.author:void 0,noExtensions:n.noExtensions===!0},n);l(o,n)}function me(e,t){return{add:t.addValues,addJson:t.addJsonValues,remove:t.removeValues,removeIndex:t.removeIndexValues,list:!!e.list,run:!!e.run,match:typeof e.match=="string"?e.match:void 0,onlyIndex:typeof e.onlyIndex=="string"||typeof e.onlyIndex=="number"?e.onlyIndex:void 0,onlyLast:!!e.onlyLast,timeout:typeof e.timeout=="string"?e.timeout:void 0,progress:!!e.progress,envSet:Array.isArray(e.envSet)?e.envSet:[],envClear:Array.isArray(e.envClear)?e.envClear:[],sharedHostSafe:!!e.sharedHostSafe,pmContext:typeof e.pmContext=="string"?e.pmContext:void 0,overrideLinkedPmContext:!!e.overrideLinkedPmContext,workspaceContext:typeof e.workspaceContext=="string"?e.workspaceContext:void 0,overrideLinkedWorkspaceContext:!!e.overrideLinkedWorkspaceContext,allowUntrustedLinkedTests:!!e.allowUntrustedLinkedTests,acknowledgeLinkedTests:!!e.acknowledgeLinkedTests,failOnContextMismatch:!!e.failOnContextMismatch,failOnSkipped:!!e.failOnSkipped,failOnEmptyTestRun:!!e.failOnEmptyTestRun,requireAssertionsForPm:!!e.requireAssertionsForPm,checkContext:!!e.checkContext,autoPmContext:!!e.autoPmContext,author:typeof e.author=="string"?e.author:void 0,message:typeof e.message=="string"?e.message:void 0,force:!!e.force,measure:Array.isArray(e.measure)?e.measure:[],metricBelow:typeof e.metricBelow=="string"?e.metricBelow:void 0,metricDiff:typeof e.metricDiff=="string"?e.metricDiff:void 0}}var Lt={buildRunTestOptions:me,buildRunTestAllOptions:fe,runWorkspacePositionAction:pe,validateBackgroundTestOptions:ue};async function Ce(e,t,n,a){let o=await ne(e,me(t,a),n);(a.addValues.length>0||a.addJsonValues.length>0||a.removeValues.length>0||t.run===!0||a.removeIndexValues.length>0)&&await y(n,o),l(o,n),(o.run_results.some(r=>r.status==="failed")||o.fail_on_skipped_triggered===!0)&&(process.exitCode=d.DEPENDENCY_FAILED)}async function De(e,t,n){let a=c(n),o=Date.now(),r=_e(t);ue(t,r),t.background===!0?await Ie(e,t,a,r):await Ce(e,t,a,r),a.profile&&u(`profile:command=test took_ms=${Date.now()-o}`)}function k(e){let t=i(e,"author"),n=i(e,"assignee");if(t!==void 0&&n!==void 0&&t!==n)throw new m("Lifecycle ownership received conflicting --author and --assignee values; use one actor value for both aliases.",d.USAGE,{code:"conflicting_lifecycle_owner",examples:["pm claim pm-123","pm claim pm-123 --start","pm release pm-123"]});return{author:t??n,message:i(e,"message")}}async function Se(e,t){let n=c(t),a=Date.now();if(e.background===!0){let s=await C({kind:"test-all",commandArgs:O(e),statusFilter:i(e,"status"),noExtensions:n.noExtensions===!0},n);l(s,n),n.profile&&u(`profile:command=test-all took_ms=${Date.now()-a}`);return}let r=await ae(fe(e),n);await y(n,{ids:r.results.map(s=>s.id)}),l(r,n),(r.failed>0||r.fail_on_skipped_triggered===!0)&&(process.exitCode=d.DEPENDENCY_FAILED),n.profile&&u(`profile:command=test-all took_ms=${Date.now()-a}`)}function fe(e){return{status:i(e,"status"),limit:i(e,"limit"),offset:i(e,"offset"),timeout:i(e,"timeout"),progress:!!e.progress,envSet:Array.isArray(e.envSet)?e.envSet:[],envClear:Array.isArray(e.envClear)?e.envClear:[],sharedHostSafe:!!e.sharedHostSafe,pmContext:i(e,"pmContext"),overrideLinkedPmContext:!!e.overrideLinkedPmContext,workspaceContext:i(e,"workspaceContext"),overrideLinkedWorkspaceContext:!!e.overrideLinkedWorkspaceContext,allowUntrustedLinkedTests:!!e.allowUntrustedLinkedTests,failOnContextMismatch:!!e.failOnContextMismatch,failOnSkipped:!!e.failOnSkipped,failOnEmptyTestRun:!!e.failOnEmptyTestRun,requireAssertionsForPm:!!e.requireAssertionsForPm,checkContext:!!e.checkContext,autoPmContext:!!e.autoPmContext}}async function Be(e,t,n,a){let o=c(a),r=Date.now(),s=await te({subcommand:Ae(e,t),limit:i(n,"limit")},o);l(s,o),o.profile&&u(`profile:command=telemetry took_ms=${Date.now()-r}`)}async function Te(e,t){let n=c(t),a=Date.now(),o=ie(i(e,"analytics")),r=await Z(n,{includeEmpty:e.includeEmpty===!0,storage:e.storage===!0,metadataCoverage:e.metadataCoverage===!0,byAssignee:e.byAssignee===!0,byTag:e.byTag===!0,byPriority:e.byPriority===!0,tagPrefix:i(e,"tagPrefix"),fieldUtilization:e.fieldUtilization===!0,...o});r.recorded_observations?.some(s=>s.changed)===!0&&await y(n,{ids:r.recorded_observations?.flatMap(s=>s.observation.item_id?[s.observation.item_id]:[])}),l(r,n),n.profile&&u(`profile:command=stats took_ms=${Date.now()-a}`)}async function Ee(e,t){let n=c(t),a=Date.now(),o=i(e,"threshold"),r=i(e,"limit"),s=await ee(n,{...e.exhaustive===!0?{exhaustive:!0}:{},status:Array.isArray(e.status)&&e.status.length>0?e.status:void 0,since:i(e,"since"),...o===void 0?{}:{threshold:Number(o)},...r===void 0?{}:{limit:Number(r)}});l(s,n),n.profile&&u(`profile:command=duplicates took_ms=${Date.now()-a}`)}async function Re(e,t){let n=c(t),a=Date.now(),o=!!e.strictExit||!!e.failOnWarn,r=await P(n,{strictExit:o,strictDirectories:!!e.strictDirectories,requireMergeDrivers:!!e.requireMergeDrivers,checkOnly:!!e.checkOnly,checkTelemetry:!!e.checkTelemetry,noRefresh:!!e.noRefresh,refreshVectors:!!e.refreshVectors,verboseStaleItems:!!e.verboseStaleItems,verboseAuthorEvents:!!e.verboseAuthorEvents,brief:!!e.brief,summary:!!e.summary||o,skipVectors:!!e.skipVectors,skipIntegrity:!!e.skipIntegrity,skipDrift:!!e.skipDrift,full:!!e.full});l(r,n),o&&!r.ok&&(A({...r,exit_code:d.GENERIC_FAILURE,error_code:"health_findings",error_category:"validation",command_resolution:"health_findings",resolution_stage:"execute"}),process.exitCode=d.GENERIC_FAILURE),n.profile&&u(`profile:command=health took_ms=${Date.now()-a}`)}async function Oe(e,t){let n=c(t),a=Date.now(),o=await se({checkMetadata:!!e.checkMetadata,metadataProfile:i(e,"metadataProfile"),checkResolution:!!e.checkResolution,checkCompleteness:!!e.checkCompleteness,checkLifecycle:!!e.checkLifecycle,checkStaleBlockers:!!e.checkStaleBlockers,dependencyCycleSeverity:i(e,"dependencyCycleSeverity"),parentCycleSeverity:i(e,"parentCycleSeverity"),checkFiles:!!e.checkFiles,checkCommandReferences:!!e.checkCommandReferences,scanMode:i(e,"scanMode"),includePmInternals:!!e.includePmInternals,verboseFileLists:!!e.verboseFileLists,verboseDiagnostics:!!e.verboseDiagnostics,allAffectedIds:!!e.allAffectedIds,checkHistoryDrift:!!e.checkHistoryDrift,checkStorageIntegrity:!!e.checkStorageIntegrity,fixHints:!!e.fixHints,autoFix:!!e.autoFix,dryRun:!!e.dryRun,fixScope:Array.isArray(e.fixScope)?e.fixScope:void 0,pruneMissing:!!e.pruneMissing,counts:!!e.counts,full:!!e.full},n);l(o,n),(e.strictExit||e.failOnWarn)&&(o.has_warnings||!o.ok)&&(A({...o,exit_code:d.GENERIC_FAILURE,error_code:"validation_findings",error_category:"validation",command_resolution:"validation_findings",resolution_stage:"execute"}),process.exitCode=d.GENERIC_FAILURE),n.profile&&u(`profile:command=validate took_ms=${Date.now()-a}`)}async function Pe(e,t){let n=c(t),a=Date.now(),o=await H(n,{dryRun:e.dryRun===!0,scope:Array.isArray(e.scope)?e.scope:[]});l(o,n),n.profile&&u(`profile:command=gc took_ms=${Date.now()-a}`)}async function Le(e,t,n,a){let o=c(a),r=x(process.cwd(),o.path),s=e.trim().toLowerCase();if(!I.some(p=>p===s))throw v({command_path:"workspace snapshot",token:e,allowed:I,display_name:"workspace snapshot",token_kind:"action",examples:["pm workspace snapshot create before-migration","pm workspace snapshot restore before-migration"]});if(s==="list"){l(await j(r),o);return}if(s==="create"){l(await W(r,t===void 0?{}:{name:t}),o);return}if(t===void 0)throw new m(`pm workspace snapshot ${s} requires a snapshot name or fingerprint`,d.USAGE);if(s==="inspect"){l(await J(r,t),o);return}if(s==="restore"){if(n.dryRun===!0){l(await z(r,t),o);return}let p=await _(r);l(await Y(r,t,{force:n.force===!0,author:T(i(n,"author"),p.author_default),message:i(n,"message"),lockTtlSeconds:p.locks.ttl_seconds,lockWaitMs:p.locks.wait_ms}),o);return}l(await K(r,t),o)}async function pe(e,t){let n=c(t);l(await X(n),n)}async function Me(e,t){let n=c(t),a=Date.now(),o=await Q({action:i(e,"action"),command:i(e,"command"),summary:!!e.summary,schemaOnly:!!e.schemaOnly,flagsOnly:!!e.flagsOnly,availabilityOnly:!!e.availabilityOnly,runtimeOnly:!!e.runtimeOnly||!!e.activeOnly,full:!!e.full},n);l(o,n),n.profile&&u(`profile:command=contracts took_ms=${Date.now()-a}`)}async function Fe(e,t,n){if(t.start===!0){ce(e,!1),await ye(e,t,n);return}let a=c(n),o=Date.now(),r={...k(t),ifAvailable:t.ifAvailable===!0,maxAttempts:t.maxAttempts};ce(e,t.next===!0);let s=t.next===!0?await V(!!t.force,a,r,{type:typeof t.type=="string"?t.type:void 0,tag:typeof t.tag=="string"?t.tag:void 0,priority:t.priority,assigneeFilter:typeof t.assigneeFilter=="string"?t.assigneeFilter:void 0,parent:typeof t.parent=="string"?t.parent:void 0,sprint:typeof t.sprint=="string"?t.sprint:void 0,release:typeof t.release=="string"?t.release:void 0,includeDecisions:t.includeDecisions===!0,includeGates:t.includeGates===!0,includeContainers:t.includeContainers===!0,tokenBudget:t.tokenBudget??t.token_budget,explainRanking:t.explainRanking===!0||t.explain_ranking===!0}):await F(e,!!t.force,a,r);await y(a,s),l(s,a),a.profile&&u(`profile:command=claim took_ms=${Date.now()-o}`)}function ce(e,t){if(!t&&!e)throw new m("Specify an item id or pass --next",d.USAGE);if(t&&e)throw new m("Specify either an item id or --next, not both",d.USAGE)}async function Ve(e,t,n){if(t.pause===!0){await ge(e,t,n);return}let a=c(n),o=Date.now(),r=await N(e,!!t.force,a,{...k(t),ownershipReleaseBypass:t.ownershipReleaseBypass===!0});await y(a,r),l(await E("release",[e],t,a,r),a),a.profile&&u(`profile:command=release took_ms=${Date.now()-o}`)}async function D(e){let t=c(e),n=S(e.name());if(!n||t.json||t.quiet)return;(await _(x(process.cwd(),t.path))).ux?.deprecation_hints&&u(B(n))}async function ye(e,t,n){await D(n);let a=c(n),o=Date.now(),r=await $(e,{...k(t),force:!!t.force,next:t.next===!0,ifAvailable:t.ifAvailable===!0},a);await y(a,r.update),l(r,a),a.profile&&u(`profile:command=start-task took_ms=${Date.now()-o}`)}async function ge(e,t,n){await D(n);let a=c(n),o=Date.now(),r=await q(e,{...k(t),force:!!t.force},a);await y(a,r.release),l(r,a),a.profile&&u(`profile:command=pause-task took_ms=${Date.now()-o}`)}async function Ne(e,t,n,a){await D(a);let o=c(a),r=Date.now(),s=await G(e,t,{...k(n),validateClose:i(n,"validateClose"),force:!!n.force},o);await y(o,s.release),l(s,o),o.profile&&u(`profile:command=close-task took_ms=${Date.now()-r}`)}function de(e){return e.option("--background","Run linked tests in managed background mode").option("--timeout <seconds>","Default run timeout in seconds").option("--progress","Emit linked-test progress to stderr (always shown in TTY, opt-in for non-TTY)").option("--env-set <value>","Set environment variable(s) for linked-test runs (KEY=VALUE, repeatable)",f).option("--env-clear <value>","Clear environment variable(s) for linked-test runs (NAME, repeatable)",f).option("--shared-host-safe","Apply additive shared-host-safe runtime defaults for linked-test runs").option("--pm-context <mode>","PM linked-test context mode: schema|tracker|auto (default: schema)").option("--override-linked-pm-context","Force run-level --pm-context to override per-linked-test pm_context_mode metadata").option("--workspace-context <mode>","Source-workspace mode: source|isolated|snapshot (default: source)").option("--override-linked-workspace-context","Force run-level --workspace-context over per-linked-test metadata").option("--allow-untrusted-linked-tests","Execute untrusted linked commands when project policy also permits it").option("--fail-on-context-mismatch","Fail linked PM commands when context item counts differ").option("--fail-on-skipped","Treat skipped linked tests as dependency failures").option("--fail-on-empty-test-run","Treat successful linked-test commands that report zero executed tests as failures").option("--require-assertions-for-pm","Require assertion metadata for linked PM command tests").option("--check-context","Preflight linked PM command context diagnostics before executing commands").option("--auto-pm-context","Auto-remediate PM tracker-read context mismatches by routing those linked commands through tracker context")}function Mt(e){le(e);let t=e.command("test").argument("<id>","Item id").option("--add <value>","Add verified isolated test (CSV/markdown or stdin)",f).option("--add-json <value>","Add verified isolated test (JSON object/array or stdin)",f).option("--remove <value>","Remove linked test entry by exact command/path (command=<value> and path=<value> preserve commas and equals signs; or - for stdin)",f).option("--remove-index <n>","Remove the 1-based linked-test index from --list order (repeatable)",f).option("--list","List linked tests without mutating").option("--run","Run linked test commands").option("--match <value>","Run only linked tests whose command/path contains this substring").option("--only-index <n>","Run only the 1-based linked-test index from --list order").option("--only-last","Run only the most recently added linked test");t.option("--acknowledge-linked-tests","Trust the item's current linked commands in this clone without executing them"),de(t).option("--measure <value>","Record name=value[,unit=...][,threshold=...] evidence; repeatable",f).option("--metric-below <value>","Return evidence below name=value").option("--metric-diff <name>","Diff the latest two values").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").description("Manage tests linked to an item and optionally run them.").action(De);let n=e.command("test-all").description("Run linked tests across matching items.").option("--status <value>","Filter items by status before running tests").option("--limit <n>","Limit matching items before running linked tests").option("--offset <n>","Skip matching items before running linked tests");de(n).action(Se),e.command("test-runs-worker",{hidden:!0}).argument("<runId>","Background run id").description("Internal background worker command.").action(async(w,h,he)=>{let ke=c(he);await oe(w,ke)}),e.command("telemetry").argument("[namespace-or-subcommand]","Telemetry subcommand: status, flush, stats, clear (default: status)").argument("[subcommand]","Compatibility alias target for local-analytics: status, flush, stats, clear").option("--limit <n>","Maximum command groups returned by telemetry stats").description("Inspect and manage local telemetry queue/runtime state.").action(Be),e.command("duplicates").description("Find duplicate clusters across all statuses.").option("--status <value>","Statuses (repeatable or comma-separated)",f,[]).option("--since <value>","Created at or after this time").option("--threshold <value>","Minimum similarity (0-1)").option("--limit <n>","Maximum clusters").option("--exhaustive","Score all pairs within the safety bound").action(Ee),e.command("stats").description("Show project tracker statistics.").option("--include-empty","Restore zero-count registered item-type and lifecycle-status buckets").option("--storage","Include aggregate history-stream storage metrics (total streams/lines/bytes, largest + deepest streams, oldest/newest entries)").option("--metadata-coverage","Include metadata coverage % (acceptance_criteria, estimated_minutes, resolution, tags, parent) overall and by type").option("--by-assignee","Include a lifecycle-bucketed item breakdown grouped by assignee").option("--by-tag","Include a lifecycle-bucketed item breakdown grouped by tag").option("--by-priority","Include a lifecycle-bucketed item breakdown grouped by priority").option("--tag-prefix <value>","With --by-tag: only count tags starting with this prefix (e.g. domain:)").option("--field-utilization","Report content-field utilization rates (notes/learnings/files/docs/tests/comments/deps/body) for governance analysis").option("--analytics <json>","Improvement ledger/history analytics JSON").action(Te),e.command("health").description("Show project tracker health checks.").option("--strict-directories","Treat optional item-type directories as required failures").option("--require-merge-drivers","Treat absent clone-local merge drivers as a required health failure").option("--check-only","Run read-only health diagnostics without refreshing vectors").option("--check-telemetry","Probe telemetry endpoint health and include network diagnostics").option("--no-refresh","Disable automatic vector refresh attempts during health checks").option("--refresh-vectors","Explicitly enable vector refresh attempts during health checks").option("--verbose-stale-items","Include full stale vectorization ID lists in health output").option("--verbose-author-events","Include every actionable unknown-author event coordinate for review or disposition").option("--brief","Emit compact health details for low-token agent checks").option("--summary","Emit one-line-style health status with check names and warning count").option("--skip-vectors","Skip vectorization check for a faster run").option("--skip-integrity","Skip item/history file integrity check for a faster run").option("--skip-drift","Skip history drift hash check for a faster run").option("--full","Run all checks including slow integrity, drift, and vectorization checks").option("--strict-exit","Return non-zero exit when health is not ok and default to actionable summary output; use --full for complete details").option("--fail-on-warn","Alias for --strict-exit").action(Re),e.command("validate").description("Validate metadata, lifecycle policies, files, command references, and history.").option("--check-metadata","Run metadata completeness checks").option("--metadata-profile <value>","Metadata profile (core|strict|custom)").option("--check-resolution","Run closed-item resolution metadata checks").option("--check-completeness","Check declarative lifecycle field requirements").option("--check-lifecycle","Run active-item lifecycle governance drift checks").option("--check-stale-blockers","Include stale blocker-pattern diagnostics in lifecycle checks").option("--dependency-cycle-severity <value>","Set dependency-cycle warning policy for lifecycle checks (off|warn|error)").option("--parent-cycle-severity <value>","Set parent-hierarchy cycle warning policy for lifecycle checks (off|warn|error)").option("--check-files","Run linked-file and orphaned-file checks").option("--check-command-references","Run linked-command PM-ID reference checks").option("--scan-mode <value>","Select file candidate scan mode for --check-files (default|tracked-all|tracked-all-strict)").option("--include-pm-internals","Include PM storage internals in tracked-all candidate scans").option("--verbose-file-lists","Include full file-path lists for validate --check-files details").option("--verbose-diagnostics","Include full diagnostic ID lists").option("--all-affected-ids","Emit complete missing_* affected-ID lists with no truncation (implied by --json)").option("--strict-exit","Return non-zero exit when validation warnings are present").option("--fail-on-warn","Alias for --strict-exit").option("--fix-hints","Add a machine-executable fix_hints[] of pm commands to each failing check's details").option("--auto-fix","Apply safe, deterministic field backfills").option("--dry-run","Preview planned --auto-fix/--prune-missing fixes without applying them").option("--fix-scope <scope>","Grant --auto-fix scopes (metadata, resolution, lifecycle; comma-separated or repeatable). Default: metadata, resolution; lifecycle must be named explicitly",f).option("--prune-missing","Remove deleted-path file/doc links; preserves real files").option("--check-history-drift","Run item/history hash drift checks").option("--check-storage-integrity","Run the post-merge storage-integrity check (unreadable items, history conflict markers, resurrected deletes, unparseable config/schema)").option("--counts","Keep validation counts and totals while omitting per-item diagnostic arrays").option("--full","Return the complete validation diagnostic projection").action(Oe),e.command("gc").option("--dry-run","Preview cleanup targets without deleting files; without this flag, pm gc deletes matched artifacts").option("--scope <value>","Limit cleanup to one or more scopes (comma-separated or repeatable): index, embeddings, runtime, locks, checkpoints, transactions",f).description("Delete optional cache artifacts by default (including expired lock debris) and show a summary.").action(Pe);let a=e.command("workspace").description("Inspect workspace state and snapshots.");a.command("position").description("Show merge and history readiness.").action(pe),a.command("snapshot").argument("<action>","Action: create, list, inspect, restore, delete").argument("[target]","Optional name for create; name or fingerprint otherwise").description("Manage content-addressed tracker snapshots.").option("--dry-run","Preview restore file, item, stream, and history-entry impact without mutating state").option("--force","Explicitly confirm a whole-workspace snapshot restore").option("--author <value>","Actor recorded on the restore audit event").option("--message <value>","Human-readable restore rationale").action(Le),e.command("contracts").description("Show machine-readable command and schema contracts for agents.").option("--action <value>","Filter tool schema branches to a specific action").option("--command <value>","Scope contracts output to one CLI command (narrow-by-default)").option("--summary","Return one command+intent row per top-level command for cheap agent bootstrap").option("--schema-only","Return schema-focused output only").option("--flags-only","Return command flag contracts only").option("--availability-only","Return action availability surface only").option("--runtime-only","Include only actions invocable in the current runtime").option("--active-only","Alias for --runtime-only").option("--full","Include full schema and command-flag surfaces (large; default brief output omits heavy sections for unfiltered queries)").action(Me);let o=e.command("claim").option("--start","Claim and start an explicit item").argument("[id]","Item id (omit with --next)").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force claim override").option("--if-available","Skip another author's claim (skipped=true)").option("--next","Atomically claim the next caller-available actionable item").option("--type <value>","Filter --next candidates by type").option("--tag <value>","Filter --next candidates by tag").option("--priority <value>","Filter --next candidates by priority").option("--assignee-filter <value>","Filter --next candidates: assigned|unassigned").option("--parent <id>","Scope --next candidates to a subtree").option("--sprint <value>","Filter --next candidates by sprint").option("--release <value>","Filter --next candidates by release").option("--max-attempts <n>","Bound the --next candidate walk (default 10; maximum 100)").option("--include-decisions","Allow --next to claim human-gated Decision items").option("--include-gates","Allow --next to claim outcome gates").option("--include-containers","Allow --next to claim containers with unfinished descendants").option("--token-budget <n>","Bound the estimated tokens used to rank --next candidates").option("--explain-ranking","Include ranking provenance for --next selection").description("Claim an item for active work.").action(Fe);g(o,"--assignee <value>","Alias for --author on lifecycle ownership commands"),g(o,"--token_budget <n>","Alias for --token-budget"),g(o,"--explain_ranking","Alias for --explain-ranking");let r=e.command("release").option("--pause","Use open status").argument("<id>","Item id").option("--author <value>","Author").option("--message <value>","Message").option("--force","Override ownership").description("Release ownership.").action(Ve);g(r,"--assignee <value>","Alias for --author on lifecycle ownership commands");let s=e.command("start-task",{hidden:!0}).argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership or terminal override when required").description("Lifecycle alias: claim an item and move it to in_progress.").action(ye);g(s,"--assignee <value>","Alias for --author on lifecycle ownership commands");let p=e.command("pause-task",{hidden:!0}).argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override when required").description("Lifecycle alias: move an item to open and release its claim.").action(ge);g(p,"--assignee <value>","Alias for --author on lifecycle ownership commands");let b=e.command("close-task",{hidden:!0}).argument("<id>","Item id").argument("[reason]","Close reason text").option("--author <value>","Mutation author").option("--message <value>","History message").option("--validate-close <value>","Close-time validation mode: off|warn|strict").option("--force","Force ownership or terminal override when required").description("Lifecycle alias: close an item and release assignment metadata.").action(Ne);g(b,"--assignee <value>","Alias for --author on lifecycle ownership commands")}export{Lt as _testOnlyRegisterOperations,Mt as registerOperationCommands,ce as requireClaimTarget};
|
|
2
|
-
//# sourceMappingURL=register-operations-LBEMFUMM.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as L,h as T}from"./chunk-AACGU5IA.js";import{Ca as O,Qa as I,Va as j,Xa as P,za as U}from"./chunk-QA4GUEKJ.js";import"./chunk-DEZPZOQ7.js";import{Fo as y,Io as k,O as d,Q as m,Qh as S,Th as w,Uh as h,ib as D,l as G,m as $,xj as R}from"./chunk-KHN4NMKT.js";import C from"node:fs/promises";import W from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="66c6b511-901e-596f-bf5b-6af9652519bb")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0b0e08e0-f6e7-59c4-ac96-9f47b172727a")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d975120a-964e-5b19-ae10-8ba011ba9bf8")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="74e48eb2-5a8d-51da-9abb-43d6451e5f11")}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]="a22921b3-d233-5bf8-aa95-ab98ae854502")}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]="3c84ab8c-970a-5d71-a5a3-9166a8da9e64")}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]="a8ac0dcc-067d-55e1-ae02-15ba3f9ecd34")}catch{}})();var H={extension:"extension",package:void 0};async function _(e,t){if(!e)return;let o=G(e),a=y(t);await R(D(process.cwd(),a.path)).then(r=>r.ux.deprecation_hints)&&h($(o))}var V={init:"init",install:"install",uninstall:"uninstall",explore:"explore",manage:"manage",describe:"describe",reload:"reload",doctor:"doctor",catalog:"catalog",adopt:"adopt","adopt-all":"adoptAll",activate:"activate",deactivate:"deactivate",migrate:"migrate"};function X(e){let t=e.capability,o=typeof t=="string"?[t]:Array.isArray(t)?t.filter(i=>typeof i=="string"):[],a=[...new Set(o.map(i=>i.trim().toLowerCase()).filter(i=>i.length>0))];if(a.length>1)throw new m(`Multiple scaffold capabilities cannot be combined yet: ${a.join(", ")}. Choose one capability per scaffold.`,d.USAGE);return a[0]}function A(e,t,o="extension"){let a={...e};t!==void 0&&(a[V[t]]=!0);let i=(...c)=>c.some(s=>a[s]===!0),r=(...c)=>{for(let s of c)if(typeof a[s]=="string")return a[s]};return{init:i("init"),scaffold:i("scaffold"),install:i("install"),uninstall:i("uninstall"),explore:i("explore","list"),manage:i("manage"),describe:i("describe"),markdown:i("markdown"),reload:i("reload"),doctor:i("doctor"),catalog:i("catalog"),adopt:i("adopt"),adoptAll:i("adoptAll","adopt_all","adopt-all"),activate:i("activate"),deactivate:i("deactivate"),migrate:i("migrate"),project:i("project"),local:i("local"),global:i("global"),gh:r("gh"),github:r("github"),ref:r("ref"),capability:X(e),declarative:i("declarative"),fields:r("fields"),detail:r("detail"),output:r("output"),trace:i("trace"),watch:i("watch"),runtimeProbe:i("runtimeProbe","runtime_probe","runtime-probe"),fixManagedState:i("fixManagedState","fix_managed_state","fix-managed-state"),isolated:i("isolated"),ignoreGlobal:i("ignoreGlobal","ignore_global","ignore-global"),strictExit:i("strictExit","strict_exit","strict-exit"),failOnWarn:i("failOnWarn","fail_on_warn","fail-on-warn"),dryRun:i("dryRun","dry_run","dry-run"),vocabulary:o}}async function Y(e){let t=(await C.readdir(process.cwd())).filter(a=>!a.startsWith(".")).sort((a,i)=>a.localeCompare(i)),o=[...e].sort((a,i)=>a.localeCompare(i));return t.length===o.length&&t.every((a,i)=>a===o[i])}async function J(e){let t=(e??[]).map(o=>o.trim()).filter(o=>o.length>0);return t.length<=1?t.length===0?void 0:t:await Y(t)?["*"]:t}function M(e,t,o){let a=e.markdown===!0;if(o!==void 0&&o==="")throw new m("--output requires a non-empty file path.",d.USAGE);if(o!==void 0&&!a)throw new m("--output is only supported with --markdown describe output.",d.USAGE);if(a){if(t.json)throw new m("Cannot combine --json with --markdown.",d.USAGE);if(e.describe!==!0)throw new m("--markdown is only supported by the describe action.",d.USAGE)}}async function Q(e){let t=O(e.result.details,e.vocabulary);if(e.outputPath!==void 0){let o=W.resolve(e.outputPath);await C.mkdir(W.dirname(o),{recursive:!0}),await C.writeFile(o,t,"utf8")}if(!e.globalOptions.quiet){for(let o of e.result.warnings)h(`warning: ${o}`);e.outputPath===void 0&&S(t)}}function Z(e,t){let o=!!t.strictExit||!!t.failOnWarn;if(e.action!=="doctor"||!o)return;let a=e.details!==null&&typeof e.details=="object"?e.details:{},i=a.summary!==null&&typeof a.summary=="object"?a.summary:null,r=i&&typeof i.status=="string"?i.status:void 0;(e.warnings.length>0||r!==void 0&&r!=="ok")&&(process.exitCode=d.GENERIC_FAILURE)}async function p(e,t,o,a,i="extension"){let r=y(o),c=Date.now(),s=i==="extension"?"package":i;await _(H[i],o);let n=A(t,a,s),f=(typeof n.output=="string"?n.output:void 0)?.trim();M(n,r,f);let g=await I(e,n,r);n.markdown===!0?await Q({result:g,vocabulary:s,outputPath:f,globalOptions:r}):w(g,r),Z(g,n),g.ok===!1&&(process.exitCode=d.GENERIC_FAILURE),r.profile&&h(`profile:command=extension took_ms=${Date.now()-c}`)}function ee(e){return e.details!==null&&typeof e.details=="object"?e.details:{}}function te(e){return e instanceof m?{message:e.message,exit_code:e.exitCode,...e.context}:{message:e instanceof Error?e.message:String(e),exit_code:d.GENERIC_FAILURE}}async function oe(e,t,o){let a=[],i=[],r=d.GENERIC_FAILURE;for(let c of e)try{let s=await I(c,t,o),n=ee(s),l=Array.isArray(s.warnings)?s.warnings:[];i.push(...l);let f=s.ok===!0;a.push({target:c,ok:f,extension:n.extension,source:n.source,install_plan:n.install_plan,dry_run:n.dry_run,destination_path:n.destination_path,activated:n.activated,settings_changed:n.settings_changed,command_paths:n.command_paths,action_paths:n.action_paths,runtime_activation_status:n.runtime_activation_status,activation_diagnostics:n.activation_diagnostics,command_discovery:n.command_discovery,verification:n.verification,warnings:l,...f?{}:{error:{message:"Extension install returned ok=false without throwing an error.",exit_code:d.GENERIC_FAILURE,code:"extension_install_soft_failed"}}})}catch(s){let n=te(s),l=n.exit_code;typeof l=="number"&&r===d.GENERIC_FAILURE&&l!==d.GENERIC_FAILURE&&(r=l),a.push({target:c,ok:!1,error:n})}return{rows:a,warnings:i,failureExitCode:r}}async function z(e,t,o,a){let i=a==="extension"?"package":a;await _(H[a],o);let r=await J(e);if(r===void 0||r.length<=1){await p(r?.[0],t,o,"install",i);return}let c=y(o),s=Date.now(),n=A(t,"install",i);if(M(n,c,void 0),[n.gh,n.github].some(b=>typeof b=="string"&&b.trim().length>0))throw new m("Multiple install targets cannot be combined with --gh/--github. Install one GitHub source per command, or pass multiple explicit local, bundled, or npm: targets.",d.USAGE,{code:"multi_target_github_install_ambiguous",required:"Use exactly one positional target with --gh/--github, or omit --gh/--github when installing multiple targets.",examples:["pm install --gh owner/repo","pm install npm:pm-guide-shell pm-todos"]});let{rows:f,warnings:g,failureExitCode:E}=await oe(r,n,c),v=f.filter(b=>b.ok!==!0).length,K={ok:v===0,action:"install",scope:n.global===!0?"global":"project",installed_count:n.dryRun===!0?0:f.length-v,...n.dryRun===!0?{dry_run:!0,planned_count:f.length-v}:{},failed_count:v,targets:f,warnings:[...new Set(g)].sort((b,B)=>b.localeCompare(B))};w(K,c),v>0&&(process.exitCode=E),c.profile&&h(`profile:command=extension took_ms=${Date.now()-s}`)}function ae(e){return e.option("--project","Use project extension scope (default)").option("--local","Alias for --project").option("--global","Use global extension scope")}function x(e){return e.option("--project","Use project package scope (default)").option("--local","Alias for --project").option("--global","Use global package scope")}function u(e,t){return t==="package"?x(e):ae(e)}function N(e){return e.option("--dry-run","Plan CLI/package upgrades without running npm or reinstalling packages").option("--cli-only","Upgrade only the pm CLI/SDK npm package").option("--packages-only","Upgrade only managed pm packages").option("--repair","Force npm global reinstall when upgrading the pm CLI/SDK").option("--tag <value>","npm dist-tag/version for CLI and registry package upgrades").option("--package-name <value>","Override the CLI package name for self-upgrade testing")}async function q(e,t,o){let a=y(t),i=Date.now();o&&await _("upgrade",t);let r=await L(e,t.optsWithGlobals(),a);w(r,a),r.ok||(process.exitCode=d.GENERIC_FAILURE),a.profile&&h(`profile:command=package-upgrade took_ms=${Date.now()-i}`)}function F(e,t){let o=t==="package"?"package":"extension",a=t==="package"?"packages":"extensions",i=t,r=e.command(i,{hidden:t==="extension"}).argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} source, name, or scaffold path`).option("--init",`Generate a starter ${o} scaffold at target path`).option("--scaffold","Alias for --init").option("--capability <kind>","Starter capability for --init (default: commands)",k).option("--install",`Install a ${o} source`).option("--dry-run","Resolve install sources and estimate copying without destination writes or activation").option("--uninstall",`Uninstall an installed ${o}`).option("--explore",`List discovered ${a} in selected scope`).option("--list","Alias for --explore").option("--manage",`List managed ${a} with update-check metadata`).option("--describe",`Map every surface a loaded ${o} registers (optionally one by name)`).option("--markdown","Render describe output as a Markdown reference document (describe only)").option("--output <path>","Write describe Markdown to a file (requires --markdown)").option("--reload",`Reload ${a} with cache-busted module imports`).option("--watch","Use watch mode with --reload").option("--doctor",`Run consolidated ${o} diagnostics (summary/deep modes)`).option("--catalog",`List bundled first-party ${o} catalog metadata`).option("--adopt",`Adopt an existing unmanaged ${o} into managed metadata`).option("--adopt-all",`Adopt all unmanaged ${a} into managed metadata`).option("--activate",`Activate a ${o} in selected scope settings`).option("--deactivate",`Deactivate a ${o} in selected scope settings`).option("--project",`Use project ${o} scope (default)`).option("--local","Alias for --project").option("--global",`Use global ${o} scope`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").option("--detail <mode>",`${o[0].toUpperCase()}${o.slice(1)} diagnostics detail mode (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(t==="package"?"Manage package lifecycle in project or global scope.":"Manage extension lifecycle in project or global scope.").action(async(s,n,l)=>{await p(s,l.optsWithGlobals(),l,void 0,t)});t==="package"&&(r.alias("packages"),r.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"));let c=r.command("init").alias("scaffold").argument("<target>","Scaffold target directory path").option("--capability <kind>",`Capability the starter targets (${U.join("|")}; default commands)`,k).description(t==="package"?"Generate a starter package scaffold with package metadata, manifest, and entrypoint.":"Generate a starter extension scaffold with manifest and entrypoint.");t==="package"&&c.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"),u(c,t).action(async(s,n,l)=>{await p(s,l.optsWithGlobals(),l,"init",t)}),u(r.command("install").option("--dry-run","Resolve sources and estimate copying without destination writes or activation").argument("[targets...]",`${o[0].toUpperCase()}${o.slice(1)} source (local path, bundled alias, npm: source, wildcard, or GitHub source)`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").description(`Install ${o} from local path, bundled alias, npm: source, wildcard, or GitHub source.`),t).action(async(s,n,l)=>{await z(s,l.optsWithGlobals(),l,t)}),u(r.command("uninstall").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Uninstall an installed ${o}.`),t).action(async(s,n,l)=>{await p(s,l.optsWithGlobals(),l,"uninstall",t)}),u(r.command("explore").description(`List discovered ${a} in selected scope.`),t).action(async(s,n)=>{await p(void 0,n.optsWithGlobals(),n,"explore",t)}),u(r.command("manage").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).description(`List managed ${a} with update-check metadata.`),t).action(async(s,n)=>{await p(void 0,n.optsWithGlobals(),n,"manage",t)}),u(r.command("describe").argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} name to describe (omit for every loaded ${o})`).option("--markdown","Render the surface map as a Markdown reference document instead of toon/json").option("--output <path>","Write Markdown output to a file (requires --markdown)").description(`Map every surface a loaded ${o} registers (commands, hooks, item types, providers, overrides, ...).`),t).action(async(s,n,l)=>{await p(s,l.optsWithGlobals(),l,"describe",t)}),u(r.command("reload").option("--watch","Use watch mode for repeated reload checks").description(`Reload ${a} with cache-busted module imports.`),t).action(async(s,n)=>{await p(void 0,n.optsWithGlobals(),n,"reload",t)}),u(r.command("doctor").option("--detail <mode>",`Detail mode for ${o} diagnostics (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(`Run consolidated ${o} diagnostics (summary/deep modes).`),t).action(async(s,n)=>{await p(void 0,n.optsWithGlobals(),n,"doctor",t)}),u(r.command("catalog").alias("list").option("--fields <value>","Render compact comma-separated catalog fields, for example: alias,installed,install_command").description(`List bundled first-party ${o} catalog metadata.`),t).action(async(s,n)=>{await p(void 0,n.optsWithGlobals(),n,"catalog",t)}),u(r.command("adopt").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).option("--gh <owner/repo[/path]>",`GitHub provenance shorthand for adopted ${o}`).option("--github <owner/repo[/path]>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub shorthand source").description(`Adopt an existing unmanaged ${o} into managed metadata.`),t).action(async(s,n,l)=>{await p(s,l.optsWithGlobals(),l,"adopt",t)}),u(r.command("adopt-all").description(`Adopt all unmanaged ${a} into managed metadata.`),t).action(async(s,n)=>{await p(void 0,n.optsWithGlobals(),n,"adopt-all",t)}),u(r.command("migrate").option("--dry-run","Plan active migrations without invoking extension code").description(`Plan or apply active ${o} migrations with durable receipts.`),t).action(async(s,n)=>{await p(void 0,n.optsWithGlobals(),n,"migrate",t)}),u(r.command("activate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Activate a ${o} in selected scope settings.`),t).action(async(s,n,l)=>{await p(s,l.optsWithGlobals(),l,"activate",t)}),u(r.command("deactivate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Deactivate a ${o} in selected scope settings.`),t).action(async(s,n,l)=>{await p(s,l.optsWithGlobals(),l,"deactivate",t)}),t==="package"&&N(x(r.command("upgrade").argument("[target]","Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages").description("Upgrade the pm CLI/SDK and refresh managed installable pm packages."))).action(async(s,n,l)=>{await q(s,l,!1)})}async function ie(e,t,o){let a=y(o),i=Date.now(),r=await P(e,a,{idPrefix:typeof t.idPrefix=="string"?t.idPrefix:void 0,preset:typeof t.preset=="string"?t.preset:void 0,defaults:t.defaults===!0||t.yes===!0,author:typeof t.author=="string"?t.author:void 0,agentGuidance:typeof t.agentGuidance=="string"?t.agentGuidance:void 0,typePreset:typeof t.typePreset=="string"?t.typePreset:void 0,withPackages:t.withPackages===!0,mergeFence:t.mergeFence!==!1,force:t.force===!0,workspace:typeof t.workspace=="string"?t.workspace:void 0}),s=t.verbose===!0||a.json===!0;w(s?r:j(r,!0),a),a.profile&&h(`profile:command=init took_ms=${Date.now()-i}`)}function ne(e,t,o,a){let r=e!==void 0&&new Set(["get","set","list","export"]).has(e);return{resolvedScope:r?"project":e??"project",resolvedAction:r?e:t??"list",resolvedKey:r?t:o,resolvedValue:r?o:a}}function re(e){return{criterion:Array.isArray(e.criterion)?e.criterion:[],format:typeof e.format=="string"?e.format:void 0,policy:typeof e.policy=="string"?e.policy:void 0,value:typeof e.value=="string"?e.value:void 0,clearCriteria:e.clearCriteria===!0,defaultDepth:typeof e.defaultDepth=="string"?e.defaultDepth:void 0,activityLimit:typeof e.activityLimit=="string"?e.activityLimit:void 0,staleThresholdDays:typeof e.staleThresholdDays=="string"?e.staleThresholdDays:void 0,sectionHierarchy:typeof e.sectionHierarchy=="string"?e.sectionHierarchy:void 0,sectionActivity:typeof e.sectionActivity=="string"?e.sectionActivity:void 0,sectionProgress:typeof e.sectionProgress=="string"?e.sectionProgress:void 0,sectionBlockers:typeof e.sectionBlockers=="string"?e.sectionBlockers:void 0,sectionFiles:typeof e.sectionFiles=="string"?e.sectionFiles:void 0,sectionWorkload:typeof e.sectionWorkload=="string"?e.sectionWorkload:void 0,sectionStaleness:typeof e.sectionStaleness=="string"?e.sectionStaleness:void 0,sectionTests:typeof e.sectionTests=="string"?e.sectionTests:void 0}}async function se(e,t,o,a,i,r){let c=y(r),s=Date.now(),{resolvedScope:n,resolvedAction:l,resolvedKey:f,resolvedValue:g}=ne(e,t,o,a),E=await T(n,l,f,re(i),c,typeof g=="string"?g:void 0);w(E,c),c.profile&&h(`profile:command=config took_ms=${Date.now()-s}`)}var Se={normalizeExtensionOptions:A};function Re(e){e.command("init").argument("[prefix-or-path]","Optional id prefix, or path-like tracker target such as ./pm-sandbox").option("--prefix, --id-prefix <value>","Set the item ID prefix (alias for the positional prefix)").option("--preset <value>","Governance preset for new setups: minimal|default|strict").option("--defaults","Use non-interactive setup defaults without opening the wizard").option("-y, --yes","Alias for --defaults (non-interactive setup)").option("--author <value>","Set the default mutation author for this project").option("--agent-guidance <mode>","Agent guidance mode: ask|add|skip|status").option("--type-preset <name>","Register domain item types during init: agile|ops|research").option("--with-packages","Install all bundled first-party packages during initialization").option("--no-merge-fence","Skip automatic merge-driver installation for a fresh Git-backed tracker").option("--workspace <dir>","Initialize repository-local tracker storage at <dir>/.agents/pm").option("--force","Allow initializing tracker files directly in a directory that looks like a workspace root").option("--verbose","Include the full resolved settings tree in the output (default output is a concise summary)").description("Initialize pm storage and defaults for the current workspace or a path-like tracker target.").action(async(t,o,a)=>{await ie(t,o,a)}),e.command("config").argument("[scope]","Config scope: project|global, or action shorthand list|export|get|set for project scope").argument("[action]","Config action: get|set|list|export").argument("[key]","Config key for get|set; use `pm config project list` for the complete typed inventory, including mutation-guard-* policies").argument("[value]",'Optional value for set: routed to the right typed flag by key (e.g. config set telemetry-tracking off, config set item-format toon, config set definition-of-done "Tests pass"). Equivalent to --policy/--format/--criterion. context keys still require --default-depth/--section-* flags.').option("--criterion <text>","Criteria value for definition-of-done, metadata-required-fields, or lifecycle pattern keys (repeatable for set)",k).option("--clear-criteria","Clear criteria-list keys for config set operations").option("--format <value>","Item format for item-format key: toon").option("--policy <value>","Policy key values: history-missing-stream-policy=auto_create|strict_error; sprint-release-format-policy=warn|strict_error; parent-reference-policy=warn|strict_error; governance-preset=minimal|default|strict|custom; governance-ownership-enforcement=none|warn|strict; governance-create-mode-default=progressive|strict; governance-close-validation-default=off|warn|strict; governance-require-close-reason=enabled|disabled; governance-parent-reference-policy=warn|strict_error; governance-metadata-validation-profile=core|strict|custom; governance-force-required-for-stale-lock=enabled|disabled; governance-duplicate-detection-mode=off|advisory|strict; test-result-tracking=enabled|disabled; untrusted-linked-test-execution=enabled|disabled; telemetry-tracking=enabled|disabled").option("--value <value>","Typed nested setting value. Mutation guards: require-attributed-author=true|false, secret-guard=off|advise|block, stale-in-progress-hours=integer>=1. Kebab-case is preferred; underscore aliases remain accepted.").option("--default-depth <value>","Context default depth: brief|standard|deep").option("--activity-limit <n>","Context default activity limit").option("--stale-threshold-days <n>","Context staleness cutoff in days").option("--section-hierarchy <value>","Enable/disable context hierarchy section (true|false)").option("--section-activity <value>","Enable/disable context activity section (true|false)").option("--section-progress <value>","Enable/disable context progress section (true|false)").option("--section-blockers <value>","Enable/disable context blockers section (true|false)").option("--section-files <value>","Enable/disable context files section (true|false)").option("--section-workload <value>","Enable/disable context workload section (true|false)").option("--section-staleness <value>","Enable/disable context staleness section (true|false)").option("--section-tests <value>","Enable/disable context tests section (true|false)").description("Read or update pm settings for the current workspace or global profile.").action(async(t,o,a,i,r,c)=>{await se(t,o,a,i,r,c)}),F(e,"extension"),F(e,"package"),x(e.command("install",{hidden:!0}).option("--dry-run","Resolve sources and estimate copying without destination writes or activation").argument("[targets...]","Package source (local path, bundled alias, npm: source, wildcard, or GitHub source)").option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").description("Install a pm package into the project package scope by default.")).action(async(t,o,a)=>{await _("install",a),await z(t,a.optsWithGlobals(),a,"package")}),N(x(e.command("upgrade",{hidden:!0}).argument("[target]","Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages").description("Upgrade the pm CLI/SDK and refresh managed installable pm packages."))).action(async(t,o,a)=>{await q(t,a,!0)})}export{Se as _testOnlyRegisterSetup,Re as registerSetupCommands};
|
|
2
|
-
//# sourceMappingURL=register-setup-MU557JAA.js.map
|