@ggui-ai/protocol 0.1.0-rc.1 → 0.2.0-alpha.1

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 (92) hide show
  1. package/README.md +3 -3
  2. package/dist/bridge/invoke-agent.d.ts +8 -8
  3. package/dist/bridge/invoke-agent.d.ts.map +1 -1
  4. package/dist/bridge/invoke-agent.js +12 -12
  5. package/dist/envelopes/builders.d.ts +2 -4
  6. package/dist/envelopes/builders.d.ts.map +1 -1
  7. package/dist/envelopes/builders.js +2 -6
  8. package/dist/gadgets/stdlib-gadgets.d.ts +1 -1
  9. package/dist/gadgets/stdlib-gadgets.js +1 -1
  10. package/dist/index.d.ts +2 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +4 -3
  13. package/dist/integrations/mcp-apps.d.ts +354 -711
  14. package/dist/integrations/mcp-apps.d.ts.map +1 -1
  15. package/dist/integrations/mcp-apps.js +266 -208
  16. package/dist/recommended-prompts.d.ts +1 -1
  17. package/dist/recommended-prompts.js +1 -1
  18. package/dist/schemas/data-contract.d.ts +4 -3
  19. package/dist/schemas/data-contract.d.ts.map +1 -1
  20. package/dist/schemas/data-contract.js +4 -3
  21. package/dist/schemas/invoke.d.ts +2 -2
  22. package/dist/schemas/invoke.js +2 -2
  23. package/dist/schemas/mcp.d.ts +60 -79
  24. package/dist/schemas/mcp.d.ts.map +1 -1
  25. package/dist/schemas/mcp.js +93 -116
  26. package/dist/schemas/sync-check.js +1 -1
  27. package/dist/stream/stream-parser.d.ts +4 -4
  28. package/dist/stream/stream-parser.d.ts.map +1 -1
  29. package/dist/stream/stream-parser.js +9 -9
  30. package/dist/transport/websocket.d.ts +14 -49
  31. package/dist/transport/websocket.d.ts.map +1 -1
  32. package/dist/types/app-config.d.ts +17 -32
  33. package/dist/types/app-config.d.ts.map +1 -1
  34. package/dist/types/canvas-lifecycle.d.ts +13 -13
  35. package/dist/types/canvas-lifecycle.d.ts.map +1 -1
  36. package/dist/types/canvas-lifecycle.js +3 -3
  37. package/dist/types/contract-inference.d.ts +4 -7
  38. package/dist/types/contract-inference.d.ts.map +1 -1
  39. package/dist/types/data-bindings.d.ts +1 -1
  40. package/dist/types/data-bindings.d.ts.map +1 -1
  41. package/dist/types/data-contract.d.ts +10 -10
  42. package/dist/types/data-contract.d.ts.map +1 -1
  43. package/dist/types/events.d.ts +14 -56
  44. package/dist/types/events.d.ts.map +1 -1
  45. package/dist/types/events.js +1 -8
  46. package/dist/types/feedback.d.ts +2 -4
  47. package/dist/types/feedback.d.ts.map +1 -1
  48. package/dist/types/handshake-suggestion.d.ts +1 -1
  49. package/dist/types/host-context.d.ts +5 -15
  50. package/dist/types/host-context.d.ts.map +1 -1
  51. package/dist/types/host-context.js +1 -1
  52. package/dist/types/live-channel.d.ts +128 -191
  53. package/dist/types/live-channel.d.ts.map +1 -1
  54. package/dist/types/llm-route.d.ts +233 -0
  55. package/dist/types/llm-route.d.ts.map +1 -0
  56. package/dist/types/llm-route.js +433 -0
  57. package/dist/types/llm.d.ts +35 -17
  58. package/dist/types/llm.d.ts.map +1 -1
  59. package/dist/types/llm.js +50 -39
  60. package/dist/types/mcp.d.ts +47 -137
  61. package/dist/types/mcp.d.ts.map +1 -1
  62. package/dist/types/mcp.js +2 -2
  63. package/dist/types/openrouter-models.d.ts +3 -2
  64. package/dist/types/openrouter-models.d.ts.map +1 -1
  65. package/dist/types/render-event.d.ts +119 -0
  66. package/dist/types/render-event.d.ts.map +1 -0
  67. package/dist/types/render-event.js +38 -0
  68. package/dist/types/session.d.ts +216 -342
  69. package/dist/types/session.d.ts.map +1 -1
  70. package/dist/types/ui-generator.d.ts +8 -9
  71. package/dist/types/ui-generator.d.ts.map +1 -1
  72. package/dist/validation/contract-validator.d.ts +60 -4
  73. package/dist/validation/contract-validator.d.ts.map +1 -1
  74. package/dist/validation/contract-validator.js +101 -5
  75. package/dist/validation/reserved-channels.d.ts +1 -1
  76. package/dist/validation/reserved-channels.js +5 -5
  77. package/dist/validation/sanitize-error.js +1 -1
  78. package/dist/validation/schema-compat-invariants.d.ts +2 -2
  79. package/dist/validation/schema-compat-invariants.js +2 -2
  80. package/dist/validation/schema-meta-validation.d.ts +1 -1
  81. package/dist/validation/schema-meta-validation.js +2 -2
  82. package/dist/validation/schema-subset.d.ts +1 -1
  83. package/dist/version.d.ts +253 -46
  84. package/dist/version.d.ts.map +1 -1
  85. package/dist/version.js +253 -46
  86. package/package.json +17 -16
  87. package/dist/navigation/index.d.ts +0 -3
  88. package/dist/navigation/index.d.ts.map +0 -1
  89. package/dist/navigation/index.js +0 -1
  90. package/dist/navigation/stack-navigation.d.ts +0 -55
  91. package/dist/navigation/stack-navigation.d.ts.map +0 -1
  92. package/dist/navigation/stack-navigation.js +0 -80
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/types/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,gBAAgB,EAChB,UAAU,EACV,UAAU,EACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAKhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,MAAO,SAAQ,UAAU;IACxC,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX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AC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -1,4 +1,3 @@
1
- import type { EventSubscription } from './events';
2
1
  import type { DataContract, JsonObject, JsonSchema, JsonValue } from './data-contract';
3
2
  /**
4
3
  * Design system version — used as part of the cache fingerprint.
@@ -46,22 +45,22 @@ export declare function computeStyleFingerprint(input: StyleFingerprintInput): s
46
45
  * Generic `TContext` defaults to {@link JsonObject} for generator context hints.
47
46
  */
48
47
  export interface UIGenerationRequest<TContext = JsonObject> {
49
- sessionId: string;
48
+ renderId: string;
50
49
  prompt: string;
51
50
  context?: TContext;
52
51
  schema?: JsonSchema;
53
- subscription?: EventSubscription;
54
52
  }
55
53
  /**
56
54
  * Internal response from UI generation. This is the GENERATOR-OUTPUT
57
55
  * shape — `componentCode` is the freshly produced ESM string. Before
58
- * the stack item commits to the wire, the bootstrap-meta derivation
56
+ * the render commits to the wire, the slice-meta derivation
59
57
  * uploads the code body and projects `codeUrl` (a fetchable URL) onto
60
- * `_meta.ggui.bootstrap` instead of inlining the source. Iframe
61
- * runtimes fetch the code from `codeUrl`; they never see this field.
58
+ * the `ai.ggui/render` slice instead of inlining the source.
59
+ * Iframe runtimes fetch the code from `codeUrl`; they never see this
60
+ * field.
62
61
  */
63
62
  export interface UIGenerationResponse {
64
- stackItemId: string;
63
+ renderId: string;
65
64
  componentCode: string;
66
65
  sourceCode?: string;
67
66
  warnings?: string[];
@@ -71,8 +70,8 @@ export interface UIGenerationResponse {
71
70
  * Populated by the generator when the component calls wire hooks
72
71
  * (`useAction('name')`, `useStream('channel')`) — the generator
73
72
  * extracts the call sites and emits a matching authoring-side
74
- * envelope so downstream consumers (`ggui_push` → StackItem, console
75
- * inspectors, session-channel router) have the contract available.
73
+ * envelope so downstream consumers (`ggui_render` → Render, console
74
+ * inspectors, render-channel router) have the contract available.
76
75
  *
77
76
  * - When the caller supplied `UiGenerateInput.contract` that
78
77
  * envelope is passed through as-is (already authoritative).
@@ -1 +1 @@
1
- {"version":3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declare function validateActionEnvelope(envelope: ActionEnvelope, spec: A
167
167
  * Compile a contract's runtime-validated sub-schemas into standalone,
168
168
  * eval-free ESM validator modules — the producer half of the
169
169
  * precompiled-validator channel
170
- * ({@link CompiledContractValidators} on `GguiBootstrapMeta`).
170
+ * ({@link CompiledContractValidators} on `McpAppAiGguiMeta`).
171
171
  *
172
172
  * The renderer iframe runs under a strict CSP with no `'unsafe-eval'`,
173
173
  * so it cannot call `ajv.compile()` (which builds validators via
@@ -189,7 +189,7 @@ export declare function validateActionEnvelope(envelope: ActionEnvelope, spec: A
189
189
  * validates `value`.
190
190
  *
191
191
  * Returns `undefined` when the contract declares no runtime-validated
192
- * schema at all — the bootstrap projection then omits the field.
192
+ * schema at all — the slice-meta projection then omits the field.
193
193
  */
194
194
  export declare function compileContractValidators(specs: {
195
195
  readonly propsSpec?: PropsSpec;
@@ -197,6 +197,62 @@ export declare function compileContractValidators(specs: {
197
197
  readonly streamSpec?: StreamSpec;
198
198
  readonly contextSpec?: ContextSpec;
199
199
  }): CompiledContractValidators | undefined;
200
+ /**
201
+ * Wrap a {@link CompiledContractValidators} object as the source text of
202
+ * an ES module whose `default` export is the same object. This is the
203
+ * wire format served from the content-addressable contract route
204
+ * (`GET /contract/<hash>.js`) in #109's decomposition slice — one URL,
205
+ * one fetch, one dynamic-import per unique contract.
206
+ *
207
+ * Why a wrapping module rather than emitting the validator-modules
208
+ * raw: each inner validator-module is independently `export default ...`,
209
+ * so they can't share a single file without name collisions. The
210
+ * iframe-runtime's existing `loadCompiledValidators` already knows how
211
+ * to take a `CompiledContractValidators` and load each inner module via
212
+ * `blob:` import; this wrapper just hands it the same shape it expects,
213
+ * sourced from one HTTP round-trip instead of inline.
214
+ *
215
+ * `JSON.stringify` is deterministic on objects with string keys in V8
216
+ * + Node — the producer's iteration order is preserved, so a given
217
+ * contract always serializes to identical bytes. {@link computeContractBundle}
218
+ * leans on that determinism so the resulting hash is stable across
219
+ * pushes of the same contract.
220
+ *
221
+ * @public
222
+ */
223
+ export declare function bundleCompiledValidatorsAsModule(compiled: CompiledContractValidators): string;
224
+ /**
225
+ * Convenience over {@link compileContractValidators} +
226
+ * {@link bundleCompiledValidatorsAsModule} + sha256 — produces the
227
+ * `{contractHash, bundleSource, validators}` triple the emitter (push.ts
228
+ * / update.ts in #109 C4) writes to the content-addressable store and
229
+ * emits as `_meta["ai.ggui/contract"] = {contractHash, validatorsUrl}`.
230
+ *
231
+ * `contractHash` is `sha256(canonicalJsonStringify(specs))` (hex). Hashing
232
+ * the INPUT specs — not the compiled output — guarantees a stable hash
233
+ * across server processes and Ajv version bumps: the same contract
234
+ * definition always lands at the same URL. Compiled output bytes may
235
+ * differ across calls (Ajv's standalone emitter uses incrementing
236
+ * counter names like `validate10`/`validate11`), but the CodeStore is
237
+ * idempotent (first write wins) and the URL response carries
238
+ * `Cache-Control: immutable`, so browsers + CDNs lock in the
239
+ * first-served bytes and never observe a counter-name reshuffle.
240
+ *
241
+ * Returns `undefined` when the contract declares no runtime-validated
242
+ * schema at all (matches {@link compileContractValidators}'s posture).
243
+ *
244
+ * @public
245
+ */
246
+ export declare function computeContractBundle(specs: {
247
+ readonly propsSpec?: PropsSpec;
248
+ readonly actionSpec?: ActionSpec;
249
+ readonly streamSpec?: StreamSpec;
250
+ readonly contextSpec?: ContextSpec;
251
+ }): Promise<{
252
+ readonly contractHash: string;
253
+ readonly bundleSource: string;
254
+ readonly validators: CompiledContractValidators;
255
+ } | undefined>;
200
256
  /**
201
257
  * Format violations into a human-readable error message for the target agent.
202
258
  */
@@ -226,10 +282,10 @@ export declare function formatViolations(violations: ContractViolation[]): strin
226
282
  export declare function validateContractStructure(contract: DataContract): ValidationResult;
227
283
  export declare class ContractViolationError extends Error {
228
284
  readonly violations: ContractViolation[];
229
- readonly tool: 'ggui_push' | 'ggui_update' | 'ggui_emit' | 'ggui_event';
285
+ readonly tool: 'ggui_render' | 'ggui_update' | 'ggui_emit' | 'ggui_event';
230
286
  readonly hint: string;
231
287
  constructor(opts: {
232
- tool: 'ggui_push' | 'ggui_update' | 'ggui_emit' | 'ggui_event';
288
+ tool: 'ggui_render' | 'ggui_update' | 'ggui_emit' | 'ggui_event';
233
289
  violations: ContractViolation[];
234
290
  hint?: string;
235
291
  });
@@ -1 +1 @@
1
- {"version":3,"file":"contract-validator.d.ts","sourceRoot":"","sources":["../../src/validation/contract-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEnI,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAO3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAItD,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAItD,OAAO,EAKL,KAAK,wBAAwB,EAC9B,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,iBAAiB,EAAE,CAAC;CACjC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,SAAS,GAAG,UAAU,CAcnE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,IAAI,EAAE,SAAS,EACf,WAAW,CAAC,EAAE,gBAAgB,GAC7B,gBAAgB,CAWlB;AAED;;;;;;;;;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MAAM,CAIxE;AAMD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,YAAY,GAAG,gBAAgB,CAiGlF;AAyPD,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,UAAU,EAAE,iBAAiB,EAAE,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,WAAW,GAAG,YAAY,CAAC;IAC1E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE;QAChB,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,WAAW,GAAG,YAAY,CAAC;QACjE,UAAU,EAAE,iBAAiB,EAAE,CAAC;QAChC,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;IASD,8DAA8D;IAC9D,WAAW,IAAI;QACb,KAAK,EAAE,oBAAoB,CAAC;QAC5B,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,iBAAiB,EAAE,CAAC;QAChC,IAAI,EAAE,MAAM,CAAC;KACd;CAQF"}
@@ -294,7 +294,7 @@ export function validateActionEnvelope(envelope, spec, precompiledActions) {
294
294
  * Compile a contract's runtime-validated sub-schemas into standalone,
295
295
  * eval-free ESM validator modules — the producer half of the
296
296
  * precompiled-validator channel
297
- * ({@link CompiledContractValidators} on `GguiBootstrapMeta`).
297
+ * ({@link CompiledContractValidators} on `McpAppAiGguiMeta`).
298
298
  *
299
299
  * The renderer iframe runs under a strict CSP with no `'unsafe-eval'`,
300
300
  * so it cannot call `ajv.compile()` (which builds validators via
@@ -316,7 +316,7 @@ export function validateActionEnvelope(envelope, spec, precompiledActions) {
316
316
  * validates `value`.
317
317
  *
318
318
  * Returns `undefined` when the contract declares no runtime-validated
319
- * schema at all — the bootstrap projection then omits the field.
319
+ * schema at all — the slice-meta projection then omits the field.
320
320
  */
321
321
  export function compileContractValidators(specs) {
322
322
  const compilePerEntry = (spec) => {
@@ -350,6 +350,102 @@ export function compileContractValidators(specs) {
350
350
  out.context = context;
351
351
  return Object.keys(out).length > 0 ? out : undefined;
352
352
  }
353
+ /**
354
+ * Wrap a {@link CompiledContractValidators} object as the source text of
355
+ * an ES module whose `default` export is the same object. This is the
356
+ * wire format served from the content-addressable contract route
357
+ * (`GET /contract/<hash>.js`) in #109's decomposition slice — one URL,
358
+ * one fetch, one dynamic-import per unique contract.
359
+ *
360
+ * Why a wrapping module rather than emitting the validator-modules
361
+ * raw: each inner validator-module is independently `export default ...`,
362
+ * so they can't share a single file without name collisions. The
363
+ * iframe-runtime's existing `loadCompiledValidators` already knows how
364
+ * to take a `CompiledContractValidators` and load each inner module via
365
+ * `blob:` import; this wrapper just hands it the same shape it expects,
366
+ * sourced from one HTTP round-trip instead of inline.
367
+ *
368
+ * `JSON.stringify` is deterministic on objects with string keys in V8
369
+ * + Node — the producer's iteration order is preserved, so a given
370
+ * contract always serializes to identical bytes. {@link computeContractBundle}
371
+ * leans on that determinism so the resulting hash is stable across
372
+ * pushes of the same contract.
373
+ *
374
+ * @public
375
+ */
376
+ export function bundleCompiledValidatorsAsModule(compiled) {
377
+ return `export default ${JSON.stringify(compiled)};\n`;
378
+ }
379
+ /**
380
+ * Recursive canonical-JSON serializer with object keys sorted
381
+ * lexicographically at every depth. Output is byte-stable across any
382
+ * two callers building the same logical contract via different key
383
+ * orders (e.g. `{a:1, b:2}` vs `{b:2, a:1}`) — so {@link computeContractBundle}'s
384
+ * hash is robust to spec-author hand-ordering.
385
+ *
386
+ * Arrays preserve element order (semantically meaningful in JSON
387
+ * Schema, e.g. `required: [a, b]` differs from `[b, a]` for some
388
+ * validators / error message ordering). Functions are not part of
389
+ * `DataContract` specs, so the type-`function` branch is unreachable
390
+ * in normal use and excluded.
391
+ */
392
+ function canonicalJsonStringify(value) {
393
+ if (value === null)
394
+ return 'null';
395
+ if (typeof value === 'number' || typeof value === 'boolean')
396
+ return JSON.stringify(value);
397
+ if (typeof value === 'string')
398
+ return JSON.stringify(value);
399
+ if (Array.isArray(value)) {
400
+ return `[${value.map(canonicalJsonStringify).join(',')}]`;
401
+ }
402
+ if (typeof value === 'object') {
403
+ const keys = Object.keys(value).sort();
404
+ const parts = keys.map((k) => `${JSON.stringify(k)}:${canonicalJsonStringify(value[k])}`);
405
+ return `{${parts.join(',')}}`;
406
+ }
407
+ // undefined / function — not valid inside DataContract specs.
408
+ return 'null';
409
+ }
410
+ /**
411
+ * Convenience over {@link compileContractValidators} +
412
+ * {@link bundleCompiledValidatorsAsModule} + sha256 — produces the
413
+ * `{contractHash, bundleSource, validators}` triple the emitter (push.ts
414
+ * / update.ts in #109 C4) writes to the content-addressable store and
415
+ * emits as `_meta["ai.ggui/contract"] = {contractHash, validatorsUrl}`.
416
+ *
417
+ * `contractHash` is `sha256(canonicalJsonStringify(specs))` (hex). Hashing
418
+ * the INPUT specs — not the compiled output — guarantees a stable hash
419
+ * across server processes and Ajv version bumps: the same contract
420
+ * definition always lands at the same URL. Compiled output bytes may
421
+ * differ across calls (Ajv's standalone emitter uses incrementing
422
+ * counter names like `validate10`/`validate11`), but the CodeStore is
423
+ * idempotent (first write wins) and the URL response carries
424
+ * `Cache-Control: immutable`, so browsers + CDNs lock in the
425
+ * first-served bytes and never observe a counter-name reshuffle.
426
+ *
427
+ * Returns `undefined` when the contract declares no runtime-validated
428
+ * schema at all (matches {@link compileContractValidators}'s posture).
429
+ *
430
+ * @public
431
+ */
432
+ export async function computeContractBundle(specs) {
433
+ const validators = compileContractValidators(specs);
434
+ if (validators === undefined)
435
+ return undefined;
436
+ const bundleSource = bundleCompiledValidatorsAsModule(validators);
437
+ // Web Crypto's subtle.digest is universal (Node 19+, all modern
438
+ // browsers, Workers). The protocol package ships into iframe-runtime
439
+ // bundles too — `node:crypto` would force esbuild to mark a Node
440
+ // builtin unresolved at browser bundle time even though this
441
+ // function is server-only at call time.
442
+ const bytes = new TextEncoder().encode(canonicalJsonStringify(specs));
443
+ const digest = await globalThis.crypto.subtle.digest('SHA-256', bytes);
444
+ const contractHash = Array.from(new Uint8Array(digest))
445
+ .map((b) => b.toString(16).padStart(2, '0'))
446
+ .join('');
447
+ return { contractHash, bundleSource, validators };
448
+ }
353
449
  /**
354
450
  * Format violations into a human-readable error message for the target agent.
355
451
  */
@@ -679,13 +775,13 @@ function validateSchemaStructure(schema, path, violations) {
679
775
  * Thrown by commit/update/stream handlers when agent data doesn't match
680
776
  * the negotiated contract. The MCP handler catches this and returns a
681
777
  * structured error response with violations + hint so the agent can
682
- * self-correct (fix data or propose a new contract via ggui_push).
778
+ * self-correct (fix data or propose a new contract via ggui_render).
683
779
  */
684
780
  function defaultHintFor(tool) {
685
781
  if (tool === 'ggui_event') {
686
- return 'The user-action payload did not match the session\'s actionSpec. Re-check the client-side action wiring, or have the agent push a new UI whose actionSpec covers this payload shape.';
782
+ return 'The user-action payload did not match the render\'s actionSpec. Re-check the client-side action wiring, or have the agent render a new UI whose actionSpec covers this payload shape.';
687
783
  }
688
- return 'Fix your data to match the contract, or call ggui_push to create a new UI for this data shape.';
784
+ return 'Fix your data to match the contract, or call ggui_render to create a new UI for this data shape.';
689
785
  }
690
786
  export class ContractViolationError extends Error {
691
787
  violations;
@@ -3,7 +3,7 @@ import type { ValidationResult } from './contract-validator';
3
3
  export declare const RESERVED_CHANNEL_PREFIX = "_ggui:";
4
4
  /**
5
5
  * Reserved channel for provisional A2UI assembly streams emitted by
6
- * the server during fresh-gen `ggui_push` flows. The agent never
6
+ * the server during fresh-gen `ggui_render` flows. The agent never
7
7
  * authors messages on this channel; the renderer subscribes implicitly
8
8
  * and dispatches the A2UI payload through its preview surface.
9
9
  */
@@ -2,7 +2,7 @@
2
2
  export const RESERVED_CHANNEL_PREFIX = '_ggui:';
3
3
  /**
4
4
  * Reserved channel for provisional A2UI assembly streams emitted by
5
- * the server during fresh-gen `ggui_push` flows. The agent never
5
+ * the server during fresh-gen `ggui_render` flows. The agent never
6
6
  * authors messages on this channel; the renderer subscribes implicitly
7
7
  * and dispatches the A2UI payload through its preview surface.
8
8
  */
@@ -329,12 +329,12 @@ export function validateCanvasLifecyclePayload(payload) {
329
329
  });
330
330
  }
331
331
  break;
332
- case 'push_started':
333
- requireString('stackItemId');
332
+ case 'render_started':
333
+ requireString('renderId');
334
334
  requireString('intent');
335
335
  break;
336
336
  case 'consume_polling':
337
- requireString('stackItemId');
337
+ requireString('renderId');
338
338
  if (p.state !== 'open') {
339
339
  violations.push({
340
340
  field: 'state',
@@ -348,7 +348,7 @@ export function validateCanvasLifecyclePayload(payload) {
348
348
  violations.push({
349
349
  field: 'kind',
350
350
  message: `Unknown lifecycle kind '${p.kind}'. Closed union; new kinds bump protocol version.`,
351
- expected: "'handshake_started' | 'handshake_completed' | 'push_started' | 'consume_polling'",
351
+ expected: "'handshake_started' | 'handshake_completed' | 'render_started' | 'consume_polling'",
352
352
  received: p.kind,
353
353
  });
354
354
  }
@@ -9,7 +9,7 @@
9
9
  // and env-var dumps. The envelope flows on the reserved
10
10
  // `_ggui:contract-error` channel with `replay: 'all'`, so anything that
11
11
  // lands in `causedBy` persists in the session ring buffer and is visible
12
- // in operator tools (SessionInspector activity panels). If an operator
12
+ // in operator tools (RenderInspector activity panels). If an operator
13
13
  // shares a bug report with that data, the credential leaks externally.
14
14
  //
15
15
  // This module's default posture is "sanitize before emission": the
@@ -18,7 +18,7 @@
18
18
  * `streamSpec[*].schema` vs `agentCapabilities.tools[*].inputSchema` /
19
19
  * `outputSchema`, all of which are author-declared JSON Schemas
20
20
  * already on the contract. No tool registry, no zod conversion, no
21
- * server state. The server-level F4 check (`checkStackItemSchemaCompat`
21
+ * server state. The server-level F4 check (`checkRenderSchemaCompat`
22
22
  * in `@ggui-ai/mcp-server`) compares the same `actionSpec` /
23
23
  * `streamSpec` schemas against the SERVER-REGISTERED tools' actual
24
24
  * zod schemas; it covers the operator-side "did the deployed tool
@@ -132,7 +132,7 @@ export declare class SchemaCompatInvariantError extends Error {
132
132
  *
133
133
  * Slots alongside `assertCrossReferences` + `assertNameInvariants`
134
134
  * at push time. Different scope from the server-level
135
- * `SchemaCompatError` thrown by `checkStackItemSchemaCompat` in
135
+ * `SchemaCompatError` thrown by `checkRenderSchemaCompat` in
136
136
  * `@ggui-ai/mcp-server`: this check uses ONLY the contract's own
137
137
  * catalog; the server-level check uses the runtime tool registry.
138
138
  */
@@ -18,7 +18,7 @@
18
18
  * `streamSpec[*].schema` vs `agentCapabilities.tools[*].inputSchema` /
19
19
  * `outputSchema`, all of which are author-declared JSON Schemas
20
20
  * already on the contract. No tool registry, no zod conversion, no
21
- * server state. The server-level F4 check (`checkStackItemSchemaCompat`
21
+ * server state. The server-level F4 check (`checkRenderSchemaCompat`
22
22
  * in `@ggui-ai/mcp-server`) compares the same `actionSpec` /
23
23
  * `streamSpec` schemas against the SERVER-REGISTERED tools' actual
24
24
  * zod schemas; it covers the operator-side "did the deployed tool
@@ -208,7 +208,7 @@ export class SchemaCompatInvariantError extends Error {
208
208
  *
209
209
  * Slots alongside `assertCrossReferences` + `assertNameInvariants`
210
210
  * at push time. Different scope from the server-level
211
- * `SchemaCompatError` thrown by `checkStackItemSchemaCompat` in
211
+ * `SchemaCompatError` thrown by `checkRenderSchemaCompat` in
212
212
  * `@ggui-ai/mcp-server`: this check uses ONLY the contract's own
213
213
  * catalog; the server-level check uses the runtime tool registry.
214
214
  */
@@ -23,7 +23,7 @@
23
23
  * Designed to slot at:
24
24
  * - `ggui_handshake` entry — validates `blueprintDraft.contract`
25
25
  * before the negotiator runs.
26
- * - `ggui_push` entry — validates the `effectiveContract` (either
26
+ * - `ggui_render` entry — validates the `effectiveContract` (either
27
27
  * synth-amended or override) before any state mutation.
28
28
  *
29
29
  * Both call sites already run cross-reference and name-invariant
@@ -23,7 +23,7 @@
23
23
  * Designed to slot at:
24
24
  * - `ggui_handshake` entry — validates `blueprintDraft.contract`
25
25
  * before the negotiator runs.
26
- * - `ggui_push` entry — validates the `effectiveContract` (either
26
+ * - `ggui_render` entry — validates the `effectiveContract` (either
27
27
  * synth-amended or override) before any state mutation.
28
28
  *
29
29
  * Both call sites already run cross-reference and name-invariant
@@ -50,7 +50,7 @@ export class ContractSchemaMetaError extends Error {
50
50
  'Fix the JSON Schema at the named field. Common causes: ' +
51
51
  'missing `items` on an array schema, a properties entry that ' +
52
52
  'is not itself a JSON Schema object, or an unknown keyword. ' +
53
- 'Re-call ggui_push (or ggui_handshake) once corrected.';
53
+ 'Re-call ggui_render (or ggui_handshake) once corrected.';
54
54
  }
55
55
  }
56
56
  function tryCompile(field, schema, violations) {
@@ -12,7 +12,7 @@
12
12
  *
13
13
  * **Check points.**
14
14
  *
15
- * - Pre-commit of a `StackItem` with `actionSpec` / `streamSpec`
15
+ * - Pre-commit of a `Render` with `actionSpec` / `streamSpec`
16
16
  * entries that reference tools: each action's declared schema
17
17
  * MUST be a subset of the tool's inputSchema (what the action
18
18
  * payload is allowed to send ⊆ what the tool accepts). Each