@unbrained/pm-cli 2026.9.28 → 2026.9.29
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/pm-developer/references/GRAPH_AND_RELATIONSHIPS.md +7 -6
- package/.agents/skills/pm-user/references/BACKLOG_SHAPING.md +1 -1
- package/.agents/skills/pm-user/references/ECOSYSTEM_PLANNING.md +26 -3
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +17 -0
- package/dist/cli/error-guidance.js +1 -1
- package/dist/cli/help-json-payload.js +2 -2
- package/dist/cli/main.js +2 -2
- package/dist/cli/runtime/invocation-options.d.ts +3 -1
- package/dist/cli/runtime/invocation-options.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +153 -153
- package/dist/cli-bundle/chunks/{chunk-OYCCWPBM.js → chunk-2AQKVJMW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UT7GRGHY.js → chunk-4DOL43PF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GLH2LNRH.js → chunk-5KEPG36D.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YERBAGQD.js → chunk-D32HVIB2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-A2G5OG6W.js → chunk-GP6QTYSD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CPOWTIIS.js → chunk-OTLIM22J.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PLNNUAFZ.js → chunk-P75SO5HO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PR4UAMI5.js → chunk-PJSQAWWQ.js} +60 -60
- package/dist/cli-bundle/chunks/{chunk-VMJLM7P2.js → chunk-S5A2UIRV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZFHJP7YD.js → chunk-SC6JHXFT.js} +31 -29
- package/dist/cli-bundle/chunks/{chunk-NBDB3SRC.js → chunk-SEJ53XDN.js} +48 -48
- package/dist/cli-bundle/chunks/{chunk-35DME35A.js → chunk-SJI55O65.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NEUIVBFO.js → chunk-U3QJGJYN.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-N6RP6PSP.js → register-list-query-R3ELWWPY.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-CY7JGQE6.js → register-mutation-WHXJXIHJ.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-53HAD3QP.js → register-operations-7ASWBYQG.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-NVX6374E.js → register-setup-FDRTUG54.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-YZB7IPR6.js → chunk-2O3QFI3G.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-Y5Z3XNGY.js → chunk-4A4DO5ZT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-K7GSZ7YZ.js → chunk-5MC57KRC.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-IWLMQLBO.js → chunk-6OXJVE74.js} +17 -17
- package/dist/cli-bundle/focused-chunks/{chunk-6IVQPNYN.js → chunk-7URX7FMY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-5KJXX2TZ.js → chunk-AVP5C674.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-DTLRXY77.js → chunk-AZE7KUHG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-V7OPZRL6.js → chunk-DZVOCJFY.js} +14 -14
- package/dist/cli-bundle/focused-chunks/{chunk-AZA4AEOR.js → chunk-FBIRNSYP.js} +6 -6
- package/dist/cli-bundle/focused-chunks/{chunk-A5O3VYWV.js → chunk-IFBA3ZAT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ONDNR3VU.js → chunk-K3AIMRIK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ZMQTIS3L.js → chunk-KLKKCHWM.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BRLXKRI2.js → chunk-MRH4A542.js} +4 -4
- package/dist/cli-bundle/focused-chunks/{chunk-IJXZQE3D.js → chunk-NXQZMKW5.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BGWF6CMP.js → chunk-NY6FLQTN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-OVVCXTIE.js → chunk-T4H6Q44B.js} +2 -2
- package/dist/cli-bundle/main.js +22 -22
- 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 +22 -21
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +28 -28
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +2 -2
- package/dist/core/history/replay.js +1 -1
- package/dist/core/output/mutation-projection.js +1 -1
- package/dist/core/telemetry/runtime.js +2 -2
- package/dist/sdk/cli-contracts/command-aliases.js +1 -1
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/lifecycle/plan-mutation-receipt.d.ts +53 -0
- package/dist/sdk/lifecycle/plan-mutation-receipt.js +2 -0
- package/dist/sdk/lifecycle/plan.d.ts +3 -0
- package/dist/sdk/lifecycle/plan.js +1 -1
- package/dist/sdk/linked-artifacts.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/runtime/actions.js +1 -1
- package/dist/sdk/runtime-input.d.ts +2 -0
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime.js +1 -1
- package/dist/sdk/similarity-scoring.js +1 -1
- package/dist/sdk/telemetry.d.ts +2 -0
- package/dist/sdk/telemetry.js +3 -1
- package/docs/CLI_GRAMMAR.md +18 -1
- package/docs/ECOSYSTEM_PLANNING_REVIEW.md +270 -0
- package/docs/README.md +1 -0
- package/docs/SDK_EVIDENCE_TRACEABILITY.md +34 -0
- package/docs/agent-task-token-baseline.json +28 -2
- package/docs/agent-task-transcripts.json +137 -14
- package/docs/ecosystem-review-2026-09-28.json +3159 -0
- package/marketplace.json +2 -2
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +2 -2
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +2 -2
- package/plugins/pm-codex/plugin.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$a as Fo,$c as Zo,$f as st,$g as ai,$j as ce,A as U,B as ae,Bc as B,D as V,Ei as ui,Fb as Bo,H as ue,Hb as Ho,Hd as Dt,Id as Qo,Jd as Sn,Kb as Re,Kc as K,Kd as En,Ki as mi,Ld as $n,M as Po,Mf as Se,Nd as ei,Ni as Lt,Od as ti,Oi as Ft,Qa as jo,Ra as Lo,Rd as ni,Ri as Ne,Sa as z,T as Ro,Uf as I,Vf as Q,W as Ct,Wf as ii,Wi as fi,Wj as gi,Xf as Y,Xi as An,Xj as De,Yd as oi,Yf as ie,Yj as ct,Zj as yi,_a as N,_f as ri,_j as _i,ab as Mo,ad as at,ak as Ke,ba as No,bb as Go,bf as T,bg as jt,bi as In,bk as wi,ck as me,co as Mt,di as si,dj as hi,ec as xn,eh as H,ei as He,fa as wn,fc as Ko,gc as Rt,ha as Do,ic as ke,if as Z,ii as se,k as Co,ka as vn,kc as xe,la as h,li as A,mi as Ee,ml as vi,na as f,nc as Vo,ni as $e,pc as Nt,qc as Yo,ra as Pt,rb as Uo,rc as Xo,ri as ci,sa as bn,sb as zo,si as li,ta as kn,tb as Jo,ti as Ie,ui as di,vi as pi,wb as qo,x,xb as Wo,y as Ot,z as pe}from"./chunk-
|
|
1
|
+
import{$a as Fo,$c as Zo,$f as st,$g as ai,$j as ce,A as U,B as ae,Bc as B,D as V,Ei as ui,Fb as Bo,H as ue,Hb as Ho,Hd as Dt,Id as Qo,Jd as Sn,Kb as Re,Kc as K,Kd as En,Ki as mi,Ld as $n,M as Po,Mf as Se,Nd as ei,Ni as Lt,Od as ti,Oi as Ft,Qa as jo,Ra as Lo,Rd as ni,Ri as Ne,Sa as z,T as Ro,Uf as I,Vf as Q,W as Ct,Wf as ii,Wi as fi,Wj as gi,Xf as Y,Xi as An,Xj as De,Yd as oi,Yf as ie,Yj as ct,Zj as yi,_a as N,_f as ri,_j as _i,ab as Mo,ad as at,ak as Ke,ba as No,bb as Go,bf as T,bg as jt,bi as In,bk as wi,ck as me,co as Mt,di as si,dj as hi,ec as xn,eh as H,ei as He,fa as wn,fc as Ko,gc as Rt,ha as Do,ic as ke,if as Z,ii as se,k as Co,ka as vn,kc as xe,la as h,li as A,mi as Ee,ml as vi,na as f,nc as Vo,ni as $e,pc as Nt,qc as Yo,ra as Pt,rb as Uo,rc as Xo,ri as ci,sa as bn,sb as zo,si as li,ta as kn,tb as Jo,ti as Ie,ui as di,vi as pi,wb as qo,x,xb as Wo,y as Ot,z as pe}from"./chunk-SEJ53XDN.js";import{mkdir as tc,readFile as nc}from"node:fs/promises";import $i 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 Tn=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 bi(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 ki(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 xi(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 Ii(e,t){return $i.join(e,"transactions","sdk",`${t}.json`)}async function Ae(e,t){t.updatedAt=T();let n=Ii(e,t.transactionId);await tc($i.dirname(n),{recursive:!0}),await ae(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 On(e,t){return e===void 0?void 0:cc(e,t)}function Cn(e,t,n,o){let i=On(n,o);i===void 0?delete e[t]:e[t]=i}function Si(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Ei(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(!Ei(e.startedStepIds,t)||!Ei(e.completedStepIds,t)||!Si(e.results)||!Si(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 Ai(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=On(a.result,`Step ${r.id} result`);if(a.state!=="applied"){let c=await r.prepareCompensation?.();Cn(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=On(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)),Cn(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 Tn||t.status==="committed")throw o;try{await Ai(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(Ii(e,t),"utf8"),t,n)}catch(o){if(o!==null&&typeof o=="object"&&"code"in o&&pe(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),Cn(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 Ai(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 Ti(e){let t=ki(e.pmRoot,"Transaction pmRoot"),n=bi(e.transactionId,"Transaction id"),o=ki(e.author,"Transaction author"),i=xi(e.lockTtlSeconds,rc,"Transaction lock TTL"),r=xi(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=bi(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 Z(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 Pn(e){return gc.join(e,"extension-migrations.json")}function Oi(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 Ci(e,t){return`${e.layer}:${e.name}:${t}`}async function yc(e){let t=Pn(e);if(!await x(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=Oi(i,r),s=o.get(Ci(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=Oi(d,p),g=Ci(d,u),y=n.get(g),w=String(d.definition.status??"pending").toLowerCase(),m=y?.status??(w==="applied"||w==="failed"?w:"pending");if(m==="applied"){o.push({key:g,layer:d.layer,extension:d.name,id:u,before:m,outcome:"skipped"});continue}if(e.dryRun===!0){o.push({key:g,layer:d.layer,extension:d.name,id:u,before:m,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:m,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:m}));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:m,outcome:"applied"}),i=!0}catch(k){let S=k instanceof Error?k.message:String(k),P={key:g,layer:d.layer,extension:d.name,id:u,status:"failed",attempted_at:v,error:S};n.set(g,P),d.definition.status="failed",d.definition.reason=S,o.push({key:g,layer:d.layer,extension:d.name,id:u,before:m,outcome:"failed",error:S}),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:Pn(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:Pn(e.pmRoot),total:o.length,pending_count:a,applied_count:s,skipped_count:c,failed_count:l,migrations:o}}async function Pi(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 lt 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 Ni="# pm-cli:runtime-cache:start",Rn="# pm-cli:runtime-cache:end",Di=".agents/pm",kc=["runtime/","search/","locks/","transactions/","checkpoints/"],xc=["search/eval-queries.json"];async function Ri(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 f("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 ji(e){return e.replaceAll("\\","/").replace(/^\.\/+/,"").replace(/\/+$/,"")}function Nn(e){let t=e.replaceAll("\\","/");return lt.isAbsolute(e)||t===".."||t.startsWith("../")}function Sc(e=Di){let t=ji(e);return[Ni,...kc.map(n=>n==="search/"?`${t}/${n}*`:`${t}/${n}`),...xc.map(n=>`!${t}/${n}`),Rn].join(`
|
|
4
4
|
`)}async function Li(e,t={}){let n=lt.join(e,".gitignore"),o=Di;if(t.pmRoot!==void 0){let d=ji(lt.relative(lt.resolve(e),lt.resolve(t.pmRoot)));if(Nn(d))return{path:n,changed:!1};d.length>0&&(o=d)}let i="";try{i=await Ri(()=>vc(n,"utf8"))}catch(d){if(!(d instanceof Error&&"code"in d&&pe(d)))throw d}let r=i.indexOf(Ni),a=i.indexOf(Rn),c=(r>=0&&a>=r?`${i.slice(0,r)}${i.slice(a+Rn.length)}`:i).trimEnd(),l=`${c.length>0?`${c}
|
|
@@ -77,4 +77,4 @@ Agent guidance check
|
|
|
77
77
|
`),ee.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 ee.write(`
|
|
79
79
|
`),{prefix:i,preset:s,telemetry_enabled:d}}finally{n.close()}}function sf(e){return{presetFromOption:Io(e.preset),useDefaults:e.defaults===!0,authorFromOption:Ls(e.author),installBundledPackages:e.withPackages===!0,agentGuidanceMode:Gs(e.agentGuidance),typePreset:js(e.typePreset)}}function cf(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 lf(e,t,n,o){if(t.length===0||n)return;let i=o.discovery==="ancestor";throw new f(`${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 df(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&&(Ao(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 pf(e){let t=await A(e.pmRoot);e.warnings.push(`already_exists:${e.settingsPath}`);let n=cf({settings:t,normalizedPrefix:e.normalizedPrefix,prefixArg:e.prefixArg,presetFromOption:e.normalizedOptions.presetFromOption,authorFromOption:e.normalizedOptions.authorFromOption});return lf(e.settingsPath,n,e.options.force===!0,e.target),df({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 uf(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,vn.telemetry.enabled);t=c.prefix,n=c.preset,o=c.telemetry_enabled,i=!0}let r=n??"minimal",a=of();a.id_prefix=t,Ao(a,r);let s=ai()?.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 pf(e):await uf({pmRoot:e.pmRoot,normalizedPrefix:e.normalizedPrefix,normalizedOptions:e.normalizedOptions})}async function mf(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 ff(e,t){let n=[],o=[],i=await ri(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 hf(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 gf(e){let n=z(e.settings,B()).folders.filter(i=>!wn.includes(i)),o=await Bs(e.pmRoot,n);e.createdDirs.push(...o.createdDirs),e.warnings.push(...o.warnings)}function yf(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 _f(e,t,n,o){if(!e)return;let i=await _o("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 f(`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=>at([...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=Jn){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 f))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 wf(e,t,n,o){if(e==null||n==="status")return;let i=await Li(e,{pmRoot:t});i.changed&&o.push(`updated:gitignore:${i.path}`)}async function fb(e,t,n={}){let o=t[tf],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=sf(n);await Ws(a,r.target.mode==="tracker-path",n.force===!0);let c=[],l=[],d=L.join(a,"settings.json"),p=await x(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,wn);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=yf(r.target),m=await Wt(w??L.dirname(a)),_=w??m,v=await mf({pmRoot:a,cwd:_??i,agentGuidanceMode:s.agentGuidanceMode,settings:y,warnings:l}),k=await ff(a,y);c.push(...k.createdDirs),l.push(...k.warnings);let S=await hf({pmRoot:a,settings:y,typePreset:s.typePreset,warnings:l});S&&(y=await A(a)),await gf({pmRoot:a,settings:y,createdDirs:c,warnings:l}),await wf(_,a,s.agentGuidanceMode,l),!p&&n.mergeFence!==!1&&s.agentGuidanceMode!=="status"&&await Vs(a,m,l);let P=await _f(s.installBundledPackages,t,a,l),G=Ks({installBundledPackages:s.installBundledPackages,registeredTypePreset:S,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,...S?{registered_type_preset:S}:{},...P?{installed_packages:P}:{},next_steps:G,agent_guidance:v}}export{Tn as a,Ti as b,Pn as c,yc as d,_c as e,wc as f,Pi as g,Gp as h,Ni as i,Rn as j,kc as k,Sc as l,Li as m,Ve as n,$c as o,Ic as p,Mi as q,Jt as r,Le as s,Gt as t,Fn as u,jc as v,Lc as w,Hf as x,qt as y,Wc as z,pt as A,Bi as B,Vc as C,Wt as D,zn as E,Zi as F,vh as G,bh as H,Qi as I,kh as J,Jn as K,mr as L,Qe as M,et as N,fr as O,dr as P,Xe as Q,Ze as R,pr as S,Zc as T,Eh as U,Th as V,tr as W,tl as X,Bh as Y,vr as Z,Sr as _,Gl as $,Ul as aa,W_ as ba,K_ as ca,V_ as da,Et as ea,Y_ as fa,X_ as ga,Z_ as ha,Q_ as ia,ew as ja,tw as ka,nw as la,ow as ma,iw as na,rw as oa,aw as pa,sw as qa,cw as ra,lw as sa,dw as ta,pw as ua,uw as va,mw as wa,fw as xa,hw as ya,gw as za,yw as Aa,_w as Ba,ww as Ca,vw as Da,te as Ea,b as Fa,Yn as Ga,id as Ha,we as Ia,Kt as Ja,zl as Ka,ft as La,Vt as Ma,Mr as Na,Kr as Oa,co as Pa,ca as Qa,Gy as Ra,cu as Sa,za as Ta,Ja as Ua,Wa as Va,va as Wa,Fp as Xa,_u as Ya,ka as Za,_o as _a,ws as $a,zv as ab,Cs as bb,tf as cb,ub as db,mb as eb,fb};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-S5A2UIRV.js.map
|