@wenathlan/getry 2.0.165 → 2.0.166
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accounts.ts +2087 -0
- package/antigravity.ts +2171 -0
- package/auth.ts +265 -0
- package/constants.ts +950 -0
- package/db.ts +810 -0
- package/docs/distributionlanes.md +1 -1
- package/docs/getry.md +33 -0
- package/engine.ts +1535 -0
- package/fingerprint.ts +1461 -0
- package/gateway.ts +1306 -0
- package/gatewayprobe.ts +61 -0
- package/gatewaysmoke.ts +64 -0
- package/intelligence.ts +169 -0
- package/json.ts +932 -0
- package/labels.ts +262 -0
- package/llm.ts +2709 -0
- package/models.ts +4017 -0
- package/nodeshim.ts +265 -0
- package/oauth.ts +2201 -0
- package/package.json +575 -215
- package/project.ts +1293 -0
- package/providers.ts +3238 -0
- package/quota.ts +1891 -0
- package/recovery.ts +2434 -0
- package/request.ts +4496 -0
- package/search.ts +1761 -0
- package/server.ts +766 -0
- package/streaming.ts +4398 -0
- package/thinking.ts +416 -0
- package/types.ts +809 -0
- package/utils.ts +263 -0
- package/validate.ts +61 -0
- package/versionregistry.ts +1325 -0
package/labels.ts
ADDED
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* labels.ts — the copy law of getry: every interface string lives in the
|
|
3
|
+
* label store, the wingets and page anchors read through this typed accessor,
|
|
4
|
+
* and a hardcoded string inside a widget is a defect. the manifest below is
|
|
5
|
+
* the english source of truth extracted from the real strings of the Sol
|
|
6
|
+
* wingets and the page anchors; the seed ingests it into the labels store
|
|
7
|
+
* (the site db through db.ts on the gateway runtime, the browser rows cache
|
|
8
|
+
* in the visitor machine) and the seed never overwrites a translated row.
|
|
9
|
+
*
|
|
10
|
+
* the browser imports db.ts through the erased type door only (the sqlite
|
|
11
|
+
* mirror of db.ts rides a process guard): the seed here mirrors the rows
|
|
12
|
+
* into the local cache the way onboardingstate.ts mirrors the seen flags.
|
|
13
|
+
*
|
|
14
|
+
* data stays data: replica tags, provider names, routes, badges, budgets,
|
|
15
|
+
* session ids, key masks, token counts and the curl protocol block of the
|
|
16
|
+
* quick start keep flowing from the engine tables (gateway.ts, thinking.ts,
|
|
17
|
+
* sessions.ts, db.ts) and the code tokens stay literal; the prose and the
|
|
18
|
+
* affordances around them ride here.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { createLabelStore } from "@wenathlan/vault/labelstore";
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
/** the label revision of the manifest: bump on every copy wave so the seed
|
|
25
|
+
* refreshes the store rows of the changed strings. */
|
|
26
|
+
export const LABEL_REVISION = 2;
|
|
27
|
+
|
|
28
|
+
/** the english manifest: the page.widget.key path answers the surface text.
|
|
29
|
+
* every entry is the verbatim string the wingets and page anchors rendered
|
|
30
|
+
* before the copy wave — zero invented copy. */
|
|
31
|
+
export const LABEL_MANIFEST = {
|
|
32
|
+
// the app boundary (App.tsx, the boot anchor)
|
|
33
|
+
"app.boundary.body": "getry could not render this frame.",
|
|
34
|
+
"app.boundary.reload": "reload the interface",
|
|
35
|
+
// the window shell widget (the one chrome of the application)
|
|
36
|
+
"shell.window.aria": "getry",
|
|
37
|
+
"ShellBrand": "getry",
|
|
38
|
+
"shell.role": "the AI gateway of the wenathlan family",
|
|
39
|
+
"shell.caption.minimize": "Minimize",
|
|
40
|
+
"shell.caption.maximize": "Maximize",
|
|
41
|
+
"shell.caption.restore": "Restore",
|
|
42
|
+
"shell.caption.close": "Close",
|
|
43
|
+
"shell.rail.aria": "primary",
|
|
44
|
+
"shell.rail.home": "home",
|
|
45
|
+
"shell.rail.homeDetail": "the gateway surface of the family",
|
|
46
|
+
"shell.rail.sessions": "sessions",
|
|
47
|
+
"shell.rail.sessionsDetail": "the session store and key rotation",
|
|
48
|
+
"shell.rail.thinking": "thinking",
|
|
49
|
+
"shell.rail.thinkingDetail": "the 7-level reasoning ladder",
|
|
50
|
+
"shell.rail.versions": "versions",
|
|
51
|
+
"shell.rail.versionsDetail": "five provider gateways and their routes",
|
|
52
|
+
"shell.family.aria": "the wenathlan family",
|
|
53
|
+
"shell.family.tip": "{slug} — a family surface",
|
|
54
|
+
"shell.family.tab": "open {slug} in its own tab",
|
|
55
|
+
"shell.theme.aria": "toggle theme",
|
|
56
|
+
"shell.chip.restoreAria": "Restore getry",
|
|
57
|
+
// the toast widget (the dismiss affordance)
|
|
58
|
+
"toast.dismiss": "dismiss",
|
|
59
|
+
// the shared nav labels of the quad links
|
|
60
|
+
"nav.versions": "versions",
|
|
61
|
+
"nav.thinking": "thinking",
|
|
62
|
+
"nav.sessions": "sessions",
|
|
63
|
+
// the home page anchor (the gateway landing)
|
|
64
|
+
"home.eyebrow": "getry · deployable inference gateway",
|
|
65
|
+
"home.title": "many gateways, one mask",
|
|
66
|
+
"home.lede":
|
|
67
|
+
"getry spins five provider replicas behind the devthink meta-model — {count} OpenAI-compatible routes, pure byte passthrough, nothing on your machine.",
|
|
68
|
+
"home.hero.label": "send a completion",
|
|
69
|
+
"home.hero.inputAria": "gateway endpoint",
|
|
70
|
+
"home.hero.send": "send",
|
|
71
|
+
"home.hero.sendToast": "{endpoint} answers on the self-hosted gateway over HTTPS — this surface stores nothing",
|
|
72
|
+
"home.status.unrouted": "unrouted · the replicas answer /v1 through /v{count}",
|
|
73
|
+
"home.status.routed": "{v} · {provider} · /{v}/{route} · {badge}",
|
|
74
|
+
"home.status.unknownRoute": "{v} · {provider} · unknown route — the replicas answer the seven kinds",
|
|
75
|
+
"home.status.nameRoute": "{v} · {provider} · {badge} · name a route",
|
|
76
|
+
"home.chips.replica": "replica",
|
|
77
|
+
"home.chips.route": "route",
|
|
78
|
+
"home.badge.live": "{count} replicas live",
|
|
79
|
+
"home.badge.routes": "{count} routes",
|
|
80
|
+
"home.badge.passthrough": "pure byte passthrough",
|
|
81
|
+
"home.matrix.aria": "replica matrix",
|
|
82
|
+
"home.matrix.title": "the replica matrix",
|
|
83
|
+
"home.matrix.lede":
|
|
84
|
+
"One meta model, five copies of itself: every replica serves devthink over its provider family — the mask is the product, the lane is the detail.",
|
|
85
|
+
"home.table.replica": "replica",
|
|
86
|
+
"home.table.serves": "serves",
|
|
87
|
+
"home.table.lane": "lane",
|
|
88
|
+
"home.table.routes": "routes",
|
|
89
|
+
"home.table.status": "status",
|
|
90
|
+
"home.matrix.featnote": "22 keys round robin",
|
|
91
|
+
"home.matrix.note":
|
|
92
|
+
"The paused v2 babel lane falls back to v1 zai; v4 and v5 discover their free-tag models live — zero hardcoded names anywhere.",
|
|
93
|
+
"home.steps.aria": "deploy steps",
|
|
94
|
+
"home.steps.deploy.title": "deploy the mirror",
|
|
95
|
+
"home.steps.deploy.phrase":
|
|
96
|
+
"the same self-hosted gateway serves every deploy — this site runs the same routes.",
|
|
97
|
+
"home.steps.route.title": "name a route",
|
|
98
|
+
"home.steps.route.phrase": "35 OpenAI-compatible endpoints answer on the self-hosted lanes — the seven kinds ride every replica.",
|
|
99
|
+
"home.steps.mask.title": "ride the mask",
|
|
100
|
+
"home.steps.mask.phrase":
|
|
101
|
+
"the parser re-emits every chunk as devthink — reasoning deltas before content, keepalives holding the stream.",
|
|
102
|
+
"home.quad.gateway": "gateway",
|
|
103
|
+
"home.quad.gatewayMeta": "{replicas} replicas · {routes} routes · {live} live",
|
|
104
|
+
"home.quad.thinking": "thinking",
|
|
105
|
+
"home.quad.thinkingMeta": "{rungs} rungs · default {default} · {budget} token ceiling",
|
|
106
|
+
"home.quad.store": "store",
|
|
107
|
+
"home.quad.storeMeta": "rotation every {every} turns · keys masked at render · zero client storage",
|
|
108
|
+
"home.quad.pages": "pages",
|
|
109
|
+
"home.quad.domainsAria": "gateway domains",
|
|
110
|
+
"home.family.aria": "the family apps",
|
|
111
|
+
"home.family.head": "the devthink family",
|
|
112
|
+
"home.family.tip": "open {slug} in its own deploy",
|
|
113
|
+
// the sessions page anchor (the session registry)
|
|
114
|
+
"sessions.eyebrow": "getry · sessions",
|
|
115
|
+
"sessions.title": "sessions, keys and the chat log",
|
|
116
|
+
"sessions.lede":
|
|
117
|
+
"One row per session and provider carries the rotation index, the thinking budget and the context window math. The key pools rotate in round robin; the meta model rotates every six messages.",
|
|
118
|
+
"sessions.stamp.never": "never",
|
|
119
|
+
"sessions.toast.reload": "the store answers from the self-hosted database — reload to ask again",
|
|
120
|
+
"sessions.toast.refresh": "the rows refresh from the site database on every load — nothing persists on your machine",
|
|
121
|
+
"sessions.registry.aria": "session registry",
|
|
122
|
+
"sessions.registry.head": "session contexts — one row per session and provider",
|
|
123
|
+
"sessions.table.session": "session",
|
|
124
|
+
"sessions.table.model": "model",
|
|
125
|
+
"sessions.table.messages": "messages",
|
|
126
|
+
"sessions.table.context": "context",
|
|
127
|
+
"sessions.table.rotation": "rotation",
|
|
128
|
+
"sessions.table.thinking": "thinking",
|
|
129
|
+
"sessions.table.last": "last message",
|
|
130
|
+
"sessions.think.default": "default",
|
|
131
|
+
"sessions.think.off": "off",
|
|
132
|
+
"sessions.empty.sessions":
|
|
133
|
+
"the session store answered no rows — the self-hosted DB is offline and this static build carries no seeds for it",
|
|
134
|
+
"sessions.action.store": "ask the store again",
|
|
135
|
+
"sessions.loading.sessions": "loading the session store…",
|
|
136
|
+
"sessions.rail.rotation": "rotation",
|
|
137
|
+
"sessions.rail.activeKeys": "active keys",
|
|
138
|
+
"sessions.rail.inRotation": "in rotation",
|
|
139
|
+
"sessions.rail.erroring": "erroring",
|
|
140
|
+
"sessions.rail.metaTurns": "meta model turns",
|
|
141
|
+
"sessions.rail.everySix": "every 6",
|
|
142
|
+
"sessions.rail.foot":
|
|
143
|
+
"The real keys live in the environment of the self-hosted deploy — this surface only ever renders the masked answers.",
|
|
144
|
+
"sessions.rail.keys": "provider keys",
|
|
145
|
+
"sessions.empty.keys": "the key pool answered no rows — the /v1/keys lane of the self-hosted DB is not answering",
|
|
146
|
+
"sessions.action.pool": "ask the pool again",
|
|
147
|
+
"sessions.key.unlabeled": "unlabeled",
|
|
148
|
+
"sessions.key.meta": "{provider} · {label} · {uses} uses · rotated {rotated}×",
|
|
149
|
+
"sessions.log.aria": "recent chat log",
|
|
150
|
+
"sessions.log.title": "recent chat log",
|
|
151
|
+
"sessions.log.lede":
|
|
152
|
+
"Every gateway request and response lands in the ChatMessage kind with its route, tokens and round-trip duration — the slice the gateway lanes consume.",
|
|
153
|
+
"sessions.log.chat": "chat",
|
|
154
|
+
"sessions.log.provider": "provider",
|
|
155
|
+
"sessions.log.route": "route",
|
|
156
|
+
"sessions.log.role": "role",
|
|
157
|
+
"sessions.log.tokens": "tokens",
|
|
158
|
+
"sessions.log.durationHead": "duration",
|
|
159
|
+
"sessions.log.at": "at",
|
|
160
|
+
"sessions.log.duration": "{ms}ms",
|
|
161
|
+
"sessions.empty.log": "the chat log answered no entries — no gateway request has been logged to this store yet",
|
|
162
|
+
"sessions.action.log": "ask the log again",
|
|
163
|
+
"sessions.loading.log": "loading the chat log…",
|
|
164
|
+
"sessions.action.how": "how the rows arrive",
|
|
165
|
+
// the thinking page anchor (the reasoning ladder)
|
|
166
|
+
"thinking.eyebrow": "getry · thinking",
|
|
167
|
+
"thinking.title": "the 7-level thinking system",
|
|
168
|
+
"thinking.lede":
|
|
169
|
+
"Every chat route accepts a thinking level; the gateway resolves it to the budget the provider receives and carries the choice on the session context. Requests that name no level ride the deep-reasoning default.",
|
|
170
|
+
"thinking.levels.aria": "thinking levels",
|
|
171
|
+
"thinking.defaultBadge": "default",
|
|
172
|
+
"thinking.rung.budget": "{budget} tokens",
|
|
173
|
+
"thinking.rail.head": "how a level resolves",
|
|
174
|
+
"thinking.rail.ledeLead": "The gateway reads the level from the request body (or falls back to ",
|
|
175
|
+
"thinking.rail.ledeMid1": ") and resolves the budget with the same math on every version — ",
|
|
176
|
+
"thinking.rail.ledeMid2": " answers ",
|
|
177
|
+
"thinking.rail.ledeTail":
|
|
178
|
+
" tokens — and records the rung on the session context so the rotation keeps the choice across turns.",
|
|
179
|
+
"thinking.rail.ladder": "ladder",
|
|
180
|
+
"thinking.rail.defaultRung": "default rung",
|
|
181
|
+
"thinking.rail.defaultBudget": "default budget",
|
|
182
|
+
"thinking.rail.foot":
|
|
183
|
+
"The caps repeat at the top of the ladder: xhigh and max ride the same {ceiling} ceiling the providers allow. Seven rungs, one budget math, zero client storage.",
|
|
184
|
+
// the versions page anchor (the gateway registry)
|
|
185
|
+
"versions.eyebrow": "getry · versions",
|
|
186
|
+
"versions.title": "five gateways, thirty-five routes",
|
|
187
|
+
"versions.lede":
|
|
188
|
+
"Each version owns one provider family and answers the same seven OpenAI-compatible routes. The v2 babel service is paused and falls back to v1 zai; v4 and v5 discover their models live through the free-tag filter.",
|
|
189
|
+
"versions.registry.aria": "gateway registry",
|
|
190
|
+
"versions.row.routes": "{count} routes",
|
|
191
|
+
"versions.toast.route": "{endpoint} answers on the self-hosted gateway, never on this surface",
|
|
192
|
+
"versions.parser.head": "canonical parser pattern",
|
|
193
|
+
"versions.glance.head": "the registry at a glance",
|
|
194
|
+
"versions.glance.replicas": "replicas",
|
|
195
|
+
"versions.glance.live": "live",
|
|
196
|
+
"versions.glance.routes": "routes",
|
|
197
|
+
"versions.glance.mask": "mask",
|
|
198
|
+
"versions.glance.foot":
|
|
199
|
+
"Every replica serves the same meta model — the parser masks the upstream name before the bytes leave the lane.",
|
|
200
|
+
"versions.quickstart.aria": "quick start",
|
|
201
|
+
"versions.quickstart.title": "quick start",
|
|
202
|
+
"versions.quickstart":
|
|
203
|
+
'# v1 — zai passthrough no key required\ncurl -x post http://localhost:3000/v1/chat/completions \\\n -h "content-type: application/json" \\\n -d \'{"messages":[{"role":"user","content":"hi"}],"stream":true}\'\n\n# v3 — nvidia nim free models\ncurl -x post http://localhost:3000/v3/chat/completions \\\n -h "content-type: application/json" \\\n -d \'{"model":"devthink","messages":[{"role":"user","content":"hi"}]}\'\n\n# v4 — opencode kilo anonymous free tier\ncurl -x post http://localhost:3000/v4/chat/completions \\\n -h "content-type: application/json" \\\n -d \'{"model":"devthink","messages":[{"role":"user","content":"hi"}]}\'\n\n# v5 — openrouter free models requires key\ncurl -x post http://localhost:3000/v5/chat/completions \\\n -h "content-type: application/json" \\\n -h "authorization: bearer $openrouter_api_key" \\\n -d \'{"model":"devthink","messages":[{"role":"user","content":"hi"}]}\'\n\n# model discovery — v4 and v5 catalogs are dynamic (free-tag filter)\ncurl http://localhost:3000/v4/models\ncurl http://localhost:3000/v5/models',
|
|
204
|
+
// the intro page anchor (the splash)
|
|
205
|
+
"intro.aria": "getry is opening",
|
|
206
|
+
"intro.name": "getry",
|
|
207
|
+
"intro.role": "the AI gateway of the wenathlan family",
|
|
208
|
+
"intro.skip": "click or press any key to skip",
|
|
209
|
+
// the notfound page anchor (the unrouted route)
|
|
210
|
+
"notfound.title": "Route Not Found",
|
|
211
|
+
"notfound.lede1": "This route of the gateway does not exist.",
|
|
212
|
+
"notfound.lede2": "It may have been moved or never served.",
|
|
213
|
+
"notfound.backHome": "back to home",
|
|
214
|
+
// the onboarding page anchor (the first-run frames)
|
|
215
|
+
"onboarding.aria": "getry first run",
|
|
216
|
+
"onboarding.title": "welcome to getry",
|
|
217
|
+
"onboarding.skip": "skip ahead",
|
|
218
|
+
"onboarding.step.eyebrow": "{no} — {step}",
|
|
219
|
+
"onboarding.steps.app": "the app",
|
|
220
|
+
"onboarding.steps.surfaces": "the surfaces",
|
|
221
|
+
"onboarding.steps.enter": "enter",
|
|
222
|
+
"onboarding.what.title": "one window, the whole gateway",
|
|
223
|
+
"onboarding.what.body":
|
|
224
|
+
"getry is the AI gateway of the wenathlan family — not an operating system: one application window holding the console over the provider gateways, the reasoning ladder and the session store.",
|
|
225
|
+
"onboarding.hosts.title": "what the window hosts",
|
|
226
|
+
"onboarding.enter.title": "ready to enter",
|
|
227
|
+
"onboarding.enter.body":
|
|
228
|
+
"the window opens on the gateway home and every surface rides the same rail. the theme starts dark and stays in memory only — nothing is written to this machine.",
|
|
229
|
+
"onboarding.back": "back",
|
|
230
|
+
"onboarding.enterCta": "enter getry",
|
|
231
|
+
"onboarding.continue": "continue",
|
|
232
|
+
} as const;
|
|
233
|
+
|
|
234
|
+
export type LabelKey = keyof typeof LABEL_MANIFEST & string;
|
|
235
|
+
|
|
236
|
+
/** the store mechanism rides the vault factory (the storage law of the
|
|
237
|
+
* family: the vault owns the store, the app owns the manifest — the
|
|
238
|
+
* mechanism is imported, never duplicated). the cache key keeps the browser mirror the wingets already read. */
|
|
239
|
+
const store = createLabelStore({
|
|
240
|
+
manifest: LABEL_MANIFEST,
|
|
241
|
+
revision: LABEL_REVISION,
|
|
242
|
+
cacheKey: "getry.labels.rows",
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
/** the typed accessor of the copy: the only door a widget or page anchor uses. */
|
|
246
|
+
export function label(key: LabelKey): string {
|
|
247
|
+
return store.label(key);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/** the placeholder door: fills the {token} slots of one format key with the
|
|
251
|
+
* runtime values (the store keeps the sentence, the widget passes the data). */
|
|
252
|
+
export function labelfill(key: LabelKey, values: Record<string, string>): string {
|
|
253
|
+
return store.labelfill(key, values);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/** the seed ingests the manifest into the labels store, idempotent, and the
|
|
257
|
+
* translated rows stay protected from the overwrite. in the browser the rows
|
|
258
|
+
* ride the local cache of the site db; on the server db.ts seeds the same
|
|
259
|
+
* manifest into the labels table through seedLabelRows. */
|
|
260
|
+
export function seedLabels(): Promise<{ seeded: number; protected: number }> {
|
|
261
|
+
return store.seedLabels();
|
|
262
|
+
}
|