@ggui-ai/protocol 0.12.0 → 0.14.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/gadgets/stdlib-gadgets.d.ts +1 -1
- package/dist/gadgets/stdlib-gadgets.js +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/integrations/mcp-apps.d.ts +63 -11
- package/dist/integrations/mcp-apps.d.ts.map +1 -1
- package/dist/integrations/mcp-apps.js +73 -3
- package/dist/schemas/app-theme.d.ts +5 -0
- package/dist/schemas/app-theme.d.ts.map +1 -1
- package/dist/schemas/app-theme.js +23 -0
- package/dist/schemas/data-contract.d.ts +3 -1
- package/dist/schemas/data-contract.d.ts.map +1 -1
- package/dist/schemas/data-contract.js +2 -0
- package/dist/schemas/invoke.d.ts +2 -2
- package/dist/schemas/mcp.d.ts +482 -24
- package/dist/schemas/mcp.d.ts.map +1 -1
- package/dist/schemas/mcp.js +455 -26
- package/dist/schemas/render-input-envelope.d.ts +20 -0
- package/dist/schemas/render-input-envelope.d.ts.map +1 -0
- package/dist/schemas/render-input-envelope.js +56 -0
- package/dist/types/ggui-session-event.d.ts +4 -5
- package/dist/types/ggui-session-event.d.ts.map +1 -1
- package/dist/types/ggui-session-event.js +0 -37
- package/dist/types/host-context.d.ts +17 -16
- package/dist/types/host-context.d.ts.map +1 -1
- package/dist/types/host-context.js +7 -0
- package/dist/types/llm-route.d.ts +2 -2
- package/dist/types/llm-route.d.ts.map +1 -1
- package/dist/types/llm-route.js +11 -3
- package/dist/types/llm.d.ts +397 -7
- package/dist/types/llm.d.ts.map +1 -1
- package/dist/types/llm.js +111 -10
- package/dist/types/mcp.d.ts +16 -53
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/types/readonly.d.ts +11 -0
- package/dist/types/readonly.d.ts.map +1 -0
- package/dist/types/readonly.js +1 -0
- package/dist/types/refusal-codes.d.ts +319 -0
- package/dist/types/refusal-codes.d.ts.map +1 -0
- package/dist/types/refusal-codes.js +329 -0
- package/dist/version.d.ts +79 -5
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +78 -4
- package/package.json +7 -3
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { parseAnyLlmRoute } from '../types/llm-route.js';
|
|
3
|
+
import { renderInputShape } from './mcp.js';
|
|
4
|
+
/**
|
|
5
|
+
* The render input ENVELOPE — the registered shape plus the route grammar
|
|
6
|
+
* (ggui#818): `infra.model`, when present, MUST parse as a model route in
|
|
7
|
+
* either wire form (canonical `provider:model` or LiteLLM `provider/model`;
|
|
8
|
+
* aliases resolve in both). The render handler parses this BEFORE its
|
|
9
|
+
* pre-generation gate, so a malformed route is a contract error at zod path
|
|
10
|
+
* `infra.model` — never a policy refusal (`model_not_in_tier` is reserved
|
|
11
|
+
* for a well-formed route with no rate row on the effective tier).
|
|
12
|
+
*
|
|
13
|
+
* Kept OUT of the registered shape on purpose: `@ggui-ai/iframe-runtime`
|
|
14
|
+
* bundles `@ggui-ai/protocol` for the browser and never validates a render
|
|
15
|
+
* input, so the route tables must not ride that bundle. The builder call is
|
|
16
|
+
* `@__PURE__` so an importer that never uses the envelope drops it — and the
|
|
17
|
+
* parser with it (the bundle-size gate is the receipt).
|
|
18
|
+
*/
|
|
19
|
+
function buildRenderInputEnvelope() {
|
|
20
|
+
return z.object(renderInputShape).superRefine((value, ctx) => {
|
|
21
|
+
const model = value.infra?.model;
|
|
22
|
+
if (model !== undefined && parseAnyLlmRoute(model) === null) {
|
|
23
|
+
ctx.addIssue({
|
|
24
|
+
code: 'custom',
|
|
25
|
+
path: ['infra', 'model'],
|
|
26
|
+
message: 'infra.model must be a model route: canonical `provider:model` or LiteLLM `provider/model` (aliases resolve in both). Bare model ids are not accepted.',
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export const renderInputEnvelopeSchema = /* @__PURE__ */ buildRenderInputEnvelope();
|
|
32
|
+
const ROUTE_MESSAGE = 'infra.model must be a model route: canonical `provider:model` or LiteLLM `provider/model` (aliases resolve in both). Bare model ids are not accepted.';
|
|
33
|
+
/**
|
|
34
|
+
* The pre-gate ROUTE GUARD — the route grammar and nothing else. The render
|
|
35
|
+
* handler parses this before its pre-generation gate so a malformed
|
|
36
|
+
* `infra.model` never reaches the gate, while a syntactically empty input
|
|
37
|
+
* still does: #786 pins that a gate's refusal is projected BEFORE the
|
|
38
|
+
* handler's own parse, so the guard MUST NOT require `handshakeId`/`props`
|
|
39
|
+
* or reject unknown keys — the full envelope does that after the gate.
|
|
40
|
+
*/
|
|
41
|
+
function buildRenderInputRouteGuard() {
|
|
42
|
+
return z
|
|
43
|
+
.object({
|
|
44
|
+
infra: z
|
|
45
|
+
.object({
|
|
46
|
+
model: z
|
|
47
|
+
.string()
|
|
48
|
+
.refine((s) => parseAnyLlmRoute(s) !== null, { message: ROUTE_MESSAGE })
|
|
49
|
+
.optional(),
|
|
50
|
+
})
|
|
51
|
+
.passthrough()
|
|
52
|
+
.optional(),
|
|
53
|
+
})
|
|
54
|
+
.passthrough();
|
|
55
|
+
}
|
|
56
|
+
export const renderInputRouteGuardSchema = /* @__PURE__ */ buildRenderInputRouteGuard();
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { runtimePullEventsPageSchema } from '../schemas/mcp';
|
|
3
|
+
import type { DeepReadonly } from './readonly';
|
|
1
4
|
/**
|
|
2
5
|
* GguiSessionEvent ledger — wire-frame replay primitives (R7).
|
|
3
6
|
*
|
|
@@ -139,11 +142,7 @@ export declare function deriveEpochFromEvents(events: ReadonlyArray<Pick<GguiSes
|
|
|
139
142
|
*
|
|
140
143
|
* @public
|
|
141
144
|
*/
|
|
142
|
-
export
|
|
143
|
-
readonly events: ReadonlyArray<GguiSessionEvent>;
|
|
144
|
-
readonly lastSequence: number;
|
|
145
|
-
readonly hasMore: boolean;
|
|
146
|
-
}
|
|
145
|
+
export type EventsResponse = DeepReadonly<z.infer<typeof runtimePullEventsPageSchema>>;
|
|
147
146
|
/**
|
|
148
147
|
* 410 Gone response body — `sinceSequence` predates the server's
|
|
149
148
|
* replay horizon (events evicted from the bounded ring buffer or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ggui-session-event.d.ts","sourceRoot":"","sources":["../../src/types/ggui-session-event.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gBAAgB,CAAC,KAAK,GAAG,OAAO;IAC/C;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;CACtB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,oBAAoB,GAC5B,YAAY,GACZ,YAAY,GACZ,cAAc,GACd,aAAa,GACb,aAAa,GACb,aAAa,GACb,gBAAgB,CAAC;AAErB;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,qEAAqE;IACrE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,gBAAgB,EAAE,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,aAAa,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,GACpD,MAAM,CAMR;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,cAAc,GAAG,YAAY,CACvC,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAC5C,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;IACzC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC"}
|
|
@@ -1,40 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GguiSessionEvent ledger — wire-frame replay primitives (R7).
|
|
3
|
-
*
|
|
4
|
-
* Core protocol-layer types backing the unified cursor-replay model.
|
|
5
|
-
* The same ledger is read by:
|
|
6
|
-
*
|
|
7
|
-
* - `GET /api/sessions/:sessionId/events?sinceSequence=N&limit=M` —
|
|
8
|
-
* HTTP cursor-replay endpoint; polling clients walk it on a
|
|
9
|
-
* 2s tick.
|
|
10
|
-
* - WS `subscribe` with `SubscribePayload.sinceSequence` — server
|
|
11
|
-
* replays events with `seq > sinceSequence` as `render_event`
|
|
12
|
-
* wire frames BEFORE entering live-stream mode.
|
|
13
|
-
*
|
|
14
|
-
* Two transports, same cursor — switching transports does not lose
|
|
15
|
-
* events.
|
|
16
|
-
*
|
|
17
|
-
* # Why this is core (not an integration)
|
|
18
|
-
*
|
|
19
|
-
* GguiSessionEvent is the wire-frame ledger shape — the structural unit
|
|
20
|
-
* the live-channel transport replays. It sits at the same layer as
|
|
21
|
-
* other transport-level types (`StreamEnvelope`, `AckPayload`). It is
|
|
22
|
-
* NOT an MCP-Apps-integration-specific concept — it's the protocol's
|
|
23
|
-
* primary durable cursor primitive, equally consumed by the
|
|
24
|
-
* `@ggui-ai/iframe-runtime` polling layer and any non-MCP-Apps host.
|
|
25
|
-
*
|
|
26
|
-
* # Source of truth
|
|
27
|
-
*
|
|
28
|
-
* This is the canonical definition. The server-side `GguiSessionStore`
|
|
29
|
-
* seam in `@ggui-ai/mcp-server-core` re-exports these types so
|
|
30
|
-
* implementors (in-memory, sqlite, dynamo) all bind to the same
|
|
31
|
-
* shape. Wave 7 (flatten-render-identity, 2026-05-28): merged the
|
|
32
|
-
* earlier protocol-side `SessionEvent` (sequence + emittedAt + type +
|
|
33
|
-
* payload) into the server-side GguiSessionEvent shape (seq + timestamp +
|
|
34
|
-
* type + data); one ledger primitive everywhere. `timestamp` carries
|
|
35
|
-
* an ISO 8601 UTC string for cross-layer uniformity (was epoch-ms on
|
|
36
|
-
* the server side).
|
|
37
|
-
*/
|
|
38
1
|
/**
|
|
39
2
|
* Head epoch implied by an event list: the count of `'ui.reminted'`
|
|
40
3
|
* events. `ggui_render` mints epoch 0 with NO event, so an empty (or
|
|
@@ -43,6 +43,22 @@
|
|
|
43
43
|
import type { JsonValue } from './data-contract';
|
|
44
44
|
export type { McpUiDisplayMode, McpUiHostContext, McpUiHostCapabilities, } from '@modelcontextprotocol/ext-apps';
|
|
45
45
|
import type { McpUiDisplayMode } from '@modelcontextprotocol/ext-apps';
|
|
46
|
+
import type { z } from 'zod';
|
|
47
|
+
import type { hostContextProjectionSchema, mcpUiDisplayModeSchema } from '../schemas/mcp';
|
|
48
|
+
import type { DeepReadonly } from './readonly';
|
|
49
|
+
/**
|
|
50
|
+
* The wire enum is assignable to ext-apps' `McpUiDisplayMode` — checked at
|
|
51
|
+
* compile time, so a display mode the host SDK adds is a protocol change
|
|
52
|
+
* here, never a silent widening.
|
|
53
|
+
*/
|
|
54
|
+
export type HostContextDisplayModeIsExtApps = z.infer<typeof mcpUiDisplayModeSchema> extends McpUiDisplayMode ? true : never;
|
|
55
|
+
/**
|
|
56
|
+
* Forces the check above to be EVALUATED: a conditional type nobody consumes
|
|
57
|
+
* is never checked, but a value annotated with it is — if the wire enum ever
|
|
58
|
+
* drifts from ext-apps' `McpUiDisplayMode`, `true` stops being assignable to
|
|
59
|
+
* `never` and this line is the compile error.
|
|
60
|
+
*/
|
|
61
|
+
export declare const HOST_CONTEXT_DISPLAY_MODE_IS_EXT_APPS: HostContextDisplayModeIsExtApps;
|
|
46
62
|
/**
|
|
47
63
|
* Width specification — either fixed `width` or `maxWidth`, never both.
|
|
48
64
|
* Matches the spec's discriminated container-dimension shape.
|
|
@@ -87,22 +103,7 @@ export interface HostContextDeviceCapabilities {
|
|
|
87
103
|
* `userAgent` + `toolInfo` intentionally EXCLUDED for v1 — easy to add
|
|
88
104
|
* later if a concrete use case appears.
|
|
89
105
|
*/
|
|
90
|
-
export
|
|
91
|
-
/** Display modes the host can render this view in. Absent ⇒ assume `['inline']`. */
|
|
92
|
-
readonly availableDisplayModes?: readonly McpUiDisplayMode[];
|
|
93
|
-
/** Current display mode the host is rendering. Absent ⇒ assume `'inline'`. */
|
|
94
|
-
readonly currentDisplayMode?: McpUiDisplayMode;
|
|
95
|
-
/** Iframe container dimensions. Absent ⇒ unknown; use a reasonable default. */
|
|
96
|
-
readonly containerDimensions?: HostContextContainerDimensions;
|
|
97
|
-
/** Host platform classification. */
|
|
98
|
-
readonly platform?: 'web' | 'desktop' | 'mobile';
|
|
99
|
-
/** Touch / hover input capability. */
|
|
100
|
-
readonly deviceCapabilities?: HostContextDeviceCapabilities;
|
|
101
|
-
/** User's BCP-47 locale (e.g., `'en-US'`). */
|
|
102
|
-
readonly locale?: string;
|
|
103
|
-
/** User's IANA timezone (e.g., `'America/Los_Angeles'`). */
|
|
104
|
-
readonly timeZone?: string;
|
|
105
|
-
}
|
|
106
|
+
export type HostContextProjection = DeepReadonly<z.infer<typeof hostContextProjectionSchema>>;
|
|
106
107
|
/**
|
|
107
108
|
* Live-channel inbound (client → server) payload that delivers the
|
|
108
109
|
* iframe-captured `HostContextProjection` to the server. Server-side
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-context.d.ts","sourceRoot":"","sources":["../../src/types/host-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;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,EAAE,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,MAAM,8BAA8B,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;AAMlF;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAMD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAC9C,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAC5C,CAAC;AAMF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAC;CAC7C;AAoBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,qBAAqB,GAAG,SAAS,CAsDlF;AAED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,CAAC,EAAE,qBAAqB,GAAG,SAAS,EACpC,CAAC,EAAE,qBAAqB,GAAG,SAAS,GACnC,OAAO,CAIT;AAGD,YAAY,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -40,6 +40,13 @@
|
|
|
40
40
|
* projection widenings can be detected; this module is the canonical
|
|
41
41
|
* shape for the current schema major.
|
|
42
42
|
*/
|
|
43
|
+
/**
|
|
44
|
+
* Forces the check above to be EVALUATED: a conditional type nobody consumes
|
|
45
|
+
* is never checked, but a value annotated with it is — if the wire enum ever
|
|
46
|
+
* drifts from ext-apps' `McpUiDisplayMode`, `true` stops being assignable to
|
|
47
|
+
* `never` and this line is the compile error.
|
|
48
|
+
*/
|
|
49
|
+
export const HOST_CONTEXT_DISPLAY_MODE_IS_EXT_APPS = true;
|
|
43
50
|
// =============================================================================
|
|
44
51
|
// Projection helper
|
|
45
52
|
// =============================================================================
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
* ready.
|
|
52
52
|
*/
|
|
53
53
|
export declare const MODELS: {
|
|
54
|
-
readonly anthropic: readonly ["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"];
|
|
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
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"];
|
|
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
|
-
readonly bedrock: readonly ["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"];
|
|
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"];
|
|
59
59
|
};
|
|
60
60
|
/**
|
|
@@ -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,M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mB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAMtD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CASxE;AAiBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAEzD;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAajE;AA8CD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAgB7D;AAuBD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAKvD;AAmBD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAE3D"}
|
package/dist/types/llm-route.js
CHANGED
|
@@ -58,8 +58,9 @@ export const MODELS = {
|
|
|
58
58
|
// Wire-canonical IDs accepted by api.anthropic.com/v1/messages.
|
|
59
59
|
// Per Anthropic's official models doc (claude.com/docs/about-claude/models/overview):
|
|
60
60
|
// the Claude 5 family (2026-07: Opus 5, Sonnet 5, and the
|
|
61
|
-
// Mythos-class Fable 5) and the 4.6–4.8 generation carry undated
|
|
61
|
+
// Mythos-class Fable 5; 2026-09: Fable 5.1) and the 4.6–4.8 generation carry undated
|
|
62
62
|
// wire IDs; Haiku 4.5 still uses the dated form.
|
|
63
|
+
'claude-fable-5-1', // 2026-09 (ggui#706); dateless like the rest of the 5 family
|
|
63
64
|
'claude-fable-5',
|
|
64
65
|
'claude-opus-5',
|
|
65
66
|
'claude-sonnet-5',
|
|
@@ -129,6 +130,7 @@ export const MODELS = {
|
|
|
129
130
|
// have enabled Claude in Amazon Bedrock; otherwise every id
|
|
130
131
|
// 403s "not available for this account".
|
|
131
132
|
// Messages-API endpoint (Mantle) — Claude 5 family + Opus 4.8
|
|
133
|
+
'anthropic.claude-fable-5-1', // ggui#706: Bedrock id for Fable 5.1
|
|
132
134
|
'anthropic.claude-fable-5',
|
|
133
135
|
'anthropic.claude-opus-5',
|
|
134
136
|
'anthropic.claude-sonnet-5',
|
|
@@ -321,9 +323,15 @@ export function parseLlmRoute(serialized) {
|
|
|
321
323
|
const model = serialized.substring(sep + 1);
|
|
322
324
|
if (model.length === 0)
|
|
323
325
|
return null;
|
|
324
|
-
if (!
|
|
326
|
+
if (!isLlmProvider(provider))
|
|
327
|
+
return null;
|
|
328
|
+
// One model-id vocabulary, two separators: the LiteLLM aliases resolve
|
|
329
|
+
// here exactly as in `parseLiteLlmString`, so `anthropic:claude-haiku-4-5`
|
|
330
|
+
// and `anthropic/claude-haiku-4-5` are the same route (#818 origin).
|
|
331
|
+
const mapped = LITELLM_TO_WIRE[provider]?.[model] ?? model;
|
|
332
|
+
if (!isValidLlmRoute(provider, mapped))
|
|
325
333
|
return null;
|
|
326
|
-
return { provider, model };
|
|
334
|
+
return { provider, model: mapped };
|
|
327
335
|
}
|
|
328
336
|
// ============================================================================
|
|
329
337
|
// LiteLLM back-compat parser/serializer
|