@jskit-ai/jskit-catalog 0.2.112 → 0.2.113

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.
@@ -6,55 +6,55 @@
6
6
  "release": {
7
7
  "packages": {
8
8
  "@jskit-ai/agent": "0.1.3",
9
- "@jskit-ai/agent-docs": "0.1.360",
10
- "@jskit-ai/agent-runtime": "0.1.45",
9
+ "@jskit-ai/agent-docs": "0.1.361",
10
+ "@jskit-ai/agent-runtime": "0.1.46",
11
11
  "@jskit-ai/architecture-inspector": "0.1.34",
12
- "@jskit-ai/assistant-core": "0.2.89",
13
- "@jskit-ai/assistant-runtime": "0.2.95",
14
- "@jskit-ai/assistant-voice": "0.2.95",
15
- "@jskit-ai/assistant-voice-sherpa": "0.1.142",
12
+ "@jskit-ai/assistant-core": "0.2.90",
13
+ "@jskit-ai/assistant-runtime": "0.2.96",
14
+ "@jskit-ai/assistant-voice": "0.2.96",
15
+ "@jskit-ai/assistant-voice-sherpa": "0.1.143",
16
16
  "@jskit-ai/auth-core": "0.2.40",
17
17
  "@jskit-ai/auth-pass": "0.1.9",
18
18
  "@jskit-ai/auth-provider-local-core": "0.2.47",
19
- "@jskit-ai/auth-provider-local-db-core": "0.1.206",
20
- "@jskit-ai/auth-provider-oidc-core": "0.2.68",
19
+ "@jskit-ai/auth-provider-local-db-core": "0.1.207",
20
+ "@jskit-ai/auth-provider-oidc-core": "0.2.69",
21
21
  "@jskit-ai/auth-provider-supabase-core": "0.2.43",
22
22
  "@jskit-ai/auth-web": "0.2.61",
23
23
  "@jskit-ai/config-eslint": "0.1.253",
24
- "@jskit-ai/connector-google-calendar": "0.2.56",
25
- "@jskit-ai/connectors-catalog": "0.2.59",
26
- "@jskit-ai/connectors-core": "0.2.56",
27
- "@jskit-ai/connectors-web": "0.2.56",
28
- "@jskit-ai/console-core": "0.2.68",
29
- "@jskit-ai/console-web": "0.1.301",
30
- "@jskit-ai/crud-core": "0.2.57",
31
- "@jskit-ai/database-runtime": "0.1.288",
32
- "@jskit-ai/database-runtime-mysql": "0.1.286",
33
- "@jskit-ai/database-runtime-postgres": "0.1.285",
24
+ "@jskit-ai/connector-google-calendar": "0.2.57",
25
+ "@jskit-ai/connectors-catalog": "0.2.60",
26
+ "@jskit-ai/connectors-core": "0.2.57",
27
+ "@jskit-ai/connectors-web": "0.2.57",
28
+ "@jskit-ai/console-core": "0.2.69",
29
+ "@jskit-ai/console-web": "0.1.302",
30
+ "@jskit-ai/crud-core": "0.2.58",
31
+ "@jskit-ai/database-runtime": "0.1.289",
32
+ "@jskit-ai/database-runtime-mysql": "0.1.287",
33
+ "@jskit-ai/database-runtime-postgres": "0.1.286",
34
34
  "@jskit-ai/http-runtime": "0.2.36",
35
35
  "@jskit-ai/http-web": "0.2.62",
36
- "@jskit-ai/jskit-catalog": "0.2.112",
36
+ "@jskit-ai/jskit-catalog": "0.2.113",
37
37
  "@jskit-ai/kernel": "0.2.35",
38
38
  "@jskit-ai/material-web": "0.1.12",
39
39
  "@jskit-ai/mobile-capacitor": "0.2.53",
40
- "@jskit-ai/oidc-issuer-core": "0.1.57",
41
- "@jskit-ai/payments-core": "0.2.45",
40
+ "@jskit-ai/oidc-issuer-core": "0.1.58",
41
+ "@jskit-ai/payments-core": "0.2.46",
42
42
  "@jskit-ai/payments-web": "0.2.36",
43
43
  "@jskit-ai/realtime": "0.2.56",
44
44
  "@jskit-ai/release": "0.1.16",
45
45
  "@jskit-ai/resource-core": "0.1.226",
46
46
  "@jskit-ai/resource-crud-core": "0.1.228",
47
- "@jskit-ai/resource-runtime": "0.2.53",
48
- "@jskit-ai/rewarded-core": "0.2.68",
49
- "@jskit-ai/rewarded-web": "0.2.77",
47
+ "@jskit-ai/resource-runtime": "0.2.54",
48
+ "@jskit-ai/rewarded-core": "0.2.69",
49
+ "@jskit-ai/rewarded-web": "0.2.78",
50
50
  "@jskit-ai/shell-web": "0.2.53",
51
51
  "@jskit-ai/storage-runtime": "0.1.281",
52
52
  "@jskit-ai/uploads-image-web": "0.2.35",
53
53
  "@jskit-ai/uploads-runtime": "0.2.35",
54
- "@jskit-ai/users-core": "0.2.68",
55
- "@jskit-ai/users-web": "0.2.85",
56
- "@jskit-ai/workspaces-core": "0.2.68",
57
- "@jskit-ai/workspaces-web": "0.2.85"
54
+ "@jskit-ai/users-core": "0.2.69",
55
+ "@jskit-ai/users-web": "0.2.86",
56
+ "@jskit-ai/workspaces-core": "0.2.69",
57
+ "@jskit-ai/workspaces-web": "0.2.86"
58
58
  },
59
59
  "singletonPackages": [
60
60
  "@jskit-ai/assistant-runtime",
@@ -113,7 +113,7 @@
113
113
  },
114
114
  {
115
115
  "packageId": "@jskit-ai/agent-runtime",
116
- "version": "0.1.45",
116
+ "version": "0.1.46",
117
117
  "description": "Opt-in parts of the agent: its own tables (saved runs, goals, summaries, commands) and coding tools (files, commands in gVisor or a local process, to-do list, notes, goals, asking the person). PostgreSQL.",
118
118
  "jskit": {
119
119
  "kind": "runtime",
@@ -178,14 +178,14 @@
178
178
  "zod": "^4.6.7"
179
179
  },
180
180
  "peerDependencies": {
181
- "@jskit-ai/database-runtime": "0.1.288",
182
- "@jskit-ai/resource-runtime": "0.2.53"
181
+ "@jskit-ai/database-runtime": "0.1.289",
182
+ "@jskit-ai/resource-runtime": "0.2.54"
183
183
  }
184
184
  }
185
185
  },
186
186
  {
187
187
  "packageId": "@jskit-ai/assistant-core",
188
- "version": "0.2.89",
188
+ "version": "0.2.90",
189
189
  "description": "Reusable assistant client/server/shared primitives without surface-specific routes or settings ownership.",
190
190
  "jskit": {
191
191
  "kind": "runtime",
@@ -369,7 +369,7 @@
369
369
  },
370
370
  {
371
371
  "packageId": "@jskit-ai/assistant-runtime",
372
- "version": "0.2.95",
372
+ "version": "0.2.96",
373
373
  "description": "Capability-based assistant runtime with per-surface chat, transcripts, settings, and action tools.",
374
374
  "jskit": {
375
375
  "kind": "runtime",
@@ -475,7 +475,7 @@
475
475
  },
476
476
  "packageJson": {
477
477
  "dependencies": {
478
- "@jskit-ai/assistant-core": "0.2.89",
478
+ "@jskit-ai/assistant-core": "0.2.90",
479
479
  "@jskit-ai/resource-core": "0.1.226",
480
480
  "json-rest-schema": "^1.0.20"
481
481
  },
@@ -488,14 +488,14 @@
488
488
  "@tanstack/vue-query": "^5.90.5",
489
489
  "vue": "^3.5.13",
490
490
  "vuetify": "^4.0.0",
491
- "@jskit-ai/database-runtime": "0.1.288",
492
- "@jskit-ai/resource-runtime": "0.2.53"
491
+ "@jskit-ai/database-runtime": "0.1.289",
492
+ "@jskit-ai/resource-runtime": "0.2.54"
493
493
  }
494
494
  }
495
495
  },
496
496
  {
497
497
  "packageId": "@jskit-ai/assistant-voice",
498
- "version": "0.2.95",
498
+ "version": "0.2.96",
499
499
  "description": "Duplex voice conversations with application-owned targets and authorization, and the speech service engine with its client.",
500
500
  "jskit": {
501
501
  "kind": "runtime",
@@ -541,7 +541,7 @@
541
541
  },
542
542
  "packageJson": {
543
543
  "dependencies": {
544
- "@jskit-ai/assistant-core": "0.2.89",
544
+ "@jskit-ai/assistant-core": "0.2.90",
545
545
  "ws": "^8.20.1"
546
546
  },
547
547
  "peerDependencies": {
@@ -553,7 +553,7 @@
553
553
  },
554
554
  {
555
555
  "packageId": "@jskit-ai/assistant-voice-sherpa",
556
- "version": "0.1.142",
556
+ "version": "0.1.143",
557
557
  "description": "Optional native Sherpa speech engine and explicit model preparation for assistant voice.",
558
558
  "jskit": {
559
559
  "kind": "runtime",
@@ -591,7 +591,7 @@
591
591
  },
592
592
  "packageJson": {
593
593
  "dependencies": {
594
- "@jskit-ai/assistant-voice": "0.2.95",
594
+ "@jskit-ai/assistant-voice": "0.2.96",
595
595
  "sherpa-onnx-node": "1.13.6"
596
596
  }
597
597
  }
@@ -781,7 +781,7 @@
781
781
  },
782
782
  {
783
783
  "packageId": "@jskit-ai/auth-provider-local-db-core",
784
- "version": "0.1.206",
784
+ "version": "0.1.207",
785
785
  "description": "Database-backed local auth storage backend for JSKIT local auth.",
786
786
  "jskit": {
787
787
  "kind": "runtime",
@@ -880,15 +880,15 @@
880
880
  },
881
881
  "peerDependencies": {
882
882
  "@jskit-ai/auth-core": "0.2.40",
883
- "@jskit-ai/database-runtime": "0.1.288",
883
+ "@jskit-ai/database-runtime": "0.1.289",
884
884
  "@jskit-ai/kernel": "0.2.35",
885
- "@jskit-ai/resource-runtime": "0.2.53"
885
+ "@jskit-ai/resource-runtime": "0.2.54"
886
886
  }
887
887
  }
888
888
  },
889
889
  {
890
890
  "packageId": "@jskit-ai/auth-provider-oidc-core",
891
- "version": "0.2.68",
891
+ "version": "0.2.69",
892
892
  "description": "Sign in through any OpenID Connect issuer: self-registration or a static client, app-owned sessions, and back-channel logout.",
893
893
  "jskit": {
894
894
  "kind": "runtime",
@@ -963,7 +963,7 @@
963
963
  },
964
964
  "peerDependencies": {
965
965
  "@jskit-ai/auth-core": "0.2.40",
966
- "@jskit-ai/database-runtime": "0.1.288",
966
+ "@jskit-ai/database-runtime": "0.1.289",
967
967
  "@jskit-ai/kernel": "0.2.35"
968
968
  }
969
969
  }
@@ -1384,7 +1384,7 @@
1384
1384
  },
1385
1385
  {
1386
1386
  "packageId": "@jskit-ai/connector-google-calendar",
1387
- "version": "0.2.56",
1387
+ "version": "0.2.57",
1388
1388
  "description": "Google Calendar account configuration and event operations for JSKIT connectors.",
1389
1389
  "jskit": {
1390
1390
  "kind": "runtime",
@@ -1403,7 +1403,7 @@
1403
1403
  },
1404
1404
  "packageJson": {
1405
1405
  "dependencies": {
1406
- "@jskit-ai/connectors-core": "0.2.56",
1406
+ "@jskit-ai/connectors-core": "0.2.57",
1407
1407
  "json-rest-schema": "^1.0.20"
1408
1408
  },
1409
1409
  "peerDependencies": {
@@ -1413,7 +1413,7 @@
1413
1413
  },
1414
1414
  {
1415
1415
  "packageId": "@jskit-ai/connectors-catalog",
1416
- "version": "0.2.59",
1416
+ "version": "0.2.60",
1417
1417
  "description": "Provider definitions and focused API operations for JSKIT connectors.",
1418
1418
  "jskit": {
1419
1419
  "kind": "runtime",
@@ -1436,7 +1436,7 @@
1436
1436
  "@aws-sdk/client-redshift-data": "3.1128.0",
1437
1437
  "@aws-sdk/client-s3": "3.1128.0",
1438
1438
  "@aws-sdk/s3-request-presigner": "3.1128.0",
1439
- "@jskit-ai/connectors-core": "0.2.56",
1439
+ "@jskit-ai/connectors-core": "0.2.57",
1440
1440
  "@modelcontextprotocol/sdk": "1.32.1",
1441
1441
  "@smithy/fetch-http-handler": "5.8.0",
1442
1442
  "jose": "^6.1.3",
@@ -1449,7 +1449,7 @@
1449
1449
  },
1450
1450
  {
1451
1451
  "packageId": "@jskit-ai/connectors-core",
1452
- "version": "0.2.56",
1452
+ "version": "0.2.57",
1453
1453
  "description": "Portable integration configuration and server-side account connection runtime.",
1454
1454
  "jskit": {
1455
1455
  "kind": "runtime",
@@ -1494,16 +1494,16 @@
1494
1494
  "proper-lockfile": "4.1.2"
1495
1495
  },
1496
1496
  "peerDependencies": {
1497
- "@jskit-ai/database-runtime": "0.1.288",
1497
+ "@jskit-ai/database-runtime": "0.1.289",
1498
1498
  "@jskit-ai/http-runtime": "0.2.36",
1499
1499
  "@jskit-ai/kernel": "0.2.35",
1500
- "@jskit-ai/resource-runtime": "0.2.53"
1500
+ "@jskit-ai/resource-runtime": "0.2.54"
1501
1501
  }
1502
1502
  }
1503
1503
  },
1504
1504
  {
1505
1505
  "packageId": "@jskit-ai/connectors-web",
1506
- "version": "0.2.56",
1506
+ "version": "0.2.57",
1507
1507
  "description": "Shared Vue fields for portable application integration configuration.",
1508
1508
  "jskit": {
1509
1509
  "kind": "runtime",
@@ -1522,7 +1522,7 @@
1522
1522
  },
1523
1523
  "packageJson": {
1524
1524
  "dependencies": {
1525
- "@jskit-ai/connectors-core": "0.2.56"
1525
+ "@jskit-ai/connectors-core": "0.2.57"
1526
1526
  },
1527
1527
  "peerDependencies": {
1528
1528
  "@jskit-ai/kernel": "0.2.35",
@@ -1533,7 +1533,7 @@
1533
1533
  },
1534
1534
  {
1535
1535
  "packageId": "@jskit-ai/console-core",
1536
- "version": "0.2.68",
1536
+ "version": "0.2.69",
1537
1537
  "description": "Console runtime: console settings schema, bootstrap flags, actions, and HTTP routes.",
1538
1538
  "jskit": {
1539
1539
  "kind": "runtime",
@@ -1617,21 +1617,21 @@
1617
1617
  "packageJson": {
1618
1618
  "dependencies": {
1619
1619
  "@jskit-ai/resource-core": "0.1.226",
1620
- "@jskit-ai/users-core": "0.2.68",
1620
+ "@jskit-ai/users-core": "0.2.69",
1621
1621
  "json-rest-schema": "^1.0.20"
1622
1622
  },
1623
1623
  "peerDependencies": {
1624
1624
  "@jskit-ai/auth-core": "0.2.40",
1625
- "@jskit-ai/database-runtime": "0.1.288",
1625
+ "@jskit-ai/database-runtime": "0.1.289",
1626
1626
  "@jskit-ai/http-runtime": "0.2.36",
1627
1627
  "@jskit-ai/kernel": "0.2.35",
1628
- "@jskit-ai/resource-runtime": "0.2.53"
1628
+ "@jskit-ai/resource-runtime": "0.2.54"
1629
1629
  }
1630
1630
  }
1631
1631
  },
1632
1632
  {
1633
1633
  "packageId": "@jskit-ai/console-web",
1634
- "version": "0.1.301",
1634
+ "version": "0.1.302",
1635
1635
  "description": "Authenticated console surface scaffold and surface policy wiring.",
1636
1636
  "jskit": {
1637
1637
  "kind": "runtime",
@@ -1725,7 +1725,7 @@
1725
1725
  },
1726
1726
  "packageJson": {
1727
1727
  "dependencies": {
1728
- "@jskit-ai/console-core": "0.2.68"
1728
+ "@jskit-ai/console-core": "0.2.69"
1729
1729
  },
1730
1730
  "peerDependencies": {
1731
1731
  "@jskit-ai/auth-web": "0.2.61",
@@ -1735,7 +1735,7 @@
1735
1735
  },
1736
1736
  {
1737
1737
  "packageId": "@jskit-ai/crud-core",
1738
- "version": "0.2.57",
1738
+ "version": "0.2.58",
1739
1739
  "description": "Shared server-side CRUD service, repository, route, and query helpers.",
1740
1740
  "jskit": {
1741
1741
  "kind": "runtime",
@@ -1769,13 +1769,13 @@
1769
1769
  "peerDependencies": {
1770
1770
  "@jskit-ai/http-runtime": "0.2.36",
1771
1771
  "@jskit-ai/kernel": "0.2.35",
1772
- "@jskit-ai/resource-runtime": "0.2.53"
1772
+ "@jskit-ai/resource-runtime": "0.2.54"
1773
1773
  }
1774
1774
  }
1775
1775
  },
1776
1776
  {
1777
1777
  "packageId": "@jskit-ai/database-runtime",
1778
- "version": "0.1.288",
1778
+ "version": "0.1.289",
1779
1779
  "jskit": {
1780
1780
  "kind": "runtime",
1781
1781
  "capabilities": {
@@ -1850,7 +1850,7 @@
1850
1850
  },
1851
1851
  {
1852
1852
  "packageId": "@jskit-ai/database-runtime-mysql",
1853
- "version": "0.1.286",
1853
+ "version": "0.1.287",
1854
1854
  "jskit": {
1855
1855
  "kind": "runtime",
1856
1856
  "capabilities": {
@@ -1896,14 +1896,14 @@
1896
1896
  "mysql2": "^3.11.2"
1897
1897
  },
1898
1898
  "peerDependencies": {
1899
- "@jskit-ai/database-runtime": "0.1.288",
1899
+ "@jskit-ai/database-runtime": "0.1.289",
1900
1900
  "@jskit-ai/kernel": "0.2.35"
1901
1901
  }
1902
1902
  }
1903
1903
  },
1904
1904
  {
1905
1905
  "packageId": "@jskit-ai/database-runtime-postgres",
1906
- "version": "0.1.285",
1906
+ "version": "0.1.286",
1907
1907
  "jskit": {
1908
1908
  "kind": "runtime",
1909
1909
  "capabilities": {
@@ -1949,7 +1949,7 @@
1949
1949
  "pg": "^8.13.1"
1950
1950
  },
1951
1951
  "peerDependencies": {
1952
- "@jskit-ai/database-runtime": "0.1.288",
1952
+ "@jskit-ai/database-runtime": "0.1.289",
1953
1953
  "@jskit-ai/kernel": "0.2.35"
1954
1954
  }
1955
1955
  }
@@ -2184,7 +2184,7 @@
2184
2184
  },
2185
2185
  {
2186
2186
  "packageId": "@jskit-ai/oidc-issuer-core",
2187
- "version": "0.1.57",
2187
+ "version": "0.1.58",
2188
2188
  "description": "OpenID Connect accounts hub: one sign-in for all of an owner's apps, with approval of every production app.",
2189
2189
  "jskit": {
2190
2190
  "kind": "runtime",
@@ -2283,14 +2283,14 @@
2283
2283
  "oidc-provider": "9.12.2"
2284
2284
  },
2285
2285
  "peerDependencies": {
2286
- "@jskit-ai/database-runtime": "0.1.288",
2286
+ "@jskit-ai/database-runtime": "0.1.289",
2287
2287
  "@jskit-ai/kernel": "0.2.35"
2288
2288
  }
2289
2289
  }
2290
2290
  },
2291
2291
  {
2292
2292
  "packageId": "@jskit-ai/payments-core",
2293
- "version": "0.2.45",
2293
+ "version": "0.2.46",
2294
2294
  "description": "Application-owned payment configuration, subscription access, prepaid top-ups and transactional usage credits.",
2295
2295
  "jskit": {
2296
2296
  "kind": "runtime",
@@ -2343,9 +2343,9 @@
2343
2343
  "stripe": "22.6.2"
2344
2344
  },
2345
2345
  "peerDependencies": {
2346
- "@jskit-ai/database-runtime": "0.1.288",
2346
+ "@jskit-ai/database-runtime": "0.1.289",
2347
2347
  "@jskit-ai/kernel": "0.2.35",
2348
- "@jskit-ai/resource-runtime": "0.2.53"
2348
+ "@jskit-ai/resource-runtime": "0.2.54"
2349
2349
  }
2350
2350
  }
2351
2351
  },
@@ -2574,7 +2574,7 @@
2574
2574
  },
2575
2575
  {
2576
2576
  "packageId": "@jskit-ai/resource-runtime",
2577
- "version": "0.2.53",
2577
+ "version": "0.2.54",
2578
2578
  "description": "The resource runtime: features own their tables through it and read and write them with scoped handles on json-rest-api.",
2579
2579
  "jskit": {
2580
2580
  "kind": "runtime",
@@ -2630,14 +2630,14 @@
2630
2630
  "json-rest-api": "3.3.4"
2631
2631
  },
2632
2632
  "peerDependencies": {
2633
- "@jskit-ai/database-runtime": "0.1.288",
2633
+ "@jskit-ai/database-runtime": "0.1.289",
2634
2634
  "@jskit-ai/kernel": "0.2.35"
2635
2635
  }
2636
2636
  }
2637
2637
  },
2638
2638
  {
2639
2639
  "packageId": "@jskit-ai/rewarded-core",
2640
- "version": "0.2.68",
2640
+ "version": "0.2.69",
2641
2641
  "description": "Rewarded workflow runtime plus internal CRUD providers for rules, provider configs, watch sessions, and unlock receipts.",
2642
2642
  "jskit": {
2643
2643
  "kind": "runtime",
@@ -2752,25 +2752,25 @@
2752
2752
  },
2753
2753
  "packageJson": {
2754
2754
  "dependencies": {
2755
- "@jskit-ai/crud-core": "0.2.57",
2755
+ "@jskit-ai/crud-core": "0.2.58",
2756
2756
  "@jskit-ai/resource-core": "0.1.226",
2757
2757
  "@jskit-ai/resource-crud-core": "0.1.228",
2758
- "@jskit-ai/users-core": "0.2.68",
2759
- "@jskit-ai/workspaces-core": "0.2.68",
2758
+ "@jskit-ai/users-core": "0.2.69",
2759
+ "@jskit-ai/workspaces-core": "0.2.69",
2760
2760
  "json-rest-schema": "^1.0.20"
2761
2761
  },
2762
2762
  "peerDependencies": {
2763
2763
  "@jskit-ai/auth-core": "0.2.40",
2764
- "@jskit-ai/database-runtime": "0.1.288",
2764
+ "@jskit-ai/database-runtime": "0.1.289",
2765
2765
  "@jskit-ai/http-runtime": "0.2.36",
2766
2766
  "@jskit-ai/kernel": "0.2.35",
2767
- "@jskit-ai/resource-runtime": "0.2.53"
2767
+ "@jskit-ai/resource-runtime": "0.2.54"
2768
2768
  }
2769
2769
  }
2770
2770
  },
2771
2771
  {
2772
2772
  "packageId": "@jskit-ai/rewarded-web",
2773
- "version": "0.2.77",
2773
+ "version": "0.2.78",
2774
2774
  "description": "Rewarded gate client workflow with explicitly composed application delivery.",
2775
2775
  "jskit": {
2776
2776
  "kind": "runtime",
@@ -2819,7 +2819,7 @@
2819
2819
  },
2820
2820
  "packageJson": {
2821
2821
  "dependencies": {
2822
- "@jskit-ai/rewarded-core": "0.2.68"
2822
+ "@jskit-ai/rewarded-core": "0.2.69"
2823
2823
  },
2824
2824
  "peerDependencies": {
2825
2825
  "@jskit-ai/http-runtime": "0.2.36",
@@ -3411,7 +3411,7 @@
3411
3411
  },
3412
3412
  {
3413
3413
  "packageId": "@jskit-ai/users-core",
3414
- "version": "0.2.68",
3414
+ "version": "0.2.69",
3415
3415
  "description": "Users/account runtime plus HTTP routes for account features.",
3416
3416
  "jskit": {
3417
3417
  "kind": "runtime",
@@ -3600,16 +3600,16 @@
3600
3600
  },
3601
3601
  "peerDependencies": {
3602
3602
  "@jskit-ai/auth-core": "0.2.40",
3603
- "@jskit-ai/database-runtime": "0.1.288",
3603
+ "@jskit-ai/database-runtime": "0.1.289",
3604
3604
  "@jskit-ai/http-runtime": "0.2.36",
3605
3605
  "@jskit-ai/kernel": "0.2.35",
3606
- "@jskit-ai/resource-runtime": "0.2.53"
3606
+ "@jskit-ai/resource-runtime": "0.2.54"
3607
3607
  }
3608
3608
  }
3609
3609
  },
3610
3610
  {
3611
3611
  "packageId": "@jskit-ai/users-web",
3612
- "version": "0.2.85",
3612
+ "version": "0.2.86",
3613
3613
  "description": "Users web module with account, profile, and user-specific shell UI.",
3614
3614
  "jskit": {
3615
3615
  "kind": "runtime",
@@ -3815,7 +3815,7 @@
3815
3815
  "packageJson": {
3816
3816
  "dependencies": {
3817
3817
  "@jskit-ai/uploads-image-web": "0.2.35",
3818
- "@jskit-ai/users-core": "0.2.68"
3818
+ "@jskit-ai/users-core": "0.2.69"
3819
3819
  },
3820
3820
  "peerDependencies": {
3821
3821
  "@jskit-ai/auth-web": "0.2.61",
@@ -3832,7 +3832,7 @@
3832
3832
  },
3833
3833
  {
3834
3834
  "packageId": "@jskit-ai/workspaces-core",
3835
- "version": "0.2.68",
3835
+ "version": "0.2.69",
3836
3836
  "description": "Workspace tenancy runtime plus HTTP routes, role catalog, and workspace config scaffolding.",
3837
3837
  "jskit": {
3838
3838
  "kind": "runtime",
@@ -4026,21 +4026,21 @@
4026
4026
  "dependencies": {
4027
4027
  "@jskit-ai/resource-core": "0.1.226",
4028
4028
  "@jskit-ai/resource-crud-core": "0.1.228",
4029
- "@jskit-ai/users-core": "0.2.68",
4029
+ "@jskit-ai/users-core": "0.2.69",
4030
4030
  "json-rest-schema": "^1.0.20"
4031
4031
  },
4032
4032
  "peerDependencies": {
4033
4033
  "@jskit-ai/auth-core": "0.2.40",
4034
- "@jskit-ai/database-runtime": "0.1.288",
4034
+ "@jskit-ai/database-runtime": "0.1.289",
4035
4035
  "@jskit-ai/http-runtime": "0.2.36",
4036
4036
  "@jskit-ai/kernel": "0.2.35",
4037
- "@jskit-ai/resource-runtime": "0.2.53"
4037
+ "@jskit-ai/resource-runtime": "0.2.54"
4038
4038
  }
4039
4039
  }
4040
4040
  },
4041
4041
  {
4042
4042
  "packageId": "@jskit-ai/workspaces-web",
4043
- "version": "0.2.85",
4043
+ "version": "0.2.86",
4044
4044
  "description": "Workspace web module: workspace selector, tools widget, workspace surfaces, members UI, and settings hosts.",
4045
4045
  "jskit": {
4046
4046
  "kind": "runtime",
@@ -4288,15 +4288,15 @@
4288
4288
  },
4289
4289
  "packageJson": {
4290
4290
  "dependencies": {
4291
- "@jskit-ai/users-core": "0.2.68",
4292
- "@jskit-ai/workspaces-core": "0.2.68"
4291
+ "@jskit-ai/users-core": "0.2.69",
4292
+ "@jskit-ai/workspaces-core": "0.2.69"
4293
4293
  },
4294
4294
  "peerDependencies": {
4295
4295
  "@jskit-ai/auth-web": "0.2.61",
4296
4296
  "@jskit-ai/http-web": "0.2.62",
4297
4297
  "@jskit-ai/kernel": "0.2.35",
4298
4298
  "@jskit-ai/shell-web": "0.2.53",
4299
- "@jskit-ai/users-web": "0.2.85",
4299
+ "@jskit-ai/users-web": "0.2.86",
4300
4300
  "@tanstack/vue-query": "^5.90.5",
4301
4301
  "vue": "^3.5.13",
4302
4302
  "vue-router": "^5.0.4",
@@ -4328,7 +4328,7 @@
4328
4328
  "@jskit-ai/shell-web"
4329
4329
  ],
4330
4330
  "packageId": "@jskit-ai/assistant-runtime",
4331
- "packageVersion": "0.2.95",
4331
+ "packageVersion": "0.2.96",
4332
4332
  "documentPath": "patterns/assistant-surface/PATTERN.md",
4333
4333
  "examplePath": "patterns/assistant-surface/example",
4334
4334
  "files": [
@@ -4360,7 +4360,7 @@
4360
4360
  "@jskit-ai/oidc-issuer-core"
4361
4361
  ],
4362
4362
  "packageId": "@jskit-ai/oidc-issuer-core",
4363
- "packageVersion": "0.1.57",
4363
+ "packageVersion": "0.1.58",
4364
4364
  "documentPath": "patterns/accounts-hub/PATTERN.md",
4365
4365
  "examplePath": "patterns/accounts-hub/example",
4366
4366
  "files": [
@@ -4431,7 +4431,7 @@
4431
4431
  "@jskit-ai/auth-web"
4432
4432
  ],
4433
4433
  "packageId": "@jskit-ai/auth-provider-oidc-core",
4434
- "packageVersion": "0.2.68",
4434
+ "packageVersion": "0.2.69",
4435
4435
  "documentPath": "patterns/oidc-sign-in/PATTERN.md",
4436
4436
  "examplePath": "patterns/oidc-sign-in/example",
4437
4437
  "files": [
@@ -4513,7 +4513,7 @@
4513
4513
  "@jskit-ai/connectors-core"
4514
4514
  ],
4515
4515
  "packageId": "@jskit-ai/connectors-catalog",
4516
- "packageVersion": "0.2.59",
4516
+ "packageVersion": "0.2.60",
4517
4517
  "documentPath": "patterns/ai-connections/PATTERN.md",
4518
4518
  "examplePath": "patterns/ai-connections/example",
4519
4519
  "files": [
@@ -4548,7 +4548,7 @@
4548
4548
  "@jskit-ai/connectors-core"
4549
4549
  ],
4550
4550
  "packageId": "@jskit-ai/connectors-catalog",
4551
- "packageVersion": "0.2.59",
4551
+ "packageVersion": "0.2.60",
4552
4552
  "documentPath": "patterns/api-key-connection/PATTERN.md",
4553
4553
  "examplePath": "patterns/api-key-connection/example",
4554
4554
  "files": [
@@ -4575,7 +4575,7 @@
4575
4575
  "@jskit-ai/connectors-core"
4576
4576
  ],
4577
4577
  "packageId": "@jskit-ai/connectors-catalog",
4578
- "packageVersion": "0.2.59",
4578
+ "packageVersion": "0.2.60",
4579
4579
  "documentPath": "patterns/assistant-mcp/PATTERN.md",
4580
4580
  "examplePath": "patterns/assistant-mcp/example",
4581
4581
  "files": [
@@ -4608,7 +4608,7 @@
4608
4608
  "@jskit-ai/connectors-core"
4609
4609
  ],
4610
4610
  "packageId": "@jskit-ai/connectors-catalog",
4611
- "packageVersion": "0.2.59",
4611
+ "packageVersion": "0.2.60",
4612
4612
  "documentPath": "patterns/assistant-mcp-oauth/PATTERN.md",
4613
4613
  "examplePath": "patterns/assistant-mcp-oauth/example",
4614
4614
  "files": [
@@ -4636,7 +4636,7 @@
4636
4636
  "@jskit-ai/connectors-core"
4637
4637
  ],
4638
4638
  "packageId": "@jskit-ai/connectors-catalog",
4639
- "packageVersion": "0.2.59",
4639
+ "packageVersion": "0.2.60",
4640
4640
  "documentPath": "patterns/aws-storage-queries/PATTERN.md",
4641
4641
  "examplePath": "patterns/aws-storage-queries/example",
4642
4642
  "files": [
@@ -4667,7 +4667,7 @@
4667
4667
  "@jskit-ai/database-runtime-mysql"
4668
4668
  ],
4669
4669
  "packageId": "@jskit-ai/connector-google-calendar",
4670
- "packageVersion": "0.2.56",
4670
+ "packageVersion": "0.2.57",
4671
4671
  "documentPath": "patterns/calendar-cli/PATTERN.md",
4672
4672
  "examplePath": "patterns/calendar-cli/example",
4673
4673
  "files": [
@@ -4697,7 +4697,7 @@
4697
4697
  "@jskit-ai/connectors-core"
4698
4698
  ],
4699
4699
  "packageId": "@jskit-ai/connectors-catalog",
4700
- "packageVersion": "0.2.59",
4700
+ "packageVersion": "0.2.60",
4701
4701
  "documentPath": "patterns/event-delivery/PATTERN.md",
4702
4702
  "examplePath": "patterns/event-delivery/example",
4703
4703
  "files": [
@@ -4726,7 +4726,7 @@
4726
4726
  "@jskit-ai/connectors-core"
4727
4727
  ],
4728
4728
  "packageId": "@jskit-ai/connectors-catalog",
4729
- "packageVersion": "0.2.59",
4729
+ "packageVersion": "0.2.60",
4730
4730
  "documentPath": "patterns/firebase-messaging/PATTERN.md",
4731
4731
  "examplePath": "patterns/firebase-messaging/example",
4732
4732
  "files": [
@@ -4751,7 +4751,7 @@
4751
4751
  "@jskit-ai/connectors-core"
4752
4752
  ],
4753
4753
  "packageId": "@jskit-ai/connectors-catalog",
4754
- "packageVersion": "0.2.59",
4754
+ "packageVersion": "0.2.60",
4755
4755
  "documentPath": "patterns/google-ads-search/PATTERN.md",
4756
4756
  "examplePath": "patterns/google-ads-search/example",
4757
4757
  "files": [
@@ -4802,7 +4802,7 @@
4802
4802
  "@jskit-ai/connectors-core"
4803
4803
  ],
4804
4804
  "packageId": "@jskit-ai/connectors-catalog",
4805
- "packageVersion": "0.2.59",
4805
+ "packageVersion": "0.2.60",
4806
4806
  "documentPath": "patterns/oauth-connection/PATTERN.md",
4807
4807
  "examplePath": "patterns/oauth-connection/example",
4808
4808
  "files": [
@@ -4825,7 +4825,7 @@
4825
4825
  "@jskit-ai/connectors-core"
4826
4826
  ],
4827
4827
  "packageId": "@jskit-ai/connectors-catalog",
4828
- "packageVersion": "0.2.59",
4828
+ "packageVersion": "0.2.60",
4829
4829
  "documentPath": "patterns/paddle-catalogue/PATTERN.md",
4830
4830
  "examplePath": "patterns/paddle-catalogue/example",
4831
4831
  "files": [
@@ -4850,7 +4850,7 @@
4850
4850
  "@jskit-ai/connectors-core"
4851
4851
  ],
4852
4852
  "packageId": "@jskit-ai/connectors-catalog",
4853
- "packageVersion": "0.2.59",
4853
+ "packageVersion": "0.2.60",
4854
4854
  "documentPath": "patterns/public-image/PATTERN.md",
4855
4855
  "examplePath": "patterns/public-image/example",
4856
4856
  "files": [
@@ -4879,7 +4879,7 @@
4879
4879
  "@jskit-ai/connectors-core"
4880
4880
  ],
4881
4881
  "packageId": "@jskit-ai/connectors-catalog",
4882
- "packageVersion": "0.2.59",
4882
+ "packageVersion": "0.2.60",
4883
4883
  "documentPath": "patterns/redshift-queries/PATTERN.md",
4884
4884
  "examplePath": "patterns/redshift-queries/example",
4885
4885
  "files": [
@@ -4906,7 +4906,7 @@
4906
4906
  "@jskit-ai/connectors-core"
4907
4907
  ],
4908
4908
  "packageId": "@jskit-ai/connectors-catalog",
4909
- "packageVersion": "0.2.59",
4909
+ "packageVersion": "0.2.60",
4910
4910
  "documentPath": "patterns/source-scanning/PATTERN.md",
4911
4911
  "examplePath": "patterns/source-scanning/example",
4912
4912
  "files": [
@@ -4932,7 +4932,7 @@
4932
4932
  "@jskit-ai/shell-web"
4933
4933
  ],
4934
4934
  "packageId": "@jskit-ai/console-web",
4935
- "packageVersion": "0.1.301",
4935
+ "packageVersion": "0.1.302",
4936
4936
  "documentPath": "patterns/console-surface/PATTERN.md",
4937
4937
  "examplePath": "patterns/console-surface/example",
4938
4938
  "files": [
@@ -4992,7 +4992,7 @@
4992
4992
  "@jskit-ai/resource-crud-core"
4993
4993
  ],
4994
4994
  "packageId": "@jskit-ai/crud-core",
4995
- "packageVersion": "0.2.57",
4995
+ "packageVersion": "0.2.58",
4996
4996
  "documentPath": "patterns/crud-feature-package/PATTERN.md",
4997
4997
  "examplePath": "patterns/crud-feature-package/example",
4998
4998
  "files": [
@@ -5056,7 +5056,7 @@
5056
5056
  "@jskit-ai/database-runtime-mysql"
5057
5057
  ],
5058
5058
  "packageId": "@jskit-ai/database-runtime-mysql",
5059
- "packageVersion": "0.1.286",
5059
+ "packageVersion": "0.1.287",
5060
5060
  "documentPath": "patterns/mysql-application/PATTERN.md",
5061
5061
  "examplePath": "patterns/mysql-application/example",
5062
5062
  "files": [
@@ -5084,7 +5084,7 @@
5084
5084
  "@jskit-ai/database-runtime-postgres"
5085
5085
  ],
5086
5086
  "packageId": "@jskit-ai/database-runtime-postgres",
5087
- "packageVersion": "0.1.285",
5087
+ "packageVersion": "0.1.286",
5088
5088
  "documentPath": "patterns/postgres-application/PATTERN.md",
5089
5089
  "examplePath": "patterns/postgres-application/example",
5090
5090
  "files": [
@@ -5192,7 +5192,7 @@
5192
5192
  "@jskit-ai/rewarded-web"
5193
5193
  ],
5194
5194
  "packageId": "@jskit-ai/rewarded-web",
5195
- "packageVersion": "0.2.77",
5195
+ "packageVersion": "0.2.78",
5196
5196
  "documentPath": "patterns/google-rewarded/PATTERN.md",
5197
5197
  "examplePath": "patterns/google-rewarded/example",
5198
5198
  "files": [
@@ -5301,7 +5301,7 @@
5301
5301
  "@jskit-ai/users-web"
5302
5302
  ],
5303
5303
  "packageId": "@jskit-ai/users-web",
5304
- "packageVersion": "0.2.85",
5304
+ "packageVersion": "0.2.86",
5305
5305
  "documentPath": "patterns/account-settings/PATTERN.md",
5306
5306
  "examplePath": "patterns/account-settings/example",
5307
5307
  "files": [
@@ -5334,7 +5334,7 @@
5334
5334
  "@jskit-ai/users-core"
5335
5335
  ],
5336
5336
  "packageId": "@jskit-ai/users-core",
5337
- "packageVersion": "0.2.68",
5337
+ "packageVersion": "0.2.69",
5338
5338
  "documentPath": "patterns/user-administration-server/PATTERN.md",
5339
5339
  "examplePath": "patterns/user-administration-server/example",
5340
5340
  "files": [
@@ -5370,7 +5370,7 @@
5370
5370
  "@jskit-ai/workspaces-core"
5371
5371
  ],
5372
5372
  "packageId": "@jskit-ai/workspaces-core",
5373
- "packageVersion": "0.2.68",
5373
+ "packageVersion": "0.2.69",
5374
5374
  "documentPath": "patterns/workspace-server/PATTERN.md",
5375
5375
  "examplePath": "patterns/workspace-server/example",
5376
5376
  "files": [
@@ -5400,7 +5400,7 @@
5400
5400
  "@jskit-ai/workspaces-web"
5401
5401
  ],
5402
5402
  "packageId": "@jskit-ai/workspaces-web",
5403
- "packageVersion": "0.2.85",
5403
+ "packageVersion": "0.2.86",
5404
5404
  "documentPath": "patterns/workspace-surfaces/PATTERN.md",
5405
5405
  "examplePath": "patterns/workspace-surfaces/example",
5406
5406
  "files": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/jskit-catalog",
3
- "version": "0.2.112",
3
+ "version": "0.2.113",
4
4
  "description": "Published metadata catalog for JSKIT package metadata.",
5
5
  "type": "module",
6
6
  "files": [
@@ -5,7 +5,8 @@
5
5
  // database patterns, prepared once for every worker), the test-only `env` and APP_ENV=test, on the host's address in
6
6
  // place of the run's own ports. The host's suite then runs against them as a managed target (PLAYWRIGHT_BASE_URL, and
7
7
  // PLAYWRIGHT_WORKER_TARGETS for several), signed in with the login state its host supplies, so these servers sign
8
- // nothing in. The host and port come from the arguments, else HOST and PORT; workers, from 1 to 64, from the third
8
+ // nothing in; with the port in PLAYWRIGHT_PORT, each of its workers takes its own server's prepared environment, its
9
+ // DB_NAME among them, from the worker environments these servers leave in the app (browserTestConfig()). The host and port come from the arguments, else HOST and PORT; workers, from 1 to 64, from the third
9
10
  // argument, else 1. The servers' output also reaches this command's own; stopping the command stops them.
10
11
  import { existsSync } from "node:fs";
11
12
  import path from "node:path";
@@ -16,7 +16,7 @@
16
16
  // when it stops, so they never pile up in the cache, nor outlive the sessions they hold.
17
17
  import { spawn } from "node:child_process";
18
18
  import { once } from "node:events";
19
- import { createWriteStream, fstatSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
19
+ import { createWriteStream, fstatSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
20
20
  import { createRequire } from "node:module";
21
21
  import net from "node:net";
22
22
  import path from "node:path";
@@ -36,6 +36,10 @@ const DROP_WAIT_MS = 5_000;
36
36
  // drop: the app's prepare module loads the app's own copy of that package, so the launcher reads them here.
37
37
  const PREPARED_COPIES = Symbol.for("@jskit-ai/database-runtime/preparedTestDatabaseCopies");
38
38
 
39
+ // The peak resident memory of the largest app server of a run, beside its worker environments, for the next run's
40
+ // worker count (browserTestWorkers()).
41
+ const SERVER_MEMORY = "server-memory.json";
42
+
39
43
  const seconds = (since) => `${((performance.now() - since) / 1000).toFixed(1)}s`;
40
44
  const words = (command) => String(command).trim().split(/\s+/u).filter(Boolean);
41
45
 
@@ -108,11 +112,54 @@ const servers = [];
108
112
  let stopping = false;
109
113
  // The files this run leaves for its workers, which it removes when it stops.
110
114
  let runFiles = [];
115
+ // Where this run records its servers' peak memory as they stop.
116
+ let serverMemoryFile = "";
111
117
  // The prepare module's work, which a stop waits for (within DROP_WAIT_MS) so the copies it is making are dropped too.
112
118
  let preparing = Promise.resolve();
113
119
  const running = (server) => server.exitCode === null && server.signalCode === null;
114
120
  const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms, false));
121
+ /** The peak resident memory (VmHWM) of process `pid` and each process under it, added up, in bytes (Linux's /proc). */
122
+ function treePeakBytes(pid) {
123
+ const children = new Map();
124
+ for (const entry of readdirSync("/proc").filter((name) => /^\d+$/u.test(name))) {
125
+ let stat;
126
+ try {
127
+ stat = readFileSync(`/proc/${entry}/stat`, "utf8");
128
+ } catch {
129
+ continue; // It ended while the others were read.
130
+ }
131
+ // "pid (name) state ppid ...", where the name may hold spaces and parentheses.
132
+ const parent = Number(stat.slice(stat.lastIndexOf(")") + 2).split(" ")[1]);
133
+ children.set(parent, [...(children.get(parent) ?? []), Number(entry)]);
134
+ }
135
+ let total = 0;
136
+ for (const queue = [pid]; queue.length > 0;) {
137
+ const current = queue.pop();
138
+ try {
139
+ total += Number(readFileSync(`/proc/${current}/status`, "utf8").match(/^VmHWM:\s+(\d+) kB$/mu)?.[1] ?? 0) * 1024;
140
+ } catch {
141
+ // It ended while the others were read.
142
+ }
143
+ queue.push(...(children.get(current) ?? []));
144
+ }
145
+ return total;
146
+ }
147
+ /** Records the peak memory of the largest of the run's app servers as they stop, for the next run's worker count. */
148
+ function recordServerMemory() {
149
+ if (process.platform !== "linux" || !serverMemoryFile) return;
150
+ try {
151
+ const peak = Math.max(0, ...servers.filter(running).map((server) => treePeakBytes(server.pid)));
152
+ if (peak < 1) return;
153
+ // Written whole, then renamed, so a run starting beside this one never reads half of it.
154
+ writeFileSync(`${serverMemoryFile}.${process.pid}`, JSON.stringify({ serverPeakBytes: peak }));
155
+ renameSync(`${serverMemoryFile}.${process.pid}`, serverMemoryFile);
156
+ } catch (error) {
157
+ console.error(`[browser-tests] The servers' peak memory was not recorded (${error.message}); the next run goes by the ` +
158
+ "peak an earlier run recorded, if any.");
159
+ }
160
+ }
115
161
  function stopServers() {
162
+ if (!stopping) recordServerMemory();
116
163
  stopping = true;
117
164
  for (const server of servers) if (running(server)) server.kill("SIGTERM");
118
165
  }
@@ -158,8 +205,11 @@ const started = performance.now();
158
205
  const appRoot = process.cwd();
159
206
  const {
160
207
  workers, host, basePort, server, build, prepare, env, health, workerEnvironments: workerEnvironmentsFile, signIn,
161
- signedInStates, terminal
208
+ signedInStates, terminal, memory
162
209
  } = JSON.parse(process.env[SETTINGS_VARIABLE] || "{}");
210
+ serverMemoryFile = workerEnvironmentsFile ? path.join(path.dirname(workerEnvironmentsFile), SERVER_MEMORY) : "";
211
+ // Fewer workers than the test budget allows, for the memory available: said before anything starts.
212
+ if (memory) console.log(`[browser-tests] ${memory}.`);
163
213
  // The servers, and the databases prepared for them, are APP_ENV=test.
164
214
  useTestAppEnvironment(process.env, "jskit browser tests");
165
215
  const baseEnvironment = { ...process.env };
@@ -1,5 +1,6 @@
1
1
  import { spawnSync } from "node:child_process";
2
- import { readFileSync } from "node:fs";
2
+ import { existsSync, readFileSync } from "node:fs";
3
+ import os from "node:os";
3
4
  import path from "node:path";
4
5
  import process from "node:process";
5
6
  import { fileURLToPath } from "node:url";
@@ -34,6 +35,15 @@ const NAVIGATION_TIMEOUT_MS = 30_000;
34
35
  const SERVERS_TIMEOUT_MS = 180_000;
35
36
  // Where the servers' launcher leaves each worker's server environment, for that worker's own process.
36
37
  const WORKER_ENVIRONMENTS = path.join("node_modules", ".cache", "jskit-browser-tests");
38
+ // The peak resident memory of the largest app server of the last local run, which its launcher records as its servers
39
+ // stop (browser-test-servers.mjs).
40
+ const SERVER_MEMORY = "server-memory.json";
41
+ const GIB = 1024 ** 3;
42
+ // The variables that name a worker's own test database, which its tests may open.
43
+ const DATABASE_VARIABLES = Object.freeze(["DB_NAME", "TEST_DB_NAME", "BROWSER_TEST_DB_NAME"]);
44
+ // The databases a test process may open, and how it reaches one: @jskit-ai/database-runtime's testDatabaseGuard.js
45
+ // reads it, and the app's knexfile settings and runtime refuse any other database.
46
+ const TEST_DATABASE_GUARD = "JSKIT_TEST_DATABASE_GUARD";
37
47
 
38
48
  const positiveInteger = (value) => (/^[1-9]\d*$/u.test(String(value ?? "").trim()) ? Number(String(value).trim()) : 0);
39
49
 
@@ -91,22 +101,76 @@ function commandLineWorkers(argv) {
91
101
  return 0;
92
102
  }
93
103
 
104
+ /** The memory this process may still take: its cgroup's limit where one applies, else the machine's. */
105
+ function systemAvailableMemory() {
106
+ return process.availableMemory?.() || os.freemem();
107
+ }
108
+
94
109
  /**
95
- * How many workers a browser run uses: the command line's `--workers`, else PLAYWRIGHT_WORKERS, else half the machine's
96
- * test budget for a local run and 1 for a managed target (one server). A local worker drives a browser and its own app
97
- * server, about two threads' work: with a budget of 4, the shell foundation's 9 tests took 11.5 s on 4 workers and
98
- * 7.9 s on 2. A managed target whose host lists several app servers (PLAYWRIGHT_WORKER_TARGETS) runs one worker per
99
- * server, and refuses another count: a worker would have no server, or a server no worker.
100
- * @param {{ env?: Record<string, string | undefined>, argv?: ReadonlyArray<string> }} [options]
110
+ * The peak resident memory, in bytes, the largest app server of the last browser run in `cwd` reached, or 0 when none
111
+ * is recorded. Its launcher records it as its servers stop (on Linux), a local run's and `jskit browser-test-server`'s
112
+ * alike, so a host sizing a managed run by its servers' memory reads it here.
113
+ * @param {{ cwd?: string }} [options]
114
+ * @returns {number}
115
+ */
116
+ function browserTestServerPeakBytes({ cwd = process.cwd() } = {}) {
117
+ const file = path.resolve(cwd, WORKER_ENVIRONMENTS, SERVER_MEMORY);
118
+ if (!existsSync(file)) return 0;
119
+ const peak = Number(JSON.parse(readFileSync(file, "utf8")).serverPeakBytes);
120
+ return peak > 0 ? peak : 0;
121
+ }
122
+
123
+ /**
124
+ * The local workers the available memory holds at the peak the last run's largest app server reached, at most
125
+ * `budgeted`, with why when fewer; `budgeted` when no run has recorded its servers' peak yet. Only the app servers are
126
+ * measured, not the browsers or Playwright's own processes, and the reason says so.
101
127
  */
102
- function browserTestWorkers({ env = process.env, argv = process.argv } = {}) {
128
+ function memoryWorkers(budgeted, { cwd, availableMemory }) {
129
+ const peak = browserTestServerPeakBytes({ cwd });
130
+ if (!peak) return { workers: budgeted, memory: "" };
131
+ const available = availableMemory();
132
+ const held = Math.max(1, Math.floor(available / peak));
133
+ if (held >= budgeted) return { workers: budgeted, memory: "" };
134
+ const gib = (bytes) => `${(bytes / GIB).toFixed(1)} GiB`;
135
+ return {
136
+ workers: held,
137
+ memory: `${held} worker${held === 1 ? "" : "s"}, not the ${budgeted} the test budget allows: ${gib(available)} of memory is ` +
138
+ `available, and the largest app server peaked at ${gib(peak)} in the last run (only the app servers are measured, not ` +
139
+ "the browsers or Playwright's own processes)"
140
+ };
141
+ }
142
+
143
+ /** browserTestWorkers()'s count, and for a local run held back by memory, why. */
144
+ function workersOf({ env, argv, cwd, availableMemory }) {
103
145
  const asked = commandLineWorkers(argv) || positiveInteger(env.PLAYWRIGHT_WORKERS);
104
146
  const targets = managedBaseUrl(env) ? managedWorkerTargets(env) : null;
105
147
  if (targets && asked && asked !== targets.length) {
106
148
  throw new Error(`PLAYWRIGHT_WORKER_TARGETS lists ${targets.length} app servers, one per Playwright worker, so this run ` +
107
149
  `cannot use ${asked} workers. Leave the count to the host that serves them.`);
108
150
  }
109
- return targets?.length || asked || (managedBaseUrl(env) ? 1 : Math.max(1, Math.floor(testConcurrency({ env }) / 2)));
151
+ const chosen = targets?.length || asked || (managedBaseUrl(env) ? 1 : 0);
152
+ if (chosen) return { workers: chosen, memory: "" };
153
+ return memoryWorkers(Math.max(1, Math.floor(testConcurrency({ env }) / 2)), { cwd, availableMemory });
154
+ }
155
+
156
+ /**
157
+ * How many workers a browser run uses: the command line's `--workers`, else PLAYWRIGHT_WORKERS, else half the machine's
158
+ * test budget for a local run and 1 for a managed target (one server). A local worker drives a browser and its own app
159
+ * server, about two threads' work: with a budget of 4, the shell foundation's 9 tests took 11.5 s on 4 workers and
160
+ * 7.9 s on 2. A local run takes no more workers than the memory available holds at the peak its largest app server
161
+ * reached in the last run (the launcher records it, on Linux), never fewer than one. A managed target whose host lists
162
+ * several app servers (PLAYWRIGHT_WORKER_TARGETS) runs one worker per server, and refuses another count: a worker would
163
+ * have no server, or a server no worker.
164
+ * @param {{ env?: Record<string, string | undefined>, argv?: ReadonlyArray<string>, cwd?: string,
165
+ * availableMemory?: () => number }} [options]
166
+ */
167
+ function browserTestWorkers({
168
+ env = process.env,
169
+ argv = process.argv,
170
+ cwd = process.cwd(),
171
+ availableMemory = systemAvailableMemory
172
+ } = {}) {
173
+ return workersOf({ env, argv, cwd, availableMemory }).workers;
110
174
  }
111
175
 
112
176
  // Finds `count` consecutive ports nothing listens on, at a random place below Linux's ephemeral range, and prints the
@@ -152,6 +216,32 @@ function preparedWorkerEnvironment(file, index) {
152
216
  }
153
217
  }
154
218
 
219
+ /**
220
+ * A Playwright worker's environment: the one prepare gave its server, from the run's worker environments, and the
221
+ * databases its tests may open, that server's own (TEST_DATABASE_GUARD). A managed run's worker reads it when its host
222
+ * names PLAYWRIGHT_PORT, the port it started `jskit browser-test-server` on; otherwise it may open no database, since
223
+ * its environment's DB_NAME is the host's own, such as a development database.
224
+ */
225
+ function workerEnvironment({ managed, servedPort, workerEnvironments, workerIndex }) {
226
+ const given = "this Playwright worker was given";
227
+ if (managed && !servedPort) {
228
+ const fix = "A managed run's worker reaches its own server's database when the host names PLAYWRIGHT_PORT, the port it " +
229
+ "started `jskit browser-test-server` on, beside PLAYWRIGHT_BASE_URL and PLAYWRIGHT_WORKER_TARGETS.";
230
+ return { [TEST_DATABASE_GUARD]: JSON.stringify({ databases: [], given, fix }) };
231
+ }
232
+ if (managed && !existsSync(workerEnvironments)) {
233
+ throw new Error(`PLAYWRIGHT_PORT names ${servedPort}, the port this managed run's \`jskit browser-test-server\` was started ` +
234
+ `on, but its servers' environments (${workerEnvironments}) are not here: run the suite in the app those servers ` +
235
+ "serve, while they run.");
236
+ }
237
+ const prepared = preparedWorkerEnvironment(workerEnvironments, workerIndex);
238
+ const databases = [...new Set(DATABASE_VARIABLES.map((name) => String(prepared[name] || "").trim()).filter(Boolean))];
239
+ const fix = databases.length > 0
240
+ ? "Open the database through this worker's environment (process.env), which holds its own server's copy."
241
+ : "This run's servers have no database of their own: browserTestConfig()'s prepare module answers each worker's DB_NAME.";
242
+ return { ...prepared, [TEST_DATABASE_GUARD]: JSON.stringify({ databases, given, fix }) };
243
+ }
244
+
155
245
  /**
156
246
  * The Playwright configuration of an application's browser tests.
157
247
  * @param {object} [options]
@@ -162,7 +252,9 @@ function preparedWorkerEnvironment(file, index) {
162
252
  * @param {string} [options.build] The command that builds the production frontend into the folder the server serves.
163
253
  * @param {string} [options.prepare] An app module, run once before the servers start, whose default export
164
254
  * `({ workers, baseUrls })` returns each worker's server environment, such as its own DB_NAME. The worker's own
165
- * process gets it too, so a test that opens the database itself reaches its own server's copy.
255
+ * process gets it too, so a test that opens the database itself reaches its own server's copy, and none other: the
256
+ * app's knexfile settings and runtime refuse any other database there. A managed run's worker gets it when its host
257
+ * names PLAYWRIGHT_PORT, the port it started `jskit browser-test-server` on; without it, it opens no database.
166
258
  * @param {string} [options.signIn] An app module whose default export `({ request, baseURL, workerIndex, env })` signs
167
259
  * `request`, a Playwright APIRequestContext on one worker's server (`env` is that server's environment), in once,
168
260
  * such as with `loginRequestAsExistingUser()` from @jskit-ai/auth-web/test/playwright. Each of that worker's tests
@@ -192,7 +284,8 @@ function browserTestConfig({
192
284
  actionTimeout = ACTION_TIMEOUT_MS,
193
285
  navigationTimeout = NAVIGATION_TIMEOUT_MS,
194
286
  environment = process.env,
195
- cwd = process.cwd()
287
+ cwd = process.cwd(),
288
+ availableMemory = systemAvailableMemory
196
289
  } = {}) {
197
290
  if (globalTimeout !== undefined && (!Number.isInteger(globalTimeout) || globalTimeout < 1)) {
198
291
  throw new Error("browserTestConfig() needs a globalTimeout of at least 1 ms; a run is always bounded.");
@@ -203,13 +296,13 @@ function browserTestConfig({
203
296
  }
204
297
  }
205
298
  const managed = managedBaseUrl(environment);
206
- const workers = browserTestWorkers({ env: environment });
299
+ const { workers, memory } = workersOf({ env: environment, argv: process.argv, cwd, availableMemory });
207
300
  // A host serving the managed target several app servers: this worker's own, and its signed-in state.
208
301
  const workerTargets = managed ? managedWorkerTargets(environment) : null;
209
- const managedIndex = Number.parseInt(String(environment.TEST_PARALLEL_INDEX || "0"), 10) || 0;
210
- const workerTarget = workerTargets ? workerTargets[managedIndex] : null;
302
+ const workerIndex = Number.parseInt(String(environment.TEST_PARALLEL_INDEX || "0"), 10) || 0;
303
+ const workerTarget = workerTargets ? workerTargets[workerIndex] : null;
211
304
  if (workerTargets && !workerTarget) {
212
- throw new Error(`PLAYWRIGHT_WORKER_TARGETS has no app server for Playwright worker ${managedIndex}.`);
305
+ throw new Error(`PLAYWRIGHT_WORKER_TARGETS has no app server for Playwright worker ${workerIndex}.`);
213
306
  }
214
307
  const runTimeout = globalTimeout ?? Math.max(MIN_GLOBAL_TIMEOUT_MS, Math.ceil(WORKER_MINUTES_MS / workers));
215
308
  let basePort = positiveInteger(environment.PLAYWRIGHT_PORT) || port;
@@ -222,9 +315,11 @@ function browserTestConfig({
222
315
  environment.PLAYWRIGHT_PORT = String(basePort);
223
316
  }
224
317
  // A Playwright worker loads this config again, with its own TEST_PARALLEL_INDEX, and reaches its own server; its
225
- // process takes the environment prepare gave that server, such as its DB_NAME, before any test file loads.
226
- const workerIndex = managed ? 0 : Number.parseInt(String(environment.TEST_PARALLEL_INDEX || "0"), 10) || 0;
227
- const workerEnvironments = path.resolve(cwd, WORKER_ENVIRONMENTS, `workers-${basePort}.json`);
318
+ // process takes the environment prepare gave that server, such as its DB_NAME, before any test file loads. A managed
319
+ // run's servers are `jskit browser-test-server`'s, worker i's on the port its host started it on plus i, which the
320
+ // host names in PLAYWRIGHT_PORT: the targets' URLs may reach them through other ports.
321
+ const servedPort = managed ? positiveInteger(environment.PLAYWRIGHT_PORT) : basePort;
322
+ const workerEnvironments = path.resolve(cwd, WORKER_ENVIRONMENTS, `workers-${servedPort || basePort}.json`);
228
323
  // A login state the host supplies is used as it is; the servers sign in only when there is none. A worker of a
229
324
  // project that depends on another (a setup project) inherits the environment that project's workers changed,
230
325
  // including the state this harness gave them, so one of this harness's own states is never taken for the host's.
@@ -232,14 +327,15 @@ function browserTestConfig({
232
327
  const suppliedState = String(environment.PLAYWRIGHT_STORAGE_STATE || "").trim();
233
328
  const hostState = suppliedState.startsWith(`${ownStates}-`) ? "" : suppliedState;
234
329
  const signedInStates = signIn && !managed && !hostState ? ownStates : "";
235
- if (!managed && environment.TEST_PARALLEL_INDEX !== undefined) {
236
- Object.assign(environment, preparedWorkerEnvironment(workerEnvironments, workerIndex));
330
+ if (environment.TEST_PARALLEL_INDEX !== undefined) {
331
+ Object.assign(environment, workerEnvironment({ managed, servedPort, workerEnvironments, workerIndex }));
237
332
  if (signedInStates) environment.PLAYWRIGHT_STORAGE_STATE = `${signedInStates}-${workerIndex}.json`;
238
333
  }
239
334
  const storageState = workerTarget ? workerTarget.storageState : String(environment.PLAYWRIGHT_STORAGE_STATE || "").trim();
240
335
  const settings = {
241
336
  workers, host: HOST, basePort, server, build, prepare, env, health, workerEnvironments,
242
- ...(signedInStates ? { signIn, signedInStates } : {})
337
+ ...(signedInStates ? { signIn, signedInStates } : {}),
338
+ ...(memory ? { memory } : {})
243
339
  };
244
340
 
245
341
  return {
@@ -273,4 +369,4 @@ function browserTestConfig({
273
369
  };
274
370
  }
275
371
 
276
- export { SETTINGS_VARIABLE, browserTestConfig, browserTestWorkers };
372
+ export { SETTINGS_VARIABLE, browserTestConfig, browserTestServerPeakBytes, browserTestWorkers };
package/scripts/jskit.mjs CHANGED
@@ -106,7 +106,8 @@ function usage() {
106
106
  " playwright.config.mjs browserTestConfig(), worker i on port+i, on the production build, each with",
107
107
  " the database its prepare module gives that worker, its test-only env and APP_ENV=test. The",
108
108
  " host's suite runs against them with PLAYWRIGHT_BASE_URL (and PLAYWRIGHT_WORKER_TARGETS for",
109
- " several) and the login state the host supplies. It runs until it is stopped.",
109
+ " several), [port] in PLAYWRIGHT_PORT, so each worker opens only its own server's database, and",
110
+ " the login state the host supplies. It runs until it is stopped.",
110
111
  "",
111
112
  "<locale> is a BCP 47 language tag, such as fr or pt-BR."
112
113
  ].join("\n");