@ggui-ai/protocol 0.13.0 → 0.15.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.
Files changed (85) hide show
  1. package/dist/envelope-adapters.d.ts +1 -14
  2. package/dist/envelope-adapters.d.ts.map +1 -1
  3. package/dist/envelope-adapters.js +17 -1
  4. package/dist/envelopes/render-refusal.d.ts +49 -0
  5. package/dist/envelopes/render-refusal.d.ts.map +1 -0
  6. package/dist/envelopes/render-refusal.js +12 -0
  7. package/dist/gadgets/resolve-app-gadgets.d.ts +1 -1
  8. package/dist/gadgets/stdlib-gadgets.d.ts +2 -2
  9. package/dist/gadgets/stdlib-gadgets.js +1 -1
  10. package/dist/index.d.ts +67 -60
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +10 -0
  13. package/dist/integrations/mcp-apps.d.ts +4 -10
  14. package/dist/integrations/mcp-apps.d.ts.map +1 -1
  15. package/dist/schemas/app-theme.d.ts +5 -0
  16. package/dist/schemas/app-theme.d.ts.map +1 -1
  17. package/dist/schemas/app-theme.js +23 -0
  18. package/dist/schemas/blueprint.d.ts +2 -2
  19. package/dist/schemas/data-contract.d.ts +12 -30
  20. package/dist/schemas/data-contract.d.ts.map +1 -1
  21. package/dist/schemas/data-contract.js +6 -27
  22. package/dist/schemas/interface-context.d.ts +44 -0
  23. package/dist/schemas/interface-context.d.ts.map +1 -0
  24. package/dist/schemas/interface-context.js +22 -0
  25. package/dist/schemas/invoke.d.ts +1 -1
  26. package/dist/schemas/invoke.js +1 -1
  27. package/dist/schemas/mcp.d.ts +636 -69
  28. package/dist/schemas/mcp.d.ts.map +1 -1
  29. package/dist/schemas/mcp.js +554 -47
  30. package/dist/schemas/public-env-key.d.ts +26 -0
  31. package/dist/schemas/public-env-key.d.ts.map +1 -0
  32. package/dist/schemas/public-env-key.js +25 -0
  33. package/dist/schemas/render-input-envelope.d.ts +20 -0
  34. package/dist/schemas/render-input-envelope.d.ts.map +1 -0
  35. package/dist/schemas/render-input-envelope.js +56 -0
  36. package/dist/schemas/runtime-telemetry-limits.d.ts +11 -0
  37. package/dist/schemas/runtime-telemetry-limits.d.ts.map +1 -0
  38. package/dist/schemas/runtime-telemetry-limits.js +10 -0
  39. package/dist/transport/websocket.d.ts +5 -5
  40. package/dist/types/auth.d.ts +1 -1
  41. package/dist/types/contract-inference.d.ts +1 -1
  42. package/dist/types/events.d.ts +1 -1
  43. package/dist/types/ggui-session-event.d.ts +4 -5
  44. package/dist/types/ggui-session-event.d.ts.map +1 -1
  45. package/dist/types/ggui-session-event.js +0 -37
  46. package/dist/types/host-context.d.ts +18 -17
  47. package/dist/types/host-context.d.ts.map +1 -1
  48. package/dist/types/host-context.js +7 -0
  49. package/dist/types/interface-context.d.ts +1 -1
  50. package/dist/types/invoke.d.ts +1 -1
  51. package/dist/types/lifecycle.d.ts +1 -1
  52. package/dist/types/live-channel.d.ts +2 -2
  53. package/dist/types/llm-route.d.ts +2 -2
  54. package/dist/types/llm-route.d.ts.map +1 -1
  55. package/dist/types/llm-route.js +11 -3
  56. package/dist/types/llm.d.ts +397 -7
  57. package/dist/types/llm.d.ts.map +1 -1
  58. package/dist/types/llm.js +111 -10
  59. package/dist/types/mcp.d.ts +31 -111
  60. package/dist/types/mcp.d.ts.map +1 -1
  61. package/dist/types/mcp.js +7 -0
  62. package/dist/types/readonly.d.ts +11 -0
  63. package/dist/types/readonly.d.ts.map +1 -0
  64. package/dist/types/readonly.js +1 -0
  65. package/dist/types/refusal-codes.d.ts +340 -0
  66. package/dist/types/refusal-codes.d.ts.map +1 -0
  67. package/dist/types/refusal-codes.js +346 -0
  68. package/dist/types/render.d.ts +9 -8
  69. package/dist/types/render.d.ts.map +1 -1
  70. package/dist/types/ui-generator.d.ts +1 -1
  71. package/dist/validation/ajv-runtime.d.ts +2 -2
  72. package/dist/validation/contract-validator.d.ts +6 -6
  73. package/dist/validation/cross-references.d.ts +2 -2
  74. package/dist/validation/hygiene-rules.d.ts +1 -1
  75. package/dist/validation/name-invariants.d.ts +2 -2
  76. package/dist/validation/reserved-channels.d.ts +1 -1
  77. package/dist/validation/schema-compat-invariants.d.ts +2 -2
  78. package/dist/validation/schema-meta-validation.d.ts +1 -1
  79. package/dist/version.d.ts +201 -5
  80. package/dist/version.d.ts.map +1 -1
  81. package/dist/version.js +200 -4
  82. package/dist/wire.d.ts +45 -0
  83. package/dist/wire.d.ts.map +1 -0
  84. package/dist/wire.js +44 -0
  85. package/package.json +13 -3
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The `GGUI_PUBLIC_APP_*` key grammar — its own module (ggui#819) so the
3
+ * browser entry can carry the regex without the contract schema that
4
+ * embeds it.
5
+ */
6
+ /**
7
+ * `App.publicEnv` key regex.
8
+ *
9
+ * Each key in `App.publicEnv` MUST match this pattern. The prefix is
10
+ * the **security boundary** — operators can't accidentally stash
11
+ * sensitive credentials under arbitrary names, and downstream consumers
12
+ * (render gate, bootstrap projection, iframe shim) can rely on the
13
+ * naming convention to mean "public-by-design".
14
+ *
15
+ * Rule: `GGUI_PUBLIC_APP_` prefix, then uppercase letters / digits /
16
+ * underscores, at least one char after the prefix.
17
+ *
18
+ * `GGUI_PUBLIC_USER_*` keys are RESERVED for a future per-user
19
+ * channel. The current regex rejects them so App-side config can't
20
+ * pre-emptively use the namespace.
21
+ *
22
+ * Hoisted above `gadgetDescriptorSchema` so the wrapper's `requires`
23
+ * array can reference it at schema-construction time (TDZ-safe).
24
+ */
25
+ export declare const PUBLIC_ENV_APP_KEY_RE: RegExp;
26
+ //# sourceMappingURL=public-env-key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-env-key.d.ts","sourceRoot":"","sources":["../../src/schemas/public-env-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,qBAAqB,QAAiC,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The `GGUI_PUBLIC_APP_*` key grammar — its own module (ggui#819) so the
3
+ * browser entry can carry the regex without the contract schema that
4
+ * embeds it.
5
+ */
6
+ /**
7
+ * `App.publicEnv` key regex.
8
+ *
9
+ * Each key in `App.publicEnv` MUST match this pattern. The prefix is
10
+ * the **security boundary** — operators can't accidentally stash
11
+ * sensitive credentials under arbitrary names, and downstream consumers
12
+ * (render gate, bootstrap projection, iframe shim) can rely on the
13
+ * naming convention to mean "public-by-design".
14
+ *
15
+ * Rule: `GGUI_PUBLIC_APP_` prefix, then uppercase letters / digits /
16
+ * underscores, at least one char after the prefix.
17
+ *
18
+ * `GGUI_PUBLIC_USER_*` keys are RESERVED for a future per-user
19
+ * channel. The current regex rejects them so App-side config can't
20
+ * pre-emptively use the namespace.
21
+ *
22
+ * Hoisted above `gadgetDescriptorSchema` so the wrapper's `requires`
23
+ * array can reference it at schema-construction time (TDZ-safe).
24
+ */
25
+ export const PUBLIC_ENV_APP_KEY_RE = /^GGUI_PUBLIC_APP_[A-Z0-9_]+$/;
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ export declare const renderInputEnvelopeSchema: z.ZodObject<{
3
+ handshakeId: z.ZodString;
4
+ props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
5
+ themeId: z.ZodOptional<z.ZodString>;
6
+ infra: z.ZodOptional<z.ZodObject<{
7
+ model: z.ZodOptional<z.ZodString>;
8
+ }, z.core.$strict>>;
9
+ override: z.ZodOptional<z.ZodObject<{
10
+ contract: z.ZodOptional<z.ZodType<import("../index.js").DataContract, unknown, z.core.$ZodTypeInternals<import("../index.js").DataContract, unknown>>>;
11
+ variance: z.ZodOptional<z.ZodType<import("../index.js").BlueprintVariance, unknown, z.core.$ZodTypeInternals<import("../index.js").BlueprintVariance, unknown>>>;
12
+ }, z.core.$strict>>;
13
+ }, z.core.$strip>;
14
+ export declare const renderInputRouteGuardSchema: z.ZodObject<{
15
+ infra: z.ZodOptional<z.ZodObject<{
16
+ model: z.ZodOptional<z.ZodString>;
17
+ }, z.core.$loose>>;
18
+ }, z.core.$loose>;
19
+ export type RenderInputEnvelope = z.infer<typeof renderInputEnvelopeSchema>;
20
+ //# sourceMappingURL=render-input-envelope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-input-envelope.d.ts","sourceRoot":"","sources":["../../src/schemas/render-input-envelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiCxB,eAAO,MAAM,yBAAyB;;;;;;;;;;;iBAA6C,CAAC;AA6BpF,eAAO,MAAM,2BAA2B;;;;iBAA+C,CAAC;AAExF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -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();
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Bounds the browser runtime shares with the server — its own module
3
+ * (ggui#819) so `@ggui-ai/protocol/wire` carries the number, not the tool
4
+ * schemas that enforce it.
5
+ */
6
+ /**
7
+ * Per-batch event cap on `ggui_runtime_telemetry` — a bounded
8
+ * fire-and-forget diagnostic channel, never a data plane.
9
+ */
10
+ export declare const RUNTIME_TELEMETRY_MAX_EVENTS = 40;
11
+ //# sourceMappingURL=runtime-telemetry-limits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-telemetry-limits.d.ts","sourceRoot":"","sources":["../../src/schemas/runtime-telemetry-limits.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;;GAGG;AACH,eAAO,MAAM,4BAA4B,KAAK,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Bounds the browser runtime shares with the server — its own module
3
+ * (ggui#819) so `@ggui-ai/protocol/wire` carries the number, not the tool
4
+ * schemas that enforce it.
5
+ */
6
+ /**
7
+ * Per-batch event cap on `ggui_runtime_telemetry` — a bounded
8
+ * fire-and-forget diagnostic channel, never a data plane.
9
+ */
10
+ export const RUNTIME_TELEMETRY_MAX_EVENTS = 40;
@@ -20,11 +20,11 @@
20
20
  * pay its type/build cost. Consumers that only need contract payloads
21
21
  * stay on the root import.
22
22
  */
23
- import type { ActionEnvelope } from '../types/events';
24
- import type { JsonObject } from '../types/data-contract';
25
- import type { SubscribePayload, AckPayload, ErrorPayload, RenderPayload, StreamEnvelope, PropsUpdatePayload, ChannelSubscribePayload, ChannelUnsubscribePayload, ChannelPayloadFrame, ChannelErrorPayload, DrainAckPayload } from '../types/live-channel';
26
- import type { HostContextObservedPayload } from '../types/host-context';
27
- import type { GguiSessionEvent } from '../types/ggui-session-event';
23
+ import type { ActionEnvelope } from '../types/events.js';
24
+ import type { JsonObject } from '../types/data-contract.js';
25
+ import type { SubscribePayload, AckPayload, ErrorPayload, RenderPayload, StreamEnvelope, PropsUpdatePayload, ChannelSubscribePayload, ChannelUnsubscribePayload, ChannelPayloadFrame, ChannelErrorPayload, DrainAckPayload } from '../types/live-channel.js';
26
+ import type { HostContextObservedPayload } from '../types/host-context.js';
27
+ import type { GguiSessionEvent } from '../types/ggui-session-event.js';
28
28
  /**
29
29
  * WebSocket message types for client-server communication.
30
30
  * Each type maps to a specific payload shape in the {@link WebSocketMessage} discriminated union.
@@ -1,4 +1,4 @@
1
- import type { JsonObject } from './data-contract';
1
+ import type { JsonObject } from './data-contract.js';
2
2
  /**
3
3
  * Authenticated end-user identity.
4
4
  * Attached to renders and included in events consumed by agents.
@@ -1,4 +1,4 @@
1
- import type { DataContract, JsonObject, JsonSchemaTypeName, JsonValue } from './data-contract';
1
+ import type { DataContract, JsonObject, JsonSchemaTypeName, JsonValue } from './data-contract.js';
2
2
  /**
3
3
  * Extract the JSON Schema `required` array from a schema literal as a
4
4
  * string union. Resolves to `never` when `required` is absent, empty,
@@ -1,4 +1,4 @@
1
- import type { JsonValue } from './data-contract';
1
+ import type { JsonValue } from './data-contract.js';
2
2
  /**
3
3
  * Event type that flows from user to agent.
4
4
  *
@@ -1,3 +1,6 @@
1
+ import type { z } from 'zod';
2
+ import type { runtimePullEventsPageSchema } from '../schemas/mcp.js';
3
+ import type { DeepReadonly } from './readonly.js';
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 interface EventsResponse {
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,aAA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AGG;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,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
@@ -40,9 +40,25 @@
40
40
  * projection widenings can be detected; this module is the canonical
41
41
  * shape for the current schema major.
42
42
  */
43
- import type { JsonValue } from './data-contract';
43
+ import type { JsonValue } from './data-contract.js';
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.js';
48
+ import type { DeepReadonly } from './readonly.js';
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 interface HostContextProjection {
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAkBjD,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAMvE;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,CAAC,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,WAAW,qBAAqB;IACpC,oFAAoF;IACpF,QAAQ,CAAC,qBAAqB,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC7D,8EAA8E;IAC9E,QAAQ,CAAC,kBAAkB,CAAC,EAAE,gBAAgB,CAAC;IAC/C,+EAA+E;IAC/E,QAAQ,CAAC,mBAAmB,CAAC,EAAE,8BAA8B,CAAC;IAC9D,oCAAoC;IACpC,QAAQ,CAAC,QAAQ,CAAC,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,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
  // =============================================================================
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Allows Claude to generate UIs adapted to the user's device/viewport.
8
8
  */
9
- import type { JsonObject } from './data-contract';
9
+ import type { JsonObject } from './data-contract.js';
10
10
  export type PlatformType = 'web' | 'mobile' | 'desktop';
11
11
  export type DeviceType = 'phone' | 'tablet' | 'desktop';
12
12
  export type Orientation = 'portrait' | 'landscape';
@@ -5,7 +5,7 @@
5
5
  * of truth. Do not hand-author parallel types here.
6
6
  */
7
7
  import type { z } from 'zod';
8
- import type { textBlockSchema, toolUseBlockSchema, toolResultBlockSchema, contentBlockSchema, invokeEventSchema, invokeErrorCodeSchema, invokeTurnSchema } from '../schemas/invoke';
8
+ import type { textBlockSchema, toolUseBlockSchema, toolResultBlockSchema, contentBlockSchema, invokeEventSchema, invokeErrorCodeSchema, invokeTurnSchema } from '../schemas/invoke.js';
9
9
  export type TextBlock = z.infer<typeof textBlockSchema>;
10
10
  export type ToolUseBlock = z.infer<typeof toolUseBlockSchema>;
11
11
  export type ToolResultBlock = z.infer<typeof toolResultBlockSchema>;
@@ -33,7 +33,7 @@
33
33
  * - This module is `data` only — no functions, no reducers. Pure
34
34
  * types so the protocol bundle stays tiny.
35
35
  */
36
- import type { JsonObject } from './data-contract';
36
+ import type { JsonObject } from './data-contract.js';
37
37
  /**
38
38
  * Emitted when the server starts processing a `ggui_handshake` call.
39
39
  * Progress UIs transition from their current state into a
@@ -15,8 +15,8 @@
15
15
  * The corresponding inbound user-action envelope ({@link ActionEnvelope})
16
16
  * lives in `types/events.ts` alongside the event-type enum.
17
17
  */
18
- import type { GguiSession } from './render';
19
- import type { JsonObject, JsonValue, StreamChannelMode } from './data-contract';
18
+ import type { GguiSession } from './render.js';
19
+ import type { JsonObject, JsonValue, StreamChannelMode } from './data-contract.js';
20
20
  /**
21
21
  * Payload for subscribe message
22
22
  */
@@ -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","sour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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 (!isValidLlmRoute(provider, model))
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