@adonis-agora/agent 0.75.0 → 0.76.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.
Files changed (29) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +16 -0
  3. package/dist/src/genui/sandbox.d.ts +7 -0
  4. package/dist/src/genui/sandbox.d.ts.map +1 -1
  5. package/dist/src/genui/sandbox.js +11 -4
  6. package/dist/src/genui/sandbox.js.map +1 -1
  7. package/dist/src/index.d.ts +1 -1
  8. package/dist/src/index.js +1 -1
  9. package/dist/src/react-native/genui/index.d.ts +20 -0
  10. package/dist/src/react-native/genui/index.d.ts.map +1 -0
  11. package/dist/src/react-native/genui/index.js +18 -0
  12. package/dist/src/react-native/genui/index.js.map +1 -0
  13. package/dist/src/react-native/genui/provider.d.ts +19 -0
  14. package/dist/src/react-native/genui/provider.d.ts.map +1 -0
  15. package/dist/src/react-native/genui/provider.js +23 -0
  16. package/dist/src/react-native/genui/provider.js.map +1 -0
  17. package/dist/src/react-native/genui/sandbox-assets.d.ts +57 -0
  18. package/dist/src/react-native/genui/sandbox-assets.d.ts.map +1 -0
  19. package/dist/src/react-native/genui/sandbox-assets.js +153 -0
  20. package/dist/src/react-native/genui/sandbox-assets.js.map +1 -0
  21. package/dist/src/react-native/genui/sandbox-host.d.ts +119 -0
  22. package/dist/src/react-native/genui/sandbox-host.d.ts.map +1 -0
  23. package/dist/src/react-native/genui/sandbox-host.js +188 -0
  24. package/dist/src/react-native/genui/sandbox-host.js.map +1 -0
  25. package/dist/src/react-native/genui/sandbox.d.ts +86 -0
  26. package/dist/src/react-native/genui/sandbox.d.ts.map +1 -0
  27. package/dist/src/react-native/genui/sandbox.js +376 -0
  28. package/dist/src/react-native/genui/sandbox.js.map +1 -0
  29. package/package.json +16 -1
@@ -0,0 +1,119 @@
1
+ /**
2
+ * The host side of a sandbox drawn in a `react-native-webview`, as plain functions: what the
3
+ * WebView may load, what it may say, how the host talks back, the theme it gets. No React Native
4
+ * import here — the renderer (`sandbox.tsx`) wires these to the WebView, the tests call them as is.
5
+ */
6
+ import type { StandardSchemaV1 } from '@standard-schema/spec';
7
+ import { type UiAction } from '../../genui/actions.js';
8
+ import { type SandboxPolicy } from '../../genui/sandbox.js';
9
+ import type { JsonSchema } from '../../genui/schema.js';
10
+ import type { SandboxRefusal } from '../../react/core/genui/sandbox.js';
11
+ /** Whether a URL is the inline sandbox document itself — everything else is a navigation away. */
12
+ export declare function isInlineDocumentUrl(url: unknown): boolean;
13
+ /**
14
+ * `onShouldStartLoadWithRequest`: the inline document loads, nothing else does — no link, no
15
+ * `location = …`, no `window.open`, no `tel:` / `mailto:` / app scheme. (Used with an
16
+ * `originWhitelist` that lets every URL through to it: `react-native-webview` hands a URL the
17
+ * whitelist refuses to `Linking.openURL` — the system browser or another app — instead of dropping it.)
18
+ */
19
+ export declare function shouldStartSandboxLoad(request: {
20
+ url?: unknown;
21
+ }): boolean;
22
+ /** Room for the envelope (`type`, `token`, keys) around a payload in one bridge message. */
23
+ export declare const NATIVE_SANDBOX_ENVELOPE_CHARS = 1024;
24
+ export type FrameMessage =
25
+ /** A message with this frame's token, parsed. */
26
+ {
27
+ kind: 'message';
28
+ data: Record<string, unknown> & {
29
+ type: string;
30
+ };
31
+ }
32
+ /** An `agent.send` with this frame's token, too long to even parse (`bytes`: at least). */
33
+ | {
34
+ kind: 'too-large';
35
+ bytes: number;
36
+ }
37
+ /** Anything else — not a string, too long, not JSON, not an object, no or another token. */
38
+ | {
39
+ kind: 'drop';
40
+ };
41
+ /**
42
+ * Read one `onMessage` string from the WebView. Its length is capped BEFORE it is parsed (the cap
43
+ * is the payload limit plus the envelope: a payload within the limit always fits, as its JSON has at
44
+ * most as many UTF-16 units as UTF-8 bytes); only a JSON object carrying `token` and a frame message
45
+ * type gets through. A send too long to parse is recognised by its envelope's exact prefix — which
46
+ * the bridge writes first — so it is refused as `too-large` rather than dropped unseen.
47
+ */
48
+ export declare function parseFrameMessage(raw: unknown, token: string, maxPayloadBytes: number): FrameMessage;
49
+ /**
50
+ * The script `injectJavaScript` runs to hand the frame one host message: a `message` event whose
51
+ * `source` is the frame's own window — its `parent` (a top-level document is its own parent), the
52
+ * only source the bridge and the JSX runtime listen to. The message is JSON (as a JS literal; the
53
+ * line separators JSON leaves raw are escaped), never code.
54
+ */
55
+ export declare function hostMessageScript(message: Record<string, unknown>): string;
56
+ /** The frame's height: what it measured, within 24 px and the policy's `maxHeight`. */
57
+ export declare function clampSandboxHeight(value: number, policy: SandboxPolicy): number;
58
+ /**
59
+ * The app's design tokens for the frame — what a web host reads off its page's `:root`. `vars` are
60
+ * CSS custom properties (`{ '--primary': '#2563eb' }` or `{ primary: '#2563eb' }`); `dark` sets the
61
+ * frame's `dark` class and `data-theme`; `colorScheme` (`'dark'`, `'light dark'`) is mirrored as
62
+ * `color-scheme` when given.
63
+ */
64
+ export interface NativeSandboxTheme {
65
+ vars: Record<string, string>;
66
+ dark?: boolean;
67
+ colorScheme?: string;
68
+ /** Light/dark attributes for the frame's root (`data-theme`, `data-bs-theme`…), as a web host mirrors its own. */
69
+ attributes?: Record<string, string>;
70
+ }
71
+ /** The theme as the frame takes it: `:root{…}`, light/dark, root attributes, Tailwind's `@theme`. */
72
+ export interface NativeThemeCss {
73
+ css: string;
74
+ dark: boolean;
75
+ attributes: Record<string, string>;
76
+ tailwind: string;
77
+ }
78
+ /** `vars` keyed `--name` (a bare `name` gets its dashes), invalid names and non-strings dropped. */
79
+ export declare function normalizeThemeVars(vars: Record<string, unknown>): Record<string, string>;
80
+ export declare function nativeThemeCss(theme: NativeSandboxTheme): NativeThemeCss;
81
+ /**
82
+ * A url the config names, made absolute against `baseUrl` (React Native has no page origin to
83
+ * resolve it against). Only `http:` / `https:` come out; anything else, or a relative url without
84
+ * an absolute `baseUrl`, is `undefined`.
85
+ */
86
+ export declare function resolveSandboxUrl(url: string, baseUrl: string | undefined): string | undefined;
87
+ /** The count and time of the accepted sends of one frame. */
88
+ export interface SendState {
89
+ count: number;
90
+ last: number;
91
+ }
92
+ export interface SendCheck {
93
+ payload: unknown;
94
+ state: SendState;
95
+ policy: SandboxPolicy;
96
+ /** The view is still being written: what it sends is not the user's yet. */
97
+ incomplete: boolean;
98
+ schema?: StandardSchemaV1 | JsonSchema;
99
+ confirm?: (action: UiAction) => boolean | Promise<boolean>;
100
+ hasHandler: boolean;
101
+ componentId?: string;
102
+ title?: string;
103
+ now?: number;
104
+ }
105
+ /**
106
+ * Everything the web host checks an `agent.send` for, in its order: a preview's send declined, the
107
+ * count, the interval, JSON, the size, `schema`, `confirm`, a handler. The interval clock starts at
108
+ * a send that passed the size check; the count grows only for a delivered action.
109
+ */
110
+ export declare function checkSandboxSend(check: SendCheck): Promise<{
111
+ ok: true;
112
+ action: UiAction;
113
+ } | {
114
+ ok: false;
115
+ refusal: SandboxRefusal;
116
+ }>;
117
+ /** A per-frame token. Not a secret from the frame's own code — it tells this frame's messages apart. */
118
+ export declare function sandboxToken(): string;
119
+ //# sourceMappingURL=sandbox-host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox-host.d.ts","sourceRoot":"","sources":["../../../../src/react-native/genui/sandbox-host.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAGL,KAAK,QAAQ,EAEd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE/F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAQxE,kGAAkG;AAClG,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAA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OX_DEFAULTS, SANDBOX_MESSAGE } from '../../genui/sandbox.js';
3
+ import { hostThemeCss, tailwindThemeCss } from '../../genui/sandbox-theme.js';
4
+ /**
5
+ * The only URLs the WebView may be at: the inline document (`source={{ html }}` loads as
6
+ * `about:blank`; `about:srcdoc` for engines that name it so), and in-page `#fragment` jumps.
7
+ */
8
+ const INLINE_DOCUMENT = /^about:(blank|srcdoc)(#.*)?$/i;
9
+ /** Whether a URL is the inline sandbox document itself — everything else is a navigation away. */
10
+ export function isInlineDocumentUrl(url) {
11
+ return typeof url === 'string' && INLINE_DOCUMENT.test(url);
12
+ }
13
+ /**
14
+ * `onShouldStartLoadWithRequest`: the inline document loads, nothing else does — no link, no
15
+ * `location = …`, no `window.open`, no `tel:` / `mailto:` / app scheme. (Used with an
16
+ * `originWhitelist` that lets every URL through to it: `react-native-webview` hands a URL the
17
+ * whitelist refuses to `Linking.openURL` — the system browser or another app — instead of dropping it.)
18
+ */
19
+ export function shouldStartSandboxLoad(request) {
20
+ return isInlineDocumentUrl(request.url);
21
+ }
22
+ /** Room for the envelope (`type`, `token`, keys) around a payload in one bridge message. */
23
+ export const NATIVE_SANDBOX_ENVELOPE_CHARS = 1024;
24
+ /** The frame → host message types a host acts on. */
25
+ const FRAME_TYPES = new Set([
26
+ SANDBOX_MESSAGE.ready,
27
+ SANDBOX_MESSAGE.resize,
28
+ SANDBOX_MESSAGE.send,
29
+ SANDBOX_MESSAGE.error,
30
+ ]);
31
+ /**
32
+ * Read one `onMessage` string from the WebView. Its length is capped BEFORE it is parsed (the cap
33
+ * is the payload limit plus the envelope: a payload within the limit always fits, as its JSON has at
34
+ * most as many UTF-16 units as UTF-8 bytes); only a JSON object carrying `token` and a frame message
35
+ * type gets through. A send too long to parse is recognised by its envelope's exact prefix — which
36
+ * the bridge writes first — so it is refused as `too-large` rather than dropped unseen.
37
+ */
38
+ export function parseFrameMessage(raw, token, maxPayloadBytes) {
39
+ if (typeof raw !== 'string')
40
+ return { kind: 'drop' };
41
+ if (raw.length > maxPayloadBytes + NATIVE_SANDBOX_ENVELOPE_CHARS) {
42
+ const prefix = `{"type":${JSON.stringify(SANDBOX_MESSAGE.send)},"token":${JSON.stringify(token)},"payload":`;
43
+ return raw.startsWith(prefix)
44
+ ? { kind: 'too-large', bytes: raw.length - prefix.length - 1 }
45
+ : { kind: 'drop' };
46
+ }
47
+ let data;
48
+ try {
49
+ data = JSON.parse(raw);
50
+ }
51
+ catch {
52
+ return { kind: 'drop' };
53
+ }
54
+ if (typeof data !== 'object' || data === null || Array.isArray(data))
55
+ return { kind: 'drop' };
56
+ const record = data;
57
+ if (typeof record.token !== 'string' || record.token !== token)
58
+ return { kind: 'drop' };
59
+ if (typeof record.type !== 'string' || !FRAME_TYPES.has(record.type))
60
+ return { kind: 'drop' };
61
+ return { kind: 'message', data: record };
62
+ }
63
+ /**
64
+ * The script `injectJavaScript` runs to hand the frame one host message: a `message` event whose
65
+ * `source` is the frame's own window — its `parent` (a top-level document is its own parent), the
66
+ * only source the bridge and the JSX runtime listen to. The message is JSON (as a JS literal; the
67
+ * line separators JSON leaves raw are escaped), never code.
68
+ */
69
+ export function hostMessageScript(message) {
70
+ const literal = JSON.stringify(message)
71
+ .split(String.fromCharCode(0x2028))
72
+ .join('\\u2028')
73
+ .split(String.fromCharCode(0x2029))
74
+ .join('\\u2029');
75
+ return `(function(){try{window.dispatchEvent(new MessageEvent('message',{data:${literal},source:window}))}catch(e){}})();true;`;
76
+ }
77
+ /** The frame's height: what it measured, within 24 px and the policy's `maxHeight`. */
78
+ export function clampSandboxHeight(value, policy) {
79
+ const max = policy.maxHeight ?? SANDBOX_DEFAULTS.maxHeight;
80
+ return Math.max(24, Math.min(max, Math.ceil(value)));
81
+ }
82
+ const MODE_ATTRIBUTE = /^data-([\w-]*-)?(theme|mode|scheme)$/;
83
+ const VAR_NAME = /^--[A-Za-z0-9_-]+$/;
84
+ /** `vars` keyed `--name` (a bare `name` gets its dashes), invalid names and non-strings dropped. */
85
+ export function normalizeThemeVars(vars) {
86
+ const out = {};
87
+ for (const [key, value] of Object.entries(vars)) {
88
+ const name = key.startsWith('--') ? key : `--${key}`;
89
+ if (!VAR_NAME.test(name))
90
+ continue;
91
+ if (typeof value === 'number')
92
+ out[name] = String(value);
93
+ else if (typeof value === 'string' && value.trim() !== '')
94
+ out[name] = value.trim();
95
+ }
96
+ return out;
97
+ }
98
+ export function nativeThemeCss(theme) {
99
+ const vars = normalizeThemeVars(theme.vars ?? {});
100
+ return {
101
+ css: hostThemeCss(vars, theme.colorScheme !== undefined ? { colorScheme: theme.colorScheme } : {}),
102
+ dark: theme.dark === true,
103
+ attributes: Object.fromEntries(Object.entries(theme.attributes ?? {}).filter(([name, value]) => MODE_ATTRIBUTE.test(name) && typeof value === 'string')),
104
+ tailwind: tailwindThemeCss(vars),
105
+ };
106
+ }
107
+ /**
108
+ * A url the config names, made absolute against `baseUrl` (React Native has no page origin to
109
+ * resolve it against). Only `http:` / `https:` come out; anything else, or a relative url without
110
+ * an absolute `baseUrl`, is `undefined`.
111
+ */
112
+ export function resolveSandboxUrl(url, baseUrl) {
113
+ const absolute = /^https?:\/\/[^/?#]+/i;
114
+ if (absolute.test(url))
115
+ return url;
116
+ if (baseUrl === undefined)
117
+ return undefined;
118
+ const base = absolute.exec(baseUrl);
119
+ if (base === null)
120
+ return undefined;
121
+ const origin = base[0];
122
+ if (url.startsWith('//')) {
123
+ const out = `${origin.slice(0, origin.indexOf(':'))}:${url}`;
124
+ return absolute.test(out) ? out : undefined;
125
+ }
126
+ if (url.startsWith('/'))
127
+ return `${origin}${url}`;
128
+ if (/^[a-z][a-z0-9+.-]*:/i.test(url))
129
+ return undefined;
130
+ const path = baseUrl.slice(origin.length).replace(/[?#].*$/, '');
131
+ const directory = path.endsWith('/') ? path : path.replace(/[^/]*$/, '') || '/';
132
+ return `${origin}${directory.startsWith('/') ? '' : '/'}${directory}${url}`;
133
+ }
134
+ /**
135
+ * Everything the web host checks an `agent.send` for, in its order: a preview's send declined, the
136
+ * count, the interval, JSON, the size, `schema`, `confirm`, a handler. The interval clock starts at
137
+ * a send that passed the size check; the count grows only for a delivered action.
138
+ */
139
+ export async function checkSandboxSend(check) {
140
+ const { state, policy } = check;
141
+ if (check.incomplete)
142
+ return { ok: false, refusal: { reason: 'declined' } };
143
+ const maxSends = policy.maxSends ?? SANDBOX_DEFAULTS.maxSends;
144
+ if (state.count >= maxSends)
145
+ return { ok: false, refusal: { reason: 'too-many', limit: maxSends } };
146
+ const now = check.now ?? Date.now();
147
+ const interval = policy.minSendIntervalMs ?? SANDBOX_DEFAULTS.minSendIntervalMs;
148
+ if (state.last > 0 && now - state.last < interval) {
149
+ return { ok: false, refusal: { reason: 'too-soon', waitMs: interval - (now - state.last) } };
150
+ }
151
+ const bytes = jsonByteLength(check.payload);
152
+ if (bytes === undefined)
153
+ return { ok: false, refusal: { reason: 'not-json' } };
154
+ const limit = policy.maxPayloadBytes ?? SANDBOX_DEFAULTS.maxPayloadBytes;
155
+ if (bytes > limit)
156
+ return { ok: false, refusal: { reason: 'too-large', bytes, limit } };
157
+ state.last = now;
158
+ let action = sandboxAction(check.payload, {
159
+ ...(check.componentId !== undefined ? { componentId: check.componentId } : {}),
160
+ ...(check.title !== undefined ? { title: check.title } : {}),
161
+ });
162
+ if (check.schema !== undefined) {
163
+ const checked = await validateUiActionContext(action, check.schema);
164
+ if (!checked.ok)
165
+ return { ok: false, refusal: { reason: 'invalid', issues: checked.issues } };
166
+ action = { ...action, context: checked.context };
167
+ }
168
+ if (check.confirm !== undefined && !(await check.confirm(action))) {
169
+ return { ok: false, refusal: { reason: 'declined' } };
170
+ }
171
+ if (!check.hasHandler)
172
+ return { ok: false, refusal: { reason: 'no-handler' } };
173
+ state.count += 1;
174
+ return { ok: true, action };
175
+ }
176
+ /** A per-frame token. Not a secret from the frame's own code — it tells this frame's messages apart. */
177
+ export function sandboxToken() {
178
+ const bytes = new Uint8Array(16);
179
+ const crypto = globalThis
180
+ .crypto;
181
+ if (typeof crypto?.getRandomValues === 'function')
182
+ crypto.getRandomValues(bytes);
183
+ else
184
+ for (let index = 0; index < bytes.length; index++)
185
+ bytes[index] = Math.floor(Math.random() * 256);
186
+ return Array.from(bytes, (byte) => byte.toString(16).padStart(2, '0')).join('');
187
+ }
188
+ //# sourceMappingURL=sandbox-host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox-host.js","sourceRoot":"","sources":["../../../../src/react-native/genui/sandbox-host.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,cAAc,EACd,aAAa,EAEb,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAsB,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAI9E;;;GAGG;AACH,MAAM,eAAe,GAAG,+BAA+B,CAAC;AAExD,kGAAkG;AAClG,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC9C,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAA0B;IAC/D,OAAO,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC1C,CAAC;AAED,4FAA4F;AAC5F,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,CAAC;AAElD,qDAAqD;AACrD,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC;IAC/C,eAAe,CAAC,KAAK;IACrB,eAAe,CAAC,MAAM;IACtB,eAAe,CAAC,IAAI;IACpB,eAAe,CAAC,KAAK;CACtB,CAAC,CAAC;AAUH;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,GAAY,EACZ,KAAa,EACb,eAAuB;IAEvB,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EA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A6E;SAC1F,MAAM,CAAC;IACV,IAAI,OAAO,MAAM,EAAE,eAAe,KAAK,UAAU;QAAE,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;;QAE/E,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE;YAC/C,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;IACnD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAClF,CAAC"}
@@ -0,0 +1,86 @@
1
+ import type { StandardSchemaV1 } from '@standard-schema/spec';
2
+ import { type ReactNode } from 'react';
3
+ import { type StyleProp, type ViewStyle } from 'react-native';
4
+ import { type WebViewProps } from 'react-native-webview';
5
+ import type { UiAction } from '../../genui/actions.js';
6
+ import { type SandboxPolicy, type SandboxProps } from '../../genui/sandbox.js';
7
+ import type { JsonSchema } from '../../genui/schema.js';
8
+ import type { SandboxRefusal } from '../../react/core/genui/sandbox.js';
9
+ import type { GenuiRenderer } from '../../react/core/genui/types.js';
10
+ import { type FetchLike, type NativeSandboxConfigSource } from './sandbox-assets.js';
11
+ import { type NativeSandboxTheme } from './sandbox-host.js';
12
+ /** What a drawn component calls to hand an action back to the agent (the next user turn). */
13
+ export type GenuiActionHandler = (action: UiAction) => void;
14
+ export interface NativeSandboxRendererOptions {
15
+ /**
16
+ * The policy the frame runs under. Default: the one the catalog's definition carries (through the
17
+ * enclosing `GenuiProvider`'s catalog), else none — no network, the default limits.
18
+ */
19
+ policy?: SandboxPolicy;
20
+ /** Checks the values of every `agent.send(…)` (a Zod object, any Standard Schema, or a JSON Schema). */
21
+ schema?: StandardSchemaV1 | JsonSchema;
22
+ /** Last word on an action before it is sent — e.g. an `Alert`. Falsy → dropped (`declined`). */
23
+ confirm?: (action: UiAction) => boolean | Promise<boolean>;
24
+ /** Where actions go. Default: the enclosing `GenuiActionProvider` / `GenuiProvider onAction`. */
25
+ onAction?: GenuiActionHandler;
26
+ /** Something the frame sent was refused — the same reasons as the web renderer's. */
27
+ onRefused?: (refusal: SandboxRefusal) => void;
28
+ /** An uncaught error in the generated code, or the view lost (it navigated, its process died). */
29
+ onError?: (message: string) => void;
30
+ /**
31
+ * The app's design tokens, as CSS custom properties on the frame's `:root` (the web renderer reads
32
+ * them off its page). An object, or a hook returning one — called while rendering, so it may use
33
+ * hooks (`() => useAppTheme()`); a change reaches a drawn view without reloading it. `false`: off.
34
+ */
35
+ theme?: NativeSandboxTheme | false | (() => NativeSandboxTheme | null | undefined);
36
+ /**
37
+ * Tailwind and the kit: an object (assets inline or by url), a url answering `GET <agent>/config`,
38
+ * a loader, or `false`. Default: `GET <baseUrl>/config` with a `baseUrl`, else theme only.
39
+ */
40
+ config?: NativeSandboxConfigSource;
41
+ /**
42
+ * The agent's absolute url (`https://api.example.com/agent`): where the config is fetched from by
43
+ * default, and what the relative urls it names resolve against.
44
+ */
45
+ baseUrl?: string;
46
+ /** The `fetch` for the config and assets. Default: the global one. */
47
+ fetch?: FetchLike;
48
+ /** What to draw while nothing is drawable yet. Default: a box of `initialHeight` with the placeholder lines. */
49
+ placeholder?: (state: {
50
+ height: number;
51
+ messages: string[];
52
+ title?: string;
53
+ }) => ReactNode;
54
+ /** Extra style for the WebView (its height is the content's). */
55
+ style?: StyleProp<ViewStyle>;
56
+ }
57
+ /**
58
+ * The WebView props every sandbox gets. JavaScript runs inside it; it stores nothing (no DOM
59
+ * storage, incognito, no cache, no cookies), reads no file, opens no window, loads no mixed content,
60
+ * shows no link preview, does not scroll (the host sizes it to its content) and goes nowhere: every
61
+ * URL reaches `onShouldStartLoadWithRequest` (the whitelist lets them through — a URL it refuses
62
+ * would be handed to `Linking.openURL`), which allows only the inline document.
63
+ */
64
+ export declare const NATIVE_SANDBOX_WEBVIEW_PROPS: Readonly<WebViewProps>;
65
+ /**
66
+ * A React Native renderer for the sandbox component (`Sandbox`): the model's HTML, CSS and JS in a
67
+ * hardened `react-native-webview` ({@link NATIVE_SANDBOX_WEBVIEW_PROPS}) — the same document as the
68
+ * web renderer's iframe (`buildSandboxDocument`, the same CSP: no network unless the policy lists an
69
+ * origin), sized to its content.
70
+ *
71
+ * It streams like the web one: a placeholder of `initialHeight`, a preview of the styled markup (no
72
+ * code runs), then the live view, whose code is posted in as it closes. The only bridge is the one
73
+ * the document carries: `ReactNativeWebView.postMessage` out (ready, resize, error, `agent.send`),
74
+ * `injectJavaScript` dispatching a `message` event in (render, run, theme, jsx). Everything the
75
+ * WebView says is checked as the web host checks it — length capped before parsing, the frame's
76
+ * token, size, interval and count limits, JSON only, `schema`, `confirm` — and an accepted
77
+ * `agent.send` is handed on as a `UiAction`.
78
+ *
79
+ * ```tsx
80
+ * <GenuiProvider registry={{ Sandbox: createNativeSandboxRenderer({ theme: () => useSandboxTheme() }) }} onAction={chat.sendUiAction}>
81
+ * ```
82
+ */
83
+ export declare function createNativeSandboxRenderer(options?: NativeSandboxRendererOptions): GenuiRenderer<SandboxProps>;
84
+ /** The native sandbox renderer with its defaults (theme from nothing, no Tailwind, no kit). */
85
+ export declare const NativeSandboxView: GenuiRenderer<SandboxProps>;
86
+ //# sourceMappingURL=sandbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../../../src/react-native/genui/sandbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,SAAS,EAAc,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1E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