@unbrained/pm-cli 2026.10.8 → 2026.10.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +17 -0
- package/dist/cli/register-list-query.js +2 -2
- package/dist/cli-bundle/bundle-manifest.json +151 -151
- package/dist/cli-bundle/chunks/{chunk-ZHIMZ65M.js → chunk-55MK3QQM.js} +30 -30
- package/dist/cli-bundle/chunks/{chunk-34L2BS2Z.js → chunk-5MOFELIF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZBVAZ7XX.js → chunk-5NR6TDYB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OG66KEOF.js → chunk-5TCQ5J3V.js} +74 -78
- package/dist/cli-bundle/chunks/{chunk-K6E2FFUT.js → chunk-CPZOW6L2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TNU56MZI.js → chunk-E4XR5LKU.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RCFZ6H2Y.js → chunk-KOGF6O6W.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-JDTBPW4Y.js → chunk-N7GKWO4G.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-L7U5FSZ5.js → chunk-NIF7JOPW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MJVRF67I.js → chunk-P5NS7EFC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HFCIAXLP.js → chunk-QQHNXCO3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FOLSEOJ2.js → chunk-XW3BLWFF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UGFN5NJ2.js → chunk-ZNXRGATT.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-PYVSPGPV.js → register-list-query-2YOWMNWY.js} +7 -7
- package/dist/cli-bundle/chunks/{register-mutation-WXP3YLIN.js → register-mutation-ILOWFMTV.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-WL25C3NP.js → register-operations-BMK65YM3.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-PFKYNEQI.js → register-setup-24TFFK6N.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-PEBOVLEG.js → chunk-2ATAD56F.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-6TKAFFEB.js → chunk-2CJWTLQG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-EOUORVJA.js → chunk-362645PL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-V3EPBB6V.js → chunk-AU6VJGTY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-L3CZNKZE.js → chunk-B3YW6H2I.js} +16 -20
- package/dist/cli-bundle/focused-chunks/{chunk-XT7JAVHI.js → chunk-DMSADMEU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-2KSPGWLH.js → chunk-DSLNUL2Q.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-A3W6HFFO.js → chunk-EZ4367G4.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MW2TQHZ3.js → chunk-IARAEFMA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-OSKXYRYZ.js → chunk-MCVWZUGK.js} +27 -27
- package/dist/cli-bundle/focused-chunks/{chunk-F2ME5MJY.js → chunk-PBCYGO7X.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-PBPPIGUL.js → chunk-PLTTMQAW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-OLCJ2PJS.js → chunk-SAN3KPX4.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-DRHJOG5X.js → chunk-W5AE7GKZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-LZQGEVKT.js → chunk-WAOXID5J.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BDT5EALU.js → chunk-WOEZJUA2.js} +2 -2
- package/dist/cli-bundle/main.js +2 -2
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +22 -22
- 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 +50 -50
- 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 +7 -7
- package/dist/core/history/event-index.d.ts +1 -2
- package/dist/core/history/event-index.js +2 -2
- package/dist/core/output/output.d.ts +16 -14
- package/dist/core/output/output.js +6 -10
- package/dist/core/store/item-metadata-query-index.d.ts +1 -2
- package/dist/core/store/item-metadata-query-index.js +1 -1
- package/dist/core/store/sqlite-runtime.d.ts +15 -0
- package/dist/core/store/sqlite-runtime.js +2 -0
- package/dist/sdk/output/table-rows.d.ts +37 -0
- package/dist/sdk/output/table-rows.js +2 -0
- package/dist/sdk/output.d.ts +1 -0
- package/dist/sdk/output.js +2 -2
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/read-output-contracts.d.ts +3 -3
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/test/workspace-snapshot.d.ts +1 -1
- package/dist/sdk/test/workspace-snapshot.js +1 -1
- package/docs/AGENT_OUTPUT_ENCODINGS.md +119 -0
- package/docs/PACKAGE_GATE_ACCEPTANCE.md +56 -0
- package/docs/README.md +2 -0
- package/docs/TESTING.md +11 -3
- package/marketplace.json +2 -2
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +2 -2
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +2 -2
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$c as w,Kf as $,R as p,T as h,Xc as I,Yc as C,Zc as L,_c as A,ad as v,dd as M,df as D,ef as F,eh as B,fh as k,g as P,h as m,if as V,il as y,j as S,k as N,wb as _}from"./chunk-OG66KEOF.js";import{Command as Q}from"commander";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="089f4ea0-a211-5e3e-87d3-c5693de8918d")}catch{}})();function Ue(e){return new Q().name("pm").description("Universal, flexible, extensible, agent-optimized project management CLI for any project or programming language.").version(e).showHelpAfterError(!1).allowExcessArguments(!1).allowUnknownOption(!1).configureOutput({writeOut:t=>{$(t)},writeErr:()=>{}}).option("--json","Output JSON instead of TOON; mutations emit a flat receipt with top-level id/status/changed_field_count while reads use documented entity or collection envelopes").option("--lean","Omit null and empty containers from JSON output").option("--token-accounting","Attach a bounded per-section token-cost receipt to command output").option("--output-include <fields>","Retain comma-separated fields or sections in read output").option("--output-limit <count>","Bound rows in read output").option("--output-budget <tokens|unbounded>","Bound estimated tokens in read output or explicitly disable the default ceiling").option("--output-format <toon|json>","Select the result encoding for reads and mutations").option("--output-session <state>","Carry a JSON session budget and served-item ledger across read calls").option("--output-cursor <cursor>","Resume a budget-compacted declared row collection").option("--output-row-contract","Include row selectors, encoding metadata, and read-output receipts").option("--quiet","Suppress stdout output").option("--no-changed-fields","Omit the changed_fields array from mutation output (keeps changed_field_count)").option("--full-changed-fields","Restore the legacy full mutation envelope and changed_fields array").option("--id-only","Print only id and status for single-item mutation output").option("--pm-path <dir>","Explicit tracker storage path for this command (preferred over --path)").option("--path <dir>","Backward-compatible alias for --pm-path; this is the tracker storage path, not a workspace cwd").option("--no-extensions","Disable extension loading").option("--no-pager","Disable pager integration for help and long output").option("--explain","Render extended rationale and examples in help output").option("--all","Reveal every public command and compatibility alias").option("--profile","Print deterministic timing diagnostics").option("--author <id>","Override mutation author for this invocation").exitOverride()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="be9abae1-85ae-5a68-96bc-c738218ace5e")}catch{}})();function Ke(e){return e instanceof h||e instanceof Error?e.message:"Unknown failure"}function ee(e){if(typeof e!="object"||e===null||!("exitCode"in e))return;let t=e.exitCode;return typeof t=="number"&&Number.isFinite(t)?t:void 0}function te(e){let t=Math.trunc(e);return t>p.SUCCESS?t:p.GENERIC_FAILURE}function Ye(e){return typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="string"&&e.code.startsWith("commander.")}function Xe(e,t){if(e instanceof Error)return e;let o=new Error(t),n=ee(e);return n!==void 0&&(o.exitCode=te(n)),o}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8efedca0-725e-520f-ad06-825a0cccddaa")}catch{}})();var R=new Set(["append","claim","close","close-task","comments","copy","delete","deps","docs","files","focus","get","history","history-compact","history-redact","history-repair","learnings","notes","pause-task","release","restore","start-task","test","update"]),z=new Map([["files","discover"],["item","complete"]]),ne=new Map([["append",1],["close",1],["close-task",1],["comments",1],["item complete",1],["learnings",1],["notes",1],["restore",1]]);function G(e){let t=m(e?.trim().toLowerCase()??"");return R.has(t)||z.has(t)}function oe(e,t,o){let n=R.has(o)?t+1:void 0,i=w(e.slice(t+1));if(i===void 0)return n;let s=t+1+i,a=`${o} ${e[s]}`,r=m(a);return r===a?o==="item"&&e[s]==="complete"?s+1:n:G(r)?O(e,s,r):void 0}function O(e,t,o){if(["history","context","ctx","update","close","item"].includes(o))return oe(e,t,o);let n=z.get(o);if(n===void 0)return t+1;let i=e[t+1]?.toLowerCase()===n;return t+(i?2:1)}function ie(e){let t=new Map;for(let o of y(e))for(let n of[o.flag,o.short,...o.aliases??[]])n&&t.set(n,o);return t}function se(e){let t=[];for(let o=0;o<e.length;o+=1){let n=e[o];if(n==="--")break;n==="--id"?(t.push({index:o,consumed:2,value:e[o+1]}),o+=1):n.startsWith("--id=")&&t.push({index:o,consumed:1,value:n.slice(5)})}return t}function re(e,t,o){if(e.indexOf("=")>=0||t===void 0||t.startsWith("-"))return!1;let n=o.get(e);return n!==void 0&&n.value_type!=="boolean"}function ae(e,t,o,n,i){let s=0;for(let a=t;a<e.length;a+=1){let r=e[a];if(r==="--")break;if(r==="--id"){a+=1;continue}if(!r.startsWith("--id=")){if(!r.startsWith("-")){if(a<n)return!0;s+=1;continue}re(r,e[a+1],i)&&(a+=1)}}return s>(ne.get(m(o))??0)}function U(e){let t=w(e),o=t===void 0?void 0:e[t]?.toLowerCase();if(o!=="context"&&o!=="ctx"&&!G(o))return{argv:[...e],changed:!1,conflict:!1};let n=O(e,t,o);if(n===void 0)return{argv:[...e],changed:!1,conflict:!1};let i=n>t+1?`${m(e.slice(t,n-1).join(" "))} ${e[n-1]}`:o,s=ie(i),a=se(e),r=a[0];if(!r||!r.value?.trim())return{argv:[...e],changed:!1,conflict:!1};if(a.length>1||ae(e,n,i,r.index,s))return{argv:[...e],changed:!1,conflict:!0,itemId:r.value};let l=[...e.slice(0,r.index),...e.slice(r.index+r.consumed)],c=w(l),u=O(l,c,o);return l.splice(u,0,r.value),{argv:l,changed:!0,conflict:!1,itemId:r.value}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f05cec18-5e48-5151-8ada-577c9df5885d")}catch{}})();var le=new Set(["--output-include","--output-limit","--output-budget","--output-format","--output-session","--output-cursor"]),ce=new Set(["toon","json"]);function ue(e,t,o){let n=e[t];if(C.has(n))return o.booleanFlags.add(n),1;let i=n.indexOf("="),s=i>0?n.slice(0,i):n;if(!I.has(s))return 1;let a=i>0?n.slice(i+1):void 0,r=a===void 0&&A(s,e[t+1]),l=a??(r?e[t+1]:void 0);return s==="--author"?o.author=l??"":typeof l=="string"&&l.length>0&&(le.has(s)?o.outputValues:o.pathValues).set(s,l),r?2:1}function de(e){let t={booleanFlags:new Set,outputValues:new Map,pathValues:new Map},o=0;for(;o<e.length&&e[o]!=="--";)o+=ue(e,o,t);return{path:t.pathValues.get("--pm-path")??t.pathValues.get("--path"),noExtensions:t.booleanFlags.has("--no-extensions")||["history attest","history-attest"].includes(X(e)??""),noPager:t.booleanFlags.has("--no-pager"),json:t.booleanFlags.has("--json")?t.outputValues.get("--output-format")!=="toon":t.outputValues.get("--output-format")==="json",quiet:t.booleanFlags.has("--quiet"),lean:t.booleanFlags.has("--lean"),tokenAccounting:t.booleanFlags.has("--token-accounting"),...t.booleanFlags.has("--output-row-contract")?{outputRowContract:!0}:{},...t.outputValues.get("--output-include")===void 0?{}:{outputInclude:t.outputValues.get("--output-include")},...t.outputValues.get("--output-limit")===void 0?{}:{outputLimit:t.outputValues.get("--output-limit")},...t.outputValues.get("--output-budget")===void 0?{}:{outputBudget:t.outputValues.get("--output-budget")},...ce.has(t.outputValues.get("--output-format"))?{outputFormat:t.outputValues.get("--output-format")}:{},...t.outputValues.get("--output-session")===void 0?{}:{outputSession:t.outputValues.get("--output-session")},...t.outputValues.get("--output-cursor")===void 0?{}:{outputCursor:t.outputValues.get("--output-cursor")},...t.author===""?{authorMissingValue:!0}:t.author!==void 0?{author:t.author}:{}}}function q(e){let t=[],o=0;for(;o<e.length;){let n=e[o];if(n==="--")break;if(C.has(n)||n==="--profile"||n==="--id-only"||n==="--full-changed-fields"||n==="--explain"){o+=1;continue}if(I.has(n)){o+=A(n,e[o+1])?2:1;continue}if(L(n)){o+=1;continue}t.push(n),o+=1}return t}function fe(e){let t=q(e);if(t[0]?.trim().toLowerCase()==="help"){let n=[];for(let i=1;i<t.length;i+=1){let s=t[i];if(s.startsWith("-"))break;n.push(s.trim().toLowerCase())}return{requested:!0,commandPathTokens:n}}if(t.findIndex(n=>n==="--help"||n==="-h")<0)return{requested:!1,commandPathTokens:[]};let o=[];for(let n of t){if(n.startsWith("-"))break;o.push(n.trim().toLowerCase())}return{requested:!0,commandPathTokens:o}}function T(e){return w(e)}function pe(e){return v(e)}function me(e,t){return t.noPager?!0:process.stdout.isTTY===!0?!1:fe(e).requested}function dt(e){let t=["PAGER","MANPAGER","GIT_PAGER","LESS"],o=t.map(s=>process.env[s]),n=()=>{for(let[s,a]of t.entries()){let r=o[s];r===void 0?delete process.env[a]:process.env[a]=r}},i=de(e);return me(e,i)&&(process.env.PAGER="cat",process.env.MANPAGER="cat",process.env.GIT_PAGER="cat",(typeof process.env.LESS!="string"||process.env.LESS.trim().length===0)&&(process.env.LESS="FRX")),n}var he=new Set(["install","uninstall","explore","manage","doctor","adopt","adopt-all","activate","deactivate"]);function ge(e){let t=T(e);if(t===void 0||e[t]!=="extension")return[...e];let o=e[t+1];if(!o||o.startsWith("-"))return[...e];if(!he.has(o))return[...e];if(e.includes("--help")||e.includes("-h"))return[...e];let n=`--${o}`;return e.includes(n)?[...e]:[...e.slice(0,t+1),n,...e.slice(t+2)]}var be=new Set(["pm","pm-cli"]);function ye(e,t){let o=T(e);if(o===void 0)return e;let n=e[o];return be.has(n.trim().toLowerCase())?(t.push({from:n,to:[],reason:"executable_alias",confidence:"high"}),[...e.slice(0,o),...e.slice(o+1)]):e}function we(e,t){let o=T(e);if(o!==void 0&&e[o]==="help"){let r=T(e.slice(o+1));o=r===void 0?void 0:o+1+r}if(o===void 0)return e;let n=e[o],i=N[n.trim().toLowerCase()];if(!i)return e;let s=i.split(" "),a=[...e.slice(0,o),...s,...e.slice(o+1)];return t.push({from:n,to:s,reason:"command_alias",confidence:"high"}),a}function E(e){return e.replace(/^--?/,"").replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function W(e){return E(e).replace(/-/g,"")}function j(e,t,o){let n=e.get(t);if(n===void 0){e.set(t,o);return}n!==o&&e.set(t,null)}function Ie(e){let t=[],o=n=>{typeof n=="string"&&n.startsWith("--")&&t.push(n)};o(e.flag);for(let n of e.aliases??[])o(n);return t}function _e(e,t){let o=t??y(e),n=new Map,i=new Map,s=new Map,a=new Set;for(let r of o){let l=Ie(r);if(l.length===0)continue;let c=`--${E(l[0])}`;for(let f of l)j(n,E(f),c),j(i,W(f),c);let u=W(c);s.has(c)||s.set(c,u),r.list===!0&&a.add(c)}return{canonicalByNormalized:n,canonicalByCompact:i,canonicalComparables:[...s.entries()].map(([r,l])=>({canonicalFlag:r,comparable:l})),listCanonicalFlags:a}}function K(e,t){let o=E(e),n=t.canonicalByNormalized.get(o);if(typeof n=="string")return{flag:n,reason:"flag_alias",confidence:"high"};let i=o.replace(/-/g,""),s=t.canonicalByCompact.get(i);if(typeof s=="string")return{flag:s,reason:"flag_alias",confidence:"high"};let a=i.length>=8?2:1,r=Number.POSITIVE_INFINITY,l,c=!1;for(let u of t.canonicalComparables){let f=_(i,u.comparable,a);if(f!==null){if(f<r){r=f,l=u.canonicalFlag,c=!1;continue}f===r&&l!==u.canonicalFlag&&(c=!0)}}return!l||c||!Number.isFinite(r)||r<=0?null:{flag:l,reason:"flag_typo",confidence:r>=2?"medium":"high"}}function ft(e){let t=[`${e}s`];return e.endsWith("y")&&e.length>1&&t.push(`${e.slice(0,-1)}ies`),t}function Ce(e,t=!1){if(t||e.includes("://"))return null;let o=e.match(/^([A-Za-z][A-Za-z0-9_-]{1,63})([:=])(.*)$/);if(!o)return null;let n=o[1],i=o[3];return i.length===0?null:{key:n,value:i}}function ve(e,t,o=!1){if(o||!e.startsWith("--"))return{tokens:[e]};let n=e.indexOf("="),i=n>=0?e.slice(0,n):e,s=n>=0?e.slice(n+1):void 0,a=K(i,t);if(!a)return{tokens:[e]};let r=s===void 0?a.flag:`${a.flag}=${s}`;return r===e?{tokens:[e]}:{tokens:[r],event:{from:e,to:[r],reason:a.reason,confidence:a.confidence}}}function ke(e){let t=new Set,o=!1;for(let n=0;n<e.length;n+=1){if(o){t.add(n),o=!1;continue}let i=e[n];o=i==="--path"||i==="--pm-path"}return t}function Te(e){if(!e.startsWith("--"))return null;let t=e.indexOf("=");return t<0?{flag:e}:{flag:e.slice(0,t),inlineValue:e.slice(t+1)}}function Ee(e,t,o){o.push(e[t]);let n=e[t+1];return typeof n=="string"&&n!=="--"?(o.push(n),t+2):t+1}function xe(e,t,o,n){if(o.inlineValue!==void 0)return{originalTokens:[e[t]],value:o.inlineValue,consumed:1};let i=[],s=t+1;for(;s<e.length&&e[s]!=="--"&&!e[s].startsWith("-")&&(i.length===0||n.has(o.flag));)i.push(e[s]),s+=1;let a=i.length===0?1:1+i.length;return{originalTokens:e.slice(t,t+a),value:i.length===0?void 0:i.join(","),consumed:a}}function Se(e,t,o,n){let i=e.get(o);if(i){i.values.push(n.value),i.occurrences+=1;return}e.set(o,{outputIndex:t.length,originalTokens:n.originalTokens,values:[n.value],occurrences:1}),t.push(null)}function Ae(e,t){let o=[],n=[];for(let[i,s]of e){if(!(s.occurrences>=2||t.has(i)&&s.originalTokens.length>2)){n.push({outputIndex:s.outputIndex,tokens:s.originalTokens});continue}let a=`${i}=${s.values.join(",")}`;n.push({outputIndex:s.outputIndex,tokens:[a]}),o.push({from:`${i} (x${s.occurrences})`,to:[a],reason:"list_merge",confidence:"high"})}return{events:o,splices:n}}function Oe(e,t){t.sort((o,n)=>n.outputIndex-o.outputIndex);for(let o of t)e.splice(o.outputIndex,1,...o.tokens)}function Pe(e,t,o=new Set,n=new Set){if(t.size===0)return{argv:[...e],events:[]};let i=[],s=new Map,a=0;for(;a<e.length;){let c=e[a];if(c==="--"){i.push(...e.slice(a));break}if(o.has(c)){a=Ee(e,a,i);continue}let u=Te(c);if(!u||!t.has(u.flag)){i.push(c),a+=1;continue}let f=xe(e,a,u,n);if(f.value===void 0){i.push(c),a+=f.consumed;continue}Se(s,i,u.flag,{originalTokens:f.originalTokens,value:f.value}),a+=f.consumed}let{events:r,splices:l}=Ae(s,n);return Oe(i,l),{argv:i,events:r}}var Y=new Map([["--add",new Set(["command","cmd","path"])],["--remove",new Set(["command","path"])]]);function Ne(e,t){if(e!=="test"||t.length<2)return!1;let o=t[t.length-1],n=t[t.length-2],i=Y.get(n);return i!==void 0&&i.has(o)}function Le(e,t,o){if(t!=="test")return e;let n=[],i=0;for(;i<e.length;){let s=e[i];if(s==="--")return n.push(...e.slice(i)),n;let a=Y.get(s),r=a?e[i+1]:void 0;if(!a||typeof r!="string"||!a.has(r)){n.push(s),i+=1;continue}let l=i+2;for(;l<e.length&&!e[l].startsWith("-");)l+=1;if(l-(i+2)!==1){n.push(s),i+=1;continue}let c=e[i+2],u=`${r}=${c}`;n.push(s,u),o.push({from:`${s} ${r} ${c}`,to:[s,u],reason:"bare_key_value",confidence:"high"}),i+=3}return n}function Me(e,t,o,n){let i=[],s=ke(e);for(let a=0;a<e.length;a+=1){let r=e[a];if(r==="--"){i.push(...e.slice(a));break}let l=s.has(a),c=i[i.length-1];if(r.startsWith("--")){let b=ve(r,t,l);i.push(...b.tokens),b.event&&n.push(b.event);continue}let u=Ce(r,l);if(!u||typeof c=="string"&&c.startsWith("-")&&!c.includes("=")||["search","comments","notes","learnings"].includes(o)||Ne(o,i)){i.push(r);continue}let f=K(u.key,t);if(!f){i.push(r);continue}let g=u.value.startsWith("-")?[`${f.flag}=${u.value}`]:[f.flag,u.value];i.push(...g),n.push({from:r,to:g,reason:"bare_key_value",confidence:f.confidence})}return i}function De(e){for(let t=0;t<e.length;t+=1){let o=e[t];if(o==="--")break;if(o==="--verify"){let n=e[t+1];if(n===void 0||n==="--")throw new h("history attest --verify requires a bundle file.",p.USAGE);e.splice(t,2,`--verify=${n}`)}else(I.has(o)||o==="--output"||o==="--hash-algorithm")&&(t+=1)}}function Fe(e,t){if(!e.some(n=>n==="--help"||n==="-h"))return;let o=new Set(y(t).flatMap(n=>[n.flag,...n.aliases??[],...n.short===void 0?[]:[n.short]]));for(let n=0;n<e.length;n+=1){let i=e[n];if(i==="--")break;i!=="--help"&&i!=="-h"||o.has(e[n-1])&&!C.has(e[n-1])&&(e[n-1]=i)}}function pt(e){let t=[],o=ye(e,t),n=ge(o);(n.length!==o.length||n.some((b,J)=>b!==o[J]))&&t.push({from:o.join(" "),to:[...n],reason:"legacy_extension_action",confidence:"high"});let i=we(n,t),s=U(i);if(s.conflict)throw new h("Provide the item id either positionally or with --id, not both.",p.USAGE);s.changed&&t.push({from:`--id ${s.itemId}`,to:[s.itemId],reason:"item_id_alias",confidence:"high"});let a=pe(s.argv),r=X(s.argv),l=m(r??a??""),c=_e(r??a),u=Me(s.argv,c,l,t),f=Le(u,l,t),g=Pe(f,c.listCanonicalFlags,I,a==="create"?new Set(["--tags"]):new Set);for(let b of g.events)t.push(b);return Fe(g.argv,r??a),r==="history attest"&&De(g.argv),{argv:g.argv,commandName:a,trace:t}}function X(e){let t=q(e),o=t[0]?.trim().toLowerCase(),n=t[1]?.trim().toLowerCase(),i=P(t);return i?i.canonical:(o==="extension"||o==="package"||o==="packages")&&typeof n=="string"&&n.length>0&&!n.startsWith("-")?`${o} ${n}`:o}function mt(e){for(let t=0;t<e.length;t+=1){let o=e[t];if(o==="--")break;if(o==="--type"){let n=e[t+1];if(typeof n=="string"&&n.trim().length>0)return n.trim();continue}if(o.startsWith("--type=")){let n=o.slice(7).trim();if(n.length>0)return n}}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fb625cd9-f8a8-56cf-88ab-abef64051497")}catch{}})();function wt(e){if(e===void 0)return()=>{};let t=e.trim();if(t.length===0)throw new h("--author requires a non-empty value.",p.USAGE,{code:"missing_required_argument",nextSteps:["Pass an explicit author identifier with --author <id>."]});let o=B();k(t);let n=!1;return()=>{n||(n=!0,o===void 0?k(void 0):k(o))}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d0e60f7e-e0a8-5ef4-9af7-4a1f102ccb7d")}catch{}})();var d=Object.freeze({clock:"PM_CLOCK",tickMs:"PM_CLOCK_TICK_MS",seed:"PM_SEED"});function x(e,t,o,n){return new h(e,p.USAGE,{code:"invalid_reproducible_process_environment",reason:t,field:o,required:`${d.clock} and ${d.seed}; ${d.tickMs} is optional`,nextSteps:[`Set ${d.clock} to an ISO-8601 instant with Z or a numeric UTC offset and ${d.seed} to a non-empty reproducibility seed.`,`Optionally set ${d.tickMs} to a non-negative integer; it defaults to 1.`,"Unset all three variables to retain normal wall-clock and cryptographic-random behavior."],recovery:{recovery_mode:"compact",provided_fields:n,missing_required_fields:t==="incomplete"?[d.clock,d.seed].filter(i=>!n.includes(i)):void 0}})}function Ve(e){let t=e[d.clock],o=e[d.tickMs],n=e[d.seed],i=[[d.clock,t],[d.tickMs,o],[d.seed,n]].filter(a=>a[1]!==void 0).map(([a])=>a);if(i.length===0)return;if(t===void 0||n===void 0)throw x("Reproducible process execution requires PM_CLOCK and PM_SEED together.","incomplete",t===void 0?d.clock:d.seed,i);if(n.trim().length===0)throw x(`${d.seed} must not be empty.`,"invalid_value",d.seed,i);if(!V(t))throw x(`${d.clock} must be a valid ISO-8601 instant with Z or a numeric UTC offset.`,"invalid_value",d.clock,i);let s=o===void 0?1:Number(o);if(o?.trim().length===0||!Number.isSafeInteger(s)||s<0)throw x(`${d.tickMs} must be a non-negative integer.`,"invalid_value",d.tickMs,i);return D({clock:t,seed:n,tickMs:s})}function $e(e){let t=Ve(e);return t===void 0?o=>o():F(t)}async function Tt(e,t){return $e(e)(t)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d5c48881-420f-5673-8696-e770db353cfc")}catch{}})();function Z(e){return e.trim().match(/--[a-z0-9][a-z0-9_-]*/i)?.[0]?.replaceAll("_","-").toLowerCase()}function Ot(e){if(!(!Array.isArray(e)||e.length===0))return v(e)}function Be(e,t){let o=Z(t);if(!o)return;let n=y(e).find(i=>i.flag===o||i.aliases?.includes(o));return n?n.value_type==="boolean"?null:`<${n.value_name??"value"}>`:"<value>"}function Pt(e,t,o){let n=[...e],i=n.indexOf("--"),s=i<0?n.length:i;for(let a of o){let r=Z(a);if(!r||n.slice(0,s).some(u=>u===r||u.startsWith(`${r}=`)))continue;let l=Be(t,r),c=l?[r,l]:[r];n.splice(s,0,...c),s+=c.length}return n.length===e.length?void 0:M(n)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bd9a8d3b-bc6f-5309-a3fb-7e5f41ef9dab")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a48c9a1f-b959-54a4-a27f-4f662ae7fd31")}catch{}})();var Re={add:["create","append"],fetch:["get"],inspect:["get","health"],log:["history","comments","notes"],ls:["list"],pause:["release"],read:["get"],remove:["delete"],rm:["delete"],show:["get"],start:["start-task"]};function H(e,t){let o=e.trim().toLowerCase(),n=t.trim().toLowerCase();if(n.length===0)return Number.POSITIVE_INFINITY;let i=o.split(" "),s=Re[n]?.indexOf(m(o));if(s!==void 0&&s>=0)return s;if(o===n)return 10;if(i.includes(n))return 11;if(i.some(l=>l.startsWith(n)))return 12;let a=n.length>=5?2:1,r=Number.POSITIVE_INFINITY;for(let l of i){let c=_(l,n,a);c!==null&&(r=Math.min(r,c))}return Number.isFinite(r)?20+r:o.includes(n)?30:Number.POSITIVE_INFINITY}function $t(e,t){return e.map(o=>({path:o,score:H(o,t)})).filter(o=>Number.isFinite(o.score)).sort((o,n)=>o.score!==n.score?o.score-n.score:o.path===n.path?0:o.path<n.path?-1:1).map(o=>o.path)}function Bt(e,t,o){let n=new Set(t),i=S.filter(r=>r.lifecycle==="deprecated").slice().sort((r,l)=>l.alias.length-r.alias.length),s=[],a=e.flatMap(r=>{let l=i.find(u=>r===u.alias||r.startsWith(`${u.alias} `)),c=r;if(l){let u=r.slice(l.alias.length);if(!n.has(`${l.canonical}${u}`))return[];c=`${l.canonical_argv.join(" ")}${u}`}return o!==void 0&&H(r,o)<10&&s.push(c),[c]});return[...new Set(s.length>0?s:a)]}export{Ue as a,Ke as b,ee as c,te as d,Ye as e,Xe as f,G as g,U as h,de as i,q as j,fe as k,T as l,pe as m,dt as n,ge as o,ft as p,Pe as q,Le as r,pt as s,mt as t,wt as u,d as v,Ve as w,$e as x,Tt as y,Ot as z,Be as A,Pt as B,H as C,$t as D,Bt as E};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{$c as w,Mf as $,R as p,T as h,Xc as I,Yc as C,Zc as L,_c as A,ad as v,dd as M,df as D,ef as F,g as P,gh as B,h as m,hh as k,if as V,j as S,k as N,kl as y,wb as _}from"./chunk-5TCQ5J3V.js";import{Command as Q}from"commander";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="089f4ea0-a211-5e3e-87d3-c5693de8918d")}catch{}})();function Ue(e){return new Q().name("pm").description("Universal, flexible, extensible, agent-optimized project management CLI for any project or programming language.").version(e).showHelpAfterError(!1).allowExcessArguments(!1).allowUnknownOption(!1).configureOutput({writeOut:t=>{$(t)},writeErr:()=>{}}).option("--json","Output JSON instead of TOON; mutations emit a flat receipt with top-level id/status/changed_field_count while reads use documented entity or collection envelopes").option("--lean","Omit null and empty containers from JSON output").option("--token-accounting","Attach a bounded per-section token-cost receipt to command output").option("--output-include <fields>","Retain comma-separated fields or sections in read output").option("--output-limit <count>","Bound rows in read output").option("--output-budget <tokens|unbounded>","Bound estimated tokens in read output or explicitly disable the default ceiling").option("--output-format <toon|json>","Select the result encoding for reads and mutations").option("--output-session <state>","Carry a JSON session budget and served-item ledger across read calls").option("--output-cursor <cursor>","Resume a budget-compacted declared row collection").option("--output-row-contract","Include row selectors, encoding metadata, and read-output receipts").option("--quiet","Suppress stdout output").option("--no-changed-fields","Omit the changed_fields array from mutation output (keeps changed_field_count)").option("--full-changed-fields","Restore the legacy full mutation envelope and changed_fields array").option("--id-only","Print only id and status for single-item mutation output").option("--pm-path <dir>","Explicit tracker storage path for this command (preferred over --path)").option("--path <dir>","Backward-compatible alias for --pm-path; this is the tracker storage path, not a workspace cwd").option("--no-extensions","Disable extension loading").option("--no-pager","Disable pager integration for help and long output").option("--explain","Render extended rationale and examples in help output").option("--all","Reveal every public command and compatibility alias").option("--profile","Print deterministic timing diagnostics").option("--author <id>","Override mutation author for this invocation").exitOverride()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="be9abae1-85ae-5a68-96bc-c738218ace5e")}catch{}})();function Ke(e){return e instanceof h||e instanceof Error?e.message:"Unknown failure"}function ee(e){if(typeof e!="object"||e===null||!("exitCode"in e))return;let t=e.exitCode;return typeof t=="number"&&Number.isFinite(t)?t:void 0}function te(e){let t=Math.trunc(e);return t>p.SUCCESS?t:p.GENERIC_FAILURE}function Ye(e){return typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="string"&&e.code.startsWith("commander.")}function Xe(e,t){if(e instanceof Error)return e;let o=new Error(t),n=ee(e);return n!==void 0&&(o.exitCode=te(n)),o}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8efedca0-725e-520f-ad06-825a0cccddaa")}catch{}})();var R=new Set(["append","claim","close","close-task","comments","copy","delete","deps","docs","files","focus","get","history","history-compact","history-redact","history-repair","learnings","notes","pause-task","release","restore","start-task","test","update"]),z=new Map([["files","discover"],["item","complete"]]),ne=new Map([["append",1],["close",1],["close-task",1],["comments",1],["item complete",1],["learnings",1],["notes",1],["restore",1]]);function G(e){let t=m(e?.trim().toLowerCase()??"");return R.has(t)||z.has(t)}function oe(e,t,o){let n=R.has(o)?t+1:void 0,i=w(e.slice(t+1));if(i===void 0)return n;let s=t+1+i,a=`${o} ${e[s]}`,r=m(a);return r===a?o==="item"&&e[s]==="complete"?s+1:n:G(r)?O(e,s,r):void 0}function O(e,t,o){if(["history","context","ctx","update","close","item"].includes(o))return oe(e,t,o);let n=z.get(o);if(n===void 0)return t+1;let i=e[t+1]?.toLowerCase()===n;return t+(i?2:1)}function ie(e){let t=new Map;for(let o of y(e))for(let n of[o.flag,o.short,...o.aliases??[]])n&&t.set(n,o);return t}function se(e){let t=[];for(let o=0;o<e.length;o+=1){let n=e[o];if(n==="--")break;n==="--id"?(t.push({index:o,consumed:2,value:e[o+1]}),o+=1):n.startsWith("--id=")&&t.push({index:o,consumed:1,value:n.slice(5)})}return t}function re(e,t,o){if(e.indexOf("=")>=0||t===void 0||t.startsWith("-"))return!1;let n=o.get(e);return n!==void 0&&n.value_type!=="boolean"}function ae(e,t,o,n,i){let s=0;for(let a=t;a<e.length;a+=1){let r=e[a];if(r==="--")break;if(r==="--id"){a+=1;continue}if(!r.startsWith("--id=")){if(!r.startsWith("-")){if(a<n)return!0;s+=1;continue}re(r,e[a+1],i)&&(a+=1)}}return s>(ne.get(m(o))??0)}function U(e){let t=w(e),o=t===void 0?void 0:e[t]?.toLowerCase();if(o!=="context"&&o!=="ctx"&&!G(o))return{argv:[...e],changed:!1,conflict:!1};let n=O(e,t,o);if(n===void 0)return{argv:[...e],changed:!1,conflict:!1};let i=n>t+1?`${m(e.slice(t,n-1).join(" "))} ${e[n-1]}`:o,s=ie(i),a=se(e),r=a[0];if(!r||!r.value?.trim())return{argv:[...e],changed:!1,conflict:!1};if(a.length>1||ae(e,n,i,r.index,s))return{argv:[...e],changed:!1,conflict:!0,itemId:r.value};let l=[...e.slice(0,r.index),...e.slice(r.index+r.consumed)],c=w(l),u=O(l,c,o);return l.splice(u,0,r.value),{argv:l,changed:!0,conflict:!1,itemId:r.value}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f05cec18-5e48-5151-8ada-577c9df5885d")}catch{}})();var le=new Set(["--output-include","--output-limit","--output-budget","--output-format","--output-session","--output-cursor"]),ce=new Set(["toon","json"]);function ue(e,t,o){let n=e[t];if(C.has(n))return o.booleanFlags.add(n),1;let i=n.indexOf("="),s=i>0?n.slice(0,i):n;if(!I.has(s))return 1;let a=i>0?n.slice(i+1):void 0,r=a===void 0&&A(s,e[t+1]),l=a??(r?e[t+1]:void 0);return s==="--author"?o.author=l??"":typeof l=="string"&&l.length>0&&(le.has(s)?o.outputValues:o.pathValues).set(s,l),r?2:1}function de(e){let t={booleanFlags:new Set,outputValues:new Map,pathValues:new Map},o=0;for(;o<e.length&&e[o]!=="--";)o+=ue(e,o,t);return{path:t.pathValues.get("--pm-path")??t.pathValues.get("--path"),noExtensions:t.booleanFlags.has("--no-extensions")||["history attest","history-attest"].includes(X(e)??""),noPager:t.booleanFlags.has("--no-pager"),json:t.booleanFlags.has("--json")?t.outputValues.get("--output-format")!=="toon":t.outputValues.get("--output-format")==="json",quiet:t.booleanFlags.has("--quiet"),lean:t.booleanFlags.has("--lean"),tokenAccounting:t.booleanFlags.has("--token-accounting"),...t.booleanFlags.has("--output-row-contract")?{outputRowContract:!0}:{},...t.outputValues.get("--output-include")===void 0?{}:{outputInclude:t.outputValues.get("--output-include")},...t.outputValues.get("--output-limit")===void 0?{}:{outputLimit:t.outputValues.get("--output-limit")},...t.outputValues.get("--output-budget")===void 0?{}:{outputBudget:t.outputValues.get("--output-budget")},...ce.has(t.outputValues.get("--output-format"))?{outputFormat:t.outputValues.get("--output-format")}:{},...t.outputValues.get("--output-session")===void 0?{}:{outputSession:t.outputValues.get("--output-session")},...t.outputValues.get("--output-cursor")===void 0?{}:{outputCursor:t.outputValues.get("--output-cursor")},...t.author===""?{authorMissingValue:!0}:t.author!==void 0?{author:t.author}:{}}}function q(e){let t=[],o=0;for(;o<e.length;){let n=e[o];if(n==="--")break;if(C.has(n)||n==="--profile"||n==="--id-only"||n==="--full-changed-fields"||n==="--explain"){o+=1;continue}if(I.has(n)){o+=A(n,e[o+1])?2:1;continue}if(L(n)){o+=1;continue}t.push(n),o+=1}return t}function fe(e){let t=q(e);if(t[0]?.trim().toLowerCase()==="help"){let n=[];for(let i=1;i<t.length;i+=1){let s=t[i];if(s.startsWith("-"))break;n.push(s.trim().toLowerCase())}return{requested:!0,commandPathTokens:n}}if(t.findIndex(n=>n==="--help"||n==="-h")<0)return{requested:!1,commandPathTokens:[]};let o=[];for(let n of t){if(n.startsWith("-"))break;o.push(n.trim().toLowerCase())}return{requested:!0,commandPathTokens:o}}function T(e){return w(e)}function pe(e){return v(e)}function me(e,t){return t.noPager?!0:process.stdout.isTTY===!0?!1:fe(e).requested}function dt(e){let t=["PAGER","MANPAGER","GIT_PAGER","LESS"],o=t.map(s=>process.env[s]),n=()=>{for(let[s,a]of t.entries()){let r=o[s];r===void 0?delete process.env[a]:process.env[a]=r}},i=de(e);return me(e,i)&&(process.env.PAGER="cat",process.env.MANPAGER="cat",process.env.GIT_PAGER="cat",(typeof process.env.LESS!="string"||process.env.LESS.trim().length===0)&&(process.env.LESS="FRX")),n}var he=new Set(["install","uninstall","explore","manage","doctor","adopt","adopt-all","activate","deactivate"]);function ge(e){let t=T(e);if(t===void 0||e[t]!=="extension")return[...e];let o=e[t+1];if(!o||o.startsWith("-"))return[...e];if(!he.has(o))return[...e];if(e.includes("--help")||e.includes("-h"))return[...e];let n=`--${o}`;return e.includes(n)?[...e]:[...e.slice(0,t+1),n,...e.slice(t+2)]}var be=new Set(["pm","pm-cli"]);function ye(e,t){let o=T(e);if(o===void 0)return e;let n=e[o];return be.has(n.trim().toLowerCase())?(t.push({from:n,to:[],reason:"executable_alias",confidence:"high"}),[...e.slice(0,o),...e.slice(o+1)]):e}function we(e,t){let o=T(e);if(o!==void 0&&e[o]==="help"){let r=T(e.slice(o+1));o=r===void 0?void 0:o+1+r}if(o===void 0)return e;let n=e[o],i=N[n.trim().toLowerCase()];if(!i)return e;let s=i.split(" "),a=[...e.slice(0,o),...s,...e.slice(o+1)];return t.push({from:n,to:s,reason:"command_alias",confidence:"high"}),a}function E(e){return e.replace(/^--?/,"").replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function W(e){return E(e).replace(/-/g,"")}function j(e,t,o){let n=e.get(t);if(n===void 0){e.set(t,o);return}n!==o&&e.set(t,null)}function Ie(e){let t=[],o=n=>{typeof n=="string"&&n.startsWith("--")&&t.push(n)};o(e.flag);for(let n of e.aliases??[])o(n);return t}function _e(e,t){let o=t??y(e),n=new Map,i=new Map,s=new Map,a=new Set;for(let r of o){let l=Ie(r);if(l.length===0)continue;let c=`--${E(l[0])}`;for(let f of l)j(n,E(f),c),j(i,W(f),c);let u=W(c);s.has(c)||s.set(c,u),r.list===!0&&a.add(c)}return{canonicalByNormalized:n,canonicalByCompact:i,canonicalComparables:[...s.entries()].map(([r,l])=>({canonicalFlag:r,comparable:l})),listCanonicalFlags:a}}function K(e,t){let o=E(e),n=t.canonicalByNormalized.get(o);if(typeof n=="string")return{flag:n,reason:"flag_alias",confidence:"high"};let i=o.replace(/-/g,""),s=t.canonicalByCompact.get(i);if(typeof s=="string")return{flag:s,reason:"flag_alias",confidence:"high"};let a=i.length>=8?2:1,r=Number.POSITIVE_INFINITY,l,c=!1;for(let u of t.canonicalComparables){let f=_(i,u.comparable,a);if(f!==null){if(f<r){r=f,l=u.canonicalFlag,c=!1;continue}f===r&&l!==u.canonicalFlag&&(c=!0)}}return!l||c||!Number.isFinite(r)||r<=0?null:{flag:l,reason:"flag_typo",confidence:r>=2?"medium":"high"}}function ft(e){let t=[`${e}s`];return e.endsWith("y")&&e.length>1&&t.push(`${e.slice(0,-1)}ies`),t}function Ce(e,t=!1){if(t||e.includes("://"))return null;let o=e.match(/^([A-Za-z][A-Za-z0-9_-]{1,63})([:=])(.*)$/);if(!o)return null;let n=o[1],i=o[3];return i.length===0?null:{key:n,value:i}}function ve(e,t,o=!1){if(o||!e.startsWith("--"))return{tokens:[e]};let n=e.indexOf("="),i=n>=0?e.slice(0,n):e,s=n>=0?e.slice(n+1):void 0,a=K(i,t);if(!a)return{tokens:[e]};let r=s===void 0?a.flag:`${a.flag}=${s}`;return r===e?{tokens:[e]}:{tokens:[r],event:{from:e,to:[r],reason:a.reason,confidence:a.confidence}}}function ke(e){let t=new Set,o=!1;for(let n=0;n<e.length;n+=1){if(o){t.add(n),o=!1;continue}let i=e[n];o=i==="--path"||i==="--pm-path"}return t}function Te(e){if(!e.startsWith("--"))return null;let t=e.indexOf("=");return t<0?{flag:e}:{flag:e.slice(0,t),inlineValue:e.slice(t+1)}}function Ee(e,t,o){o.push(e[t]);let n=e[t+1];return typeof n=="string"&&n!=="--"?(o.push(n),t+2):t+1}function xe(e,t,o,n){if(o.inlineValue!==void 0)return{originalTokens:[e[t]],value:o.inlineValue,consumed:1};let i=[],s=t+1;for(;s<e.length&&e[s]!=="--"&&!e[s].startsWith("-")&&(i.length===0||n.has(o.flag));)i.push(e[s]),s+=1;let a=i.length===0?1:1+i.length;return{originalTokens:e.slice(t,t+a),value:i.length===0?void 0:i.join(","),consumed:a}}function Se(e,t,o,n){let i=e.get(o);if(i){i.values.push(n.value),i.occurrences+=1;return}e.set(o,{outputIndex:t.length,originalTokens:n.originalTokens,values:[n.value],occurrences:1}),t.push(null)}function Ae(e,t){let o=[],n=[];for(let[i,s]of e){if(!(s.occurrences>=2||t.has(i)&&s.originalTokens.length>2)){n.push({outputIndex:s.outputIndex,tokens:s.originalTokens});continue}let a=`${i}=${s.values.join(",")}`;n.push({outputIndex:s.outputIndex,tokens:[a]}),o.push({from:`${i} (x${s.occurrences})`,to:[a],reason:"list_merge",confidence:"high"})}return{events:o,splices:n}}function Oe(e,t){t.sort((o,n)=>n.outputIndex-o.outputIndex);for(let o of t)e.splice(o.outputIndex,1,...o.tokens)}function Pe(e,t,o=new Set,n=new Set){if(t.size===0)return{argv:[...e],events:[]};let i=[],s=new Map,a=0;for(;a<e.length;){let c=e[a];if(c==="--"){i.push(...e.slice(a));break}if(o.has(c)){a=Ee(e,a,i);continue}let u=Te(c);if(!u||!t.has(u.flag)){i.push(c),a+=1;continue}let f=xe(e,a,u,n);if(f.value===void 0){i.push(c),a+=f.consumed;continue}Se(s,i,u.flag,{originalTokens:f.originalTokens,value:f.value}),a+=f.consumed}let{events:r,splices:l}=Ae(s,n);return Oe(i,l),{argv:i,events:r}}var Y=new Map([["--add",new Set(["command","cmd","path"])],["--remove",new Set(["command","path"])]]);function Ne(e,t){if(e!=="test"||t.length<2)return!1;let o=t[t.length-1],n=t[t.length-2],i=Y.get(n);return i!==void 0&&i.has(o)}function Le(e,t,o){if(t!=="test")return e;let n=[],i=0;for(;i<e.length;){let s=e[i];if(s==="--")return n.push(...e.slice(i)),n;let a=Y.get(s),r=a?e[i+1]:void 0;if(!a||typeof r!="string"||!a.has(r)){n.push(s),i+=1;continue}let l=i+2;for(;l<e.length&&!e[l].startsWith("-");)l+=1;if(l-(i+2)!==1){n.push(s),i+=1;continue}let c=e[i+2],u=`${r}=${c}`;n.push(s,u),o.push({from:`${s} ${r} ${c}`,to:[s,u],reason:"bare_key_value",confidence:"high"}),i+=3}return n}function Me(e,t,o,n){let i=[],s=ke(e);for(let a=0;a<e.length;a+=1){let r=e[a];if(r==="--"){i.push(...e.slice(a));break}let l=s.has(a),c=i[i.length-1];if(r.startsWith("--")){let b=ve(r,t,l);i.push(...b.tokens),b.event&&n.push(b.event);continue}let u=Ce(r,l);if(!u||typeof c=="string"&&c.startsWith("-")&&!c.includes("=")||["search","comments","notes","learnings"].includes(o)||Ne(o,i)){i.push(r);continue}let f=K(u.key,t);if(!f){i.push(r);continue}let g=u.value.startsWith("-")?[`${f.flag}=${u.value}`]:[f.flag,u.value];i.push(...g),n.push({from:r,to:g,reason:"bare_key_value",confidence:f.confidence})}return i}function De(e){for(let t=0;t<e.length;t+=1){let o=e[t];if(o==="--")break;if(o==="--verify"){let n=e[t+1];if(n===void 0||n==="--")throw new h("history attest --verify requires a bundle file.",p.USAGE);e.splice(t,2,`--verify=${n}`)}else(I.has(o)||o==="--output"||o==="--hash-algorithm")&&(t+=1)}}function Fe(e,t){if(!e.some(n=>n==="--help"||n==="-h"))return;let o=new Set(y(t).flatMap(n=>[n.flag,...n.aliases??[],...n.short===void 0?[]:[n.short]]));for(let n=0;n<e.length;n+=1){let i=e[n];if(i==="--")break;i!=="--help"&&i!=="-h"||o.has(e[n-1])&&!C.has(e[n-1])&&(e[n-1]=i)}}function pt(e){let t=[],o=ye(e,t),n=ge(o);(n.length!==o.length||n.some((b,J)=>b!==o[J]))&&t.push({from:o.join(" "),to:[...n],reason:"legacy_extension_action",confidence:"high"});let i=we(n,t),s=U(i);if(s.conflict)throw new h("Provide the item id either positionally or with --id, not both.",p.USAGE);s.changed&&t.push({from:`--id ${s.itemId}`,to:[s.itemId],reason:"item_id_alias",confidence:"high"});let a=pe(s.argv),r=X(s.argv),l=m(r??a??""),c=_e(r??a),u=Me(s.argv,c,l,t),f=Le(u,l,t),g=Pe(f,c.listCanonicalFlags,I,a==="create"?new Set(["--tags"]):new Set);for(let b of g.events)t.push(b);return Fe(g.argv,r??a),r==="history attest"&&De(g.argv),{argv:g.argv,commandName:a,trace:t}}function X(e){let t=q(e),o=t[0]?.trim().toLowerCase(),n=t[1]?.trim().toLowerCase(),i=P(t);return i?i.canonical:(o==="extension"||o==="package"||o==="packages")&&typeof n=="string"&&n.length>0&&!n.startsWith("-")?`${o} ${n}`:o}function mt(e){for(let t=0;t<e.length;t+=1){let o=e[t];if(o==="--")break;if(o==="--type"){let n=e[t+1];if(typeof n=="string"&&n.trim().length>0)return n.trim();continue}if(o.startsWith("--type=")){let n=o.slice(7).trim();if(n.length>0)return n}}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fb625cd9-f8a8-56cf-88ab-abef64051497")}catch{}})();function wt(e){if(e===void 0)return()=>{};let t=e.trim();if(t.length===0)throw new h("--author requires a non-empty value.",p.USAGE,{code:"missing_required_argument",nextSteps:["Pass an explicit author identifier with --author <id>."]});let o=B();k(t);let n=!1;return()=>{n||(n=!0,o===void 0?k(void 0):k(o))}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d0e60f7e-e0a8-5ef4-9af7-4a1f102ccb7d")}catch{}})();var d=Object.freeze({clock:"PM_CLOCK",tickMs:"PM_CLOCK_TICK_MS",seed:"PM_SEED"});function x(e,t,o,n){return new h(e,p.USAGE,{code:"invalid_reproducible_process_environment",reason:t,field:o,required:`${d.clock} and ${d.seed}; ${d.tickMs} is optional`,nextSteps:[`Set ${d.clock} to an ISO-8601 instant with Z or a numeric UTC offset and ${d.seed} to a non-empty reproducibility seed.`,`Optionally set ${d.tickMs} to a non-negative integer; it defaults to 1.`,"Unset all three variables to retain normal wall-clock and cryptographic-random behavior."],recovery:{recovery_mode:"compact",provided_fields:n,missing_required_fields:t==="incomplete"?[d.clock,d.seed].filter(i=>!n.includes(i)):void 0}})}function Ve(e){let t=e[d.clock],o=e[d.tickMs],n=e[d.seed],i=[[d.clock,t],[d.tickMs,o],[d.seed,n]].filter(a=>a[1]!==void 0).map(([a])=>a);if(i.length===0)return;if(t===void 0||n===void 0)throw x("Reproducible process execution requires PM_CLOCK and PM_SEED together.","incomplete",t===void 0?d.clock:d.seed,i);if(n.trim().length===0)throw x(`${d.seed} must not be empty.`,"invalid_value",d.seed,i);if(!V(t))throw x(`${d.clock} must be a valid ISO-8601 instant with Z or a numeric UTC offset.`,"invalid_value",d.clock,i);let s=o===void 0?1:Number(o);if(o?.trim().length===0||!Number.isSafeInteger(s)||s<0)throw x(`${d.tickMs} must be a non-negative integer.`,"invalid_value",d.tickMs,i);return D({clock:t,seed:n,tickMs:s})}function $e(e){let t=Ve(e);return t===void 0?o=>o():F(t)}async function Tt(e,t){return $e(e)(t)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d5c48881-420f-5673-8696-e770db353cfc")}catch{}})();function Z(e){return e.trim().match(/--[a-z0-9][a-z0-9_-]*/i)?.[0]?.replaceAll("_","-").toLowerCase()}function Ot(e){if(!(!Array.isArray(e)||e.length===0))return v(e)}function Be(e,t){let o=Z(t);if(!o)return;let n=y(e).find(i=>i.flag===o||i.aliases?.includes(o));return n?n.value_type==="boolean"?null:`<${n.value_name??"value"}>`:"<value>"}function Pt(e,t,o){let n=[...e],i=n.indexOf("--"),s=i<0?n.length:i;for(let a of o){let r=Z(a);if(!r||n.slice(0,s).some(u=>u===r||u.startsWith(`${r}=`)))continue;let l=Be(t,r),c=l?[r,l]:[r];n.splice(s,0,...c),s+=c.length}return n.length===e.length?void 0:M(n)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bd9a8d3b-bc6f-5309-a3fb-7e5f41ef9dab")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a48c9a1f-b959-54a4-a27f-4f662ae7fd31")}catch{}})();var Re={add:["create","append"],fetch:["get"],inspect:["get","health"],log:["history","comments","notes"],ls:["list"],pause:["release"],read:["get"],remove:["delete"],rm:["delete"],show:["get"],start:["start-task"]};function H(e,t){let o=e.trim().toLowerCase(),n=t.trim().toLowerCase();if(n.length===0)return Number.POSITIVE_INFINITY;let i=o.split(" "),s=Re[n]?.indexOf(m(o));if(s!==void 0&&s>=0)return s;if(o===n)return 10;if(i.includes(n))return 11;if(i.some(l=>l.startsWith(n)))return 12;let a=n.length>=5?2:1,r=Number.POSITIVE_INFINITY;for(let l of i){let c=_(l,n,a);c!==null&&(r=Math.min(r,c))}return Number.isFinite(r)?20+r:o.includes(n)?30:Number.POSITIVE_INFINITY}function $t(e,t){return e.map(o=>({path:o,score:H(o,t)})).filter(o=>Number.isFinite(o.score)).sort((o,n)=>o.score!==n.score?o.score-n.score:o.path===n.path?0:o.path<n.path?-1:1).map(o=>o.path)}function Bt(e,t,o){let n=new Set(t),i=S.filter(r=>r.lifecycle==="deprecated").slice().sort((r,l)=>l.alias.length-r.alias.length),s=[],a=e.flatMap(r=>{let l=i.find(u=>r===u.alias||r.startsWith(`${u.alias} `)),c=r;if(l){let u=r.slice(l.alias.length);if(!n.has(`${l.canonical}${u}`))return[];c=`${l.canonical_argv.join(" ")}${u}`}return o!==void 0&&H(r,o)<10&&s.push(c),[c]});return[...new Set(s.length>0?s:a)]}export{Ue as a,Ke as b,ee as c,te as d,Ye as e,Xe as f,G as g,U as h,de as i,q as j,fe as k,T as l,pe as m,dt as n,ge as o,ft as p,Pe as q,Le as r,pt as s,mt as t,wt as u,d as v,Ve as w,$e as x,Tt as y,Ot as z,Be as A,Pt as B,H as C,$t as D,Bt as E};
|
|
2
|
+
//# sourceMappingURL=chunk-ZNXRGATT.js.map
|
package/dist/cli-bundle/chunks/{register-list-query-PYVSPGPV.js → register-list-query-2YOWMNWY.js}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{b as g,c as I,d as F}from"./chunk-
|
|
1
|
+
import{b as g,c as I,d as F}from"./chunk-KOGF6O6W.js";import{a as de}from"./chunk-CPZOW6L2.js";import{A as oe,P as ne,T as ie,Y as ae,r as te,y as A}from"./chunk-P5NS7EFC.js";import{$a as Q,$c as ee,Hc as K,Tc as W,Vc as X,Xc as Y,Zb as V,_c as Z,aa as q,bd as re,cd as se,dd as le,na as L}from"./chunk-XW3BLWFF.js";import"./chunk-DEZPZOQ7.js";import{Ef as S,Hc as k,Mf as v,Pf as f,Qf as m,R as c,T as u,Uo as y,Xo as s,Zo as d,bb as C,fp as G,gp as $,hp as M,ip as U,jp as N,kp as B,l as E,lp as z,m as O,mp as P,np as J,op as H,pm as T,qm as R,ti as j}from"./chunk-5TCQ5J3V.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="19d28e23-5337-5ec0-83e6-6e43b462ece7")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a51d6d75-0f11-5bdf-a384-2ca10ef064ef")}catch{}})();async function fe(e,t){let o=y(t),i=Date.now();if([e.raw,e.compact,e.full,e.provenance].filter(l=>l===!0).length>1)throw new u("Activity projection options are mutually exclusive. Use --raw, --compact, --provenance, or --full.",c.USAGE);let a=P(e.stream);if(a&&!o.json)throw new u("--stream requires --json output mode.",c.USAGE);let n=z(e),r=await V(a&&e.full!==!0&&e.provenance!==!0?{...n,raw:!0,compact:!0}:n,o);a?U(r,n,o):f(r,o),o.profile&&m(`profile:command=activity took_ms=${Date.now()-i}`)}function D(e){e.option("--id <value>","Filter by item ID").option("--op <value>","Filter by history operation").option("--author <value>","Filter by history author").option("--from <value>","Lower timestamp bound (ISO/date string or relative)").option("--to <value>","Upper timestamp bound (ISO/date string or relative)").option("--limit <n>","Return only the latest n activity entries").option("--unbounded","Explicitly return every matching activity entry (disables the default bound)").option("--compact","Condensed output: show only id, op, ts, author, msg per entry").option("--raw","Show the legacy compact per-event stream instead of the item digest").option("--full","Show full activity entries with JSON Patch payloads").option("--provenance","Show patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include bounded provenance completeness counts").option("--harness <value>","Filter by recorded or vocabulary-resolved harness (repeatable)",s).option("--agent-instance <value>","Filter by privacy-safe agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter by an exact declared provenance value (repeatable)",s).option("--stream [mode]","Emit line-delimited JSON rows (requires --json). Optional mode: rows|ndjson|jsonl").description("Show recent activity across items.").action(fe)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1a62fe05-4407-5e76-87fa-5109dcca5640")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="25c5349b-60d7-505b-98b0-3ed19e44b791")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b40cde4c-ca5a-522d-a731-52503c7e4fe0")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9212f45c-798d-5774-87ce-bb7d6ff5514a")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="deee1339-ac17-5ae9-8add-a9dd766d182e")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="de0fbee0-0bcf-5a46-9013-f7f883d3d0a3")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b662e21b-a163-5834-8789-65243f4c7c9c")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5cc1722c-b797-5b95-a493-3925003ba72e")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="35c679a2-9d47-51fa-8bd2-175a4ec48d6b")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3a772ffc-e054-57aa-84e0-2c4da3b8c645")}catch{}})();function ye(e,t){return!t||t.size===0?!0:e==="context"?t.has("context")||t.has("ctx"):t.has(e)}function ce(e){if(e===void 0)return;if(typeof e!="string")throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE);let t=e.trim().toLowerCase();if(t==="csv"||t==="table"||t==="json"||t==="ndjson"||t==="toon")return t;throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE)}function _(e,t,o,i=!1){if(t===void 0)return o;if(typeof t!="string")throw new u(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,c.USAGE);let a=t.trim().toLowerCase();if(a!=="json"&&(a!=="ndjson"||!i)&&a!=="toon")throw new u(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,c.USAGE);if(o.json===!0&&a==="toon")throw new u(`${e} cannot combine --json with --format toon`,c.USAGE);return{...o,json:a==="json"||a==="ndjson"}}function he(e,t){q[t]==="brief"&&e.includeBody!==!0&&e.compact!==!0&&e.brief!==!0&&e.full!==!0&&e.fields===void 0&&(e.brief=!0)}function ue(e){e.option("--has-notes","Show only items that have notes").option("--has-learnings","Show only items that have learnings").option("--has-files","Show only items that have linked files").option("--has-docs","Show only items that have linked docs").option("--has-tests","Show only items that have linked tests").option("--has-comments","Show only items that have comments").option("--has-deps","Show only items that have dependencies").option("--has-body","Show only items that have a non-empty body").option("--has-linked-command","Show only items whose linked tests carry a runnable command").option("--no-notes","Show only items that have no notes").option("--no-learnings","Show only items that have no learnings").option("--no-files","Show only items that have no linked files").option("--filter-files-missing","Alias for --no-files").option("--no-docs","Show only items that have no linked docs").option("--filter-docs-missing","Alias for --no-docs").option("--no-tests","Show only items that have no linked tests").option("--no-comments","Show only items that have no comments").option("--no-deps","Show only items that have no dependencies").option("--empty-body","Show only items with an empty body").option("--no-linked-command","Show only items whose linked tests carry no runnable command").option("--filter-reviewer-missing","Show only items missing reviewer").option("--filter-risk-missing","Show only items missing risk").option("--filter-confidence-missing","Show only items missing confidence").option("--filter-sprint-missing","Show only items missing sprint").option("--filter-release-missing","Show only items missing release")}var ve={draft:{name:"list-draft",dependencyBlocked:!1},open:{name:"list-open",dependencyBlocked:!1},in_progress:{name:"list-in-progress",dependencyBlocked:!1},blocked:{name:"list-blocked",dependencyBlocked:!0},closed:{name:"list-closed",dependencyBlocked:!1},canceled:{name:"list-canceled",dependencyBlocked:!1}};function ge(e,t){let o=e.stream===!0,i=ce(e.format),a=i==="csv"||i==="table",n=i==="json"||i==="ndjson"||i==="toon"?_("List",e.format,t,!0):t;if(o&&!n.json)throw new u("--stream requires --json output mode.",c.USAGE);if((a||i==="ndjson")&&o)throw new u("--format csv|table|ndjson cannot be combined with --stream.",c.USAGE);return{streamMode:o,listFormat:i,effectiveGlobal:n}}function be(e,t,o){if(o.listFormat==="csv"||o.listFormat==="table"){k(t);let i=t.items,a=o.listFormat==="csv"?T(i):R(i);!o.effectiveGlobal.quiet&&a.length>0&&v(`${a}
|
|
2
2
|
`)}else if(o.listFormat==="ndjson"){k(t);let i=I(t.items);!o.effectiveGlobal.quiet&&i.length>0&&v(`${i}
|
|
3
|
-
`)}else o.streamMode
|
|
3
|
+
`)}else o.streamMode?M(e,t,o.effectiveGlobal):f(t,o.effectiveGlobal)}async function we(e){let t=y(e.actionCommand),o=e.aliasContract?{...t,command:e.aliasContract.canonical}:t,i=Date.now();e.aliasContract?.lifecycle==="deprecated"&&await j(C(process.cwd(),o.path)).then(me=>me.ux.deprecation_hints)&&m(O(e.aliasContract));let a=S("list",e.options),n=G(a),r=xe(e,n),{effectiveName:l,effectiveStatus:h,effectiveDependencyBlocked:p,effectiveExcludeTerminal:w}=r;he(n,l),Object.assign(n,{projectionCommand:l}),w&&(n.excludeTerminal=!0),n.dependencyBlocked=p;let x=ge(a,o),pe=await L(p?void 0:h,n,o);be("list",pe,x),o.profile&&m(`profile:command=list took_ms=${Date.now()-i}`)}function xe(e,t){let o=e.name,i=e.status,a=e.dependencyBlocked===!0,n=e.excludeTerminal===!0,r=t.status?.trim().toLowerCase(),l=e.name==="list"&&r!==void 0?ve[r]:void 0;return e.name==="list"&&(e.options.all===!0||r==="all"?(o="list-all",n=!1,t.status=void 0):r!==void 0&&l!==void 0&&(o=l.name,i=r,a=l.dependencyBlocked,n=!1,t.status=void 0)),(o==="list-open"||o==="list-in-progress")&&(t.lifecycleBucket=o==="list-open"?"open":"in_progress",i=void 0),{effectiveName:o,effectiveStatus:i,effectiveDependencyBlocked:a,effectiveExcludeTerminal:n}}function ke(e,t){let{name:o,description:i,status:a,excludeTerminal:n,allowStatusFilter:r,dependencyBlocked:l,aliasContract:h}=t,p=e.command(o,{hidden:h?.hidden===!0}).description(i);r&&p.option("--status <value>","Filter by status (repeatable or comma-separated; matches any; all selects every status)",s),o==="list"&&p.option("--all","Include every lifecycle status"),p.option("--for <intent>",`Apply a declared context intent projection. ${g("list","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--type <value>","Filter by item type (repeatable or comma-separated; matches any)",s).option("--tag <value>","Filter by tag (repeatable or comma-separated; matches any)",s).option("--priority <value>","Filter by priority (repeatable or comma-separated; matches any)",s).option("--deadline-before <value>","Filter by deadline upper bound (ISO/date string or relative)").option("--deadline-after <value>","Filter by deadline lower bound (ISO/date string or relative)").option("--today","Filter to items updated since local midnight today").option("--recent","Filter to items updated in the last 7 days").option("--updated-after <value>","Updated since ISO timestamp or signed relative (-2h/-7d for past); use last-window ISO").option("--updated-before <value>","Filter by updated_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-after <value>","Filter by created_at lower bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-before <value>","Filter by created_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--ids <value>","Filter by explicit item IDs (comma-separated or repeatable)").option("--assignee <value>","Filter by assignee",s).option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--parent <value>","Filter by parent item ID").option("--sprint <value>","Filter by sprint",s).option("--release <value>","Filter by release",s).option("--filter-ac-missing","Show only items missing acceptance_criteria").option("--filter-estimates-missing","Show only items missing estimated_minutes").option("--filter-resolution-missing","Show only terminal items missing resolution").option("--filter-metadata-missing","Show only items missing any tracked metadata (AC, estimate, or resolution)").option("--limit <n>","Alias for --output-limit; --output-budget may cap rows").option("--offset <n>","Skip the first n matching rows before limit is applied").option("--after <cursor>","Continue after an opaque next_cursor from a previous list response").option("--no-truncate","Return every matched row after the explicit status and field filters").option("--include-body","Include item body in each returned list row").option("--strict-read","Fail closed if any item document or item directory cannot be read").option("--compact","Render compact list projection fields (mutually exclusive with --brief/--full/--fields)").option("--brief","Ultra-compact output: id, status, type, title only (agent-optimized, mutually exclusive with --compact/--full/--fields)").option("--full","Render full list projection fields (mutually exclusive with --compact/--brief/--fields)").option("--fields <value>",`Render custom comma-separated list fields (mutually exclusive with --compact/--brief/--full). ${g(o,"--fields")}`).option("--sort <value>","Sort field: priority|deadline|updated_at|created_at|title|parent (aliases: updated, created)").option("--order <value>","Sort order: asc|desc (requires --sort)").option("--tree","Render rows in parent/child tree order").option("--tree-depth <n>","Maximum recursion depth with --tree (0 keeps root rows only)").option("--format <value>","Output render mode: csv|table (human export) or json|ndjson|toon (machine output override)").option("--stream","Emit line-delimited JSON rows (requires --json)"),ue(p),p.action(async(w,x)=>{await we({name:o,status:a,excludeTerminal:n,dependencyBlocked:l,options:w,actionCommand:x,aliasContract:h})}),d(p,"--tags <value>","Alias for --tag"),d(p,"--assignee_filter <value>","Alias for --assignee-filter"),d(p,"--tree_depth <n>","Alias for --tree-depth"),d(p,"--token_budget <n>","Alias for --token-budget"),d(p,"--filter-estimate-missing","Alias for --filter-estimates-missing")}async function Se(e,t){let o=y(t),i=Date.now(),a=await te($(e),o);f(a,o),o.profile&&m(`profile:command=aggregate took_ms=${Date.now()-i}`)}async function _e(e,t){let o=y(t),i=Date.now(),a=J(S("context",e)),n=await X(a,o),r=K(a,o);if(r==="markdown")o.quiet||v(`${W(n)}
|
|
4
4
|
`);else if(r==="ndjson"){k(n);let l=I([...n.high_level,...n.low_level,...n.blocked_fallback]);!o.quiet&&l.length>0&&v(`${l}
|
|
5
|
-
`)}else f(n,{...o,json:r==="json"});o.profile&&m(`profile:command=context took_ms=${Date.now()-i}`)}async function Ie(e,t){let o=y(t),i=Date.now(),a=
|
|
5
|
+
`)}else f(n,{...o,json:r==="json"});o.profile&&m(`profile:command=context took_ms=${Date.now()-i}`)}async function Ie(e,t){let o=y(t),i=Date.now(),a=H(S("next",e)),n=await Z(a,o),r=Y(a,o);r==="markdown"?o.quiet||v(`${ee(n)}
|
|
6
6
|
`):f(n,{...o,json:r==="json"}),o.profile&&m(`profile:command=next took_ms=${Date.now()-i}`)}async function Ae(e,t,o){let i=y(o),a=Date.now(),n=B(e),r=S("search",t,[n]),l=N(r),h=await ne(n,l,i),p=typeof r.format=="string"?r.format.trim().toLowerCase():void 0,w=_("Search",r.format,i,!0);if(p==="ndjson"){k(h);let x=I(h.items);!w.quiet&&x.length>0&&v(`${x}
|
|
7
|
-
`)}else f(h,w);i.profile&&m(`profile:command=search took_ms=${Date.now()-a}`)}async function Fe(e,t){let o=y(t),i=Date.now(),a=await ae({mode:typeof e.mode=="string"?e.mode:void 0,k:typeof e.k=="string"?e.k:void 0,failUnder:typeof e.failUnder=="string"?e.failUnder:void 0,queries:typeof e.queries=="string"?e.queries:void 0,format:typeof e.format=="string"?e.format:void 0},o);if(f(a,_("Eval",e.format,o)),o.profile&&m(`profile:command=eval took_ms=${Date.now()-i}`),!a.passed)throw new u("Eval gate failed: one or more aggregate or per-query thresholds were not met; inspect the metric report",c.GENERIC_FAILURE)}async function De(e,t,o){let i=y(o),a=Date.now(),n=S("get",t,[e]),r=await A(e,i,{depth:typeof n.depth=="string"?n.depth:void 0,fields:typeof n.fields=="string"?n.fields:void 0,full:!!n.full,tree:n.tree===!0,treeDepth:typeof n.treeDepth=="string"?n.treeDepth:typeof n.tree_depth=="string"?n.tree_depth:void 0,at:typeof n.at=="string"?n.at:void 0});f(r,_("Get",n.format,i)),i.profile&&m(`profile:command=get took_ms=${Date.now()-a}`)}async function Ee(e,t,o){let i=y(o),a=Date.now();if([t.compact,t.raw,t.full,t.provenance].filter(h=>h===!0).length>1)throw new u("History projection options are mutually exclusive. Use --compact, --provenance, or --full.",c.USAGE);let n=typeof t.field=="string"?t.field:void 0,r=!!t.strictExit||!!t.failOnWarn;if(r&&!t.verify)throw new u("--strict-exit requires --verify (it gates on the verification result).",c.USAGE);let l=await oe(e,{limit:typeof t.limit=="string"?t.limit:void 0,compact:!(t.full===!0||t.provenance===!0),provenance:t.provenance===!0,provenanceSummary:t.provenanceSummary===!0,harness:b(t,"harness"),agentInstance:b(t,"agentInstance"),provenanceFilter:b(t,"provenanceFilter"),diff:!!t.diff||n!==void 0,field:n,verify:!!t.verify},i);f(l,_("History",t.format,i)),r&&l.verification&&!l.verification.ok&&(process.exitCode=c.GENERIC_FAILURE),i.profile&&m(`profile:command=history took_ms=${Date.now()-a}`)}function b(e,t){let o=e[t];return Array.isArray(o)?o:void 0}function
|
|
7
|
+
`)}else f(h,w);i.profile&&m(`profile:command=search took_ms=${Date.now()-a}`)}async function Fe(e,t){let o=y(t),i=Date.now(),a=await ae({mode:typeof e.mode=="string"?e.mode:void 0,k:typeof e.k=="string"?e.k:void 0,failUnder:typeof e.failUnder=="string"?e.failUnder:void 0,queries:typeof e.queries=="string"?e.queries:void 0,format:typeof e.format=="string"?e.format:void 0},o);if(f(a,_("Eval",e.format,o)),o.profile&&m(`profile:command=eval took_ms=${Date.now()-i}`),!a.passed)throw new u("Eval gate failed: one or more aggregate or per-query thresholds were not met; inspect the metric report",c.GENERIC_FAILURE)}async function De(e,t,o){let i=y(o),a=Date.now(),n=S("get",t,[e]),r=await A(e,i,{depth:typeof n.depth=="string"?n.depth:void 0,fields:typeof n.fields=="string"?n.fields:void 0,full:!!n.full,tree:n.tree===!0,treeDepth:typeof n.treeDepth=="string"?n.treeDepth:typeof n.tree_depth=="string"?n.tree_depth:void 0,at:typeof n.at=="string"?n.at:void 0});f(r,_("Get",n.format,i)),i.profile&&m(`profile:command=get took_ms=${Date.now()-a}`)}async function Ee(e,t,o){let i=y(o),a=Date.now();if([t.compact,t.raw,t.full,t.provenance].filter(h=>h===!0).length>1)throw new u("History projection options are mutually exclusive. Use --compact, --provenance, or --full.",c.USAGE);let n=typeof t.field=="string"?t.field:void 0,r=!!t.strictExit||!!t.failOnWarn;if(r&&!t.verify)throw new u("--strict-exit requires --verify (it gates on the verification result).",c.USAGE);let l=await oe(e,{limit:typeof t.limit=="string"?t.limit:void 0,compact:!(t.full===!0||t.provenance===!0),provenance:t.provenance===!0,provenanceSummary:t.provenanceSummary===!0,harness:b(t,"harness"),agentInstance:b(t,"agentInstance"),provenanceFilter:b(t,"provenanceFilter"),diff:!!t.diff||n!==void 0,field:n,verify:!!t.verify},i);f(l,_("History",t.format,i)),r&&l.verification&&!l.verification.ok&&(process.exitCode=c.GENERIC_FAILURE),i.profile&&m(`profile:command=history took_ms=${Date.now()-a}`)}function b(e,t){let o=e[t];return Array.isArray(o)?o:void 0}function Oe(e,t){let o=b(e,"harness"),i=b(e,"agentInstance"),a=b(e,"provenanceFilter"),n=typeof e.cursorMode=="string"?e.cursorMode:void 0;if(n!==void 0&&n!=="batch"&&n!=="row")throw new u("Events --cursor-mode must be batch or row.",c.USAGE,{code:"invalid_event_cursor_mode"});let r=n;return{pmRoot:t,since:typeof e.since=="string"?e.since:void 0,type:b(e,"type"),author:b(e,"author"),item:b(e,"item"),limit:typeof e.limit=="string"?Number(e.limit):void 0,full:e.full===!0,...e.provenance===!0?{provenance:!0}:{},...e.provenanceSummary===!0?{provenanceSummary:!0}:{},...o===void 0?{}:{harness:o},...i===void 0?{}:{agentInstance:i},...a===void 0?{}:{provenanceFilter:a},cursorMode:r}}async function Ce(e,t,o){if(t.provenanceSummary===!0)throw new u("Events --provenance-summary is bounded to one page and cannot be combined with --follow.",c.USAGE);let i=typeof t.intervalMs=="string"?Number(t.intervalMs):void 0;if(e.cursorMode==="row"){for await(let a of le({...e,intervalMs:i}))o||v(`${JSON.stringify(a)}
|
|
8
8
|
`);return}for await(let a of se({...e,intervalMs:i}))o||v(`${F(a.events,{count:a.count,has_more:a.has_more,next_cursor:a.next_cursor??null,source:a.source,heartbeat:a.count===0})}
|
|
9
|
-
`)}function je(e){return e.cursor_mode==="row"?I(e.events):F(e.events,{count:e.count,has_more:e.has_more,next_cursor:e.next_cursor??null,source:e.source,...e.provenance_summary===void 0?{}:{provenance_summary:e.provenance_summary}})}async function
|
|
10
|
-
`),o.profile&&m(`profile:command=events took_ms=${Date.now()-i}`)}async function Te(e,t,o,i,a){let n=y(a),r=Date.now(),l=await Q(e,t,o,{...Array.isArray(i.kind)?{kind:i.kind}:{},maxDepth:typeof i.maxDepth=="string"?i.maxDepth:void 0,limit:typeof i.limit=="string"?i.limit:void 0,after:typeof i.after=="string"?i.after:void 0,direction:typeof i.direction=="string"?i.direction:void 0,maxPaths:typeof i.maxPaths=="string"?i.maxPaths:void 0,sample:typeof i.sample=="string"?i.sample:void 0,...Array.isArray(i.exemptIsolate)?{exemptIsolate:i.exemptIsolate}:{},...Array.isArray(i.exemptIsolateType)?{exemptIsolateType:i.exemptIsolateType}:{},saveBaseline:i.saveBaseline===!0,rebuild:i.rebuild===!0,clear:i.clear===!0,summary:i.summary===!0,full:i.full===!0},n);f(l,n),n.profile&&m(`profile:command=graph took_ms=${Date.now()-r}`)}function At(e,t){let o=t?.commandFilter,i=n=>ye(n,o),a=[{name:"list",description:"List active items with optional lifecycle-status and project filters.",excludeTerminal:!0,allowStatusFilter:!0},{name:"list-all",description:"List all items with optional filters.",excludeTerminal:!1,allowStatusFilter:!0},{name:"list-draft",description:"List draft items with optional filters.",status:"draft"},{name:"list-open",description:"List open items with optional filters.",status:"open",excludeTerminal:!1,allowStatusFilter:!1},{name:"list-in-progress",description:"List in-progress items with optional filters.",status:"in_progress",excludeTerminal:!1,allowStatusFilter:!1},{name:"list-blocked",description:"List blocked items (blocked status or open blocked_by dependencies, matching pm next) with optional filters.",dependencyBlocked:!0,excludeTerminal:!1,allowStatusFilter:!1},{name:"list-closed",description:"List closed items with optional filters.",status:"closed"},{name:"list-canceled",description:"List canceled items with optional filters.",status:"canceled"}];for(let n of a)if(i(n.name)){let r=E(n.name);ke(e,{...n,...r?.registration==="commander"?{aliasContract:r}:{}})}if(i("aggregate")){let n=e.command("aggregate").description("Group item counts and numeric measures.").option("--set-mode <value>","Set grouping: element (default)|tuple").option("--limit <value>","Group page size (default: 50)").option("--after <value>","Continue with next_after cursor").option("--group-by <value>","Fields: parent,type,priority,status,assignee,tags,sprint,release (comma-separated)").option("--count","Counts (default)").option("--completion","Status counts and completion_pct").option("--sum <field>","Group numeric sum").option("--avg <field>","Group numeric average").option("--include-unparented","Keep unparented group").option("--status <value>","Item status").option("--type <value>","Item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Latest deadline (ISO/date or relative)").option("--deadline-after <value>","Earliest deadline (ISO/date or relative)").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Assignee presence: assigned|unassigned").option("--parent <value>","Parent ID").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release");d(n,"--include_unparented","Alias for --include-unparented"),d(n,"--assignee_filter <value>","Alias for --assignee-filter"),n.action(Se)}if(i("context")){let n=e.command("context").alias("ctx").description("Show a token-efficient project context snapshot for next-work decisions.").option("--for <intent>",`Apply a declared context intent projection. ${g("context","--for")}`).option("--date <value>","Anchor date/time for agenda window calculations (ISO/date string or relative)").option("--from <value>","Agenda lower bound (ISO/date string or relative)").option("--to <value>","Agenda upper bound (ISO/date string or relative)").option("--past","Include past agenda entries in bounded windows").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <id>","Scope the snapshot to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit focus and agenda rows per section").option("--after <cursor>","Continue ranked focus after a next_cursor from a previous context response").option("--format <value>","Context output format override: markdown|toon|json|ndjson").option("--depth <value>","Context depth: brief|standard|deep|full (full = every section, no per-section cap)").option("--section <value...>","Include specific sections (repeatable; overrides --depth)").option("--fields <value>","Project focus rows to a comma-separated field subset (e.g. id,title,priority)").option("--activity-limit <n>","Limit recent activity entries (default: settings or 10)").option("--stale-threshold <value>","Staleness cutoff in days (e.g. 7 or 7d; default: settings or 7)").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked candidate ids").option("--token-budget <n>","Maximum estimated tokens spent on ranked focus rows").option("--no-extension-health","Omit the installed extension health summary").option("--no-tags","Omit tag arrays from context focus rows");d(n,"--assignee_filter <value>","Alias for --assignee-filter"),d(n,"--max-items <n>","Alias for --limit"),d(n,"--explain_ranking","Alias for --explain-ranking"),d(n,"--token_budget <n>","Alias for --token-budget"),n.action(_e)}if(i("next")){let n=e.command("next").description("Recommend the next actionable (unblocked, ready) work item with rationale + blocked companion.").option("--for <intent>",`Apply a declared context intent projection. ${g("next","--for")}`).option("--type <value>","Filter candidate items by type").option("--tag <value>","Filter candidate items by tag").option("--priority <value>","Filter candidate items by priority").option("--assignee <value>","Filter candidate items by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter candidate items by sprint").option("--release <value>","Filter candidate items by release").option("--parent <id>","Scope to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit ready rows (default: 5; non-positive falls back to default)").option("--blocked-limit <n>","Limit blocked rows (default: same as --limit)").option("--ready-only","Omit the blocked companion list").option("--include-decisions","Include human-gated Decision items in the claimable ready queue").option("--include-gates","Include outcome gates in the ready queue").option("--include-containers","Include containers with unfinished descendants in the ready queue").option("--format <value>","Next output format override: markdown|toon|json").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked ready ids").option("--token-budget <n>","Maximum estimated tokens spent on the ranked ready queue");d(n,"--assignee_filter <value>","Alias for --assignee-filter"),d(n,"--blocked_limit <n>","Alias for --blocked-limit"),d(n,"--ready_only","Alias for --ready-only"),d(n,"--explain_ranking","Alias for --explain-ranking"),d(n,"--token_budget <n>","Alias for --token-budget"),n.action(Ie)}if(i("search")){let n=e.command("search").argument("<keywords...>","Keyword query tokens").description("Search items with keyword, semantic, or hybrid retrieval. Inline field:value tokens (tag:/status:/type:/priority:) in the query are parsed as filters, e.g. 'auth tag:area:search status:open'.").option("--for <intent>",`Apply a declared context intent projection. ${g("search","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--mode <value>","Search mode: keyword|semantic|hybrid (default: auto)").option("--semantic","Shorthand for --mode semantic").option("--hybrid","Shorthand for --mode hybrid").option("--match-mode <value>","Token match mode: and|or|exact (default: or with all-terms ranking bonus; and = hard-require every token; exact = exact phrase)").option("--min-score <value>","Per-query minimum score threshold (finite number >= 0); overrides settings search.score_threshold for this query only").option("--count","Return only the count of matching items (post-filter/threshold, pre-limit); skips hit rows").option("--semantic-weight <value>","Override hybrid semantic weight for this query (0..1); invalid values fall back to settings").option("--include-linked","Include linked files, docs, and tests in the searchable corpus").option("--title-exact","Require exact normalized title match for the full query string").option("--phrase-exact","Require exact normalized phrase match in searchable text").option("--highlight","Emit per-field matched-text snippets (wrapped in \xAB\u2026\xBB) on each hit; off by default").option("--status <value>","Filter by status before query (all, open/closed/canceled aliases, or configured status id; CSV)").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Filter by deadline upper bound (ISO/date string or relative)").option("--deadline-after <value>","Filter by deadline lower bound (ISO/date string or relative)").option("--updated-after <value>",'Filter by updated_at lower bound: ISO timestamp or signed relative (e.g. "-2h"/"-7d" for the past)').option("--updated-before <value>","Filter by updated_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-after <value>","Filter by created_at lower bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-before <value>","Filter by created_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--assignee <value>","Filter by assignee").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <value>","Filter by parent item ID").option("--compact","Render compact search hits (default; mutually exclusive with --full/--fields)").option("--full","Render full search hits with nested item payloads (mutually exclusive with --compact/--fields)").option("--fields <value>",`Render custom comma-separated search hit fields (mutually exclusive with --compact/--full). ${g("search","--fields")}`).option("--format <value>","Search output format override: json|ndjson|toon").option("--limit <n>","Limit returned item count").option("--after <cursor>","Continue after an opaque next_cursor from a previous search response");ue(n),n.action(Ae),d(n,"--tags <value>","Alias for --tag"),d(n,"--token_budget <n>","Alias for --token-budget")}if(i("eval")&&e.command("eval").description("Evaluate search relevance against a curated golden-query set: reports nDCG@k, MRR@k, precision@k, and recall@k per query plus the macro average. Use --fail-under as a CI gate.").option("--mode <value>","Default retrieval mode for queries without their own: keyword|semantic|hybrid (default: keyword)").option("--k <n>","Metric cutoff @k (positive integer; default: 10)").option("--fail-under <value>","Exit non-zero when aggregate nDCG@k falls below this threshold (0..1); CI gate").option("--queries <path>",`Query JSON (${ie}); default: search/eval-queries.json; errors show an example`).option("--format <value>","Eval output format override: json|toon").action(Fe),i("get")){let n=e.command("get").argument("<id>","Item id").option("--for <intent>",`Apply a declared context intent projection. ${g("get","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--depth <value>","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(De);d(n,"--tree_depth <n>","Alias for --tree-depth"),d(n,"--token_budget <n>","Alias for --token-budget")}if(i("history")){let n=e.command("history").enablePositionalOptions().argument("<id>","Item id").option("--limit <n>","Latest n entries").option("--compact","Index, time, op, author, patch count, fields").option("--full","Full entries with JSON Patches").option("--provenance","Authors and provenance; no patches").option("--provenance-summary","Count provenance completeness").option("--harness <value>","Recorded/resolved harness (repeatable)",s).option("--agent-instance <value>","Agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Exact provenance match (repeatable)",s).option("--diff","Before/after field diffs").option("--field <name>","Filter changed field; implies --diff").option("--verify","Verify full chain and replay").option("--strict-exit","With --verify, fail on integrity errors").option("--fail-on-warn","Alias for --strict-exit").option("--format <value>","Output: json|toon").description("Show item history entries.").action(Ee);de(n,!0),D(n.command("activity"))}i("events")&&e.command("events").option("--since <cursor-or-timestamp>","Resume strictly after a durable cursor, or include events from an ISO timestamp").option("--type <value>","Filter by mutation operation (repeatable or comma-separated)",s).option("--author <value>","Filter by mutation author (repeatable or comma-separated)",s).option("--item <value>","Filter by item or workspace stream id (repeatable or comma-separated)",s).option("--limit <n>","Return at most 1,000 events (default: 100)").option("--cursor-mode <mode>","Cursor framing: batch emits one terminal trailer (default); row preserves one cursor per event").option("--full","Include each complete authoritative history entry").option("--provenance","Include patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include bounded provenance completeness counts").option("--harness <value>","Filter by recorded or vocabulary-resolved harness (repeatable)",s).option("--agent-instance <value>","Filter by privacy-safe agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter by an exact declared provenance value (repeatable)",s).option("--follow","Continue emitting committed events as newline-delimited JSON").option("--interval-ms <n>","Empty-read delay while following (minimum: 10ms; default: 250ms)").description("Emit cursor-resumable committed mutation facts as newline-delimited JSON.").action(Re),i("activity")&&D(e.command("activity",{hidden:!0})),i("graph")&&e.command("graph").argument("<subcommand>","Graph query (ancestors, descendants, predecessors, successors, paths, impact, analyze, audit, communities, redundancy, dominators, slack, centrality, articulation, plan, index)").argument("[id]","Root item id (traversals, paths, impact, and dominators)").argument("[target]","Target item id (paths only)").option("--kind <value>","Restrict traversal to registered relationship kinds (repeatable or comma-separated)",s).option("--max-depth <value>","Maximum traversal depth (non-negative integer)").option("--limit <value>","Maximum returned rows per bounded collection").option("--after <value>","Resume a traversal after this previously returned node id").option("--direction <value>","Edge orientation for paths/impact (outgoing, incoming, or both)").option("--max-paths <value>","Maximum enumerated paths (paths only)").option("--sample <value>","Maximum evidence sample entries per audit finding (audit only)").option("--exempt-isolate <value>","Item ids treated as explicitly valid isolates by the audit (repeatable or comma-separated)",s).option("--exempt-isolate-type <value>","Item types whose active isolates are policy-valid for the audit (repeatable or comma-separated)",s).option("--save-baseline","Persist the audit census as the change-since-baseline comparison point (audit only)").option("--rebuild","Rebuild and warm the durable graph index (index only)").option("--clear","Delete the durable graph index (index only)").option("--summary","Return counts-first envelopes without row collections").option("--full","Return the complete graph row projection").description("Bounded workspace relationship-graph queries, analytics, and governance audit.").action(Te)}var Ft={resolveReadCommandOutputFormat:_,parseListFormat:ce};export{Ft as _testOnlyRegisterListQuery,At as registerListQueryCommands};
|
|
11
|
-
//# sourceMappingURL=register-list-query-
|
|
9
|
+
`)}function je(e){return e.cursor_mode==="row"?I(e.events):F(e.events,{count:e.count,has_more:e.has_more,next_cursor:e.next_cursor??null,source:e.source,...e.provenance_summary===void 0?{}:{provenance_summary:e.provenance_summary}})}async function Te(e,t){let o=y(t),i=Date.now(),a=Oe(e,o.path);if(e.follow===!0){await Ce(a,e,o.quiet===!0);return}let n=await re(a);if(k(n),o.json){f(n,o),o.profile&&m(`profile:command=events took_ms=${Date.now()-i}`);return}let r=je(n);!o.quiet&&r.length>0&&v(`${r}
|
|
10
|
+
`),o.profile&&m(`profile:command=events took_ms=${Date.now()-i}`)}async function Re(e,t,o,i,a){let n=y(a),r=Date.now(),l=await Q(e,t,o,{...Array.isArray(i.kind)?{kind:i.kind}:{},maxDepth:typeof i.maxDepth=="string"?i.maxDepth:void 0,limit:typeof i.limit=="string"?i.limit:void 0,after:typeof i.after=="string"?i.after:void 0,direction:typeof i.direction=="string"?i.direction:void 0,maxPaths:typeof i.maxPaths=="string"?i.maxPaths:void 0,sample:typeof i.sample=="string"?i.sample:void 0,...Array.isArray(i.exemptIsolate)?{exemptIsolate:i.exemptIsolate}:{},...Array.isArray(i.exemptIsolateType)?{exemptIsolateType:i.exemptIsolateType}:{},saveBaseline:i.saveBaseline===!0,rebuild:i.rebuild===!0,clear:i.clear===!0,summary:i.summary===!0,full:i.full===!0},n);f(l,n),n.profile&&m(`profile:command=graph took_ms=${Date.now()-r}`)}function At(e,t){let o=t?.commandFilter,i=n=>ye(n,o),a=[{name:"list",description:"List active items with optional lifecycle-status and project filters.",excludeTerminal:!0,allowStatusFilter:!0},{name:"list-all",description:"List all items with optional filters.",excludeTerminal:!1,allowStatusFilter:!0},{name:"list-draft",description:"List draft items with optional filters.",status:"draft"},{name:"list-open",description:"List open items with optional filters.",status:"open",excludeTerminal:!1,allowStatusFilter:!1},{name:"list-in-progress",description:"List in-progress items with optional filters.",status:"in_progress",excludeTerminal:!1,allowStatusFilter:!1},{name:"list-blocked",description:"List blocked items (blocked status or open blocked_by dependencies, matching pm next) with optional filters.",dependencyBlocked:!0,excludeTerminal:!1,allowStatusFilter:!1},{name:"list-closed",description:"List closed items with optional filters.",status:"closed"},{name:"list-canceled",description:"List canceled items with optional filters.",status:"canceled"}];for(let n of a)if(i(n.name)){let r=E(n.name);ke(e,{...n,...r?.registration==="commander"?{aliasContract:r}:{}})}if(i("aggregate")){let n=e.command("aggregate").description("Group item counts and numeric measures.").option("--set-mode <value>","Set grouping: element (default)|tuple").option("--limit <value>","Group page size (default: 50)").option("--after <value>","Continue with next_after cursor").option("--group-by <value>","Fields: parent,type,priority,status,assignee,tags,sprint,release (comma-separated)").option("--count","Counts (default)").option("--completion","Status counts and completion_pct").option("--sum <field>","Group numeric sum").option("--avg <field>","Group numeric average").option("--include-unparented","Keep unparented group").option("--status <value>","Item status").option("--type <value>","Item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Latest deadline (ISO/date or relative)").option("--deadline-after <value>","Earliest deadline (ISO/date or relative)").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Assignee presence: assigned|unassigned").option("--parent <value>","Parent ID").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release");d(n,"--include_unparented","Alias for --include-unparented"),d(n,"--assignee_filter <value>","Alias for --assignee-filter"),n.action(Se)}if(i("context")){let n=e.command("context").alias("ctx").description("Show a token-efficient project context snapshot for next-work decisions.").option("--for <intent>",`Apply a declared context intent projection. ${g("context","--for")}`).option("--date <value>","Anchor date/time for agenda window calculations (ISO/date string or relative)").option("--from <value>","Agenda lower bound (ISO/date string or relative)").option("--to <value>","Agenda upper bound (ISO/date string or relative)").option("--past","Include past agenda entries in bounded windows").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <id>","Scope the snapshot to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit focus and agenda rows per section").option("--after <cursor>","Continue ranked focus after a next_cursor from a previous context response").option("--format <value>","Context output format override: markdown|toon|json|ndjson").option("--depth <value>","Context depth: brief|standard|deep|full (full = every section, no per-section cap)").option("--section <value...>","Include specific sections (repeatable; overrides --depth)").option("--fields <value>","Project focus rows to a comma-separated field subset (e.g. id,title,priority)").option("--activity-limit <n>","Limit recent activity entries (default: settings or 10)").option("--stale-threshold <value>","Staleness cutoff in days (e.g. 7 or 7d; default: settings or 7)").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked candidate ids").option("--token-budget <n>","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");d(n,"--assignee_filter <value>","Alias for --assignee-filter"),d(n,"--max-items <n>","Alias for --limit"),d(n,"--explain_ranking","Alias for --explain-ranking"),d(n,"--token_budget <n>","Alias for --token-budget"),n.action(_e)}if(i("next")){let n=e.command("next").description("Recommend the next actionable (unblocked, ready) work item with rationale + blocked companion.").option("--for <intent>",`Apply a declared context intent projection. ${g("next","--for")}`).option("--type <value>","Filter candidate items by type").option("--tag <value>","Filter candidate items by tag").option("--priority <value>","Filter candidate items by priority").option("--assignee <value>","Filter candidate items by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter candidate items by sprint").option("--release <value>","Filter candidate items by release").option("--parent <id>","Scope to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit ready rows (default: 5; non-positive falls back to default)").option("--blocked-limit <n>","Limit blocked rows (default: same as --limit)").option("--ready-only","Omit the blocked companion list").option("--include-decisions","Include human-gated Decision items in the claimable ready queue").option("--include-gates","Include outcome gates in the ready queue").option("--include-containers","Include containers with unfinished descendants in the ready queue").option("--format <value>","Next output format override: markdown|toon|json").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked ready ids").option("--token-budget <n>","Maximum estimated tokens spent on the ranked ready queue");d(n,"--assignee_filter <value>","Alias for --assignee-filter"),d(n,"--blocked_limit <n>","Alias for --blocked-limit"),d(n,"--ready_only","Alias for --ready-only"),d(n,"--explain_ranking","Alias for --explain-ranking"),d(n,"--token_budget <n>","Alias for --token-budget"),n.action(Ie)}if(i("search")){let n=e.command("search").argument("<keywords...>","Keyword query tokens").description("Search items with keyword, semantic, or hybrid retrieval. Inline field:value tokens (tag:/status:/type:/priority:) in the query are parsed as filters, e.g. 'auth tag:area:search status:open'.").option("--for <intent>",`Apply a declared context intent projection. ${g("search","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--mode <value>","Search mode: keyword|semantic|hybrid (default: auto)").option("--semantic","Shorthand for --mode semantic").option("--hybrid","Shorthand for --mode hybrid").option("--match-mode <value>","Token match mode: and|or|exact (default: or with all-terms ranking bonus; and = hard-require every token; exact = exact phrase)").option("--min-score <value>","Per-query minimum score threshold (finite number >= 0); overrides settings search.score_threshold for this query only").option("--count","Return only the count of matching items (post-filter/threshold, pre-limit); skips hit rows").option("--semantic-weight <value>","Override hybrid semantic weight for this query (0..1); invalid values fall back to settings").option("--include-linked","Include linked files, docs, and tests in the searchable corpus").option("--title-exact","Require exact normalized title match for the full query string").option("--phrase-exact","Require exact normalized phrase match in searchable text").option("--highlight","Emit per-field matched-text snippets (wrapped in \xAB\u2026\xBB) on each hit; off by default").option("--status <value>","Filter by status before query (all, open/closed/canceled aliases, or configured status id; CSV)").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Filter by deadline upper bound (ISO/date string or relative)").option("--deadline-after <value>","Filter by deadline lower bound (ISO/date string or relative)").option("--updated-after <value>",'Filter by updated_at lower bound: ISO timestamp or signed relative (e.g. "-2h"/"-7d" for the past)').option("--updated-before <value>","Filter by updated_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-after <value>","Filter by created_at lower bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-before <value>","Filter by created_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--assignee <value>","Filter by assignee").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <value>","Filter by parent item ID").option("--compact","Render compact search hits (default; mutually exclusive with --full/--fields)").option("--full","Render full search hits with nested item payloads (mutually exclusive with --compact/--fields)").option("--fields <value>",`Render custom comma-separated search hit fields (mutually exclusive with --compact/--full). ${g("search","--fields")}`).option("--format <value>","Search output format override: json|ndjson|toon").option("--limit <n>","Limit returned item count").option("--after <cursor>","Continue after an opaque next_cursor from a previous search response");ue(n),n.action(Ae),d(n,"--tags <value>","Alias for --tag"),d(n,"--token_budget <n>","Alias for --token-budget")}if(i("eval")&&e.command("eval").description("Evaluate search relevance against a curated golden-query set: reports nDCG@k, MRR@k, precision@k, and recall@k per query plus the macro average. Use --fail-under as a CI gate.").option("--mode <value>","Default retrieval mode for queries without their own: keyword|semantic|hybrid (default: keyword)").option("--k <n>","Metric cutoff @k (positive integer; default: 10)").option("--fail-under <value>","Exit non-zero when aggregate nDCG@k falls below this threshold (0..1); CI gate").option("--queries <path>",`Query JSON (${ie}); default: search/eval-queries.json; errors show an example`).option("--format <value>","Eval output format override: json|toon").action(Fe),i("get")){let n=e.command("get").argument("<id>","Item id").option("--for <intent>",`Apply a declared context intent projection. ${g("get","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--depth <value>","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(De);d(n,"--tree_depth <n>","Alias for --tree-depth"),d(n,"--token_budget <n>","Alias for --token-budget")}if(i("history")){let n=e.command("history").enablePositionalOptions().argument("<id>","Item id").option("--limit <n>","Latest n entries").option("--compact","Index, time, op, author, patch count, fields").option("--full","Full entries with JSON Patches").option("--provenance","Authors and provenance; no patches").option("--provenance-summary","Count provenance completeness").option("--harness <value>","Recorded/resolved harness (repeatable)",s).option("--agent-instance <value>","Agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Exact provenance match (repeatable)",s).option("--diff","Before/after field diffs").option("--field <name>","Filter changed field; implies --diff").option("--verify","Verify full chain and replay").option("--strict-exit","With --verify, fail on integrity errors").option("--fail-on-warn","Alias for --strict-exit").option("--format <value>","Output: json|toon").description("Show item history entries.").action(Ee);de(n,!0),D(n.command("activity"))}i("events")&&e.command("events").option("--since <cursor-or-timestamp>","Resume strictly after a durable cursor, or include events from an ISO timestamp").option("--type <value>","Filter by mutation operation (repeatable or comma-separated)",s).option("--author <value>","Filter by mutation author (repeatable or comma-separated)",s).option("--item <value>","Filter by item or workspace stream id (repeatable or comma-separated)",s).option("--limit <n>","Return at most 1,000 events (default: 100)").option("--cursor-mode <mode>","Cursor framing: batch emits one terminal trailer (default); row preserves one cursor per event").option("--full","Include each complete authoritative history entry").option("--provenance","Include patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include bounded provenance completeness counts").option("--harness <value>","Filter by recorded or vocabulary-resolved harness (repeatable)",s).option("--agent-instance <value>","Filter by privacy-safe agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter by an exact declared provenance value (repeatable)",s).option("--follow","Continue emitting committed events as newline-delimited JSON").option("--interval-ms <n>","Empty-read delay while following (minimum: 10ms; default: 250ms)").description("Emit cursor-resumable committed mutation facts as newline-delimited JSON.").action(Te),i("activity")&&D(e.command("activity",{hidden:!0})),i("graph")&&e.command("graph").argument("<subcommand>","Graph query (ancestors, descendants, predecessors, successors, paths, impact, analyze, audit, communities, redundancy, dominators, slack, centrality, articulation, plan, index)").argument("[id]","Root item id (traversals, paths, impact, and dominators)").argument("[target]","Target item id (paths only)").option("--kind <value>","Restrict traversal to registered relationship kinds (repeatable or comma-separated)",s).option("--max-depth <value>","Maximum traversal depth (non-negative integer)").option("--limit <value>","Maximum returned rows per bounded collection").option("--after <value>","Resume a traversal after this previously returned node id").option("--direction <value>","Edge orientation for paths/impact (outgoing, incoming, or both)").option("--max-paths <value>","Maximum enumerated paths (paths only)").option("--sample <value>","Maximum evidence sample entries per audit finding (audit only)").option("--exempt-isolate <value>","Item ids treated as explicitly valid isolates by the audit (repeatable or comma-separated)",s).option("--exempt-isolate-type <value>","Item types whose active isolates are policy-valid for the audit (repeatable or comma-separated)",s).option("--save-baseline","Persist the audit census as the change-since-baseline comparison point (audit only)").option("--rebuild","Rebuild and warm the durable graph index (index only)").option("--clear","Delete the durable graph index (index only)").option("--summary","Return counts-first envelopes without row collections").option("--full","Return the complete graph row projection").description("Bounded workspace relationship-graph queries, analytics, and governance audit.").action(Re)}var Ft={resolveReadCommandOutputFormat:_,parseListFormat:ce};export{Ft as _testOnlyRegisterListQuery,At as registerListQueryCommands};
|
|
11
|
+
//# sourceMappingURL=register-list-query-2YOWMNWY.js.map
|