@unbrained/pm-cli 2026.9.25 → 2026.9.27
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/.agents/skills/README.md +1 -0
- package/.agents/skills/pm-developer/SKILL.md +3 -0
- package/.agents/skills/pm-test-audit/LICENSE.txt +21 -0
- package/.agents/skills/pm-test-audit/SKILL.md +103 -0
- package/.agents/skills/pm-test-audit/references/AUDIT.md +54 -0
- package/.agents/skills/pm-test-audit/references/CAMPAIGN.md +47 -0
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +28 -1
- package/dist/cli/commander-usage.js +2 -2
- package/dist/cli/error-guidance.js +1 -1
- package/dist/cli/main.js +2 -2
- package/dist/cli/register-list-query.js +2 -2
- package/dist/cli/register-setup.js +1 -1
- package/dist/cli/runtime/selection.d.ts +3 -1
- package/dist/cli/runtime/selection.js +1 -1
- package/dist/cli/schema/registration.js +2 -2
- package/dist/cli-bundle/bundle-manifest.json +155 -147
- package/dist/cli-bundle/chunks/chunk-3BTJ66CB.js +238 -0
- package/dist/cli-bundle/chunks/{chunk-5AP67ZXH.js → chunk-4SLLCDFL.js} +39 -39
- package/dist/cli-bundle/chunks/{chunk-GAU55CWI.js → chunk-4UPZLUT2.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-25KTCTBL.js → chunk-6OJVQ7SW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-445ARBKY.js → chunk-7TAGYNFP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GOWZEBTH.js → chunk-AUS6USO4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YDIGMRLZ.js → chunk-IEP3VAT5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3IB4THWX.js → chunk-JX6WCCHL.js} +6 -6
- package/dist/cli-bundle/chunks/chunk-LC6WEA5U.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-CZ3VJJEA.js → chunk-LKGQUZ5M.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-P7ZSJOWH.js → chunk-OKVDVERQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-COFQCKF4.js → chunk-TSF2LPIH.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YABJDOOX.js → chunk-V5UGBYHN.js} +3 -3
- package/dist/cli-bundle/chunks/{register-list-query-IZ7ZVTDE.js → register-list-query-6PAJ4PBU.js} +4 -4
- package/dist/cli-bundle/chunks/{register-mutation-IPAZTFDZ.js → register-mutation-RZCXZXYS.js} +4 -4
- package/dist/cli-bundle/chunks/{register-operations-APN33LNI.js → register-operations-GK6VU2H2.js} +2 -2
- package/dist/cli-bundle/chunks/register-setup-ASEMNMBF.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-KRIHJH5U.js → chunk-6J2YCGSN.js} +5 -5
- package/dist/cli-bundle/focused-chunks/{chunk-XKH2FC5D.js → chunk-6UNKK3UH.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-NRHTXBTI.js → chunk-DQ3MB7BO.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-PMPFLA6X.js → chunk-E7LYK7V5.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-GZD4ZYIB.js +20 -0
- package/dist/cli-bundle/focused-chunks/chunk-KMPKKSA6.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-TLF6N56J.js → chunk-LBDWUHQD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UIFVIE5F.js → chunk-MILJCOFJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MK5AKKHK.js → chunk-NETVXIH5.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-Q355NPLH.js → chunk-NWRVNHAD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-IXNNMP2R.js → chunk-NZAG7OKB.js} +12 -12
- package/dist/cli-bundle/focused-chunks/{chunk-OY3VHCTX.js → chunk-OJKJFDIG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-OJRX6G22.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-NVVB2HJC.js → chunk-PDVL7QYU.js} +16 -16
- package/dist/cli-bundle/focused-chunks/{chunk-O7MIBEMK.js → chunk-QO4MTAEA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ABA3KRPY.js → chunk-SMADBUPL.js} +2 -2
- package/dist/cli-bundle/main.js +21 -21
- 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 +20 -20
- 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 +46 -46
- 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/search/embedding-batches.d.ts +47 -15
- package/dist/core/search/embedding-batches.js +1 -1
- package/dist/core/search/eval-thresholds.d.ts +14 -0
- package/dist/core/search/eval-thresholds.js +2 -0
- package/dist/core/search/eval.d.ts +4 -1
- package/dist/core/search/eval.js +1 -1
- package/dist/core/search/http-client.d.ts +7 -0
- package/dist/core/search/http-client.js +1 -1
- package/dist/sdk/agent-capability-contracts.js +1 -1
- package/dist/sdk/cli-contracts/command-aliases.js +1 -1
- package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
- package/dist/sdk/completion/shared.d.ts +1 -1
- package/dist/sdk/completion/shared.js +1 -1
- package/dist/sdk/eval.d.ts +19 -17
- package/dist/sdk/eval.js +1 -1
- package/dist/sdk/extension/static-inventory.d.ts +54 -0
- package/dist/sdk/extension/static-inventory.js +2 -0
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/governance/reindex.d.ts +4 -1
- package/dist/sdk/governance/reindex.js +2 -2
- package/dist/sdk/guide-topics.js +1 -1
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/complete-list.js +1 -1
- package/dist/sdk/query.d.ts +3 -0
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/read-output/provenance.d.ts +20 -0
- package/dist/sdk/read-output/provenance.js +2 -0
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/runtime/schema-preview.d.ts +2 -0
- package/dist/sdk/runtime/schema-preview.js +2 -0
- package/dist/sdk/runtime/schema.js +1 -1
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime-primitives.d.ts +2 -1
- package/dist/sdk/runtime-primitives.js +1 -1
- package/docs/CLI_GRAMMAR.md +31 -0
- package/docs/CODEX_PLUGIN.md +8 -0
- package/docs/EXTENSION_LIFECYCLE.md +18 -0
- package/docs/README.md +1 -0
- package/docs/RELEASING.md +51 -2
- package/docs/SEARCH_QUALITY.md +116 -0
- package/docs/agent-task-token-baseline.json +4 -4
- package/docs/generated/AGENT_CAPABILITY_ROUTING.md +1 -1
- package/docs/generated/AGENT_COMMAND_SURFACE.md +5 -1
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +4 -0
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +14 -7
- package/marketplace.json +2 -2
- package/package.json +2 -2
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +5 -1
- package/plugins/pm-claude/package.json +2 -2
- package/plugins/pm-claude/skills/pm-audit/SKILL.md +14 -103
- package/plugins/pm-claude/skills/pm-audit/agents/openai.yaml +4 -0
- package/plugins/pm-claude/skills/pm-developer/SKILL.md +20 -143
- package/plugins/pm-claude/skills/pm-developer/agents/openai.yaml +4 -0
- package/plugins/pm-claude/skills/pm-planner/SKILL.md +16 -167
- package/plugins/pm-claude/skills/pm-planner/agents/openai.yaml +4 -0
- package/plugins/pm-claude/skills/pm-release/SKILL.md +18 -102
- package/plugins/pm-claude/skills/pm-release/agents/openai.yaml +4 -0
- package/plugins/pm-claude/skills/pm-workflow/SKILL.md +25 -156
- package/plugins/pm-claude/skills/pm-workflow/agents/openai.yaml +4 -0
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/README.md +10 -2
- package/plugins/pm-codex/mcp.json +11 -0
- package/plugins/pm-codex/package.json +2 -2
- package/plugins/pm-codex/plugin.json +45 -0
- package/plugins/pm-codex/skills/pm-audit/SKILL.md +21 -0
- package/plugins/pm-codex/skills/pm-audit/agents/openai.yaml +4 -0
- package/plugins/pm-codex/skills/pm-auditor/SKILL.md +5 -40
- package/plugins/pm-codex/skills/pm-auditor/agents/openai.yaml +3 -5
- package/plugins/pm-codex/skills/pm-developer/SKILL.md +26 -0
- package/plugins/pm-codex/skills/pm-developer/agents/openai.yaml +4 -0
- package/plugins/pm-codex/skills/pm-native/SKILL.md +7 -87
- package/plugins/pm-codex/skills/pm-native/agents/openai.yaml +3 -5
- package/plugins/pm-codex/skills/pm-planner/SKILL.md +22 -0
- package/plugins/pm-codex/skills/pm-planner/agents/openai.yaml +4 -0
- package/plugins/pm-codex/skills/pm-release/SKILL.md +17 -38
- package/plugins/pm-codex/skills/pm-release/agents/openai.yaml +2 -4
- package/plugins/pm-codex/skills/pm-workflow/SKILL.md +39 -0
- package/plugins/pm-codex/skills/pm-workflow/agents/openai.yaml +4 -0
- package/dist/cli-bundle/chunks/chunk-JDHWZYZU.js +0 -238
- package/dist/cli-bundle/chunks/register-setup-HPHIKG5U.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-HQPTDJLF.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-V2X37U6J.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-Y2M4QLAA.js +0 -20
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$a as Mo,$c as Qo,$j as
|
|
1
|
+
import{$a as Mo,$c as Qo,$f as ct,$g as si,$j as se,A as W,B as ge,Bc as B,D as V,Ei as mi,Fb as Ho,H as de,Hb as Ko,Hd as Rt,Id as ei,Jd as En,Kb as Re,Kc as K,Kd as $n,Ki as fi,Ld as In,M as Ro,Mf as Se,Nd as ti,Ni as Dt,Od as ni,Oi as jt,Qa as Lo,Ra as Fo,Rd as oi,Ri as Ne,Sa as U,T as No,Uf as I,Vf as Z,W as Tt,Wf as ri,Wi as hi,Wj as yi,Xf as Y,Xi as Tn,Xj as De,Yd as ii,Yf as ie,Yj as lt,Zj as _i,_a as N,_f as ai,_j as wi,ab as Go,ad as st,ak as Ke,ba as Do,bb as Uo,bf as T,bg as Nt,bi as An,bk as vi,ck as pe,co as Lt,di as ci,dj as gi,ec as Sn,eh as H,ei as He,fa as vn,fc as Vo,gc as Ct,ha as jo,ic as ke,if as ee,ii as ae,k as Po,ka as bn,kc as xe,la as h,li as A,mi as Ee,ml as bi,na as m,nc as Yo,ni as $e,pc as Pt,qc as Xo,ra as Ot,rb as zo,rc as Zo,ri as li,sa as kn,sb as Jo,si as di,ta as xn,tb as qo,ti as Ie,ui as pi,vi as ui,wb as Wo,x as S,xb as Bo,y as At,z as re}from"./chunk-3BTJ66CB.js";import{mkdir as tc,readFile as nc}from"node:fs/promises";import Ii 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]="4d7f490a-03a3-512c-ba3c-b19fcc9a1270")}catch{}})();var On=class extends Error{constructor(t="Workspace transaction interrupted"){super(t),this.name="WorkspaceTransactionInterruptedError"}},oc="sdk-workspace-transaction",ic=/^[a-zA-Z0-9._-]+$/,rc=30,ac=3e3;function ki(e,t){if(typeof e!="string")throw new TypeError(`${t} must be a string`);let n=e.trim();if(!n||!ic.test(n))throw new TypeError(`${t} must match [a-zA-Z0-9._-]+`);return n}function xi(e,t){if(typeof e!="string")throw new TypeError(`${t} must be a string`);let n=e.trim();if(!n)throw new TypeError(`${t} must be non-empty`);return n}function Si(e,t,n){let o=e??t;if(!Number.isInteger(o)||o<=0)throw new TypeError(`${n} must be a positive integer`);return o}function Ai(e,t){return Ii.join(e,"transactions","sdk",`${t}.json`)}async function Ae(e,t){t.updatedAt=T();let n=Ai(e,t.transactionId);await tc(Ii.dirname(n),{recursive:!0}),await ge(n,`${JSON.stringify(t,null,2)}
|
|
2
2
|
`)}function sc(e){return Number.isInteger(e.attempt)&&typeof e.author=="string"&&typeof e.createdAt=="string"&&typeof e.updatedAt=="string"}function je(e){return Object.assign(Object.create(null),e)}function cc(e,t){try{let n=JSON.stringify(e,(o,i)=>{if(typeof i=="number"&&!Number.isFinite(i))throw new TypeError(`${t} contains a non-finite number`);if(i===void 0||typeof i=="function"||typeof i=="symbol")throw new TypeError(`${t} contains a non-JSON value`);return i});return JSON.parse(n)}catch(n){throw new TypeError(`${t} must be JSON serializable`,{cause:n})}}function Cn(e,t){return e===void 0?void 0:cc(e,t)}function Pn(e,t,n,o){let i=Cn(n,o);i===void 0?delete e[t]:e[t]=i}function Ei(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function $i(e,t){return Array.isArray(e)&&new Set(e).size===e.length&&e.every(n=>typeof n=="string"&&t.includes(n))}function lc(e,t){if(!$i(e.startedStepIds,t)||!$i(e.completedStepIds,t)||!Ei(e.results)||!Ei(e.compensationData))return!1;let n=e.startedStepIds,o=new Set(n),i=e.completedStepIds,r=new Set(i);return Object.keys(e.compensationData).some(a=>!o.has(a))||Object.keys(e.results).some(a=>!r.has(a))?!1:e.status==="committed"?t.every(a=>r.has(a)):e.status!=="compensated"||r.size===0&&o.size===0}function dc(e,t,n){let o;try{o=JSON.parse(e)}catch{throw new TypeError(`Workspace transaction ${t} journal is invalid JSON`)}if(!o||typeof o!="object"||Array.isArray(o))throw new TypeError(`Workspace transaction ${t} journal is invalid`);let i=o,r=i.schemaVersion===1&&i.transactionId===t,a=Array.isArray(i.stepIds)&&i.stepIds.length===n.length&&i.stepIds.every((d,p)=>d===n[p]),s=lc(i,n),c=sc(i),l=["applying","compensating","compensated","committed"].includes(String(i.status));if(!r||!a||!s||!c||!l)throw new TypeError(`Workspace transaction ${t} journal does not match the supplied plan`);return{...i,results:je(i.results),compensationData:je(i.compensationData)}}async function pc(e,t,n,o,i){let r=i,a=r!==void 0;if(r?.status==="compensating"&&await Ti(e,r),r===void 0||r.status==="compensated"){let s=T();r={schemaVersion:1,transactionId:t,author:n,status:"applying",attempt:(r?.attempt??0)+1,createdAt:r?.createdAt??s,updatedAt:s,stepIds:o,startedStepIds:[],completedStepIds:[],results:je(),compensationData:je()},await Ae(e.pmRoot,r),await ye(e,r,"prepared")}return{journal:r,recovered:a}}async function uc(e,t,n){try{await fc(t,e.steps),await Ae(e.pmRoot,t);let o=new Set(t.completedStepIds),i=new Set(t.startedStepIds);for(let r of e.steps){if(o.has(r.id))continue;let a=await r.inspect(),s=Cn(a.result,`Step ${r.id} result`);if(a.state!=="applied"){let c=await r.prepareCompensation?.();Pn(t.compensationData,r.id,c,`Step ${r.id} compensation data`),i.add(r.id),t.startedStepIds=e.steps.map(d=>d.id).filter(d=>i.has(d)),await Ae(e.pmRoot,t);let l=await r.apply();s=Cn(l,`Step ${r.id} result`)}await ye(e,t,"step_applied",r.id),o.add(r.id),t.completedStepIds=e.steps.map(c=>c.id).filter(c=>o.has(c)),Pn(t.results,r.id,s,`Step ${r.id} result`),await Ae(e.pmRoot,t),await ye(e,t,"step_recorded",r.id)}return await ye(e,t,"committing"),t.status="committed",await Ae(e.pmRoot,t),await ye(e,t,"committed"),{transactionId:t.transactionId,status:"committed",recovered:n,results:je(t.results)}}catch(o){if(o instanceof On||t.status==="committed")throw o;try{await Ti(e,t)}catch(i){throw new AggregateError([o,i],`Workspace transaction failed and compensation failed: ${String(i)}`,{cause:i})}throw o}}async function mc(e,t,n){try{return dc(await nc(Ai(e,t),"utf8"),t,n)}catch(o){if(o!==null&&typeof o=="object"&&"code"in o&&re(o))return;throw o}}async function ye(e,t,n,o){await e.onTransition?.({transactionId:t.transactionId,attempt:t.attempt,transition:n,...o===void 0?{}:{stepId:o}})}async function fc(e,t){let n=new Set,o=je();for(let i of t){let r=await i.inspect();r.state==="applied"&&(n.add(i.id),Pn(o,i.id,r.result,`Step ${i.id} result`))}e.results=o,e.completedStepIds=t.map(i=>i.id).filter(i=>n.has(i))}async function Ti(e,t){t.status="compensating",await Ae(e.pmRoot,t),await ye(e,t,"compensating");let n=new Set(t.completedStepIds),o=new Set(t.startedStepIds);for(let i of[...e.steps].reverse()){if(!o.has(i.id)&&!n.has(i.id))continue;let r;try{r=o.has(i.id)&&(await i.inspect()).state==="applied"}catch{r=o.has(i.id)}r&&(await ye(e,t,"step_compensating",i.id),await i.compensate(t.compensationData[i.id])),n.delete(i.id),o.delete(i.id),t.completedStepIds=e.steps.map(a=>a.id).filter(a=>n.has(a)),t.startedStepIds=e.steps.map(a=>a.id).filter(a=>o.has(a)),delete t.results[i.id],delete t.compensationData[i.id],await Ae(e.pmRoot,t),await ye(e,t,"step_compensated",i.id)}t.status="compensated",await Ae(e.pmRoot,t),await ye(e,t,"compensated")}async function Oi(e){let t=xi(e.pmRoot,"Transaction pmRoot"),n=ki(e.transactionId,"Transaction id"),o=xi(e.author,"Transaction author"),i=Si(e.lockTtlSeconds,rc,"Transaction lock TTL"),r=Si(e.lockWaitMs,ac,"Transaction lock wait"),a=[...e.steps];if(a.length===0)throw new TypeError("Workspace transaction requires at least one step");let s=a.map(d=>{let p=ki(d.id,"Transaction step id");if(p!==d.id)throw new TypeError("Transaction step id must not contain surrounding whitespace");return p});if(new Set(s).size!==s.length)throw new TypeError("Workspace transaction step ids must be unique");let c={...e,pmRoot:t,transactionId:n,author:o,steps:a,lockTtlSeconds:i,lockWaitMs:r},l=await ee(t,oc,i,o,!1,!1,r);try{let d=await mc(t,n,s),p=d!==void 0;if(d?.status==="committed")return{transactionId:n,status:"committed",recovered:!0,results:je(d.results)};let u=await pc(c,n,o,s,d);return await uc(c,u.journal,p||u.recovered)}finally{await l()}}import hc from"node:fs/promises";import gc 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]="c4dc16d1-672a-5b1c-b681-97a7b3febd69")}catch{}})();function Rn(e){return gc.join(e,"extension-migrations.json")}function Ci(e,t){let n=e.definition.id;return typeof n=="string"&&n.trim().length>0?n.trim():`migration-${String(t+1).padStart(3,"0")}`}function Pi(e,t){return`${e.layer}:${e.name}:${t}`}async function yc(e){let t=Rn(e);if(!await S(t))return{version:1,updated_at:"",entries:[]};let n=JSON.parse(await hc.readFile(t,"utf8"));return{version:1,updated_at:typeof n.updated_at=="string"?n.updated_at:"",entries:Array.isArray(n.entries)?n.entries.filter(o=>typeof o?.key=="string"&&(o.status==="applied"||o.status==="failed")):[]}}async function _c(e,t){let n=await yc(e),o=new Map(n.entries.map(i=>[i.key,i]));return t.forEach((i,r)=>{let a=Ci(i,r),s=o.get(Pi(i,a));s&&(i.definition.status=s.status,s.status==="failed"?i.definition.reason=s.error:(delete i.definition.reason,delete i.definition.error,delete i.definition.message))}),n}async function wc(e){let t=await _c(e.pmRoot,e.migrations),n=new Map(t.entries.map(d=>[d.key,d])),o=[],i=!1,r=e.migrations.map((d,p)=>({migration:d,index:p})).filter(({migration:d})=>e.scope===void 0||d.layer===e.scope);for(let{migration:d,index:p}of r){let u=Ci(d,p),g=Pi(d,u),y=n.get(g),w=String(d.definition.status??"pending").toLowerCase(),f=y?.status??(w==="applied"||w==="failed"?w:"pending");if(f==="applied"){o.push({key:g,layer:d.layer,extension:d.name,id:u,before:f,outcome:"skipped"});continue}if(e.dryRun===!0){o.push({key:g,layer:d.layer,extension:d.name,id:u,before:f,outcome:"pending"});continue}let _=d.runtime_definition?.run??d.definition.run;if(typeof _!="function"){o.push({key:g,layer:d.layer,extension:d.name,id:u,before:f,outcome:"pending"});continue}let v=new Date().toISOString();try{await Promise.resolve(_({id:u,command:"migration",layer:d.layer,extension:d.name,pm_root:e.pmRoot,status:f}));let k={key:g,layer:d.layer,extension:d.name,id:u,status:"applied",attempted_at:v};n.set(g,k),d.definition.status="applied",delete d.definition.reason,delete d.definition.error,delete d.definition.message,o.push({key:g,layer:d.layer,extension:d.name,id:u,before:f,outcome:"applied"}),i=!0}catch(k){let x=k instanceof Error?k.message:String(k),C={key:g,layer:d.layer,extension:d.name,id:u,status:"failed",attempted_at:v,error:x};n.set(g,C),d.definition.status="failed",d.definition.reason=x,o.push({key:g,layer:d.layer,extension:d.name,id:u,before:f,outcome:"failed",error:x}),i=!0}}if(i){let d=await A(e.pmRoot),p={version:1,updated_at:new Date().toISOString(),entries:[...n.values()].sort((u,g)=>u.key.localeCompare(g.key))};await He({pmRoot:e.pmRoot,filePath:Rn(e.pmRoot),raw:`${JSON.stringify(p,null,2)}
|
|
3
3
|
`,op:"extension_migrations_apply",author:e.author,lockTtlSeconds:d.locks.ttl_seconds,lockWaitMs:d.locks.wait_ms})}let a=o.filter(d=>d.outcome==="pending").length,s=o.filter(d=>d.outcome==="applied").length,c=o.filter(d=>d.outcome==="skipped").length,l=o.filter(d=>d.outcome==="failed").length;return{ok:l===0,dry_run:e.dryRun===!0,state_path:Rn(e.pmRoot),total:o.length,pending_count:a,applied_count:s,skipped_count:c,failed_count:l,migrations:o}}async function Ri(e){let t=await A(e.resolvedRoots.settings_root),n=await ke({pmRoot:e.resolvedRoots.pm_root,settings:t,cwd:process.cwd(),noExtensions:e.global.noExtensions===!0}),o=await xe(n);e.warnings.push(...n.warnings,...o.warnings);let i=await wc({pmRoot:e.resolvedRoots.pm_root,migrations:o.registrations.migrations,author:typeof e.global.author=="string"&&e.global.author.trim().length>0?e.global.author.trim():"pm-extension-migration",dryRun:e.options.dryRun===!0,...e.scope==="global"?{scope:"global"}:{}});return e.withResult({migration:i,load_failure_count:n.failed.length,activation_failure_count:o.failed.length},i.ok)}import{readFile as vc,writeFile as bc}from"node:fs/promises";import dt 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]="5b131b40-e139-5a7d-a6ef-633fe2cbee64")}catch{}})();var Di="# pm-cli:runtime-cache:start",Nn="# pm-cli:runtime-cache:end",ji=".agents/pm",kc=["runtime/","search/","locks/","transactions/","checkpoints/"],xc=["search/eval-queries.json"];async function Ni(e){try{return await e()}catch(t){throw t instanceof Error&&"code"in t&&typeof t.code=="string"&&["EACCES","EPERM","EROFS"].includes(t.code)?new m("The workspace .gitignore is not writable.",h.GENERIC_FAILURE,{code:"init_gitignore_unwritable",reason:t.code.toLowerCase(),required:"Grant the current user read and write access to the workspace .gitignore before initialization.",why:"pm init must publish its managed runtime-cache ignore fence without replacing unrelated entries.",nextSteps:["Grant read and write access to the workspace .gitignore and rerun pm init.","If the workspace is intentionally read-only, initialize pm in a writable workspace or clone."]}):t}}function Li(e){return e.replaceAll("\\","/").replace(/^\.\/+/,"").replace(/\/+$/,"")}function Dn(e){let t=e.replaceAll("\\","/");return dt.isAbsolute(e)||t===".."||t.startsWith("../")}function Sc(e=ji){let t=Li(e);return[Di,...kc.map(n=>n==="search/"?`${t}/${n}*`:`${t}/${n}`),...xc.map(n=>`!${t}/${n}`),Nn].join(`
|
|
4
4
|
`)}async function Fi(e,t={}){let n=dt.join(e,".gitignore"),o=ji;if(t.pmRoot!==void 0){let d=Li(dt.relative(dt.resolve(e),dt.resolve(t.pmRoot)));if(Dn(d))return{path:n,changed:!1};d.length>0&&(o=d)}let i="";try{i=await Ni(()=>vc(n,"utf8"))}catch(d){if(!(d instanceof Error&&"code"in d&&re(d)))throw d}let r=i.indexOf(Di),a=i.indexOf(Nn),c=(r>=0&&a>=r?`${i.slice(0,r)}${i.slice(a+Nn.length)}`:i).trimEnd(),l=`${c.length>0?`${c}
|
|
@@ -76,5 +76,5 @@ Agent guidance check
|
|
|
76
76
|
3/3 Project telemetry
|
|
77
77
|
`),Q.write(`Telemetry helps improve reliability and can be disabled anytime via pm config.
|
|
78
78
|
`);let c=t?"Y/n":"y/N",l=await n.question(`Enable telemetry for this project? [${c}] `),d=Us(l,t);return Q.write(`
|
|
79
|
-
`),{prefix:i,preset:s,telemetry_enabled:d}}finally{n.close()}}function af(e){return{presetFromOption:Ao(e.preset),useDefaults:e.defaults===!0,authorFromOption:Ls(e.author),installBundledPackages:e.withPackages===!0,agentGuidanceMode:Gs(e.agentGuidance),typePreset:js(e.typePreset)}}function sf(e){let t=[];return e.prefixArg!==void 0&&e.settings.id_prefix!==e.normalizedPrefix&&t.push("id_prefix"),e.presetFromOption!==void 0&&e.settings.governance.preset!==e.presetFromOption&&t.push("governance_preset"),e.authorFromOption!==void 0&&e.settings.author_default!==e.authorFromOption&&t.push("author_default"),t}function cf(e,t,n,o){if(t.length===0||n)return;let i=o.discovery==="ancestor";throw new m(`${i?`No tracker exists in ${o.requested_cwd}; pm init found an ancestor tracker at ${o.tracker_root}. `:""}Refusing to update existing tracker settings at ${e} without --force.`,h.USAGE,{code:"init_existing_settings_requires_force",type:"urn:pm-cli:error:init_existing_settings_requires_force",required:`--force for ${t.join(", ")}`,why:i?"Ancestor discovery is useful for normal commands, but init must make the selected existing workspace explicit before changing its identity or policy settings.":"pm init is safe to rerun, but changing id prefix, governance preset, or default author on an existing tracker can corrupt long-lived project context when an agent meant to initialize a sandbox path.",resolved_path:o.tracker_root,requested_path:o.requested_cwd,suggested_path:o.suggested_current_tracker_root,examples:["pm init --yes","pm init ./sandbox-pm --yes",...i?['pm init <name> --yes --pm-path "$PWD/.agents/pm"']:[],"pm init acme --yes --force"],nextSteps:[...i?['To create a new tracker in the current directory, rerun with --pm-path "$PWD/.agents/pm".']:[],"If you meant to initialize a sandbox tracker, pass a path-like positional such as ./sandbox-pm or /tmp/pm-test.","If you intentionally want to rewrite this existing tracker's init-managed settings, rerun with --force."]})}function lf(e){let t=!1;return e.prefixArg!==void 0&&e.settings.id_prefix!==e.normalizedPrefix&&(e.settings.id_prefix=e.normalizedPrefix,e.warnings.push(`updated:id_prefix:${e.normalizedPrefix}`),t=!0),e.presetFromOption!==void 0&&e.settings.governance.preset!==e.presetFromOption&&(To(e.settings,e.presetFromOption),e.warnings.push(`updated:governance_preset:${e.presetFromOption}`),t=!0),e.authorFromOption!==void 0&&e.settings.author_default!==e.authorFromOption&&(e.settings.author_default=e.authorFromOption,e.warnings.push(`updated:author_default:${e.authorFromOption}`),t=!0),t}async function df(e){let t=await A(e.pmRoot);e.warnings.push(`already_exists:${e.settingsPath}`);let n=sf({settings:t,normalizedPrefix:e.normalizedPrefix,prefixArg:e.prefixArg,presetFromOption:e.normalizedOptions.presetFromOption,authorFromOption:e.normalizedOptions.authorFromOption});return cf(e.settingsPath,n,e.options.force===!0,e.target),lf({settings:t,normalizedPrefix:e.normalizedPrefix,prefixArg:e.prefixArg,presetFromOption:e.normalizedOptions.presetFromOption,authorFromOption:e.normalizedOptions.authorFromOption,warnings:e.warnings})&&await Ee(e.pmRoot,t),{settings:t,normalizedPrefix:e.normalizedPrefix,chosenPreset:e.normalizedOptions.presetFromOption,wizardUsed:!1}}async function pf(e){let t=e.normalizedPrefix,n=e.normalizedOptions.presetFromOption,o,i=!1;if(e.normalizedOptions.presetFromOption===void 0&&!e.normalizedOptions.useDefaults&&process.stdin.isTTY===!0&&process.stdout.isTTY===!0){let c=await Hs(t,bn.telemetry.enabled);t=c.prefix,n=c.preset,o=c.telemetry_enabled,i=!0}let r=n??"minimal",a=nf();a.id_prefix=t,To(a,r);let s=si()?.trim()||void 0;return a.author_default=e.normalizedOptions.authorFromOption??s??"",o!==void 0&&(a.telemetry.enabled=o,a.telemetry.first_run_prompt_completed=!0),await Ee(e.pmRoot,a),{settings:a,normalizedPrefix:t,chosenPreset:n,wizardUsed:i}}async function Ps(e){return e.settingsExists?await df(e):await pf({pmRoot:e.pmRoot,normalizedPrefix:e.normalizedPrefix,normalizedOptions:e.normalizedOptions})}async function uf(e){let t=await Cs({pm_root:e.pmRoot,cwd:e.cwd,mode:e.agentGuidanceMode,interactive:process.stdin.isTTY===!0&&process.stdout.isTTY===!0,settings:e.settings});return e.warnings.push(...t.warnings),t.settings_changed&&await Ee(e.pmRoot,e.settings),{...t.summary,next_steps:t.next_steps}}async function mf(e,t){let n=[],o=[],i=await ai(e,t.schema);for(let r of i.created_paths)n.push(r),o.push(...await K({path:r,scope:"project",op:"init:runtime_schema_file"}));return{createdDirs:n,warnings:o}}async function ff(e){if(e.typePreset===void 0)return;let t=await Js(e.pmRoot,e.settings,e.typePreset);return e.warnings.push(`registered_type_preset:${e.typePreset}`),e.warnings.push(...await K({path:t.file,scope:"project",op:"init:type_preset"})),t}async function hf(e){let n=U(e.settings,B()).folders.filter(i=>!vn.includes(i)),o=await Bs(e.pmRoot,n);e.createdDirs.push(...o.createdDirs),e.warnings.push(...o.warnings)}function gf(e){let t=L.resolve(e.tracker_root),n=L.dirname(t);return L.basename(t)==="pm"&&L.basename(n)===".agents"?L.dirname(n):e.workspace_root}async function yf(e,t,n,o){if(!e)return;let i=await wo("all",{install:!0,project:!0},{...t,path:n});o.push(...i.warnings);let r=zs(i),a=r.packages.filter(s=>!s.ok).map(s=>s.alias);if(!r.installed_all||a.length>0)throw new m(`pm init --with-packages did not install all bundled packages successfully${a.length>0?`: ${a.join(", ")}`:"."}`,h.GENERIC_FAILURE);return r}function Ks(e){let t=o=>st([...e.target.mode==="workspace-discovery"?[]:["--pm-path",e.target.tracker_root],...o]),n=[`Create your first item: ${t(["create","--type","Task","--title","<title>"])}`,`List active items: ${t(["list"])}`,`Get agent-friendly project context: ${t(["context"])}`];e.installBundledPackages?n.push(`Explore newly-available commands: ${t(["cal"])}, ${t(["templates"])}, ${t(["guide"])}`):(n.push(`Add optional packages for richer workflows: ${t(["install","calendar","--project"])}, ${t(["install","templates","--project"])}, ${t(["install","guide-shell","--project"])}`),n.push(`Or install everything bundled: ${t(["init","--with-packages"])} (idempotent on re-run)`)),e.registeredTypePreset&&n.push(`Inspect registered preset types: ${t(["schema","list"])}, ${t(["schema","show",e.registeredTypePreset.registered[0]??e.registeredTypePreset.updated[0]])}`),n.push("Supported agent harnesses are attributed automatically; use --author or PM_AUTHOR only when an explicit identity override is required.");for(let o of e.agentGuidanceNextSteps){let i=e.target.mode==="workspace-discovery"?o:o.replace(/\bpm (?=[a-z])/g,()=>`${t([])} `);n.includes(i)||n.push(i)}return n}async function Vs(e,t,n,o=qn){if(t===null){n.push("merge_fence_skipped:not_git_repository:run pm merge install after moving the tracker into a Git repository");return}try{let i=await o({pmRoot:e,workspaceRoot:t});i.gitattributes.changed&&n.push(`updated:merge_fence:${i.gitattributes.path}`)}catch(i){if(!(i instanceof m))throw i;n.push(`merge_fence_skipped:install_failed:${i.context.code??"pm_error"}:${i.message}:run pm merge install after resolving the Git repository error`)}}async function _f(e,t,n,o){if(e==null||n==="status")return;let i=await Fi(e,{pmRoot:t});i.changed&&o.push(`updated:gitignore:${i.path}`)}async function mb(e,t,n={}){let o=t[ef],i=typeof o=="string"?o:process.cwd(),r=Fs(i,t,e,n.workspace),a=r.pmRoot;e=Ms(r.prefixArg,n.idPrefix);let s=af(n);await Ws(a,r.target.mode==="tracker-path",n.force===!0);let c=[],l=[],d=L.join(a,"settings.json"),p=await S(d),u;p&&(u=await Ps({pmRoot:a,settingsPath:d,settingsExists:p,normalizedPrefix:$e(e),prefixArg:e,options:n,normalizedOptions:s,warnings:l,target:r.target}));let g=await Bs(a,vn);c.push(...g.createdDirs),l.push(...g.warnings),u??=await Ps({pmRoot:a,settingsPath:d,settingsExists:p,normalizedPrefix:$e(e),prefixArg:e,options:n,normalizedOptions:s,warnings:l,target:r.target});let{settings:y}=u,w=gf(r.target),f=await Wt(w??L.dirname(a)),_=w??f,v=await uf({pmRoot:a,cwd:_??i,agentGuidanceMode:s.agentGuidanceMode,settings:y,warnings:l}),k=await mf(a,y);c.push(...k.createdDirs),l.push(...k.warnings);let x=await ff({pmRoot:a,settings:y,typePreset:s.typePreset,warnings:l});x&&(y=await A(a)),await hf({pmRoot:a,settings:y,createdDirs:c,warnings:l}),await _f(_,a,s.agentGuidanceMode,l),!p&&n.mergeFence!==!1&&s.agentGuidanceMode!=="status"&&await Vs(a,f,l);let C=await yf(s.installBundledPackages,t,a,l),G=Ks({installBundledPackages:s.installBundledPackages,registeredTypePreset:x,agentGuidanceNextSteps:v.next_steps,target:r.target});return{ok:!0,path:a,target:r.target,settings:y,created_dirs:c,warnings:l,governance_preset:y.governance.preset,wizard_used:u.wizardUsed,...x?{registered_type_preset:x}:{},...C?{installed_packages:C}:{},next_steps:G,agent_guidance:v}}export{On as a,Oi as b,Rn as c,yc as d,_c as e,wc as f,Ri as g,Mp as h,Di as i,Nn as j,kc as k,Sc as l,Fi as m,Ve as n,$c as o,Ic as p,Gi as q,Ut as r,Le as s,Ft as t,Mn as u,jc as v,Lc as w,Bf as x,zt as y,Ki as z,Xe as A,Un as B,Kc as C,Wt as D,Jn as E,Zi as F,wh as G,vh as H,Qi as I,bh as J,qn as K,mr as L,et as M,tt as N,fr as O,dr as P,Ze as Q,Qe as R,pr as S,Xc as T,Sh as U,Ah as V,tr as W,el as X,Wh as Y,vr as Z,Sr as _,Ml as $,Gl as aa,q_ as ba,H_ as ca,K_ as da,xt as ea,V_ as fa,Y_ as ga,X_ as ha,Z_ as ia,Q_ as ja,ew as ka,tw as la,nw as ma,ow as na,iw as oa,rw as pa,aw as qa,sw as ra,cw as sa,lw as ta,dw as ua,pw as va,uw as wa,mw as xa,fw as ya,hw as za,gw as Aa,yw as Ba,_w as Ca,ww as Da,
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
79
|
+
`),{prefix:i,preset:s,telemetry_enabled:d}}finally{n.close()}}function af(e){return{presetFromOption:Ao(e.preset),useDefaults:e.defaults===!0,authorFromOption:Ls(e.author),installBundledPackages:e.withPackages===!0,agentGuidanceMode:Gs(e.agentGuidance),typePreset:js(e.typePreset)}}function sf(e){let t=[];return e.prefixArg!==void 0&&e.settings.id_prefix!==e.normalizedPrefix&&t.push("id_prefix"),e.presetFromOption!==void 0&&e.settings.governance.preset!==e.presetFromOption&&t.push("governance_preset"),e.authorFromOption!==void 0&&e.settings.author_default!==e.authorFromOption&&t.push("author_default"),t}function cf(e,t,n,o){if(t.length===0||n)return;let i=o.discovery==="ancestor";throw new m(`${i?`No tracker exists in ${o.requested_cwd}; pm init found an ancestor tracker at ${o.tracker_root}. `:""}Refusing to update existing tracker settings at ${e} without --force.`,h.USAGE,{code:"init_existing_settings_requires_force",type:"urn:pm-cli:error:init_existing_settings_requires_force",required:`--force for ${t.join(", ")}`,why:i?"Ancestor discovery is useful for normal commands, but init must make the selected existing workspace explicit before changing its identity or policy settings.":"pm init is safe to rerun, but changing id prefix, governance preset, or default author on an existing tracker can corrupt long-lived project context when an agent meant to initialize a sandbox path.",resolved_path:o.tracker_root,requested_path:o.requested_cwd,suggested_path:o.suggested_current_tracker_root,examples:["pm init --yes","pm init ./sandbox-pm --yes",...i?['pm init <name> --yes --pm-path "$PWD/.agents/pm"']:[],"pm init acme --yes --force"],nextSteps:[...i?['To create a new tracker in the current directory, rerun with --pm-path "$PWD/.agents/pm".']:[],"If you meant to initialize a sandbox tracker, pass a path-like positional such as ./sandbox-pm or /tmp/pm-test.","If you intentionally want to rewrite this existing tracker's init-managed settings, rerun with --force."]})}function lf(e){let t=!1;return e.prefixArg!==void 0&&e.settings.id_prefix!==e.normalizedPrefix&&(e.settings.id_prefix=e.normalizedPrefix,e.warnings.push(`updated:id_prefix:${e.normalizedPrefix}`),t=!0),e.presetFromOption!==void 0&&e.settings.governance.preset!==e.presetFromOption&&(To(e.settings,e.presetFromOption),e.warnings.push(`updated:governance_preset:${e.presetFromOption}`),t=!0),e.authorFromOption!==void 0&&e.settings.author_default!==e.authorFromOption&&(e.settings.author_default=e.authorFromOption,e.warnings.push(`updated:author_default:${e.authorFromOption}`),t=!0),t}async function df(e){let t=await A(e.pmRoot);e.warnings.push(`already_exists:${e.settingsPath}`);let n=sf({settings:t,normalizedPrefix:e.normalizedPrefix,prefixArg:e.prefixArg,presetFromOption:e.normalizedOptions.presetFromOption,authorFromOption:e.normalizedOptions.authorFromOption});return cf(e.settingsPath,n,e.options.force===!0,e.target),lf({settings:t,normalizedPrefix:e.normalizedPrefix,prefixArg:e.prefixArg,presetFromOption:e.normalizedOptions.presetFromOption,authorFromOption:e.normalizedOptions.authorFromOption,warnings:e.warnings})&&await Ee(e.pmRoot,t),{settings:t,normalizedPrefix:e.normalizedPrefix,chosenPreset:e.normalizedOptions.presetFromOption,wizardUsed:!1}}async function pf(e){let t=e.normalizedPrefix,n=e.normalizedOptions.presetFromOption,o,i=!1;if(e.normalizedOptions.presetFromOption===void 0&&!e.normalizedOptions.useDefaults&&process.stdin.isTTY===!0&&process.stdout.isTTY===!0){let c=await Hs(t,bn.telemetry.enabled);t=c.prefix,n=c.preset,o=c.telemetry_enabled,i=!0}let r=n??"minimal",a=nf();a.id_prefix=t,To(a,r);let s=si()?.trim()||void 0;return a.author_default=e.normalizedOptions.authorFromOption??s??"",o!==void 0&&(a.telemetry.enabled=o,a.telemetry.first_run_prompt_completed=!0),await Ee(e.pmRoot,a),{settings:a,normalizedPrefix:t,chosenPreset:n,wizardUsed:i}}async function Ps(e){return e.settingsExists?await df(e):await pf({pmRoot:e.pmRoot,normalizedPrefix:e.normalizedPrefix,normalizedOptions:e.normalizedOptions})}async function uf(e){let t=await Cs({pm_root:e.pmRoot,cwd:e.cwd,mode:e.agentGuidanceMode,interactive:process.stdin.isTTY===!0&&process.stdout.isTTY===!0,settings:e.settings});return e.warnings.push(...t.warnings),t.settings_changed&&await Ee(e.pmRoot,e.settings),{...t.summary,next_steps:t.next_steps}}async function mf(e,t){let n=[],o=[],i=await ai(e,t.schema);for(let r of i.created_paths)n.push(r),o.push(...await K({path:r,scope:"project",op:"init:runtime_schema_file"}));return{createdDirs:n,warnings:o}}async function ff(e){if(e.typePreset===void 0)return;let t=await Js(e.pmRoot,e.settings,e.typePreset);return e.warnings.push(`registered_type_preset:${e.typePreset}`),e.warnings.push(...await K({path:t.file,scope:"project",op:"init:type_preset"})),t}async function hf(e){let n=U(e.settings,B()).folders.filter(i=>!vn.includes(i)),o=await Bs(e.pmRoot,n);e.createdDirs.push(...o.createdDirs),e.warnings.push(...o.warnings)}function gf(e){let t=L.resolve(e.tracker_root),n=L.dirname(t);return L.basename(t)==="pm"&&L.basename(n)===".agents"?L.dirname(n):e.workspace_root}async function yf(e,t,n,o){if(!e)return;let i=await wo("all",{install:!0,project:!0},{...t,path:n});o.push(...i.warnings);let r=zs(i),a=r.packages.filter(s=>!s.ok).map(s=>s.alias);if(!r.installed_all||a.length>0)throw new m(`pm init --with-packages did not install all bundled packages successfully${a.length>0?`: ${a.join(", ")}`:"."}`,h.GENERIC_FAILURE);return r}function Ks(e){let t=o=>st([...e.target.mode==="workspace-discovery"?[]:["--pm-path",e.target.tracker_root],...o]),n=[`Create your first item: ${t(["create","--type","Task","--title","<title>"])}`,`List active items: ${t(["list"])}`,`Get agent-friendly project context: ${t(["context"])}`];e.installBundledPackages?n.push(`Explore newly-available commands: ${t(["cal"])}, ${t(["templates"])}, ${t(["guide"])}`):(n.push(`Add optional packages for richer workflows: ${t(["install","calendar","--project"])}, ${t(["install","templates","--project"])}, ${t(["install","guide-shell","--project"])}`),n.push(`Or install everything bundled: ${t(["init","--with-packages"])} (idempotent on re-run)`)),e.registeredTypePreset&&n.push(`Inspect registered preset types: ${t(["schema","list"])}, ${t(["schema","show",e.registeredTypePreset.registered[0]??e.registeredTypePreset.updated[0]])}`),n.push("Supported agent harnesses are attributed automatically; use --author or PM_AUTHOR only when an explicit identity override is required.");for(let o of e.agentGuidanceNextSteps){let i=e.target.mode==="workspace-discovery"?o:o.replace(/\bpm (?=[a-z])/g,()=>`${t([])} `);n.includes(i)||n.push(i)}return n}async function Vs(e,t,n,o=qn){if(t===null){n.push("merge_fence_skipped:not_git_repository:run pm merge install after moving the tracker into a Git repository");return}try{let i=await o({pmRoot:e,workspaceRoot:t});i.gitattributes.changed&&n.push(`updated:merge_fence:${i.gitattributes.path}`)}catch(i){if(!(i instanceof m))throw i;n.push(`merge_fence_skipped:install_failed:${i.context.code??"pm_error"}:${i.message}:run pm merge install after resolving the Git repository error`)}}async function _f(e,t,n,o){if(e==null||n==="status")return;let i=await Fi(e,{pmRoot:t});i.changed&&o.push(`updated:gitignore:${i.path}`)}async function mb(e,t,n={}){let o=t[ef],i=typeof o=="string"?o:process.cwd(),r=Fs(i,t,e,n.workspace),a=r.pmRoot;e=Ms(r.prefixArg,n.idPrefix);let s=af(n);await Ws(a,r.target.mode==="tracker-path",n.force===!0);let c=[],l=[],d=L.join(a,"settings.json"),p=await S(d),u;p&&(u=await Ps({pmRoot:a,settingsPath:d,settingsExists:p,normalizedPrefix:$e(e),prefixArg:e,options:n,normalizedOptions:s,warnings:l,target:r.target}));let g=await Bs(a,vn);c.push(...g.createdDirs),l.push(...g.warnings),u??=await Ps({pmRoot:a,settingsPath:d,settingsExists:p,normalizedPrefix:$e(e),prefixArg:e,options:n,normalizedOptions:s,warnings:l,target:r.target});let{settings:y}=u,w=gf(r.target),f=await Wt(w??L.dirname(a)),_=w??f,v=await uf({pmRoot:a,cwd:_??i,agentGuidanceMode:s.agentGuidanceMode,settings:y,warnings:l}),k=await mf(a,y);c.push(...k.createdDirs),l.push(...k.warnings);let x=await ff({pmRoot:a,settings:y,typePreset:s.typePreset,warnings:l});x&&(y=await A(a)),await hf({pmRoot:a,settings:y,createdDirs:c,warnings:l}),await _f(_,a,s.agentGuidanceMode,l),!p&&n.mergeFence!==!1&&s.agentGuidanceMode!=="status"&&await Vs(a,f,l);let C=await yf(s.installBundledPackages,t,a,l),G=Ks({installBundledPackages:s.installBundledPackages,registeredTypePreset:x,agentGuidanceNextSteps:v.next_steps,target:r.target});return{ok:!0,path:a,target:r.target,settings:y,created_dirs:c,warnings:l,governance_preset:y.governance.preset,wizard_used:u.wizardUsed,...x?{registered_type_preset:x}:{},...C?{installed_packages:C}:{},next_steps:G,agent_guidance:v}}export{On as a,Oi as b,Rn as c,yc as d,_c as e,wc as f,Ri as g,Mp as h,Di as i,Nn as j,kc as k,Sc as l,Fi as m,Ve as n,$c as o,Ic as p,Gi as q,Ut as r,Le as s,Ft as t,Mn as u,jc as v,Lc as w,Bf as x,zt as y,Ki as z,Xe as A,Un as B,Kc as C,Wt as D,Jn as E,Zi as F,wh as G,vh as H,Qi as I,bh as J,qn as K,mr as L,et as M,tt as N,fr as O,dr as P,Ze as Q,Qe as R,pr as S,Xc as T,Sh as U,Ah as V,tr as W,el as X,Wh as Y,vr as Z,Sr as _,Ml as $,Gl as aa,q_ as ba,H_ as ca,K_ as da,xt as ea,V_ as fa,Y_ as ga,X_ as ha,Z_ as ia,Q_ as ja,ew as ka,tw as la,nw as ma,ow as na,iw as oa,rw as pa,aw as qa,sw as ra,cw as sa,lw as ta,dw as ua,pw as va,uw as wa,mw as xa,fw as ya,hw as za,gw as Aa,yw as Ba,_w as Ca,ww as Da,te as Ea,b as Fa,Xn as Ga,od as Ha,we as Ia,Kt as Ja,Ul as Ka,mt as La,Vt as Ma,Mr as Na,Kr as Oa,lo as Pa,ca as Qa,My as Ra,su as Sa,za as Ta,Ja as Ua,Wa as Va,va as Wa,Lp as Xa,yu as Ya,ka as Za,wo as _a,ws as $a,Uv as ab,Cs as bb,ef as cb,pb as db,ub as eb,mb as fb};
|
|
80
|
+
//# sourceMappingURL=chunk-V5UGBYHN.js.map
|
package/dist/cli-bundle/chunks/{register-list-query-IZ7ZVTDE.js → register-list-query-6PAJ4PBU.js}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{b as g,c as I,d as D}from"./chunk-
|
|
1
|
+
import{b as g,c as I,d as D}from"./chunk-LKGQUZ5M.js";import{a as de}from"./chunk-AUS6USO4.js";import{L as ne,P as ie,U as ae,n as te,u as A,w as oe}from"./chunk-JX6WCCHL.js";import{$a as Q,Gc as K,Sc as W,Uc as X,Wc as Y,Yb as V,Zc as Z,_c as ee,aa as q,ad as re,bd as se,cd as le,na as L}from"./chunk-7TAGYNFP.js";import"./chunk-DEZPZOQ7.js";import{$o as H,Ec as k,Ff as v,Go as y,If as f,Jf as m,Jo as s,Lo as d,Tj as R,To as G,Uj as T,Uo as M,Vo as $,Wo as B,Xo as U,Yo as N,Zo as z,_a as O,_o as P,ap as J,l as E,la as c,li as j,m as C,na as u,zf as S}from"./chunk-3BTJ66CB.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="19d28e23-5337-5ec0-83e6-6e43b462ece7")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="10ce695f-65e7-5ea4-bdd8-472ad9527506")}catch{}})();async function fe(e,t){let o=y(t),i=Date.now();if([e.raw,e.compact,e.full,e.provenance].filter(l=>l===!0).length>1)throw new u("Activity projection options are mutually exclusive. Use --raw, --compact, --provenance, or --full.",c.USAGE);let a=P(e.stream);if(a&&!o.json)throw new u("--stream requires --json output mode.",c.USAGE);let n=z(e),r=await V(a&&e.full!==!0&&e.provenance!==!0?{...n,raw:!0,compact:!0}:n,o);a?B(r,n,o):f(r,o),o.profile&&m(`profile:command=activity took_ms=${Date.now()-i}`)}function F(e){e.option("--id <value>","Filter by item ID").option("--op <value>","Filter by history operation").option("--author <value>","Filter by history author").option("--from <value>","Lower timestamp bound (ISO/date string or relative)").option("--to <value>","Upper timestamp bound (ISO/date string or relative)").option("--limit <n>","Return only the latest n activity entries").option("--unbounded","Explicitly return every matching activity entry (disables the default bound)").option("--compact","Condensed output: show only id, op, ts, author, msg per entry").option("--raw","Show the legacy compact per-event stream instead of the item digest").option("--full","Show full activity entries with JSON Patch payloads").option("--provenance","Show patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include bounded provenance completeness counts").option("--harness <value>","Filter by recorded or vocabulary-resolved harness (repeatable)",s).option("--agent-instance <value>","Filter by privacy-safe agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter by an exact declared provenance value (repeatable)",s).option("--stream [mode]","Emit line-delimited JSON rows (requires --json). Optional mode: rows|ndjson|jsonl").description("Show recent activity across items.").action(fe)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1a62fe05-4407-5e76-87fa-5109dcca5640")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="25c5349b-60d7-505b-98b0-3ed19e44b791")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b40cde4c-ca5a-522d-a731-52503c7e4fe0")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9212f45c-798d-5774-87ce-bb7d6ff5514a")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="deee1339-ac17-5ae9-8add-a9dd766d182e")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="de0fbee0-0bcf-5a46-9013-f7f883d3d0a3")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b662e21b-a163-5834-8789-65243f4c7c9c")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5cc1722c-b797-5b95-a493-3925003ba72e")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="35c679a2-9d47-51fa-8bd2-175a4ec48d6b")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="507df40e-86e4-532b-8e84-3c5a3baad385")}catch{}})();function ye(e,t){return!t||t.size===0?!0:e==="context"?t.has("context")||t.has("ctx"):t.has(e)}function ce(e){if(e===void 0)return;if(typeof e!="string")throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE);let t=e.trim().toLowerCase();if(t==="csv"||t==="table"||t==="json"||t==="ndjson"||t==="toon")return t;throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE)}function _(e,t,o,i=!1){if(t===void 0)return o;if(typeof t!="string")throw new u(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,c.USAGE);let a=t.trim().toLowerCase();if(a!=="json"&&(a!=="ndjson"||!i)&&a!=="toon")throw new u(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,c.USAGE);if(o.json===!0&&a==="toon")throw new u(`${e} cannot combine --json with --format toon`,c.USAGE);return{...o,json:a==="json"||a==="ndjson"}}function he(e,t){q[t]==="brief"&&e.includeBody!==!0&&e.compact!==!0&&e.brief!==!0&&e.full!==!0&&e.fields===void 0&&(e.brief=!0)}function ue(e){e.option("--has-notes","Show only items that have notes").option("--has-learnings","Show only items that have learnings").option("--has-files","Show only items that have linked files").option("--has-docs","Show only items that have linked docs").option("--has-tests","Show only items that have linked tests").option("--has-comments","Show only items that have comments").option("--has-deps","Show only items that have dependencies").option("--has-body","Show only items that have a non-empty body").option("--has-linked-command","Show only items whose linked tests carry a runnable command").option("--no-notes","Show only items that have no notes").option("--no-learnings","Show only items that have no learnings").option("--no-files","Show only items that have no linked files").option("--filter-files-missing","Alias for --no-files").option("--no-docs","Show only items that have no linked docs").option("--filter-docs-missing","Alias for --no-docs").option("--no-tests","Show only items that have no linked tests").option("--no-comments","Show only items that have no comments").option("--no-deps","Show only items that have no dependencies").option("--empty-body","Show only items with an empty body").option("--no-linked-command","Show only items whose linked tests carry no runnable command").option("--filter-reviewer-missing","Show only items missing reviewer").option("--filter-risk-missing","Show only items missing risk").option("--filter-confidence-missing","Show only items missing confidence").option("--filter-sprint-missing","Show only items missing sprint").option("--filter-release-missing","Show only items missing release")}var ve={draft:{name:"list-draft",dependencyBlocked:!1},open:{name:"list-open",dependencyBlocked:!1},in_progress:{name:"list-in-progress",dependencyBlocked:!1},blocked:{name:"list-blocked",dependencyBlocked:!0},closed:{name:"list-closed",dependencyBlocked:!1},canceled:{name:"list-canceled",dependencyBlocked:!1}};function ge(e,t){let o=e.stream===!0,i=ce(e.format),a=i==="csv"||i==="table",n=i==="json"||i==="ndjson"||i==="toon"?_("List",e.format,t,!0):t;if(o&&!n.json)throw new u("--stream requires --json output mode.",c.USAGE);if((a||i==="ndjson")&&o)throw new u("--format csv|table|ndjson cannot be combined with --stream.",c.USAGE);return{streamMode:o,listFormat:i,effectiveGlobal:n}}function be(e,t,o){if(o.listFormat==="csv"||o.listFormat==="table"){k(t);let i=t.items,a=o.listFormat==="csv"?R(i):T(i);!o.effectiveGlobal.quiet&&a.length>0&&v(`${a}
|
|
2
2
|
`)}else if(o.listFormat==="ndjson"){k(t);let i=I(t.items);!o.effectiveGlobal.quiet&&i.length>0&&v(`${i}
|
|
3
|
-
`)}else o.streamMode
|
|
3
|
+
`)}else o.streamMode?$(e,t,o.effectiveGlobal):f(t,o.effectiveGlobal)}async function we(e){let t=y(e.actionCommand),o=e.aliasContract?{...t,command:e.aliasContract.canonical}:t,i=Date.now();e.aliasContract?.lifecycle==="deprecated"&&await j(O(process.cwd(),o.path)).then(me=>me.ux.deprecation_hints)&&m(C(e.aliasContract));let a=S("list",e.options),n=G(a),r=xe(e,n),{effectiveName:l,effectiveStatus:h,effectiveDependencyBlocked:p,effectiveExcludeTerminal:w}=r;he(n,l),Object.assign(n,{projectionCommand:l}),w&&(n.excludeTerminal=!0),n.dependencyBlocked=p;let x=ge(a,o),pe=await L(p?void 0:h,n,o);be("list",pe,x),o.profile&&m(`profile:command=list took_ms=${Date.now()-i}`)}function xe(e,t){let o=e.name,i=e.status,a=e.dependencyBlocked===!0,n=e.excludeTerminal===!0,r=t.status?.trim().toLowerCase(),l=e.name==="list"&&r!==void 0?ve[r]:void 0;return e.name==="list"&&(e.options.all===!0||r==="all"?(o="list-all",n=!1,t.status=void 0):r!==void 0&&l!==void 0&&(o=l.name,i=r,a=l.dependencyBlocked,n=!1,t.status=void 0)),(o==="list-open"||o==="list-in-progress")&&(t.lifecycleBucket=o==="list-open"?"open":"in_progress",i=void 0),{effectiveName:o,effectiveStatus:i,effectiveDependencyBlocked:a,effectiveExcludeTerminal:n}}function ke(e,t){let{name:o,description:i,status:a,excludeTerminal:n,allowStatusFilter:r,dependencyBlocked:l,aliasContract:h}=t,p=e.command(o,{hidden:h?.hidden===!0}).description(i);r&&p.option("--status <value>","Filter by status (repeatable or comma-separated; matches any; all selects every status)",s),o==="list"&&p.option("--all","Include every lifecycle status"),p.option("--for <intent>",`Apply a declared context intent projection. ${g("list","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--type <value>","Filter by item type (repeatable or comma-separated; matches any)",s).option("--tag <value>","Filter by tag (repeatable or comma-separated; matches any)",s).option("--priority <value>","Filter by priority (repeatable or comma-separated; matches any)",s).option("--deadline-before <value>","Filter by deadline upper bound (ISO/date string or relative)").option("--deadline-after <value>","Filter by deadline lower bound (ISO/date string or relative)").option("--today","Filter to items updated since local midnight today").option("--recent","Filter to items updated in the last 7 days").option("--updated-after <value>","Updated since ISO timestamp or signed relative (-2h/-7d for past); use last-window ISO").option("--updated-before <value>","Filter by updated_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-after <value>","Filter by created_at lower bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-before <value>","Filter by created_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--ids <value>","Filter by explicit item IDs (comma-separated or repeatable)").option("--assignee <value>","Filter by assignee",s).option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--parent <value>","Filter by parent item ID").option("--sprint <value>","Filter by sprint",s).option("--release <value>","Filter by release",s).option("--filter-ac-missing","Show only items missing acceptance_criteria").option("--filter-estimates-missing","Show only items missing estimated_minutes").option("--filter-resolution-missing","Show only terminal items missing resolution").option("--filter-metadata-missing","Show only items missing any tracked metadata (AC, estimate, or resolution)").option("--limit <n>","Alias for --output-limit; --output-budget may cap rows").option("--offset <n>","Skip the first n matching rows before limit is applied").option("--after <cursor>","Continue after an opaque next_cursor from a previous list response").option("--no-truncate","Return every matched row after the explicit status and field filters").option("--include-body","Include item body in each returned list row").option("--strict-read","Fail closed if any item document or item directory cannot be read").option("--compact","Render compact list projection fields (mutually exclusive with --brief/--full/--fields)").option("--brief","Ultra-compact output: id, status, type, title only (agent-optimized, mutually exclusive with --compact/--full/--fields)").option("--full","Render full list projection fields (mutually exclusive with --compact/--brief/--fields)").option("--fields <value>",`Render custom comma-separated list fields (mutually exclusive with --compact/--brief/--full). ${g(o,"--fields")}`).option("--sort <value>","Sort field: priority|deadline|updated_at|created_at|title|parent (aliases: updated, created)").option("--order <value>","Sort order: asc|desc (requires --sort)").option("--tree","Render rows in parent/child tree order").option("--tree-depth <n>","Maximum recursion depth with --tree (0 keeps root rows only)").option("--format <value>","Output render mode: csv|table (human export) or json|ndjson|toon (machine output override)").option("--stream","Emit line-delimited JSON rows (requires --json)"),ue(p),p.action(async(w,x)=>{await we({name:o,status:a,excludeTerminal:n,dependencyBlocked:l,options:w,actionCommand:x,aliasContract:h})}),d(p,"--tags <value>","Alias for --tag"),d(p,"--assignee_filter <value>","Alias for --assignee-filter"),d(p,"--tree_depth <n>","Alias for --tree-depth"),d(p,"--token_budget <n>","Alias for --token-budget"),d(p,"--filter-estimate-missing","Alias for --filter-estimates-missing")}async function Se(e,t){let o=y(t),i=Date.now(),a=await te(M(e),o);f(a,o),o.profile&&m(`profile:command=aggregate took_ms=${Date.now()-i}`)}async function _e(e,t){let o=y(t),i=Date.now(),a=H(S("context",e)),n=await X(a,o),r=K(a,o);if(r==="markdown")o.quiet||v(`${W(n)}
|
|
4
4
|
`);else if(r==="ndjson"){k(n);let l=I([...n.high_level,...n.low_level,...n.blocked_fallback]);!o.quiet&&l.length>0&&v(`${l}
|
|
5
5
|
`)}else f(n,{...o,json:r==="json"});o.profile&&m(`profile:command=context took_ms=${Date.now()-i}`)}async function Ie(e,t){let o=y(t),i=Date.now(),a=J(S("next",e)),n=await Z(a,o),r=Y(a,o);r==="markdown"?o.quiet||v(`${ee(n)}
|
|
6
6
|
`):f(n,{...o,json:r==="json"}),o.profile&&m(`profile:command=next took_ms=${Date.now()-i}`)}async function Ae(e,t,o){let i=y(o),a=Date.now(),n=N(e),r=S("search",t,[n]),l=U(r),h=await ne(n,l,i),p=typeof r.format=="string"?r.format.trim().toLowerCase():void 0,w=_("Search",r.format,i,!0);if(p==="ndjson"){k(h);let x=I(h.items);!w.quiet&&x.length>0&&v(`${x}
|
|
7
|
-
`)}else f(h,w);i.profile&&m(`profile:command=search took_ms=${Date.now()-a}`)}async function De(e,t){let o=y(t),i=Date.now(),a=await ae({mode:typeof e.mode=="string"?e.mode:void 0,k:typeof e.k=="string"?e.k:void 0,failUnder:typeof e.failUnder=="string"?e.failUnder:void 0,queries:typeof e.queries=="string"?e.queries:void 0,format:typeof e.format=="string"?e.format:void 0},o);if(f(a,_("Eval",e.format,o)),o.profile&&m(`profile:command=eval took_ms=${Date.now()-i}`),!a.passed)throw new u(
|
|
7
|
+
`)}else f(h,w);i.profile&&m(`profile:command=search took_ms=${Date.now()-a}`)}async function De(e,t){let o=y(t),i=Date.now(),a=await ae({mode:typeof e.mode=="string"?e.mode:void 0,k:typeof e.k=="string"?e.k:void 0,failUnder:typeof e.failUnder=="string"?e.failUnder:void 0,queries:typeof e.queries=="string"?e.queries:void 0,format:typeof e.format=="string"?e.format:void 0},o);if(f(a,_("Eval",e.format,o)),o.profile&&m(`profile:command=eval took_ms=${Date.now()-i}`),!a.passed)throw new u("Eval gate failed: one or more aggregate or per-query thresholds were not met; inspect the metric report",c.GENERIC_FAILURE)}async function Fe(e,t,o){let i=y(o),a=Date.now(),n=S("get",t,[e]),r=await A(e,i,{depth:typeof n.depth=="string"?n.depth:void 0,fields:typeof n.fields=="string"?n.fields:void 0,full:!!n.full,tree:n.tree===!0,treeDepth:typeof n.treeDepth=="string"?n.treeDepth:typeof n.tree_depth=="string"?n.tree_depth:void 0,at:typeof n.at=="string"?n.at:void 0});f(r,_("Get",n.format,i)),i.profile&&m(`profile:command=get took_ms=${Date.now()-a}`)}async function Ee(e,t,o){let i=y(o),a=Date.now();if([t.compact,t.raw,t.full,t.provenance].filter(h=>h===!0).length>1)throw new u("History projection options are mutually exclusive. Use --compact, --provenance, or --full.",c.USAGE);let n=typeof t.field=="string"?t.field:void 0,r=!!t.strictExit||!!t.failOnWarn;if(r&&!t.verify)throw new u("--strict-exit requires --verify (it gates on the verification result).",c.USAGE);let l=await oe(e,{limit:typeof t.limit=="string"?t.limit:void 0,compact:!(t.full===!0||t.provenance===!0),provenance:t.provenance===!0,provenanceSummary:t.provenanceSummary===!0,harness:b(t,"harness"),agentInstance:b(t,"agentInstance"),provenanceFilter:b(t,"provenanceFilter"),diff:!!t.diff||n!==void 0,field:n,verify:!!t.verify},i);f(l,_("History",t.format,i)),r&&l.verification&&!l.verification.ok&&(process.exitCode=c.GENERIC_FAILURE),i.profile&&m(`profile:command=history took_ms=${Date.now()-a}`)}function b(e,t){let o=e[t];return Array.isArray(o)?o:void 0}function Ce(e,t){let o=b(e,"harness"),i=b(e,"agentInstance"),a=b(e,"provenanceFilter"),n=typeof e.cursorMode=="string"?e.cursorMode:void 0;if(n!==void 0&&n!=="batch"&&n!=="row")throw new u("Events --cursor-mode must be batch or row.",c.USAGE,{code:"invalid_event_cursor_mode"});let r=n;return{pmRoot:t,since:typeof e.since=="string"?e.since:void 0,type:b(e,"type"),author:b(e,"author"),item:b(e,"item"),limit:typeof e.limit=="string"?Number(e.limit):void 0,full:e.full===!0,...e.provenance===!0?{provenance:!0}:{},...e.provenanceSummary===!0?{provenanceSummary:!0}:{},...o===void 0?{}:{harness:o},...i===void 0?{}:{agentInstance:i},...a===void 0?{}:{provenanceFilter:a},cursorMode:r}}async function Oe(e,t,o){if(t.provenanceSummary===!0)throw new u("Events --provenance-summary is bounded to one page and cannot be combined with --follow.",c.USAGE);let i=typeof t.intervalMs=="string"?Number(t.intervalMs):void 0;if(e.cursorMode==="row"){for await(let a of le({...e,intervalMs:i}))o||v(`${JSON.stringify(a)}
|
|
8
8
|
`);return}for await(let a of se({...e,intervalMs:i}))o||v(`${D(a.events,{count:a.count,has_more:a.has_more,next_cursor:a.next_cursor??null,source:a.source,heartbeat:a.count===0})}
|
|
9
9
|
`)}function je(e){return e.cursor_mode==="row"?I(e.events):D(e.events,{count:e.count,has_more:e.has_more,next_cursor:e.next_cursor??null,source:e.source,...e.provenance_summary===void 0?{}:{provenance_summary:e.provenance_summary}})}async function Re(e,t){let o=y(t),i=Date.now(),a=Ce(e,o.path);if(e.follow===!0){await Oe(a,e,o.quiet===!0);return}let n=await re(a);if(k(n),o.json){f(n,o),o.profile&&m(`profile:command=events took_ms=${Date.now()-i}`);return}let r=je(n);!o.quiet&&r.length>0&&v(`${r}
|
|
10
10
|
`),o.profile&&m(`profile:command=events took_ms=${Date.now()-i}`)}async function Te(e,t,o,i,a){let n=y(a),r=Date.now(),l=await Q(e,t,o,{...Array.isArray(i.kind)?{kind:i.kind}:{},maxDepth:typeof i.maxDepth=="string"?i.maxDepth:void 0,limit:typeof i.limit=="string"?i.limit:void 0,after:typeof i.after=="string"?i.after:void 0,direction:typeof i.direction=="string"?i.direction:void 0,maxPaths:typeof i.maxPaths=="string"?i.maxPaths:void 0,sample:typeof i.sample=="string"?i.sample:void 0,...Array.isArray(i.exemptIsolate)?{exemptIsolate:i.exemptIsolate}:{},...Array.isArray(i.exemptIsolateType)?{exemptIsolateType:i.exemptIsolateType}:{},saveBaseline:i.saveBaseline===!0,rebuild:i.rebuild===!0,clear:i.clear===!0,summary:i.summary===!0,full:i.full===!0},n);f(l,n),n.profile&&m(`profile:command=graph took_ms=${Date.now()-r}`)}function Dt(e,t){let o=t?.commandFilter,i=n=>ye(n,o),a=[{name:"list",description:"List active items with optional lifecycle-status and project filters.",excludeTerminal:!0,allowStatusFilter:!0},{name:"list-all",description:"List all items with optional filters.",excludeTerminal:!1,allowStatusFilter:!0},{name:"list-draft",description:"List draft items with optional filters.",status:"draft"},{name:"list-open",description:"List open items with optional filters.",status:"open",excludeTerminal:!1,allowStatusFilter:!1},{name:"list-in-progress",description:"List in-progress items with optional filters.",status:"in_progress",excludeTerminal:!1,allowStatusFilter:!1},{name:"list-blocked",description:"List blocked items (blocked status or open blocked_by dependencies, matching pm next) with optional filters.",dependencyBlocked:!0,excludeTerminal:!1,allowStatusFilter:!1},{name:"list-closed",description:"List closed items with optional filters.",status:"closed"},{name:"list-canceled",description:"List canceled items with optional filters.",status:"canceled"}];for(let n of a)if(i(n.name)){let r=E(n.name);ke(e,{...n,...r?.registration==="commander"?{aliasContract:r}:{}})}if(i("aggregate")){let n=e.command("aggregate").description("Group item counts and numeric measures.").option("--set-mode <value>","Set grouping: element (default)|tuple").option("--limit <value>","Group page size (default: 50)").option("--after <value>","Continue with next_after cursor").option("--group-by <value>","Fields: parent,type,priority,status,assignee,tags,sprint,release (comma-separated)").option("--count","Counts (default)").option("--completion","Status counts and completion_pct").option("--sum <field>","Group numeric sum").option("--avg <field>","Group numeric average").option("--include-unparented","Keep unparented group").option("--status <value>","Item status").option("--type <value>","Item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Latest deadline (ISO/date or relative)").option("--deadline-after <value>","Earliest deadline (ISO/date or relative)").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Assignee presence: assigned|unassigned").option("--parent <value>","Parent ID").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release");d(n,"--include_unparented","Alias for --include-unparented"),d(n,"--assignee_filter <value>","Alias for --assignee-filter"),n.action(Se)}if(i("context")){let n=e.command("context").alias("ctx").description("Show a token-efficient project context snapshot for next-work decisions.").option("--for <intent>",`Apply a declared context intent projection. ${g("context","--for")}`).option("--date <value>","Anchor date/time for agenda window calculations (ISO/date string or relative)").option("--from <value>","Agenda lower bound (ISO/date string or relative)").option("--to <value>","Agenda upper bound (ISO/date string or relative)").option("--past","Include past agenda entries in bounded windows").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <id>","Scope the snapshot to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit focus and agenda rows per section").option("--after <cursor>","Continue ranked focus after a next_cursor from a previous context response").option("--format <value>","Context output format override: markdown|toon|json|ndjson").option("--depth <value>","Context depth: brief|standard|deep|full (full = every section, no per-section cap)").option("--section <value...>","Include specific sections (repeatable; overrides --depth)").option("--fields <value>","Project focus rows to a comma-separated field subset (e.g. id,title,priority)").option("--activity-limit <n>","Limit recent activity entries (default: settings or 10)").option("--stale-threshold <value>","Staleness cutoff in days (e.g. 7 or 7d; default: settings or 7)").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked candidate ids").option("--token-budget <n>","Maximum estimated tokens spent on ranked focus rows").option("--no-extension-health","Omit the installed extension health summary").option("--no-tags","Omit tag arrays from context focus rows");d(n,"--assignee_filter <value>","Alias for --assignee-filter"),d(n,"--max-items <n>","Alias for --limit"),d(n,"--explain_ranking","Alias for --explain-ranking"),d(n,"--token_budget <n>","Alias for --token-budget"),n.action(_e)}if(i("next")){let n=e.command("next").description("Recommend the next actionable (unblocked, ready) work item with rationale + blocked companion.").option("--for <intent>",`Apply a declared context intent projection. ${g("next","--for")}`).option("--type <value>","Filter candidate items by type").option("--tag <value>","Filter candidate items by tag").option("--priority <value>","Filter candidate items by priority").option("--assignee <value>","Filter candidate items by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter candidate items by sprint").option("--release <value>","Filter candidate items by release").option("--parent <id>","Scope to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit ready rows (default: 5; non-positive falls back to default)").option("--blocked-limit <n>","Limit blocked rows (default: same as --limit)").option("--ready-only","Omit the blocked companion list").option("--include-decisions","Include human-gated Decision items in the claimable ready queue").option("--include-gates","Include outcome gates in the ready queue").option("--include-containers","Include containers with unfinished descendants in the ready queue").option("--format <value>","Next output format override: markdown|toon|json").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked ready ids").option("--token-budget <n>","Maximum estimated tokens spent on the ranked ready queue");d(n,"--assignee_filter <value>","Alias for --assignee-filter"),d(n,"--blocked_limit <n>","Alias for --blocked-limit"),d(n,"--ready_only","Alias for --ready-only"),d(n,"--explain_ranking","Alias for --explain-ranking"),d(n,"--token_budget <n>","Alias for --token-budget"),n.action(Ie)}if(i("search")){let n=e.command("search").argument("<keywords...>","Keyword query tokens").description("Search items with keyword, semantic, or hybrid retrieval. Inline field:value tokens (tag:/status:/type:/priority:) in the query are parsed as filters, e.g. 'auth tag:area:search status:open'.").option("--for <intent>",`Apply a declared context intent projection. ${g("search","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--mode <value>","Search mode: keyword|semantic|hybrid (default: auto)").option("--semantic","Shorthand for --mode semantic").option("--hybrid","Shorthand for --mode hybrid").option("--match-mode <value>","Token match mode: and|or|exact (default: or with all-terms ranking bonus; and = hard-require every token; exact = exact phrase)").option("--min-score <value>","Per-query minimum score threshold (finite number >= 0); overrides settings search.score_threshold for this query only").option("--count","Return only the count of matching items (post-filter/threshold, pre-limit); skips hit rows").option("--semantic-weight <value>","Override hybrid semantic weight for this query (0..1); invalid values fall back to settings").option("--include-linked","Include linked files, docs, and tests in the searchable corpus").option("--title-exact","Require exact normalized title match for the full query string").option("--phrase-exact","Require exact normalized phrase match in searchable text").option("--highlight","Emit per-field matched-text snippets (wrapped in \xAB\u2026\xBB) on each hit; off by default").option("--status <value>","Filter by status before query (all, open/closed/canceled aliases, or configured status id; CSV)").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Filter by deadline upper bound (ISO/date string or relative)").option("--deadline-after <value>","Filter by deadline lower bound (ISO/date string or relative)").option("--updated-after <value>",'Filter by updated_at lower bound: ISO timestamp or signed relative (e.g. "-2h"/"-7d" for the past)').option("--updated-before <value>","Filter by updated_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-after <value>","Filter by created_at lower bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-before <value>","Filter by created_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--assignee <value>","Filter by assignee").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <value>","Filter by parent item ID").option("--compact","Render compact search hits (default; mutually exclusive with --full/--fields)").option("--full","Render full search hits with nested item payloads (mutually exclusive with --compact/--fields)").option("--fields <value>",`Render custom comma-separated search hit fields (mutually exclusive with --compact/--full). ${g("search","--fields")}`).option("--format <value>","Search output format override: json|ndjson|toon").option("--limit <n>","Limit returned item count").option("--after <cursor>","Continue after an opaque next_cursor from a previous search response");ue(n),n.action(Ae),d(n,"--tags <value>","Alias for --tag"),d(n,"--token_budget <n>","Alias for --token-budget")}if(i("eval")&&e.command("eval").description("Evaluate search relevance against a curated golden-query set: reports nDCG@k, MRR@k, precision@k, and recall@k per query plus the macro average. Use --fail-under as a CI gate.").option("--mode <value>","Default retrieval mode for queries without their own: keyword|semantic|hybrid (default: keyword)").option("--k <n>","Metric cutoff @k (positive integer; default: 10)").option("--fail-under <value>","Exit non-zero when aggregate nDCG@k falls below this threshold (0..1); CI gate").option("--queries <path>",`Query JSON (${ie}); default: search/eval-queries.json; errors show an example`).option("--format <value>","Eval output format override: json|toon").action(De),i("get")){let n=e.command("get").argument("<id>","Item id").option("--for <intent>",`Apply a declared context intent projection. ${g("get","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--depth <value>","Detail depth: brief|standard|deep|full (full aliases deep; default: standard)").option("--full","Explicit full item read; equivalent to --depth deep (mutually exclusive with --depth/--fields)").option("--fields <value>",`Render custom comma-separated item metadata fields. ${g("get","--fields")}`).option("--tree","Include descendants rooted at the requested item").option("--tree-depth <n>","Maximum subtree depth for --tree descendants").option("--at <version-or-timestamp>","Reconstruct a verified historical item state without mutating it").option("--format <value>","Get output format override: json|toon").description("Show item details by ID.").action(Fe);d(n,"--tree_depth <n>","Alias for --tree-depth"),d(n,"--token_budget <n>","Alias for --token-budget")}if(i("history")){let n=e.command("history").enablePositionalOptions().argument("<id>","Item id").option("--limit <n>","Latest n entries").option("--compact","Index, time, op, author, patch count, fields").option("--full","Full entries with JSON Patches").option("--provenance","Authors and provenance; no patches").option("--provenance-summary","Count provenance completeness").option("--harness <value>","Recorded/resolved harness (repeatable)",s).option("--agent-instance <value>","Agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Exact provenance match (repeatable)",s).option("--diff","Before/after field diffs").option("--field <name>","Filter changed field; implies --diff").option("--verify","Verify full chain and replay").option("--strict-exit","With --verify, fail on integrity errors").option("--fail-on-warn","Alias for --strict-exit").option("--format <value>","Output: json|toon").description("Show item history entries.").action(Ee);de(n,!0),F(n.command("activity"))}i("events")&&e.command("events").option("--since <cursor-or-timestamp>","Resume strictly after a durable cursor, or include events from an ISO timestamp").option("--type <value>","Filter by mutation operation (repeatable or comma-separated)",s).option("--author <value>","Filter by mutation author (repeatable or comma-separated)",s).option("--item <value>","Filter by item or workspace stream id (repeatable or comma-separated)",s).option("--limit <n>","Return at most 1,000 events (default: 100)").option("--cursor-mode <mode>","Cursor framing: batch emits one terminal trailer (default); row preserves one cursor per event").option("--full","Include each complete authoritative history entry").option("--provenance","Include patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include bounded provenance completeness counts").option("--harness <value>","Filter by recorded or vocabulary-resolved harness (repeatable)",s).option("--agent-instance <value>","Filter by privacy-safe agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter by an exact declared provenance value (repeatable)",s).option("--follow","Continue emitting committed events as newline-delimited JSON").option("--interval-ms <n>","Empty-read delay while following (minimum: 10ms; default: 250ms)").description("Emit cursor-resumable committed mutation facts as newline-delimited JSON.").action(Re),i("activity")&&F(e.command("activity",{hidden:!0})),i("graph")&&e.command("graph").argument("<subcommand>","Graph query (ancestors, descendants, predecessors, successors, paths, impact, analyze, audit, communities, redundancy, dominators, slack, centrality, articulation, plan, index)").argument("[id]","Root item id (traversals, paths, impact, and dominators)").argument("[target]","Target item id (paths only)").option("--kind <value>","Restrict traversal to registered relationship kinds (repeatable or comma-separated)",s).option("--max-depth <value>","Maximum traversal depth (non-negative integer)").option("--limit <value>","Maximum returned rows per bounded collection").option("--after <value>","Resume a traversal after this previously returned node id").option("--direction <value>","Edge orientation for paths/impact (outgoing, incoming, or both)").option("--max-paths <value>","Maximum enumerated paths (paths only)").option("--sample <value>","Maximum evidence sample entries per audit finding (audit only)").option("--exempt-isolate <value>","Item ids treated as explicitly valid isolates by the audit (repeatable or comma-separated)",s).option("--exempt-isolate-type <value>","Item types whose active isolates are policy-valid for the audit (repeatable or comma-separated)",s).option("--save-baseline","Persist the audit census as the change-since-baseline comparison point (audit only)").option("--rebuild","Rebuild and warm the durable graph index (index only)").option("--clear","Delete the durable graph index (index only)").option("--summary","Return counts-first envelopes without row collections").option("--full","Return the complete graph row projection").description("Bounded workspace relationship-graph queries, analytics, and governance audit.").action(Te)}var Ft={resolveReadCommandOutputFormat:_,parseListFormat:ce};export{Ft as _testOnlyRegisterListQuery,Dt as registerListQueryCommands};
|
|
11
|
-
//# sourceMappingURL=register-list-query-
|
|
11
|
+
//# sourceMappingURL=register-list-query-6PAJ4PBU.js.map
|