@unbrained/pm-cli 2026.10.2 → 2026.10.3
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 +15 -0
- package/dist/cli-bundle/bundle-manifest.json +99 -99
- package/dist/cli-bundle/chunks/{chunk-R4TUD355.js → chunk-3AF2R3Y6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TRYXVQ7W.js → chunk-44UGMMQ6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XOUBIF6Z.js → chunk-5XKF5SQV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WP6NRH72.js → chunk-6ST3SCQ6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CZLAWXDR.js → chunk-6Z4IV2MC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MTJMOI4I.js → chunk-FW5LJXQY.js} +31 -31
- package/dist/cli-bundle/chunks/{chunk-7FUEQOYG.js → chunk-H2DZW6I6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7NL3A2BY.js → chunk-H7CXQBGQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZI7F3FVE.js → chunk-KP7NBQK3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SV7CZEVV.js → chunk-MKXBCBAN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-R7ULWMBG.js → chunk-QPKQKSQU.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-HY6M34B4.js → chunk-YCBGZF3T.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Z2GYDSAO.js → chunk-YDWKGUQU.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-R4PHNB7W.js → register-list-query-DYCGUQEW.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-PDDAUDYV.js → register-mutation-5PT3NW3A.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-A5HJT46K.js → register-operations-QDDQOAAV.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-EZ2F25JI.js → register-setup-BBX67YMA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BLCTBSGT.js → chunk-73DA7ISY.js} +26 -26
- package/dist/cli-bundle/focused-chunks/{chunk-GBD4EN6S.js → chunk-HIA2ZF64.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-IR4UXLRP.js → chunk-WAJNX4RN.js} +2 -2
- package/dist/cli-bundle/main.js +2 -2
- package/dist/cli-bundle/sdk-core.js +31 -31
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +20 -20
- 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 +1 -1
- package/dist/core/shared/secret-rules.js +1 -1
- package/dist/sdk/linked-artifacts.d.ts +1 -1
- package/dist/sdk/linked-artifacts.js +1 -1
- package/dist/sdk/test/execution.js +2 -2
- package/dist/sdk/test/workspace-snapshot.d.ts +11 -0
- package/dist/sdk/test/workspace-snapshot.js +2 -0
- package/docs/DEVELOPMENT_DEPENDENCY_SECURITY.md +109 -0
- package/docs/TESTING.md +32 -5
- package/marketplace.json +2 -2
- package/package.json +5 -4
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +2 -2
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +2 -2
- package/plugins/pm-codex/plugin.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as k,c as I,d as A,e as _,k as T,m as C}from"./chunk-
|
|
1
|
+
import{a as k,c as I,d as A,e as _,k as T,m as C}from"./chunk-3AF2R3Y6.js";import{Db as b,Eb as v,Fb as R}from"./chunk-MKXBCBAN.js";import{Gc as E,Gn as H,Jf as D,Mf as m,Nf as y,Qo as f,To as g,Uo as a,Yl as x,lp as w,na as c,pa as p}from"./chunk-QPKQKSQU.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="631e56aa-4d7e-58b6-bbea-a0d320716b82")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="0bcdd63c-5fd3-585d-a6c5-9393029ef864")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="4dce4f19-071c-54a8-be0d-5975d9e3b34b")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="f330a0c5-a967-5383-9c27-efa4a39e0f0d")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="420952ed-9a04-55dd-bcb8-804d81582002")}catch{}})();function B(t,e){if(typeof t!="string")return;let o=Number.parseInt(t,10);if(!/^\d+$/.test(t.trim())||!Number.isSafeInteger(o))throw new p(`history-compact ${e} must be a non-negative integer.`,c.USAGE);return o}async function O(t,e,o){let r=f(o),n=Date.now(),i=await x(a(e,"ids")),l=i===void 0?void 0:H(i),d=B(e.allOver,"--all-over"),u=B(e.minEntries,"--min-entries");if(e.closed===!0&&e.allStreams===!0)throw new p("history-compact: --closed and --all-streams are mutually exclusive; pick one lifecycle scope.",c.USAGE);let s=e.closed===!0?"closed":e.allStreams===!0?"all-streams":void 0;if((l!==void 0||d!==void 0||s!==void 0)&&typeof e.before=="string")throw new p("history-compact: --before applies only in single-id mode (bulk mode always compacts full streams).",c.USAGE);if(I(t,{ids:l,allOver:d,scope:s}),t!==void 0&&u!==void 0)throw new p("history-compact: --min-entries applies only in bulk mode (single-id mode compacts the named stream).",c.USAGE);if(t===void 0){let h=await A({ids:l,scope:s,allOver:d,minEntries:u,dryRun:e.dryRun===!0,author:a(e,"author"),message:a(e,"message"),force:!!e.force},r);m(h,r),h.totals.items_errored>0&&(process.exitCode=c.GENERIC_FAILURE)}else{let h=await k(t,{before:a(e,"before"),dryRun:e.dryRun===!0,author:a(e,"author"),message:a(e,"message"),force:!!e.force},r);m(h,r)}r.profile&&y(`profile:command=history-compact took_ms=${Date.now()-n}`)}async function S(t,e,o,r){let n=f(r),i=Date.now(),l=await C(t,e,{author:a(o,"author"),message:a(o,"message"),force:!!o.force},n);await w(n,l),m(l,n),n.profile&&y(`profile:command=restore took_ms=${Date.now()-i}`)}async function N(t,e){let o=f(e),r=await T({verify:a(t,"verify"),output:a(t,"output"),hashAlgorithm:a(t,"hashAlgorithm")},o);"format"in r?(E(r),o.quiet||D(`${JSON.stringify(r,null,2)}
|
|
2
2
|
`)):m(r,o),"ok"in r&&!r.ok&&(process.exitCode=c.GENERIC_FAILURE)}function ee(t,e){t.command(e?"attest":"history-attest",{hidden:!e}).summary("Export or verify history proof.").option("--verify <file>","Compare retained streams with a detached JSON proof").option("--output <file>","Create a proof file and return a compact receipt").option("--hash-algorithm <name>","Bundle digest algorithm: sha256 (default) or sha512").description("Export exact-byte history commitments, or verify an independently retained proof without tracker writes.").action(N),t.command("restore",{hidden:!e}).summary("Restore a version.").argument("<id>","Item id").argument("<target>","Restore target timestamp or version number").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership/lock override").description("Restore an item to an earlier timestamp or version.").action(S),t.command(e?"redact":"history-redact",{hidden:!e}).summary("Redact sensitive values.").argument("<id>","Item id").option("--literal <value>","Literal string to redact (repeatable)",g).option("--regex <value>","Regex pattern to redact (repeatable; accepts /pattern/flags or raw pattern)",g).option("--replacement <value>",'Replacement string (default: "[redacted]")').option("--dry-run","Preview redaction impact without writing item/history files").option("--author <value>","Mutation author").option("--message <value>","Audit history message for the redaction marker entry").option("--force","Force ownership/lock override").description("Redact sensitive literals/patterns from an item history stream and recompute hashes.").action(async(o,r,n)=>{let i=f(n),l=Date.now(),d=Array.isArray(r.literal)?r.literal:void 0,u=Array.isArray(r.regex)?r.regex:void 0,s=await _(o,{literal:d,regex:u,replacement:a(r,"replacement"),dryRun:r.dryRun===!0,author:a(r,"author"),message:a(r,"message"),force:!!r.force},i);s.changed&&!s.dry_run&&await w(i,s),m(s,i),i.profile&&y(`profile:command=history-redact took_ms=${Date.now()-l}`)}),t.command(e?"repair":"history-repair",{hidden:!e}).summary("Repair drift.").argument("[id]","Item id (omit with --all)").option("--salvage-tail","Recover invalid tail; requires verified prefix").option("--all","Scan every stream for drift and repair each drifted stream in one audited pass").option("--dry-run","Preview the re-anchor impact without writing the history file").option("--normalize-provenance","Remove invalid provenance; return aggregate-only evidence").option("--author <value>","Mutation author").option("--message <value>","Audit history message for the repair marker entry").option("--force","Force ownership/lock override").description("Re-anchor a drifted item history chain (recompute hashes, reconcile with the on-disk item) and record an audit marker. Use --all to repair every drifted stream.").action(async(o,r,n)=>{let i=f(n),l=Date.now(),d=r.all===!0;v(o,d);let u={dryRun:r.dryRun===!0,author:a(r,"author"),message:a(r,"message"),force:!!r.force,normalizeProvenance:r.normalizeProvenance===!0,salvageTail:r.salvageTail===!0};if(d){let s=await R(u,i);m(s,i),s.totals.failed>0&&(process.exitCode=c.GENERIC_FAILURE)}else{let s=await b(o,u,i);m(s,i)}i.profile&&y(`profile:command=history-repair took_ms=${Date.now()-l}`)}),t.command(e?"compact":"history-compact",{hidden:!e}).summary("Compact streams.").argument("[id]","Item id (omit when using a bulk selector)").option("--before <value>","Compact entries strictly before this version number or ISO timestamp (single-id mode only)").option("--ids <value>","Bulk IDs: comma/newline text, - stdin, or @path file").option("--all-over <n>","Bulk: compact every stream with more than N entries").option("--closed","Bulk: compact only closed (terminal) items' streams").option("--all-streams","Bulk: compact every history stream regardless of lifecycle state").option("--min-entries <n>","Bulk: skip streams with at most N entries (already compact; default 3)").option("--dry-run","Preview compaction impact without writing the history file").option("--author <value>","Mutation author").option("--message <value>","Audit history message for the compaction marker entry").option("--force","Force ownership/lock override").description("Compact item history streams into a synthetic baseline plus retained tail entries. Pass an item id for one stream, or a bulk selector (--ids/--all-over/--closed/--all-streams) to compact many.").action(O)}export{ee as a};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-H2DZW6I6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$c as _,Jf as $,Wc as w,Xc as S,Yc as L,Zc as A,_c as b,cd as M,cf as F,df as D,dh as B,eh as v,g as P,gl as y,h as m,hf as V,j as E,k as N,na as p,pa as h,vb as I}from"./chunk-R7ULWMBG.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]="59132bc6-2d45-5049-981f-fadcf0c75091")}catch{}})();function Ge(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]="bdf3dec8-63d1-5ea6-a413-64be0ae8f69f")}catch{}})();function je(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 Ke(e){return typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="string"&&e.code.startsWith("commander.")}function Ye(e,t){if(e instanceof Error)return e;let n=new Error(t),o=ee(e);return o!==void 0&&(n.exitCode=te(o)),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]="e1db7644-e481-5049-a773-fcffa09f1779")}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,n){let o=R.has(n)?t+1:void 0,i=b(e.slice(t+1));if(i===void 0)return o;let s=t+1+i,a=`${n} ${e[s]}`,r=m(a);return r===a?n==="item"&&e[s]==="complete"?s+1:o:G(r)?O(e,s,r):void 0}function O(e,t,n){if(["history","context","ctx","update","close","item"].includes(n))return oe(e,t,n);let o=z.get(n);if(o===void 0)return t+1;let i=e[t+1]?.toLowerCase()===o;return t+(i?2:1)}function ie(e){let t=new Map;for(let n of y(e))for(let o of[n.flag,n.short,...n.aliases??[]])o&&t.set(o,n);return t}function se(e){let t=[];for(let n=0;n<e.length;n+=1){let o=e[n];if(o==="--")break;o==="--id"?(t.push({index:n,consumed:2,value:e[n+1]}),n+=1):o.startsWith("--id=")&&t.push({index:n,consumed:1,value:o.slice(5)})}return t}function re(e,t,n){if(e.indexOf("=")>=0||t===void 0||t.startsWith("-"))return!1;let i=n.get(e);return i!==void 0&&i.value_type!=="boolean"}function ae(e,t,n,o,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<o)return!0;s+=1;continue}re(r,e[a+1],i)&&(a+=1)}}return s>(ne.get(m(n))??0)}function W(e){let t=b(e),n=t===void 0?void 0:e[t]?.toLowerCase();if(n!=="context"&&n!=="ctx"&&!G(n))return{argv:[...e],changed:!1,conflict:!1};let o=O(e,t,n);if(o===void 0)return{argv:[...e],changed:!1,conflict:!1};let i=o>t+1?`${m(e.slice(t,o-1).join(" "))} ${e[o-1]}`:n,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,o,i,r.index,s))return{argv:[...e],changed:!1,conflict:!0,itemId:r.value};let c=[...e.slice(0,r.index),...e.slice(r.index+r.consumed)],l=b(c),u=O(c,l,n);return c.splice(u,0,r.value),{argv:c,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]="8ef3b254-0494-57bc-8bbf-8ee58eb7d152")}catch{}})();var ce=new Set(["--output-include","--output-limit","--output-budget","--output-format","--output-session","--output-cursor"]);function le(e,t,n){let o=e[t];if(S.has(o))return n.booleanFlags.add(o),1;let i=o.indexOf("="),s=i>0?o.slice(0,i):o;if(!w.has(s))return 1;let a=i>0?o.slice(i+1):void 0,r=a===void 0&&A(s,e[t+1]),c=a??(r?e[t+1]:void 0);return s==="--author"?n.author=c??"":typeof c=="string"&&c.length>0&&(ce.has(s)?n.outputValues:n.pathValues).set(s,c),r?2:1}function ue(e){let t={booleanFlags:new Set,outputValues:new Map,pathValues:new Map},n=0;for(;n<e.length&&e[n]!=="--";)n+=le(e,n,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"),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")},...t.outputValues.get("--output-format")==="toon"||t.outputValues.get("--output-format")==="json"?{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 j(e){let t=[],n=0;for(;n<e.length;){let o=e[n];if(o==="--")break;if(S.has(o)||o==="--profile"||o==="--id-only"||o==="--full-changed-fields"||o==="--explain"){n+=1;continue}if(w.has(o)){n+=A(o,e[n+1])?2:1;continue}if(L(o)){n+=1;continue}t.push(o),n+=1}return t}function de(e){let t=j(e);if(t[0]?.trim().toLowerCase()==="help"){let s=[];for(let a=1;a<t.length;a+=1){let r=t[a];if(r.startsWith("-"))break;s.push(r.trim().toLowerCase())}return{requested:!0,commandPathTokens:s}}if(t.findIndex(s=>s==="--help"||s==="-h")<0)return{requested:!1,commandPathTokens:[]};let i=[];for(let s of t){if(s.startsWith("-"))break;i.push(s.trim().toLowerCase())}return{requested:!0,commandPathTokens:i}}function C(e){return b(e)}function fe(e){return _(e)}function pe(e,t){return t.noPager?!0:process.stdout.isTTY===!0?!1:de(e).requested}function ut(e){let t=["PAGER","MANPAGER","GIT_PAGER","LESS"],n=t.map(s=>process.env[s]),o=()=>{for(let[s,a]of t.entries()){let r=n[s];r===void 0?delete process.env[a]:process.env[a]=r}},i=ue(e);return pe(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")),o}var me=new Set(["install","uninstall","explore","manage","doctor","adopt","adopt-all","activate","deactivate"]);function he(e){let t=C(e);if(t===void 0||e[t]!=="extension")return[...e];let n=e[t+1];if(!n||n.startsWith("-"))return[...e];if(!me.has(n))return[...e];if(e.includes("--help")||e.includes("-h"))return[...e];let o=`--${n}`;return e.includes(o)?[...e]:[...e.slice(0,t+1),o,...e.slice(t+2)]}var ge=new Set(["pm","pm-cli"]);function be(e,t){let n=C(e);if(n===void 0)return e;let o=e[n];return ge.has(o.trim().toLowerCase())?(t.push({from:o,to:[],reason:"executable_alias",confidence:"high"}),[...e.slice(0,n),...e.slice(n+1)]):e}function ye(e,t){let n=C(e);if(n!==void 0&&e[n]==="help"){let r=C(e.slice(n+1));n=r===void 0?void 0:n+1+r}if(n===void 0)return e;let o=e[n],i=N[o.trim().toLowerCase()];if(!i)return e;let s=i.split(" "),a=[...e.slice(0,n),...s,...e.slice(n+1)];return t.push({from:o,to:s,reason:"command_alias",confidence:"high"}),a}function k(e){return e.replace(/^--?/,"").replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function U(e){return k(e).replace(/-/g,"")}function q(e,t,n){let o=e.get(t);if(o===void 0){e.set(t,n);return}o!==n&&e.set(t,null)}function we(e){let t=[],n=o=>{typeof o=="string"&&o.startsWith("--")&&t.push(o)};n(e.flag);for(let o of e.aliases??[])n(o);return t}function Ie(e,t){let n=t??y(e),o=new Map,i=new Map,s=new Map,a=new Set;for(let r of n){let c=we(r);if(c.length===0)continue;let l=`--${k(c[0])}`;for(let d of c)q(o,k(d),l),q(i,U(d),l);let u=U(l);s.has(l)||s.set(l,u),r.list===!0&&a.add(l)}return{canonicalByNormalized:o,canonicalByCompact:i,canonicalComparables:[...s.entries()].map(([r,c])=>({canonicalFlag:r,comparable:c})),listCanonicalFlags:a}}function K(e,t){let n=k(e),o=t.canonicalByNormalized.get(n);if(typeof o=="string")return{flag:o,reason:"flag_alias",confidence:"high"};let i=n.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,c,l=!1;for(let u of t.canonicalComparables){let d=I(i,u.comparable,a);if(d!==null){if(d<r){r=d,c=u.canonicalFlag,l=!1;continue}d===r&&c!==u.canonicalFlag&&(l=!0)}}return!c||l||!Number.isFinite(r)||r<=0?null:{flag:c,reason:"flag_typo",confidence:r>=2?"medium":"high"}}function dt(e){let t=[`${e}s`];return e.endsWith("y")&&e.length>1&&t.push(`${e.slice(0,-1)}ies`),t}function _e(e,t=!1){if(t||e.includes("://"))return null;let n=e.match(/^([A-Za-z][A-Za-z0-9_-]{1,63})([:=])(.*)$/);if(!n)return null;let o=n[1],i=n[3];return i.length===0?null:{key:o,value:i}}function ve(e,t,n=!1){if(n||!e.startsWith("--"))return{tokens:[e]};let o=e.indexOf("="),i=o>=0?e.slice(0,o):e,s=o>=0?e.slice(o+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 Ce(e){let t=new Set,n=!1;for(let o=0;o<e.length;o+=1){if(n){t.add(o),n=!1;continue}let i=e[o];n=i==="--path"||i==="--pm-path"}return t}function ke(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 xe(e,t,n){n.push(e[t]);let o=e[t+1];return typeof o=="string"&&o!=="--"?(n.push(o),t+2):t+1}function Te(e,t,n,o){if(n.inlineValue!==void 0)return{originalTokens:[e[t]],value:n.inlineValue,consumed:1};let i=[],s=t+1;for(;s<e.length&&e[s]!=="--"&&!e[s].startsWith("-")&&(i.length===0||o.has(n.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 Ee(e,t,n,o){let i=e.get(n);if(i){i.values.push(o.value),i.occurrences+=1;return}e.set(n,{outputIndex:t.length,originalTokens:o.originalTokens,values:[o.value],occurrences:1}),t.push(null)}function Se(e,t){let n=[],o=[];for(let[i,s]of e){if(!(s.occurrences>=2||t.has(i)&&s.originalTokens.length>2)){o.push({outputIndex:s.outputIndex,tokens:s.originalTokens});continue}let r=`${i}=${s.values.join(",")}`;o.push({outputIndex:s.outputIndex,tokens:[r]}),n.push({from:`${i} (x${s.occurrences})`,to:[r],reason:"list_merge",confidence:"high"})}return{events:n,splices:o}}function Ae(e,t){t.sort((n,o)=>o.outputIndex-n.outputIndex);for(let n of t)e.splice(n.outputIndex,1,...n.tokens)}function Oe(e,t,n=new Set,o=new Set){if(t.size===0)return{argv:[...e],events:[]};let i=[],s=new Map,a=0;for(;a<e.length;){let l=e[a];if(l==="--"){i.push(...e.slice(a));break}if(n.has(l)){a=xe(e,a,i);continue}let u=ke(l);if(!u||!t.has(u.flag)){i.push(l),a+=1;continue}let d=Te(e,a,u,o);if(d.value===void 0){i.push(l),a+=d.consumed;continue}Ee(s,i,u.flag,{originalTokens:d.originalTokens,value:d.value}),a+=d.consumed}let{events:r,splices:c}=Se(s,o);return Ae(i,c),{argv:i,events:r}}var Y=new Map([["--add",new Set(["command","cmd","path"])],["--remove",new Set(["command","path"])]]);function Pe(e,t){if(e!=="test"||t.length<2)return!1;let n=t[t.length-1],o=t[t.length-2],i=Y.get(o);return i!==void 0&&i.has(n)}function Ne(e,t){return e==="search"||Pe(e,t)}function Le(e,t,n){if(t!=="test")return e;let o=[],i=0;for(;i<e.length;){let s=e[i];if(s==="--")return o.push(...e.slice(i)),o;let a=Y.get(s),r=a?e[i+1]:void 0;if(!a||typeof r!="string"||!a.has(r)){o.push(s),i+=1;continue}let c=i+2;for(;c<e.length&&!e[c].startsWith("-");)c+=1;if(c-(i+2)!==1){o.push(s),i+=1;continue}let l=e[i+2],u=`${r}=${l}`;o.push(s,u),n.push({from:`${s} ${r} ${l}`,to:[s,u],reason:"bare_key_value",confidence:"high"}),i+=3}return o}function Me(e,t,n,o){let i=[],s=Ce(e);for(let a=0;a<e.length;a+=1){let r=e[a];if(r==="--"){i.push(...e.slice(a));break}let c=s.has(a),l=i[i.length-1];if(r.startsWith("--")){let d=ve(r,t,c);i.push(...d.tokens),d.event&&o.push(d.event);continue}let u=_e(r,c);if(u&&!(typeof l=="string"&&l.startsWith("-"))&&!Ne(n,i)){let d=K(u.key,t);if(d){let g=[d.flag,u.value];i.push(...g),o.push({from:r,to:g,reason:"bare_key_value",confidence:d.confidence});continue}}i.push(r)}return i}function Fe(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")break;if(n==="--verify"){let o=e[t+1];if(o===void 0||o==="--")throw new h("history attest --verify requires a bundle file.",p.USAGE);e.splice(t,2,`--verify=${o}`)}else(w.has(n)||n==="--output"||n==="--hash-algorithm")&&(t+=1)}}function ft(e){let t=[],n=be(e,t),o=he(n);(o.length!==n.length||o.some((T,J)=>T!==n[J]))&&t.push({from:n.join(" "),to:[...o],reason:"legacy_extension_action",confidence:"high"});let i=ye(o,t),s=W(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=fe(s.argv),r=X(s.argv),c=m(r??a??""),l=Ie(r??a),u=Me(s.argv,l,c,t),d=Le(u,c,t),g=Oe(d,l.listCanonicalFlags,w,a==="create"?new Set(["--tags"]):new Set);for(let T of g.events)t.push(T);return r==="history attest"&&Fe(g.argv),{argv:g.argv,commandName:a,trace:t}}function X(e){let t=j(e),n=t[0]?.trim().toLowerCase(),o=t[1]?.trim().toLowerCase(),i=P(t);return i?i.canonical:(n==="extension"||n==="package"||n==="packages")&&typeof o=="string"&&o.length>0&&!o.startsWith("-")?`${n} ${o}`:n}function pt(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")break;if(n==="--type"){let o=e[t+1];if(typeof o=="string"&&o.trim().length>0)return o.trim();continue}if(n.startsWith("--type=")){let o=n.slice(7).trim();if(o.length>0)return 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]="d22b586a-5c12-518e-b1ee-4baa0d04243b")}catch{}})();function yt(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 n=B();v(t);let o=!1;return()=>{o||(o=!0,n===void 0?v(void 0):v(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]="69117358-9878-589b-8918-e71599e6c7df")}catch{}})();var f=Object.freeze({clock:"PM_CLOCK",tickMs:"PM_CLOCK_TICK_MS",seed:"PM_SEED"});function x(e,t,n,o){return new h(e,p.USAGE,{code:"invalid_reproducible_process_environment",reason:t,field:n,required:`${f.clock} and ${f.seed}; ${f.tickMs} is optional`,nextSteps:[`Set ${f.clock} to an ISO-8601 instant with Z or a numeric UTC offset and ${f.seed} to a non-empty reproducibility seed.`,`Optionally set ${f.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:o,missing_required_fields:t==="incomplete"?[f.clock,f.seed].filter(i=>!o.includes(i)):void 0}})}function De(e){let t=e[f.clock],n=e[f.tickMs],o=e[f.seed],i=[[f.clock,t],[f.tickMs,n],[f.seed,o]].filter(a=>a[1]!==void 0).map(([a])=>a);if(i.length===0)return;if(t===void 0||o===void 0)throw x("Reproducible process execution requires PM_CLOCK and PM_SEED together.","incomplete",t===void 0?f.clock:f.seed,i);if(o.trim().length===0)throw x(`${f.seed} must not be empty.`,"invalid_value",f.seed,i);if(!V(t))throw x(`${f.clock} must be a valid ISO-8601 instant with Z or a numeric UTC offset.`,"invalid_value",f.clock,i);let s=n===void 0?1:Number(n);if(n?.trim().length===0||!Number.isSafeInteger(s)||s<0)throw x(`${f.tickMs} must be a non-negative integer.`,"invalid_value",f.tickMs,i);return F({clock:t,seed:o,tickMs:s})}function Ve(e){let t=De(e);return t===void 0?n=>n():D(t)}async function kt(e,t){return Ve(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]="4f7274c6-547e-5590-b7c9-a4d6418bf860")}catch{}})();function Z(e){return e.trim().match(/--[a-z0-9][a-z0-9_-]*/i)?.[0]?.replaceAll("_","-").toLowerCase()}function At(e){if(!(!Array.isArray(e)||e.length===0))return _(e)}function $e(e,t){let n=Z(t);if(!n)return;let o=y(e).find(i=>i.flag===n||i.aliases?.includes(n));return o?o.value_type==="boolean"?null:`<${o.value_name??"value"}>`:"<value>"}function Ot(e,t,n){let o=[...e],i=o.indexOf("--"),s=i<0?o.length:i;for(let a of n){let r=Z(a);if(!r||o.slice(0,s).some(u=>u===r||u.startsWith(`${r}=`)))continue;let c=$e(t,r),l=c?[r,c]:[r];o.splice(s,0,...l),s+=l.length}return o.length===e.length?void 0:M(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]="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]="925e5fec-4cc0-5315-a331-03cb128893f0")}catch{}})();var Be={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 n=e.trim().toLowerCase(),o=t.trim().toLowerCase();if(o.length===0)return Number.POSITIVE_INFINITY;let i=n.split(" "),s=Be[o]?.indexOf(m(n));if(s!==void 0&&s>=0)return s;if(n===o)return 10;if(i.includes(o))return 11;if(i.some(c=>c.startsWith(o)))return 12;let a=o.length>=5?2:1,r=Number.POSITIVE_INFINITY;for(let c of i){let l=I(c,o,a);l!==null&&(r=Math.min(r,l))}return Number.isFinite(r)?20+r:n.includes(o)?30:Number.POSITIVE_INFINITY}function Vt(e,t){return e.map(n=>({path:n,score:H(n,t)})).filter(n=>Number.isFinite(n.score)).sort((n,o)=>n.score!==o.score?n.score-o.score:n.path===o.path?0:n.path<o.path?-1:1).map(n=>n.path)}function $t(e,t,n){let o=new Set(t),i=E.filter(r=>r.lifecycle==="deprecated").slice().sort((r,c)=>c.alias.length-r.alias.length),s=[],a=e.flatMap(r=>{let c=i.find(u=>r===u.alias||r.startsWith(`${u.alias} `)),l=r;if(c){let u=r.slice(c.alias.length);if(!o.has(`${c.canonical}${u}`))return[];l=`${c.canonical_argv.join(" ")}${u}`}return n!==void 0&&H(r,n)<10&&s.push(l),[l]});return[...new Set(s.length>0?s:a)]}export{Ge as a,je as b,ee as c,te as d,Ke as e,Ye as f,G as g,W as h,ue as i,j,de as k,C as l,fe as m,ut as n,he as o,dt as p,Oe as q,Le as r,ft as s,pt as t,yt as u,f as v,De as w,Ve as x,kt as y,At as z,$e as A,Ot as B,H as C,Vt as D,$t as E};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{$c as _,Jf as $,Wc as w,Xc as S,Yc as L,Zc as A,_c as b,cd as M,cf as F,df as D,dh as B,eh as v,g as P,gl as y,h as m,hf as V,j as E,k as N,na as p,pa as h,vb as I}from"./chunk-QPKQKSQU.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]="59132bc6-2d45-5049-981f-fadcf0c75091")}catch{}})();function Ge(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]="bdf3dec8-63d1-5ea6-a413-64be0ae8f69f")}catch{}})();function je(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 Ke(e){return typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="string"&&e.code.startsWith("commander.")}function Ye(e,t){if(e instanceof Error)return e;let n=new Error(t),o=ee(e);return o!==void 0&&(n.exitCode=te(o)),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]="e1db7644-e481-5049-a773-fcffa09f1779")}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,n){let o=R.has(n)?t+1:void 0,i=b(e.slice(t+1));if(i===void 0)return o;let s=t+1+i,a=`${n} ${e[s]}`,r=m(a);return r===a?n==="item"&&e[s]==="complete"?s+1:o:G(r)?O(e,s,r):void 0}function O(e,t,n){if(["history","context","ctx","update","close","item"].includes(n))return oe(e,t,n);let o=z.get(n);if(o===void 0)return t+1;let i=e[t+1]?.toLowerCase()===o;return t+(i?2:1)}function ie(e){let t=new Map;for(let n of y(e))for(let o of[n.flag,n.short,...n.aliases??[]])o&&t.set(o,n);return t}function se(e){let t=[];for(let n=0;n<e.length;n+=1){let o=e[n];if(o==="--")break;o==="--id"?(t.push({index:n,consumed:2,value:e[n+1]}),n+=1):o.startsWith("--id=")&&t.push({index:n,consumed:1,value:o.slice(5)})}return t}function re(e,t,n){if(e.indexOf("=")>=0||t===void 0||t.startsWith("-"))return!1;let i=n.get(e);return i!==void 0&&i.value_type!=="boolean"}function ae(e,t,n,o,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<o)return!0;s+=1;continue}re(r,e[a+1],i)&&(a+=1)}}return s>(ne.get(m(n))??0)}function W(e){let t=b(e),n=t===void 0?void 0:e[t]?.toLowerCase();if(n!=="context"&&n!=="ctx"&&!G(n))return{argv:[...e],changed:!1,conflict:!1};let o=O(e,t,n);if(o===void 0)return{argv:[...e],changed:!1,conflict:!1};let i=o>t+1?`${m(e.slice(t,o-1).join(" "))} ${e[o-1]}`:n,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,o,i,r.index,s))return{argv:[...e],changed:!1,conflict:!0,itemId:r.value};let c=[...e.slice(0,r.index),...e.slice(r.index+r.consumed)],l=b(c),u=O(c,l,n);return c.splice(u,0,r.value),{argv:c,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]="8ef3b254-0494-57bc-8bbf-8ee58eb7d152")}catch{}})();var ce=new Set(["--output-include","--output-limit","--output-budget","--output-format","--output-session","--output-cursor"]);function le(e,t,n){let o=e[t];if(S.has(o))return n.booleanFlags.add(o),1;let i=o.indexOf("="),s=i>0?o.slice(0,i):o;if(!w.has(s))return 1;let a=i>0?o.slice(i+1):void 0,r=a===void 0&&A(s,e[t+1]),c=a??(r?e[t+1]:void 0);return s==="--author"?n.author=c??"":typeof c=="string"&&c.length>0&&(ce.has(s)?n.outputValues:n.pathValues).set(s,c),r?2:1}function ue(e){let t={booleanFlags:new Set,outputValues:new Map,pathValues:new Map},n=0;for(;n<e.length&&e[n]!=="--";)n+=le(e,n,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"),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")},...t.outputValues.get("--output-format")==="toon"||t.outputValues.get("--output-format")==="json"?{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 j(e){let t=[],n=0;for(;n<e.length;){let o=e[n];if(o==="--")break;if(S.has(o)||o==="--profile"||o==="--id-only"||o==="--full-changed-fields"||o==="--explain"){n+=1;continue}if(w.has(o)){n+=A(o,e[n+1])?2:1;continue}if(L(o)){n+=1;continue}t.push(o),n+=1}return t}function de(e){let t=j(e);if(t[0]?.trim().toLowerCase()==="help"){let s=[];for(let a=1;a<t.length;a+=1){let r=t[a];if(r.startsWith("-"))break;s.push(r.trim().toLowerCase())}return{requested:!0,commandPathTokens:s}}if(t.findIndex(s=>s==="--help"||s==="-h")<0)return{requested:!1,commandPathTokens:[]};let i=[];for(let s of t){if(s.startsWith("-"))break;i.push(s.trim().toLowerCase())}return{requested:!0,commandPathTokens:i}}function C(e){return b(e)}function fe(e){return _(e)}function pe(e,t){return t.noPager?!0:process.stdout.isTTY===!0?!1:de(e).requested}function ut(e){let t=["PAGER","MANPAGER","GIT_PAGER","LESS"],n=t.map(s=>process.env[s]),o=()=>{for(let[s,a]of t.entries()){let r=n[s];r===void 0?delete process.env[a]:process.env[a]=r}},i=ue(e);return pe(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")),o}var me=new Set(["install","uninstall","explore","manage","doctor","adopt","adopt-all","activate","deactivate"]);function he(e){let t=C(e);if(t===void 0||e[t]!=="extension")return[...e];let n=e[t+1];if(!n||n.startsWith("-"))return[...e];if(!me.has(n))return[...e];if(e.includes("--help")||e.includes("-h"))return[...e];let o=`--${n}`;return e.includes(o)?[...e]:[...e.slice(0,t+1),o,...e.slice(t+2)]}var ge=new Set(["pm","pm-cli"]);function be(e,t){let n=C(e);if(n===void 0)return e;let o=e[n];return ge.has(o.trim().toLowerCase())?(t.push({from:o,to:[],reason:"executable_alias",confidence:"high"}),[...e.slice(0,n),...e.slice(n+1)]):e}function ye(e,t){let n=C(e);if(n!==void 0&&e[n]==="help"){let r=C(e.slice(n+1));n=r===void 0?void 0:n+1+r}if(n===void 0)return e;let o=e[n],i=N[o.trim().toLowerCase()];if(!i)return e;let s=i.split(" "),a=[...e.slice(0,n),...s,...e.slice(n+1)];return t.push({from:o,to:s,reason:"command_alias",confidence:"high"}),a}function k(e){return e.replace(/^--?/,"").replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function U(e){return k(e).replace(/-/g,"")}function q(e,t,n){let o=e.get(t);if(o===void 0){e.set(t,n);return}o!==n&&e.set(t,null)}function we(e){let t=[],n=o=>{typeof o=="string"&&o.startsWith("--")&&t.push(o)};n(e.flag);for(let o of e.aliases??[])n(o);return t}function Ie(e,t){let n=t??y(e),o=new Map,i=new Map,s=new Map,a=new Set;for(let r of n){let c=we(r);if(c.length===0)continue;let l=`--${k(c[0])}`;for(let d of c)q(o,k(d),l),q(i,U(d),l);let u=U(l);s.has(l)||s.set(l,u),r.list===!0&&a.add(l)}return{canonicalByNormalized:o,canonicalByCompact:i,canonicalComparables:[...s.entries()].map(([r,c])=>({canonicalFlag:r,comparable:c})),listCanonicalFlags:a}}function K(e,t){let n=k(e),o=t.canonicalByNormalized.get(n);if(typeof o=="string")return{flag:o,reason:"flag_alias",confidence:"high"};let i=n.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,c,l=!1;for(let u of t.canonicalComparables){let d=I(i,u.comparable,a);if(d!==null){if(d<r){r=d,c=u.canonicalFlag,l=!1;continue}d===r&&c!==u.canonicalFlag&&(l=!0)}}return!c||l||!Number.isFinite(r)||r<=0?null:{flag:c,reason:"flag_typo",confidence:r>=2?"medium":"high"}}function dt(e){let t=[`${e}s`];return e.endsWith("y")&&e.length>1&&t.push(`${e.slice(0,-1)}ies`),t}function _e(e,t=!1){if(t||e.includes("://"))return null;let n=e.match(/^([A-Za-z][A-Za-z0-9_-]{1,63})([:=])(.*)$/);if(!n)return null;let o=n[1],i=n[3];return i.length===0?null:{key:o,value:i}}function ve(e,t,n=!1){if(n||!e.startsWith("--"))return{tokens:[e]};let o=e.indexOf("="),i=o>=0?e.slice(0,o):e,s=o>=0?e.slice(o+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 Ce(e){let t=new Set,n=!1;for(let o=0;o<e.length;o+=1){if(n){t.add(o),n=!1;continue}let i=e[o];n=i==="--path"||i==="--pm-path"}return t}function ke(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 xe(e,t,n){n.push(e[t]);let o=e[t+1];return typeof o=="string"&&o!=="--"?(n.push(o),t+2):t+1}function Te(e,t,n,o){if(n.inlineValue!==void 0)return{originalTokens:[e[t]],value:n.inlineValue,consumed:1};let i=[],s=t+1;for(;s<e.length&&e[s]!=="--"&&!e[s].startsWith("-")&&(i.length===0||o.has(n.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 Ee(e,t,n,o){let i=e.get(n);if(i){i.values.push(o.value),i.occurrences+=1;return}e.set(n,{outputIndex:t.length,originalTokens:o.originalTokens,values:[o.value],occurrences:1}),t.push(null)}function Se(e,t){let n=[],o=[];for(let[i,s]of e){if(!(s.occurrences>=2||t.has(i)&&s.originalTokens.length>2)){o.push({outputIndex:s.outputIndex,tokens:s.originalTokens});continue}let r=`${i}=${s.values.join(",")}`;o.push({outputIndex:s.outputIndex,tokens:[r]}),n.push({from:`${i} (x${s.occurrences})`,to:[r],reason:"list_merge",confidence:"high"})}return{events:n,splices:o}}function Ae(e,t){t.sort((n,o)=>o.outputIndex-n.outputIndex);for(let n of t)e.splice(n.outputIndex,1,...n.tokens)}function Oe(e,t,n=new Set,o=new Set){if(t.size===0)return{argv:[...e],events:[]};let i=[],s=new Map,a=0;for(;a<e.length;){let l=e[a];if(l==="--"){i.push(...e.slice(a));break}if(n.has(l)){a=xe(e,a,i);continue}let u=ke(l);if(!u||!t.has(u.flag)){i.push(l),a+=1;continue}let d=Te(e,a,u,o);if(d.value===void 0){i.push(l),a+=d.consumed;continue}Ee(s,i,u.flag,{originalTokens:d.originalTokens,value:d.value}),a+=d.consumed}let{events:r,splices:c}=Se(s,o);return Ae(i,c),{argv:i,events:r}}var Y=new Map([["--add",new Set(["command","cmd","path"])],["--remove",new Set(["command","path"])]]);function Pe(e,t){if(e!=="test"||t.length<2)return!1;let n=t[t.length-1],o=t[t.length-2],i=Y.get(o);return i!==void 0&&i.has(n)}function Ne(e,t){return e==="search"||Pe(e,t)}function Le(e,t,n){if(t!=="test")return e;let o=[],i=0;for(;i<e.length;){let s=e[i];if(s==="--")return o.push(...e.slice(i)),o;let a=Y.get(s),r=a?e[i+1]:void 0;if(!a||typeof r!="string"||!a.has(r)){o.push(s),i+=1;continue}let c=i+2;for(;c<e.length&&!e[c].startsWith("-");)c+=1;if(c-(i+2)!==1){o.push(s),i+=1;continue}let l=e[i+2],u=`${r}=${l}`;o.push(s,u),n.push({from:`${s} ${r} ${l}`,to:[s,u],reason:"bare_key_value",confidence:"high"}),i+=3}return o}function Me(e,t,n,o){let i=[],s=Ce(e);for(let a=0;a<e.length;a+=1){let r=e[a];if(r==="--"){i.push(...e.slice(a));break}let c=s.has(a),l=i[i.length-1];if(r.startsWith("--")){let d=ve(r,t,c);i.push(...d.tokens),d.event&&o.push(d.event);continue}let u=_e(r,c);if(u&&!(typeof l=="string"&&l.startsWith("-"))&&!Ne(n,i)){let d=K(u.key,t);if(d){let g=[d.flag,u.value];i.push(...g),o.push({from:r,to:g,reason:"bare_key_value",confidence:d.confidence});continue}}i.push(r)}return i}function Fe(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")break;if(n==="--verify"){let o=e[t+1];if(o===void 0||o==="--")throw new h("history attest --verify requires a bundle file.",p.USAGE);e.splice(t,2,`--verify=${o}`)}else(w.has(n)||n==="--output"||n==="--hash-algorithm")&&(t+=1)}}function ft(e){let t=[],n=be(e,t),o=he(n);(o.length!==n.length||o.some((T,J)=>T!==n[J]))&&t.push({from:n.join(" "),to:[...o],reason:"legacy_extension_action",confidence:"high"});let i=ye(o,t),s=W(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=fe(s.argv),r=X(s.argv),c=m(r??a??""),l=Ie(r??a),u=Me(s.argv,l,c,t),d=Le(u,c,t),g=Oe(d,l.listCanonicalFlags,w,a==="create"?new Set(["--tags"]):new Set);for(let T of g.events)t.push(T);return r==="history attest"&&Fe(g.argv),{argv:g.argv,commandName:a,trace:t}}function X(e){let t=j(e),n=t[0]?.trim().toLowerCase(),o=t[1]?.trim().toLowerCase(),i=P(t);return i?i.canonical:(n==="extension"||n==="package"||n==="packages")&&typeof o=="string"&&o.length>0&&!o.startsWith("-")?`${n} ${o}`:n}function pt(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")break;if(n==="--type"){let o=e[t+1];if(typeof o=="string"&&o.trim().length>0)return o.trim();continue}if(n.startsWith("--type=")){let o=n.slice(7).trim();if(o.length>0)return 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]="d22b586a-5c12-518e-b1ee-4baa0d04243b")}catch{}})();function yt(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 n=B();v(t);let o=!1;return()=>{o||(o=!0,n===void 0?v(void 0):v(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]="69117358-9878-589b-8918-e71599e6c7df")}catch{}})();var f=Object.freeze({clock:"PM_CLOCK",tickMs:"PM_CLOCK_TICK_MS",seed:"PM_SEED"});function x(e,t,n,o){return new h(e,p.USAGE,{code:"invalid_reproducible_process_environment",reason:t,field:n,required:`${f.clock} and ${f.seed}; ${f.tickMs} is optional`,nextSteps:[`Set ${f.clock} to an ISO-8601 instant with Z or a numeric UTC offset and ${f.seed} to a non-empty reproducibility seed.`,`Optionally set ${f.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:o,missing_required_fields:t==="incomplete"?[f.clock,f.seed].filter(i=>!o.includes(i)):void 0}})}function De(e){let t=e[f.clock],n=e[f.tickMs],o=e[f.seed],i=[[f.clock,t],[f.tickMs,n],[f.seed,o]].filter(a=>a[1]!==void 0).map(([a])=>a);if(i.length===0)return;if(t===void 0||o===void 0)throw x("Reproducible process execution requires PM_CLOCK and PM_SEED together.","incomplete",t===void 0?f.clock:f.seed,i);if(o.trim().length===0)throw x(`${f.seed} must not be empty.`,"invalid_value",f.seed,i);if(!V(t))throw x(`${f.clock} must be a valid ISO-8601 instant with Z or a numeric UTC offset.`,"invalid_value",f.clock,i);let s=n===void 0?1:Number(n);if(n?.trim().length===0||!Number.isSafeInteger(s)||s<0)throw x(`${f.tickMs} must be a non-negative integer.`,"invalid_value",f.tickMs,i);return F({clock:t,seed:o,tickMs:s})}function Ve(e){let t=De(e);return t===void 0?n=>n():D(t)}async function kt(e,t){return Ve(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]="4f7274c6-547e-5590-b7c9-a4d6418bf860")}catch{}})();function Z(e){return e.trim().match(/--[a-z0-9][a-z0-9_-]*/i)?.[0]?.replaceAll("_","-").toLowerCase()}function At(e){if(!(!Array.isArray(e)||e.length===0))return _(e)}function $e(e,t){let n=Z(t);if(!n)return;let o=y(e).find(i=>i.flag===n||i.aliases?.includes(n));return o?o.value_type==="boolean"?null:`<${o.value_name??"value"}>`:"<value>"}function Ot(e,t,n){let o=[...e],i=o.indexOf("--"),s=i<0?o.length:i;for(let a of n){let r=Z(a);if(!r||o.slice(0,s).some(u=>u===r||u.startsWith(`${r}=`)))continue;let c=$e(t,r),l=c?[r,c]:[r];o.splice(s,0,...l),s+=l.length}return o.length===e.length?void 0:M(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]="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]="925e5fec-4cc0-5315-a331-03cb128893f0")}catch{}})();var Be={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 n=e.trim().toLowerCase(),o=t.trim().toLowerCase();if(o.length===0)return Number.POSITIVE_INFINITY;let i=n.split(" "),s=Be[o]?.indexOf(m(n));if(s!==void 0&&s>=0)return s;if(n===o)return 10;if(i.includes(o))return 11;if(i.some(c=>c.startsWith(o)))return 12;let a=o.length>=5?2:1,r=Number.POSITIVE_INFINITY;for(let c of i){let l=I(c,o,a);l!==null&&(r=Math.min(r,l))}return Number.isFinite(r)?20+r:n.includes(o)?30:Number.POSITIVE_INFINITY}function Vt(e,t){return e.map(n=>({path:n,score:H(n,t)})).filter(n=>Number.isFinite(n.score)).sort((n,o)=>n.score!==o.score?n.score-o.score:n.path===o.path?0:n.path<o.path?-1:1).map(n=>n.path)}function $t(e,t,n){let o=new Set(t),i=E.filter(r=>r.lifecycle==="deprecated").slice().sort((r,c)=>c.alias.length-r.alias.length),s=[],a=e.flatMap(r=>{let c=i.find(u=>r===u.alias||r.startsWith(`${u.alias} `)),l=r;if(c){let u=r.slice(c.alias.length);if(!o.has(`${c.canonical}${u}`))return[];l=`${c.canonical_argv.join(" ")}${u}`}return n!==void 0&&H(r,n)<10&&s.push(l),[l]});return[...new Set(s.length>0?s:a)]}export{Ge as a,je as b,ee as c,te as d,Ke as e,Ye as f,G as g,W as h,ue as i,j,de as k,C as l,fe as m,ut as n,he as o,dt as p,Oe as q,Le as r,ft as s,pt as t,yt as u,f as v,De as w,Ve as x,kt as y,At as z,$e as A,Ot as B,H as C,Vt as D,$t as E};
|
|
2
|
+
//# sourceMappingURL=chunk-H7CXQBGQ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$i as De,A as U,Bi as ci,C as ae,Ci as li,Dc as B,Di as Ie,E as V,Ei as di,Fi as pi,Gn as vi,Hb as Bo,I as ue,Jb as Ho,Ld as Dt,Mb as Ne,Mc as K,Md as Qo,N as Po,Nd as Sn,Od as En,Oi as ui,Pd as $n,Qf as Se,Rd as ei,Sa as jo,Sd as ti,Ta as Lo,U as Ro,Ua as z,Ui as mi,Vd as ni,X as Ct,Xi as Lt,Yi as Ft,ab as N,ae as oi,bb as Fo,bd as Zo,bi as In,ca as No,cb as Mo,cd as st,cg as I,db as Go,dg as Q,dh as ai,di as si,eg as ii,ei as He,ej as fi,ff as T,fg as Y,fj as An,gc as xn,gg as ie,ha as wn,hc as Ko,ic as Rt,ig as ri,ih as H,ja as Do,k as Co,kc as ke,kg as ct,li as se,ma as vn,mc as xe,mf as Z,mg as jt,na as h,om as gi,pa as f,pc as Vo,pi as A,pm as je,qi as Ee,qm as lt,rc as Nt,rm as yi,sc as Yo,sm as _i,ta as Pt,tb as Uo,tc as Xo,tm as ce,ua as bn,ub as zo,um as Ke,va as kn,vb as Jo,vm as wi,vo as Mt,wm as me,x,xi as $e,xl as hi,y as Ot,yb as qo,z as pe,zb as Wo}from"./chunk-
|
|
1
|
+
import{$i as De,A as U,Bi as ci,C as ae,Ci as li,Dc as B,Di as Ie,E as V,Ei as di,Fi as pi,Gn as vi,Hb as Bo,I as ue,Jb as Ho,Ld as Dt,Mb as Ne,Mc as K,Md as Qo,N as Po,Nd as Sn,Od as En,Oi as ui,Pd as $n,Qf as Se,Rd as ei,Sa as jo,Sd as ti,Ta as Lo,U as Ro,Ua as z,Ui as mi,Vd as ni,X as Ct,Xi as Lt,Yi as Ft,ab as N,ae as oi,bb as Fo,bd as Zo,bi as In,ca as No,cb as Mo,cd as st,cg as I,db as Go,dg as Q,dh as ai,di as si,eg as ii,ei as He,ej as fi,ff as T,fg as Y,fj as An,gc as xn,gg as ie,ha as wn,hc as Ko,ic as Rt,ig as ri,ih as H,ja as Do,k as Co,kc as ke,kg as ct,li as se,ma as vn,mc as xe,mf as Z,mg as jt,na as h,om as gi,pa as f,pc as Vo,pi as A,pm as je,qi as Ee,qm as lt,rc as Nt,rm as yi,sc as Yo,sm as _i,ta as Pt,tb as Uo,tc as Xo,tm as ce,ua as bn,ub as zo,um as Ke,va as kn,vb as Jo,vm as wi,vo as Mt,wm as me,x,xi as $e,xl as hi,y as Ot,yb as qo,z as pe,zb as Wo}from"./chunk-QPKQKSQU.js";import{mkdir as tc,readFile as nc}from"node:fs/promises";import Ei from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d9ef3878-afce-5983-8fe9-8a896f82d0a7")}catch{}})();var Tn=class extends Error{constructor(t="Workspace transaction interrupted"){super(t),this.name="WorkspaceTransactionInterruptedError"}},oc="sdk-workspace-transaction",ic=/^[a-zA-Z0-9._-]+$/,rc=30,ac=3e3;function $i(e,t){if(typeof e!="string")throw new TypeError(`${t} must be a string`);let n=e.trim();if(!n||!ic.test(n))throw new TypeError(`${t} must match [a-zA-Z0-9._-]+`);return n}function bi(e,t){if(typeof e!="string")throw new TypeError(`${t} must be a string`);let n=e.trim();if(!n)throw new TypeError(`${t} must be non-empty`);return n}function sc(e){return{pmRoot:bi(e.pmRoot,"Transaction pmRoot"),transactionId:$i(e.transactionId,"Transaction id"),author:bi(e.author,"Transaction author")}}function ki(e,t,n){let o=e??t;if(!Number.isInteger(o)||o<=0)throw new TypeError(`${n} must be a positive integer`);return o}function Ii(e,t){return Ei.join(e,"transactions","sdk",`${t}.json`)}async function Ae(e,t){t.updatedAt=T();let n=Ii(e,t.transactionId);await tc(Ei.dirname(n),{recursive:!0}),await ae(n,`${JSON.stringify(t,null,2)}
|
|
2
2
|
`)}function cc(e){return Number.isInteger(e.attempt)&&typeof e.author=="string"&&typeof e.createdAt=="string"&&typeof e.updatedAt=="string"}function Le(e){return Object.assign(Object.create(null),e)}function lc(e,t){try{let n=JSON.stringify(e,(o,i)=>{if(typeof i=="number"&&!Number.isFinite(i))throw new TypeError(`${t} contains a non-finite number`);if(i===void 0||typeof i=="function"||typeof i=="symbol")throw new TypeError(`${t} contains a non-JSON value`);return i});return JSON.parse(n)}catch(n){throw new TypeError(`${t} must be JSON serializable`,{cause:n})}}function On(e,t){return e===void 0?void 0:lc(e,t)}function Cn(e,t,n,o){let i=On(n,o);i===void 0?delete e[t]:e[t]=i}function xi(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Si(e,t){return Array.isArray(e)&&new Set(e).size===e.length&&e.every(n=>typeof n=="string"&&t.includes(n))}function dc(e,t){if(!Si(e.startedStepIds,t)||!Si(e.completedStepIds,t)||!xi(e.results)||!xi(e.compensationData))return!1;let n=e.startedStepIds,o=new Set(n),i=e.completedStepIds,r=new Set(i);return Object.keys(e.compensationData).some(a=>!o.has(a))||Object.keys(e.results).some(a=>!r.has(a))?!1:e.status==="committed"?t.every(a=>r.has(a)):e.status!=="compensated"||r.size===0&&o.size===0}function pc(e,t,n){let o;try{o=JSON.parse(e)}catch{throw new TypeError(`Workspace transaction ${t} journal is invalid JSON`)}if(!o||typeof o!="object"||Array.isArray(o))throw new TypeError(`Workspace transaction ${t} journal is invalid`);let i=o,r=i.schemaVersion===1&&i.transactionId===t,a=Array.isArray(i.stepIds)&&i.stepIds.length===n.length&&i.stepIds.every((d,p)=>d===n[p]),s=dc(i,n),c=cc(i),l=["applying","compensating","compensated","committed"].includes(String(i.status));if(!r||!a||!s||!c||!l)throw new TypeError(`Workspace transaction ${t} journal does not match the supplied plan`);return{...i,results:Le(i.results),compensationData:Le(i.compensationData)}}async function uc(e,t,n,o,i){let r=i,a=r!==void 0;if(r?.status==="compensating"&&await Ai(e,r),r===void 0||r.status==="compensated"){let s=T();r={schemaVersion:1,transactionId:t,author:n,status:"applying",attempt:(r?.attempt??0)+1,createdAt:r?.createdAt??s,updatedAt:s,stepIds:o,startedStepIds:[],completedStepIds:[],results:Le(),compensationData:Le()},await Ae(e.pmRoot,r),await ye(e,r,"prepared")}return{journal:r,recovered:a}}async function mc(e,t,n){try{await hc(t,e.steps),await Ae(e.pmRoot,t);let o=new Set(t.completedStepIds),i=new Set(t.startedStepIds);for(let r of e.steps){if(o.has(r.id))continue;let a=await r.inspect(),s=On(a.result,`Step ${r.id} result`);if(a.state!=="applied"){let c=await r.prepareCompensation?.();Cn(t.compensationData,r.id,c,`Step ${r.id} compensation data`),i.add(r.id),t.startedStepIds=e.steps.map(d=>d.id).filter(d=>i.has(d)),await Ae(e.pmRoot,t);let l=await r.apply();s=On(l,`Step ${r.id} result`)}await ye(e,t,"step_applied",r.id),o.add(r.id),t.completedStepIds=e.steps.map(c=>c.id).filter(c=>o.has(c)),Cn(t.results,r.id,s,`Step ${r.id} result`),await Ae(e.pmRoot,t),await ye(e,t,"step_recorded",r.id)}return await ye(e,t,"committing"),t.status="committed",await Ae(e.pmRoot,t),await ye(e,t,"committed"),{transactionId:t.transactionId,status:"committed",recovered:n,results:Le(t.results)}}catch(o){if(o instanceof Tn||t.status==="committed")throw o;try{await Ai(e,t)}catch(i){throw new AggregateError([o,i],`Workspace transaction failed and compensation failed: ${String(i)}`,{cause:i})}throw o}}async function fc(e,t,n){try{return pc(await nc(Ii(e,t),"utf8"),t,n)}catch(o){if(o!==null&&typeof o=="object"&&"code"in o&&pe(o))return;throw o}}async function ye(e,t,n,o){await e.onTransition?.({transactionId:t.transactionId,attempt:t.attempt,transition:n,...o===void 0?{}:{stepId:o}})}async function hc(e,t){let n=new Set,o=Le();for(let i of t){let r=await i.inspect();r.state==="applied"&&(n.add(i.id),Cn(o,i.id,r.result,`Step ${i.id} result`))}e.results=o,e.completedStepIds=t.map(i=>i.id).filter(i=>n.has(i))}async function Ai(e,t){t.status="compensating",await Ae(e.pmRoot,t),await ye(e,t,"compensating");let n=new Set(t.completedStepIds),o=new Set(t.startedStepIds);for(let i of[...e.steps].reverse()){if(!o.has(i.id)&&!n.has(i.id))continue;let r;try{r=o.has(i.id)&&(await i.inspect()).state==="applied"}catch{r=o.has(i.id)}r&&(await ye(e,t,"step_compensating",i.id),await i.compensate(t.compensationData[i.id])),n.delete(i.id),o.delete(i.id),t.completedStepIds=e.steps.map(a=>a.id).filter(a=>n.has(a)),t.startedStepIds=e.steps.map(a=>a.id).filter(a=>o.has(a)),delete t.results[i.id],delete t.compensationData[i.id],await Ae(e.pmRoot,t),await ye(e,t,"step_compensated",i.id)}t.status="compensated",await Ae(e.pmRoot,t),await ye(e,t,"compensated")}async function Ti(e){let{pmRoot:t,transactionId:n,author:o}=sc(e),i=ki(e.lockTtlSeconds,rc,"Transaction lock TTL"),r=ki(e.lockWaitMs,ac,"Transaction lock wait"),a=[...e.steps];if(a.length===0)throw new TypeError("Workspace transaction requires at least one step");let s=a.map(d=>{let p=$i(d.id,"Transaction step id");if(p!==d.id)throw new TypeError("Transaction step id must not contain surrounding whitespace");return p});if(new Set(s).size!==s.length)throw new TypeError("Workspace transaction step ids must be unique");let c={...e,pmRoot:t,transactionId:n,author:o,steps:a,lockTtlSeconds:i,lockWaitMs:r},l=await Z(t,oc,i,o,!1,!1,r);try{let d=await fc(t,n,s),p=d!==void 0;if(d?.status==="committed")return{transactionId:n,status:"committed",recovered:!0,results:Le(d.results)};let u=await uc(c,n,o,s,d);return await mc(c,u.journal,p||u.recovered)}finally{await l()}}import gc from"node:fs/promises";import yc from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c4dc16d1-672a-5b1c-b681-97a7b3febd69")}catch{}})();function Pn(e){return yc.join(e,"extension-migrations.json")}function Oi(e,t){let n=e.definition.id;return typeof n=="string"&&n.trim().length>0?n.trim():`migration-${String(t+1).padStart(3,"0")}`}function Ci(e,t){return`${e.layer}:${e.name}:${t}`}async function _c(e){let t=Pn(e);if(!await x(t))return{version:1,updated_at:"",entries:[]};let n=JSON.parse(await gc.readFile(t,"utf8"));return{version:1,updated_at:typeof n.updated_at=="string"?n.updated_at:"",entries:Array.isArray(n.entries)?n.entries.filter(o=>typeof o?.key=="string"&&(o.status==="applied"||o.status==="failed")):[]}}async function wc(e,t){let n=await _c(e),o=new Map(n.entries.map(i=>[i.key,i]));return t.forEach((i,r)=>{let a=Oi(i,r),s=o.get(Ci(i,a));s&&(i.definition.status=s.status,s.status==="failed"?i.definition.reason=s.error:(delete i.definition.reason,delete i.definition.error,delete i.definition.message))}),n}async function vc(e){let t=await wc(e.pmRoot,e.migrations),n=new Map(t.entries.map(d=>[d.key,d])),o=[],i=!1,r=e.migrations.map((d,p)=>({migration:d,index:p})).filter(({migration:d})=>e.scope===void 0||d.layer===e.scope);for(let{migration:d,index:p}of r){let u=Oi(d,p),g=Ci(d,u),y=n.get(g),w=String(d.definition.status??"pending").toLowerCase(),m=y?.status??(w==="applied"||w==="failed"?w:"pending");if(m==="applied"){o.push({key:g,layer:d.layer,extension:d.name,id:u,before:m,outcome:"skipped"});continue}if(e.dryRun===!0){o.push({key:g,layer:d.layer,extension:d.name,id:u,before:m,outcome:"pending"});continue}let _=d.runtime_definition?.run??d.definition.run;if(typeof _!="function"){o.push({key:g,layer:d.layer,extension:d.name,id:u,before:m,outcome:"pending"});continue}let v=new Date().toISOString();try{await Promise.resolve(_({id:u,command:"migration",layer:d.layer,extension:d.name,pm_root:e.pmRoot,status:m}));let k={key:g,layer:d.layer,extension:d.name,id:u,status:"applied",attempted_at:v};n.set(g,k),d.definition.status="applied",delete d.definition.reason,delete d.definition.error,delete d.definition.message,o.push({key:g,layer:d.layer,extension:d.name,id:u,before:m,outcome:"applied"}),i=!0}catch(k){let S=k instanceof Error?k.message:String(k),R={key:g,layer:d.layer,extension:d.name,id:u,status:"failed",attempted_at:v,error:S};n.set(g,R),d.definition.status="failed",d.definition.reason=S,o.push({key:g,layer:d.layer,extension:d.name,id:u,before:m,outcome:"failed",error:S}),i=!0}}if(i){let d=await A(e.pmRoot),p={version:1,updated_at:new Date().toISOString(),entries:[...n.values()].sort((u,g)=>u.key.localeCompare(g.key))};await He({pmRoot:e.pmRoot,filePath:Pn(e.pmRoot),raw:`${JSON.stringify(p,null,2)}
|
|
3
3
|
`,op:"extension_migrations_apply",author:e.author,lockTtlSeconds:d.locks.ttl_seconds,lockWaitMs:d.locks.wait_ms})}let a=o.filter(d=>d.outcome==="pending").length,s=o.filter(d=>d.outcome==="applied").length,c=o.filter(d=>d.outcome==="skipped").length,l=o.filter(d=>d.outcome==="failed").length;return{ok:l===0,dry_run:e.dryRun===!0,state_path:Pn(e.pmRoot),total:o.length,pending_count:a,applied_count:s,skipped_count:c,failed_count:l,migrations:o}}async function Pi(e){let t=await A(e.resolvedRoots.settings_root),n=await ke({pmRoot:e.resolvedRoots.pm_root,settings:t,cwd:process.cwd(),noExtensions:e.global.noExtensions===!0}),o=await xe(n);e.warnings.push(...n.warnings,...o.warnings);let i=await vc({pmRoot:e.resolvedRoots.pm_root,migrations:o.registrations.migrations,author:typeof e.global.author=="string"&&e.global.author.trim().length>0?e.global.author.trim():"pm-extension-migration",dryRun:e.options.dryRun===!0,...e.scope==="global"?{scope:"global"}:{}});return e.withResult({migration:i,load_failure_count:n.failed.length,activation_failure_count:o.failed.length},i.ok)}import{readFile as bc,writeFile as kc}from"node:fs/promises";import dt from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5b131b40-e139-5a7d-a6ef-633fe2cbee64")}catch{}})();var Ni="# pm-cli:runtime-cache:start",Rn="# pm-cli:runtime-cache:end",Di=".agents/pm",xc=["runtime/","search/","locks/","transactions/","checkpoints/"],Sc=["search/eval-queries.json"];async function Ri(e){try{return await e()}catch(t){throw t instanceof Error&&"code"in t&&typeof t.code=="string"&&["EACCES","EPERM","EROFS"].includes(t.code)?new f("The workspace .gitignore is not writable.",h.GENERIC_FAILURE,{code:"init_gitignore_unwritable",reason:t.code.toLowerCase(),required:"Grant the current user read and write access to the workspace .gitignore before initialization.",why:"pm init must publish its managed runtime-cache ignore fence without replacing unrelated entries.",nextSteps:["Grant read and write access to the workspace .gitignore and rerun pm init.","If the workspace is intentionally read-only, initialize pm in a writable workspace or clone."]}):t}}function ji(e){return e.replaceAll("\\","/").replace(/^\.\/+/,"").replace(/\/+$/,"")}function Nn(e){let t=e.replaceAll("\\","/");return dt.isAbsolute(e)||t===".."||t.startsWith("../")}function Ec(e=Di){let t=ji(e);return[Ni,...xc.map(n=>n==="search/"?`${t}/${n}*`:`${t}/${n}`),...Sc.map(n=>`!${t}/${n}`),Rn].join(`
|
|
4
4
|
`)}async function Li(e,t={}){let n=dt.join(e,".gitignore"),o=Di;if(t.pmRoot!==void 0){let d=ji(dt.relative(dt.resolve(e),dt.resolve(t.pmRoot)));if(Nn(d))return{path:n,changed:!1};d.length>0&&(o=d)}let i="";try{i=await Ri(()=>bc(n,"utf8"))}catch(d){if(!(d instanceof Error&&"code"in d&&pe(d)))throw d}let r=i.indexOf(Ni),a=i.indexOf(Rn),c=(r>=0&&a>=r?`${i.slice(0,r)}${i.slice(a+Rn.length)}`:i).trimEnd(),l=`${c.length>0?`${c}
|
|
@@ -77,4 +77,4 @@ Agent guidance check
|
|
|
77
77
|
`),ee.write(`Telemetry helps improve reliability and can be disabled anytime via pm config.
|
|
78
78
|
`);let c=t?"Y/n":"y/N",l=await n.question(`Enable telemetry for this project? [${c}] `),d=Us(l,t);return ee.write(`
|
|
79
79
|
`),{prefix:i,preset:s,telemetry_enabled:d}}finally{n.close()}}function lf(e){return{presetFromOption:Io(e.preset),useDefaults:e.defaults===!0,authorFromOption:Ls(e.author),installBundledPackages:e.withPackages===!0,agentGuidanceMode:Gs(e.agentGuidance),typePreset:js(e.typePreset)}}function df(e){let t=[];return e.prefixArg!==void 0&&e.settings.id_prefix!==e.normalizedPrefix&&t.push("id_prefix"),e.presetFromOption!==void 0&&e.settings.governance.preset!==e.presetFromOption&&t.push("governance_preset"),e.authorFromOption!==void 0&&e.settings.author_default!==e.authorFromOption&&t.push("author_default"),t}function pf(e,t,n,o){if(t.length===0||n)return;let i=o.discovery==="ancestor";throw new f(`${i?`No tracker exists in ${o.requested_cwd}; pm init found an ancestor tracker at ${o.tracker_root}. `:""}Refusing to update existing tracker settings at ${e} without --force.`,h.USAGE,{code:"init_existing_settings_requires_force",type:"urn:pm-cli:error:init_existing_settings_requires_force",required:`--force for ${t.join(", ")}`,why:i?"Ancestor discovery is useful for normal commands, but init must make the selected existing workspace explicit before changing its identity or policy settings.":"pm init is safe to rerun, but changing id prefix, governance preset, or default author on an existing tracker can corrupt long-lived project context when an agent meant to initialize a sandbox path.",resolved_path:o.tracker_root,requested_path:o.requested_cwd,suggested_path:o.suggested_current_tracker_root,examples:["pm init --yes","pm init ./sandbox-pm --yes",...i?['pm init <name> --yes --pm-path "$PWD/.agents/pm"']:[],"pm init acme --yes --force"],nextSteps:[...i?['To create a new tracker in the current directory, rerun with --pm-path "$PWD/.agents/pm".']:[],"If you meant to initialize a sandbox tracker, pass a path-like positional such as ./sandbox-pm or /tmp/pm-test.","If you intentionally want to rewrite this existing tracker's init-managed settings, rerun with --force."]})}function uf(e){let t=!1;return e.prefixArg!==void 0&&e.settings.id_prefix!==e.normalizedPrefix&&(e.settings.id_prefix=e.normalizedPrefix,e.warnings.push(`updated:id_prefix:${e.normalizedPrefix}`),t=!0),e.presetFromOption!==void 0&&e.settings.governance.preset!==e.presetFromOption&&(Ao(e.settings,e.presetFromOption),e.warnings.push(`updated:governance_preset:${e.presetFromOption}`),t=!0),e.authorFromOption!==void 0&&e.settings.author_default!==e.authorFromOption&&(e.settings.author_default=e.authorFromOption,e.warnings.push(`updated:author_default:${e.authorFromOption}`),t=!0),t}async function mf(e){let t=await A(e.pmRoot);e.warnings.push(`already_exists:${e.settingsPath}`);let n=df({settings:t,normalizedPrefix:e.normalizedPrefix,prefixArg:e.prefixArg,presetFromOption:e.normalizedOptions.presetFromOption,authorFromOption:e.normalizedOptions.authorFromOption});return pf(e.settingsPath,n,e.options.force===!0,e.target),uf({settings:t,normalizedPrefix:e.normalizedPrefix,prefixArg:e.prefixArg,presetFromOption:e.normalizedOptions.presetFromOption,authorFromOption:e.normalizedOptions.authorFromOption,warnings:e.warnings})&&await Ee(e.pmRoot,t),{settings:t,normalizedPrefix:e.normalizedPrefix,chosenPreset:e.normalizedOptions.presetFromOption,wizardUsed:!1}}async function ff(e){let t=e.normalizedPrefix,n=e.normalizedOptions.presetFromOption,o,i=!1;if(e.normalizedOptions.presetFromOption===void 0&&!e.normalizedOptions.useDefaults&&process.stdin.isTTY===!0&&process.stdout.isTTY===!0){let c=await Hs(t,vn.telemetry.enabled);t=c.prefix,n=c.preset,o=c.telemetry_enabled,i=!0}let r=n??"minimal",a=af();a.id_prefix=t,Ao(a,r);let s=ai()?.trim()||void 0;return a.author_default=e.normalizedOptions.authorFromOption??s??"",o!==void 0&&(a.telemetry.enabled=o,a.telemetry.first_run_prompt_completed=!0),await Ee(e.pmRoot,a),{settings:a,normalizedPrefix:t,chosenPreset:n,wizardUsed:i}}async function Ps(e){return e.settingsExists?await mf(e):await ff({pmRoot:e.pmRoot,normalizedPrefix:e.normalizedPrefix,normalizedOptions:e.normalizedOptions})}async function hf(e){let t=await Cs({pm_root:e.pmRoot,cwd:e.cwd,mode:e.agentGuidanceMode,interactive:process.stdin.isTTY===!0&&process.stdout.isTTY===!0,settings:e.settings});return e.warnings.push(...t.warnings),t.settings_changed&&await Ee(e.pmRoot,e.settings),{...t.summary,next_steps:t.next_steps}}async function gf(e,t){let n=[],o=[],i=await ri(e,t.schema);for(let r of i.created_paths)n.push(r),o.push(...await K({path:r,scope:"project",op:"init:runtime_schema_file"}));return{createdDirs:n,warnings:o}}async function yf(e){if(e.typePreset===void 0)return;let t=await Js(e.pmRoot,e.settings,e.typePreset);return e.warnings.push(`registered_type_preset:${e.typePreset}`),e.warnings.push(...await K({path:t.file,scope:"project",op:"init:type_preset"})),t}async function _f(e){let n=z(e.settings,B()).folders.filter(i=>!wn.includes(i)),o=await Bs(e.pmRoot,n);e.createdDirs.push(...o.createdDirs),e.warnings.push(...o.warnings)}function wf(e){let t=L.resolve(e.tracker_root),n=L.dirname(t);return L.basename(t)==="pm"&&L.basename(n)===".agents"?L.dirname(n):e.workspace_root}async function vf(e,t,n,o){if(!e)return;let i=await _o("all",{install:!0,project:!0},{...t,path:n});o.push(...i.warnings);let r=zs(i),a=r.packages.filter(s=>!s.ok).map(s=>s.alias);if(!r.installed_all||a.length>0)throw new f(`pm init --with-packages did not install all bundled packages successfully${a.length>0?`: ${a.join(", ")}`:"."}`,h.GENERIC_FAILURE);return r}function Ks(e){let t=o=>st([...e.target.mode==="workspace-discovery"?[]:["--pm-path",e.target.tracker_root],...o]),n=[`Create your first item: ${t(["create","--type","Task","--title","<title>"])}`,`List active items: ${t(["list"])}`,`Get agent-friendly project context: ${t(["context"])}`];e.installBundledPackages?n.push(`Explore newly-available commands: ${t(["cal"])}, ${t(["templates"])}, ${t(["guide"])}`):(n.push(`Add optional packages for richer workflows: ${t(["install","calendar","--project"])}, ${t(["install","templates","--project"])}, ${t(["install","guide-shell","--project"])}`),n.push(`Or install everything bundled: ${t(["init","--with-packages"])} (idempotent on re-run)`)),e.registeredTypePreset&&n.push(`Inspect registered preset types: ${t(["schema","list"])}, ${t(["schema","show",e.registeredTypePreset.registered[0]??e.registeredTypePreset.updated[0]])}`),n.push("Supported agent harnesses are attributed automatically; use --author or PM_AUTHOR only when an explicit identity override is required.");for(let o of e.agentGuidanceNextSteps){let i=e.target.mode==="workspace-discovery"?o:o.replace(/\bpm (?=[a-z])/g,()=>`${t([])} `);n.includes(i)||n.push(i)}return n}async function Vs(e,t,n,o=Jn){if(t===null){n.push("merge_fence_skipped:not_git_repository:run pm merge install after moving the tracker into a Git repository");return}try{let i=await o({pmRoot:e,workspaceRoot:t});i.gitattributes.changed&&n.push(`updated:merge_fence:${i.gitattributes.path}`)}catch(i){if(!(i instanceof f))throw i;n.push(`merge_fence_skipped:install_failed:${i.context.code??"pm_error"}:${i.message}:run pm merge install after resolving the Git repository error`)}}async function bf(e,t,n,o){if(e==null||n==="status")return;let i=await Li(e,{pmRoot:t});i.changed&&o.push(`updated:gitignore:${i.path}`)}async function gb(e,t,n={}){let o=t[of],i=typeof o=="string"?o:process.cwd(),r=Fs(i,t,e,n.workspace),a=r.pmRoot;e=Ms(r.prefixArg,n.idPrefix);let s=lf(n);await Ws(a,r.target.mode==="tracker-path",n.force===!0);let c=[],l=[],d=L.join(a,"settings.json"),p=await x(d),u;p&&(u=await Ps({pmRoot:a,settingsPath:d,settingsExists:p,normalizedPrefix:$e(e),prefixArg:e,options:n,normalizedOptions:s,warnings:l,target:r.target}));let g=await Bs(a,wn);c.push(...g.createdDirs),l.push(...g.warnings),u??=await Ps({pmRoot:a,settingsPath:d,settingsExists:p,normalizedPrefix:$e(e),prefixArg:e,options:n,normalizedOptions:s,warnings:l,target:r.target});let{settings:y}=u,w=wf(r.target),m=await Wt(w??L.dirname(a)),_=w??m,v=await hf({pmRoot:a,cwd:_??i,agentGuidanceMode:s.agentGuidanceMode,settings:y,warnings:l}),k=await gf(a,y);c.push(...k.createdDirs),l.push(...k.warnings);let S=await yf({pmRoot:a,settings:y,typePreset:s.typePreset,warnings:l});S&&(y=await A(a)),await _f({pmRoot:a,settings:y,createdDirs:c,warnings:l}),await bf(_,a,s.agentGuidanceMode,l),!p&&n.mergeFence!==!1&&s.agentGuidanceMode!=="status"&&await Vs(a,m,l);let R=await vf(s.installBundledPackages,t,a,l),G=Ks({installBundledPackages:s.installBundledPackages,registeredTypePreset:S,agentGuidanceNextSteps:v.next_steps,target:r.target});return{ok:!0,path:a,target:r.target,settings:y,created_dirs:c,warnings:l,governance_preset:y.governance.preset,wizard_used:u.wizardUsed,...S?{registered_type_preset:S}:{},...R?{installed_packages:R}:{},next_steps:G,agent_guidance:v}}export{Tn as a,sc as b,Ti as c,Pn as d,_c as e,wc as f,vc as g,Pi as h,zp as i,Ni as j,Rn as k,xc as l,Ec as m,Li as n,Ve as o,Ic as p,Ac as q,Mi as r,Jt as s,Fe as t,Gt as u,Fn as v,Lc as w,Fc as x,Vf as y,qt as z,Bc as A,ut as B,Bi as C,Xc as D,Wt as E,zn as F,Zi as G,kh as H,xh as I,Qi as J,Sh as K,Jn as L,mr as M,et as N,tt as O,fr as P,dr as Q,Ze as R,Qe as S,pr as T,el as U,Ih as V,Ch as W,tr as X,ol as Y,Kh as Z,vr as _,Sr as $,zl as aa,Jl as ba,H_ as ca,Y_ as da,X_ as ea,Et as fa,Z_ as ga,Q_ as ha,ew as ia,tw as ja,nw as ka,ow as la,iw as ma,rw as na,aw as oa,sw as pa,cw as qa,lw as ra,dw as sa,pw as ta,uw as ua,mw as va,fw as wa,hw as xa,gw as ya,yw as za,_w as Aa,ww as Ba,vw as Ca,bw as Da,kw as Ea,te as Fa,b as Ga,Yn as Ha,ad as Ia,we as Ja,Kt as Ka,ql as La,ft as Ma,Vt as Na,Mr as Oa,Kr as Pa,co as Qa,ca as Ra,zy as Sa,du as Ta,za as Ua,Ja as Va,Wa,va as Xa,Gp as Ya,vu as Za,ka as _a,_o as $a,ws as ab,qv as bb,Cs as cb,of as db,fb as eb,hb as fb,gb};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-KP7NBQK3.js.map
|