@unbrained/pm-cli 2026.11.25 → 2026.11.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/dist/cli/commander-usage.js +9 -9
- package/dist/cli/error-guidance.js +5 -5
- package/dist/cli/help-content.js +4 -4
- package/dist/cli/register-setup.js +1 -1
- package/dist/cli/runtime/selection.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/{chunk-CZEMEPPQ.js → chunk-5CMR4R5V.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YIGBEY7K.js → chunk-5M7UTO2G.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-63AVXDZS.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-CONBVY2O.js → chunk-66TNCHHG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LPW7S5KA.js → chunk-6NJ3BONB.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-AVHRMUXJ.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-FVY7U3SU.js → chunk-HTT52JL3.js} +37 -37
- package/dist/cli-bundle/chunks/{chunk-OS5W4ZG2.js → chunk-J25DZRYJ.js} +31 -31
- package/dist/cli-bundle/chunks/chunk-J6TFG34A.js +4 -0
- package/dist/cli-bundle/chunks/{chunk-K34FR5CO.js → chunk-JX475QVU.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-KP75JTTO.js +35 -0
- package/dist/cli-bundle/chunks/chunk-KS47NGMQ.js +69 -0
- package/dist/cli-bundle/chunks/{chunk-BVJMVU4Z.js → chunk-O23KTJL6.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-DF6A7C32.js → chunk-OFX2VA5Z.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FHLOGAGA.js → chunk-QVDEZBSV.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-SIRZ4VMT.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-C4KIZQHW.js → chunk-VC4BJIA7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GBVF2ZB3.js → chunk-W7SPEGSP.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-WY7467RY.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-7EPYCU7U.js → chunk-X6TE47CS.js} +5 -5
- package/dist/cli-bundle/chunks/chunk-XB6QEVUK.js +2 -0
- package/dist/cli-bundle/chunks/chunk-XYX4CXFR.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-SCIPT7WF.js → chunk-Y5U7QCNX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-L6VS7F3R.js → chunk-YGK6SA7P.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OWK2JL4I.js → chunk-ZGV4ZXDS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CNUFU454.js → chunk-ZILIHDDY.js} +41 -41
- package/dist/cli-bundle/chunks/{field-option-collisions-QE65APSD.js → field-option-collisions-UL6BIPAK.js} +2 -2
- package/dist/cli-bundle/chunks/{item-revision-INDHJV6X.js → item-revision-WNUDY5DM.js} +2 -2
- package/dist/cli-bundle/chunks/item-transaction-ER3OWOPV.js +2 -0
- package/dist/cli-bundle/chunks/{mutation-actor-KU7BMLUN.js → mutation-actor-SFYTD2ZB.js} +2 -2
- package/dist/cli-bundle/chunks/{mutation-admission-3OMCTQD4.js → mutation-admission-AVOOT3KH.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-3GV3LBOT.js → register-list-query-Q7UW2EPV.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-GZLF47SX.js → register-mutation-YNW7E3T4.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-PBJZGCAL.js → register-operations-DAUTQCIO.js} +2 -2
- package/dist/cli-bundle/chunks/register-setup-VSURGF7V.js +2 -0
- package/dist/cli-bundle/chunks/{stage-3WIZBD4N.js → stage-N5GDBS5A.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-X4EWD6TL.js → chunk-24W63UPP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-C3FEDTSD.js → chunk-2XGHBYDA.js} +26 -26
- package/dist/cli-bundle/focused-chunks/{chunk-ZLRRII55.js → chunk-3QRMY6KF.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-PKX2EHE3.js → chunk-4HLZOOZI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-52PHSTGP.js +27 -0
- package/dist/cli-bundle/focused-chunks/{chunk-YYEWIKNI.js → chunk-7FKGIJEB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-7GZMOLQY.js +15 -0
- package/dist/cli-bundle/focused-chunks/chunk-AL47ODFZ.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-AN4NFFLL.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-BYQK5DGH.js → chunk-B2HJI6KA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-JOKRDFMQ.js → chunk-C2HW7BSE.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-TQIKDFOD.js → chunk-GISZWMBS.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BOIMP2AR.js → chunk-GUAT4OAC.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-VU2PH4PF.js → chunk-H4JBS477.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-XKLBTDJ7.js → chunk-HGJ4MILN.js} +37 -37
- package/dist/cli-bundle/focused-chunks/{chunk-TRL4JDWX.js → chunk-HSWL6L2O.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-SXC2EO3E.js → chunk-I4GY7HAP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-KMG4O2IU.js +4 -0
- package/dist/cli-bundle/focused-chunks/{chunk-4LQL4EO6.js → chunk-N7ZAMULP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UWWAVXG4.js → chunk-REORRDPH.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{chunk-MB56Y4M6.js → chunk-SXWUKNTY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-5RBC4WSE.js → chunk-UGQ2EXTU.js} +58 -59
- package/dist/cli-bundle/focused-chunks/chunk-YPOATPTX.js +3 -0
- package/dist/cli-bundle/focused-chunks/{chunk-7SSGTGZO.js → chunk-ZZYJS74B.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{field-option-collisions-5ROXGUME.js → field-option-collisions-BP7ILGQK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{item-revision-KYMSQVZE.js → item-revision-NOHVIOQQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{item-transaction-I4HLVHEJ.js → item-transaction-O26COBOJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{mutation-actor-GGOQKAE6.js → mutation-actor-HVJV5S76.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{mutation-admission-OS36ZCMH.js → mutation-admission-JRICEVYN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{stage-4ZFWJUKO.js → stage-NSX6ASBZ.js} +2 -2
- package/dist/cli-bundle/main.js +26 -26
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +4 -4
- package/dist/cli-bundle/sdk-core.js +1 -1
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +63 -63
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +11 -11
- package/dist/core/extensions/index.js +1 -1
- package/dist/core/reproducibility/context.d.ts +2 -0
- package/dist/core/reproducibility/context.js +1 -1
- package/dist/core/shared/command-line.d.ts +2 -2
- package/dist/core/shared/command-line.js +1 -1
- package/dist/core/shared/secret-rules.js +5 -5
- package/dist/sdk/cli-bootstrap.d.ts +17 -0
- package/dist/sdk/cli-bootstrap.js +1 -1
- package/dist/sdk/cli-contracts/command-aliases.js +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
- package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +1 -1
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +1 -1
- package/dist/sdk/completion/shared.d.ts +1 -1
- package/dist/sdk/completion/shared.js +1 -1
- package/dist/sdk/extension/bundled-catalog.js +1 -1
- package/dist/sdk/extension/install-sources.js +5 -5
- package/dist/sdk/extension/listing-fields.d.ts +15 -0
- package/dist/sdk/extension/listing-fields.js +2 -0
- package/dist/sdk/extension/managed-update-status.js +1 -1
- package/dist/sdk/extension/npm-spec.d.ts +18 -0
- package/dist/sdk/extension/npm-spec.js +2 -0
- package/dist/sdk/extension/static-inventory.d.ts +53 -1
- package/dist/sdk/extension/static-inventory.js +1 -1
- package/dist/sdk/extension/update-check.js +1 -1
- package/dist/sdk/extension/update-observations.js +3 -0
- package/dist/sdk/extension/upgrade-hints.js +2 -0
- package/dist/sdk/extension.d.ts +2 -0
- package/dist/sdk/extension.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/governance/upgrade.d.ts +7 -2
- package/dist/sdk/governance/upgrade.js +2 -2
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/context.d.ts +20 -7
- package/dist/sdk/query/context.js +4 -2
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/testing.d.ts +20 -2
- package/docs/COMMANDS.md +19 -1
- package/docs/CONFIGURATION.md +1 -1
- package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +6 -0
- package/docs/EXTENSION_LIFECYCLE.md +72 -2
- package/docs/MUTATION_INTEGRITY.md +47 -0
- package/docs/SDK.md +24 -3
- package/marketplace.json +1 -1
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +1 -1
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +1 -1
- package/dist/cli-bundle/chunks/chunk-4FZH5BTV.js +0 -2
- package/dist/cli-bundle/chunks/chunk-GZI7ZAB7.js +0 -2
- package/dist/cli-bundle/chunks/chunk-LOX3VY4T.js +0 -2
- package/dist/cli-bundle/chunks/chunk-VA4T37Q4.js +0 -70
- package/dist/cli-bundle/chunks/chunk-WQOEVGLQ.js +0 -2
- package/dist/cli-bundle/chunks/chunk-XHCIOLJP.js +0 -3
- package/dist/cli-bundle/chunks/chunk-XKWJONAO.js +0 -2
- package/dist/cli-bundle/chunks/chunk-ZBOQEZ2H.js +0 -33
- package/dist/cli-bundle/chunks/chunk-ZLICQPRG.js +0 -3
- package/dist/cli-bundle/chunks/item-transaction-LCKK4XXB.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-ZLJEF6NZ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-3Y5PTQ2F.js +0 -27
- package/dist/cli-bundle/focused-chunks/chunk-A4R57E4K.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-IAOKVKWW.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-VMYVN36N.js +0 -13
- package/dist/cli-bundle/focused-chunks/chunk-WL2R7T5G.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-WVA5KOXF.js +0 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{existsSync as
|
|
1
|
+
import{existsSync as S,realpathSync as w}from"node:fs";import{AsyncLocalStorage as k}from"node:async_hooks";import c from"node:path";import{ownedTransactionCompensation as R}from"../store/item-mutation-precondition.js";import{runCommandHandler as I,runBeforeMutationHooks as y,runCommandOverride as H,runOnIndexHooks as P,runParserOverride as T,runPreflightOverride as W,runOnReadHooks as M,runRendererOverride as j,runServiceOverride as D,runServiceOverrideSync as G,runOnWriteHooks as N}from"./loader.js";let a=null,d=null,p=null,v=null,f=null,g=null,_=null,l=null,h,A=[];const O=new k;function s(){return O.getStore()}function Z(e){return O.run({hooks:null,commands:null,parsers:null,preflight:null,services:null,renderers:null,registrations:null,commandContext:null,commandResult:void 0,affectedItems:[]},e)}const L=new Set(["body","comments","dependencies","docs","events","files","learnings","notes","reminders","test_runs","tests"]);function m(e){try{return w.native(e)}catch{return}}function U(e){const t=e.split(c.sep).join("/");return t.endsWith("/")?t.slice(0,-1):t}function $(e){const t={resolved:new Set,spelled:new Set};let n=!0;for(const o of(e.GIT_CEILING_DIRECTORIES??"").split(c.delimiter))if(o.length===0)n=!1;else if(c.isAbsolute(o))if(!n)t.spelled.add(o.endsWith("/")?o.slice(0,-1):o);else{const r=m(o);r!==void 0&&t.resolved.add(r)}else continue;return t}function B(e,t){return e.resolved.has(t)||e.spelled.has(U(t))}function F(e,t){for(let n=e;;n=c.dirname(n)){if(m(n)===t)return n;if(c.dirname(n)===n)return t}}function K(e,t){const n=c.resolve(e),o=c.isAbsolute(e)?e:`${process.cwd()}${c.sep}${e}`,r=m(o);let i=r??n;for(;;){if(S(c.join(i,".git"))){const x=F(n,i);return{source:x,repo:x}}const u=c.dirname(i);if(u===i||B(t,u))return{source:r===void 0||m(n)===r?n:r};i=u}}function Q(e,t){const n=m(e),o=m(t);return n!==void 0&&o!==void 0?c.relative(n,o):c.relative(e,c.resolve(t))}function C(e){const t=process.env.PM_SOURCE_WORKSPACE_ROOT?.trim()||process.cwd(),{source:n,repo:o}=K(t,$(process.env));if(!e)return{source_workspace_root:n,...o?{repo_root:o}:{}};const r=Q(n,e),i=r.length>0&&!r.startsWith(`..${c.sep}`)&&r!==".."&&!c.isAbsolute(r);return{source_workspace_root:n,...o?{repo_root:o}:{},...i?{pm_root_rel:r.split(c.sep).join("/")}:{}}}function ee(e){const t=s();if(t){t.hooks=e;return}a=e}function te(e){const t=s();if(t){t.commands=e;return}d=e}function ne(e){const t=s();if(t){t.parsers=e;return}p=e}function oe(e){const t=s();if(t){t.preflight=e;return}v=e}function re(e){const t=s();if(t){t.services=e;return}f=e}function se(e){const t=s();if(t){t.renderers=e;return}g=e}function ie(e){const t=s();if(t){t.registrations=e;return}_=e}function ce(){const e=s();return e?e.registrations:_}function ae(){const e=s();if(e){e.hooks=null,e.commands=null,e.parsers=null,e.preflight=null,e.services=null,e.renderers=null,e.registrations=null,e.commandContext=null,e.commandResult=null,e.affectedItems=[];return}a=null,d=null,p=null,v=null,f=null,g=null,_=null,l=null,h=null}function le(e){const t=e?{...e,...C(e.pm_root)}:null,n=s();if(n){n.commandContext=t;return}l=t}function ue(){const e=s(),t=e?e.commandContext:l;return t?{...t,args:[...t.args],options:t.options?{...t.options}:{},global:t.global?{...t.global}:void 0}:null}function de(e){const t=s()??{commandContext:l,hooks:a,commands:d,parsers:p,preflight:v,services:f,renderers:g,registrations:_};return t.commandContext?.command!==e||[t.hooks,t.preflight,t.services,t.renderers].some(r=>Object.values(r??{}).some(i=>i.length>0))||[t.commands,t.parsers].some(r=>Object.values(r??{}).some(i=>i.some(u=>u.command===e)))?!1:!Object.entries(t.registrations??{}).some(([r,i])=>["migrations","search_providers","vector_store_adapters","assurance_providers"].includes(r)&&i.length>0)}function fe(e){const t=s();if(t){t.commandResult=e;return}h=e}function me(){const e=s();return e?e.commandResult:h}function pe(e){if(!e)return;const t=s();t?t.affectedItems.push(e):A.push(e)}function ve(e,t){if(!e||!e.id)return{};const n={id:e.id,type:e.type,status:e.status};if(!Array.isArray(t))return n;const o=e;for(const r of t){if(typeof r!="string")continue;const i=r.startsWith("unset:")?r.slice(6):r;i==="id"||i==="type"||i==="status"||L.has(i)||Object.hasOwn(o,i)&&o[i]!==void 0&&(n[i]=o[i])}return n}function ge(){const e=s(),t=e?.affectedItems??A;if(t.length===0)return;const n=t;return e?e.affectedItems=[]:A=[],n}function _e(){const e=s();if(e){e.hooks=null,e.commands=null,e.parsers=null,e.preflight=null,e.services=null,e.renderers=null,e.registrations=null,e.commandContext=null,e.commandResult=void 0,e.affectedItems=[];return}a=null,d=null,p=null,v=null,f=null,g=null,_=null,l=null,h=void 0,A=[]}async function xe(e){const t=s(),n=t?t.hooks:a;return n?N(n,e):[]}const b=new k;function he(e,t){return!e||(e.beforeMutation?.length??0)===0?t():b.run(e,t)}function X(){const e=s();return e?e.hooks:a}async function Ae(e){const t=b.getStore(),n=t??X();if(!n)return;const{resolveMutationActor:o}=await import("./mutation-actor.js"),r=t!==void 0||e.dry_run===!0,i=r?void 0:R(e.pm_root,[e.before?.metadata.id,e.after?.metadata.id],e.operation),u=await y(n,{pm_root:e.pm_root,operation:e.operation,before:e.before,after:e.after,changed_fields:e.changed_fields,sdk:e.sdk,actor:o(e.author),dry_run:r,...i===void 0?{}:{compensation:{transaction_id:i.transaction_id,step_id:i.step_id}}});i?.overrides.push(...u.map(x=>({source:"mutation_guard",...x})))}async function Ce(e){const t=s(),n=t?t.hooks:a;return n?M(n,e):[]}function ke(){const e=s();return((e?e.hooks:a)?.onWrite?.length??0)>0}function Oe(){const e=s();return((e?e.hooks:a)?.onRead?.length??0)>0}async function be(e){const t=s(),n=t?t.hooks:a;return n?P(n,e):[]}function Ee(e){const t=s(),n=t?t.commands:d,o=t?t.commandContext:l;return!n||!o?{overridden:!1,result:e,warnings:[]}:H(n,{command:o.command,args:[...o.args],options:o.options?{...o.options}:{},global:o.global?{...o.global}:void 0,pm_root:o.pm_root,source_workspace_root:o.source_workspace_root,repo_root:o.repo_root,pm_root_rel:o.pm_root_rel,result:e})}async function Se(e){const t=s(),n=t?t.commands:d;return n?I(n,{...e,...C(e.pm_root)}):{handled:!1,result:null,warnings:[]}}async function we(e){const t=s(),n=t?t.parsers:p;return n?T(n,{...e,...C(e.pm_root)}):{overridden:!1,context:{command:e.command,args:[...e.args],options:{...e.options},global:{...e.global},pm_root:e.pm_root},warnings:[]}}async function Re(e){const t=s(),n=t?t.preflight:v;return n?W(n,{...e,...C(e.pm_root)}):{overridden:!1,context:{command:e.command,args:[...e.args],options:{...e.options},global:{...e.global},pm_root:e.pm_root},decision:{...e.decision},warnings:[]}}function Ie(e,t){const n=s(),o=n?n.renderers:g,r=n?n.commandContext:l;return o?j(o,{format:e,command:r?.command,args:r?[...r.args]:[],options:r?.options?{...r.options}:{},global:r?.global?{...r.global}:void 0,pm_root:r?.pm_root,source_workspace_root:r?.source_workspace_root,repo_root:r?.repo_root,pm_root_rel:r?.pm_root_rel,result:t}):{overridden:!1,rendered:null,warnings:[]}}function E(e,t){const n=s(),o=n?n.commandContext:l;return{service:e,command:o?.command,args:o?[...o.args]:[],options:o?.options?{...o.options}:{},global:o?.global?{...o.global}:void 0,pm_root:o?.pm_root,source_workspace_root:o?.source_workspace_root,repo_root:o?.repo_root,pm_root_rel:o?.pm_root_rel,payload:t}}async function ye(e,t){const n=s(),o=n?n.services:f;return o?D(o,E(e,t)):{handled:!1,result:t,warnings:[]}}function He(e,t){const n=s(),o=n?n.services:f;return o?G(o,E(e,t)):{handled:!1,result:t,warnings:[]}}export*from"./loader.js";export*from"./command-hook-context.js";import{createSerialQueue as je}from"../shared/serial-queue.js";import{EXTENSION_CAPABILITY_REGISTRATION_SURFACES as Ge,collectUsedExtensionCapabilities as Ne,reconcileExtensionCapabilityUsage as Le}from"./capability-usage.js";export{Ge as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,_e as clearActiveExtensionHooks,Ne as collectUsedExtensionCapabilities,ge as consumeAfterCommandAffectedItems,je as createSerialQueue,ue as getActiveCommandContext,me as getActiveCommandResult,X as getActiveExtensionHooks,ce as getActiveExtensionRegistrations,Oe as hasActiveOnReadHooks,ke as hasActiveOnWriteHooks,de as isActiveCommandUnextended,ve as projectAfterCommandItemSnapshot,Le as reconcileExtensionCapabilityUsage,pe as recordAfterCommandAffectedItem,ae as resetActiveExtensionRuntimeState,C as resolvePortableWorkspaceContext,Ae as runActiveBeforeMutationHooks,Se as runActiveCommandHandler,Ee as runActiveCommandOverride,be as runActiveOnIndexHooks,Ce as runActiveOnReadHooks,xe as runActiveOnWriteHooks,we as runActiveParserOverride,Re as runActivePreflightOverride,Ie as runActiveRendererOverride,ye as runActiveServiceOverride,He as runActiveServiceOverrideSync,Z as runWithIsolatedExtensionRuntime,he as runWithPreviewMutationGuards,le as setActiveCommandContext,fe as setActiveCommandResult,te as setActiveExtensionCommands,ee as setActiveExtensionHooks,ne as setActiveExtensionParsers,oe as setActiveExtensionPreflight,ie as setActiveExtensionRegistrations,se as setActiveExtensionRenderers,re as setActiveExtensionServices};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -14,6 +14,8 @@ export declare function validateReproducibleExecutionSettings(settings:Reproduci
|
|
|
14
14
|
export declare function createReproducibleExecutionRunner(settings:ReproducibleExecutionSettings):ReproducibleExecutionRunner;
|
|
15
15
|
/** Run an isolated async operation with deterministic clock and entropy state. */
|
|
16
16
|
export declare function runWithReproducibleExecution<T>(settings:ReproducibleExecutionSettings,operation:()=> Promise<T>):Promise<T>;
|
|
17
|
+
/** Whether a reproducible recipe (pinned clock and entropy) governs the current execution. */
|
|
18
|
+
export declare function isReproducibleExecutionActive():boolean;
|
|
17
19
|
/** Return the next deterministic clock value, or undefined outside a recipe. */
|
|
18
20
|
export declare function nextReproducibleTimestamp():string|undefined;
|
|
19
21
|
/** Return a deterministic base36 token, or undefined outside a recipe. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import u from"node:crypto";import{AsyncLocalStorage as a}from"node:async_hooks";const o=new a,c=1024;function s(e){const 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 d(e){const r={...s(e),clockReads:0,tokenReads:0};return n=>o.run(r,n)}async function f(e,t){return d(e)(t)}function k(){return o.getStore()!==void 0}function b(){const e=o.getStore();if(e===void 0)return;const t=new Date(Date.parse(e.clock)+e.clockReads*e.tickMs).toISOString();return e.clockReads+=1,t}function m(e){const t=o.getStore();if(t===void 0)return;if(!Number.isSafeInteger(e)||e<0||e>c)throw new Error(`Reproducible token length must be an integer between 0 and ${c}`);let r="";for(;r.length<e;){const n=u.createHash("sha256").update(`${t.seed}\0${t.tokenReads}`).digest();t.tokenReads+=1;for(const i of n)if(r+=(i%36).toString(36),r.length===e)break}return r}export{d as createReproducibleExecutionRunner,k as isReproducibleExecutionActive,b as nextReproducibleTimestamp,m as nextReproducibleToken,f as runWithReproducibleExecution,s as validateReproducibleExecutionSettings};
|
|
2
2
|
//# sourceMappingURL=context.js.map
|
|
@@ -52,8 +52,8 @@ export declare const quoteCommandArg:(arg:string,platform?:NodeJS.Platform,diale
|
|
|
52
52
|
/**
|
|
53
53
|
* Quote one argument for a POSIX shell. Double quotes with `"`, `\`, `$` and
|
|
54
54
|
* backticks escaped are exact for `sh -c` and scripts; an argument holding
|
|
55
|
-
* `!` is single-quoted instead,
|
|
56
|
-
* history
|
|
55
|
+
* `!` or a line break, or ending in a backslash, is single-quoted instead,
|
|
56
|
+
* the one spelling every interactive history scanner reads as the shell does.
|
|
57
57
|
*/
|
|
58
58
|
export declare const quotePosixCommandArg:(arg:string)=> string;
|
|
59
59
|
/** Render a complete pm command from already-tokenized arguments. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const l="PM_COMMAND_SHELL",a=new Map([["posix","posix"],["sh","posix"],["bash","posix"],["zsh","posix"],["cmd","cmd"],["cmd.exe","cmd"],["powershell","powershell"],["pwsh","powershell"]]),r=(e=process.platform,
|
|
1
|
+
const l="PM_COMMAND_SHELL",a=new Map([["posix","posix"],["sh","posix"],["bash","posix"],["zsh","posix"],["cmd","cmd"],["cmd.exe","cmd"],["powershell","powershell"],["pwsh","powershell"]]),r=(e=process.platform,o=process.env)=>{const t=o[l]?.trim().toLowerCase(),n=t===void 0?void 0:a.get(t);return n!==void 0?n:e==="win32"?"cmd":"posix"},d=e=>{let o='"',t=0;for(const n of e){if(n==="\\"){t+=1;continue}o+="\\".repeat(n==='"'?t*2+1:t),o+=n,t=0}return`${o}${"\\".repeat(t*2)}"`},c=new Set(["(",")","!","^",'"',"<",">","&","|"]),i=e=>{let o="";for(let t=0;t<e.length;t+=1){const n=e[t];if(c.has(n)){o+=`^${n}`;continue}o+=n,n==="%"&&!c.has(e.charAt(t+1))&&(o+="^")}return o},u=/["%]/u,m=/\r\n|[\r\n]/gu,h=e=>{const o=e.replace(m," "),t=d(o);return u.test(o)?i(t):t},_=/['\u2018\u2019\u201A\u201B]/gu,A=e=>e.replace(_,"$&$&"),E=e=>`'${A(e)}'`,x={posix:/^(?!=)[A-Za-z0-9._:/@=-]+$/u,cmd:/^[A-Za-z0-9._:/\\@=-]+$/u,powershell:/^(?!--$)[A-Za-z0-9._:/\\=-][A-Za-z0-9._:/\\@=-]*$/u},C=(e,o=process.platform,t)=>{const n=t??r(o);return x[n].test(e)?e:n==="cmd"?h(e):n==="powershell"?E(e):$(e)},S=/!|[\r\n]|\\$/u,$=e=>S.test(e)?`'${e.replaceAll("'","'\\''")}'`:`"${e.replace(/(["\\$`])/g,"\\$1")}"`,f=(e,o=process.platform,t)=>{const n=t??r(o),s=e.map(p=>C(p,o,n)).join(" ");return s.length>0?`pm ${s}`:"pm"};export{l as COMMAND_SHELL_ENV,i as escapeCmdMetacharacters,A as escapePowerShellSingleQuotes,h as quoteCmdCommandArg,C as quoteCommandArg,$ as quotePosixCommandArg,E as quotePowerShellCommandArg,d as quoteWindowsCommandArg,f as renderPmCommand,r as resolveCommandShellDialect};
|
|
2
2
|
//# sourceMappingURL=command-line.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
`)){n.lastIndex=0;let s=!1;for(const i of r.matchAll(n))s=!0,yield{index:t+i.index};for(const i of He(r,n,s))yield{...i,index:t};t+=r.length+1}}const V="password|passphrase",N=4,g=4096,$=e=>`${e}+(?!${e})`,F=String.raw`'[^'\r\n]*'|"[^"\\\r\n]*(?:\\.[^"\\\r\n]*){0,${g}}"`,qe=String.raw`\$\{(?:${$(String.raw`[^{}$'"\\\r\n]`)}|\\[^\r\n]|${F}|\$(?!\{)|\$\{[^{}\r\n]*\}){0,${g}}\}`+String.raw`|\$\((?:${$(String.raw`[^()$'"\\\r\n]`)}|\\[^\r\n]|${F}|\$(?!\()|\$\([^()\r\n]*\)){0,${g}}\)`,B=String.raw`${qe}|<[^<>\r\n]*>|${$(String.raw`[A-Za-z0-9!@#%^&*._+\-=]`)}|\$(?![{(])`,Ge=String.raw`"[^"]*"|'[^']*'`,H=String.raw`(?:"[^"\s]*"|'[^'\s]*')(?:${B}){0,${g}}`,W=new RegExp(String.raw`(?!config\.auth\.password\s*(?:\|\|\s*(?:''|"")|\?\s*unescape\(encodeURIComponent\(config\.auth\.password\)\)\s*:\s*(?:''|""))(?=[ \t]*(?:\/\*(?:[^*]|\*(?!\/))*\*\/[ \t]*)*(?:;|$|\/\/[^\r\n\u2028\u2029]*(?:\r\n)?$)))`+`((?:${B}){1,${g}}(?:${H}){0,${N}}|(?:${H}){1,${N}}|${Ge})`),Ke=8,q="token|secret|password|passwd|api[_-]?key",I="(?<![a-z0-9_]|[a-z0-9_]-)(?:(?:[a-z0-9]+_)+(?:password|passphrase)|(?:[a-z0-9]+[_-])*(?:secret|token|(?:api|secret|private|access)[_-]?key|client[_-]?secret|passwd|pwd))",p=4096,G=String.raw`"(?=[^"\s]{8}[^"\s]*")|'(?=[^'\s]{8}[^'\s]*')|(?!["'])`,K=String.raw`(?![<[$/]|~\/|\.\.?\/|[A-Za-z][\w+.-]*:\/\/|%[A-Za-z_]\w*%(?=$|[\s"',;)}\]<>&|\\])|[A-Za-z]:[\\/]|(?<=")(?:(?:[A-Za-z_]\w*\.){1,${p}}[A-Za-z_]\w*|[A-Za-z]+(?:-[A-Za-z]+){0,${p}}|(?:[\w.-]+\/){1,${p}}[\w.-]+\.[A-Za-z][A-Za-z0-9]{0,4})"|(?<=')(?:(?:[A-Za-z_]\w*\.){1,${p}}[A-Za-z_]\w*|[A-Za-z]+(?:-[A-Za-z]+){0,${p}}|(?:[\w.-]+\/){1,${p}}[\w.-]+\.[A-Za-z][A-Za-z0-9]{0,4})'|(?<!["'])[A-Za-z]+(?:-[A-Za-z]+){0,${p}}(?![\w!@#$%^&*.+\-=/~])|(?<!["'])(?:[A-Za-z_]\w*\.){1,${p}}[A-Za-z_]\w*(?![\w!@#$%^&*.+\-=/~])|(?<!["'])(?:[\w.-]+\/){1,${p}}[\w.-]+\.[A-Za-z][A-Za-z0-9]{0,4}(?=[\s,;)}\]]|$)|(?<!["'])[\w$.]+\()(?:(?<=")[^\s"]{8}[^\s"]*|(?<=')[^\s']{8}[^\s']*|(?<==)[A-Za-z0-9!@#$%^&*._+\-=/~?:|]{8,}|(?<!["'=])[A-Za-z0-9!@#$%^&*._+\-=/~]{8,})`,C=new RegExp(`(?:${G})(${K})`,"iy"),Qe=8,je=String.raw`[A-Za-z0-9!@#%^*._+\-=/~]`,Q=String.raw`&(?!&)`,Ye=64,j=String.raw`'[^'\s]*'|"[^"\\\s]*(?:\\\S[^"\\\s]*){0,${g}}"`,Y=String.raw`\$\{(?:${$(String.raw`[^{}$'"\\\s]`)}|\\\S|${j}|\$(?!\{)|\$\{[^{}\s]*\}){0,${g}}\}`+String.raw`|\$\((?:${$(String.raw`[^()$'"\\\s]`)}|\\\S|${j}|\$(?!\()|\$\([^()\s]*\)){0,${g}}\)`+String.raw`|<[^<>\s]*>|\$[A-Za-z_]\w*(?!\w)`,X=e=>String.raw`${Y}|${$(e)}|${Q}|\$(?![{(A-Za-z_])`,J=e=>String.raw`(?:"[^"\s]*"|'[^'\s]*')(?:${X(e)}){0,${g}}`,Xe=e=>String.raw`(?:(?:${e}|${Q}){1,${Ye}}(?=[$<]))?(?:${Y})`+String.raw`(?:${X(e)}){0,${g}}(?:${J(e)}){0,${N}}`,Je=e=>String.raw`(?:${J(e)}){1,${N}}`,ee=e=>String.raw`(?<!["'])(?:${e(je)})`,ne=String.raw`(?:[\w@#~]|!(?![.+\-*/%=^!(]))`,en=String.raw`(?=(?:"[^"\s]*"|'[^'\s]*')[$<"']`+String.raw`|"(?=[^"\s]*[$<])[^"\s]*"${ne}|'(?=[^'\s]*[$<])[^'\s]*'${ne})`,nn=String.raw`(?<=")(?=[^"\s]*[$<])[^"\s]+|(?<=')(?=[^'\s]*[$<])[^'\s]+`,te=new RegExp(`(?:${en}|${G})((?=["'])(?:${ee(Je)})|${nn}|${ee(Xe)}|${K})`),re=/["']?([A-Za-z0-9+/=_-]{24,})/,zt=[{name:"private-key",mutationRule:"private_key",category:"credential",regex:/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----/g},{name:"github-token",mutationRule:"github_token",category:"credential",regex:/\b(?:gh[opsru]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,})\b/g},{name:"npm-token",mutationRule:"npm_token",category:"credential",regex:/\bnpm_[A-Za-z0-9]{20,}\b/g},{name:"aws-access-key",mutationRule:"aws_access_key",category:"credential",regex:/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g},{name:"google-api-key",mutationRule:"google_api_key",category:"credential",regex:/\bAIza[0-9A-Za-z_-]{35}\b/g},{name:"slack-token",mutationRule:"slack_token",category:"credential",regex:/\bxox[baprs]-[A-Za-z0-9-]{10,}\b/g},{name:"anthropic-api-key",mutationRule:"anthropic_api_key",category:"credential",regex:/\bsk-ant-[A-Za-z0-9_-]{20,}\b/g},{name:"openai-api-key",mutationRule:"openai_api_key",category:"credential",regex:/\bsk-(?!ant-)[A-Za-z0-9_-]{20,}\b/g},{name:"gitlab-token",mutationRule:"gitlab_token",category:"credential",regex:/\bglpat-[A-Za-z0-9_.-]{20,}\b/g},{name:"jwt-like-token",mutationRule:"jwt_like_token",category:"credential",regex:/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g},{name:"npm-auth-token-assignment",mutationRule:"npm_auth_token_assignment",category:"credential",regex:/_authToken\s*=\s*\S+/g},{name:"sentry-user-token",mutationRule:"sentry_user_token",category:"credential",regex:/\bsntryu_[A-Za-z0-9]{20,}\b/g},{name:"sentry-org-token",mutationRule:"sentry_org_token",category:"credential",regex:/\bsntrys_[A-Za-z0-9_-]{20,}\b/g},{name:"private-ip",mutationRule:"private_ip",category:"network",regex:/\b(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g},{name:"private-ssh-target",mutationRule:"private_ssh_target",category:"network",regex:/\b(?:ssh|scp|rsync)\s+[A-Za-z0-9._-]+@(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g},{name:"sshpass-inline-password",mutationRule:"sshpass_inline_password",category:"credential",regex:/\bsshpass\s+-p\s+["'][^"']{6,}["']/g},{name:"password-assignment",mutationRule:"password_assignment",category:"credential",regex:new RegExp(String.raw`\b(?:${V})\s*[:=]\s*`+W.source,"gi"),structured:{keys:V,value:W.source,element:!0},minimumLiteralLength:Ke},{name:"absolute-home-path",mutationRule:"absolute_home_path",category:"path",regex:Pe,excludeFiles:/^(?:tests\/|examples\/)/},{name:"user-at-private-host",mutationRule:"user_at_private_host",category:"network",regex:/(?<![A-Za-z0-9._-])[A-Za-z0-9._-]+@(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g,excludeFiles:/^(?:tests\/|examples\/)/},{name:"high-entropy-assignment",mutationRule:"high_entropy_assignment",category:"credential",regex:new RegExp(String.raw`\b(?:${q})\s*[:=]\s*`+re.source,"gi"),structured:{keys:q,value:re.source},mutationOnlyReason:"Generic assignments in source code are not credentials; preserve the existing mutation heuristic without treating source identifiers as secrets.",minimumEntropy:3.5},{name:"credential-key-assignment",mutationRule:"credential_key_assignment",category:"credential",regex:new RegExp(String.raw`\b(?:${I})\s*[:=]\s*`+te.source,"gi"),structured:{keys:I,value:te.source,element:!0,elementValue:!0},mutationOnlyReason:"Key-named assignments in source code and test fixtures are identifiers and synthetic data; repository scans keep the token-format rules, which recognize real credentials there.",minimumEntropy:3,minimumLiteralLength:Qe,literalValue:C,baseline:{regex:new RegExp(String.raw`\b(?:${I})\s*[:=]\s*`+C.source,"gi"),value:C.source},rejectValue:/^(?:[\w.-]+\/)*id_(?:rsa|dsa|ecdsa|ed25519)(?:_sk)?(?:\.pub)?$/u,rejectStatementReference:/^[A-Z]+(?:_[A-Z]+)+$/u}];function*Mt(e,n){if(e.mutationRule==="absolute_home_path"){yield*We(n,e.regex);return}for(const t of ie(e))yield*cn(t,n),t.structured&&(yield*gt(t,t.structured,n))}const se=new WeakMap;function ie(e){const n=e.baseline;if(n===void 0)return[e];let t=se.get(e);return t===void 0&&(t={...e,regex:n.regex,minimumLiteralLength:void 0,literalValue:void 0,baseline:void 0},e.structured&&(t.structured={...e.structured,value:n.value}),se.set(e,t)),[e,t]}function tn(e,n){const t=e[n-1]==="#"||e[n-1]==="!"?n-1:n;return e[t-1]==="{"&&e[t-2]==="$"}const b=new WeakSet,ue=new WeakMap,rn=4096;function sn(e,n,t){const r=[],s=[],i=n+t.length;return oe(e,n,i,s,r),oe(e,i,Math.min(e.length,i+rn),s),r}function oe(e,n,t,r,s){for(let i=n;i<t&&(s!==void 0||r.length>0);i+=1){const u=r.at(-1);if(e[i]==="$"&&(e[i+1]==="{"||e[i+1]==="(")&&u?.quoted!=="'"){const o={open:i,close:t,command:e[i+1]==="(",quoted:[]};s?.push(o),r.push({span:o,closer:e[i+1]==="{"?"}":")"}),i+=1}else u!==void 0&&(i=un(e,i,r))}}function un(e,n,t){const r=t.at(-1),s=e[n];return s==="\\"&&r.quoted!=="'"?n+1:(r.quoted!==void 0?s===r.quoted&&(r.span.quoted.push([r.quoteStart,n]),r.quoted=void 0):s==="'"||s==='"'?(r.quoted=s,r.quoteStart=n):s===r.closer&&(t.pop().span.close=n),n)}function on(e){const n=[];let t=0;return r=>{for(;t<e.length&&e[t].open<r;t+=1){for(;n.length>0&&n.at(-1).close<e[t].open;)n.pop();n.push(e[t])}for(;n.length>0&&n.at(-1).close<r;)n.pop();return n.at(-1)}}function an(e,n){let t=0,r=e.quoted.length-1;for(;t<=r;){const s=t+r>>1,[i,u]=e.quoted[s];if(n<i)r=s-1;else if(n>u)t=s+1;else return!0}return!1}const ae=/\$[({A-Za-z_]|</u,k=new WeakMap;function*cn(e,n){const t=new RegExp(e.regex),r=ln(e);let s,i;for(let u=t.exec(n);u!==null;u=t.exec(n)){let o=u;if(e.minimumLiteralLength!==void 0){i??=bn(n);const a=u.index+u[0].length,c=a-u[1].length,l=Bn(i,c,a);l>c&&(l<a&&(o=Qn(u,l),t.lastIndex=l),k.set(o,l))}L(e,o)?yield{index:o.index}:r!==void 0&&ae.test(o[1])&&(s??=new RegExp(t),yield*dn(e,s,n,o,r==="deep"))}}function ln(e){return e.minimumLiteralLength===void 0?void 0:e.minimumEntropy===void 0&&e.literalValue===void 0&&e.rejectValue===void 0?"deep":"shallow"}function*dn(e,n,t,r,s){const i=r.index+r[0].length;n.lastIndex=i-r[1].length;let u;for(let o=n.exec(t);o!==null&&o.index<i;o=n.exec(t)){if(tn(t,o.index)){n.lastIndex=o.index+1;continue}u??=on(sn(t,i-r[1].length,r[1]));const a=u(o.index);a!==void 0&&(ue.set(o,a.close),a.command&&!an(a,o.index)&&b.add(o)),L(e,o)?yield{index:o.index}:s&&ae.test(o[1])&&(n.lastIndex=o.index+o[0].length-o[1].length)}}const ce=new Map,y=/[\r\n\u2028\u2029]/u;function z(e){const n=`${e.keys}\0${e.value}\0${e.element===!0}`;let t=ce.get(n);return t||(t={key:new RegExp(String.raw`\b(?:${e.keys})(["']?)\s*[:=]\s*`,"gi"),value:new RegExp(e.value,"iyd"),...e.element?{element:{open:new RegExp(String.raw`<(?:${e.keys})(?:\s[^<>]*)?>`,"gi"),close:new RegExp(String.raw`<\/(?:${e.keys})\s*>`,"iy"),span:new RegExp(String.raw`<(?!\/?(?:${e.keys})\b)[^<>]*>`,"iy")}}:{}},ce.set(n,t)),t}function le(e,n){const t=e[n];for(let r=n+1;r<e.length;r+=1){const s=e[r];if(s==="\\")r+=1;else if(s===t)return{end:r+1,terminated:!0}}return{end:e.length,terminated:!1}}function fn(e,n){return le(e,n).end}function gn(e,n,t){return e.at(-1)==="}"?t:n}function pn(e,n,t,r=t){const s=[];let i=!1;for(let u=n;u<e.length;u+=1){const o=e[u];switch(o){case"[":case"{":s.push(o==="["?"]":"}"),i=o==="{";break;case"]":case"}":if(s.pop()!==o||s.length===0)return{found:!1,end:u+1};i=!1;break;case",":i=s.at(-1)==="}";break;case":":i=!1;break;case'"':case"'":if(!i&&gn(s,t,r)(u))return{found:!0,end:u};u=fn(e,u)-1;break;default:break}}return{found:!1,end:e.length}}const En=/\\(?:U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{2}|[0-7]{1,3}|[\s\S])/gu,_n={n:`
|
|
3
|
-
`,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"};function
|
|
4
|
-
`||u==="\r"||u==='"'||u==="'")return"malformed"}return"malformed"}function ge(e,n,t,r=!1){const s=(o,a,c)=>{n.lastIndex=a;const l=n.exec(o);if(l===null||y.test(l[0]))return null;const f=l.indices?.[1];return c!==void 0&&f!==void 0&&(l[1]=c.original.slice(Math.max(f[0],c.bodyStart),Math.min(f[1],c.bodyEnd)),O.add(l)),L(e,l)?l:null},i=o=>{if(t[o]!=='"'&&t[o]!=="'")return;const{end:a,terminated:c}=le(t,o),l=t.slice(o,a);if(!r&&!l.includes("\\"))return;if(y.test(l))return[];const f=An(l,c);return(t[o]==="'"?[f,{reading:l,...de(l,c)}]:[f]).map(A=>s(A.reading,0,A)).filter(A=>A!==null)},u=o=>{const a=i(o);if(a!==void 0)return a;const c=s(t,o);return c===null?[]:[c]};return{direct:o=>s(t,o)!==null,escaped:o=>(i(o)?.length??0)>0,accepts:o=>a=>u(a).some(c=>!(o&&/\s/u.test(hn(e,c))))}}function hn(e,n){return e.minimumLiteralLength===void 0?n[0]:pe(n)}const O=new WeakSet;function pe(e){const n=b.has(e)&&!_(w(e))?yn(e[1]):void 0,t=n??e[1];if(n===void 0&&wn(e,t))return"";const r=n!==void 0||Tn(e);return O.has(e)||_(w(e))?Le(t,r):kt(t,r)}const $n=/^%[A-Za-z_]\w*%$/u,Sn=/^(["']?)%[A-Za-z_]\w*%\1$/u;function wn(e,n){if(!Sn.test(n))return!1;if(O.has(e))return!0;const t=e.input,r=e.index+e[0].length;if(k.get(e)===r)return!0;let s=r;for(;s<t.length&&(t[s]===" "||t[s]===" ");)s+=1;return s===t.length||y.test(t[s])?!0:_(n[0])&&/[,;)}\]]/u.test(t[s])&&Nn(e)}const mn=/(?:^|[\s{,[])(["'])[^"'\r\n]{1,256}\1\s*[:=]\s*$/u;function Nn(e){if(Ee(e,!1)!==void 0)return!0;const n=e.input,t=e.index+e[0].length-e[1].length,r=n.slice(Math.max(0,t-_e),t);return mn.test(r)||/:[ \t]*$/u.test(r)}function yn(e){for(let n=0;n<e.length;n+=1){const t=e[n];if(t==="'"||t==='"')n=ye(e,n);else if(t==="$"&&(e[n+1]==="{"||e[n+1]==="("))n=Math.max(n,D(e,n)-1);else if(/[|&;<>]/u.test(t))return e.slice(0,n)}}const On=/^[;,)}\]]{0,64}/u;function Tn(e){const n=e.input,t=e.index+e[0].length,r=_(w(e))&&_(n[t])?t+1:_(e[0].at(-1))?t:-1,s=r===-1?t:r,i=On.exec(n.slice(s,s+he))[0].length,u=s+i;if(u===n.length||/\s/u.test(n[u])||Ln(e,s,t))return!0;if(r===-1||i===0)return!1;const o=Ee(e,r===t+1),a=n.slice(u,u+40),c=/[}\]]/u.test(n.slice(s,u));return o!==void 0&&(Ae.test(a)||(o==="element"||c)&&Re.test(a))}function Ln(e,n,t){return ue.get(e)===n||b.has(e)&&/[|&;<>]/u.test(e.input[n])?!0:k.get(e)===t}function Ee(e,n){const t=e.input,r=e.index+e[0].length-e[1].length-(n?1:0),s=t.slice(Math.max(0,r-_e),r);return In.test(s)?"element":xn.test(s)?"key":void 0}const _e=512,xn=/[{,]\s*(["'])[^"'\r\n]{1,256}\1\s*[:=]\s*$/u,In=/[[,]\s*$/u,Ae=/^(?:["'`]|[{[](?:[\s"'`{[\]}]|$|(?:-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null)[\s,\]}]))/u,Re=/^(?:-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null)[\s,\]}]/u,he=64,S=0,M=1,Cn=2,$e=/[\p{L}\p{N}_]/u;function Se(e){return e===10||e===13}function bn(e){return{content:e,index:0,state:S,opener:-1,escapes:!0}}function we(e){const{content:n}=e,t=e.index,r=n.charCodeAt(t);if(e.index=t+1,Se(r))return e.state=S,-1;if(r===92)return e.escapes&&t+1<n.length&&!Se(n.charCodeAt(t+1))&&(e.index=t+2),-1;if(r!==34&&r!==39)return-1;const s=r===34?M:Cn;return e.state===s?(e.state=S,t):(e.state===S&&!(t>0&&$e.test(n[t-1]))&&(e.state=s,e.opener=t,e.escapes=s===M||Mn(n,t)),-1)}function kn(e,n){for(;e.index<n;)we(e)}function zn(e,n){const t=me(e,n),r=e[t];return{inContainer:r!==void 0&&/[[{,:]/u.test(r),attribute:r==="="&&Pn(e,t)}}function me(e,n){let t=n-1;for(;t>=0&&/\s/u.test(e[t]);)t-=1;return t}function Mn(e,n){return/[[{,:]/u.test(e.charAt(me(e,n)))}const Dn=8192;function Pn(e,n){const t=Math.max(0,n-Dn);for(let r=n-1;r>=t;r-=1){const s=e[r];if(s===">")return!1;if(s==="<")return/[A-Za-z]/u.test(e.charAt(r+1));if(s==='"'||s==="'"){const i=e.lastIndexOf(s,r-1);if(i<t)return!1;r=i}}return!1}const Zn=/[,:;)}\]]/u;function Un(e,n,t){let r=n+1;if(vn(e,r,t))return!0;const s=Math.min(e.length,r+he);for(;r<s&&Zn.test(e[r]);)r+=1;if(r===n+1)return!1;for(;r<e.length&&(e[r]===" "||e[r]===" ");)r+=1;if(r===e.length||y.test(e[r]))return!0;if(!t.inContainer)return!1;const i=e.slice(r,r+Vn);return Ae.test(i)||Re.test(i)||Fn.test(i)}function vn(e,n,t){return n===e.length||/\s/u.test(e[n])?!0:t.attribute&&(e[n]===">"||e.startsWith("/>",n))}const Vn=512,Fn=/^[A-Za-z_][\w.-]{0,480}:(?:\s|$)/u;function Bn(e,n,t){kn(e,n);const r=e.state;if(r===S)return-1;const{content:s}=e,i=e.opener,u=r===M?"'":'"',o={open:!1,placeholder:!1,references:[]},a=Math.min(t,s.length-1);for(;e.index<=a;){qn(o,s,e.index,u);const c=we(e);if(c!==-1){const l=o.open||o.placeholder||o.references.length>0;return Kn(s,c,t,l)&&Un(s,c,zn(s,i))?c:-1}if(e.state!==r)return-1}return-1}const Hn=/^<[^<>\s]{0,254}>/u,Wn=256;function qn(e,n,t,r){const s=n[t];e.open?s===r&&(e.open=!1):e.placeholder?s===">"&&(e.placeholder=!1):s==="$"&&(n[t+1]==="{"||n[t+1]==="(")?e.references.push(n[t+1]==="{"?"}":")"):s===e.references.at(-1)?e.references.pop():s==="<"&&Hn.test(n.slice(t,t+Wn))?e.placeholder=!0:s===r&&(e.open=Gn(n,t))}function Gn(e,n){return e[n]==='"'||!$e.test(e[n-1])}function Kn(e,n,t,r){return n>=t||!(r||/\s/u.test(e.charAt(n+1)))}function Qn(e,n){const t=e.index+e[0].length-e[1].length,r=[e.input.slice(e.index,n),e.input.slice(t,n)];return Object.assign(r,{index:e.index,input:e.input,groups:void 0})}const jn=/^\s{0,16}\(/u,Yn=/(?<![=!<>])=[ \t]{0,16}$/u;function w(e){return e.input[e.index+e[0].length-e[1].length-1]}function _(e){return e==='"'||e==="'"}const Xn=/[$<"']/u;function Jn(e){if(O.has(e)||_(w(e))||!/^[$<]/u.test(e[1]))return!1;const n=e.index+e[0].length,t=n-e[1].length,r=e.input.slice(n,n+18);if(e[1][0]==="<"&&(it(e[1])||Yn.test(e.input.slice(Math.max(0,t-18),t))||ot.test(r)))return!0;const s=Ne(e[1]),i=e[1][s]==="!"?e[1][s+1]:e[1][s];return ut.test(i??"")||jn.test(r)}function Ne(e){let n=0;for(let t=D(e,n);t!==-1;t=D(e,n))n=t;return n}function D(e,n){const t=e[n];if(t==="<")return et(e,n);if(t!=="$")return-1;const r=e[n+1];if(r==="{"||r==="(")return nt(e,n+1,r);T.lastIndex=n;const s=T.exec(e)?.[0];return s===void 0?-1:n+s.length}function et(e,n){const t=e.indexOf(">",n+1),r=e.indexOf("<",n+1);return t!==-1&&(r===-1||t<r)?t+1:-1}function nt(e,n,t){const r=t==="{"?"}":")";let s=0;for(let i=n;i<e.length;i+=1){const u=e[i];if(u==="\\")i+=1;else if(u==="'"||u==='"')i=ye(e,i);else if(u===t)s+=1;else if(u===r&&--s===0)return i+1}return-1}function ye(e,n){const t=e[n];for(let r=n+1;r<e.length;r+=1){if(e[r]===t)return r;t==='"'&&e[r]==="\\"&&(r+=1)}return e.length}const tt=/^[\w$.[\]|&,{}:;?]+$/u,rt=/^(?:"[^"]*"|'[^']*'|-?\d+(?:\.\d+)?)(?:\|(?:"[^"]*"|'[^']*'|-?\d+(?:\.\d+)?|[A-Za-z_$][\w$.]*))*$/u,st=/\b(?:string|number|boolean|bigint|symbol|any|unknown|object|never|void|undefined|null)\b/u;function it(e){const n=e.slice(1,e.indexOf(">"));return rt.test(n)?!0:tt.test(n)?st.test(n)||/[.|&[{]/u.test(n)||/^[A-Z][\w$]*$/u.test(n)&&(n.length===1||/[a-z]/u.test(n)):!1}const ut=/[.+\-*/%=^&]/u,ot=/^\s{0,16}(?:\?\.|\?\?|\|\||&&|[([])/u;function at(e,n,t){if(t)return!1;const r=n.replaceAll('"',"'");return e.lastIndex=0,e.exec(`"${r}"`)?.[1]===r}function Dt(e,n){if(!e.structured)return;const t=`${JSON.stringify(n)}:`,r=z(e.structured).key;r.lastIndex=0;for(let s=r.exec(t);s;s=r.exec(t)){if(s.index+s[0].length!==t.length)continue;const i=fe(t,s.index,s[1]);if(i!=="malformed")return i}}function Pt(e,n,t){if(!e.structured)return!1;const r=JSON.stringify(n).replaceAll("\u2028","\\u2028").replaceAll("\u2029","\\u2029");return ie(e).some(s=>ge(s,z(s.structured).value,r,!0).accepts(t)(0))}function*ct(e,n,t){const r=new RegExp(e.open);for(let s=r.exec(n);s;s=r.exec(n)){const i=s.index+s[0].length,u=lt(e,n,i);if(u===void 0){r.lastIndex=s.index+1;continue}t(n.slice(i,u.start).trim())&&(yield{index:s.index}),r.lastIndex=u.end}}function lt(e,n,t){for(let r=n.indexOf("<",t);r!==-1;){e.close.lastIndex=r;const s=e.close.exec(n);if(s!==null)return{start:r,end:r+s[0].length};e.span.lastIndex=r;const i=e.span.exec(n);if(i===null)return;r=n.indexOf("<",r+i[0].length)}}function dt(e,n,t){return n<e.exact||t&&n<e.compact}function ft(e,n,t,r){return(t||e.escaped(r)&&!e.direct(r))&&n(r)}function*gt(e,n,t){const r=z(n),s=ge(e,r.value,t),i=new RegExp(r.key),u={exact:0,compact:0};for(let o=i.exec(t);o;o=i.exec(t)){const a=o[1],c=fe(t,o.index,a);if(c==="malformed")continue;const l=c==="prefixed",f=s.accepts(l),E=o.index+o[0].length,A=t[E];if(A==="["||A==="{"){if(dt(u,E,l))continue;const Z=pn(t,E,f,s.accepts(!0));u[l?"compact":"exact"]=Z.end,Z.found&&(yield{index:o.index})}else ft(s,f,a,E)&&(yield{index:o.index})}r.element&&(yield*ct(r.element,t,Et(e,n,r)))}const pt=8;function Et(e,n,t){if(!n.elementValue){const r=e.minimumLiteralLength??pt;return s=>!$n.test(s.trim())&&Le(s).length>=r}return r=>{const s=r.replaceAll('"',"'");t.value.lastIndex=0;const i=t.value.exec(`"${s}"`);return i===null||i[1]!==s?!1:(i[1]=r,L(e,i))}}function _t(e,n,t){const r=n.index+n[0].length;return/^[ \t]*;/u.test(n.input.slice(r,r+64))&&!_(w(n))&&e.test(t)}function At(e,n){for(let t=n+1;t<e.length;t+=1){if(e[t]===">")return t;if(e[t]==="<")return-1}return-1}function P(e,n){e.raw+=n,e.literal+=n}function Rt(e,n,t){const r=e[n+1];if(e[n]!=="$"||r!=="{"&&r!=="(")return-1;const s=r==="{"?e.slice(n+2,n+2+Ot(e,n+2)):"",i=t[0],u=t.length===1&&i.quote!==void 0&&i.literal.length===i.pieceStart;return t.push({close:r==="{"?"}":")",keep:s!=="",raw:`$${r}${s}`,literal:"",opensPiece:u}),n+2+s.length}const ht=/[A-Za-z_]/u,$t=/\w/u,St=/[{(A-Za-z_]/u,T=/\$[A-Za-z_]\w*/y,wt=/^_*[A-Z][A-Z0-9_]*$/u,mt=/^\$[A-Za-z_]\w*$/u,Nt=/^(["'])\$[A-Za-z_]\w*\1$/u;function yt(e,n,t){T.lastIndex=n;const r=T.exec(e)?.[0];return r===void 0?-1:(t.literal===""&&wt.test(r.slice(1))?t.raw+=r:P(t,r),n+r.length)}function Ot(e,n){if(!ht.test(e[n]??""))return 0;let t=n+1;for(;t<e.length&&$t.test(e[t]);)t+=1;e[t]===":"&&(t+=1);const r=e[t];return r==="-"||r==="="||r==="+"?t+1-n:0}function Tt(e,n){const t=e.pop(),r=e.at(-1);r.raw+=`${t.raw}${n}`,t.keep&&(r.literal+=t.literal)}const Oe=/[^$<"'\\})]+/y,Lt='$`"\\\n';function xt(e,n){return e===`
|
|
5
|
-
`?"":n==='"'&&!
|
|
1
|
+
const h=`[^\\s/\\\\<>"'\\x60()\\[\\]{},;?=:#*]+`,d="[/\\\\]+",ze="[\\p{L}\\p{N}._@-]+",$=ze+"(?:"+d+h+")*",N="(?:(?:home|users)"+d+$+"|root"+d+$+")",Me="[/\\\\]"+N,Pe="[/\\\\]{2,}"+N,De="/?[a-z]:"+d+"users"+d+$,Ze=h+"(?: +"+h+")*",x="(?:"+Ze+d+")?users"+d+$,Ue="[/\\\\]{2,}"+h+d+x,ve="(?:[a-z]:|volume\\{[a-f0-9-]+\\}|"+h+")",v="[/\\\\]{2}[?.]"+d+"(?:unc"+d+h+d+x+"|"+ve+d+"users"+d+$+")",Fe="file:(?:"+v+"|(?:[/\\\\](?![/\\\\])|[/\\\\]{3,}|[/\\\\]{2}localhost"+d+")(?:"+N+"|[a-z]:"+d+"users"+d+$+")|[/\\\\]{2}(?:[a-z]:"+d+"users"+d+$+"|"+h+d+"(?:"+N+"|"+x+")))",Ve=new RegExp("(?:^|[^\\p{L}\\p{N}_./\\\\~])(?:"+Me+"|"+De+"|"+Fe+")|(?:^|[^\\p{L}\\p{N}_:./\\\\~])(?:"+Pe+"|"+Ue+"|"+v+")","giu"),F=4,Be=/%[a-f0-9]{2}|\\(?:u[a-f0-9]{4}|x[a-f0-9]{2}|\/)/iu,He=new TextDecoder("utf-8");function We(e){return e.replace(/(?:%[a-f0-9]{2})+/giu,n=>He.decode(Uint8Array.from(n.matchAll(/%([a-f0-9]{2})/giu),t=>Number.parseInt(t[1],16)))).replace(/%(?![a-f0-9]{2})[a-z0-9]{0,2}/giu,"\uFFFD")}function qe(e){return e.replace(/\\+(?:u([a-f0-9]{4})|x([a-f0-9]{2})|(\/))?/giu,(n,t,r,s)=>{const i=t??r;return i===void 0?s??n:String.fromCharCode(Number.parseInt(i,16))})}function Ge(e){return e.normalize("NFKC").replace(/[\p{Bidi_Control}\u200b-\u200f\u2060-\u206f\ufeff]/gu,"").replace(/[\u2215\u2044]/gu,"/").replace(/[\u043e\u041e]/gu,"o").replace(/[\u0455\u0405]/gu,"s")}function Ke(e,n){for(const[t,r]of[["percent_decode",We],["json_unescape",qe],["unicode_fold",Ge]]){const s=r(e);s!==e&&!n.includes(t)&&n.push(t),e=s}return e}function*Qe(e,n,t){let r=e;const s=[];for(let i=0;i<F;i+=1){const u=r;if(r=Ke(r,s),!t){n.lastIndex=0;for(const o of r.matchAll(n))t=!0,yield{index:0,normalizations:[...s]}}if(r===u)break;i===F-1&&Be.test(r)&&(yield{index:0,normalizations:[...s],normalization_incomplete:!0})}}function*Ye(e,n){let t=0;for(const r of e.split(`
|
|
2
|
+
`)){n.lastIndex=0;let s=!1;for(const i of r.matchAll(n))s=!0,yield{index:t+i.index};for(const i of Qe(r,n,s))yield{...i,index:t};t+=r.length+1}}const V="password|passphrase",y=4,_=4096,S=e=>`${e}+(?!${e})`,B=String.raw`'[^'\r\n]*'|"[^"\\\r\n]*(?:\\.[^"\\\r\n]*){0,${_}}"`,je=String.raw`\$\{(?:${S(String.raw`[^{}$'"\\\r\n]`)}|\\[^\r\n]|${B}|\$(?!\{)|\$\{[^{}\r\n]*\}){0,${_}}\}`+String.raw`|\$\((?:${S(String.raw`[^()$'"\\\r\n]`)}|\\[^\r\n]|${B}|\$(?!\()|\$\([^()\r\n]*\)){0,${_}}\)`,H=String.raw`${je}|<[^<>\r\n]*>|${S(String.raw`[A-Za-z0-9!@#%^&*._+\-=]`)}|\$(?![{(])`,Xe=String.raw`"[^"]*"|'[^']*'`,W=String.raw`(?:"[^"\s]*"|'[^'\s]*')(?:${H}){0,${_}}`,q=new RegExp(String.raw`(?!config\.auth\.password\s*(?:\|\|\s*(?:''|"")|\?\s*unescape\(encodeURIComponent\(config\.auth\.password\)\)\s*:\s*(?:''|""))(?=[ \t]*(?:\/\*(?:[^*]|\*(?!\/))*\*\/[ \t]*)*(?:;|$|\/\/[^\r\n\u2028\u2029]*(?:\r\n)?$)))`+`((?:${H}){1,${_}}(?:${W}){0,${y}}|(?:${W}){1,${y}}|${Xe})`),Je=8,G="token|secret|password|passwd|api[_-]?key",b="(?<![a-z0-9_]|[a-z0-9_]-)(?:(?:[a-z0-9]+_)+(?:password|passphrase)|(?:[a-z0-9]+[_-])*(?:secret|token|(?:api|secret|private|access)[_-]?key|client[_-]?secret|passwd|pwd))",R=4096,K=String.raw`"(?=[^"\s]{8}[^"\s]*")|'(?=[^'\s]{8}[^'\s]*')|(?!["'])`,Q=String.raw`(?![<[$/]|~\/|\.\.?\/|[A-Za-z][\w+.-]*:\/\/|%[A-Za-z_]\w*%(?=$|[\s"',;)}\]<>&|\\])|[A-Za-z]:[\\/]|(?<=")(?:(?:[A-Za-z_]\w*\.){1,${R}}[A-Za-z_]\w*|[A-Za-z]+(?:-[A-Za-z]+){0,${R}}|(?:[\w.-]+\/){1,${R}}[\w.-]+\.[A-Za-z][A-Za-z0-9]{0,4})"|(?<=')(?:(?:[A-Za-z_]\w*\.){1,${R}}[A-Za-z_]\w*|[A-Za-z]+(?:-[A-Za-z]+){0,${R}}|(?:[\w.-]+\/){1,${R}}[\w.-]+\.[A-Za-z][A-Za-z0-9]{0,4})'|(?<!["'])[A-Za-z]+(?:-[A-Za-z]+){0,${R}}(?![\w!@#$%^&*.+\-=/~])|(?<!["'])(?:[A-Za-z_]\w*\.){1,${R}}[A-Za-z_]\w*(?![\w!@#$%^&*.+\-=/~])|(?<!["'])(?:[\w.-]+\/){1,${R}}[\w.-]+\.[A-Za-z][A-Za-z0-9]{0,4}(?=[\s,;)}\]]|$)|(?<!["'])[\w$.]+\()(?:(?<=")[^\s"]{8}[^\s"]*|(?<=')[^\s']{8}[^\s']*|(?<==)[A-Za-z0-9!@#$%^&*._+\-=/~?:|]{8,}|(?<!["'=])[A-Za-z0-9!@#$%^&*._+\-=/~]{8,})`,k=new RegExp(`(?:${K})(${Q})`,"iy"),en=8,nn=String.raw`[A-Za-z0-9!@#%^*._+\-=/~]`,Y=String.raw`&(?!&)`,tn=64,j=String.raw`'[^'\s]*'|"[^"\\\s]*(?:\\\S[^"\\\s]*){0,${_}}"`,X=String.raw`\$\{(?:${S(String.raw`[^{}$'"\\\s]`)}|\\\S|${j}|\$(?!\{)|\$\{[^{}\s]*\}){0,${_}}\}`+String.raw`|\$\((?:${S(String.raw`[^()$'"\\\s]`)}|\\\S|${j}|\$(?!\()|\$\([^()\s]*\)){0,${_}}\)`+String.raw`|<[^<>\s]*>|\$[A-Za-z_]\w*(?!\w)`,J=e=>String.raw`${X}|${S(e)}|${Y}|\$(?![{(A-Za-z_])`,ee=e=>String.raw`(?:"[^"\s]*"|'[^'\s]*')(?:${J(e)}){0,${_}}`,rn=e=>String.raw`(?:(?:${e}|${Y}){1,${tn}}(?=[$<]))?(?:${X})`+String.raw`(?:${J(e)}){0,${_}}(?:${ee(e)}){0,${y}}`,sn=e=>String.raw`(?:${ee(e)}){1,${y}}`,ne=e=>String.raw`(?<!["'])(?:${e(nn)})`,te=String.raw`(?:[\w@#~]|!(?![.+\-*/%=^!(]))`,un=String.raw`(?=(?:"[^"\s]*"|'[^'\s]*')[$<"']`+String.raw`|"(?=[^"\s]*[$<])[^"\s]*"${te}|'(?=[^'\s]*[$<])[^'\s]*'${te})`,on=String.raw`(?<=")(?=[^"\s]*[$<])[^"\s]+|(?<=')(?=[^'\s]*[$<])[^'\s]+`,re=new RegExp(`(?:${un}|${K})((?=["'])(?:${ne(sn)})|${on}|${ne(rn)}|${Q})`),se=/["']?([A-Za-z0-9+/=_-]{24,})/,Vt=[{name:"private-key",mutationRule:"private_key",category:"credential",regex:/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----/g},{name:"github-token",mutationRule:"github_token",category:"credential",regex:/\b(?:gh[opsru]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,})\b/g},{name:"npm-token",mutationRule:"npm_token",category:"credential",regex:/\bnpm_[A-Za-z0-9]{20,}\b/g},{name:"aws-access-key",mutationRule:"aws_access_key",category:"credential",regex:/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g},{name:"google-api-key",mutationRule:"google_api_key",category:"credential",regex:/\bAIza[0-9A-Za-z_-]{35}\b/g},{name:"slack-token",mutationRule:"slack_token",category:"credential",regex:/\bxox[baprs]-[A-Za-z0-9-]{10,}\b/g},{name:"anthropic-api-key",mutationRule:"anthropic_api_key",category:"credential",regex:/\bsk-ant-[A-Za-z0-9_-]{20,}\b/g},{name:"openai-api-key",mutationRule:"openai_api_key",category:"credential",regex:/\bsk-(?!ant-)[A-Za-z0-9_-]{20,}\b/g},{name:"gitlab-token",mutationRule:"gitlab_token",category:"credential",regex:/\bglpat-[A-Za-z0-9_.-]{20,}\b/g},{name:"jwt-like-token",mutationRule:"jwt_like_token",category:"credential",regex:/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g},{name:"npm-auth-token-assignment",mutationRule:"npm_auth_token_assignment",category:"credential",regex:/_authToken\s*=\s*\S+/g},{name:"sentry-user-token",mutationRule:"sentry_user_token",category:"credential",regex:/\bsntryu_[A-Za-z0-9]{20,}\b/g},{name:"sentry-org-token",mutationRule:"sentry_org_token",category:"credential",regex:/\bsntrys_[A-Za-z0-9_-]{20,}\b/g},{name:"private-ip",mutationRule:"private_ip",category:"network",regex:/\b(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g},{name:"private-ssh-target",mutationRule:"private_ssh_target",category:"network",regex:/\b(?:ssh|scp|rsync)\s+[A-Za-z0-9._-]+@(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g},{name:"sshpass-inline-password",mutationRule:"sshpass_inline_password",category:"credential",regex:/\bsshpass\s+-p\s+["'][^"']{6,}["']/g},{name:"password-assignment",mutationRule:"password_assignment",category:"credential",regex:new RegExp(String.raw`\b(?:${V})\s*[:=]\s*`+q.source,"gi"),structured:{keys:V,value:q.source,element:!0},minimumLiteralLength:Je},{name:"absolute-home-path",mutationRule:"absolute_home_path",category:"path",regex:Ve,excludeFiles:/^(?:tests\/|examples\/)/},{name:"user-at-private-host",mutationRule:"user_at_private_host",category:"network",regex:/(?<![A-Za-z0-9._-])[A-Za-z0-9._-]+@(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g,excludeFiles:/^(?:tests\/|examples\/)/},{name:"high-entropy-assignment",mutationRule:"high_entropy_assignment",category:"credential",regex:new RegExp(String.raw`\b(?:${G})\s*[:=]\s*`+se.source,"gi"),structured:{keys:G,value:se.source},mutationOnlyReason:"Generic assignments in source code are not credentials; preserve the existing mutation heuristic without treating source identifiers as secrets.",minimumEntropy:3.5},{name:"credential-key-assignment",mutationRule:"credential_key_assignment",category:"credential",regex:new RegExp(String.raw`\b(?:${b})\s*[:=]\s*`+re.source,"gi"),structured:{keys:b,value:re.source,element:!0,elementValue:!0},mutationOnlyReason:"Key-named assignments in source code and test fixtures are identifiers and synthetic data; repository scans keep the token-format rules, which recognize real credentials there.",minimumEntropy:3,minimumLiteralLength:en,literalValue:k,baseline:{regex:new RegExp(String.raw`\b(?:${b})\s*[:=]\s*`+k.source,"gi"),value:k.source},rejectValue:/^(?:[\w.-]+\/)*id_(?:rsa|dsa|ecdsa|ed25519)(?:_sk)?(?:\.pub)?$/u,rejectStatementReference:/^[A-Z]+(?:_[A-Z]+)+$/u}];function*Bt(e,n){if(e.mutationRule==="absolute_home_path"){yield*Ye(n,e.regex);return}for(const t of ue(e))yield*pn(t,n),t.structured&&(yield*St(t,t.structured,n))}const ie=new WeakMap;function ue(e){const n=e.baseline;if(n===void 0)return[e];let t=ie.get(e);return t===void 0&&(t={...e,regex:n.regex,minimumLiteralLength:void 0,literalValue:void 0,baseline:void 0},e.structured&&(t.structured={...e.structured,value:n.value}),ie.set(e,t)),[e,t]}function an(e,n){const t=e[n-1]==="#"||e[n-1]==="!"?n-1:n;return e[t-1]==="{"&&e[t-2]==="$"}const z=new WeakSet,oe=new WeakMap,cn=4096;function ln(e,n,t){const r=[],s=[],i=n+t.length;return ae(e,n,i,s,r),ae(e,i,Math.min(e.length,i+cn),s),r}function ae(e,n,t,r,s){for(let i=n;i<t&&(s!==void 0||r.length>0);i+=1){const u=r.at(-1);if(e[i]==="$"&&(e[i+1]==="{"||e[i+1]==="(")&&u?.quoted!=="'"){const o={open:i,close:t,command:e[i+1]==="(",quoted:[]};s?.push(o),r.push({span:o,closer:e[i+1]==="{"?"}":")"}),i+=1}else u!==void 0&&(i=dn(e,i,r))}}function dn(e,n,t){const r=t.at(-1),s=e[n];return s==="\\"&&r.quoted!=="'"?n+1:(r.quoted!==void 0?s===r.quoted&&(r.span.quoted.push([r.quoteStart,n]),r.quoted=void 0):s==="'"||s==='"'?(r.quoted=s,r.quoteStart=n):s===r.closer&&(t.pop().span.close=n),n)}function fn(e){const n=[];let t=0;return r=>{for(;t<e.length&&e[t].open<r;t+=1){for(;n.length>0&&n.at(-1).close<e[t].open;)n.pop();n.push(e[t])}for(;n.length>0&&n.at(-1).close<r;)n.pop();return n.at(-1)}}function gn(e,n){let t=0,r=e.quoted.length-1;for(;t<=r;){const s=t+r>>1,[i,u]=e.quoted[s];if(n<i)r=s-1;else if(n>u)t=s+1;else return!0}return!1}const ce=/\$[({A-Za-z_]|</u,L=new WeakMap;function*pn(e,n){const t=new RegExp(e.regex),r=En(e);let s,i;for(let u=t.exec(n);u!==null;u=t.exec(n)){let o=u;if(e.minimumLiteralLength!==void 0){i??=me(n);const c=u.index+u[0].length,a=c-u[1].length,l=Oe(i,a,c);l>a&&(l<c&&(o=Te(u,l),t.lastIndex=l),L.set(o,l))}C(e,o)?yield{index:o.index}:r!==void 0&&ce.test(o[1])&&(s??=new RegExp(t),yield*_n(e,s,n,o,r==="deep"))}}function En(e){return e.minimumLiteralLength===void 0?void 0:e.minimumEntropy===void 0&&e.literalValue===void 0&&e.rejectValue===void 0?"deep":"shallow"}function*_n(e,n,t,r,s){const i=r.index+r[0].length;n.lastIndex=i-r[1].length;let u;for(let o=n.exec(t);o!==null&&o.index<i;o=n.exec(t)){if(an(t,o.index)){n.lastIndex=o.index+1;continue}u??=fn(ln(t,i-r[1].length,r[1]));const c=u(o.index);c!==void 0&&(oe.set(o,c.close),c.command&&!gn(c,o.index)&&z.add(o)),C(e,o)?yield{index:o.index}:s&&ce.test(o[1])&&(n.lastIndex=o.index+o[0].length-o[1].length)}}const le=new Map,O=/[\r\n\u2028\u2029]/u;function M(e){const n=`${e.keys}\0${e.value}\0${e.element===!0}`;let t=le.get(n);return t||(t={key:new RegExp(String.raw`\b(?:${e.keys})(["']?)\s*[:=]\s*`,"gi"),value:new RegExp(e.value,"iyd"),...e.element?{element:{open:new RegExp(String.raw`<(?:${e.keys})(?:\s[^<>]*)?>`,"gi"),close:new RegExp(String.raw`<\/(?:${e.keys})\s*>`,"iy"),span:new RegExp(String.raw`<(?!\/?(?:${e.keys})\b)[^<>]*>`,"iy")}}:{}},le.set(n,t)),t}function de(e,n){const t=e[n];for(let r=n+1;r<e.length;r+=1){const s=e[r];if(s==="\\")r+=1;else if(s===t)return{end:r+1,terminated:!0}}return{end:e.length,terminated:!1}}function An(e,n){return de(e,n).end}function Rn(e,n,t){return e.at(-1)==="}"?t:n}function hn(e,n,t,r=t){const s=[];let i=!1;for(let u=n;u<e.length;u+=1){const o=e[u];switch(o){case"[":case"{":s.push(o==="["?"]":"}"),i=o==="{";break;case"]":case"}":if(s.pop()!==o||s.length===0)return{found:!1,end:u+1};i=!1;break;case",":i=s.at(-1)==="}";break;case":":i=!1;break;case'"':case"'":if(!i&&Rn(s,t,r)(u))return{found:!0,end:u};u=An(e,u)-1;break;default:break}}return{found:!1,end:e.length}}const $n=/\\(?:U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{2}|[0-7]{1,3}|[\s\S])/gu,Sn={n:`
|
|
3
|
+
`,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"};function wn(e,n){const t=e[0],r=e.slice(1,n?-1:void 0).replaceAll($n,u=>{const o=u[1];if((o==="u"||o==="x")&&u.length>2)return String.fromCharCode(Number.parseInt(u.slice(2),16));if(/^[0-7]$/u.test(o))return String.fromCharCode(Number.parseInt(u.slice(1),8));if(o==="U"&&u.length===10){const c=Number.parseInt(u.slice(2),16);return c<=1114111?String.fromCodePoint(c):"\uFFFD"}return Sn[o]??o}),s=r.replaceAll(t,t==='"'?"'":'"').replaceAll(/[\r\n\u2028\u2029]/gu," "),i=n?t:"";return{reading:`${t}${s}${i}`,...fe(`${t}${r}${i}`,n)}}function mn(e,n,t,r){const s=wn(t,r);return e[n]==="'"&&r?[s,{reading:t,...fe(t,!0)}]:[s]}function fe(e,n){return{original:e,bodyStart:1,bodyEnd:e.length-(n?1:0)}}const Nn=64;function ge(e,n,t){const r=e[n-1];if(!t)return r!==void 0&&/[\p{L}\p{N}_.-]/u.test(r)?"prefixed":"exact";if(r===t)return"exact";const s=Math.max(0,n-Nn);for(let i=n-1;i>=s;i-=1){const u=e[i];if(u===t)return"prefixed";if(u===`
|
|
4
|
+
`||u==="\r"||u==='"'||u==="'")return"malformed"}return"malformed"}function pe(e,n,t,r=!1){const s=Xn(e,t),i=(a,l,f)=>{n.lastIndex=l;const g=n.exec(a);if(g===null||O.test(g[0]))return null;const p=s(g),E=p.indices?.[1];return f!==void 0&&E!==void 0&&(p[1]=f.original.slice(Math.max(E[0],f.bodyStart),Math.min(E[1],f.bodyEnd)),T.add(p)),C(e,p)?p:null},u=a=>{if(t[a]!=='"'&&t[a]!=="'")return;const{end:l,terminated:f}=de(t,a),g=t.slice(a,l);if(!r&&!g.includes("\\"))return;if(O.test(g))return[];const p=mn(t,a,g,f).map(E=>i(E.reading,0,E)).filter(E=>E!==null);return t[a]==="'"?[...p,...o(a)]:p},o=a=>{const l=i(t,a);return l===null?[]:[l]},c=a=>u(a)??o(a);return{direct:a=>i(t,a)!==null,escaped:a=>(u(a)?.length??0)>0,accepts:a=>l=>c(l).some(f=>!(a&&/\s/u.test(yn(e,f))))}}function yn(e,n){return e.minimumLiteralLength===void 0?n[0]:Ee(n)}const T=new WeakSet;function Ee(e){const n=z.has(e)&&!A(m(e))?xn(e[1]):void 0,t=n??e[1];if(n===void 0&&Tn(e,t))return"";const r=n!==void 0||kn(e);return T.has(e)||A(m(e))?ke(t,r):Ft(t,r)}const Ln=/^%[A-Za-z_]\w*%$/u,On=/^(["']?)%[A-Za-z_]\w*%\1$/u;function Tn(e,n){if(!On.test(n))return!1;if(T.has(e))return!0;const t=e.input,r=e.index+e[0].length;if(L.get(e)===r)return!0;let s=r;for(;s<t.length&&(t[s]===" "||t[s]===" ");)s+=1;return s===t.length||O.test(t[s])?!0:A(n[0])&&/[,;)}\]]/u.test(t[s])&&Cn(e)}const In=/(?:^|[\s{,[])(["'])[^"'\r\n]{1,256}\1\s*[:=]\s*$/u;function Cn(e){if(_e(e,!1)!==void 0)return!0;const n=e.input,t=e.index+e[0].length-e[1].length,r=n.slice(Math.max(0,t-Ae),t);return In.test(r)||/:[ \t]*$/u.test(r)}function xn(e){for(let n=0;n<e.length;n+=1){const t=e[n];if(t==="'"||t==='"')n=Ce(e,n);else if(t==="$"&&(e[n+1]==="{"||e[n+1]==="("))n=Math.max(n,Z(e,n)-1);else if(/[|&;<>]/u.test(t))return e.slice(0,n)}}const bn=/^[;,)}\]]{0,64}/u;function kn(e){const n=e.input,t=e.index+e[0].length,r=A(m(e))&&A(n[t])?t+1:A(e[0].at(-1))?t:-1,s=r===-1?t:r,i=bn.exec(n.slice(s,s+$e))[0].length,u=s+i;if(u===n.length||/\s/u.test(n[u])||zn(e,s,t))return!0;if(r===-1||i===0)return!1;const o=_e(e,r===t+1),c=n.slice(u,u+40),a=/[}\]]/u.test(n.slice(s,u));return o!==void 0&&(Re.test(c)||(o==="element"||a)&&he.test(c))}function zn(e,n,t){return oe.get(e)===n||z.has(e)&&/[|&;<>]/u.test(e.input[n])?!0:L.get(e)===t}function _e(e,n){const t=e.input,r=e.index+e[0].length-e[1].length-(n?1:0),s=t.slice(Math.max(0,r-Ae),r);return Pn.test(s)?"element":Mn.test(s)?"key":void 0}const Ae=512,Mn=/[{,]\s*(["'])[^"'\r\n]{1,256}\1\s*[:=]\s*$/u,Pn=/[[,]\s*$/u,Re=/^(?:["'`]|[{[](?:[\s"'`{[\]}]|$|(?:-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null)[\s,\]}]))/u,he=/^(?:-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null)[\s,\]}]/u,$e=64,w=0,P=1,Dn=2,Se=/[\p{L}\p{N}_]/u;function we(e){return e===10||e===13}function me(e){return{content:e,index:0,state:w,opener:-1,escapes:!0,declined:!1}}function D(e){const{content:n}=e,t=e.index,r=n.charCodeAt(t);if(e.index=t+1,we(r))return e.state=w,e.escapes=!0,e.declined=!1,-1;if(r===92)return Zn(e,t),-1;if(r!==34&&r!==39)return-1;const s=r===34?P:Dn;return e.state===s?(e.state=w,e.escapes=!0,t):(e.state===w&&Un(e,s,t),-1)}function Zn(e,n){const{content:t}=e;!e.escapes||n+1>=t.length||we(t.charCodeAt(n+1))||(e.index=n+2,e.state===w&&A(t[n+1])&&(e.declined=!0))}function Un(e,n,t){const{content:r}=e;if(t>0&&Se.test(r[t-1])&&!vn.test(r.slice(Math.max(0,t-3),t))){e.declined=!0;return}e.state=n,e.opener=t,e.escapes=n===P||r[t-1]==="$"||Bn(r,t)}const vn=/(?:^|[^\p{L}\p{N}_])(?:[rRbBuUfF]|[rR][bBfF]|[bBfF][rR])$/u;function Fn(e){return!e.declined}function Ne(e,n){for(;e.index<n;)D(e)}function Vn(e,n){const t=ye(e,n),r=e[t];return{inContainer:r!==void 0&&/[[{,:]/u.test(r),attribute:r==="="&&Wn(e,t)}}function ye(e,n){let t=n-1;for(;t>=0&&/\s/u.test(e[t]);)t-=1;return t}function Bn(e,n){return/[[{,:]/u.test(e.charAt(ye(e,n)))}const Hn=8192;function Wn(e,n){const t=Math.max(0,n-Hn);for(let r=n-1;r>=t;r-=1){const s=e[r];if(s===">")return!1;if(s==="<")return/[A-Za-z]/u.test(e.charAt(r+1));if(s==='"'||s==="'"){const i=e.lastIndexOf(s,r-1);if(i<t)return!1;r=i}}return!1}const qn=/[,:;)}\]]/u;function Gn(e,n,t){let r=n+1;if(Kn(e,r,t))return!0;const s=Math.min(e.length,r+$e);for(;r<s&&qn.test(e[r]);)r+=1;if(r===n+1)return!1;for(;r<e.length&&(e[r]===" "||e[r]===" ");)r+=1;if(r===e.length||O.test(e[r]))return!0;if(!t.inContainer)return!1;const i=e.slice(r,r+Qn);return Re.test(i)||he.test(i)||Yn.test(i)}function Kn(e,n,t){return n===e.length||/\s/u.test(e[n])?!0:t.attribute&&(e[n]===">"||e.startsWith("/>",n))}const Qn=512,Yn=/^[A-Za-z_][\w.-]{0,480}:(?:\s|$)/u,Le=1024;function jn(e){const n=me(e),t=[{...n}];return r=>{for(;n.index<r;)n.index+1>=t.length*Le&&t.push({...n}),D(n);const i={...n.index===r?n:t[Math.min(Math.floor(r/Le),t.length-1)]};return Ne(i,r),i}}function Xn(e,n){if(e.minimumLiteralLength===void 0)return r=>r;let t;return r=>{if(r.input!==n)return r;const s=r[1],i=r.index+r[0].length;if(!/["']/u.test(s.slice(1))&&!A(n.charAt(i)))return r;const u=i-s.length;t??=jn(n);const o=Oe(t(u),u,i);if(o<=u)return r;const c=o<i?Te(r,o):r;return L.set(c,o),c}}function Oe(e,n,t){Ne(e,n);const r=e.state;if(r===w||!Fn(e))return-1;const{content:s}=e,i=e.opener,u=r===P?"'":'"',o={open:!1,placeholder:!1,references:[]},c=Math.min(t,s.length-1);for(;e.index<=c;){nt(o,s,e.index,u);const a=D(e);if(a!==-1){const l=o.open||o.placeholder||o.references.length>0;return rt(s,a,t,l)&&Gn(s,a,Vn(s,i))?a:-1}if(e.state!==r)return-1}return-1}const Jn=/^<[^<>\s]{0,254}>/u,et=256;function nt(e,n,t,r){const s=n[t];e.open?s===r&&(e.open=!1):e.placeholder?s===">"&&(e.placeholder=!1):s==="$"&&(n[t+1]==="{"||n[t+1]==="(")?e.references.push(n[t+1]==="{"?"}":")"):s===e.references.at(-1)?e.references.pop():s==="<"&&Jn.test(n.slice(t,t+et))?e.placeholder=!0:s===r&&(e.open=tt(n,t))}function tt(e,n){return e[n]==='"'||!Se.test(e[n-1])}function rt(e,n,t,r){return n>=t||!(r||/\s/u.test(e.charAt(n+1)))}function Te(e,n){const t=e.index+e[0].length-e[1].length,r=[e.input.slice(e.index,n),e.input.slice(t,n)];return Object.assign(r,{index:e.index,input:e.input,groups:void 0})}const st=/^\s{0,16}\(/u,it=/(?<![=!<>])=[ \t]{0,16}$/u;function m(e){return e.input[e.index+e[0].length-e[1].length-1]}function A(e){return e==='"'||e==="'"}const ut=/[$<"']/u;function ot(e){if(T.has(e)||A(m(e))||!/^[$<]/u.test(e[1]))return!1;const n=e.index+e[0].length,t=n-e[1].length,r=e.input.slice(n,n+18);if(e[1][0]==="<"&&(gt(e[1])||it.test(e.input.slice(Math.max(0,t-18),t))||Et.test(r)))return!0;const s=Ie(e[1]),i=e[1][s]==="!"?e[1][s+1]:e[1][s];return pt.test(i??"")||st.test(r)}function Ie(e){let n=0;for(let t=Z(e,n);t!==-1;t=Z(e,n))n=t;return n}function Z(e,n){const t=e[n];if(t==="<")return at(e,n);if(t!=="$")return-1;const r=e[n+1];if(r==="{"||r==="(")return ct(e,n+1,r);I.lastIndex=n;const s=I.exec(e)?.[0];return s===void 0?-1:n+s.length}function at(e,n){const t=e.indexOf(">",n+1),r=e.indexOf("<",n+1);return t!==-1&&(r===-1||t<r)?t+1:-1}function ct(e,n,t){const r=t==="{"?"}":")";let s=0;for(let i=n;i<e.length;i+=1){const u=e[i];if(u==="\\")i+=1;else if(u==="'"||u==='"')i=Ce(e,i);else if(u===t)s+=1;else if(u===r&&--s===0)return i+1}return-1}function Ce(e,n){const t=e[n];for(let r=n+1;r<e.length;r+=1){if(e[r]===t)return r;t==='"'&&e[r]==="\\"&&(r+=1)}return e.length}const lt=/^[\w$.[\]|&,{}:;?]+$/u,dt=/^(?:"[^"]*"|'[^']*'|-?\d+(?:\.\d+)?)(?:\|(?:"[^"]*"|'[^']*'|-?\d+(?:\.\d+)?|[A-Za-z_$][\w$.]*))*$/u,ft=/\b(?:string|number|boolean|bigint|symbol|any|unknown|object|never|void|undefined|null)\b/u;function gt(e){const n=e.slice(1,e.indexOf(">"));return dt.test(n)?!0:lt.test(n)?ft.test(n)||/[.|&[{]/u.test(n)||/^[A-Z][\w$]*$/u.test(n)&&(n.length===1||/[a-z]/u.test(n)):!1}const pt=/[.+\-*/%=^&]/u,Et=/^\s{0,16}(?:\?\.|\?\?|\|\||&&|[([])/u;function _t(e,n,t){if(t)return!1;const r=n.replaceAll('"',"'");return e.lastIndex=0,e.exec(`"${r}"`)?.[1]===r}function Ht(e,n){if(!e.structured)return;const t=`${JSON.stringify(n)}:`,r=M(e.structured).key;r.lastIndex=0;for(let s=r.exec(t);s;s=r.exec(t)){if(s.index+s[0].length!==t.length)continue;const i=ge(t,s.index,s[1]);if(i!=="malformed")return i}}function Wt(e,n,t){if(!e.structured)return!1;const r=JSON.stringify(n).replaceAll("\u2028","\\u2028").replaceAll("\u2029","\\u2029");return ue(e).some(s=>pe(s,M(s.structured).value,r,!0).accepts(t)(0))}function*At(e,n,t){const r=new RegExp(e.open);for(let s=r.exec(n);s;s=r.exec(n)){const i=s.index+s[0].length,u=Rt(e,n,i);if(u===void 0){r.lastIndex=s.index+1;continue}t(n.slice(i,u.start).trim())&&(yield{index:s.index}),r.lastIndex=u.end}}function Rt(e,n,t){for(let r=n.indexOf("<",t);r!==-1;){e.close.lastIndex=r;const s=e.close.exec(n);if(s!==null)return{start:r,end:r+s[0].length};e.span.lastIndex=r;const i=e.span.exec(n);if(i===null)return;r=n.indexOf("<",r+i[0].length)}}function ht(e,n,t){return n<e.exact||t&&n<e.compact}function $t(e,n,t,r){return(t||e.escaped(r)&&!e.direct(r))&&n(r)}function*St(e,n,t){const r=M(n),s=pe(e,r.value,t),i=new RegExp(r.key),u={exact:0,compact:0};for(let o=i.exec(t);o;o=i.exec(t)){const c=o[1],a=ge(t,o.index,c);if(a==="malformed")continue;const l=a==="prefixed",f=s.accepts(l),g=o.index+o[0].length,p=t[g];if(p==="["||p==="{"){if(ht(u,g,l))continue;const E=hn(t,g,f,s.accepts(!0));u[l?"compact":"exact"]=E.end,E.found&&(yield{index:o.index})}else $t(s,f,c,g)&&(yield{index:o.index})}r.element&&(yield*At(r.element,t,mt(e,n,r)))}const wt=8;function mt(e,n,t){if(!n.elementValue){const r=e.minimumLiteralLength??wt;return s=>!Ln.test(s.trim())&&ke(s).length>=r}return r=>{const s=r.replaceAll('"',"'");t.value.lastIndex=0;const i=t.value.exec(`"${s}"`);return i===null||i[1]!==s?!1:(i[1]=r,C(e,i))}}function Nt(e,n,t){const r=n.index+n[0].length;return/^[ \t]*;/u.test(n.input.slice(r,r+64))&&!A(m(n))&&e.test(t)}function yt(e,n){for(let t=n+1;t<e.length;t+=1){if(e[t]===">")return t;if(e[t]==="<")return-1}return-1}function U(e,n){e.raw+=n,e.literal+=n}function Lt(e,n,t){const r=e[n+1];if(e[n]!=="$"||r!=="{"&&r!=="(")return-1;const s=r==="{"?e.slice(n+2,n+2+zt(e,n+2)):"",i=t[0],u=t.length===1&&i.quote!==void 0&&i.literal.length===i.pieceStart;return t.push({close:r==="{"?"}":")",keep:s!=="",raw:`$${r}${s}`,literal:"",opensPiece:u}),n+2+s.length}const Ot=/[A-Za-z_]/u,Tt=/\w/u,It=/[{(A-Za-z_]/u,I=/\$[A-Za-z_]\w*/y,Ct=/^_*[A-Z][A-Z0-9_]*$/u,xt=/^\$[A-Za-z_]\w*$/u,bt=/^(["'])\$[A-Za-z_]\w*\1$/u;function kt(e,n,t){I.lastIndex=n;const r=I.exec(e)?.[0];return r===void 0?-1:(t.literal===""&&Ct.test(r.slice(1))?t.raw+=r:U(t,r),n+r.length)}function zt(e,n){if(!Ot.test(e[n]??""))return 0;let t=n+1;for(;t<e.length&&Tt.test(e[t]);)t+=1;e[t]===":"&&(t+=1);const r=e[t];return r==="-"||r==="="||r==="+"?t+1-n:0}function Mt(e,n){const t=e.pop(),r=e.at(-1);r.raw+=`${t.raw}${n}`,t.keep&&(r.literal+=t.literal)}const xe=/[^$<"'\\})]+/y,Pt='$`"\\\n';function Dt(e,n){return e===`
|
|
5
|
+
`?"":n==='"'&&!Pt.includes(e)?`\\${e}`:e}function Zt(e,n,t){const r=e[n],s=t.quote;if(s==='"'&&r==="$"&&It.test(e[n+1]??""))return-1;let i=1,u=r;if(r==="\\"&&s!=="'"&&n+1<e.length)i=2,u=Dt(e[n+1],s);else if(s===void 0){if(r!=='"'&&r!=="'")return-1;t.quote=r,u=""}else r===s&&(t.quote=void 0,u="");return t.raw+=e.slice(n,n+i),t.keep&&(t.literal+=u),n+i}function Ut(e,n,t,r,s){const i=t.at(-1);xe.lastIndex=n;const u=xe.exec(e)?.[0];if(u!==void 0)return U(i,u),n+u.length;if(t.length>1){const g=Zt(e,n,i);if(g!==-1)return g}else if(r&&vt(e[n],i))return n+1;const o=Lt(e,n,t);if(o!==-1)return o;const c=t.at(-1),a=e[n],l=s&&a==="$"?kt(e,n,c):-1;if(l!==-1)return l;if(t.length>1&&a===c.close)return Mt(t,a),n+1;const f=a==="<"?yt(e,n):-1;return f!==-1?(c.raw+=e.slice(n,f+1),f+1):(U(c,a),n+1)}function vt(e,n){return e!=='"'&&e!=="'"?!1:n.quote===void 0?(n.quote=e,n.pieceStart=n.literal.length,!0):e!==n.quote?!1:(n.quote=void 0,!0)}function be(e,n,t){if(t&&(xt.test(e)||n&&bt.test(e)))return"";const r={close:"}",keep:!0,raw:"",literal:""},s=[r];for(let i=0;i<e.length;)i=Ut(e,i,s,n,t);for(let i=s.length-1;i>0;i-=1){const u=s[i],o=s[i-1];o.raw+=u.raw,n&&i===1&&u.opensPiece===!0||(o.literal+=u.raw)}return r.literal}function ke(e,n=!0){return be(e,!1,n)}function Ft(e,n=!0){return be(e,!0,n)}function C(e,n){const t=e.minimumLiteralLength===void 0?n[1]:Ee(n);if(e.minimumLiteralLength!==void 0&&t.length<e.minimumLiteralLength||e.literalValue&&ut.test(n[1])&&!_t(e.literalValue,t,ot(n))||e.rejectValue?.test(t)===!0||e.rejectStatementReference&&Nt(e.rejectStatementReference,n,t))return!1;if(e.minimumEntropy===void 0)return!0;const r=[...t],s=new Map;for(const u of r)s.set(u,(s.get(u)??0)+1);let i=0;for(const u of s.values()){const o=u/r.length;i-=o*Math.log2(o)}return i>=e.minimumEntropy}const qt={leadingReferencesEnd:Ie};export{Ve as PRIVATE_HOME_PATH_PATTERN,Vt as SECRET_RULES,qt as _testOnly,C as acceptsSecretMatch,Wt as acceptsStructuredValue,ke as expandRuntimeReferences,Ye as findPrivateHomePathMatches,Bt as findSecretRuleMatches,Ft as literalAfterReferences,Ht as structuredKeyShape};
|
|
6
6
|
//# sourceMappingURL=secret-rules.js.map
|
|
@@ -104,6 +104,23 @@ export declare function mergeLinkedTestTwoTokenEntries(argv:string[],commandName
|
|
|
104
104
|
* return the selected command and normalization events for host diagnostics.
|
|
105
105
|
*/
|
|
106
106
|
export declare function normalizeBootstrapInvocation(argv:string[]):BootstrapInvocationNormalizationResult;
|
|
107
|
+
/**
|
|
108
|
+
* The verb of a package invocation, given the tokens after its noun: root
|
|
109
|
+
* switches Commander accepts before the verb are skipped (`--global`,
|
|
110
|
+
* `--offline`), a valued root or inherited host option skips its value
|
|
111
|
+
* (`--ref v1`, `--pm-path <dir>`), and the first
|
|
112
|
+
* remaining operand is the verb. The one parser static selection, flag
|
|
113
|
+
* normalization and recovery share, so every spelling Commander routes to a
|
|
114
|
+
* verb resolves to the same leaf contract.
|
|
115
|
+
*/
|
|
116
|
+
export declare function resolveLifecycleVerb(tokens:readonly string[]):string|undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Drop a terminator that stands before the command (`pm --json -- package list`), which
|
|
119
|
+
* Commander still routes to the command. Host options are walked with their arity, so a
|
|
120
|
+
* `--` that is a flag value (`--pm-path --`) stays a value and the first bare `--` is the
|
|
121
|
+
* terminator (Codex review rounds 7 and 9).
|
|
122
|
+
*/
|
|
123
|
+
export declare function removeLeadingCommandTerminator(argv:readonly string[]):string[];
|
|
107
124
|
/** Implements parse bootstrap type value for the public runtime surface of this module. */
|
|
108
125
|
export declare function parseBootstrapTypeValue(argv:string[]):string|undefined;
|
|
109
126
|
/** Public contract for test only, shared by SDK and presentation-layer consumers. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{EXECUTABLE_COMMAND_ALIASES as C,PM_COMMAND_ALIAS_CONTRACTS as B,renderPmCommandAliasMigrationHint as O,resolvePmCommandAlias as $}from"./cli-contracts/command-aliases.js";import{resolveSubcommandFlagContractsForCommand as b}from"./cli-contracts/flag-contracts.js";import{levenshteinDistanceWithinLimit as G}from"../core/shared/levenshtein.js";import{EXIT_CODE as y}from"../core/shared/constants.js";import{PmCliError as w}from"../core/shared/errors.js";import{findPmNamespacedCommand as M,resolvePmCommandOperation as z}from"./cli-contracts/command-aliases.js";import{normalizeItemAddressInvocation as W}from"./agent/item-addressing.js";import{BOOTSTRAP_BOOLEAN_FLAGS as x,GLOBAL_VALUE_CONSUMING_FLAGS as h,consumesBootstrapValue as A,findBootstrapCommandTokenIndex as R,isInlineGlobalValueToken as q,parseBootstrapCommandName as U}from"./cli-contracts/bootstrap-command-scanner.js";const D=new Set(["--output-include","--output-limit","--output-budget","--output-format","--output-session","--output-cursor"]),K=new Set(["toon","json"]);function j(e,t,o){const n=e[t];if(x.has(n))return o.booleanFlags.add(n),1;const s=n.indexOf("="),i=s>0?n.slice(0,s):n;if(!h.has(i))return 1;const a=s>0?n.slice(s+1):void 0,u=a===void 0&&A(i,e[t+1]),r=a??(u?e[t+1]:void 0);return i==="--author"?o.author=r??"":typeof r=="string"&&r.length>0&&(D.has(i)?o.outputValues:o.pathValues).set(i,r),u?2:1}function X(e){return e.outputValues.get("--output-format")!=="toon"&&(e.booleanFlags.has("--json")||e.outputValues.get("--output-format")==="json"||e.pathValues.get("--format")?.trim().toLowerCase()==="json")}function Y(e){const t={booleanFlags:new Set,outputValues:new Map,pathValues:new Map};let o=0;for(;o<e.length&&e[o]!=="--";)o+=j(e,o,t);return{path:t.pathValues.get("--pm-path")??t.pathValues.get("--path"),noExtensions:t.booleanFlags.has("--no-extensions")||["history attest","history-attest"].includes(N(e)??""),noPager:t.booleanFlags.has("--no-pager"),json:X(t),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")},...K.has(t.outputValues.get("--output-format"))?{outputFormat:t.outputValues.get("--output-format")}:{},...t.outputValues.get("--output-session")===void 0?{}:{outputSession:t.outputValues.get("--output-session")},...t.outputValues.get("--output-cursor")===void 0?{}:{outputCursor:t.outputValues.get("--output-cursor")},...t.author===""?{authorMissingValue:!0}:t.author!==void 0?{author:t.author}:{}}}function S(e){const t=[];let o=0;for(;o<e.length;){const n=e[o];if(n==="--")break;if(x.has(n)||n==="--profile"||n==="--id-only"||n==="--full-changed-fields"||n==="--explain"){o+=1;continue}if(h.has(n)){o+=A(n,e[o+1])?2:1;continue}if(q(n)){o+=1;continue}t.push(n),o+=1}return t}function v(e){const t=S(e);if(t[0]?.trim().toLowerCase()==="help"){const i=[];for(let a=1;a<t.length;a+=1){const u=t[a];if(u.startsWith("-"))break;i.push(u.trim().toLowerCase())}return{requested:!0,commandPathTokens:i}}if(t.findIndex(i=>i==="--help"||i==="-h")<0)return{requested:!1,commandPathTokens:[]};const s=[];for(const i of t){if(i.startsWith("-"))break;s.push(i.trim().toLowerCase())}return{requested:!0,commandPathTokens:s}}function m(e){return R(e)}function H(e){return U(e)}function Z(e,t){return t.noPager?!0:process.stdout.isTTY===!0?!1:v(e).requested}function Ae(e){const t=["PAGER","MANPAGER","GIT_PAGER","LESS"],o=t.map(i=>process.env[i]),n=()=>{for(const[i,a]of t.entries()){const u=o[i];u===void 0?delete process.env[a]:process.env[a]=u}},s=Y(e);return Z(e,s)&&(process.env.PAGER="cat",process.env.MANPAGER="cat",process.env.GIT_PAGER="cat",(typeof process.env.LESS!="string"||process.env.LESS.trim().length===0)&&(process.env.LESS="FRX")),n}const J=new Set(["install","uninstall","explore","manage","doctor","adopt","adopt-all","activate","deactivate"]);function Q(e){const t=m(e);if(t===void 0||e[t]!=="extension")return[...e];const o=e[t+1];if(!o||o.startsWith("-"))return[...e];if(!J.has(o))return[...e];if(e.includes("--help")||e.includes("-h"))return[...e];const n=`--${o}`;return e.includes(n)?[...e]:[...e.slice(0,t+1),n,...e.slice(t+2)]}const ee=new Set(["pm","pm-cli"]);function te(e,t){const o=m(e);if(o===void 0)return e;const n=e[o];return ee.has(n.trim().toLowerCase())?(t.push({from:n,to:[],reason:"executable_alias",confidence:"high"}),[...e.slice(0,o),...e.slice(o+1)]):e}function ne(e,t){let o=m(e);if(o!==void 0&&e[o]==="help"){const u=m(e.slice(o+1));o=u===void 0?void 0:o+1+u}if(o===void 0)return e;const n=e[o],s=C[n.trim().toLowerCase()];if(!s)return e;const i=s.split(" "),a=[...e.slice(0,o),...i,...e.slice(o+1)];return t.push({from:n,to:i,reason:"command_alias",confidence:"high"}),a}function g(e){return e.replace(/^--?/,"").replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function I(e){return g(e).replace(/-/g,"")}function T(e,t,o){const n=e.get(t);if(n===void 0){e.set(t,o);return}n!==o&&e.set(t,null)}function _(e){const t=[],o=n=>{typeof n=="string"&&n.startsWith("--")&&t.push(n)};o(e.flag);for(const n of e.aliases??[])o(n);return t}function L(e,t){const o=t??b(e),n=new Map,s=new Map,i=new Map,a=new Set;for(const u of o){const r=_(u);if(r.length===0)continue;const c=`--${g(r[0])}`;for(const f of r)T(n,g(f),c),T(s,I(f),c);const l=I(c);i.has(c)||i.set(c,l),u.list===!0&&a.add(c)}return{canonicalByNormalized:n,canonicalByCompact:s,canonicalComparables:[...i.entries()].map(([u,r])=>({canonicalFlag:u,comparable:r})),listCanonicalFlags:a}}function k(e,t){const o=g(e),n=t.canonicalByNormalized.get(o);if(typeof n=="string")return{flag:n,reason:"flag_alias",confidence:"high"};const s=o.replace(/-/g,""),i=t.canonicalByCompact.get(s);if(typeof i=="string")return{flag:i,reason:"flag_alias",confidence:"high"};const a=s.length>=8?2:1;let u=Number.POSITIVE_INFINITY,r,c=!1;for(const l of t.canonicalComparables){const f=G(s,l.comparable,a);if(f!==null){if(f<u){u=f,r=l.canonicalFlag,c=!1;continue}f===u&&r!==l.canonicalFlag&&(c=!0)}}return!r||c||!Number.isFinite(u)||u<=0?null:{flag:r,reason:"flag_typo",confidence:u>=2?"medium":"high"}}function Se(e){const t=[`${e}s`];return e.endsWith("y")&&e.length>1&&t.push(`${e.slice(0,-1)}ies`),t}function oe(e,t=!1){if(t||e.includes("://"))return null;const o=e.match(/^([A-Za-z][A-Za-z0-9_-]{1,63})([:=])(.*)$/);if(!o)return null;const n=o[1],s=o[3];return s.length===0||o[2]===":"&&/\s/u.test(e)?null:{key:n,value:s}}function V(e,t,o=!1){if(o||!e.startsWith("--"))return{tokens:[e]};const n=e.indexOf("="),s=n>=0?e.slice(0,n):e,i=n>=0?e.slice(n+1):void 0,a=k(s,t);if(!a)return{tokens:[e]};const u=i===void 0?a.flag:`${a.flag}=${i}`;return u===e?{tokens:[e]}:{tokens:[u],event:{from:e,to:[u],reason:a.reason,confidence:a.confidence}}}function E(e){const t=new Set;let o=!1;for(let n=0;n<e.length;n+=1){if(o){t.add(n),o=!1;continue}const s=e[n];o=s==="--path"||s==="--pm-path"}return t}function se(e){if(!e.startsWith("--"))return null;const t=e.indexOf("=");return t<0?{flag:e}:{flag:e.slice(0,t),inlineValue:e.slice(t+1)}}function ie(e,t,o){o.push(e[t]);const n=e[t+1];return typeof n=="string"&&n!=="--"?(o.push(n),t+2):t+1}function ae(e,t,o,n){if(o.inlineValue!==void 0)return{originalTokens:[e[t]],value:o.inlineValue,consumed:1};const s=[];let i=t+1;for(;i<e.length&&e[i]!=="--"&&!e[i].startsWith("-")&&(s.length===0||n.has(o.flag));)s.push(e[i]),i+=1;const a=s.length===0?1:1+s.length;return{originalTokens:e.slice(t,t+a),value:s.length===0?void 0:s.join(","),consumed:a}}function ue(e,t,o,n){const s=e.get(o);if(s){s.values.push(n.value),s.occurrences+=1;return}e.set(o,{outputIndex:t.length,originalTokens:n.originalTokens,values:[n.value],occurrences:1}),t.push(null)}function re(e,t){const o=[],n=[];for(const[s,i]of e){if(!(i.occurrences>=2||t.has(s)&&i.originalTokens.length>2)){n.push({outputIndex:i.outputIndex,tokens:i.originalTokens});continue}const u=`${s}=${i.values.join(",")}`;n.push({outputIndex:i.outputIndex,tokens:[u]}),o.push({from:`${s} (x${i.occurrences})`,to:[u],reason:"list_merge",confidence:"high"})}return{events:o,splices:n}}function ce(e,t){t.sort((o,n)=>n.outputIndex-o.outputIndex);for(const o of t)e.splice(o.outputIndex,1,...o.tokens)}function le(e,t,o=new Set,n=new Set){if(t.size===0)return{argv:[...e],events:[]};const s=[],i=new Map;let a=0;for(;a<e.length;){const c=e[a];if(c==="--"){s.push(...e.slice(a));break}if(o.has(c)){a=ie(e,a,s);continue}const l=se(c);if(!l||!t.has(l.flag)){s.push(c),a+=1;continue}const f=ae(e,a,l,n);if(f.value===void 0){s.push(c),a+=f.consumed;continue}ue(i,s,l.flag,{originalTokens:f.originalTokens,value:f.value}),a+=f.consumed}const{events:u,splices:r}=re(i,n);return ce(s,r),{argv:s,events:u}}const F=new Map([["--add",new Set(["command","cmd","path"])],["--remove",new Set(["command","path"])]]);function fe(e,t){if(e!=="test"||t.length<2)return!1;const o=t[t.length-1],n=t[t.length-2],s=F.get(n);return s!==void 0&&s.has(o)}function pe(e,t,o){if(t!=="test")return e;const n=[];let s=0;for(;s<e.length;){const i=e[s];if(i==="--")return n.push(...e.slice(s)),n;const a=F.get(i),u=a?e[s+1]:void 0;if(!a||typeof u!="string"||!a.has(u)){n.push(i),s+=1;continue}let r=s+2;for(;r<e.length&&!e[r].startsWith("-");)r+=1;if(r-(s+2)!==1){n.push(i),s+=1;continue}const c=e[s+2],l=`${u}=${c}`;n.push(i,l),o.push({from:`${i} ${u} ${c}`,to:[i,l],reason:"bare_key_value",confidence:"high"}),s+=3}return n}function de(e,t,o,n){const s=[],i=E(e);for(let a=0;a<e.length;a+=1){const u=e[a];if(u==="--"){s.push(...e.slice(a));break}const r=i.has(a),c=s[s.length-1];if(u.startsWith("--")){const d=V(u,t,r);s.push(...d.tokens),d.event&&n.push(d.event);continue}const l=oe(u,r);if(!l||typeof c=="string"&&c.startsWith("-")&&!c.includes("=")||["search","comments","notes","learnings"].includes(o)||fe(o,s)){s.push(u);continue}const f=k(l.key,t);if(!f){s.push(u);continue}const p=l.value.startsWith("-")?[`${f.flag}=${l.value}`]:[f.flag,l.value];s.push(...p),n.push({from:u,to:p,reason:"bare_key_value",confidence:f.confidence})}return s}function he(e){for(let t=0;t<e.length;t+=1){const o=e[t];if(o==="--")break;if(o==="--verify"){const n=e[t+1];if(n===void 0||n==="--")throw new w("history attest --verify requires a bundle file.",y.USAGE);e.splice(t,2,`--verify=${n}`)}else(h.has(o)||o==="--output"||o==="--hash-algorithm")&&(t+=1)}}function me(e,t){if(!e.some(n=>n==="--help"||n==="-h"))return;const o=new Set(b(t).flatMap(n=>[n.flag,...n.aliases??[],...n.short===void 0?[]:[n.short]]));for(let n=0;n<e.length;n+=1){const s=e[n];if(s==="--")break;s!=="--help"&&s!=="-h"||o.has(e[n-1])&&!x.has(e[n-1])&&(e[n-1]=s)}}function Ie(e){const t=[],o=te(e,t),n=Q(o);(n.length!==o.length||n.some((d,P)=>d!==o[P]))&&t.push({from:o.join(" "),to:[...n],reason:"legacy_extension_action",confidence:"high"});const s=ne(n,t),i=W(s);if(i.conflict)throw new w("Provide the item id either positionally or with --id, not both.",y.USAGE);i.changed&&t.push({from:`--id ${i.itemId}`,to:[i.itemId],reason:"item_id_alias",confidence:"high"});const a=H(i.argv),u=N(i.argv),r=z(u??a??""),c=L(u??a),l=de(i.argv,c,r,t),f=pe(l,r,t),p=le(f,c.listCanonicalFlags,h,a==="create"?new Set(["--tags"]):new Set);for(const d of p.events)t.push(d);return me(p.argv,u??a),u==="history attest"&&he(p.argv),{argv:p.argv,commandName:a,trace:t}}function N(e){const t=S(e),o=t[0]?.trim().toLowerCase(),n=t[1]?.trim().toLowerCase(),s=M(t);return s?s.canonical:(o==="extension"||o==="package"||o==="packages")&&typeof n=="string"&&n.length>0&&!n.startsWith("-")?`${o} ${n}`:o}function _e(e){for(let t=0;t<e.length;t+=1){const o=e[t];if(o==="--")break;if(o==="--type"){const n=e[t+1];if(typeof n=="string"&&n.trim().length>0)return n.trim();continue}if(o.startsWith("--type=")){const n=o.slice(7).trim();if(n.length>0)return n}}}const Le={buildFlagLookup:L,collectBootstrapPathValueIndices:E,collectLongFlagCandidates:_,markUnambiguousFlag:T,normalizeLongOptionToken:V,resolveCanonicalFlag:k};export{C as EXECUTABLE_COMMAND_ALIASES,B as PM_COMMAND_ALIAS_CONTRACTS,Le as _testOnly,Ae as applyBootstrapPagerPolicy,le as coalesceRepeatedListFlags,m as findBootstrapCommandTokenIndex,Se as listAliasPluralKeys,pe as mergeLinkedTestTwoTokenEntries,Ie as normalizeBootstrapInvocation,Q as normalizeLegacyExtensionActionSyntax,H as parseBootstrapCommandName,Y as parseBootstrapGlobalOptions,v as parseBootstrapHelpRequest,_e as parseBootstrapTypeValue,O as renderPmCommandAliasMigrationHint,$ as resolvePmCommandAlias,S as stripGlobalBootstrapTokens};
|
|
1
|
+
import{EXECUTABLE_COMMAND_ALIASES as b,PM_COMMAND_ALIAS_CONTRACTS as P,renderPmCommandAliasMigrationHint as B,resolvePmCommandAlias as $}from"./cli-contracts/command-aliases.js";import{hasSubcommandFlagContractsForCommand as G,resolveSubcommandFlagContractsForCommand as k}from"./cli-contracts/flag-contracts.js";import{levenshteinDistanceWithinLimit as M}from"../core/shared/levenshtein.js";import{EXIT_CODE as y}from"../core/shared/constants.js";import{PmCliError as L}from"../core/shared/errors.js";import{findPmNamespacedCommand as z,resolvePmCommandOperation as W}from"./cli-contracts/command-aliases.js";import{normalizeItemAddressInvocation as R}from"./agent/item-addressing.js";import{BOOTSTRAP_BOOLEAN_FLAGS as x,GLOBAL_VALUE_CONSUMING_FLAGS as h,consumesBootstrapValue as w,findBootstrapCommandTokenIndex as q,isInlineGlobalValueToken as U,parseBootstrapCommandName as D}from"./cli-contracts/bootstrap-command-scanner.js";const j=new Set(["--output-include","--output-limit","--output-budget","--output-format","--output-session","--output-cursor"]),K=new Set(["toon","json"]);function X(e,t,n){const o=e[t];if(x.has(o))return n.booleanFlags.add(o),1;const s=o.indexOf("="),i=s>0?o.slice(0,s):o;if(!h.has(i))return 1;const a=s>0?o.slice(s+1):void 0,u=a===void 0&&w(i,e[t+1]),r=a??(u?e[t+1]:void 0);return i==="--author"?n.author=r??"":typeof r=="string"&&r.length>0&&(j.has(i)?n.outputValues:n.pathValues).set(i,r),u?2:1}function Y(e){return e.outputValues.get("--output-format")!=="toon"&&(e.booleanFlags.has("--json")||e.outputValues.get("--output-format")==="json"||e.pathValues.get("--format")?.trim().toLowerCase()==="json")}function H(e){const t={booleanFlags:new Set,outputValues:new Map,pathValues:new Map};let n=0;for(;n<e.length&&e[n]!=="--";)n+=X(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(O(e)??""),noPager:t.booleanFlags.has("--no-pager"),json:Y(t),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")},...K.has(t.outputValues.get("--output-format"))?{outputFormat:t.outputValues.get("--output-format")}:{},...t.outputValues.get("--output-session")===void 0?{}:{outputSession:t.outputValues.get("--output-session")},...t.outputValues.get("--output-cursor")===void 0?{}:{outputCursor:t.outputValues.get("--output-cursor")},...t.author===""?{authorMissingValue:!0}:t.author!==void 0?{author:t.author}:{}}}function S(e){const t=[];let n=0;for(;n<e.length;){const o=e[n];if(o==="--")break;if(x.has(o)||o==="--profile"||o==="--id-only"||o==="--full-changed-fields"||o==="--explain"){n+=1;continue}if(h.has(o)){n+=w(o,e[n+1])?2:1;continue}if(U(o)){n+=1;continue}t.push(o),n+=1}return t}function Z(e){const t=S(e);if(t[0]?.trim().toLowerCase()==="help"){const i=[];for(let a=1;a<t.length;a+=1){const u=t[a];if(u.startsWith("-"))break;i.push(u.trim().toLowerCase())}return{requested:!0,commandPathTokens:i}}if(t.findIndex(i=>i==="--help"||i==="-h")<0)return{requested:!1,commandPathTokens:[]};const s=[];for(const i of t){if(i.startsWith("-"))break;s.push(i.trim().toLowerCase())}return{requested:!0,commandPathTokens:s}}function m(e){return q(e)}function J(e){return D(e)}function v(e,t){return t.noPager?!0:process.stdout.isTTY===!0?!1:Z(e).requested}function Ve(e){const t=["PAGER","MANPAGER","GIT_PAGER","LESS"],n=t.map(i=>process.env[i]),o=()=>{for(const[i,a]of t.entries()){const u=n[i];u===void 0?delete process.env[a]:process.env[a]=u}},s=H(e);return v(e,s)&&(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}const Q=new Set(["install","uninstall","explore","manage","doctor","adopt","adopt-all","activate","deactivate"]);function ee(e){const t=e.indexOf("--");return(t===-1?e:e.slice(0,t)).some(n=>/^(?:--)?fields(?:[=:]|$)/iu.test(n))}function te(e){const t=m(e);if(t===void 0||e[t]!=="extension")return[...e];const n=e[t+1];if(!n||n.startsWith("-"))return[...e];if(!Q.has(n))return[...e];if(e.includes("--help")||e.includes("-h"))return[...e];if((n==="explore"||n==="manage")&&ee(e.slice(t+2)))return[...e];const o=`--${n}`;return e.includes(o)?[...e]:[...e.slice(0,t+1),o,...e.slice(t+2)]}const ne=new Set(["pm","pm-cli"]);function oe(e,t){const n=m(e);if(n===void 0)return e;const o=e[n];return ne.has(o.trim().toLowerCase())?(t.push({from:o,to:[],reason:"executable_alias",confidence:"high"}),[...e.slice(0,n),...e.slice(n+1)]):e}function se(e,t){let n=m(e);if(n!==void 0&&e[n]==="help"){const u=m(e.slice(n+1));n=u===void 0?void 0:n+1+u}if(n===void 0)return e;const o=e[n],s=b[o.trim().toLowerCase()];if(!s)return e;const i=s.split(" "),a=[...e.slice(0,n),...i,...e.slice(n+1)];return t.push({from:o,to:i,reason:"command_alias",confidence:"high"}),a}function g(e){return e.replace(/^--?/,"").replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function A(e){return g(e).replace(/-/g,"")}function T(e,t,n){const o=e.get(t);if(o===void 0){e.set(t,n);return}o!==n&&e.set(t,null)}function I(e){const t=[],n=o=>{typeof o=="string"&&o.startsWith("--")&&t.push(o)};n(e.flag);for(const o of e.aliases??[])n(o);return t}function _(e,t){const n=t??k(e),o=new Map,s=new Map,i=new Map,a=new Set;for(const u of n){const r=I(u);if(r.length===0)continue;const c=`--${g(r[0])}`;for(const f of r)T(o,g(f),c),T(s,A(f),c);const l=A(c);i.has(c)||i.set(c,l),u.list===!0&&a.add(c)}return{canonicalByNormalized:o,canonicalByCompact:s,canonicalComparables:[...i.entries()].map(([u,r])=>({canonicalFlag:u,comparable:r})),listCanonicalFlags:a}}function C(e,t){const n=g(e),o=t.canonicalByNormalized.get(n);if(typeof o=="string")return{flag:o,reason:"flag_alias",confidence:"high"};const s=n.replace(/-/g,""),i=t.canonicalByCompact.get(s);if(typeof i=="string")return{flag:i,reason:"flag_alias",confidence:"high"};const a=s.length>=8?2:1;let u=Number.POSITIVE_INFINITY,r,c=!1;for(const l of t.canonicalComparables){const f=M(s,l.comparable,a);if(f!==null){if(f<u){u=f,r=l.canonicalFlag,c=!1;continue}f===u&&r!==l.canonicalFlag&&(c=!0)}}return!r||c||!Number.isFinite(u)||u<=0?null:{flag:r,reason:"flag_typo",confidence:u>=2?"medium":"high"}}function Ee(e){const t=[`${e}s`];return e.endsWith("y")&&e.length>1&&t.push(`${e.slice(0,-1)}ies`),t}function ie(e,t=!1){if(t||e.includes("://"))return null;const n=e.match(/^([A-Za-z][A-Za-z0-9_-]{1,63})([:=])(.*)$/);if(!n)return null;const o=n[1],s=n[3];return s.length===0||n[2]===":"&&/\s/u.test(e)?null:{key:o,value:s}}function V(e,t,n=!1){if(n||!e.startsWith("--"))return{tokens:[e]};const o=e.indexOf("="),s=o>=0?e.slice(0,o):e,i=o>=0?e.slice(o+1):void 0,a=C(s,t);if(!a)return{tokens:[e]};const u=i===void 0?a.flag:`${a.flag}=${i}`;return u===e?{tokens:[e]}:{tokens:[u],event:{from:e,to:[u],reason:a.reason,confidence:a.confidence}}}function E(e){const t=new Set;let n=!1;for(let o=0;o<e.length;o+=1){if(n){t.add(o),n=!1;continue}const s=e[o];n=s==="--path"||s==="--pm-path"}return t}function ae(e){if(!e.startsWith("--"))return null;const t=e.indexOf("=");return t<0?{flag:e}:{flag:e.slice(0,t),inlineValue:e.slice(t+1)}}function ue(e,t,n){n.push(e[t]);const o=e[t+1];return typeof o=="string"&&o!=="--"?(n.push(o),t+2):t+1}function re(e,t,n,o){if(n.inlineValue!==void 0)return{originalTokens:[e[t]],value:n.inlineValue,consumed:1};const s=[];let i=t+1;for(;i<e.length&&e[i]!=="--"&&!e[i].startsWith("-")&&(s.length===0||o.has(n.flag));)s.push(e[i]),i+=1;const a=s.length===0?1:1+s.length;return{originalTokens:e.slice(t,t+a),value:s.length===0?void 0:s.join(","),consumed:a}}function ce(e,t,n,o){const s=e.get(n);if(s){s.values.push(o.value),s.occurrences+=1;return}e.set(n,{outputIndex:t.length,originalTokens:o.originalTokens,values:[o.value],occurrences:1}),t.push(null)}function le(e,t){const n=[],o=[];for(const[s,i]of e){if(!(i.occurrences>=2||t.has(s)&&i.originalTokens.length>2)){o.push({outputIndex:i.outputIndex,tokens:i.originalTokens});continue}const u=`${s}=${i.values.join(",")}`;o.push({outputIndex:i.outputIndex,tokens:[u]}),n.push({from:`${s} (x${i.occurrences})`,to:[u],reason:"list_merge",confidence:"high"})}return{events:n,splices:o}}function fe(e,t){t.sort((n,o)=>o.outputIndex-n.outputIndex);for(const n of t)e.splice(n.outputIndex,1,...n.tokens)}function pe(e,t,n=new Set,o=new Set){if(t.size===0)return{argv:[...e],events:[]};const s=[],i=new Map;let a=0;for(;a<e.length;){const c=e[a];if(c==="--"){s.push(...e.slice(a));break}if(n.has(c)){a=ue(e,a,s);continue}const l=ae(c);if(!l||!t.has(l.flag)){s.push(c),a+=1;continue}const f=re(e,a,l,o);if(f.value===void 0){s.push(c),a+=f.consumed;continue}ce(i,s,l.flag,{originalTokens:f.originalTokens,value:f.value}),a+=f.consumed}const{events:u,splices:r}=le(i,o);return fe(s,r),{argv:s,events:u}}const F=new Map([["--add",new Set(["command","cmd","path"])],["--remove",new Set(["command","path"])]]);function de(e,t){if(e!=="test"||t.length<2)return!1;const n=t[t.length-1],o=t[t.length-2],s=F.get(o);return s!==void 0&&s.has(n)}function he(e,t,n){if(t!=="test")return e;const o=[];let s=0;for(;s<e.length;){const i=e[s];if(i==="--")return o.push(...e.slice(s)),o;const a=F.get(i),u=a?e[s+1]:void 0;if(!a||typeof u!="string"||!a.has(u)){o.push(i),s+=1;continue}let r=s+2;for(;r<e.length&&!e[r].startsWith("-");)r+=1;if(r-(s+2)!==1){o.push(i),s+=1;continue}const c=e[s+2],l=`${u}=${c}`;o.push(i,l),n.push({from:`${i} ${u} ${c}`,to:[i,l],reason:"bare_key_value",confidence:"high"}),s+=3}return o}function me(e,t,n,o){const s=[],i=E(e);for(let a=0;a<e.length;a+=1){const u=e[a];if(u==="--"){s.push(...e.slice(a));break}const r=i.has(a),c=s[s.length-1];if(u.startsWith("--")){const d=V(u,t,r);s.push(...d.tokens),d.event&&o.push(d.event);continue}const l=ie(u,r);if(!l||typeof c=="string"&&c.startsWith("-")&&!c.includes("=")||["search","comments","notes","learnings"].includes(n)||de(n,s)){s.push(u);continue}const f=C(l.key,t);if(!f){s.push(u);continue}const p=l.value.startsWith("-")?[`${f.flag}=${l.value}`]:[f.flag,l.value];s.push(...p),o.push({from:u,to:p,reason:"bare_key_value",confidence:f.confidence})}return s}function ge(e){for(let t=0;t<e.length;t+=1){const n=e[t];if(n==="--")break;if(n==="--verify"){const o=e[t+1];if(o===void 0||o==="--")throw new L("history attest --verify requires a bundle file.",y.USAGE);e.splice(t,2,`--verify=${o}`)}else(h.has(n)||n==="--output"||n==="--hash-algorithm")&&(t+=1)}}function xe(e,t){if(!e.some(o=>o==="--help"||o==="-h"))return;const n=new Set(k(t).flatMap(o=>[o.flag,...o.aliases??[],...o.short===void 0?[]:[o.short]]));for(let o=0;o<e.length;o+=1){const s=e[o];if(s==="--")break;s!=="--help"&&s!=="-h"||n.has(e[o-1])&&!x.has(e[o-1])&&(e[o-1]=s)}}function Fe(e){const t=[],n=oe(e,t),o=te(n);(o.length!==n.length||o.some((d,N)=>d!==n[N]))&&t.push({from:n.join(" "),to:[...o],reason:"legacy_extension_action",confidence:"high"});const s=se(o,t),i=R(s);if(i.conflict)throw new L("Provide the item id either positionally or with --id, not both.",y.USAGE);i.changed&&t.push({from:`--id ${i.itemId}`,to:[i.itemId],reason:"item_id_alias",confidence:"high"});const a=J(i.argv),u=O(i.argv),r=W(u??a??""),c=_(u??a),l=me(i.argv,c,r,t),f=he(l,r,t),p=pe(f,c.listCanonicalFlags,h,a==="create"?new Set(["--tags"]):new Set);for(const d of p.events)t.push(d);return xe(p.argv,u??a),u==="history attest"&&ge(p.argv),{argv:p.argv,commandName:a,trace:t}}const Te=new Set(["--capability","--gh","--github","--ref","--output","--detail"]);function Ce(e){for(let t=0;t<e.length;t+=1){const n=e[t];if(!n.startsWith("-"))return n;(Te.has(n)||h.has(n))&&(t+=1)}}function Oe(e){for(let t=0;t<e.length;t+=1){const n=e[t];if(n==="--")return[...e.slice(0,t),...e.slice(t+1)];if(!n.startsWith("-"))break;h.has(n)&&(t+=1)}return[...e]}function be(e,t){const n=Ce(t);if(n===void 0||n===t[0])return n;const o=n.trim().toLowerCase();return G(`${e} ${o}`)||e!=="extension"&&o==="upgrade"?n:void 0}function O(e){const t=m(e),n=S(t===void 0?e:e.slice(t)),o=n[0]?.trim().toLowerCase(),s=(o==="extension"||o==="package"||o==="packages"?be(o,n.slice(1)):n[1])?.trim().toLowerCase(),i=z(n);return i?i.canonical:(o==="extension"||o==="package"||o==="packages")&&typeof s=="string"&&s.length>0&&!s.startsWith("-")?`${o} ${s}`:o}function Ne(e){for(let t=0;t<e.length;t+=1){const n=e[t];if(n==="--")break;if(n==="--type"){const o=e[t+1];if(typeof o=="string"&&o.trim().length>0)return o.trim();continue}if(n.startsWith("--type=")){const o=n.slice(7).trim();if(o.length>0)return o}}}const Pe={buildFlagLookup:_,collectBootstrapPathValueIndices:E,collectLongFlagCandidates:I,markUnambiguousFlag:T,normalizeLongOptionToken:V,resolveCanonicalFlag:C};export{b as EXECUTABLE_COMMAND_ALIASES,P as PM_COMMAND_ALIAS_CONTRACTS,Pe as _testOnly,Ve as applyBootstrapPagerPolicy,pe as coalesceRepeatedListFlags,m as findBootstrapCommandTokenIndex,Ee as listAliasPluralKeys,he as mergeLinkedTestTwoTokenEntries,Fe as normalizeBootstrapInvocation,te as normalizeLegacyExtensionActionSyntax,J as parseBootstrapCommandName,H as parseBootstrapGlobalOptions,Z as parseBootstrapHelpRequest,Ne as parseBootstrapTypeValue,Oe as removeLeadingCommandTerminator,B as renderPmCommandAliasMigrationHint,Ce as resolveLifecycleVerb,$ as resolvePmCommandAlias,S as stripGlobalBootstrapTokens};
|
|
2
2
|
//# sourceMappingURL=cli-bootstrap.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const s=[["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"})),c=[...["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"})),l=[["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"})),p=[...c,...l,...["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,a])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:a}))],i=[{alias:"history-attest",canonical:"history attest",canonical_argv:["history","attest"],lifecycle:"permanent",hidden:!0,registration:"commander",owner:"pm-3z0k"},...s,...p,...["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 d(e){let t;for(const a of i)a.canonical_argv.length<=(t?.canonical_argv.length??0)||a.canonical_argv.every((o,n)=>o===(n===0&&e[n]==="ctx"?"context":e[n]))&&(t=a);return t}function m(e){const t=e.trim().replace(/\s+/gu," ");return i.find(a=>a.canonical===t.replace(/^ctx /u,"context "))?.alias??t}function g(e){return m(e)}const r=[...i,...[["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,a])=>({alias:e,canonical:t,canonical_argv:[t,a],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
|
|
1
|
+
const s=[["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"})),c=[...["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"})),l=[["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"})),p=[...c,...l,...["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,a])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:a}))],i=[{alias:"history-attest",canonical:"history attest",canonical_argv:["history","attest"],lifecycle:"permanent",hidden:!0,registration:"commander",owner:"pm-3z0k"},...s,...p,...["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 d(e){let t;for(const a of i)a.canonical_argv.length<=(t?.canonical_argv.length??0)||a.canonical_argv.every((o,n)=>o===(n===0&&e[n]==="ctx"?"context":e[n]))&&(t=a);return t}function m(e){const t=e.trim().replace(/\s+/gu," ");return i.find(a=>a.canonical===t.replace(/^ctx /u,"context "))?.alias??t}function g(e){return m(e)}const r=[...i,...[["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,a])=>({alias:e,canonical:t,canonical_argv:[t,a],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"}))],f=Object.fromEntries(r.filter(e=>e.registration==="bootstrap").map(e=>[e.alias,e.canonical]));function y(e){const t=e.trim().toLowerCase();return r.find(a=>a.alias===t)}function u(e){return`Deprecated command \`${e.alias}\`; use \`pm ${e.canonical_argv.join(" ")}\`.`}export{f as EXECUTABLE_COMMAND_ALIASES,l as PM_BULK_LIFECYCLE_COMMAND_ALIASES,r as PM_COMMAND_ALIAS_CONTRACTS,c as PM_CONTEXT_OPS_COMMAND_ALIASES,s as PM_HISTORY_COMMAND_ALIASES,i as PM_NAMESPACED_COMMAND_ALIASES,p as PM_RELOCATED_COMMAND_ALIASES,d as findPmNamespacedCommand,u as renderPmCommandAliasMigrationHint,y as resolvePmCommandAlias,m as resolvePmCommandOperation,g as resolvePmHistoryOperation};
|
|
2
2
|
//# sourceMappingURL=command-aliases.js.map
|
|
@@ -120,6 +120,8 @@ export declare const EXTENSION_INSTALL_FLAG_CONTRACTS:CliFlagContract[];
|
|
|
120
120
|
export declare const EXTENSION_UNINSTALL_FLAG_CONTRACTS:CliFlagContract[];
|
|
121
121
|
/** Public contract for extension explore flag contracts, shared by SDK and presentation-layer consumers. */
|
|
122
122
|
export declare const EXTENSION_EXPLORE_FLAG_CONTRACTS:CliFlagContract[];
|
|
123
|
+
/** Flags of `package inventory` and its `list` alias: scope plus the listing row projection. */
|
|
124
|
+
export declare const EXTENSION_INVENTORY_FLAG_CONTRACTS:CliFlagContract[];
|
|
123
125
|
/** Public contract for extension describe flag contracts, shared by SDK and presentation-layer consumers. */
|
|
124
126
|
export declare const EXTENSION_DESCRIBE_FLAG_CONTRACTS:CliFlagContract[];
|
|
125
127
|
/** Public contract for extension adopt all flag contracts, shared by SDK and presentation-layer consumers. */
|