@ggui-ai/protocol 0.2.0-alpha.3 → 0.3.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 +64 -0
- package/dist/registry/portable-blueprint.d.ts.map +1 -0
- package/dist/registry/portable-blueprint.js +103 -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 +240 -58
- package/dist/schemas/mcp.d.ts.map +1 -1
- package/dist/schemas/mcp.js +285 -93
- 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 +60 -40
- 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.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 +55 -176
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/types/mcp.js +2 -2
- 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 +53 -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 +5 -46
- 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 +13 -10
- package/dist/validation/hygiene-rules.d.ts.map +1 -1
- package/dist/validation/hygiene-rules.js +20 -14
- 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 +9 -8
- package/dist/validation/lint-contract.d.ts.map +1 -1
- package/dist/validation/lint-contract.js +89 -26
- 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 +21 -8
- package/dist/validation/schema-meta-validation.d.ts.map +1 -1
- package/dist/validation/schema-meta-validation.js +28 -14
- 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 +783 -9
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +782 -8
- package/package.json +2 -2
- 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
|
@@ -85,8 +85,8 @@ export interface PropEntry {
|
|
|
85
85
|
* Data-lineage metadata. When set, the agent must have this tool available
|
|
86
86
|
* (or `required: false` on this prop) for the contract to be satisfiable.
|
|
87
87
|
* When absent, the agent populates the prop by its own means (memory,
|
|
88
|
-
* reasoning, search, etc.).
|
|
89
|
-
*
|
|
88
|
+
* reasoning, search, etc.). The blueprint matcher aggregates these
|
|
89
|
+
* for indexed primary-data-tool candidate lookups.
|
|
90
90
|
*/
|
|
91
91
|
sourceTool?: string;
|
|
92
92
|
}
|
|
@@ -174,26 +174,11 @@ export interface StreamChannelEntry {
|
|
|
174
174
|
* data receipt, `@ggui-ai/react-native` data receipt) all validate
|
|
175
175
|
* deliveries against it.
|
|
176
176
|
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
* `_ggui:contract-error` envelopes with `code: 'SCHEMA_VIOLATION'`
|
|
183
|
-
* rather than silent data, but channel subscribers see fewer
|
|
184
|
-
* refreshes than expected, which looks like a broken tool to
|
|
185
|
-
* operators.
|
|
186
|
-
*
|
|
187
|
-
* **F4 schema compat checker.** The compat relation — every value
|
|
188
|
-
* the tool returns MUST be accepted by this channel schema — is
|
|
189
|
-
* encoded as `isSchemaSubset(channelSchema, toolReturnSchema)` and
|
|
190
|
-
* is checked at push-time (before the stack item commits) and at
|
|
191
|
-
* blueprint-registration time (when the blueprint pre-declares
|
|
192
|
-
* tool refs). Mismatches surface as `SCHEMA_MISMATCH_ERROR` on
|
|
193
|
-
* the reserved `_ggui:contract-error` channel rather than showing
|
|
194
|
-
* up as downstream `SCHEMA_VIOLATION` rejections on individual
|
|
195
|
-
* refreshes. Default policy is `'reject'`; see the docstring on
|
|
196
|
-
* {@link ActionEntry.schema} for the full policy flag contract.
|
|
177
|
+
* When the channel declares a `source.tool` feed, the protocol-level
|
|
178
|
+
* `CTR_SCHEMA_INCOMPAT` linter additionally checks that the feed
|
|
179
|
+
* tool's declared return schema is a subset of this schema — see
|
|
180
|
+
* the docstring on {@link ActionEntry.schema} for the schema-subset
|
|
181
|
+
* algorithm and the `SCHEMA_MISMATCH_ERROR` failure surface.
|
|
197
182
|
*/
|
|
198
183
|
schema: JsonSchema;
|
|
199
184
|
/** Example payload (used for documentation and smoke testing). Typed as {@link JsonValue}. */
|
|
@@ -223,44 +208,6 @@ export interface StreamChannelEntry {
|
|
|
223
208
|
* work lands.
|
|
224
209
|
*/
|
|
225
210
|
complete?: boolean;
|
|
226
|
-
/**
|
|
227
|
-
* Optional MCP tool name this channel is refreshed from when a
|
|
228
|
-
* wired action fires. Consumed by the server-side wiredActionRouter
|
|
229
|
-
* (see `@ggui-ai/mcp-server` session-channel) as a declarative hint:
|
|
230
|
-
* after a wired action on this stack item succeeds, the router
|
|
231
|
-
* invokes the named tool and emits its return value on THIS channel.
|
|
232
|
-
*
|
|
233
|
-
* Name-scoping invariant:
|
|
234
|
-
*
|
|
235
|
-
* A bare tool name (`"tasks_list"`) MUST be unique across every
|
|
236
|
-
* mount registered on the server. `composeHandlersWithMounts` in
|
|
237
|
-
* `@ggui-ai/mcp-server` rejects collisions at boot and names both
|
|
238
|
-
* owners in the error — an operator with two mounts both exposing
|
|
239
|
-
* `list` is forced to rename one. No namespace syntax is accepted
|
|
240
|
-
* here: MCP protocol requires unique tool names on `tools/list` /
|
|
241
|
-
* `tools/call` regardless, so two mounts can't both expose the
|
|
242
|
-
* same name at the wire level. Authors adding a second mount to
|
|
243
|
-
* an existing `ggui.json` SHOULD re-check this invariant; a newly-
|
|
244
|
-
* registered duplicate will fail server boot with a message
|
|
245
|
-
* naming both mounts.
|
|
246
|
-
*
|
|
247
|
-
* Refresh semantics (locked):
|
|
248
|
-
*
|
|
249
|
-
* - The refresh tool SHOULD be idempotent-read-only. The router
|
|
250
|
-
* calls it after every wired action targeting this channel.
|
|
251
|
-
* - On failure, the router emits a `_ggui:contract-error` envelope
|
|
252
|
-
* (see {@link ContractErrorPayload}) and the channel's previous
|
|
253
|
-
* state is preserved — the router does NOT fall back to the
|
|
254
|
-
* wired action's own return value.
|
|
255
|
-
* - Authors who want write-then-read semantics SHOULD chain via a
|
|
256
|
-
* single action tool that returns the new state directly.
|
|
257
|
-
*
|
|
258
|
-
* Absent ⇒ no refresh fires; channel is written to by the agent (or
|
|
259
|
-
* by some other server-emitted source). Declarative hint only — it
|
|
260
|
-
* does NOT alter payload shape validation, which remains
|
|
261
|
-
* `schema`-driven.
|
|
262
|
-
*/
|
|
263
|
-
tool?: string;
|
|
264
211
|
/**
|
|
265
212
|
* Optional source declaration — when present, the channel is fed by
|
|
266
213
|
* a tool called periodically (poll) or subscribed-to (push) by the
|
|
@@ -284,7 +231,7 @@ export interface StreamChannelEntry {
|
|
|
284
231
|
}
|
|
285
232
|
/**
|
|
286
233
|
* Stream contract — describes the typed channels the component consumes
|
|
287
|
-
* on the live
|
|
234
|
+
* on the live render plane (the live channel in the three-channel doctrine).
|
|
288
235
|
*
|
|
289
236
|
* Shape: flat map keyed by channel name → entry.
|
|
290
237
|
* `DataContract.streamSpec[channelName]` IS the entry.
|
|
@@ -319,7 +266,7 @@ export interface ActionEntry {
|
|
|
319
266
|
* advisory — the agent owns the actual tool call on its next turn
|
|
320
267
|
* and is responsible for shaping the payload as the tool expects.
|
|
321
268
|
* For tools registered on THIS server, the F4 schema-compat checker
|
|
322
|
-
* surfaces a `SCHEMA_MISMATCH_ERROR` at
|
|
269
|
+
* surfaces a `SCHEMA_MISMATCH_ERROR` at render-time / blueprint-
|
|
323
270
|
* registration-time so authors get fail-loud feedback.
|
|
324
271
|
*
|
|
325
272
|
* The canonical algorithm lives in
|
|
@@ -363,7 +310,7 @@ export interface ActionEntry {
|
|
|
363
310
|
* agent without rejection. If the named tool isn't in the agent's
|
|
364
311
|
* toolbox at dispatch time, the agent surfaces the gap on its next
|
|
365
312
|
* turn (typically as `TOOL_UNAVAILABLE`); the protocol does NOT
|
|
366
|
-
* fail at
|
|
313
|
+
* fail at render.
|
|
367
314
|
*/
|
|
368
315
|
nextStep?: string;
|
|
369
316
|
}
|
|
@@ -375,87 +322,43 @@ export interface ActionEntry {
|
|
|
375
322
|
*/
|
|
376
323
|
export type ActionSpec = Record<string, ActionEntry>;
|
|
377
324
|
/**
|
|
378
|
-
*
|
|
379
|
-
*
|
|
380
|
-
* for the broader refresh-semantics lock.
|
|
381
|
-
*
|
|
382
|
-
* **v1 constraint: always empty.** Refresh tools MUST be parameterless
|
|
383
|
-
* (filter-less, context-less). Authors who need filtered / contextual
|
|
384
|
-
* reads should chain the filter into a single action tool that returns
|
|
385
|
-
* the filtered state directly — the refresh path is deliberately a
|
|
386
|
-
* read-only re-fetch of the channel's canonical state.
|
|
387
|
-
*
|
|
388
|
-
* Typed as `Record<string, never>` (empty object with no properties)
|
|
389
|
-
* rather than an empty interface so the type stays structurally
|
|
390
|
-
* assignable to `Record<string, unknown>` call sites (e.g.,
|
|
391
|
-
* `WiredActionRouter.invoke`) without any cast.
|
|
392
|
-
*
|
|
393
|
-
* This type is named separately from `{}` so that:
|
|
394
|
-
*
|
|
395
|
-
* 1. Call sites are grep-able — producers and consumers that need to
|
|
396
|
-
* reason about the refresh-input contract can find each other.
|
|
397
|
-
* 2. v2 evolution (e.g., passing `{renderId}` / `{actor}` context on
|
|
398
|
-
* refresh) has a single point to widen; today's `{}` literal
|
|
399
|
-
* wouldn't trip any compile error if the wire expectation
|
|
400
|
-
* changed.
|
|
401
|
-
* 3. Implementations of {@link WiredActionRouter} that want to treat
|
|
402
|
-
* refresh inputs specially (e.g., route through a different
|
|
403
|
-
* invoker) can pattern-match on the type.
|
|
404
|
-
*/
|
|
405
|
-
export type RefreshInput = Record<string, never>;
|
|
406
|
-
/**
|
|
407
|
-
* Frozen singleton instance of {@link RefreshInput}. Pass this to
|
|
408
|
-
* refresh-tool invocations instead of a fresh `{}` literal so that:
|
|
409
|
-
*
|
|
410
|
-
* - Every call site emits exactly the same reference (cheap identity
|
|
411
|
-
* checks in mocks / spies / test harnesses).
|
|
412
|
-
* - `Object.freeze` catches accidental mutation that would otherwise
|
|
413
|
-
* surface as cross-invocation interference in long-running servers.
|
|
414
|
-
*/
|
|
415
|
-
export declare const EMPTY_REFRESH_INPUT: RefreshInput;
|
|
416
|
-
/**
|
|
417
|
-
* Per-tool metadata in an {@link AgentCapabilitiesSpec}.
|
|
325
|
+
* Per-tool metadata in an {@link AgentCapabilitiesSpec}, keyed by the
|
|
326
|
+
* bare MCP tool name (the catalog key) in {@link AgentCapabilitiesSpec.tools}.
|
|
418
327
|
*
|
|
419
328
|
* Documents an MCP tool the contract references — by `actionSpec[*].nextStep`,
|
|
420
329
|
* by `streamSpec[*].source.tool`, or simply for the LLM-authoring catalog.
|
|
421
|
-
*
|
|
422
|
-
*
|
|
330
|
+
*
|
|
331
|
+
* Shape: `serverInfo` (OPTIONAL) carries the owning MCP server identity;
|
|
332
|
+
* `(serverInfo.name, toolName)` is the canonical cross-framework identity and
|
|
333
|
+
* enters the contract hash. In Tier 2 the LLM derives `serverInfo.name` from
|
|
334
|
+
* the `mcp__<server>__` tool prefix (omit when there is no prefix — never
|
|
335
|
+
* invent); in Tier 1 the agent-server catalog fills it from `initialize`.
|
|
336
|
+
* `serverInfo.version` is OPTIONAL metadata, NOT identity (never enters the
|
|
337
|
+
* hash). `toolInfo` echoes the MCP `tools/list` descriptor (minus `name`, which is the
|
|
338
|
+
* catalog key). The ggui authoring layer adds `usage` + `example` on top
|
|
339
|
+
* of the MCP-native descriptor. The `example` field's `input`/`output`
|
|
340
|
+
* keys align with MCP's tool envelope naming so the contract reads
|
|
341
|
+
* identically to what the agent's MCP client sees.
|
|
423
342
|
*/
|
|
424
343
|
export interface AgentToolEntry {
|
|
425
|
-
/**
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
|
|
431
|
-
|
|
344
|
+
/** Owning MCP server identity. OPTIONAL: populated by the agent-server
|
|
345
|
+
* catalog-builder (Tier 1) or derived by the LLM from the mcp__<server>__
|
|
346
|
+
* prefix (Tier 2). (serverInfo.name, toolName) is the canonical identity;
|
|
347
|
+
* `version` is OPTIONAL metadata (catalog fills it; prefix-authoring omits it)
|
|
348
|
+
* and is stripped from the canonical hash. */
|
|
349
|
+
serverInfo?: {
|
|
350
|
+
name: string;
|
|
351
|
+
version?: string;
|
|
352
|
+
};
|
|
353
|
+
/** MCP tool descriptor, echoed from `tools/list` (minus name = the catalog key). */
|
|
354
|
+
toolInfo: {
|
|
355
|
+
/** JSON Schema for the tool input. REQUIRED — every MCP tool has one. */
|
|
356
|
+
inputSchema: JsonSchema;
|
|
357
|
+
description?: string;
|
|
358
|
+
outputSchema?: JsonSchema;
|
|
359
|
+
};
|
|
360
|
+
/** ggui authoring layer (not MCP): when/why/by-whom the tool is called. */
|
|
432
361
|
usage?: string;
|
|
433
|
-
/**
|
|
434
|
-
* JSON Schema for the tool's input. MCP-aligned name. Optional —
|
|
435
|
-
* may be hydrated from MCP registry at generation time for tools the
|
|
436
|
-
* server can introspect; opaque for tools on other MCP servers.
|
|
437
|
-
*/
|
|
438
|
-
inputSchema?: JsonSchema;
|
|
439
|
-
/**
|
|
440
|
-
* JSON Schema for the tool's output. MCP-aligned name. Optional —
|
|
441
|
-
* same hydration story as `inputSchema`.
|
|
442
|
-
*/
|
|
443
|
-
outputSchema?: JsonSchema;
|
|
444
|
-
/**
|
|
445
|
-
* Whether the contract is unsatisfiable if the agent's MCP toolbox
|
|
446
|
-
* lacks this tool. Advisory in v1: enforcement happens at dispatch
|
|
447
|
-
* time (the agent gets `TOOL_UNAVAILABLE` if the named tool isn't
|
|
448
|
-
* registered), not at push time. Future: agent reports its toolbox
|
|
449
|
-
* on handshake; server can validate `required: true` proactively.
|
|
450
|
-
*
|
|
451
|
-
* Default: `false`. UI/agent code MUST guard against absence (e.g.,
|
|
452
|
-
* conditional render, fallback reasoning).
|
|
453
|
-
*/
|
|
454
|
-
required?: boolean;
|
|
455
|
-
/**
|
|
456
|
-
* Example input/output pair for documentation and boilerplate
|
|
457
|
-
* generation. Keys `input` / `output` are MCP-aligned.
|
|
458
|
-
*/
|
|
459
362
|
example?: {
|
|
460
363
|
input: JsonValue;
|
|
461
364
|
output: JsonValue;
|
|
@@ -492,7 +395,7 @@ export interface AgentCapabilitiesSpec {
|
|
|
492
395
|
export interface GadgetExportBase {
|
|
493
396
|
/**
|
|
494
397
|
* Human-readable description of what this export does. REQUIRED on
|
|
495
|
-
* the registry side; optional on the contract side (
|
|
398
|
+
* the registry side; optional on the contract side (render-time merge
|
|
496
399
|
* inherits the registry copy when absent).
|
|
497
400
|
*/
|
|
498
401
|
description?: string;
|
|
@@ -520,12 +423,6 @@ export interface GadgetExportBase {
|
|
|
520
423
|
* carries it.
|
|
521
424
|
*/
|
|
522
425
|
permission?: string;
|
|
523
|
-
/**
|
|
524
|
-
* Whether the UI MUST mount this export for the contract to be
|
|
525
|
-
* satisfiable. Default `false`. Advisory in v1 — enforced at
|
|
526
|
-
* boilerplate-generation time, not at runtime.
|
|
527
|
-
*/
|
|
528
|
-
required?: boolean;
|
|
529
426
|
}
|
|
530
427
|
/**
|
|
531
428
|
* A hook export — a `use`-prefixed React hook the generated component
|
|
@@ -590,13 +487,13 @@ export type GadgetExport = GadgetHookExport | GadgetComponentExport;
|
|
|
590
487
|
* `requires`, `typesUrl`, …) or per-export registry metadata
|
|
591
488
|
* (`permission`, `example`, `gotchas`). All of that belongs to the
|
|
592
489
|
* registered {@link GadgetDescriptor} the ggui server resolves from
|
|
593
|
-
* the app's `App.gadgets` catalog at
|
|
490
|
+
* the app's `App.gadgets` catalog at render time — `version` is the
|
|
594
491
|
* operator's deployment pin, not the agent's to author.
|
|
595
492
|
*/
|
|
596
493
|
export interface GadgetExportUse {
|
|
597
494
|
/**
|
|
598
495
|
* Intent-specific override of the registered export's description.
|
|
599
|
-
* When omitted,
|
|
496
|
+
* When omitted, render-time resolution inherits the registered
|
|
600
497
|
* description verbatim; when present, the agent's prose wins.
|
|
601
498
|
*/
|
|
602
499
|
description?: string;
|
|
@@ -623,7 +520,7 @@ export type GadgetPackageUse = Record<string, GadgetExportUse>;
|
|
|
623
520
|
* `listContractGadgets` from the package-keyed
|
|
624
521
|
* {@link ClientCapabilitiesSpec.gadgets}.
|
|
625
522
|
*
|
|
626
|
-
* NOT a wire type: an internal convenience so the
|
|
523
|
+
* NOT a wire type: an internal convenience so the render gates, the
|
|
627
524
|
* descriptor resolver, and code-gen can iterate `(package, name)`
|
|
628
525
|
* pairs uniformly instead of re-walking the nested wire map.
|
|
629
526
|
*/
|
|
@@ -645,7 +542,7 @@ export interface GadgetUse {
|
|
|
645
542
|
* `version`) and a single bundle. Transport metadata (`bundleUrl`,
|
|
646
543
|
* `bundleSri`, `bundleHost`, `styleUrl`, `connect`, `requires`,
|
|
647
544
|
* `typesUrl`, `typesSri`) is per-PACKAGE; teaching text + `permission`
|
|
648
|
-
*
|
|
545
|
+
* are per-EXPORT (on each `exports[*]`).
|
|
649
546
|
*
|
|
650
547
|
* One shape used by:
|
|
651
548
|
*
|
|
@@ -655,10 +552,10 @@ export interface GadgetUse {
|
|
|
655
552
|
* teaching text + an enum-tight `permission` per export;
|
|
656
553
|
* `registeredGadgetDescriptorSchema` additionally requires
|
|
657
554
|
* `typesUrl` for non-stdlib packages.
|
|
658
|
-
* - **Resolved sidecar side** — at
|
|
555
|
+
* - **Resolved sidecar side** — at render time
|
|
659
556
|
* `filterDescriptorsToContract` snapshots the subset of
|
|
660
557
|
* `App.gadgets` the contract references onto
|
|
661
|
-
* `
|
|
558
|
+
* `ComponentGguiSession.gadgetDescriptors`. Wire-side authors NEVER
|
|
662
559
|
* see this shape; they author the package-keyed
|
|
663
560
|
* {@link ClientCapabilitiesSpec} map of {@link GadgetPackageUse}.
|
|
664
561
|
*
|
|
@@ -673,14 +570,14 @@ export interface GadgetDescriptor {
|
|
|
673
570
|
* least one (enforced by the schema). Each {@link GadgetExport}
|
|
674
571
|
* carries its own identifier (`hook` or `component`) + teaching text
|
|
675
572
|
* (`description` / `usage` / `example` / `gotchas`) + per-export
|
|
676
|
-
* `permission
|
|
573
|
+
* `permission`.
|
|
677
574
|
*/
|
|
678
575
|
exports: GadgetExport[];
|
|
679
576
|
/**
|
|
680
577
|
* Exact semver pin (e.g., `'0.0.1'`, `'1.2.3-beta.1'`). REQUIRED.
|
|
681
578
|
* Registry-side ONLY — the wire carries no version; the operator's
|
|
682
579
|
* `App.gadgets` catalog is the sole version pin, resolved
|
|
683
|
-
* server-side at
|
|
580
|
+
* server-side at render time. `(package, version)` is the registry's
|
|
684
581
|
* frozen identity tuple. Bumping requires a new `bundleSri` /
|
|
685
582
|
* `typesSri` (registry-immutability invariant enforced by
|
|
686
583
|
* `lintGadgetCatalog`).
|
|
@@ -720,7 +617,7 @@ export interface GadgetDescriptor {
|
|
|
720
617
|
bundleUrl?: string;
|
|
721
618
|
/**
|
|
722
619
|
* Registry hostname (no scheme, no path) the server uses to resolve
|
|
723
|
-
* `bundleUrl` + `styleUrl` at
|
|
620
|
+
* `bundleUrl` + `styleUrl` at render time:
|
|
724
621
|
*
|
|
725
622
|
* `https://<bundleHost>/bundles/<scope>/<name>/<version>/bundle.js`
|
|
726
623
|
* `https://<bundleHost>/bundles/<scope>/<name>/<version>/style.css`
|
|
@@ -797,7 +694,7 @@ export interface GadgetDescriptor {
|
|
|
797
694
|
* `tsup --dts`) over the wrapper source and uploads the emitted
|
|
798
695
|
* `.d.ts` alongside the bundle; the registry stamps the URL here.
|
|
799
696
|
*
|
|
800
|
-
* The handler parallel-fetches every `typesUrl` at
|
|
697
|
+
* The handler parallel-fetches every `typesUrl` at render time
|
|
801
698
|
* (`fetchGadgetTypes`), verifies the SHA-384 SRI against
|
|
802
699
|
* {@link typesSri}, and loads the `.d.ts` content into the code-gen
|
|
803
700
|
* sandbox's virtual file system at
|
|
@@ -841,7 +738,7 @@ export interface GadgetDescriptor {
|
|
|
841
738
|
* Non-generic — the wire surface carries package-keyed
|
|
842
739
|
* {@link GadgetPackageUse} values. The post-resolution view (full
|
|
843
740
|
* descriptors for hygiene + transport metadata derivation) lives on
|
|
844
|
-
* `
|
|
741
|
+
* `ComponentGguiSession.gadgetDescriptors` as a sidecar, NOT as an
|
|
845
742
|
* enrichment overlay on this type.
|
|
846
743
|
*/
|
|
847
744
|
export interface ClientCapabilitiesSpec {
|
|
@@ -943,12 +840,12 @@ export type ContextSpec = Record<string, ContextEntry>;
|
|
|
943
840
|
* - `null` → `null`
|
|
944
841
|
* 3. `undefined` (caller validates / rejects)
|
|
945
842
|
*
|
|
946
|
-
*
|
|
843
|
+
* Render-time validators MUST reject contextSpec entries that resolve
|
|
947
844
|
* to `undefined` here (e.g., schema is `oneOf` with no clear primitive
|
|
948
845
|
* type — author MUST provide an explicit `default` for such schemas).
|
|
949
846
|
*
|
|
950
847
|
* Consumed by the boilerplate generator's useState emission and by
|
|
951
|
-
* the
|
|
848
|
+
* the render-time validator's default-derivability rule.
|
|
952
849
|
*
|
|
953
850
|
* @public
|
|
954
851
|
*/
|
|
@@ -957,7 +854,7 @@ export declare function deriveContextDefault(entry: ContextEntry): JsonValue | u
|
|
|
957
854
|
* Data contract that bind a generated component to its consumers.
|
|
958
855
|
*
|
|
959
856
|
* Seven parts:
|
|
960
|
-
* - **intent**: WHY this UI exists — concise purpose capturing user goal, data shown, and interaction pattern (NOT a contract field; threaded externally on `ggui_handshake({
|
|
857
|
+
* - **intent**: WHY this UI exists — concise purpose capturing user goal, data shown, and interaction pattern (NOT a contract field; threaded externally on `ggui_handshake({sessionId, intent})`)
|
|
961
858
|
* - **propsSpec**: WHAT data the UI renders initially (set on render, mutated via ggui_update) — agent → client one-shot
|
|
962
859
|
* - **streamSpec**: WHAT live data the UI accepts — flat map keyed by channel name (agent → client live)
|
|
963
860
|
* - **contextSpec**: WHAT observable client state the LLM sees — flat map keyed by slot name (client → agent live, last-write-wins state)
|
|
@@ -1015,9 +912,9 @@ export declare function deriveContextDefault(entry: ContextEntry): JsonValue | u
|
|
|
1015
912
|
* },
|
|
1016
913
|
* agentCapabilities: {
|
|
1017
914
|
* tools: {
|
|
1018
|
-
* todo_toggle: { description: 'Flip a todo done/undone',
|
|
915
|
+
* todo_toggle: { toolInfo: { description: 'Flip a todo done/undone',
|
|
1019
916
|
* inputSchema: { type: 'object', properties: { id: {type:'string'} },
|
|
1020
|
-
* required: ['id'] } },
|
|
917
|
+
* required: ['id'] } } },
|
|
1021
918
|
* },
|
|
1022
919
|
* },
|
|
1023
920
|
* }
|
|
@@ -1088,109 +985,10 @@ export interface DataContract {
|
|
|
1088
985
|
* Wire-side only. Package-keyed — values are {@link GadgetPackageUse}
|
|
1089
986
|
* (per-package export-use maps keyed by export name). The
|
|
1090
987
|
* post-resolution descriptor view lives on
|
|
1091
|
-
* `
|
|
988
|
+
* `ComponentGguiSession.gadgetDescriptors` as a sidecar.
|
|
1092
989
|
*/
|
|
1093
990
|
clientCapabilities?: ClientCapabilitiesSpec;
|
|
1094
991
|
}
|
|
1095
|
-
/**
|
|
1096
|
-
* Canonical error codes emitted on the reserved
|
|
1097
|
-
* `_ggui:contract-error` channel when a declared
|
|
1098
|
-
* `streamSpec[name].source.tool` (continuous feed),
|
|
1099
|
-
* `streamSpec[name].tool` (refresh-after-action hint, agent-less
|
|
1100
|
-
* deployments only), or a session-level boot failure happens. Emitted
|
|
1101
|
-
* as the body of a stream envelope.
|
|
1102
|
-
*
|
|
1103
|
-
* v1 codes emitted by `@ggui-ai/mcp-server`'s session-channel router:
|
|
1104
|
-
*
|
|
1105
|
-
* - `TOOL_NOT_FOUND` — declared tool not registered on the wired
|
|
1106
|
-
* action router. Author wiring bug.
|
|
1107
|
-
* - `TOOL_THREW` — the tool handler threw (sync or async rejection).
|
|
1108
|
-
* Handler failure captured verbatim in `message`; original stack (if
|
|
1109
|
-
* any) lives on `causedBy`.
|
|
1110
|
-
* - `TOOL_TIMEOUT` — invocation exceeded the router's configured
|
|
1111
|
-
* timeout (default 30s). Handler may still complete in the
|
|
1112
|
-
* background; caller must treat as failure either way.
|
|
1113
|
-
* - `SCHEMA_VIOLATION` — the tool returned a shape that violates the
|
|
1114
|
-
* declared `streamSpec[name].schema`. Router rejected
|
|
1115
|
-
* BEFORE emitting on the channel, so subscribers do NOT see the
|
|
1116
|
-
* malformed payload.
|
|
1117
|
-
*
|
|
1118
|
-
* Extensibility — typed as `'TOOL_NOT_FOUND' | 'TOOL_THREW' |
|
|
1119
|
-
* 'TOOL_TIMEOUT' | 'SCHEMA_VIOLATION' | 'SCHEMA_MISMATCH_ERROR' |
|
|
1120
|
-
* (string & {})` rather than a closed union. Consumers MUST handle
|
|
1121
|
-
* unknown codes gracefully — render as raw string, not switch-case
|
|
1122
|
-
* without default. Future failure modes that may populate this field
|
|
1123
|
-
* include `'SANITIZER_FAILED'` (the `causedBy` sanitizer itself
|
|
1124
|
-
* threw), `'MCP_TRANSPORT_ERROR'` (the MCP transport rejected the
|
|
1125
|
-
* tool invocation before the handler ran), `'RATE_LIMIT_EXCEEDED'`
|
|
1126
|
-
* (the tool was refused by an upstream rate limiter), and
|
|
1127
|
-
* `'BOOTSTRAP_FAILED'` (C8 — initial contract bootstrap failed on
|
|
1128
|
-
* attach). Adding such codes does NOT bump the protocol version,
|
|
1129
|
-
* because the type was extensible from day one.
|
|
1130
|
-
*
|
|
1131
|
-
* `'SCHEMA_MISMATCH_ERROR'` — F4 schema compat checker. Emitted when
|
|
1132
|
-
* `actionSpec[name].schema` and its declared `tool`'s inputSchema
|
|
1133
|
-
* disagree, or when a `streamSpec[channel].schema` and its declared
|
|
1134
|
-
* `tool`'s return schema disagree. Fires at push-time (before the
|
|
1135
|
-
* stack item commits) and at blueprint-registration time. See
|
|
1136
|
-
* {@link ActionEntry.schema} and {@link StreamChannelEntry.schema}
|
|
1137
|
-
* for the author invariant, and `@ggui-ai/protocol/validation/
|
|
1138
|
-
* schema-subset` for the subset algorithm that produces the named
|
|
1139
|
-
* failure. Provides a named, actionable signal before a malformed
|
|
1140
|
-
* envelope reaches the agentic loop — instead of a silent `TOOL_THREW`
|
|
1141
|
-
* at runtime.
|
|
1142
|
-
*
|
|
1143
|
-
* `'RENDER_NOT_FOUND'` + `'AUTH_REJECTED'` — fire on post-WS-open
|
|
1144
|
-
* boot failures where the live channel is already alive (so the envelope-
|
|
1145
|
-
* emittable invariant is satisfied). The renderer bundle surfaces
|
|
1146
|
-
* them BOTH on the live-channel `_ggui:contract-error` envelope (with
|
|
1147
|
-
* `sourceAction.type === 'bootstrap-load'`) AND as a
|
|
1148
|
-
* `postMessage({type:'ggui:bootstrap-failed', reason, message})` to
|
|
1149
|
-
* the embedding host — the former for in-session observability, the
|
|
1150
|
-
* latter for host-level UX response. Pre-WS bootstrap failures
|
|
1151
|
-
* (`BUNDLE_FETCH_FAILED`, `CSP_VIOLATION`, `BOOTSTRAP_META_MISSING`)
|
|
1152
|
-
* are postMessage-only: they can't reach the live channel because the WS
|
|
1153
|
-
* doesn't exist yet, so they remain OUT of `ContractErrorCode`'s
|
|
1154
|
-
* named set to preserve the "live-channel-emittable" invariant. The
|
|
1155
|
-
* renderer's `BootstrapFailureReason` union (in `@ggui-ai/iframe-runtime`)
|
|
1156
|
-
* carries ALL bootstrap codes — `ContractErrorCode` is the strict
|
|
1157
|
-
* subset that's observable on the contract-error envelope.
|
|
1158
|
-
*/
|
|
1159
|
-
export type ContractErrorCode = 'TOOL_NOT_FOUND' | 'TOOL_THREW' | 'TOOL_TIMEOUT' | 'SCHEMA_VIOLATION' | 'SCHEMA_MISMATCH_ERROR' | 'RENDER_NOT_FOUND' | 'AUTH_REJECTED'
|
|
1160
|
-
/**
|
|
1161
|
-
* `'INVALID_ACTION_KIND'` — emitted when the
|
|
1162
|
-
* `ggui_runtime_submit_action` handler receives an envelope whose `kind`
|
|
1163
|
-
* discriminator OR per-kind payload shape is malformed. Source of
|
|
1164
|
-
* truth for the envelope contract is `SubmitActionEnvelope` /
|
|
1165
|
-
* `GguiSubmitActionInput` in `@ggui-ai/protocol/integrations/mcp-apps`.
|
|
1166
|
-
* Fail-soft at the client: the primary host effect (the `ui/message`
|
|
1167
|
-
* / `ui/open-link` / 3-message-bridge call alongside the audit) MUST
|
|
1168
|
-
* still succeed; this code surfaces only on the server-side
|
|
1169
|
-
* `_ggui:contract-error` channel for operator observability.
|
|
1170
|
-
*/
|
|
1171
|
-
| 'INVALID_ACTION_KIND'
|
|
1172
|
-
/**
|
|
1173
|
-
* `'PIPE_NOT_FOUND'` — surfaced when `ggui_runtime_submit_action`
|
|
1174
|
-
* receives a `kind:"dispatch"` envelope referencing a `renderId`
|
|
1175
|
-
* whose pending-events pipe is closed/missing (drained, render
|
|
1176
|
-
* closed, or never opened). The handler returns `{ok:false, code:
|
|
1177
|
-
* 'PIPE_NOT_FOUND'}` in structuredContent; the iframe-runtime
|
|
1178
|
-
* inspects the response (via the host's postMessage relay) and
|
|
1179
|
-
* falls through to the `ui/message` chat-shortcut postMessage so
|
|
1180
|
-
* the gesture still reaches the agent (via the next chat turn)
|
|
1181
|
-
* instead of vanishing silently.
|
|
1182
|
-
*/
|
|
1183
|
-
| 'PIPE_NOT_FOUND'
|
|
1184
|
-
/**
|
|
1185
|
-
* `'CONTEXT_TOO_LARGE'` — emitted when `ggui_runtime_sync_context`
|
|
1186
|
-
* receives a snapshot that exceeds the contextSpec size limits:
|
|
1187
|
-
* per-slot value > {@link CONTEXT_SLOT_VALUE_MAX_BYTES} (16 KB),
|
|
1188
|
-
* total snapshot > {@link CONTEXT_SNAPSHOT_MAX_BYTES} (64 KB), or
|
|
1189
|
-
* slot count > {@link CONTEXT_SNAPSHOT_MAX_SLOTS} (50). Reject
|
|
1190
|
-
* instead of truncate so authors notice and route the data through
|
|
1191
|
-
* the right surface (propsSpec / streamSpec / a tool call).
|
|
1192
|
-
*/
|
|
1193
|
-
| 'CONTEXT_TOO_LARGE' | (string & {});
|
|
1194
992
|
/**
|
|
1195
993
|
* Maximum byte size (UTF-8) of a single contextSpec slot's value
|
|
1196
994
|
* accepted by `ggui_runtime_sync_context`. Values larger than this
|
|
@@ -1210,87 +1008,4 @@ export declare const CONTEXT_SNAPSHOT_MAX_BYTES: number;
|
|
|
1210
1008
|
* more slots reject with `CONTEXT_TOO_LARGE`.
|
|
1211
1009
|
*/
|
|
1212
1010
|
export declare const CONTEXT_SNAPSHOT_MAX_SLOTS = 50;
|
|
1213
|
-
/**
|
|
1214
|
-
* The body of a stream envelope the server emits on the reserved
|
|
1215
|
-
* `_ggui:contract-error` channel when a wired-action or refresh-stream
|
|
1216
|
-
* invocation fails. Carries enough shape to surface the failure in
|
|
1217
|
-
* operator-facing activity panels AND to correlate back to the
|
|
1218
|
-
* originating dispatch.
|
|
1219
|
-
*
|
|
1220
|
-
* Design notes:
|
|
1221
|
-
*
|
|
1222
|
-
* - This is a PLATFORM-EMITTED envelope. Agents MUST NOT author
|
|
1223
|
-
* deliveries on `_ggui:contract-error` — the reserved-channel
|
|
1224
|
-
* validator rejects them.
|
|
1225
|
-
* - The payload is a leaf-level contract: it does NOT wrap a
|
|
1226
|
-
* semantic payload for the author to interpret. Consumers render
|
|
1227
|
-
* it as an error activity row, NOT as a declared channel's data.
|
|
1228
|
-
* - The shape intentionally omits retry / recovery metadata. Retries
|
|
1229
|
-
* are an explicit non-goal of the v1 contract.
|
|
1230
|
-
*/
|
|
1231
|
-
export interface ContractErrorPayload {
|
|
1232
|
-
/** The tool that failed — wired-action tool OR refresh-stream tool. */
|
|
1233
|
-
readonly toolName: string;
|
|
1234
|
-
/** The originating action name when the error came from a wired
|
|
1235
|
-
* action. Absent when the failure occurred on a refresh-stream path
|
|
1236
|
-
* that fired after a successful wired action. */
|
|
1237
|
-
readonly actionName?: string;
|
|
1238
|
-
/** Provenance on the router side — whether this error came from the
|
|
1239
|
-
* wired-action invocation (directly in response to a dispatch) or
|
|
1240
|
-
* from the refresh-stream tool that followed a successful action.
|
|
1241
|
-
*
|
|
1242
|
-
* v1 values emitted by `@ggui-ai/mcp-server`'s session-channel
|
|
1243
|
-
* router:
|
|
1244
|
-
*
|
|
1245
|
-
* - `'wired-action'` — failure surfaced on the wired-action dispatch
|
|
1246
|
-
* path (the originating tool threw, was not found, or timed out).
|
|
1247
|
-
* - `'refresh-stream'` — failure surfaced on the refresh tool that
|
|
1248
|
-
* fires after a successful wired action (declared via
|
|
1249
|
-
* {@link StreamChannelEntry.tool}).
|
|
1250
|
-
*
|
|
1251
|
-
* Extensibility — typed as `(string & {}) | 'wired-action' |
|
|
1252
|
-
* 'refresh-stream'` rather than a closed union. Consumers MUST handle
|
|
1253
|
-
* unknown values gracefully (render as the raw string, not a hard
|
|
1254
|
-
* switch-case that throws). Future router sources that may populate
|
|
1255
|
-
* this field include `'bootstrap-refresh'` (initial attach-time
|
|
1256
|
-
* refresh before the first wired action), `'scheduled-refresh'` (a
|
|
1257
|
-
* timer-driven refresh independent of any action), and
|
|
1258
|
-
* `'session-restore'` (a refresh fired after a session-resume
|
|
1259
|
-
* hydration). Adding such values does NOT bump the protocol version,
|
|
1260
|
-
* because the type was extensible from day one. */
|
|
1261
|
-
readonly sourceAction?: {
|
|
1262
|
-
readonly type: 'wired-action' | 'refresh-stream' | (string & {});
|
|
1263
|
-
/** ISO 8601 timestamp when the originating dispatch hit the router. */
|
|
1264
|
-
readonly dispatchedAt: string;
|
|
1265
|
-
};
|
|
1266
|
-
readonly error: {
|
|
1267
|
-
readonly code: ContractErrorCode;
|
|
1268
|
-
/** Short, author-readable failure summary. Safe to log/display. */
|
|
1269
|
-
readonly message: string;
|
|
1270
|
-
/** Optional stringified original error (typically `error.stack`) for
|
|
1271
|
-
* debugging. Producers MUST pipe the raw string through
|
|
1272
|
-
* {@link sanitizeCausedBy} (or an operator-supplied stricter
|
|
1273
|
-
* sanitizer) before populating this field — the envelope rides
|
|
1274
|
-
* `_ggui:contract-error` which is `replay: 'all'`, so anything
|
|
1275
|
-
* landed here persists in the session ring buffer and surfaces in
|
|
1276
|
-
* operator tools. The default sanitizer redacts
|
|
1277
|
-
* Bearer tokens, query-param secrets, and common env-var dumps, and
|
|
1278
|
-
* truncates at 2KB. `@ggui-ai/mcp-server`'s session-channel router
|
|
1279
|
-
* applies it by default; alternative producers MUST match that
|
|
1280
|
-
* posture. */
|
|
1281
|
-
readonly causedBy?: string;
|
|
1282
|
-
};
|
|
1283
|
-
/** ISO 8601 timestamp of the error envelope itself. */
|
|
1284
|
-
readonly timestamp: string;
|
|
1285
|
-
/**
|
|
1286
|
-
* Protocol schema version stamped by the producer. Pre-launch:
|
|
1287
|
-
* advisory — consumers MUST NOT reject on mismatch. At launch
|
|
1288
|
-
* cutover, policy tightens so operators can surface an
|
|
1289
|
-
* UPGRADE_REQUIRED state when the received major diverges from the
|
|
1290
|
-
* client's known major.
|
|
1291
|
-
*
|
|
1292
|
-
* See `PROTOCOL_SCHEMA_VERSION` for the current value.
|
|
1293
|
-
*/
|
|
1294
|
-
readonly schemaVersion?: string;
|
|
1295
|
-
}
|
|
1296
1011
|
//# sourceMappingURL=data-contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-contract.d.ts","sourceRoot":"","sources":["../../src/types/data-contract.ts"],"names":[],"mappings":"AAwCA;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;CACtC;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,EAAE,GACX,UAAU,CAAC;AAMf;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAW,SAAQ,UAAU;IAC5C,oEAAoE;IACpE,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;IACnB,oBAAoB;IACpB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,uDAAuD;IACvD,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U,CAAC;IACxB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,sEAAsE;IACtE,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;IAC1C;;;;;;;;;;;OAWG;IACH,kBAAkB,CAAC,EAAE,sBAAsB,CAAC;CAC7C;AAMD;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,QAAY,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,QAAY,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,KAAK,CAAC"}
|
|
@@ -39,16 +39,6 @@ export const DEFAULT_STREAM_CHANNEL_MODE = 'append';
|
|
|
39
39
|
export const DEFAULT_STREAM_REPLAY_POLICY = 'none';
|
|
40
40
|
/** Locked default applied when {@link StreamChannelEntry.complete} is omitted. */
|
|
41
41
|
export const DEFAULT_STREAM_CHANNEL_COMPLETE = false;
|
|
42
|
-
/**
|
|
43
|
-
* Frozen singleton instance of {@link RefreshInput}. Pass this to
|
|
44
|
-
* refresh-tool invocations instead of a fresh `{}` literal so that:
|
|
45
|
-
*
|
|
46
|
-
* - Every call site emits exactly the same reference (cheap identity
|
|
47
|
-
* checks in mocks / spies / test harnesses).
|
|
48
|
-
* - `Object.freeze` catches accidental mutation that would otherwise
|
|
49
|
-
* surface as cross-invocation interference in long-running servers.
|
|
50
|
-
*/
|
|
51
|
-
export const EMPTY_REFRESH_INPUT = Object.freeze({});
|
|
52
42
|
/** Locked default applied when {@link ContextEntry.debounceMs}
|
|
53
43
|
* is omitted. */
|
|
54
44
|
export const DEFAULT_CONTEXT_DEBOUNCE_MS = 300;
|
|
@@ -66,12 +56,12 @@ export const DEFAULT_CONTEXT_DEBOUNCE_MS = 300;
|
|
|
66
56
|
* - `null` → `null`
|
|
67
57
|
* 3. `undefined` (caller validates / rejects)
|
|
68
58
|
*
|
|
69
|
-
*
|
|
59
|
+
* Render-time validators MUST reject contextSpec entries that resolve
|
|
70
60
|
* to `undefined` here (e.g., schema is `oneOf` with no clear primitive
|
|
71
61
|
* type — author MUST provide an explicit `default` for such schemas).
|
|
72
62
|
*
|
|
73
63
|
* Consumed by the boilerplate generator's useState emission and by
|
|
74
|
-
* the
|
|
64
|
+
* the render-time validator's default-derivability rule.
|
|
75
65
|
*
|
|
76
66
|
* @public
|
|
77
67
|
*/
|
|
@@ -90,6 +80,9 @@ export function deriveContextDefault(entry) {
|
|
|
90
80
|
default: return undefined;
|
|
91
81
|
}
|
|
92
82
|
}
|
|
83
|
+
// =============================================================================
|
|
84
|
+
// Context snapshot limits (`ggui_runtime_sync_context` rejection bounds)
|
|
85
|
+
// =============================================================================
|
|
93
86
|
/**
|
|
94
87
|
* Maximum byte size (UTF-8) of a single contextSpec slot's value
|
|
95
88
|
* accepted by `ggui_runtime_sync_context`. Values larger than this
|