cwtools-shared 0.2.9 → 0.3.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.
@@ -39,7 +39,8 @@ exports.GENERATED_MCP_TOOLS = [
39
39
  "isReadOnly": true,
40
40
  "effect": "workspace_read",
41
41
  "riskLevel": 0,
42
- "concurrencyClass": "parallel"
42
+ "concurrencyClass": "parallel",
43
+ "mcpSupportsCwtOnly": false
43
44
  }
44
45
  },
45
46
  {
@@ -79,7 +80,8 @@ exports.GENERATED_MCP_TOOLS = [
79
80
  "isReadOnly": true,
80
81
  "effect": "workspace_read",
81
82
  "riskLevel": 0,
82
- "concurrencyClass": "parallel"
83
+ "concurrencyClass": "parallel",
84
+ "mcpSupportsCwtOnly": false
83
85
  }
84
86
  },
85
87
  {
@@ -123,7 +125,8 @@ exports.GENERATED_MCP_TOOLS = [
123
125
  "isReadOnly": true,
124
126
  "effect": "workspace_read",
125
127
  "riskLevel": 0,
126
- "concurrencyClass": "parallel"
128
+ "concurrencyClass": "parallel",
129
+ "mcpSupportsCwtOnly": false
127
130
  }
128
131
  },
129
132
  {
@@ -170,7 +173,8 @@ exports.GENERATED_MCP_TOOLS = [
170
173
  "isReadOnly": true,
171
174
  "effect": "workspace_read",
172
175
  "riskLevel": 0,
173
- "concurrencyClass": "parallel"
176
+ "concurrencyClass": "parallel",
177
+ "mcpSupportsCwtOnly": false
174
178
  }
175
179
  },
176
180
  {
@@ -196,7 +200,8 @@ exports.GENERATED_MCP_TOOLS = [
196
200
  "isReadOnly": true,
197
201
  "effect": "workspace_read",
198
202
  "riskLevel": 0,
199
- "concurrencyClass": "parallel"
203
+ "concurrencyClass": "parallel",
204
+ "mcpSupportsCwtOnly": false
200
205
  }
201
206
  },
202
207
  {
@@ -222,7 +227,8 @@ exports.GENERATED_MCP_TOOLS = [
222
227
  "isReadOnly": true,
223
228
  "effect": "workspace_read",
224
229
  "riskLevel": 0,
225
- "concurrencyClass": "parallel"
230
+ "concurrencyClass": "parallel",
231
+ "mcpSupportsCwtOnly": false
226
232
  }
227
233
  },
228
234
  {
@@ -261,7 +267,8 @@ exports.GENERATED_MCP_TOOLS = [
261
267
  "isReadOnly": true,
262
268
  "effect": "workspace_read",
263
269
  "riskLevel": 0,
264
- "concurrencyClass": "parallel"
270
+ "concurrencyClass": "parallel",
271
+ "mcpSupportsCwtOnly": false
265
272
  }
266
273
  },
267
274
  {
@@ -300,7 +307,8 @@ exports.GENERATED_MCP_TOOLS = [
300
307
  "isReadOnly": true,
301
308
  "effect": "workspace_read",
302
309
  "riskLevel": 0,
303
- "concurrencyClass": "lsp-limited"
310
+ "concurrencyClass": "lsp-limited",
311
+ "mcpSupportsCwtOnly": true
304
312
  }
305
313
  },
306
314
  {
@@ -348,7 +356,8 @@ exports.GENERATED_MCP_TOOLS = [
348
356
  "isReadOnly": true,
349
357
  "effect": "none",
350
358
  "riskLevel": 2,
351
- "concurrencyClass": "global-exclusive"
359
+ "concurrencyClass": "global-exclusive",
360
+ "mcpSupportsCwtOnly": true
352
361
  }
353
362
  },
354
363
  {
@@ -398,7 +407,8 @@ exports.GENERATED_MCP_TOOLS = [
398
407
  "isReadOnly": true,
399
408
  "effect": "workspace_read",
400
409
  "riskLevel": 0,
401
- "concurrencyClass": "parallel"
410
+ "concurrencyClass": "parallel",
411
+ "mcpSupportsCwtOnly": false
402
412
  }
403
413
  },
404
414
  {
@@ -469,7 +479,8 @@ exports.GENERATED_MCP_TOOLS = [
469
479
  "isReadOnly": true,
470
480
  "effect": "workspace_read",
471
481
  "riskLevel": 0,
472
- "concurrencyClass": "parallel"
482
+ "concurrencyClass": "parallel",
483
+ "mcpSupportsCwtOnly": false
473
484
  }
474
485
  },
475
486
  {
@@ -543,7 +554,8 @@ exports.GENERATED_MCP_TOOLS = [
543
554
  "isReadOnly": true,
544
555
  "effect": "workspace_read",
545
556
  "riskLevel": 0,
546
- "concurrencyClass": "parallel"
557
+ "concurrencyClass": "parallel",
558
+ "mcpSupportsCwtOnly": false
547
559
  }
548
560
  },
549
561
  {
@@ -612,7 +624,8 @@ exports.GENERATED_MCP_TOOLS = [
612
624
  "isReadOnly": true,
613
625
  "effect": "workspace_read",
614
626
  "riskLevel": 0,
615
- "concurrencyClass": "lsp-limited"
627
+ "concurrencyClass": "lsp-limited",
628
+ "mcpSupportsCwtOnly": false
616
629
  }
617
630
  },
618
631
  {
@@ -648,7 +661,8 @@ exports.GENERATED_MCP_TOOLS = [
648
661
  "isReadOnly": true,
649
662
  "effect": "workspace_read",
650
663
  "riskLevel": 0,
651
- "concurrencyClass": "lsp-limited"
664
+ "concurrencyClass": "lsp-limited",
665
+ "mcpSupportsCwtOnly": false
652
666
  }
653
667
  },
654
668
  {
@@ -684,7 +698,8 @@ exports.GENERATED_MCP_TOOLS = [
684
698
  "isReadOnly": true,
685
699
  "effect": "workspace_read",
686
700
  "riskLevel": 0,
687
- "concurrencyClass": "lsp-limited"
701
+ "concurrencyClass": "lsp-limited",
702
+ "mcpSupportsCwtOnly": false
688
703
  }
689
704
  },
690
705
  {
@@ -715,7 +730,8 @@ exports.GENERATED_MCP_TOOLS = [
715
730
  "isReadOnly": true,
716
731
  "effect": "workspace_read",
717
732
  "riskLevel": 0,
718
- "concurrencyClass": "lsp-limited"
733
+ "concurrencyClass": "lsp-limited",
734
+ "mcpSupportsCwtOnly": false
719
735
  }
720
736
  },
721
737
  {
@@ -925,7 +941,8 @@ exports.GENERATED_MCP_TOOLS = [
925
941
  "isReadOnly": true,
926
942
  "effect": "workspace_read",
927
943
  "riskLevel": 0,
928
- "concurrencyClass": "parallel"
944
+ "concurrencyClass": "parallel",
945
+ "mcpSupportsCwtOnly": false
929
946
  }
930
947
  },
931
948
  {
@@ -989,7 +1006,8 @@ exports.GENERATED_MCP_TOOLS = [
989
1006
  "isReadOnly": true,
990
1007
  "effect": "workspace_read",
991
1008
  "riskLevel": 0,
992
- "concurrencyClass": "parallel"
1009
+ "concurrencyClass": "parallel",
1010
+ "mcpSupportsCwtOnly": false
993
1011
  }
994
1012
  },
995
1013
  {
@@ -1020,7 +1038,8 @@ exports.GENERATED_MCP_TOOLS = [
1020
1038
  "isReadOnly": true,
1021
1039
  "effect": "workspace_read",
1022
1040
  "riskLevel": 0,
1023
- "concurrencyClass": "parallel"
1041
+ "concurrencyClass": "parallel",
1042
+ "mcpSupportsCwtOnly": false
1024
1043
  }
1025
1044
  },
1026
1045
  {
@@ -1060,7 +1079,8 @@ exports.GENERATED_MCP_TOOLS = [
1060
1079
  "isReadOnly": true,
1061
1080
  "effect": "workspace_read",
1062
1081
  "riskLevel": 0,
1063
- "concurrencyClass": "parallel"
1082
+ "concurrencyClass": "parallel",
1083
+ "mcpSupportsCwtOnly": true
1064
1084
  }
1065
1085
  },
1066
1086
  {
@@ -1086,7 +1106,8 @@ exports.GENERATED_MCP_TOOLS = [
1086
1106
  "isReadOnly": true,
1087
1107
  "effect": "workspace_read",
1088
1108
  "riskLevel": 0,
1089
- "concurrencyClass": "lsp-limited"
1109
+ "concurrencyClass": "lsp-limited",
1110
+ "mcpSupportsCwtOnly": true
1090
1111
  }
1091
1112
  },
1092
1113
  {
@@ -1116,7 +1137,8 @@ exports.GENERATED_MCP_TOOLS = [
1116
1137
  "isReadOnly": true,
1117
1138
  "effect": "workspace_read",
1118
1139
  "riskLevel": 0,
1119
- "concurrencyClass": "lsp-limited"
1140
+ "concurrencyClass": "lsp-limited",
1141
+ "mcpSupportsCwtOnly": true
1120
1142
  }
1121
1143
  },
1122
1144
  {
@@ -1153,7 +1175,8 @@ exports.GENERATED_MCP_TOOLS = [
1153
1175
  "isReadOnly": true,
1154
1176
  "effect": "workspace_read",
1155
1177
  "riskLevel": 0,
1156
- "concurrencyClass": "lsp-limited"
1178
+ "concurrencyClass": "lsp-limited",
1179
+ "mcpSupportsCwtOnly": true
1157
1180
  }
1158
1181
  },
1159
1182
  {
@@ -1194,7 +1217,8 @@ exports.GENERATED_MCP_TOOLS = [
1194
1217
  "isReadOnly": true,
1195
1218
  "effect": "workspace_read",
1196
1219
  "riskLevel": 0,
1197
- "concurrencyClass": "lsp-limited"
1220
+ "concurrencyClass": "lsp-limited",
1221
+ "mcpSupportsCwtOnly": true
1198
1222
  }
1199
1223
  },
1200
1224
  {
@@ -1222,7 +1246,8 @@ exports.GENERATED_MCP_TOOLS = [
1222
1246
  "isReadOnly": true,
1223
1247
  "effect": "workspace_read",
1224
1248
  "riskLevel": 0,
1225
- "concurrencyClass": "parallel"
1249
+ "concurrencyClass": "parallel",
1250
+ "mcpSupportsCwtOnly": false
1226
1251
  }
1227
1252
  },
1228
1253
  {
@@ -1250,7 +1275,8 @@ exports.GENERATED_MCP_TOOLS = [
1250
1275
  "isReadOnly": true,
1251
1276
  "effect": "workspace_read",
1252
1277
  "riskLevel": 0,
1253
- "concurrencyClass": "parallel"
1278
+ "concurrencyClass": "parallel",
1279
+ "mcpSupportsCwtOnly": false
1254
1280
  }
1255
1281
  },
1256
1282
  {
@@ -1278,7 +1304,8 @@ exports.GENERATED_MCP_TOOLS = [
1278
1304
  "isReadOnly": true,
1279
1305
  "effect": "workspace_read",
1280
1306
  "riskLevel": 0,
1281
- "concurrencyClass": "parallel"
1307
+ "concurrencyClass": "parallel",
1308
+ "mcpSupportsCwtOnly": false
1282
1309
  }
1283
1310
  },
1284
1311
  {
@@ -1306,7 +1333,8 @@ exports.GENERATED_MCP_TOOLS = [
1306
1333
  "isReadOnly": true,
1307
1334
  "effect": "workspace_read",
1308
1335
  "riskLevel": 0,
1309
- "concurrencyClass": "parallel"
1336
+ "concurrencyClass": "parallel",
1337
+ "mcpSupportsCwtOnly": false
1310
1338
  }
1311
1339
  },
1312
1340
  {
@@ -1330,7 +1358,8 @@ exports.GENERATED_MCP_TOOLS = [
1330
1358
  "isReadOnly": true,
1331
1359
  "effect": "workspace_read",
1332
1360
  "riskLevel": 0,
1333
- "concurrencyClass": "parallel"
1361
+ "concurrencyClass": "parallel",
1362
+ "mcpSupportsCwtOnly": false
1334
1363
  }
1335
1364
  },
1336
1365
  {
@@ -1356,7 +1385,8 @@ exports.GENERATED_MCP_TOOLS = [
1356
1385
  "isReadOnly": true,
1357
1386
  "effect": "workspace_read",
1358
1387
  "riskLevel": 0,
1359
- "concurrencyClass": "parallel"
1388
+ "concurrencyClass": "parallel",
1389
+ "mcpSupportsCwtOnly": false
1360
1390
  }
1361
1391
  },
1362
1392
  {
@@ -1399,7 +1429,8 @@ exports.GENERATED_MCP_TOOLS = [
1399
1429
  "isReadOnly": true,
1400
1430
  "effect": "workspace_read",
1401
1431
  "riskLevel": 0,
1402
- "concurrencyClass": "lsp-limited"
1432
+ "concurrencyClass": "lsp-limited",
1433
+ "mcpSupportsCwtOnly": false
1403
1434
  }
1404
1435
  },
1405
1436
  {
@@ -1425,7 +1456,8 @@ exports.GENERATED_MCP_TOOLS = [
1425
1456
  "isReadOnly": true,
1426
1457
  "effect": "workspace_read",
1427
1458
  "riskLevel": 0,
1428
- "concurrencyClass": "lsp-limited"
1459
+ "concurrencyClass": "lsp-limited",
1460
+ "mcpSupportsCwtOnly": false
1429
1461
  }
1430
1462
  },
1431
1463
  {
@@ -1451,7 +1483,8 @@ exports.GENERATED_MCP_TOOLS = [
1451
1483
  "isReadOnly": true,
1452
1484
  "effect": "workspace_read",
1453
1485
  "riskLevel": 0,
1454
- "concurrencyClass": "lsp-limited"
1486
+ "concurrencyClass": "lsp-limited",
1487
+ "mcpSupportsCwtOnly": false
1455
1488
  }
1456
1489
  },
1457
1490
  {
@@ -1481,7 +1514,8 @@ exports.GENERATED_MCP_TOOLS = [
1481
1514
  "isReadOnly": true,
1482
1515
  "effect": "workspace_read",
1483
1516
  "riskLevel": 0,
1484
- "concurrencyClass": "lsp-limited"
1517
+ "concurrencyClass": "lsp-limited",
1518
+ "mcpSupportsCwtOnly": false
1485
1519
  }
1486
1520
  },
1487
1521
  {
@@ -1517,7 +1551,8 @@ exports.GENERATED_MCP_TOOLS = [
1517
1551
  "isReadOnly": true,
1518
1552
  "effect": "workspace_read",
1519
1553
  "riskLevel": 0,
1520
- "concurrencyClass": "lsp-limited"
1554
+ "concurrencyClass": "lsp-limited",
1555
+ "mcpSupportsCwtOnly": false
1521
1556
  }
1522
1557
  },
1523
1558
  {
@@ -1543,7 +1578,8 @@ exports.GENERATED_MCP_TOOLS = [
1543
1578
  "isReadOnly": true,
1544
1579
  "effect": "workspace_read",
1545
1580
  "riskLevel": 0,
1546
- "concurrencyClass": "lsp-limited"
1581
+ "concurrencyClass": "lsp-limited",
1582
+ "mcpSupportsCwtOnly": false
1547
1583
  }
1548
1584
  },
1549
1585
  {
@@ -1571,7 +1607,8 @@ exports.GENERATED_MCP_TOOLS = [
1571
1607
  "isReadOnly": true,
1572
1608
  "effect": "workspace_read",
1573
1609
  "riskLevel": 0,
1574
- "concurrencyClass": "lsp-limited"
1610
+ "concurrencyClass": "lsp-limited",
1611
+ "mcpSupportsCwtOnly": false
1575
1612
  }
1576
1613
  },
1577
1614
  {
@@ -1599,7 +1636,8 @@ exports.GENERATED_MCP_TOOLS = [
1599
1636
  "isReadOnly": true,
1600
1637
  "effect": "workspace_read",
1601
1638
  "riskLevel": 0,
1602
- "concurrencyClass": "parallel"
1639
+ "concurrencyClass": "parallel",
1640
+ "mcpSupportsCwtOnly": false
1603
1641
  }
1604
1642
  },
1605
1643
  {
@@ -1642,7 +1680,8 @@ exports.GENERATED_MCP_TOOLS = [
1642
1680
  "isReadOnly": true,
1643
1681
  "effect": "workspace_read",
1644
1682
  "riskLevel": 0,
1645
- "concurrencyClass": "parallel"
1683
+ "concurrencyClass": "parallel",
1684
+ "mcpSupportsCwtOnly": false
1646
1685
  }
1647
1686
  },
1648
1687
  {
@@ -1710,7 +1749,8 @@ exports.GENERATED_MCP_TOOLS = [
1710
1749
  "isReadOnly": false,
1711
1750
  "effect": "workspace_write",
1712
1751
  "riskLevel": 2,
1713
- "concurrencyClass": "per-file-write"
1752
+ "concurrencyClass": "per-file-write",
1753
+ "mcpSupportsCwtOnly": false
1714
1754
  }
1715
1755
  },
1716
1756
  {
@@ -4198,7 +4238,8 @@ exports.GENERATED_MCP_TOOLS = [
4198
4238
  "isReadOnly": false,
4199
4239
  "effect": "workspace_write",
4200
4240
  "riskLevel": 2,
4201
- "concurrencyClass": "per-file-write"
4241
+ "concurrencyClass": "per-file-write",
4242
+ "mcpSupportsCwtOnly": false
4202
4243
  }
4203
4244
  },
4204
4245
  {
@@ -4238,7 +4279,8 @@ exports.GENERATED_MCP_TOOLS = [
4238
4279
  "isReadOnly": false,
4239
4280
  "effect": "workspace_write",
4240
4281
  "riskLevel": 2,
4241
- "concurrencyClass": "per-file-write"
4282
+ "concurrencyClass": "per-file-write",
4283
+ "mcpSupportsCwtOnly": false
4242
4284
  }
4243
4285
  },
4244
4286
  {
@@ -4282,7 +4324,8 @@ exports.GENERATED_MCP_TOOLS = [
4282
4324
  "isReadOnly": false,
4283
4325
  "effect": "media",
4284
4326
  "riskLevel": 2,
4285
- "concurrencyClass": "interactive"
4327
+ "concurrencyClass": "interactive",
4328
+ "mcpSupportsCwtOnly": false
4286
4329
  }
4287
4330
  },
4288
4331
  {
@@ -4329,7 +4372,8 @@ exports.GENERATED_MCP_TOOLS = [
4329
4372
  "isReadOnly": false,
4330
4373
  "effect": "media",
4331
4374
  "riskLevel": 2,
4332
- "concurrencyClass": "interactive"
4375
+ "concurrencyClass": "interactive",
4376
+ "mcpSupportsCwtOnly": false
4333
4377
  }
4334
4378
  },
4335
4379
  {
@@ -4364,7 +4408,8 @@ exports.GENERATED_MCP_TOOLS = [
4364
4408
  "isReadOnly": false,
4365
4409
  "effect": "media",
4366
4410
  "riskLevel": 2,
4367
- "concurrencyClass": "interactive"
4411
+ "concurrencyClass": "interactive",
4412
+ "mcpSupportsCwtOnly": false
4368
4413
  }
4369
4414
  }
4370
4415
  ];
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Steam Workshop workspace detection.
3
+ *
4
+ * Workshop mods live under `steamapps/workshop/content/<appId>/<itemId>`.
5
+ * The App ID in the path is the most reliable game-identification signal
6
+ * available — far better than text/marker scoring — so it is used both to
7
+ * correct misdetection and to gate activation behind explicit user consent.
8
+ *
9
+ * This module deliberately avoids importing `vscode` so unit tests can load
10
+ * it directly without stubs.
11
+ */
12
+ /**
13
+ * Extracts the Steam App ID from a workshop content path.
14
+ * Matches a `workshop` segment immediately followed by `content` and a
15
+ * purely numeric segment, case-insensitively and across path separators.
16
+ */
17
+ export declare function parseWorkshopContentAppId(rootPath: string): string | undefined;
18
+ /**
19
+ * Maps a Steam App ID to a registered game language ID.
20
+ * Placeholder App IDs ('0', e.g. EU5 until the real one is known) never match.
21
+ */
22
+ export declare function getGameIdForWorkshopAppId(appId: string): string | undefined;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ // Generated by tools/generate-mcp-detection.cjs from client/extension.
3
+ // Do not edit by hand; run npm run generate:mcp-detection.
4
+ /**
5
+ * Steam Workshop workspace detection.
6
+ *
7
+ * Workshop mods live under `steamapps/workshop/content/<appId>/<itemId>`.
8
+ * The App ID in the path is the most reliable game-identification signal
9
+ * available — far better than text/marker scoring — so it is used both to
10
+ * correct misdetection and to gate activation behind explicit user consent.
11
+ *
12
+ * This module deliberately avoids importing `vscode` so unit tests can load
13
+ * it directly without stubs.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.parseWorkshopContentAppId = parseWorkshopContentAppId;
17
+ exports.getGameIdForWorkshopAppId = getGameIdForWorkshopAppId;
18
+ const workspaceDetectionProfiles_1 = require("./workspaceDetectionProfiles");
19
+ /**
20
+ * Extracts the Steam App ID from a workshop content path.
21
+ * Matches a `workshop` segment immediately followed by `content` and a
22
+ * purely numeric segment, case-insensitively and across path separators.
23
+ */
24
+ function parseWorkshopContentAppId(rootPath) {
25
+ const segments = rootPath.split(/[\\/]+/).filter(Boolean);
26
+ for (let i = 0; i < segments.length - 2; i++) {
27
+ if (segments[i].toLowerCase() === 'workshop' && segments[i + 1].toLowerCase() === 'content') {
28
+ const appId = segments[i + 2];
29
+ if (/^\d+$/.test(appId)) {
30
+ return appId;
31
+ }
32
+ }
33
+ }
34
+ return undefined;
35
+ }
36
+ /**
37
+ * Maps a Steam App ID to a registered game language ID.
38
+ * Placeholder App IDs ('0', e.g. EU5 until the real one is known) never match.
39
+ */
40
+ function getGameIdForWorkshopAppId(appId) {
41
+ if (!/^\d+$/.test(appId) || appId === '0') {
42
+ return undefined;
43
+ }
44
+ for (const profile of (0, workspaceDetectionProfiles_1.getWorkspaceDetectionProfiles)()) {
45
+ if (profile.steamAppId === appId) {
46
+ return profile.id;
47
+ }
48
+ }
49
+ return undefined;
50
+ }
@@ -0,0 +1,2 @@
1
+ import type { WorkspaceDetectionProfile } from './workspaceGameDetection';
2
+ export declare function getWorkspaceDetectionProfiles(): WorkspaceDetectionProfile[];
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getWorkspaceDetectionProfiles = getWorkspaceDetectionProfiles;
4
+ const PROFILES = [
5
+ {
6
+ "id": "stellaris",
7
+ "displayName": "Stellaris",
8
+ "steamFolderName": "Stellaris",
9
+ "exeName": "stellaris",
10
+ "alternativeFolderNames": [],
11
+ "steamAppId": "281990"
12
+ },
13
+ {
14
+ "id": "hoi4",
15
+ "displayName": "Hearts of Iron IV",
16
+ "steamFolderName": "Hearts of Iron IV",
17
+ "exeName": "hoi4",
18
+ "alternativeFolderNames": [],
19
+ "steamAppId": "394360"
20
+ },
21
+ {
22
+ "id": "eu4",
23
+ "displayName": "Europa Universalis IV",
24
+ "steamFolderName": "Europa Universalis IV",
25
+ "exeName": "eu4",
26
+ "alternativeFolderNames": [],
27
+ "steamAppId": "236850"
28
+ },
29
+ {
30
+ "id": "ck2",
31
+ "displayName": "Crusader Kings II",
32
+ "steamFolderName": "Crusader Kings II",
33
+ "exeName": "CK2",
34
+ "alternativeFolderNames": [],
35
+ "steamAppId": "203770"
36
+ },
37
+ {
38
+ "id": "ck3",
39
+ "displayName": "Crusader Kings III",
40
+ "steamFolderName": "Crusader Kings III",
41
+ "exeName": "ck3",
42
+ "alternativeFolderNames": [],
43
+ "steamAppId": "1158310"
44
+ },
45
+ {
46
+ "id": "vic2",
47
+ "displayName": "Victoria II",
48
+ "steamFolderName": "Victoria 2",
49
+ "exeName": "v2game",
50
+ "alternativeFolderNames": [
51
+ "Victoria II"
52
+ ],
53
+ "steamAppId": "42960"
54
+ },
55
+ {
56
+ "id": "vic3",
57
+ "displayName": "Victoria 3",
58
+ "steamFolderName": "Victoria 3",
59
+ "exeName": "victoria3",
60
+ "alternativeFolderNames": [],
61
+ "steamAppId": "529340"
62
+ },
63
+ {
64
+ "id": "imperator",
65
+ "displayName": "Imperator: Rome",
66
+ "steamFolderName": "ImperatorRome",
67
+ "exeName": "imperator",
68
+ "alternativeFolderNames": [
69
+ "Imperator"
70
+ ],
71
+ "steamAppId": "859580"
72
+ },
73
+ {
74
+ "id": "eu5",
75
+ "displayName": "Europa Universalis V",
76
+ "steamFolderName": "Europa Universalis V",
77
+ "exeName": "eu5",
78
+ "alternativeFolderNames": [],
79
+ "steamAppId": "0"
80
+ }
81
+ ];
82
+ function getWorkspaceDetectionProfiles() {
83
+ return PROFILES.map(profile => ({ ...profile, alternativeFolderNames: [...profile.alternativeFolderNames] }));
84
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Workspace game detection.
3
+ *
4
+ * Pure, vscode-free evidence classification. Structural evidence decides WHETHER
5
+ * a workspace is supported; scoring only decides WHICH game it targets. The
6
+ * MCP generator publishes this file and its profile adapter to cwtools-shared.
7
+ */
8
+ /** Looks up the user-configured vanilla data path for a game id. */
9
+ export type ConfiguredGamePathLookup = (gameId: string) => string | undefined;
10
+ export interface WorkspaceDetectionProfile {
11
+ id: string;
12
+ displayName: string;
13
+ steamFolderName: string;
14
+ exeName: string;
15
+ alternativeFolderNames: string[];
16
+ steamAppId: string;
17
+ }
18
+ export type WorkspaceProjectKind = 'mod' | 'vanilla' | 'cwt-only' | 'unsupported' | 'ambiguous';
19
+ export type WorkspaceEvidenceStrength = 'strong' | 'composite' | 'none';
20
+ export interface WorkspaceProjectDetection {
21
+ kind: WorkspaceProjectKind;
22
+ gameId?: string;
23
+ matchedAt?: string;
24
+ evidence: string[];
25
+ candidates?: string[];
26
+ strength: WorkspaceEvidenceStrength;
27
+ reason: string;
28
+ }
29
+ export declare function hasWorkspaceModDescriptor(rootPath: string): boolean;
30
+ /** Classify only this exact root; no ancestor or child can change its identity. */
31
+ export declare function classifyWorkspaceRoot(rootPath: string, configuredGamePath: ConfiguredGamePathLookup, options?: {
32
+ allowCwt?: boolean;
33
+ }): WorkspaceProjectDetection;
34
+ /** Resolve a root, a strong ancestor, or exactly one matching immediate child. */
35
+ export declare function detectWorkspaceProject(rootPath: string, configuredGamePath: ConfiguredGamePathLookup): WorkspaceProjectDetection;
36
+ /** True only for game/mod evidence; CWT-only deliberately does not select a game. */
37
+ export declare function workspaceHasParadoxStructure(rootPath: string, configuredGamePath: ConfiguredGamePathLookup): boolean;
38
+ /** Infer the game only after structural support has been established. */
39
+ export declare function inferGameIdFromWorkspace(rootPath: string, configuredGamePath: ConfiguredGamePathLookup): string | undefined;