@unbrained/pm-cli 2026.11.25 → 2026.11.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/dist/cli/commander-usage.js +9 -9
- package/dist/cli/error-guidance.js +5 -5
- package/dist/cli/help-content.js +4 -4
- package/dist/cli/register-setup.js +1 -1
- package/dist/cli/runtime/selection.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/{chunk-LPW7S5KA.js → chunk-5AAIRHNE.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-5BPDT7G2.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-7EPYCU7U.js → chunk-5FY2VHRF.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-YIGBEY7K.js → chunk-7F3UFYZA.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-B2GM6KOM.js +2 -0
- package/dist/cli-bundle/chunks/chunk-BITDGTAX.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-L6VS7F3R.js → chunk-CBBKXTJG.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-DUJSME77.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-OWK2JL4I.js → chunk-DYL2N3OC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GBVF2ZB3.js → chunk-FWBR3OW7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OS5W4ZG2.js → chunk-GQXK4KKH.js} +31 -31
- package/dist/cli-bundle/chunks/{chunk-FHLOGAGA.js → chunk-HOLQZ56F.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-HTGN24XM.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-K34FR5CO.js → chunk-IGW3RVJC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FVY7U3SU.js → chunk-KCRRTJ4X.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DF6A7C32.js → chunk-KES4VHU4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CZEMEPPQ.js → chunk-LNZKNVMT.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-MNFCJNQA.js +35 -0
- package/dist/cli-bundle/chunks/{chunk-CONBVY2O.js → chunk-NDS4MXZX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BVJMVU4Z.js → chunk-PQSEEVOA.js} +6 -6
- package/dist/cli-bundle/chunks/chunk-QMM46SJM.js +4 -0
- package/dist/cli-bundle/chunks/chunk-RFK3ERYX.js +2 -0
- package/dist/cli-bundle/chunks/chunk-T3GJPXIZ.js +69 -0
- package/dist/cli-bundle/chunks/{chunk-CNUFU454.js → chunk-WZOJSHJT.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-C4KIZQHW.js → chunk-XRCE4QNL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SCIPT7WF.js → chunk-ZDL45VTB.js} +2 -2
- package/dist/cli-bundle/chunks/{field-option-collisions-QE65APSD.js → field-option-collisions-CGRJEAPQ.js} +2 -2
- package/dist/cli-bundle/chunks/{item-revision-INDHJV6X.js → item-revision-FGDR5NSF.js} +2 -2
- package/dist/cli-bundle/chunks/item-transaction-C3KAMEYO.js +2 -0
- package/dist/cli-bundle/chunks/{mutation-actor-KU7BMLUN.js → mutation-actor-HGG47KXV.js} +2 -2
- package/dist/cli-bundle/chunks/{mutation-admission-3OMCTQD4.js → mutation-admission-LLHIRY6O.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-3GV3LBOT.js → register-list-query-EKSCZWEZ.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-GZLF47SX.js → register-mutation-ZIAOKKUJ.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-PBJZGCAL.js → register-operations-ECVBZ5FM.js} +2 -2
- package/dist/cli-bundle/chunks/register-setup-3QYD5H4H.js +2 -0
- package/dist/cli-bundle/chunks/{stage-3WIZBD4N.js → stage-RSCSUYEJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-VU2PH4PF.js → chunk-3BR5NWQI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BOIMP2AR.js → chunk-3GQRWIT5.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-X4EWD6TL.js → chunk-AAB3ZR7Z.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-C3FEDTSD.js → chunk-AVLB4L7M.js} +26 -26
- package/dist/cli-bundle/focused-chunks/{chunk-5RBC4WSE.js → chunk-FQWKESMI.js} +58 -59
- package/dist/cli-bundle/focused-chunks/{chunk-BYQK5DGH.js → chunk-FW5Q26HA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-GQBWI4KA.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-TQIKDFOD.js → chunk-IWEGGRRD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ZLRRII55.js → chunk-JUG3BAZZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-KEZ4VXYD.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-XKLBTDJ7.js → chunk-NSFS3VWP.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{chunk-TRL4JDWX.js → chunk-NXUFVQ33.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-YYEWIKNI.js → chunk-QNWNUQSJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-QSRXF6XS.js +15 -0
- package/dist/cli-bundle/focused-chunks/{chunk-WVA5KOXF.js → chunk-R6QFPHWW.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{chunk-PKX2EHE3.js → chunk-RDELKGLS.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-3Y5PTQ2F.js → chunk-RFJ3MEFP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-SXC2EO3E.js → chunk-RMJKVQYE.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UWWAVXG4.js → chunk-TNVLDU7Z.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-UA2JNKMY.js +4 -0
- package/dist/cli-bundle/focused-chunks/{chunk-7SSGTGZO.js → chunk-VV2QF5IE.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MB56Y4M6.js → chunk-WHHFPATO.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-JOKRDFMQ.js → chunk-YNRW2FWB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-4LQL4EO6.js → chunk-YSZZSV6M.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{field-option-collisions-5ROXGUME.js → field-option-collisions-WV6GPYYP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{item-revision-KYMSQVZE.js → item-revision-RPTXN7WW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{item-transaction-I4HLVHEJ.js → item-transaction-A6MVNPT7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{mutation-actor-GGOQKAE6.js → mutation-actor-6ZVW6OME.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{mutation-admission-OS36ZCMH.js → mutation-admission-2DA4CINP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{stage-4ZFWJUKO.js → stage-RG3PKST7.js} +2 -2
- package/dist/cli-bundle/main.js +26 -26
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +4 -4
- package/dist/cli-bundle/sdk-core.js +1 -1
- 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 +63 -63
- 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 +11 -11
- package/dist/core/reproducibility/context.d.ts +2 -0
- package/dist/core/reproducibility/context.js +1 -1
- package/dist/sdk/cli-bootstrap.d.ts +17 -0
- package/dist/sdk/cli-bootstrap.js +1 -1
- package/dist/sdk/cli-contracts/command-aliases.js +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
- package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +1 -1
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +1 -1
- package/dist/sdk/completion/shared.d.ts +1 -1
- package/dist/sdk/completion/shared.js +1 -1
- package/dist/sdk/extension/bundled-catalog.js +1 -1
- package/dist/sdk/extension/install-sources.js +5 -5
- package/dist/sdk/extension/listing-fields.d.ts +15 -0
- package/dist/sdk/extension/listing-fields.js +2 -0
- package/dist/sdk/extension/managed-update-status.js +1 -1
- package/dist/sdk/extension/npm-spec.d.ts +18 -0
- package/dist/sdk/extension/npm-spec.js +2 -0
- package/dist/sdk/extension/static-inventory.d.ts +53 -1
- package/dist/sdk/extension/static-inventory.js +1 -1
- package/dist/sdk/extension/update-check.js +1 -1
- package/dist/sdk/extension/update-observations.js +3 -0
- package/dist/sdk/extension/upgrade-hints.js +2 -0
- package/dist/sdk/extension.d.ts +2 -0
- package/dist/sdk/extension.js +1 -1
- 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/upgrade.d.ts +7 -2
- package/dist/sdk/governance/upgrade.js +2 -2
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/context.d.ts +20 -7
- package/dist/sdk/query/context.js +4 -2
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/testing.d.ts +20 -2
- package/docs/COMMANDS.md +19 -1
- package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +6 -0
- package/docs/EXTENSION_LIFECYCLE.md +72 -2
- package/docs/SDK.md +21 -2
- package/marketplace.json +1 -1
- 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 +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +1 -1
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +1 -1
- package/dist/cli-bundle/chunks/chunk-4FZH5BTV.js +0 -2
- package/dist/cli-bundle/chunks/chunk-GZI7ZAB7.js +0 -2
- package/dist/cli-bundle/chunks/chunk-LOX3VY4T.js +0 -2
- package/dist/cli-bundle/chunks/chunk-VA4T37Q4.js +0 -70
- package/dist/cli-bundle/chunks/chunk-WQOEVGLQ.js +0 -2
- package/dist/cli-bundle/chunks/chunk-XHCIOLJP.js +0 -3
- package/dist/cli-bundle/chunks/chunk-XKWJONAO.js +0 -2
- package/dist/cli-bundle/chunks/chunk-ZBOQEZ2H.js +0 -33
- package/dist/cli-bundle/chunks/chunk-ZLICQPRG.js +0 -3
- package/dist/cli-bundle/chunks/item-transaction-LCKK4XXB.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-ZLJEF6NZ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-A4R57E4K.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-IAOKVKWW.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-VMYVN36N.js +0 -13
- package/dist/cli-bundle/focused-chunks/chunk-WL2R7T5G.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Cc as pt,Gc as ht,Ic as V,Mb as D,O as st,Oh as yt,Sh as kt,Tf as oe,Uf as ie,ca as ct,cb as ut,ea as B,eb as _t,nc as ft,sc as F,zc as mt}from"./chunk-
|
|
1
|
+
import{Cc as pt,Gc as ht,Ic as V,Mb as D,O as st,Oh as yt,Sh as kt,Tf as oe,Uf as ie,ca as ct,cb as ut,ea as B,eb as _t,nc as ft,sc as F,zc as mt}from"./chunk-WZOJSHJT.js";import{Q as ee,a as N,b as P,d as p,x as lt}from"./chunk-DUJSME77.js";import{F as te,J as ne,K as re,N as dt,d as et,e as tt,f as nt,g as rt,m as ot,r as it,z as at}from"./chunk-SX76UGEY.js";import{A as v,C as x,E as Qe,F as le,H as I,I as Ze,J as Te,K as Z,v as Xe,y as u,z as Q}from"./chunk-6OIHST4I.js";import wt from"node:fs/promises";import G from"node:path";var R="_workspace";function W(e){return G.join(e,"history",`${R}.jsonl`)}function Ce(e,t){return{metadata:{id:R,title:"Workspace state",description:"Audited singleton workspace document state.",type:"Chore",status:"open",priority:2,tags:["workspace-history"],created_at:t,updated_at:t,documents:e},body:""}}function U(e,t=e.length){let n=mt();for(let r of e.slice(0,t))n=ht(n,r.patch).document;return pt(n)}function K(e){return"documents"in e.metadata&&typeof e.metadata.documents=="object"&&e.metadata.documents!==null&&!Array.isArray(e.metadata.documents)?e.metadata.documents:{}}function J(e){throw new x(`Workspace history verification failed: ${e.join(", ")}`,v.CONFLICT,{code:"workspace_history_chain_invalid",reason:"workspace_history_chain_verification_failed",verification_errors:[...e],required:"Repair the _workspace history chain before reading, reconciling, restoring, or appending audited singleton state.",why:"Continuing against an unverifiable append-only stream could hide or compound workspace state corruption.",examples:["pm history _workspace --verify --json","pm validate --check-history-drift --fix-hints --json"],nextSteps:["Inspect the exact verification_errors and preserve the corrupt stream as evidence.","Use the history-drift remediation returned by validate before retrying the refused operation."],recovery:{recovery_mode:"compact",next_best_command:"pm history _workspace --verify --json"}})}function de(e,t){let n=G.resolve(t),r=G.relative(e,n).replaceAll("\\","/");if(r.length===0||r===".."||r.startsWith("../")||G.isAbsolute(r))throw new TypeError("Workspace history document path must stay inside the tracker root");return{documentPath:r,absolutePath:n}}async function Jr(e){let t=await F(W(e),R),n=V(t);n.ok||J(n.errors);let r=K(t.length===0?Q:U(t)),i=[],a=[],s=[],l=[];for(let _ of Object.keys(r).sort()){let f;try{let w=de(e,G.resolve(e,_));if(f=await I(w.absolutePath),f===null){s.push(_);continue}let g=JSON.parse(f);(N(g)===N(r[_])?i:a).push(_)}catch{l.push(_)}}return{ok:a.length===0&&s.length===0&&l.length===0,document_count:Object.keys(r).length,matching_documents:i,mismatched_documents:a,missing_documents:s,unreadable_documents:l}}async function gt(e){let t=W(e.pmRoot),n=await F(t,R),r=V(n);r.ok||J(r.errors);let i=e.idempotencyKey===void 0?void 0:n.find(g=>g.op===`${e.op}:${e.idempotencyKey}`);if(i)return{entry:i,historyPath:t};let a=ee(),s=n.length===0?Q:U(n),l=K(s),_=l[e.documentPath];if(_!==void 0&&N(_)!==N(e.before))throw new x(`Workspace history state for "${e.documentPath}" changed outside the audited mutation path.`,v.CONFLICT,{code:"workspace_history_state_conflict",reason:"out_of_band_workspace_state",required:"Reconcile the singleton document with its matching _workspace history state before retrying the mutation.",why:"Accepting the write would make the append-only audit stream describe a state that was not actually observed.",examples:["pm history _workspace --verify","pm validate --check-history-drift --fix-hints"],nextSteps:["Review the version-control change that altered the singleton and preserve the intended document plus its matching workspace history.","Rerun the original mutation only after the on-disk singleton agrees with the latest audited workspace state."],recovery:{recovery_mode:"compact",next_best_command:"pm history _workspace --verify"}});let f=Ce({...l,[e.documentPath]:e.after},n.length===0?a:s.metadata.created_at),w=oe({nowIso:a,author:e.author,op:e.idempotencyKey===void 0?e.op:`${e.op}:${e.idempotencyKey}`,before:s,after:f,message:e.message});return await ie(t,w),{entry:w,historyPath:t}}async function Yr(e){let t=await D(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{return await gt(e)}finally{await t()}}async function Xr(e){let t=await D(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{let n=W(e.pmRoot),r=await F(n,R),i=V(r);i.ok||J(i.errors);let a=r.length===0?Q:U(r),s=oe({nowIso:ee(),author:e.author,op:e.op,before:a,after:a,message:e.message,context:e.context});return await ie(n,s),{entry:s,historyPath:n}}finally{await t()}}async function bt(e,t){if(t===e.raw)return!1;let n=t===null?null:JSON.parse(t),r=JSON.parse(e.raw);await Z(e.filePath,e.raw);try{(t!==null||e.recordCreation!==!1)&&await gt({pmRoot:e.pmRoot,documentPath:G.relative(e.pmRoot,e.filePath).replaceAll("\\","/"),before:n,after:r,op:e.op,idempotencyKey:e.idempotencyKey,author:e.author,lockTtlSeconds:e.lockTtlSeconds,lockWaitMs:e.lockWaitMs,message:e.message})}catch(i){throw t===null?await wt.rm(e.filePath,{force:!0}):await Z(e.filePath,t),i}return!0}async function vt(e){let{documentPath:t}=de(e.pmRoot,e.filePath),n=await D(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{let r=await I(e.filePath);if(e.dryRun===!0||e.idempotencyKey!==void 0){let a=await F(W(e.pmRoot),R),s=V(a);s.ok||J(s.errors);let l=K(a.length===0?Q:U(a))[t];if(l!==void 0&&N(l)!==N(r===null?null:JSON.parse(r)))throw new x(`Workspace history state for "${t}" changed outside the audited mutation path.`,v.CONFLICT,{code:"workspace_history_state_conflict"});if(e.idempotencyKey!==void 0&&a.some(_=>_.op===`${e.op}:${e.idempotencyKey}`))return{changed:!1,result:void 0,replayed:!0}}let i=await e.mutate(r);return JSON.parse(i.raw),e.dryRun===!0?{changed:r!==i.raw,result:i.result}:{changed:await bt({...e,raw:i.raw},r),result:i.result}}finally{await n()}}async function Qr(e){let t=await D(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{return await bt(e,await I(e.filePath))}finally{await t()}}async function Zr(e){let t=e.authorizationDecision.trim();if(!t)throw new TypeError("Workspace history reconciliation requires an authorization decision");let n=await D(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{let{documentPath:r,absolutePath:i}=de(e.pmRoot,e.filePath),a=W(e.pmRoot),s=await F(a,R),l=V(s);l.ok||J(l.errors);let _=U(s),f=K(_);if(!Object.hasOwn(f,r))throw new TypeError(`Workspace history does not govern document ${r}`);let w=await I(i);if(w===null)throw new TypeError(`Workspace history document is missing: ${r}`);let g=JSON.parse(w);if(N(f[r])===N(g))return{changed:!1,historyPath:a};let S=ee(),X=oe({nowIso:S,author:e.author,op:e.op,before:_,after:Ce({...f,[r]:g},_.metadata.created_at),message:e.message,context:{reason:"out_of_band_workspace_state_reconciliation",document_path:r,authorization_decision:t}});return await ie(a,X),{changed:!0,entry:X,historyPath:a}}finally{await n()}}async function eo(e){let t=await D(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{let{documentPath:n,absolutePath:r}=de(e.pmRoot,e.filePath),i=await F(W(e.pmRoot),R),a=V(i);if(a.ok||J(a.errors),!Number.isInteger(e.targetVersion)||e.targetVersion<1||e.targetVersion>i.length)throw new TypeError(`Invalid workspace history target version: ${String(e.targetVersion)}`);let s=K(U(i,e.targetVersion))[n];if(s===void 0)throw new TypeError(`Workspace history version ${e.targetVersion} does not contain ${n}`);let l=await I(r),_=`${JSON.stringify(s,null,2)}
|
|
2
2
|
`;if(l===_)return{document_path:n,restored_from_version:e.targetVersion,changed:!1};let f=U(i),w=ee(),g=oe({nowIso:w,author:e.author,op:e.op,before:f,after:Ce({...K(f),[n]:s},f.metadata.created_at),message:e.message,context:{reason:"workspace_state_restore",document_path:n,restored_from_version:e.targetVersion,replaced_out_of_band_state:!0}});await Z(r,_);try{await ie(W(e.pmRoot),g)}catch(S){throw l===null?await wt.rm(r,{force:!0}):await Z(r,l),S}return{document_path:n,restored_from_version:e.targetVersion,changed:!0}}finally{await t()}}var O={ok:!1,path:[]};function Pe(e,t){return{ok:!1,path:[e,...t.path]}}var c=e=>typeof e=="string"?{ok:!0,value:e}:O,h=e=>typeof e=="boolean"?{ok:!0,value:e}:O;function k(e={}){return t=>typeof t!="number"||!Number.isFinite(t)||e.int&&(!Number.isInteger(t)||!Number.isSafeInteger(t))||e.positive&&t<=0||typeof e.min=="number"&&t<e.min||typeof e.max=="number"&&t>e.max?O:{ok:!0,value:t}}function y(...e){return t=>typeof t=="string"&&e.includes(t)?{ok:!0,value:t}:O}function d(e,t){return n=>{if(!Array.isArray(n)||t!==void 0&&n.length>t)return O;let r=[];for(let[i,a]of n.entries()){let s=e(a);if(!s.ok)return Pe(String(i),s);r.push(s.value)}return{ok:!0,value:r}}}function je(e,t){return n=>typeof n=="string"&&n.length>0&&n.length<=e&&n===n.trim()&&(t===void 0||t.test(n))?{ok:!0,value:n}:O}function o(e){return t=>t===void 0?{ok:!0,value:void 0}:e(t)}function ue(e){return t=>{if(typeof t!="object"||t===null||Array.isArray(t))return O;let n={};for(let[r,i]of Object.entries(t)){let a=e(i);if(!a.ok)return Pe(r,a);n[r]=a.value}return{ok:!0,value:n}}}function m(e){return t=>{if(typeof t!="object"||t===null||Array.isArray(t))return O;let n=t,r={};for(let[i,a]of Object.entries(e)){let s=a(n[i]);if(!s.ok)return Pe(i,s);s.value!==void 0&&(r[i]=s.value)}return{ok:!0,value:r}}}var mn=m({key:c,values:d(c),required:o(h),aliases:o(d(c)),description:o(c)}),pn=m({command:y("create","update"),option:c,required:o(h),visible:o(h),enabled:o(h)}),hn=m({name:c,description:o(c),default_status:o(c),execution_role:o(y("agent","human","gate")),folder:o(c),aliases:o(d(c)),required_create_fields:o(d(c)),required_create_repeatables:o(d(c)),options:o(d(mn)),command_option_policies:o(d(pn))}),yn=m({id:c,aliases:o(d(c)),roles:o(d(y(...et))),description:o(c),order:o(k())}),kn=m({key:c,metadata_key:o(c),front_matter_key:o(c),cli_flag:o(c),cli_aliases:o(d(c)),description:o(c),type:o(y(...tt)),commands:o(d(y(...nt))),repeatable:o(h),required:o(h),required_on_create:o(h),required_types:o(d(c)),allow_unset:o(h)}),wn=e=>{if(!Array.isArray(e)||e.length!==2)return O;let[t,n]=e;return typeof t!="string"||typeof n!="string"?O:{ok:!0,value:[t,n]}},gn=m({type:c,allowed_transitions:d(wn)}),bn=o(m({version:o(k({int:!0})),files:o(m({types:o(c),statuses:o(c),fields:o(c),workflows:o(c)})),statuses:o(d(yn)),fields:o(d(kn)),workflow:o(m({draft_status:o(c),open_status:o(c),in_progress_status:o(c),blocked_status:o(c),close_status:o(c),canceled_status:o(c)})),type_workflows:o(d(gn)),unknown_field_policy:o(y(...rt))})),vn=o(m({preset:o(y(...ot)),ownership_enforcement:o(y("none","warn","strict")),create_mode_default:o(y("progressive","strict")),close_validation_default:o(y("off","warn","strict")),require_close_reason:o(h),parent_reference:o(y("warn","strict_error")),metadata_profile:o(y("core","strict","custom")),force_required_for_stale_lock:o(h),create_default_type:o(c),workflow_enforcement:o(y("off","warn","strict")),start_blocker_enforcement:o(y("off","warn","strict")),duplicate_detection_mode:o(y("off","advisory","strict")),duplicate_detection_threshold:o(k({min:0,max:1})),duplicate_detection_limit:o(k({int:!0,min:0,max:20}))})),xn=m({name:c,disabled:o(h),require_trusted:o(h),require_provenance:o(h),sandbox_profile:o(y("none","restricted","strict")),allowed_capabilities:o(d(c)),blocked_capabilities:o(d(c)),allowed_surfaces:o(d(c)),blocked_surfaces:o(d(c)),allowed_commands:o(d(c)),blocked_commands:o(d(c)),allowed_actions:o(d(c)),blocked_actions:o(d(c)),allowed_services:o(d(c)),blocked_services:o(d(c))}),Ae=y("block","warn"),Sn=e=>typeof e=="string"?Ae(e):m({global:o(Ae),project:o(Ae)})(e),En=o(m({mode:o(y("off","warn","enforce")),trust_mode:o(y("off","warn","enforce")),pm_max_version_exceeded_mode:o(Sn),require_provenance:o(h),trusted_extensions:o(d(c)),default_sandbox_profile:o(y("none","restricted","strict")),allowed_extensions:o(d(c)),blocked_extensions:o(d(c)),allowed_capabilities:o(d(c)),blocked_capabilities:o(d(c)),allowed_surfaces:o(d(c)),blocked_surfaces:o(d(c)),allowed_commands:o(d(c)),blocked_commands:o(d(c)),allowed_actions:o(d(c)),blocked_actions:o(d(c)),allowed_services:o(d(c)),blocked_services:o(d(c)),extension_overrides:o(d(xn))})),$=je(128),On=m({harness:je(128,/^[a-z0-9]+(?:-[a-z0-9]+)*$/u),environment_keys:o(d($,64)),model_environment_keys:o(d($,64)),session_environment_keys:o(d($,64)),provenance_environment_keys:o(ue(d($,64))),provenance_resolvers:o(ue(y("ai_agent_version","claude_session_file"))),provenance_unavailable_dimensions:o(d($,64)),argv_markers:o(d($,64)),client_names:o(d($,64))}),xt={version:k({int:!0}),id_prefix:c,ids:o(m({token_length:o(k({int:!0,min:4,max:12}))})),author_default:c,agent_identity:o(m({probes_enabled:o(h),identity_vocabulary:o(m({version:k({int:!0,positive:!0}),aliases:ue(je(128,/^[a-z0-9]+(?:-[a-z0-9]+)*$/u))})),harness_signals:d(On)})),mutation_guard:o(m({require_attributed_author:o(h),secret_guard:o(y("off","advise","block")),stale_in_progress_hours:o(k({int:!0,positive:!0}))})),item_format:o(y("toon","json_markdown")),locks:m({ttl_seconds:k({int:!0}),wait_ms:o(k({int:!0,min:0}))}),checkpoints:o(m({retention_days:o(k({int:!0,positive:!0}))})),output:m({default_format:y("toon","json")}),ux:o(m({deprecation_hints:o(h)})),history:o(m({missing_stream:y("auto_create","strict_error"),compact_policy:o(m({enabled:o(h),max_entries:o(k({int:!0,positive:!0})),trigger:o(y("health_warn","auto"))}))})),validation:o(m({sprint_release_format:y("warn","strict_error"),parent_reference:o(y("warn","strict_error")),metadata_profile:o(y("core","strict","custom")),metadata_required_fields:o(d(c)),lifecycle_stale_blocker_reason_patterns:o(d(c)),lifecycle_closure_like_blocked_reason_patterns:o(d(c)),lifecycle_closure_like_resolution_patterns:o(d(c)),lifecycle_closure_like_actual_result_patterns:o(d(c)),estimate_defaults_by_type:o(ue(k({int:!0,positive:!0})))})),governance:vn,workflow:o(m({definition_of_done:d(c)})),testing:o(m({record_results_to_items:h,allow_untrusted_linked_tests:o(h)})),telemetry:o(m({enabled:h,first_run_prompt_completed:o(h),capture_level:o(y("minimal","redacted","max")),endpoint:o(c),installation_id:o(c),retention_days:o(k({int:!0,positive:!0}))})),agent_guidance:o(m({prompt_completed:o(h),declined:o(h),declined_at:o(c),template_version:o(k({int:!0,positive:!0})),last_checked_files:o(d(c))})),item_types:o(m({definitions:d(hn)})),schema:bn,context:o(m({default_depth:o(y(...at)),activity_limit:o(k({int:!0,positive:!0})),stale_threshold_days:o(k({int:!0,positive:!0})),next_ranking_policy:o(y("priority_floor","weighted")),sections:o(m({hierarchy:o(h),activity:o(h),progress:o(h),recently_created:o(h),unparented:o(h),blockers:o(h),files:o(h),workload:o(h),staleness:o(h),tests:o(h)}))})),extensions:m({enabled:d(c),disabled:d(c),policy:En}),search:m({score_threshold:k(),hybrid_semantic_weight:o(k()),max_results:k({int:!0}),embedding_model:c,embedding_corpus_max_characters:o(k()),embedding_batch_size:k({int:!0}),embedding_timeout_ms:o(k({int:!0})),scanner_max_batch_retries:k({int:!0}),provider:o(c),default_mode:o(y("auto","keyword","semantic","hybrid")),corpus_fields:o(d(c)),mutation_refresh_policy:o(y("cache_only","semantic_configured","semantic_auto")),query_expansion:o(m({enabled:o(h),provider:o(c)})),rerank:o(m({enabled:o(h),model:o(c),top_k:o(k({int:!0,positive:!0}))})),bm25:o(m({k1:o(k()),b:o(k())}))}),providers:m({openai:m({base_url:c,api_key:c,model:c}),ollama:m({base_url:c,model:c})}),vector_store:m({adapter:o(c),collection_name:o(c),qdrant:m({url:c,api_key:c}),lancedb:m({path:c})})},Tn=m(xt),St=Object.freeze(Object.keys(xt));function _e(e){let t=Tn(e);return t.ok?{success:!0,data:t.value}:{success:!1,path:t.path.join(".")}}import{AsyncLocalStorage as In}from"node:async_hooks";import{lstat as Rn,realpath as Lt}from"node:fs/promises";import qt from"node:path";function fe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ne(e,t,n,r=[]){if(P(e,t)&&(r.length>0||fe(n)))return n;if(P(e,n)||P(t,n))return t;if((e===void 0||fe(e))&&fe(t)&&fe(n)){let i=e??{},a=new Set([...Object.keys(i),...Object.keys(t),...Object.keys(n)]);return Object.fromEntries([...a].flatMap(s=>{let l=Ne(Object.hasOwn(i,s)?i[s]:void 0,Object.hasOwn(t,s)?t[s]:void 0,Object.hasOwn(n,s)?n[s]:void 0,[...r,s]);return l===void 0?[]:[[s,l]]}))}throw new x(`Settings changed concurrently at ${r.join(".")||"<root>"}; read the latest settings and reapply the intended change.`,v.CONFLICT,{reason:"stale_settings_snapshot",required:"Read a fresh settings snapshot and reapply the intended change.",why:"Another writer changed the same setting after this snapshot was read.",examples:["pm config project export --json"],nextSteps:["Read the current settings, then retry the original config operation."]})}var Cn={Epic:2880,Feature:480,Story:480,Milestone:2880,Task:120,Issue:60,Bug:60,Chore:30,Decision:15,Plan:120},Et=120;function Ie(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Tt(e){let t=new Map;for(let[n,r]of Object.entries(e))t.set(n.toLowerCase(),r);return t}var An=Tt(Cn),Ot=new WeakMap;function Pn(e){let t=Ot.get(e);if(t)return t;let n=Tt(e);return Ot.set(e,n),n}function co(e,t){let n=(e??"").trim().toLowerCase();if(n.length===0)return Et;if(t){let i=Pn(t).get(n);if(Ie(i))return Math.floor(i)}let r=An.get(n);return Ie(r)?Math.floor(r):Et}function Re(e){let t={};if(e===null||typeof e!="object"||Array.isArray(e))return t;for(let[n,r]of Object.entries(e)){let i=n.trim();i.length===0||!Ie(r)||(t[i]=Math.floor(r))}return t}import{stat as jn}from"node:fs/promises";var me=new Map;function Ct(e){return[...new Set(e.map(t=>t.trim()).filter(t=>t.length>0))].sort((t,n)=>t.localeCompare(n))}async function Nn(e){try{let t=await jn(e);return{path:e,mtime_ms:t.mtimeMs,size:t.size}}catch{return{path:e,mtime_ms:null,size:null}}}async function L(e){let t=Ct(e),n=await Promise.all(t.map(r=>Nn(r)));return n.sort((r,i)=>r.path.localeCompare(i.path)),n}function ae(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r.path!==i.path||r.mtime_ms!==i.mtime_ms||r.size!==i.size)return!1}return!0}function At(e){return me.get(e)}function pe(e,t){let n=Ct(t.tracked_paths),r=[...t.signatures].map(i=>({path:i.path,mtime_ms:i.mtime_ms,size:i.size})).sort((i,a)=>i.path.localeCompare(a.path));me.set(e,{tracked_paths:n,signatures:r,value:t.value})}function H(e){if(e){me.delete(e);return}me.clear()}var Me=new In;async function jo(e,t,n=()=>!0){let r=new Set([qt.resolve(e)]);try{r.add(await Lt(e))}catch{}let i=!1,a=[r,()=>!i&&n()];try{return await Me.run([...Me.getStore()??[],a],t)}finally{i=!0}}function Ln(e){let t=qt.resolve(e);return Me.getStore()?.some(([n,r])=>n.has(t)&&r())??!1}var qn="settings:write",zt=Symbol("pm.settings.persist_source"),Mt=Symbol("pm.settings.fallback_origin"),Dt=Symbol("pm.settings.fallback_baseline"),zn=128,Mn=new Set(["off","advisory","strict"]);function Pt(e){return structuredClone(Xe[e])}function Dn(e){return e==="minimal"||e==="default"||e==="strict"||e==="custom"?e:u.governance.preset}var Fn=new Set(it);function Ft(e){return Fn.has(e)}function jt(e,t){let n=typeof t.create_default_type=="string"?t.create_default_type.trim():void 0;return n&&n.length>0&&(e.create_default_type=n),(t.workflow_enforcement==="off"||t.workflow_enforcement==="warn"||t.workflow_enforcement==="strict")&&(e.workflow_enforcement=t.workflow_enforcement),Ft(t.start_blocker_enforcement)&&(e.start_blocker_enforcement=t.start_blocker_enforcement),t.require_close_reason===!1&&(e.require_close_reason=!1),e.duplicate_detection_mode=t.duplicate_detection_mode,e.duplicate_detection_threshold=t.duplicate_detection_threshold,e.duplicate_detection_limit=t.duplicate_detection_limit,e}function Vn(e){return e.preset==="custom"?jt({preset:"custom",ownership_enforcement:e.ownership_enforcement,create_mode_default:e.create_mode_default,close_validation_default:e.close_validation_default,parent_reference:e.parent_reference,metadata_profile:e.metadata_profile,force_required_for_stale_lock:e.force_required_for_stale_lock},e):jt({preset:e.preset},e)}function Wn(e){let t=typeof e.create_default_type=="string"?e.create_default_type.trim():void 0,n={};t&&t.length>0&&(n.create_default_type=t),(e.workflow_enforcement==="off"||e.workflow_enforcement==="warn"||e.workflow_enforcement==="strict")&&(n.workflow_enforcement=e.workflow_enforcement),Ft(e.start_blocker_enforcement)&&(n.start_blocker_enforcement=e.start_blocker_enforcement),typeof e.require_close_reason=="boolean"&&(n.require_close_reason=e.require_close_reason),Mn.has(String(e.duplicate_detection_mode))&&(n.duplicate_detection_mode=e.duplicate_detection_mode);let r=e.duplicate_detection_threshold;[typeof r=="number",Number.isFinite(r),Number(r)>=0,Number(r)<=1].every(Boolean)&&(n.duplicate_detection_threshold=r);let i=e.duplicate_detection_limit;return[typeof i=="number",Number.isSafeInteger(i),Number(i)>=0,Number(i)<=20].every(Boolean)&&(n.duplicate_detection_limit=i),n}function Vt(e){let t=e.governance??{},n=Dn(t.preset),r=Wn(t);if(n==="custom"){let s=Pt("default"),l=r.require_close_reason??s.require_close_reason;return{preset:n,ownership_enforcement:t.ownership_enforcement??s.ownership_enforcement,create_mode_default:t.create_mode_default??s.create_mode_default,close_validation_default:t.close_validation_default??s.close_validation_default,parent_reference:t.parent_reference??s.parent_reference,metadata_profile:t.metadata_profile??s.metadata_profile,force_required_for_stale_lock:t.force_required_for_stale_lock??s.force_required_for_stale_lock,...r,require_close_reason:l,duplicate_detection_mode:r.duplicate_detection_mode??s.duplicate_detection_mode,duplicate_detection_threshold:r.duplicate_detection_threshold??s.duplicate_detection_threshold,duplicate_detection_limit:r.duplicate_detection_limit??s.duplicate_detection_limit}}let i=Pt(n),a=r.require_close_reason??i.require_close_reason;return{preset:n,...i,...r,require_close_reason:a}}function Ve(){return structuredClone(u)}function Wt(e){return e==="cache_only"||e==="semantic_configured"||e==="semantic_auto"?e:u.search.mutation_refresh_policy}function Ut(e){return e==="auto"||e==="keyword"||e==="semantic"||e==="hybrid"?e:"auto"}function $t(e){return typeof e=="boolean"?e:u.search.query_expansion.enabled}function Ht(e){return typeof e!="string"?u.search.query_expansion.provider:e.trim()}function Bt(e){return typeof e=="boolean"?e:u.search.rerank.enabled}function Gt(e){return typeof e!="string"?u.search.rerank.model:e.trim()}function Kt(e){return typeof e=="number"&&Number.isFinite(e)&&Number.isInteger(e)&&e>0?e:u.search.rerank.top_k}function Jt(e){if(typeof e!="string")return u.vector_store.collection_name;let n=e.trim().replaceAll(/[^a-zA-Z0-9_-]/g,"_").slice(0,zn);return n.length>0?n:u.vector_store.collection_name}function Le(e){return{present:Array.isArray(e),values:Array.isArray(e)?structuredClone(e):[]}}function Yt(e,t){let n=e.schema,r=Le(n?.statuses),i=Le(n?.fields),a=Le(n?.type_workflows);return{persisted_settings:structuredClone(e),source_settings:structuredClone(e),has_source_item_type_definitions:Array.isArray(e.item_types?.definitions),source_item_type_definitions:Y(e.item_types?.definitions),has_source_schema_statuses:r.present,source_schema_statuses:r.values,has_source_schema_fields:i.present,source_schema_fields:i.values,has_source_schema_type_workflows:a.present,source_schema_type_workflows:a.values,runtime_item_type_definitions:Y(t.item_types?.definitions),runtime_schema_statuses:structuredClone(t.schema.statuses),runtime_schema_fields:structuredClone(t.schema.fields),runtime_schema_type_workflows:structuredClone(t.schema.type_workflows??[])}}function ke(e,t){Object.defineProperty(e,zt,{value:t,writable:!0,configurable:!0,enumerable:!1})}function We(e){let t=e[zt];if(!(!t||typeof t!="object"))return t}function No(e){let t=We(e);if(t){let n=structuredClone(t);n.source_settings.item_format=e.item_format,ke(e,n)}}function he(e){let t=structuredClone(e.settings),n=We(e.settings);n&&ke(t,n);let r=Ue(e.settings);return r!==void 0&&Xt(t,r),{settings:t,metadata:{has_explicit_item_format:e.metadata.has_explicit_item_format},warnings:[...e.warnings]}}function Un(e,t,n){let r=ne(t);return[n,re(e,r.files.types,te.types),re(e,r.files.statuses,te.statuses),re(e,r.files.fields,te.fields),re(e,r.files.workflows,te.workflows)]}async function $n(e,t,n){let r=await L(t);pe(e,{tracked_paths:t,signatures:r,value:he(n)})}async function Hn(e,t,n){try{await $n(e,t,n)}catch{H(e)}}function Nt(e,t){return e.find(n=>n.path===t)}function Bn(e,t,n){for(let r of n){let i=Nt(e,r),a=Nt(t,r);if(!i||!a||!ae([i],[a]))return!1}return!0}async function qe(e,t,n,r,i){try{let a=await L(t);if(!Bn(r,a,i)){H(e);return}pe(e,{tracked_paths:t,signatures:a,value:he(n)})}catch{H(e)}}function Gn(e,t){let n=ne(e.schema),r=Y(e.item_types?.definitions);if(!t)return{item_type_definitions:r,schema_statuses:n.statuses,schema_fields:n.fields,schema_type_workflows:n.type_workflows};let i=n.type_workflows??[],a=P(r,t.runtime_item_type_definitions),s=P(n.statuses,t.runtime_schema_statuses),l=P(n.fields,t.runtime_schema_fields),_=P(i,t.runtime_schema_type_workflows);return{item_type_definitions:a?t.has_source_item_type_definitions?Y(t.source_item_type_definitions):[]:r,schema_statuses:s?t.has_source_schema_statuses?structuredClone(t.source_schema_statuses):[]:n.statuses,schema_fields:l?t.has_source_schema_fields?structuredClone(t.source_schema_fields):[]:n.fields,schema_type_workflows:_?t.has_source_schema_type_workflows?structuredClone(t.source_schema_type_workflows):void 0:n.type_workflows}}function Xt(e,t){Object.defineProperty(e,Mt,{value:t,writable:!0,configurable:!0,enumerable:!1})}function Io(e){return Ue(e)!==void 0}function Ue(e){let t=e[Mt];return typeof t=="string"?t:void 0}function Kn(e){return e[Dt]}function Jn(e,t){Object.defineProperty(e,Dt,{value:t,writable:!0,configurable:!0,enumerable:!1})}function j(e){let t=Ve();return e!==void 0&&Xt(t,e),{settings:t,metadata:{has_explicit_item_format:!1},warnings:e?[e]:[]}}function Qt(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e.item_format;return t==="toon"||t==="json_markdown"}function De(e){return[...new Set((e??[]).map(t=>t.trim()).filter(t=>t.length>0))].sort((t,n)=>t.localeCompare(n))}function Zt(e){let t=u.agent_guidance,n=e?.template_version;return{prompt_completed:e?.prompt_completed===!0,declined:e?.declined===!0,declined_at:typeof e?.declined_at=="string"?e.declined_at:t.declined_at,template_version:typeof n=="number"&&Number.isInteger(n)&&n>0?n:t.template_version,last_checked_files:De(e?.last_checked_files??t.last_checked_files)}}function A(e){return[...new Set((e??[]).map(t=>t.trim().toLowerCase()).filter(t=>t.length>0))].sort((t,n)=>t.localeCompare(n))}function Yn(e){return e==="off"||e==="warn"||e==="enforce"?e:u.extensions.policy.mode}function Xn(e){return e==="off"||e==="warn"||e==="enforce"?e:u.extensions.policy.trust_mode}function en(e){return e==="none"||e==="restricted"||e==="strict"?e:u.extensions.policy.default_sandbox_profile}function Qn(e){let t=e.name.trim().toLowerCase();if(t.length===0)return null;let n={name:t};e.disabled===!0&&(n.disabled=!0),e.require_trusted===!0&&(n.require_trusted=!0),e.require_provenance===!0&&(n.require_provenance=!0),e.sandbox_profile!==void 0&&(n.sandbox_profile=en(e.sandbox_profile));let r=A(e.allowed_capabilities),i=A(e.blocked_capabilities),a=A(e.allowed_surfaces),s=A(e.blocked_surfaces),l=A(e.allowed_commands),_=A(e.blocked_commands),f=A(e.allowed_actions),w=A(e.blocked_actions),g=A(e.allowed_services),S=A(e.blocked_services);return r.length>0&&(n.allowed_capabilities=r),i.length>0&&(n.blocked_capabilities=i),a.length>0&&(n.allowed_surfaces=a),s.length>0&&(n.blocked_surfaces=s),l.length>0&&(n.allowed_commands=l),_.length>0&&(n.blocked_commands=_),f.length>0&&(n.allowed_actions=f),w.length>0&&(n.blocked_actions=w),g.length>0&&(n.allowed_services=g),S.length>0&&(n.blocked_services=S),n}function Zn(e){let t=new Map;for(let n of e??[]){let r=Qn(n);r&&t.set(r.name,r)}return[...t.values()].sort((n,r)=>n.name.localeCompare(r.name))}function ze(e){return e==="block"||e==="warn"?e:void 0}function er(e){if(typeof e=="string")return ze(e);if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let t=ze(e.global),n=ze(e.project);return t===void 0&&n===void 0?void 0:{...t!==void 0?{global:t}:{},...n!==void 0?{project:n}:{}}}}function T(e,t){return A(e?.[t]??u.extensions.policy[t])}function tn(e){let t=er(e?.pm_max_version_exceeded_mode);return{mode:Yn(e?.mode),trust_mode:Xn(e?.trust_mode),...t!==void 0?{pm_max_version_exceeded_mode:t}:{},require_provenance:e?.require_provenance===!0,trusted_extensions:T(e,"trusted_extensions"),default_sandbox_profile:en(e?.default_sandbox_profile),allowed_extensions:T(e,"allowed_extensions"),blocked_extensions:T(e,"blocked_extensions"),allowed_capabilities:T(e,"allowed_capabilities"),blocked_capabilities:T(e,"blocked_capabilities"),allowed_surfaces:T(e,"allowed_surfaces"),blocked_surfaces:T(e,"blocked_surfaces"),allowed_commands:T(e,"allowed_commands"),blocked_commands:T(e,"blocked_commands"),allowed_actions:T(e,"allowed_actions"),blocked_actions:T(e,"blocked_actions"),allowed_services:T(e,"allowed_services"),blocked_services:T(e,"blocked_services"),extension_overrides:Zn(e?.extension_overrides??u.extensions.policy.extension_overrides)}}function nn(e){return[...new Set((e??[]).map(n=>n.trim().toLowerCase().replaceAll("-","_")))].filter(n=>n.length>0).sort((n,r)=>n.localeCompare(r)).filter(n=>["author","acceptance_criteria","estimated_minutes","close_reason","reviewer","risk","confidence","sprint","release"].includes(n))}function q(e){return[...new Set((e??[]).map(t=>t.trim().toLowerCase()).filter(t=>t.length>0))].sort((t,n)=>t.localeCompare(n))}function b(e,t){return e===void 0?t:e}function C(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{}}function Fe(e){return Array.isArray(e)?e:[]}function tr(e,t,n){return{...t.validation,...e.validation,parent_reference:n.parent_reference,metadata_profile:n.metadata_profile,metadata_required_fields:nn(e.validation?.metadata_required_fields),lifecycle_stale_blocker_reason_patterns:q(e.validation?.lifecycle_stale_blocker_reason_patterns??t.validation.lifecycle_stale_blocker_reason_patterns),lifecycle_closure_like_blocked_reason_patterns:q(e.validation?.lifecycle_closure_like_blocked_reason_patterns??t.validation.lifecycle_closure_like_blocked_reason_patterns),lifecycle_closure_like_resolution_patterns:q(e.validation?.lifecycle_closure_like_resolution_patterns??t.validation.lifecycle_closure_like_resolution_patterns),lifecycle_closure_like_actual_result_patterns:q(e.validation?.lifecycle_closure_like_actual_result_patterns??t.validation.lifecycle_closure_like_actual_result_patterns),estimate_defaults_by_type:Re(e.validation?.estimate_defaults_by_type)}}function nr(e,t){return{enabled:e.telemetry?.enabled??t.telemetry.enabled,first_run_prompt_completed:e.telemetry?.first_run_prompt_completed??t.telemetry.first_run_prompt_completed,capture_level:e.telemetry?.capture_level??t.telemetry.capture_level,endpoint:e.telemetry?.endpoint??t.telemetry.endpoint,installation_id:e.telemetry?.installation_id??t.telemetry.installation_id,retention_days:e.telemetry?.retention_days??t.telemetry.retention_days}}function rr(e,t){return{...t.search,...e.search,default_mode:Ut(e.search?.default_mode),mutation_refresh_policy:Wt(e.search?.mutation_refresh_policy),query_expansion:{...t.search.query_expansion,...e.search?.query_expansion,enabled:$t(e.search?.query_expansion?.enabled),provider:Ht(e.search?.query_expansion?.provider)},rerank:{...t.search.rerank,...e.search?.rerank,enabled:Bt(e.search?.rerank?.enabled),model:Gt(e.search?.rerank?.model),top_k:Kt(e.search?.rerank?.top_k)}}}function or(e,t){return{adapter:e.vector_store.adapter??t.vector_store.adapter,collection_name:Jt(e.vector_store.collection_name),qdrant:{...t.vector_store.qdrant,...e.vector_store.qdrant},lancedb:{...t.vector_store.lancedb,...e.vector_store.lancedb}}}function ir(e,t){return e.item_format==="json_markdown"?"toon":e.item_format??t.item_format}function ar(e,t){return{default_depth:e.context?.default_depth??t.context.default_depth,activity_limit:e.context?.activity_limit??t.context.activity_limit,stale_threshold_days:e.context?.stale_threshold_days??t.context.stale_threshold_days,next_ranking_policy:e.context?.next_ranking_policy??t.context.next_ranking_policy,sections:{...t.context.sections,...e.context?.sections}}}function sr(e,t){return{openai:{...t.providers.openai,...e.providers.openai},ollama:{...t.providers.ollama,...e.providers.ollama}}}function Y(e){let t=(e??[]).map(r=>st(r)).filter(r=>r!==null),n=new Map;for(let r of t)n.set(r.name.toLowerCase(),r);return[...n.values()].sort((r,i)=>r.name.localeCompare(i.name))}function ye(e){let t=Ve(),n=Vt({governance:e.governance??{preset:"default"}});return{...t,...e,item_format:ir(e,t),locks:{...t.locks,...e.locks},ids:{...t.ids,...e.ids},agent_identity:structuredClone(e.agent_identity??t.agent_identity),mutation_guard:{...t.mutation_guard,...e.mutation_guard},checkpoints:{...t.checkpoints,...e.checkpoints},output:{...t.output,...e.output},ux:{...t.ux,...e.ux},history:{...t.history,...e.history,compact_policy:{...t.history.compact_policy,...e.history?.compact_policy}},validation:tr(e,t,n),governance:n,workflow:{definition_of_done:[...e.workflow?.definition_of_done??t.workflow.definition_of_done]},testing:{record_results_to_items:e.testing?.record_results_to_items??t.testing.record_results_to_items,allow_untrusted_linked_tests:e.testing?.allow_untrusted_linked_tests??t.testing.allow_untrusted_linked_tests},telemetry:nr(e,t),agent_guidance:Zt(e.agent_guidance??t.agent_guidance),item_types:{definitions:Y(e.item_types?.definitions)},schema:ne(e.schema??t.schema),context:ar(e,t),extensions:{enabled:[...e.extensions.enabled],disabled:[...e.extensions.disabled],policy:tn(e.extensions.policy??t.extensions.policy)},search:rr(e,t),providers:sr(e,t),vector_store:or(e,t)}}function cr(e){e.agent_identity=p(e.agent_identity,["probes_enabled","identity_vocabulary","harness_signals"]);let t=e.agent_identity;Object.hasOwn(t,"identity_vocabulary")&&(t.identity_vocabulary=p(C(t.identity_vocabulary),["version","aliases"])),e.agent_identity.harness_signals=Fe(e.agent_identity.harness_signals).map(n=>p(C(n),["harness","environment_keys","model_environment_keys","session_environment_keys","provenance_environment_keys","provenance_resolvers","provenance_unavailable_dimensions","argv_markers","client_names"])),e.locks=p(e.locks,["ttl_seconds","wait_ms"]),e.ids=p(e.ids,["token_length"]),e.mutation_guard=p(e.mutation_guard,["require_attributed_author","secret_guard","stale_in_progress_hours"]),e.checkpoints=p(e.checkpoints,["retention_days"]),e.output=p(e.output,["default_format"]),e.ux=p(e.ux,["deprecation_hints"]),e.history=p(e.history,["missing_stream","compact_policy"]),e.validation=p(e.validation,["sprint_release_format","parent_reference","metadata_profile","metadata_required_fields","lifecycle_stale_blocker_reason_patterns","lifecycle_closure_like_blocked_reason_patterns","lifecycle_closure_like_resolution_patterns","lifecycle_closure_like_actual_result_patterns","estimate_defaults_by_type"]),e.governance=p(e.governance,["preset","ownership_enforcement","create_mode_default","close_validation_default","require_close_reason","parent_reference","metadata_profile","force_required_for_stale_lock","create_default_type","workflow_enforcement","duplicate_detection_mode","duplicate_detection_threshold","duplicate_detection_limit"]),e.workflow=p(e.workflow,["definition_of_done"]),e.testing=p(e.testing,["record_results_to_items","allow_untrusted_linked_tests"]),e.telemetry=p(e.telemetry,["enabled","first_run_prompt_completed","capture_level","endpoint","installation_id","retention_days"]),e.agent_guidance=p(e.agent_guidance,["prompt_completed","declined","declined_at","template_version","last_checked_files"]),e.item_types=p(e.item_types,["definitions"]),e.schema=p(e.schema,["version","files","statuses","fields","workflow","type_workflows","unknown_field_policy"]),e.schema.files=p(C(e.schema.files),["types","statuses","fields","workflows"]),e.schema.workflow=p(C(e.schema.workflow),["draft_status","open_status","in_progress_status","blocked_status","close_status","canceled_status"]),e.context=p(e.context,["default_depth","activity_limit","stale_threshold_days","next_ranking_policy","sections"]),e.context.sections=p(C(e.context.sections),["hierarchy","activity","progress","blockers","files","workload","staleness","tests"]),e.extensions=p(e.extensions,["enabled","disabled","policy"]),e.extensions.policy=p(C(e.extensions.policy),["mode","trust_mode","pm_max_version_exceeded_mode","require_provenance","trusted_extensions","default_sandbox_profile","allowed_extensions","blocked_extensions","allowed_capabilities","blocked_capabilities","allowed_surfaces","blocked_surfaces","allowed_commands","blocked_commands","allowed_actions","blocked_actions","allowed_services","blocked_services","extension_overrides"]),e.extensions.policy.extension_overrides=Fe(e.extensions.policy.extension_overrides).map(n=>p(C(n),["name","disabled","require_trusted","require_provenance","sandbox_profile","allowed_capabilities","blocked_capabilities","allowed_surfaces","blocked_surfaces","allowed_commands","blocked_commands","allowed_actions","blocked_actions","allowed_services","blocked_services"])),e.search=p(e.search,["score_threshold","hybrid_semantic_weight","max_results","embedding_model","embedding_corpus_max_characters","embedding_batch_size","embedding_timeout_ms","scanner_max_batch_retries","provider","default_mode","mutation_refresh_policy","query_expansion","rerank"]),e.search.query_expansion=p(C(e.search.query_expansion),["enabled","provider"]),e.search.rerank=p(C(e.search.rerank),["enabled","model","top_k"]),e.providers=p(e.providers,["openai","ollama"]),e.providers.openai=p(C(e.providers.openai),["base_url","api_key","model"]),e.providers.ollama=p(C(e.providers.ollama),["base_url","model"]),e.vector_store=p(e.vector_store,["adapter","collection_name","qdrant","lancedb"]),e.vector_store.qdrant=p(C(e.vector_store.qdrant),["url","api_key"]),e.vector_store.lancedb=p(C(e.vector_store.lancedb),["path"])}function lr(e){return{...e,locks:b(e.locks,u.locks),ids:b(e.ids,u.ids),agent_identity:b(e.agent_identity,u.agent_identity),mutation_guard:b(e.mutation_guard,u.mutation_guard),checkpoints:b(e.checkpoints,u.checkpoints),output:b(e.output,u.output),ux:b(e.ux,u.ux),history:b(e.history,u.history),validation:b(e.validation,u.validation),workflow:b(e.workflow,u.workflow),testing:b(e.testing,u.testing),telemetry:b(e.telemetry,u.telemetry),agent_guidance:b(e.agent_guidance,u.agent_guidance),item_types:b(e.item_types,u.item_types),schema:b(e.schema,u.schema),context:b(e.context,u.context),extensions:b(e.extensions,u.extensions),search:b(e.search,u.search),providers:b(e.providers,u.providers),vector_store:b(e.vector_store,u.vector_store)}}function dr(e,t){return{...e.validation,parent_reference:t.parent_reference,metadata_profile:t.metadata_profile,metadata_required_fields:nn(e.validation?.metadata_required_fields),lifecycle_stale_blocker_reason_patterns:q(e.validation?.lifecycle_stale_blocker_reason_patterns??u.validation.lifecycle_stale_blocker_reason_patterns),lifecycle_closure_like_blocked_reason_patterns:q(e.validation?.lifecycle_closure_like_blocked_reason_patterns??u.validation.lifecycle_closure_like_blocked_reason_patterns),lifecycle_closure_like_resolution_patterns:q(e.validation?.lifecycle_closure_like_resolution_patterns??u.validation.lifecycle_closure_like_resolution_patterns),lifecycle_closure_like_actual_result_patterns:q(e.validation?.lifecycle_closure_like_actual_result_patterns??u.validation.lifecycle_closure_like_actual_result_patterns),estimate_defaults_by_type:Re(e.validation?.estimate_defaults_by_type)}}function ur(e){return{...u.search,...e.search,default_mode:Ut(e.search?.default_mode),mutation_refresh_policy:Wt(e.search?.mutation_refresh_policy),query_expansion:{...u.search.query_expansion,...e.search?.query_expansion,enabled:$t(e.search?.query_expansion?.enabled),provider:Ht(e.search?.query_expansion?.provider)},rerank:{...u.search.rerank,...e.search?.rerank,enabled:Bt(e.search?.rerank?.enabled),model:Gt(e.search?.rerank?.model),top_k:Kt(e.search?.rerank?.top_k)}}}function _r(e){return{default_depth:e.context?.default_depth??u.context.default_depth,activity_limit:e.context?.activity_limit??u.context.activity_limit,stale_threshold_days:e.context?.stale_threshold_days??u.context.stale_threshold_days,next_ranking_policy:e.context?.next_ranking_policy??u.context.next_ranking_policy,sections:{...u.context.sections,...e.context?.sections}}}function fr(e){return{...e.vector_store,adapter:e.vector_store?.adapter??u.vector_store.adapter,collection_name:Jt(e.vector_store?.collection_name),qdrant:{...e.vector_store?.qdrant},lancedb:{...e.vector_store?.lancedb}}}function mr(e,t,n,r){return{...e,item_format:"toon",validation:dr(e,t),governance:t,agent_guidance:Zt(e.agent_guidance),item_types:{definitions:r.item_type_definitions},schema:{...n,statuses:r.schema_statuses,fields:r.schema_fields,type_workflows:r.schema_type_workflows},search:ur(e),context:_r(e),extensions:{enabled:De(e.extensions?.enabled),disabled:De(e.extensions?.disabled),policy:tn(e.extensions?.policy)},vector_store:fr(e)}}function rn(e,t){for(let n of Object.keys(t)){let r=Reflect.get(t,n),i=e[n];typeof r=="object"&&r!==null&&!Array.isArray(r)&&typeof i=="object"&&i!==null&&!Array.isArray(i)?rn(i,r):e[n]=structuredClone(r)}}function $e(e,t,n){let r=new Set([...Object.keys(t),...Object.keys(n)]);for(let i of r){let a=t[i],s=n[i];if(!P(a,s)){if(s===void 0){delete e[i];continue}if(typeof a=="object"&&a!==null&&!Array.isArray(a)&&typeof s=="object"&&s!==null&&!Array.isArray(s)){let l=e[i],_=typeof l=="object"&&l!==null&&!Array.isArray(l)?l:{};$e(_,a,s),Object.keys(_).length>0?e[i]=_:delete e[i];continue}e[i]=structuredClone(s)}}}var we=["version","id_prefix","ids","author_default","agent_identity","mutation_guard","item_format","locks","checkpoints","output","ux","history","validation","governance","workflow","testing","telemetry","agent_guidance","item_types","schema","context","extensions","search","providers","vector_store"];function It(e,t){let n=lr(e),r=Vt(n),i=ne(n.schema),a=Gn(n,t),s=mr(n,r,i,a),l=p({...s,governance:Vn(r)},we);return cr(l),l}function on(e,t={}){let n=t.source===void 0?t.persist_source:Yt(t.source.validated,ye(t.source.validated)),r=It(e,n);if(n){let i=ye(n.source_settings);i.item_types={definitions:structuredClone(n.runtime_item_type_definitions)},i.schema={...i.schema,statuses:structuredClone(n.runtime_schema_statuses),fields:structuredClone(n.runtime_schema_fields),type_workflows:structuredClone(n.runtime_schema_type_workflows)};let a=It(i,n);t.source!==void 0&&rn(a,t.source.validated);let s=structuredClone(t.source===void 0?n.source_settings:t.source.raw);return $e(s,a,r),`${JSON.stringify(p(s,we),null,2)}
|
|
3
3
|
`}return`${JSON.stringify(r,null,2)}
|
|
4
4
|
`}async function pr(e){let t;try{t=await Lt(e)}catch(l){if(le(l))return j();throw l}let n=B(t),r;try{r=await Rn(n)}catch(l){if(le(l))return j();throw l}if(!r.isFile())throw Te("settings.json");let i;try{i=await Ze(n,Te("settings.json"))}catch(l){if(le(l))return j();throw l}let a;try{a=JSON.parse(i)}catch{return j("settings_read_invalid_json")}let s=_e(a);return s.success?{settings:ye(s.data),metadata:{has_explicit_item_format:Qt(a)},warnings:s.data.item_format==="json_markdown"?["settings_item_format_legacy_json_markdown_coerced_to_toon"]:[]}:j("settings_read_invalid_schema")}async function an(e){if(Ln(e))return pr(e);let t=B(e),n=[t];await kt({path:t,scope:"project"});let r=At(e);if(r){let f=await L(r.tracked_paths);if(ae(f,r.signatures))return he(r.value)}let i=await L([t]),a;try{a=await I(t)}catch{return j("settings_read_fs_error")}if(a===null){let f=j();return await qe(e,[t],f,i,[t]),f}let s=await L([t]);if(!ae(i,s))return H(e),an(e);let l;try{l=JSON.parse(a)}catch{let f=j("settings_read_invalid_json");return await qe(e,[t],f,s,[t]),f}let _=_e(l);if(!_.success){let f=j("settings_read_invalid_schema");return await qe(e,[t],f,s,[t]),f}try{let f=ye(_.data),w=Un(e,f.schema,t);n=w;let g=await L(w),S=await dt(e,f.schema),X=await L(w),Oe={...f,item_types:{definitions:Y([...f.item_types.definitions,...Fe(S.type_definitions_from_file)])},schema:S.schema};ke(Oe,Yt(_.data,Oe));let Ye={settings:Oe,metadata:{has_explicit_item_format:Qt(l)},warnings:[..._.data.item_format==="json_markdown"?["settings_item_format_legacy_json_markdown_coerced_to_toon"]:[],...S.warnings]};return ae(g,X)?pe(e,{tracked_paths:w,signatures:X,value:he(Ye)}):H(e),Ye}catch{let f=j("settings_read_merge_failed");return await Hn(e,n,f),f}}function hr(e,t=[],n=null){let r=He(n)??{},i=t.filter(s=>!Object.hasOwn(r,s));if(i.length===0)return e;let a=JSON.parse(e);for(let s of i)Reflect.deleteProperty(a,s);return`${JSON.stringify(a,null,2)}
|
|
@@ -6,4 +6,4 @@ import{Cc as pt,Gc as ht,Ic as V,Mb as D,O as st,Oh as yt,Sh as kt,Tf as oe,Uf a
|
|
|
6
6
|
`}function xr(e){try{return JSON.parse(e)}catch{throw new x("Existing settings.json is malformed; the settings write was refused.",v.USAGE,{code:"settings_write_invalid_existing_json",reason:"existing_settings_json_malformed",why:"Writing defaults over malformed settings could destroy intended project configuration.",nextSteps:["Repair the syntax in .agents/pm/settings.json, then retry the original command.","Run pm health to confirm the settings warning has cleared."]})}}async function Ro(e){return(await an(e)).settings}async function Lo(e,t,n=qn,r={}){let i=r.assignedPaths??[];wr(i);let a=B(e),s=We(t),l=s?void 0:Ue(t),_=on(t,{persist_source:s}),f=JSON.parse(_),w=!1;try{if(await vt({pmRoot:e,filePath:a,mutate:g=>{let S=g===null?null:xr(g);return g!==null&&r.skipIfStored?.(S)===!0?(w=!0,{raw:g,result:void 0}):l!==void 0&&g!==null?{raw:vr(S,f,l,i,Kn(t)),result:void 0}:{raw:s?`${JSON.stringify(p(Ne(s.persisted_settings,f,S),we),null,2)}
|
|
7
7
|
`:hr(_,r.omitSections,S),result:void 0}},op:n,author:ft(void 0,t.author_default),lockTtlSeconds:t.locks.ttl_seconds,lockWaitMs:t.locks.wait_ms,recordCreation:!1}),w)return;s?ke(t,{...s,persisted_settings:structuredClone(f)}):l!==void 0&&Jn(t,structuredClone(f)),await yt({path:a,scope:"project",op:n})}finally{H(e)}}import cn from"node:fs";import se from"node:path";import{createRequire as Sr}from"node:module";var ce="@unbrained/pm-cli",Er=new Set(["append","claim","changelog","close","close-many","close-task","comments","config","copy","create","dedupe-merge","delete","deps","docs","extension","event","events","files","focus","gc","history-author-acknowledge","history-compact","history-redact","history-repair","init","install","item","learnings","meet","merge","normalize","notes","package","packages","pause-task","plan","profile","reindex","release","remind","restore","schema","start-task","test","test-all","test-runs","test-runs-worker","telemetry","templates","twin","update","update-many","upgrade","vcs","workspace"]),ln=new Set(["--author","--expect-hash","--output-budget","--output-format","--output-include","--output-limit","--output-session","--path","--pm-path"]),Ge=/\b(\d{4})\.(\d{1,2})\.(\d{1,2})(?:-(\d+))?\b/u,xe="2026.8.31";function E(e,t){return e.some(n=>t.includes(n.split("=",1)[0]))}function Be(e,t){return["activate","adopt","adopt-all","deactivate","init","install","migrate","reload","uninstall"].includes(t[0]??"")||E(e,["--activate","--adopt","--adopt-all","--deactivate","--fix-managed-state","--init","--install","--output","--reload","--scaffold","--uninstall"])}var Or={changelog:(e,t)=>{if(t[0]==="generate")return!E(e,["--check"]);let n=e.indexOf("export");return t[0]==="export"&&(E(e,["--output"])||n>=0&&e[n+1]!==void 0&&!e[n+1].startsWith("-"))},comments:e=>E(e,["--add","--delete","--edit","--file","--stdin"]),config:(e,t)=>(t[0]==="project"||t[0]==="global"?t[1]:t[0])==="set",deps:()=>!1,docs:e=>E(e,["--add","--add-glob","--migrate","--remove"]),duplicates:()=>!1,events:()=>!1,extension:Be,files:(e,t)=>E(e,["--add","--add-glob","--migrate","--remove"])||t[0]==="discover"&&E(e,["--apply"]),health:e=>!E(e,["--check-only","--no-refresh","--skip-vectors"]),learnings:e=>E(e,["--add","--delete","--edit","--file","--stdin"]),merge:(e,t)=>t[0]!=="report",notes:e=>E(e,["--add","--delete","--edit","--file","--stdin"]),package:Be,packages:Be,profile:(e,t)=>t[0]==="apply",schema:(e,t)=>["add-field","add-status","add-type","remove-field","remove-status","remove-type","remap-status","rename-field","rename-type"].includes(t[0]??"")&&!(E(e,["--infer"])&&!E(e,["--apply"])),telemetry:(e,t)=>t.slice(0,2).some(n=>["clear","flush"].includes(n)),templates:(e,t)=>t[0]==="save",test:e=>E(e,["--update","--update-index","--add","--add-json","--background","--measure","--remove","--resume","--run","--stop"]),validate:e=>E(e,["--auto-fix","--prune-missing"]),vcs:(e,t)=>["abandon","create","merge","propose","ref-create"].includes(t[0]??""),workspace:(e,t)=>t[0]==="snapshot"&&["create","delete","restore"].includes(t[1]??"")};function be(e){let t=e.match(Ge);return t?[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4]??0)]:null}function z(e,t){let n=be(e),r=be(t);if(!n||!r)return null;for(let i=0;i<n.length;i+=1){let a=n[i]-r[i];if(a!==0)return Math.sign(a)}return 0}function ge(e){return z(e,xe)!==-1?3:2}function Tr(e,t){if(t===3)return e.filter(n=>n.history_epoch_compatible===!1).map(n=>({...n,declaration:n.declaration??n.version})).sort((n,r)=>z(n.version,r.version))[0]}function ve(e){try{let t=JSON.parse(cn.readFileSync(e,"utf8"));return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:null}catch{return null}}function Cr(e){let t=[...e.matchAll(/(<=|<)\s*v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/gu)].map(r=>({inclusive:r[1]==="<=",version:r[2]})),n=e.match(/\b\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?\s+-\s+v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/u);return n?[...t,{inclusive:!0,version:n[1]}]:t}function Ar(e){let t=e.split("||").map(n=>Cr(n));return{bounded:t.some(n=>n.length>0),compatible:t.some(n=>n.every(r=>{let i=z(xe,r.version);return i!==null&&(r.inclusive?i!==1:i===-1)}))}}function dn(e){return["dependencies","devDependencies","optionalDependencies","peerDependencies"].flatMap(t=>{let n=e[t];if(typeof n!="object"||n===null)return[];let r=n[ce];return typeof r=="string"?[r.trim()]:[]})}function Pr(e){return dn(e).flatMap(t=>{let n=/^[<!]/u.test(t)?void 0:t.match(Ge)?.[0];if(!n)return[];let r=/^(?:=|v)?\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?$/u.test(t),i=Ar(t);return[{version:n,constraint:r?"exact":i.bounded?"range":"minimum",...r?{}:{declaration:t},history_epoch_compatible:r?z(n,xe)!==-1:i.compatible}]})}function jr(e){let n=ve(se.join(e,"package-lock.json"))?.packages;if(typeof n!="object"||n===null)return;let r=n["node_modules/@unbrained/pm-cli"];if(typeof r!="object"||r===null)return;let i=r.version;return typeof i=="string"?i:void 0}function Nr(e,t){try{let n=cn.readFileSync(se.join(e,t),"utf8").split(/\r?\n/u),r=n.findIndex(_=>_.includes(ce));if(r<0)return;let i=n[r].match(/^\s*/u)[0].length,a=[n[r]];for(let _=r+1;_<n.length;_+=1){let f=n[_],w=f.trim(),g=f.match(/^\s*/u)[0].length;if(w.length>0&&g<=i)break;a.push(f)}return a.join(`
|
|
8
8
|
`).match(/^\s*version(?::\s*|\s+)["']?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/mu)?.[1]??a[0].match(Ge)?.[0]}catch{return}}function un(e){let t=[],n=ve(se.join(e,"package.json"));n&&t.push(...Pr(n).map(s=>({...s,source:"package.json"})));let i=ve(se.join(e,"node_modules","@unbrained","pm-cli","package.json"))?.version;typeof i=="string"&&be(i)&&t.push({version:i,source:"installed-package",constraint:"exact",history_epoch_compatible:ge(i)===3});let a=jr(e);a&&be(a)&&t.push({version:a,source:"package-lock.json",constraint:"exact",history_epoch_compatible:ge(a)===3});for(let s of["pnpm-lock.yaml","yarn.lock"]){let l=Nr(e,s);l&&t.push({version:l,source:s,constraint:"exact",history_epoch_compatible:ge(l)===3})}return t}function Ir(e,t){if(t<=1)return;let{minVersion:n,lt:r}=Sr(import.meta.url)("semver"),i=dn(ve(se.join(e,"package.json"))??{}).find(s=>{try{let l=n(s);return l!==null&&r(l,"2026.10.10")}catch{return!1}}),a=i===void 0?un(e).find(s=>z(s.version,"2026.10.10")===-1):{version:i,source:"package.json"};if(a)throw new x(`The project selects pm ${a.version}, which cannot safely refuse item format ${t}.`,v.CONFLICT,{code:"project_runtime_item_format_incompatible",reason:a.source,required:"Upgrade project pins, installed SDKs, CI hosts and Git merge drivers before writing guarded item formats.",nextSteps:["Use a pm runtime supporting the required item format throughout the project; preserve original item and history bytes, and never re-anchor history to satisfy an older host."]})}function $o(e,t){let n=_t(e);n<=1||(Ir(ct(t),n),e.pm_format_version=n)}function _n(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(ln.has(n)){t+=1;continue}if(!n.startsWith("-"))return{command:n.toLowerCase(),index:t}}}function Rr(e){let t=_n(e);if(!t||E(e,["--help","-h","--dry-run"]))return!1;let{command:n,index:r}=t,i=[];for(let s=r+1;s<e.length;s+=1){let l=e[s];if(ln.has(l)){s+=1;continue}l.startsWith("-")||i.push(l.toLowerCase())}let a=Or[n];return a?a(e,i):Er.has(n)}function Lr(e){let t=_n(e.argv)?.command,n=Rr(e.argv),r=un(e.projectRoot).filter(w=>z(w.version,e.executingVersion)!==null).sort((w,g)=>z(g.version,w.version)),i=r[0],a=i!==void 0&&z(e.executingVersion,i.version)===-1,s=ge(e.executingVersion),l=Tr(r,s),_=n&&l!==void 0,f=a&&!n?{code:"project_runtime_stale_read",executing_version:e.executingVersion,project_version:i.version,source:i.source,message:"This read is using an older pm runtime than the project requires.",next_steps:[`Run the command through the project's installed ${ce} ${i.version}.`,"Install the project dependencies with its declared package manager if the local executable is missing."]}:void 0;return{compatible:!n||!a&&!_||e.allowStale===!0,executing_version:e.executingVersion,...i?{project_version:i.version,source:i.source}:{},...t?{command:t}:{},mutating:n,stale:a,history_epoch_incompatible:_,writer_item_hash_version:s,...l?{incompatible_project_version:l.declaration,incompatible_source:l.source}:{},...f?{warning:f}:{},override_applied:n&&(a||_)&&e.allowStale===!0}}function Ho(e){let t=Lr(e);if(t.compatible)return t;throw t.history_epoch_incompatible?new x(`pm ${t.executing_version} cannot write item-hash epoch ${t.writer_item_hash_version} into a project pinned to pm ${t.incompatible_project_version}.`,v.CONFLICT,{code:"project_runtime_history_epoch_incompatible",reason:t.incompatible_source,why:`The pinned runtime cannot read item_hash_version ${t.writer_item_hash_version}; allowing the write would break its health and validation gates.`,nextSteps:[`Upgrade the project's ${ce} pin to ${xe} or newer before mutating tracker history.`,"For an intentional coordinated migration only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]}):new x(`pm ${t.executing_version} cannot mutate a project pinned to newer pm ${t.project_version}.`,v.CONFLICT,{code:"project_runtime_stale_mutation",reason:t.source,why:"An older runtime can write storage, history, and merge contracts it does not understand.",nextSteps:[`Run this command through the project's installed ${ce} ${t.project_version}.`,"For an intentional recovery only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]})}import Je from"node:fs/promises";import Se from"node:path";function M(e,t){return typeof e=="object"&&e!==null&&"code"in e&&e.code===t}function fn(e){let t=["--pm-path",e,"init","--defaults","--agent-guidance","skip"];return{suggested_retry:lt(t),suggested_retry_args:t}}function Ee(e){return new x(`Tracker root is not a directory at ${e}.`,v.USAGE,{code:"tracker_root_not_directory",reason:"not_a_directory",resolved_path:e,nextSteps:["Pass a tracker directory, usually <workspace>/.agents/pm, rather than a file path."]})}function Ke(e){return new x(`Tracker root is not readable at ${e}.`,v.GENERIC_FAILURE,{code:"tracker_root_unreadable",reason:"unreadable",resolved_path:e,nextSteps:["Grant read and directory-search permission to the tracker root, then retry."]})}async function qr(e){let t=Se.resolve(e),n=Se.parse(t).root,r=Se.dirname(t);for(;r!==n;){let i;try{i=await Je.stat(r)}catch(a){if(M(a,"ENOTDIR"))throw Ee(e);if(!M(a,"ENOENT"))throw a;r=Se.dirname(r);continue}if(!i.isDirectory())throw Ee(e);return}}async function zr(e){let t;try{t=await Je.stat(e)}catch(n){throw M(n,"ENOENT")?(await qr(e),new x(`Tracker is not initialized at ${e}. Tracker root does not exist. Run pm init first.`,v.NOT_FOUND,{code:"tracker_root_missing",reason:"missing",resolved_path:e,nextSteps:["Confirm the tracker root path or initialize it with the emitted retry."],recovery:fn(e)})):M(n,"ENOTDIR")?Ee(e):M(n,"EACCES")||M(n,"EPERM")?Ke(e):n}if(!t.isDirectory())throw Ee(e);if(process.platform!=="win32"&&((t.mode&292)===0||(t.mode&73)===0))throw Ke(e);try{await(await Je.opendir(e)).close()}catch(n){throw M(n,"EACCES")||M(n,"EPERM")?Ke(e):n}}async function ei(e){if(await zr(e),!await Qe(B(e)))throw new x(`Tracker is not initialized at ${e}. Run pm init first.`,v.NOT_FOUND,{code:"tracker_not_initialized",reason:"settings_missing",resolved_path:e,nextSteps:["Initialize the selected tracker root with the emitted retry."],recovery:fn(e)})}export{R as a,W as b,Jr as c,Yr as d,Xr as e,vt as f,Qr as g,Zr as h,eo as i,St as j,_e as k,co as l,H as m,jo as n,Ln as o,Vt as p,No as q,Io as r,ye as s,on as t,an as u,Ro as v,Lo as w,xe as x,z as y,ge as z,un as A,Ir as B,$o as C,Rr as D,Lr as E,Ho as F,fn as G,zr as H,ei as I};
|
|
9
|
-
//# sourceMappingURL=chunk-
|
|
9
|
+
//# sourceMappingURL=chunk-XRCE4QNL.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as T,b as M,f,i as _,j as R,l as E}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as T,b as M,f,i as _,j as R,l as E}from"./chunk-7F3UFYZA.js";import{v as g}from"./chunk-XRCE4QNL.js";import{Q as l,R as I}from"./chunk-SX76UGEY.js";import{A as u,C as p}from"./chunk-6OIHST4I.js";async function pe(e){let{plan:t}=e,i=await E({pmRoot:e.pmRoot,author:e.author,transactionId:t.transaction_id,mutations:t.mutations}),a=new Map(i.warnings.map(r=>[r.index,r.warnings])),o=t.rows.map(r=>{let n={...r};delete n.warnings;let c=a.get(r.index);return c!==void 0&&(n.warnings=c),n});return{validation:i,rows:o}}async function le(e){let t=e.upsertKey?.trim();if(t!==void 0&&t.length===0)throw new p("Upsert key must be a non-empty field name.",u.USAGE);let i=e.settings??await g(e.pmRoot),a=e.transactionId?.trim()??"",o=a.length>0?a:M(e.input),r=await _(e.pmRoot,i),n=l(r.schema).definitions,d=(n.find(m=>m.metadata_key===t)??n.find(m=>m.key===t||I(m)===t))?.metadata_key??T(t),s=d===void 0?void 0:{key:d,existing:await R(e.pmRoot,i,r,d)};return{...f(e.input,{transactionId:o,idPrefix:i.id_prefix,runtimeFields:n,...s===void 0?{}:{upsert:s}}),transaction_id:o,transaction_id_source:a.length>0?"explicit":"derived",...s===void 0?{}:{upsert_key:s.key}}}export{pe as a,le as b};
|
|
2
|
+
//# sourceMappingURL=chunk-ZDL45VTB.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=field-option-collisions-
|
|
1
|
+
import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i}from"./chunk-IGW3RVJC.js";import"./chunk-B2GM6KOM.js";import"./chunk-DUJSME77.js";import"./chunk-SX76UGEY.js";import"./chunk-6OIHST4I.js";import"./chunk-XAWE4EAK.js";export{i as assertFieldDefinitionOptionsAvailable,h as assertFieldOptionsAvailable,e as describeFieldFlagSpellingDefectLine,f as describeFieldOptionCollision,d as resolveAddFieldFlagSpellingDefects,b as resolveAddFieldOptionCollisions,c as resolveFieldFlagSpellingDefects,a as resolveFieldOptionCollisions,g as scanFieldOptionCollisions};
|
|
2
|
+
//# sourceMappingURL=field-option-collisions-CGRJEAPQ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{A as u,B as v,C as w,D as x,E as y,k as e,l as f,m as g,n as h,o as i,p as j,q as k,r as l,s as m,t as n,u as o,v as p,w as q,x as r,y as s,z as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=item-revision-
|
|
1
|
+
import{A as u,B as v,C as w,D as x,E as y,k as e,l as f,m as g,n as h,o as i,p as j,q as k,r as l,s as m,t as n,u as o,v as p,w as q,x as r,y as s,z as t}from"./chunk-KES4VHU4.js";import"./chunk-NDS4MXZX.js";import"./chunk-PZA7QECY.js";import"./chunk-KCRRTJ4X.js";import"./chunk-XRCE4QNL.js";import{Wf as a,Xf as b,Yf as c,Zf as d}from"./chunk-WZOJSHJT.js";import"./chunk-DUJSME77.js";import"./chunk-SX76UGEY.js";import"./chunk-6OIHST4I.js";import"./chunk-XAWE4EAK.js";export{f as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,e as ITEM_REVISION_CONFLICT_CODE,w as assertExpectHashAdmissible,t as bindExpectedItemRevisions,c as bindItemRevisionScope,a as createItemRevisionScope,k as describeItemRevisionChanges,y as dispatchWithExpectedItemRevisions,q as enrichItemRevisionConflict,o as expectHashInvocationRewrittenError,x as expectHashRequiresMutationError,m as isItemRevisionConflict,u as isTrackerRevisionGuarded,l as itemRevisionConflictRowFields,d as itemRevisionScopeReceipt,v as itemRevisionUncheckedWarning,g as normalizeExpectedItemHash,h as parseExpectHashSpecs,i as readItemRevision,j as resolveExpectedItemRevisions,r as runWithBoundItemRevisionScope,b as runWithItemRevisionScope,p as scopeItemRevisionConflict,n as throwFirstItemRevisionConflict,s as withExpectedItemRevisions};
|
|
2
|
+
//# sourceMappingURL=item-revision-FGDR5NSF.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as a,j as b,k as c,l as d,m as e,n as f,o as g,p as h,q as i,r as j}from"./chunk-7F3UFYZA.js";import"./chunk-PQSEEVOA.js";import"./chunk-GQXK4KKH.js";import"./chunk-MGJMQSN4.js";import"./chunk-CBBKXTJG.js";import"./chunk-HTGN24XM.js";import"./chunk-T3GJPXIZ.js";import"./chunk-LNZKNVMT.js";import"./chunk-KHFUHGL3.js";import"./chunk-AA52P34H.js";import"./chunk-5AAIRHNE.js";import"./chunk-MNFCJNQA.js";import"./chunk-6H36ZHMI.js";import"./chunk-QMM46SJM.js";import"./chunk-5FY2VHRF.js";import"./chunk-KES4VHU4.js";import"./chunk-NDS4MXZX.js";import"./chunk-PZA7QECY.js";import"./chunk-KCRRTJ4X.js";import"./chunk-XRCE4QNL.js";import"./chunk-WZOJSHJT.js";import"./chunk-IGW3RVJC.js";import"./chunk-B2GM6KOM.js";import"./chunk-DUJSME77.js";import"./chunk-SX76UGEY.js";import"./chunk-6OIHST4I.js";import"./chunk-XAWE4EAK.js";export{h as _testOnlyItemTransaction,j as abandonItemTransaction,f as buildItemCompletionMutations,g as commitItemCompletion,e as commitItemMutations,b as listUpsertKeyCandidates,c as loadGuardedRuntimeSchema,d as previewItemMutations,i as readItemTransaction,a as resolveTransactionSchema};
|
|
2
|
+
//# sourceMappingURL=item-transaction-C3KAMEYO.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{kc as t,lc as r,mc as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=mutation-actor-
|
|
1
|
+
import{kc as t,lc as r,mc as s}from"./chunk-WZOJSHJT.js";import"./chunk-DUJSME77.js";import"./chunk-SX76UGEY.js";import"./chunk-6OIHST4I.js";import"./chunk-XAWE4EAK.js";function c(n){let e=r(n),o={...e.harness===void 0?{}:{harness:e.harness},...e.model===void 0?{}:{model:e.model},...e.model_source===void 0?{}:{model_source:e.model_source},...e.instance===void 0?{}:{instance:e.instance}};return Object.freeze({author:n,author_source:t(n),principal:s(n),...Object.keys(o).length===0?{}:{agent:Object.freeze(o)}})}export{c as resolveMutationActor};
|
|
2
|
+
//# sourceMappingURL=mutation-actor-HGG47KXV.js.map
|
package/dist/cli-bundle/chunks/{mutation-admission-3OMCTQD4.js → mutation-admission-LLHIRY6O.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{P as y,s as _,x as f}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=mutation-admission-
|
|
1
|
+
import{P as y,s as _,x as f}from"./chunk-CBBKXTJG.js";import{a as A,j as L,m as M}from"./chunk-5FY2VHRF.js";import"./chunk-KCRRTJ4X.js";import{v as E}from"./chunk-XRCE4QNL.js";import{Qa as S,ba as w}from"./chunk-WZOJSHJT.js";import{G as R,Qa as N,Wa as b}from"./chunk-B2GM6KOM.js";import{da as C}from"./chunk-DUJSME77.js";import{Q as T,R as g}from"./chunk-SX76UGEY.js";import{C as m}from"./chunk-6OIHST4I.js";import"./chunk-XAWE4EAK.js";function l(e,t,n,i=!1){let s=[...n].map(o=>({candidate:o,distance:S(t,o,3)})).filter(o=>o.distance!==null).sort((o,d)=>o.distance-d.distance||o.candidate.localeCompare(d.candidate))[0]?.candidate,a=i?`Put mutation fields under options (options.${t}).`:s?`Did you mean "${s}"?`:"Use the declared command options or the field option for registered item fields.";throw new m(`Unknown ${e} ${i?"argument":"option"} "${t}". ${a} No changes were made.`,2,{code:"invalid_argument_value",reason:"unknown_mutation_option",changed:!1,field:t,required:a,nextSteps:[a]})}var p=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor"];function $(e){let t=e==="create"?L:M,i=(e==="create"?N:b).map(({flag:s})=>s.slice(2).replace(/-([a-z])/gu,(a,o)=>o.toUpperCase()));return new Set([...t.flatMap(s=>[s.target,...s.keys]),...i,"author","message","force","fullChangedFields","idOnly",...p])}function F(e){if(e!==void 0&&!f(e))throw new m("Mutation options must be an object. No changes were made.",2,{code:"invalid_argument_value",changed:!1})}async function v(e,t){let i=T((await E(w(process.cwd(),t))).schema).command_to_fields.get(e)??[];return{targets:i.map(s=>g(s)),reads:s=>i.some(a=>C({[s]:!0},a)===!0)}}async function h(e,t,n,i,s,a=(o,d)=>l(e,o,d)){let o=[...n].filter(r=>!i.has(r));if(o.length===0)return;let d=await v(t,s);for(let r of d.targets)i.add(r);for(let r of o)d.reads(r)||a(r,i)}async function ee(e,t,n,i,s){if(_(t))return;let a=$(e),o=new Set(["action","options","path","cwd","author","force","noExtensions","no_extensions","fullChangedFields","idOnly",...p,...s,...e==="update"?["id"]:[]]);for(let r of Object.keys(t))o.has(r)||l(e,r,a,a.has(r));let d=t.options;F(d),await h(e,e,new Set([...Object.keys(d??{}),...Object.keys(n)]),a,i)}var I=new Set([...y].filter(e=>e!=="filterStatus"&&(e.startsWith("filter")||e==="ids"||e==="limit"||e==="offset"))),k=e=>e.replace(/_([a-z])/gu,(t,n)=>n.toUpperCase()),O=new Map([["for","Bound the selection with list.limit."],["tokenBudget","Bound the selection with list.limit."],["token_budget","Bound the selection with list.limit."],["all",'State the status selection as filterStatus: "all" beside the list record.'],["status","State the status selection as filterStatus beside the list record."]]),K=["compact","brief","fields","includeBody","full"];async function U(e,t){let n=K.filter(s=>Object.hasOwn(e,s));if(n.length===0)return;let i=await v("list",t);for(let s of n)i.reads(s)&&c(`update-many "list.${s}" is not read beside this selection.`,`list.${s}`,"The bulk selection clears this list option, so the schema field's filter under that name is not applied; select the rows another way.")}var j=["excludeTerminal","lifecycleBucket","dependencyBlocked"];function P(){let e=R.map(({flag:n})=>n.replace(/^--(?:no-)?/u,"").replace(/-([a-z])/gu,(i,s)=>s.toUpperCase())),t=new Set([...e,...A.flatMap(n=>n.keys),"filterEstimateMissing",...j]);for(let n of O.keys())t.delete(n);return t}function c(e,t,n,i="unknown_mutation_option"){throw new m(`${e} ${n} No changes were made.`,2,{code:"invalid_argument_value",reason:i,changed:!1,field:t,required:n,nextSteps:[n]})}function D(){let e=$("update");e.delete("id");for(let t of e)/File$|^stdin/u.test(t)&&e.delete(t);return e.add("documentAnnotationSnapshot"),e}function B(e){for(let t of["list","update"]){let n=e[t];n!=null&&!f(n)&&c(`update-many "${t}" must be an object.`,t,`Pass ${t} as an object, or omit it.`,"invalid_mutation_option_value")}}async function x(e,t,n){Object.hasOwn(e,"id")&&l("update-many list","id",new Set(["ids"])),Object.hasOwn(e,"status")&&c('update-many "list.status" is not read beside this selection.',"list.status",O.get("status"));let i=[...t].find(s=>I.has(s));i!==void 0&&c(`update-many "${i}" is not read beside this selection.`,i,`Put the selection inside list, or drop the list record; a flat "${i}" beside it is not read.`),await U(e,n),await h("update-many list","list",Object.keys(e),P(),n,(s,a)=>{let o=O.get(s);o===void 0&&l("update-many list",s,a),c(`update-many "list.${s}" is not read beside this selection.`,`list.${s}`,o)})}function Y(e,t,n){for(let i of e)t.has(i)||(n.has(i)&&c(`Unknown update-many option "${i}".`,i,`Put update fields inside update (update.${i}); beside a nested update record an outer key selects rows or controls the run.`),l("update-many",i,t))}async function te(e,t,n){if(_(e))return;let i=e.options;F(i);let s=D(),a=new Set([...y,"author","message","force","fullChangedFields","idOnly",...p]),o=new Set([...s,...a]),d=new Set(["action","options","path","cwd","author","noExtensions","no_extensions","fullChangedFields","idOnly",...p]);for(let u of Object.keys(e))d.has(u)||l("update-many",u,o,o.has(u));let r=new Set([...Object.keys(i??{}),...Object.keys(t)].map(u=>p.includes(k(u))?k(u):u));if(B(t),f(t.list)&&await x(t.list,r,n),!f(t.update)){await h("update-many","update_many",r,o,n);return}Y(r,a,s),await h("update-many","update_many",Object.keys(t.update),s,n)}export{ee as assertNativeMutationOptions,te as assertNativeUpdateManyOptions};
|
|
2
|
+
//# sourceMappingURL=mutation-admission-LLHIRY6O.js.map
|
package/dist/cli-bundle/chunks/{register-list-query-3GV3LBOT.js → register-list-query-EKSCZWEZ.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ce}from"./chunk-
|
|
1
|
+
import{a as ce}from"./chunk-FWBR3OW7.js";import"./chunk-SLFRSZK6.js";import{b as g,c as _,d as O}from"./chunk-DYL2N3OC.js";import{L as ie,P as re,U as ae,n as oe,u as I,w as ne}from"./chunk-5AAIRHNE.js";import{Ha as V,Hc as X,Jc as Y,Lc as Z,Mb as K,Oc as ee,Pc as te,Rc as se,Sc as le,Tc as de,U as Q,vc as W}from"./chunk-MNFCJNQA.js";import"./chunk-6H36ZHMI.js";import"./chunk-QMM46SJM.js";import{Aa as $,Ba as M,Ca as B,Da as N,Ea as T,Fa as U,Ga as P,Ha as z,Ia as H,Ja as J,pa as y,sa as s,ua as l}from"./chunk-5FY2VHRF.js";import"./chunk-KES4VHU4.js";import"./chunk-NDS4MXZX.js";import"./chunk-PZA7QECY.js";import{Aa as q,za as R}from"./chunk-KCRRTJ4X.js";import{v as G}from"./chunk-XRCE4QNL.js";import{Af as p,Ih as k,ba as D,gf as F,uf as v,zf as h}from"./chunk-WZOJSHJT.js";import{e as L}from"./chunk-B2GM6KOM.js";import{o as C,p as E}from"./chunk-DUJSME77.js";import"./chunk-SX76UGEY.js";import{A as c,C as u}from"./chunk-6OIHST4I.js";import"./chunk-XAWE4EAK.js";async function he(e,i){let n=y(i),o=Date.now();if([e.raw,e.compact,e.full,e.provenance].filter(d=>d===!0).length>1)throw new u("Activity projection options are mutually exclusive. Use --raw, --compact, --provenance, or --full.",c.USAGE);let r=z(e.stream);if(r&&!n.json)throw new u("--stream requires --json output mode.",c.USAGE);let t=P(e),a=await K(r&&e.full!==!0&&e.provenance!==!0?{...t,raw:!0,compact:!0}:t,n);r?N(a,t,n):h(a,n),n.profile&&p(`profile:command=activity took_ms=${Date.now()-o}`)}function j(e){e.option("--id <value>","Filter by item ID").option("--op <value>","Filter by history operation").option("--author <value>","Filter by history author").option("--from <value>","Inclusive lower time bound (ISO or relative)").option("--to <value>","Exclusive upper time bound (ISO or relative)").option("--limit <n>","Maximum activity rows").option("--after <cursor>","Continue a fixed-window page").option("--unbounded","Return every matching row").option("--compact","Show compact event rows").option("--raw","Show the legacy compact per-event stream instead of the item digest").option("--full","Show full activity entries with JSON Patch payloads").option("--provenance","Show patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include provenance counts").option("--harness <value>","Filter by harness (repeatable)",s).option("--agent-instance <value>","Filter by agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter exact provenance values (repeatable)",s).option("--stream [mode]","Emit line-delimited JSON rows (requires --json): rows|ndjson|jsonl").description("Show recent activity across items.").action(he)}function ye(e,i){return!i||i.size===0?!0:e==="context"?i.has("context")||i.has("ctx"):i.has(e)}function ue(e){if(e===void 0)return;if(typeof e!="string")throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE);let i=e.trim().toLowerCase();if(i==="csv"||i==="table"||i==="json"||i==="ndjson"||i==="toon")return i;throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE)}function S(e,i,n,o=!1){if(i===void 0)return n;if(typeof i!="string")throw new u(`${e} --format must be one of ${o?"json|ndjson|toon":"json|toon"}`,c.USAGE);let r=i.trim().toLowerCase();if(r!=="json"&&(r!=="ndjson"||!o)&&r!=="toon")throw new u(`${e} --format must be one of ${o?"json|ndjson|toon":"json|toon"}`,c.USAGE);if(n.json===!0&&r==="toon")throw new u(`${e} cannot combine --json with --format toon`,c.USAGE);return{...n,json:r==="json"||r==="ndjson"}}function ve(e,i){L[i]==="brief"&&e.includeBody!==!0&&e.compact!==!0&&e.brief!==!0&&e.full!==!0&&e.fields===void 0&&(e.brief=!0)}function pe(e){e.option("--has-notes","Show only items that have notes").option("--has-learnings","Show only items that have learnings").option("--has-files","Show only items that have linked files").option("--has-docs","Show only items that have linked docs").option("--has-tests","Show only items that have linked tests").option("--has-comments","Show only items that have comments").option("--has-deps","Show only items that have dependencies").option("--has-body","Show only items that have a non-empty body").option("--has-linked-command","Show only items whose linked tests carry a runnable command").option("--no-notes","Show only items that have no notes").option("--no-learnings","Show only items that have no learnings").option("--no-files","Show only items that have no linked files").option("--filter-files-missing","Alias for --no-files").option("--no-docs","Show only items that have no linked docs").option("--filter-docs-missing","Alias for --no-docs").option("--no-tests","Show only items that have no linked tests").option("--no-comments","Show only items that have no comments").option("--no-deps","Show only items that have no dependencies").option("--empty-body","Show only items with an empty body").option("--no-linked-command","Show only items whose linked tests carry no runnable command").option("--filter-reviewer-missing","Show only items missing reviewer").option("--filter-risk-missing","Show only items missing risk").option("--filter-confidence-missing","Show only items missing confidence").option("--filter-sprint-missing","Show only items missing sprint").option("--filter-release-missing","Show only items missing release")}var ge={draft:{name:"list-draft",dependencyBlocked:!1},open:{name:"list-open",dependencyBlocked:!1},in_progress:{name:"list-in-progress",dependencyBlocked:!1},blocked:{name:"list-blocked",dependencyBlocked:!0},closed:{name:"list-closed",dependencyBlocked:!1},canceled:{name:"list-canceled",dependencyBlocked:!1}};function be(e,i){let n=e.stream===!0,o=ue(e.format),r=o==="csv"||o==="table",t=o==="json"||o==="ndjson"||o==="toon"?S("List",e.format,i,!0):i;if(n&&!t.json)throw new u("--stream requires --json output mode.",c.USAGE);if((r||o==="ndjson")&&n)throw new u("--format csv|table|ndjson cannot be combined with --stream.",c.USAGE);return{streamMode:n,listFormat:o,effectiveGlobal:t}}function we(e,i,n){if(n.listFormat==="csv"||n.listFormat==="table"){k(i);let o=i.items,r=n.listFormat==="csv"?R(o):q(o);!n.effectiveGlobal.quiet&&r.length>0&&v(`${r}
|
|
2
2
|
`)}else if(n.listFormat==="ndjson"){k(i);let o=_(i.items);!n.effectiveGlobal.quiet&&o.length>0&&v(`${o}
|
|
3
3
|
`)}else n.streamMode?B(e,i,n.effectiveGlobal):h(i,n.effectiveGlobal)}function A(e,i,n,o=[]){if(n.outputBudget===void 0)return F(e,i,o);let{outputBudget:r,...t}=F(e,{...i,outputBudget:n.outputBudget},o);return t}async function xe(e){let i=y(e.actionCommand),n=e.aliasContract?{...i,command:e.aliasContract.canonical}:i,o=Date.now();e.aliasContract?.lifecycle==="deprecated"&&await G(D(process.cwd(),n.path)).then(fe=>fe.ux.deprecation_hints)&&p(E(e.aliasContract));let r=A("list",e.options,n),t=$(r),a=ke(e,t),{effectiveName:d,effectiveStatus:m,effectiveDependencyBlocked:f,effectiveExcludeTerminal:w}=a;ve(t,e.name),Object.assign(t,{projectionCommand:d}),w&&(t.excludeTerminal=!0),t.dependencyBlocked=f;let x=be(r,n),me=await Q(f?void 0:m,t,n);we("list",me,x),n.profile&&p(`profile:command=list took_ms=${Date.now()-o}`)}function ke(e,i){let n=e.name,o=e.status,r=e.dependencyBlocked===!0,t=e.excludeTerminal===!0,a=i.status?.trim().toLowerCase(),d=e.name==="list"&&a!==void 0?ge[a]:void 0;return e.name==="list"&&(e.options.all===!0||a==="all"?(n="list-all",t=!1,i.status=void 0):a!==void 0&&d!==void 0&&(n=d.name,o=a,r=d.dependencyBlocked,t=!1,i.status=void 0)),(n==="list-open"||n==="list-in-progress")&&(i.lifecycleBucket=n==="list-open"?"open":"in_progress",o=void 0),{effectiveName:n,effectiveStatus:o,effectiveDependencyBlocked:r,effectiveExcludeTerminal:t}}function Se(e,i){let{name:n,description:o,status:r,excludeTerminal:t,allowStatusFilter:a,dependencyBlocked:d,aliasContract:m}=i,f=e.command(n,{hidden:m?.hidden===!0}).description(o);a&&f.option("--status <value>","Filter by status (repeatable or comma-separated; matches any; all selects every status)",s),n==="list"&&f.option("--all","Include every lifecycle status"),f.option("--for <intent>",`Apply a declared context intent projection. ${g("list","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--type <value>","Filter by item type (repeatable or comma-separated; matches any)",s).option("--tag <value>","Filter by tag (repeatable or comma-separated; matches any)",s).option("--priority <value>","Filter by priority (repeatable or comma-separated; matches any)",s).option("--deadline-before <value>","Filter by deadline upper bound (ISO/date string or relative)").option("--deadline-after <value>","Filter by deadline lower bound (ISO/date string or relative)").option("--today","Filter to items updated since local midnight today").option("--recent","Filter to items updated in the last 7 days").option("--updated-after <value>","Updated since ISO timestamp or signed relative (-2h/-7d for past); use last-window ISO").option("--updated-before <value>","Filter by updated_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-after <value>","Filter by created_at lower bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-before <value>","Filter by created_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--ids <value>","Filter by explicit item IDs (comma-separated or repeatable)").option("--assignee <value>","Filter by assignee",s).option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--parent <value>","Filter by parent item ID").option("--sprint <value>","Filter by sprint",s).option("--release <value>","Filter by release",s).option("--filter-ac-missing","Show only items missing acceptance_criteria").option("--filter-estimates-missing","Show only items missing estimated_minutes").option("--filter-resolution-missing","Show only terminal items missing resolution").option("--filter-metadata-missing","Show only items missing any tracked metadata (AC, estimate, or resolution)").option("--limit <n>","Alias for --output-limit; --output-budget may cap rows").option("--offset <n>","Skip the first n matching rows before limit is applied").option("--after <cursor>","Query next_cursor; output_cursor uses --output-cursor").option("--no-truncate","Disable default token cap; explicit --limit and --output-budget apply").option("--include-body","Include item body in each returned list row").option("--strict-read","Fail closed if any item document or item directory cannot be read").option("--compact","Render compact list projection fields (mutually exclusive with --brief/--full/--fields)").option("--brief","Brief rows: id, status, type, title and leading sort field (priority by default; excludes --compact/--full/--fields)").option("--full","Render full list projection fields (mutually exclusive with --compact/--brief/--fields)").option("--fields <value>",`Render custom comma-separated list fields (mutually exclusive with --compact/--brief/--full). ${g(n,"--fields")}`).option("--sort <value>","Sort field: priority|deadline|updated_at|created_at|title|parent (aliases: updated, created)").option("--order <value>","Sort order: asc|desc (requires --sort)").option("--tree","Render rows in parent/child tree order").option("--tree-depth <n>","Maximum recursion depth with --tree (0 keeps root rows only)").option("--format <value>","Output render mode: csv|table (human export) or json|ndjson|toon (machine output override)").option("--stream","Emit line-delimited JSON rows (requires --json)"),pe(f),f.action(async(w,x)=>{await xe({name:n,status:r,excludeTerminal:t,dependencyBlocked:d,options:w,actionCommand:x,aliasContract:m})}),l(f,"--tags <value>","Alias for --tag"),l(f,"--assignee_filter <value>","Alias for --assignee-filter"),l(f,"--tree_depth <n>","Alias for --tree-depth"),l(f,"--token_budget <n>","Alias for --token-budget"),l(f,"--filter-estimate-missing","Alias for --filter-estimates-missing")}async function _e(e,i){let n=y(i),o=Date.now(),r=await oe(M(e),n);h(r,n),n.profile&&p(`profile:command=aggregate took_ms=${Date.now()-o}`)}async function Ae(e,i){let n=y(i),o=Date.now(),r=H(A("context",e,n)),t=await Y(r,n),a=W(r,n);if(a==="markdown")n.quiet||v(`${X(t)}
|
|
4
4
|
`);else if(a==="ndjson"){k(t);let d=_([...t.high_level,...t.low_level,...t.blocked_fallback]);!n.quiet&&d.length>0&&v(`${d}
|
|
@@ -8,4 +8,4 @@ import{a as ce}from"./chunk-GBVF2ZB3.js";import"./chunk-SLFRSZK6.js";import{b as
|
|
|
8
8
|
`);return}for await(let r of le({...e,intervalMs:o}))n||v(`${O(r.events,{count:r.count,has_more:r.has_more,next_cursor:r.next_cursor??null,source:r.source,integrity:r.integrity,...r.verified_streams===void 0?{}:{verified_streams:r.verified_streams},heartbeat:r.count===0})}
|
|
9
9
|
`)}function Re(e){return e.cursor_mode==="row"?_(e.events):O(e.events,{count:e.count,has_more:e.has_more,next_cursor:e.next_cursor??null,source:e.source,integrity:e.integrity,...e.verified_streams===void 0?{}:{verified_streams:e.verified_streams},...e.provenance_summary===void 0?{}:{provenance_summary:e.provenance_summary}})}async function qe(e,i){let n=y(i),o=Date.now(),r=Ee(e,n.path);if(e.follow===!0){await De(r,e,n.quiet===!0);return}let t=await se(r);if(k(t),n.json){h(t,n),n.profile&&p(`profile:command=events took_ms=${Date.now()-o}`);return}let a=Re(t);!n.quiet&&a.length>0&&v(`${a}
|
|
10
10
|
`),n.profile&&p(`profile:command=events took_ms=${Date.now()-o}`)}async function Ge(e,i,n,o,r){let t=y(r),a=Date.now(),d=await V(e,i,n,{...Array.isArray(o.kind)?{kind:o.kind}:{},maxDepth:typeof o.maxDepth=="string"?o.maxDepth:void 0,limit:typeof o.limit=="string"?o.limit:void 0,after:typeof o.after=="string"?o.after:void 0,direction:typeof o.direction=="string"?o.direction:void 0,maxPaths:typeof o.maxPaths=="string"?o.maxPaths:void 0,sample:typeof o.sample=="string"?o.sample:void 0,...Array.isArray(o.exemptIsolate)?{exemptIsolate:o.exemptIsolate}:{},...Array.isArray(o.exemptIsolateType)?{exemptIsolateType:o.exemptIsolateType}:{},saveBaseline:o.saveBaseline===!0,rebuild:o.rebuild===!0,clear:o.clear===!0,summary:o.summary===!0,full:o.full===!0},t);h(d,t),t.profile&&p(`profile:command=graph took_ms=${Date.now()-a}`)}function Ot(e,i){let n=i?.commandFilter,o=t=>ye(t,n),r=[{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 t of r)if(o(t.name)){let a=C(t.name);Se(e,{...t,...a?.registration==="commander"?{aliasContract:a}:{}})}if(o("aggregate")){let t=e.command("aggregate").description("Group item counts and numeric measures.").option("--set-mode <value>","Set grouping: element (default)|tuple").option("--limit <value>","Group page size (default: 50)").option("--after <value>","Continue with next_after cursor").option("--group-by <value>","Fields: parent,type,priority,status,assignee,tags,sprint,release (comma-separated)").option("--count","Counts (default)").option("--completion","Status counts and completion_pct").option("--sum <field>","Group numeric sum").option("--avg <field>","Group numeric average").option("--include-unparented","Keep unparented group").option("--status <value>","Item status").option("--type <value>","Item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Latest deadline (ISO/date or relative)").option("--deadline-after <value>","Earliest deadline (ISO/date or relative)").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Assignee presence: assigned|unassigned").option("--parent <value>","Parent ID").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release");l(t,"--include_unparented","Alias for --include-unparented"),l(t,"--assignee_filter <value>","Alias for --assignee-filter"),t.action(_e)}if(o("context")){let t=e.command("context").alias("ctx").description("Show a token-efficient project context snapshot for next-work decisions.").option("--for <intent>",`Apply a declared context intent projection. ${g("context","--for")}`).option("--date <value>","Anchor date/time for agenda window calculations (ISO/date string or relative)").option("--from <value>","Agenda lower bound (ISO/date string or relative)").option("--to <value>","Agenda upper bound (ISO/date string or relative)").option("--past","Include past agenda entries in bounded windows").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <id>","Scope the snapshot to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit focus and agenda rows per section").option("--after <cursor>","Query next_cursor; output_cursor uses --output-cursor").option("--format <value>","Context output format override: markdown|toon|json|ndjson").option("--depth <value>","Context depth: brief|standard|deep|full (full = every section, no per-section cap)").option("--section <value...>","Include specific sections (repeatable; overrides --depth)").option("--fields <value>","Project focus rows to a comma-separated field subset (e.g. id,title,priority)").option("--activity-limit <n>","Limit recent activity entries (default: settings or 10)").option("--stale-threshold <value>","Staleness cutoff in days (e.g. 7 or 7d; default: settings or 7)").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked candidate ids").option("--token-budget <n>","Complete JSON/TOON response token ceiling").option("--no-extension-health","Omit the installed extension health summary").option("--no-tags","Omit tag arrays from context focus rows");l(t,"--assignee_filter <value>","Alias for --assignee-filter"),l(t,"--max-items <n>","Alias for --limit"),l(t,"--explain_ranking","Alias for --explain-ranking"),l(t,"--token_budget <n>","Alias for --token-budget"),t.action(Ae)}if(o("next")){let t=e.command("next").description("Recommend the next actionable (unblocked, ready) work item with rationale + blocked companion.").option("--for <intent>",`Apply a declared context intent projection. ${g("next","--for")}`).option("--type <value>","Filter candidate items by type").option("--tag <value>","Filter candidate items by tag").option("--priority <value>","Filter candidate items by priority").option("--assignee <value>","Filter candidate items by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter candidate items by sprint").option("--release <value>","Filter candidate items by release").option("--parent <id>","Scope to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit ready rows (default: 5; non-positive falls back to default)").option("--blocked-limit <n>","Limit blocked rows (default: same as --limit)").option("--ready-only","Omit the blocked companion list").option("--include-decisions","Include human-gated Decision items in the claimable ready queue").option("--include-gates","Include outcome gates in the ready queue").option("--include-containers","Include containers with unfinished descendants in the ready queue").option("--format <value>","Next output format override: markdown|toon|json").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked ready ids").option("--token-budget <n>","Maximum estimated tokens spent on the ranked ready queue");l(t,"--assignee_filter <value>","Alias for --assignee-filter"),l(t,"--blocked_limit <n>","Alias for --blocked-limit"),l(t,"--ready_only","Alias for --ready-only"),l(t,"--explain_ranking","Alias for --explain-ranking"),l(t,"--token_budget <n>","Alias for --token-budget"),t.action(Fe)}if(o("search")){let t=e.command("search").argument("<keywords...>","Keyword query tokens").description("Search items with keyword, semantic, or hybrid retrieval. Inline field:value tokens (tag:/status:/type:/priority:) in the query are parsed as filters, e.g. 'auth tag:area:search status:open'.").option("--for <intent>",`Apply a declared context intent projection. ${g("search","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--mode <value>","Search mode: keyword|semantic|hybrid (default: auto)").option("--semantic","Shorthand for --mode semantic").option("--hybrid","Shorthand for --mode hybrid").option("--match-mode <value>","Token match mode: and|or|exact (default: or with all-terms ranking bonus; and = hard-require every token; exact = exact phrase)").option("--min-score <value>","Per-query minimum score threshold (finite number >= 0); overrides settings search.score_threshold for this query only").option("--count","Return only the count of matching items (post-filter/threshold, pre-limit); skips hit rows").option("--semantic-weight <value>","Override hybrid semantic weight for this query (0..1); invalid values fall back to settings").option("--include-linked","Include linked files, docs, and tests in the searchable corpus").option("--title-exact","Require exact normalized title match for the full query string").option("--phrase-exact","Require exact normalized phrase match in searchable text").option("--highlight","Emit per-field matched-text snippets (wrapped in \xAB\u2026\xBB) on each hit; off by default").option("--status <value>","Filter by status before query (all, open/closed/canceled aliases, or configured status id; CSV)").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Filter by deadline upper bound (ISO/date string or relative)").option("--deadline-after <value>","Filter by deadline lower bound (ISO/date string or relative)").option("--updated-after <value>",'Filter by updated_at lower bound: ISO timestamp or signed relative (e.g. "-2h"/"-7d" for the past)').option("--updated-before <value>","Filter by updated_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-after <value>","Filter by created_at lower bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-before <value>","Filter by created_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--assignee <value>","Filter by assignee").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <value>","Filter by parent item ID").option("--compact","Render compact search hits (default; mutually exclusive with --full/--fields)").option("--full","Render full search hits with nested item payloads (mutually exclusive with --compact/--fields)").option("--fields <value>",`Render custom comma-separated search hit fields (mutually exclusive with --compact/--full). ${g("search","--fields")}`).option("--format <value>","Search output format override: json|ndjson|toon").option("--limit <n>","Limit returned item count").option("--after <cursor>","Query next_cursor; output_cursor uses --output-cursor");pe(t),t.action(Ie),l(t,"--tags <value>","Alias for --tag"),l(t,"--token_budget <n>","Alias for --token-budget")}if(o("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 (${re}); default: search/eval-queries.json; errors show an example`).option("--format <value>","Eval output format override: json|toon").action(Oe),o("get")){let t=e.command("get").argument("<id>","Item id").option("--for <intent>",`Apply a declared context intent projection. ${g("get","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--depth <value>","brief|standard|deep|full (default: standard)").option("--full","Full details and children for any type; excludes --depth/--fields").option("--fields <value>",`Render custom comma-separated item metadata fields. ${g("get","--fields")}`).option("--tree","Include descendants rooted at the requested item").option("--tree-depth <n>","Maximum subtree depth for --tree descendants").option("--at <version-or-timestamp>","Reconstruct a verified historical item state without mutating it").option("--format <value>","Get output format override: json|toon").description("Show item details by ID.").action(je);l(t,"--tree_depth <n>","Alias for --tree-depth"),l(t,"--token_budget <n>","Alias for --token-budget")}if(o("history")){let t=e.command("history").enablePositionalOptions().argument("<id>","Item id").option("--limit <n>","Latest N; keeps order").option("--order <value>","oldest_first|newest_first").option("--compact","Summary (default newest_first)").option("--full","Patches (default oldest_first)").option("--provenance","Authors (default newest_first)").option("--provenance-summary","Count provenance completeness").option("--harness <value>","Harness (repeatable)",s).option("--agent-instance <value>","Instance (repeatable)",s).option("--provenance-filter <dimension=value>","Provenance (repeatable)",s).option("--diff","Before/after field diffs").option("--field <name>","Filter changed field; implies --diff").option("--verify","Verify full chain and replay").option("--strict-exit","With --verify, fail on integrity errors").option("--fail-on-warn","Alias for --strict-exit").option("--format <value>","Output: json|toon").description("Read history.").action(Ce);ce(t,!0),j(t.command("activity"))}o("events")&&e.command("events").option("--since <cursor-or-timestamp>","Resume strictly after a durable cursor, or include events from an ISO timestamp").option("--type <value>","Filter by mutation operation (repeatable or comma-separated)",s).option("--author <value>","Filter by mutation author (repeatable or comma-separated)",s).option("--item <value>","Filter by item or workspace stream id (repeatable or comma-separated)",s).option("--limit <n>","Return at most 1,000 events (default: 100)").option("--cursor-mode <mode>","Cursors: batch trailer (default) or per-row").option("--full","Include each complete authoritative history entry").option("--verify","Verify selected authoritative history chains").option("--provenance","Include patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include bounded provenance completeness counts").option("--harness <value>","Filter by recorded or vocabulary-resolved harness (repeatable)",s).option("--agent-instance <value>","Filter by privacy-safe agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter by an exact declared provenance value (repeatable)",s).option("--follow","Follow committed events as NDJSON").option("--interval-ms <n>","Empty-read delay while following (minimum: 10ms; default: 250ms)").description("Read mutation events as NDJSON with resumable cursors.").action(qe),o("activity")&&j(e.command("activity",{hidden:!0})),o("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(Ge)}var jt={resolveReadCommandOutputFormat:S,parseListFormat:ue};export{jt as _testOnlyRegisterListQuery,Ot as registerListQueryCommands};
|
|
11
|
-
//# sourceMappingURL=register-list-query-
|
|
11
|
+
//# sourceMappingURL=register-list-query-EKSCZWEZ.js.map
|