@wenathlan/getry 2.0.166 → 2.0.168

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 (41) hide show
  1. package/README.md +1 -1
  2. package/cli.ts +15 -6
  3. package/db.ts +33 -29
  4. package/docs/features.md +1 -2
  5. package/docs/gateway.md +2 -3
  6. package/gatewaycheck.ts +142 -0
  7. package/package.json +81 -89
  8. package/server.ts +9 -5
  9. package/{tests → test}/cli.test.ts +1 -1
  10. package/{tests → test}/design.test.ts +3 -3
  11. package/test/familyseats.test.ts +220 -0
  12. package/{tests → test}/gateway.test.ts +2 -2
  13. package/{tests → test}/gatewayversions.test.ts +1 -1
  14. package/{tests → test}/intelligence.test.ts +1 -1
  15. package/{tests → test}/keyrotation.test.ts +1 -1
  16. package/{tests → test}/onboardingstate.test.ts +1 -1
  17. package/{tests → test}/providerfixtures.ts +12 -12
  18. package/{tests → test}/researchfixtures.ts +1 -1
  19. package/{tests → test}/sandboxmodality.test.ts +1 -1
  20. package/gatewayprobe.ts +0 -61
  21. package/gatewaysmoke.ts +0 -64
  22. /package/{tests → test}/debonairlane.test.ts +0 -0
  23. /package/{tests → test}/family.test.ts +0 -0
  24. /package/{tests → test}/gatewayserver.ts +0 -0
  25. /package/{tests → test}/jsonpolicy.test.ts +0 -0
  26. /package/{tests → test}/llm.test.ts +0 -0
  27. /package/{tests → test}/modelroute.test.ts +0 -0
  28. /package/{tests → test}/promptlibrary.test.ts +0 -0
  29. /package/{tests → test}/providercli.test.ts +0 -0
  30. /package/{tests → test}/providerconstants.test.ts +0 -0
  31. /package/{tests → test}/providerfingerprint.test.ts +0 -0
  32. /package/{tests → test}/providermodels.test.ts +0 -0
  33. /package/{tests → test}/provideroauth.test.ts +0 -0
  34. /package/{tests → test}/routerotation.test.ts +0 -0
  35. /package/{tests → test}/serverauth.test.ts +0 -0
  36. /package/{tests → test}/serverengine.test.ts +0 -0
  37. /package/{tests → test}/serverproperty.test.ts +0 -0
  38. /package/{tests → test}/serverutils.test.ts +0 -0
  39. /package/{tests → test}/streamfallback.test.ts +0 -0
  40. /package/{tests → test}/thinkingladder.test.ts +0 -0
  41. /package/{tests → test}/torturellm.test.ts +0 -0
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@wenathlan/getry",
3
- "version": "2.0.166",
3
+ "version": "2.0.168",
4
4
  "private": false,
5
5
  "description": "getry is the AI gateway of the wenathlan family: five provider gateways (v1 zai, v2 babel, v3 nvidia, v4 opencode+kilo, v5 openrouter) serving 35 OpenAI-compatible routes with the 7-level thinking system, the session store and the key rotation, described by schema.prisma and served as one static Sol surface. The envelope distributes the documentation set and the tests directory as one package.",
6
+ "license": "GPL-3.0-only",
6
7
  "scripts": {
7
8
  "db:generate": "prisma generate --schema schema.prisma",
8
9
  "dev": "vite --host",
@@ -15,11 +16,11 @@
15
16
  "restore:entry": "node -e \"const{readFileSync}=require('node:fs');const{execSync}=require('node:child_process');const script=/script[^>]*App\\.tsx/;const triad=/family=Bricolage\\+Grotesque[\\s\\S]*Outfit[\\s\\S]*JetBrains\\+Mono/;const face=(h)=>script.test(h)&&triad.test(h);if(face(readFileSync('index.html','utf8'))){console.log('index.html already rides the source face');process.exit(0)}if(!face(execSync('git show HEAD:./index.html',{encoding:'utf8'}))){console.error('refusing: HEAD index.html is not the canonical source face yet (script App.tsx + the font triad) - land the source-face fix first; nothing was touched');process.exit(1)}execSync('git checkout -- index.html',{stdio:'inherit'});console.log('index.html restored from HEAD (the source face)')\""
16
17
  },
17
18
  "dependencies": {
18
- "@ai-sdk/openai": "^4.0.109",
19
- "@ai-sdk/openai-compatible": "^3.0.85",
20
- "@ai-sdk/provider-utils": "^5.0.75",
19
+ "@ai-sdk/openai": "^4.0.111",
20
+ "@ai-sdk/openai-compatible": "^3.0.87",
21
+ "@ai-sdk/provider-utils": "^5.0.76",
21
22
  "@anthropic-ai/sdk": "^1.6.0",
22
- "@biomejs/biome": "^2.6.5",
23
+ "@biomejs/biome": "^2.6.6",
23
24
  "@capacitor/android": "^8.6.0",
24
25
  "@capacitor/cli": "^8.6.0",
25
26
  "@capacitor/core": "^8.6.0",
@@ -71,31 +72,31 @@
71
72
  "@radix-ui/react-toggle-group": "^1.2.1",
72
73
  "@radix-ui/react-tooltip": "^1.4.1",
73
74
  "@reactuses/core": "^6.6.1",
74
- "@tailwindcss/postcss": "^4.3.4",
75
+ "@tailwindcss/postcss": "^4.3.5",
75
76
  "@tailwindcss/typography": "^0.5.20",
76
- "@tailwindcss/vite": "^4.3.4",
77
- "@tanstack/react-query": "^5.106.1",
77
+ "@tailwindcss/vite": "^4.3.5",
78
+ "@tanstack/react-query": "^5.107.1",
78
79
  "@tanstack/react-table": "^9.3.1",
79
80
  "@tsconfig/node26": "^26.0.1",
80
81
  "@types/babel__core": "^7.20.5",
81
82
  "@types/better-sqlite3": "^9.6.0",
82
83
  "@types/chrome": "^0.3.7",
83
84
  "@types/express": "^5.0.6",
84
- "@types/google.maps": "^3.66.9",
85
+ "@types/google.maps": "^3.66.10",
85
86
  "@types/node": "^26.6.6",
86
87
  "@types/react": "^19.3.0",
87
88
  "@types/react-dom": "^19.3.0",
88
89
  "@types/three": "^0.187.0",
89
90
  "@vitejs/plugin-react": "^6.2.1",
90
- "@wenathlan/argan": "~2.0.165",
91
- "@wenathlan/cadria": "~2.0.165",
92
- "@wenathlan/debonair": "~2.0.165",
93
- "@wenathlan/devthink": "~2.0.165",
94
- "@wenathlan/getry": "~2.0.165",
95
- "@wenathlan/saddle": "~2.0.165",
96
- "@wenathlan/vault": "~2.0.165",
91
+ "@wenathlan/argan": "~2.0.167",
92
+ "@wenathlan/cadria": "~2.0.167",
93
+ "@wenathlan/debonair": "~2.0.167",
94
+ "@wenathlan/devthink": "~2.0.167",
95
+ "@wenathlan/getry": "~2.0.167",
96
+ "@wenathlan/saddle": "~2.0.167",
97
+ "@wenathlan/vault": "~2.0.167",
97
98
  "add": "^2.0.9",
98
- "ai": "^7.0.163",
99
+ "ai": "^7.0.165",
99
100
  "autoprefixer": "^10.6.2",
100
101
  "axios": "^1.21.0",
101
102
  "baseline-browser-mapping": "^2.11.35",
@@ -106,7 +107,7 @@
106
107
  "class-variance-authority": "^0.7.1",
107
108
  "clsx": "^2.1.1",
108
109
  "cmdk": "^1.1.1",
109
- "commander": "^15.0.0",
110
+ "commander": "^15.1.0",
110
111
  "date-fns": "^4.4.0",
111
112
  "deepmerge-ts": "^8.0.2",
112
113
  "dockerode": "^5.0.1",
@@ -121,25 +122,24 @@
121
122
  "fast-check": "^4.10.2",
122
123
  "fast-uri": "^4.2.3",
123
124
  "follow-redirects": "^1.16.2",
124
- "framer-motion": "^14.9.1",
125
+ "framer-motion": "^14.10.1",
125
126
  "glob": "^14.0.4",
126
127
  "gsap": "^3.15.1",
127
- "hono": "^4.13.16",
128
+ "hono": "^4.13.17",
128
129
  "ink": "^8.0.0",
129
130
  "input-otp": "^1.5.0",
130
131
  "js-yaml": "^5.5.0",
131
132
  "jsdom": "^31.0.0",
132
133
  "katex": "^0.19.1",
133
- "lucide-react": "^1.69.0",
134
134
  "minimatch": "^11.0.5",
135
- "motion": "^14.9.1",
135
+ "motion": "^14.10.1",
136
136
  "mysql2": "^3.24.6",
137
137
  "nanoid": "^6.0.2",
138
138
  "next": "^16.4.5",
139
139
  "next-auth": "^4.24.15",
140
140
  "next-intl": "^4.14.9",
141
141
  "next-themes": "^0.4.6",
142
- "openai": "^7.52.0",
142
+ "openai": "^7.53.0",
143
143
  "p-limit": "^7.3.3",
144
144
  "p-retry": "^9.0.0",
145
145
  "playwright": "^1.65.0",
@@ -155,7 +155,7 @@
155
155
  "react-dom": "^19.3.1",
156
156
  "react-hook-form": "^7.91.0",
157
157
  "react-markdown": "^10.1.0",
158
- "react-resizable-panels": "^4.18.1",
158
+ "react-resizable-panels": "^4.19.1",
159
159
  "react-syntax-highlighter": "^16.1.2",
160
160
  "recharts": "^3.10.1",
161
161
  "request-ip": "^3.3.0",
@@ -166,7 +166,7 @@
166
166
  "source-map-js": "^1.2.2",
167
167
  "streamdown": "^2.7.1",
168
168
  "tailwind-merge": "^3.7.0",
169
- "tailwindcss": "^4.3.4",
169
+ "tailwindcss": "^4.3.5",
170
170
  "tailwindcss-animate": "^1.0.7",
171
171
  "three": "^0.187.0",
172
172
  "ts-node": "^10.9.2",
@@ -186,14 +186,14 @@
186
186
  "yaml": "^2.9.1",
187
187
  "z-ai-web-dev-sdk": "^0.0.18",
188
188
  "zod": "^4.6.7",
189
- "zustand": "^5.0.15"
189
+ "zustand": "^5.1.0"
190
190
  },
191
191
  "devDependencies": {
192
- "@ai-sdk/openai": "^4.0.109",
193
- "@ai-sdk/openai-compatible": "^3.0.85",
194
- "@ai-sdk/provider-utils": "^5.0.75",
192
+ "@ai-sdk/openai": "^4.0.111",
193
+ "@ai-sdk/openai-compatible": "^3.0.87",
194
+ "@ai-sdk/provider-utils": "^5.0.76",
195
195
  "@anthropic-ai/sdk": "^1.6.0",
196
- "@biomejs/biome": "^2.6.5",
196
+ "@biomejs/biome": "^2.6.6",
197
197
  "@capacitor/android": "^8.6.0",
198
198
  "@capacitor/cli": "^8.6.0",
199
199
  "@capacitor/core": "^8.6.0",
@@ -245,31 +245,31 @@
245
245
  "@radix-ui/react-toggle-group": "^1.2.1",
246
246
  "@radix-ui/react-tooltip": "^1.4.1",
247
247
  "@reactuses/core": "^6.6.1",
248
- "@tailwindcss/postcss": "^4.3.4",
248
+ "@tailwindcss/postcss": "^4.3.5",
249
249
  "@tailwindcss/typography": "^0.5.20",
250
- "@tailwindcss/vite": "^4.3.4",
251
- "@tanstack/react-query": "^5.106.1",
250
+ "@tailwindcss/vite": "^4.3.5",
251
+ "@tanstack/react-query": "^5.107.1",
252
252
  "@tanstack/react-table": "^9.3.1",
253
253
  "@tsconfig/node26": "^26.0.1",
254
254
  "@types/babel__core": "^7.20.5",
255
255
  "@types/better-sqlite3": "^9.6.0",
256
256
  "@types/chrome": "^0.3.7",
257
257
  "@types/express": "^5.0.6",
258
- "@types/google.maps": "^3.66.9",
258
+ "@types/google.maps": "^3.66.10",
259
259
  "@types/node": "^26.6.6",
260
260
  "@types/react": "^19.3.0",
261
261
  "@types/react-dom": "^19.3.0",
262
262
  "@types/three": "^0.187.0",
263
263
  "@vitejs/plugin-react": "^6.2.1",
264
- "@wenathlan/argan": "~2.0.165",
265
- "@wenathlan/cadria": "~2.0.165",
266
- "@wenathlan/debonair": "~2.0.165",
267
- "@wenathlan/devthink": "~2.0.165",
268
- "@wenathlan/getry": "~2.0.165",
269
- "@wenathlan/saddle": "~2.0.165",
270
- "@wenathlan/vault": "~2.0.165",
264
+ "@wenathlan/argan": "~2.0.167",
265
+ "@wenathlan/cadria": "~2.0.167",
266
+ "@wenathlan/debonair": "~2.0.167",
267
+ "@wenathlan/devthink": "~2.0.167",
268
+ "@wenathlan/getry": "~2.0.167",
269
+ "@wenathlan/saddle": "~2.0.167",
270
+ "@wenathlan/vault": "~2.0.167",
271
271
  "add": "^2.0.9",
272
- "ai": "^7.0.163",
272
+ "ai": "^7.0.165",
273
273
  "autoprefixer": "^10.6.2",
274
274
  "axios": "^1.21.0",
275
275
  "baseline-browser-mapping": "^2.11.35",
@@ -280,7 +280,7 @@
280
280
  "class-variance-authority": "^0.7.1",
281
281
  "clsx": "^2.1.1",
282
282
  "cmdk": "^1.1.1",
283
- "commander": "^15.0.0",
283
+ "commander": "^15.1.0",
284
284
  "date-fns": "^4.4.0",
285
285
  "deepmerge-ts": "^8.0.2",
286
286
  "dockerode": "^5.0.1",
@@ -295,25 +295,24 @@
295
295
  "fast-check": "^4.10.2",
296
296
  "fast-uri": "^4.2.3",
297
297
  "follow-redirects": "^1.16.2",
298
- "framer-motion": "^14.9.1",
298
+ "framer-motion": "^14.10.1",
299
299
  "glob": "^14.0.4",
300
300
  "gsap": "^3.15.1",
301
- "hono": "^4.13.16",
301
+ "hono": "^4.13.17",
302
302
  "ink": "^8.0.0",
303
303
  "input-otp": "^1.5.0",
304
304
  "js-yaml": "^5.5.0",
305
305
  "jsdom": "^31.0.0",
306
306
  "katex": "^0.19.1",
307
- "lucide-react": "^1.69.0",
308
307
  "minimatch": "^11.0.5",
309
- "motion": "^14.9.1",
308
+ "motion": "^14.10.1",
310
309
  "mysql2": "^3.24.6",
311
310
  "nanoid": "^6.0.2",
312
311
  "next": "^16.4.5",
313
312
  "next-auth": "^4.24.15",
314
313
  "next-intl": "^4.14.9",
315
314
  "next-themes": "^0.4.6",
316
- "openai": "^7.52.0",
315
+ "openai": "^7.53.0",
317
316
  "p-limit": "^7.3.3",
318
317
  "p-retry": "^9.0.0",
319
318
  "playwright": "^1.65.0",
@@ -329,7 +328,7 @@
329
328
  "react-dom": "^19.3.1",
330
329
  "react-hook-form": "^7.91.0",
331
330
  "react-markdown": "^10.1.0",
332
- "react-resizable-panels": "^4.18.1",
331
+ "react-resizable-panels": "^4.19.1",
333
332
  "react-syntax-highlighter": "^16.1.2",
334
333
  "recharts": "^3.10.1",
335
334
  "request-ip": "^3.3.0",
@@ -340,7 +339,7 @@
340
339
  "source-map-js": "^1.2.2",
341
340
  "streamdown": "^2.7.1",
342
341
  "tailwind-merge": "^3.7.0",
343
- "tailwindcss": "^4.3.4",
342
+ "tailwindcss": "^4.3.5",
344
343
  "tailwindcss-animate": "^1.0.7",
345
344
  "three": "^0.187.0",
346
345
  "ts-node": "^10.9.2",
@@ -360,14 +359,14 @@
360
359
  "yaml": "^2.9.1",
361
360
  "z-ai-web-dev-sdk": "^0.0.18",
362
361
  "zod": "^4.6.7",
363
- "zustand": "^5.0.15"
362
+ "zustand": "^5.1.0"
364
363
  },
365
364
  "overrides": {
366
- "@ai-sdk/openai": "^4.0.109",
367
- "@ai-sdk/openai-compatible": "^3.0.85",
368
- "@ai-sdk/provider-utils": "^5.0.75",
365
+ "@ai-sdk/openai": "^4.0.111",
366
+ "@ai-sdk/openai-compatible": "^3.0.87",
367
+ "@ai-sdk/provider-utils": "^5.0.76",
369
368
  "@anthropic-ai/sdk": "^1.6.0",
370
- "@biomejs/biome": "^2.6.5",
369
+ "@biomejs/biome": "^2.6.6",
371
370
  "@capacitor/android": "^8.6.0",
372
371
  "@capacitor/cli": "^8.6.0",
373
372
  "@capacitor/core": "^8.6.0",
@@ -419,31 +418,31 @@
419
418
  "@radix-ui/react-toggle-group": "^1.2.1",
420
419
  "@radix-ui/react-tooltip": "^1.4.1",
421
420
  "@reactuses/core": "^6.6.1",
422
- "@tailwindcss/postcss": "^4.3.4",
421
+ "@tailwindcss/postcss": "^4.3.5",
423
422
  "@tailwindcss/typography": "^0.5.20",
424
- "@tailwindcss/vite": "^4.3.4",
425
- "@tanstack/react-query": "^5.106.1",
423
+ "@tailwindcss/vite": "^4.3.5",
424
+ "@tanstack/react-query": "^5.107.1",
426
425
  "@tanstack/react-table": "^9.3.1",
427
426
  "@tsconfig/node26": "^26.0.1",
428
427
  "@types/babel__core": "^7.20.5",
429
428
  "@types/better-sqlite3": "^9.6.0",
430
429
  "@types/chrome": "^0.3.7",
431
430
  "@types/express": "^5.0.6",
432
- "@types/google.maps": "^3.66.9",
431
+ "@types/google.maps": "^3.66.10",
433
432
  "@types/node": "^26.6.6",
434
433
  "@types/react": "^19.3.0",
435
434
  "@types/react-dom": "^19.3.0",
436
435
  "@types/three": "^0.187.0",
437
436
  "@vitejs/plugin-react": "^6.2.1",
438
- "@wenathlan/argan": "~2.0.165",
439
- "@wenathlan/cadria": "~2.0.165",
440
- "@wenathlan/debonair": "~2.0.165",
441
- "@wenathlan/devthink": "~2.0.165",
442
- "@wenathlan/getry": "~2.0.165",
443
- "@wenathlan/saddle": "~2.0.165",
444
- "@wenathlan/vault": "~2.0.165",
437
+ "@wenathlan/argan": "~2.0.167",
438
+ "@wenathlan/cadria": "~2.0.167",
439
+ "@wenathlan/debonair": "~2.0.167",
440
+ "@wenathlan/devthink": "~2.0.167",
441
+ "@wenathlan/getry": "~2.0.167",
442
+ "@wenathlan/saddle": "~2.0.167",
443
+ "@wenathlan/vault": "~2.0.167",
445
444
  "add": "^2.0.9",
446
- "ai": "^7.0.163",
445
+ "ai": "^7.0.165",
447
446
  "autoprefixer": "^10.6.2",
448
447
  "axios": "^1.21.0",
449
448
  "baseline-browser-mapping": "^2.11.35",
@@ -454,7 +453,7 @@
454
453
  "class-variance-authority": "^0.7.1",
455
454
  "clsx": "^2.1.1",
456
455
  "cmdk": "^1.1.1",
457
- "commander": "^15.0.0",
456
+ "commander": "^15.1.0",
458
457
  "date-fns": "^4.4.0",
459
458
  "deepmerge-ts": "^8.0.2",
460
459
  "dockerode": "^5.0.1",
@@ -469,25 +468,24 @@
469
468
  "fast-check": "^4.10.2",
470
469
  "fast-uri": "^4.2.3",
471
470
  "follow-redirects": "^1.16.2",
472
- "framer-motion": "^14.9.1",
471
+ "framer-motion": "^14.10.1",
473
472
  "glob": "^14.0.4",
474
473
  "gsap": "^3.15.1",
475
- "hono": "^4.13.16",
474
+ "hono": "^4.13.17",
476
475
  "ink": "^8.0.0",
477
476
  "input-otp": "^1.5.0",
478
477
  "js-yaml": "^5.5.0",
479
478
  "jsdom": "^31.0.0",
480
479
  "katex": "^0.19.1",
481
- "lucide-react": "^1.69.0",
482
480
  "minimatch": "^11.0.5",
483
- "motion": "^14.9.1",
481
+ "motion": "^14.10.1",
484
482
  "mysql2": "^3.24.6",
485
483
  "nanoid": "^6.0.2",
486
484
  "next": "^16.4.5",
487
485
  "next-auth": "^4.24.15",
488
486
  "next-intl": "^4.14.9",
489
487
  "next-themes": "^0.4.6",
490
- "openai": "^7.52.0",
488
+ "openai": "^7.53.0",
491
489
  "p-limit": "^7.3.3",
492
490
  "p-retry": "^9.0.0",
493
491
  "playwright": "^1.65.0",
@@ -503,7 +501,7 @@
503
501
  "react-dom": "^19.3.1",
504
502
  "react-hook-form": "^7.91.0",
505
503
  "react-markdown": "^10.1.0",
506
- "react-resizable-panels": "^4.18.1",
504
+ "react-resizable-panels": "^4.19.1",
507
505
  "react-syntax-highlighter": "^16.1.2",
508
506
  "recharts": "^3.10.1",
509
507
  "request-ip": "^3.3.0",
@@ -514,7 +512,7 @@
514
512
  "source-map-js": "^1.2.2",
515
513
  "streamdown": "^2.7.1",
516
514
  "tailwind-merge": "^3.7.0",
517
- "tailwindcss": "^4.3.4",
515
+ "tailwindcss": "^4.3.5",
518
516
  "tailwindcss-animate": "^1.0.7",
519
517
  "three": "^0.187.0",
520
518
  "ts-node": "^10.9.2",
@@ -534,7 +532,7 @@
534
532
  "yaml": "^2.9.1",
535
533
  "z-ai-web-dev-sdk": "^0.0.18",
536
534
  "zod": "^4.6.7",
537
- "zustand": "^5.0.15",
535
+ "zustand": "^5.1.0",
538
536
  "xcode": {
539
537
  "uuid": "11.1.1"
540
538
  }
@@ -689,15 +687,10 @@
689
687
  "import": "./gateway.ts",
690
688
  "default": "./gateway.ts"
691
689
  },
692
- "./gatewayprobe": {
693
- "types": "./gatewayprobe.ts",
694
- "import": "./gatewayprobe.ts",
695
- "default": "./gatewayprobe.ts"
696
- },
697
- "./gatewaysmoke": {
698
- "types": "./gatewaysmoke.ts",
699
- "import": "./gatewaysmoke.ts",
700
- "default": "./gatewaysmoke.ts"
690
+ "./gatewaycheck": {
691
+ "types": "./gatewaycheck.ts",
692
+ "import": "./gatewaycheck.ts",
693
+ "default": "./gatewaycheck.ts"
701
694
  },
702
695
  "./nodeshim": {
703
696
  "types": "./nodeshim.ts",
@@ -718,7 +711,7 @@
718
711
  "files": [
719
712
  "README.md",
720
713
  "docs",
721
- "tests",
714
+ "test",
722
715
  "accounts.ts",
723
716
  "antigravity.ts",
724
717
  "auth.ts",
@@ -728,8 +721,7 @@
728
721
  "engine.ts",
729
722
  "fingerprint.ts",
730
723
  "gateway.ts",
731
- "gatewayprobe.ts",
732
- "gatewaysmoke.ts",
724
+ "gatewaycheck.ts",
733
725
  "intelligence.ts",
734
726
  "json.ts",
735
727
  "labels.ts",
@@ -745,7 +737,7 @@
745
737
  "search.ts",
746
738
  "server.ts",
747
739
  "streaming.ts",
748
- "tests/gatewayserver.ts",
740
+ "test/gatewayserver.ts",
749
741
  "thinking.ts",
750
742
  "types.ts",
751
743
  "utils.ts",
package/server.ts CHANGED
@@ -61,6 +61,7 @@ import { createversion } from "@wenathlan/getry/engine";
61
61
  import type { gatewayconfig, gatewaydefinition } from "@wenathlan/getry/types";
62
62
  import { corsheaders, ctndjson, ctsse, safejsonparse, safestringify } from "@wenathlan/getry/utils";
63
63
  import { GATEWAYROUTES } from "./gateway.js";
64
+ import { resolvegatewaybind } from "./binddraw.js";
64
65
 
65
66
  // ---------------------------------------------------------------------------
66
67
  // sse transport — the stream pipeline of the gateway http transport
@@ -620,8 +621,12 @@ function consoleroots(): string[] {
620
621
  return roots;
621
622
  }
622
623
 
623
- /** main — bootstrap the server on the configured port
624
- * host and port honor env — never hardcoded per open infrastructure rules */
624
+ /** main — bootstrap the server on the drawn bind
625
+ * the gateway ports law (host/porta sorteados, never localhost literal):
626
+ * the env pin rides when the env carries one, otherwise the host and the
627
+ * port draw — the port inside the documented cryptographic band
628
+ * 30000..59999, the host inside the loopback band with drawn octets —
629
+ * never a literal fallback (the drawn bind grammar rides binddraw.ts) */
625
630
  async function main(): Promise<void> {
626
631
  const app = await createserver();
627
632
  const definition = await loadconfig();
@@ -635,9 +640,8 @@ async function main(): Promise<void> {
635
640
  console.error("[server] unhandled rejection:", reason);
636
641
  });
637
642
 
638
- const port = Number(process.env.PORT) || 3001;
639
- const hostname = process.env.HOST || "0.0.0.0";
640
- serve({ fetch: app.fetch, port, hostname }, (info: { address: string; port: number }) => {
643
+ const bind = resolvegatewaybind(process.env.PORT, process.env.HOST);
644
+ serve({ fetch: app.fetch, port: bind.port, hostname: bind.hostname }, (info: { address: string; port: number }) => {
641
645
  console.log(`[server] gateway listening on http://${info.address}:${info.port}`);
642
646
  console.log(`[server] config loaded — ${versioncount} versions`);
643
647
  });
@@ -289,7 +289,7 @@ describe("cli init with db keys", () => {
289
289
  );
290
290
  expect(keyscode).toBe(0);
291
291
  expect(stdout).toContain("register keys");
292
- const seed = join(dbworkdir, "tests", "seedkeys.mjs");
292
+ const seed = join(dbworkdir, "test", "seedkeys.mjs");
293
293
  expect(existsSync(seed)).toBe(true);
294
294
  const content = readFileSync(seed, "utf8");
295
295
  expect(content).toContain("key-aaaaaaaaaa");
@@ -197,9 +197,9 @@ describe("flow contract — intro → onboarding → the platform", () => {
197
197
 
198
198
  it("gates the home anchor on the seen state before anything shows", () => {
199
199
  /* the widget surface law: the dotted widget name is written exactly
200
- once (inside sol/wingets/index.ts) and the page answers the surface
201
- import with its canonical alias — never the dotted path again */
202
- expect(HOME).toMatch(/import \{ HomeEntrygate as EntryGate \} from "\.\.\/wingets"/);
200
+ once (inside wingets.ts at the app root) and the page answers the
201
+ surface import with its canonical alias — never the dotted path again */
202
+ expect(HOME).toMatch(/import \{ HomeEntrygate as EntryGate \} from "\.\.\/\.\.\/wingets"/);
203
203
  expect(GATE).toContain('navigate("/intro", { replace: true })');
204
204
  expect(GATE).toContain('navigate("/onboarding", { replace: true })');
205
205
  expect(GATE).toContain("flowthrough");