@herbertgao/pi-extensions 2026.11.19 → 2026.11.21
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 +12 -0
- package/README.md +10 -10
- package/THIRD_PARTY_NOTICES.md +3 -3
- package/node_modules/@estebanforge/pi-antigravity-bridge/CHANGELOG.md +8 -0
- package/node_modules/@estebanforge/pi-antigravity-bridge/README.md +9 -5
- package/node_modules/@estebanforge/pi-antigravity-bridge/extensions/index.ts +11 -1
- package/node_modules/@estebanforge/pi-antigravity-bridge/package.json +1 -1
- package/node_modules/@estebanforge/pi-antigravity-bridge/src/config.ts +71 -13
- package/node_modules/@estebanforge/pi-antigravity-bridge/src/provider.ts +148 -47
- package/node_modules/@narumitw/pi-btw/CHANGELOG.md +7 -0
- package/node_modules/@narumitw/pi-btw/dist/chunks/{main-tree-picker-3PXJARQW.ts → main-tree-picker-WMTVRTR2.ts} +1 -1
- package/node_modules/@narumitw/pi-btw/dist/chunks/main-tree-picker-WMTVRTR2.ts.map +7 -0
- package/node_modules/@narumitw/pi-btw/dist/index.ts +1 -1
- package/node_modules/@narumitw/pi-btw/docs/core-alignment.md +6 -0
- package/node_modules/@narumitw/pi-btw/package.json +5 -5
- package/node_modules/@narumitw/pi-btw/src/main-tree-picker.ts +1 -1
- package/node_modules/@narumitw/pi-caffeinate/CHANGELOG.md +7 -0
- package/node_modules/@narumitw/pi-caffeinate/package.json +3 -3
- package/node_modules/pi-lens/CHANGELOG-USER.md +6 -6
- package/node_modules/pi-lens/CHANGELOG.md +121 -0
- package/node_modules/pi-lens/README.md +9 -2
- package/node_modules/pi-lens/dist/{chunk-ZVQUYCBU.js → chunk-2ERVW2UF.js} +161 -100
- package/node_modules/pi-lens/dist/{chunk-AFSG6YUB.js → chunk-2K7BUOKS.js} +13 -13
- package/node_modules/pi-lens/dist/{chunk-BJGWP4UX.js → chunk-3JJ4OAJI.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-GIK6VUCY.js → chunk-3UHGSUVL.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-EKQDQPX6.js → chunk-463WN3VP.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-F7BFIENK.js → chunk-4X3ML2UQ.js} +29 -32
- package/node_modules/pi-lens/dist/{chunk-7JMEPY6P.js → chunk-5BI5YP57.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-MKW7ZUTT.js → chunk-5Z4XLUFF.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-NIZKGBOU.js → chunk-62AJH3IN.js} +12 -14
- package/node_modules/pi-lens/dist/{chunk-4GLSO2EM.js → chunk-6F34GMP7.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-35UJUF27.js → chunk-6LIUVGOR.js} +13 -3
- package/node_modules/pi-lens/dist/{chunk-WJ7GY5WJ.js → chunk-6REF4GCO.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-HFIFEH46.js → chunk-7KRR24GO.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-WAK2AXQQ.js → chunk-7OMOMBEQ.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-S7KUDW73.js → chunk-7ZFXICNN.js} +15 -15
- package/node_modules/pi-lens/dist/{chunk-VEF3GFOL.js → chunk-ABKRQVOY.js} +28 -52
- package/node_modules/pi-lens/dist/{chunk-Y2LIOCA7.js → chunk-ANSLRJBG.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-ARTCVE6I.js → chunk-AWMFBPGJ.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-H6DNTQ4V.js → chunk-BG7KHGNX.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-FD4LJQ6Y.js → chunk-BK2R2223.js} +10 -8
- package/node_modules/pi-lens/dist/{chunk-TWAQFMLW.js → chunk-BXXC6KRR.js} +31 -34
- package/node_modules/pi-lens/dist/{chunk-S247BOH2.js → chunk-CKJS2AUI.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-GNK2IHVG.js → chunk-COGU5KQJ.js} +15 -15
- package/node_modules/pi-lens/dist/{chunk-P7EV5ISR.js → chunk-CQNXALZJ.js} +12 -6
- package/node_modules/pi-lens/dist/{chunk-IO6P3NBP.js → chunk-CSZESDPP.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-CZ5TCJPB.js +98 -0
- package/node_modules/pi-lens/dist/{chunk-DLGJYQML.js → chunk-D2LFEA5U.js} +9 -2
- package/node_modules/pi-lens/dist/chunk-D3KLF5CD.js +50 -0
- package/node_modules/pi-lens/dist/{chunk-W2JPGW7Q.js → chunk-ENJ2M76Y.js} +20 -20
- package/node_modules/pi-lens/dist/{chunk-2DWNYVUN.js → chunk-EQKF6BAK.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-KIQSNH3F.js → chunk-F2SAP2FM.js} +38 -45
- package/node_modules/pi-lens/dist/{chunk-BYIEU4E4.js → chunk-F6QAJXQV.js} +2 -2
- package/node_modules/pi-lens/dist/chunk-GR2QDWH5.js +25 -0
- package/node_modules/pi-lens/dist/{chunk-T2D2WWP6.js → chunk-GVE5VZYQ.js} +5 -5
- package/node_modules/pi-lens/dist/{chunk-HMXWZUQW.js → chunk-GWZZOJD2.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-GZS6VPIE.js +27 -0
- package/node_modules/pi-lens/dist/chunk-H4B4SC7I.js +71 -0
- package/node_modules/pi-lens/dist/{chunk-2RQREVGO.js → chunk-HA6TUJOE.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-NAACKIKT.js → chunk-HKPJTI47.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-NHHS5T52.js → chunk-HPKC55MA.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-B2QO7GHY.js → chunk-I65CQLCG.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-BQ72NQQM.js → chunk-IDKLWVKY.js} +11 -11
- package/node_modules/pi-lens/dist/chunk-IUM2Q7NF.js +25 -0
- package/node_modules/pi-lens/dist/{chunk-PVV27TOX.js → chunk-J24IS3KZ.js} +5 -5
- package/node_modules/pi-lens/dist/{chunk-DKXIUGNA.js → chunk-J2DAHH4T.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-CDAJQBKJ.js → chunk-JBDZVOFL.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-T7KHGEJ5.js → chunk-JC6NFC57.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-BWGNVM33.js → chunk-JTHEUTW7.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-WWZLT6AM.js → chunk-JWW3ODBN.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-Q32RJDYC.js → chunk-K3ZIYLHT.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-LDPY22FS.js → chunk-KDPZA2UE.js} +2 -3
- package/node_modules/pi-lens/dist/{chunk-YIEHUKX2.js → chunk-KMY2OU4T.js} +489 -285
- package/node_modules/pi-lens/dist/{chunk-WH6O4IFD.js → chunk-KQF7VT26.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-OG3UCAHV.js → chunk-KVGA7X76.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-TABDCX35.js → chunk-KW7O72AK.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-AOEVZXR6.js → chunk-LEQTVRSV.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-7BWPQZHE.js → chunk-LKPSBM6S.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-WA6U2URH.js → chunk-LKW2HFSZ.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-M3QGXGY4.js → chunk-LURFD4HD.js} +624 -97
- package/node_modules/pi-lens/dist/{chunk-2YQ5LI7R.js → chunk-M6ELTECW.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-OHTHVILU.js → chunk-MGVVYYKW.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-W2YHHNY3.js → chunk-MQBKGRSB.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-MET776XM.js → chunk-MVG2ZEAO.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-2XALJI2K.js → chunk-MY4XNNTX.js} +39 -41
- package/node_modules/pi-lens/dist/{chunk-GFCPPCNR.js → chunk-N4AJVFRF.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-UARVPNAU.js → chunk-OFKKMXWM.js} +31 -36
- package/node_modules/pi-lens/dist/{chunk-DHFJS2I4.js → chunk-OFZE4ANN.js} +8 -8
- package/node_modules/pi-lens/dist/chunk-OLXBUTJR.js +61 -0
- package/node_modules/pi-lens/dist/{chunk-SJ2SR432.js → chunk-OZGEHOSG.js} +38 -17
- package/node_modules/pi-lens/dist/{chunk-6MDWNZ7E.js → chunk-PKGOROPQ.js} +40 -2
- package/node_modules/pi-lens/dist/{chunk-3IWMNN2S.js → chunk-Q6D5QKRG.js} +17 -17
- package/node_modules/pi-lens/dist/{chunk-JGCBMCCS.js → chunk-QECLJFHI.js} +12 -17
- package/node_modules/pi-lens/dist/{chunk-KXKM2DFP.js → chunk-QJA33VD5.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-YV7XVYSJ.js → chunk-R5XVJ6AN.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-62PIU4TO.js → chunk-REZL4OM4.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-NNDZ7DOP.js → chunk-RK5RBREN.js} +74 -107
- package/node_modules/pi-lens/dist/chunk-RP5ZQTHO.js +86 -0
- package/node_modules/pi-lens/dist/{chunk-HKRESBMC.js → chunk-RURPX2YV.js} +23 -23
- package/node_modules/pi-lens/dist/chunk-TB5MGZLS.js +53 -0
- package/node_modules/pi-lens/dist/chunk-TC63XRYP.js +27 -0
- package/node_modules/pi-lens/dist/chunk-TJOYHAXJ.js +69 -0
- package/node_modules/pi-lens/dist/{chunk-NZ7NSKIW.js → chunk-TRXKDCBP.js} +13 -13
- package/node_modules/pi-lens/dist/{chunk-7WAQ3K26.js → chunk-TTK37D7R.js} +22 -23
- package/node_modules/pi-lens/dist/{chunk-ALTHJUZO.js → chunk-UH3QHLR5.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-6MZLS6CK.js → chunk-UNTJJ7GN.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-XRLZ75YY.js → chunk-UPAFSETJ.js} +54 -59
- package/node_modules/pi-lens/dist/{chunk-N2U644ZW.js → chunk-UX75PTQW.js} +50 -17
- package/node_modules/pi-lens/dist/{chunk-EXHSWN3P.js → chunk-V353PYMK.js} +423 -233
- package/node_modules/pi-lens/dist/{chunk-SL4G67AP.js → chunk-V4TFQY5G.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-YOMLAKU6.js → chunk-VC3W54G3.js} +289 -138
- package/node_modules/pi-lens/dist/{chunk-KSQJBGRO.js → chunk-VSBCJVPC.js} +5 -5
- package/node_modules/pi-lens/dist/{chunk-EBXCYEII.js → chunk-WAQQGXVV.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-7ORBRDFY.js → chunk-WLEVWR7Y.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-Q4UQNTLB.js → chunk-WPMPVP5I.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-TQKWR5AZ.js → chunk-WXNLFOC2.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-HOWHAKXO.js → chunk-Y3ZNOZZS.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-DNJJVKJZ.js → chunk-YL6JQTWC.js} +29 -32
- package/node_modules/pi-lens/dist/{chunk-HUWW77QY.js → chunk-YVE5Q2UU.js} +86 -217
- package/node_modules/pi-lens/dist/{chunk-25CAONWT.js → chunk-YZNARDMM.js} +12 -9
- package/node_modules/pi-lens/dist/{chunk-HERQPNY6.js → chunk-ZDWNFZJ2.js} +8 -8
- package/node_modules/pi-lens/dist/{chunk-MKQFSW2Q.js → chunk-ZEUF7BIN.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-AB26NAHA.js → chunk-ZIF4WLWR.js} +45 -25
- package/node_modules/pi-lens/dist/{chunk-6MWX2J5H.js → chunk-ZSPVF7KI.js} +227 -24
- package/node_modules/pi-lens/dist/{chunk-QQGZY2BR.js → chunk-ZX6OKBVO.js} +2 -2
- package/node_modules/pi-lens/dist/index.js +6455 -5243
- package/node_modules/pi-lens/dist/mcp/analyze-cli.js +8 -8
- package/node_modules/pi-lens/dist/mcp/cli.js +39 -41
- package/node_modules/pi-lens/dist/mcp/server.js +870 -559
- package/node_modules/pi-lens/dist/mcp/worker.js +68 -59
- package/node_modules/pi-lens/dist/probes/installer.js +19 -20
- package/node_modules/pi-lens/docs/configuration.md +24 -10
- package/node_modules/pi-lens/docs/defect-shapes.md +18 -2
- package/node_modules/pi-lens/docs/environment-variables.md +18 -9
- package/node_modules/pi-lens/docs/globalconfig.md +16 -0
- package/node_modules/pi-lens/docs/invariants/dispatch-runners.md +7 -0
- package/node_modules/pi-lens/docs/invariants/lsp-trust-exec.md +33 -3
- package/node_modules/pi-lens/docs/lsp-capability-matrix.md +23 -10
- package/node_modules/pi-lens/docs/lsp-idle-eviction.md +8 -3
- package/node_modules/pi-lens/docs/release-qa-baseline.md +22 -17
- package/node_modules/pi-lens/docs/servercapabilities.md +1 -1
- package/node_modules/pi-lens/docs/settings.md +9 -2
- package/node_modules/pi-lens/docs/tools.md +1 -1
- package/node_modules/pi-lens/package.json +3 -3
- package/node_modules/pi-typesafe/README.md +1 -1
- package/node_modules/pi-typesafe/dist/ask.js +6 -3
- package/node_modules/pi-typesafe/dist/auth.d.ts +31 -7
- package/node_modules/pi-typesafe/dist/auth.js +159 -55
- package/node_modules/pi-typesafe/dist/batch.d.ts +16 -2
- package/node_modules/pi-typesafe/dist/batch.js +62 -22
- package/node_modules/pi-typesafe/dist/calibrate.d.ts +38 -11
- package/node_modules/pi-typesafe/dist/calibrate.js +56 -24
- package/node_modules/pi-typesafe/dist/client.d.ts +13 -0
- package/node_modules/pi-typesafe/dist/client.js +67 -27
- package/node_modules/pi-typesafe/dist/errors.d.ts +20 -0
- package/node_modules/pi-typesafe/dist/errors.js +105 -2
- package/node_modules/pi-typesafe/dist/extension.d.ts +106 -0
- package/node_modules/pi-typesafe/dist/extension.js +206 -106
- package/node_modules/pi-typesafe/dist/index.d.ts +8 -8
- package/node_modules/pi-typesafe/dist/index.js +3 -3
- package/node_modules/pi-typesafe/dist/key-prompt.d.ts +20 -0
- package/node_modules/pi-typesafe/dist/key-prompt.js +23 -3
- package/node_modules/pi-typesafe/dist/login.d.ts +58 -1
- package/node_modules/pi-typesafe/dist/login.js +167 -13
- package/node_modules/pi-typesafe/dist/schema.d.ts +3 -0
- package/node_modules/pi-typesafe/dist/schema.js +47 -13
- package/node_modules/pi-typesafe/dist/ui.d.ts +2 -1
- package/node_modules/pi-typesafe/dist/usage.d.ts +53 -0
- package/node_modules/pi-typesafe/dist/usage.js +79 -40
- package/node_modules/pi-typesafe/package.json +3 -3
- package/package.json +8 -8
- package/node_modules/@narumitw/pi-btw/dist/chunks/main-tree-picker-3PXJARQW.ts.map +0 -7
- package/node_modules/pi-lens/dist/chunk-3UTDLQWO.js +0 -88
- package/node_modules/pi-lens/dist/chunk-3Z7Z3B7V.js +0 -27
- package/node_modules/pi-lens/dist/chunk-4E4OCW3L.js +0 -38
- package/node_modules/pi-lens/dist/chunk-5HVDD7IA.js +0 -17
- package/node_modules/pi-lens/dist/chunk-BKJ6WZKP.js +0 -255
- package/node_modules/pi-lens/dist/chunk-D3UQWOCB.js +0 -46
- package/node_modules/pi-lens/dist/chunk-EH6EHFW2.js +0 -73
- package/node_modules/pi-lens/dist/chunk-J7VNGHLN.js +0 -69
- package/node_modules/pi-lens/dist/chunk-L3Q72QGQ.js +0 -25
- package/node_modules/pi-lens/dist/chunk-TFSBHRL2.js +0 -25
- package/node_modules/pi-lens/dist/chunk-UWBD3JMH.js +0 -56
- package/node_modules/pi-lens/dist/chunk-XWWFESYZ.js +0 -27
- package/node_modules/pi-lens/dist/chunk-XZSXSM4K.js +0 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herbertgao/pi-extensions",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.21",
|
|
4
4
|
"description": "Aggregate installer for HerbertGao-maintained Pi extensions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"extensions",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"postpack": "node ../../scripts/aggregate-bundle.mjs restore"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@ast-grep/cli": "0.51.
|
|
39
|
+
"@ast-grep/cli": "0.51.2",
|
|
40
40
|
"@ast-grep/napi": "^0.51.0",
|
|
41
41
|
"@dietrichgebert/ponytail": "5.3.3",
|
|
42
|
-
"@estebanforge/pi-antigravity-bridge": "1.13.
|
|
42
|
+
"@estebanforge/pi-antigravity-bridge": "1.13.2",
|
|
43
43
|
"@estebanforge/pi-ask-shared": "^0.1.6",
|
|
44
44
|
"@estebanforge/pi-tui-dialogs": "^0.1.3",
|
|
45
45
|
"@herbertgao/pi-agency": "0.1.4",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
55
55
|
"@mozilla/readability": "^0.6.0",
|
|
56
56
|
"@napi-rs/keyring": "^2.1.0",
|
|
57
|
-
"@narumitw/pi-btw": "0.63.
|
|
58
|
-
"@narumitw/pi-caffeinate": "0.49.
|
|
59
|
-
"@narumitw/pi-tui-kit": "^0.
|
|
57
|
+
"@narumitw/pi-btw": "0.63.9",
|
|
58
|
+
"@narumitw/pi-caffeinate": "0.49.16",
|
|
59
|
+
"@narumitw/pi-tui-kit": "^0.71.0",
|
|
60
60
|
"@pi-plugins/fast-mode": "0.1.16",
|
|
61
61
|
"@shikijs/cli": "^4.0.2",
|
|
62
62
|
"@tifan/pi-copy-response": "0.2.7",
|
|
@@ -78,10 +78,10 @@
|
|
|
78
78
|
"nanoid": "^5.1.16",
|
|
79
79
|
"p-limit": "^6.1.0",
|
|
80
80
|
"pi-commandcode-provider": "0.8.7",
|
|
81
|
-
"pi-lens": "4.5.
|
|
81
|
+
"pi-lens": "4.5.2",
|
|
82
82
|
"pi-next-cue": "1.0.8",
|
|
83
83
|
"pi-provider-qoder": "0.6.13",
|
|
84
|
-
"pi-typesafe": "0.
|
|
84
|
+
"pi-typesafe": "0.15.1",
|
|
85
85
|
"pi-web-access": "0.48.0",
|
|
86
86
|
"pidusage": "^4.0.1",
|
|
87
87
|
"promise.try": "^2.0.1",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/main-tree-picker.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n copyToClipboard,\n type ExtensionAPI,\n type ExtensionCommandContext,\n type SessionEntry,\n type SessionTreeNode,\n TreeSelectorComponent,\n} from \"@earendil-works/pi-coding-agent\";\nimport { type Component, type Focusable, Key, matchesKey } from \"@earendil-works/pi-tui\";\nimport { showBtwCustomPreservingEditor } from \"./menu.js\";\nimport { sanitizeSingleLine } from \"./text.js\";\n\nexport type MainEntryPickResult = { kind: \"selected\"; entryId: string } | { kind: \"back\" } | { kind: \"closed\" };\n\nexport interface MainThreadTreeSelector extends Component, Focusable {\n onCopy?: (text: string | undefined) => void;\n setViewLabel?(entryId: string, label: string | undefined, labelTimestamp?: string): void;\n dispose?(): void;\n}\n\nexport interface MainThreadTreeSelectorOptions {\n tree: SessionTreeNode[];\n currentLeafId: string | null;\n terminalRows: number;\n onSelect: (entryId: string) => void;\n onCancel: () => void;\n onCopy: (entryId: string | undefined, displayText: string | undefined) => void;\n onLabelChange: (entryId: string, label: string | undefined) => void;\n}\n\nexport interface MainThreadTreePickerDependencies {\n createSelector?: (options: MainThreadTreeSelectorOptions) => MainThreadTreeSelector;\n copyToClipboard?: (text: string, signal: AbortSignal) => Promise<void>;\n}\n\nclass MainThreadTreePickerComponent implements Component, Focusable {\n constructor(\n private readonly selector: MainThreadTreeSelector,\n private readonly onClose: () => void,\n ) {}\n\n get focused(): boolean {\n return this.selector.focused;\n }\n\n set focused(value: boolean) {\n this.selector.focused = value;\n }\n\n get wantsKeyRelease(): boolean | undefined {\n return this.selector.wantsKeyRelease;\n }\n\n render(width: number): string[] {\n return this.selector.render(width);\n }\n\n handleInput(data: string): void {\n if (matchesKey(data, Key.ctrl(\"c\"))) {\n this.onClose();\n return;\n }\n this.selector.handleInput?.(data);\n }\n\n invalidate(): void {\n this.selector.invalidate();\n }\n\n dispose(): void {\n this.selector.dispose?.();\n this.onClose();\n }\n}\n\nexport async function pickMainEntry(\n pi: ExtensionAPI,\n ctx: ExtensionCommandContext,\n dependencies: MainThreadTreePickerDependencies = {},\n): Promise<MainEntryPickResult> {\n let rawTree: SessionTreeNode[];\n let currentLeafId: string | null;\n try {\n rawTree = ctx.sessionManager.getTree();\n currentLeafId = ctx.sessionManager.getLeafId();\n } catch {\n return { kind: \"closed\" };\n }\n\n if (rawTree.length === 0) {\n notifySafely(ctx, \"No main-thread entries are available\", \"warning\");\n return { kind: \"back\" };\n }\n\n const { tree, rawCopyText, savedLabels } = prepareTreeSnapshot(rawTree);\n const createSelector = dependencies.createSelector ?? createNativeTreeSelector;\n const copy = dependencies.copyToClipboard ?? copyText;\n const copyControllers = new Set<AbortController>();\n const copyTasks = new Set<Promise<void>>();\n const abortCopies = () => {\n for (const controller of copyControllers) {\n controller.abort(new Error(\"The main-thread tree picker closed\"));\n }\n };\n const result = await showBtwCustomPreservingEditor<MainEntryPickResult>(ctx, (tui, _theme, _keybindings, done) => {\n let settled = false;\n let selector: MainThreadTreeSelector | undefined;\n const finish = (value: MainEntryPickResult) => {\n if (settled) return;\n settled = true;\n abortCopies();\n done(value);\n };\n const onCopy = (entryId: string | undefined, displayText: string | undefined) => {\n if (settled) return;\n let text: string | undefined;\n try {\n const source = entryId ? rawCopyText.get(entryId) : displayText;\n text = typeof source === \"string\" ? source : source?.join(\"\");\n } catch (error: unknown) {\n notifySafely(ctx, `Could not copy selected message: ${formatError(error)}`, \"error\");\n return;\n }\n if (!text) {\n notifySafely(ctx, \"Selected entry has no text to copy\", \"warning\");\n return;\n }\n const controller = new AbortController();\n copyControllers.add(controller);\n let operation: Promise<void>;\n try {\n operation = copy(text, controller.signal);\n } catch (error: unknown) {\n operation = Promise.reject(error);\n }\n let task!: Promise<void>;\n task = operation\n .then(() => {\n if (!settled) notifySafely(ctx, \"Copied selected message\", \"info\");\n })\n .catch((error: unknown) => {\n if (!settled && !controller.signal.aborted) {\n notifySafely(ctx, `Could not copy selected message: ${formatError(error)}`, \"error\");\n }\n })\n .finally(() => {\n copyControllers.delete(controller);\n copyTasks.delete(task);\n });\n copyTasks.add(task);\n };\n const restoreLabel = (entryId: string) => {\n const previous = savedLabels.get(entryId);\n selector?.setViewLabel?.(entryId, previous?.label, previous?.labelTimestamp);\n tui.requestRender();\n };\n const onLabelChange = (entryId: string, label: string | undefined) => {\n if (settled) return;\n try {\n if (!ctx.sessionManager.getEntry(entryId)) {\n restoreLabel(entryId);\n notifySafely(ctx, \"The selected main-thread entry is no longer available\", \"warning\");\n return;\n }\n const persistedLabel = label === undefined ? undefined : sanitizeSingleLine(label);\n pi.setLabel(entryId, persistedLabel);\n if (persistedLabel === undefined) savedLabels.delete(entryId);\n else savedLabels.set(entryId, { label: persistedLabel });\n selector?.setViewLabel?.(entryId, persistedLabel);\n tui.requestRender();\n } catch (error: unknown) {\n restoreLabel(entryId);\n notifySafely(ctx, `Could not update tree label: ${formatError(error)}`, \"error\");\n }\n };\n selector = createSelector({\n tree,\n currentLeafId,\n terminalRows: tui.terminal.rows,\n onSelect: (entryId) => finish({ kind: \"selected\", entryId }),\n onCancel: () => finish({ kind: \"back\" }),\n onCopy,\n onLabelChange,\n });\n return new MainThreadTreePickerComponent(selector, () => finish({ kind: \"closed\" }));\n });\n abortCopies();\n await Promise.allSettled([...copyTasks]);\n\n return result ?? { kind: \"closed\" };\n}\n\nfunction createNativeTreeSelector(options: MainThreadTreeSelectorOptions): MainThreadTreeSelector {\n const selector = new TreeSelectorComponent(\n options.tree,\n options.currentLeafId,\n options.terminalRows,\n options.onSelect,\n options.onCancel,\n options.onLabelChange,\n );\n selector.onCopy = (displayText) => options.onCopy(selector.getTreeList().getSelectedNode()?.entry.id, displayText);\n const result = selector as MainThreadTreeSelector;\n result.setViewLabel = (entryId, label, labelTimestamp) =>\n selector.getTreeList().updateNodeLabel(entryId, label, labelTimestamp);\n return result;\n}\n\ntype RawCopySource = string | readonly string[];\n\n/** @internal Package-local snapshot test boundary; not an extension entrypoint. */\nexport function prepareTreeSnapshot(rawTree: readonly SessionTreeNode[]): {\n tree: SessionTreeNode[];\n rawCopyText: Map<string, RawCopySource>;\n savedLabels: Map<string, SavedLabel>;\n} {\n const tree: SessionTreeNode[] = [];\n const rawCopyText = new Map<string, RawCopySource>();\n const savedLabels = new Map<string, SavedLabel>();\n // Keep traversal state on the heap: valid session histories can be arbitrarily deep.\n const stack = [{ source: rawTree, target: tree, index: 0 }];\n while (stack.length > 0) {\n const frame = stack[stack.length - 1];\n if (frame.index === frame.source.length) {\n stack.pop();\n continue;\n }\n const node = frame.source[frame.index++];\n const label = node.label === undefined ? undefined : sanitizeSingleLine(node.label);\n const labelTimestamp = node.labelTimestamp === undefined ? undefined : sanitizeSingleLine(node.labelTimestamp);\n const displayNode: SessionTreeNode = {\n entry: sanitizeEntryForDisplay(node.entry),\n children: [],\n };\n if (label !== undefined) displayNode.label = label;\n if (labelTimestamp !== undefined) displayNode.labelTimestamp = labelTimestamp;\n frame.target.push(displayNode);\n const source = captureRawCopySource(node.entry);\n if (source !== undefined) rawCopyText.set(node.entry.id, source);\n if (label !== undefined || labelTimestamp !== undefined) {\n savedLabels.set(node.entry.id, { label, labelTimestamp });\n }\n if (node.children.length > 0) {\n stack.push({ source: node.children, target: displayNode.children, index: 0 });\n }\n }\n return { tree, rawCopyText, savedLabels };\n}\n\nfunction sanitizeEntryForDisplay(entry: SessionEntry): SessionEntry {\n switch (entry.type) {\n case \"message\": {\n const message = { ...entry.message } as Record<string, unknown>;\n if (\"content\" in entry.message) message.content = sanitizeDisplayContent(entry.message.content);\n for (const key of [\"role\", \"errorMessage\", \"command\", \"toolName\"] as const) {\n const value = message[key];\n if (typeof value === \"string\") message[key] = sanitizeSingleLine(value);\n }\n return { ...entry, message } as unknown as SessionEntry;\n }\n case \"custom_message\":\n return {\n ...entry,\n customType: sanitizeSingleLine(entry.customType),\n content: sanitizeDisplayContent(entry.content) as typeof entry.content,\n };\n case \"compaction\":\n return { ...entry, summary: sanitizeSingleLine(entry.summary) };\n case \"branch_summary\":\n return { ...entry, summary: sanitizeSingleLine(entry.summary) };\n case \"model_change\":\n return {\n ...entry,\n provider: sanitizeSingleLine(entry.provider),\n modelId: sanitizeSingleLine(entry.modelId),\n };\n case \"thinking_level_change\":\n return { ...entry, thinkingLevel: sanitizeSingleLine(entry.thinkingLevel) };\n case \"custom\":\n return { ...entry, customType: sanitizeSingleLine(entry.customType) };\n case \"context_edit\":\n return { ...entry, targetId: sanitizeSingleLine(entry.targetId) };\n case \"label\":\n return {\n ...entry,\n label: entry.label === undefined ? undefined : sanitizeSingleLine(entry.label),\n };\n case \"session_info\":\n return {\n ...entry,\n name: entry.name === undefined ? undefined : sanitizeSingleLine(entry.name),\n };\n case \"usage\":\n return {\n ...entry,\n kind: sanitizeSingleLine(entry.kind),\n provider: sanitizeSingleLine(entry.provider),\n model: sanitizeSingleLine(entry.model),\n note: entry.note === undefined ? undefined : sanitizeSingleLine(entry.note),\n };\n }\n}\n\nfunction sanitizeDisplayContent(content: unknown): unknown {\n if (typeof content === \"string\") return sanitizeSingleLine(content);\n if (!Array.isArray(content)) return content;\n return content.map((block) => {\n if (block === null || typeof block !== \"object\" || !(\"type\" in block)) return block;\n if (block.type === \"text\" && \"text\" in block && typeof block.text === \"string\") {\n return { ...block, text: sanitizeSingleLine(block.text) };\n }\n if (block.type === \"toolCall\") {\n const copy = { ...block } as Record<string, unknown>;\n if (typeof copy.name === \"string\") copy.name = sanitizeSingleLine(copy.name);\n copy.arguments = sanitizeToolArguments(copy.arguments, new WeakMap());\n return copy;\n }\n return block;\n });\n}\n\nfunction sanitizeToolArguments(value: unknown, seen: WeakMap<object, unknown>): unknown {\n if (typeof value === \"string\") return sanitizeSingleLine(value);\n if (value === null || typeof value !== \"object\") return value;\n const existing = seen.get(value);\n if (existing !== undefined) return existing;\n if (Array.isArray(value)) {\n const result: unknown[] = [];\n seen.set(value, result);\n for (const item of value) result.push(sanitizeToolArguments(item, seen));\n return result;\n }\n const result: Record<string, unknown> = {};\n seen.set(value, result);\n for (const [key, item] of Object.entries(value)) {\n result[key] = sanitizeToolArguments(item, seen);\n }\n return result;\n}\n\nfunction captureRawCopySource(entry: SessionEntry): RawCopySource | undefined {\n let source: RawCopySource | undefined;\n if (entry.type === \"message\") {\n if (entry.message.role === \"bashExecution\") source = entry.message.command;\n else if (\"content\" in entry.message) {\n source = captureRawText(entry.message.content);\n const empty = typeof source === \"string\" ? source.length === 0 : source.every((part) => part.length === 0);\n if (empty && entry.message.role === \"assistant\") source = entry.message.errorMessage;\n }\n } else if (entry.type === \"custom_message\") source = captureRawText(entry.content);\n else if (entry.type === \"compaction\" || entry.type === \"branch_summary\") source = entry.summary;\n if (typeof source === \"string\") return /\\S/u.test(source) ? source : undefined;\n return source?.some((part) => /\\S/u.test(part)) ? source : undefined;\n}\n\nfunction captureRawText(content: unknown): RawCopySource {\n if (typeof content === \"string\") return content;\n if (!Array.isArray(content)) return \"\";\n // Retain immutable strings, not live blocks or joined copies of every message.\n const parts: string[] = [];\n for (const block of content) {\n if (\n block !== null &&\n typeof block === \"object\" &&\n \"type\" in block &&\n block.type === \"text\" &&\n \"text\" in block &&\n typeof block.text === \"string\"\n ) {\n parts.push(block.text);\n }\n }\n return parts.length === 1 ? parts[0] : parts;\n}\n\ninterface SavedLabel {\n label: string | undefined;\n labelTimestamp?: string;\n}\n\nasync function copyText(text: string, signal: AbortSignal): Promise<void> {\n signal.throwIfAborted();\n await copyToClipboard(text);\n signal.throwIfAborted();\n}\n\nfunction notifySafely(\n ctx: ExtensionCommandContext,\n message: string,\n level: Parameters<ExtensionCommandContext[\"ui\"][\"notify\"]>[1],\n): void {\n try {\n ctx.ui.notify(sanitizeSingleLine(message), level);\n } catch {\n // The command context may have been replaced while the selector was open.\n }\n}\n\nfunction formatError(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAAA;AAAA,EACE;AAAA,EAKA;AAAA,OACK;AACP,SAAyC,KAAK,kBAAkB;AA2BhE,IAAM,gCAAN,MAAoE;AAAA,EAClE,YACmB,UACA,SACjB;AAFiB;AACA;AAAA,EAChB;AAAA,EAFgB;AAAA,EACA;AAAA,EAGnB,IAAI,UAAmB;AACrB,WAAO,KAAK,SAAS;AAAA,EACvB;AAAA,EAEA,IAAI,QAAQ,OAAgB;AAC1B,SAAK,SAAS,UAAU;AAAA,EAC1B;AAAA,EAEA,IAAI,kBAAuC;AACzC,WAAO,KAAK,SAAS;AAAA,EACvB;AAAA,EAEA,OAAO,OAAyB;AAC9B,WAAO,KAAK,SAAS,OAAO,KAAK;AAAA,EACnC;AAAA,EAEA,YAAY,MAAoB;AAC9B,QAAI,WAAW,MAAM,IAAI,KAAK,GAAG,CAAC,GAAG;AACnC,WAAK,QAAQ;AACb;AAAA,IACF;AACA,SAAK,SAAS,cAAc,IAAI;AAAA,EAClC;AAAA,EAEA,aAAmB;AACjB,SAAK,SAAS,WAAW;AAAA,EAC3B;AAAA,EAEA,UAAgB;AACd,SAAK,SAAS,UAAU;AACxB,SAAK,QAAQ;AAAA,EACf;AACF;AAEA,eAAsB,cACpB,IACA,KACA,eAAiD,CAAC,GACpB;AAC9B,MAAI;AACJ,MAAI;AACJ,MAAI;AACF,cAAU,IAAI,eAAe,QAAQ;AACrC,oBAAgB,IAAI,eAAe,UAAU;AAAA,EAC/C,QAAQ;AACN,WAAO,EAAE,MAAM,S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,UAAS,eAAe,MAAM,OAAO;AAAA,WACxE,MAAM,SAAS,gBAAgB,MAAM,SAAS,iBAAkB,UAAS,MAAM;AACxF,MAAI,OAAO,WAAW,SAAU,QAAO,MAAM,KAAK,MAAM,IAAI,SAAS;AACrE,SAAO,QAAQ,KAAK,CAAC,SAAS,MAAM,KAAK,IAAI,CAAC,IAAI,SAAS;AAC7D;AAEA,SAAS,eAAe,SAAiC;AACvD,MAAI,OAAO,YAAY,SAAU,QAAO;AACxC,MAAI,CAAC,MAAM,QAAQ,OAAO,EAAG,QAAO;AAEpC,QAAM,QAAkB,CAAC;AACzB,aAAW,SAAS,SAAS;AAC3B,QACE,UAAU,QACV,OAAO,UAAU,YACjB,UAAU,SACV,MAAM,SAAS,UACf,UAAU,SACV,OAAO,MAAM,SAAS,UACtB;AACA,YAAM,KAAK,MAAM,IAAI;AAAA,IACvB;AAAA,EACF;AACA,SAAO,MAAM,WAAW,IAAI,MAAM,CAAC,IAAI;AACzC;AAOA,eAAe,SAAS,MAAc,QAAoC;AACxE,SAAO,eAAe;AACtB,QAAM,gBAAgB,IAAI;AAC1B,SAAO,eAAe;AACxB;AAEA,SAAS,aACP,KACA,SACA,OACM;AACN,MAAI;AACF,QAAI,GAAG,OAAO,mBAAmB,OAAO,GAAG,KAAK;AAAA,EAClD,QAAQ;AAAA,EAER;AACF;AAEA,SAAS,YAAY,OAAwB;AAC3C,SAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D;",
|
|
6
|
-
"names": ["result"]
|
|
7
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
_getWarmWordIndexCacheStateForTests,
|
|
4
|
-
_resetWarmWordIndexCacheForTests,
|
|
5
|
-
acquireWarmWordIndex,
|
|
6
|
-
analyzeFile,
|
|
7
|
-
summarizeWarningTiers
|
|
8
|
-
} from "./chunk-ZVQUYCBU.js";
|
|
9
|
-
import "./chunk-BKJ6WZKP.js";
|
|
10
|
-
import "./chunk-2RQREVGO.js";
|
|
11
|
-
import "./chunk-T7KHGEJ5.js";
|
|
12
|
-
import "./chunk-7ORBRDFY.js";
|
|
13
|
-
import "./chunk-W2YHHNY3.js";
|
|
14
|
-
import "./chunk-OG3UCAHV.js";
|
|
15
|
-
import "./chunk-FD4LJQ6Y.js";
|
|
16
|
-
import "./chunk-HFIFEH46.js";
|
|
17
|
-
import "./chunk-QQGZY2BR.js";
|
|
18
|
-
import "./chunk-ALTHJUZO.js";
|
|
19
|
-
import "./chunk-S247BOH2.js";
|
|
20
|
-
import "./chunk-JGCBMCCS.js";
|
|
21
|
-
import "./chunk-NNDZ7DOP.js";
|
|
22
|
-
import "./chunk-Q32RJDYC.js";
|
|
23
|
-
import "./chunk-2YQ5LI7R.js";
|
|
24
|
-
import "./chunk-Y2LIOCA7.js";
|
|
25
|
-
import "./chunk-IO6P3NBP.js";
|
|
26
|
-
import "./chunk-W2JPGW7Q.js";
|
|
27
|
-
import "./chunk-3MED75HT.js";
|
|
28
|
-
import "./chunk-PKLB2XJL.js";
|
|
29
|
-
import "./chunk-EXHSWN3P.js";
|
|
30
|
-
import "./chunk-35UJUF27.js";
|
|
31
|
-
import "./chunk-XIMYZ3JA.js";
|
|
32
|
-
import "./chunk-YIEHUKX2.js";
|
|
33
|
-
import "./chunk-J7VNGHLN.js";
|
|
34
|
-
import "./chunk-AB26NAHA.js";
|
|
35
|
-
import "./chunk-5HVDD7IA.js";
|
|
36
|
-
import "./chunk-B2QO7GHY.js";
|
|
37
|
-
import "./chunk-5W3R6LFT.js";
|
|
38
|
-
import "./chunk-S7KUDW73.js";
|
|
39
|
-
import "./chunk-KSQJBGRO.js";
|
|
40
|
-
import "./chunk-H6DNTQ4V.js";
|
|
41
|
-
import "./chunk-4GLSO2EM.js";
|
|
42
|
-
import "./chunk-Z54ZSOBZ.js";
|
|
43
|
-
import "./chunk-2DWNYVUN.js";
|
|
44
|
-
import "./chunk-6HWVI6MI.js";
|
|
45
|
-
import "./chunk-HMXWZUQW.js";
|
|
46
|
-
import "./chunk-MET776XM.js";
|
|
47
|
-
import "./chunk-BQ72NQQM.js";
|
|
48
|
-
import "./chunk-BYIEU4E4.js";
|
|
49
|
-
import "./chunk-NAACKIKT.js";
|
|
50
|
-
import "./chunk-6MDWNZ7E.js";
|
|
51
|
-
import "./chunk-2APSZHHI.js";
|
|
52
|
-
import "./chunk-62PIU4TO.js";
|
|
53
|
-
import "./chunk-2BEMIWEW.js";
|
|
54
|
-
import "./chunk-IJYGIDF4.js";
|
|
55
|
-
import "./chunk-YOMLAKU6.js";
|
|
56
|
-
import "./chunk-T2D2WWP6.js";
|
|
57
|
-
import "./chunk-25CAONWT.js";
|
|
58
|
-
import "./chunk-WWZLT6AM.js";
|
|
59
|
-
import "./chunk-DKXIUGNA.js";
|
|
60
|
-
import "./chunk-LDPY22FS.js";
|
|
61
|
-
import "./chunk-HOWHAKXO.js";
|
|
62
|
-
import "./chunk-WJ7GY5WJ.js";
|
|
63
|
-
import "./chunk-WA6U2URH.js";
|
|
64
|
-
import "./chunk-TABDCX35.js";
|
|
65
|
-
import "./chunk-TQWRH25U.js";
|
|
66
|
-
import "./chunk-UYXV5NIS.js";
|
|
67
|
-
import "./chunk-M3QGXGY4.js";
|
|
68
|
-
import "./chunk-GIK6VUCY.js";
|
|
69
|
-
import "./chunk-QYF5S6P6.js";
|
|
70
|
-
import "./chunk-N2U644ZW.js";
|
|
71
|
-
import "./chunk-SL4G67AP.js";
|
|
72
|
-
import "./chunk-DLGJYQML.js";
|
|
73
|
-
import "./chunk-CIA7X2PZ.js";
|
|
74
|
-
import "./chunk-EKQDQPX6.js";
|
|
75
|
-
import "./chunk-P7EV5ISR.js";
|
|
76
|
-
import "./chunk-S26LC76R.js";
|
|
77
|
-
import "./chunk-HUWW77QY.js";
|
|
78
|
-
import "./chunk-LJDODBBZ.js";
|
|
79
|
-
import "./chunk-NHHS5T52.js";
|
|
80
|
-
import "./chunk-6MWX2J5H.js";
|
|
81
|
-
import "./chunk-NXL4FFQQ.js";
|
|
82
|
-
export {
|
|
83
|
-
_getWarmWordIndexCacheStateForTests,
|
|
84
|
-
_resetWarmWordIndexCacheForTests,
|
|
85
|
-
acquireWarmWordIndex,
|
|
86
|
-
analyzeFile,
|
|
87
|
-
summarizeWarningTiers
|
|
88
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
GovulncheckClient,
|
|
4
|
-
parseGovulncheckJson
|
|
5
|
-
} from "./chunk-DHFJS2I4.js";
|
|
6
|
-
import "./chunk-FD4LJQ6Y.js";
|
|
7
|
-
import "./chunk-HFIFEH46.js";
|
|
8
|
-
import "./chunk-QQGZY2BR.js";
|
|
9
|
-
import "./chunk-5HVDD7IA.js";
|
|
10
|
-
import "./chunk-2APSZHHI.js";
|
|
11
|
-
import "./chunk-WWZLT6AM.js";
|
|
12
|
-
import "./chunk-LDPY22FS.js";
|
|
13
|
-
import "./chunk-M3QGXGY4.js";
|
|
14
|
-
import "./chunk-GIK6VUCY.js";
|
|
15
|
-
import "./chunk-N2U644ZW.js";
|
|
16
|
-
import "./chunk-DLGJYQML.js";
|
|
17
|
-
import "./chunk-EKQDQPX6.js";
|
|
18
|
-
import "./chunk-P7EV5ISR.js";
|
|
19
|
-
import "./chunk-S26LC76R.js";
|
|
20
|
-
import "./chunk-HUWW77QY.js";
|
|
21
|
-
import "./chunk-LJDODBBZ.js";
|
|
22
|
-
import "./chunk-6MWX2J5H.js";
|
|
23
|
-
import "./chunk-NXL4FFQQ.js";
|
|
24
|
-
export {
|
|
25
|
-
GovulncheckClient,
|
|
26
|
-
parseGovulncheckJson
|
|
27
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
GitleaksClient,
|
|
4
|
-
PLACEHOLDER_SECRET_REGEXES,
|
|
5
|
-
classifyAndFilterFindings,
|
|
6
|
-
hasGitRepo,
|
|
7
|
-
hasGitleaksSignal,
|
|
8
|
-
parseGitleaksReport,
|
|
9
|
-
writeScopedGitleaksConfig
|
|
10
|
-
} from "./chunk-PVV27TOX.js";
|
|
11
|
-
import "./chunk-OG3UCAHV.js";
|
|
12
|
-
import "./chunk-FD4LJQ6Y.js";
|
|
13
|
-
import "./chunk-HFIFEH46.js";
|
|
14
|
-
import "./chunk-QQGZY2BR.js";
|
|
15
|
-
import "./chunk-5HVDD7IA.js";
|
|
16
|
-
import "./chunk-2APSZHHI.js";
|
|
17
|
-
import "./chunk-WWZLT6AM.js";
|
|
18
|
-
import "./chunk-LDPY22FS.js";
|
|
19
|
-
import "./chunk-M3QGXGY4.js";
|
|
20
|
-
import "./chunk-GIK6VUCY.js";
|
|
21
|
-
import "./chunk-N2U644ZW.js";
|
|
22
|
-
import "./chunk-DLGJYQML.js";
|
|
23
|
-
import "./chunk-EKQDQPX6.js";
|
|
24
|
-
import "./chunk-P7EV5ISR.js";
|
|
25
|
-
import "./chunk-S26LC76R.js";
|
|
26
|
-
import "./chunk-HUWW77QY.js";
|
|
27
|
-
import "./chunk-LJDODBBZ.js";
|
|
28
|
-
import "./chunk-6MWX2J5H.js";
|
|
29
|
-
import "./chunk-NXL4FFQQ.js";
|
|
30
|
-
export {
|
|
31
|
-
GitleaksClient,
|
|
32
|
-
PLACEHOLDER_SECRET_REGEXES,
|
|
33
|
-
classifyAndFilterFindings,
|
|
34
|
-
hasGitRepo,
|
|
35
|
-
hasGitleaksSignal,
|
|
36
|
-
parseGitleaksReport,
|
|
37
|
-
writeScopedGitleaksConfig
|
|
38
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
isTestMode
|
|
4
|
-
} from "./chunk-HUWW77QY.js";
|
|
5
|
-
|
|
6
|
-
// dist/clients/scanner-temp-root.js
|
|
7
|
-
import * as os from "node:os";
|
|
8
|
-
function scannerReportParentDir() {
|
|
9
|
-
if (!isTestMode() && process.env.PI_LENS_TEST_SCANNER_HARNESS !== "1")
|
|
10
|
-
return os.tmpdir();
|
|
11
|
-
const override = process.env.PI_LENS_TEST_SCANNER_TMPDIR?.trim();
|
|
12
|
-
return override && override.length > 0 ? override : os.tmpdir();
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
scannerReportParentDir
|
|
17
|
-
};
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
classifyProbeFailure,
|
|
4
|
-
installRetryDelayMs
|
|
5
|
-
} from "./chunk-LDPY22FS.js";
|
|
6
|
-
import {
|
|
7
|
-
safeSpawnAsync
|
|
8
|
-
} from "./chunk-M3QGXGY4.js";
|
|
9
|
-
import {
|
|
10
|
-
assertInstallAllowed
|
|
11
|
-
} from "./chunk-EKQDQPX6.js";
|
|
12
|
-
import {
|
|
13
|
-
logExtension,
|
|
14
|
-
recordDegradationOnce
|
|
15
|
-
} from "./chunk-P7EV5ISR.js";
|
|
16
|
-
import {
|
|
17
|
-
isToolInstallDisabled
|
|
18
|
-
} from "./chunk-HUWW77QY.js";
|
|
19
|
-
import {
|
|
20
|
-
normalizeMapKey
|
|
21
|
-
} from "./chunk-6MWX2J5H.js";
|
|
22
|
-
|
|
23
|
-
// dist/clients/dispatch/collect-later-tier.js
|
|
24
|
-
var COLLECT_LATER_THRESHOLD_MS = 5e3;
|
|
25
|
-
var slowRunners = /* @__PURE__ */ new Map();
|
|
26
|
-
function runnerFlightKey(projectRoot, runnerId) {
|
|
27
|
-
return `${normalizeMapKey(projectRoot)}\0${runnerId}`;
|
|
28
|
-
}
|
|
29
|
-
function classifyObservedRunner(projectRoot, runnerId, dispatch) {
|
|
30
|
-
const runnerKey = runnerFlightKey(projectRoot, runnerId);
|
|
31
|
-
const flight = flights.get(runnerKey);
|
|
32
|
-
return slowRunners.has(runnerKey) || flight !== void 0 && (flight.owner === void 0 || flight.owner !== dispatch) ? "collect-later" : "inline";
|
|
33
|
-
}
|
|
34
|
-
function observeRunnerLatency(options) {
|
|
35
|
-
const normalizedProjectRoot = normalizeMapKey(options.projectRoot);
|
|
36
|
-
const runnerKey = runnerFlightKey(normalizedProjectRoot, options.runnerId);
|
|
37
|
-
if (options.timedOut === true || options.durationMs > COLLECT_LATER_THRESHOLD_MS) {
|
|
38
|
-
slowRunners.set(runnerKey, {
|
|
39
|
-
projectRoot: normalizedProjectRoot,
|
|
40
|
-
runnerId: options.runnerId
|
|
41
|
-
});
|
|
42
|
-
return "collect-later";
|
|
43
|
-
}
|
|
44
|
-
slowRunners.delete(runnerKey);
|
|
45
|
-
return "inline";
|
|
46
|
-
}
|
|
47
|
-
var flights = /* @__PURE__ */ new Map();
|
|
48
|
-
var DROPPED_BY_RESET = {
|
|
49
|
-
status: "skipped",
|
|
50
|
-
diagnostics: [],
|
|
51
|
-
semantic: "none"
|
|
52
|
-
};
|
|
53
|
-
function runCollectLater(options) {
|
|
54
|
-
const flightKey = runnerFlightKey(options.projectRoot, options.runnerId);
|
|
55
|
-
const flight = flights.get(flightKey);
|
|
56
|
-
if (flight) {
|
|
57
|
-
const fileKey = normalizeMapKey(options.filePath);
|
|
58
|
-
const queued = flight.queued.get(fileKey);
|
|
59
|
-
if (queued) {
|
|
60
|
-
queued.start = options.start;
|
|
61
|
-
return { promise: queued.promise, coalesced: true };
|
|
62
|
-
}
|
|
63
|
-
const slot = {
|
|
64
|
-
start: options.start,
|
|
65
|
-
promise: Promise.allSettled([flight.tail]).then(() => startQueued(flightKey, flight, fileKey, slot))
|
|
66
|
-
};
|
|
67
|
-
flight.queued.set(fileKey, slot);
|
|
68
|
-
chain(flightKey, flight, slot.promise);
|
|
69
|
-
return { promise: slot.promise, coalesced: true };
|
|
70
|
-
}
|
|
71
|
-
const promise = options.start();
|
|
72
|
-
holdFlight(flightKey, promise);
|
|
73
|
-
return { promise, coalesced: false };
|
|
74
|
-
}
|
|
75
|
-
function holdFlight(flightKey, promise, owner) {
|
|
76
|
-
const held = flights.get(flightKey);
|
|
77
|
-
if (held) {
|
|
78
|
-
chain(flightKey, held, Promise.allSettled([held.tail, promise]));
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
const started = { tail: promise, queued: /* @__PURE__ */ new Map(), owner };
|
|
82
|
-
flights.set(flightKey, started);
|
|
83
|
-
chain(flightKey, started, promise);
|
|
84
|
-
}
|
|
85
|
-
function flightTail(flightKey) {
|
|
86
|
-
return flights.get(flightKey)?.tail;
|
|
87
|
-
}
|
|
88
|
-
function startQueued(flightKey, flight, fileKey, slot) {
|
|
89
|
-
if (flights.get(flightKey) !== flight)
|
|
90
|
-
return DROPPED_BY_RESET;
|
|
91
|
-
flight.queued.delete(fileKey);
|
|
92
|
-
return slot.start();
|
|
93
|
-
}
|
|
94
|
-
function chain(flightKey, flight, run) {
|
|
95
|
-
flight.tail = run;
|
|
96
|
-
void Promise.allSettled([run]).then(() => {
|
|
97
|
-
if (flight.tail === run && flights.get(flightKey) === flight)
|
|
98
|
-
flights.delete(flightKey);
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
function resetObservedRunnerLatency() {
|
|
102
|
-
slowRunners.clear();
|
|
103
|
-
flights.clear();
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// dist/clients/dispatch/runners/utils/lazy-installer.js
|
|
107
|
-
var LAZY_INSTALL_SPECS = {
|
|
108
|
-
rubocop: { command: "gem", args: ["install", "rubocop", "--no-document"] },
|
|
109
|
-
"rust-clippy": { command: "rustup", args: ["component", "add", "clippy"] },
|
|
110
|
-
rustfmt: { command: "rustup", args: ["component", "add", "rustfmt"] }
|
|
111
|
-
};
|
|
112
|
-
var LAZY_INSTALL_IGNORES_AMBIENT_SIGNAL = true;
|
|
113
|
-
var LAZY_INSTALL_TIMEOUT_MS = 18e4;
|
|
114
|
-
var attempts = /* @__PURE__ */ new Map();
|
|
115
|
-
function key(cwd, tool) {
|
|
116
|
-
return `${cwd}:${tool}`;
|
|
117
|
-
}
|
|
118
|
-
function getLazyInstallAttempt(tool, cwd) {
|
|
119
|
-
return attempts.get(key(cwd, tool))?.fact;
|
|
120
|
-
}
|
|
121
|
-
function resetLazyInstallAttempts() {
|
|
122
|
-
attempts.clear();
|
|
123
|
-
}
|
|
124
|
-
function suppressionFor(state) {
|
|
125
|
-
if (!state)
|
|
126
|
-
return null;
|
|
127
|
-
if (state.fact.outcome === "succeeded")
|
|
128
|
-
return "succeeded";
|
|
129
|
-
if (state.retryAtMs === 0)
|
|
130
|
-
return "held";
|
|
131
|
-
return Date.now() < state.retryAtMs ? "cooling" : null;
|
|
132
|
-
}
|
|
133
|
-
var inFlight = /* @__PURE__ */ new Map();
|
|
134
|
-
async function runLazyInstall(tool, cwd, spec) {
|
|
135
|
-
if (isToolInstallDisabled()) {
|
|
136
|
-
recordDegradationOnce({
|
|
137
|
-
kind: "install-disabled",
|
|
138
|
-
subject: tool,
|
|
139
|
-
reason: "installation disabled by PI_LENS_DISABLE_TOOL_INSTALL=1"
|
|
140
|
-
});
|
|
141
|
-
return false;
|
|
142
|
-
}
|
|
143
|
-
const k = key(cwd, tool);
|
|
144
|
-
const running = inFlight.get(k);
|
|
145
|
-
if (running)
|
|
146
|
-
return running;
|
|
147
|
-
const previous = attempts.get(k);
|
|
148
|
-
const suppressed = suppressionFor(previous);
|
|
149
|
-
if (suppressed !== null) {
|
|
150
|
-
logExtension({
|
|
151
|
-
subsystem: "install",
|
|
152
|
-
message: `lazy-install ${tool} suppressed (${suppressed})`,
|
|
153
|
-
metadata: {
|
|
154
|
-
tool,
|
|
155
|
-
cwd,
|
|
156
|
-
suppressed,
|
|
157
|
-
outcome: previous?.fact.outcome,
|
|
158
|
-
...previous?.fact.reason && { reason: previous.fact.reason },
|
|
159
|
-
...suppressed === "cooling" && {
|
|
160
|
-
retryAfterMs: Math.max(0, (previous?.retryAtMs ?? 0) - Date.now())
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
return false;
|
|
165
|
-
}
|
|
166
|
-
const started = performInstall(k, tool, cwd, spec);
|
|
167
|
-
inFlight.set(k, started);
|
|
168
|
-
try {
|
|
169
|
-
return await started;
|
|
170
|
-
} finally {
|
|
171
|
-
inFlight.delete(k);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
async function performInstall(k, tool, cwd, spec) {
|
|
175
|
-
let result;
|
|
176
|
-
try {
|
|
177
|
-
result = await safeSpawnAsync(spec.command, spec.args, {
|
|
178
|
-
timeout: LAZY_INSTALL_TIMEOUT_MS,
|
|
179
|
-
cwd,
|
|
180
|
-
...LAZY_INSTALL_IGNORES_AMBIENT_SIGNAL && { ignoreAmbientSignal: true }
|
|
181
|
-
});
|
|
182
|
-
} catch (err) {
|
|
183
|
-
result = {
|
|
184
|
-
stdout: "",
|
|
185
|
-
stderr: err?.message ?? String(err),
|
|
186
|
-
status: null,
|
|
187
|
-
error: err,
|
|
188
|
-
failure: "spawn"
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
if (!result.error && result.status === 0) {
|
|
192
|
-
attempts.set(k, {
|
|
193
|
-
fact: { outcome: "succeeded" },
|
|
194
|
-
retryAtMs: 0,
|
|
195
|
-
transientAttempts: 0
|
|
196
|
-
});
|
|
197
|
-
return true;
|
|
198
|
-
}
|
|
199
|
-
const classified = classifyProbeFailure(result, {
|
|
200
|
-
command: spec.command,
|
|
201
|
-
unclassifiedFailureOutcome: "transient"
|
|
202
|
-
});
|
|
203
|
-
const durable = classified.outcome === "missing";
|
|
204
|
-
const reason = (result.error?.message ?? result.stderr ?? `exit ${result.status}`).trim().slice(0, 200);
|
|
205
|
-
const settledPrevious = attempts.get(k);
|
|
206
|
-
const transientAttempts = durable ? 0 : (settledPrevious?.transientAttempts ?? 0) + 1;
|
|
207
|
-
const cooldownMs = durable ? 0 : installRetryDelayMs(transientAttempts);
|
|
208
|
-
const retryAtMs = cooldownMs === 0 ? 0 : Date.now() + cooldownMs;
|
|
209
|
-
attempts.set(k, {
|
|
210
|
-
fact: { outcome: "failed", reason },
|
|
211
|
-
retryAtMs,
|
|
212
|
-
transientAttempts
|
|
213
|
-
});
|
|
214
|
-
logExtension({
|
|
215
|
-
subsystem: "install",
|
|
216
|
-
message: `lazy-install ${tool} failed: ${reason}`,
|
|
217
|
-
metadata: {
|
|
218
|
-
tool,
|
|
219
|
-
cwd,
|
|
220
|
-
command: spec.command,
|
|
221
|
-
cause: classified.cause,
|
|
222
|
-
durable,
|
|
223
|
-
transientAttempts,
|
|
224
|
-
held: retryAtMs === 0,
|
|
225
|
-
...retryAtMs > 0 && { retryAfterMs: retryAtMs - Date.now() },
|
|
226
|
-
evidence: classified.evidence
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
return false;
|
|
230
|
-
}
|
|
231
|
-
async function tryLazyInstall(tool, cwd) {
|
|
232
|
-
if (!assertInstallAllowed(`runner lazy install: ${tool}`))
|
|
233
|
-
return false;
|
|
234
|
-
return runLazyInstall(tool, cwd, LAZY_INSTALL_SPECS[tool]);
|
|
235
|
-
}
|
|
236
|
-
async function tryLazyInstallForFormatter(tool, cwd) {
|
|
237
|
-
if (!assertInstallAllowed(`formatter lazy install: ${tool}`))
|
|
238
|
-
return false;
|
|
239
|
-
return runLazyInstall(tool, cwd, LAZY_INSTALL_SPECS[tool]);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
export {
|
|
243
|
-
COLLECT_LATER_THRESHOLD_MS,
|
|
244
|
-
runnerFlightKey,
|
|
245
|
-
classifyObservedRunner,
|
|
246
|
-
observeRunnerLatency,
|
|
247
|
-
runCollectLater,
|
|
248
|
-
holdFlight,
|
|
249
|
-
flightTail,
|
|
250
|
-
resetObservedRunnerLatency,
|
|
251
|
-
getLazyInstallAttempt,
|
|
252
|
-
resetLazyInstallAttempts,
|
|
253
|
-
tryLazyInstall,
|
|
254
|
-
tryLazyInstallForFormatter
|
|
255
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
TrivyClient,
|
|
4
|
-
existingDependencyManifests,
|
|
5
|
-
hasAnyDependencyManifest,
|
|
6
|
-
isTrivyEnabled,
|
|
7
|
-
parseTrivyLicenses,
|
|
8
|
-
parseTrivyReport,
|
|
9
|
-
parseTrivySecrets,
|
|
10
|
-
resolveSeverityFloor,
|
|
11
|
-
shouldScanTrivy,
|
|
12
|
-
trivyEvidenceFiles,
|
|
13
|
-
worktreeSkipDirs
|
|
14
|
-
} from "./chunk-W2YHHNY3.js";
|
|
15
|
-
import "./chunk-OG3UCAHV.js";
|
|
16
|
-
import "./chunk-FD4LJQ6Y.js";
|
|
17
|
-
import "./chunk-HFIFEH46.js";
|
|
18
|
-
import "./chunk-QQGZY2BR.js";
|
|
19
|
-
import "./chunk-5HVDD7IA.js";
|
|
20
|
-
import "./chunk-2APSZHHI.js";
|
|
21
|
-
import "./chunk-WWZLT6AM.js";
|
|
22
|
-
import "./chunk-LDPY22FS.js";
|
|
23
|
-
import "./chunk-M3QGXGY4.js";
|
|
24
|
-
import "./chunk-GIK6VUCY.js";
|
|
25
|
-
import "./chunk-N2U644ZW.js";
|
|
26
|
-
import "./chunk-DLGJYQML.js";
|
|
27
|
-
import "./chunk-EKQDQPX6.js";
|
|
28
|
-
import "./chunk-P7EV5ISR.js";
|
|
29
|
-
import "./chunk-S26LC76R.js";
|
|
30
|
-
import "./chunk-HUWW77QY.js";
|
|
31
|
-
import "./chunk-LJDODBBZ.js";
|
|
32
|
-
import "./chunk-6MWX2J5H.js";
|
|
33
|
-
import "./chunk-NXL4FFQQ.js";
|
|
34
|
-
export {
|
|
35
|
-
TrivyClient,
|
|
36
|
-
existingDependencyManifests,
|
|
37
|
-
hasAnyDependencyManifest,
|
|
38
|
-
isTrivyEnabled,
|
|
39
|
-
parseTrivyLicenses,
|
|
40
|
-
parseTrivyReport,
|
|
41
|
-
parseTrivySecrets,
|
|
42
|
-
resolveSeverityFloor,
|
|
43
|
-
shouldScanTrivy,
|
|
44
|
-
trivyEvidenceFiles,
|
|
45
|
-
worktreeSkipDirs
|
|
46
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
adaptLspService,
|
|
4
|
-
getLSPService,
|
|
5
|
-
groupFilesByPrimaryServer,
|
|
6
|
-
hasAuxiliaryLspPublishedForRoot,
|
|
7
|
-
notifyExternalFileChange,
|
|
8
|
-
peekLSPService,
|
|
9
|
-
resetLSPService,
|
|
10
|
-
resyncGitChangedFiles,
|
|
11
|
-
runPerServerGroups
|
|
12
|
-
} from "./chunk-EXHSWN3P.js";
|
|
13
|
-
import "./chunk-35UJUF27.js";
|
|
14
|
-
import "./chunk-XIMYZ3JA.js";
|
|
15
|
-
import "./chunk-YIEHUKX2.js";
|
|
16
|
-
import "./chunk-J7VNGHLN.js";
|
|
17
|
-
import "./chunk-AB26NAHA.js";
|
|
18
|
-
import "./chunk-5HVDD7IA.js";
|
|
19
|
-
import "./chunk-B2QO7GHY.js";
|
|
20
|
-
import "./chunk-S7KUDW73.js";
|
|
21
|
-
import "./chunk-KSQJBGRO.js";
|
|
22
|
-
import "./chunk-H6DNTQ4V.js";
|
|
23
|
-
import "./chunk-4GLSO2EM.js";
|
|
24
|
-
import "./chunk-Z54ZSOBZ.js";
|
|
25
|
-
import "./chunk-2DWNYVUN.js";
|
|
26
|
-
import "./chunk-6HWVI6MI.js";
|
|
27
|
-
import "./chunk-HMXWZUQW.js";
|
|
28
|
-
import "./chunk-MET776XM.js";
|
|
29
|
-
import "./chunk-BQ72NQQM.js";
|
|
30
|
-
import "./chunk-BYIEU4E4.js";
|
|
31
|
-
import "./chunk-NAACKIKT.js";
|
|
32
|
-
import "./chunk-6MDWNZ7E.js";
|
|
33
|
-
import "./chunk-2APSZHHI.js";
|
|
34
|
-
import "./chunk-62PIU4TO.js";
|
|
35
|
-
import "./chunk-2BEMIWEW.js";
|
|
36
|
-
import "./chunk-IJYGIDF4.js";
|
|
37
|
-
import "./chunk-YOMLAKU6.js";
|
|
38
|
-
import "./chunk-T2D2WWP6.js";
|
|
39
|
-
import "./chunk-25CAONWT.js";
|
|
40
|
-
import "./chunk-WWZLT6AM.js";
|
|
41
|
-
import "./chunk-DKXIUGNA.js";
|
|
42
|
-
import "./chunk-LDPY22FS.js";
|
|
43
|
-
import "./chunk-HOWHAKXO.js";
|
|
44
|
-
import "./chunk-WJ7GY5WJ.js";
|
|
45
|
-
import "./chunk-WA6U2URH.js";
|
|
46
|
-
import "./chunk-TABDCX35.js";
|
|
47
|
-
import "./chunk-TQWRH25U.js";
|
|
48
|
-
import "./chunk-UYXV5NIS.js";
|
|
49
|
-
import "./chunk-M3QGXGY4.js";
|
|
50
|
-
import "./chunk-GIK6VUCY.js";
|
|
51
|
-
import "./chunk-QYF5S6P6.js";
|
|
52
|
-
import "./chunk-N2U644ZW.js";
|
|
53
|
-
import "./chunk-SL4G67AP.js";
|
|
54
|
-
import "./chunk-DLGJYQML.js";
|
|
55
|
-
import "./chunk-CIA7X2PZ.js";
|
|
56
|
-
import "./chunk-EKQDQPX6.js";
|
|
57
|
-
import "./chunk-P7EV5ISR.js";
|
|
58
|
-
import "./chunk-S26LC76R.js";
|
|
59
|
-
import "./chunk-HUWW77QY.js";
|
|
60
|
-
import "./chunk-LJDODBBZ.js";
|
|
61
|
-
import "./chunk-6MWX2J5H.js";
|
|
62
|
-
import "./chunk-NXL4FFQQ.js";
|
|
63
|
-
export {
|
|
64
|
-
adaptLspService,
|
|
65
|
-
getLSPService,
|
|
66
|
-
groupFilesByPrimaryServer,
|
|
67
|
-
hasAuxiliaryLspPublishedForRoot,
|
|
68
|
-
notifyExternalFileChange,
|
|
69
|
-
peekLSPService,
|
|
70
|
-
resetLSPService,
|
|
71
|
-
resyncGitChangedFiles,
|
|
72
|
-
runPerServerGroups
|
|
73
|
-
};
|