@unbrained/pm-cli 2026.11.28 → 2026.11.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/dist/cli/commander-usage.js +4 -4
- package/dist/cli/error-guidance.js +5 -5
- package/dist/cli/linked-resource-value-list.js +2 -0
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/{chunk-O2WNNIKK.js → chunk-2SBTXR6C.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YEMFOKFG.js → chunk-3AZOATC2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CATRDGAB.js → chunk-3TXEWHQX.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-47ZS6RPL.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-MGJMQSN4.js → chunk-4QA5O64H.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-5EFS7K7Y.js +1 -0
- package/dist/cli-bundle/chunks/{chunk-E2LQ6LCJ.js → chunk-5PNOVDVO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OFIYA3PI.js → chunk-AOTI76Q6.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-TWRUA2NH.js → chunk-CCKM5YQM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CTM26LUE.js → chunk-DCWGM7CY.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-FECZV72T.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-O2SWNEBW.js → chunk-FR7ULTM4.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-GSLOAEY2.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-ZXERHBMA.js → chunk-HXQ3OHQR.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-T7RZPIOB.js → chunk-IGEFPHV7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FG4TNQQM.js → chunk-JPJNJHQW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6OIHST4I.js → chunk-K672XXGQ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-CDUV7DFD.js → chunk-KCVSSONY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LMDIKSDZ.js → chunk-KXTKLDKD.js} +8 -8
- package/dist/cli-bundle/chunks/chunk-NHBG5ET3.js +2 -0
- package/dist/cli-bundle/chunks/chunk-NVYDPNQP.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-C4O5TZY3.js → chunk-NZSXWIX7.js} +60 -60
- package/dist/cli-bundle/chunks/{chunk-KHFUHGL3.js → chunk-OGVSGXQX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LRGYV6QQ.js → chunk-Q4VZSMUL.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-SJWIPGZW.js +113 -0
- package/dist/cli-bundle/chunks/chunk-TE6FBDHP.js +4 -0
- package/dist/cli-bundle/chunks/{chunk-Q6BGQRCB.js → chunk-TX74QJ4W.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-TY55UX6M.js +10 -0
- package/dist/cli-bundle/chunks/chunk-USBTXMKS.js +2 -0
- package/dist/cli-bundle/chunks/chunk-VCXQ6A35.js +3 -0
- package/dist/cli-bundle/chunks/chunk-WFYE34TO.js +23 -0
- package/dist/cli-bundle/chunks/chunk-X5D5YUHR.js +2 -0
- package/dist/cli-bundle/chunks/chunk-YPMNXG2C.js +2 -0
- package/dist/cli-bundle/chunks/chunk-YVTALIN3.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-JQYPSABI.js → chunk-Z7YL2SUM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-T7UTG56V.js → chunk-ZA5NS3PL.js} +3 -3
- package/dist/cli-bundle/chunks/field-definition-losses-XKE4DRUA.js +2 -0
- package/dist/cli-bundle/chunks/{field-option-collisions-G4LQ2646.js → field-option-collisions-2F2Z7R7B.js} +2 -2
- package/dist/cli-bundle/chunks/{indexed-receipt-blobs-H3MMNXXG.js → indexed-receipt-blobs-DR3FDHND.js} +2 -2
- package/dist/cli-bundle/chunks/{item-revision-O7L3AA2W.js → item-revision-UAF6L47R.js} +2 -2
- package/dist/cli-bundle/chunks/item-transaction-RJECL53Y.js +2 -0
- package/dist/cli-bundle/chunks/linked-resource-value-list-WXPPYUVQ.js +2 -0
- package/dist/cli-bundle/chunks/{mutation-actor-A45DFDEO.js → mutation-actor-UK3QNEEB.js} +2 -2
- package/dist/cli-bundle/chunks/mutation-admission-UTDYPFWP.js +2 -0
- package/dist/cli-bundle/chunks/{register-list-query-FCPGG2UT.js → register-list-query-DRA3CWHI.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-VD3JX23I.js → register-mutation-WO74VLEQ.js} +2 -2
- package/dist/cli-bundle/chunks/register-operations-CRBKH7WN.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-EWAZZWPL.js → register-setup-6V6NQB5C.js} +2 -2
- package/dist/cli-bundle/chunks/runtime-schema-OAIUNQRL.js +2 -0
- package/dist/cli-bundle/chunks/{settlement-hook-KWBOSRDZ.js → settlement-hook-BIVNGBZF.js} +2 -2
- package/dist/cli-bundle/chunks/{stage-UIDZMTE5.js → stage-DYEHGASU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-26P6C6OO.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-2UUBS4BG.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-J4V3J5MC.js → chunk-4ER3VMST.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-4YBMHMBJ.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-Y7EC2L2G.js → chunk-62AMZMR4.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-OEMI52ZS.js → chunk-7G7JIXLL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-YC3PFFDE.js → chunk-A3DORTXS.js} +57 -57
- package/dist/cli-bundle/focused-chunks/{chunk-AHCOSTL7.js → chunk-CWQLW4ZO.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-CQLOYNJY.js → chunk-FM5WQ6ZU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-HXM7K6VH.js +100 -0
- package/dist/cli-bundle/focused-chunks/{chunk-7EKKUYN5.js → chunk-IIVDBAJM.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{chunk-ZYHGQIQ7.js → chunk-IJ3T3W4U.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-NGFDPEP7.js → chunk-IRYNVGKH.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-JFICNN4T.js +4 -0
- package/dist/cli-bundle/focused-chunks/chunk-KPASZGBL.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-YX75PQFO.js → chunk-L357ZAES.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-HCWDMFWA.js → chunk-LWBZ7UGG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-JD45Y2BR.js → chunk-M57KDG7I.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-MZNV26XE.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-NGHT2LNG.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-NJTKGBSK.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-7P6OGPEG.js → chunk-P55AZPFN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-RQYVX2T6.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-Q6JCMFGU.js → chunk-SXC3NVZI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-TQQO42C2.js +44 -0
- package/dist/cli-bundle/focused-chunks/{chunk-VNU3IFBL.js → chunk-U35K7FSE.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-UQJ4PY2Y.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-XVCMYFQU.js → chunk-WAP3DF4B.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-4SX2BN4V.js → chunk-XR6MLUVW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-XR745UGE.js +4 -0
- package/dist/cli-bundle/focused-chunks/field-definition-losses-GGA6FUHD.js +2 -0
- package/dist/cli-bundle/focused-chunks/{field-option-collisions-63YQ2J3N.js → field-option-collisions-7TG7STO7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-PG2VJ3MB.js → indexed-receipt-blobs-EUYZJR5R.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{item-revision-PV5O6F5Y.js → item-revision-J7EUGCHR.js} +2 -2
- package/dist/cli-bundle/focused-chunks/item-transaction-2IC2MLML.js +2 -0
- package/dist/cli-bundle/focused-chunks/{mutation-actor-2AAUJG2Z.js → mutation-actor-LJVF2HVD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/mutation-admission-SLFAUONA.js +2 -0
- package/dist/cli-bundle/focused-chunks/runtime-schema-IDRXWCC4.js +2 -0
- package/dist/cli-bundle/focused-chunks/{settlement-hook-4MGRERCT.js → settlement-hook-Q6MJQKIE.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{stage-56RYPMBK.js → stage-MWR73LTZ.js} +2 -2
- package/dist/cli-bundle/main.js +26 -26
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +1 -1
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +63 -63
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +1 -1
- package/dist/core/extensions/item-fields.d.ts +18 -1
- package/dist/core/extensions/item-fields.js +1 -1
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/fs/fs-utils.d.ts +8 -0
- package/dist/core/fs/fs-utils.js +2 -2
- package/dist/core/item/item-type-inspection.js +2 -0
- package/dist/core/item/type-registry.js +1 -1
- package/dist/core/schema/runtime-schema.d.ts +19 -0
- package/dist/core/schema/runtime-schema.js +2 -2
- package/dist/core/shared/url-credentials.d.ts +4 -2
- package/dist/core/shared/url-credentials.js +1 -1
- package/dist/core/store/settings.d.ts +7 -0
- package/dist/core/store/settings.js +5 -5
- package/dist/sdk/context-intent-contracts.js +1 -1
- package/dist/sdk/extension-command-context.js +2 -2
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/governance/validate.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/runtime/schema.js +1 -1
- package/dist/sdk/schema/field-definition-losses.js +1 -1
- package/dist/sdk/schema/schema-file-entry-losses.js +2 -0
- package/dist/sdk/test/execution.d.ts +9 -1
- package/dist/sdk/test/execution.js +4 -4
- package/docs/COMMANDS.md +3 -1
- package/docs/CONFIGURATION.md +23 -4
- package/docs/EXTENSIONS.md +1 -1
- package/docs/READ_OUTPUT_CONTRACTS.md +5 -0
- package/docs/SDK.md +19 -3
- package/docs/SDK_AUDITED_MUTATIONS.md +9 -0
- package/marketplace.json +1 -1
- package/node_modules/fast-json-patch/README.md +2 -2
- package/node_modules/fast-json-patch/dist/fast-json-patch.js +604 -818
- package/node_modules/fast-json-patch/dist/fast-json-patch.min.js +4 -8
- package/node_modules/fast-json-patch/package.json +14 -17
- package/package.json +2 -2
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +1 -1
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +1 -1
- package/dist/cli-bundle/chunks/chunk-2YD2AERA.js +0 -2
- package/dist/cli-bundle/chunks/chunk-54AQJTUH.js +0 -3
- package/dist/cli-bundle/chunks/chunk-56DKWGHE.js +0 -2
- package/dist/cli-bundle/chunks/chunk-56GUDMXN.js +0 -113
- package/dist/cli-bundle/chunks/chunk-5ECCMDSU.js +0 -2
- package/dist/cli-bundle/chunks/chunk-6RBD2AKU.js +0 -2
- package/dist/cli-bundle/chunks/chunk-D3I5AHNN.js +0 -2
- package/dist/cli-bundle/chunks/chunk-MO6PPUI6.js +0 -2
- package/dist/cli-bundle/chunks/chunk-RGE3XW3A.js +0 -2
- package/dist/cli-bundle/chunks/chunk-SP6CDM6B.js +0 -31
- package/dist/cli-bundle/chunks/chunk-WKDKBS4P.js +0 -4
- package/dist/cli-bundle/chunks/chunk-YLS2N4SN.js +0 -2
- package/dist/cli-bundle/chunks/field-definition-losses-JFMMMVTV.js +0 -2
- package/dist/cli-bundle/chunks/item-transaction-4XC74ULD.js +0 -2
- package/dist/cli-bundle/chunks/mutation-admission-SIUIMAEO.js +0 -2
- package/dist/cli-bundle/chunks/register-operations-KHJD4GFZ.js +0 -2
- package/dist/cli-bundle/chunks/runtime-schema-3RAXYNG5.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-5MZXU6HB.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-64DSKZJN.js +0 -100
- package/dist/cli-bundle/focused-chunks/chunk-A5B43EWU.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-E4C6T3NL.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-KMGI5GZP.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-MSLRDKWL.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-O33WUEAF.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-RBOWKXFV.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-TF57RHS2.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-X5ZVPFK7.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-Z4FWJGQG.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZHHFOQSL.js +0 -44
- package/dist/cli-bundle/focused-chunks/chunk-ZUAPUBJK.js +0 -2
- package/dist/cli-bundle/focused-chunks/field-definition-losses-NUZO3JCP.js +0 -2
- package/dist/cli-bundle/focused-chunks/item-transaction-S5QXBGAT.js +0 -2
- package/dist/cli-bundle/focused-chunks/mutation-admission-X7HHNERR.js +0 -2
- package/dist/cli-bundle/focused-chunks/runtime-schema-5J2ONRNV.js +0 -2
- package/node_modules/fast-json-patch/webpack.config.js +0 -63
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{D as V,Z as G}from"./chunk-WKDKBS4P.js";import{A as p,C as m}from"./chunk-6OIHST4I.js";import Te from"node:crypto";function Re(e){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return e.toString();if(e===void 0)return"undefined";if(typeof e=="symbol")return e.toString();if(typeof e=="function")return`[function:${e.name||"anonymous"}]`}function Ie(e){let t=Object.keys(e).sort(),n={};for(let r of t){let o=e[r];o!==void 0&&(n[r]=$(o))}return n}function $(e){let t=Re(e);if(t!==void 0)return t;if(Array.isArray(e))return e.map(r=>$(r));if(e instanceof Date)return e.toISOString();let n=e;if(typeof n.toJSON=="function"){let r=n.toJSON();if(r!==e)return $(r)}return Ie(e)}function _(e){return JSON.stringify($(e))}function B(e,t,n,r){for(let o=0;o<t.length;o+=1)if(!n.has(o)&&r(e,t[o]))return n.add(o),!0;return!1}function De(e,t){if(e instanceof RegExp||t instanceof RegExp)return e instanceof RegExp&&t instanceof RegExp&&e.toString()===t.toString()}function Ne(e,t){if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}function ke(e,t){if(!(e instanceof Set||t instanceof Set))return;if(!(e instanceof Set&&t instanceof Set)||e.size!==t.size)return!1;let n=[...t],r=new Set;for(let o of e)if(!B(o,n,r,E))return!1;return!0}function Le(e,t){if(!(e instanceof Map||t instanceof Map))return;if(!(e instanceof Map&&t instanceof Map)||e.size!==t.size)return!1;let n=[...t.entries()],r=new Set;for(let[o,i]of e.entries())if(!B([o,i],n,r,([a,c],[u,l])=>E(a,u)&&E(c,l)))return!1;return!0}function Pe(e,t){if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((n,r)=>E(n,t[r]))}function Fe(e,t){let n=Object.keys(e).sort((o,i)=>o.localeCompare(i)),r=Object.keys(t).sort((o,i)=>o.localeCompare(i));if(n.length!==r.length)return!1;for(let o=0;o<n.length;o+=1){let i=n[o];if(i!==r[o]||!E(e[i],t[i]))return!1}return!0}var Ue=[De,Ne,ke,Le,Pe];function E(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;for(let n of Ue){let r=n(e,t);if(r!==void 0)return r}return Fe(e,t)}function mn(e){return Te.createHash("sha256").update(e,"utf8").digest("hex")}function gn(e,t){let n={};for(let o of t){let i=e[o];i!==void 0&&(n[o]=i)}let r=Object.keys(e).filter(o=>!t.includes(o)).sort((o,i)=>o.localeCompare(i));for(let o of r){let i=e[o];i!==void 0&&(n[o]=i)}return n}var ve=[["history-redact","history redact"],["history-repair","history repair"],["history-compact","history compact"],["activity","history activity"],["restore","history restore"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"commander",owner:"pm-tqel"})),je=[...["next","focus"].map(e=>({alias:e,canonical:`context ${e}`,owner:"pm-kcs4"})),...["stats","health","validate","gc","telemetry","eval","test-all"].map(e=>({alias:e,canonical:`ops ${e}`,owner:"pm-6apl"})),...["normalize","reindex"].map(e=>({alias:e,canonical:`ops ${e}`,owner:"pm-3i9q8g"})),{alias:"events",canonical:"history events",owner:"pm-3i9q8g"}].map(e=>({...e,canonical_argv:e.canonical.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap"})),ze=[["update-many","update many"],["close-many","close many"],["delete","close delete"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-ik19"})),He=[...je,...ze,...["init","config","schema","profile"].map(e=>({alias:e,canonical:`workspace ${e}`,canonical_argv:["workspace",e],lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-npr3"})),...[...["comments","notes","learnings","files","docs","deps","append","test"].map(e=>[e,`item ${e}`,"pm-yql1"]),["test-runs-worker","item test worker","pm-lp4j"],...["statuses","tags","types"].map(e=>[`completion-${e}`,`completion ${e}`,"pm-szdc"]),["history-author-acknowledge","history acknowledge","pm-djyvbk"],["copy","item copy","pm-m6g87m"],["merge","workspace merge","pm-m6g87m"],["duplicates","item duplicates","pm-fmy9ih"],["dedupe-audit","item duplicates audit","pm-fmy9ih"],["dedupe-merge","item duplicates merge","pm-fmy9ih"],["comments-audit","item audit-comments","pm-fmy9ih"],["search-advanced","search advanced","pm-wfskfn"],...["meet","event","remind"].map(e=>[e,`calendar ${e}`,"pm-o3fh"])].map(([e,t,n])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:n}))],T=[{alias:"history-attest",canonical:"history attest",canonical_argv:["history","attest"],lifecycle:"permanent",hidden:!0,registration:"commander",owner:"pm-3z0k"},...ve,...He,...["discover","lookup"].map(e=>({alias:`files ${e}`,canonical:`item files ${e}`,canonical_argv:["item","files",e],lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-yql1"}))];function yn(e){let t;for(let n of T)n.canonical_argv.length<=(t?.canonical_argv.length??0)||n.canonical_argv.every((r,o)=>r===(o===0&&e[o]==="ctx"?"context":e[o]))&&(t=n);return t}function qe(e){let t=e.trim().replace(/\s+/gu," ");return T.find(n=>n.canonical===t.replace(/^ctx /u,"context "))?.alias??t}function _n(e){return qe(e)}var Z=[...T,...[["ctx","context"],["packages","package"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:[t],lifecycle:"permanent",hidden:!1,registration:"commander",owner:"pm-pbyu"})),...[["start-task","claim","--start"],["pause-task","release","--pause"],["close-task","close","--release-assignment"]].map(([e,t,n])=>({alias:e,canonical:t,canonical_argv:[t,n],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-eq4x"})),{alias:"tests",canonical:"item test",canonical_argv:["item","test"],lifecycle:"permanent",hidden:!1,registration:"bootstrap",owner:"pm-u4t9gp"},...[["fetch","get"],["read","get"],["show","get"],["view","get"],["comment","comments"],["note","notes"],["learning","learnings"]].map(([e,t])=>({alias:e,canonical:["comments","notes","learnings"].includes(t)?`item ${t}`:t,canonical_argv:["comments","notes","learnings"].includes(t)?["item",t]:[t],lifecycle:"permanent",hidden:!1,registration:"bootstrap",owner:"pm-pbyu"})),...[["extension scaffold","extension init"],["package scaffold","package init"],["packages scaffold","package init"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!1,registration:"commander",owner:"pm-ya7x55"})),...[["extension list","package inventory"],["package list","package inventory"],["packages list","package inventory"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!1,registration:"commander",owner:"pm-gh1777"})),{alias:"list-all",canonical:"list",canonical_argv:["list","--all"],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-pfqi"},...[["list-draft","draft"],["list-open","open"],["list-in-progress","in_progress"],["list-blocked","blocked"],["list-closed","closed"],["list-canceled","canceled"]].map(([e,t])=>({alias:e,canonical:"list",canonical_argv:["list","--status",t],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-pfqi"})),...[["extension","package"],["install","package install"],["upgrade","package upgrade"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-tnud"}))],Sn=Object.fromEntries(Z.filter(e=>e.registration==="bootstrap").map(e=>[e.alias,e.canonical]));function An(e){let t=e.trim().toLowerCase();return Z.find(n=>n.alias===t)}function En(e){return`Deprecated command \`${e.alias}\`; use \`pm ${e.canonical_argv.join(" ")}\`.`}var We="PM_COMMAND_SHELL",Ve=new Map([["posix","posix"],["sh","posix"],["bash","posix"],["zsh","posix"],["cmd","cmd"],["cmd.exe","cmd"],["powershell","powershell"],["pwsh","powershell"]]),K=(e=process.platform,t=process.env)=>{let n=t[We]?.trim().toLowerCase(),r=n===void 0?void 0:Ve.get(n);return r!==void 0?r:e==="win32"?"cmd":"posix"},R=e=>{let t='"',n=0;for(let r of e){if(r==="\\"){n+=1;continue}t+="\\".repeat(r==='"'?n*2+1:n),t+=r,n=0}return`${t}${"\\".repeat(n*2)}"`},X=new Set(["(",")","!","^",'"',"<",">","&","|"]),I=e=>{let t="";for(let n=0;n<e.length;n+=1){let r=e[n];if(X.has(r)){t+=`^${r}`;continue}t+=r,r==="%"&&!X.has(e.charAt(n+1))&&(t+="^")}return t},Ge=/["%]/u,Be=/\r\n|[\r\n]/gu,Ze=e=>{let t=e.replace(Be," "),n=R(t);return Ge.test(t)?I(n):n},Xe=/['\u2018\u2019\u201A\u201B]/gu,D=e=>e.replace(Xe,"$&$&"),Ke=e=>`'${D(e)}'`,Ye={posix:/^(?!=)[A-Za-z0-9._:/@=-]+$/u,cmd:/^[A-Za-z0-9._:/\\@=-]+$/u,powershell:/^(?!--$)[A-Za-z0-9._:/\\=-][A-Za-z0-9._:/\\@=-]*$/u},Je=(e,t=process.platform,n)=>{let r=n??K(t);return Ye[r].test(e)?e:r==="cmd"?Ze(e):r==="powershell"?Ke(e):et(e)},Qe=/!|[\r\n]|\\$/u,et=e=>Qe.test(e)?`'${e.replaceAll("'","'\\''")}'`:`"${e.replace(/(["\\$`])/g,"\\$1")}"`,bn=(e,t=process.platform,n)=>{let r=n??K(t),o=e.map(i=>Je(i,t,r)).join(" ");return o.length>0?`pm ${o}`:"pm"};import{AsyncLocalStorage as tt}from"node:async_hooks";var te="[redacted]",nt=/%\^?40/giu,k=/@|%\^?40/iu;function ne(e,t=e.length){let n=-1;for(let r of e.matchAll(nt)){if(r.index>t)break;n=r.index}return n}function rt(e,t){if(/[\t\n\r]/u.test(e)||!/(?:^|[^A-Za-z0-9+.-])(?:https?|wss?|ftp)$/iu.test(e.slice(0,t)))return!1;let n=t+1;for(;e[n]==="/"||e[n]==="\\";)n+=1;let r=e.indexOf("/",n)-n;if(r<0)return!1;let o=n+r;return!/[:@%]/u.test(e.slice(n,o))&&!/[:%]|[/\\][/\\]/u.test(e.slice(o))}function L(e){let t=Math.max(e.lastIndexOf("@"),ne(e)),n=e.indexOf(":");if(t<0||n<0||n>t)return;let r=n+1;for(;r<t&&r<n+3&&(e[r]==="/"||e[r]==="\\");)r+=1;return r===t||rt(e,n)?void 0:[r,t]}function P(e){let t=L(e);return t?`${e.slice(0,t[0])}${te}${e.slice(t[1])}`:e}function re(e){return P(e)}var oe=["author","assignee","claim_principal"];function Tn(e){let t={...e};for(let n of oe)typeof t[n]=="string"&&(t[n]=re(t[n]));return t}function ie(e,t){if(!(typeof e!="string"||L(e.trim())===void 0))throw new m(`${t} must not carry URL credentials: an identity is a name, never a credential.`,p.USAGE,{code:"invalid_argument_value",field:t,required:`Set ${t} to a plain name such as agent-a, with no URL userinfo (no user, password or token before the host).`,nextSteps:[`Rerun with ${t} set to a plain name.`],url_credentials_rejected:{source:t}})}function Rn(e,t){return ie(e,t),e}var ot=[["comments","author"],["notes","author"],["learnings","author"],["dependencies","author"],["plan_decisions","author"],["plan_discoveries","author"],["plan_steps","owner"],["tests","provenance","author"],["tests","updated_by"]],it=4;function N(e,t,n=0){if(typeof e=="string"){ie(e,t);return}if(!(n>=it||typeof e!="object"||e===null))for(let r of Object.values(e))N(r,t,n+1)}function st(e,t){let n=e;for(let r of t){if(typeof n!="object"||n===null||Array.isArray(n))return;n=n[r]}return n}function se(e){let t=e;for(let n of oe)N(t[n],n);for(let[n,...r]of ot){let o=t[n];Array.isArray(o)&&o.forEach((i,s)=>{N(st(i,r),`${n}[${s}].${r.join(".")}`)})}}function In(e){return typeof e=="string"?re(e):e}var b=6,at=65536,ae={carried:!1,fragments:new Set,fragmentLength:b,shortSpellings:[]},F=new tt;function ce(e){let t=e.toLowerCase();if(t.length===e.length)return t;let n="";for(let r of e){let o=r.toLowerCase();n+=o.length===r.length?o:r}return n}function ct(e){let t=R(`${e}@`),n=[e,e.replaceAll(/(["\\$`])/gu,"\\$1"),e.replaceAll("'","'\\''"),t.slice(1,-2),I(t).slice(2,-3),D(e)];return[...n,...n.map(r=>JSON.stringify(r).slice(1,-1))]}function ut(e){let t=e.indexOf(":");return t>=0&&t<e.length-1?e.slice(t+1):e}function lt(e){let t=new Set,n=!1;for(let u of e){let l=L(u);if(l){n=!0;for(let d of ct(ut(u.slice(l[0],l[1]))))t.add(ce(d))}}let r=[...t],o=r.reduce((u,l)=>u+Math.max(0,l.length-b+1)+1,0),i=Math.max(1,Math.ceil(o/at)),s=Math.max(b,i),a=new Set,c=new Set;for(let u of r){if(u.length<s){(u.length>=b||/\s/u.test(u))&&c.add(u);continue}for(let l=0;l+s<=u.length;l+=i)a.add(u.slice(l,l+s));a.add(u.slice(-s))}return{carried:n,fragments:a,fragmentLength:s,shortSpellings:[...c]}}function dt(e,t){let n=ce(e),r=new Uint8Array(e.length),o=!1,i=t.fragmentLength;for(let a=0;a+i<=n.length;a+=1)t.fragments.has(n.slice(a,a+i))&&(r.fill(1,a,a+i),o=!0);for(let a of t.shortSpellings)for(let c=n.indexOf(a);c>=0;c=n.indexOf(a,c+1))r.fill(1,c,c+a.length),o=!0;if(!o)return e;let s="";for(let a=0;a<e.length;a+=1)r[a]?(a===0||!r[a-1])&&(s+=te):s+=e[a];return s}function Dn(e,t){return F.run(lt(e),t)}function Nn(){return(F.getStore()??ae).carried}var ft=16,ue=512,pt=/^(?:(?:[A-Za-z0-9-]+\.)+[A-Za-z0-9-]+|localhost):\d+$/iu,mt=260,gt={'"':'"',"'":"'","`":"`","<":">","(":")","[":"]"},ht=new Set(["http","https","ws","wss","ftp","file"]);function Y(e,t=!1){let n=$t(e);if(n<0)return;let r=j(e,n);if(n-r<2)return;let o=gt[e[r-1]??""],i=ht.has(e.slice(r,n).toLowerCase()),s=n+1;for(;s<e.length&&(e[s]==="/"||e[s]==="\\");)s+=1;if(s===e.length)return{kind:"pending",closer:o,special:i};let a=U(e.slice(s),o);if(a.startsWith("[")||i&&/[/\\?#]/u.test(a)||v(a,o)>=0)return;let c=bt(a,t);return c===void 0?void 0:{kind:c,closer:o,special:i}}var yt=new Set([")","]"]),_t="'\\''",St="'\\\\''";function U(e,t){return t==="'"?J(e.replaceAll(St,"_____").replaceAll(_t,"____")):t==='"'?J(e):e}function le(e,t){let n=t;for(;e[n]==="\\";)n+=1;return n}function At(e,t,n){let r=(n-t)%2===1;if(e[n]==='"')return r?n:-1;if(e[n]!=="^")return-1;if(e[n+1]==='"')return r?n+1:-1;let o=le(e,n+1);return e[o]==='"'&&(o-n-1)%2===1?o:-1}function J(e){let t=[],n=0;for(let r=e.indexOf("\\");r>=0;r=e.indexOf("\\",r)){let o=le(e,r),i=At(e,r,o);i>=0&&(t.push(e.slice(n,r),"_".repeat(i+1-r)),n=i+1),r=i>=0?i+1:o}return n===0?e:`${t.join("")}${e.slice(n)}`}function v(e,t){if(t===void 0)return-1;if(!yt.has(t))return Et(e,t);let n=e.length;for(;n>0&&/[.,;:!?*_~`]/u.test(e[n-1]);)n-=1;return n>0&&e[n-1]===t?n-1:-1}function Et(e,t){for(let n=e.indexOf(t);n>=0;n=e.indexOf(t,n+1)){if(t==="'"&&e[n+1]==="'"){n+=1;continue}let r=0;for(;n-r>0&&e[n-r-1]==="\\";)r+=1;if(r%2===0)return n}return-1}function $t(e){let t=-1;for(let n=e.length-2;n>=0;n-=1){if(e[n]!==":"||e[n+1]!=="/"&&e[n+1]!=="\\")continue;let r=j(e,n);if(r===0||/[=?&#"'`(<[{,]/u.test(e[r-1]))return n;t=n}return t}function j(e,t){let n=t;for(;n>0&&/[A-Za-z0-9+.-]/u.test(e[n-1]);)n-=1;return n}function bt(e,t){return e.includes(":")?!t&&e.length<=mt&&pt.test(e)?void 0:"user":k.test(e)?void 0:"label"}function wt(e,t,n,r=-1){let o=Math.min(e.length,t+ue),i=t,s=r,a=n.kind==="user",c=!1;for(let u=0;u<ft&&i<o;u+=1){let l=de(e,i,o);if(l===void 0)break;let d=Ct(e.slice(l[0],Math.min(l[1],o+3)),o-l[0],n);if(d.startsUrl)break;Ot(d,a,c)&&(s=l[1]);let f=/[\t\r\n]/u.test(e[l[1]]??"");if(a||=d.colon||d.trailingColon&&f,c||=d.trailingColon,d.endsAuthority)break;i=l[1]}return s}function Ot(e,t,n){return e.separator?t||e.colonBeforeSeparator||n&&(e.hasPath||e.closedByOpener):!1}function de(e,t,n){let r=t;for(;r<n&&/\s/u.test(e[r]);)r+=1;if(r===n)return;let o=r;for(;o<e.length&&!/\s/u.test(e[o]);)o+=1;return[r,o]}function Q(e){let t=e.indexOf(":");return t>=0&&t<e.length-1&&!xt.test(e)}var xt=/^\d{1,2}:\d{2}(?::\d{2})?(?:\.\d+)?(?:Z|[AaPp][Mm])?[.,;:!?)]*$/u;function Ct(e,t,n){let r=U(e,n.closer),o=n.special?r.search(/[/\\?#]/u):-1,i=o<0?r:r.slice(0,o),s=v(i,n.closer),a=r.search(/:[/\\]/u),c=s<0?i:i.slice(0,s),u=Math.min(c.length,t)-1,l=u<0?-1:Math.max(c.lastIndexOf("@",u),ne(c,u));return{startsUrl:a>=0&&s<0&&Mt(r.slice(0,a+1)),separator:l>=0,colonBeforeSeparator:l>0&&(Q(c.slice(0,l))||c[l-1]===":"),colon:Q(c),trailingColon:c.endsWith(":"),hasPath:s<0&&l>=0&&/[/\\]/u.test(r.slice(l+1)),closedByOpener:s>=0,endsAuthority:o>=0||s>=0}}function Mt(e){let t=j(e,e.length-1);return t<e.length-2&&/[A-Za-z]/u.test(e[t])&&(t===0||t===1&&/["'`(<[]/u.test(e[0]))}function Tt(e,t,n){let r=Y(t,/[\t\r\n]/u.test(e.charAt(n)));if(r?.kind!=="pending")return r===void 0?void 0:{opening:r,from:n,seed:-1,final:!1};let o=de(e,n,Math.min(e.length,n+ue));if(o===void 0)return;let i=U(e.slice(o[0],o[1]),r.closer),s=/^[/\\]*/u.exec(i)[0],a=i.slice(s.length),c=r.special?a.split(/[/\\?#]/u,1)[0]:a,u=v(c,r.closer),l=`${s}${u<0?c:c.slice(0,u)}`,d=k.test(l),f=d?{...r,kind:"user"}:Y(`${t}${l}`);if(f===void 0||f.kind==="pending")return;let g=d?o[1]:-1;return{opening:f,from:o[1],seed:g,final:l.length<i.length}}function Rt(e){if(!/:[/\\]/u.test(e))return e;let t=/\S+/gu,n="",r=0;for(let o=t.exec(e);o!==null;o=t.exec(e)){let i=Tt(e,o[0],o.index+o[0].length);if(i===void 0)continue;let s=i.final?i.seed:wt(e,i.from,i.opening,i.seed);s!==-1&&(n+=`${e.slice(r,o.index)}${P(e.slice(o.index,s))}`,r=s,t.lastIndex=s)}return r===0?e:`${n}${e.slice(r)}`}function kn(e){let t=F.getStore()??ae,n=ee(e);return t.carried?ee(dt(n,t)):n}function ee(e){return k.test(e)?Rt(e).replaceAll(/\S+/gu,P):e}import It from"node:crypto";import{AsyncLocalStorage as Dt}from"node:async_hooks";var w=new Dt,fe=1024;function Nt(e){let t=Date.parse(e.clock);if(!Number.isFinite(t))throw new Error(`Invalid reproducible workspace clock: ${e.clock}`);if(!Number.isSafeInteger(e.tickMs)||e.tickMs<0)throw new Error("Reproducible workspace tickMs must be a non-negative integer");if(e.seed.trim().length===0)throw new Error("Reproducible workspace seed must not be empty");return{...e,clock:new Date(t).toISOString()}}function kt(e){let n={...Nt(e),clockReads:0,tokenReads:0};return r=>w.run(n,r)}async function Un(e,t){return kt(e)(t)}function vn(){return w.getStore()!==void 0}function pe(){let e=w.getStore();if(e===void 0)return;let t=new Date(Date.parse(e.clock)+e.clockReads*e.tickMs).toISOString();return e.clockReads+=1,t}function jn(e){let t=w.getStore();if(t===void 0)return;if(!Number.isSafeInteger(e)||e<0||e>fe)throw new Error(`Reproducible token length must be an integer between 0 and ${fe}`);let n="";for(;n.length<e;){let r=It.createHash("sha256").update(`${t.seed}\0${t.tokenReads}`).digest();t.tokenReads+=1;for(let o of r)if(n+=(o%36).toString(36),n.length===e)break}return n}var Lt=/^([+-]?)(\d+)([hdwm])$/i,Pt=/^[+-]?\d+[hdwm](?:[+-]\d+[hdwm])+$/i,Ft=/^(\d{4})(\d{2})(\d{2})$/,Ut=/^(\d{4})(\d{2})(\d{2})(?:[T\s]?)(\d{2})(\d{2})(\d{2})?([.,]\d{1,3})?(Z|[+-]\d{2}:?\d{2})?$/i,vt=/^(\d{4}-\d{2}-\d{2})[T\s](\d{2})-(\d{2})(?:-(\d{2}))?([.,]\d{1,3})?(Z|[+-]\d{2}:?\d{2})?$/i,jt=/^(\d{4}-\d{2}-\d{2})[T\s](\d{2})(\d{2})(\d{2})?([.,]\d{1,3})?(Z|[+-]\d{2}:?\d{2})?$/i,zt=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(?:Z|[+-](\d{2}):(\d{2}))$/i;function Gn(){return pe()??new Date().toISOString()}function Bn(e){return Number.isFinite(Date.parse(e))}function q(e){let t=zt.exec(e);if(!t||!Number.isFinite(Date.parse(e)))return!1;let[,n,r,o,i,s,a,c,u]=t,[l,d,f,g,h,y]=[n,r,o,i,s,a].map(Number);return d>=1&&d<=12&&f>=1&&f<=W(l,d-1)&&g<=23&&h<=59&&y<=59&&(c===void 0||Number(c)<=23)&&(u===void 0||Number(u)<=59)}function Zn(e){let t=/\.(\d+)(?:Z|[+-]\d{2}:\d{2})$/iu.exec(e)?.[1];return q(e)&&(t===void 0||/^\d{0,3}0*$/u.test(t))}var Ht=1e4,O=new Map;function me(e){let t=O.get(e);if(t!==void 0)return t;let n=Date.parse(e);return O.size>=Ht&&V(O),O.set(e,n),n}function A(e,t){let n=me(e),r=me(t);return Number.isFinite(n)&&Number.isFinite(r)&&n!==r?n-r:e.localeCompare(t)}function Xn(e,t){return!(t.deadlineBefore&&(!e.deadline||A(e.deadline,t.deadlineBefore)>0)||t.deadlineAfter&&(!e.deadline||A(e.deadline,t.deadlineAfter)<0)||t.updatedAfter&&A(e.updated_at,t.updatedAfter)<0||t.updatedBefore&&A(e.updated_at,t.updatedBefore)>0||t.createdAfter&&A(e.created_at,t.createdAfter)<0||t.createdBefore&&A(e.created_at,t.createdBefore)>0)}function z(e){return e?`.${e.slice(1).padEnd(3,"0").slice(0,3)}`:""}function H(e){if(!e)return"";if(e.toUpperCase()==="Z")return"Z";let t=/^([+-]\d{2})(\d{2})$/.exec(e);return t?`${t[1]}:${t[2]}`:e}function qt(e,t,n){n&&n!==t&&(e.includes(n)||e.push(n))}function Wt(e){let t=[],n=u=>qt(t,e,u),r=Ft.exec(e);if(r){let[,u,l,d]=r;n(`${u}-${l}-${d}`)}let o=Ut.exec(e);if(o){let[,u,l,d,f,g,h,y,Ce]=o,Me=h?`:${h}`:"";n(`${u}-${l}-${d}T${f}:${g}${Me}${z(y)}${H(Ce)}`)}let i=vt.exec(e);if(i){let[,u,l,d,f,g,h]=i,y=f?`:${f}`:"";n(`${u}T${l}:${d}${y}${z(g)}${H(h)}`)}let s=jt.exec(e);if(s){let[,u,l,d,f,g,h]=s,y=f?`:${f}`:"";n(`${u}T${l}:${d}${y}${z(g)}${H(h)}`)}let a=10,c=e.slice(0,a);if(Gt(c)){let u=a;for(;u<e.length&&Bt(e[u]);)u+=1;u<e.length&&n(`${c}T${e.slice(u)}`)}return t}function Vt(e){let t=Date.parse(e);if(Number.isFinite(t))return t;for(let n of Wt(e)){let r=Date.parse(n);if(Number.isFinite(r))return r}return Number.NaN}function Gt(e){if(e.length!==10)return!1;for(let t=0;t<e.length;t+=1){let n=e[t];if(t===4||t===7){if(n!=="-")return!1;continue}let r=n.charCodeAt(0);if(r<48||r>57)return!1}return!0}function Bt(e){return e?e===" "||e===" "||e===`
|
|
2
|
-
`||e==="\r"||e==="\f"||e==="\v":!1}function W(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}var Zt=["January","February","March","April","May","June","July","August","September","October","November","December"],Xt=/^(\d{4})-(\d{2})-(\d{2})/,Kt=/^(\d{4})(\d{2})(\d{2})(?:[T ]?\d{2}|$)/;function Yt(e,t,n){let r=Xt.exec(t)??Kt.exec(t);if(!r)return;let o=Number.parseInt(r[1],10),i=Number.parseInt(r[2],10),s=Number.parseInt(r[3],10),a=n?.trim()||"deadline";if(i<1||i>12)throw new m(`Invalid ${a} value "${e}". Month "${r[2]}" is out of range \u2014 use a month between 01 and 12.`,p.USAGE,{field:a,value:e});let c=W(o,i-1);if(s<1||s>c)throw new m(`Invalid ${a} value "${e}". ${Zt[i-1]} ${o} has ${c} days, so day "${r[3]}" does not exist. Use a real YYYY-MM-DD calendar date.`,p.USAGE,{field:a,value:e})}function Jt(e,t){let n=new Date(e.getTime()),r=n.getUTCDate(),o=n.getUTCMonth()+t,i=n.getUTCFullYear()+Math.floor(o/12),s=(o%12+12)%12,a=Math.min(r,W(i,s));return n.setUTCFullYear(i,s,a),n}function Kn(e,t=new Date,n="deadline"){let r=e.trim();if(r.toLowerCase()==="now")return t.toISOString();let o=Lt.exec(r);if(o){let s=o[1]==="-"?-1:1,a=Number.parseInt(o[2],10)*s,c=o[3].toLowerCase();if(c==="m")return Jt(t,a).toISOString();let u=c==="h"?3600*1e3:c==="d"?1440*60*1e3:10080*60*1e3;return new Date(t.getTime()+a*u).toISOString()}Yt(e,r,n);let i=Vt(r);if(!Number.isFinite(i)){let s=n.trim().length>0?n.trim():"deadline",a=Pt.test(r)?"Compound relative expressions like +3d+1h are not supported; use a single relative token (for example +3d) or an ISO/date string.":'Use ISO/date string input, "now", or relative +6h/-6h/+1d/-1d/+2w/-2w/+6m/-6m.';throw new m(`Invalid ${s} value "${e}". ${a}`,p.USAGE,{field:s,value:e})}return new Date(i).toISOString()}function Qt(e){let t=e.trim();return t.startsWith("-")&&!t.startsWith("--")}var ge=/[\s|,=<>[\]]/u;function en(e){let t=e.trim();if(Qt(t))return t.length===2&&!ge.test(t[1])?void 0:"is not a short flag: a short flag is one dash and one character";let n=t.replace(/^--/u,"");if(n.length===0)return"is empty";if(n.startsWith("-"))return"starts with three dashes";if(n.endsWith("-")||n.includes("--"))return"has an empty segment between hyphens, which the option parser cannot turn into an option key";let r=ge.exec(n)?.[0];if(r!==void 0)return/\s/u.test(r)?"contains whitespace, which the option parser reads as a break between two flags":`contains ${JSON.stringify(r)}, which the option parser reads as ${r==="|"||r===","?"a break between two flags":r==="="?"the start of an attached value":"a value placeholder"}`}var tn=new Set(["-h","help"]);function he(e){let t=e.trim();return en(t)===void 0&&!tn.has(t.replace(/^--/u,""))}var nn=16;function x(e){let t=e.trim().replaceAll(/[^A-Za-z0-9]+/g," ").split(/\s+/).filter(o=>o.length>0).map(o=>o.toLowerCase());if(t.length===0)return e;let[n,...r]=t;return`${n}${r.map(o=>`${o.slice(0,1).toUpperCase()}${o.slice(1)}`).join("")}`}function sr(e,t,n=new Set,r){if(Ae(e,t,r))return;let o=Ee(e,t,n,r),i=C(e);return[x(e.cli_flag),...i].find(a=>!o.has(a)&&Se(a,i,o))}function Se(e,t,n){for(let r of t){if(r===e)break;if(n.has(r))return!1}return!0}function Ae(e,t,n){return t.definitions.some(r=>r!==e&&r.metadata_key===e.metadata_key&&(n===void 0||r.commands.includes(n)))}function Ee(e,t,n,r){return new Set([...n,...t.definitions.filter(o=>o!==e&&(r===void 0||o.commands.includes(r))).flatMap(o=>C(o))])}function $e(e){return e.replace(/^-+/u,"").startsWith("no-")}function rn(e){return e.startsWith("-")?e:`--${e}`}function ar(e,t,n,r){if(Ae(e,t,r))return;let o=Ee(e,t,n.options,r),i=C(e);return[e.cli_flag,...e.cli_aliases].find(s=>{if(!he(s))return!1;let a=be(s);return $e(s)||n.flags.has(rn(s))||o.has(a)?!1:Se(a,i,o)})}function be(e){return e.replace(/^-+/u,"").replace(/^no-/u,"").split("-").reduce((t,n)=>`${t}${n.charAt(0).toUpperCase()}${n.slice(1)}`)}function C(e){return[...new Set([G(e),x(e.key),x(e.cli_flag),...e.cli_aliases.map(t=>x(t)),...[e.cli_flag,...e.cli_aliases].filter(t=>!$e(t)).map(t=>be(t))])]}function we(e,t){for(let n of C(t)){if(!Object.hasOwn(e,n))continue;let r=e[n];if(r!==void 0)return r}}function Oe(e){return Array.isArray(e)?e.flatMap(t=>Oe(t)).map(t=>t.trim()).filter(t=>t.length>0):typeof e=="string"?e.split(/[,\n|]/).map(t=>t.trim()).filter(t=>t.length>0):e==null?[]:[String(e).trim()].filter(t=>t.length>0)}function ye(e,t){if(typeof e=="boolean")return e;if(typeof e=="number"){if(e===1)return!0;if(e===0)return!1}if(typeof e=="string"){let n=e.trim().toLowerCase();if(n==="true"||n==="1"||n==="yes")return!0;if(n==="false"||n==="0"||n==="no")return!1}throw new m(`${t} must be one of true|false|1|0|yes|no`,p.USAGE)}function _e(e,t){if(typeof e=="number"&&Number.isFinite(e))return e;let n=typeof e=="string"?e.trim():String(e),r=Number(n);if(!Number.isFinite(r))throw new m(`${t} must be a number`,p.USAGE);return r}function on(e,t,n){let r=typeof e=="string"?(()=>{try{return JSON.parse(e)}catch{return}})():e;if(n==="array"&&Array.isArray(r)||n==="object"&&typeof r=="object"&&r!==null&&!Array.isArray(r))return r;throw new m(`${t} must be valid JSON ${n}`,p.USAGE)}function sn(e,t){return t===void 0?!0:t==="array"?Array.isArray(e):t==="object"?typeof e=="object"&&e!==null&&!Array.isArray(e):typeof e===t}function an(e,t,n){if(t.const!==void 0&&_(e)!==_(t.const))return`${n} must equal ${_(t.const)}`;if(t.enum!==void 0&&!t.enum.some(r=>_(r)===_(e)))return`${n} must be one of ${t.enum.map(r=>_(r)).join("|")}`;if(!sn(e,t.type))return`${n} must match configured type ${String(t.type)}`;if(typeof e=="string"){if(t.min_length!==void 0&&e.length<t.min_length)return`${n} must contain at least ${t.min_length} characters`;if(t.format==="date-time"&&!q(e))return`${n} must be an RFC 3339 date-time`}}function cn(e,t,n,r){if(Array.isArray(e)){if(t.min_items!==void 0&&e.length<t.min_items)return`${n} must contain at least ${t.min_items} items`;if(t.items)for(let[o,i]of e.entries()){let s=M(i,t.items,`${n}[${o}]`,r+1);if(s)return s}}}function un(e,t,n,r){if(typeof e!="object"||e===null||Array.isArray(e))return;let o=e;for(let i of t.required??[])if(!Object.hasOwn(o,i))return`${n}.${i} is required`;for(let[i,s]of Object.entries(o)){let a=t.properties?.[i];if(!a){if(t.additional_properties===!1)return`${n}.${i} is not allowed`;continue}let c=M(s,a,`${n}.${i}`,r+1);if(c)return c}}function M(e,t,n,r=0){if(r>nn)return`${n} value schema exceeds maximum depth`;let o=an(e,t,n);if(o)return o;let i=cn(e,t,n,r);if(i)return i;let s=un(e,t,n,r);if(s)return s;if(!t.one_of)return;let a=0;for(let c of t.one_of)if(M(e,c,n,r+1)===void 0&&(a+=1,a>1))break;return a===1?void 0:`${n} must match exactly one configured schema variant`}function S(e,t,n){if(!e.value_schema||t===void 0)return t;let r=M(t,e.value_schema,n);if(r)throw new m(r,p.USAGE);return t}function ln(e,t,n,r){let o=r==="option"&&Array.isArray(t)?t[t.length-1]:t;if(o!==void 0)return S(e,on(o,n,e.type),n)}function xe(e,t,n,r="option"){let o=n??`--${e.cli_flag}`;if(e.type==="array"||e.type==="object")return ln(e,t,o,r);if(e.repeatable||e.type==="string_array"){let s=Oe(t);return e.type==="number"?S(e,s.map(a=>_e(a,o)),o):e.type==="boolean"?S(e,s.map(a=>ye(a,o)),o):S(e,s,o)}let i=Array.isArray(t)?t[t.length-1]:t;if(i!==void 0)return e.type==="number"?S(e,_e(i,o),o):e.type==="boolean"?S(e,ye(i,o),o):S(e,typeof i=="string"?i:String(i),o)}function dn(e,t){return!e.required&&!e.required_on_create?!1:e.required_types.length===0?!0:t?e.required_types.map(n=>n.toLowerCase()).includes(t.trim().toLowerCase()):!1}function cr(e,t,n){let r={},o=[];for(let i of t.command_to_fields.get("create")??[]){let s=we(e,i);if(s===void 0){dn(i,n)&&o.push(`--${i.cli_flag}`);continue}r[i.metadata_key]=xe(i,s)}return{values:r,missing_required_flags:[...new Set(o)].sort((i,s)=>i.localeCompare(s))}}function ur(e,t,n=["update"]){let r={},o=(n??["update"]).flatMap(s=>t.command_to_fields.get(s)??[]),i=new Set;for(let s of o){let a=we(e,s);a!==void 0&&(i.has(s.metadata_key)||(i.add(s.metadata_key),r[s.metadata_key]=xe(s,a)))}return se(r),r}var fn=Object.freeze([{flag:"--json"},{flag:"--lean"},{flag:"--token-accounting"},{flag:"--output-include",value_name:"fields",extension_command_availability:"read_output"},{flag:"--output-limit",value_name:"count",extension_command_availability:"read_output"},{flag:"--output-budget",value_name:"tokens",extension_command_availability:"read_output"},{flag:"--output-format",value_name:"toon|json"},{flag:"--output-session",value_name:"state",extension_command_availability:"read_output"},{flag:"--output-cursor",value_name:"cursor",extension_command_availability:"read_output"},{flag:"--output-row-contract",extension_command_availability:"read_output"},{flag:"--quiet"},{flag:"--no-changed-fields"},{flag:"--full-changed-fields"},{flag:"--id-only"},{flag:"--pm-path",aliases:["--path"],discovery_value_name:"path"},{flag:"--no-extensions",extension_command_availability:"never"},{flag:"--no-pager"},{flag:"--profile"},{flag:"--help"},{flag:"--author",value_name:"id"},{flag:"--expect-hash",value_name:"revision"}]),dr=new Set(fn.flatMap(e=>[e.flag,...e.aliases??[]]));export{_ as a,E as b,mn as c,gn as d,ve as e,je as f,ze as g,He as h,T as i,yn as j,qe as k,_n as l,Z as m,Sn as n,An as o,En as p,We as q,K as r,R as s,Ze as t,Ke as u,Je as v,et as w,bn as x,te as y,P as z,re as A,Tn as B,ie as C,Rn as D,se as E,In as F,Dn as G,Nn as H,kn as I,fn as J,dr as K,Nt as L,kt as M,Un as N,vn as O,jn as P,Gn as Q,Bn as R,q as S,Zn as T,A as U,Xn as V,Kn as W,Qt as X,en as Y,he as Z,sr as _,rn as $,ar as aa,be as ba,C as ca,we as da,xe as ea,dn as fa,cr as ga,ur as ha};
|
|
3
|
-
//# sourceMappingURL=chunk-54AQJTUH.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as ye}from"./chunk-E2LQ6LCJ.js";import{Ad as w,Jc as ge,kc as Ie,lc as xe,mb as k,nb as b,tb as _e,zd as I}from"./chunk-CATRDGAB.js";import{t as he}from"./chunk-LMDIKSDZ.js";import{Af as fe,Bf as me,Cf as T,Fa as y,Ga as v,H as Y,Mf as h,Nb as oe,ah as pe,if as ie,pf as B,qf as re,rf as N,sf as se,tf as ce,wf as ae,xf as de,y as V,yf as le,zf as ue}from"./chunk-56GUDMXN.js";import{b as j,h as X,j as J,p as Q,v as Z}from"./chunk-D3I5AHNN.js";import{y as ee,z as te}from"./chunk-54AQJTUH.js";import{W as ne}from"./chunk-WKDKBS4P.js";import{A as m,C as u,z as W}from"./chunk-6OIHST4I.js";import{readdir as Ke}from"node:fs/promises";import H from"node:path";function O(e,o){return(o===void 0?void 0:J(e,o))?.execution_role??j[e.trim().toLowerCase()]??"agent"}var L="blocked_by",we="blocks",De=Object.freeze([L,we]),A="no-active-blocker";function d(e){return e.trim().toLowerCase()}function E(e,o){return o?`external:${e}`:`local:${d(e)}`}function _(e){let o=new Map,t=typeof e.blocked_by=="string"?e.blocked_by.trim():"";if(t.length>0&&d(t)!==A){let n=I(t);o.set(E(t,n),n?t:d(t))}for(let n of e.dependencies??[]){let i=typeof n.id=="string"?n.id.trim():"";if(h(n.kind)===L&&i.length>0&&d(i)!==A){let r=I(i)||w(n.source_kind);o.set(E(i,r),r?i:d(i))}}return[...o.values()].sort((n,i)=>n.localeCompare(i))}function C(e){let o=new Map;for(let t of e){let n=d(t.id);n.length!==0&&o.set(n,new Set(_(t)))}for(let t of e){let n=d(t.id);if(n.length!==0)for(let i of t.dependencies??[]){let r=h(i.kind)===we&&typeof i.id=="string"?d(i.id):"";if(r.length===0||r===A)continue;let s=o.get(r)??new Set;s.add(n),o.set(r,s)}}return new Map([...o].map(([t,n])=>[t,[...n].sort((i,r)=>i.localeCompare(r))]))}function ve(e,o){let t=d(e.id);return t.length>0?C(o).get(t)??_(e):_(e)}function D(e,o,t,n){let i=e,r=typeof i.id=="string"?n?.get(d(i.id))??ve(i,[...o.values()]):_(e),s=new Set((e.dependencies??[]).filter(c=>h(c.kind)===L&&w(c.source_kind)&&typeof c.id=="string"&&c.id.trim().length>0).map(c=>E(c.id.trim(),!0)));return r.map(c=>{if(I(c)||s.has(E(c,!0)))return{id:c,title:null,status:null,resolved:!1,external:!0,...typeof e.updated_at=="string"?{blocked_since:e.updated_at}:{},resolver:null};let a=o.get(d(c));return a?{id:c,title:a.title,status:a.status,resolved:v(a.status,t)}:{id:c,title:null,status:null,resolved:!1}})}function M(e,o,t){return D(e,o,t)}function Me(e,o){let t=new Map(e.map(s=>[d(s.id),s])),n=C(e),i=new Set([...ke(o),...o.blocked_statuses]),r=new Set;for(let s of e){let c=y(s.status,o);if(!i.has(c))continue;(o.blocked_statuses.has(c)||D(s,t,o,n).some(l=>!l.resolved))&&r.add(d(s.id))}return r}function He(e,o,t={},n){let i=[...e.ready,...e.decisions,...e.gates];t.includeContainers===!0&&i.push(...e.containers.filter(s=>s.open_blockers.length===0&&!o.blocked_statuses.has(y(s.item.status,o))));let r={ready:[],decisions:[],gates:[]};for(let s of i){let c=O(s.item.type,n);c==="human"&&t.includeDecisions!==!0?r.decisions.push(s):c==="gate"&&t.includeGates!==!0?r.gates.push(s):r.ready.push(s)}return r}function ke(e){return e.active_statuses.size>0?e.active_statuses:new Set([e.open_status])}function Pe(e,o,t){let n=[d(e)],i=new Set;for(;n.length>0;){let r=n.pop();if(!i.has(r)){i.add(r);for(let s of o.get(r)??[]){if(!v(s.status,t))return!0;n.push(d(s.id))}}}return!1}function $e(e){let o=new Map,t=new Map,n=new Map,i=C(e);for(let r of e){o.set(d(r.id),r);let s=typeof r.parent=="string"?r.parent.trim():"";if(s.length>0){let c=d(s),a=t.get(c)??[];a.push(r),t.set(c,a)}for(let c of i.get(d(r.id))){let a=d(c),l=n.get(a)??[];l.push(r.id),n.set(a,l)}}return{itemsById:o,childrenByParent:t,blockedByReverse:n,blockerIdsByItem:i}}function Fe(e,o,t,n){let{itemsById:i,childrenByParent:r,blockedByReverse:s,blockerIdsByItem:c}=$e(o),a=new Set([...ke(t),...t.blocked_statuses]),l=new Set(o.filter(f=>!v(f.status,t)).map(f=>d(f.id))),F=[],K=[],S=[],U=[],G=[],q=0;for(let f of e){if(!a.has(y(f.status,t)))continue;q+=1;let z=D(f,i,t,c).filter(p=>!p.resolved),Ae=(s.get(d(f.id))??[]).filter(p=>l.has(d(p))).sort((p,Le)=>p.localeCompare(Le)),g={item:f,open_blockers:z,unblocks:Ae};if(Pe(f.id,r,t)){S.push(g);continue}let Oe=t.blocked_statuses.has(y(f.status,t));if(z.length===0&&!Oe){let p=O(f.type,n);p==="human"?U.push(g):p==="gate"?G.push(g):F.push(g)}else K.push(g)}return{ready:F,blocked:K,containers:S,decisions:U,gates:G,active_count:q,container_count:S.length}}function Ue(e,o){let t=new Map;for(let n of e){let i=n.external?n.id:o.get(n.id.toLowerCase())?.id??n.id;t.set(n.external?`external:${i}`:`local:${i.toLowerCase()}`,{...n,id:i})}return[...t.values()]}async function P(e,o){let t=H.basename(e),i=(await Ke(H.dirname(e)).catch(r=>{throw Ie("Cannot verify the blocker's physical file identity",{exitCode:m.GENERIC_FAILURE,context:{code:"blocker_identity_read_failed",required:"Restore access to the blocker item directory, then retry the item read."},cause:r})})).filter(r=>r.toLowerCase()===t.toLowerCase()).sort((r,s)=>+(s===t)-+(r===t)||r.localeCompare(s)).map(r=>H.parse(r).name)[0];if(i===void 0)throw new u(`Blocker canonical file disappeared during identity verification: ${o}`,m.CONFLICT,{code:"item_identity_conflict",required:"Restore the canonical blocker file and validate storage integrity before retrying the item read."});return i}async function pt(e){let o=_(e.metadata);if(o.length===0)return[];let t=new Map([e.metadata.blocked_by,...(e.metadata.dependencies??[]).filter(i=>h(i.kind)==="blocked_by").map(i=>i.id)].filter(i=>typeof i=="string").map(i=>[i.trim().toLowerCase(),i.trim()])),n=new Map;for(let i of o){if(I(i)||!/^(?!\.{1,2}$)[^/\\:\0]+$/u.test(i)||e.metadata.dependencies?.some(c=>c.id.trim()===i&&h(c.kind)==="blocked_by"&&w(c.source_kind)))continue;let r=await k(e.pmRoot,t.get(i),e.settings.id_prefix,e.settings.item_format,e.typeToFolder);if(r===null)continue;let s=await b(r,{schema:e.settings.schema});if(r.id=await P(r.itemPath,r.id),s.document.metadata.id!==r.id)throw new u(`Blocker identity differs from its canonical file: ${r.id}`,m.CONFLICT,{code:"item_identity_conflict",required:"Restore the canonical blocker identity and validate storage integrity before retrying the item read."});n.set(i.toLowerCase(),s.document.metadata)}return Ue(M({blocked_by:e.metadata.blocked_by,dependencies:e.metadata.dependencies,updated_at:e.metadata.updated_at},n,ne(e.settings.schema)),n)}var Ee="item_revision_conflict",Ge=10,Ce=/^[0-9a-f]{64}$/u;function x(e,o){return new u(`Invalid expected revision ${JSON.stringify(e)}: ${o}.`,m.USAGE,{code:"expect_hash_invalid",value:e,required:"Pass the 64-character item_hash from pm get <id> --json, optionally as <id>=<item_hash>.",examples:["--expect-hash <item_hash>","--expect-hash pm-a1b2=<item_hash>"]})}function Re(e){let o=typeof e=="string"?e.trim().toLowerCase():"";if(!Ce.test(o))throw x(String(e),"the revision is not a 64-character hexadecimal item_hash");return o}function qe(e){return(e===void 0?[]:typeof e=="string"?[e]:e).flatMap(t=>{if(typeof t!="string")throw x(String(t),"expected a string");let n=t.split(",").map(r=>r.trim()).filter(r=>r.length>0);if(n.length===0)throw x(t,"the value is empty");let i=r=>te(t)===t?r:ee;return n.map(r=>{let s=r.lastIndexOf("="),c=s===-1?void 0:r.slice(0,s).trim();if(c!==void 0&&c.length===0)throw x(i(r),"the item id before = is empty");let a=s===-1?r:r.slice(s+1);if(!Ce.test(a.trim().toLowerCase()))throw x(i(a),"the revision is not a 64-character hexadecimal item_hash");let l=Re(a);return c===void 0?{itemHash:l}:{id:c,itemHash:l}})})}async function Se(e,o){let t=await he(e),n=X(t,pe()).type_to_folder,i=await k(e,o,t.id_prefix,t.item_format,n);if(i){let{document:r}=await b(i,{schema:t.schema});if(r.metadata.id!==await P(i.itemPath,i.id))throw new u(`Item file ${i.id} embeds the id ${r.metadata.id}; no revision can be bound to an item whose identity is in conflict.`,m.CONFLICT,{code:"item_identity_conflict",item_id:i.id,required:`Repair ${i.id}'s identity first (pm validate reports it; pm restore ${i.id} <version> recovers a recorded state), then read its item_hash again.`});return{id:r.metadata.id,document:r}}try{return{id:(await ye(e,o,t,n)).id,document:W}}catch{throw await _e(e,o,t.id_prefix,n)}}function $(e){return Q(e.cwd??process.cwd(),e.pmRoot)}async function Ot(e,o={}){let t=await Se($(o),e);return{id:t.id,item_hash:ie(t.document)}}async function Be(e,o,t){let n=[];for(let i of o){let r=i.id??t;if(r===void 0||r.trim().length===0)throw new u("A bare expected revision needs an item to bind to.",m.USAGE,{code:"expect_hash_target_required",required:"This command has no single item argument; name each target as --expect-hash <id>=<item_hash>.",examples:["--expect-hash pm-a1b2=<item_hash>"]});n.push({id:(await Se(e,r)).id,itemHash:i.itemHash})}return n}function ze(e){return[...new Set(e.patch.map(o=>{let t=o.path.split("/");return String(t[1]==="metadata"?t[2]:t[1])}))].sort()}async function We(e,o,t){let n;try{n=await oe(Z(e,o),o)}catch{return}let i=-1;for(let c=n.length-1;c>=0;c-=1){let a=n[c];if(a.after_hash===t){i=c+1;break}if(a.before_hash===t){i=c;break}}if(i===-1)return{expected_revision_recorded:!1,changes_since:[],changes_since_omitted:0};let r=n.slice(i),s=r.slice(-Ge);return{expected_revision_recorded:!0,changes_since:s.map(c=>({ts:c.ts,op:c.op,author:c.author,fields:ze(c)})),changes_since_omitted:r.length-s.length}}async function Lt(e,o){if(!R(e))return{};let t=await Ne(e,o);return{error_code:Ee,expected_revision:String(t.context.expected_revision),current_revision:String(t.context.current_revision),details:t.context.details}}function R(e){return xe(e)&&e.context.code===Ee}function Dt(e){let o=e.find(t=>R(t));if(o!==void 0)throw o}function Mt(){return new u("--expect-hash cannot guard an invocation an extension override rewrote: which item it writes is not provable.",m.USAGE,{code:"expect_hash_invocation_rewritten",required:"Run the command without the rewriting extension (--no-extensions), or drop --expect-hash.",why:"An extension parser or preflight override changed this invocation's tracker or arguments, and final dispatch, the extension SDK client and the guard do not share one rewritten view."})}function Ve(e,o){if(o===void 0||!R(e)||typeof e.context.item_id!="string"||fe(e))return e;let t=e.context.reason===de;if(!t&&e.context.reason!==ae)return e;let n=me(T(e,new u(e.message,e.exitCode,{...e.context,...le(e.context.item_id,t,o)})));return n.stack=e.stack,n}async function Ne(e,o,t){if(!ue(e,o))return e;let n=Ve(e,t);if(!R(n)||n.context.details!==void 0)return n;let i=n.context.item_id,r=n.context.expected_revision;if(typeof i!="string"||typeof r!="string")return n;let s;try{s=await We(o,i,r)}catch{return n}if(s===void 0)return n;let c={expected_revision_recorded:s.expected_revision_recorded,changes_since:s.changes_since.map(l=>({ts:l.ts,op:l.op,author:l.author,fields:[...l.fields]})),changes_since_omitted:s.changes_since_omitted},a=T(n,new u(n.message,n.exitCode,{...n.context,details:c}));return a.stack=n.stack,a}async function Te(e,o,t){try{return{result:await re(e,o),...se(e)}}catch(n){throw e.pmRoot===void 0?n:await Ne(n,e.pmRoot,t)}}function Ye(e){return e.cwd===void 0&&e.pmRoot===void 0?void 0:{scopeArgs:["--pm-path",$(e)]}}async function Ht(e,o,t={}){return Te(await je(e,t),o,Ye(t))}async function je(e,o={}){let t=$(o),n=e.map(({id:r,itemHash:s})=>({id:r,itemHash:Re(s)})),i=B();return N(i,t,await Be(t,n)),i}function Pt(e){let o=ce(e);return o===void 0||o.length>0}function Xe(e){return`expect_hash_unchecked:${e}:no_locked_write_reached_this_item`}var be=new Set(V);function Je(e,o={}){let t=e.trim().replace(/\s+/gu,"-"),n=be.has(t)?t:e;if(be.has(n)&&(!ge(n)||n==="deps")&&!Y.has(n))throw Qe(n);if((n==="test"||n==="test-all")&&o.background===!0)throw new u(`--expect-hash cannot guard ${n} --background: the worker runs in another process.`,m.USAGE,{code:"expect_hash_background_unsupported",required:`Run ${n} in the foreground to guard its result recording, or drop --expect-hash for a background run.`})}function Qe(e){return new u(`--expect-hash guards item writes, and ${e} is not a mutation.`,m.USAGE,{code:"expect_hash_requires_mutation",required:"Use --expect-hash (MCP/SDK expectHash) only on a command or action that writes items."})}function Ze(e,o){if(o.length===0||typeof e!="object"||e===null||Array.isArray(e))return e;let t=e,n=Array.isArray(t.warnings)?t.warnings:[];return{...t,warnings:[...n,...o.map(Xe)]}}async function $t(e){let o=e.expectHash;if(o!==void 0&&typeof o!="string"&&!(Array.isArray(o)&&o.every(r=>typeof r=="string")))throw x(JSON.stringify(o)??String(o),"expected a string or an array of strings");let t=qe(o);if(t.length===0)return e.run();Je(e.action,{background:e.background===!0||e.options?.background===!0});let n=B();N(n,e.pmRoot,await Be(e.pmRoot,t,e.defaultId));let i=await Te(n,e.run,e.invocation);return Ze(i.result,i.unchecked)}export{O as a,De as b,_ as c,C as d,ve as e,M as f,Me as g,He as h,Fe as i,pt as j,Ee as k,Ge as l,Re as m,qe as n,Ot as o,Be as p,We as q,Lt as r,R as s,Dt as t,Mt as u,Ve as v,Ne as w,Te as x,Ht as y,je as z,Pt as A,Xe as B,Je as C,Qe as D,$t as E};
|
|
2
|
-
//# sourceMappingURL=chunk-56DKWGHE.js.map
|