@ggui-ai/protocol 0.2.0-alpha.4 → 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 +49 -35
- 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 +9 -9
- package/dist/validation/hygiene-rules.js +13 -13
- 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 +1 -1
- package/dist/validation/lint-contract.js +3 -3
- 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 +4 -4
- package/dist/validation/schema-meta-validation.d.ts.map +1 -1
- package/dist/validation/schema-meta-validation.js +7 -9
- 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
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Client-side data-binding subsystem for React Native controllers.
|
|
3
|
-
*
|
|
4
|
-
* **NOT to be confused with {@link ClientCapabilitiesSpec} on
|
|
5
|
-
* `DataContract.clientCapabilities`.** These types describe the
|
|
6
|
-
* data-RESOLVER toolkit consumed by `@ggui-ai/ggui-react-native`
|
|
7
|
-
* (`fetch` / `auth` / `storage` / `subscription` / `voice` / `camera` /
|
|
8
|
-
* `chain` / `transform` / `merge`) — the controllers wire one of these
|
|
9
|
-
* tool configs onto a binding name and the runtime resolves the value
|
|
10
|
-
* at render time.
|
|
11
|
-
*
|
|
12
|
-
* `clientCapabilities.gadgets` is the wire-level declaration that the
|
|
13
|
-
* UI calls a browser-capability hook (`useMicrophone` /
|
|
14
|
-
* `useGeolocation` / `useClipboardWrite` / …); those hooks are
|
|
15
|
-
* implemented in `@ggui-ai/gadgets` and surfaced into the
|
|
16
|
-
* agent only when the UI threads their value into a `contextSpec` slot
|
|
17
|
-
* or an `actionSpec` payload.
|
|
18
|
-
*
|
|
19
|
-
* The shared word "tool" is historical:
|
|
20
|
-
*
|
|
21
|
-
* - `ClientToolName` here = a runtime data-resolver identifier.
|
|
22
|
-
* - `clientCapabilities.gadgets` = a package-keyed wire map
|
|
23
|
-
* (`Record<package, Record<exportName, GadgetExportUse>>`); the
|
|
24
|
-
* export name is the inner map key, not a field.
|
|
25
|
-
* - `agentCapabilities.tools` = MCP tool catalog.
|
|
26
|
-
*
|
|
27
|
-
* All three are distinct namespaces.
|
|
28
|
-
*/
|
|
29
|
-
import type { JsonObject, JsonValue } from './data-contract';
|
|
30
|
-
import type { EndUserIdentity } from './auth';
|
|
31
|
-
/**
|
|
32
|
-
* Available client-side tools
|
|
33
|
-
*/
|
|
34
|
-
export type ClientToolName = 'fetch' | 'auth' | 'storage' | 'subscription' | 'voice' | 'camera' | 'chain' | 'transform' | 'merge';
|
|
35
|
-
/**
|
|
36
|
-
* Base configuration for all tools.
|
|
37
|
-
* Extends {@link JsonObject} for JSON serialization compatibility.
|
|
38
|
-
* Generic `TConfig` defaults to {@link JsonObject} for the tool-specific configuration shape.
|
|
39
|
-
*/
|
|
40
|
-
export interface ClientToolConfig<TConfig extends JsonObject = JsonObject> extends JsonObject {
|
|
41
|
-
tool: ClientToolName;
|
|
42
|
-
config: TConfig;
|
|
43
|
-
/**
|
|
44
|
-
* Other bindings this depends on (resolved first in topological order)
|
|
45
|
-
* Example: ['user'] means this tool waits for 'user' binding to resolve
|
|
46
|
-
*/
|
|
47
|
-
dependsOn?: string[];
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Fetch tool - HTTP requests with interpolation support
|
|
51
|
-
*
|
|
52
|
-
* Example:
|
|
53
|
-
* ```
|
|
54
|
-
* { tool: 'fetch', config: { endpoint: '/api/users/{user.id}' } }
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
export interface FetchToolConfig extends ClientToolConfig {
|
|
58
|
-
tool: 'fetch';
|
|
59
|
-
config: {
|
|
60
|
-
/**
|
|
61
|
-
* Endpoint with optional interpolation: '/api/users/{user.id}'
|
|
62
|
-
* Values in braces are replaced from resolved dependencies
|
|
63
|
-
*/
|
|
64
|
-
endpoint: string;
|
|
65
|
-
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
66
|
-
headers?: Record<string, string>;
|
|
67
|
-
/** Request body. Typed as {@link JsonValue} (any JSON-safe value). */
|
|
68
|
-
body?: JsonValue;
|
|
69
|
-
/**
|
|
70
|
-
* Cache configuration
|
|
71
|
-
*/
|
|
72
|
-
cache?: {
|
|
73
|
-
/** Time-to-live in milliseconds */
|
|
74
|
-
ttl: number;
|
|
75
|
-
/** Cache key (defaults to endpoint) */
|
|
76
|
-
key?: string;
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* Transform response before returning
|
|
80
|
-
* Dot path to extract: 'data.users' extracts response.data.users
|
|
81
|
-
*/
|
|
82
|
-
extract?: string;
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Auth tool - Access authentication context
|
|
87
|
-
*
|
|
88
|
-
* Example:
|
|
89
|
-
* ```
|
|
90
|
-
* { tool: 'auth', config: { field: 'currentUser' } }
|
|
91
|
-
* ```
|
|
92
|
-
*/
|
|
93
|
-
export interface AuthToolConfig extends ClientToolConfig {
|
|
94
|
-
tool: 'auth';
|
|
95
|
-
config: {
|
|
96
|
-
/**
|
|
97
|
-
* Field to extract from auth context
|
|
98
|
-
* - 'currentUser': Full user object
|
|
99
|
-
* - 'userId': Just the user ID
|
|
100
|
-
* - 'token': Access token
|
|
101
|
-
* - 'isAuthenticated': Boolean
|
|
102
|
-
*/
|
|
103
|
-
field: 'currentUser' | 'userId' | 'token' | 'isAuthenticated' | string;
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Storage tool - localStorage/sessionStorage access
|
|
108
|
-
*
|
|
109
|
-
* Example:
|
|
110
|
-
* ```
|
|
111
|
-
* { tool: 'storage', config: { key: 'userPrefs', storage: 'local' } }
|
|
112
|
-
* ```
|
|
113
|
-
*/
|
|
114
|
-
export interface StorageToolConfig extends ClientToolConfig {
|
|
115
|
-
tool: 'storage';
|
|
116
|
-
config: {
|
|
117
|
-
key: string;
|
|
118
|
-
storage?: 'local' | 'session';
|
|
119
|
-
/** Default value if key doesn't exist. Typed as {@link JsonValue}. */
|
|
120
|
-
defaultValue?: JsonValue;
|
|
121
|
-
/** Parse as JSON (default: true) */
|
|
122
|
-
parse?: boolean;
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Subscription tool - Real-time data subscriptions
|
|
127
|
-
*
|
|
128
|
-
* Example:
|
|
129
|
-
* ```
|
|
130
|
-
* { tool: 'subscription', config: { channel: 'notifications/{user.id}' } }
|
|
131
|
-
* ```
|
|
132
|
-
*/
|
|
133
|
-
export interface SubscriptionToolConfig extends ClientToolConfig {
|
|
134
|
-
tool: 'subscription';
|
|
135
|
-
config: {
|
|
136
|
-
/** Channel/topic with optional interpolation */
|
|
137
|
-
channel: string;
|
|
138
|
-
/** Protocol type */
|
|
139
|
-
type?: 'websocket' | 'sse' | 'polling';
|
|
140
|
-
/** Polling interval in ms (for polling type) */
|
|
141
|
-
interval?: number;
|
|
142
|
-
/** Initial data before first message. Typed as {@link JsonValue}. */
|
|
143
|
-
initialData?: JsonValue;
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Voice tool - Voice input/output
|
|
148
|
-
*/
|
|
149
|
-
export interface VoiceToolConfig extends ClientToolConfig {
|
|
150
|
-
tool: 'voice';
|
|
151
|
-
config: {
|
|
152
|
-
mode: 'input' | 'output' | 'both';
|
|
153
|
-
language?: string;
|
|
154
|
-
continuous?: boolean;
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Camera tool - Camera access
|
|
159
|
-
*/
|
|
160
|
-
export interface CameraToolConfig extends ClientToolConfig {
|
|
161
|
-
tool: 'camera';
|
|
162
|
-
config: {
|
|
163
|
-
mode: 'photo' | 'video' | 'stream';
|
|
164
|
-
facing?: 'user' | 'environment';
|
|
165
|
-
resolution?: {
|
|
166
|
-
width: number;
|
|
167
|
-
height: number;
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Chain tool - Sequential execution of tools
|
|
173
|
-
* Each step receives previous result as {prev}
|
|
174
|
-
*
|
|
175
|
-
* Example:
|
|
176
|
-
* ```
|
|
177
|
-
* {
|
|
178
|
-
* tool: 'chain',
|
|
179
|
-
* config: {
|
|
180
|
-
* steps: [
|
|
181
|
-
* { tool: 'auth', config: { field: 'currentUser' } },
|
|
182
|
-
* { tool: 'fetch', config: { endpoint: '/api/dashboard/{prev.id}' } },
|
|
183
|
-
* { tool: 'transform', config: { pick: ['stats', 'notifications'] } }
|
|
184
|
-
* ]
|
|
185
|
-
* }
|
|
186
|
-
* }
|
|
187
|
-
* ```
|
|
188
|
-
*/
|
|
189
|
-
export interface ChainToolConfig extends ClientToolConfig {
|
|
190
|
-
tool: 'chain';
|
|
191
|
-
config: {
|
|
192
|
-
/** Sequential tool steps, each receives previous result as {prev} */
|
|
193
|
-
steps: ClientToolConfig[];
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Transform tool - Data transformation
|
|
198
|
-
*
|
|
199
|
-
* Example:
|
|
200
|
-
* ```
|
|
201
|
-
* { tool: 'transform', config: { pick: ['name', 'email'], rename: { email: 'contactEmail' } } }
|
|
202
|
-
* ```
|
|
203
|
-
*/
|
|
204
|
-
export interface TransformToolConfig<TDefaults extends JsonObject = JsonObject> extends ClientToolConfig {
|
|
205
|
-
tool: 'transform';
|
|
206
|
-
config: {
|
|
207
|
-
/** Pick specific fields from data */
|
|
208
|
-
pick?: string[];
|
|
209
|
-
/** Omit specific fields from data */
|
|
210
|
-
omit?: string[];
|
|
211
|
-
/** Rename fields: { oldName: 'newName' } */
|
|
212
|
-
rename?: Record<string, string>;
|
|
213
|
-
/** Map array items through a transformation */
|
|
214
|
-
mapArray?: {
|
|
215
|
-
/** Field containing array */
|
|
216
|
-
field?: string;
|
|
217
|
-
/** Fields to pick from each item */
|
|
218
|
-
pick?: string[];
|
|
219
|
-
/** Fields to rename in each item */
|
|
220
|
-
rename?: Record<string, string>;
|
|
221
|
-
};
|
|
222
|
-
/** Flatten nested object: 'user.profile' moves profile fields to top level */
|
|
223
|
-
flatten?: string;
|
|
224
|
-
/** Default values for missing fields */
|
|
225
|
-
defaults?: TDefaults;
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Merge tool - Combine multiple data sources
|
|
230
|
-
*
|
|
231
|
-
* Example:
|
|
232
|
-
* ```
|
|
233
|
-
* {
|
|
234
|
-
* tool: 'merge',
|
|
235
|
-
* config: { sources: ['user', 'profile', 'settings'] },
|
|
236
|
-
* dependsOn: ['user', 'profile', 'settings']
|
|
237
|
-
* }
|
|
238
|
-
* ```
|
|
239
|
-
*/
|
|
240
|
-
export interface MergeToolConfig extends ClientToolConfig {
|
|
241
|
-
tool: 'merge';
|
|
242
|
-
config: {
|
|
243
|
-
/** Binding names to merge (must be in dependsOn) */
|
|
244
|
-
sources: string[];
|
|
245
|
-
/** How to handle conflicts */
|
|
246
|
-
strategy?: 'first' | 'last' | 'deep';
|
|
247
|
-
/** Rename sources in merged result */
|
|
248
|
-
rename?: Record<string, string>;
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Type-safe tool config union
|
|
253
|
-
*/
|
|
254
|
-
export type TypedToolConfig = FetchToolConfig | AuthToolConfig | StorageToolConfig | SubscriptionToolConfig | VoiceToolConfig | CameraToolConfig | ChainToolConfig | TransformToolConfig | MergeToolConfig;
|
|
255
|
-
/**
|
|
256
|
-
* Data bindings - map of binding names to tool configurations
|
|
257
|
-
*
|
|
258
|
-
* Example:
|
|
259
|
-
* ```
|
|
260
|
-
* const bindings: DataBindings = {
|
|
261
|
-
* user: { tool: 'auth', config: { field: 'currentUser' } },
|
|
262
|
-
* profile: {
|
|
263
|
-
* tool: 'fetch',
|
|
264
|
-
* config: { endpoint: '/api/users/{user.id}/profile' },
|
|
265
|
-
* dependsOn: ['user']
|
|
266
|
-
* }
|
|
267
|
-
* };
|
|
268
|
-
* ```
|
|
269
|
-
*/
|
|
270
|
-
export type DataBindings = Record<string, TypedToolConfig>;
|
|
271
|
-
/**
|
|
272
|
-
* Context provided to tool execution.
|
|
273
|
-
* Generic `TResolved` defaults to {@link JsonObject} for the resolved dependency values.
|
|
274
|
-
*/
|
|
275
|
-
export interface ToolContext<TResolved = JsonObject> {
|
|
276
|
-
/** Resolved values from previous bindings */
|
|
277
|
-
resolved: TResolved;
|
|
278
|
-
/** Auth context (user, token, etc.) */
|
|
279
|
-
auth?: {
|
|
280
|
-
currentUser?: EndUserIdentity;
|
|
281
|
-
userId?: string;
|
|
282
|
-
token?: string;
|
|
283
|
-
isAuthenticated: boolean;
|
|
284
|
-
};
|
|
285
|
-
/** App configuration */
|
|
286
|
-
appId: string;
|
|
287
|
-
renderId: string;
|
|
288
|
-
/** Base URL for API calls */
|
|
289
|
-
apiBaseUrl?: string;
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* Result from tool execution
|
|
293
|
-
*/
|
|
294
|
-
export interface ToolResult<T = unknown> {
|
|
295
|
-
data: T | null;
|
|
296
|
-
loading: boolean;
|
|
297
|
-
error: Error | null;
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* Tool implementation interface
|
|
301
|
-
*/
|
|
302
|
-
export interface ClientTool<TConfig extends ClientToolConfig = ClientToolConfig> {
|
|
303
|
-
name: ClientToolName;
|
|
304
|
-
/**
|
|
305
|
-
* Execute the tool with given config and context
|
|
306
|
-
*/
|
|
307
|
-
execute(config: TConfig['config'], context: ToolContext): Promise<unknown>;
|
|
308
|
-
}
|
|
309
|
-
/**
|
|
310
|
-
* Controller metadata - describes what props a controller expects
|
|
311
|
-
* Note: Actual controller components receive children as ReactNode,
|
|
312
|
-
* but we use 'unknown' here to avoid React dependency in shared package.
|
|
313
|
-
*/
|
|
314
|
-
export interface ControllerPropSpec {
|
|
315
|
-
name: string;
|
|
316
|
-
type: 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
317
|
-
required: boolean;
|
|
318
|
-
description: string;
|
|
319
|
-
/** Default value for this prop. Typed as {@link JsonValue}. */
|
|
320
|
-
defaultValue?: JsonValue;
|
|
321
|
-
}
|
|
322
|
-
//# sourceMappingURL=data-bindings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-bindings.d.ts","sourceRoot":"","sources":["../../src/types/data-bindings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAM9C;;GAEG;AACH,MAAM,MAAM,cAAc,GAEtB,OA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@
|
|
|
1
|
-
/**
|
|
2
|
-
* Client-side data-binding subsystem for React Native controllers.
|
|
3
|
-
*
|
|
4
|
-
* **NOT to be confused with {@link ClientCapabilitiesSpec} on
|
|
5
|
-
* `DataContract.clientCapabilities`.** These types describe the
|
|
6
|
-
* data-RESOLVER toolkit consumed by `@ggui-ai/ggui-react-native`
|
|
7
|
-
* (`fetch` / `auth` / `storage` / `subscription` / `voice` / `camera` /
|
|
8
|
-
* `chain` / `transform` / `merge`) — the controllers wire one of these
|
|
9
|
-
* tool configs onto a binding name and the runtime resolves the value
|
|
10
|
-
* at render time.
|
|
11
|
-
*
|
|
12
|
-
* `clientCapabilities.gadgets` is the wire-level declaration that the
|
|
13
|
-
* UI calls a browser-capability hook (`useMicrophone` /
|
|
14
|
-
* `useGeolocation` / `useClipboardWrite` / …); those hooks are
|
|
15
|
-
* implemented in `@ggui-ai/gadgets` and surfaced into the
|
|
16
|
-
* agent only when the UI threads their value into a `contextSpec` slot
|
|
17
|
-
* or an `actionSpec` payload.
|
|
18
|
-
*
|
|
19
|
-
* The shared word "tool" is historical:
|
|
20
|
-
*
|
|
21
|
-
* - `ClientToolName` here = a runtime data-resolver identifier.
|
|
22
|
-
* - `clientCapabilities.gadgets` = a package-keyed wire map
|
|
23
|
-
* (`Record<package, Record<exportName, GadgetExportUse>>`); the
|
|
24
|
-
* export name is the inner map key, not a field.
|
|
25
|
-
* - `agentCapabilities.tools` = MCP tool catalog.
|
|
26
|
-
*
|
|
27
|
-
* All three are distinct namespaces.
|
|
28
|
-
*/
|
|
29
|
-
export {};
|
package/dist/types/feedback.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UI Feedback types -- end-user ratings for generated UIs.
|
|
3
|
-
*
|
|
4
|
-
* Users can rate each rendered page with love/dislike/other.
|
|
5
|
-
* Feedback is sent via WebSocket and stored server-side.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Feedback rating options for a generated UI page.
|
|
9
|
-
*/
|
|
10
|
-
export type FeedbackRating = 'love' | 'dislike' | 'other';
|
|
11
|
-
/**
|
|
12
|
-
* Input payload for submitting UI feedback via WebSocket.
|
|
13
|
-
*/
|
|
14
|
-
export interface UIFeedbackPayload {
|
|
15
|
-
/** Render being rated */
|
|
16
|
-
renderId: string;
|
|
17
|
-
/** Rating type */
|
|
18
|
-
rating: FeedbackRating;
|
|
19
|
-
/** Free-text comment (required when rating is 'other', optional otherwise) */
|
|
20
|
-
comment?: string;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=feedback.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../src/types/feedback.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB;IAClB,MAAM,EAAE,cAAc,CAAC;IACvB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
package/dist/types/feedback.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Third-party MCP discovery + relay — wire shapes and public
|
|
3
|
-
* constants for external MCP providers.
|
|
4
|
-
*
|
|
5
|
-
* Scope: constants and types that describe how OSS tooling and
|
|
6
|
-
* hosted services talk to upstream MCP discovery APIs (Claude.ai
|
|
7
|
-
* today; Anthropic's MCP-servers API). These are third-party
|
|
8
|
-
* PROTOCOL fragments — any OSS relay that proxies Claude.ai MCP
|
|
9
|
-
* servers would need the same constants and discovery-response
|
|
10
|
-
* shapes.
|
|
11
|
-
*
|
|
12
|
-
* Hosted-overlay config types for linking these proxies into an
|
|
13
|
-
* app's per-tenant config are a hosting concept and live outside
|
|
14
|
-
* this open protocol package.
|
|
15
|
-
*
|
|
16
|
-
* What remains here:
|
|
17
|
-
*
|
|
18
|
-
* - Claude.ai OAuth + discovery endpoint constants (third-party
|
|
19
|
-
* public API surface).
|
|
20
|
-
* - {@link DiscoveredMcpServer} — the normalised shape consumers
|
|
21
|
-
* get back from any discovery call.
|
|
22
|
-
* - {@link ClaudeAiDiscoveryResponse} — raw Claude.ai discovery
|
|
23
|
-
* response wire shape.
|
|
24
|
-
* - {@link CLAUDE_AI_SERVICE_ID} — credential-store service id
|
|
25
|
-
* used across the stack to name Claude.ai user credentials.
|
|
26
|
-
*/
|
|
27
|
-
/** Claude Code's registered public OAuth client_id (PKCE, no secret). */
|
|
28
|
-
export declare const CLAUDE_AI_CLIENT_ID = "9d1c250a-e61b-44d9-88ed-5944d1962f5e";
|
|
29
|
-
/** Claude.ai OAuth endpoints. */
|
|
30
|
-
export declare const CLAUDE_AI_OAUTH: {
|
|
31
|
-
readonly authorizeUrl: "https://claude.ai/oauth/authorize";
|
|
32
|
-
readonly tokenUrl: "https://platform.claude.com/v1/oauth/token";
|
|
33
|
-
/** Manual redirect — shows auth code for user to copy. */
|
|
34
|
-
readonly manualRedirectUrl: "https://console.anthropic.com/oauth/code/callback";
|
|
35
|
-
/** Discovery endpoint for user's MCP servers. */
|
|
36
|
-
readonly discoveryUrl: "https://api.anthropic.com/v1/mcp_servers";
|
|
37
|
-
/** MCP proxy URL pattern. */
|
|
38
|
-
readonly proxyUrl: "https://mcp-proxy.anthropic.com/v1/mcp/{server_id}";
|
|
39
|
-
};
|
|
40
|
-
/** Scopes needed for MCP server access via Claude.ai. */
|
|
41
|
-
export declare const CLAUDE_AI_MCP_SCOPES: readonly ["user:mcp_servers"];
|
|
42
|
-
/** Beta header required for MCP servers API. */
|
|
43
|
-
export declare const CLAUDE_AI_MCP_BETA_HEADER = "mcp-servers-2025-12-04";
|
|
44
|
-
/** A single MCP server discovered from a proxy's discovery endpoint. */
|
|
45
|
-
export interface DiscoveredMcpServer {
|
|
46
|
-
/** Server identifier (used in proxy URL template). */
|
|
47
|
-
id: string;
|
|
48
|
-
/** Human-readable name (e.g. "Google Calendar", "Gmail"). */
|
|
49
|
-
displayName: string;
|
|
50
|
-
/** Direct server URL (for reference — calls go through the proxy). */
|
|
51
|
-
url: string;
|
|
52
|
-
}
|
|
53
|
-
/** Discovery API response shape (Claude.ai format). */
|
|
54
|
-
export interface ClaudeAiDiscoveryResponse {
|
|
55
|
-
data: Array<{
|
|
56
|
-
type: 'mcp_server';
|
|
57
|
-
id: string;
|
|
58
|
-
display_name: string;
|
|
59
|
-
url: string;
|
|
60
|
-
created_at: string;
|
|
61
|
-
}>;
|
|
62
|
-
has_more: boolean;
|
|
63
|
-
next_page: string | null;
|
|
64
|
-
}
|
|
65
|
-
/** ServiceId used for Claude.ai platform credentials in UserCredential. */
|
|
66
|
-
export declare const CLAUDE_AI_SERVICE_ID = "claude_ai_platform";
|
|
67
|
-
//# sourceMappingURL=mcp-proxy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-proxy.d.ts","sourceRoot":"","sources":["../../src/types/mcp-proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,yCAAyC,CAAC;AAE1E,iCAAiC;AACjC,eAAO,MAAM,eAAe;;;IAG1B,0DAA0D;;IAE1D,iDAAiD;;IAEjD,6BAA6B;;CAErB,CAAC;AAEX,yDAAyD;AACzD,eAAO,MAAM,oBAAoB,+BAAgC,CAAC;AAElE,gDAAgD;AAChD,eAAO,MAAM,yBAAyB,2BAA2B,CAAC;AAIlE,wEAAwE;AACxE,MAAM,WAAW,mBAAmB;IAClC,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAC;CACb;AAED,uDAAuD;AACvD,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,KAAK,CAAC;QACV,IAAI,EAAE,YAAY,CAAC;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,YAAY,EAAE,MAAM,CAAC;QACrB,GAAG,EAAE,MAAM,CAAC;QACZ,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,uBAAuB,CAAC"}
|
package/dist/types/mcp-proxy.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Third-party MCP discovery + relay — wire shapes and public
|
|
3
|
-
* constants for external MCP providers.
|
|
4
|
-
*
|
|
5
|
-
* Scope: constants and types that describe how OSS tooling and
|
|
6
|
-
* hosted services talk to upstream MCP discovery APIs (Claude.ai
|
|
7
|
-
* today; Anthropic's MCP-servers API). These are third-party
|
|
8
|
-
* PROTOCOL fragments — any OSS relay that proxies Claude.ai MCP
|
|
9
|
-
* servers would need the same constants and discovery-response
|
|
10
|
-
* shapes.
|
|
11
|
-
*
|
|
12
|
-
* Hosted-overlay config types for linking these proxies into an
|
|
13
|
-
* app's per-tenant config are a hosting concept and live outside
|
|
14
|
-
* this open protocol package.
|
|
15
|
-
*
|
|
16
|
-
* What remains here:
|
|
17
|
-
*
|
|
18
|
-
* - Claude.ai OAuth + discovery endpoint constants (third-party
|
|
19
|
-
* public API surface).
|
|
20
|
-
* - {@link DiscoveredMcpServer} — the normalised shape consumers
|
|
21
|
-
* get back from any discovery call.
|
|
22
|
-
* - {@link ClaudeAiDiscoveryResponse} — raw Claude.ai discovery
|
|
23
|
-
* response wire shape.
|
|
24
|
-
* - {@link CLAUDE_AI_SERVICE_ID} — credential-store service id
|
|
25
|
-
* used across the stack to name Claude.ai user credentials.
|
|
26
|
-
*/
|
|
27
|
-
// ── Claude.ai constants ─────────────────────────────────────────────
|
|
28
|
-
/** Claude Code's registered public OAuth client_id (PKCE, no secret). */
|
|
29
|
-
export const CLAUDE_AI_CLIENT_ID = '9d1c250a-e61b-44d9-88ed-5944d1962f5e';
|
|
30
|
-
/** Claude.ai OAuth endpoints. */
|
|
31
|
-
export const CLAUDE_AI_OAUTH = {
|
|
32
|
-
authorizeUrl: 'https://claude.ai/oauth/authorize',
|
|
33
|
-
tokenUrl: 'https://platform.claude.com/v1/oauth/token',
|
|
34
|
-
/** Manual redirect — shows auth code for user to copy. */
|
|
35
|
-
manualRedirectUrl: 'https://console.anthropic.com/oauth/code/callback',
|
|
36
|
-
/** Discovery endpoint for user's MCP servers. */
|
|
37
|
-
discoveryUrl: 'https://api.anthropic.com/v1/mcp_servers',
|
|
38
|
-
/** MCP proxy URL pattern. */
|
|
39
|
-
proxyUrl: 'https://mcp-proxy.anthropic.com/v1/mcp/{server_id}',
|
|
40
|
-
};
|
|
41
|
-
/** Scopes needed for MCP server access via Claude.ai. */
|
|
42
|
-
export const CLAUDE_AI_MCP_SCOPES = ['user:mcp_servers'];
|
|
43
|
-
/** Beta header required for MCP servers API. */
|
|
44
|
-
export const CLAUDE_AI_MCP_BETA_HEADER = 'mcp-servers-2025-12-04';
|
|
45
|
-
/** ServiceId used for Claude.ai platform credentials in UserCredential. */
|
|
46
|
-
export const CLAUDE_AI_SERVICE_ID = 'claude_ai_platform';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { ModelTier } from "./llm.js";
|
|
2
|
-
import type { LlmProvider } from "./llm-route.js";
|
|
3
|
-
export interface OpenRouterModelConfig {
|
|
4
|
-
id: string;
|
|
5
|
-
openRouterId: string;
|
|
6
|
-
provider: LlmProvider;
|
|
7
|
-
displayName: string;
|
|
8
|
-
tier: ModelTier;
|
|
9
|
-
costs: {
|
|
10
|
-
inputPer1M: number;
|
|
11
|
-
outputPer1M: number;
|
|
12
|
-
};
|
|
13
|
-
maxTokens: number;
|
|
14
|
-
supportsTools: boolean;
|
|
15
|
-
supportsCaching: boolean;
|
|
16
|
-
supportsThinking: boolean;
|
|
17
|
-
}
|
|
18
|
-
export declare const OPENROUTER_MODEL_REGISTRY: Record<string, OpenRouterModelConfig>;
|
|
19
|
-
/** All OpenRouter model IDs */
|
|
20
|
-
export declare const OPENROUTER_MODEL_IDS: string[];
|
|
21
|
-
/** Check if a model ID is a valid OpenRouter model */
|
|
22
|
-
export declare function isOpenRouterModel(id: string): boolean;
|
|
23
|
-
//# sourceMappingURL=openrouter-models.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openrouter-models.d.ts","sourceRoot":"","sources":["../../src/types/openrouter-models.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,WAAW,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CA+tJ3E,CAAC;AAEF,+BAA+B;AAC/B,eAAO,MAAM,oBAAoB,EAAE,MAAM,EAA2C,CAAC;AAErF,sDAAsD;AACtD,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAErD"}
|