@ggui-ai/iframe-runtime 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/runtime.d.ts CHANGED
@@ -342,18 +342,39 @@ export declare function readSelfContainedMeta(): McpAppAiGguiRenderMeta | null;
342
342
  * no WS at all for spec-compliant MCP-Apps hosts that expose no ggui
343
343
  * live channel (claude.ai / ChatGPT / Claude Desktop).
344
344
  *
345
- * Two static-content shapes (the autostart discriminator):
345
+ * Three static-content shapes (the autostart discriminator), in
346
+ * priority order:
346
347
  * - `kind` → a system-card seed (`type:'system'`); no fetch.
348
+ * - `codeB64` → a compiled-component seed carried inline; DECODED,
349
+ * never fetched. Preferred over `codeUrl` when both are present —
350
+ * the inline bytes exist precisely for hosts whose iframe CSP
351
+ * blocks the fetch.
347
352
  * - `codeUrl` → a compiled-component seed; fetches the
348
353
  * content-addressable component bytes.
349
354
  *
350
- * Returns `null` when the meta carries NEITHER (a live-only meta has
355
+ * Returns `null` when the meta carries NONE (a live-only meta has
351
356
  * nothing to seed — the first WS ack mounts it). Throws when a `codeUrl`
352
- * fetch fails so the caller can surface a typed boot failure. The four
353
- * server-assigned ledger fields are intentionally absent — the first
354
- * ack reconciles the seed to a full `GguiSession` (no fabrication).
357
+ * fetch fails or `codeB64` is not valid base64 so the caller can
358
+ * surface a typed boot failure. The four server-assigned ledger fields
359
+ * are intentionally absent — the first ack reconciles the seed to a
360
+ * full `GguiSession` (no fabrication).
355
361
  */
356
362
  export declare function buildGguiSessionSeedInput(meta: McpAppAiGguiRenderMeta): Promise<GguiSessionSeedInput | null>;
363
+ /**
364
+ * Does this slice carry STATIC content the mount surface can paint
365
+ * without any network round-trip authorization — `codeUrl` (fetched),
366
+ * `codeB64` (decoded inline), or `kind` (built-in registry)?
367
+ *
368
+ * The ONE discriminator `bootSequence` consults when deciding whether
369
+ * the static seed-mount path runs. `codeB64` counting here is
370
+ * load-bearing for fetch-blocked hosts: their meta carries codeB64
371
+ * PLUS a live trio the iframe can never connect, and missing the
372
+ * inline arm would skip the only paint path and die on the dead WS.
373
+ * Mirrors `validateMeta`'s static-content arm (meta-parse.ts) and the
374
+ * protocol host-helper's `hasMountModeDiscriminator` — drift among
375
+ * the three IS the historical bug class, hence the named export.
376
+ */
377
+ export declare function hasStaticContentMeta(meta: McpAppAiGguiRenderMeta): boolean;
357
378
  /**
358
379
  * Extract a {@link McpAppAiGguiRenderMeta} from a
359
380
  * `ui/notifications/tool-result` JSON-RPC params payload — the
@@ -369,6 +390,25 @@ export declare function buildGguiSessionSeedInput(meta: McpAppAiGguiRenderMeta):
369
390
  * impossible because the shell never inspects the slice-meta shape.
370
391
  */
371
392
  export declare function extractMetaFromToolResult(params: unknown): McpAppAiGguiRenderMeta | null;
393
+ /**
394
+ * Drain `window.__GGUI_PENDING_TOOL_RESULTS__` — the buffer the
395
+ * minimal shell populates while messages arrive between
396
+ * shell-load and runtime-load. Returns the NEWEST valid slice meta
397
+ * (each new tool-result supersedes the previous — every emission
398
+ * carries complete state, so last-wins loses nothing). Newest-first
399
+ * matters on the inline-runtime shell: its preflight completes the
400
+ * handshake BEFORE the large bundle parses, so a render AND a
401
+ * follow-up update can both land in the buffer during parse — booting
402
+ * the oldest would paint stale props and drop the update forever
403
+ * (buffered entries never reach the post-mount listener; it hears
404
+ * only post-App arrivals).
405
+ *
406
+ * The shell-side buffer contract: an array whose ELEMENTS are the raw
407
+ * JSON-RPC `params` values of `ui/notifications/tool-result`
408
+ * notifications, in arrival order (shells cap it newest-biased). The
409
+ * runtime reads it once at autostart.
410
+ */
411
+ export declare function readPendingToolResults(): McpAppAiGguiRenderMeta | null;
372
412
  /**
373
413
  * Render a submit-action's `data` payload as a short inline string
374
414
  * for embedding in a `ui/message` consent prompt. Goal: human-