voidmachine 5.0.8 → 7.0.0

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.
Files changed (38) hide show
  1. package/core-assets/.claude-plugin/plugin.json +13 -2
  2. package/core-assets/PHILOSOPHY.md +29 -6
  3. package/core-assets/data/catalog.v3.json +52 -132
  4. package/core-assets/data/certification.json +1 -1
  5. package/core-assets/data/model.json +51 -75
  6. package/core-assets/hooks/_syntax-worker.cjs +1 -1
  7. package/core-assets/hooks/_void-hook.mjs +730 -515
  8. package/core-assets/hooks/outcome-meter.sh +2 -1
  9. package/core-assets/hooks/tdd-guard.md +45 -88
  10. package/core-assets/hooks/viewport-screenshot-gate.sh +3 -3
  11. package/core-assets/packs/pack-monorepo/skills/void-dependency-direction/SKILL.md +27 -146
  12. package/core-assets/packs/pack-monorepo/skills/void-service-package/SKILL.md +5 -8
  13. package/core-assets/packs/pack-server/skills/void-webhook-handler-pattern/.source +4 -2
  14. package/core-assets/packs/pack-server/skills/void-webhook-handler-pattern/SKILL.md +32 -132
  15. package/core-assets/skills/void-accessibility/SKILL.md +2 -2
  16. package/core-assets/skills/void-async-safety/SKILL.md +37 -24
  17. package/core-assets/skills/void-autopilot/SKILL.md +7 -6
  18. package/core-assets/skills/void-brainstorm/SKILL.md +40 -61
  19. package/core-assets/skills/void-code-review/SKILL.md +24 -11
  20. package/core-assets/skills/void-commit-discipline/SKILL.md +13 -20
  21. package/core-assets/skills/void-debug/SKILL.md +9 -10
  22. package/core-assets/skills/void-domain-driven-design/SKILL.md +1 -1
  23. package/core-assets/skills/void-frontend-design/SKILL.md +3 -3
  24. package/core-assets/skills/void-hexagonal-architecture/SKILL.md +5 -5
  25. package/core-assets/skills/void-implement/SKILL.md +67 -26
  26. package/core-assets/skills/void-llm-cost-discipline/SKILL.md +3 -0
  27. package/core-assets/skills/void-observability/SKILL.md +4 -4
  28. package/core-assets/skills/void-orchestrate/SKILL.md +91 -221
  29. package/core-assets/skills/void-plan/SKILL.md +12 -17
  30. package/core-assets/skills/void-qa/SKILL.md +15 -14
  31. package/core-assets/skills/void-tdd/SKILL.md +33 -84
  32. package/core-assets/skills/void-testing/SKILL.md +5 -5
  33. package/core-assets/skills/void-ticket/SKILL.md +2 -0
  34. package/core-assets/skills/void-typescript-strict/SKILL.md +5 -5
  35. package/core-assets/skills/void-verify/SKILL.md +57 -159
  36. package/dist/main.js +1959 -1633
  37. package/package.json +3 -3
  38. package/core-assets/hooks/block-protected-push.sh +0 -81
@@ -261,16 +261,6 @@
261
261
  "staticTokens": 96,
262
262
  "type": "hook"
263
263
  },
264
- {
265
- "description": "",
266
- "id": "hook:block-protected-push",
267
- "lines": 81,
268
- "name": "block-protected-push",
269
- "pack": null,
270
- "source": "packages/core/hooks/block-protected-push.sh",
271
- "staticTokens": 971,
272
- "type": "hook"
273
- },
274
264
  {
275
265
  "description": "",
276
266
  "id": "hook:boundary-direction-check",
@@ -394,11 +384,11 @@
394
384
  {
395
385
  "description": "",
396
386
  "id": "hook:outcome-meter",
397
- "lines": 13,
387
+ "lines": 14,
398
388
  "name": "outcome-meter",
399
389
  "pack": null,
400
390
  "source": "packages/core/hooks/outcome-meter.sh",
401
- "staticTokens": 104,
391
+ "staticTokens": 127,
402
392
  "type": "hook"
403
393
  },
404
394
  {
@@ -528,7 +518,7 @@
528
518
  "name": "viewport-screenshot-gate",
529
519
  "pack": null,
530
520
  "source": "packages/core/hooks/viewport-screenshot-gate.sh",
531
- "staticTokens": 542,
521
+ "staticTokens": 570,
532
522
  "type": "hook"
533
523
  },
534
524
  {
@@ -822,7 +812,7 @@
822
812
  "type": "skill"
823
813
  },
824
814
  {
825
- "description": "Enforce the @repo/* import direction in a Turborepo workspace. Concrete violations + fixes. Composes with core:hexagonal-architecture and the boundary-direction-check hook.",
815
+ "description": "Declare cross-package dependencies explicitly and preserve domain-owned ports. Use when crossing a workspace package boundary or fixing boundary-direction-check.",
826
816
  "enforcement": {
827
817
  "floor": "ci",
828
818
  "inline": {
@@ -839,7 +829,7 @@
839
829
  }
840
830
  ],
841
831
  "id": "skill:pack-monorepo/void-dependency-direction",
842
- "lines": 160,
832
+ "lines": 41,
843
833
  "name": "void-dependency-direction",
844
834
  "owner": "folpe",
845
835
  "pack": "pack-monorepo",
@@ -848,7 +838,7 @@
848
838
  "codex"
849
839
  ],
850
840
  "source": "packages/packs/pack-monorepo/skills/void-dependency-direction/SKILL.md",
851
- "staticTokens": 1417,
841
+ "staticTokens": 535,
852
842
  "type": "skill"
853
843
  },
854
844
  {
@@ -899,7 +889,7 @@
899
889
  }
900
890
  ],
901
891
  "id": "skill:pack-monorepo/void-service-package",
902
- "lines": 122,
892
+ "lines": 119,
903
893
  "name": "void-service-package",
904
894
  "owner": "folpe",
905
895
  "pack": "pack-monorepo",
@@ -908,7 +898,7 @@
908
898
  "codex"
909
899
  ],
910
900
  "source": "packages/packs/pack-monorepo/skills/void-service-package/SKILL.md",
911
- "staticTokens": 1472,
901
+ "staticTokens": 1444,
912
902
  "type": "skill"
913
903
  },
914
904
  {
@@ -1512,7 +1502,7 @@
1512
1502
  "type": "skill"
1513
1503
  },
1514
1504
  {
1515
- "description": "Build a webhook handler with signature verification, idempotency, and dead-letter routing. Per-source patterns (Stripe, Resend, GitHub). Self-contained — no harness wrappers required.",
1505
+ "description": "Build a webhook handler with signature verification, idempotency, and dead-letter routing. Per-source patterns (Stripe, Resend, GitHub). Uses the shared async-safety contract.",
1516
1506
  "enforcement": {
1517
1507
  "floor": "ci",
1518
1508
  "inline": {
@@ -1529,7 +1519,7 @@
1529
1519
  }
1530
1520
  ],
1531
1521
  "id": "skill:pack-server/void-webhook-handler-pattern",
1532
- "lines": 205,
1522
+ "lines": 105,
1533
1523
  "name": "void-webhook-handler-pattern",
1534
1524
  "owner": "folpe",
1535
1525
  "pack": "pack-server",
@@ -1538,7 +1528,7 @@
1538
1528
  "codex"
1539
1529
  ],
1540
1530
  "source": "packages/packs/pack-server/skills/void-webhook-handler-pattern/SKILL.md",
1541
- "staticTokens": 2123,
1531
+ "staticTokens": 1436,
1542
1532
  "type": "skill"
1543
1533
  },
1544
1534
  {
@@ -1569,7 +1559,7 @@
1569
1559
  "codex"
1570
1560
  ],
1571
1561
  "source": "packages/core/skills/void-accessibility/SKILL.md",
1572
- "staticTokens": 2209,
1562
+ "staticTokens": 2247,
1573
1563
  "triggers": {
1574
1564
  "extensions": [
1575
1565
  "tsx"
@@ -1633,7 +1623,7 @@
1633
1623
  }
1634
1624
  ],
1635
1625
  "id": "skill:void-async-safety",
1636
- "lines": 287,
1626
+ "lines": 300,
1637
1627
  "name": "void-async-safety",
1638
1628
  "owner": "folpe",
1639
1629
  "pack": null,
@@ -1642,7 +1632,7 @@
1642
1632
  "codex"
1643
1633
  ],
1644
1634
  "source": "packages/core/skills/void-async-safety/SKILL.md",
1645
- "staticTokens": 3048,
1635
+ "staticTokens": 3424,
1646
1636
  "triggers": {
1647
1637
  "globs": [
1648
1638
  "**/webhooks/**",
@@ -1703,7 +1693,7 @@
1703
1693
  }
1704
1694
  ],
1705
1695
  "id": "skill:void-autopilot",
1706
- "lines": 395,
1696
+ "lines": 396,
1707
1697
  "name": "void-autopilot",
1708
1698
  "owner": "folpe",
1709
1699
  "pack": null,
@@ -1712,11 +1702,11 @@
1712
1702
  "codex"
1713
1703
  ],
1714
1704
  "source": "packages/core/skills/void-autopilot/SKILL.md",
1715
- "staticTokens": 7051,
1705
+ "staticTokens": 7059,
1716
1706
  "type": "skill"
1717
1707
  },
1718
1708
  {
1719
- "description": "Engage on a raw idea, or the moment an exchange settles a behaviour, boundary or trade-off: pressure-test, one question at a time, 2-3 approaches, spec written and approved before any code.",
1709
+ "description": "Resolve a raw idea or consequential design ambiguity: inspect context, compare alternatives and record approved choices. Clear authorized implementation requests go directly to void-implement.",
1720
1710
  "enforcement": {
1721
1711
  "floor": "ci",
1722
1712
  "inline": {
@@ -1733,7 +1723,7 @@
1733
1723
  }
1734
1724
  ],
1735
1725
  "id": "skill:void-brainstorm",
1736
- "lines": 278,
1726
+ "lines": 257,
1737
1727
  "name": "void-brainstorm",
1738
1728
  "owner": "folpe",
1739
1729
  "pack": null,
@@ -1742,7 +1732,7 @@
1742
1732
  "codex"
1743
1733
  ],
1744
1734
  "source": "packages/core/skills/void-brainstorm/SKILL.md",
1745
- "staticTokens": 4226,
1735
+ "staticTokens": 3930,
1746
1736
  "type": "skill"
1747
1737
  },
1748
1738
  {
@@ -1824,7 +1814,7 @@
1824
1814
  }
1825
1815
  ],
1826
1816
  "id": "skill:void-code-review",
1827
- "lines": 232,
1817
+ "lines": 245,
1828
1818
  "name": "void-code-review",
1829
1819
  "owner": "folpe",
1830
1820
  "pack": null,
@@ -1833,12 +1823,12 @@
1833
1823
  "codex"
1834
1824
  ],
1835
1825
  "source": "packages/core/skills/void-code-review/SKILL.md",
1836
- "staticTokens": 3050,
1826
+ "staticTokens": 3443,
1837
1827
  "type": "skill"
1838
1828
  },
1839
1829
  {
1840
1830
  "activation": "always",
1841
- "description": "Conventional Commits + mandatory \"why\" in body + scope + breaking-change marking. ASCII-only (no em dash, no emoji). Co-author trailer for AI pair. The git log is documentation. Use at every commit.",
1831
+ "description": "Conventional Commits + mandatory \"why\" in body + scope + breaking-change marking. Co-author trailer for AI pair. The git log is documentation. Use at every commit.",
1842
1832
  "enforcement": {
1843
1833
  "floor": "ci",
1844
1834
  "inline": {
@@ -1855,7 +1845,7 @@
1855
1845
  }
1856
1846
  ],
1857
1847
  "id": "skill:void-commit-discipline",
1858
- "lines": 211,
1848
+ "lines": 204,
1859
1849
  "name": "void-commit-discipline",
1860
1850
  "owner": "folpe",
1861
1851
  "pack": null,
@@ -1864,7 +1854,7 @@
1864
1854
  "codex"
1865
1855
  ],
1866
1856
  "source": "packages/core/skills/void-commit-discipline/SKILL.md",
1867
- "staticTokens": 1868,
1857
+ "staticTokens": 1830,
1868
1858
  "type": "skill"
1869
1859
  },
1870
1860
  {
@@ -1898,7 +1888,7 @@
1898
1888
  "type": "skill"
1899
1889
  },
1900
1890
  {
1901
- "description": "Four phases (investigate, analyze, hypothesize, implement). Iron Law: no fix without a failing test reproducing the bug AND a root cause. Bug fix commit pairs. Use on bug or test failure.",
1891
+ "description": "Four phases (investigate, analyze, hypothesize, implement). Iron Law: no fix without a failing test reproducing the bug AND a root cause. Observed RED/GREEN evidence. Use on bug or test failure.",
1902
1892
  "enforcement": {
1903
1893
  "floor": "ci",
1904
1894
  "inline": {
@@ -1915,7 +1905,7 @@
1915
1905
  }
1916
1906
  ],
1917
1907
  "id": "skill:void-debug",
1918
- "lines": 211,
1908
+ "lines": 210,
1919
1909
  "name": "void-debug",
1920
1910
  "owner": "folpe",
1921
1911
  "pack": null,
@@ -1924,7 +1914,7 @@
1924
1914
  "codex"
1925
1915
  ],
1926
1916
  "source": "packages/core/skills/void-debug/SKILL.md",
1927
- "staticTokens": 2325,
1917
+ "staticTokens": 2383,
1928
1918
  "type": "skill"
1929
1919
  },
1930
1920
  {
@@ -2046,7 +2036,7 @@
2046
2036
  "codex"
2047
2037
  ],
2048
2038
  "source": "packages/core/skills/void-domain-driven-design/SKILL.md",
2049
- "staticTokens": 3159,
2039
+ "staticTokens": 3182,
2050
2040
  "type": "skill"
2051
2041
  },
2052
2042
  {
@@ -2077,7 +2067,7 @@
2077
2067
  "codex"
2078
2068
  ],
2079
2069
  "source": "packages/core/skills/void-frontend-design/SKILL.md",
2080
- "staticTokens": 3590,
2070
+ "staticTokens": 3622,
2081
2071
  "triggers": {
2082
2072
  "extensions": [
2083
2073
  "tsx"
@@ -2174,7 +2164,7 @@
2174
2164
  "codex"
2175
2165
  ],
2176
2166
  "source": "packages/core/skills/void-hexagonal-architecture/SKILL.md",
2177
- "staticTokens": 2734,
2167
+ "staticTokens": 2797,
2178
2168
  "type": "skill"
2179
2169
  },
2180
2170
  {
@@ -2195,7 +2185,7 @@
2195
2185
  }
2196
2186
  ],
2197
2187
  "id": "skill:void-implement",
2198
- "lines": 193,
2188
+ "lines": 234,
2199
2189
  "name": "void-implement",
2200
2190
  "owner": "folpe",
2201
2191
  "pack": null,
@@ -2204,7 +2194,7 @@
2204
2194
  "codex"
2205
2195
  ],
2206
2196
  "source": "packages/core/skills/void-implement/SKILL.md",
2207
- "staticTokens": 5864,
2197
+ "staticTokens": 6632,
2208
2198
  "type": "skill"
2209
2199
  },
2210
2200
  {
@@ -2256,7 +2246,7 @@
2256
2246
  }
2257
2247
  ],
2258
2248
  "id": "skill:void-llm-cost-discipline",
2259
- "lines": 299,
2249
+ "lines": 302,
2260
2250
  "name": "void-llm-cost-discipline",
2261
2251
  "owner": "folpe",
2262
2252
  "pack": null,
@@ -2265,7 +2255,7 @@
2265
2255
  "codex"
2266
2256
  ],
2267
2257
  "source": "packages/core/skills/void-llm-cost-discipline/SKILL.md",
2268
- "staticTokens": 2519,
2258
+ "staticTokens": 2554,
2269
2259
  "type": "skill"
2270
2260
  },
2271
2261
  {
@@ -2394,11 +2384,11 @@
2394
2384
  "codex"
2395
2385
  ],
2396
2386
  "source": "packages/core/skills/void-observability/SKILL.md",
2397
- "staticTokens": 2210,
2387
+ "staticTokens": 2277,
2398
2388
  "type": "skill"
2399
2389
  },
2400
2390
  {
2401
- "description": "Delegate independent research and substantial implementation through native agents; choose context, isolation and bounded concurrency, collect results and preserve review evidence. Use the supported session host.",
2391
+ "description": "Delegate independent research and substantial implementation through native agents; choose context, isolation and bounded concurrency, collect results and preserve review evidence. Publish observed worker lifecycle events.",
2402
2392
  "enforcement": {
2403
2393
  "floor": "ci",
2404
2394
  "inline": {
@@ -2415,7 +2405,7 @@
2415
2405
  }
2416
2406
  ],
2417
2407
  "id": "skill:void-orchestrate",
2418
- "lines": 328,
2408
+ "lines": 198,
2419
2409
  "name": "void-orchestrate",
2420
2410
  "owner": "folpe",
2421
2411
  "pack": null,
@@ -2424,7 +2414,7 @@
2424
2414
  "codex"
2425
2415
  ],
2426
2416
  "source": "packages/core/skills/void-orchestrate/SKILL.md",
2427
- "staticTokens": 4684,
2417
+ "staticTokens": 3221,
2428
2418
  "type": "skill"
2429
2419
  },
2430
2420
  {
@@ -2445,7 +2435,7 @@
2445
2435
  }
2446
2436
  ],
2447
2437
  "id": "skill:void-plan",
2448
- "lines": 246,
2438
+ "lines": 241,
2449
2439
  "name": "void-plan",
2450
2440
  "owner": "folpe",
2451
2441
  "pack": null,
@@ -2454,7 +2444,7 @@
2454
2444
  "codex"
2455
2445
  ],
2456
2446
  "source": "packages/core/skills/void-plan/SKILL.md",
2457
- "staticTokens": 2706,
2447
+ "staticTokens": 2797,
2458
2448
  "type": "skill"
2459
2449
  },
2460
2450
  {
@@ -2507,7 +2497,7 @@
2507
2497
  }
2508
2498
  ],
2509
2499
  "id": "skill:void-qa",
2510
- "lines": 103,
2500
+ "lines": 104,
2511
2501
  "name": "void-qa",
2512
2502
  "owner": "folpe",
2513
2503
  "pack": null,
@@ -2516,7 +2506,7 @@
2516
2506
  "codex"
2517
2507
  ],
2518
2508
  "source": "packages/core/skills/void-qa/SKILL.md",
2519
- "staticTokens": 2613,
2509
+ "staticTokens": 2907,
2520
2510
  "type": "skill"
2521
2511
  },
2522
2512
  {
@@ -2693,7 +2683,7 @@
2693
2683
  }
2694
2684
  ],
2695
2685
  "id": "skill:void-tdd",
2696
- "lines": 394,
2686
+ "lines": 343,
2697
2687
  "name": "void-tdd",
2698
2688
  "owner": "folpe",
2699
2689
  "pack": null,
@@ -2702,7 +2692,7 @@
2702
2692
  "codex"
2703
2693
  ],
2704
2694
  "source": "packages/core/skills/void-tdd/SKILL.md",
2705
- "staticTokens": 3771,
2695
+ "staticTokens": 3712,
2706
2696
  "type": "skill"
2707
2697
  },
2708
2698
  {
@@ -2733,7 +2723,7 @@
2733
2723
  "codex"
2734
2724
  ],
2735
2725
  "source": "packages/core/skills/void-testing/SKILL.md",
2736
- "staticTokens": 3073,
2726
+ "staticTokens": 3097,
2737
2727
  "triggers": {
2738
2728
  "globs": [
2739
2729
  "**/*.test.ts",
@@ -2760,7 +2750,7 @@
2760
2750
  }
2761
2751
  ],
2762
2752
  "id": "skill:void-ticket",
2763
- "lines": 238,
2753
+ "lines": 240,
2764
2754
  "name": "void-ticket",
2765
2755
  "owner": "folpe",
2766
2756
  "pack": null,
@@ -2769,7 +2759,7 @@
2769
2759
  "codex"
2770
2760
  ],
2771
2761
  "source": "packages/core/skills/void-ticket/SKILL.md",
2772
- "staticTokens": 3317,
2762
+ "staticTokens": 3360,
2773
2763
  "type": "skill"
2774
2764
  },
2775
2765
  {
@@ -2800,7 +2790,7 @@
2800
2790
  "codex"
2801
2791
  ],
2802
2792
  "source": "packages/core/skills/void-typescript-strict/SKILL.md",
2803
- "staticTokens": 2681,
2793
+ "staticTokens": 2733,
2804
2794
  "triggers": {
2805
2795
  "extensions": [
2806
2796
  "ts",
@@ -2842,7 +2832,7 @@
2842
2832
  },
2843
2833
  {
2844
2834
  "activation": "always",
2845
- "description": "Final pre-flight checklist. Twelve items observed (not assumed) — typecheck, tests, hooks, mobile+desktop, commit why, review evidence. Skipping requires reason. Use at end of every task.",
2835
+ "description": "Verify acceptance with applicable tests, types, hooks and independent review; reuse unaffected proofs and report concrete limits. Use before claiming completion.",
2846
2836
  "enforcement": {
2847
2837
  "floor": "ci",
2848
2838
  "inline": {
@@ -2859,7 +2849,7 @@
2859
2849
  }
2860
2850
  ],
2861
2851
  "id": "skill:void-verify",
2862
- "lines": 203,
2852
+ "lines": 101,
2863
2853
  "name": "void-verify",
2864
2854
  "owner": "folpe",
2865
2855
  "pack": null,
@@ -2868,7 +2858,7 @@
2868
2858
  "codex"
2869
2859
  ],
2870
2860
  "source": "packages/core/skills/void-verify/SKILL.md",
2871
- "staticTokens": 2552,
2861
+ "staticTokens": 1573,
2872
2862
  "type": "skill"
2873
2863
  }
2874
2864
  ],
@@ -2922,13 +2912,6 @@
2922
2912
  "origin": "declared",
2923
2913
  "evidence": "block-dangerous-bash blocks destructive shell — enforces security-guidance"
2924
2914
  },
2925
- {
2926
- "from": "hook:block-protected-push",
2927
- "to": "skill:void-autopilot",
2928
- "kind": "enforces",
2929
- "origin": "declared",
2930
- "evidence": "block-protected-push guards protected-branch pushes for commit-only autopilot workers — enforces autopilot"
2931
- },
2932
2915
  {
2933
2916
  "from": "hook:boundary-direction-check",
2934
2917
  "to": "skill:void-hexagonal-architecture",
@@ -3104,13 +3087,6 @@
3104
3087
  "origin": "declared",
3105
3088
  "evidence": "ubiquitous-language-lint checks domain vocabulary — enforces domain-driven-design"
3106
3089
  },
3107
- {
3108
- "from": "hook:viewport-screenshot-gate",
3109
- "to": "skill:void-accessibility",
3110
- "kind": "enforces",
3111
- "origin": "declared",
3112
- "evidence": "viewport-screenshot-gate gates mobile+desktop viewports — enforces accessibility"
3113
- },
3114
3090
  {
3115
3091
  "from": "pack:pack-mobile",
3116
3092
  "to": "skill:pack-mobile/void-eas-build-profile",
@@ -443,7 +443,7 @@ Project '${_.projectName}' (${ew[_.projectKind]}) ${o}
443
443
  `&&(!_||_.length===0||cet(_,o))){let{lineText:u,absolutePosition:g}=s.textStorage.getAbsolutePositionAndLineText(t.line);if(u&&u.search("\\S")<0){let m=i.getIndentationAtPosition(n,o,c),h=0,S,T;for(S=0,T=u.length;S<T;S++)if(u.charAt(S)===" ")h++;else if(u.charAt(S)===" ")h+=c.tabSize;else break;if(m!==h){let k=g+S;_.push({span:xc(g,k),newText:Zc.getIndentationString(m,c)})}}}if(_)return _.map(u=>({start:s.positionToLineOffset(u.span.start),end:s.positionToLineOffset(Ko(u.span)),newText:u.newText?u.newText:""}))}getCompletions(t,n){let{file:i,project:s}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),_=s.getLanguageService().getCompletionsAtPosition(i,c,{...ufe(this.getPreferences(i)),triggerCharacter:t.triggerCharacter,triggerKind:t.triggerKind,includeExternalModuleExports:t.includeExternalModuleExports,includeInsertTextCompletions:t.includeInsertTextCompletions},s.projectService.getFormatCodeOptions(i));if(_===void 0)return;if(n==="completions-full")return _;let u=t.prefix||"",g=Ni(_.entries,h=>{if(_.isMemberCompletion||Ui(h.name.toLowerCase(),u.toLowerCase())){let S=h.replacementSpan?Tm(h.replacementSpan,o):void 0;return{...h,replacementSpan:S,hasAction:h.hasAction||void 0,symbol:void 0}}});return n==="completions"?(_.metadata&&(g.metadata=_.metadata),g):{..._,optionalReplacementSpan:_.optionalReplacementSpan&&Tm(_.optionalReplacementSpan,o),entries:g}}getCompletionEntryDetails(t,n){let{file:i,project:s}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),_=s.projectService.getFormatCodeOptions(i),u=!!this.getPreferences(i).displayPartsForJSDoc,g=Ni(t.entryNames,m=>{let{name:h,source:S,data:T}=typeof m=="string"?{name:m,source:void 0,data:void 0}:m;return s.getLanguageService().getCompletionEntryDetails(i,c,h,_,S,this.getPreferences(i),T?Rs(T,ket):void 0)});return n?u?g:g.map(m=>({...m,tags:this.mapJSDocTagInfo(m.tags,s,!1)})):g.map(m=>({...m,codeActions:dr(m.codeActions,h=>this.mapCodeAction(h)),documentation:this.mapDisplayParts(m.documentation,s),tags:this.mapJSDocTagInfo(m.tags,s,u)}))}getCompileOnSaveAffectedFileList(t){let n=this.getProjects(t,!0,!0),i=this.projectService.getScriptInfo(t.file);return i?_et(i,s=>this.projectService.getScriptInfoForPath(s),n,(s,o)=>{if(!s.compileOnSaveEnabled||!s.languageServiceEnabled||s.isOrphan())return;let c=s.getCompilationSettings();if(!(c.noEmit||Al(o.fileName)&&!oet(c)))return{projectFileName:s.getProjectName(),fileNames:s.getCompileOnSaveAffectedFileList(o),projectUsesOutFile:!!c.outFile}}):yl}emitFile(t){let{file:n,project:i}=this.getFileAndProject(t);if(i||Ph.ThrowNoProject(),!i.languageServiceEnabled)return t.richResponse?{emitSkipped:!0,diagnostics:[]}:!1;let s=i.getScriptInfo(n),{emitSkipped:o,diagnostics:c}=i.emitFile(s,(_,u,g)=>this.host.writeFile(_,u,g));return t.richResponse?{emitSkipped:o,diagnostics:t.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(c):c.map(_=>YI(_,!0))}:!o}getSignatureHelpItems(t,n){let{file:i,project:s}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),_=s.getLanguageService().getSignatureHelpItems(i,c,t),u=!!this.getPreferences(i).displayPartsForJSDoc;if(_&&n){let g=_.applicableSpan;return{..._,applicableSpan:{start:o.positionToLineOffset(g.start),end:o.positionToLineOffset(g.start+g.length)},items:this.mapSignatureHelpItems(_.items,s,u)}}else return u||!_?_:{..._,items:_.items.map(g=>({...g,tags:this.mapJSDocTagInfo(g.tags,s,!1)}))}}toPendingErrorCheck(t){let n=ro(t),i=this.projectService.tryGetDefaultProjectForFile(n);return i&&{fileName:n,project:i}}getDiagnostics(t,n,i){this.suppressDiagnosticEvents||i.length>0&&this.updateErrorCheck(t,i,n)}change(t){let n=this.projectService.getScriptInfo(t.file);E.assert(!!n),n.textStorage.switchToScriptVersionCache();let i=n.lineOffsetToPosition(t.line,t.offset),s=n.lineOffsetToPosition(t.endLine,t.endOffset);i>=0&&(this.changeSeq++,this.projectService.applyChangesToFile(n,mQ({span:{start:i,length:s-i},newText:t.insertString})))}reload(t){let n=ro(t.file),i=t.tmpfile===void 0?void 0:ro(t.tmpfile),s=this.projectService.getScriptInfoForNormalizedPath(n);s&&(this.changeSeq++,s.reloadFromFile(i))}saveToTmp(t,n){let i=this.projectService.getScriptInfo(t);i&&i.saveTo(n)}closeClientFile(t){if(!t)return;let n=zs(t);this.projectService.closeClientFile(n)}mapLocationNavigationBarItems(t,n){return dr(t,i=>({text:i.text,kind:i.kind,kindModifiers:i.kindModifiers,spans:i.spans.map(s=>Tm(s,n)),childItems:this.mapLocationNavigationBarItems(i.childItems,n),indent:i.indent}))}getNavigationBarItems(t,n){let{file:i,languageService:s}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=s.getNavigationBarItems(i);return o?n?this.mapLocationNavigationBarItems(o,this.projectService.getScriptInfoForNormalizedPath(i)):o:void 0}toLocationNavigationTree(t,n){return{text:t.text,kind:t.kind,kindModifiers:t.kindModifiers,spans:t.spans.map(i=>Tm(i,n)),nameSpan:t.nameSpan&&Tm(t.nameSpan,n),childItems:dr(t.childItems,i=>this.toLocationNavigationTree(i,n))}}getNavigationTree(t,n){let{file:i,languageService:s}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=s.getNavigationTree(i);return o?n?this.toLocationNavigationTree(o,this.projectService.getScriptInfoForNormalizedPath(i)):o:void 0}getNavigateToItems(t,n){let i=this.getFullNavigateToItems(t);return n?ua(i,({project:s,navigateToItems:o})=>o.map(c=>{let _=s.getScriptInfo(c.fileName),u={name:c.name,kind:c.kind,kindModifiers:c.kindModifiers,isCaseSensitive:c.isCaseSensitive,matchKind:c.matchKind,file:c.fileName,start:_.positionToLineOffset(c.textSpan.start),end:_.positionToLineOffset(Ko(c.textSpan))};return c.kindModifiers&&c.kindModifiers!==""&&(u.kindModifiers=c.kindModifiers),c.containerName&&c.containerName.length>0&&(u.containerName=c.containerName),c.containerKind&&c.containerKind.length>0&&(u.containerKind=c.containerKind),u})):ua(i,({navigateToItems:s})=>s)}getFullNavigateToItems(t){let{currentFileOnly:n,searchValue:i,maxResultCount:s,projectFileName:o}=t;if(n){E.assertIsDefined(t.file);let{file:S,project:T}=this.getFileAndProject(t);return[{project:T,navigateToItems:T.getLanguageService().getNavigateToItems(i,s,S)}]}let c=this.getHostPreferences(),_=[],u=new Map;if(!t.file&&!o)this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(S=>g(S));else{let S=this.getProjects(t);Mwe(S,void 0,T=>g(T))}return _;function g(S){let T=S.getLanguageService().getNavigateToItems(i,s,void 0,S.isNonTsProject(),c.excludeLibrarySymbolsInNavTo),k=Cn(T,D=>m(D)&&!KG(tw(D),S));k.length&&_.push({project:S,navigateToItems:k})}function m(S){let T=S.name;if(!u.has(T))return u.set(T,[S]),!0;let k=u.get(T);for(let D of k)if(h(D,S))return!1;return k.push(S),!0}function h(S,T){return S===T?!0:!S||!T?!1:S.containerKind===T.containerKind&&S.containerName===T.containerName&&S.fileName===T.fileName&&S.isCaseSensitive===T.isCaseSensitive&&S.kind===T.kind&&S.kindModifiers===T.kindModifiers&&S.matchKind===T.matchKind&&S.name===T.name&&S.textSpan.start===T.textSpan.start&&S.textSpan.length===T.textSpan.length}}getSupportedCodeFixes(t){if(!t)return hH();if(t.file){let{file:i,project:s}=this.getFileAndProject(t);return s.getLanguageService().getSupportedCodeFixes(i)}let n=this.getProject(t.projectFileName);return n||Ph.ThrowNoProject(),n.getLanguageService().getSupportedCodeFixes()}isLocation(t){return t.line!==void 0}extractPositionOrRange(t,n){let i,s;return this.isLocation(t)?i=o(t):s=this.getRange(t,n),E.checkDefined(i===void 0?s:i);function o(c){return c.position!==void 0?c.position:n.lineOffsetToPosition(c.line,c.offset)}}getRange(t,n){let{startPosition:i,endPosition:s}=this.getStartAndEndPosition(t,n);return{pos:i,end:s}}getApplicableRefactors(t){let{file:n,project:i}=this.getFileAndProject(t),s=i.getScriptInfoForNormalizedPath(n);return i.getLanguageService().getApplicableRefactors(n,this.extractPositionOrRange(t,s),this.getPreferences(n),t.triggerReason,t.kind,t.includeInteractiveActions).map(c=>({...c,actions:c.actions.map(_=>({..._,range:_.range?{start:p6({line:_.range.start.line,character:_.range.start.offset}),end:p6({line:_.range.end.line,character:_.range.end.offset})}:void 0}))}))}getEditsForRefactor(t,n){let{file:i,project:s}=this.getFileAndProject(t),o=s.getScriptInfoForNormalizedPath(i),c=s.getLanguageService().getEditsForRefactor(i,this.getFormatOptions(i),this.extractPositionOrRange(t,o),t.refactor,t.action,this.getPreferences(i),t.interactiveRefactorArguments);if(c===void 0)return{edits:[]};if(n){let{renameFilename:_,renameLocation:u,edits:g}=c,m;if(_!==void 0&&u!==void 0){let h=s.getScriptInfoForNormalizedPath(ro(_));m=Nfe(Sk(h.getSnapshot()),_,u,g)}return{renameLocation:m,renameFilename:_,edits:this.mapTextChangesToCodeEdits(g),notApplicableReason:c.notApplicableReason}}return c}getMoveToRefactoringFileSuggestions(t){let{file:n,project:i}=this.getFileAndProject(t),s=i.getScriptInfoForNormalizedPath(n);return i.getLanguageService().getMoveToRefactoringFileSuggestions(n,this.extractPositionOrRange(t,s),this.getPreferences(n))}preparePasteEdits(t){let{file:n,project:i}=this.getFileAndProject(t);return i.getLanguageService().preparePasteEditsForFile(n,t.copiedTextSpan.map(s=>this.getRange({file:n,startLine:s.start.line,startOffset:s.start.offset,endLine:s.end.line,endOffset:s.end.offset},this.projectService.getScriptInfoForNormalizedPath(n))))}getPasteEdits(t){let{file:n,project:i}=this.getFileAndProject(t);if(KP(n))return;let s=t.copiedFrom?{file:t.copiedFrom.file,range:t.copiedFrom.spans.map(c=>this.getRange({file:t.copiedFrom.file,startLine:c.start.line,startOffset:c.start.offset,endLine:c.end.line,endOffset:c.end.offset},i.getScriptInfoForNormalizedPath(ro(t.copiedFrom.file))))}:void 0,o=i.getLanguageService().getPasteEdits({targetFile:n,pastedText:t.pastedText,pasteLocations:t.pasteLocations.map(c=>this.getRange({file:n,startLine:c.start.line,startOffset:c.start.offset,endLine:c.end.line,endOffset:c.end.offset},i.getScriptInfoForNormalizedPath(n))),copiedFrom:s,preferences:this.getPreferences(n)},this.getFormatOptions(n));return o&&this.mapPasteEditsAction(o)}organizeImports(t,n){E.assert(t.scope.type==="file");let{file:i,project:s}=this.getFileAndProject(t.scope.args),o=s.getLanguageService().organizeImports({fileName:i,mode:t.mode??(t.skipDestructiveCodeActions?"SortAndCombine":void 0),type:"file"},this.getFormatOptions(i),this.getPreferences(i));return n?this.mapTextChangesToCodeEdits(o):o}getEditsForFileRename(t,n){let i=ro(t.oldFilePath),s=ro(t.newFilePath),o=this.getHostFormatOptions(),c=this.getHostPreferences(),_=new Set,u=[];return this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(g=>{let m=g.getLanguageService().getEditsForFileRename(i,s,o,c),h=[];for(let S of m)_.has(S.fileName)||(u.push(S),h.push(S.fileName));for(let S of h)_.add(S)}),n?u.map(g=>this.mapTextChangeToCodeEdit(g)):u}getCodeFixes(t,n){let{file:i,project:s}=this.getFileAndProject(t),o=s.getScriptInfoForNormalizedPath(i),{startPosition:c,endPosition:_}=this.getStartAndEndPosition(t,o),u;try{u=s.getLanguageService().getCodeFixesAtPosition(i,c,_,t.errorCodes,this.getFormatOptions(i),this.getPreferences(i))}catch(g){let m=g instanceof Error?g:new Error(g),h=s.getLanguageService(),S=[...h.getSyntacticDiagnostics(i),...h.getSemanticDiagnostics(i),...h.getSuggestionDiagnostics(i)].filter(k=>_3(c,_-c,k.start,k.length)).map(k=>k.code),T=t.errorCodes.find(k=>!S.includes(k));throw T!==void 0&&(m.message+=`
444
444
  Additional information: BADCLIENT: Bad error code, ${T} not found in range ${c}..${_} (found: ${S.join(", ")})`),m}return n?u.map(g=>this.mapCodeFixAction(g)):u}getCombinedCodeFix({scope:t,fixId:n},i){E.assert(t.type==="file");let{file:s,project:o}=this.getFileAndProject(t.args),c=o.getLanguageService().getCombinedCodeFix({type:"file",fileName:s},n,this.getFormatOptions(s),this.getPreferences(s));return i?{changes:this.mapTextChangesToCodeEdits(c.changes),commands:c.commands}:c}applyCodeActionCommand(t){let n=t.command;for(let i of KT(n)){let{file:s,project:o}=this.getFileAndProject(i);o.getLanguageService().applyCodeActionCommand(i,this.getFormatOptions(s)).then(c=>{},c=>{})}return{}}getStartAndEndPosition(t,n){let i,s;return t.startPosition!==void 0?i=t.startPosition:(i=n.lineOffsetToPosition(t.startLine,t.startOffset),t.startPosition=i),t.endPosition!==void 0?s=t.endPosition:(s=n.lineOffsetToPosition(t.endLine,t.endOffset),t.endPosition=s),{startPosition:i,endPosition:s}}mapCodeAction({description:t,changes:n,commands:i}){return{description:t,changes:this.mapTextChangesToCodeEdits(n),commands:i}}mapCodeFixAction({fixName:t,description:n,changes:i,commands:s,fixId:o,fixAllDescription:c}){return{fixName:t,description:n,changes:this.mapTextChangesToCodeEdits(i),commands:s,fixId:o,fixAllDescription:c}}mapPasteEditsAction({edits:t,fixId:n}){return{edits:this.mapTextChangesToCodeEdits(t),fixId:n}}mapTextChangesToCodeEdits(t){return t.map(n=>this.mapTextChangeToCodeEdit(n))}mapTextChangeToCodeEdit(t){let n=this.projectService.getScriptInfoOrConfig(t.fileName);return!!t.isNewFile==!!n&&(n||this.projectService.logErrorForScriptInfoNotFound(t.fileName),E.fail("Expected isNewFile for (only) new files. "+JSON.stringify({isNewFile:!!t.isNewFile,hasScriptInfo:!!n}))),n?{fileName:t.fileName,textChanges:t.textChanges.map(i=>het(i,n))}:bet(t)}convertTextChangeToCodeEdit(t,n){return{start:n.positionToLineOffset(t.span.start),end:n.positionToLineOffset(t.span.start+t.span.length),newText:t.newText?t.newText:""}}getBraceMatching(t,n){let{file:i,languageService:s}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),_=s.getBraceMatchingAtPosition(i,c);return _?n?_.map(u=>Tm(u,o)):_:void 0}getDiagnosticsForProject(t,n,i){if(this.suppressDiagnosticEvents)return;let{fileNames:s,languageServiceDisabled:o}=this.getProjectInfoWorker(i,void 0,!0,void 0,!0);if(o)return;let c=s.filter(D=>!D.includes("lib.d.ts"));if(c.length===0)return;let _=[],u=[],g=[],m=[],h=ro(i),S=this.projectService.ensureDefaultProjectForFile(h);for(let D of c)this.getCanonicalFileName(D)===this.getCanonicalFileName(i)?_.push(D):this.projectService.getScriptInfo(D).isScriptOpen()?u.push(D):Al(D)?m.push(D):g.push(D);let k=[..._,...u,...g,...m].map(D=>({fileName:D,project:S}));this.updateErrorCheck(t,k,n,!1)}configurePlugin(t){this.projectService.configurePlugin(t)}getSmartSelectionRange(t,n){let{locations:i}=t,{file:s,languageService:o}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=E.checkDefined(this.projectService.getScriptInfo(s));return dr(i,_=>{let u=this.getPosition(_,c),g=o.getSmartSelectionRange(s,u);return n?this.mapSelectionRange(g,c):g})}toggleLineComment(t,n){let{file:i,languageService:s}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfo(i),c=this.getRange(t,o),_=s.toggleLineComment(i,c);if(n){let u=this.projectService.getScriptInfoForNormalizedPath(i);return _.map(g=>this.convertTextChangeToCodeEdit(g,u))}return _}toggleMultilineComment(t,n){let{file:i,languageService:s}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,o),_=s.toggleMultilineComment(i,c);if(n){let u=this.projectService.getScriptInfoForNormalizedPath(i);return _.map(g=>this.convertTextChangeToCodeEdit(g,u))}return _}commentSelection(t,n){let{file:i,languageService:s}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,o),_=s.commentSelection(i,c);if(n){let u=this.projectService.getScriptInfoForNormalizedPath(i);return _.map(g=>this.convertTextChangeToCodeEdit(g,u))}return _}uncommentSelection(t,n){let{file:i,languageService:s}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,o),_=s.uncommentSelection(i,c);if(n){let u=this.projectService.getScriptInfoForNormalizedPath(i);return _.map(g=>this.convertTextChangeToCodeEdit(g,u))}return _}mapSelectionRange(t,n){let i={textSpan:Tm(t.textSpan,n)};return t.parent&&(i.parent=this.mapSelectionRange(t.parent,n)),i}getScriptInfoFromProjectService(t){let n=ro(t),i=this.projectService.getScriptInfoForNormalizedPath(n);return i||(this.projectService.logErrorForScriptInfoNotFound(n),Ph.ThrowNoProject())}toProtocolCallHierarchyItem(t){let n=this.getScriptInfoFromProjectService(t.file);return{name:t.name,kind:t.kind,kindModifiers:t.kindModifiers,file:t.file,containerName:t.containerName,span:Tm(t.span,n),selectionSpan:Tm(t.selectionSpan,n)}}toProtocolCallHierarchyIncomingCall(t){let n=this.getScriptInfoFromProjectService(t.from.file);return{from:this.toProtocolCallHierarchyItem(t.from),fromSpans:t.fromSpans.map(i=>Tm(i,n))}}toProtocolCallHierarchyOutgoingCall(t,n){return{to:this.toProtocolCallHierarchyItem(t.to),fromSpans:t.fromSpans.map(i=>Tm(i,n))}}prepareCallHierarchy(t){let{file:n,project:i}=this.getFileAndProject(t),s=this.projectService.getScriptInfoForNormalizedPath(n);if(s){let o=this.getPosition(t,s),c=i.getLanguageService().prepareCallHierarchy(n,o);return c&&Eq(c,_=>this.toProtocolCallHierarchyItem(_))}}provideCallHierarchyIncomingCalls(t){let{file:n,project:i}=this.getFileAndProject(t),s=this.getScriptInfoFromProjectService(n);return i.getLanguageService().provideCallHierarchyIncomingCalls(n,this.getPosition(t,s)).map(c=>this.toProtocolCallHierarchyIncomingCall(c))}provideCallHierarchyOutgoingCalls(t){let{file:n,project:i}=this.getFileAndProject(t),s=this.getScriptInfoFromProjectService(n);return i.getLanguageService().provideCallHierarchyOutgoingCalls(n,this.getPosition(t,s)).map(c=>this.toProtocolCallHierarchyOutgoingCall(c,s))}getCanonicalFileName(t){let n=this.host.useCaseSensitiveFileNames?t:_y(t);return zs(n)}exit(){}notRequired(t){return t&&this.doOutput(void 0,t.command,t.seq,!0,this.performanceData),{responseRequired:!1,performanceData:this.performanceData}}requiredResponse(t){return{response:t,responseRequired:!0,performanceData:this.performanceData}}addProtocolHandler(t,n){if(this.handlers.has(t))throw new Error(`Protocol handler already exists for command "${t}"`);this.handlers.set(t,n)}setCurrentRequest(t){E.assert(this.currentRequestId===void 0),this.currentRequestId=t,this.cancellationToken.setRequest(t)}resetCurrentRequest(t){E.assert(this.currentRequestId===t),this.currentRequestId=void 0,this.cancellationToken.resetRequest(t)}executeWithRequestId(t,n,i){let s=this.performanceData;try{return this.performanceData=i,this.setCurrentRequest(t),n()}finally{this.resetCurrentRequest(t),this.performanceData=s}}executeCommand(t){let n=this.handlers.get(t.command);if(n){let i=this.executeWithRequestId(t.seq,()=>n(t),void 0);return this.projectService.enableRequestedPlugins(),i}else return this.logger.msg(`Unrecognized JSON command:${vv(t)}`,"Err"),this.doOutput(void 0,"unknown",t.seq,!1,void 0,`Unrecognized JSON command: ${t.command}`),{responseRequired:!1}}onMessage(t){var n,i,s,o,c,_,u;this.gcTimer.scheduleCollect();let g,m=this.performanceData;this.logger.hasLevel(2)&&(g=this.hrtime(),this.logger.hasLevel(3)&&this.logger.info(`request:${kP(this.toStringMessage(t))}`));let h,S;try{h=this.parseMessage(t),S=h.arguments&&h.arguments.file?h.arguments:void 0,(n=sn)==null||n.instant(sn.Phase.Session,"request",{seq:h.seq,command:h.command}),(i=sn)==null||i.push(sn.Phase.Session,"executeCommand",{seq:h.seq,command:h.command},!0);let{response:T,responseRequired:k,performanceData:D}=this.executeCommand(h);if((s=sn)==null||s.pop(),this.logger.hasLevel(2)){let w=aet(this.hrtime(g)).toFixed(4);k?this.logger.perftrc(`${h.seq}::${h.command}: elapsed time (in milliseconds) ${w}`):this.logger.perftrc(`${h.seq}::${h.command}: async elapsed time (in milliseconds) ${w}`)}(o=sn)==null||o.instant(sn.Phase.Session,"response",{seq:h.seq,command:h.command,success:!!T}),T?this.doOutput(T,h.command,h.seq,!0,D):k&&this.doOutput(void 0,h.command,h.seq,!1,D,"No content available.")}catch(T){if((c=sn)==null||c.popAll(),T instanceof h4){(_=sn)==null||_.instant(sn.Phase.Session,"commandCanceled",{seq:h?.seq,command:h?.command}),this.doOutput({canceled:!0},h.command,h.seq,!0,this.performanceData);return}this.logErrorWorker(T,this.toStringMessage(t),S),(u=sn)==null||u.instant(sn.Phase.Session,"commandError",{seq:h?.seq,command:h?.command,message:T.message}),this.doOutput(void 0,h?h.command:"unknown",h?h.seq:0,!1,this.performanceData,"Error processing request. "+T.message+`
445
445
  `+T.stack)}finally{this.performanceData=m}}parseMessage(t){return JSON.parse(t)}toStringMessage(t){return t}getFormatOptions(t){return this.projectService.getFormatCodeOptions(t)}getPreferences(t){return this.projectService.getPreferences(t)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function Uwe(e){let t=e.diagnosticsDuration&&is(e.diagnosticsDuration,([n,i])=>({...i,file:n}));return{...e,diagnosticsDuration:t}}function Tm(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(Ko(e))}}function wfe(e,t,n){let i=Tm(e,n),s=t&&Tm(t,n);return s?{...i,contextStart:s.start,contextEnd:s.end}:i}function het(e,t){return{start:Vwe(t,e.span.start),end:Vwe(t,Ko(e.span)),newText:e.newText}}function Vwe(e,t){return Tfe(e)?vet(e.getLineAndCharacterOfPosition(t)):e.positionToLineOffset(t)}function yet(e,t){let n=e.ranges.map(i=>({start:t.positionToLineOffset(i.start),end:t.positionToLineOffset(i.start+i.length)}));return e.wordPattern?{ranges:n,wordPattern:e.wordPattern}:{ranges:n}}function vet(e){return{line:e.line+1,offset:e.character+1}}function bet(e){E.assert(e.textChanges.length===1);let t=ya(e.textChanges);return E.assert(t.span.start===0&&t.span.length===0),{fileName:e.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:t.newText}]}}function Nfe(e,t,n,i){let s=Tet(e,t,i),{line:o,character:c}=AC(cx(s),n);return{line:o+1,offset:c+1}}function Tet(e,t,n){for(let{fileName:i,textChanges:s}of n)if(i===t)for(let o=s.length-1;o>=0;o--){let{newText:c,span:{start:_,length:u}}=s[o];e=e.slice(0,_)+c+e.slice(_+u)}return e}function qwe(e,{fileName:t,textSpan:n,contextSpan:i,isWriteAccess:s,isDefinition:o},{disableLineTextInReferences:c}){let _=E.checkDefined(e.getScriptInfo(t)),u=wfe(n,i,_),g=c?void 0:xet(_,u);return{file:t,...u,lineText:g,isWriteAccess:s,isDefinition:o}}function xet(e,t){let n=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(n.start,Ko(n)).replace(/\r|\n/g,"")}function ket(e){return e===void 0||e&&typeof e=="object"&&typeof e.exportName=="string"&&(e.fileName===void 0||typeof e.fileName=="string")&&(e.ambientModuleName===void 0||typeof e.ambientModuleName=="string"&&(e.isPackageJsonImport===void 0||typeof e.isPackageJsonImport=="boolean"))}var d6=4,Afe=(e=>(e[e.PreStart=0]="PreStart",e[e.Start=1]="Start",e[e.Entire=2]="Entire",e[e.Mid=3]="Mid",e[e.End=4]="End",e[e.PostEnd=5]="PostEnd",e))(Afe||{}),Cet=class{constructor(){this.goSubtree=!0,this.lineIndex=new ZI,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new m6,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(e,t){t&&(this.trailingText=""),e?e=this.initialText+e+this.trailingText:e=this.initialText+this.trailingText;let i=ZI.linesFromText(e).lines;i.length>1&&i[i.length-1]===""&&i.pop();let s,o;for(let _=this.endBranch.length-1;_>=0;_--)this.endBranch[_].updateCounts(),this.endBranch[_].charCount()===0&&(o=this.endBranch[_],_>0?s=this.endBranch[_-1]:s=this.branchNode);o&&s.remove(o);let c=this.startPath[this.startPath.length-1];if(i.length>0)if(c.text=i[0],i.length>1){let _=new Array(i.length-1),u=c;for(let h=1;h<i.length;h++)_[h-1]=new iM(i[h]);let g=this.startPath.length-2;for(;g>=0;){let h=this.startPath[g];_=h.insertAt(u,_),g--,u=h}let m=_.length;for(;m>0;){let h=new m6;h.add(this.lineIndex.root),_=h.insertAt(this.lineIndex.root,_),m=_.length,this.lineIndex.root=h}this.lineIndex.root.updateCounts()}else for(let _=this.startPath.length-2;_>=0;_--)this.startPath[_].updateCounts();else{this.startPath[this.startPath.length-2].remove(c);for(let u=this.startPath.length-2;u>=0;u--)this.startPath[u].updateCounts()}return this.lineIndex}post(e,t,n){n===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(e,t,n,i,s){let o=this.stack[this.stack.length-1];this.state===2&&s===1&&(this.state=1,this.branchNode=o,this.lineCollectionAtBranch=n);let c;function _(u){return u.isLeaf()?new iM(""):new m6}switch(s){case 0:this.goSubtree=!1,this.state!==4&&o.add(n);break;case 1:this.state===4?this.goSubtree=!1:(c=_(n),o.add(c),this.startPath.push(c));break;case 2:this.state!==4?(c=_(n),o.add(c),this.startPath.push(c)):n.isLeaf()||(c=_(n),o.add(c),this.endBranch.push(c));break;case 3:this.goSubtree=!1;break;case 4:this.state!==4?this.goSubtree=!1:n.isLeaf()||(c=_(n),o.add(c),this.endBranch.push(c));break;case 5:this.goSubtree=!1,this.state!==1&&o.add(n);break}this.goSubtree&&this.stack.push(c)}leaf(e,t,n){this.state===1?this.initialText=n.text.substring(0,e):this.state===2?(this.initialText=n.text.substring(0,e),this.trailingText=n.text.substring(e+t)):this.trailingText=n.text.substring(e+t)}},Eet=class{constructor(e,t,n){this.pos=e,this.deleteLen=t,this.insertedText=n}getTextChangeRange(){return f3(Xl(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},e$=class XT{constructor(){this.changes=[],this.versions=new Array(XT.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%XT.maxVersions}currentVersionToIndex(){return this.currentVersion%XT.maxVersions}edit(t,n,i){this.changes.push(new Eet(t,n,i)),(this.changes.length>XT.changeNumberThreshold||n>XT.changeLengthThreshold||i&&i.length>XT.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let n=t.index;for(let i of this.changes)n=n.edit(i.pos,i.deleteLen,i.insertedText);t=new Hwe(this.currentVersion+1,this,n,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=XT.maxVersions&&(this.minVersion=this.currentVersion-XT.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(t){return this._getSnapshot().index.lineNumberToInfo(t)}lineOffsetToPosition(t,n){return this._getSnapshot().index.absolutePositionOfStartOfLine(t)+(n-1)}positionToLineOffset(t){return this._getSnapshot().index.positionToLineOffset(t)}lineToTextSpan(t){let n=this._getSnapshot().index,{lineText:i,absolutePosition:s}=n.lineNumberToInfo(t+1),o=i!==void 0?i.length:n.absolutePositionOfStartOfLine(t+2)-s;return Xl(s,o)}getTextChangesBetweenVersions(t,n){if(t<n)if(t>=this.minVersion){let i=[];for(let s=t+1;s<=n;s++){let o=this.versions[this.versionToIndex(s)];for(let c of o.changesSincePreviousVersion)i.push(c.getTextChangeRange())}return gZ(i)}else return;else return A7}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){let n=new XT,i=new Hwe(0,n,new ZI);n.versions[n.currentVersion]=i;let s=ZI.linesFromText(t);return i.index.load(s.lines),n}};e$.changeNumberThreshold=8,e$.changeLengthThreshold=256,e$.maxVersions=8;var t$=e$,Hwe=class K5e{constructor(t,n,i,s=yl){this.version=t,this.cache=n,this.index=i,this.changesSincePreviousVersion=s}getText(t,n){return this.index.getText(t,n-t)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof K5e&&this.cache===t.cache)return this.version<=t.version?A7:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},ZI=class Cge{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(t){return this.lineNumberToInfo(t).absolutePosition}positionToLineOffset(t){let{oneBasedLine:n,zeroBasedColumn:i}=this.root.charOffsetToLineInfo(1,t);return{line:n,offset:i+1}}positionToColumnAndLineText(t){return this.root.charOffsetToLineInfo(1,t)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(t){let n=this.getLineCount();if(t<=n){let{position:i,leaf:s}=this.root.lineNumberToInfo(t,0);return{absolutePosition:i,lineText:s&&s.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){let n=[];for(let i=0;i<t.length;i++)n[i]=new iM(t[i]);this.root=Cge.buildTreeFromBottom(n)}else this.root=new m6}walk(t,n,i){this.root.walk(t,n,i)}getText(t,n){let i="";return n>0&&t<this.root.charCount()&&this.walk(t,n,{goSubtree:!0,done:!1,leaf:(s,o,c)=>{i=i.concat(c.text.substring(s,s+o))}}),i}getLength(){return this.root.charCount()}every(t,n,i){i||(i=this.root.charCount());let s={goSubtree:!0,done:!1,leaf(o,c,_){t(_,o,c)||(this.done=!0)}};return this.walk(n,i-n,s),!s.done}edit(t,n,i){if(this.root.charCount()===0)return E.assert(n===0),i!==void 0?(this.load(Cge.linesFromText(i).lines),this):void 0;{let s;if(this.checkEdits){let _=this.getText(0,this.root.charCount());s=_.slice(0,t)+i+_.slice(t+n)}let o=new Cet,c=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;let _=this.getText(t,1);i?i=_+i:i=_,n=0,c=!0}else if(n>0){let _=t+n,{zeroBasedColumn:u,lineText:g}=this.positionToColumnAndLineText(_);u===0&&(n+=g.length,i=i?i+g:g)}if(this.root.walk(t,n,o),o.insertLines(i,c),this.checkEdits){let _=o.lineIndex.getText(0,o.lineIndex.getLength());E.assert(s===_,"buffer edit mismatch")}return o.lineIndex}}static buildTreeFromBottom(t){if(t.length<d6)return new m6(t);let n=new Array(Math.ceil(t.length/d6)),i=0;for(let s=0;s<n.length;s++){let o=Math.min(i+d6,t.length);n[s]=new m6(t.slice(i,o)),i=o}return this.buildTreeFromBottom(n)}static linesFromText(t){let n=cx(t);if(n.length===0)return{lines:[],lineMap:n};let i=new Array(n.length),s=n.length-1;for(let c=0;c<s;c++)i[c]=t.substring(n[c],n[c+1]);let o=t.substring(n[s]);return o.length>0?i[s]=o:i.pop(),{lines:i,lineMap:n}}},m6=class Ege{constructor(t=[]){this.children=t,this.totalChars=0,this.totalLines=0,t.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(let t of this.children)this.totalChars+=t.charCount(),this.totalLines+=t.lineCount()}execWalk(t,n,i,s,o){return i.pre&&i.pre(t,n,this.children[s],this,o),i.goSubtree?(this.children[s].walk(t,n,i),i.post&&i.post(t,n,this.children[s],this,o)):i.goSubtree=!0,i.done}skipChild(t,n,i,s,o){s.pre&&!s.done&&(s.pre(t,n,this.children[i],this,o),s.goSubtree=!0)}walk(t,n,i){if(this.children.length===0)return;let s=0,o=this.children[s].charCount(),c=t;for(;c>=o;)this.skipChild(c,n,s,i,0),c-=o,s++,o=this.children[s].charCount();if(c+n<=o){if(this.execWalk(c,n,i,s,2))return}else{if(this.execWalk(c,o-c,i,s,1))return;let _=n-(o-c);for(s++,o=this.children[s].charCount();_>o;){if(this.execWalk(0,o,i,s,3))return;_-=o,s++,o=this.children[s].charCount()}if(_>0&&this.execWalk(0,_,i,s,4))return}if(i.pre){let _=this.children.length;if(s<_-1)for(let u=s+1;u<_;u++)this.skipChild(0,0,u,i,5)}}charOffsetToLineInfo(t,n){if(this.children.length===0)return{oneBasedLine:t,zeroBasedColumn:n,lineText:void 0};for(let o of this.children){if(o.charCount()>n)return o.isLeaf()?{oneBasedLine:t,zeroBasedColumn:n,lineText:o.text}:o.charOffsetToLineInfo(t,n);n-=o.charCount(),t+=o.lineCount()}let i=this.lineCount();if(i===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};let s=E.checkDefined(this.lineNumberToInfo(i,0).leaf);return{oneBasedLine:i,zeroBasedColumn:s.charCount(),lineText:void 0}}lineNumberToInfo(t,n){for(let i of this.children){let s=i.lineCount();if(s>=t)return i.isLeaf()?{position:n,leaf:i}:i.lineNumberToInfo(t,n);t-=s,n+=i.charCount()}return{position:n,leaf:void 0}}splitAfter(t){let n,i=this.children.length;t++;let s=t;if(t<i){for(n=new Ege;t<i;)n.add(this.children[t]),t++;n.updateCounts()}return this.children.length=s,n}remove(t){let n=this.findChildIndex(t),i=this.children.length;if(n<i-1)for(let s=n;s<i-1;s++)this.children[s]=this.children[s+1];this.children.pop()}findChildIndex(t){let n=this.children.indexOf(t);return E.assert(n!==-1),n}insertAt(t,n){let i=this.findChildIndex(t),s=this.children.length,o=n.length;if(s<d6&&i===s-1&&o===1)return this.add(n[0]),this.updateCounts(),[];{let c=this.splitAfter(i),_=0;for(i++;i<d6&&_<o;)this.children[i]=n[_],i++,_++;let u=[],g=0;if(_<o){g=Math.ceil((o-_)/d6),u=new Array(g);let m=0;for(let S=0;S<g;S++)u[S]=new Ege;let h=u[0];for(;_<o;)h.add(n[_]),_++,h.children.length===d6&&(m++,h=u[m]);for(let S=u.length-1;S>=0;S--)u[S].children.length===0&&u.pop()}c&&u.push(c),this.updateCounts();for(let m=0;m<g;m++)u[m].updateCounts();return u}}add(t){this.children.push(t),E.assert(this.children.length<=d6)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},iM=class{constructor(e){this.text=e}isLeaf(){return!0}walk(e,t,n){n.leaf(e,t,this)}charCount(){return this.text.length}lineCount(){return 1}},Gwe=class eFe{constructor(t,n,i,s,o,c){this.telemetryEnabled=t,this.logger=n,this.host=i,this.globalTypingsCacheLocation=s,this.event=o,this.maxActiveRequestCount=c,this.activeRequestCount=0,this.requestQueue=Qw(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(t){var n;return zg.validatePackageName(t)!==zg.NameValidationResult.Ok?!1:(this.requestedRegistry||(this.requestedRegistry=!0,this.installer.send({kind:"typesRegistry"})),!!((n=this.typesRegistryCache)!=null&&n.has(t)))}installPackage(t){this.packageInstallId++;let n={kind:"installPackage",...t,id:this.packageInstallId},i=new Promise((s,o)=>{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:s,reject:o})});return this.installer.send(n),i}attach(t){this.projectService=t,this.installer=this.createInstallerProcess()}onProjectClosed(t){this.installer.send({projectName:t.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest(t,n,i){let s=j_e(t,n,i);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${vv(s)}`),this.activeRequestCount<this.maxActiveRequestCount?this.scheduleRequest(s):(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Deferring request for: ${s.projectName}`),this.requestQueue.enqueue(s),this.requestMap.set(s.projectName,s))}handleMessage(t){var n,i;switch(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Received response:${vv(t)}`),t.kind){case CV:this.typesRegistryCache=new Map(Object.entries(t.typesRegistry));break;case qA:{let s=(n=this.packageInstalledPromise)==null?void 0:n.get(t.id);E.assertIsDefined(s,"Should find the promise for package install"),(i=this.packageInstalledPromise)==null||i.delete(t.id),t.success?s.resolve({successMessage:t.message}):s.reject(t.message),this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case Vse:{let s={message:t.message};this.event(s,"typesInstallerInitializationFailed");break}case EV:{let s={eventId:t.eventId,packages:t.packagesToInstall};this.event(s,"beginInstallTypes");break}case DV:{if(this.telemetryEnabled){let c={telemetryEventName:"typingsInstalled",payload:{installedPackages:t.packagesToInstall.join(","),installSuccess:t.installSuccess,typingsInstallerVersion:t.typingsInstallerVersion}};this.event(c,"telemetry")}let s={eventId:t.eventId,packages:t.packagesToInstall,success:t.installSuccess};this.event(s,"endInstallTypes");break}case k9:{this.projectService.updateTypingsForProject(t);break}case x9:{for(this.activeRequestCount>0?this.activeRequestCount--:E.fail("TIAdapter:: Received too many responses");!this.requestQueue.isEmpty();){let s=this.requestQueue.dequeue();if(this.requestMap.get(s.projectName)===s){this.requestMap.delete(s.projectName),this.scheduleRequest(s);break}this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Skipping defunct request for: ${s.projectName}`)}this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case HA:this.projectService.watchTypingLocations(t);break;default:}}scheduleRequest(t){this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`),this.activeRequestCount++,this.host.setTimeout(()=>{this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Sending request:${vv(t)}`),this.installer.send(t)},eFe.requestDelayMillis,`${t.projectName}::${t.kind}`)}};Gwe.requestDelayMillis=100;var $we=Gwe,Xwe={};Oc(Xwe,{ActionInvalidate:()=>k9,ActionPackageInstalled:()=>qA,ActionSet:()=>x9,ActionWatchTypingLocations:()=>HA,Arguments:()=>PV,AutoImportProviderProject:()=>sfe,AuxiliaryProject:()=>nfe,CharRangeSection:()=>Afe,CloseFileWatcherEvent:()=>UG,CommandNames:()=>Owe,ConfigFileDiagEvent:()=>jG,ConfiguredProject:()=>afe,ConfiguredProjectLoadKind:()=>ffe,CreateDirectoryWatcherEvent:()=>WG,CreateFileWatcherEvent:()=>zG,Errors:()=>Ph,EventBeginInstallTypes:()=>EV,EventEndInstallTypes:()=>DV,EventInitializationFailed:()=>Vse,EventTypesRegistry:()=>CV,ExternalProject:()=>IG,GcTimer:()=>q_e,InferredProject:()=>rfe,LargeFileReferencedEvent:()=>RG,LineIndex:()=>ZI,LineLeaf:()=>iM,LineNode:()=>m6,LogLevel:()=>M_e,Msg:()=>R_e,OpenFileInfoTelemetryEvent:()=>ofe,Project:()=>Lk,ProjectInfoTelemetryEvent:()=>JG,ProjectKind:()=>ew,ProjectLanguageServiceStateEvent:()=>BG,ProjectLoadingFinishEvent:()=>MG,ProjectLoadingStartEvent:()=>LG,ProjectService:()=>Sfe,ProjectsUpdatedInBackgroundEvent:()=>tM,ScriptInfo:()=>X_e,ScriptVersionCache:()=>t$,Session:()=>Wwe,TextStorage:()=>$_e,ThrottledOperations:()=>V_e,TypingsInstallerAdapter:()=>$we,allFilesAreJsOrDts:()=>K_e,allRootFilesAreJsOrDts:()=>Z_e,asNormalizedPath:()=>awe,convertCompilerOptions:()=>rM,convertFormatOptions:()=>f6,convertScriptKindName:()=>qG,convertTypeAcquisition:()=>lfe,convertUserPreferences:()=>ufe,convertWatchOptions:()=>QI,countEachFileTypes:()=>HI,createInstallTypingsRequest:()=>j_e,createModuleSpecifierCache:()=>kfe,createNormalizedPathMap:()=>owe,createPackageJsonCache:()=>Cfe,createSortedArray:()=>U_e,emptyArray:()=>yl,findArgument:()=>o2e,formatDiagnosticToProtocol:()=>YI,formatMessage:()=>Efe,getBaseConfigFileName:()=>AG,getDetailWatchInfo:()=>XG,getLocationInNewDocument:()=>Nfe,hasArgument:()=>a2e,hasNoTypeScriptSource:()=>efe,indent:()=>kP,isBackgroundProject:()=>$I,isConfigFile:()=>Tfe,isConfiguredProject:()=>w0,isDynamicFileName:()=>KP,isExternalProject:()=>GI,isInferredProject:()=>Mk,isInferredProjectName:()=>B_e,isProjectDeferredClose:()=>XI,makeAutoImportProviderProjectName:()=>z_e,makeAuxiliaryProjectName:()=>W_e,makeInferredProjectName:()=>J_e,maxFileSize:()=>OG,maxProgramSizeForNonTsFiles:()=>FG,normalizedPathToPath:()=>_6,nowString:()=>c2e,nullCancellationToken:()=>Awe,nullTypingsInstaller:()=>nM,protocol:()=>H_e,scriptInfoIsContainedByBackgroundProject:()=>Q_e,scriptInfoIsContainedByDeferredClosedProject:()=>Y_e,stringifyIndented:()=>vv,toEvent:()=>Dfe,toNormalizedPath:()=>ro,tryConvertScriptKindName:()=>VG,typingsInstaller:()=>L_e,updateProjectIfDirty:()=>Wp}),typeof console<"u"&&(E.loggingHost={log(e,t){switch(e){case 1:return console.error(t);case 2:return console.warn(t);case 3:return console.log(t);case 4:return console.log(t)}}})})({get exports(){return G5e},set exports(Aa){G5e=Aa,typeof uQ<"u"&&uQ.exports&&(uQ.exports=Aa)}})});var nFe=q5e((odt,rFe)=>{rFe.exports=tFe()});var iFe={};xpt(iFe,{analyzeSyntax:()=>Ept});function Ept(Aa){let Gl=/\.tsx$/.test(Aa.path)?Tc.ScriptKind.TSX:/\.jsx$/.test(Aa.path)?Tc.ScriptKind.JSX:/\.[cm]?js$/.test(Aa.path)?Tc.ScriptKind.JS:Tc.ScriptKind.TS,bu=Tc.createSourceFile(Aa.path,Aa.source,Tc.ScriptTarget.Latest,!1,Gl),Bm={getSourceFile:$a=>$a===Aa.path?bu:void 0,getDefaultLibFileName:()=>"",writeFile:()=>{},getCurrentDirectory:()=>"",getCanonicalFileName:$a=>$a,useCaseSensitiveFileNames:()=>!0,getNewLine:()=>`
446
- `,fileExists:$a=>$a===Aa.path,readFile:$a=>$a===Aa.path?Aa.source:void 0};if(Tc.createProgram([Aa.path],{noResolve:!0,noLib:!0},Bm).getSyntacticDiagnostics(bu).length>0)throw new SyntaxError;let Oc=[bu],qw=new Set,LR=new Set,o7=[],H2=0;for(;Oc.length>0;){if(++H2>2e4)throw new RangeError;let $a=Oc.pop();if($a===void 0)break;if(Aa.purpose==="declarations"){if($a.kind===Tc.SyntaxKind.JsxText){o7.push({start:$a.pos,end:$a.end});continue}let p_=[...Tc.getLeadingCommentRanges(Aa.source,$a.pos)??[],...Tc.getTrailingCommentRanges(Aa.source,$a.end)??[]];for(let Ve of p_)/^\/\/\s*tdd-cover:/.test(Aa.source.slice(Ve.pos,Ve.end))&&LR.add(Ve.pos);Oc.push(...$a.getChildren(bu));continue}if(Tc.isPropertyAccessExpression($a)&&Tc.isIdentifier($a.expression)){let p_=$a.expression.text;(["it","test","describe"].includes(p_)&&$a.name.text==="only"||["it","test"].includes(p_)&&$a.name.text==="skip")&&qw.add(bu.getLineAndCharacterOfPosition($a.getStart(bu)).line+1)}if(Tc.isCallExpression($a)||Tc.isTaggedTemplateExpression($a)){let p_=Tc.isCallExpression($a)?$a.expression:$a.tag;for(;Tc.isPropertyAccessExpression(p_)||Tc.isElementAccessExpression(p_)||Tc.isParenthesizedExpression(p_)||Tc.isAsExpression(p_)||Tc.isTypeAssertionExpression(p_)||Tc.isNonNullExpression(p_)||Tc.isSatisfiesExpression(p_);){if(++H2>2e4)throw new RangeError;p_=p_.expression}Tc.isIdentifier(p_)&&["xit","xdescribe"].includes(p_.text)&&qw.add(bu.getLineAndCharacterOfPosition($a.getStart(bu)).line+1)}Tc.forEachChild($a,p_=>{Oc.push(p_)})}for(let $a of LR)o7.some(p_=>$a>=p_.start&&$a<p_.end)||qw.add(bu.getLineAndCharacterOfPosition($a).line+1);return{lines:[...qw].sort(($a,p_)=>$a-p_)}}var Tc,sFe=Tpt(()=>{"use strict";Tc=Cpt(nFe(),1)});var aFe=require("node:fs");function H5e(Aa){if(!(!Aa||typeof Aa!="object")&&!(!("version"in Aa)||Aa.version!==1||!("path"in Aa)||typeof Aa.path!="string"||Aa.path.length>4096||!("source"in Aa)||typeof Aa.source!="string"||!("purpose"in Aa)||Aa.purpose!=="focused-tests"&&Aa.purpose!=="declarations"))return{path:Aa.path,source:Aa.source,purpose:Aa.purpose}}async function Dpt(){let Aa=Buffer.alloc(425984),Gl=0;try{for(;Gl<Aa.length;){let Bm=(0,aFe.readSync)(0,Aa,{offset:Gl,length:Aa.length-Gl});if(Bm===0)break;Gl+=Bm}if(Gl===Aa.length)return{version:1,kind:"invalid-request"};let bu=H5e(JSON.parse(Aa.toString("utf8",0,Gl)));if(bu===void 0||Buffer.byteLength(bu.source)>65536)return{version:1,kind:"invalid-request"};try{let{analyzeSyntax:Bm}=await Promise.resolve().then(()=>(sFe(),iFe));return{version:1,kind:"inspected",...Bm(bu)}}catch(Bm){return{version:1,kind:Bm instanceof SyntaxError?"invalid-source":Bm instanceof RangeError?"limit":"unavailable"}}}catch{return{version:1,kind:"invalid-request"}}}Dpt().then(Aa=>{process.stdout.write(JSON.stringify(Aa))});
446
+ `,fileExists:$a=>$a===Aa.path,readFile:$a=>$a===Aa.path?Aa.source:void 0};if(Tc.createProgram([Aa.path],{noResolve:!0,noLib:!0},Bm).getSyntacticDiagnostics(bu).length>0)throw new SyntaxError;let Oc=[bu],qw=new Set,LR=new Set,o7=[],H2=0;for(;Oc.length>0;){if(++H2>2e4)throw new RangeError;let $a=Oc.pop();if($a===void 0)break;if(Aa.purpose==="declarations"){if($a.kind===Tc.SyntaxKind.JsxText){o7.push({start:$a.pos,end:$a.end});continue}let p_=[...Tc.getLeadingCommentRanges(Aa.source,$a.pos)??[],...Tc.getTrailingCommentRanges(Aa.source,$a.end)??[]];for(let Ve of p_)/^\/\/\s*tdd-cover:/.test(Aa.source.slice(Ve.pos,Ve.end))&&LR.add(Ve.pos);Oc.push(...$a.getChildren(bu));continue}if(Tc.isPropertyAccessExpression($a)&&Tc.isIdentifier($a.expression)){let p_=$a.expression.text;(["it","test","describe"].includes(p_)&&$a.name.text==="only"||["it","test","describe"].includes(p_)&&$a.name.text==="skip")&&qw.add(bu.getLineAndCharacterOfPosition($a.getStart(bu)).line+1)}if(Tc.isCallExpression($a)||Tc.isTaggedTemplateExpression($a)){let p_=Tc.isCallExpression($a)?$a.expression:$a.tag;for(;Tc.isPropertyAccessExpression(p_)||Tc.isElementAccessExpression(p_)||Tc.isParenthesizedExpression(p_)||Tc.isAsExpression(p_)||Tc.isTypeAssertionExpression(p_)||Tc.isNonNullExpression(p_)||Tc.isSatisfiesExpression(p_);){if(++H2>2e4)throw new RangeError;p_=p_.expression}Tc.isIdentifier(p_)&&["xit","xdescribe","fit","fdescribe"].includes(p_.text)&&qw.add(bu.getLineAndCharacterOfPosition($a.getStart(bu)).line+1)}Tc.forEachChild($a,p_=>{Oc.push(p_)})}for(let $a of LR)o7.some(p_=>$a>=p_.start&&$a<p_.end)||qw.add(bu.getLineAndCharacterOfPosition($a).line+1);return{lines:[...qw].sort(($a,p_)=>$a-p_)}}var Tc,sFe=Tpt(()=>{"use strict";Tc=Cpt(nFe(),1)});var aFe=require("node:fs");function H5e(Aa){if(!(!Aa||typeof Aa!="object")&&!(!("version"in Aa)||Aa.version!==1||!("path"in Aa)||typeof Aa.path!="string"||Aa.path.length>4096||!("source"in Aa)||typeof Aa.source!="string"||!("purpose"in Aa)||Aa.purpose!=="focused-tests"&&Aa.purpose!=="declarations"))return{path:Aa.path,source:Aa.source,purpose:Aa.purpose}}async function Dpt(){let Aa=Buffer.alloc(425984),Gl=0;try{for(;Gl<Aa.length;){let Bm=(0,aFe.readSync)(0,Aa,{offset:Gl,length:Aa.length-Gl});if(Bm===0)break;Gl+=Bm}if(Gl===Aa.length)return{version:1,kind:"invalid-request"};let bu=H5e(JSON.parse(Aa.toString("utf8",0,Gl)));if(bu===void 0||Buffer.byteLength(bu.source)>65536)return{version:1,kind:"invalid-request"};try{let{analyzeSyntax:Bm}=await Promise.resolve().then(()=>(sFe(),iFe));return{version:1,kind:"inspected",...Bm(bu)}}catch(Bm){return{version:1,kind:Bm instanceof SyntaxError?"invalid-source":Bm instanceof RangeError?"limit":"unavailable"}}}catch{return{version:1,kind:"invalid-request"}}}Dpt().then(Aa=>{process.stdout.write(JSON.stringify(Aa))});
447
447
  /*! TypeScript (Apache-2.0)
448
448
  Apache License
449
449