@ggui-ai/protocol 0.14.0 → 0.16.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/envelopes/render-refusal.d.ts +49 -0
- package/dist/envelopes/render-refusal.d.ts.map +1 -0
- package/dist/envelopes/render-refusal.js +12 -0
- package/dist/errors/domain-error.d.ts +70 -0
- package/dist/errors/domain-error.d.ts.map +1 -0
- package/dist/errors/domain-error.js +118 -0
- package/dist/gadgets/resolve-app-gadgets.d.ts +1 -1
- package/dist/gadgets/stdlib-gadgets.d.ts +2 -2
- package/dist/gadgets/stdlib-gadgets.js +1 -1
- package/dist/index.d.ts +69 -63
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/integrations/mcp-apps.d.ts +35 -9
- package/dist/integrations/mcp-apps.d.ts.map +1 -1
- package/dist/integrations/mcp-apps.js +13 -13
- package/dist/integrations/overlay-hash.d.ts +19 -0
- package/dist/integrations/overlay-hash.d.ts.map +1 -0
- package/dist/integrations/overlay-hash.js +29 -0
- package/dist/integrations/theme-binding.d.ts +14 -12
- package/dist/integrations/theme-binding.d.ts.map +1 -1
- package/dist/integrations/theme-binding.js +10 -6
- package/dist/registry/blueprint-key.d.ts.map +1 -1
- package/dist/registry/blueprint-key.js +4 -3
- package/dist/schemas/app-theme.d.ts +46 -10
- package/dist/schemas/app-theme.d.ts.map +1 -1
- package/dist/schemas/app-theme.js +108 -40
- package/dist/schemas/blueprint.d.ts +4 -3
- package/dist/schemas/blueprint.d.ts.map +1 -1
- package/dist/schemas/blueprint.js +15 -3
- package/dist/schemas/data-contract.d.ts +11 -31
- package/dist/schemas/data-contract.d.ts.map +1 -1
- package/dist/schemas/data-contract.js +5 -28
- package/dist/schemas/handshake-suggestion.d.ts.map +1 -1
- package/dist/schemas/handshake-suggestion.js +8 -1
- package/dist/schemas/interface-context.d.ts +44 -0
- package/dist/schemas/interface-context.d.ts.map +1 -0
- package/dist/schemas/interface-context.js +22 -0
- package/dist/schemas/invoke.d.ts +3 -3
- package/dist/schemas/invoke.js +1 -1
- package/dist/schemas/mcp.d.ts +246 -111
- package/dist/schemas/mcp.d.ts.map +1 -1
- package/dist/schemas/mcp.js +149 -42
- package/dist/schemas/ops-blueprint.d.ts +4 -4
- package/dist/schemas/ops-blueprint.d.ts.map +1 -1
- package/dist/schemas/ops-blueprint.js +13 -8
- package/dist/schemas/public-env-key.d.ts +26 -0
- package/dist/schemas/public-env-key.d.ts.map +1 -0
- package/dist/schemas/public-env-key.js +25 -0
- package/dist/schemas/render-input-envelope.d.ts +2 -2
- package/dist/schemas/render-input-envelope.js +1 -1
- package/dist/schemas/runtime-telemetry-limits.d.ts +11 -0
- package/dist/schemas/runtime-telemetry-limits.d.ts.map +1 -0
- package/dist/schemas/runtime-telemetry-limits.js +10 -0
- package/dist/transport/websocket.d.ts +5 -5
- package/dist/types/auth.d.ts +1 -1
- package/dist/types/blueprint-source.d.ts +27 -7
- package/dist/types/blueprint-source.d.ts.map +1 -1
- package/dist/types/blueprint-source.js +19 -3
- package/dist/types/blueprint.d.ts +2 -2
- package/dist/types/blueprint.d.ts.map +1 -1
- package/dist/types/contract-inference.d.ts +1 -1
- package/dist/types/data-contract.d.ts +3 -3
- package/dist/types/domain-error-codes.d.ts +167 -0
- package/dist/types/domain-error-codes.d.ts.map +1 -0
- package/dist/types/domain-error-codes.js +170 -0
- package/dist/types/events.d.ts +1 -1
- package/dist/types/ggui-session-event.d.ts +2 -2
- package/dist/types/handshake-suggestion.d.ts +2 -2
- package/dist/types/host-context.d.ts +3 -3
- package/dist/types/interface-context.d.ts +1 -1
- package/dist/types/invoke.d.ts +1 -1
- package/dist/types/lifecycle.d.ts +1 -1
- package/dist/types/live-channel.d.ts +3 -3
- package/dist/types/llm-route.d.ts +59 -2
- package/dist/types/llm-route.d.ts.map +1 -1
- package/dist/types/llm-route.js +62 -16
- package/dist/types/llm.d.ts +22 -2
- package/dist/types/llm.d.ts.map +1 -1
- package/dist/types/llm.js +29 -2
- package/dist/types/mcp.d.ts +49 -100
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/types/mcp.js +28 -9
- package/dist/types/refusal-codes.d.ts +54 -95
- package/dist/types/refusal-codes.d.ts.map +1 -1
- package/dist/types/refusal-codes.js +67 -105
- package/dist/types/render.d.ts +12 -11
- package/dist/types/render.d.ts.map +1 -1
- package/dist/types/ui-generator.d.ts +1 -1
- package/dist/validation/ajv-runtime.d.ts +2 -2
- package/dist/validation/contract-validator.d.ts +14 -8
- package/dist/validation/contract-validator.d.ts.map +1 -1
- package/dist/validation/contract-validator.js +12 -4
- package/dist/validation/cross-references.d.ts +2 -2
- package/dist/validation/hygiene-rules.d.ts +1 -1
- package/dist/validation/lint-contract.d.ts +2 -2
- package/dist/validation/lint-contract.d.ts.map +1 -1
- package/dist/validation/lint-contract.js +6 -4
- package/dist/validation/name-invariants.d.ts +2 -2
- package/dist/validation/reserved-channels.d.ts +1 -1
- package/dist/validation/schema-compat-invariants.d.ts +2 -2
- package/dist/validation/schema-meta-validation.d.ts +1 -1
- package/dist/validation/schema-subset.d.ts +3 -3
- package/dist/version.d.ts +485 -12
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +484 -11
- package/dist/wire.d.ts +45 -0
- package/dist/wire.d.ts.map +1 -0
- package/dist/wire.js +44 -0
- package/package.json +7 -1
- package/dist/envelope-adapters.d.ts +0 -25
- package/dist/envelope-adapters.d.ts.map +0 -1
- package/dist/envelope-adapters.js +0 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-contract.d.ts","sourceRoot":"","sources":["../../src/schemas/data-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"data-contract.d.ts","sourceRoot":"","sources":["../../src/schemas/data-contract.ts"],"names":[],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BAKvB,CAAC;AAEZ;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB;;;mBAa/B,CAAC;AAEL;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,4BAA4B;;;;;kBAO9B,CAAC;AAEZ;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,uCAAgE,CAAC;AAEhG;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,QAQa,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAehC,CAAC;AAEX,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAiCZ,CAAC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Output-side seams that type-narrow contract on the wire —
|
|
8
8
|
* `renderOutputSchema.contract` and the various `decision` echoes — use
|
|
9
9
|
* `z.custom<DataContract>()` because they trust the shape (it
|
|
10
|
-
* originates from internal
|
|
10
|
+
* originates from internal server state).
|
|
11
11
|
*
|
|
12
12
|
* The input seam is different: agents author contract on
|
|
13
13
|
* `story.contract` and the handler MUST plumb them to the generator.
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
* just to accept the contract and pass it to the generator.
|
|
52
52
|
*/
|
|
53
53
|
import { z } from 'zod';
|
|
54
|
+
import { PUBLIC_ENV_APP_KEY_RE } from './public-env-key.js';
|
|
54
55
|
import { KNOWN_PERMISSION_NAMES } from '../validation/hygiene-rules.js';
|
|
55
56
|
import { STDLIB_GADGETS_PACKAGE } from '../gadgets/stdlib-gadgets.js';
|
|
56
57
|
import { COMPONENT_NAME_RE, HOOK_NAME_RE } from './gadget-name-grammar.js';
|
|
@@ -220,26 +221,6 @@ export const agentCapabilitiesSpecSchema = z
|
|
|
220
221
|
tools: z.record(z.string(), agentToolEntrySchema),
|
|
221
222
|
})
|
|
222
223
|
.passthrough();
|
|
223
|
-
/**
|
|
224
|
-
* `App.publicEnv` key regex.
|
|
225
|
-
*
|
|
226
|
-
* Each key in `App.publicEnv` MUST match this pattern. The prefix is
|
|
227
|
-
* the **security boundary** — operators can't accidentally stash
|
|
228
|
-
* sensitive credentials under arbitrary names, and downstream consumers
|
|
229
|
-
* (render gate, bootstrap projection, iframe shim) can rely on the
|
|
230
|
-
* naming convention to mean "public-by-design".
|
|
231
|
-
*
|
|
232
|
-
* Rule: `GGUI_PUBLIC_APP_` prefix, then uppercase letters / digits /
|
|
233
|
-
* underscores, at least one char after the prefix.
|
|
234
|
-
*
|
|
235
|
-
* `GGUI_PUBLIC_USER_*` keys are RESERVED for a future per-user
|
|
236
|
-
* channel. The current regex rejects them so App-side config can't
|
|
237
|
-
* pre-emptively use the namespace.
|
|
238
|
-
*
|
|
239
|
-
* Hoisted above `gadgetDescriptorSchema` so the wrapper's `requires`
|
|
240
|
-
* array can reference it at schema-construction time (TDZ-safe).
|
|
241
|
-
*/
|
|
242
|
-
export const PUBLIC_ENV_APP_KEY_RE = /^GGUI_PUBLIC_APP_[A-Z0-9_]+$/;
|
|
243
224
|
/**
|
|
244
225
|
* Single source of truth for the `requires[]` field shape on gadget
|
|
245
226
|
* descriptors. The wire-permissive `gadgetDescriptorSchema`, the
|
|
@@ -253,9 +234,7 @@ export const PUBLIC_ENV_APP_KEY_RE = /^GGUI_PUBLIC_APP_[A-Z0-9_]+$/;
|
|
|
253
234
|
* that declare a `requires` key must have a corresponding App-side
|
|
254
235
|
* publicEnv value at render time (gate: `assertPublicEnvSatisfied`).
|
|
255
236
|
*/
|
|
256
|
-
export const gadgetRequiresSchema = z
|
|
257
|
-
.array(z.string().regex(PUBLIC_ENV_APP_KEY_RE))
|
|
258
|
-
.readonly();
|
|
237
|
+
export const gadgetRequiresSchema = z.array(z.string().regex(PUBLIC_ENV_APP_KEY_RE));
|
|
259
238
|
/**
|
|
260
239
|
* SRI hash format for gadget bundles. Registry install writes
|
|
261
240
|
* `bundleSri` in this shape; iframe-runtime emits it verbatim into
|
|
@@ -434,7 +413,7 @@ const basePackageFieldsShape = {
|
|
|
434
413
|
bundleSri: z.string().regex(BUNDLE_SRI_RE).optional(),
|
|
435
414
|
styleUrl: z.url().optional(),
|
|
436
415
|
// CSP `connect-src` feed — full URL shape on every entry.
|
|
437
|
-
connect: z.array(z.url()).
|
|
416
|
+
connect: z.array(z.url()).optional(),
|
|
438
417
|
// Shared `gadgetRequiresSchema`.
|
|
439
418
|
requires: gadgetRequiresSchema.optional(),
|
|
440
419
|
// HTTPS URL of the package's `.d.ts`. The handler fetches it at
|
|
@@ -640,9 +619,7 @@ export const clientCapabilitiesSpecSchema = z
|
|
|
640
619
|
* - Defensive re-validation in the iframe-runtime slice-meta
|
|
641
620
|
* extractors (`parseMetaFromGlobal`, `parseMetaFromToolResult`).
|
|
642
621
|
*/
|
|
643
|
-
export const appPublicEnvSchema = z
|
|
644
|
-
.record(z.string().regex(PUBLIC_ENV_APP_KEY_RE), z.string())
|
|
645
|
-
.readonly();
|
|
622
|
+
export const appPublicEnvSchema = z.record(z.string().regex(PUBLIC_ENV_APP_KEY_RE), z.string());
|
|
646
623
|
/**
|
|
647
624
|
* {@link DataContract} — the unified four-spec contract surface
|
|
648
625
|
* agents author on `story.contract` and that the generator
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handshake-suggestion.d.ts","sourceRoot":"","sources":["../../src/schemas/handshake-suggestion.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"handshake-suggestion.d.ts","sourceRoot":"","sources":["../../src/schemas/handshake-suggestion.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,kCAAkC,CAAC;AAI1C,qEAAqE;AACrE,eAAO,MAAM,sBAAsB,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAI7D,CAAC;AAEH,mEAAmE;AACnE,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAezB,CAAC;AAE7B,8DAA8D;AAC9D,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAsD,CAAC;AAExG;;;;;GAKG;AACH,oFAAoF;AACpF,eAAO,MAAM,oBAAoB,gDAAiD,CAAC;AAEnF,eAAO,MAAM,0BAA0B;;;;kBA0B5B,CAAC;AAEZ,uDAAuD;AACvD,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAA2D,CAAC;AAEvH,+DAA+D;AAC/D,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CASlB,CAAC;AAExC,0EAA0E;AAC1E,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAOtB,CAAC;AAE5C,qDAAqD;AACrD,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAKzB,CAAC;AAE/C,2EAA2E;AAC3E,eAAO,MAAM,yBAAyB,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,CASxB,CAAC"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* `z.ZodType<T>` so any drift fails compile.
|
|
9
9
|
*/
|
|
10
10
|
import { z } from 'zod';
|
|
11
|
+
import { GENERATOR_ID_PATTERN } from '../types/blueprint-source.js';
|
|
11
12
|
import { dataContractSchema, jsonValueSchema } from './data-contract.js';
|
|
12
13
|
import { blueprintSourceSchema, blueprintVarianceSchema } from './blueprint.js';
|
|
13
14
|
/** Three-mode routing enum on {@link HandshakeSuggestion.origin}. */
|
|
@@ -51,7 +52,13 @@ export const blueprintDraftObjectSchema = z
|
|
|
51
52
|
// rejection message) that `blueprintMeta.variance` projects on the
|
|
52
53
|
// way back out (ggui#523 item 1 — the mirror-of-a-mirror is gone).
|
|
53
54
|
variance: blueprintVarianceSchema.optional(),
|
|
54
|
-
generator: z
|
|
55
|
+
generator: z
|
|
56
|
+
.string()
|
|
57
|
+
.regex(GENERATOR_ID_PATTERN, {
|
|
58
|
+
error: 'generator is an identity `ui-gen-<tier>` — one tier token, no model segment (ggui#924)',
|
|
59
|
+
})
|
|
60
|
+
.optional()
|
|
61
|
+
.describe('Generator identity hint — `ui-gen-default` or `ui-gen-advanced` (one tier token, no model segment). The deployment picks the model and reports it on `source.model`.'),
|
|
55
62
|
}, {
|
|
56
63
|
error: (issue) => issue.code === 'unrecognized_keys'
|
|
57
64
|
? `blueprintDraft: unknown key(s) ${issue.keys.map((k) => JSON.stringify(k)).join(', ')} — a draft is EXACTLY {${BLUEPRINT_DRAFT_KEYS.join(', ')}}; \`intent\` is a top-level ggui_handshake field, not a draft field, and the four specs live INSIDE \`contract\``
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface-context schema — the client's viewport/platform snapshot every
|
|
3
|
+
* handshake and every `InvokeEvent` carries. Its own module (ggui#819) so
|
|
4
|
+
* the browser entry (`@ggui-ai/protocol/wire`) reaches it without the
|
|
5
|
+
* tool schemas that used to share its file.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
export declare const viewportSchema: z.ZodObject<{
|
|
9
|
+
width: z.ZodNumber;
|
|
10
|
+
height: z.ZodNumber;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export declare const interfaceContextSchema: z.ZodObject<{
|
|
13
|
+
viewport: z.ZodObject<{
|
|
14
|
+
width: z.ZodNumber;
|
|
15
|
+
height: z.ZodNumber;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
platform: z.ZodEnum<{
|
|
18
|
+
web: "web";
|
|
19
|
+
desktop: "desktop";
|
|
20
|
+
mobile: "mobile";
|
|
21
|
+
}>;
|
|
22
|
+
deviceType: z.ZodEnum<{
|
|
23
|
+
desktop: "desktop";
|
|
24
|
+
tablet: "tablet";
|
|
25
|
+
phone: "phone";
|
|
26
|
+
}>;
|
|
27
|
+
orientation: z.ZodEnum<{
|
|
28
|
+
portrait: "portrait";
|
|
29
|
+
landscape: "landscape";
|
|
30
|
+
}>;
|
|
31
|
+
devicePixelRatio: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
touchPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
shellType: z.ZodOptional<z.ZodEnum<{
|
|
34
|
+
fullscreen: "fullscreen";
|
|
35
|
+
chat: "chat";
|
|
36
|
+
spatial: "spatial";
|
|
37
|
+
}>>;
|
|
38
|
+
colorScheme: z.ZodOptional<z.ZodEnum<{
|
|
39
|
+
light: "light";
|
|
40
|
+
dark: "dark";
|
|
41
|
+
}>>;
|
|
42
|
+
reducedMotion: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
+
}, z.core.$loose>;
|
|
44
|
+
//# sourceMappingURL=interface-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface-context.d.ts","sourceRoot":"","sources":["../../src/schemas/interface-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc;;;iBAGzB,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUnB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface-context schema — the client's viewport/platform snapshot every
|
|
3
|
+
* handshake and every `InvokeEvent` carries. Its own module (ggui#819) so
|
|
4
|
+
* the browser entry (`@ggui-ai/protocol/wire`) reaches it without the
|
|
5
|
+
* tool schemas that used to share its file.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
export const viewportSchema = z.object({
|
|
9
|
+
width: z.number(),
|
|
10
|
+
height: z.number(),
|
|
11
|
+
});
|
|
12
|
+
export const interfaceContextSchema = z.object({
|
|
13
|
+
viewport: viewportSchema,
|
|
14
|
+
platform: z.enum(['web', 'mobile', 'desktop']),
|
|
15
|
+
deviceType: z.enum(['phone', 'tablet', 'desktop']),
|
|
16
|
+
orientation: z.enum(['portrait', 'landscape']),
|
|
17
|
+
devicePixelRatio: z.number().optional(),
|
|
18
|
+
touchPrimary: z.boolean().optional(),
|
|
19
|
+
shellType: z.enum(['chat', 'fullscreen', 'spatial']).optional(),
|
|
20
|
+
colorScheme: z.enum(['light', 'dark']).optional(),
|
|
21
|
+
reducedMotion: z.boolean().optional(),
|
|
22
|
+
}).passthrough();
|
package/dist/schemas/invoke.d.ts
CHANGED
|
@@ -307,13 +307,13 @@ export declare const invokeRequestSchema: z.ZodObject<{
|
|
|
307
307
|
}, z.core.$strip>;
|
|
308
308
|
platform: z.ZodEnum<{
|
|
309
309
|
web: "web";
|
|
310
|
-
mobile: "mobile";
|
|
311
310
|
desktop: "desktop";
|
|
311
|
+
mobile: "mobile";
|
|
312
312
|
}>;
|
|
313
313
|
deviceType: z.ZodEnum<{
|
|
314
314
|
desktop: "desktop";
|
|
315
|
-
phone: "phone";
|
|
316
315
|
tablet: "tablet";
|
|
316
|
+
phone: "phone";
|
|
317
317
|
}>;
|
|
318
318
|
orientation: z.ZodEnum<{
|
|
319
319
|
portrait: "portrait";
|
|
@@ -322,8 +322,8 @@ export declare const invokeRequestSchema: z.ZodObject<{
|
|
|
322
322
|
devicePixelRatio: z.ZodOptional<z.ZodNumber>;
|
|
323
323
|
touchPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
324
324
|
shellType: z.ZodOptional<z.ZodEnum<{
|
|
325
|
-
chat: "chat";
|
|
326
325
|
fullscreen: "fullscreen";
|
|
326
|
+
chat: "chat";
|
|
327
327
|
spatial: "spatial";
|
|
328
328
|
}>>;
|
|
329
329
|
colorScheme: z.ZodOptional<z.ZodEnum<{
|
package/dist/schemas/invoke.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* and types for authoring.
|
|
13
13
|
*/
|
|
14
14
|
import { z } from 'zod';
|
|
15
|
-
import { interfaceContextSchema } from './
|
|
15
|
+
import { interfaceContextSchema } from './interface-context.js';
|
|
16
16
|
// ── Content blocks ────────────────────────────────────────────────────
|
|
17
17
|
/** Plain text content — streamed via `text_delta` events. */
|
|
18
18
|
export const textBlockSchema = z.object({
|