@visulima/vis 2.0.0 → 2.0.2
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/CHANGELOG.md +41 -0
- package/LICENSE.md +862 -170
- package/README.md +1 -1
- package/dist/bin.js +1 -1
- package/dist/binx.js +2 -2
- package/dist/config/index.d.ts +1817 -1811
- package/dist/generate/index.d.ts +39 -39
- package/dist/packem_chunks/CONFIG_FILES.js +5 -5
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/cache-attestation.js +1 -1
- package/dist/packem_chunks/catalog.js +69 -67
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +150 -145
- package/dist/packem_chunks/detect.js +3 -3
- package/dist/packem_chunks/detect2.js +4 -4
- package/dist/packem_chunks/dispatch.js +3 -3
- package/dist/packem_chunks/doctor-probe.js +1 -1
- package/dist/packem_chunks/extra-files.js +3 -3
- package/dist/packem_chunks/fix.js +9 -9
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +5 -5
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +6 -6
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +2 -2
- package/dist/packem_chunks/handler21.js +2 -2
- package/dist/packem_chunks/handler22.js +10 -10
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +5 -5
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +3 -3
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +2 -3
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler31.js +2 -2
- package/dist/packem_chunks/handler35.js +3 -3
- package/dist/packem_chunks/handler4.js +4 -4
- package/dist/packem_chunks/handler40.js +10 -10
- package/dist/packem_chunks/handler42.js +3 -3
- package/dist/packem_chunks/handler43.js +3 -3
- package/dist/packem_chunks/handler5.js +5 -5
- package/dist/packem_chunks/handler50.js +5 -5
- package/dist/packem_chunks/handler51.js +13 -13
- package/dist/packem_chunks/handler52.js +3 -3
- package/dist/packem_chunks/handler53.js +1 -1
- package/dist/packem_chunks/handler54.js +2 -2
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler57.js +5 -5
- package/dist/packem_chunks/handler58.js +4 -4
- package/dist/packem_chunks/handler59.js +8 -8
- package/dist/packem_chunks/handler6.js +7 -7
- package/dist/packem_chunks/handler60.js +2 -2
- package/dist/packem_chunks/handler61.js +13 -13
- package/dist/packem_chunks/handler62.js +4 -4
- package/dist/packem_chunks/handler63.js +3 -3
- package/dist/packem_chunks/handler64.js +4 -4
- package/dist/packem_chunks/handler65.js +6 -6
- package/dist/packem_chunks/handler66.js +2 -2
- package/dist/packem_chunks/handler67.js +9 -9
- package/dist/packem_chunks/handler68.js +7 -7
- package/dist/packem_chunks/handler69.js +24 -24
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +6 -6
- package/dist/packem_chunks/handler71.js +14 -14
- package/dist/packem_chunks/handler72.js +47 -47
- package/dist/packem_chunks/handler73.js +9 -9
- package/dist/packem_chunks/handler74.js +27 -27
- package/dist/packem_chunks/handler75.js +3 -3
- package/dist/packem_chunks/handler76.js +8 -8
- package/dist/packem_chunks/handler77.js +63 -64
- package/dist/packem_chunks/handler78.js +25 -25
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +5 -5
- package/dist/packem_chunks/heal.js +8 -8
- package/dist/packem_chunks/help-command.js +46 -46
- package/dist/packem_chunks/index2.js +5 -5
- package/dist/packem_chunks/index3.js +3 -3
- package/dist/packem_chunks/index4.js +11 -11
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +2 -2
- package/dist/packem_chunks/list.js +2 -2
- package/dist/packem_chunks/loader.js +4 -4
- package/dist/packem_chunks/orchestrator.js +14 -14
- package/dist/packem_chunks/pre-mode.js +2 -2
- package/dist/packem_chunks/prompts.js +3 -3
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/publish-guards.js +1 -1
- package/dist/packem_chunks/registry.js +17 -17
- package/dist/packem_chunks/resolveFormatter.js +5 -5
- package/dist/packem_chunks/shell-runner.js +1 -1
- package/dist/packem_chunks/snapshot.js +2 -2
- package/dist/packem_chunks/stage-publisher.js +1 -1
- package/dist/packem_chunks/staged-registry.js +2 -2
- package/dist/packem_chunks/state.js +3 -3
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tar.js +3 -3
- package/dist/packem_chunks/tripwire.js +2 -2
- package/dist/packem_chunks/ts-loader.js +9 -9
- package/dist/packem_chunks/verify-lockfile.js +2 -2
- package/dist/packem_chunks/workspace.js +2 -2
- package/dist/packem_shared/advisories-CCBGdU8U.js +1 -0
- package/dist/packem_shared/affected-selection-Dj-ymxhw.js +1 -0
- package/dist/packem_shared/affected-shas-PwkVbPch.js +1 -0
- package/dist/packem_shared/ai-analysis-bGCAc1jR.js +68 -0
- package/dist/packem_shared/{ai-fix-CLfWbyqY.js → ai-fix-DV5-dHBY.js} +9 -9
- package/dist/packem_shared/{augment-BVuj3ee7.js → augment-24KX2nkI.js} +4 -4
- package/dist/packem_shared/bin-CtzhnYMp.js +1 -0
- package/dist/packem_shared/build-scripts-w4SNeR7D.js +1 -0
- package/dist/packem_shared/{command-runtime-DTbo12cP.js → command-runtime-BLFPUYAT.js} +1 -1
- package/dist/packem_shared/cyclonedx-C4KaVTn1.js +4 -0
- package/dist/packem_shared/{dependency-scan-DZcSlSFp.js → dependency-scan-D_ona0Qm.js} +1 -1
- package/dist/packem_shared/{docker-69ybb6g7.js → docker-DaVs-9wK.js} +40 -40
- package/dist/packem_shared/{en-C26W78--.js → en-D3CfXlO7.js} +13 -13
- package/dist/packem_shared/failure-log-CTneNcio.js +2 -0
- package/dist/packem_shared/giget-CAxjpwew.js +2 -0
- package/dist/packem_shared/glob-BUjyjdE8-C4M8e02u.js +1 -0
- package/dist/packem_shared/index-BWl4DbMp.js +1 -0
- package/dist/packem_shared/index-CTMU29dI.js +1 -0
- package/dist/packem_shared/index-uBVnF4ji.js +35 -0
- package/dist/packem_shared/index.server-CusjRLCh.js +2 -0
- package/dist/packem_shared/{interface.d-B7VK2rcH.d.ts → interface.d-CRqRz4jt.d.ts} +39 -39
- package/dist/packem_shared/{interface.d-Cezzifoh.d.ts → interface.d-CrHOtJc1.d.ts} +37 -37
- package/dist/packem_shared/lifecycle-B8A2T3gx.js +2 -0
- package/dist/packem_shared/lockfile-Bccery3L.js +1 -0
- package/dist/packem_shared/main-D_cam4hv.js +1 -0
- package/dist/packem_shared/manifests-BDkwiVbh.js +1 -0
- package/dist/packem_shared/{min-release-age-hK604veF.js → min-release-age-OaYpLwux.js} +2 -2
- package/dist/packem_shared/missing-package-json-BqS-OnKd.js +1 -0
- package/dist/packem_shared/{native-config-sync-DDKjAy0i.js → native-config-sync-Ds1FtcrM.js} +7 -7
- package/dist/packem_shared/osv-bloom-pKp7urSB.js +2 -0
- package/dist/packem_shared/package-version-C47v64aB.js +4 -0
- package/dist/packem_shared/packument-HBVbyf7x.js +1 -0
- package/dist/packem_shared/pm-runner-C6eTANt1.js +1 -0
- package/dist/packem_shared/project-name-filter-CJ3XX2TI.js +7 -0
- package/dist/packem_shared/prompt-BSAy8SMH.js +1 -0
- package/dist/packem_shared/{provenance-CRBV9cko.js → provenance-D4Cza8cp.js} +1 -1
- package/dist/packem_shared/{readJsonSync-DuMMeB3s-B9cGBVbJ.js → readJsonSync-DweZd5ZA-0eZh9sGm.js} +1 -1
- package/dist/packem_shared/registry-keys-C0ez2VND.js +1 -0
- package/dist/packem_shared/{resolve-explicit-BX6aMYl-.js → resolve-explicit-BbT764KS.js} +1 -1
- package/dist/packem_shared/{resolve-runtime-COyiEML3.js → resolve-runtime-D_vZovbB.js} +1 -1
- package/dist/packem_shared/run-file-DyPFFN9U.js +1 -0
- package/dist/packem_shared/{runtime-check-fzDkedMW.js → runtime-check-D4um-yQq.js} +1 -1
- package/dist/packem_shared/s1ngularity-St6dhKiq.js +1 -0
- package/dist/packem_shared/scan-progress-q-N2JtIp.js +2 -0
- package/dist/packem_shared/selectors-Ce_6UAoY.js +3 -0
- package/dist/packem_shared/signatures-Dyeyg1q9.js +2 -0
- package/dist/packem_shared/subtree-DSm0QEoE.js +2 -0
- package/dist/packem_shared/target-merge-Cfy7c__2.js +11 -0
- package/dist/packem_shared/target-options-7XcbqGDe.js +1 -0
- package/dist/packem_shared/toolchain-C_pNMBM6.js +5 -0
- package/dist/packem_shared/typosquats-xzcAGPiM.js +1 -0
- package/dist/packem_shared/{use-measured-height-DfNxp6nf.js → use-measured-height-CBjN0fle.js} +1 -1
- package/dist/packem_shared/verify-Dve9PQj3.js +1 -0
- package/dist/packem_shared/{vis-update-app-De8JjZm0.js → vis-update-app-DMAC2pPf.js} +1 -1
- package/dist/packem_shared/vis-user-error-xmha3L4n.js +30 -0
- package/dist/packem_shared/watch-BXOOX7lx.js +1 -0
- package/dist/packem_shared/watch-loop-Q7UpkVbr.js +11 -0
- package/dist/release/core/package-managers/index.d.ts +2 -2
- package/dist/release/core/version-actions/index.d.ts +10 -10
- package/dist/release/index.d.ts +60 -60
- package/dist/release/plugin-sdk.d.ts +80 -80
- package/dist/release/presets.d.ts +148 -148
- package/dist/release/types.d.ts +840 -840
- package/dist/runtime/preload.js +1 -1
- package/index.d.ts +204 -204
- package/index.js +52 -52
- package/package.json +16 -16
- package/schemas/project.schema.json +4 -1
- package/schemas/vis-config.schema.json +9 -3
- package/dist/packem_shared/advisories-B76fBVL-.js +0 -1
- package/dist/packem_shared/affected-shas-BOeR4vEc.js +0 -1
- package/dist/packem_shared/ai-analysis-D7HOdUwd.js +0 -68
- package/dist/packem_shared/bin-CkfFJCAM.js +0 -1
- package/dist/packem_shared/build-scripts-CfAqHBlq.js +0 -1
- package/dist/packem_shared/cyclonedx--L7NbMBH.js +0 -4
- package/dist/packem_shared/failure-log-BZQqxffZ.js +0 -2
- package/dist/packem_shared/giget-DVTFJlbR.js +0 -2
- package/dist/packem_shared/glob-DMbPwGSj-D2Hk3lFG.js +0 -1
- package/dist/packem_shared/index-2LCHaVNX.js +0 -35
- package/dist/packem_shared/index-B0EsgdzO.js +0 -1
- package/dist/packem_shared/index-Bhzio2RB.js +0 -1
- package/dist/packem_shared/index-Bq6YEpiq.js +0 -28
- package/dist/packem_shared/index.server-qvZ-cy29.js +0 -2
- package/dist/packem_shared/lifecycle-BcCMt9wn.js +0 -2
- package/dist/packem_shared/lockfile-Cwt0Nwr0.js +0 -1
- package/dist/packem_shared/main-B3juSU5z.js +0 -1
- package/dist/packem_shared/manifests-BshBdSb-.js +0 -1
- package/dist/packem_shared/missing-package-json-Cu0iWMT2.js +0 -1
- package/dist/packem_shared/osv-bloom-DMhXP184.js +0 -2
- package/dist/packem_shared/package-version-TsxLc6w2.js +0 -4
- package/dist/packem_shared/packument-CtVAoNo7.js +0 -1
- package/dist/packem_shared/pm-runner-CfyxALPK.js +0 -1
- package/dist/packem_shared/prompt-DjXHVgYU.js +0 -1
- package/dist/packem_shared/registry-keys-Ci2keQNi.js +0 -1
- package/dist/packem_shared/run-file-CTJfIZ0I.js +0 -1
- package/dist/packem_shared/s1ngularity-Cq1cCSpU.js +0 -1
- package/dist/packem_shared/scan-progress-DQ9qIGzr.js +0 -2
- package/dist/packem_shared/selectors-B9dOMIMq.js +0 -3
- package/dist/packem_shared/signatures-DvD1E8Xa.js +0 -2
- package/dist/packem_shared/subtree-C7bZuiSQ.js +0 -2
- package/dist/packem_shared/target-merge-Dg25Izl5.js +0 -11
- package/dist/packem_shared/target-options-aPqByoww.js +0 -1
- package/dist/packem_shared/toolchain-CiaW3bx4.js +0 -5
- package/dist/packem_shared/typosquats-CRnvlYPw.js +0 -1
- package/dist/packem_shared/verify-23b6IfSg.js +0 -1
- package/dist/packem_shared/watch-B3P2dwoG.js +0 -1
- package/dist/packem_shared/watch-loop-B3_O8hF-.js +0 -11
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`;break;case 114:
|
|
3
|
-
`),l++,p=t,i=14;switch(
|
|
4
|
-
`+" ".repeat(o)),new Array(
|
|
5
|
-
`+" ".repeat(o)),new Array(
|
|
6
|
-
`+" ".repeat(o)),new Array(
|
|
7
|
-
`+" ".repeat(o));var re;(function(e){e.DEFAULT={allowTrailingComma:!1}})(re||(re={}));function pt(e,o=[],s=re.DEFAULT){let t=null,r=[];const c=[];function i(l){Array.isArray(r)?r.push(l):t!==null&&(r[t]=l)}return ut(e,{onObjectBegin:()=>{const l={};i(l),c.push(r),r=l,t=null},onObjectProperty:l=>{t=l},onObjectEnd:()=>{r=c.pop()},onArrayBegin:()=>{const l=[];i(l),c.push(r),r=l,t=null},onArrayEnd:()=>{r=c.pop()},onLiteralValue:i,onError:(l,a,p)=>{o.push({error:l,offset:a,length:p})}},s),r[0]}function ut(e,o,s=re.DEFAULT){const t=at(e,!1),r=[];let c=0;function i(y){return y?()=>c===0&&y(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function l(y){return y?C=>c===0&&y(C,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function a(y){return y?C=>c===0&&y(C,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>r.slice()):()=>!0}function p(y){return y?()=>{c>0?c++:y(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>r.slice())===!1&&(c=1)}:()=>!0}function f(y){return y?()=>{c>0&&c--,c===0&&y(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter())}:()=>!0}const d=p(o.onObjectBegin),v=a(o.onObjectProperty),O=f(o.onObjectEnd),k=p(o.onArrayBegin),T=f(o.onArrayEnd),A=a(o.onLiteralValue),I=l(o.onSeparator),h=i(o.onComment),n=l(o.onError),g=s&&s.disallowComments,b=s&&s.allowTrailingComma;function m(){for(;;){const y=t.scan();switch(t.getTokenError()){case 4:u(14);break;case 5:u(15);break;case 3:u(13);break;case 1:g||u(11);break;case 2:u(12);break;case 6:u(16);break}switch(y){case 12:case 13:g?u(10):h();break;case 16:u(1);break;case 15:case 14:break;default:return y}}}function u(y,C=[],ye=[]){if(n(y),C.length+ye.length>0){let Q=t.getToken();for(;Q!==17;){if(C.indexOf(Q)!==-1){m();break}else if(ye.indexOf(Q)!==-1)break;Q=m()}}}function E(y){const C=t.getTokenValue();return y?A(C):(v(C),r.push(C)),m(),!0}function R(){switch(t.getToken()){case 11:const y=t.getTokenValue();let C=Number(y);isNaN(C)&&(u(2),C=0),A(C);break;case 7:A(null);break;case 8:A(!0);break;case 9:A(!1);break;default:return!1}return m(),!0}function z(){return t.getToken()!==10?(u(3,[],[2,5]),!1):(E(!1),t.getToken()===6?(I(":"),m(),ie()||u(4,[],[2,5])):u(5,[],[2,5]),r.pop(),!0)}function Ve(){d(),m();let y=!1;for(;t.getToken()!==2&&t.getToken()!==17;){if(t.getToken()===5){if(y||u(4,[],[]),I(","),m(),t.getToken()===2&&b)break}else y&&u(6,[],[]);z()||u(4,[],[2,5]),y=!0}return O(),t.getToken()!==2?u(7,[2],[]):m(),!0}function Je(){k(),m();let y=!0,C=!1;for(;t.getToken()!==4&&t.getToken()!==17;){if(t.getToken()===5){if(C||u(4,[],[]),I(","),m(),t.getToken()===4&&b)break}else C&&u(6,[],[]);y?(r.push(0),y=!1):r[r.length-1]++,ie()||u(4,[],[4,5]),C=!0}return T(),y||r.pop(),t.getToken()!==4?u(8,[4],[]):m(),!0}function ie(){switch(t.getToken()){case 3:return Je();case 1:return Ve();case 10:return E(!0);default:return R()}}return m(),t.getToken()===17?s.allowEmptyContent?!0:(u(4,[],[]),!1):ie()?(t.getToken()!==17&&u(9,[],[]),!0):(u(4,[],[]),!1)}var ve;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(ve||(ve={}));var Ce;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(Ce||(Ce={}));const se=pt;var we;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(we||(we={}));function dt(e){switch(e){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}const ft=(e,o,s,t)=>{if(e.length===0)return;const r=e[0],c=Qe(o,r.offset),i=new Ye(`${dt(r.error)} at offset ${r.offset}`);throw i.fileName=s,i.codeFrame=Xe(o,{start:c},{tabWidth:!1,...t}),i},mt=(e,o)=>{const{allowEmptyContent:s,allowTrailingComma:t=!0,beforeParse:r,buffer:c,color:i,compression:l,disallowComments:a,encoding:p="utf8",flag:f}=o??{},d=F(e,{buffer:c,compression:l,encoding:p,flag:f}),v=typeof r=="function"?r(d):d,O=[],k=se(v,O,{allowEmptyContent:s,allowTrailingComma:t,disallowComments:a});return ft(O,v,Ze(e),{color:i}),k},ht=D(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gt=e=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[o,s]=M.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return M.getBuiltinModule(e)}return ht(e)};gt("node:fs/promises");const Ot=D(import.meta.url),V=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,bt=e=>{if(typeof V<"u"&&V.versions&&V.versions.node){const[o,s]=V.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return V.getBuiltinModule(e)}return Ot(e)};bt("node:fs");const yt=(e,o)=>{const s=F(e,{encoding:"utf8",...o});return rt(s)};var J={},Te;function kt(){if(Te)return J;Te=1,Object.defineProperty(J,"__esModule",{value:!0});const e=h=>h!==null&&typeof h=="object",o=(h,n)=>Object.assign(new Error(`[${h}]: ${n}`),{code:h}),s="ERR_INVALID_PACKAGE_CONFIG",t="ERR_INVALID_PACKAGE_TARGET",r="ERR_PACKAGE_PATH_NOT_EXPORTED",c="ERR_PACKAGE_IMPORT_NOT_DEFINED",i=/^\d+$/,l=/^(\.{1,2}|node_modules)$/i,a=/\/|\\/;var p=(h=>(h.Export="exports",h.Import="imports",h))(p||{});const f=(h,n,g,b,m)=>{if(n==null)return[];if(typeof n=="string"){const[u,...E]=n.split(a);if(u===".."||E.some(R=>l.test(R)))throw o(t,`Invalid "${h}" target "${n}" defined in the package config`);return[m?n.replace(/\*/g,m):n]}if(Array.isArray(n))return n.flatMap(u=>f(h,u,g,b,m));if(e(n)){for(const u of Object.keys(n)){if(i.test(u))throw o(s,"Cannot contain numeric property keys");if(u==="default"||b.includes(u))return f(h,n[u],g,b,m)}return[]}throw o(t,`Invalid "${h}" target "${n}"`)},d="*",v=(h,n)=>{const g=h.indexOf(d),b=n.indexOf(d);return g===b?n.length>h.length:b>g};function O(h,n){if(!n.includes(d)&&h.hasOwnProperty(n))return[n];let g,b;for(const m of Object.keys(h))if(m.includes(d)){const[u,E,R]=m.split(d);if(R===void 0&&n.startsWith(u)&&n.endsWith(E)){const z=n.slice(u.length,-E.length||void 0);z&&(!g||v(g,m))&&(g=m,b=z)}}return[g,b]}const k=h=>Object.keys(h).reduce((n,g)=>{const b=g===""||g[0]!==".";if(n===void 0||n===b)return b;throw o(s,'"exports" cannot contain some keys starting with "." and some not')},void 0),T=/^\w+:/,A=(h,n,g)=>{if(!h)throw new Error('"exports" is required');n=n===""?".":`./${n}`,(typeof h=="string"||Array.isArray(h)||e(h)&&k(h))&&(h={".":h});const[b,m]=O(h,n),u=f(p.Export,h[b],n,g,m);if(u.length===0)throw o(r,n==="."?'No "exports" main defined':`Package subpath '${n}' is not defined by "exports"`);for(const E of u)if(!E.startsWith("./")&&!T.test(E))throw o(t,`Invalid "exports" target "${E}" defined in the package config`);return u},I=(h,n,g)=>{if(!h)throw new Error('"imports" is required');const[b,m]=O(h,n),u=f(p.Import,h[b],n,g,m);if(u.length===0)throw o(c,`Package import specifier "${n}" is not defined in package`);return u};return J.resolveExports=A,J.resolveImports=I,J}var vt=kt();const Ct=D(import.meta.url),q=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,je=e=>{if(typeof q<"u"&&q.versions&&q.versions.node){const[o,s]=q.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return q.getBuiltinModule(e)}return Ct(e)},{statSync:X}=je("node:fs"),wt=je("node:module"),_e=(e=process.cwd())=>{const{findPnpApi:o}=wt;return o?o(e):void 0},Tt=e=>se(F(e,{buffer:!1})),ce=(e,o,s,t)=>{const r=`resolveFromPackageJsonPath:${e}:${o}:${s?"yes":"no"}`;if(t?.has(r))return t.get(r);const c=Tt(e);if(!c)return;let i=o||"tsconfig.json";if(!s&&c.exports)try{const[l]=vt.resolveExports(c.exports,o,["require","types"]);i=l}catch{return!1}else!o&&c.tsconfig&&(i=c.tsconfig);return i=w(e,"..",i),t?.set(r,i),i},le="package.json",ae="tsconfig.json",xt=(e,o,s)=>{let t=e;if(e===".."&&(t=w(t,ae)),e.startsWith(".")&&(t=S(o,t)),be(t)){if($(t)){if(X(t).isFile())return t}else if(!t.endsWith(".json")){const O=`${t}.json`;if($(O))return O}return}const[r="",...c]=e.split("/"),i=r.startsWith("@")?`${r}/${String(c.shift())}`:r,l=c.join("/"),a=_e(o);if(a){const{resolveRequest:O}=a;try{if(i===e){const k=O(w(i,le),o);if(k){const T=ce(k,l,!1,s);if(T&&$(T))return T}}else{let k;try{k=O(e,o,{extensions:[".json"]})}catch{k=O(w(e,ae),o)}if(k)return k}}catch{}}const p=oe(O=>{const k=w(S(O),"node_modules",i);if($(k))return w("node_modules",i)},{cwd:o,type:"directory"});if(!p||!X(p).isDirectory())return;const f=w(p,le);if($(f)){const O=ce(f,l,!1,s);if(O===!1)return;if(O&&$(O)&&X(O).isFile())return O}const d=w(p,l),v=d.endsWith(".json");if(!v){const O=`${d}.json`;if($(O))return O}if($(d)){if(X(d).isDirectory()){const O=w(d,le);if($(O)){const T=ce(O,"",!0,s);if(T&&$(T))return T}const k=w(d,ae);if($(k))return k}else if(v)return d}},Et=e=>{const o=S(e);let s;const t=_e(o);if(t)try{s=t.resolveRequest("typescript/package.json",o)??void 0}catch{}if(s??=oe(r=>w(r,"node_modules","typescript","package.json"),{cwd:o,type:"file"}),!!s)try{const r=se(F(s,{buffer:!1}));if(typeof r?.version=="string")return r.version}catch{}},$t=new Set(["node16","node18","node20","nodenext"]),De=e=>e!==void 0&&$t.has(e),St=(e,o)=>{!o.has("target")&&!De(e.module)&&(e.target="es3")},At=(e,o)=>{!o.has("target")&&!De(e.module)&&(e.target="es5")},It=(e,o)=>{o.has("strict")||(e.strict=!0),o.has("target")||(e.target="es2025"),o.has("module")||(e.module="es2022"),o.has("moduleResolution")||(e.moduleResolution="bundler"),o.has("rootDir")||(e.rootDir="."),o.has("types")||(e.types=[]),o.has("noUncheckedSideEffectImports")||(e.noUncheckedSideEffectImports=!0),o.has("libReplacement")||(e.libReplacement=!1),o.has("alwaysStrict")||(e.alwaysStrict=!0)},Nt=(e,o)=>{o.has("module")||(e.module="esnext"),o.has("moduleResolution")||(e.moduleResolution="bundler"),o.has("stableTypeOrdering")||(e.stableTypeOrdering=!0)},Lt=[[4,St],[5,At],[6,It],[7,Nt]],jt=/^v?(\d+)/,_t=e=>{const o=jt.exec(e);return o?Number(o[1]):void 0},Dt=(e,o)=>{const s=_t(o);if(s===void 0)return;const t=new Set(Object.keys(e));for(const[r,c]of Lt)r<=s&&c(e,t)},Ft=e=>se(F(e,{buffer:!1})),Rt=e=>e.replaceAll("\\","/"),G=e=>{const o=et(e);return tt(o)?o:`./${o}`},me=["files","include","exclude"],xe=(e,o,s)=>{const t=w(o,s),r=H(e,t);return te(r)||"./"},Bt=(e,o,s)=>{const t=H(e,o);if(!t)return s;const r=s.startsWith("./")?s.slice(2):s;return`${t}/${r}`},Ut=(e,o,s,t,r)=>{if(s.has(e))throw new Error(`Circularity detected while resolving configuration: ${e}`);s.add(e);const c=N(e),i=Fe(e,t,s,r);delete i.references;const{compilerOptions:l}=i;if(l){const{baseUrl:a}=l;a&&!a.startsWith(x)&&(l.baseUrl=xe(o,c,a));const{outDir:p}=l;p&&!p.startsWith(x)&&(l.outDir=xe(o,c,p))}for(const a of me){const p=i[a];p&&(i[a]=p.map(f=>f.startsWith(x)||be(f)?f:Bt(o,c,f)))}return i},Fe=(e,o,s=new Set,t=new Map)=>{let r;try{r=Ft(e)??{}}catch(i){throw new Error(`Cannot resolve tsconfig at path: ${e}`,{cause:i})}if(typeof r!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const c=N(e);if(r.compilerOptions){const{compilerOptions:i}=r;i.paths&&!i.baseUrl&&(i[Re]=c)}if(r.extends){const i=Array.isArray(r.extends)?r.extends:[r.extends];delete r.extends;const l=i.toReversed();for(let a=0;a<l.length;a++){const p=l[a],f=xt(p,c,t);if(!f)throw new Ne(`No such file or directory, for '${p}' found.`);const d=Ut(f,c,new Set(s),o,t);d.compilerOptions?.rootDir!==void 0&&!d.compilerOptions.rootDir.startsWith(x)&&(d.compilerOptions.rootDir=w(N(f),d.compilerOptions.rootDir));const v={...d,...r,compilerOptions:{...d.compilerOptions,...r.compilerOptions}};d.watchOptions&&(v.watchOptions={...d.watchOptions,...r.watchOptions}),r=v}}if(r.compilerOptions){const{compilerOptions:i}=r;for(const l of["baseUrl","rootDir"]){const a=i[l];if(a&&!a.startsWith(x)){const p=S(c,a);i[l]=G(H(c,p))}}for(const l of["outDir","declarationDir"]){let a=i[l];a&&(Array.isArray(r.exclude)||(r.exclude=["outDir","declarationDir"].map(p=>{const f=i[p];if(f)return f.startsWith(x)||be(f)?f:w(c,f)}).filter(Boolean)),a.startsWith(x)||(a=G(a)),i[l]=a)}}else r.compilerOptions={};if(r.include&&(r.include=r.include.map(i=>Rt(i))),r.files&&(r.files=r.files.map(i=>i.startsWith(x)?i:G(i))),r.watchOptions){const{watchOptions:i}=r;i.excludeDirectories&&(i.excludeDirectories=i.excludeDirectories.map(l=>te(S(c,l)))),i.excludeFiles&&(i.excludeFiles=i.excludeFiles.map(l=>te(S(c,l)))),i.watchFile&&(i.watchFile=i.watchFile.toLowerCase()),i.watchDirectory&&(i.watchDirectory=i.watchDirectory.toLowerCase()),i.fallbackPolling&&(i.fallbackPolling=i.fallbackPolling.toLowerCase())}if(r.compilerOptions.lib&&(r.compilerOptions.lib=r.compilerOptions.lib.map(i=>i.toLowerCase())),r.compilerOptions.module){let i=r.compilerOptions.module.toLowerCase();i==="es2015"&&(i="es6"),r.compilerOptions.module=i}if(r.compilerOptions.target){let i=r.compilerOptions.target.toLowerCase();i==="es2015"&&(i="es6"),r.compilerOptions.target=i}if(r.compilerOptions.moduleResolution){let i=r.compilerOptions.moduleResolution.toLowerCase();i==="node"&&(i="node10"),r.compilerOptions.moduleResolution=i}return r.compilerOptions.jsx&&(r.compilerOptions.jsx=r.compilerOptions.jsx.toLowerCase()),r.compilerOptions.moduleDetection&&(r.compilerOptions.moduleDetection=r.compilerOptions.moduleDetection.toLowerCase()),r.compilerOptions.importsNotUsedAsValues&&(r.compilerOptions.importsNotUsedAsValues=r.compilerOptions.importsNotUsedAsValues.toLowerCase()),r.compilerOptions.newLine&&(r.compilerOptions.newLine=r.compilerOptions.newLine.toLowerCase()),r},Z=(e,o)=>{if(e.startsWith(x))return te(w(o,e.slice(x.length)))},Pt=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],pe=e=>e==="es2022"||e==="es2023"||e==="es2024"||e==="es2025"||e==="esnext",Wt=(e,o)=>{if(e.compilerOptions===void 0)return e;if(e.compilerOptions.rewriteRelativeImportExtensions&&(e.compilerOptions.allowImportingTsExtensions??=!0),e.compilerOptions.composite&&(e.compilerOptions.declaration??=!0,e.compilerOptions.incremental??=!0),e.compilerOptions.checkJs&&(e.compilerOptions.allowJs??=!0),e.compilerOptions.verbatimModuleSyntax&&(e.compilerOptions.isolatedModules??=!0,e.compilerOptions.preserveConstEnums??=!0),["5.4","5.5","5.6","5.7","5.8","5.9"].includes(String(o?.tscCompatible))){if(e.compilerOptions.esModuleInterop===void 0&&(e.compilerOptions.module==="node16"||e.compilerOptions.module==="node18"||e.compilerOptions.module==="node20"||e.compilerOptions.module==="nodenext"||e.compilerOptions.module==="preserve")&&(e.compilerOptions.esModuleInterop=!0),e.compilerOptions.moduleDetection===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.moduleDetection="force"),e.compilerOptions.moduleResolution===void 0){let s="classic";if(e.compilerOptions.module!==void 0)switch(e.compilerOptions.module.toLocaleLowerCase()){case"commonjs":{s="node10";break}case"node16":case"node18":{s="node16";break}case"node20":{s="node16";break}case"nodenext":{s="nodenext";break}case"preserve":{s="bundler";break}}s!=="classic"&&(e.compilerOptions.moduleResolution=s)}if(e.compilerOptions.moduleResolution==="bundler"&&(e.compilerOptions.resolveJsonModule??=!0),e.compilerOptions.module&&["node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.resolveJsonModule??=!0),(e.compilerOptions.esModuleInterop||e.compilerOptions.module==="system"||e.compilerOptions.moduleResolution==="bundler")&&e.compilerOptions.allowSyntheticDefaultImports===void 0&&(e.compilerOptions.allowSyntheticDefaultImports=!0),["5.7","5.8","5.9"].includes(String(o?.tscCompatible))&&e.compilerOptions.moduleResolution){let s=!1;["bundler","node16","nodenext"].includes(e.compilerOptions.moduleResolution.toLocaleLowerCase())&&(s=!0),e.compilerOptions.resolvePackageJsonExports===void 0&&s&&(e.compilerOptions.resolvePackageJsonExports=!0),e.compilerOptions.resolvePackageJsonImports===void 0&&s&&(e.compilerOptions.resolvePackageJsonImports=!0)}if(e.compilerOptions.target===void 0){let s="es5";switch(e.compilerOptions.module){case"node16":case"node18":{s="es2022";break}case"node20":{s="es2023";break}case"nodenext":{s="esnext";break}}s!=="es5"&&(e.compilerOptions.target=s)}e.compilerOptions.useDefineForClassFields===void 0&&e.compilerOptions.target&&pe(e.compilerOptions.target)&&(e.compilerOptions.useDefineForClassFields=!0)}if(["5.6","5.7","5.8","5.9"].includes(String(o?.tscCompatible))&&e.compilerOptions.strict&&e.compilerOptions.strictBuiltinIteratorReturn===void 0&&(e.compilerOptions.strictBuiltinIteratorReturn=!0),["5.4","5.5","5.6","5.7","5.8","5.9"].includes(String(o?.tscCompatible))&&(e.compilerOptions.strict&&(e.compilerOptions.noImplicitAny=e.compilerOptions.noImplicitAny??!0,e.compilerOptions.noImplicitThis=e.compilerOptions.noImplicitThis??!0,e.compilerOptions.strictNullChecks=e.compilerOptions.strictNullChecks??!0,e.compilerOptions.strictFunctionTypes=e.compilerOptions.strictFunctionTypes??!0,e.compilerOptions.strictBindCallApply=e.compilerOptions.strictBindCallApply??!0,e.compilerOptions.strictPropertyInitialization=e.compilerOptions.strictPropertyInitialization??!0,e.compilerOptions.alwaysStrict=e.compilerOptions.alwaysStrict??!0),e.compilerOptions.useDefineForClassFields===void 0&&e.compilerOptions.target&&pe(e.compilerOptions.target)&&(e.compilerOptions.useDefineForClassFields=!0),e.compilerOptions.strict&&e.compilerOptions.useUnknownInCatchVariables===void 0&&(e.compilerOptions.useUnknownInCatchVariables=!0),e.compilerOptions.isolatedModules&&(e.compilerOptions.preserveConstEnums=e.compilerOptions.preserveConstEnums??!0)),["6.0","7.0","true"].includes(String(o?.tscCompatible))){if(e.compilerOptions.moduleDetection===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.moduleDetection="force"),e.compilerOptions.moduleResolution===void 0&&e.compilerOptions.module){const s=e.compilerOptions.module.toLocaleLowerCase();s==="node16"||s==="node18"||s==="node20"?e.compilerOptions.moduleResolution="node16":s==="nodenext"&&(e.compilerOptions.moduleResolution="nodenext")}if(e.compilerOptions.useDefineForClassFields===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&e.compilerOptions.target&&!pe(e.compilerOptions.target)&&(e.compilerOptions.useDefineForClassFields=!1),e.compilerOptions.isolatedModules&&e.compilerOptions.preserveConstEnums===void 0&&(e.compilerOptions.preserveConstEnums=!0),e.compilerOptions.resolveJsonModule===void 0){const s=e.compilerOptions.module,t=e.compilerOptions.moduleResolution?.toLocaleLowerCase();!(s!==void 0&&["node20","nodenext"].includes(s)||t==="bundler")&&t&&(e.compilerOptions.resolveJsonModule=!1)}if(e.compilerOptions.moduleResolution){const s=e.compilerOptions.moduleResolution.toLocaleLowerCase();["bundler","node16","nodenext"].includes(s)||(e.compilerOptions.resolvePackageJsonExports??=!1,e.compilerOptions.resolvePackageJsonImports??=!1)}}return e.compileOnSave===!1&&delete e.compileOnSave,e},Mt=(e,o)=>{const s=e?.typescriptVersion;if(!(s===!1||s===void 0))return s==="auto"?Et(o):s},x="${configDir}",Re=Symbol("implicitBaseUrl"),Vt=(e,o)=>{const s=S(e),t=Fe(s,o),r=N(s),c=Mt(o,r);c&&t.compilerOptions&&Dt(t.compilerOptions,c);const{compilerOptions:i}=t;if(i){for(const a of Pt){const p=i[a];if(p){const f=Z(p,r);i[a]=f?G(H(r,f)):p}}for(const a of["rootDirs","typeRoots"]){const p=i[a];p&&(i[a]=p.map(f=>{const d=Z(f,r);return d?G(H(r,d)):f}))}const{paths:l}=i;if(l){const a=Object.keys(l);for(let p=0;p<a.length;p++){const f=a[p];l[f]=l[f].map(d=>Z(d,r)??d)}}}for(let l=0;l<me.length;l++){const a=me[l],p=t[a];p&&(t[a]=p.map(f=>Z(f,r)??f))}return Wt(t,o)},Jt=D(import.meta.url),K=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qt=e=>{if(typeof K<"u"&&K.versions&&K.versions.node){const[o,s]=K.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return K.getBuiltinModule(e)}return Jt(e)},{statSync:Kt}=qt("node:fs"),Gt=new Map,Ht="tsconfig.json",zt=(e,o)=>{let s=0;try{s=Kt(e).mtimeMs}catch{}return`${e}::${String(o.tscCompatible)}::${String(o.typescriptVersion)}::${String(s)}`},Qt=(e,o={})=>{const s=o.configFileName??Ht,t=o.configFileName===void 0;let r=oe(s,{...e&&{cwd:e},type:"file"});if(!r&&t&&(r=oe("jsconfig.json",{...e&&{cwd:e},type:"file"})),!r)throw new Ne(t?`No such file or directory, for '${s}' or 'jsconfig.json' found.`:`No such file or directory, for '${s}' found.`);const c=o.cache&&typeof o.cache!="boolean"?o.cache:Gt,i=zt(r,o);if(o.cache&&c.has(i))return c.get(i);const l={config:Vt(r,{tscCompatible:o.tscCompatible,typescriptVersion:o.typescriptVersion}),path:r};return o.cache&&c.set(i,l),l},Yt=/\.[cm]?tsx?$/,Xt=[".yaml",".yml",".toml",".jsonc",".json5",".txt"],Be=/\.(?:ya?ml|toml|jsonc|json5|txt)$/,Zt=e=>e.endsWith(".yaml")||e.endsWith(".yml")?ot(e):e.endsWith(".toml")?yt(e):e.endsWith(".jsonc")?mt(e,{allowTrailingComma:!0}):e.endsWith(".json5")?st(e):Oe(e,"utf8"),he=e=>e===void 0?"undefined":e===null?"null":typeof e=="number"?Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":String(e):typeof e=="bigint"?`${e}n`:typeof e=="boolean"?String(e):typeof e=="string"?JSON.stringify(e):e instanceof Date?`new Date(${JSON.stringify(e.toISOString())})`:Array.isArray(e)?`[${e.map(o=>he(o)).join(",")}]`:typeof e=="object"?`{${Object.entries(e).map(([o,s])=>`${JSON.stringify(o)}:${he(s)}`).join(",")}}`:"null",ue=new Map,eo=(e,o)=>e.startsWith(x)?w(o,e.slice(x.length)):e,to=e=>{if(ue.has(e))return ue.get(e);let o;try{const{config:s,path:t}=Qt(e,{cache:!1}),r=N(t),c=s.compilerOptions,i=c?.paths??{};if(c!==void 0){const{baseUrl:l}=c;let a,p=!1;if(l===void 0){const f=c[Re];a=typeof f=="string"?f:r}else p=!0,a=S(r,eo(l,r));o={hasBaseUrl:p,paths:i,pathsBase:a}}}catch{o=void 0}return ue.set(e,o),o},Ue=(e,o)=>{const s=to(o);if(s===void 0)return;const{hasBaseUrl:t,pathsBase:r}=s,c=i=>Pe(i)??We(i);for(const[i,l]of Object.entries(s.paths)){const a=i.indexOf("*");if(a===-1){if(i===e)for(const d of l){const v=c(S(r,d));if(v!==void 0)return v}continue}const p=i.slice(0,a),f=i.slice(a+1);if(e.startsWith(p)&&e.endsWith(f)&&e.length>=p.length+f.length){const d=e.slice(p.length,e.length-f.length);for(const v of l){const O=v.replace("*",d),k=c(S(r,O));if(k!==void 0)return k}}}if(t){const i=c(S(r,e));if(i!==void 0)return i}};let Ee=!1,de=0,$e=!1,Se=!1;const oo=()=>{Se||(Se=!0,process.setSourceMapsEnabled?.(!0))},ro=e=>{const o=e.indexOf("?");return o===-1?e:e.slice(0,o)},so=e=>e.endsWith(".cts")?"commonjs":"module",Ae=[".ts",".tsx",".mts",".cts",".js",".mjs",".cjs",".json"],_=e=>{try{return Ie(e).isFile()}catch{return!1}},io=e=>{try{return Ie(e).isDirectory()}catch{return!1}},no=e=>{if(e.endsWith(".js"))return`${e.slice(0,-3)}.ts`;if(e.endsWith(".mjs"))return`${e.slice(0,-4)}.mts`;if(e.endsWith(".cjs"))return`${e.slice(0,-4)}.cts`},Pe=e=>{if(_(e))return e;const o=no(e);if(o!==void 0&&_(o))return o;for(const s of Ae)if(_(e+s))return e+s;if(io(e))for(const s of Ae){const t=`${e}/index${s}`;if(_(t))return t}},We=e=>{if(_(e)&&Be.test(e))return e;for(const o of Xt)if(_(e+o))return e+o},Me=()=>{oo();const{registerHooks:e}=fe;return typeof e!="function"?!1:(Ee||(e({load(o,s,t){const r=ro(o);if(r.startsWith("file:")&&Yt.test(r)){const c=Y(r),{code:i}=Le(c,Oe(c,"utf8"));return{format:so(c),shortCircuit:!0,source:i}}if(r.startsWith("file:")&&Be.test(r)){const c=Y(r),i=Zt(c);return{format:"module",shortCircuit:!0,source:`export default ${he(i)};
|
|
8
|
-
`}}return t(o,s)},resolve(o,s,t){if((o.startsWith(".")||o.startsWith("/"))&&s.parentURL!==void 0){let r;try{r=new URL(o,s.parentURL)}catch{r=void 0}if(r?.protocol==="file:"){const
|
|
9
|
-
`));const{code:o}=
|
|
1
|
+
import{createRequire as Qe}from"node:module";import{z as R,i as tt,E as ot,s as rt,L as st,e as it,P as S,J as I,b as z,h as te,w,k as Le,v as be,W as oe,y as nt,_ as ct,l as $,u as lt}from"../packem_shared/index-uBVnF4ji.js";import{parse as at}from"./index5.js";import"../packem_shared/public-api-WqUCiyIe.js";import{transformTs as _e}from"#native";let Ye;const Xe=e=>(Ye??=Qe(import.meta.url))(e),F=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ge=e=>{if(typeof F<"u"&&F.versions&&F.versions.node){const[o,s]=F.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return F.getBuiltinModule(e)}return Xe(e)},{readFileSync:Oe,statSync:Ne,writeFileSync:Ze,unlinkSync:et}=ge("node:fs"),de=ge("node:module"),{createRequire:D}=de,{fileURLToPath:Y,pathToFileURL:ee}=ge("node:url");function pt(e,o,s){const{beforeParse:t,buffer:r,compression:n,encoding:i="utf8",flag:l}={},a=R(e,{buffer:r,compression:n,encoding:i,flag:l}),p=typeof t=="function"?t(a):a;return tt.parse(p,o)}let ut;const dt=e=>(ut??=D(import.meta.url))(e),U=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ft=e=>{if(typeof U<"u"&&U.versions&&U.versions.node){const[o,s]=U.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return U.getBuiltinModule(e)}return dt(e)};ft("node:fs/promises");let mt;const ht=e=>(mt??=D(import.meta.url))(e),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gt=e=>{if(typeof P<"u"&&P.versions&&P.versions.node){const[o,s]=P.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return P.getBuiltinModule(e)}return ht(e)};gt("node:fs");function Ot(e,o=!1){const s=e.length;let t=0,r="",n=0,i=16,l=0,a=0,p=0,f=0,d=0;function k(c,g){let b=0,m=0;for(;b<c;){let u=e.charCodeAt(t);if(u>=48&&u<=57)m=m*16+u-48;else if(u>=65&&u<=70)m=m*16+u-65+10;else if(u>=97&&u<=102)m=m*16+u-97+10;else break;t++,b++}return b<c&&(m=-1),m}function O(c){t=c,r="",n=0,i=16,d=0}function v(){let c=t;if(e.charCodeAt(t)===48)t++;else for(t++;t<e.length&&L(e.charCodeAt(t));)t++;if(t<e.length&&e.charCodeAt(t)===46)if(t++,t<e.length&&L(e.charCodeAt(t)))for(t++;t<e.length&&L(e.charCodeAt(t));)t++;else return d=3,e.substring(c,t);let g=t;if(t<e.length&&(e.charCodeAt(t)===69||e.charCodeAt(t)===101))if(t++,(t<e.length&&e.charCodeAt(t)===43||e.charCodeAt(t)===45)&&t++,t<e.length&&L(e.charCodeAt(t))){for(t++;t<e.length&&L(e.charCodeAt(t));)t++;g=t}else d=3;return e.substring(c,g)}function T(){let c="",g=t;for(;;){if(t>=s){c+=e.substring(g,t),d=2;break}const b=e.charCodeAt(t);if(b===34){c+=e.substring(g,t),t++;break}if(b===92){if(c+=e.substring(g,t),t++,t>=s){d=2;break}switch(e.charCodeAt(t++)){case 34:c+='"';break;case 92:c+="\\";break;case 47:c+="/";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+=`
|
|
2
|
+
`;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:const m=k(4);m>=0?c+=String.fromCharCode(m):d=4;break;default:d=5}g=t;continue}if(b>=0&&b<=31)if(W(b)){c+=e.substring(g,t),d=2;break}else d=6;t++}return c}function A(){if(r="",d=0,n=t,a=l,f=p,t>=s)return n=s,i=17;let c=e.charCodeAt(t);if(ne(c)){do t++,r+=String.fromCharCode(c),c=e.charCodeAt(t);while(ne(c));return i=15}if(W(c))return t++,r+=String.fromCharCode(c),c===13&&e.charCodeAt(t)===10&&(t++,r+=`
|
|
3
|
+
`),l++,p=t,i=14;switch(c){case 123:return t++,i=1;case 125:return t++,i=2;case 91:return t++,i=3;case 93:return t++,i=4;case 58:return t++,i=6;case 44:return t++,i=5;case 34:return t++,r=T(),i=10;case 47:const g=t-1;if(e.charCodeAt(t+1)===47){for(t+=2;t<s&&!W(e.charCodeAt(t));)t++;return r=e.substring(g,t),i=12}if(e.charCodeAt(t+1)===42){t+=2;const b=s-1;let m=!1;for(;t<b;){const u=e.charCodeAt(t);if(u===42&&e.charCodeAt(t+1)===47){t+=2,m=!0;break}t++,W(u)&&(u===13&&e.charCodeAt(t)===10&&t++,l++,p=t)}return m||(t++,d=1),r=e.substring(g,t),i=13}return r+=String.fromCharCode(c),t++,i=16;case 45:if(r+=String.fromCharCode(c),t++,t===s||!L(e.charCodeAt(t)))return i=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return r+=v(),i=11;default:for(;t<s&&N(c);)t++,c=e.charCodeAt(t);if(n!==t){switch(r=e.substring(n,t),r){case"true":return i=8;case"false":return i=9;case"null":return i=7}return i=16}return r+=String.fromCharCode(c),t++,i=16}}function N(c){if(ne(c)||W(c))return!1;switch(c){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function h(){let c;do c=A();while(c>=12&&c<=15);return c}return{setPosition:O,getPosition:()=>t,scan:o?h:A,getToken:()=>i,getTokenValue:()=>r,getTokenOffset:()=>n,getTokenLength:()=>t-n,getTokenStartLine:()=>a,getTokenStartCharacter:()=>n-f,getTokenError:()=>d}}function ne(e){return e===32||e===9}function W(e){return e===10||e===13}function L(e){return e>=48&&e<=57}var ve;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(ve||(ve={}));new Array(20).fill(0).map((e,o)=>" ".repeat(o));const _=200;new Array(_).fill(0).map((e,o)=>`
|
|
4
|
+
`+" ".repeat(o)),new Array(_).fill(0).map((e,o)=>"\r"+" ".repeat(o)),new Array(_).fill(0).map((e,o)=>`\r
|
|
5
|
+
`+" ".repeat(o)),new Array(_).fill(0).map((e,o)=>`
|
|
6
|
+
`+" ".repeat(o)),new Array(_).fill(0).map((e,o)=>"\r"+" ".repeat(o)),new Array(_).fill(0).map((e,o)=>`\r
|
|
7
|
+
`+" ".repeat(o));var re;(function(e){e.DEFAULT={allowTrailingComma:!1}})(re||(re={}));function bt(e,o=[],s=re.DEFAULT){let t=null,r=[];const n=[];function i(l){Array.isArray(r)?r.push(l):t!==null&&(r[t]=l)}return yt(e,{onObjectBegin:()=>{const l={};i(l),n.push(r),r=l,t=null},onObjectProperty:l=>{t=l},onObjectEnd:()=>{r=n.pop()},onArrayBegin:()=>{const l=[];i(l),n.push(r),r=l,t=null},onArrayEnd:()=>{r=n.pop()},onLiteralValue:i,onError:(l,a,p)=>{o.push({error:l,offset:a,length:p})}},s),r[0]}function yt(e,o,s=re.DEFAULT){const t=Ot(e,!1),r=[];let n=0;function i(y){return y?()=>n===0&&y(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function l(y){return y?C=>n===0&&y(C,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function a(y){return y?C=>n===0&&y(C,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>r.slice()):()=>!0}function p(y){return y?()=>{n>0?n++:y(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>r.slice())===!1&&(n=1)}:()=>!0}function f(y){return y?()=>{n>0&&n--,n===0&&y(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter())}:()=>!0}const d=p(o.onObjectBegin),k=a(o.onObjectProperty),O=f(o.onObjectEnd),v=p(o.onArrayBegin),T=f(o.onArrayEnd),A=a(o.onLiteralValue),N=l(o.onSeparator),h=i(o.onComment),c=l(o.onError),g=s&&s.disallowComments,b=s&&s.allowTrailingComma;function m(){for(;;){const y=t.scan();switch(t.getTokenError()){case 4:u(14);break;case 5:u(15);break;case 3:u(13);break;case 1:g||u(11);break;case 2:u(12);break;case 6:u(16);break}switch(y){case 12:case 13:g?u(10):h();break;case 16:u(1);break;case 15:case 14:break;default:return y}}}function u(y,C=[],ye=[]){if(c(y),C.length+ye.length>0){let Q=t.getToken();for(;Q!==17;){if(C.indexOf(Q)!==-1){m();break}else if(ye.indexOf(Q)!==-1)break;Q=m()}}}function E(y){const C=t.getTokenValue();return y?A(C):(k(C),r.push(C)),m(),!0}function B(){switch(t.getToken()){case 11:const y=t.getTokenValue();let C=Number(y);isNaN(C)&&(u(2),C=0),A(C);break;case 7:A(null);break;case 8:A(!0);break;case 9:A(!1);break;default:return!1}return m(),!0}function H(){return t.getToken()!==10?(u(3,[],[2,5]),!1):(E(!1),t.getToken()===6?(N(":"),m(),ie()||u(4,[],[2,5])):u(5,[],[2,5]),r.pop(),!0)}function ze(){d(),m();let y=!1;for(;t.getToken()!==2&&t.getToken()!==17;){if(t.getToken()===5){if(y||u(4,[],[]),N(","),m(),t.getToken()===2&&b)break}else y&&u(6,[],[]);H()||u(4,[],[2,5]),y=!0}return O(),t.getToken()!==2?u(7,[2],[]):m(),!0}function He(){v(),m();let y=!0,C=!1;for(;t.getToken()!==4&&t.getToken()!==17;){if(t.getToken()===5){if(C||u(4,[],[]),N(","),m(),t.getToken()===4&&b)break}else C&&u(6,[],[]);y?(r.push(0),y=!1):r[r.length-1]++,ie()||u(4,[],[4,5]),C=!0}return T(),y||r.pop(),t.getToken()!==4?u(8,[4],[]):m(),!0}function ie(){switch(t.getToken()){case 3:return He();case 1:return ze();case 10:return E(!0);default:return B()}}return m(),t.getToken()===17?s.allowEmptyContent?!0:(u(4,[],[]),!1):ie()?(t.getToken()!==17&&u(9,[],[]),!0):(u(4,[],[]),!1)}var ke;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(ke||(ke={}));var Ce;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(Ce||(Ce={}));const se=bt;var we;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(we||(we={}));function vt(e){switch(e){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}const kt=(e,o,s,t)=>{if(e.length===0)return;const r=e[0],n=ot(o,r.offset),i=new rt(`${vt(r.error)} at offset ${r.offset}`);throw i.fileName=s,i.codeFrame=st(o,{start:n},{tabWidth:!1,...t}),i},Ct=(e,o)=>{const{allowEmptyContent:s,allowTrailingComma:t=!0,beforeParse:r,buffer:n,color:i,compression:l,disallowComments:a,encoding:p="utf8",flag:f}=o??{},d=R(e,{buffer:n,compression:l,encoding:p,flag:f}),k=typeof r=="function"?r(d):d,O=[],v=se(k,O,{allowEmptyContent:s,allowTrailingComma:t,disallowComments:a});return kt(O,k,it(e),{color:i}),v};let wt;const Tt=e=>(wt??=D(import.meta.url))(e),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xt=e=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[o,s]=M.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return M.getBuiltinModule(e)}return Tt(e)};xt("node:fs/promises");let Et;const $t=e=>(Et??=D(import.meta.url))(e),V=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,St=e=>{if(typeof V<"u"&&V.versions&&V.versions.node){const[o,s]=V.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return V.getBuiltinModule(e)}return $t(e)};St("node:fs");const At=(e,o)=>{const s=R(e,{encoding:"utf8",...o});return at(s)};var J={},Te;function It(){if(Te)return J;Te=1,Object.defineProperty(J,"__esModule",{value:!0});const e=h=>h!==null&&typeof h=="object",o=(h,c)=>Object.assign(new Error(`[${h}]: ${c}`),{code:h}),s="ERR_INVALID_PACKAGE_CONFIG",t="ERR_INVALID_PACKAGE_TARGET",r="ERR_PACKAGE_PATH_NOT_EXPORTED",n="ERR_PACKAGE_IMPORT_NOT_DEFINED",i=/^\d+$/,l=/^(\.{1,2}|node_modules)$/i,a=/\/|\\/;var p=(h=>(h.Export="exports",h.Import="imports",h))(p||{});const f=(h,c,g,b,m)=>{if(c==null)return[];if(typeof c=="string"){const[u,...E]=c.split(a);if(u===".."||E.some(B=>l.test(B)))throw o(t,`Invalid "${h}" target "${c}" defined in the package config`);return[m?c.replace(/\*/g,m):c]}if(Array.isArray(c))return c.flatMap(u=>f(h,u,g,b,m));if(e(c)){for(const u of Object.keys(c)){if(i.test(u))throw o(s,"Cannot contain numeric property keys");if(u==="default"||b.includes(u))return f(h,c[u],g,b,m)}return[]}throw o(t,`Invalid "${h}" target "${c}"`)},d="*",k=(h,c)=>{const g=h.indexOf(d),b=c.indexOf(d);return g===b?c.length>h.length:b>g};function O(h,c){if(!c.includes(d)&&h.hasOwnProperty(c))return[c];let g,b;for(const m of Object.keys(h))if(m.includes(d)){const[u,E,B]=m.split(d);if(B===void 0&&c.startsWith(u)&&c.endsWith(E)){const H=c.slice(u.length,-E.length||void 0);H&&(!g||k(g,m))&&(g=m,b=H)}}return[g,b]}const v=h=>Object.keys(h).reduce((c,g)=>{const b=g===""||g[0]!==".";if(c===void 0||c===b)return b;throw o(s,'"exports" cannot contain some keys starting with "." and some not')},void 0),T=/^\w+:/,A=(h,c,g)=>{if(!h)throw new Error('"exports" is required');c=c===""?".":`./${c}`,(typeof h=="string"||Array.isArray(h)||e(h)&&v(h))&&(h={".":h});const[b,m]=O(h,c),u=f(p.Export,h[b],c,g,m);if(u.length===0)throw o(r,c==="."?'No "exports" main defined':`Package subpath '${c}' is not defined by "exports"`);for(const E of u)if(!E.startsWith("./")&&!T.test(E))throw o(t,`Invalid "exports" target "${E}" defined in the package config`);return u},N=(h,c,g)=>{if(!h)throw new Error('"imports" is required');const[b,m]=O(h,c),u=f(p.Import,h[b],c,g,m);if(u.length===0)throw o(n,`Package import specifier "${c}" is not defined in package`);return u};return J.resolveExports=A,J.resolveImports=N,J}var Nt=It();let Lt;const _t=e=>(Lt??=D(import.meta.url))(e),q=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,je=e=>{if(typeof q<"u"&&q.versions&&q.versions.node){const[o,s]=q.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return q.getBuiltinModule(e)}return _t(e)},{statSync:X}=je("node:fs"),jt=je("node:module"),De=(e=process.cwd())=>{const{findPnpApi:o}=jt;return o?o(e):void 0},Dt=e=>se(R(e,{buffer:!1})),ce=(e,o,s,t)=>{const r=`resolveFromPackageJsonPath:${e}:${o}:${s?"yes":"no"}`;if(t?.has(r))return t.get(r);const n=Dt(e);if(!n)return;let i=o||"tsconfig.json";if(!s&&n.exports)try{const[l]=Nt.resolveExports(n.exports,o,["require","types"]);i=l}catch{return!1}else!o&&n.tsconfig&&(i=n.tsconfig);return i=w(e,"..",i),t?.set(r,i),i},le="package.json",ae="tsconfig.json",Rt=(e,o,s)=>{let t=e;if(e===".."&&(t=w(t,ae)),e.startsWith(".")&&(t=S(o,t)),be(t)){if($(t)){if(X(t).isFile())return t}else if(!t.endsWith(".json")){const O=`${t}.json`;if($(O))return O}return}const[r="",...n]=e.split("/"),i=r.startsWith("@")?`${r}/${String(n.shift())}`:r,l=n.join("/"),a=De(o);if(a){const{resolveRequest:O}=a;try{if(i===e){const v=O(w(i,le),o);if(v){const T=ce(v,l,!1,s);if(T&&$(T))return T}}else{let v;try{v=O(e,o,{extensions:[".json"]})}catch{v=O(w(e,ae),o)}if(v)return v}}catch{}}const p=te(O=>{const v=w(S(O),"node_modules",i);if($(v))return w("node_modules",i)},{cwd:o,type:"directory"});if(!p||!X(p).isDirectory())return;const f=w(p,le);if($(f)){const O=ce(f,l,!1,s);if(O===!1)return;if(O&&$(O)&&X(O).isFile())return O}const d=w(p,l),k=d.endsWith(".json");if(!k){const O=`${d}.json`;if($(O))return O}if($(d)){if(X(d).isDirectory()){const O=w(d,le);if($(O)){const T=ce(O,"",!0,s);if(T&&$(T))return T}const v=w(d,ae);if($(v))return v}else if(k)return d}},Re=e=>{const o=S(e);let s;const t=De(o);if(t)try{s=t.resolveRequest("typescript/package.json",o)??void 0}catch{}if(s??=te(r=>w(r,"node_modules","typescript","package.json"),{cwd:o,type:"file"}),!!s)try{const r=se(R(s,{buffer:!1}));if(typeof r?.version=="string")return r.version}catch{}},Be=new Set(["node16","node18","node20","nodenext"]),Fe=e=>e!==void 0&&Be.has(e),Bt=e=>{switch(e){case"node20":return"es2023";case"nodenext":return"esnext";default:return"es2022"}},Ft=e=>e==="nodenext"?"nodenext":"node16",Ut=e=>{if(e==="nodenext")return"nodenext";if(e==="node16")return"node16"},Ue=(e,o,s)=>{const t=o.has("module")?e.module:void 0,r=o.has("moduleResolution")?e.moduleResolution:void 0;let n;t!==void 0&&Be.has(t)?n=t:r!==void 0&&(n=Ut(r)),s.target!==void 0&&!o.has("target")&&(e.target=n?Bt(n):s.target),o.has("module")||(e.module=n??s.module),o.has("moduleResolution")||(e.moduleResolution=n?Ft(n):"bundler")},Pt=(e,o)=>{!o.has("target")&&!Fe(e.module)&&(e.target="es3")},Wt=(e,o)=>{!o.has("target")&&!Fe(e.module)&&(e.target="es5")},Mt=(e,o)=>{o.has("strict")||(e.strict=!0),Ue(e,o,{module:"es2022",target:"es2025"}),o.has("rootDir")||(e.rootDir="."),o.has("types")||(e.types=[]),o.has("noUncheckedSideEffectImports")||(e.noUncheckedSideEffectImports=!0),o.has("libReplacement")||(e.libReplacement=!1),o.has("alwaysStrict")||(e.alwaysStrict=!0)},Vt=(e,o)=>{Ue(e,o,{module:"esnext"}),o.has("stableTypeOrdering")||(e.stableTypeOrdering=!0)},Jt=[[4,Pt],[5,Wt],[6,Mt],[7,Vt]],qt=/^v?(\d+)/,Kt=e=>{const o=qt.exec(e);return o?Number(o[1]):void 0},Gt=(e,o)=>{const s=Kt(o);if(s===void 0)return;const t=new Set(Object.keys(e));for(const[r,n]of Jt)r<=s&&n(e,t)},zt=e=>se(R(e,{buffer:!1})),Ht=e=>e.replaceAll("\\","/"),G=e=>{const o=nt(e);return ct(o)?o:`./${o}`},fe=["files","include","exclude"],xe=(e,o,s)=>{const t=w(o,s),r=z(e,t);return oe(r)||"./"},Qt=(e,o,s)=>{const t=z(e,o);if(!t)return s;const r=s.startsWith("./")?s.slice(2):s;return`${t}/${r}`},Yt=(e,o,s,t,r)=>{if(s.has(e))throw new Error(`Circularity detected while resolving configuration: ${e}`);s.add(e);const n=I(e),i=Pe(e,t,s,r);delete i.references;const{compilerOptions:l}=i;if(l){const{baseUrl:a}=l;a&&!a.startsWith(x)&&(l.baseUrl=xe(o,n,a));const{outDir:p}=l;p&&!p.startsWith(x)&&(l.outDir=xe(o,n,p))}for(const a of fe){const p=i[a];p&&(i[a]=p.map(f=>f.startsWith(x)||be(f)?f:Qt(o,n,f)))}return i},Pe=(e,o,s=new Set,t=new Map)=>{let r;try{r=zt(e)??{}}catch(i){throw new Error(`Cannot resolve tsconfig at path: ${e}`,{cause:i})}if(typeof r!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const n=I(e);if(r.compilerOptions){const{compilerOptions:i}=r;i.paths&&!i.baseUrl&&(i[We]=n)}if(r.extends){const i=Array.isArray(r.extends)?r.extends:[r.extends];delete r.extends;const l=i.toReversed();for(let a=0;a<l.length;a++){const p=l[a],f=Rt(p,n,t);if(!f)throw new Le(`No such file or directory, for '${p}' found.`);const d=Yt(f,n,new Set(s),o,t);d.compilerOptions?.rootDir!==void 0&&!d.compilerOptions.rootDir.startsWith(x)&&(d.compilerOptions.rootDir=w(I(f),d.compilerOptions.rootDir));const k={...d,...r,compilerOptions:{...d.compilerOptions,...r.compilerOptions}};d.watchOptions&&(k.watchOptions={...d.watchOptions,...r.watchOptions}),r=k}}if(r.compilerOptions){const{compilerOptions:i}=r;for(const l of["baseUrl","rootDir"]){const a=i[l];if(a&&!a.startsWith(x)){const p=S(n,a);i[l]=G(z(n,p))}}for(const l of["outDir","declarationDir"]){let a=i[l];a&&(Array.isArray(r.exclude)||(r.exclude=["outDir","declarationDir"].map(p=>{const f=i[p];if(f)return f.startsWith(x)||be(f)?f:w(n,f)}).filter(Boolean)),a.startsWith(x)||(a=G(a)),i[l]=a)}}else r.compilerOptions={};if(r.include&&(r.include=r.include.map(i=>Ht(i))),r.files&&(r.files=r.files.map(i=>i.startsWith(x)?i:G(i))),r.watchOptions){const{watchOptions:i}=r;i.excludeDirectories&&(i.excludeDirectories=i.excludeDirectories.map(l=>oe(S(n,l)))),i.excludeFiles&&(i.excludeFiles=i.excludeFiles.map(l=>oe(S(n,l)))),i.watchFile&&(i.watchFile=i.watchFile.toLowerCase()),i.watchDirectory&&(i.watchDirectory=i.watchDirectory.toLowerCase()),i.fallbackPolling&&(i.fallbackPolling=i.fallbackPolling.toLowerCase())}if(r.compilerOptions.lib&&(r.compilerOptions.lib=r.compilerOptions.lib.map(i=>i.toLowerCase())),r.compilerOptions.module){let i=r.compilerOptions.module.toLowerCase();i==="es2015"&&(i="es6"),r.compilerOptions.module=i}if(r.compilerOptions.target){let i=r.compilerOptions.target.toLowerCase();i==="es2015"&&(i="es6"),r.compilerOptions.target=i}if(r.compilerOptions.moduleResolution){let i=r.compilerOptions.moduleResolution.toLowerCase();i==="node"&&(i="node10"),r.compilerOptions.moduleResolution=i}return r.compilerOptions.jsx&&(r.compilerOptions.jsx=r.compilerOptions.jsx.toLowerCase()),r.compilerOptions.moduleDetection&&(r.compilerOptions.moduleDetection=r.compilerOptions.moduleDetection.toLowerCase()),r.compilerOptions.importsNotUsedAsValues&&(r.compilerOptions.importsNotUsedAsValues=r.compilerOptions.importsNotUsedAsValues.toLowerCase()),r.compilerOptions.newLine&&(r.compilerOptions.newLine=r.compilerOptions.newLine.toLowerCase()),r},Z=(e,o)=>{if(e.startsWith(x))return oe(w(o,e.slice(x.length)))},Xt=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],Ee=e=>e==="es2022"||e==="es2023"||e==="es2024"||e==="es2025"||e==="esnext",Zt=(e,o)=>{if(e.compilerOptions===void 0)return e;if(e.compilerOptions.rewriteRelativeImportExtensions&&(e.compilerOptions.allowImportingTsExtensions??=!0),e.compilerOptions.composite&&(e.compilerOptions.declaration??=!0,e.compilerOptions.incremental??=!0),e.compilerOptions.checkJs&&(e.compilerOptions.allowJs??=!0),e.compilerOptions.verbatimModuleSyntax&&(e.compilerOptions.isolatedModules??=!0,e.compilerOptions.preserveConstEnums??=!0),["5.4","5.5","5.6","5.7","5.8","5.9"].includes(String(o?.tscCompatible))){if(e.compilerOptions.esModuleInterop===void 0&&(e.compilerOptions.module==="node16"||e.compilerOptions.module==="node18"||e.compilerOptions.module==="node20"||e.compilerOptions.module==="nodenext"||e.compilerOptions.module==="preserve")&&(e.compilerOptions.esModuleInterop=!0),e.compilerOptions.moduleDetection===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.moduleDetection="force"),e.compilerOptions.moduleResolution===void 0){let s="classic";if(e.compilerOptions.module!==void 0)switch(e.compilerOptions.module.toLocaleLowerCase()){case"commonjs":{s="node10";break}case"node16":case"node18":{s="node16";break}case"node20":{s="node16";break}case"nodenext":{s="nodenext";break}case"preserve":{s="bundler";break}}s!=="classic"&&(e.compilerOptions.moduleResolution=s)}if(e.compilerOptions.moduleResolution==="bundler"&&(e.compilerOptions.resolveJsonModule??=!0),e.compilerOptions.module&&["node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.resolveJsonModule??=!0),(e.compilerOptions.esModuleInterop||e.compilerOptions.module==="system"||e.compilerOptions.moduleResolution==="bundler")&&e.compilerOptions.allowSyntheticDefaultImports===void 0&&(e.compilerOptions.allowSyntheticDefaultImports=!0),["5.7","5.8","5.9"].includes(String(o?.tscCompatible))&&e.compilerOptions.moduleResolution){let s=!1;["bundler","node16","nodenext"].includes(e.compilerOptions.moduleResolution.toLocaleLowerCase())&&(s=!0),e.compilerOptions.resolvePackageJsonExports===void 0&&s&&(e.compilerOptions.resolvePackageJsonExports=!0),e.compilerOptions.resolvePackageJsonImports===void 0&&s&&(e.compilerOptions.resolvePackageJsonImports=!0)}if(e.compilerOptions.target===void 0){let s="es5";switch(e.compilerOptions.module){case"node16":case"node18":{s="es2022";break}case"node20":{s="es2023";break}case"nodenext":{s="esnext";break}}s!=="es5"&&(e.compilerOptions.target=s)}e.compilerOptions.useDefineForClassFields===void 0&&e.compilerOptions.target&&Ee(e.compilerOptions.target)&&(e.compilerOptions.useDefineForClassFields=!0)}if(["5.6","5.7","5.8","5.9"].includes(String(o?.tscCompatible))&&e.compilerOptions.strict&&e.compilerOptions.strictBuiltinIteratorReturn===void 0&&(e.compilerOptions.strictBuiltinIteratorReturn=!0),["5.4","5.5","5.6","5.7","5.8","5.9"].includes(String(o?.tscCompatible))&&(e.compilerOptions.strict&&(e.compilerOptions.noImplicitAny=e.compilerOptions.noImplicitAny??!0,e.compilerOptions.noImplicitThis=e.compilerOptions.noImplicitThis??!0,e.compilerOptions.strictNullChecks=e.compilerOptions.strictNullChecks??!0,e.compilerOptions.strictFunctionTypes=e.compilerOptions.strictFunctionTypes??!0,e.compilerOptions.strictBindCallApply=e.compilerOptions.strictBindCallApply??!0,e.compilerOptions.strictPropertyInitialization=e.compilerOptions.strictPropertyInitialization??!0,e.compilerOptions.alwaysStrict=e.compilerOptions.alwaysStrict??!0),e.compilerOptions.strict&&e.compilerOptions.useUnknownInCatchVariables===void 0&&(e.compilerOptions.useUnknownInCatchVariables=!0),e.compilerOptions.isolatedModules&&(e.compilerOptions.preserveConstEnums=e.compilerOptions.preserveConstEnums??!0)),["6.0","7.0","true"].includes(String(o?.tscCompatible))){if(e.compilerOptions.moduleDetection===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.moduleDetection="force"),e.compilerOptions.moduleResolution===void 0&&e.compilerOptions.module){const s=e.compilerOptions.module.toLocaleLowerCase();s==="node16"||s==="node18"||s==="node20"?e.compilerOptions.moduleResolution="node16":s==="nodenext"&&(e.compilerOptions.moduleResolution="nodenext")}if(e.compilerOptions.useDefineForClassFields===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&e.compilerOptions.target&&!Ee(e.compilerOptions.target)&&(e.compilerOptions.useDefineForClassFields=!1),e.compilerOptions.isolatedModules&&e.compilerOptions.preserveConstEnums===void 0&&(e.compilerOptions.preserveConstEnums=!0),e.compilerOptions.resolveJsonModule===void 0){const s=e.compilerOptions.module,t=e.compilerOptions.moduleResolution?.toLocaleLowerCase();!(s!==void 0&&["node20","nodenext"].includes(s)||t==="bundler")&&t&&(e.compilerOptions.resolveJsonModule=!1)}if(e.compilerOptions.moduleResolution){const s=e.compilerOptions.moduleResolution.toLocaleLowerCase();["bundler","node16","nodenext"].includes(s)||(e.compilerOptions.resolvePackageJsonExports??=!1,e.compilerOptions.resolvePackageJsonImports??=!1)}}return e.compileOnSave===!1&&delete e.compileOnSave,e},eo=(e,o)=>{const s=e?.typescriptVersion;if(!(s===!1||s===void 0))return s==="auto"?Re(o):s},x="${configDir}",We=Symbol("implicitBaseUrl"),to=(e,o)=>{const s=S(e),t=Pe(s,o),r=I(s),n=eo(o,r);n&&t.compilerOptions&&Gt(t.compilerOptions,n);const{compilerOptions:i}=t;if(i){for(const a of Xt){const p=i[a];if(p){const f=Z(p,r);i[a]=f?G(z(r,f)):p}}for(const a of["rootDirs","typeRoots"]){const p=i[a];p&&(i[a]=p.map(f=>{const d=Z(f,r);return d?G(z(r,d)):f}))}const{paths:l}=i;if(l){const a=Object.keys(l);for(let p=0;p<a.length;p++){const f=a[p];l[f]=l[f].map(d=>Z(d,r)??d)}}}for(let l=0;l<fe.length;l++){const a=fe[l],p=t[a];p&&(t[a]=p.map(f=>Z(f,r)??f))}return Zt(t,o)};let oo;const ro=e=>(oo??=D(import.meta.url))(e),K=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,so=e=>{if(typeof K<"u"&&K.versions&&K.versions.node){const[o,s]=K.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return K.getBuiltinModule(e)}return ro(e)},{statSync:io}=so("node:fs"),no=new Map,me=new WeakMap,co="tsconfig.json",Me=e=>{try{return io(e).mtimeMs}catch{return 0}},lo=(e,o)=>{let s=String(o.typescriptVersion);return o.typescriptVersion==="auto"&&(s=`auto:${String(Re(I(e)))}`),`${e}::${String(o.tscCompatible)}::${s}`},ao=(e,o,s)=>{if(e.has(o)&&me.get(e)?.get(o)===Me(s))return e.get(o)},po=(e,o,s,t)=>{e.set(o,t);let r=me.get(e);r||(r=new Map,me.set(e,r)),r.set(o,Me(s))},uo=(e,o={})=>{const s=o.configFileName??co,t=o.configFileName===void 0;let r=te(s,{...e&&{cwd:e},type:"file"});if(!r&&t&&(r=te("jsconfig.json",{...e&&{cwd:e},type:"file"})),!r)throw new Le(t?`No such file or directory, for '${s}' or 'jsconfig.json' found.`:`No such file or directory, for '${s}' found.`);const n=o.cache&&typeof o.cache!="boolean"?o.cache:no,i=lo(r,o);if(o.cache){const a=ao(n,i,r);if(a)return a}const l={config:to(r,{tscCompatible:o.tscCompatible,typescriptVersion:o.typescriptVersion}),path:r};return o.cache&&po(n,i,r,l),l},fo=/\.[cm]?tsx?$/,mo=[".yaml",".yml",".toml",".jsonc",".json5",".txt"],Ve=/\.(?:ya?ml|toml|jsonc|json5|txt)$/,ho=e=>e.endsWith(".yaml")||e.endsWith(".yml")?lt(e):e.endsWith(".toml")?At(e):e.endsWith(".jsonc")?Ct(e,{allowTrailingComma:!0}):e.endsWith(".json5")?pt(e):Oe(e,"utf8"),he=e=>e===void 0?"undefined":e===null?"null":typeof e=="number"?Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":String(e):typeof e=="bigint"?`${e}n`:typeof e=="boolean"?String(e):typeof e=="string"?JSON.stringify(e):e instanceof Date?`new Date(${JSON.stringify(e.toISOString())})`:Array.isArray(e)?`[${e.map(o=>he(o)).join(",")}]`:typeof e=="object"?`{${Object.entries(e).map(([o,s])=>`${JSON.stringify(o)}:${he(s)}`).join(",")}}`:"null",pe=new Map,go=(e,o)=>e.startsWith(x)?w(o,e.slice(x.length)):e,Oo=e=>{if(pe.has(e))return pe.get(e);let o;try{const{config:s,path:t}=uo(e,{cache:!1}),r=I(t),n=s.compilerOptions,i=n?.paths??{};if(n!==void 0){const{baseUrl:l}=n;let a,p=!1;if(l===void 0){const f=n[We];a=typeof f=="string"?f:r}else p=!0,a=S(r,go(l,r));o={hasBaseUrl:p,paths:i,pathsBase:a}}}catch{o=void 0}return pe.set(e,o),o},Je=(e,o)=>{const s=Oo(o);if(s===void 0)return;const{hasBaseUrl:t,pathsBase:r}=s,n=i=>qe(i)??Ke(i);for(const[i,l]of Object.entries(s.paths)){const a=i.indexOf("*");if(a===-1){if(i===e)for(const d of l){const k=n(S(r,d));if(k!==void 0)return k}continue}const p=i.slice(0,a),f=i.slice(a+1);if(e.startsWith(p)&&e.endsWith(f)&&e.length>=p.length+f.length){const d=e.slice(p.length,e.length-f.length);for(const k of l){const O=k.replace("*",d),v=n(S(r,O));if(v!==void 0)return v}}}if(t){const i=n(S(r,e));if(i!==void 0)return i}};let $e=!1,ue=0,Se=!1,Ae=!1;const bo=()=>{Ae||(Ae=!0,process.setSourceMapsEnabled?.(!0))},yo=e=>{const o=e.indexOf("?");return o===-1?e:e.slice(0,o)},vo=e=>e.endsWith(".cts")?"commonjs":"module",Ie=[".ts",".tsx",".mts",".cts",".js",".mjs",".cjs",".json"],j=e=>{try{return Ne(e).isFile()}catch{return!1}},ko=e=>{try{return Ne(e).isDirectory()}catch{return!1}},Co=e=>{if(e.endsWith(".js"))return`${e.slice(0,-3)}.ts`;if(e.endsWith(".mjs"))return`${e.slice(0,-4)}.mts`;if(e.endsWith(".cjs"))return`${e.slice(0,-4)}.cts`},qe=e=>{if(j(e))return e;const o=Co(e);if(o!==void 0&&j(o))return o;for(const s of Ie)if(j(e+s))return e+s;if(ko(e))for(const s of Ie){const t=`${e}/index${s}`;if(j(t))return t}},Ke=e=>{if(j(e)&&Ve.test(e))return e;for(const o of mo)if(j(e+o))return e+o},Ge=()=>{bo();const{registerHooks:e}=de;return typeof e!="function"?!1:($e||(e({load(o,s,t){const r=yo(o);if(r.startsWith("file:")&&fo.test(r)){const n=Y(r),{code:i}=_e(n,Oe(n,"utf8"));return{format:vo(n),shortCircuit:!0,source:i}}if(r.startsWith("file:")&&Ve.test(r)){const n=Y(r),i=ho(n);return{format:"module",shortCircuit:!0,source:`export default ${he(i)};
|
|
8
|
+
`}}return t(o,s)},resolve(o,s,t){if((o.startsWith(".")||o.startsWith("/"))&&s.parentURL!==void 0){let r;try{r=new URL(o,s.parentURL)}catch{r=void 0}if(r?.protocol==="file:"){const n=Y(r),i=qe(n)??Ke(n);if(i!==void 0)return{shortCircuit:!0,url:ee(i).href}}}if(s.parentURL!==void 0&&!o.startsWith(".")&&!o.startsWith("/")&&!o.startsWith("#")&&!o.startsWith("node:")&&!de.isBuiltin?.(o)){let r;try{r=I(Y(s.parentURL))}catch{r=void 0}if(r!==void 0){const n=Je(o,r);if(n!==void 0)return{shortCircuit:!0,url:ee(n).href}}}return t(o,s)}}),$e=!0),!0)},wo=()=>Ge(),To=async e=>{if(ue+=1,Ge())return await import(`${ee(e).href}?v=${String(ue)}`);Se||(Se=!0,process.stderr.write(`vis: Node < 22.15 has no module.registerHooks — only the entry file is transpiled; local TypeScript imports won't load. Upgrade to Node >= 22.15 for full support.
|
|
9
|
+
`));const{code:o}=_e(e,Oe(e,"utf8")),s=w(I(e),`.vis-ts-${String(ue)}-${String(process.pid)}.mjs`);Ze(s,o);try{return await import(ee(s).href)}finally{try{et(s)}catch{}}},Io=Object.defineProperty({__proto__:null,importTs:To,registerTsHooks:wo,resolveTsConfigPaths:Je},Symbol.toStringTag,{value:"Module"});export{To as i,At as m,wo as r,Io as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p}from"./cli-main.js";import{A as b}from"../packem_shared/pm-runner-
|
|
2
|
-
`),n.status==="fail"&&(process.exitCode=1);return}const[c,...l]=P(n);if(n.status==="skipped"){p.info(c);return}if(n.status==="pass"){p.success(c);return}p.error(c);for(const f of l)p.error(f);process.exitCode=1};export{
|
|
1
|
+
import{p}from"./cli-main.js";import{A as b}from"../packem_shared/pm-runner-C6eTANt1.js";import{r as y,l as w,L as $}from"../packem_shared/dependency-scan-D_ona0Qm.js";import{z as v,w as m,l as C}from"../packem_shared/index-uBVnF4ji.js";import{D as S}from"../packem_shared/package-version-C47v64aB.js";import"../packem_shared/public-api-WqUCiyIe.js";import{e as x}from"../packem_shared/index-CTMU29dI.js";const M=e=>{const s=e.trim();return s===""?!1:/^(?:git\+|git:\/\/|git@|ssh:\/\/)/i.test(s)||/^(?:github|gitlab|bitbucket|gist):/i.test(s)||/^[\w.-]+\/[\w.-]+(?:#.+)?$/.test(s)&&!s.includes("@")?!0:/^https?:\/\//i.test(s)},L=(e,s)=>{for(const t of s)if(t===e||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},D=(e,s,t={})=>{const o=y(e,s);if(!o)return[];let i;try{i=v(m(e,o.file))}catch{return[]}const n=S(i,o.type);if(n.length===0)return[];const c=t.allow??[],l=[],f=new Set;for(const r of n){const a=`${r.name}@${r.version}`;for(const d of[r.dependencies,r.optionalDependencies])if(d){for(const[u,h]of Object.entries(d))if(!L(u,c))for(const k of h){if(!M(k))continue;const g=`${a}->${u}@${k}`;f.has(g)||(f.add(g),l.push({declaredBy:a,packageName:u,source:k}))}}}return l.sort((r,a)=>r.packageName.localeCompare(a.packageName)||r.declaredBy.localeCompare(a.declaredBy))},E=new Set(["firstSeen","publisherChange"]),N=e=>e.severity==="block"&&e.acceptedRisk===void 0,R=e=>{const s=e.security?.policies?.firstSeen?.minutes,t=typeof s=="number"&&s>0,o=e.security?.policies?.publisherChange?.mode==="no-downgrade",i=e.security?.blockExoticSubdeps===!0;return t||o||i},V=async e=>{const{offline:s=!1,packageManager:t,visConfig:o,workspaceRoot:i}=e,n=Date.now();if(!R(o))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!1,status:"skipped"};const c=y(i,t);if(!c||!C(m(i,c.file)))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!0,status:"fail"};const l=w(i,t,{includeDev:!0}),f=l.length,r=await x({offline:s,packageManager:t,packages:l,workspaceRoot:i},"install",{enabledPolicies:new Set(E),visConfig:o}),a=o.security?.blockExoticSubdeps===!0?D(i,t,{allow:o.security.exoticSubdepsAllow}):[],d=r.some(u=>N(u))||a.length>0;return{decisions:r,durationMs:Date.now()-n,entryCount:f,exoticViolations:a,lockfileMissing:!1,status:d?"fail":"pass"}},B=e=>e<1e3?`${String(e)}ms`:`${(e/1e3).toFixed(1)}s`,P=e=>{if(e.status==="skipped")return["– Lockfile supply-chain verification skipped (no firstSeen / publisherChange / blockExoticSubdeps policy configured)"];if(e.lockfileMissing)return["✗ Lockfile supply-chain verification failed — no lockfile found, the resolved closure cannot be attested"];const s=`(${String(e.entryCount)} ${e.entryCount===1?"entry":"entries"}, ${B(e.durationMs)})`;if(e.status==="pass")return[`✓ Lockfile passes supply-chain policies ${s}`];const t=[`✗ Lockfile failed supply-chain policy check ${s}`];for(const o of e.decisions)o.severity==="block"&&o.acceptedRisk===void 0&&t.push(` [${o.policy}] ${o.reason}`);for(const o of e.exoticViolations)t.push(` [blockExoticSubdeps] ${o.packageName} pulled from exotic source by ${o.declaredBy}: ${o.source}`);return t},J=async({options:e,visConfig:s,workspaceRoot:t})=>{const o=t??process.cwd(),i=b(o);if(!$[i.name]){p.warn(`Package manager '${i.name}' has no lockfile vis can verify.`);return}const n=await V({offline:!!e.offline,packageManager:i.name,visConfig:s??{},workspaceRoot:o});if(e.json){process.stdout.write(`${JSON.stringify(n,void 0,2)}
|
|
2
|
+
`),n.status==="fail"&&(process.exitCode=1);return}const[c,...l]=P(n);if(n.status==="skipped"){p.info(c);return}if(n.status==="pass"){p.success(c);return}p.error(c);for(const f of l)p.error(f);process.exitCode=1};export{J as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`)},
|
|
1
|
+
import{createRequire as p}from"node:module";import _ from"./index.js";import{normaliseGroup as C}from"../release/types.js";import{d as v}from"./registry.js";import{resolveFormatter as j}from"./resolveFormatter.js";let u;const d=o=>(u??=p(import.meta.url))(o),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=o=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[n,t]=l.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return l.getBuiltinModule(o)}return d(o)},{readFile:f,writeFile:w}=m("node:fs/promises"),k="## Release wave {date} ({count} packages)",$=async(o,n,t,s={})=>{const r=s.renderer??t,e=[(s.waveHeading??k).replaceAll("{date}",n).replaceAll("{count}",String(o.length)),""];for(const a of o){e.push(`### ${a.name} → ${a.newVersion}`),e.push("");const i={changeFiles:a.changeFiles,date:n,release:a,target:"github-release"},c=await r(i);c.trim()?e.push(c.trim()):e.push("_No changelog entries._"),e.push("")}return e.join(`
|
|
2
|
+
`)},y=(o,n={})=>{const t=n.file??"CHANGELOG.md";return t.startsWith("/")?t:`${o}/${t}`},G=/[!()*+?@[\]{|}]/,b=(o,n)=>{const t=[],s=new Set;for(const r of o)if(G.test(r))for(const e of n)!s.has(e.name)&&_(r,e.name)&&(s.add(e.name),t.push(e));else{const e=n.find(a=>a.name===r);e&&!s.has(e.name)&&(s.add(e.name),t.push(e))}return t},N=(o,n,t)=>{const s=new Map,r=[...o.fixed??[],...o.linked??[]];for(const e of r){const a=C(e);if(a.changelog.mode!=="shared")continue;const i=b(a.packages,n);if(i.length===0)continue;let c;a.changelog.path?c=a.changelog.path.startsWith("/")?a.changelog.path:`${t}/${a.changelog.path}`:c=`${[...i].sort((g,h)=>g.name.localeCompare(h.name))[0].dir}/GROUP-CHANGELOG.md`;for(const g of i)s.has(g.name)||s.set(g.name,c)}return s},O=async(o,n)=>{if(n.length===0)return;const t=o.workspaceChangelog,s=typeof t=="object"?t:void 0,r=await j(o.changelogConfig,o.cwd),e=new Date().toISOString().slice(0,10),a=await $(n,e,r,s),i=y(o.cwd,s),c=await f(i,"utf8").catch(()=>{});return await w(i,v(a,c)),i};export{$ as renderWorkspaceChangelog,N as resolveGroupChangelogRouting,y as workspaceChangelogPath,O as writeWorkspaceChangelogWave};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as R}from"node:module";import{F as M}from"./target-merge-Cfy7c__2.js";import{advisoriesQuery as j,advisoriesIngest as q,advisoriesStatus as _,NATIVE_BINDING_VERSION as f}from"#native";let D;const I=s=>(D??=R(import.meta.url))(s),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=s=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[e,t]=l.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return l.getBuiltinModule(s)}return I(s)},{randomUUID:$}=c("node:crypto"),{existsSync:T,createWriteStream:O}=c("node:fs"),{mkdir:P,unlink:U,stat:k}=c("node:fs/promises"),{join:g,dirname:x}=c("node:path"),{Readable:C}=c("node:stream"),{pipeline:L}=c("node:stream/promises"),w=6;if(f!==w)throw new Error(`vis native binding ABI mismatch in advisories: expected ${w}, got ${f}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const J="https://osv-vulnerabilities.storage.googleapis.com",W=new Set(["osv-vulnerabilities.storage.googleapis.com"]);class B extends Error{cause="DB_NOT_FOUND";constructor(e){super(`No local advisory DB at ${e}. Run 'vis advisories sync' first.`),this.name="AdvisoryDbNotFoundError"}}class p extends Error{cause="SOURCE_NOT_ALLOWED";constructor(e){super(`Advisory source host '${e}' is not in the built-in allowlist. Add it to \`security.audit.advisories.allowedHosts\` if intentional.`),this.name="AdvisorySourceNotAllowedError"}}class A extends Error{cause="SYNC_NETWORK";constructor(e,t){super(`Advisory sync failed for ${e}: ${t}. Check connectivity, proxy env vars, or --source.`),this.name="AdvisorySyncNetworkError"}}const y=s=>{const e=M("vis",{create:!0,cwd:s})??g(s,"node_modules",".cache","vis");return g(e,"advisories","db.sqlite")},F=(s,e)=>{let t;try{t=new URL(s)}catch{throw new p(s)}if(t.protocol!=="https:")throw new p(`${t.protocol}//${t.host}`);if(!new Set([...W,...e??[]]).has(t.host))throw new p(t.host);return t},X=async s=>{const e=s.dbPath??y(s.workspaceRoot);await P(x(e),{recursive:!0});const t=F(s.source,s.allowedHosts),d=new URL(`${s.ecosystem}/all.zip`,G(t.toString())),u=await V(e,s.ecosystem);let r=null;if(!s.force){const i=await b(d,{method:"HEAD"});if(i.ok&&(r=i.headers.get("etag"),r&&u&&r===u))return{advisoriesIngested:0,dbPath:e,durationMs:0,upToDate:!0}}const n=`${e}.${s.ecosystem}.${process.pid}.${$()}.zip.tmp`,o=await b(d,{method:"GET"});if(!o.ok||!o.body)throw new A(d.toString(),o.status);r||(r=o.headers.get("etag"));const v=o.headers.get("content-length"),a=v?Number.parseInt(v,10):null;let m=0;const E=O(n),h=C.fromWeb(o.body);s.onProgress&&a&&h.on("data",i=>{m+=i.byteLength,s.onProgress?.(m,a,"download")}),await L(h,E);try{const i=await q({dbPath:e,ecosystem:s.ecosystem,manifestEtag:r??void 0,zipPath:n},(S,N)=>s.onProgress?.(S,N,"ingest"));return{advisoriesIngested:i.advisoriesIngested,dbPath:e,durationMs:i.durationMs,upToDate:!1}}finally{await U(n).catch(()=>{})}},Z=(s,e)=>{if(s.length===0)return new Map;const t=e.dbPath??y(e.workspaceRoot),d=e.ecosystem??"npm";if(!T(t))throw new B(t);const u=s.map(o=>({ecosystem:d,name:o.name,version:o.version})),r=j(t,u),n=new Map;for(const[o,v]of s.entries()){const a=r[o];!a||a.vulnerabilities.length===0||n.set(v.name,a.vulnerabilities.map(m=>H(m)))}return n},ss=async(s,e)=>{const t=e??y(s);return _(t)},V=async(s,e)=>{try{await k(s)}catch{return null}return _(s).ecosystems.find(t=>t.name===e)?.manifestEtag??null},H=s=>({aliases:s.aliases.length>0?s.aliases:void 0,cvssScore:s.cvssScore??void 0,fixedVersions:s.fixedVersions,id:s.id,severity:z(s.severity),summary:s.summary}),z=s=>{const e=s.toUpperCase();return e==="CRITICAL"||e==="HIGH"||e==="MODERATE"||e==="LOW"?e:"UNKNOWN"},G=s=>s.endsWith("/")?s:`${s}/`,b=async(s,e)=>{try{return await fetch(s,e)}catch(t){throw new A(s.toString(),t instanceof Error?t.message:String(t))}};export{B as A,J as D,ss as g,Z as q,y as r,X as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as k}from"node:module";import{getAffectedProjects as P}from"@visulima/task-runner";import{I as S}from"./index-BWl4DbMp.js";import{a as w}from"./vis-user-error-xmha3L4n.js";import{r as q}from"./affected-shas-PwkVbPch.js";let y;const R=e=>(y??=k(import.meta.url))(e),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,C=e=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[t,o]=p.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return p.getBuiltinModule(e)}return R(e)},{spawnSync:A}=C("node:child_process"),_=new Set(["deep","direct","none"]),B=e=>{const t=[],o=e.split("\0");for(let s=0;s<o.length;s++){const r=o[s];if(!r||r.length<4)continue;const f=r.slice(0,2),u=r.slice(3);if(u&&t.push(u),f.includes("R")||f.includes("C")){s+=1;const a=o[s];a&&t.push(a)}}return t},I=e=>{const t=A("git",["status","--porcelain","-z"],{cwd:e,encoding:"utf8"});return t.error||t.status!==0||typeof t.stdout!="string"?[]:B(t.stdout)},W=async(e,t,o={})=>{const s=e.downstream??"deep",r=e.upstream??"none";if(!_.has(s))throw new w(`Invalid --downstream value: "${s}". Must be "none", "direct", or "deep".`);if(!_.has(r))throw new w(`Invalid --upstream value: "${r}". Must be "none", "direct", or "deep".`);const{projectGraph:f,projects:u,workspaceRoot:a}=t,l=[];let{base:m}=e,{head:n}=e;if(!m||!n){const i=q({defaultBase:o.defaultBase,workspaceRoot:a});m=m||i.base,n=n||i.head,l.push(`Resolved affected refs from ${i.provider} (${i.notes.join("; ")})`)}const v=o.runningInCi??S,h=n==="HEAD"||n==="",b=e.uncommitted??(!v&&h);let d=[];if(b)if(h){const i=(o.readWorkingTreeChanges??I)(a),$=Object.values(u).map(c=>c.root?.replace(/\/$/,"")).filter(c=>!!c&&c!==".");d=i.filter(c=>$.some(j=>c===j||c.startsWith(`${j}/`)));const g=i.length-d.length;d.length>0&&l.push(`including ${d.length} uncommitted working-tree file(s)`),g>0&&l.push(`ignoring ${g} uncommitted path(s) outside any project (untracked scratch would otherwise mark every project affected)`)}else l.push(`ignoring --uncommitted: --head=${n} pins the comparison to a commit, not the working tree`);return{...await P({additionalChangedFiles:d,base:m,downstream:s,head:n,projectGraph:f,projects:u,upstream:r,workspaceRoot:a}),notes:l,uncommittedFileCount:d.length}};export{W as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as l}from"node:module";import{l as h,z as b}from"./index-uBVnF4ji.js";let E;const d=e=>(E??=l(import.meta.url))(e),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,p=e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[s,r]=_.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return _.getBuiltinModule(e)}return d(e)},{spawnSync:g}=p("node:child_process"),A="0000000000000000000000000000000000000000",I=e=>{if(h(e))try{const s=b(e);return JSON.parse(s)}catch{return}},f=(e,s)=>{const r=g("git",e,{cwd:s,encoding:"utf8"});if(!(r.error||typeof r.status!="number"||r.status!==0))return typeof r.stdout=="string"?r.stdout.trim():void 0},c=e=>typeof e=="string"&&e.length>0&&e!==A,R=(e,s,r)=>{const t=[],o=e.GITHUB_BASE_REF,i=e.GITHUB_SHA??"HEAD";if(o&&o.length>0)return t.push(`pull_request: $GITHUB_BASE_REF=${o}`),{base:`origin/${o}`,head:i,notes:t,provider:"github"};const a=e.GITHUB_EVENT_PATH,n=a?r(a):void 0;if(n){const u=typeof n.before=="string"?n.before:void 0;if(c(u))return t.push(`push: event.before=${u}`),{base:u,head:i,notes:t,provider:"github"}}return t.push(`fallback: origin/${s}`),{base:`origin/${s}`,head:i,notes:t,provider:"github"}},C=(e,s)=>{const r=[],t=e.CI_COMMIT_SHA??"HEAD";if(e.CI_PIPELINE_SOURCE==="merge_request_event"){const a=e.CI_MERGE_REQUEST_DIFF_BASE_SHA;if(c(a))return r.push(`merge_request: $CI_MERGE_REQUEST_DIFF_BASE_SHA=${a}`),{base:a,head:t,notes:r,provider:"gitlab"};const n=e.CI_MERGE_REQUEST_TARGET_BRANCH_NAME;if(n&&n.length>0)return r.push(`merge_request: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME=${n}`),{base:`origin/${n}`,head:t,notes:r,provider:"gitlab"}}const o=e.CI_COMMIT_BEFORE_SHA;if(c(o))return r.push(`push: $CI_COMMIT_BEFORE_SHA=${o}`),{base:o,head:t,notes:r,provider:"gitlab"};const i=e.CI_DEFAULT_BRANCH??s;return r.push(`fallback: origin/${i}`),{base:`origin/${i}`,head:t,notes:r,provider:"gitlab"}},T=(e,s)=>{const r=[],t=e.BUILDKITE_COMMIT??"HEAD",o=e.BUILDKITE_PULL_REQUEST_BASE_BRANCH;return o&&o.length>0?(r.push(`pull_request: $BUILDKITE_PULL_REQUEST_BASE_BRANCH=${o}`),{base:`origin/${o}`,head:t,notes:r,provider:"buildkite"}):(r.push(`fallback: origin/${s} (buildkite has no canonical previous-build SHA env)`),{base:`origin/${s}`,head:t,notes:r,provider:"buildkite"})},v=(e,s)=>{const r=[],t=e.CIRCLE_SHA1??"HEAD",o=e.CIRCLE_PR_BASE_BRANCH;return o&&o.length>0?(r.push(`pull_request: $CIRCLE_PR_BASE_BRANCH=${o}`),{base:`origin/${o}`,head:t,notes:r,provider:"circleci"}):(r.push(`fallback: origin/${s} (circleci has no canonical previous-build SHA env)`),{base:`origin/${s}`,head:t,notes:r,provider:"circleci"})},B=(e,s,r)=>{const t=[],o=s(["merge-base","HEAD",`origin/${e}`],r);return o&&o.length>0?(t.push(`local: git merge-base HEAD origin/${e}=${o}`),{base:o,head:"HEAD",notes:t,provider:"local"}):(t.push(`local fallback: origin/${e} (no merge-base available)`),{base:`origin/${e}`,head:"HEAD",notes:t,provider:"local"})},S=e=>{const s=e?.env??process.env,r=e?.defaultBase??"main",t=e?.readEventPayload??I,o=e?.runGit??f,i=e?.workspaceRoot??process.cwd();return s.GITHUB_ACTIONS==="true"?R(s,r,t):s.GITLAB_CI==="true"?C(s,r):s.BUILDKITE==="true"?T(s,r):s.CIRCLECI==="true"?v(s,r):B(r,o,i)};export{S as r};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import{createRequire as te}from"node:module";import{h as oe,R as v,m as se,i as E}from"../packem_chunks/catalog.js";import"./en-D3CfXlO7.js";import{Table as ce}from"@visulima/tui-kit/table";import{U as de,V as le,W as ue,X as pe}from"../packem_chunks/cli-main.js";let ae;const ne=e=>(ae??=te(import.meta.url))(e),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[a,t]=_.versions.node.split(".").map(Number);if(a>22||a===22&&t>=3||a===20&&t>=16)return _.getBuiltinModule(e)}return ne(e)},{execFile:V,spawn:re,execFileSync:U}=k("node:child_process"),{existsSync:G}=k("node:fs"),{platform:ie,homedir:B}=k("node:os"),{join:g}=k("node:path"),{StringDecoder:j}=k("node:string_decoder"),{promisify:F}=k("node:util"),me=/v?(\d+\.\d+\.\d+(?:-[\w.]+)?)/,fe=5e3,ge=1e4,he=3e5,be=4096,O=ie()==="win32",W=["amp","claude","codex","copilot","crush","cursor","droid","gemini","kimi","opencode","qwen"],ve={alternateCommands:[],buildArgs:(e,{dangerous:a})=>{const t=["-x",e];return a&&t.push("--dangerously-allow-all"),t},command:"amp",defaultModel:"",displayName:"Amp",envVariable:"AMP_PATH",sessionMarkers:[{confidence:"definite",variable:"AMP_CURRENT_THREAD_ID"},{confidence:"definite",equals:"amp",variable:"AGENT"}],supportsMaxTokens:!1,supportsModel:!1},ye={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const n=[];return a&&n.push("--dangerously-skip-permissions"),t&&n.push("--model",t),n.push("--output-format","text","-p",e),n},command:"claude",defaultModel:"",displayName:"Claude Code",envVariable:"CLAUDE_PATH",sessionMarkers:[{confidence:"definite",variable:"CLAUDECODE"},{confidence:"definite",variable:"CLAUDE_CODE"}],supportsMaxTokens:!1,supportsModel:!0},Ee={alternateCommands:["openai-codex"],buildArgs:(e,{dangerous:a,model:t})=>{const n=["exec"];return t&&n.push("--model",t),a&&n.push("--dangerously-bypass-approvals-and-sandbox"),n.push("--",e),n},command:"codex",defaultModel:"",displayName:"Codex",envVariable:"CODEX_PATH",sessionMarkers:[{confidence:"definite",variable:"CODEX_SANDBOX"},{confidence:"definite",variable:"CODEX_THREAD_ID"},{confidence:"definite",variable:"CODEX_CI"}],supportsMaxTokens:!1,supportsModel:!0},Ae={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const n=["-p",e];return a&&n.push("--allow-all-tools"),t&&n.push("--model",t),n},command:"copilot",defaultModel:"",displayName:"GitHub Copilot CLI",envVariable:"COPILOT_PATH",sessionMarkers:[{confidence:"definite",variable:"COPILOT_MODEL"},{confidence:"definite",variable:"COPILOT_ALLOW_ALL"},{confidence:"definite",variable:"COPILOT_GITHUB_TOKEN"},{agent:"GitHub Copilot in VS Code",confidence:"definite",label:"TERM_PROGRAM+GIT_PAGER",match:{all:[["TERM_PROGRAM","vscode"],["GIT_PAGER","cat"]],none:["CURSOR_TRACE_ID"]}}],supportsMaxTokens:!1,supportsModel:!0},ke={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const n=["run"];return a&&n.push("--yolo"),t&&n.push("-m",t),n.push("--",e),n},command:"crush",defaultModel:"",displayName:"Crush",envVariable:"CRUSH_PATH",sessionMarkers:[{confidence:"definite",equals:"1",variable:"CRUSH"},{confidence:"definite",equals:"crush",variable:"AGENT"}],supportsMaxTokens:!1,supportsModel:!0},Re={alternateCommands:["cursor"],buildArgs:(e,{dangerous:a,model:t})=>{const n=["-p"];return a&&n.push("--force"),n.push("--output-format","text"),t&&n.push("--model",t),n.push("--",e),n},command:"agent",defaultModel:"",displayName:"Cursor Agent",envVariable:"CURSOR_PATH",sessionMarkers:[{confidence:"definite",variable:"CURSOR_AGENT"},{confidence:"definite",label:"CURSOR_TRACE_ID+PAGER",match:{all:["CURSOR_TRACE_ID",["PAGER","head -n 10000 | cat"]]}},{agent:"Cursor editor",confidence:"ambient",variable:"CURSOR_TRACE_ID"}],supportsMaxTokens:!1,supportsModel:!0},_e={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const n=[];return a&&n.push("--skip-permissions-unsafe"),n.push("-o","text"),t&&n.push("-m",t),n.push("--",e),n},command:"droid",defaultModel:"",displayName:"Droid",envVariable:"DROID_PATH",sessionMarkers:[],supportsMaxTokens:!1,supportsModel:!0},we={alternateCommands:["gemini-cli"],buildArgs:(e,{dangerous:a,maxTokens:t,model:n})=>{const r=[];return a||r.push("--sandbox"),n&&r.push("--model",n),r.push("--max-output-tokens",String(t),"-p",e),r},command:"gemini",defaultModel:"gemini-2.5-pro",displayName:"Gemini CLI",envVariable:"GEMINI_PATH",sessionMarkers:[{confidence:"definite",label:"GEMINI_CLI",match:{all:["GEMINI_CLI"],none:["QWEN_CODE"]}}],supportsMaxTokens:!0,supportsModel:!0},Me={alternateCommands:[],buildArgs:(e,{model:a})=>{const t=["--quiet","-p",e];return a&&t.push("-m",a),t},command:"kimi",defaultModel:"",displayName:"Kimi CLI",envVariable:"KIMI_PATH",sessionMarkers:[],supportsMaxTokens:!1,supportsModel:!0},Ce={alternateCommands:[],buildArgs:(e,{model:a})=>{const t=["run"];return a&&t.push("-m",a),t.push("--",e),t},command:"opencode",defaultModel:"",displayName:"opencode",envVariable:"OPENCODE_PATH",sessionMarkers:[{confidence:"definite",label:"OPENCODE",match:{any:["OPENCODE","OPENCODE_BIN_PATH","OPENCODE_SERVER","OPENCODE_APP_INFO","OPENCODE_MODES","OPENCODE_CLIENT"]}}],supportsMaxTokens:!1,supportsModel:!0},Te={alternateCommands:["qwen-code"],buildArgs:(e,{dangerous:a,model:t})=>{const n=["-p",e];return a&&n.push("--yolo"),n.push("-o","text"),t&&n.push("-m",t),n},command:"qwen",defaultModel:"",displayName:"Qwen Code",envVariable:"QWEN_PATH",sessionMarkers:[{confidence:"definite",equals:"1",variable:"QWEN_CODE"}],supportsMaxTokens:!1,supportsModel:!0},T={amp:ve,claude:ye,codex:Ee,copilot:Ae,crush:ke,cursor:Re,droid:_e,gemini:we,kimi:Me,opencode:Ce,qwen:Te};class A extends Error{exitCode;durationMs;provider;stderr;stdout;timedOut;aborted;constructor(a,t){super(a),this.name="AiRunError",this.provider=t.provider,this.exitCode=t.exitCode??null,this.durationMs=t.durationMs,this.stdout=t.stdout??"",this.stderr=t.stderr??"",this.timedOut=t.timedOut??!1,this.aborted=t.aborted??!1}}F(V);const Oe=[{agent:"Cline",confidence:"definite",variable:"CLINE_ACTIVE"},{agent:"Aider",confidence:"definite",label:"OR_APP_NAME|AIDER_API_KEY",match:{any:[["OR_APP_NAME","Aider"],"AIDER_API_KEY"]}},{agent:"Antigravity",confidence:"definite",label:"ANTIGRAVITY_AGENT",match:{any:["ANTIGRAVITY_AGENT","ANTIGRAVITY_PROJECT_ID"]}},{agent:"Augment",confidence:"definite",variable:"AUGMENT_AGENT"},{agent:"Windsurf",confidence:"definite",variable:"CODEIUM_EDITOR_APP_ROOT"},{agent:"Warp",confidence:"definite",variable:"OZ_RUN_ID"},{agent:"Pi",confidence:"definite",equals:"true",variable:"PI_CODING_AGENT"},{agent:"Jules",confidence:"definite",label:"HOME+USER",match:{all:[["HOME","/home/jules"],["USER","swebot"]]}},{agent:"Replit Agent",confidence:"definite",variable:"REPLIT_CLI"},{agent:"Replit Assistant",confidence:"definite",label:"REPL_ID+REPLIT_MODE",match:{all:["REPL_ID",["REPLIT_MODE","assistant"]]}},{agent:"Bolt.new",confidence:"definite",label:"SHELL+npm_config_yes",match:{all:[["SHELL","/bin/jsh"],"npm_config_yes"]}},{agent:"Zed",confidence:"definite",label:"TERM_PROGRAM+PAGER",match:{all:[["TERM_PROGRAM","zed"],["PAGER","cat"]]}},{agent:"Replit workspace",confidence:"ambient",label:"REPL_ID",match:{all:["REPL_ID"],none:[["REPLIT_MODE","assistant"]]}},{agent:"Bolt.new editor",confidence:"ambient",label:"SHELL",match:{all:[["SHELL","/bin/jsh"]],none:["npm_config_yes"]}},{agent:"Zed editor",confidence:"ambient",label:"TERM_PROGRAM",match:{all:[["TERM_PROGRAM","zed"]],none:[["PAGER","cat"]]}}],Ie={ambient:"interactive",definite:"agent"},K=(e,a,t)=>{const n={agent:e.agent??a,confidence:e.confidence,provider:t,type:e.type??Ie[e.confidence]};return"match"in e?{...n,label:e.label,match:e.match}:{...n,label:e.variable,match:e.equals===void 0?e.variable:[e.variable,e.equals]}},Se=(e,a)=>a.sessionMarkers.map(t=>K(t,a.displayName,e));[...Object.keys(T).flatMap(e=>Se(e,T[e])),...Oe.map(e=>K(e,e.agent,e.provider))].toSorted((e,a)=>e.confidence===a.confidence?0:e.confidence==="definite"?-1:1);F(V);const Pe=/\.(?:bat|cmd)$/i,J=e=>O&&Pe.test(e),P=e=>`"${e.replaceAll('"','""')}"`,q=e=>e==="~"||e.startsWith("~/")||O&&e.startsWith("~\\")?g(B(),e.slice(2)):e,Ne=e=>{try{const a=U(O?"where":"which",[e],{encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:fe}).trim().split(`
|
|
2
|
+
`)[0]?.trim();return a&&a.length>0?a:void 0}catch{return}},$e=e=>{const a=B();if(O){const t=process.env.APPDATA??"",n=process.env.LOCALAPPDATA??"",r=process.env.ProgramFiles??"";return[g(t,"npm",`${e}.cmd`),g(t,"npm",e),g(n,"Programs",e,`${e}.exe`),g(r,e,`${e}.exe`),g(a,".npm-global","bin",`${e}.cmd`)]}return[`/opt/homebrew/bin/${e}`,`/usr/local/bin/${e}`,g(a,".npm-global","bin",e),g(a,".local","bin",e),g(a,".cargo","bin",e)]},Le=e=>{try{const a=J(e),t=U(a?P(e):e,["--version"],{encoding:"utf8",shell:a,stdio:["pipe","pipe","pipe"],timeout:ge}),n=me.exec(t);return n?n[1]:void 0}catch{return}},Y=(e,a={})=>{const t=T[e],n={available:!1,name:e},r=a.version!==!1,i=s=>{if(r)return Le(s)},o=process.env[t.envVariable];if(o&&G(q(o))){const s=q(o);return{...n,available:!0,detectionMethod:"envvar",path:s,version:i(s)}}const d=[t.command,...t.alternateCommands];for(const s of d){const c=Ne(s);if(c)return{...n,available:!0,detectionMethod:"which",path:c,version:i(c)}}for(const s of d)for(const c of $e(s))if(G(c))return{...n,available:!0,detectionMethod:"known-path",path:c,version:i(c)};return n},De=(e={})=>W.map(a=>Y(a,e)),xe=(e={})=>De(e).filter(a=>a.available),Ge=(e,a,t={})=>{const n=T[e],r=t.model??n.defaultModel,i=t.maxTokens!==void 0&&Number.isFinite(t.maxTokens)?t.maxTokens:be;return n.buildArgs(a,{dangerous:t.dangerous===!0,maxTokens:i,model:r})},je=async(e,a,t={})=>{if(!e.available||!e.path)throw new A(`AI provider "${e.name}" is not available.`,{durationMs:0,provider:e.name});const n=Ge(e.name,a,t),r=t.timeoutMs!==void 0&&Number.isFinite(t.timeoutMs)?t.timeoutMs:he,i=e.path,o=J(i),d=Date.now();if(t.signal?.aborted)throw new A(`${e.name} CLI run was aborted.`,{aborted:!0,durationMs:0,provider:e.name});return new Promise((s,c)=>{const m={cwd:t.cwd,env:{...process.env,...t.env,FORCE_COLOR:"0",NO_COLOR:"1"},shell:o,stdio:["pipe","pipe","pipe"]},p=o?n.map(l=>P(l)):n,f=re(o?P(i):i,p,m);f.stdin?.end();let h="",b="",y=!1;const N=new j("utf8"),$=new j("utf8");let w,L,M;const I=()=>{clearTimeout(L),M&&t.signal?.removeEventListener("abort",M)},ee=()=>{f.kill("SIGKILL")},D=l=>{if(y)return;y=!0,f.kill("SIGTERM"),w=setTimeout(ee,5e3),w.unref(),I();const u=Date.now()-d,R=l?new A(`${e.name} CLI run was aborted.`,{aborted:!0,durationMs:u,provider:e.name,stderr:b,stdout:h}):new A(`${e.name} CLI timed out after ${String(r)}ms`,{durationMs:u,provider:e.name,stderr:b,stdout:h,timedOut:!0});c(R)};L=setTimeout(D,r,!1),M=()=>{D(!0)},t.signal?.addEventListener("abort",M,{once:!0}),f.stdout?.on("data",l=>{const u=N.write(l);u&&(h+=u,t.onStdout?.(u))}),f.stderr?.on("data",l=>{const u=$.write(l);u&&(b+=u,t.onStderr?.(u))}),f.on("close",l=>{clearTimeout(w);const u=N.end();u&&(h+=u,t.onStdout?.(u));const R=$.end();if(R&&(b+=R,t.onStderr?.(R)),y)return;y=!0,I();const x=Date.now()-d;l===0?s({durationMs:x,exitCode:l,provider:e.name,stderr:b,stdout:h}):c(new A(`${e.name} CLI exited with code ${String(l)}: ${b||h}`,{durationMs:x,exitCode:l,provider:e.name,stderr:b,stdout:h}))}),f.on("error",l=>{clearTimeout(w),!y&&(y=!0,I(),c(new A(`Failed to spawn ${e.name} CLI: ${l.message}`,{durationMs:Date.now()-d,provider:e.name,stderr:b,stdout:h})))})})},qe=12e4,He=2,Ve=1e3,Ue=e=>new Promise(a=>{setTimeout(a,e)}),z=async(e,a,t=He)=>{let n;for(let r=0;r<=t;r+=1)try{return(await je(e,a,{timeoutMs:qe})).stdout}catch(i){if(n=i instanceof Error?i:new Error(String(i)),n.message.includes("timed out"))throw n;if(r<t){const o=Ve*2**r;await Ue(o)}}throw n??new Error("AI request failed after retries")},Be={amp:30,claude:80,codex:60,copilot:50,crush:35,cursor:40,droid:20,gemini:100,kimi:25,opencode:35,qwen:30},Fe=e=>{if(e?.provider){if(!W.includes(e.provider))return;const n=Y(e.provider);return n.available?n:void 0}const a=xe();if(a.length===0)return;const t={...Be,...e?.priority};return a.toSorted((n,r)=>(t[r.name]??0)-(t[n.name]??0))[0]},We=new Set(["defer","review","skip","update"]),Ke=new Set(["critical","high","low","medium"]),Je=new Set(["high","low","medium"]),Ye=50,S=30,ze=e=>e.map(a=>{const t=a.vulnerabilities&&a.vulnerabilities.length>0?` [VULNERABILITIES: ${a.vulnerabilities.map(r=>`${r.severity} ${r.id}`).join(", ")}]`:"";let n="";if(a.socketReport){const r=Math.round(a.socketReport.score.overall*100),i=[`score:${String(r)}%`];if(a.socketReport.alerts.length>0){const o={};for(const s of a.socketReport.alerts)o[s.severity]=(o[s.severity]??0)+1;const d=Object.entries(o).map(([s,c])=>`${String(c)} ${s}`).join(", ");i.push(`alerts: ${d}`)}i.push(`supply-chain:${String(Math.round(a.socketReport.score.supplyChain*100))}%`),i.push(`quality:${String(Math.round(a.socketReport.score.quality*100))}%`),n=` [SOCKET.DEV: ${i.join(", ")}]`}return`- ${a.packageName}: ${a.currentRange} → ${a.newRange} (${a.updateType})${t}${n}`}).join(`
|
|
3
|
+
`),C=`Respond ONLY with valid JSON in this exact structure:
|
|
4
|
+
{
|
|
5
|
+
"summary": "Brief overall summary",
|
|
6
|
+
"recommendations": [
|
|
7
|
+
{
|
|
8
|
+
"package": "package-name",
|
|
9
|
+
"action": "update|skip|review|defer",
|
|
10
|
+
"reason": "explanation",
|
|
11
|
+
"riskLevel": "low|medium|high|critical",
|
|
12
|
+
"breakingChanges": ["change1"],
|
|
13
|
+
"effort": "low|medium|high"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"warnings": ["warning1"]
|
|
17
|
+
}`,Xe={compatibility:e=>`Analyze the compatibility of these package updates:
|
|
18
|
+
|
|
19
|
+
${e}
|
|
20
|
+
|
|
21
|
+
For each package:
|
|
22
|
+
1. Check peer dependency compatibility
|
|
23
|
+
2. Identify potential conflicts with other packages in the list
|
|
24
|
+
3. Assess API compatibility between current and target versions
|
|
25
|
+
4. Check for deprecated features being removed
|
|
26
|
+
5. Evaluate Node.js version requirements
|
|
27
|
+
|
|
28
|
+
${C}`,impact:e=>`Analyze the impact of updating these npm packages:
|
|
29
|
+
|
|
30
|
+
${e}
|
|
31
|
+
|
|
32
|
+
For each package, provide:
|
|
33
|
+
1. Risk level (low/medium/high/critical)
|
|
34
|
+
2. Recommended action (update/skip/review/defer)
|
|
35
|
+
3. Reason for recommendation
|
|
36
|
+
4. Known breaking changes (if any)
|
|
37
|
+
5. Estimated migration effort (low/medium/high)
|
|
38
|
+
|
|
39
|
+
${C}`,recommend:e=>`Provide smart recommendations for updating these packages:
|
|
40
|
+
|
|
41
|
+
${e}
|
|
42
|
+
|
|
43
|
+
Consider:
|
|
44
|
+
1. Update priority based on security, features, and stability
|
|
45
|
+
2. Grouping related packages for atomic updates
|
|
46
|
+
3. Best practices for the specific package ecosystem
|
|
47
|
+
4. Risk vs. benefit analysis
|
|
48
|
+
5. Suggested update order
|
|
49
|
+
6. If Socket.dev scores are provided, prioritize packages with low supply chain or quality scores
|
|
50
|
+
|
|
51
|
+
${C}`,security:e=>`Analyze the security implications of these package updates:
|
|
52
|
+
|
|
53
|
+
${e}
|
|
54
|
+
|
|
55
|
+
For each package:
|
|
56
|
+
1. Check if the update fixes known vulnerabilities (use the vulnerability data above)
|
|
57
|
+
2. Assess if the new version introduces security risks
|
|
58
|
+
3. Evaluate if this is a security-sensitive package (auth, crypto, session, etc.)
|
|
59
|
+
4. Recommend urgency of the update based on vulnerability severity
|
|
60
|
+
5. Flag any packages where skipping the update poses security risk
|
|
61
|
+
6. If Socket.dev scores are provided, factor in supply chain and quality scores — low scores indicate higher risk
|
|
62
|
+
|
|
63
|
+
${C}`},Qe=new Set(["compatibility","impact","recommend","security"]),pt=e=>Qe.has(e)?e:"impact",X=(e,a="impact")=>{const t=ze(e);return Xe[a](t)},Ze=/```(?:json)?\s*([\s\S]*?)```/,et=/\{[\s\S]*\}/,tt=e=>{try{return JSON.parse(e)}catch{}const a=Ze.exec(e);if(a?.[1])try{return JSON.parse(a[1])}catch{}const t=et.exec(e);if(t?.[0])try{return JSON.parse(t[0])}catch{}},at=e=>({action:We.has(e.action)?e.action:"review",breakingChanges:Array.isArray(e.breakingChanges)?e.breakingChanges:[],effort:Je.has(e.effort)?e.effort:"medium",package:typeof e.package=="string"?e.package:"",reason:typeof e.reason=="string"?e.reason:"",riskLevel:Ke.has(e.riskLevel)?e.riskLevel:"medium"}),Q=(e,a,t)=>{const n=tt(e);if(!n||typeof n!="object")return{analysisType:t,provider:a,recommendations:[],summary:"Failed to parse AI response.",warnings:["AI response was not valid JSON."]};const r=n,i=Array.isArray(r.recommendations)?r.recommendations:[];return{analysisType:t,provider:a,recommendations:i.map(o=>at(o)),summary:typeof r.summary=="string"?r.summary:"",warnings:Array.isArray(r.warnings)?r.warnings:[]}},nt={eslint:["ESLint 9.0: Flat config required","ESLint 8.0+: New rule formats"],next:["Next.js 13+: App router changes","Next.js 14+: Server components default"],react:["React 17 to 18: Concurrent features","React 18+: Strict mode changes"],typescript:["TypeScript 5.0: New decorators","TypeScript 4.7+: ESM changes"],vite:["Vite 5: Node.js 18+ required"],vue:["Vue 3: Composition API","Vue 3: Breaking template changes"],webpack:["Webpack 5: Node.js polyfills removed"]},rt=new Set(["bcrypt","cors","crypto-js","express-session","helmet","jose","jsonwebtoken","node-forge","oauth","passport"]),H=(e,a)=>{const t=e.map(n=>{const r=n.vulnerabilities&&n.vulnerabilities.length>0,i=rt.has(n.packageName),o=nt[n.packageName]??[];let d="low",s="update",c="low",m="Patch/minor update, safe to apply.";return n.updateType==="major"?(d="high",s=o.length>0?"review":"update",c="medium",m=o.length>0?`Major update with known breaking changes: ${o[0]}`:"Major version update, review changelog before applying."):n.updateType==="minor"&&(d="medium",m="Minor update, generally safe."),r&&(d="high",s="update",m="Security update — current version has known vulnerabilities."),i&&n.updateType==="major"&&(s="review",m="Security-sensitive package with major update, careful review needed.",c="high"),{action:s,breakingChanges:o,effort:c,package:n.packageName,reason:m,riskLevel:d}});return{analysisType:a,provider:"rule-engine",recommendations:t,summary:`Rule-based ${a} analysis for ${String(e.length)} packages.`,warnings:["No AI provider available — using built-in rule engine."]}},it=async(e,a,t)=>{const n=X(a,t),r=await z(e,n);return Q(r,e.name,t)},ot=(e,a,t)=>{const n=[],r=[],i=[];for(const o of e)n.push(...o.recommendations),r.push(...o.warnings),o.summary&&i.push(o.summary);return{analysisType:t,provider:a,recommendations:n,summary:i.length===1?i[0]??"":`Analyzed ${String(n.length)} packages in ${String(e.length)} batches.`,warnings:[...new Set(r)]}},Z={compatibility:"Compatibility",impact:"Impact",recommend:"Recommendations",security:"Security"},mt=e=>{const a=`${Z[e.analysisType]??e.analysisType} Analysis (${e.provider})`,t=e.recommendations.flatMap(r=>{const i=[{action:r.action,effort:r.effort,package:r.package,reason:r.reason,risk:r.riskLevel}];return r.breakingChanges.length>0&&i.push({action:"",effort:"",package:"",reason:`Breaking: ${r.breakingChanges.join("; ")}`,risk:""}),i}),n=process.stdout.columns||80;return oe(v.createElement(se,{borderStyle:"round",flexDirection:"column",paddingLeft:1,paddingRight:1},v.createElement(E,{bold:!0},a),v.createElement(E,null,""),v.createElement(E,null,e.summary),v.createElement(E,null,""),v.createElement(ce,{borderStyle:"none",data:t}),...e.warnings.length>0?[v.createElement(E,null,""),...e.warnings.map((r,i)=>v.createElement(E,{dimColor:!0,key:String(i)},` ${r}`))]:[]),{columns:n})},ft=async(e,a,t,n="impact")=>{const r=Fe(t);if(!r)return a.info(`No AI CLI tool found, using rule-based analysis.
|
|
64
|
+
`),H(e,n);const i=de(r.name,n,e),o=le(i);if(o)return a.info(`Using cached ${n} analysis from ${o.provider}.
|
|
65
|
+
`),o;const d=Z[n]??n;a.info(`Running ${d.toLowerCase()} analysis with ${r.name}...
|
|
66
|
+
`);try{let s;if(e.length>Ye){a.info(`Splitting ${String(e.length)} packages into batches of ${String(S)}...
|
|
67
|
+
`);const c=[];for(let p=0;p<e.length;p+=S)c.push(e.slice(p,p+S));const m=[];for(let p=0;p<c.length;p+=1){a.info(` Batch ${String(p+1)}/${String(c.length)}...`);const f=c[p];f&&m.push(await it(r,f,n))}s=ot(m,r.name,n)}else{const c=await z(r,X(e,n));s=Q(c,r.name,n)}return ue(i,s,pe(n,t?.cacheTtl)),s}catch(s){const c=s instanceof Error?s.message:String(s);return a.warn(`AI analysis failed (${c}), falling back to rule engine.
|
|
68
|
+
`),H(e,n)}};export{pt as K,Fe as R,Be as S,mt as W,ft as Z,De as a,je as b,tt as c,z as r};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
${a}`},
|
|
1
|
+
import{createRequire as S}from"node:module";import{readLastRunSummary as T}from"@visulima/task-runner";import{a as j}from"./failure-log-CTneNcio.js";import{c as w,d as P,g as k,r as C,O as D,B as F,N as _}from"../packem_chunks/cli-main.js";import{c as N}from"./en-D3CfXlO7.js";import{v as y,P as v,w as B,b as E}from"./index-uBVnF4ji.js";import{R as M,r as q,c as H}from"./ai-analysis-bGCAc1jR.js";let $;const I=t=>($??=S(import.meta.url))(t),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,O=t=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[e,a]=d.versions.node.split(".").map(Number);if(e>22||e===22&&a>=3||e===20&&a>=16)return d.getBuiltinModule(t)}return I(t)},{readFile:R,writeFile:A}=O("node:fs/promises"),W=32*1024,L=(t,e)=>{if(t.length<=e)return t;const a=t.slice(-e),o=t.length-a.length;return`[…${String(o)} bytes truncated from head…]
|
|
2
|
+
${a}`},Y=async(t,e)=>e===void 0?T(t,{dataDirectory:N(t)}):C(t,e),dt=async(t,e,a={})=>{const o=a.terminalOutputLimit??W,[s,n]=await Promise.all([j(t,e),Y(t,a.runId)]),i=n?w(n,e):void 0;if(!s&&!i)return;let r,c;if(n&&i){const h=await P(t,n.id),p=h?w(h,e):void 0;r=k(i.hashDetails,p?.hashDetails),c=h?.id}const u=s?.terminalOutput??"";return{command:s?.command??void 0,cwd:s?.cwd??void 0,dependencies:i?.dependencies??[],duration:i?.duration,exitCode:s?.exitCode??i?.exitCode,hash:i?.hash??s?.hash,hashDetails:i?.hashDetails,hashDiff:r,previousRunId:c,project:i?.target.project,runId:n?.id??s?.runId,status:s?.status??(i?J(i):void 0),target:i?.target.target,taskId:e,terminalOutput:L(u,o),terminalOutputCaptured:!!s,timestamp:s?.timestamp??i?.endTime??i?.startTime}},J=t=>{if(t.exitCode!==void 0&&t.exitCode!==0)return"failure";switch(t.cacheStatus){case"HIT":return"local-cache";case"REMOTE_HIT":return"remote-cache";case"SKIPPED":return"skipped";default:return t.exitCode===0?"success":void 0}},K=3600*1e3,x=80,U=new Set(["high","low","medium"]),G=()=>`You are an expert software engineer helping fix a failing build/test/lint task.
|
|
3
3
|
|
|
4
4
|
You will be given:
|
|
5
5
|
- The terminal output (stdout/stderr) from the failed task.
|
|
@@ -32,12 +32,12 @@ Respond ONLY with valid JSON in this exact structure:
|
|
|
32
32
|
"cannotFix": "optional — set when no safe patch can be proposed"
|
|
33
33
|
}`,f=(t,e)=>{const a=[];if(e.added.length>0&&a.push(` added: ${e.added.join(", ")}`),e.changed.length>0&&a.push(` changed: ${e.changed.join(", ")}`),e.removed.length>0&&a.push(` removed: ${e.removed.join(", ")}`),a.length!==0)return`- ${t}:
|
|
34
34
|
${a.join(`
|
|
35
|
-
`)}`},
|
|
36
|
-
`)},
|
|
37
|
-
`)},
|
|
35
|
+
`)}`},V=t=>{if(!t.hashDiff)return"No hash-diff available — there is no previous run to compare against.";const e=[];t.hashDiff.commandChanged&&e.push("- command line changed since previous run");const a=f("file inputs",t.hashDiff.nodes),o=f("implicit deps",t.hashDiff.implicitDeps),s=f("runtime/env",t.hashDiff.runtime);return a&&e.push(a),o&&e.push(o),s&&e.push(s),e.length===0?"No detectable changes between this run and the previous run.":e.join(`
|
|
36
|
+
`)},z=t=>{const e=[`Task: ${t.taskId}`];return t.project&&e.push(`Project: ${t.project}`),t.target&&e.push(`Target: ${t.target}`),t.command&&e.push(`Command: ${t.command}`),t.cwd&&e.push(`CWD: ${t.cwd}`),t.exitCode!==void 0&&e.push(`Exit code: ${String(t.exitCode)}`),t.hash&&e.push(`Task hash: ${t.hash}`),e.push("","Hash-diff since previous run:",V(t),""),t.terminalOutputCaptured?e.push("Terminal output:","```",t.terminalOutput,"```"):e.push("Terminal output: <no failure log was captured for this task>",'Set "cannotFix" and tell the user to re-run with `vis run` so logs can be captured.'),e.join(`
|
|
37
|
+
`)},Q=t=>`${G()}
|
|
38
38
|
|
|
39
|
-
${
|
|
40
|
-
`);return}const s=a.cache!==!1,n=
|
|
39
|
+
${z(t)}`,X=(t,e)=>{const a=Array.isArray(t.patches)?t.patches:[],o=[];for(const n of a)typeof n.file!="string"||n.file.length===0||typeof n.oldString!="string"||n.oldString.length===0||typeof n.newString=="string"&&o.push({file:n.file,newString:n.newString,oldString:n.oldString,reason:typeof n.reason=="string"&&n.reason.length>0?n.reason:void 0});const s=typeof t.cannotFix=="string"&&t.cannotFix.length>0?t.cannotFix:void 0;return{cannotFix:s,confidence:U.has(t.confidence)?t.confidence:"low",explanation:typeof t.explanation=="string"?t.explanation:"",patches:s?[]:o,provider:e}},Z=(t,e)=>{const a=H(t);return!a||typeof a!="object"?{cannotFix:"AI response was not valid JSON.",confidence:"low",explanation:"Failed to parse AI response.",patches:[],provider:e}:X(a,e)},tt=(t,e)=>_({cwd:e.cwd??null,flow:"ai-fix",hash:e.hash??null,provider:t,taskId:e.taskId,terminalOutput:e.terminalOutput,terminalOutputCaptured:e.terminalOutputCaptured}),lt=async(t,e,a={})=>{const o=M(a.config);if(!o){e.warn(`No AI provider available — install one of: claude, gemini, copilot, codex.
|
|
40
|
+
`);return}const s=a.cache!==!1,n=tt(o.name,t);if(s){const i=D(n);if(i)return e.info(`Using cached fix proposal from ${i.provider}.
|
|
41
41
|
`),i}e.info(`Generating fix proposal with ${o.name}...
|
|
42
|
-
`);try{const i=await
|
|
43
|
-
`);return}},
|
|
42
|
+
`);try{const i=await q(o,Q(t)),r=Z(i,o.name);return s&&r.patches.length>0&&!r.cannotFix&&F(n,r,K),r}catch(i){const r=i instanceof Error?i.message:String(i);e.warn(`AI fix proposal failed (${r}).
|
|
43
|
+
`);return}},et=(t,e,a)=>y(a)?v(a):v(B(e??t,a)),at=(t,e)=>{const a=E(t,e);return a===""?!0:!a.startsWith("..")&&!y(a)},it=(t,e,a)=>{const o=t.indexOf(e),s=Math.max(0,o-x),n=Math.min(t.length,o+e.length+x),i=t.slice(s,n);return{previewAfter:`${t.slice(s,o)}${a}${t.slice(o+e.length,n)}`,previewBefore:i}},pt=async(t,e,a,o={})=>{const s=o.dryRun===!0,n=new Map,i=[];for(const r of a.patches){const c=et(t,e,r.file);if(!at(t,c)){i.push({absolutePath:c,patch:r,status:"outside-workspace"});continue}let u=n.get(c);if(u===void 0){try{u=await R(c,"utf8")}catch(l){const g=l.code;i.push({absolutePath:c,error:g==="ENOENT"?void 0:l.message,patch:r,status:g==="ENOENT"?"missing-file":"error"});continue}n.set(c,u)}const h=u.indexOf(r.oldString);if(h===-1){i.push({absolutePath:c,patch:r,status:"no-match"});continue}if(u.indexOf(r.oldString,h+r.oldString.length)!==-1){i.push({absolutePath:c,patch:r,status:"ambiguous-match"});continue}const{previewAfter:p,previewBefore:b}=it(u,r.oldString,r.newString),m=`${u.slice(0,h)}${r.newString}${u.slice(h+r.oldString.length)}`;if(!s)try{await A(c,m,"utf8")}catch(l){n.delete(c),i.push({absolutePath:c,error:l.message,patch:r,status:"error"});continue}n.set(c,m),i.push({absolutePath:c,patch:r,previewAfter:p,previewBefore:b,status:"applied"})}return i};export{dt as a,pt as b,et as c,lt as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as T}from"node:module";import{l as P}from"./target-options-
|
|
2
|
-
`):globalThis.Temporal=r.Temporal},
|
|
3
|
-
`):globalThis.URLPattern=r.URLPattern},
|
|
4
|
-
`)})},
|
|
1
|
+
import{createRequire as T}from"node:module";import{l as P}from"./target-options-7XcbqGDe.js";import{w as q}from"./index-uBVnF4ji.js";let j;const E=e=>(j??=T(import.meta.url))(e),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=e=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[r,t]=y.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return y.getBuiltinModule(e)}return E(e)},{createRequire:L}=h("node:module"),{pathToFileURL:R}=h("node:url"),m=["temporal","urlpattern","reporterror","regexp-escape","promise-try","float16array","error-iserror","navigator-locks"],F=e=>{const r=e.trim().toLowerCase();return r===""||r==="all"||r==="1"||r==="true"?m:r.split(",").map(t=>t.trim()).filter(t=>m.includes(t))},v=async(e,r)=>{try{const t=L(q(r,"__vis_polyfill_resolver__.js")).resolve(e);return await import(R(t).href)}catch{return}},x=async e=>{if(globalThis.Temporal!==void 0)return;const r=await v("@js-temporal/polyfill",e);r?.Temporal===void 0?process.stderr.write(`vis: --polyfill temporal requested but @js-temporal/polyfill is not installed in this project.
|
|
2
|
+
`):globalThis.Temporal=r.Temporal},O=async e=>{if(globalThis.URLPattern!==void 0)return;const r=await v("urlpattern-polyfill",e);r?.URLPattern===void 0?process.stderr.write(`vis: --polyfill urlpattern requested but urlpattern-polyfill is not installed in this project.
|
|
3
|
+
`):globalThis.URLPattern=r.URLPattern},k=()=>{typeof globalThis.reportError!="function"&&(globalThis.reportError=e=>{const r=e instanceof Error?e.stack??`${e.name}: ${e.message}`:String(e);process.stderr.write(`${r}
|
|
4
|
+
`)})},I=()=>{if(typeof RegExp.escape=="function")return;const e=new Set(String.raw`^$\.*+?()[]{}|/`),r={"\f":String.raw`\f`,"\n":String.raw`\n`,"\r":String.raw`\r`," ":String.raw`\t`,"\v":String.raw`\v`},t=/\s/u,o=n=>n<=255?String.raw`\x${n.toString(16).padStart(2,"0")}`:String.raw`\u${n.toString(16).padStart(4,"0")}`;RegExp.escape=n=>{if(typeof n!="string")throw new TypeError("RegExp.escape requires a string argument");let a="",i=!0;for(const s of n){const c=s.codePointAt(0);i&&/[\dA-Za-z]/u.test(s)?a+=o(c):e.has(s)?a+=`\\${s}`:r[s]!==void 0?a+=r[s]:t.test(s)?a+=o(c):a+=s,i=!1}return a}},A=()=>{typeof Promise.try!="function"&&(Promise.try=function(e,...r){const t=typeof this=="function"?this:Promise;return new t((o,n)=>{try{o(e(...r))}catch(a){n(a)}})})},w=e=>{const r=new Float32Array(1),t=new Uint32Array(r.buffer);r[0]=e;const o=t[0],n=o>>>16&32768,a=o>>>23&255,i=o&8388607;if(a===255)return i===0?n|31744:n|32256;const s=a-127+15;if(s>=31)return n|31744;if(s<=0){if(s<-10)return n;const l=i|8388608,p=14-s;let d=l>>p;const g=l&(1<<p)-1,u=1<<p-1;return(g>u||g===u&&(d&1)===1)&&(d+=1),n|d}let c=s<<10|i>>13;const f=i&8191;return(f>4096||f===4096&&(c&1)===1)&&(c+=1),n|c},b=e=>{const r=e&32768?-1:1,t=e>>10&31,o=e&1023;return t===0?r*o*2**-24:t===31?o?Number.NaN:r*Number.POSITIVE_INFINITY:r*(1+o/1024)*2**(t-15)},N=()=>{const e=Math;typeof e.f16round!="function"&&(e.f16round=t=>b(w(t)));const r=DataView.prototype;typeof r.getFloat16!="function"&&(r.getFloat16=function(t,o){return b(this.getUint16(t,o))}),typeof r.setFloat16!="function"&&(r.setFloat16=function(t,o,n){this.setUint16(t,w(o),n)})},U=()=>{typeof Error.isError!="function"&&(Error.isError=e=>typeof e=="object"&&e!==null&&Object.prototype.toString.call(e)==="[object Error]")},$=()=>{const e=globalThis,r=e.navigator;if(r?.locks!==void 0)return;const t=new Map,o=new Set,n=i=>i.reason??(typeof DOMException=="function"?new DOMException("The lock request is aborted","AbortError"):Object.assign(new Error("The lock request is aborted"),{name:"AbortError"})),a={request:async(i,s,c)=>{const f=typeof s!="function",l=(f?s:{})??{},p=f?c:s,d=l.mode==="shared"?"shared":"exclusive";if(l.signal?.aborted)throw n(l.signal);if(l.ifAvailable===!0&&o.has(i))return p(null);const g=t.get(i)??Promise.resolve();let u;const _=new Promise(S=>{u=S});if(t.set(i,g.then(()=>_)),await g.catch(()=>{}),l.signal?.aborted)throw u(),n(l.signal);o.add(i);try{return await p({mode:d,name:i})}finally{o.delete(i),u()}}};r===void 0?Object.defineProperty(e,"navigator",{configurable:!0,enumerable:!0,value:{locks:a},writable:!0}):Object.defineProperty(r,"locks",{configurable:!0,enumerable:!0,value:a})},M={"error-iserror":U,float16array:N,"navigator-locks":$,"promise-try":A,"regexp-escape":I,reporterror:k},V=async(e,r=process.cwd())=>{const t=F(e);await Promise.all(t.map(async o=>{o==="temporal"?await x(r):o==="urlpattern"?await O(r):M[o]?.()}))},z=async e=>{for(const[r,t]of Object.entries(P(e,!0)))process.env[r]===void 0&&(process.env[r]=t);process.env.VIS_POLYFILL!==void 0&&await V(process.env.VIS_POLYFILL,e)};export{z as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as _}from"node:module";import{c as T}from"./compile-cache-B_Vf_WxT.js";import{t as w,h as R,a as $,u as m,c as M,m as S}from"./package-version-C47v64aB.js";import{I as j}from"./index-BWl4DbMp.js";let g;const x=e=>(g??=_(import.meta.url))(e),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[s,o]=r.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return r.getBuiltinModule(e)}return x(e)},{createRequire:y}=b("node:module");let O;const q=e=>(O??=y(import.meta.url))(e),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=e=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[s,o]=t.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return t.getBuiltinModule(e)}return q(e)},{execFileSync:N}=f("node:child_process"),{totalmem:z}=f("node:os"),C=/--max-old-space-size=(\d+)/,B=/--max-semi-space-size=(\d+)/,E=e=>Math.floor(z()/1024/1024*e),I=e=>e<=512?4:e<=1024?8:e<=2048?16:e<=4096?32:e<=8192?64:Math.floor(Math.log2(e))*8,d=(e,s)=>{for(const o of s){const n=e.exec(o);if(n)return Number.parseInt(n[1],10)}},L=e=>{const o=[...M()],n=[...w()],a=d(C,o),p=d(B,o);if(a!==void 0&&p!==void 0)return;const l=a??E(.75),h=p??I(l),c=[];if(a===void 0&&c.push(`--max-old-space-size=${String(l)}`),p===void 0&&c.push(`--max-semi-space-size=${String(h)}`),c.length!==0)try{N(R(),[...c,...o,...n.slice(1)],{env:$(),stdio:"inherit"}),m(0)}catch(v){const u=v.status;m(typeof u=="number"?u:1)}},V=()=>{process.env.VIS_VERSION=S()},A=e=>{!process.stdout.isTTY||j||process.env.TERM==="dumb"||process.stdout.write(`\x1B]0;${e}\x07`)},F=new Set(["","--help","--version","-h","-v","completion","dlx","exec","x"]),i=process.argv[2]??"";!F.has(i)&&!process.argv.includes("--help")&&!process.argv.includes("-h")&&L();process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");V();T();(async()=>{if(i==="__pm-shim"){const{dispatchShim:s}=await import("../packem_chunks/dispatch.js");s(process.argv[3]??"",process.argv.slice(4));return}if(i==="x"){const{runLeanX:s}=await import("../packem_chunks/lean.js");await s(process.argv.slice(3));return}if(i==="exec"||i==="dlx"){const{runExecCli:s}=await import("../packem_chunks/cli-exec.js");await s();return}const{runCli:e}=await import("../packem_chunks/cli-main.js").then(s=>s.ap);await e()})();export{A as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as b}from"node:module";import{w as m,l as g}from"./index-uBVnF4ji.js";import{a as M}from"./readJsonSync-DweZd5ZA-0eZh9sGm.js";let $;const w=e=>($??=b(import.meta.url))(e),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[s,n]=_.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return _.getBuiltinModule(e)}return w(e)},{readdirSync:y,statSync:q}=k("node:fs"),x=["preinstall","install","postinstall","prepare"],B=e=>{const s=m(e,"node_modules");if(!g(s))return[];const n=new Map,o=(f,p="")=>{let u;try{u=y(f)}catch{return}for(const r of u){const i=m(f,r);if(r.startsWith("@")){o(i,`${r}/`);continue}if(r===".pnpm"&&p===""){let l;try{l=y(i)}catch{continue}for(const a of l){const c=m(i,a,"node_modules");g(c)&&o(c)}continue}if(r.startsWith("."))continue;const h=p+r,t=m(i,"package.json");try{if(!q(i).isDirectory()||!g(t))continue;const l=M(t),a=l.scripts??{},c=x.filter(v=>a[v]);!a.preinstall&&!a.install&&!a.postinstall&&g(m(i,"binding.gyp"))&&c.push("install (binding.gyp)"),c.length>0&&!n.has(h)&&n.set(h,{directory:i,hooks:c,name:h,version:typeof l.version=="string"?l.version:void 0});const d=m(i,"node_modules");g(d)&&o(d)}catch{}}};return o(s),[...n.values()]},j=e=>{const s=e.startsWith("@"),n=e.indexOf("@",s?1:0);return n===-1?{name:e}:{name:e.slice(0,n),version:e.slice(n+1)}},O=(e,s,n)=>{for(const[o,f]of Object.entries(s)){if(!f)continue;if(o.endsWith("@*")){if(o.slice(0,-2)===e.name)return!0;continue}if(o.endsWith("*")){if(e.name.startsWith(o.slice(0,-1)))return!0;continue}const{name:p,version:u}=j(o);if(p===e.name&&(!n||u===void 0||e.version===u))return!0}return!1},R=(e,s,n={})=>{const o=n.pinVersions===!0,f=B(e),p=[],u=[],r=new Map(f.map(t=>[t.name,t]));for(const t of f)O(t,s,o)?u.push(t):p.push(t);const i=[],h=[];for(const[t,l]of Object.entries(s)){if(!l)continue;if(t.endsWith("@*")){const v=t.slice(0,-2);r.has(v)||i.push(t);continue}if(t.endsWith("*")){const v=t.slice(0,-1);[...r.keys()].some(W=>W.startsWith(v))||i.push(t);continue}const{name:a,version:c}=j(t),d=r.get(a);if(!d){i.push(t);continue}o&&c!==void 0&&c!=="*"&&d.version&&d.version!==c&&h.push({from:t,to:`${a}@${d.version}`})}return{excess:i,installed:u,unapproved:p,versionDrift:h}},E=(e,s)=>R(e,s).unapproved.map(n=>`${n.name} (${n.hooks.join(", ")})`);export{R as W,E as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o}from"./resolve-runtime-
|
|
1
|
+
import{r as o}from"./resolve-runtime-D_vZovbB.js";const i=e=>{if(e!==null&&typeof e=="object"&&"runtime"in e){const r=e.runtime;if(typeof r=="string")return r}},s=(e,r)=>{const t=o(r,{config:e.visConfig?.runtime,flag:i(e.options)});return t.deferredNotice!==void 0&&e.logger?.warn?.(t.deferredNotice),t},u=e=>e.runtime==="bun"?"bun":void 0;export{u as a,s as r};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{createRequire as ie}from"node:module";import{w as E,z as le}from"./index-uBVnF4ji.js";import{r as me}from"./docker-DaVs-9wK.js";import{a as oe}from"./readJsonSync-DweZd5ZA-0eZh9sGm.js";import{e as de}from"./license-t5KnNX6v.js";import{D as he}from"./package-version-C47v64aB.js";import"./public-api-WqUCiyIe.js";import{u as _e}from"./index-BAe6e0XE.js";let ae;const pe=e=>(ae??=ie(import.meta.url))(e),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,se=e=>{if(typeof P<"u"&&P.versions&&P.versions.node){const[n,t]=P.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return P.getBuiltinModule(e)}return pe(e)},{randomUUID:ue}=se("node:crypto"),{readdirSync:fe}=se("node:fs"),X=e=>e.replaceAll(/[^\w.~-]/g,n=>`%${(n.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),C=(e,n)=>{const t=e.toLowerCase();if(t.startsWith("@")){const s=t.indexOf("/");if(s>0){const r=t.slice(0,s),p=t.slice(s+1);return`pkg:npm/${X(r)}/${X(p)}@${X(n)}`}}return`pkg:npm/${X(t)}@${X(n)}`},m={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},ge=[m.STRING,m.NUMBER,m.BOOLEAN],ye='<?xml version="1.0" encoding="UTF-8"?>',ee=["_selfCloseTag","_attrs"],be=(e="",n=0)=>e.repeat(n),H=e=>Array.isArray(e)&&m.ARRAY||typeof e===m.OBJECT&&e!==null&&e._name&&m.JSTOXML_OBJECT||e instanceof Date&&m.DATE||e===null&&m.NULL||typeof e,re=e=>e.startsWith("<![CDATA["),ce=(e="",n={},t)=>{let s=e;if(typeof e===m.STRING){if(re(e))return e;const r=new RegExp(`(${Object.keys(n).join("|")})(?!(\\w|#)*;)`,"g");s=String(e).replace(r,(p,h)=>n[h]||"")}return typeof t=="function"?t(s):s},$e=(e={},n,t,s)=>(Array.isArray(e)?e:Object.entries(e).map(([r,p])=>({[r]:p}))).reduce((r,p)=>{const h=Object.keys(p)[0],_=p[h];if(typeof t===m.FUNCTION&&t(h,_))return r;const y=n?ce(_,n):_,$=!s&&y===!0?"":`="${y}"`;return r.push(`${h}${$}`),r},[]),Oe=(e={},n,t,s)=>{const r=$e(e,n,t,s);return r.length===0?"":` ${r.join(" ")}`},je=(e={})=>Object.keys(e).map(n=>({_name:n,_content:e[n]})),ve=e=>ge.includes(H(e)),ke=e=>!e.match("<"),Te=({header:e,isOutputStart:n})=>e&&n?typeof e===m.BOOLEAN?ye:e:"",ne={"<":"<",">":">","&":"&",'"':"""},U=(e={},n={})=>{const{depth:t=0,indent:s,_isFirstItem:r,_isOutputStart:p=!0,header:h,attributeReplacements:_={},attributeFilter:y,attributeExplicitTrue:$=!1,contentReplacements:F={},contentMap:M,selfCloseTags:B=!0}=n,J=typeof _=="boolean"&&!_?{}:{...ne,..._},z=typeof F=="boolean"&&!F?{}:{...ne,...F},D=typeof s=="string",k=be(s,t),G=H(e),L=Te({header:h,isOutputStart:p}),N=p&&!L&&r&&t===0,R=D&&!N?`
|
|
2
|
+
`:"";let b="";switch(G){case m.JSTOXML_OBJECT:{const{_name:f,_content:u}=e;if(u===null&&typeof M!="function"){b=`${R}${k}${f}`;break}if(Array.isArray(u)&&u.every(ve))return u.map(v=>U({_name:f,_content:v},{...n,depth:t,_isOutputStart:!1})).join("");if(ee.includes(f))break;const g=U(u,{...n,depth:t+1,_isOutputStart:N}),A=H(g),O=ke(g),j=re(g),x=`${R}${k}`;if(f==="_comment"){b+=`${x}<!-- ${u} -->`;break}const W=A==="undefined"||g==="",c=B,o=e._selfCloseTag,a=typeof o===m.BOOLEAN?W&&o:W&&c,i=a?"/":"",l=Oe(e._attrs,J,y,$),d=`<${f}${l}${i}>`,T=D&&!O&&!j?`
|
|
3
|
+
${k}`:"",S=a?"":`${g}${T}</${f}>`;b+=`${x}${d}${S}`;break}case m.OBJECT:{const f=Object.keys(e);b=f.map((u,g)=>{const A={...n,_isFirstItem:g===0,_isLastItem:g+1===f.length,_isOutputStart:N},O={_name:u};if(H(e[u])===m.OBJECT&&(ee.forEach(j=>{const x=e[u][j];typeof x<"u"&&(O[j]=x,delete e[u][j])}),typeof e[u]._content<"u"&&Object.keys(e[u]).length>1)){const j=Object.assign({},e[u]);delete j._content,O._content=[...je(j),e[u]._content]}return typeof O._content>"u"&&(O._content=e[u]),U(O,A)},n).join("");break}case m.FUNCTION:{const f=e(n);b=U(f,n);break}case m.ARRAY:{b=e.map((f,u)=>{const g={...n,_isFirstItem:u===0,_isLastItem:u+1===e.length,_isOutputStart:N};return U(f,g)}).join("");break}default:{b=ce(e,z,M);break}}return`${L}${b}`},Q=e=>{try{return oe(e)}catch{return}},Se=e=>{if(e.length===0||e.includes("..")||e.startsWith(".")||e.includes("\0")||e.includes("\\"))return!1;if(e.startsWith("@")){const n=e.indexOf("/");return n>1&&!e.includes("/",n+1)}return!e.includes("/")},we=e=>e.length>0&&!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&!e.includes("\0"),Ae=(e,n,t)=>{const s=`${n.replaceAll("/","+")}@${t}`,r=E(e,"node_modules",".pnpm"),p=Q(E(r,s,"node_modules",n,"package.json"));if(p)return p;let h;try{h=fe(r)}catch{return}const _=`${s}_`;for(const y of h){if(!y.startsWith(_))continue;const $=Q(E(r,y,"node_modules",n,"package.json"));if($)return $}},xe=(e,n,t)=>{const s=Q(E(e,"node_modules",n,"package.json"));return s?.version===t?s:void 0},De=(e,n,t)=>{if(!(!Se(n)||!we(t)))return Ae(e,n,t)??xe(e,n,t)},Ne={sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"},Re={sha256:64,sha384:96,sha512:128},Ce=e=>{const n={name:e.name,version:e.version},{integrity:t}=e;return t&&t.hex.length===Re[t.algorithm]&&(n.hash={alg:Ne[t.algorithm],content:t.hex}),e.dependencies&&(n.dependencies=e.dependencies),e.peerDependencies&&(n.peerDependencies=e.peerDependencies),e.optionalDependencies&&(n.optionalDependencies=e.optionalDependencies),n},Ee=[{file:"pnpm-lock.yaml",type:"pnpm"},{file:"npm-shrinkwrap.json",type:"npm"},{file:"package-lock.json",type:"npm"},{file:"yarn.lock",type:"yarn"},{file:"bun.lock",type:"bun"}],Me=e=>{for(const{file:n,type:t}of Ee){let s;try{s=le(E(e,n))}catch{continue}const r=new Map;for(const p of he(s,t))r.set(`${p.name}@${p.version}`,Ce(p));return{packages:r,type:t}}},Be=e=>{const n=e.indexOf(":");return n<=0?e:e.slice(0,n)==="npm"?e.slice(n+1):e},V=(e,n,t)=>{const s=t.get(e);if(!s||s.size===0)return;if(s.has(n))return n;const r=Be(n);if(r!==n&&s.has(r))return r;const p=[...s];return _e.maxSatisfying(p,r,{includePrerelease:!0})||p[0]},Le="1.7",Ie="CycloneDX",Ue="http://cyclonedx.org/schema/bom-1.7.schema.json",Fe="@visulima/vis",te=e=>{try{return oe(e)}catch{return}},Je=e=>{if(e){if(typeof e=="string")return e;if(typeof e=="object"&&e.name)return e.email?`${e.name} <${e.email}>`:e.name}},qe=e=>{if(e)return typeof e=="string"?e:e.url},Pe=e=>{if(e)return typeof e=="string"?e:e.url},Xe=e=>{const n=[];e.homepage&&n.push({type:"website",url:e.homepage});const t=qe(e.repository);t&&n.push({type:"vcs",url:t});const s=Pe(e.bugs);return s&&n.push({type:"issue-tracker",url:s}),n.length>0?n:void 0},ze=e=>e==="application"||e==="service"||e==="tool"?"application":"library",K=(e,n)=>{if(!n)return;n.description&&(e.description=n.description);const t=Je(n.author);t&&(e.author=t);const s=de(n);s&&(e.licenses=s);const r=Xe(n);r&&(e.externalReferences=r)},sn=e=>{const{focus:n,generatorVersion:t,includeDev:s=!1,now:r=new Date,projectGraph:p,serialNumber:h,workspace:_,workspaceRoot:y}=e,$=n&&n.length>0?[...me(n,p)].sort():Object.keys(_.projects).sort(),F=new Set($),M=new Map;for(const c of $){const o=_.projects[c];o&&M.set(c,te(E(y,o.root,"package.json")))}const B=[],J=new Map;for(const c of $){const o=_.projects[c];if(!o)continue;const a=M.get(c),i=a?.version??"0.0.0",l=C(c,i);J.set(c,l);const d={"bom-ref":l,name:c,purl:l,type:ze(o.projectType),version:i};K(d,a),B.push(d)}const z=Me(y),D=new Map,k=new Map;if(z)for(const c of z.packages.values()){D.set(`${c.name}@${c.version}`,c);let o=k.get(c.name);o||(o=new Set,k.set(c.name,o)),o.add(c.version)}const G=[],L=[],N=new Map;for(const c of $){const o=M.get(c);if(!o)continue;const a=[o.dependencies,o.peerDependencies];s&&a.push(o.devDependencies);const i=new Set,l=(d,T)=>{if(T)for(const[S,v]of Object.entries(T)){if(F.has(S)){const I=J.get(S);I&&i.add(I);continue}const w=V(S,v,k);w&&(i.add(C(S,w)),d.push(`${S}@${w}`))}};for(const d of a)l(G,d);l(L,o.optionalDependencies),N.set(c,i)}const R=new Map,b=new Map,f=(c,o)=>{const a=[...c];for(;a.length>0;){const i=a.pop(),l=R.get(i);if(l==="required"||l==="optional"&&o==="optional")continue;R.set(i,o);const d=D.get(i);if(!d)continue;const T=b.get(i)??new Set,S=[d.dependencies,d.peerDependencies];for(const v of S)if(v)for(const[w,I]of Object.entries(v))for(const q of I){const Y=V(w,q,k);Y&&(T.add(C(w,Y)),a.push(`${w}@${Y}`))}if(d.optionalDependencies)for(const[v,w]of Object.entries(d.optionalDependencies))for(const I of w){const q=V(v,I,k);q&&(T.add(C(v,q)),L.push(`${v}@${q}`))}T.size>0&&b.set(i,T)}};f(G,"required"),f(L,"optional");const u=[],g=[...R.keys()].sort();for(const c of g){const o=D.get(c);if(!o)continue;const a=C(o.name,o.version),i={"bom-ref":a,name:o.name,purl:a,scope:R.get(c)??"required",type:"library",version:o.version};o.hash&&(i.hashes=[o.hash]),K(i,De(y,o.name,o.version)),u.push(i)}const A=[];for(const[c,o]of N){const a=J.get(c);if(!a)continue;const i=[...o].sort();A.push(i.length>0?{dependsOn:i,ref:a}:{ref:a})}for(const c of g){const o=D.get(c);if(!o)continue;const a=C(o.name,o.version),i=b.get(c),l=i?[...i].sort():[];A.push(l.length>0?{dependsOn:l,ref:a}:{ref:a})}A.sort((c,o)=>c.ref.localeCompare(o.ref));const O=te(E(y,"package.json")),j=(()=>{if(n?.length===1){const l=B.find(d=>d.name===n[0]);if(l)return{"bom-ref":l["bom-ref"],name:l.name,purl:l.purl,type:l.type,version:l.version}}const c=O?.name??"workspace",o=O?.version??"0.0.0",a=C(c,o),i={"bom-ref":a,name:c,purl:a,type:"application",version:o};return K(i,O),i})(),x=j["bom-ref"],W=x?B.filter(c=>c["bom-ref"]!==x):B;return{$schema:Ue,bomFormat:Ie,components:[...W,...u],dependencies:A,metadata:{component:j,lifecycles:[{phase:"build"}],timestamp:r.toISOString(),tools:{components:[{name:Fe,type:"application",...t?{version:t}:{}}]}},serialNumber:h??`urn:uuid:${ue()}`,specVersion:Le,version:1}},on=e=>{const n={version:e.version??1,xmlns:"http://cyclonedx.org/schema/bom/1.7"};e.serialNumber&&(n.serialNumber=e.serialNumber);const t=[];return e.metadata&&t.push(Ge(e.metadata)),e.components&&e.components.length>0&&t.push({_content:e.components.map(s=>Z(s)),_name:"components"}),e.dependencies&&e.dependencies.length>0&&t.push({_content:e.dependencies.map(s=>He(s)),_name:"dependencies"}),`${U({_attrs:n,_content:t,_name:"bom"},{header:!0,indent:" ",selfCloseTags:!0})}
|
|
4
|
+
`},Ge=e=>{const n=[];return e.timestamp&&n.push({timestamp:e.timestamp}),e.lifecycles&&e.lifecycles.length>0&&n.push({_content:e.lifecycles.map(t=>{const s=[];return t.phase&&s.push({phase:t.phase}),t.name&&s.push({name:t.name}),t.description&&s.push({description:t.description}),{_content:s,_name:"lifecycle"}}),_name:"lifecycles"}),e.tools?.components&&n.push({_content:[{_content:e.tools.components.map(t=>Z(t)),_name:"components"}],_name:"tools"}),e.component&&n.push(Z(e.component)),{_content:n,_name:"metadata"}},Z=e=>{const n={type:e.type};e["bom-ref"]&&(n["bom-ref"]=e["bom-ref"]);const t=[];e.group&&t.push({group:e.group}),t.push({name:e.name}),e.version&&t.push({version:e.version}),e.description&&t.push({description:e.description}),e.author&&t.push({author:e.author}),e.hashes&&e.hashes.length>0&&t.push({_content:e.hashes.map(r=>({_attrs:{alg:r.alg},_content:r.content,_name:"hash"})),_name:"hashes"});const s=We(e.licenses);return s&&t.push(s),e.purl&&t.push({purl:e.purl}),e.scope&&t.push({scope:e.scope}),e.externalReferences&&e.externalReferences.length>0&&t.push({_content:e.externalReferences.map(r=>({_attrs:{type:r.type},_content:[{url:r.url}],_name:"reference"})),_name:"externalReferences"}),{_attrs:n,_content:t,_name:"component"}},We=e=>{if(!e||e.length===0)return;const n=[];for(const t of e){if("expression"in t){n.push({expression:t.expression});continue}const s=[];"id"in t.license&&t.license.id?s.push({id:t.license.id}):"name"in t.license&&t.license.name&&s.push({name:t.license.name}),n.push({_content:s,_name:"license"})}return{_content:n,_name:"licenses"}},He=e=>e.dependsOn&&e.dependsOn.length>0?{_attrs:{ref:e.ref},_content:e.dependsOn.map(n=>({_attrs:{ref:n},_name:"dependency"})),_name:"dependency"}:{_attrs:{ref:e.ref},_name:"dependency"};export{sn as b,on as s,C as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{z as u,w as l,l as g}from"./index-uBVnF4ji.js";import{D as d}from"./package-version-C47v64aB.js";import"./public-api-WqUCiyIe.js";import{x as w,e as D}from"../packem_chunks/catalog.js";const v={bun:{file:"bun.lock",type:"bun"},npm:{aliases:["npm-shrinkwrap.json"],file:"package-lock.json",type:"npm"},pnpm:{file:"pnpm-lock.yaml",type:"pnpm"},yarn:{file:"yarn.lock",type:"yarn"}},j=o=>{const t=v[o];return t?[...t.aliases??[],t.file].map(e=>({file:e,type:t.type})):[]},m=(o,t)=>{const e=j(t);if(e.length!==0)return e.find(r=>g(l(o,r.file)))??e[e.length-1]},k=o=>{try{return JSON.parse(u(o))}catch{return}},y=o=>{const t=[],e=k(l(o,"package.json"));e&&t.push(e);const r=w(o);let c;if(r?c=r:e?.workspaces&&(Array.isArray(e.workspaces)?c=e.workspaces:e.workspaces.packages&&(c=e.workspaces.packages)),!c)return t;const a=D(o,c);for(const s of a){const n=k(l(o,s,"package.json"));n&&t.push(n)}return t},b=(o,t)=>{const e=new Set,r=[],c=new Map;for(const s of t){const n=c.get(s.name);n?n.push(s):c.set(s.name,[s])}const a=s=>{if(s)for(const n of Object.keys(s))e.has(n)||(e.add(n),r.push(n))};for(const s of y(o))a(s.dependencies),a(s.peerDependencies),a(s.optionalDependencies);for(;r.length>0;){const s=r.shift(),n=c.get(s);if(n){for(const i of n)for(const p of[i.dependencies,i.peerDependencies,i.optionalDependencies])if(p)for(const f of Object.keys(p))e.has(f)||(e.add(f),r.push(f))}}return e},A=(o,t,e={})=>{const r=m(o,t);if(!r)return[];let c;try{c=u(l(o,r.file))}catch{return[]}const a=d(c,r.type);if(a.length===0)return[];const s=e.includeDev??!0?void 0:b(o,a),n=new Set,i=[];for(const p of a){if(s&&!s.has(p.name))continue;const f=`${p.name}@${p.version}`;n.has(f)||(n.add(f),i.push({isDev:!1,name:p.name,version:p.version}))}return i},M=(o,t)=>{const e=m(o,t);if(!e)return[];let r;try{r=u(l(o,e.file))}catch{return[]}const c=d(r,e.type);if(c.length===0)return[];const a=new Map;for(const n of c)a.has(n.name)||a.set(n.name,new Set),a.get(n.name).add(n.version);const s=[];for(const[n,i]of a)i.size<=1||s.push({name:n,versions:[...i]});return s.sort((n,i)=>n.name.localeCompare(i.name))},x=(o,t)=>{const e=m(o,t);if(!e)return;let r;try{r=u(l(o,e.file))}catch{return}const c=d(r,e.type);if(c.length===0)return;const a=[],s=new Set;for(const n of y(o))for(const i of[n.dependencies,n.devDependencies,n.peerDependencies,n.optionalDependencies])if(i)for(const[p,f]of Object.entries(i)){const h=`${p}@${f}`;s.has(h)||(s.add(h),a.push({name:p,version:f}))}return{entries:c,roots:a}};export{v as L,x as a,M as f,A as l,m as r};
|