@ggui-ai/protocol 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/envelopes/render-refusal.d.ts +49 -0
- package/dist/envelopes/render-refusal.d.ts.map +1 -0
- package/dist/envelopes/render-refusal.js +12 -0
- package/dist/errors/domain-error.d.ts +70 -0
- package/dist/errors/domain-error.d.ts.map +1 -0
- package/dist/errors/domain-error.js +118 -0
- package/dist/gadgets/resolve-app-gadgets.d.ts +1 -1
- package/dist/gadgets/stdlib-gadgets.d.ts +2 -2
- package/dist/gadgets/stdlib-gadgets.js +1 -1
- package/dist/index.d.ts +69 -63
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/integrations/mcp-apps.d.ts +35 -9
- package/dist/integrations/mcp-apps.d.ts.map +1 -1
- package/dist/integrations/mcp-apps.js +13 -13
- package/dist/integrations/overlay-hash.d.ts +19 -0
- package/dist/integrations/overlay-hash.d.ts.map +1 -0
- package/dist/integrations/overlay-hash.js +29 -0
- package/dist/integrations/theme-binding.d.ts +14 -12
- package/dist/integrations/theme-binding.d.ts.map +1 -1
- package/dist/integrations/theme-binding.js +10 -6
- package/dist/registry/blueprint-key.d.ts.map +1 -1
- package/dist/registry/blueprint-key.js +4 -3
- package/dist/schemas/app-theme.d.ts +46 -10
- package/dist/schemas/app-theme.d.ts.map +1 -1
- package/dist/schemas/app-theme.js +108 -40
- package/dist/schemas/blueprint.d.ts +4 -3
- package/dist/schemas/blueprint.d.ts.map +1 -1
- package/dist/schemas/blueprint.js +15 -3
- package/dist/schemas/data-contract.d.ts +11 -31
- package/dist/schemas/data-contract.d.ts.map +1 -1
- package/dist/schemas/data-contract.js +5 -28
- package/dist/schemas/handshake-suggestion.d.ts.map +1 -1
- package/dist/schemas/handshake-suggestion.js +8 -1
- package/dist/schemas/interface-context.d.ts +44 -0
- package/dist/schemas/interface-context.d.ts.map +1 -0
- package/dist/schemas/interface-context.js +22 -0
- package/dist/schemas/invoke.d.ts +3 -3
- package/dist/schemas/invoke.js +1 -1
- package/dist/schemas/mcp.d.ts +246 -111
- package/dist/schemas/mcp.d.ts.map +1 -1
- package/dist/schemas/mcp.js +149 -42
- package/dist/schemas/ops-blueprint.d.ts +4 -4
- package/dist/schemas/ops-blueprint.d.ts.map +1 -1
- package/dist/schemas/ops-blueprint.js +13 -8
- package/dist/schemas/public-env-key.d.ts +26 -0
- package/dist/schemas/public-env-key.d.ts.map +1 -0
- package/dist/schemas/public-env-key.js +25 -0
- package/dist/schemas/render-input-envelope.d.ts +2 -2
- package/dist/schemas/render-input-envelope.js +1 -1
- package/dist/schemas/runtime-telemetry-limits.d.ts +11 -0
- package/dist/schemas/runtime-telemetry-limits.d.ts.map +1 -0
- package/dist/schemas/runtime-telemetry-limits.js +10 -0
- package/dist/transport/websocket.d.ts +5 -5
- package/dist/types/auth.d.ts +1 -1
- package/dist/types/blueprint-source.d.ts +27 -7
- package/dist/types/blueprint-source.d.ts.map +1 -1
- package/dist/types/blueprint-source.js +19 -3
- package/dist/types/blueprint.d.ts +2 -2
- package/dist/types/blueprint.d.ts.map +1 -1
- package/dist/types/contract-inference.d.ts +1 -1
- package/dist/types/data-contract.d.ts +3 -3
- package/dist/types/domain-error-codes.d.ts +167 -0
- package/dist/types/domain-error-codes.d.ts.map +1 -0
- package/dist/types/domain-error-codes.js +170 -0
- package/dist/types/events.d.ts +1 -1
- package/dist/types/ggui-session-event.d.ts +2 -2
- package/dist/types/handshake-suggestion.d.ts +2 -2
- package/dist/types/host-context.d.ts +3 -3
- package/dist/types/interface-context.d.ts +1 -1
- package/dist/types/invoke.d.ts +1 -1
- package/dist/types/lifecycle.d.ts +1 -1
- package/dist/types/live-channel.d.ts +3 -3
- package/dist/types/llm-route.d.ts +59 -2
- package/dist/types/llm-route.d.ts.map +1 -1
- package/dist/types/llm-route.js +62 -16
- package/dist/types/llm.d.ts +22 -2
- package/dist/types/llm.d.ts.map +1 -1
- package/dist/types/llm.js +29 -2
- package/dist/types/mcp.d.ts +49 -100
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/types/mcp.js +28 -9
- package/dist/types/refusal-codes.d.ts +54 -95
- package/dist/types/refusal-codes.d.ts.map +1 -1
- package/dist/types/refusal-codes.js +67 -105
- package/dist/types/render.d.ts +12 -11
- package/dist/types/render.d.ts.map +1 -1
- package/dist/types/ui-generator.d.ts +1 -1
- package/dist/validation/ajv-runtime.d.ts +2 -2
- package/dist/validation/contract-validator.d.ts +14 -8
- package/dist/validation/contract-validator.d.ts.map +1 -1
- package/dist/validation/contract-validator.js +12 -4
- package/dist/validation/cross-references.d.ts +2 -2
- package/dist/validation/hygiene-rules.d.ts +1 -1
- package/dist/validation/lint-contract.d.ts +2 -2
- package/dist/validation/lint-contract.d.ts.map +1 -1
- package/dist/validation/lint-contract.js +6 -4
- package/dist/validation/name-invariants.d.ts +2 -2
- package/dist/validation/reserved-channels.d.ts +1 -1
- package/dist/validation/schema-compat-invariants.d.ts +2 -2
- package/dist/validation/schema-meta-validation.d.ts +1 -1
- package/dist/validation/schema-subset.d.ts +3 -3
- package/dist/version.d.ts +485 -12
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +484 -11
- package/dist/wire.d.ts +45 -0
- package/dist/wire.d.ts.map +1 -0
- package/dist/wire.js +44 -0
- package/package.json +7 -1
- package/dist/envelope-adapters.d.ts +0 -25
- package/dist/envelope-adapters.d.ts.map +0 -1
- package/dist/envelope-adapters.js +0 -14
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
*/
|
|
53
53
|
export declare const MODELS: {
|
|
54
54
|
readonly anthropic: readonly ["claude-fable-5-1", "claude-fable-5", "claude-opus-5", "claude-sonnet-5", "claude-haiku-4-5-20251001", "claude-opus-4-8", "claude-sonnet-4-6", "claude-opus-4-7", "claude-opus-4-6"];
|
|
55
|
-
readonly openai: readonly ["gpt-5.6", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5", "gpt-5.5-2026-04-23", "gpt-5.5-pro", "gpt-5.5-pro-2026-04-23", "gpt-5.4", "gpt-5.4-2026-03-05", "gpt-5.4-mini", "gpt-5.4-mini-2026-03-17", "gpt-5.4-nano", "gpt-5.4-nano-2026-03-17", "gpt-5.3-codex"];
|
|
55
|
+
readonly openai: readonly ["gpt-6-astra", "gpt-5.6", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5", "gpt-5.5-2026-04-23", "gpt-5.5-pro", "gpt-5.5-pro-2026-04-23", "gpt-5.4", "gpt-5.4-2026-03-05", "gpt-5.4-mini", "gpt-5.4-mini-2026-03-17", "gpt-5.4-nano", "gpt-5.4-nano-2026-03-17", "gpt-5.3-codex"];
|
|
56
56
|
readonly google: readonly ["gemini-3.7-flash", "gemini-3.6-flash", "gemini-3.5-flash", "gemini-3.5-flash-lite", "gemini-flash-latest", "gemini-3.1-flash-lite", "gemini-3.1-pro-preview", "gemini-3.1-flash-lite-preview", "gemini-3-flash-preview"];
|
|
57
57
|
readonly bedrock: readonly ["anthropic.claude-fable-5-1", "anthropic.claude-fable-5", "anthropic.claude-opus-5", "anthropic.claude-sonnet-5", "anthropic.claude-opus-4-8", "us.anthropic.claude-haiku-4-5-20251001-v1:0", "eu.anthropic.claude-haiku-4-5-20251001-v1:0", "apac.anthropic.claude-haiku-4-5-20251001-v1:0", "global.anthropic.claude-haiku-4-5-20251001-v1:0", "us.anthropic.claude-sonnet-4-6", "eu.anthropic.claude-sonnet-4-6", "apac.anthropic.claude-sonnet-4-6", "us.anthropic.claude-opus-4-7", "eu.anthropic.claude-opus-4-7", "apac.anthropic.claude-opus-4-7", "global.anthropic.claude-opus-4-7", "us.anthropic.claude-opus-4-6-v1"];
|
|
58
58
|
readonly openrouter: readonly ["anthropic/claude-fable-5", "anthropic/claude-opus-5", "anthropic/claude-sonnet-5", "anthropic/claude-haiku-4.5", "anthropic/claude-sonnet-4.6", "anthropic/claude-opus-4.7", "openai/gpt-5.6-sol", "openai/gpt-5.6-terra", "openai/gpt-5.6-luna", "openai/gpt-5.5", "openai/gpt-5.5-pro", "openai/gpt-5.4-mini", "openai/gpt-5.4-nano", "google/gemini-3.6-flash", "google/gemini-3.5-flash", "google/gemini-3.5-flash-lite", "google/gemini-3.1-pro-preview", "google/gemini-3.1-flash-lite", "x-ai/grok-4.3", "meta-llama/llama-4-maverick", "meta-llama/llama-3.3-70b-instruct", "deepseek/deepseek-v4-pro", "deepseek/deepseek-r1-0528", "qwen/qwen3.7-max", "qwen/qwen3-coder", "mistralai/mistral-large-2512", "openai/gpt-oss-120b"];
|
|
@@ -189,6 +189,25 @@ export declare function serializeLlmRoute(route: LlmRoute): string;
|
|
|
189
189
|
* Round-trip with {@link serializeLlmRoute}.
|
|
190
190
|
*/
|
|
191
191
|
export declare function parseLlmRoute(serialized: string): LlmRoute | null;
|
|
192
|
+
/**
|
|
193
|
+
* Map from LiteLLM transport prefix → our `LlmProvider` enum. Used by
|
|
194
|
+
* {@link parseLiteLlmString} to accept legacy ggui.json files and
|
|
195
|
+
* ecosystem inputs without forcing a migration on every operator.
|
|
196
|
+
*
|
|
197
|
+
* Note: LiteLLM separates `gemini/` (AI Studio) from `vertex_ai/`
|
|
198
|
+
* (enterprise Vertex). We don't have a Vertex variant in this slice;
|
|
199
|
+
* `vertex_ai/` parsing falls through to `null` until Vertex lands.
|
|
200
|
+
*/
|
|
201
|
+
/**
|
|
202
|
+
* The prefixes a {@link ModelRef} may start with — the LiteLLM spellings,
|
|
203
|
+
* and the model registry's. The single source: the prefix→provider map
|
|
204
|
+
* below is keyed by it (exhaustive by type), and the JSON-Schema-facing
|
|
205
|
+
* `pattern` in `llmBlueprintSourceSchema` is built from it.
|
|
206
|
+
*/
|
|
207
|
+
export declare const MODEL_REF_PREFIXES: readonly ["anthropic", "gemini", "openai", "bedrock", "openrouter"];
|
|
208
|
+
export type ModelRefPrefix = (typeof MODEL_REF_PREFIXES)[number];
|
|
209
|
+
/** Whether `s` is one of {@link MODEL_REF_PREFIXES}. */
|
|
210
|
+
export declare function isModelRefPrefix(s: string): s is ModelRefPrefix;
|
|
192
211
|
/**
|
|
193
212
|
* Parse a LiteLLM-format string (`<prefix>/<model>` or
|
|
194
213
|
* `<prefix>/<sub>/<model>` for OpenRouter) into an `LlmRoute`.
|
|
@@ -218,7 +237,7 @@ export declare function parseLiteLlmString(s: string): LlmRoute | null;
|
|
|
218
237
|
* For models without an explicit LITELLM_TO_WIRE mapping (Gemini,
|
|
219
238
|
* OpenAI, OpenRouter), serialization uses the wire model as-is.
|
|
220
239
|
*/
|
|
221
|
-
export declare function toLiteLlmString(route: LlmRoute):
|
|
240
|
+
export declare function toLiteLlmString(route: LlmRoute): ModelRef;
|
|
222
241
|
/**
|
|
223
242
|
* Single-entry parser that accepts both canonical (`provider:model`)
|
|
224
243
|
* and LiteLLM (`prefix/model`) formats. Used at wire boundaries that
|
|
@@ -230,4 +249,42 @@ export declare function toLiteLlmString(route: LlmRoute): string;
|
|
|
230
249
|
* format produces a valid route.
|
|
231
250
|
*/
|
|
232
251
|
export declare function parseAnyLlmRoute(s: string): LlmRoute | null;
|
|
252
|
+
/**
|
|
253
|
+
* A route rendered as ONE string in the model registry's spelling —
|
|
254
|
+
* the LiteLLM form `<prefix>/<model>` (#818: one model-id vocabulary,
|
|
255
|
+
* two separators). Every registry id (`ModelId`, e.g.
|
|
256
|
+
* `anthropic/claude-haiku-4-5`, `gemini/gemini-3.5-flash`) is the ref
|
|
257
|
+
* of the route it names, so `ModelId ⊂ ModelRef`; a bedrock inference
|
|
258
|
+
* profile or an unlisted OpenRouter model is a `ModelRef` the registry
|
|
259
|
+
* does not list. Where a wire model has a LiteLLM alias
|
|
260
|
+
* (`claude-haiku-4-5-20251001` ↔ `claude-haiku-4-5`) the ref is the
|
|
261
|
+
* ALIAS — the dated wire id is not a ref spelling.
|
|
262
|
+
*
|
|
263
|
+
* Split at the FIRST `/`: prefixes contain no slash, so
|
|
264
|
+
* `openrouter/anthropic/claude-3.5-sonnet` is unambiguous.
|
|
265
|
+
*
|
|
266
|
+
* Used where a record must say which model a run used and readers must
|
|
267
|
+
* recover the route: `LlmBlueprintSource.model`.
|
|
268
|
+
*/
|
|
269
|
+
export type ModelRef = `${ModelRefPrefix}/${string}`;
|
|
270
|
+
/**
|
|
271
|
+
* The one composer of a {@link ModelRef}: render the route the run used,
|
|
272
|
+
* inverting the LiteLLM alias map so a resolved `{anthropic,
|
|
273
|
+
* claude-haiku-4-5-20251001}` renders as `anthropic/claude-haiku-4-5` —
|
|
274
|
+
* the registry id. Total: every `LlmRoute` has a ref. Feed it the ROUTE
|
|
275
|
+
* the call used; the ref is the same whether the route was configured
|
|
276
|
+
* as the alias or already resolved.
|
|
277
|
+
*/
|
|
278
|
+
export declare function modelRefOfRoute(route: LlmRoute): ModelRef;
|
|
279
|
+
/**
|
|
280
|
+
* Recover the route from a {@link ModelRef}. `null` unless `s` is a
|
|
281
|
+
* LiteLLM-form string that parses ({@link parseLiteLlmString}) AND is
|
|
282
|
+
* the spelling {@link modelRefOfRoute} produces for that route — a ref
|
|
283
|
+
* has one spelling, so the dated wire id of an aliased model and a
|
|
284
|
+
* wrong prefix are refused here even though the lenient wire parsers
|
|
285
|
+
* accept them.
|
|
286
|
+
*/
|
|
287
|
+
export declare function parseModelRef(s: string): LlmRoute | null;
|
|
288
|
+
/** Whether `s` is a {@link ModelRef} — see {@link parseModelRef}. */
|
|
289
|
+
export declare function isModelRef(s: string): s is ModelRef;
|
|
233
290
|
//# sourceMappingURL=llm-route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-route.d.ts","sourceRoot":"","sources":["../../src/types/llm-route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAMH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,MAAM;;;;;;
|
|
1
|
+
{"version":3,"file":"llm-route.d.ts","sourceRoot":"","sources":["../../src/types/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7 @@ export const MODELS = {
|
|
|
78
78
|
// reasoning), `terra` (balanced), `luna` (fast/cost). The bare
|
|
79
79
|
// `gpt-5.6` alias routes to Sol on OpenAI's side. No dated
|
|
80
80
|
// siblings registered at adoption time.
|
|
81
|
+
'gpt-6-astra', // ggui#977 (2026-09-09): listed by `GET /v1/models/gpt-6-astra` → 200
|
|
81
82
|
'gpt-5.6',
|
|
82
83
|
'gpt-5.6-sol',
|
|
83
84
|
'gpt-5.6-terra',
|
|
@@ -345,6 +346,13 @@ export function parseLlmRoute(serialized) {
|
|
|
345
346
|
* (enterprise Vertex). We don't have a Vertex variant in this slice;
|
|
346
347
|
* `vertex_ai/` parsing falls through to `null` until Vertex lands.
|
|
347
348
|
*/
|
|
349
|
+
/**
|
|
350
|
+
* The prefixes a {@link ModelRef} may start with — the LiteLLM spellings,
|
|
351
|
+
* and the model registry's. The single source: the prefix→provider map
|
|
352
|
+
* below is keyed by it (exhaustive by type), and the JSON-Schema-facing
|
|
353
|
+
* `pattern` in `llmBlueprintSourceSchema` is built from it.
|
|
354
|
+
*/
|
|
355
|
+
export const MODEL_REF_PREFIXES = ['anthropic', 'gemini', 'openai', 'bedrock', 'openrouter'];
|
|
348
356
|
const LITELLM_PROVIDER_PREFIX_MAP = {
|
|
349
357
|
anthropic: 'anthropic',
|
|
350
358
|
gemini: 'google',
|
|
@@ -352,6 +360,26 @@ const LITELLM_PROVIDER_PREFIX_MAP = {
|
|
|
352
360
|
bedrock: 'bedrock',
|
|
353
361
|
openrouter: 'openrouter',
|
|
354
362
|
};
|
|
363
|
+
/**
|
|
364
|
+
* Provider → its ONE LiteLLM prefix. Exhaustive by type: adding a
|
|
365
|
+
* provider to `MODELS` without a prefix here is a compile error, which
|
|
366
|
+
* is what makes {@link modelRefOfRoute} total.
|
|
367
|
+
*/
|
|
368
|
+
const PROVIDER_TO_LITELLM_PREFIX = {
|
|
369
|
+
anthropic: 'anthropic',
|
|
370
|
+
google: 'gemini',
|
|
371
|
+
openai: 'openai',
|
|
372
|
+
bedrock: 'bedrock',
|
|
373
|
+
openrouter: 'openrouter',
|
|
374
|
+
};
|
|
375
|
+
const MODEL_REF_PREFIX_LIST = MODEL_REF_PREFIXES;
|
|
376
|
+
/** Whether `s` is one of {@link MODEL_REF_PREFIXES}. */
|
|
377
|
+
export function isModelRefPrefix(s) {
|
|
378
|
+
return MODEL_REF_PREFIX_LIST.includes(s);
|
|
379
|
+
}
|
|
380
|
+
function liteLlmPrefixProvider(prefix) {
|
|
381
|
+
return isModelRefPrefix(prefix) ? LITELLM_PROVIDER_PREFIX_MAP[prefix] : undefined;
|
|
382
|
+
}
|
|
355
383
|
/**
|
|
356
384
|
* LiteLLM canonical → wire-canonical model mappings for providers
|
|
357
385
|
* whose LiteLLM-form differs from the wire-canonical form.
|
|
@@ -396,7 +424,7 @@ export function parseLiteLlmString(s) {
|
|
|
396
424
|
if (firstSlash <= 0)
|
|
397
425
|
return null;
|
|
398
426
|
const prefix = s.substring(0, firstSlash);
|
|
399
|
-
const provider =
|
|
427
|
+
const provider = liteLlmPrefixProvider(prefix);
|
|
400
428
|
if (!provider)
|
|
401
429
|
return null;
|
|
402
430
|
// For OpenRouter the model is everything after the first slash
|
|
@@ -446,23 +474,10 @@ function getWireToLitellm() {
|
|
|
446
474
|
* OpenAI, OpenRouter), serialization uses the wire model as-is.
|
|
447
475
|
*/
|
|
448
476
|
export function toLiteLlmString(route) {
|
|
449
|
-
|
|
450
|
-
const inverseMap = getWireToLitellm()[route.provider];
|
|
451
|
-
const modelForLitellm = inverseMap?.[route.model] ?? route.model;
|
|
452
|
-
return `${prefix}/${modelForLitellm}`;
|
|
477
|
+
return modelRefOfRoute(route);
|
|
453
478
|
}
|
|
454
479
|
function providerLiteLlmPrefix(provider) {
|
|
455
|
-
|
|
456
|
-
// most one prefix per provider in LITELLM_PROVIDER_PREFIX_MAP today.
|
|
457
|
-
for (const [prefix, p] of Object.entries(LITELLM_PROVIDER_PREFIX_MAP)) {
|
|
458
|
-
if (p === provider)
|
|
459
|
-
return prefix;
|
|
460
|
-
}
|
|
461
|
-
// Defensive: every provider in MODELS should have a LiteLLM prefix.
|
|
462
|
-
// If not, fall through to the provider's own name (degrades gracefully
|
|
463
|
-
// for observability — the trace just won't match LiteLLM's exact
|
|
464
|
-
// wording, but it still names the provider).
|
|
465
|
-
return provider;
|
|
480
|
+
return PROVIDER_TO_LITELLM_PREFIX[provider];
|
|
466
481
|
}
|
|
467
482
|
// ============================================================================
|
|
468
483
|
// Combined parser (accepts either format)
|
|
@@ -480,3 +495,34 @@ function providerLiteLlmPrefix(provider) {
|
|
|
480
495
|
export function parseAnyLlmRoute(s) {
|
|
481
496
|
return parseLlmRoute(s) ?? parseLiteLlmString(s);
|
|
482
497
|
}
|
|
498
|
+
/**
|
|
499
|
+
* The one composer of a {@link ModelRef}: render the route the run used,
|
|
500
|
+
* inverting the LiteLLM alias map so a resolved `{anthropic,
|
|
501
|
+
* claude-haiku-4-5-20251001}` renders as `anthropic/claude-haiku-4-5` —
|
|
502
|
+
* the registry id. Total: every `LlmRoute` has a ref. Feed it the ROUTE
|
|
503
|
+
* the call used; the ref is the same whether the route was configured
|
|
504
|
+
* as the alias or already resolved.
|
|
505
|
+
*/
|
|
506
|
+
export function modelRefOfRoute(route) {
|
|
507
|
+
const inverseMap = getWireToLitellm()[route.provider];
|
|
508
|
+
const model = inverseMap?.[route.model] ?? route.model;
|
|
509
|
+
return `${providerLiteLlmPrefix(route.provider)}/${model}`;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Recover the route from a {@link ModelRef}. `null` unless `s` is a
|
|
513
|
+
* LiteLLM-form string that parses ({@link parseLiteLlmString}) AND is
|
|
514
|
+
* the spelling {@link modelRefOfRoute} produces for that route — a ref
|
|
515
|
+
* has one spelling, so the dated wire id of an aliased model and a
|
|
516
|
+
* wrong prefix are refused here even though the lenient wire parsers
|
|
517
|
+
* accept them.
|
|
518
|
+
*/
|
|
519
|
+
export function parseModelRef(s) {
|
|
520
|
+
const route = parseLiteLlmString(s);
|
|
521
|
+
if (route === null)
|
|
522
|
+
return null;
|
|
523
|
+
return modelRefOfRoute(route) === s ? route : null;
|
|
524
|
+
}
|
|
525
|
+
/** Whether `s` is a {@link ModelRef} — see {@link parseModelRef}. */
|
|
526
|
+
export function isModelRef(s) {
|
|
527
|
+
return parseModelRef(s) !== null;
|
|
528
|
+
}
|
package/dist/types/llm.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - `MODEL_REGISTRY` here = LiteLLM-keyed pricing + capability
|
|
7
7
|
* metadata. Keys are LiteLLM strings (`"gemini/gemini-3.5-flash"`,
|
|
8
8
|
* `"openai/gpt-5.4-mini"`, …). Read by:
|
|
9
|
-
* -
|
|
9
|
+
* - a hosted deployment's pricing-drift test (vendored
|
|
10
10
|
* LiteLLM JSON pricing table)
|
|
11
11
|
* - `oss/misc/benchmark` runner (bench harness; picks model
|
|
12
12
|
* configs by LiteLLM key)
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
* EXISTS, and `scripts/check-litellm-pricing-drift.ts` compares the
|
|
41
41
|
* snapshot against upstream, never the registry. That gap let this
|
|
42
42
|
* table sit four months stale while production routed to models it did
|
|
43
|
-
* not even list.
|
|
43
|
+
* not even list. A hosted deployment's `pricing-tables.test.ts` now asserts every
|
|
44
44
|
* entry's `costs` match the vendored rate (with an explicit, dated
|
|
45
45
|
* PENDING_UPSTREAM allowlist for prices we learn before LiteLLM does).
|
|
46
46
|
* Add a model here and you MUST re-vendor the snapshot in the same
|
|
@@ -336,6 +336,22 @@ declare const MODEL_ROWS: {
|
|
|
336
336
|
readonly maxTokens: 1000000;
|
|
337
337
|
readonly supportsTools: true;
|
|
338
338
|
};
|
|
339
|
+
readonly "openai/gpt-6-astra": {
|
|
340
|
+
readonly id: "openai/gpt-6-astra";
|
|
341
|
+
readonly provider: "openai";
|
|
342
|
+
readonly displayName: "GPT-6 Astra";
|
|
343
|
+
readonly tier: "premium";
|
|
344
|
+
readonly state: "active";
|
|
345
|
+
readonly lineup: false;
|
|
346
|
+
readonly costs: {
|
|
347
|
+
readonly inputPer1M: 10;
|
|
348
|
+
readonly outputPer1M: 50;
|
|
349
|
+
readonly cacheWritePer1M: 12.5;
|
|
350
|
+
readonly cacheReadPer1M: 1;
|
|
351
|
+
};
|
|
352
|
+
readonly maxTokens: 922000;
|
|
353
|
+
readonly supportsTools: true;
|
|
354
|
+
};
|
|
339
355
|
readonly "openai/gpt-5.6-sol": {
|
|
340
356
|
readonly id: "openai/gpt-5.6-sol";
|
|
341
357
|
readonly provider: "openai";
|
|
@@ -453,6 +469,10 @@ export interface ModelConfig extends ModelConfigBase {
|
|
|
453
469
|
* {@link ModelId} and enforce `id === key`.
|
|
454
470
|
*/
|
|
455
471
|
export declare const MODEL_REGISTRY: Readonly<Record<ModelId, ModelConfig>>;
|
|
472
|
+
/** Whether `value` is a registry model id — provider-qualified, e.g. `anthropic/claude-haiku-4-5`. */
|
|
473
|
+
export declare function isModelId(value: string): value is ModelId;
|
|
474
|
+
/** Every registry model id, in registry order (ggui#924: the blueprint record's `model` is one of these). */
|
|
475
|
+
export declare const MODEL_IDS: readonly ModelId[];
|
|
456
476
|
/**
|
|
457
477
|
* The curated "current lineup" — derived once from the rows' `lineup`
|
|
458
478
|
* fact, in registry order. Pickers render this up front and put the
|
package/dist/types/llm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm.d.ts","sourceRoot":"","sources":["../../src/types/llm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAMlD,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE7C,iEAA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AEvF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,SAAS,OAAO,EAEA,CAAC;AAE5C,+CAA+C;AAC/C,wBAAgB,aAAa,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAElD;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,OAAsC,CAAC"}
|
package/dist/types/llm.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - `MODEL_REGISTRY` here = LiteLLM-keyed pricing + capability
|
|
7
7
|
* metadata. Keys are LiteLLM strings (`"gemini/gemini-3.5-flash"`,
|
|
8
8
|
* `"openai/gpt-5.4-mini"`, …). Read by:
|
|
9
|
-
* -
|
|
9
|
+
* - a hosted deployment's pricing-drift test (vendored
|
|
10
10
|
* LiteLLM JSON pricing table)
|
|
11
11
|
* - `oss/misc/benchmark` runner (bench harness; picks model
|
|
12
12
|
* configs by LiteLLM key)
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
* EXISTS, and `scripts/check-litellm-pricing-drift.ts` compares the
|
|
41
41
|
* snapshot against upstream, never the registry. That gap let this
|
|
42
42
|
* table sit four months stale while production routed to models it did
|
|
43
|
-
* not even list.
|
|
43
|
+
* not even list. A hosted deployment's `pricing-tables.test.ts` now asserts every
|
|
44
44
|
* entry's `costs` match the vendored rate (with an explicit, dated
|
|
45
45
|
* PENDING_UPSTREAM allowlist for prices we learn before LiteLLM does).
|
|
46
46
|
* Add a model here and you MUST re-vendor the snapshot in the same
|
|
@@ -307,6 +307,27 @@ const MODEL_ROWS = defineModelRegistry({
|
|
|
307
307
|
// confirmed upstream LiteLLM has ingested both cuts, so these costs
|
|
308
308
|
// now agree with the vendored snapshot (no PENDING_UPSTREAM
|
|
309
309
|
// exemption needed).
|
|
310
|
+
// ggui#977 (2026-09-09) — Exp 008's founder-ruled second arm. Receipts on
|
|
311
|
+
// the issue: existence `GET /v1/models/gpt-6-astra` → 200; pricing from
|
|
312
|
+
// platform.openai.com/docs/pricing, standard short-context tier; context
|
|
313
|
+
// window and tool support from the model page. No retirement date is
|
|
314
|
+
// published → `retireNotBefore` unset. Not in the lineup (experiment arm).
|
|
315
|
+
"openai/gpt-6-astra": {
|
|
316
|
+
id: "openai/gpt-6-astra",
|
|
317
|
+
provider: "openai",
|
|
318
|
+
displayName: "GPT-6 Astra",
|
|
319
|
+
tier: "premium",
|
|
320
|
+
state: "active",
|
|
321
|
+
lineup: false,
|
|
322
|
+
costs: {
|
|
323
|
+
inputPer1M: 10.0,
|
|
324
|
+
outputPer1M: 50.0,
|
|
325
|
+
cacheWritePer1M: 12.5,
|
|
326
|
+
cacheReadPer1M: 1.0,
|
|
327
|
+
},
|
|
328
|
+
maxTokens: 922000,
|
|
329
|
+
supportsTools: true,
|
|
330
|
+
},
|
|
310
331
|
"openai/gpt-5.6-sol": {
|
|
311
332
|
id: "openai/gpt-5.6-sol",
|
|
312
333
|
provider: "openai",
|
|
@@ -399,6 +420,12 @@ const MODEL_ROWS = defineModelRegistry({
|
|
|
399
420
|
* {@link ModelId} and enforce `id === key`.
|
|
400
421
|
*/
|
|
401
422
|
export const MODEL_REGISTRY = MODEL_ROWS;
|
|
423
|
+
/** Whether `value` is a registry model id — provider-qualified, e.g. `anthropic/claude-haiku-4-5`. */
|
|
424
|
+
export function isModelId(value) {
|
|
425
|
+
return Object.hasOwn(MODEL_ROWS, value);
|
|
426
|
+
}
|
|
427
|
+
/** Every registry model id, in registry order (ggui#924: the blueprint record's `model` is one of these). */
|
|
428
|
+
export const MODEL_IDS = Object.keys(MODEL_ROWS).filter(isModelId);
|
|
402
429
|
/**
|
|
403
430
|
* The curated "current lineup" — derived once from the rows' `lineup`
|
|
404
431
|
* fact, in registry order. Pickers render this up front and put the
|
package/dist/types/mcp.d.ts
CHANGED
|
@@ -1,42 +1,21 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
-
import type { DataContract, JsonObject, JsonSchema, JsonValue } from './data-contract';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
export type { GguiSessionStatus } from './render';
|
|
2
|
+
import type { DataContract, JsonObject, JsonSchema, JsonValue } from './data-contract.js';
|
|
3
|
+
import type { DeepReadonly } from './readonly.js';
|
|
4
|
+
import type { consumeInputSchema, getRenderSourceInputSchema, getSessionInputSchema, handshakeInputSchema, handshakeOutputSchema, renderBlueprintInputSchema, renderCacheMarkerSchema, renderErrorSchema, renderInputSchema, renderOutputSchema, resourceReadErrorCodeSchema, resourceReadErrorSchema, runtimePullInputSchema, runtimeTelemetryInputSchema, runtimeTelemetryOutputSchema, searchBlueprintsInputSchema, updateInputSchema, updateOutputSchema, amendInputSchema, amendOutputSchema, declareToolCatalogOutputSchema, gguiGetSessionOutputSchema, gguiSearchBlueprintsOutputSchema, consumeEventEntrySchema, pendingEventSchema, gguiConsumeOutputSchema, gguiEmitOutputSchema, gguiListSessionsOutputSchema } from '../schemas/mcp.js';
|
|
5
|
+
import type { EventsResponse, ReplayHorizonPassedError } from './ggui-session-event.js';
|
|
6
|
+
export type { GguiSessionStatus } from './render.js';
|
|
8
7
|
/** Target screen size category for responsive layout */
|
|
9
8
|
export type Screen = 'mobile' | 'tablet' | 'desktop' | 'universal';
|
|
10
9
|
/**
|
|
11
|
-
*
|
|
10
|
+
* One stored row of the consume pipe — a user action awaiting the agent's
|
|
11
|
+
* `ggui_consume`. Derived from {@link pendingEventSchema} (ggui#839): the
|
|
12
|
+
* shape a producer appends and a store drains, on every store.
|
|
12
13
|
*
|
|
13
|
-
* `envelope` is the canonical {@link ConsumeEventEntry}
|
|
14
|
-
* is the
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* a JSON-stringified object, depending on how the deployment's storage
|
|
19
|
-
* layer serializes rows. Consume readers MUST accept both — see
|
|
20
|
-
* {@link parsePendingEnvelope}.
|
|
21
|
-
*/
|
|
22
|
-
export interface PendingEvent {
|
|
23
|
-
/** Stable row id — UUID assigned at ingestion. */
|
|
24
|
-
id: string;
|
|
25
|
-
/**
|
|
26
|
-
* Canonical {@link ConsumeEventEntry} row payload. JSON object or
|
|
27
|
-
* stringified JSON on the wire (both shapes round-trip through the
|
|
28
|
-
* consume helpers).
|
|
29
|
-
*/
|
|
30
|
-
envelope: ConsumeEventEntry | string;
|
|
31
|
-
/**
|
|
32
|
-
* GguiSession-scoped monotonic sequence assigned at ingestion. Mirrors
|
|
33
|
-
* `GguiSession.eventSequence` at the moment this row was appended so
|
|
34
|
-
* consumers can detect gaps without reading render state.
|
|
35
|
-
*/
|
|
36
|
-
sequence: number;
|
|
37
|
-
/** ISO datetime when the row was appended. */
|
|
38
|
-
createdAt: string;
|
|
39
|
-
}
|
|
14
|
+
* `envelope` is the canonical {@link ConsumeEventEntry} — always the
|
|
15
|
+
* object. `id` is the drain_ack key and the idempotency key per
|
|
16
|
+
* `(sessionId, id)`. `createdAt` is when the row was appended.
|
|
17
|
+
*/
|
|
18
|
+
export type PendingEvent = Readonly<z.infer<typeof pendingEventSchema>>;
|
|
40
19
|
/**
|
|
41
20
|
* Input for ggui_consume tool — long-poll for buffered events on a
|
|
42
21
|
* specific render.
|
|
@@ -107,17 +86,9 @@ export interface GguiEmitInput<TPayload = JsonValue> {
|
|
|
107
86
|
* any subscriber is currently connected is a separate concern and does
|
|
108
87
|
* NOT affect this flag. No-subscriber is not an error.
|
|
109
88
|
*/
|
|
110
|
-
export
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* GguiSession-scoped monotonic outbound sequence assigned to this
|
|
115
|
-
* delivery. Omitted on implementations without a
|
|
116
|
-
* `GguiSessionStreamBuffer` (hosted cloud today); required on OSS
|
|
117
|
-
* `@ggui-ai/mcp-server`.
|
|
118
|
-
*/
|
|
119
|
-
seq?: number;
|
|
120
|
-
}
|
|
89
|
+
export type GguiEmitOutput = DeepReadonly<z.infer<typeof gguiEmitOutputSchema>>;
|
|
90
|
+
/** `ggui_list_sessions`' wire, derived from {@link gguiListSessionsOutputSchema} (ggui#817 part C2). */
|
|
91
|
+
export type GguiListSessionsOutput = DeepReadonly<z.infer<typeof gguiListSessionsOutputSchema>>;
|
|
121
92
|
/**
|
|
122
93
|
* Input for ggui_get_session tool — retrieves render state.
|
|
123
94
|
* Derived from `getSessionInputSchema`.
|
|
@@ -128,7 +99,7 @@ export type GguiGetSessionInput = z.infer<typeof getSessionInputSchema>;
|
|
|
128
99
|
* + the store row's six base fields, plus `contextSnapshot` when the row has
|
|
129
100
|
* one. Nothing else on the row travels (the transport strip-parses to this).
|
|
130
101
|
*/
|
|
131
|
-
export type GguiGetSessionOutput =
|
|
102
|
+
export type GguiGetSessionOutput = DeepReadonly<z.infer<typeof gguiGetSessionOutputSchema>>;
|
|
132
103
|
/**
|
|
133
104
|
* Input for ggui_get_render_source tool — read the generated source of
|
|
134
105
|
* the calling app's own render. Derived from `getRenderSourceInputSchema`.
|
|
@@ -167,32 +138,7 @@ export interface GguiGetRenderSourceOutput {
|
|
|
167
138
|
* seam) — consume reads from a separate render-scoped pipe whose entries
|
|
168
139
|
* originate at `submit_action`.
|
|
169
140
|
*/
|
|
170
|
-
export
|
|
171
|
-
/** Stable discriminator — always the literal `'action'`. */
|
|
172
|
-
readonly type: 'action';
|
|
173
|
-
/** GguiSession the gesture targeted. */
|
|
174
|
-
readonly sessionId: string;
|
|
175
|
-
/** Which `actionSpec[*]` entry the iframe dispatched against. */
|
|
176
|
-
readonly intent: string;
|
|
177
|
-
/**
|
|
178
|
-
* Typed payload satisfying `actionSpec[intent].schema`. `null` for
|
|
179
|
-
* no-payload gestures (bare button click).
|
|
180
|
-
*/
|
|
181
|
-
readonly actionData: JsonValue | null;
|
|
182
|
-
/**
|
|
183
|
-
* Snapshot of the contract's `contextSpec` slot values at the moment
|
|
184
|
-
* the user fired the gesture. Empty object `{}` when the contract
|
|
185
|
-
* has no `contextSpec` or no slots have been mirrored yet.
|
|
186
|
-
*/
|
|
187
|
-
readonly uiContext: JsonObject;
|
|
188
|
-
/**
|
|
189
|
-
* 8-hex FNV-1a correlation id of the gesture — matches the iframe-
|
|
190
|
-
* runtime's outstanding-toast key and the server's `drain_ack` frame.
|
|
191
|
-
*/
|
|
192
|
-
readonly actionId: string;
|
|
193
|
-
/** ISO 8601 UTC timestamp of the gesture (iframe-local clock). */
|
|
194
|
-
readonly firedAt: string;
|
|
195
|
-
}
|
|
141
|
+
export type ConsumeEventEntry = Readonly<z.infer<typeof consumeEventEntrySchema>>;
|
|
196
142
|
/**
|
|
197
143
|
* Output from `ggui_consume` — buffered consume-entries.
|
|
198
144
|
*
|
|
@@ -202,23 +148,7 @@ export interface ConsumeEventEntry {
|
|
|
202
148
|
* single source of truth — both the action and the local UI state are
|
|
203
149
|
* atomic on a single entry.
|
|
204
150
|
*/
|
|
205
|
-
export
|
|
206
|
-
/** Buffered consume-entries (cleared after return). */
|
|
207
|
-
events: ConsumeEventEntry[];
|
|
208
|
-
/** GguiSession status — `'expired'` means the GguiSession's TTL elapsed and
|
|
209
|
-
* no more events will arrive; the agent's long-poll loop terminates. */
|
|
210
|
-
status: GguiSessionStatus;
|
|
211
|
-
/**
|
|
212
|
-
* Client-side observations echoed back to the agent. Same shape
|
|
213
|
-
* `ggui_handshake` exposes. Lets the agent pick up mid-render
|
|
214
|
-
* changes (window resize, fullscreen toggle, etc.) without waiting
|
|
215
|
-
* for the next handshake. Absent ⇒ no client observations yet.
|
|
216
|
-
*
|
|
217
|
-
*/
|
|
218
|
-
client?: {
|
|
219
|
-
readonly hostContext?: import('./host-context.js').HostContextProjection;
|
|
220
|
-
};
|
|
221
|
-
}
|
|
151
|
+
export type GguiConsumeOutput = DeepReadonly<z.infer<typeof gguiConsumeOutputSchema>>;
|
|
222
152
|
/**
|
|
223
153
|
* Input for ggui_search_blueprints tool — semantic search over
|
|
224
154
|
* blueprints. Derived from `searchBlueprintsInputSchema`.
|
|
@@ -330,7 +260,7 @@ export type GguiHandshakeOutput = z.infer<typeof handshakeOutputSchema>;
|
|
|
330
260
|
*
|
|
331
261
|
* Mirrors `handshakeOutputSchema.serverCapabilities` exactly — exported
|
|
332
262
|
* here as a named TypeScript type so server-side composition layers
|
|
333
|
-
* (the OSS `createGguiServer` resolver,
|
|
263
|
+
* (the OSS `createGguiServer` resolver, a hosted deployment's composer) can hand
|
|
334
264
|
* one back to the handshake factory without re-deriving the shape from
|
|
335
265
|
* the schema.
|
|
336
266
|
*
|
|
@@ -372,7 +302,7 @@ export type RenderCacheMarker = z.infer<typeof renderCacheMarkerSchema>;
|
|
|
372
302
|
* Canonical declaration lives beside the schema in `schemas/mcp.ts`;
|
|
373
303
|
* re-exported here so existing importers keep their path.
|
|
374
304
|
*/
|
|
375
|
-
export type { RenderErrorCode } from '../schemas/mcp';
|
|
305
|
+
export type { RenderErrorCode } from '../schemas/mcp.js';
|
|
376
306
|
/**
|
|
377
307
|
* In-result failure marker on `GguiRenderOutput.error` — present iff the
|
|
378
308
|
* tool result is `isError: true`. Derived from {@link renderErrorSchema}.
|
|
@@ -385,7 +315,7 @@ export type RenderError = z.infer<typeof renderErrorSchema>;
|
|
|
385
315
|
* schemas in `schemas/mcp.ts`; re-exported here so importers of the
|
|
386
316
|
* output types find them on the same path.
|
|
387
317
|
*/
|
|
388
|
-
export type { PreGenerationRefusal, RenderOutcome } from '../schemas/mcp';
|
|
318
|
+
export type { PreGenerationRefusal, RenderOutcome } from '../schemas/mcp.js';
|
|
389
319
|
/**
|
|
390
320
|
* Canonical failure code for a `resources/read` on a render locator
|
|
391
321
|
* (SPEC §7.9 Plane 1). Derived from
|
|
@@ -445,8 +375,17 @@ export type GguiRuntimeTelemetryOutput = z.infer<typeof runtimeTelemetryOutputSc
|
|
|
445
375
|
* §7.1; see {@link RenderErrorCode}). The slot stays unassigned so a
|
|
446
376
|
* future canonical code can't silently collide with stale consumers.
|
|
447
377
|
*
|
|
378
|
+
* `-32001` is RETIRED-RESERVED too (ggui#853): `UNAUTHORIZED` lived
|
|
379
|
+
* there until the 0.16.0 wave, but `-32001` is the MCP SDK client's own
|
|
380
|
+
* `RequestTimeout` — minted locally, never sent by a server — so a
|
|
381
|
+
* client reading the number could not tell a server's UNAUTHORIZED
|
|
382
|
+
* from its own timeout, the class ggui#836 closed for `-32000`
|
|
383
|
+
* (`ConnectionClosed`). `UNAUTHORIZED` is `-32007`; the slot stays
|
|
384
|
+
* unassigned. `error-codes-vs-sdk.test.ts` pins that no ggui-chosen
|
|
385
|
+
* code equals a code the SDK's `ErrorCode` enum owns.
|
|
386
|
+
*
|
|
448
387
|
* `-32006` is assigned to `MOUNT_UNAVAILABLE`; new canonical codes come
|
|
449
|
-
* at `-
|
|
388
|
+
* at `-32008` onwards.
|
|
450
389
|
*/
|
|
451
390
|
export declare const MCP_ERROR_CODES: {
|
|
452
391
|
readonly PARSE_ERROR: -32700;
|
|
@@ -454,10 +393,9 @@ export declare const MCP_ERROR_CODES: {
|
|
|
454
393
|
readonly METHOD_NOT_FOUND: -32601;
|
|
455
394
|
readonly INVALID_PARAMS: -32602;
|
|
456
395
|
readonly INTERNAL_ERROR: -32603;
|
|
457
|
-
readonly UNAUTHORIZED: -
|
|
396
|
+
readonly UNAUTHORIZED: -32007;
|
|
458
397
|
readonly SESSION_NOT_FOUND: -32002;
|
|
459
398
|
readonly APP_NOT_FOUND: -32003;
|
|
460
|
-
readonly CAPABILITY_DENIED: -32005;
|
|
461
399
|
/**
|
|
462
400
|
* A `resources/read` identified the resource but cannot return a
|
|
463
401
|
* mount for it — the component behind it is gone, the server keeps no
|
|
@@ -477,12 +415,23 @@ export declare const MCP_ERROR_CODES: {
|
|
|
477
415
|
/**
|
|
478
416
|
* Platform-specific error codes (-32010 range).
|
|
479
417
|
* These are ggui platform extensions, not part of the core protocol.
|
|
418
|
+
* `-32010`..`-32013` and `-32020` are retired-reserved (SPEC §7.9,
|
|
419
|
+
* ggui#910 / ggui#890): declared once, emitted by nothing first-party —
|
|
420
|
+
* quota, app-limit and concurrency states are refusals or
|
|
421
|
+
* implementation-range codes, and a contract violation is the Plane-2
|
|
422
|
+
* `contract_violation` result or the live channel's `CONTRACT_VIOLATION`
|
|
423
|
+
* frame code, never a JSON-RPC number.
|
|
480
424
|
*/
|
|
481
425
|
export declare const PLATFORM_ERROR_CODES: {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
426
|
+
/**
|
|
427
|
+
* The generation queue is saturated — the server, not the caller, is
|
|
428
|
+
* the limit (contrast a caller-side rate cap, which is a render-gate
|
|
429
|
+
* REFUSAL — `app_rate_limited` / `issuer_rate_limited`, SPEC §7.1 — the
|
|
430
|
+
* caller slows down; its former numeric `-32013` is retired-reserved,
|
|
431
|
+
* SPEC §7.9, ggui#890). HTTP
|
|
432
|
+
* 503 with `Retry-After`, which governs the retry; a parsed request's
|
|
433
|
+
* refusal, so it speaks this table (ggui#836 follow-up).
|
|
434
|
+
*/
|
|
435
|
+
readonly GENERATION_OVERLOADED: -32014;
|
|
487
436
|
};
|
|
488
437
|
//# sourceMappingURL=mcp.d.ts.map
|
package/dist/types/mcp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/types/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/types/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KA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