@ggui-ai/protocol 0.2.0-alpha.4 → 0.4.0-rc.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/README.md +16 -16
- package/dist/envelope-adapters.d.ts +6 -5
- package/dist/envelope-adapters.d.ts.map +1 -1
- package/dist/envelope-adapters.js +3 -3
- package/dist/envelopes/builders.d.ts +6 -32
- package/dist/envelopes/builders.d.ts.map +1 -1
- package/dist/envelopes/builders.js +3 -25
- package/dist/errors/version-mismatch.d.ts +1 -1
- package/dist/errors/version-mismatch.js +1 -1
- package/dist/gadgets/resolve-app-gadgets.d.ts +10 -0
- package/dist/gadgets/resolve-app-gadgets.d.ts.map +1 -0
- package/dist/gadgets/resolve-app-gadgets.js +19 -0
- package/dist/gadgets/resolve-contract-gadgets.d.ts +6 -6
- package/dist/gadgets/resolve-contract-gadgets.js +5 -5
- package/dist/gadgets/stdlib-gadgets.d.ts +1 -1
- package/dist/gadgets/stdlib-gadgets.d.ts.map +1 -1
- package/dist/gadgets/stdlib-gadgets.js +43 -22
- package/dist/iframe-bridge.d.ts +4 -43
- package/dist/iframe-bridge.d.ts.map +1 -1
- package/dist/iframe-bridge.js +4 -141
- package/dist/index.d.ts +60 -62
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +66 -61
- package/dist/integrations/mcp-apps.d.ts +83 -38
- package/dist/integrations/mcp-apps.d.ts.map +1 -1
- package/dist/integrations/mcp-apps.js +98 -52
- package/dist/recommended-prompts.d.ts +1 -1
- package/dist/recommended-prompts.js +1 -1
- package/dist/registry/blueprint-key.d.ts +3 -0
- package/dist/registry/blueprint-key.d.ts.map +1 -1
- package/dist/registry/blueprint-key.js +9 -0
- package/dist/registry/blueprint-stamp.d.ts +12 -0
- package/dist/registry/blueprint-stamp.d.ts.map +1 -0
- package/dist/registry/blueprint-stamp.js +12 -0
- package/dist/registry/canonicalize-contract.d.ts +31 -2
- package/dist/registry/canonicalize-contract.d.ts.map +1 -1
- package/dist/registry/canonicalize-contract.js +125 -13
- package/dist/registry/portable-blueprint.d.ts +71 -0
- package/dist/registry/portable-blueprint.d.ts.map +1 -0
- package/dist/registry/portable-blueprint.js +111 -0
- package/dist/registry/summarize-contract.d.ts +7 -2
- package/dist/registry/summarize-contract.d.ts.map +1 -1
- package/dist/registry/summarize-contract.js +12 -3
- package/dist/registry/variant-key.d.ts +17 -0
- package/dist/registry/variant-key.d.ts.map +1 -0
- package/dist/registry/variant-key.js +22 -0
- package/dist/schema-learning/derive-contract.d.ts +2 -2
- package/dist/schema-learning/derive-contract.js +2 -2
- package/dist/schema-learning/merge.d.ts.map +1 -1
- package/dist/schema-learning/merge.js +3 -2
- package/dist/schemas/app-theme.d.ts +38 -0
- package/dist/schemas/app-theme.d.ts.map +1 -0
- package/dist/schemas/app-theme.js +43 -0
- package/dist/schemas/blueprint.d.ts +30 -11
- package/dist/schemas/blueprint.d.ts.map +1 -1
- package/dist/schemas/blueprint.js +62 -26
- package/dist/schemas/data-contract.d.ts +28 -30
- package/dist/schemas/data-contract.d.ts.map +1 -1
- package/dist/schemas/data-contract.js +26 -26
- package/dist/schemas/handshake-suggestion.d.ts +2 -4
- package/dist/schemas/handshake-suggestion.d.ts.map +1 -1
- package/dist/schemas/handshake-suggestion.js +5 -14
- package/dist/schemas/mcp.d.ts +294 -59
- package/dist/schemas/mcp.d.ts.map +1 -1
- package/dist/schemas/mcp.js +350 -94
- package/dist/schemas/ops-blueprint.d.ts +12 -12
- package/dist/schemas/ops-blueprint.d.ts.map +1 -1
- package/dist/schemas/ops-blueprint.js +14 -24
- package/dist/screen-blueprints/define.d.ts +2 -2
- package/dist/screen-blueprints/match.d.ts +12 -7
- package/dist/screen-blueprints/match.d.ts.map +1 -1
- package/dist/screen-blueprints/match.js +7 -5
- package/dist/screen-blueprints/types.d.ts +14 -18
- package/dist/screen-blueprints/types.d.ts.map +1 -1
- package/dist/transport/websocket.d.ts +5 -26
- package/dist/transport/websocket.d.ts.map +1 -1
- package/dist/types/app-config.d.ts +0 -1
- package/dist/types/app-config.d.ts.map +1 -1
- package/dist/types/auth.d.ts +1 -46
- package/dist/types/auth.d.ts.map +1 -1
- package/dist/types/blueprint-source.d.ts +123 -0
- package/dist/types/blueprint-source.d.ts.map +1 -0
- package/dist/types/blueprint-source.js +126 -0
- package/dist/types/blueprint.d.ts +25 -18
- package/dist/types/blueprint.d.ts.map +1 -1
- package/dist/types/contract-inference.d.ts +2 -43
- package/dist/types/contract-inference.d.ts.map +1 -1
- package/dist/types/data-contract.d.ts +59 -344
- package/dist/types/data-contract.d.ts.map +1 -1
- package/dist/types/data-contract.js +5 -12
- package/dist/types/events.d.ts +31 -69
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/{render-event.d.ts → ggui-session-event.d.ts} +15 -15
- package/dist/types/ggui-session-event.d.ts.map +1 -0
- package/dist/types/{render-event.js → ggui-session-event.js} +5 -5
- package/dist/types/handshake-suggestion.d.ts +49 -35
- package/dist/types/handshake-suggestion.d.ts.map +1 -1
- package/dist/types/host-context.d.ts +8 -8
- package/dist/types/host-context.d.ts.map +1 -1
- package/dist/types/host-context.js +5 -5
- package/dist/types/invoke.d.ts +1 -13
- package/dist/types/invoke.d.ts.map +1 -1
- package/dist/types/{canvas-lifecycle.d.ts → lifecycle.d.ts} +35 -37
- package/dist/types/lifecycle.d.ts.map +1 -0
- package/dist/types/{canvas-lifecycle.js → lifecycle.js} +12 -14
- package/dist/types/live-channel.d.ts +48 -104
- package/dist/types/live-channel.d.ts.map +1 -1
- package/dist/types/llm-route.d.ts +4 -4
- package/dist/types/llm-route.d.ts.map +1 -1
- package/dist/types/llm-route.js +24 -2
- package/dist/types/llm.d.ts +13 -24
- package/dist/types/llm.d.ts.map +1 -1
- package/dist/types/llm.js +23 -53
- package/dist/types/mcp.d.ts +74 -177
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/types/mcp.js +11 -4
- package/dist/types/oauth-user-id.d.ts +12 -0
- package/dist/types/oauth-user-id.d.ts.map +1 -0
- package/dist/types/oauth-user-id.js +10 -0
- package/dist/types/portable-blueprint.d.ts +61 -0
- package/dist/types/portable-blueprint.d.ts.map +1 -0
- package/dist/types/portable-blueprint.js +8 -0
- package/dist/types/{session.d.ts → render.d.ts} +51 -53
- package/dist/types/render.d.ts.map +1 -0
- package/dist/types/thread.d.ts.map +1 -1
- package/dist/types/thread.js +3 -3
- package/dist/types/ui-generator.d.ts +24 -47
- package/dist/types/ui-generator.d.ts.map +1 -1
- package/dist/types/ui-generator.js +1 -53
- package/dist/validation/ajv-runtime.d.ts +3 -3
- package/dist/validation/ajv-runtime.d.ts.map +1 -1
- package/dist/validation/ajv-runtime.js +6 -5
- package/dist/validation/contract-validator.d.ts +23 -22
- package/dist/validation/contract-validator.d.ts.map +1 -1
- package/dist/validation/contract-validator.js +28 -26
- package/dist/validation/cross-references.d.ts +3 -3
- package/dist/validation/cross-references.js +3 -3
- package/dist/validation/hygiene-rules.d.ts +9 -9
- package/dist/validation/hygiene-rules.js +13 -13
- package/dist/validation/is-record.d.ts +17 -0
- package/dist/validation/is-record.d.ts.map +1 -0
- package/dist/validation/is-record.js +18 -0
- package/dist/validation/lint-contract.d.ts +1 -1
- package/dist/validation/lint-contract.js +3 -3
- package/dist/validation/name-invariants.d.ts +4 -4
- package/dist/validation/name-invariants.js +4 -4
- package/dist/validation/reserved-channels.d.ts +43 -46
- package/dist/validation/reserved-channels.d.ts.map +1 -1
- package/dist/validation/reserved-channels.js +14 -177
- package/dist/validation/resolve-stream-channel.d.ts +3 -9
- package/dist/validation/resolve-stream-channel.d.ts.map +1 -1
- package/dist/validation/resolve-stream-channel.js +3 -4
- package/dist/validation/sanitize-error.d.ts +10 -9
- package/dist/validation/sanitize-error.d.ts.map +1 -1
- package/dist/validation/sanitize-error.js +19 -18
- package/dist/validation/schema-compat-invariants.d.ts +1 -1
- package/dist/validation/schema-compat-invariants.js +3 -3
- package/dist/validation/schema-meta-validation.d.ts +4 -4
- package/dist/validation/schema-meta-validation.d.ts.map +1 -1
- package/dist/validation/schema-meta-validation.js +7 -9
- package/dist/validation/schema-subset.d.ts +9 -8
- package/dist/validation/schema-subset.d.ts.map +1 -1
- package/dist/validation/ui-security.d.ts +0 -17
- package/dist/validation/ui-security.d.ts.map +1 -1
- package/dist/validation/ui-security.js +17 -22
- package/dist/validation/zod-to-json-schema.d.ts +1 -1
- package/dist/validation/zod-to-json-schema.d.ts.map +1 -1
- package/dist/validation/zod-to-json-schema.js +4 -3
- package/dist/version.d.ts +818 -9
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +817 -8
- package/package.json +3 -3
- package/dist/bridge/invoke-agent.d.ts +0 -65
- package/dist/bridge/invoke-agent.d.ts.map +0 -1
- package/dist/bridge/invoke-agent.js +0 -113
- package/dist/stream/stream-parser.d.ts +0 -62
- package/dist/stream/stream-parser.d.ts.map +0 -1
- package/dist/stream/stream-parser.js +0 -199
- package/dist/types/canvas-lifecycle.d.ts.map +0 -1
- package/dist/types/credential.d.ts +0 -41
- package/dist/types/credential.d.ts.map +0 -1
- package/dist/types/credential.js +0 -32
- package/dist/types/data-bindings.d.ts +0 -322
- package/dist/types/data-bindings.d.ts.map +0 -1
- package/dist/types/data-bindings.js +0 -29
- package/dist/types/feedback.d.ts +0 -22
- package/dist/types/feedback.d.ts.map +0 -1
- package/dist/types/feedback.js +0 -7
- package/dist/types/mcp-proxy.d.ts +0 -67
- package/dist/types/mcp-proxy.d.ts.map +0 -1
- package/dist/types/mcp-proxy.js +0 -46
- package/dist/types/openrouter-models.d.ts +0 -23
- package/dist/types/openrouter-models.d.ts.map +0 -1
- package/dist/types/openrouter-models.js +0 -4843
- package/dist/types/region.d.ts +0 -26
- package/dist/types/region.d.ts.map +0 -1
- package/dist/types/region.js +0 -36
- package/dist/types/render-event.d.ts.map +0 -1
- package/dist/types/session.d.ts.map +0 -1
- /package/dist/types/{session.js → render.js} +0 -0
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Generation-progress lifecycle envelopes.
|
|
3
3
|
*
|
|
4
4
|
* Carried over the reserved `_ggui:lifecycle` channel via `data`
|
|
5
5
|
* WebSocket messages. The server emits at four lifecycle moments;
|
|
6
|
-
*
|
|
7
|
-
* pill state machine:
|
|
6
|
+
* subscribed clients consume them to drive progress indicators:
|
|
8
7
|
*
|
|
9
8
|
* - `handshake_started` / `handshake_completed`: bracket each
|
|
10
|
-
* `ggui_handshake` call so
|
|
9
|
+
* `ggui_handshake` call so a progress UI can render "negotiating"
|
|
11
10
|
* during the gap.
|
|
12
11
|
* - `render_started`: emitted at the gen gate of `ggui_render`, before
|
|
13
|
-
* the final `render` envelope lands. Drives
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `content`.
|
|
12
|
+
* the final `render` envelope lands. Drives a "constructing"
|
|
13
|
+
* indicator. The eventual `render` envelope (existing wire type)
|
|
14
|
+
* signals completion → the indicator gives way to content.
|
|
17
15
|
* - `consume_polling`: signals that `ggui_consume` opened a long-
|
|
18
|
-
* poll
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* needed.
|
|
16
|
+
* poll — a "listening" indicator. The complementary "close"
|
|
17
|
+
* signal is the existing `drain_ack` envelope (consume drained an
|
|
18
|
+
* action) — no separate "closed" lifecycle kind is needed.
|
|
22
19
|
*
|
|
23
20
|
* Discriminated on `kind`. Adding a kind is a protocol-version bump,
|
|
24
21
|
* not a silent extension — keeps the union closed so producers and
|
|
@@ -30,38 +27,39 @@
|
|
|
30
27
|
*
|
|
31
28
|
* Boundary discipline:
|
|
32
29
|
* - This module describes ENVELOPE SHAPES carried on a reserved
|
|
33
|
-
* channel. It does NOT describe the
|
|
34
|
-
* consumes them
|
|
30
|
+
* channel. It does NOT describe the progress-indicator state
|
|
31
|
+
* machine that consumes them — that is client-side presentation,
|
|
32
|
+
* outside the protocol.
|
|
35
33
|
* - This module is `data` only — no functions, no reducers. Pure
|
|
36
34
|
* types so the protocol bundle stays tiny.
|
|
37
35
|
*/
|
|
38
36
|
import type { JsonObject } from './data-contract';
|
|
39
37
|
/**
|
|
40
38
|
* Emitted when the server starts processing a `ggui_handshake` call.
|
|
41
|
-
*
|
|
42
|
-
*
|
|
39
|
+
* Progress UIs transition from their current state into a
|
|
40
|
+
* "negotiating" indicator.
|
|
43
41
|
*/
|
|
44
42
|
export interface HandshakeStartedPayload extends JsonObject {
|
|
45
43
|
readonly kind: 'handshake_started';
|
|
46
44
|
readonly handshakeId: string;
|
|
47
|
-
/** Agent's intent string —
|
|
45
|
+
/** Agent's intent string — consumers may surface this as a label. */
|
|
48
46
|
readonly intent: string;
|
|
49
47
|
}
|
|
50
48
|
/**
|
|
51
|
-
* Emitted when the server finishes a `ggui_handshake` call.
|
|
52
|
-
* either drops back to
|
|
53
|
-
* pre-warms
|
|
54
|
-
*
|
|
49
|
+
* Emitted when the server finishes a `ggui_handshake` call. A progress
|
|
50
|
+
* UI either drops back to its idle/content state (no gen expected) or
|
|
51
|
+
* pre-warms its "constructing" indicator if `genExpected: true` so the
|
|
52
|
+
* handshake → constructing transition doesn't flicker.
|
|
55
53
|
*/
|
|
56
54
|
export interface HandshakeCompletedPayload extends JsonObject {
|
|
57
55
|
readonly kind: 'handshake_completed';
|
|
58
56
|
readonly handshakeId: string;
|
|
59
|
-
/** Negotiator outcome — informational;
|
|
57
|
+
/** Negotiator outcome — informational; consumers may surface. */
|
|
60
58
|
readonly outcome: 'accepted' | 'amended' | 'declined' | 'cached';
|
|
61
59
|
/**
|
|
62
60
|
* Whether a cold gen is about to follow this handshake. When true,
|
|
63
|
-
* the
|
|
64
|
-
* `handshake →
|
|
61
|
+
* the consumer may pre-warm its "constructing" indicator to suppress
|
|
62
|
+
* a `handshake → idle → constructing` flicker.
|
|
65
63
|
*/
|
|
66
64
|
readonly genExpected: boolean;
|
|
67
65
|
}
|
|
@@ -72,34 +70,34 @@ export interface HandshakeCompletedPayload extends JsonObject {
|
|
|
72
70
|
*/
|
|
73
71
|
export interface RenderStartedPayload extends JsonObject {
|
|
74
72
|
readonly kind: 'render_started';
|
|
75
|
-
/** The
|
|
76
|
-
readonly
|
|
77
|
-
/** Echoed for the
|
|
73
|
+
/** The GguiSession id the eventual `render` envelope will carry. */
|
|
74
|
+
readonly sessionId: string;
|
|
75
|
+
/** Echoed for the progress label ("Building: <intent>"). */
|
|
78
76
|
readonly intent: string;
|
|
79
77
|
}
|
|
80
78
|
/**
|
|
81
79
|
* Emitted when `ggui_consume` opens a long-poll (after the action
|
|
82
|
-
* pipe is found empty)
|
|
83
|
-
*
|
|
80
|
+
* pipe is found empty) — a "listening" indicator. The complementary
|
|
81
|
+
* "close" signal is the existing `drain_ack` envelope.
|
|
84
82
|
*/
|
|
85
83
|
export interface ConsumePollingPayload extends JsonObject {
|
|
86
84
|
readonly kind: 'consume_polling';
|
|
87
85
|
/**
|
|
88
86
|
* Always `'open'` today — the closing transition is signaled
|
|
89
87
|
* by the existing `drain_ack` envelope (action consumed) and by the
|
|
90
|
-
* absence of further `consume_polling` for the same
|
|
88
|
+
* absence of further `consume_polling` for the same GguiSession.
|
|
91
89
|
* Reserved as a discriminator field rather than implicit so future
|
|
92
90
|
* `'closed'` / `'timeout'` variants can layer in without a wire
|
|
93
91
|
* shape change.
|
|
94
92
|
*/
|
|
95
93
|
readonly state: 'open';
|
|
96
|
-
/**
|
|
97
|
-
readonly
|
|
94
|
+
/** GguiSession id whose action pipe is being polled. */
|
|
95
|
+
readonly sessionId: string;
|
|
98
96
|
}
|
|
99
97
|
/**
|
|
100
|
-
* Closed discriminated union of every
|
|
101
|
-
* New kinds bump the protocol version; consumers narrow on
|
|
102
|
-
* with exhaustive switch.
|
|
98
|
+
* Closed discriminated union of every generation-progress lifecycle
|
|
99
|
+
* payload. New kinds bump the protocol version; consumers narrow on
|
|
100
|
+
* `kind` with exhaustive switch.
|
|
103
101
|
*/
|
|
104
|
-
export type
|
|
105
|
-
//# sourceMappingURL=
|
|
102
|
+
export type GguiLifecyclePayload = HandshakeStartedPayload | HandshakeCompletedPayload | RenderStartedPayload | ConsumePollingPayload;
|
|
103
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../src/types/lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;;GAIG;AACH,MAAM,WAAW,uBAAwB,SAAQ,UAAU;IACzD,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,WAAW,yBAA0B,SAAQ,UAAU;IAC3D,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC;IACrC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;IACjE;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAqB,SAAQ,UAAU;IACtD,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,oEAAoE;IACpE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,UAAU;IACvD,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,wDAAwD;IACxD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAC5B,uBAAuB,GACvB,yBAAyB,GACzB,oBAAoB,GACpB,qBAAqB,CAAC"}
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Generation-progress lifecycle envelopes.
|
|
3
3
|
*
|
|
4
4
|
* Carried over the reserved `_ggui:lifecycle` channel via `data`
|
|
5
5
|
* WebSocket messages. The server emits at four lifecycle moments;
|
|
6
|
-
*
|
|
7
|
-
* pill state machine:
|
|
6
|
+
* subscribed clients consume them to drive progress indicators:
|
|
8
7
|
*
|
|
9
8
|
* - `handshake_started` / `handshake_completed`: bracket each
|
|
10
|
-
* `ggui_handshake` call so
|
|
9
|
+
* `ggui_handshake` call so a progress UI can render "negotiating"
|
|
11
10
|
* during the gap.
|
|
12
11
|
* - `render_started`: emitted at the gen gate of `ggui_render`, before
|
|
13
|
-
* the final `render` envelope lands. Drives
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `content`.
|
|
12
|
+
* the final `render` envelope lands. Drives a "constructing"
|
|
13
|
+
* indicator. The eventual `render` envelope (existing wire type)
|
|
14
|
+
* signals completion → the indicator gives way to content.
|
|
17
15
|
* - `consume_polling`: signals that `ggui_consume` opened a long-
|
|
18
|
-
* poll
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* needed.
|
|
16
|
+
* poll — a "listening" indicator. The complementary "close"
|
|
17
|
+
* signal is the existing `drain_ack` envelope (consume drained an
|
|
18
|
+
* action) — no separate "closed" lifecycle kind is needed.
|
|
22
19
|
*
|
|
23
20
|
* Discriminated on `kind`. Adding a kind is a protocol-version bump,
|
|
24
21
|
* not a silent extension — keeps the union closed so producers and
|
|
@@ -30,8 +27,9 @@
|
|
|
30
27
|
*
|
|
31
28
|
* Boundary discipline:
|
|
32
29
|
* - This module describes ENVELOPE SHAPES carried on a reserved
|
|
33
|
-
* channel. It does NOT describe the
|
|
34
|
-
* consumes them
|
|
30
|
+
* channel. It does NOT describe the progress-indicator state
|
|
31
|
+
* machine that consumes them — that is client-side presentation,
|
|
32
|
+
* outside the protocol.
|
|
35
33
|
* - This module is `data` only — no functions, no reducers. Pure
|
|
36
34
|
* types so the protocol bundle stays tiny.
|
|
37
35
|
*/
|
|
@@ -15,14 +15,25 @@
|
|
|
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 {
|
|
18
|
+
import type { GguiSession } from './render';
|
|
19
19
|
import type { JsonObject, JsonValue, StreamChannelMode } from './data-contract';
|
|
20
20
|
/**
|
|
21
21
|
* Payload for subscribe message
|
|
22
22
|
*/
|
|
23
23
|
export interface SubscribePayload {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
sessionId: string;
|
|
25
|
+
/**
|
|
26
|
+
* App (tenant) identity. OPTIONAL — absent ⇒ the server resolves the
|
|
27
|
+
* caller's identity-default app, the same resolution rule the MCP
|
|
28
|
+
* route uses: a token binding (`wsToken` binds `(sessionId, appId)`)
|
|
29
|
+
* wins, then the deployment's identity → appId mapping, then the
|
|
30
|
+
* deployment default. Clients never invent a default; the identity
|
|
31
|
+
* resolves it server-side.
|
|
32
|
+
*
|
|
33
|
+
* When present it MUST match the GguiSession's bound `appId` or the
|
|
34
|
+
* subscribe fails `APP_MISMATCH` (SPEC §12.2.3).
|
|
35
|
+
*/
|
|
36
|
+
appId?: string;
|
|
26
37
|
/** Role of the subscriber: 'user' (Portal) or 'agent' (MCP bridge) */
|
|
27
38
|
role?: 'user' | 'agent';
|
|
28
39
|
/**
|
|
@@ -42,7 +53,7 @@ export interface SubscribePayload {
|
|
|
42
53
|
* the last envelope the client observed.
|
|
43
54
|
*
|
|
44
55
|
* Honored only by implementations that expose
|
|
45
|
-
* `
|
|
56
|
+
* `GguiSessionStreamBuffer`-backed replay. Hosted cloud does NOT
|
|
46
57
|
* yet honor `fromSeq` — the field is silently ignored there. OSS
|
|
47
58
|
* `@ggui-ai/mcp-server` honors it fully.
|
|
48
59
|
*/
|
|
@@ -50,7 +61,7 @@ export interface SubscribePayload {
|
|
|
50
61
|
/**
|
|
51
62
|
* Opaque WS auth credential for initial subscribe — the live-channel
|
|
52
63
|
* counterpart to a bearer token. Symmetric with {@link
|
|
53
|
-
* SubscribePayload.
|
|
64
|
+
* SubscribePayload.sessionId}/`appId`/`wsUrl` — names what it auths.
|
|
54
65
|
*
|
|
55
66
|
* **Auth-credential string only.** Identity/render fields ride on
|
|
56
67
|
* the `ai.ggui/render` slice meta delivered through the MCP Apps
|
|
@@ -64,7 +75,7 @@ export interface SubscribePayload {
|
|
|
64
75
|
* field with the same semantics:
|
|
65
76
|
*
|
|
66
77
|
* - Opaque to the client — validated server-side against the
|
|
67
|
-
* subscribe's `
|
|
78
|
+
* subscribe's `sessionId` + `appId`.
|
|
68
79
|
* - Short TTL (seconds-to-minutes); stale tokens are rejected
|
|
69
80
|
* (refresh via `ggui_runtime_refresh_ws_token` within the
|
|
70
81
|
* refresh window, otherwise re-handshake).
|
|
@@ -72,7 +83,7 @@ export interface SubscribePayload {
|
|
|
72
83
|
* can reconnect without a fresh handshake.
|
|
73
84
|
*
|
|
74
85
|
* On a successful ws-token-authed subscribe, the server SHOULD issue
|
|
75
|
-
* a longer-lived reconnect credential via {@link AckPayload.
|
|
86
|
+
* a longer-lived reconnect credential via {@link AckPayload.sessionToken}.
|
|
76
87
|
*
|
|
77
88
|
* Mutually compatible with upstream bearer-auth (`Authorization`
|
|
78
89
|
* header / `?token=` query). When both are present, server behavior
|
|
@@ -101,7 +112,7 @@ export interface SubscribePayload {
|
|
|
101
112
|
*
|
|
102
113
|
* **Distinct from `fromSeq`.** `fromSeq` is for per-stream-channel
|
|
103
114
|
* `StreamEnvelope` replay (declared `streamSpec[name].replay`
|
|
104
|
-
* policy); `sinceSequence` is for the
|
|
115
|
+
* policy); `sinceSequence` is for the GguiSession-level event ledger
|
|
105
116
|
* (render/update/props_update/etc.). Both cursors travel on the
|
|
106
117
|
* same subscribe frame and the server honors them independently —
|
|
107
118
|
* `sinceSequence` events replay first, then per-channel `fromSeq`
|
|
@@ -132,14 +143,6 @@ export interface SubscribePayload {
|
|
|
132
143
|
* windows.
|
|
133
144
|
*/
|
|
134
145
|
supportedVersions?: string[];
|
|
135
|
-
/**
|
|
136
|
-
* Optional bootstrap credential for transports that mint a one-time
|
|
137
|
-
* opaque token at handshake (e.g. an MCP Apps `_meta`-delivered short-
|
|
138
|
-
* lived bootstrap). Generic string slot, not coupled to any specific
|
|
139
|
-
* integration — host adapters interpret the value per their own
|
|
140
|
-
* bootstrap contract.
|
|
141
|
-
*/
|
|
142
|
-
bootstrap?: string;
|
|
143
146
|
}
|
|
144
147
|
/**
|
|
145
148
|
* Payload for ack message (subscribe response includes current render)
|
|
@@ -147,9 +150,9 @@ export interface SubscribePayload {
|
|
|
147
150
|
export interface AckPayload {
|
|
148
151
|
sequence: number;
|
|
149
152
|
timestamp: number;
|
|
150
|
-
/** Current
|
|
153
|
+
/** Current session snapshot (returned on subscribe). Single item,
|
|
151
154
|
* not an array — Phase B collapsed the vessel. */
|
|
152
|
-
|
|
155
|
+
session?: GguiSession;
|
|
153
156
|
/**
|
|
154
157
|
* Current outbound-stream cursor snapshot at the moment the ack is
|
|
155
158
|
* sent. Distinct from `sequence` (which counts INBOUND events like
|
|
@@ -158,7 +161,7 @@ export interface AckPayload {
|
|
|
158
161
|
* - seed their `lastSeenSeq` if they didn't pass `fromSeq` on
|
|
159
162
|
* subscribe.
|
|
160
163
|
*
|
|
161
|
-
* Absent on implementations without a `
|
|
164
|
+
* Absent on implementations without a `GguiSessionStreamBuffer`.
|
|
162
165
|
* 0 means the render has recorded no outbound envelopes yet.
|
|
163
166
|
*/
|
|
164
167
|
streamSeq?: number;
|
|
@@ -185,16 +188,16 @@ export interface AckPayload {
|
|
|
185
188
|
*
|
|
186
189
|
* Semantics:
|
|
187
190
|
* - Longer TTL than the ws token (minutes-to-hours).
|
|
188
|
-
* - Bound to the same `
|
|
191
|
+
* - Bound to the same `sessionId` + `appId`.
|
|
189
192
|
* - Passed on reconnect via the standard bearer path
|
|
190
|
-
* (`Authorization: Bearer <
|
|
193
|
+
* (`Authorization: Bearer <sessionToken>` or `?token=`), NOT in
|
|
191
194
|
* `SubscribePayload.wsToken` (which is short-TTL and credential-scoped).
|
|
192
195
|
*
|
|
193
196
|
* Absent when the subscribe was bearer-authed (no ws-token-bound
|
|
194
197
|
* reconnect credential needed) and on servers that don't implement
|
|
195
198
|
* ws-token auth.
|
|
196
199
|
*/
|
|
197
|
-
|
|
200
|
+
sessionToken?: string;
|
|
198
201
|
/**
|
|
199
202
|
* Protocol schema version this server emits on. Advertised on every
|
|
200
203
|
* successful ack. First-party servers populate this with
|
|
@@ -213,11 +216,11 @@ export interface AckPayload {
|
|
|
213
216
|
}
|
|
214
217
|
/**
|
|
215
218
|
* Payload for render message (Server → Client: agent push event with
|
|
216
|
-
* generated/cached UI). Carries a {@link
|
|
219
|
+
* generated/cached UI). Carries a {@link GguiSession} — either a
|
|
217
220
|
* component variant or an embedded MCP Apps iframe variant.
|
|
218
221
|
*/
|
|
219
222
|
export interface RenderPayload {
|
|
220
|
-
|
|
223
|
+
session: GguiSession;
|
|
221
224
|
matchType?: string;
|
|
222
225
|
}
|
|
223
226
|
/**
|
|
@@ -242,8 +245,8 @@ export interface RenderPayload {
|
|
|
242
245
|
* addition driven by a concrete client-UX need.
|
|
243
246
|
*/
|
|
244
247
|
export interface StreamEnvelope {
|
|
245
|
-
/**
|
|
246
|
-
|
|
248
|
+
/** GguiSession this delivery belongs to. */
|
|
249
|
+
sessionId: string;
|
|
247
250
|
/** Channel name (keys into `spec.channels`). */
|
|
248
251
|
channel: string;
|
|
249
252
|
/**
|
|
@@ -266,7 +269,7 @@ export interface StreamEnvelope {
|
|
|
266
269
|
*/
|
|
267
270
|
complete?: boolean;
|
|
268
271
|
/**
|
|
269
|
-
*
|
|
272
|
+
* GguiSession-scoped monotonic outbound sequence. Server-assigned;
|
|
270
273
|
* clients MUST NOT populate it on producer-side inputs. Gap-free
|
|
271
274
|
* within a single render, starting at 1. Used by the client to:
|
|
272
275
|
* - track `lastSeenSeq` for reconnect (pass it back as
|
|
@@ -274,7 +277,7 @@ export interface StreamEnvelope {
|
|
|
274
277
|
* - dedupe deliveries (at-least-once semantics).
|
|
275
278
|
*
|
|
276
279
|
* OPTIONAL because hosted cloud does not yet stamp `seq`;
|
|
277
|
-
* implementations backed by `
|
|
280
|
+
* implementations backed by `GguiSessionStreamBuffer`
|
|
278
281
|
* (OSS `@ggui-ai/mcp-server`) always populate it. When absent,
|
|
279
282
|
* clients treat deliveries as single-shot with no replay possible.
|
|
280
283
|
* This becomes required once the hosted runtime supports replay.
|
|
@@ -290,17 +293,6 @@ export interface StreamEnvelope {
|
|
|
290
293
|
*/
|
|
291
294
|
schemaVersion?: string;
|
|
292
295
|
}
|
|
293
|
-
/**
|
|
294
|
-
* Payload for stream message (Server → Client)
|
|
295
|
-
* Delivers streaming text chunks from the agent in real-time.
|
|
296
|
-
*/
|
|
297
|
-
export interface StreamPayload {
|
|
298
|
-
renderId: string;
|
|
299
|
-
/** Text chunk from agent. Empty string on final (done=true) message. */
|
|
300
|
-
chunk: string;
|
|
301
|
-
/** Whether this is the final chunk in the stream. */
|
|
302
|
-
done: boolean;
|
|
303
|
-
}
|
|
304
296
|
/**
|
|
305
297
|
* Payload for error message.
|
|
306
298
|
* The `details` field is {@link JsonValue} to carry any JSON-safe diagnostic data.
|
|
@@ -328,15 +320,15 @@ export interface ErrorPayload {
|
|
|
328
320
|
* to begin polling the channel's `streamSpec[ch].source.tool` on the
|
|
329
321
|
* iframe's behalf and fan results out as `channel_payload` frames.
|
|
330
322
|
*
|
|
331
|
-
* Idempotent on reconnect: replaying the same `{
|
|
323
|
+
* Idempotent on reconnect: replaying the same `{sessionId, channelName,
|
|
332
324
|
* pollIntervalMs?, args?}` triple after a WS disconnect re-binds the
|
|
333
325
|
* existing subscription rather than minting a duplicate. The server is
|
|
334
326
|
* authoritative on `pollIntervalMs` — clients propose, server caps to
|
|
335
327
|
* its policy floor.
|
|
336
328
|
*/
|
|
337
329
|
export interface ChannelSubscribePayload {
|
|
338
|
-
/** Active
|
|
339
|
-
|
|
330
|
+
/** Active GguiSession id from the iframe's bootstrap. */
|
|
331
|
+
sessionId: string;
|
|
340
332
|
/** Active app id from the iframe's bootstrap. */
|
|
341
333
|
appId: string;
|
|
342
334
|
/** Channel name as keyed in `streamSpec`. The source.tool comes from the contract. */
|
|
@@ -356,13 +348,13 @@ export interface ChannelSubscribePayload {
|
|
|
356
348
|
}
|
|
357
349
|
/**
|
|
358
350
|
* Payload for `channel_unsubscribe` (Client → Server). Idempotent: the
|
|
359
|
-
* server tolerates an unsubscribe for an unknown `{
|
|
351
|
+
* server tolerates an unsubscribe for an unknown `{sessionId,
|
|
360
352
|
* channelName}` pair (treats as a no-op + ack). Closing the WebSocket
|
|
361
353
|
* implicitly unsubscribes all channels on that subscriber — this
|
|
362
354
|
* message is for fine-grained mid-render cancellation.
|
|
363
355
|
*/
|
|
364
356
|
export interface ChannelUnsubscribePayload {
|
|
365
|
-
|
|
357
|
+
sessionId: string;
|
|
366
358
|
appId: string;
|
|
367
359
|
channelName: string;
|
|
368
360
|
}
|
|
@@ -377,7 +369,7 @@ export interface ChannelUnsubscribePayload {
|
|
|
377
369
|
* semantics as iframe-polled payloads.
|
|
378
370
|
*/
|
|
379
371
|
export interface ChannelPayloadFrame {
|
|
380
|
-
|
|
372
|
+
sessionId: string;
|
|
381
373
|
appId: string;
|
|
382
374
|
channelName: string;
|
|
383
375
|
/** Server-monotonic sequence for this channel — gap-detection on the client. */
|
|
@@ -406,75 +398,34 @@ export interface ChannelPayloadFrame {
|
|
|
406
398
|
*
|
|
407
399
|
* - `CHANNEL_UNKNOWN` — channelName not present in streamSpec.
|
|
408
400
|
* - `CHANNEL_NOT_LOCAL` — `source.tool` not in `streamWebSocketLocalTools`; iframe must poll directly.
|
|
409
|
-
* - `
|
|
401
|
+
* - `SESSION_NOT_FOUND` — `sessionId` not on the server.
|
|
410
402
|
* - `SUBSCRIBE_UNAUTHORIZED` — WS auth token expired or render-mismatch.
|
|
411
403
|
* - `POLL_FAILED` — source.tool invocation threw. `details` carries the error.
|
|
412
404
|
*/
|
|
413
405
|
export interface ChannelErrorPayload {
|
|
414
|
-
|
|
406
|
+
sessionId: string;
|
|
415
407
|
channelName: string;
|
|
416
|
-
code: 'CHANNEL_UNKNOWN' | 'CHANNEL_NOT_LOCAL' | '
|
|
408
|
+
code: 'CHANNEL_UNKNOWN' | 'CHANNEL_NOT_LOCAL' | 'SESSION_NOT_FOUND' | 'SUBSCRIBE_UNAUTHORIZED' | 'POLL_FAILED' | (string & {});
|
|
417
409
|
message: string;
|
|
418
410
|
details?: JsonValue;
|
|
419
411
|
}
|
|
420
|
-
/**
|
|
421
|
-
* Payload for close message (Client → Server: close render)
|
|
422
|
-
*/
|
|
423
|
-
export interface ClosePayload {
|
|
424
|
-
renderId: string;
|
|
425
|
-
}
|
|
426
412
|
/**
|
|
427
413
|
* Generation strategy controls how ggui resolves UI generation requests.
|
|
428
414
|
*
|
|
429
|
-
* - `strict` — Only use
|
|
415
|
+
* - `strict` — Only use cached/curated blueprints. Fails if no match found.
|
|
430
416
|
* - `balanced` — Try blueprint matching first, fall back to LLM generation.
|
|
431
|
-
* - `creative` — Always generate fresh UI via LLM (no blueprint matching).
|
|
432
|
-
*/
|
|
433
|
-
export type GenerationStrategy = 'strict' | 'balanced' | 'creative';
|
|
434
|
-
/**
|
|
435
|
-
* Progress step during UI generation
|
|
436
417
|
*/
|
|
437
|
-
export type
|
|
438
|
-
/**
|
|
439
|
-
* Payload for progress message (Server → Client)
|
|
440
|
-
*/
|
|
441
|
-
export interface ProgressPayload {
|
|
442
|
-
renderId: string;
|
|
443
|
-
step: ProgressStep;
|
|
444
|
-
message: string;
|
|
445
|
-
}
|
|
446
|
-
/**
|
|
447
|
-
* Payload for agent thinking message (Server → Client).
|
|
448
|
-
* Sent immediately when a user message is received, before the agent processes it.
|
|
449
|
-
* Agent message payload — used for both thinking and final messages.
|
|
450
|
-
*/
|
|
451
|
-
export type AgentMsgType = 'thinking' | 'chat';
|
|
452
|
-
export interface AgentMsgPayload {
|
|
453
|
-
/** Message type — 'thinking' for status updates, 'chat' for final responses */
|
|
454
|
-
type: AgentMsgType;
|
|
455
|
-
/** Message text from the agent */
|
|
456
|
-
message: string;
|
|
457
|
-
/** Render ID */
|
|
458
|
-
renderId: string;
|
|
459
|
-
}
|
|
418
|
+
export type GenerationStrategy = 'strict' | 'balanced';
|
|
460
419
|
/**
|
|
461
420
|
* Payload for props_update message (Server → Client).
|
|
462
421
|
* Replaces props on an existing rendered component without re-generation.
|
|
463
422
|
*/
|
|
464
423
|
export interface PropsUpdatePayload {
|
|
465
|
-
/**
|
|
466
|
-
|
|
424
|
+
/** GguiSession id of the rendered component being updated. */
|
|
425
|
+
sessionId: string;
|
|
467
426
|
/** New props — full replacement */
|
|
468
427
|
props: JsonObject;
|
|
469
428
|
}
|
|
470
|
-
/**
|
|
471
|
-
* Payload for url message (Server → Client)
|
|
472
|
-
* Note: shortCode is returned; client constructs full URL using renderUrl from amplify_outputs
|
|
473
|
-
*/
|
|
474
|
-
export interface UrlPayload {
|
|
475
|
-
renderId: string;
|
|
476
|
-
shortCode: string;
|
|
477
|
-
}
|
|
478
429
|
/**
|
|
479
430
|
* System-level event actions sent from platform to client.
|
|
480
431
|
*
|
|
@@ -501,15 +452,8 @@ export interface SystemPayload {
|
|
|
501
452
|
status?: string;
|
|
502
453
|
/** App ID requesting access (used with auth_required for app-scoped grants) */
|
|
503
454
|
appId?: string;
|
|
504
|
-
/**
|
|
505
|
-
|
|
506
|
-
}
|
|
507
|
-
/**
|
|
508
|
-
* Payload for internal:progress message (generator → handler)
|
|
509
|
-
*/
|
|
510
|
-
export interface InternalProgressPayload {
|
|
511
|
-
renderId: string;
|
|
512
|
-
step: ProgressStep;
|
|
455
|
+
/** GguiSession ID for WebSocket context (used with auth_required) */
|
|
456
|
+
sessionId?: string;
|
|
513
457
|
}
|
|
514
458
|
/**
|
|
515
459
|
* Payload for `drain_ack` (Server → Client). Sent by `ggui_consume` after
|
|
@@ -532,8 +476,8 @@ export interface InternalProgressPayload {
|
|
|
532
476
|
export interface DrainAckPayload {
|
|
533
477
|
/** Active app id from the bootstrap that emitted the action. */
|
|
534
478
|
appId: string;
|
|
535
|
-
/**
|
|
536
|
-
|
|
479
|
+
/** GguiSession the drained event was queued on. */
|
|
480
|
+
sessionId: string;
|
|
537
481
|
/**
|
|
538
482
|
* Server-assigned `ActionEnvelope.id` of the specific event that
|
|
539
483
|
* was drained. The iframe-runtime keys its toast resolution on this
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live-channel.d.ts","sourceRoot":"","sources":["../../src/types/live-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"live-channel.d.ts","sourceRoot":"","sources":["../../src/types/live-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,OA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vD;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,mCAAmC;IACnC,KAAK,EAAE,UAAU,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,kBAAkB,CAAC;AAEhE;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
* ready.
|
|
52
52
|
*/
|
|
53
53
|
export declare const MODELS: {
|
|
54
|
-
readonly anthropic: readonly ["claude-haiku-4-5-20251001", "claude-sonnet-4-6", "claude-opus-4-7", "claude-opus-4-6"];
|
|
55
|
-
readonly openai: readonly ["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
|
-
readonly google: readonly ["gemini-3.5-flash", "gemini-flash-latest", "gemini-3.1-flash-lite", "gemini-3.1-pro-preview", "gemini-3.1-flash-lite-preview", "gemini-3-flash-preview"];
|
|
54
|
+
readonly anthropic: readonly ["claude-fable-5", "claude-opus-5", "claude-sonnet-5", "claude-haiku-4-5-20251001", "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"];
|
|
56
|
+
readonly google: readonly ["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 ["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
|
-
readonly openrouter: readonly ["anthropic/claude-haiku-4.5", "anthropic/claude-sonnet-4.6", "anthropic/claude-opus-4.7", "openai/gpt-5.5", "openai/gpt-5.5-pro", "openai/gpt-5.4-mini", "openai/gpt-5.4-nano", "google/gemini-3.5-flash", "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"];
|
|
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
|
/**
|
|
61
61
|
* Every supported LLM provider. Adding a new provider = add a key to
|
|
@@ -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/llm-route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAMH;;;;;;;;;;;;;;;;;;;;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;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAEzD;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAQjE;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
|
@@ -57,8 +57,12 @@ export const MODELS = {
|
|
|
57
57
|
anthropic: [
|
|
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
|
-
//
|
|
61
|
-
//
|
|
60
|
+
// the Claude 5 family (2026-07: Opus 5, Sonnet 5, and the
|
|
61
|
+
// Mythos-class Fable 5) and the 4.6/4.7 generation carry undated
|
|
62
|
+
// wire IDs; Haiku 4.5 still uses the dated form.
|
|
63
|
+
'claude-fable-5',
|
|
64
|
+
'claude-opus-5',
|
|
65
|
+
'claude-sonnet-5',
|
|
62
66
|
'claude-haiku-4-5-20251001',
|
|
63
67
|
'claude-sonnet-4-6',
|
|
64
68
|
'claude-opus-4-7',
|
|
@@ -68,6 +72,14 @@ export const MODELS = {
|
|
|
68
72
|
// Per OpenAI's model registry (developers.openai.com/api/docs/models/all).
|
|
69
73
|
// Both unversioned aliases AND dated snapshots are valid wire IDs;
|
|
70
74
|
// we enumerate both because operators reasonably use either.
|
|
75
|
+
// GPT-5.6 family (2026-07): named-suffix tiers — `sol` (deepest
|
|
76
|
+
// reasoning), `terra` (balanced), `luna` (fast/cost). The bare
|
|
77
|
+
// `gpt-5.6` alias routes to Sol on OpenAI's side. No dated
|
|
78
|
+
// siblings registered at adoption time.
|
|
79
|
+
'gpt-5.6',
|
|
80
|
+
'gpt-5.6-sol',
|
|
81
|
+
'gpt-5.6-terra',
|
|
82
|
+
'gpt-5.6-luna',
|
|
71
83
|
'gpt-5.5',
|
|
72
84
|
'gpt-5.5-2026-04-23',
|
|
73
85
|
'gpt-5.5-pro',
|
|
@@ -85,7 +97,9 @@ export const MODELS = {
|
|
|
85
97
|
// Stable + the commonly-used previews. The `-preview` suffix is
|
|
86
98
|
// load-bearing on the wire for preview models — Gemini's API
|
|
87
99
|
// rejects the bare name for those.
|
|
100
|
+
'gemini-3.6-flash',
|
|
88
101
|
'gemini-3.5-flash',
|
|
102
|
+
'gemini-3.5-flash-lite',
|
|
89
103
|
'gemini-flash-latest',
|
|
90
104
|
'gemini-3.1-flash-lite',
|
|
91
105
|
'gemini-3.1-pro-preview',
|
|
@@ -131,16 +145,24 @@ export const MODELS = {
|
|
|
131
145
|
// for Anthropic version (`claude-haiku-4.5`) where Anthropic direct
|
|
132
146
|
// uses dash (`claude-haiku-4-5`) — preserve OpenRouter's wire form.
|
|
133
147
|
// Anthropic family
|
|
148
|
+
'anthropic/claude-fable-5',
|
|
149
|
+
'anthropic/claude-opus-5',
|
|
150
|
+
'anthropic/claude-sonnet-5',
|
|
134
151
|
'anthropic/claude-haiku-4.5',
|
|
135
152
|
'anthropic/claude-sonnet-4.6',
|
|
136
153
|
'anthropic/claude-opus-4.7',
|
|
137
154
|
// OpenAI family
|
|
155
|
+
'openai/gpt-5.6-sol',
|
|
156
|
+
'openai/gpt-5.6-terra',
|
|
157
|
+
'openai/gpt-5.6-luna',
|
|
138
158
|
'openai/gpt-5.5',
|
|
139
159
|
'openai/gpt-5.5-pro',
|
|
140
160
|
'openai/gpt-5.4-mini',
|
|
141
161
|
'openai/gpt-5.4-nano',
|
|
142
162
|
// Google family
|
|
163
|
+
'google/gemini-3.6-flash',
|
|
143
164
|
'google/gemini-3.5-flash',
|
|
165
|
+
'google/gemini-3.5-flash-lite',
|
|
144
166
|
'google/gemini-3.1-pro-preview',
|
|
145
167
|
'google/gemini-3.1-flash-lite',
|
|
146
168
|
// Frontier alternatives
|