@ggui-ai/protocol 0.1.0-rc.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.
- package/LICENSE +201 -0
- package/README.md +46 -0
- package/dist/bridge/invoke-agent.d.ts +65 -0
- package/dist/bridge/invoke-agent.d.ts.map +1 -0
- package/dist/bridge/invoke-agent.js +113 -0
- package/dist/envelope-adapters.d.ts +24 -0
- package/dist/envelope-adapters.d.ts.map +1 -0
- package/dist/envelope-adapters.js +14 -0
- package/dist/envelopes/builders.d.ts +145 -0
- package/dist/envelopes/builders.d.ts.map +1 -0
- package/dist/envelopes/builders.js +113 -0
- package/dist/errors/unknown-permission-name.d.ts +12 -0
- package/dist/errors/unknown-permission-name.d.ts.map +1 -0
- package/dist/errors/unknown-permission-name.js +29 -0
- package/dist/errors/version-mismatch.d.ts +55 -0
- package/dist/errors/version-mismatch.d.ts.map +1 -0
- package/dist/errors/version-mismatch.js +52 -0
- package/dist/gadgets/resolve-contract-gadgets.d.ts +93 -0
- package/dist/gadgets/resolve-contract-gadgets.d.ts.map +1 -0
- package/dist/gadgets/resolve-contract-gadgets.js +119 -0
- package/dist/gadgets/stdlib-gadgets.d.ts +43 -0
- package/dist/gadgets/stdlib-gadgets.d.ts.map +1 -0
- package/dist/gadgets/stdlib-gadgets.js +161 -0
- package/dist/iframe-bridge.d.ts +63 -0
- package/dist/iframe-bridge.d.ts.map +1 -0
- package/dist/iframe-bridge.js +166 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +79 -0
- package/dist/integrations/mcp-apps.d.ts +1218 -0
- package/dist/integrations/mcp-apps.d.ts.map +1 -0
- package/dist/integrations/mcp-apps.js +427 -0
- package/dist/navigation/index.d.ts +3 -0
- package/dist/navigation/index.d.ts.map +1 -0
- package/dist/navigation/index.js +1 -0
- package/dist/navigation/stack-navigation.d.ts +55 -0
- package/dist/navigation/stack-navigation.d.ts.map +1 -0
- package/dist/navigation/stack-navigation.js +80 -0
- package/dist/recommended-prompts.d.ts +56 -0
- package/dist/recommended-prompts.d.ts.map +1 -0
- package/dist/recommended-prompts.js +55 -0
- package/dist/registry/blueprint-key.d.ts +9 -0
- package/dist/registry/blueprint-key.d.ts.map +1 -0
- package/dist/registry/blueprint-key.js +28 -0
- package/dist/registry/canonicalize-contract.d.ts +35 -0
- package/dist/registry/canonicalize-contract.d.ts.map +1 -0
- package/dist/registry/canonicalize-contract.js +166 -0
- package/dist/registry/summarize-contract.d.ts +46 -0
- package/dist/registry/summarize-contract.d.ts.map +1 -0
- package/dist/registry/summarize-contract.js +63 -0
- package/dist/schema-learning/derive-contract.d.ts +67 -0
- package/dist/schema-learning/derive-contract.d.ts.map +1 -0
- package/dist/schema-learning/derive-contract.js +117 -0
- package/dist/schema-learning/merge.d.ts +32 -0
- package/dist/schema-learning/merge.d.ts.map +1 -0
- package/dist/schema-learning/merge.js +146 -0
- package/dist/schemas/blueprint.d.ts +32 -0
- package/dist/schemas/blueprint.d.ts.map +1 -0
- package/dist/schemas/blueprint.js +92 -0
- package/dist/schemas/data-contract.d.ts +750 -0
- package/dist/schemas/data-contract.d.ts.map +1 -0
- package/dist/schemas/data-contract.js +663 -0
- package/dist/schemas/gadget-name-grammar.d.ts +29 -0
- package/dist/schemas/gadget-name-grammar.d.ts.map +1 -0
- package/dist/schemas/gadget-name-grammar.js +28 -0
- package/dist/schemas/handshake-suggestion.d.ts +46 -0
- package/dist/schemas/handshake-suggestion.d.ts.map +1 -0
- package/dist/schemas/handshake-suggestion.js +107 -0
- package/dist/schemas/invoke.d.ts +337 -0
- package/dist/schemas/invoke.d.ts.map +1 -0
- package/dist/schemas/invoke.js +169 -0
- package/dist/schemas/mcp.d.ts +301 -0
- package/dist/schemas/mcp.d.ts.map +1 -0
- package/dist/schemas/mcp.js +373 -0
- package/dist/schemas/ops-blueprint.d.ts +176 -0
- package/dist/schemas/ops-blueprint.d.ts.map +1 -0
- package/dist/schemas/ops-blueprint.js +259 -0
- package/dist/schemas/sync-check.d.ts +11 -0
- package/dist/schemas/sync-check.d.ts.map +1 -0
- package/dist/schemas/sync-check.js +60 -0
- package/dist/screen-blueprints/define.d.ts +22 -0
- package/dist/screen-blueprints/define.d.ts.map +1 -0
- package/dist/screen-blueprints/define.js +3 -0
- package/dist/screen-blueprints/index.d.ts +4 -0
- package/dist/screen-blueprints/index.d.ts.map +1 -0
- package/dist/screen-blueprints/index.js +3 -0
- package/dist/screen-blueprints/match.d.ts +35 -0
- package/dist/screen-blueprints/match.d.ts.map +1 -0
- package/dist/screen-blueprints/match.js +51 -0
- package/dist/screen-blueprints/types.d.ts +164 -0
- package/dist/screen-blueprints/types.d.ts.map +1 -0
- package/dist/screen-blueprints/types.js +1 -0
- package/dist/stream/stream-parser.d.ts +62 -0
- package/dist/stream/stream-parser.d.ts.map +1 -0
- package/dist/stream/stream-parser.js +199 -0
- package/dist/transport/websocket.d.ts +178 -0
- package/dist/transport/websocket.d.ts.map +1 -0
- package/dist/transport/websocket.js +1 -0
- package/dist/types/app-config.d.ts +61 -0
- package/dist/types/app-config.d.ts.map +1 -0
- package/dist/types/app-config.js +1 -0
- package/dist/types/auth.d.ts +61 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +1 -0
- package/dist/types/blueprint.d.ts +206 -0
- package/dist/types/blueprint.d.ts.map +1 -0
- package/dist/types/blueprint.js +1 -0
- package/dist/types/canvas-lifecycle.d.ts +105 -0
- package/dist/types/canvas-lifecycle.d.ts.map +1 -0
- package/dist/types/canvas-lifecycle.js +38 -0
- package/dist/types/capabilities.d.ts +40 -0
- package/dist/types/capabilities.d.ts.map +1 -0
- package/dist/types/capabilities.js +19 -0
- package/dist/types/contract-inference.d.ts +401 -0
- package/dist/types/contract-inference.d.ts.map +1 -0
- package/dist/types/contract-inference.js +44 -0
- package/dist/types/credential.d.ts +41 -0
- package/dist/types/credential.d.ts.map +1 -0
- package/dist/types/credential.js +32 -0
- package/dist/types/data-bindings.d.ts +322 -0
- package/dist/types/data-bindings.d.ts.map +1 -0
- package/dist/types/data-bindings.js +29 -0
- package/dist/types/data-contract.d.ts +1296 -0
- package/dist/types/data-contract.d.ts.map +1 -0
- package/dist/types/data-contract.js +111 -0
- package/dist/types/events.d.ts +182 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +8 -0
- package/dist/types/feedback.d.ts +24 -0
- package/dist/types/feedback.d.ts.map +1 -0
- package/dist/types/feedback.js +7 -0
- package/dist/types/gadget.d.ts +121 -0
- package/dist/types/gadget.d.ts.map +1 -0
- package/dist/types/gadget.js +24 -0
- package/dist/types/handshake-suggestion.d.ts +264 -0
- package/dist/types/handshake-suggestion.d.ts.map +1 -0
- package/dist/types/handshake-suggestion.js +70 -0
- package/dist/types/host-context.d.ts +163 -0
- package/dist/types/host-context.d.ts.map +1 -0
- package/dist/types/host-context.js +142 -0
- package/dist/types/interface-context.d.ts +105 -0
- package/dist/types/interface-context.d.ts.map +1 -0
- package/dist/types/interface-context.js +115 -0
- package/dist/types/invoke.d.ts +28 -0
- package/dist/types/invoke.d.ts.map +1 -0
- package/dist/types/invoke.js +7 -0
- package/dist/types/live-channel.d.ts +613 -0
- package/dist/types/live-channel.d.ts.map +1 -0
- package/dist/types/live-channel.js +1 -0
- package/dist/types/llm.d.ts +61 -0
- package/dist/types/llm.d.ts.map +1 -0
- package/dist/types/llm.js +186 -0
- package/dist/types/mcp-proxy.d.ts +67 -0
- package/dist/types/mcp-proxy.d.ts.map +1 -0
- package/dist/types/mcp-proxy.js +46 -0
- package/dist/types/mcp.d.ts +637 -0
- package/dist/types/mcp.d.ts.map +1 -0
- package/dist/types/mcp.js +30 -0
- package/dist/types/openrouter-models.d.ts +22 -0
- package/dist/types/openrouter-models.d.ts.map +1 -0
- package/dist/types/openrouter-models.js +4843 -0
- package/dist/types/region.d.ts +26 -0
- package/dist/types/region.d.ts.map +1 -0
- package/dist/types/region.js +36 -0
- package/dist/types/session.d.ts +419 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/session.js +1 -0
- package/dist/types/thread.d.ts +207 -0
- package/dist/types/thread.d.ts.map +1 -0
- package/dist/types/thread.js +57 -0
- package/dist/types/ui-generator.d.ts +100 -0
- package/dist/types/ui-generator.d.ts.map +1 -0
- package/dist/types/ui-generator.js +53 -0
- package/dist/validation/ajv-runtime.d.ts +140 -0
- package/dist/validation/ajv-runtime.d.ts.map +1 -0
- package/dist/validation/ajv-runtime.js +452 -0
- package/dist/validation/content-hash.d.ts +3 -0
- package/dist/validation/content-hash.d.ts.map +1 -0
- package/dist/validation/content-hash.js +21 -0
- package/dist/validation/contract-validator.d.ts +244 -0
- package/dist/validation/contract-validator.d.ts.map +1 -0
- package/dist/validation/contract-validator.js +711 -0
- package/dist/validation/cross-references.d.ts +105 -0
- package/dist/validation/cross-references.d.ts.map +1 -0
- package/dist/validation/cross-references.js +164 -0
- package/dist/validation/hygiene-rules.d.ts +250 -0
- package/dist/validation/hygiene-rules.d.ts.map +1 -0
- package/dist/validation/hygiene-rules.js +564 -0
- package/dist/validation/lint-contract.d.ts +130 -0
- package/dist/validation/lint-contract.d.ts.map +1 -0
- package/dist/validation/lint-contract.js +225 -0
- package/dist/validation/name-invariants.d.ts +117 -0
- package/dist/validation/name-invariants.d.ts.map +1 -0
- package/dist/validation/name-invariants.js +172 -0
- package/dist/validation/reserved-channels.d.ts +156 -0
- package/dist/validation/reserved-channels.d.ts.map +1 -0
- package/dist/validation/reserved-channels.js +356 -0
- package/dist/validation/resolve-stream-channel.d.ts +78 -0
- package/dist/validation/resolve-stream-channel.d.ts.map +1 -0
- package/dist/validation/resolve-stream-channel.js +64 -0
- package/dist/validation/sanitize-error.d.ts +46 -0
- package/dist/validation/sanitize-error.d.ts.map +1 -0
- package/dist/validation/sanitize-error.js +88 -0
- package/dist/validation/schema-compat-invariants.d.ts +140 -0
- package/dist/validation/schema-compat-invariants.d.ts.map +1 -0
- package/dist/validation/schema-compat-invariants.js +220 -0
- package/dist/validation/schema-meta-validation.d.ts +60 -0
- package/dist/validation/schema-meta-validation.d.ts.map +1 -0
- package/dist/validation/schema-meta-validation.js +131 -0
- package/dist/validation/schema-subset.d.ts +165 -0
- package/dist/validation/schema-subset.d.ts.map +1 -0
- package/dist/validation/schema-subset.js +295 -0
- package/dist/validation/ui-security.d.ts +54 -0
- package/dist/validation/ui-security.d.ts.map +1 -0
- package/dist/validation/ui-security.js +138 -0
- package/dist/validation/zod-to-json-schema.d.ts +63 -0
- package/dist/validation/zod-to-json-schema.d.ts.map +1 -0
- package/dist/validation/zod-to-json-schema.js +126 -0
- package/dist/version.d.ts +1458 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +1459 -0
- package/package.json +113 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gadget export-name grammars — leaf module, ZERO imports.
|
|
3
|
+
*
|
|
4
|
+
* The `use`-prefixed hook grammar and the PascalCase component
|
|
5
|
+
* grammar are needed by both `schemas/data-contract.ts` (wire
|
|
6
|
+
* schemas) and `validation/hygiene-rules.ts` (catalog lints).
|
|
7
|
+
* `data-contract.ts` already imports `KNOWN_PERMISSION_NAMES` from
|
|
8
|
+
* `hygiene-rules.ts`; having `hygiene-rules.ts` import the regexes
|
|
9
|
+
* back from `data-contract.ts` would close an import cycle. Pinning
|
|
10
|
+
* the two grammars in this dependency-free leaf keeps both consumers
|
|
11
|
+
* importing downward only — no cycle is possible.
|
|
12
|
+
*
|
|
13
|
+
* `data-contract.ts` re-exports both symbols, so the package barrel
|
|
14
|
+
* (`index.ts`) surface is unchanged for external consumers.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Hook-name grammar — `use`-prefixed camelCase (`useLeafletMap`,
|
|
18
|
+
* `useGeolocation`). Formalizes the convention the boilerplate
|
|
19
|
+
* generator + the LLM rely on. Excludes tab so `gadgetIdentityKey`
|
|
20
|
+
* cannot collide.
|
|
21
|
+
*/
|
|
22
|
+
export declare const HOOK_NAME_RE: RegExp;
|
|
23
|
+
/**
|
|
24
|
+
* Component-name grammar — PascalCase (`Chart`, `MapView`). A gadget
|
|
25
|
+
* component export is rendered as JSX, so the name must be a legal
|
|
26
|
+
* PascalCase React component identifier.
|
|
27
|
+
*/
|
|
28
|
+
export declare const COMPONENT_NAME_RE: RegExp;
|
|
29
|
+
//# sourceMappingURL=gadget-name-grammar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gadget-name-grammar.d.ts","sourceRoot":"","sources":["../../src/schemas/gadget-name-grammar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,YAAY,QAA2B,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAwB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gadget export-name grammars — leaf module, ZERO imports.
|
|
3
|
+
*
|
|
4
|
+
* The `use`-prefixed hook grammar and the PascalCase component
|
|
5
|
+
* grammar are needed by both `schemas/data-contract.ts` (wire
|
|
6
|
+
* schemas) and `validation/hygiene-rules.ts` (catalog lints).
|
|
7
|
+
* `data-contract.ts` already imports `KNOWN_PERMISSION_NAMES` from
|
|
8
|
+
* `hygiene-rules.ts`; having `hygiene-rules.ts` import the regexes
|
|
9
|
+
* back from `data-contract.ts` would close an import cycle. Pinning
|
|
10
|
+
* the two grammars in this dependency-free leaf keeps both consumers
|
|
11
|
+
* importing downward only — no cycle is possible.
|
|
12
|
+
*
|
|
13
|
+
* `data-contract.ts` re-exports both symbols, so the package barrel
|
|
14
|
+
* (`index.ts`) surface is unchanged for external consumers.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Hook-name grammar — `use`-prefixed camelCase (`useLeafletMap`,
|
|
18
|
+
* `useGeolocation`). Formalizes the convention the boilerplate
|
|
19
|
+
* generator + the LLM rely on. Excludes tab so `gadgetIdentityKey`
|
|
20
|
+
* cannot collide.
|
|
21
|
+
*/
|
|
22
|
+
export const HOOK_NAME_RE = /^use[A-Z][A-Za-z0-9]*$/;
|
|
23
|
+
/**
|
|
24
|
+
* Component-name grammar — PascalCase (`Chart`, `MapView`). A gadget
|
|
25
|
+
* component export is rendered as JSX, so the name must be a legal
|
|
26
|
+
* PascalCase React component identifier.
|
|
27
|
+
*/
|
|
28
|
+
export const COMPONENT_NAME_RE = /^[A-Z][A-Za-z0-9]*$/;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod mirrors for the handshake-suggestion shapes
|
|
3
|
+
* (`packages/protocol/src/types/handshake-suggestion.ts`).
|
|
4
|
+
*
|
|
5
|
+
* Structural-mirror discipline matches `data-contract.ts` /
|
|
6
|
+
* `blueprint.ts`: TS interfaces in `../types/handshake-suggestion.ts`
|
|
7
|
+
* are the declared source of truth; the schemas here are typed
|
|
8
|
+
* `z.ZodType<T>` so any drift fails compile.
|
|
9
|
+
*/
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
import type { BlueprintDraft, BlueprintMeta, HandshakeSuggestion, JsonPatch, JsonPatchOp, PushDecision, SuggestionAmendments, SuggestionFinding, SuggestionOrigin } from '../types/handshake-suggestion.js';
|
|
12
|
+
/** Three-mode routing enum on {@link HandshakeSuggestion.origin}. */
|
|
13
|
+
export declare const suggestionOriginSchema: z.ZodType<SuggestionOrigin>;
|
|
14
|
+
/** Single JSON-Patch op (RFC 6902 subset — add/remove/replace). */
|
|
15
|
+
export declare const jsonPatchOpSchema: z.ZodType<JsonPatchOp>;
|
|
16
|
+
/** `JsonPatch` — array of ops; subset support per the doc. */
|
|
17
|
+
export declare const jsonPatchSchema: z.ZodType<JsonPatch>;
|
|
18
|
+
/**
|
|
19
|
+
* Inner zod-object form of {@link blueprintDraftSchema}. Exposed so
|
|
20
|
+
* the sync-check script can reflect `.shape` to enumerate fields;
|
|
21
|
+
* normal consumers should prefer {@link blueprintDraftSchema} (typed
|
|
22
|
+
* `z.ZodType<BlueprintDraft>`).
|
|
23
|
+
*/
|
|
24
|
+
export declare const blueprintDraftObjectSchema: z.ZodObject<{
|
|
25
|
+
contract: z.ZodType<import("../index.js").DataContract, unknown, z.core.$ZodTypeInternals<import("../index.js").DataContract, unknown>>;
|
|
26
|
+
variance: z.ZodOptional<z.ZodObject<{
|
|
27
|
+
persona: z.ZodOptional<z.ZodString>;
|
|
28
|
+
aesthetic: z.ZodOptional<z.ZodString>;
|
|
29
|
+
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../index.js").JsonValue, unknown, z.core.$ZodTypeInternals<import("../index.js").JsonValue, unknown>>>>;
|
|
30
|
+
seedPrompt: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, z.core.$strict>>;
|
|
32
|
+
generator: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
/** `BlueprintDraft` — input shape on handshake + override push. */
|
|
35
|
+
export declare const blueprintDraftSchema: z.ZodType<BlueprintDraft>;
|
|
36
|
+
/** `BlueprintMeta` — projected onto the handshake response. */
|
|
37
|
+
export declare const blueprintMetaSchema: z.ZodType<BlueprintMeta>;
|
|
38
|
+
/** `SuggestionFinding` — validator finding surfaced on the suggestion. */
|
|
39
|
+
export declare const suggestionFindingSchema: z.ZodType<SuggestionFinding>;
|
|
40
|
+
/** Synth amendment — JSON-Patch diff + reasoning. */
|
|
41
|
+
export declare const suggestionAmendmentsSchema: z.ZodType<SuggestionAmendments>;
|
|
42
|
+
/** The full handshake suggestion — produced in step-2 of the handshake. */
|
|
43
|
+
export declare const handshakeSuggestionSchema: z.ZodType<HandshakeSuggestion>;
|
|
44
|
+
/** Push decision discriminator — accept vs override. */
|
|
45
|
+
export declare const pushDecisionSchema: z.ZodType<PushDecision>;
|
|
46
|
+
//# sourceMappingURL=handshake-suggestion.d.ts.map
|
|
@@ -0,0 +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;AACxB,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,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,eAAO,MAAM,0BAA0B;;;;;;;;;kBAc5B,CAAC;AAEZ,mEAAmE;AACnE,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,CAQxB,CAAC;AAE9C,wDAAwD;AACxD,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAQ1B,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod mirrors for the handshake-suggestion shapes
|
|
3
|
+
* (`packages/protocol/src/types/handshake-suggestion.ts`).
|
|
4
|
+
*
|
|
5
|
+
* Structural-mirror discipline matches `data-contract.ts` /
|
|
6
|
+
* `blueprint.ts`: TS interfaces in `../types/handshake-suggestion.ts`
|
|
7
|
+
* are the declared source of truth; the schemas here are typed
|
|
8
|
+
* `z.ZodType<T>` so any drift fails compile.
|
|
9
|
+
*/
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
import { dataContractSchema, jsonValueSchema } from './data-contract.js';
|
|
12
|
+
import { blueprintVarianceSchema } from './blueprint.js';
|
|
13
|
+
/** Three-mode routing enum on {@link HandshakeSuggestion.origin}. */
|
|
14
|
+
export const suggestionOriginSchema = z.enum([
|
|
15
|
+
'cache',
|
|
16
|
+
'agent',
|
|
17
|
+
'synth',
|
|
18
|
+
]);
|
|
19
|
+
/** Single JSON-Patch op (RFC 6902 subset — add/remove/replace). */
|
|
20
|
+
export const jsonPatchOpSchema = z.union([
|
|
21
|
+
z.object({
|
|
22
|
+
op: z.literal('add'),
|
|
23
|
+
path: z.string(),
|
|
24
|
+
value: jsonValueSchema,
|
|
25
|
+
}).strict(),
|
|
26
|
+
z.object({
|
|
27
|
+
op: z.literal('remove'),
|
|
28
|
+
path: z.string(),
|
|
29
|
+
}).strict(),
|
|
30
|
+
z.object({
|
|
31
|
+
op: z.literal('replace'),
|
|
32
|
+
path: z.string(),
|
|
33
|
+
value: jsonValueSchema,
|
|
34
|
+
}).strict(),
|
|
35
|
+
]);
|
|
36
|
+
/** `JsonPatch` — array of ops; subset support per the doc. */
|
|
37
|
+
export const jsonPatchSchema = z.array(jsonPatchOpSchema);
|
|
38
|
+
/**
|
|
39
|
+
* Inner zod-object form of {@link blueprintDraftSchema}. Exposed so
|
|
40
|
+
* the sync-check script can reflect `.shape` to enumerate fields;
|
|
41
|
+
* normal consumers should prefer {@link blueprintDraftSchema} (typed
|
|
42
|
+
* `z.ZodType<BlueprintDraft>`).
|
|
43
|
+
*/
|
|
44
|
+
export const blueprintDraftObjectSchema = z
|
|
45
|
+
.object({
|
|
46
|
+
contract: dataContractSchema,
|
|
47
|
+
variance: z
|
|
48
|
+
.object({
|
|
49
|
+
persona: z.string().optional(),
|
|
50
|
+
aesthetic: z.string().optional(),
|
|
51
|
+
context: z.record(z.string(), jsonValueSchema).optional(),
|
|
52
|
+
seedPrompt: z.string().optional(),
|
|
53
|
+
})
|
|
54
|
+
.strict()
|
|
55
|
+
.optional(),
|
|
56
|
+
generator: z.string().optional(),
|
|
57
|
+
})
|
|
58
|
+
.strict();
|
|
59
|
+
/** `BlueprintDraft` — input shape on handshake + override push. */
|
|
60
|
+
export const blueprintDraftSchema = blueprintDraftObjectSchema;
|
|
61
|
+
/** `BlueprintMeta` — projected onto the handshake response. */
|
|
62
|
+
export const blueprintMetaSchema = z
|
|
63
|
+
.object({
|
|
64
|
+
blueprintId: z.string().min(1),
|
|
65
|
+
contractHash: z.string().min(1),
|
|
66
|
+
codeHash: z.string().optional(),
|
|
67
|
+
generator: z.string().min(1),
|
|
68
|
+
variance: blueprintVarianceSchema,
|
|
69
|
+
selectedReason: z.string().optional(),
|
|
70
|
+
})
|
|
71
|
+
.strict();
|
|
72
|
+
/** `SuggestionFinding` — validator finding surfaced on the suggestion. */
|
|
73
|
+
export const suggestionFindingSchema = z
|
|
74
|
+
.object({
|
|
75
|
+
code: z.string().min(1),
|
|
76
|
+
severity: z.enum(['error', 'warn']),
|
|
77
|
+
path: z.string(),
|
|
78
|
+
message: z.string(),
|
|
79
|
+
})
|
|
80
|
+
.strict();
|
|
81
|
+
/** Synth amendment — JSON-Patch diff + reasoning. */
|
|
82
|
+
export const suggestionAmendmentsSchema = z
|
|
83
|
+
.object({
|
|
84
|
+
contractDiff: jsonPatchSchema,
|
|
85
|
+
reasoning: z.string(),
|
|
86
|
+
})
|
|
87
|
+
.strict();
|
|
88
|
+
/** The full handshake suggestion — produced in step-2 of the handshake. */
|
|
89
|
+
export const handshakeSuggestionSchema = z
|
|
90
|
+
.object({
|
|
91
|
+
origin: suggestionOriginSchema,
|
|
92
|
+
rationale: z.string(),
|
|
93
|
+
blueprintMeta: blueprintMetaSchema,
|
|
94
|
+
amendments: suggestionAmendmentsSchema.optional(),
|
|
95
|
+
validationFindings: z.array(suggestionFindingSchema).optional(),
|
|
96
|
+
})
|
|
97
|
+
.strict();
|
|
98
|
+
/** Push decision discriminator — accept vs override. */
|
|
99
|
+
export const pushDecisionSchema = z.union([
|
|
100
|
+
z.object({ kind: z.literal('accept') }).strict(),
|
|
101
|
+
z
|
|
102
|
+
.object({
|
|
103
|
+
kind: z.literal('override'),
|
|
104
|
+
blueprintDraft: blueprintDraftSchema,
|
|
105
|
+
})
|
|
106
|
+
.strict(),
|
|
107
|
+
]);
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Streamable Invoke Protocol v1 — Zod schemas.
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for the client→agent invoke turn. Mirrors Anthropic's
|
|
5
|
+
* Messages streaming format exactly (message_start / content_block_{start,delta,stop}
|
|
6
|
+
* / message_delta / message_stop / ping / error). UI rendering is expressed as
|
|
7
|
+
* plain `tool_use` blocks calling the `ggui_render` / `ggui_render_blueprint`
|
|
8
|
+
* client tools — no ggui-specific block type.
|
|
9
|
+
*
|
|
10
|
+
* TS types in types/invoke.ts are derived from these via z.infer. Consumers
|
|
11
|
+
* (@ggui-ai/server, @ggui-ai/react) import schemas for runtime validation
|
|
12
|
+
* and types for authoring.
|
|
13
|
+
*/
|
|
14
|
+
import { z } from 'zod';
|
|
15
|
+
/** Plain text content — streamed via `text_delta` events. */
|
|
16
|
+
export declare const textBlockSchema: z.ZodObject<{
|
|
17
|
+
type: z.ZodLiteral<"text">;
|
|
18
|
+
text: z.ZodString;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
/** Tool call initiated by the agent. Input may arrive via `input_json_delta`. */
|
|
21
|
+
export declare const toolUseBlockSchema: z.ZodObject<{
|
|
22
|
+
type: z.ZodLiteral<"tool_use">;
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
/**
|
|
28
|
+
* Tool execution result (Protocol v1.1).
|
|
29
|
+
*
|
|
30
|
+
* Emitted inline on the assistant turn when the server executed a tool on
|
|
31
|
+
* the agent's behalf (e.g. `ggui_push`, `ggui_handshake`). Clients pair this
|
|
32
|
+
* with the matching `tool_use` by `tool_use_id` and render — no second
|
|
33
|
+
* round-trip through a `ggui_render` client tool is needed.
|
|
34
|
+
*
|
|
35
|
+
* This extends Anthropic's shape: Anthropic puts `tool_result` in the next
|
|
36
|
+
* user message, we also allow it on the assistant turn because the server
|
|
37
|
+
* already has the result. The `content` shape depends on the tool.
|
|
38
|
+
*/
|
|
39
|
+
export declare const toolResultBlockSchema: z.ZodObject<{
|
|
40
|
+
type: z.ZodLiteral<"tool_result">;
|
|
41
|
+
tool_use_id: z.ZodString;
|
|
42
|
+
content: z.ZodUnknown;
|
|
43
|
+
is_error: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
/** Discriminated union of every legal content block type. */
|
|
46
|
+
export declare const contentBlockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
47
|
+
type: z.ZodLiteral<"text">;
|
|
48
|
+
text: z.ZodString;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
type: z.ZodLiteral<"tool_use">;
|
|
51
|
+
id: z.ZodString;
|
|
52
|
+
name: z.ZodString;
|
|
53
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
54
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
55
|
+
type: z.ZodLiteral<"tool_result">;
|
|
56
|
+
tool_use_id: z.ZodString;
|
|
57
|
+
content: z.ZodUnknown;
|
|
58
|
+
is_error: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
}, z.core.$strip>], "type">;
|
|
60
|
+
export declare const textDeltaSchema: z.ZodObject<{
|
|
61
|
+
type: z.ZodLiteral<"text_delta">;
|
|
62
|
+
text: z.ZodString;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
export declare const inputJsonDeltaSchema: z.ZodObject<{
|
|
65
|
+
type: z.ZodLiteral<"input_json_delta">;
|
|
66
|
+
partial_json: z.ZodString;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
export declare const contentBlockDeltaPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
69
|
+
type: z.ZodLiteral<"text_delta">;
|
|
70
|
+
text: z.ZodString;
|
|
71
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
72
|
+
type: z.ZodLiteral<"input_json_delta">;
|
|
73
|
+
partial_json: z.ZodString;
|
|
74
|
+
}, z.core.$strip>], "type">;
|
|
75
|
+
/** First event of a turn. */
|
|
76
|
+
export declare const messageStartEventSchema: z.ZodObject<{
|
|
77
|
+
type: z.ZodLiteral<"message_start">;
|
|
78
|
+
message: z.ZodObject<{
|
|
79
|
+
id: z.ZodString;
|
|
80
|
+
role: z.ZodLiteral<"assistant">;
|
|
81
|
+
model: z.ZodOptional<z.ZodString>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
/** A new content block begins. */
|
|
85
|
+
export declare const contentBlockStartEventSchema: z.ZodObject<{
|
|
86
|
+
type: z.ZodLiteral<"content_block_start">;
|
|
87
|
+
index: z.ZodNumber;
|
|
88
|
+
content_block: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
89
|
+
type: z.ZodLiteral<"text">;
|
|
90
|
+
text: z.ZodString;
|
|
91
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
92
|
+
type: z.ZodLiteral<"tool_use">;
|
|
93
|
+
id: z.ZodString;
|
|
94
|
+
name: z.ZodString;
|
|
95
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
96
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
97
|
+
type: z.ZodLiteral<"tool_result">;
|
|
98
|
+
tool_use_id: z.ZodString;
|
|
99
|
+
content: z.ZodUnknown;
|
|
100
|
+
is_error: z.ZodOptional<z.ZodBoolean>;
|
|
101
|
+
}, z.core.$strip>], "type">;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
/** Incremental update to the block at `index`. */
|
|
104
|
+
export declare const contentBlockDeltaEventSchema: z.ZodObject<{
|
|
105
|
+
type: z.ZodLiteral<"content_block_delta">;
|
|
106
|
+
index: z.ZodNumber;
|
|
107
|
+
delta: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
108
|
+
type: z.ZodLiteral<"text_delta">;
|
|
109
|
+
text: z.ZodString;
|
|
110
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
111
|
+
type: z.ZodLiteral<"input_json_delta">;
|
|
112
|
+
partial_json: z.ZodString;
|
|
113
|
+
}, z.core.$strip>], "type">;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
/** The block at `index` is complete. */
|
|
116
|
+
export declare const contentBlockStopEventSchema: z.ZodObject<{
|
|
117
|
+
type: z.ZodLiteral<"content_block_stop">;
|
|
118
|
+
index: z.ZodNumber;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
/** Final metadata just before the turn ends. */
|
|
121
|
+
export declare const messageDeltaEventSchema: z.ZodObject<{
|
|
122
|
+
type: z.ZodLiteral<"message_delta">;
|
|
123
|
+
delta: z.ZodObject<{
|
|
124
|
+
stop_reason: z.ZodEnum<{
|
|
125
|
+
error: "error";
|
|
126
|
+
tool_use: "tool_use";
|
|
127
|
+
end_turn: "end_turn";
|
|
128
|
+
max_tokens: "max_tokens";
|
|
129
|
+
}>;
|
|
130
|
+
stop_sequence: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
usage: z.ZodObject<{
|
|
133
|
+
input_tokens: z.ZodNumber;
|
|
134
|
+
output_tokens: z.ZodNumber;
|
|
135
|
+
}, z.core.$strip>;
|
|
136
|
+
}, z.core.$strip>;
|
|
137
|
+
/** Turn is done. No events may follow. */
|
|
138
|
+
export declare const messageStopEventSchema: z.ZodObject<{
|
|
139
|
+
type: z.ZodLiteral<"message_stop">;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
/** Keep-alive frame. */
|
|
142
|
+
export declare const pingEventSchema: z.ZodObject<{
|
|
143
|
+
type: z.ZodLiteral<"ping">;
|
|
144
|
+
}, z.core.$strip>;
|
|
145
|
+
/** Terminal error. No `message_stop` follows. */
|
|
146
|
+
export declare const invokeErrorCodeSchema: z.ZodEnum<{
|
|
147
|
+
invalid_request: "invalid_request";
|
|
148
|
+
unauthorized: "unauthorized";
|
|
149
|
+
rate_limited: "rate_limited";
|
|
150
|
+
invoke_in_progress: "invoke_in_progress";
|
|
151
|
+
upstream_error: "upstream_error";
|
|
152
|
+
tool_error: "tool_error";
|
|
153
|
+
internal: "internal";
|
|
154
|
+
}>;
|
|
155
|
+
export declare const errorEventSchema: z.ZodObject<{
|
|
156
|
+
type: z.ZodLiteral<"error">;
|
|
157
|
+
error: z.ZodObject<{
|
|
158
|
+
code: z.ZodEnum<{
|
|
159
|
+
invalid_request: "invalid_request";
|
|
160
|
+
unauthorized: "unauthorized";
|
|
161
|
+
rate_limited: "rate_limited";
|
|
162
|
+
invoke_in_progress: "invoke_in_progress";
|
|
163
|
+
upstream_error: "upstream_error";
|
|
164
|
+
tool_error: "tool_error";
|
|
165
|
+
internal: "internal";
|
|
166
|
+
}>;
|
|
167
|
+
message: z.ZodString;
|
|
168
|
+
retryAfterMs: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
}, z.core.$strip>;
|
|
170
|
+
}, z.core.$strip>;
|
|
171
|
+
/**
|
|
172
|
+
* Discriminated union over every event the agent may emit.
|
|
173
|
+
*
|
|
174
|
+
* Parsing an incoming SSE frame:
|
|
175
|
+
* const event = invokeEventSchema.parse(JSON.parse(frame.data));
|
|
176
|
+
* switch (event.type) { ... }
|
|
177
|
+
*/
|
|
178
|
+
export declare const invokeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
179
|
+
type: z.ZodLiteral<"message_start">;
|
|
180
|
+
message: z.ZodObject<{
|
|
181
|
+
id: z.ZodString;
|
|
182
|
+
role: z.ZodLiteral<"assistant">;
|
|
183
|
+
model: z.ZodOptional<z.ZodString>;
|
|
184
|
+
}, z.core.$strip>;
|
|
185
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
186
|
+
type: z.ZodLiteral<"content_block_start">;
|
|
187
|
+
index: z.ZodNumber;
|
|
188
|
+
content_block: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
189
|
+
type: z.ZodLiteral<"text">;
|
|
190
|
+
text: z.ZodString;
|
|
191
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
192
|
+
type: z.ZodLiteral<"tool_use">;
|
|
193
|
+
id: z.ZodString;
|
|
194
|
+
name: z.ZodString;
|
|
195
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
196
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
197
|
+
type: z.ZodLiteral<"tool_result">;
|
|
198
|
+
tool_use_id: z.ZodString;
|
|
199
|
+
content: z.ZodUnknown;
|
|
200
|
+
is_error: z.ZodOptional<z.ZodBoolean>;
|
|
201
|
+
}, z.core.$strip>], "type">;
|
|
202
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
203
|
+
type: z.ZodLiteral<"content_block_delta">;
|
|
204
|
+
index: z.ZodNumber;
|
|
205
|
+
delta: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
206
|
+
type: z.ZodLiteral<"text_delta">;
|
|
207
|
+
text: z.ZodString;
|
|
208
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
209
|
+
type: z.ZodLiteral<"input_json_delta">;
|
|
210
|
+
partial_json: z.ZodString;
|
|
211
|
+
}, z.core.$strip>], "type">;
|
|
212
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
213
|
+
type: z.ZodLiteral<"content_block_stop">;
|
|
214
|
+
index: z.ZodNumber;
|
|
215
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
216
|
+
type: z.ZodLiteral<"message_delta">;
|
|
217
|
+
delta: z.ZodObject<{
|
|
218
|
+
stop_reason: z.ZodEnum<{
|
|
219
|
+
error: "error";
|
|
220
|
+
tool_use: "tool_use";
|
|
221
|
+
end_turn: "end_turn";
|
|
222
|
+
max_tokens: "max_tokens";
|
|
223
|
+
}>;
|
|
224
|
+
stop_sequence: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
225
|
+
}, z.core.$strip>;
|
|
226
|
+
usage: z.ZodObject<{
|
|
227
|
+
input_tokens: z.ZodNumber;
|
|
228
|
+
output_tokens: z.ZodNumber;
|
|
229
|
+
}, z.core.$strip>;
|
|
230
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
231
|
+
type: z.ZodLiteral<"message_stop">;
|
|
232
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
233
|
+
type: z.ZodLiteral<"ping">;
|
|
234
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
235
|
+
type: z.ZodLiteral<"error">;
|
|
236
|
+
error: z.ZodObject<{
|
|
237
|
+
code: z.ZodEnum<{
|
|
238
|
+
invalid_request: "invalid_request";
|
|
239
|
+
unauthorized: "unauthorized";
|
|
240
|
+
rate_limited: "rate_limited";
|
|
241
|
+
invoke_in_progress: "invoke_in_progress";
|
|
242
|
+
upstream_error: "upstream_error";
|
|
243
|
+
tool_error: "tool_error";
|
|
244
|
+
internal: "internal";
|
|
245
|
+
}>;
|
|
246
|
+
message: z.ZodString;
|
|
247
|
+
retryAfterMs: z.ZodOptional<z.ZodNumber>;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
}, z.core.$strip>], "type">;
|
|
250
|
+
/**
|
|
251
|
+
* A prior conversation turn. Content is either a plain text shortcut or a
|
|
252
|
+
* structured content block sequence (mirrors Anthropic's `messages[].content`).
|
|
253
|
+
*/
|
|
254
|
+
export declare const invokeTurnSchema: z.ZodObject<{
|
|
255
|
+
role: z.ZodEnum<{
|
|
256
|
+
user: "user";
|
|
257
|
+
assistant: "assistant";
|
|
258
|
+
}>;
|
|
259
|
+
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
260
|
+
type: z.ZodLiteral<"text">;
|
|
261
|
+
text: z.ZodString;
|
|
262
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
263
|
+
type: z.ZodLiteral<"tool_use">;
|
|
264
|
+
id: z.ZodString;
|
|
265
|
+
name: z.ZodString;
|
|
266
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
267
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
268
|
+
type: z.ZodLiteral<"tool_result">;
|
|
269
|
+
tool_use_id: z.ZodString;
|
|
270
|
+
content: z.ZodUnknown;
|
|
271
|
+
is_error: z.ZodOptional<z.ZodBoolean>;
|
|
272
|
+
}, z.core.$strip>], "type">>]>;
|
|
273
|
+
}, z.core.$strip>;
|
|
274
|
+
/**
|
|
275
|
+
* POST body shape for `{endpointUrl}/invoke`.
|
|
276
|
+
*
|
|
277
|
+
* Stateless by default — client holds history, sends full `history[]` every
|
|
278
|
+
* turn. Agents that need server-side memory layer their own keyed on
|
|
279
|
+
* `X-Ggui-Session-Id`.
|
|
280
|
+
*/
|
|
281
|
+
export declare const invokeRequestSchema: z.ZodObject<{
|
|
282
|
+
message: z.ZodString;
|
|
283
|
+
history: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
284
|
+
role: z.ZodEnum<{
|
|
285
|
+
user: "user";
|
|
286
|
+
assistant: "assistant";
|
|
287
|
+
}>;
|
|
288
|
+
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
289
|
+
type: z.ZodLiteral<"text">;
|
|
290
|
+
text: z.ZodString;
|
|
291
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
292
|
+
type: z.ZodLiteral<"tool_use">;
|
|
293
|
+
id: z.ZodString;
|
|
294
|
+
name: z.ZodString;
|
|
295
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
296
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
297
|
+
type: z.ZodLiteral<"tool_result">;
|
|
298
|
+
tool_use_id: z.ZodString;
|
|
299
|
+
content: z.ZodUnknown;
|
|
300
|
+
is_error: z.ZodOptional<z.ZodBoolean>;
|
|
301
|
+
}, z.core.$strip>], "type">>]>;
|
|
302
|
+
}, z.core.$strip>>>;
|
|
303
|
+
interfaceContext: z.ZodOptional<z.ZodObject<{
|
|
304
|
+
viewport: z.ZodObject<{
|
|
305
|
+
width: z.ZodNumber;
|
|
306
|
+
height: z.ZodNumber;
|
|
307
|
+
}, z.core.$strip>;
|
|
308
|
+
platform: z.ZodEnum<{
|
|
309
|
+
web: "web";
|
|
310
|
+
desktop: "desktop";
|
|
311
|
+
mobile: "mobile";
|
|
312
|
+
}>;
|
|
313
|
+
deviceType: z.ZodEnum<{
|
|
314
|
+
desktop: "desktop";
|
|
315
|
+
phone: "phone";
|
|
316
|
+
tablet: "tablet";
|
|
317
|
+
}>;
|
|
318
|
+
orientation: z.ZodEnum<{
|
|
319
|
+
portrait: "portrait";
|
|
320
|
+
landscape: "landscape";
|
|
321
|
+
}>;
|
|
322
|
+
devicePixelRatio: z.ZodOptional<z.ZodNumber>;
|
|
323
|
+
touchPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
324
|
+
shellType: z.ZodOptional<z.ZodEnum<{
|
|
325
|
+
fullscreen: "fullscreen";
|
|
326
|
+
chat: "chat";
|
|
327
|
+
spatial: "spatial";
|
|
328
|
+
}>>;
|
|
329
|
+
colorScheme: z.ZodOptional<z.ZodEnum<{
|
|
330
|
+
light: "light";
|
|
331
|
+
dark: "dark";
|
|
332
|
+
}>>;
|
|
333
|
+
reducedMotion: z.ZodOptional<z.ZodBoolean>;
|
|
334
|
+
}, z.core.$loose>>;
|
|
335
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
336
|
+
}, z.core.$strip>;
|
|
337
|
+
//# sourceMappingURL=invoke.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoke.d.ts","sourceRoot":"","sources":["../../src/schemas/invoke.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,6DAA6D;AAC7D,eAAO,MAAM,eAAe;;;iBAG1B,CAAC;AAEH,iFAAiF;AACjF,eAAO,MAAM,kBAAkB;;;;;iBAK7B,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB;;;;;iBAKhC,CAAC;AAEH,6DAA6D;AAC7D,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;2BAI7B,CAAC;AAIH,eAAO,MAAM,eAAe;;;iBAG1B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;2BAGzC,CAAC;AAIH,6BAA6B;AAC7B,eAAO,MAAM,uBAAuB;;;;;;;iBAOlC,CAAC;AAEH,kCAAkC;AAClC,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;iBAIvC,CAAC;AAEH,kDAAkD;AAClD,eAAO,MAAM,4BAA4B;;;;;;;;;;iBAIvC,CAAC;AAEH,wCAAwC;AACxC,eAAO,MAAM,2BAA2B;;;iBAGtC,CAAC;AAEH,gDAAgD;AAChD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;iBAUlC,CAAC;AAEH,0CAA0C;AAC1C,eAAO,MAAM,sBAAsB;;iBAEjC,CAAC;AAEH,wBAAwB;AACxB,eAAO,MAAM,eAAe;;iBAE1B,CAAC;AAEH,iDAAiD;AACjD,eAAO,MAAM,qBAAqB;;;;;;;;EAQhC,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;iBAO3B,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAS5B,CAAC;AAIH;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;iBAG3B,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAK9B,CAAC"}
|