gesso-framework 0.6.15 → 0.6.16
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/CHANGELOG.md +17 -0
- package/dist/{FunctionComponent-fYMdePtH.d.ts → FunctionComponent-B1TJED62.d.ts} +19 -3
- package/dist/agent/index.js +3 -3
- package/dist/{app-6S4_PPB0.js → app-NLcQF2Oh.js} +2 -2
- package/dist/{app-6S4_PPB0.js.map → app-NLcQF2Oh.js.map} +1 -1
- package/dist/{index-cRzARAq7.d.ts → index-D7J6_IUk.d.ts} +26 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +67 -16
- package/dist/index.js.map +1 -1
- package/dist/jsx/jsx-runtime.d.ts +1 -1
- package/dist/{persisted-IXHP0d-X.js → persisted-m5v2fOju.js} +2 -2
- package/dist/{persisted-IXHP0d-X.js.map → persisted-m5v2fOju.js.map} +1 -1
- package/dist/remote/index.d.ts +1 -1
- package/dist/remote/index.js +11 -2
- package/dist/remote/index.js.map +1 -1
- package/dist/{remote-BEGRJ1V3.js → remote-CSdwpwXz.js} +94 -3
- package/dist/remote-CSdwpwXz.js.map +1 -0
- package/dist/{serveChannels-CFzq0Hz3.js → serveChannels-DN2R2s0A.js} +5 -65
- package/dist/serveChannels-DN2R2s0A.js.map +1 -0
- package/dist/{webmcp-Dsp4W-pi.js → webmcp-BvQBxNjX.js} +2 -2
- package/dist/{webmcp-Dsp4W-pi.js.map → webmcp-BvQBxNjX.js.map} +1 -1
- package/dist/worker/index.d.ts +2 -2
- package/dist/worker/index.js +3 -2
- package/package.json +2 -2
- package/dist/remote-BEGRJ1V3.js.map +0 -1
- package/dist/serveChannels-CFzq0Hz3.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# gesso-framework
|
|
2
2
|
|
|
3
|
+
## 0.6.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d67e80b: `Inputs` types a member declared as an Observable by the values it holds. The host subscribes to an Observable a parent passes and feeds the cell its values, so a cell never holds the stream; `Inputs<{ items: Observable<Item[]> }>` used to type `inputs.items.value` as the Observable, and `inputs.items.value.pipe(...)` compiled and then threw on mount. It is now typed as `Item[]`, and the new `InputValue` type says how. A member that mixes values and streams, such as `UiChild` or `Reactive<T>`, is unchanged.
|
|
8
|
+
- 1f60081: A channel's view may hold a `SharedArrayBuffer`. It is a handle on memory, so reference equality is the right comparison for it, and posted to another thread it is shared rather than copied: the app worker and the render worker can read one large document without sending it, and what changes is a small plain value saying which version to read. It needs a cross-origin isolated page. A desktop window's channels refuse it by name rather than sending `{}`, an agent is shown its size, and `gesso-vite-plugin` describes it in a view's schema instead of warning. A command still may not take one from an agent.
|
|
9
|
+
- 4eed2fd: A node can take text without being a field: `textInput` makes it a surface that keeps and draws its own text, such as a code editor, and receives typed text through `onBeforeInput`, IME composition through the new `onCompositionStart`, `onCompositionUpdate` and `onCompositionEnd`, and the clipboard through `onPaste` and its state's `clipboard`. Keys belonging to an open IME composition (the Enter that commits a candidate, the arrows that choose one) are no longer forwarded as keys, which inserted a line on commit in a field too. A key whose `onKeyDown` called `preventDefault()` now keeps its text out, as in a browser; `UiKeyboardEvent.textFollows` says whether text follows a key at all. `fireEvent` gains `beforeInput`, the composition events, `copy` and `cut`.
|
|
10
|
+
|
|
11
|
+
Key events carry `code`, the physical key (`KeyZ`), so a shortcut can match Option+Z on a Mac, where the key is `Ω`.
|
|
12
|
+
|
|
13
|
+
- 548a3b0: A worker whose script never loads is now reported with the reason to look for. A render worker refused by the browser (a 404, a MIME type, or the page's `Cross-Origin-Embedder-Policy`, including a copy cached before the policy was turned on) used to be reported as "the render worker failed to start: undefined"; it now says the script did not load, that the network panel has the reason, and what the usual reasons are. An app worker that never loaded used to say nothing at all and leave the screen waiting on its channels; it is now reported the same way.
|
|
14
|
+
- Updated dependencies [dd5c789]
|
|
15
|
+
- Updated dependencies [b681046]
|
|
16
|
+
- Updated dependencies [8149ae2]
|
|
17
|
+
- Updated dependencies [4eed2fd]
|
|
18
|
+
- gesso-core@0.6.16
|
|
19
|
+
|
|
3
20
|
## 0.6.15
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -407,7 +407,23 @@ interface ComponentContext {
|
|
|
407
407
|
* default, and `select(inputs.name, ...)` projects one.
|
|
408
408
|
* `Input.optional.spec.ts` is that case written down.
|
|
409
409
|
*/
|
|
410
|
-
type Inputs<P> = { readonly [K in keyof P]-?: InputCell<P[K]
|
|
410
|
+
type Inputs<P> = { readonly [K in keyof P]-?: InputCell<InputValue<P[K]>>; };
|
|
411
|
+
/**
|
|
412
|
+
* What an input cell holds for a member declared as `P[K]`.
|
|
413
|
+
*
|
|
414
|
+
* The host subscribes to an Observable a parent passes and feeds the
|
|
415
|
+
* cell its values, so a cell never holds an Observable. A member
|
|
416
|
+
* declared as `Observable<T>` therefore holds `T`, and saying so here
|
|
417
|
+
* turns `inputs.items.value.pipe(...)`, which used to compile and then
|
|
418
|
+
* throw "pipe is not a function" on mount, into a type error. Declare
|
|
419
|
+
* the member as `T`: a parent may pass a `T` or an `Observable<T>`
|
|
420
|
+
* either way.
|
|
421
|
+
*
|
|
422
|
+
* Only a member that is nothing but an Observable (or one that may be
|
|
423
|
+
* left out) is unwrapped. A union that mixes values and streams, such
|
|
424
|
+
* as `UiChild` or `Reactive<T>`, is left as it was declared.
|
|
425
|
+
*/
|
|
426
|
+
type InputValue<V> = [Exclude<V, undefined>] extends [Observable<infer T>] ? T | Extract<V, undefined> : V;
|
|
411
427
|
/**
|
|
412
428
|
* A component written as a function.
|
|
413
429
|
*
|
|
@@ -481,5 +497,5 @@ type ComponentArgs<C> = RequiredKeys<ComponentProps<C>> extends never ? [inputs?
|
|
|
481
497
|
*/
|
|
482
498
|
declare function isClassComponent(component: ComponentType): component is ClassComponent;
|
|
483
499
|
//#endregion
|
|
484
|
-
export {
|
|
485
|
-
//# sourceMappingURL=FunctionComponent-
|
|
500
|
+
export { InternalState as C, output as S, Component as T, OutputTarget as _, ComponentType as a, into as b, Inputs as c, BoundsCell as d, bounds as f, OutputCell as g, InputCell as h, ComponentProps as i, isClassComponent as l, EmitValue as m, ComponentArgs as n, FunctionComponent as o, EmitArgs as p, ComponentContext as r, InputValue as s, ClassComponent as t, ChannelReplica as u, ReadableCell as v, internalState as w, isOutputTarget as x, input as y };
|
|
501
|
+
//# sourceMappingURL=FunctionComponent-B1TJED62.d.ts.map
|
package/dist/agent/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as agentSurface, i as serveAgentPort, n as combineSurfaces, o as resourceUri, r as remoteSurface, s as validate, t as AGENT_PORT } from "../remote-
|
|
2
|
-
import { a as resolveTarget, i as outline, n as serveApplicationAgent, o as uiSurface, r as UiRefs } from "../app-
|
|
3
|
-
import { i as registerWebMcpTools, n as connectWebMcp, r as pageModelContext, t as confirmInWindow } from "../webmcp-
|
|
1
|
+
import { a as agentSurface, i as serveAgentPort, n as combineSurfaces, o as resourceUri, r as remoteSurface, s as validate, t as AGENT_PORT } from "../remote-CSdwpwXz.js";
|
|
2
|
+
import { a as resolveTarget, i as outline, n as serveApplicationAgent, o as uiSurface, r as UiRefs } from "../app-NLcQF2Oh.js";
|
|
3
|
+
import { i as registerWebMcpTools, n as connectWebMcp, r as pageModelContext, t as confirmInWindow } from "../webmcp-BvQBxNjX.js";
|
|
4
4
|
//#region src/agent/mcp.ts
|
|
5
5
|
/**
|
|
6
6
|
* An agent surface, served over the Model Context Protocol.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { a as agentSurface, i as serveAgentPort, n as combineSurfaces, r as remoteSurface, t as AGENT_PORT } from "./remote-
|
|
2
|
+
import { a as agentSurface, i as serveAgentPort, n as combineSurfaces, r as remoteSurface, t as AGENT_PORT } from "./remote-CSdwpwXz.js";
|
|
3
3
|
//#region src/agent/ui.ts
|
|
4
4
|
const TARGET = {
|
|
5
5
|
ref: {
|
|
@@ -323,4 +323,4 @@ function serveApplicationAgent(port, parts) {
|
|
|
323
323
|
//#endregion
|
|
324
324
|
export { resolveTarget as a, outline as i, serveApplicationAgent as n, uiSurface as o, UiRefs as r, app_exports as t };
|
|
325
325
|
|
|
326
|
-
//# sourceMappingURL=app-
|
|
326
|
+
//# sourceMappingURL=app-NLcQF2Oh.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-6S4_PPB0.js","names":[],"sources":["../src/agent/ui.ts","../src/agent/app.ts"],"sourcesContent":["import type { UiKeyModifiers, UiSemanticsAction, UiSemanticsMap, UiSemanticsRecord } from 'gesso-core';\n\nimport type { JsonSchema } from '../channel/ChannelSchema';\nimport type { AgentSurface, AgentTool, AgentToolResult } from './AgentSurface';\n\n/**\n * The screen, as tools an agent can use.\n *\n * Channels are the application's own vocabulary, and the right way in\n * for anything they cover. Not everything is covered: a dialog's\n * buttons, a tab, a field the person is halfway through filling. For\n * those an agent has to do what a person does, and a canvas gives it\n * nothing to do that with: no DOM to query, no element to click.\n *\n * The semantics tree is the answer a screen reader already gets. Every\n * control has a role and an accessible name, a state, a value, and an\n * id, so an agent can read the screen as an outline and act on a\n * control by naming it. Acting goes through `applySemanticsAction`,\n * the path the accessibility mirror uses, which turns a press into the\n * same click a pointer makes and a value into the same edit a keyboard\n * makes: an agent can do exactly what a person could, no more, and an\n * open focus trap holds it as it holds Tab.\n *\n * ui_snapshot the screen as an outline, each control with a ref\n * ui_press press a control, by ref or by role and name\n * ui_type replace a field's text\n * ui_focus move focus to a control\n * ui_key press a key where focus is: Enter, Escape, Tab, ArrowDown\n *\n * Each action answers with the outline as it is afterwards.\n */\n\n/** What the tools need of the running application. */\nexport interface UiHost {\n semanticsTree(): UiSemanticsMap;\n focusedNodeId(): string | null;\n applySemanticsAction(action: UiSemanticsAction): void;\n key(key: string, modifiers: UiKeyModifiers): void;\n /**\n * Runs a pending frame now. A tab in the background is sent no\n * frames, and without one an action's effect never reaches the tree\n * this reads back.\n */\n flush(): void;\n}\n\nexport interface UiSurfaceOptions {\n /** How long the screen must hold still after an action before it is read back (default 50 ms). */\n quietMs?: number;\n /** The longest an action waits for that (default 1000 ms). */\n settleMs?: number;\n}\n\nconst TARGET: Record<string, JsonSchema> = {\n ref: { type: 'string', description: 'The ref ui_snapshot gave the control, such as \"e4\".' },\n role: { type: 'string', description: 'The control\\'s role, such as \"button\" or \"textbox\".' },\n name: { type: 'string', description: \"The control's accessible name, as ui_snapshot shows it in quotes.\" }\n};\n\nconst TOOLS: readonly AgentTool[] = [\n {\n name: 'ui_snapshot',\n title: 'Read the screen',\n description:\n 'The screen as an outline of what a screen reader would announce: each control with its role, name, state, ' +\n 'value and a ref to act on it by. Read it before acting, and again whenever an action did not do what you ' +\n 'expected. Prefer a channel tool when one covers what you want; these act on the interface.',\n inputSchema: { type: 'object', properties: {}, additionalProperties: false },\n annotations: { readOnlyHint: true, openWorldHint: false }\n },\n {\n name: 'ui_press',\n title: 'Press a control',\n description:\n 'Presses a button, link, checkbox, tab or any other control, as a click would. Name it by ref, or by role and ' +\n 'name. Returns the screen afterwards.',\n inputSchema: { type: 'object', properties: TARGET, additionalProperties: false },\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false }\n },\n {\n name: 'ui_type',\n title: 'Fill a field',\n description:\n \"Replaces a text field's whole text, as if the person had selected it all and typed. Name the field by ref, or \" +\n 'by role and name. Returns the screen afterwards; press Enter with ui_key to submit.',\n inputSchema: {\n type: 'object',\n properties: { ...TARGET, text: { type: 'string', description: 'The text the field should hold.' } },\n required: ['text'],\n additionalProperties: false\n },\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false }\n },\n {\n name: 'ui_focus',\n title: 'Focus a control',\n description: 'Moves keyboard focus to a control, by ref or by role and name. Returns the screen afterwards.',\n inputSchema: { type: 'object', properties: TARGET, additionalProperties: false },\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false }\n },\n {\n name: 'ui_key',\n title: 'Press a key',\n description:\n 'Presses a key where focus is, as the keyboard would: Enter, Escape, Tab, ArrowDown, a letter. Modifiers are ' +\n 'optional. Returns the screen afterwards.',\n inputSchema: {\n type: 'object',\n properties: {\n key: { type: 'string', description: 'A KeyboardEvent key name, such as \"Enter\", \"Escape\" or \"a\".' },\n shift: { type: 'boolean' },\n ctrl: { type: 'boolean' },\n alt: { type: 'boolean' },\n meta: { type: 'boolean' }\n },\n required: ['key'],\n additionalProperties: false\n },\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false }\n }\n];\n\n/**\n * Short names for record ids.\n *\n * A record's id is its path through the tree, `root:0:0:component:1:0:1`,\n * which is exact and long, and an outline repeats one on every line an\n * agent reads. A ref is `e` and a number, given the first time a record\n * is seen and kept for as long as the surface lives, so the ref an agent\n * read in one snapshot still names the same control in the next.\n */\nexport class UiRefs {\n private readonly byId = new Map<string, string>();\n private readonly byRef = new Map<string, string>();\n\n refOf(id: string): string {\n let ref = this.byId.get(id);\n if (ref === undefined) {\n ref = `e${this.byId.size + 1}`;\n this.byId.set(id, ref);\n this.byRef.set(ref, id);\n }\n return ref;\n }\n\n /** The record id a ref names, or the input itself when it is not a ref this surface gave. */\n idOf(ref: string): string {\n return this.byRef.get(ref) ?? ref;\n }\n}\n\n/**\n * The tools, over a host. `host` returns undefined until the\n * application has started, and a tool called before then says so.\n */\nexport function uiSurface(host: () => UiHost | undefined, options: UiSurfaceOptions = {}): AgentSurface {\n const quietMs = options.quietMs ?? 50;\n const settleMs = options.settleMs ?? 1000;\n const refs = new UiRefs();\n\n /** Waits until two readings of the screen agree, then returns the last. */\n const settled = async (ui: UiHost): Promise<string> => {\n const start = Date.now();\n let previous = '';\n for (;;) {\n ui.flush();\n const current = outline(ui.semanticsTree(), ui.focusedNodeId(), refs);\n if (current === previous || Date.now() - start >= settleMs) {\n return current;\n }\n previous = current;\n await new Promise(resolve => setTimeout(resolve, quietMs));\n }\n };\n\n const act = async (\n args: Readonly<Record<string, unknown>>,\n perform: (ui: UiHost, record: UiSemanticsRecord) => string | null\n ): Promise<AgentToolResult> => {\n const ui = host();\n if (ui === undefined) {\n return failure('The application has not started yet.');\n }\n ui.flush();\n const found = resolveTarget(ui.semanticsTree(), args, refs);\n if (typeof found === 'string') {\n return failure(found);\n }\n if (found.disabled === true) {\n return failure(`${describe(found)} is disabled.`);\n }\n const problem = perform(ui, found);\n if (problem !== null) {\n return failure(problem);\n }\n return success(await settled(ui));\n };\n\n return {\n tools: () => TOOLS,\n call: async (name, args = {}) => {\n switch (name) {\n case 'ui_snapshot': {\n const ui = host();\n return ui === undefined ? failure('The application has not started yet.') : success(await settled(ui));\n }\n case 'ui_press':\n return act(args, (ui, record) => (ui.applySemanticsAction({ id: record.id, action: 'click' }), null));\n case 'ui_focus':\n return act(args, (ui, record) => (ui.applySemanticsAction({ id: record.id, action: 'focus' }), null));\n case 'ui_type':\n if (typeof args.text !== 'string') {\n return failure('ui_type needs text: the text the field should hold.');\n }\n return act(args, (ui, record) => {\n if (record.states?.includes('readonly')) {\n return `${describe(record)} is read-only.`;\n }\n ui.applySemanticsAction({ id: record.id, action: 'setValue', value: args.text as string });\n return null;\n });\n case 'ui_key': {\n const ui = host();\n if (ui === undefined) {\n return failure('The application has not started yet.');\n }\n if (typeof args.key !== 'string' || args.key === '') {\n return failure('ui_key needs key: a KeyboardEvent key name, such as \"Enter\".');\n }\n ui.key(args.key, {\n shift: args.shift === true,\n ctrl: args.ctrl === true,\n alt: args.alt === true,\n meta: args.meta === true\n });\n return success(await settled(ui));\n }\n default:\n return failure(`There is no tool called ${name}.`);\n }\n },\n resources: () => [],\n read: () => undefined,\n dispose: () => {}\n };\n}\n\n/**\n * The tree as an indented outline, one control per line:\n *\n * - button \"Add one\" [e3]\n * - textbox \"Title\" value=\"Groceries\" [e4] (focused)\n *\n * Text, because an agent reads it, and an outline is a third the size\n * of the same tree as JSON. A record with neither a role nor a name is\n * structure, and its children are lifted to its depth.\n */\nexport function outline(tree: UiSemanticsMap, focused: string | null, refs: UiRefs = new UiRefs()): string {\n const depths = new Map<string, number>();\n const lines: string[] = [];\n for (const record of tree.values()) {\n const parentDepth = record.parent === null ? -1 : (depths.get(record.parent) ?? -1);\n const shown = record.role !== undefined || (record.label !== undefined && record.label !== '');\n const depth = shown ? parentDepth + 1 : parentDepth;\n depths.set(record.id, depth);\n if (!shown) {\n continue;\n }\n const parts = [`${' '.repeat(depth)}- ${describe(record)}`];\n if (record.states !== undefined && record.states.length > 0) {\n parts.push(`[${record.states.join(', ')}]`);\n }\n const value = valueOf(record);\n if (value !== null) {\n parts.push(`value=${JSON.stringify(value)}`);\n }\n if (record.disabled === true) {\n parts.push('(disabled)');\n }\n parts.push(`[${refs.refOf(record.id)}]`);\n if (record.id === focused) {\n parts.push('(focused)');\n }\n lines.push(parts.join(' '));\n }\n return lines.length === 0 ? '(the screen announces nothing)' : lines.join('\\n');\n}\n\nfunction describe(record: UiSemanticsRecord): string {\n const name = record.label === undefined || record.label === '' ? '' : ` ${JSON.stringify(record.label)}`;\n return `${record.role ?? 'text'}${name}`;\n}\n\nfunction valueOf(record: UiSemanticsRecord): string | null {\n if (record.valueText !== undefined && record.valueText !== record.label) {\n return record.valueText;\n }\n if (record.valueNow !== undefined) {\n return String(record.valueNow);\n }\n return null;\n}\n\n/**\n * The record an action names: by ref, or by role and name. A name\n * matches exactly before it matches as a part, ignoring case, so\n * \"Save\" finds the button called Save rather than \"Save as\". More than\n * one match is an error listing them, because guessing which of two\n * buttons an agent meant is how the wrong one gets pressed.\n */\nexport function resolveTarget(\n tree: UiSemanticsMap,\n args: Readonly<Record<string, unknown>>,\n refs: UiRefs = new UiRefs()\n): UiSemanticsRecord | string {\n const ref = typeof args.ref === 'string' ? args.ref : undefined;\n const role = typeof args.role === 'string' ? args.role : undefined;\n const name = typeof args.name === 'string' ? args.name : undefined;\n if (ref !== undefined) {\n return (\n tree.get(refs.idOf(ref)) ??\n `Nothing on the screen has the ref ${ref} now. Read ui_snapshot again for current refs.`\n );\n }\n if (role === undefined && name === undefined) {\n return 'Say which control: a ref from ui_snapshot, or a role and a name.';\n }\n const candidates = [...tree.values()].filter(record => role === undefined || record.role === role);\n let matches = candidates;\n if (name !== undefined) {\n const wanted = name.toLowerCase();\n const exact = candidates.filter(record => record.label?.toLowerCase() === wanted);\n matches = exact.length > 0 ? exact : candidates.filter(record => record.label?.toLowerCase().includes(wanted));\n }\n const wanted = [role, name === undefined ? undefined : JSON.stringify(name)].filter(Boolean).join(' ');\n if (matches.length === 1) {\n return matches[0];\n }\n if (matches.length === 0) {\n const nearby = candidates\n .filter(record => record.role !== undefined)\n .slice(0, 10)\n .map(record => `${describe(record)} [${refs.refOf(record.id)}]`);\n return `Nothing on the screen is ${wanted}.${nearby.length > 0 ? ` Some that are: ${nearby.join('; ')}.` : ''}`;\n }\n return `${matches.length} controls are ${wanted}: ${matches\n .slice(0, 10)\n .map(record => `${describe(record)} [${refs.refOf(record.id)}]`)\n .join('; ')}. Use a ref.`;\n}\n\nfunction success(text: string): AgentToolResult {\n return { content: [{ type: 'text', text }], isError: false };\n}\n\nfunction failure(text: string): AgentToolResult {\n return { content: [{ type: 'text', text }], isError: true };\n}\n","import type { ServedChannel } from '../channel/serveChannels';\nimport type { WorkerHandle } from '../worker/WorkerPorts';\nimport { agentSurface } from './AgentSurface';\nimport { AGENT_PORT, combineSurfaces, remoteSurface, serveAgentPort } from './remote';\nimport { uiSurface, type UiHost } from './ui';\n\n/** What a thread that draws the application can offer an agent. */\nexport interface ApplicationAgentParts {\n /** The channels fed from this thread. */\n readonly channels: () => readonly ServedChannel[];\n /** The workers behind it, each asked over an agent port of its own. */\n readonly workers: () => Iterable<WorkerHandle>;\n /** The screen, once the application has started. */\n readonly ui: () => UiHost | undefined;\n}\n\n/**\n * Answers an agent port with the whole application: the channels this\n * thread feeds, whatever each worker behind it serves, and the screen.\n *\n * The thread that draws is the one that knows all three, which is the\n * render worker in the worker configuration and the page in the single\n * thread one; both answer with this. The screen comes last, so a\n * channel tool keeps its name.\n */\nexport function serveApplicationAgent(port: MessagePort, parts: ApplicationAgentParts): () => void {\n return serveAgentPort(port, confirm => {\n const workers = [...parts.workers()]\n .filter(worker => worker.spawned)\n .map(worker => remoteSurface(worker.open(AGENT_PORT), { confirm }));\n return combineSurfaces([agentSurface(parts.channels(), { confirm }), ...workers, uiSurface(parts.ui)]);\n });\n}\n"],"mappings":";;;AAqDA,MAAM,SAAqC;CACzC,KAAK;EAAE,MAAM;EAAU,aAAa;CAAsD;CAC1F,MAAM;EAAE,MAAM;EAAU,aAAa;CAAsD;CAC3F,MAAM;EAAE,MAAM;EAAU,aAAa;CAAoE;AAC3G;AAEA,MAAM,QAA8B;CAClC;EACE,MAAM;EACN,OAAO;EACP,aACE;EAGF,aAAa;GAAE,MAAM;GAAU,YAAY,CAAC;GAAG,sBAAsB;EAAM;EAC3E,aAAa;GAAE,cAAc;GAAM,eAAe;EAAM;CAC1D;CACA;EACE,MAAM;EACN,OAAO;EACP,aACE;EAEF,aAAa;GAAE,MAAM;GAAU,YAAY;GAAQ,sBAAsB;EAAM;EAC/E,aAAa;GAAE,cAAc;GAAO,iBAAiB;GAAO,eAAe;EAAM;CACnF;CACA;EACE,MAAM;EACN,OAAO;EACP,aACE;EAEF,aAAa;GACX,MAAM;GACN,YAAY;IAAE,GAAG;IAAQ,MAAM;KAAE,MAAM;KAAU,aAAa;IAAkC;GAAE;GAClG,UAAU,CAAC,MAAM;GACjB,sBAAsB;EACxB;EACA,aAAa;GAAE,cAAc;GAAO,iBAAiB;GAAO,eAAe;EAAM;CACnF;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,aAAa;GAAE,MAAM;GAAU,YAAY;GAAQ,sBAAsB;EAAM;EAC/E,aAAa;GAAE,cAAc;GAAO,iBAAiB;GAAO,gBAAgB;GAAM,eAAe;EAAM;CACzG;CACA;EACE,MAAM;EACN,OAAO;EACP,aACE;EAEF,aAAa;GACX,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AC;CACvG,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"app-NLcQF2Oh.js","names":[],"sources":["../src/agent/ui.ts","../src/agent/app.ts"],"sourcesContent":["import type { UiKeyModifiers, UiSemanticsAction, UiSemanticsMap, UiSemanticsRecord } from 'gesso-core';\n\nimport type { JsonSchema } from '../channel/ChannelSchema';\nimport type { AgentSurface, AgentTool, AgentToolResult } from './AgentSurface';\n\n/**\n * The screen, as tools an agent can use.\n *\n * Channels are the application's own vocabulary, and the right way in\n * for anything they cover. Not everything is covered: a dialog's\n * buttons, a tab, a field the person is halfway through filling. For\n * those an agent has to do what a person does, and a canvas gives it\n * nothing to do that with: no DOM to query, no element to click.\n *\n * The semantics tree is the answer a screen reader already gets. Every\n * control has a role and an accessible name, a state, a value, and an\n * id, so an agent can read the screen as an outline and act on a\n * control by naming it. Acting goes through `applySemanticsAction`,\n * the path the accessibility mirror uses, which turns a press into the\n * same click a pointer makes and a value into the same edit a keyboard\n * makes: an agent can do exactly what a person could, no more, and an\n * open focus trap holds it as it holds Tab.\n *\n * ui_snapshot the screen as an outline, each control with a ref\n * ui_press press a control, by ref or by role and name\n * ui_type replace a field's text\n * ui_focus move focus to a control\n * ui_key press a key where focus is: Enter, Escape, Tab, ArrowDown\n *\n * Each action answers with the outline as it is afterwards.\n */\n\n/** What the tools need of the running application. */\nexport interface UiHost {\n semanticsTree(): UiSemanticsMap;\n focusedNodeId(): string | null;\n applySemanticsAction(action: UiSemanticsAction): void;\n key(key: string, modifiers: UiKeyModifiers): void;\n /**\n * Runs a pending frame now. A tab in the background is sent no\n * frames, and without one an action's effect never reaches the tree\n * this reads back.\n */\n flush(): void;\n}\n\nexport interface UiSurfaceOptions {\n /** How long the screen must hold still after an action before it is read back (default 50 ms). */\n quietMs?: number;\n /** The longest an action waits for that (default 1000 ms). */\n settleMs?: number;\n}\n\nconst TARGET: Record<string, JsonSchema> = {\n ref: { type: 'string', description: 'The ref ui_snapshot gave the control, such as \"e4\".' },\n role: { type: 'string', description: 'The control\\'s role, such as \"button\" or \"textbox\".' },\n name: { type: 'string', description: \"The control's accessible name, as ui_snapshot shows it in quotes.\" }\n};\n\nconst TOOLS: readonly AgentTool[] = [\n {\n name: 'ui_snapshot',\n title: 'Read the screen',\n description:\n 'The screen as an outline of what a screen reader would announce: each control with its role, name, state, ' +\n 'value and a ref to act on it by. Read it before acting, and again whenever an action did not do what you ' +\n 'expected. Prefer a channel tool when one covers what you want; these act on the interface.',\n inputSchema: { type: 'object', properties: {}, additionalProperties: false },\n annotations: { readOnlyHint: true, openWorldHint: false }\n },\n {\n name: 'ui_press',\n title: 'Press a control',\n description:\n 'Presses a button, link, checkbox, tab or any other control, as a click would. Name it by ref, or by role and ' +\n 'name. Returns the screen afterwards.',\n inputSchema: { type: 'object', properties: TARGET, additionalProperties: false },\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false }\n },\n {\n name: 'ui_type',\n title: 'Fill a field',\n description:\n \"Replaces a text field's whole text, as if the person had selected it all and typed. Name the field by ref, or \" +\n 'by role and name. Returns the screen afterwards; press Enter with ui_key to submit.',\n inputSchema: {\n type: 'object',\n properties: { ...TARGET, text: { type: 'string', description: 'The text the field should hold.' } },\n required: ['text'],\n additionalProperties: false\n },\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false }\n },\n {\n name: 'ui_focus',\n title: 'Focus a control',\n description: 'Moves keyboard focus to a control, by ref or by role and name. Returns the screen afterwards.',\n inputSchema: { type: 'object', properties: TARGET, additionalProperties: false },\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false }\n },\n {\n name: 'ui_key',\n title: 'Press a key',\n description:\n 'Presses a key where focus is, as the keyboard would: Enter, Escape, Tab, ArrowDown, a letter. Modifiers are ' +\n 'optional. Returns the screen afterwards.',\n inputSchema: {\n type: 'object',\n properties: {\n key: { type: 'string', description: 'A KeyboardEvent key name, such as \"Enter\", \"Escape\" or \"a\".' },\n shift: { type: 'boolean' },\n ctrl: { type: 'boolean' },\n alt: { type: 'boolean' },\n meta: { type: 'boolean' }\n },\n required: ['key'],\n additionalProperties: false\n },\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false }\n }\n];\n\n/**\n * Short names for record ids.\n *\n * A record's id is its path through the tree, `root:0:0:component:1:0:1`,\n * which is exact and long, and an outline repeats one on every line an\n * agent reads. A ref is `e` and a number, given the first time a record\n * is seen and kept for as long as the surface lives, so the ref an agent\n * read in one snapshot still names the same control in the next.\n */\nexport class UiRefs {\n private readonly byId = new Map<string, string>();\n private readonly byRef = new Map<string, string>();\n\n refOf(id: string): string {\n let ref = this.byId.get(id);\n if (ref === undefined) {\n ref = `e${this.byId.size + 1}`;\n this.byId.set(id, ref);\n this.byRef.set(ref, id);\n }\n return ref;\n }\n\n /** The record id a ref names, or the input itself when it is not a ref this surface gave. */\n idOf(ref: string): string {\n return this.byRef.get(ref) ?? ref;\n }\n}\n\n/**\n * The tools, over a host. `host` returns undefined until the\n * application has started, and a tool called before then says so.\n */\nexport function uiSurface(host: () => UiHost | undefined, options: UiSurfaceOptions = {}): AgentSurface {\n const quietMs = options.quietMs ?? 50;\n const settleMs = options.settleMs ?? 1000;\n const refs = new UiRefs();\n\n /** Waits until two readings of the screen agree, then returns the last. */\n const settled = async (ui: UiHost): Promise<string> => {\n const start = Date.now();\n let previous = '';\n for (;;) {\n ui.flush();\n const current = outline(ui.semanticsTree(), ui.focusedNodeId(), refs);\n if (current === previous || Date.now() - start >= settleMs) {\n return current;\n }\n previous = current;\n await new Promise(resolve => setTimeout(resolve, quietMs));\n }\n };\n\n const act = async (\n args: Readonly<Record<string, unknown>>,\n perform: (ui: UiHost, record: UiSemanticsRecord) => string | null\n ): Promise<AgentToolResult> => {\n const ui = host();\n if (ui === undefined) {\n return failure('The application has not started yet.');\n }\n ui.flush();\n const found = resolveTarget(ui.semanticsTree(), args, refs);\n if (typeof found === 'string') {\n return failure(found);\n }\n if (found.disabled === true) {\n return failure(`${describe(found)} is disabled.`);\n }\n const problem = perform(ui, found);\n if (problem !== null) {\n return failure(problem);\n }\n return success(await settled(ui));\n };\n\n return {\n tools: () => TOOLS,\n call: async (name, args = {}) => {\n switch (name) {\n case 'ui_snapshot': {\n const ui = host();\n return ui === undefined ? failure('The application has not started yet.') : success(await settled(ui));\n }\n case 'ui_press':\n return act(args, (ui, record) => (ui.applySemanticsAction({ id: record.id, action: 'click' }), null));\n case 'ui_focus':\n return act(args, (ui, record) => (ui.applySemanticsAction({ id: record.id, action: 'focus' }), null));\n case 'ui_type':\n if (typeof args.text !== 'string') {\n return failure('ui_type needs text: the text the field should hold.');\n }\n return act(args, (ui, record) => {\n if (record.states?.includes('readonly')) {\n return `${describe(record)} is read-only.`;\n }\n ui.applySemanticsAction({ id: record.id, action: 'setValue', value: args.text as string });\n return null;\n });\n case 'ui_key': {\n const ui = host();\n if (ui === undefined) {\n return failure('The application has not started yet.');\n }\n if (typeof args.key !== 'string' || args.key === '') {\n return failure('ui_key needs key: a KeyboardEvent key name, such as \"Enter\".');\n }\n ui.key(args.key, {\n shift: args.shift === true,\n ctrl: args.ctrl === true,\n alt: args.alt === true,\n meta: args.meta === true\n });\n return success(await settled(ui));\n }\n default:\n return failure(`There is no tool called ${name}.`);\n }\n },\n resources: () => [],\n read: () => undefined,\n dispose: () => {}\n };\n}\n\n/**\n * The tree as an indented outline, one control per line:\n *\n * - button \"Add one\" [e3]\n * - textbox \"Title\" value=\"Groceries\" [e4] (focused)\n *\n * Text, because an agent reads it, and an outline is a third the size\n * of the same tree as JSON. A record with neither a role nor a name is\n * structure, and its children are lifted to its depth.\n */\nexport function outline(tree: UiSemanticsMap, focused: string | null, refs: UiRefs = new UiRefs()): string {\n const depths = new Map<string, number>();\n const lines: string[] = [];\n for (const record of tree.values()) {\n const parentDepth = record.parent === null ? -1 : (depths.get(record.parent) ?? -1);\n const shown = record.role !== undefined || (record.label !== undefined && record.label !== '');\n const depth = shown ? parentDepth + 1 : parentDepth;\n depths.set(record.id, depth);\n if (!shown) {\n continue;\n }\n const parts = [`${' '.repeat(depth)}- ${describe(record)}`];\n if (record.states !== undefined && record.states.length > 0) {\n parts.push(`[${record.states.join(', ')}]`);\n }\n const value = valueOf(record);\n if (value !== null) {\n parts.push(`value=${JSON.stringify(value)}`);\n }\n if (record.disabled === true) {\n parts.push('(disabled)');\n }\n parts.push(`[${refs.refOf(record.id)}]`);\n if (record.id === focused) {\n parts.push('(focused)');\n }\n lines.push(parts.join(' '));\n }\n return lines.length === 0 ? '(the screen announces nothing)' : lines.join('\\n');\n}\n\nfunction describe(record: UiSemanticsRecord): string {\n const name = record.label === undefined || record.label === '' ? '' : ` ${JSON.stringify(record.label)}`;\n return `${record.role ?? 'text'}${name}`;\n}\n\nfunction valueOf(record: UiSemanticsRecord): string | null {\n if (record.valueText !== undefined && record.valueText !== record.label) {\n return record.valueText;\n }\n if (record.valueNow !== undefined) {\n return String(record.valueNow);\n }\n return null;\n}\n\n/**\n * The record an action names: by ref, or by role and name. A name\n * matches exactly before it matches as a part, ignoring case, so\n * \"Save\" finds the button called Save rather than \"Save as\". More than\n * one match is an error listing them, because guessing which of two\n * buttons an agent meant is how the wrong one gets pressed.\n */\nexport function resolveTarget(\n tree: UiSemanticsMap,\n args: Readonly<Record<string, unknown>>,\n refs: UiRefs = new UiRefs()\n): UiSemanticsRecord | string {\n const ref = typeof args.ref === 'string' ? args.ref : undefined;\n const role = typeof args.role === 'string' ? args.role : undefined;\n const name = typeof args.name === 'string' ? args.name : undefined;\n if (ref !== undefined) {\n return (\n tree.get(refs.idOf(ref)) ??\n `Nothing on the screen has the ref ${ref} now. Read ui_snapshot again for current refs.`\n );\n }\n if (role === undefined && name === undefined) {\n return 'Say which control: a ref from ui_snapshot, or a role and a name.';\n }\n const candidates = [...tree.values()].filter(record => role === undefined || record.role === role);\n let matches = candidates;\n if (name !== undefined) {\n const wanted = name.toLowerCase();\n const exact = candidates.filter(record => record.label?.toLowerCase() === wanted);\n matches = exact.length > 0 ? exact : candidates.filter(record => record.label?.toLowerCase().includes(wanted));\n }\n const wanted = [role, name === undefined ? undefined : JSON.stringify(name)].filter(Boolean).join(' ');\n if (matches.length === 1) {\n return matches[0];\n }\n if (matches.length === 0) {\n const nearby = candidates\n .filter(record => record.role !== undefined)\n .slice(0, 10)\n .map(record => `${describe(record)} [${refs.refOf(record.id)}]`);\n return `Nothing on the screen is ${wanted}.${nearby.length > 0 ? ` Some that are: ${nearby.join('; ')}.` : ''}`;\n }\n return `${matches.length} controls are ${wanted}: ${matches\n .slice(0, 10)\n .map(record => `${describe(record)} [${refs.refOf(record.id)}]`)\n .join('; ')}. Use a ref.`;\n}\n\nfunction success(text: string): AgentToolResult {\n return { content: [{ type: 'text', text }], isError: false };\n}\n\nfunction failure(text: string): AgentToolResult {\n return { content: [{ type: 'text', text }], isError: true };\n}\n","import type { ServedChannel } from '../channel/serveChannels';\nimport type { WorkerHandle } from '../worker/WorkerPorts';\nimport { agentSurface } from './AgentSurface';\nimport { AGENT_PORT, combineSurfaces, remoteSurface, serveAgentPort } from './remote';\nimport { uiSurface, type UiHost } from './ui';\n\n/** What a thread that draws the application can offer an agent. */\nexport interface ApplicationAgentParts {\n /** The channels fed from this thread. */\n readonly channels: () => readonly ServedChannel[];\n /** The workers behind it, each asked over an agent port of its own. */\n readonly workers: () => Iterable<WorkerHandle>;\n /** The screen, once the application has started. */\n readonly ui: () => UiHost | undefined;\n}\n\n/**\n * Answers an agent port with the whole application: the channels this\n * thread feeds, whatever each worker behind it serves, and the screen.\n *\n * The thread that draws is the one that knows all three, which is the\n * render worker in the worker configuration and the page in the single\n * thread one; both answer with this. The screen comes last, so a\n * channel tool keeps its name.\n */\nexport function serveApplicationAgent(port: MessagePort, parts: ApplicationAgentParts): () => void {\n return serveAgentPort(port, confirm => {\n const workers = [...parts.workers()]\n .filter(worker => worker.spawned)\n .map(worker => remoteSurface(worker.open(AGENT_PORT), { confirm }));\n return combineSurfaces([agentSurface(parts.channels(), { confirm }), ...workers, uiSurface(parts.ui)]);\n });\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,KAAI,WAAU,GAAG,SAAS,MAAM,EAAE,IAAI,KAAK,MAAM,OAAO,EAAE,EAAE,EAAE;EACjE,OAAO,4BAA4B,OAAO,GAAG,OAAO,SAAS,IAAI,mBAAmB,OAAO,KAAK,IAAI,EAAE,KAAK;CAC7G;CACA,OAAO,GAAG,QAAQ,OAAO,gBAAgB,OAAO,IAAI,QACjD,MAAM,GAAG,EAAE,CAAC,CACZ,KAAI,WAAU,GAAG,SAAS,MAAM,EAAE,IAAI,KAAK,MAAM,OAAO,EAAE,EAAE,EAAE,CAAC,CAC/D,KAAK,IAAI,EAAE;AAChB;AAEA,SAAS,QAAQ,MAA+B;CAC9C,OAAO;EAAE,SAAS,CAAC;GAAE,MAAM;GAAQ;EAAK,CAAC;EAAG,SAAS;CAAM;AAC7D;AAEA,SAAS,QAAQ,MAA+B;CAC9C,OAAO;EAAE,SAAS,CAAC;GAAE,MAAM;GAAQ;EAAK,CAAC;EAAG,SAAS;CAAK;AAC5D;;;;;;;;;;;;;AC5UA,SAAgB,sBAAsB,MAAmB,OAA0C;CACjG,OAAO,eAAe,OAAM,YAAW;EACrC,MAAM,UAAU,CAAC,GAAG,MAAM,QAAQ,CAAC,CAAC,CACjC,QAAO,WAAU,OAAO,OAAO,CAAC,CAChC,KAAI,WAAU,cAAc,OAAO,KAAK,UAAU,GAAG,EAAE,QAAQ,CAAC,CAAC;EACpE,OAAO,gBAAgB;GAAC,aAAa,MAAM,SAAS,GAAG,EAAE,QAAQ,CAAC;GAAG,GAAG;GAAS,UAAU,MAAM,EAAE;EAAC,CAAC;CACvG,CAAC;AACH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { f as ChannelToken, m as CommandMap, o as Patch, p as Command, r as ChannelPort } from "./ChannelProtocol-ByNoHujM.js";
|
|
2
2
|
import { E as WorkerHandle, s as AgentConfirmation, t as UiHost, y as ChannelSource } from "./ui-e4RHm8Mt.js";
|
|
3
|
-
import {
|
|
3
|
+
import { C as InternalState, T as Component, a as ComponentType, c as Inputs, g as OutputCell, h as InputCell, i as ComponentProps, n as ComponentArgs, r as ComponentContext, u as ChannelReplica, v as ReadableCell } from "./FunctionComponent-B1TJED62.js";
|
|
4
4
|
import { BehaviorSubject, Observable, Subscription } from "rxjs";
|
|
5
5
|
import { AnimatedCell, AnimationDriver, CanvasHost, CaretRect, ComponentLikeElement, ComponentResolver, EditingState, EditingState as EditingState$1, FocusOptions, IconRasterizer, ImageResolver, LayoutExplanation, LayoutInspector, MARK_PREFIX, MotionStateInput, MotionTiming, Reactive, RendererBackend, Size, TextMeasureRequest, TextMeasurer, UI_ROLES, UI_SEMANTIC_STATES, UiAnimation, UiChild, UiContrast, UiDurationToken, UiEasing, UiEasingToken, UiEditingController, UiElement, UiFileDropMessage, UiFindController, UiFocusManager, UiFrameClockFactory, UiInputDispatcher, UiInsets, UiKeyModifiers, UiKeyboardController, UiLength, UiModifier, UiMotion, UiNode, UiPlatformAdapter, UiPointerController, UiPointerDevice, UiReducedMotionPolicy, UiRole, UiScrollability, UiSelectionController, UiSemanticState, UiSemanticsAction, UiSemanticsMap, UiSemanticsMap as UiSemanticsMap$1, UiSemanticsPatch, UiSemanticsRecord, UiSemanticsRecord as UiSemanticsRecord$1, UiSemanticsUpdate, UiShortcutRegistry, UiSpringSpec, UiSpringToken, UiTextPosition, UiThemeExtension, UiTouchScroller, UiWheelController, VideoClock, VideoResolver, markInstant, markNow, measureSpan, performanceMarksEnabled, setPerformanceMarks as setPerformanceMarks$1 } from "gesso-core";
|
|
6
6
|
//#region src/service/ServiceRegistry.d.ts
|
|
@@ -987,6 +987,17 @@ declare class ChannelRegistry {
|
|
|
987
987
|
* The check runs once per key, on the first value only. It is a
|
|
988
988
|
* development guard against a design mistake, not a validator on the
|
|
989
989
|
* hot path.
|
|
990
|
+
*
|
|
991
|
+
* One kind of object is allowed: a `SharedArrayBuffer`. Reference
|
|
992
|
+
* equality is the right comparison for it, not a trap: it is a handle
|
|
993
|
+
* on memory, two handles on the same memory are the same value, and
|
|
994
|
+
* one built afresh is new memory. Posted to another thread it is not
|
|
995
|
+
* copied; both threads read the same bytes. That is how a large
|
|
996
|
+
* document is shared between the app worker and the render worker
|
|
997
|
+
* rather than sent: the view carries the handle once, and what changes
|
|
998
|
+
* after that is small plain data saying which version to read. It
|
|
999
|
+
* cannot cross to another process (`remote/frames.ts` says so), and an
|
|
1000
|
+
* agent is shown its size rather than its bytes.
|
|
990
1001
|
*/
|
|
991
1002
|
/**
|
|
992
1003
|
* Returns the path to the first value that cannot cross, or null when
|
|
@@ -4600,12 +4611,14 @@ type ShellToRuntimeMessage = {
|
|
|
4600
4611
|
{
|
|
4601
4612
|
type: 'keyDown';
|
|
4602
4613
|
key: string;
|
|
4614
|
+
code?: string;
|
|
4603
4615
|
modifiers: UiKeyModifiers;
|
|
4604
4616
|
at?: number;
|
|
4605
4617
|
textFollows?: boolean;
|
|
4606
4618
|
} | {
|
|
4607
4619
|
type: 'keyUp';
|
|
4608
4620
|
key: string;
|
|
4621
|
+
code?: string;
|
|
4609
4622
|
modifiers: UiKeyModifiers;
|
|
4610
4623
|
at?: number;
|
|
4611
4624
|
} |
|
|
@@ -5828,6 +5841,17 @@ declare class WorkerApp {
|
|
|
5828
5841
|
* or fails to parse, arrives this way and no other.
|
|
5829
5842
|
*/
|
|
5830
5843
|
private handleWorkerFailure;
|
|
5844
|
+
/**
|
|
5845
|
+
* The app worker's counterpart, for the one failure nothing else
|
|
5846
|
+
* reports: a script that never loaded. Without this, an app worker
|
|
5847
|
+
* blocked by a 404 or by the page's embedder policy left the screen
|
|
5848
|
+
* waiting on channels that would never arrive, and said nothing.
|
|
5849
|
+
*
|
|
5850
|
+
* An exception inside the app worker arrives here too, with a
|
|
5851
|
+
* message, and is left alone: the browser reports it from inside the
|
|
5852
|
+
* worker with its stack, which is better than anything said here.
|
|
5853
|
+
*/
|
|
5854
|
+
private handleAppWorkerFailure;
|
|
5831
5855
|
/** Reports an error, to `onError` or to the console it defaults to. */
|
|
5832
5856
|
private report;
|
|
5833
5857
|
/**
|
|
@@ -8481,4 +8505,4 @@ declare class RenderWorkerApp {
|
|
|
8481
8505
|
}
|
|
8482
8506
|
//#endregion
|
|
8483
8507
|
export { StorageAdapter as $, UiOwnerReport as $n, Resource as $r, FontFaceDeclaration as $t, Presence as A, AudioState as An, Channel as Ar, ActionCause as At, PersistedOptions as B, ShellFileType as Bn, bind as Br, UiTreeSnapshot as Bt, FocusService as C, formatUrl as Cn, pickKeys as Cr, AppLogicEndpoint as Ct, FindService as D, AudioRequest as Dn, findUnplainPath as Dr, ShellHistoryMode as Dt, TextService as E, AudioMetadata as En, createChannelRegistry as Er, ShellHistory as Et, AudioSinkOptions as F, UiDuration as Fn, ControlledOptions as Fr, DevtoolsEvent as Ft, IndexedDbStorage as G, ShellStorageResult as Gn, EachKey as Gr, FrameMetrics as Gt, persisted as H, ShellRequest as Hn, ShowProps as Hr, RuntimeErrorSource as Ht, AudioSinkOutput as I, UiEasingChoice as In, ControlledValue as Ir, DevtoolsRequest as It, OpfsFileHandle as J, observeColorScheme as Jn, debounced as Jr, GessoRuntimeOptions as Jt, IndexedDbStorageOptions as K, ColorScheme as Kn, EachProps as Kr, FramePhaseTimings as Kt, MediaSessionLike as L, ShellFile as Ln, controlled as Lr, FrameEntry as Lt, RouterOutlet as M, AnimateOptions as Mn, Inject as Mr, ChannelErrorEntry as Mt, AudioElementLike as N, AnimationService as Nn, Input as Nr, CommandEntry as Nt, observeMediaQuery as O, AudioSample as On, requirePlainData as Or, ShellHistoryOptions as Ot, AudioSink as P, SpringOptions as Pn, Output as Pr, ConsoleEntry as Pt, MemoryStorage as Q, UiNodeReport as Qn, mutate as Qr, UiFramePhase as Qt, audioClock as R, ShellFileRequest as Rn, ThemeTokenCell as Rr, PatchEntry as Rt, writeClipboard as S, buildPath as Sn, pick as Sr, createApp as St, EditingService as T, AudioAction as Tn, ChannelRegistryHandle as Tr, WorkerAppOptions as Tt, ShellStorage as U, ShellService as Un, show as Ur, RuntimeToShellMessage as Ut, PersistedState as V, ShellRecentFile as Vn, Show as Vr, treeText as Vt, ShellStorageOptions as W, ShellStorageOp as Wn, Each as Wr, ShellToRuntimeMessage as Wt, OpfsStorageOptions as X, NodePathTarget as Xn, MutateOptions as Xr, RuntimeInput as Xt, OpfsStorage as Y, BoundStream as Yn, throttled as Yr, RendererChoice as Yt, OpfsWritable as Z, UiEnvironmentReport as Zn, Mutation as Zr, UI_FRAME_PHASES as Zt, EditingMirrorTarget as _, derive as _i, RouteOptions as _n, createComponent as _r, GessoAppOptions as _t, UiRole as a, select as ai, MediaOptions as an, formatAge as ar, storageReadValue as at, EditingProxy as b, to as bn, isComponentElement as br, WebMcpChoice as bt, UiSemanticsPatch as c, FanOut as ci, RouteMatch as cn, formatStream as cr, UndoableOptions as ct, markNow as d, ComputedCell as di, RouterService as dn, ComponentHost as dr, UndoStackOptions as dt, ResourceOptions as ei, FontFaceLike as en, UiPropOrigin as er, StorageOutcome as et, measureSpan as f, ComputedOptions as fi, RouteState as fn, OverlayLayer as fr, UndoTransaction as ft, renderRoot as g, Equality as gi, RouteGuard as gn, OverlayService as gr, GessoApp as gt, RenderWorkerApp as h, DeriveOptions as hi, RouteDefinition as hn, OverlayRect as hr, shellStorageDenied as ht, UI_SEMANTIC_STATES as i, SelectOptions as ii, FontService as in, describeStream as ir, storageReadFailure as it, PresenceProps as j, AudioStatus as jn, Define as jr, ActionEntry as jt, observeReducedMotion as k, AudioService as kn, ChannelRegistry as kr, createShellHistory as kt, UiSemanticsRecord$1 as l, FanOutOptions as li, RouterHistorySink as ln, printPropValue as lr, undoable as lt, setPerformanceMarks$1 as m, computed as mi, RouteContext as mn, OverlayPlacement as mr, performShellStorage as mt, MARK_PREFIX as n, ResourceStatus as ni, FontFamilyStatus as nn, UiSemanticsReport as nr, classifyStorageError as nt, UiSemanticState as o, FanCell as oi, MediaService as on, formatNodePath as or, UndoShortcutOptions as ot, performanceMarksEnabled as p, ReadSource as pi, OutletProps as pn, OverlayEntry as pr, ShellLocalStore as pt, OpfsDirectory as q, ColorSchemePreference as qn, each as qr, GessoRuntime as qt, UI_ROLES as r, resource as ri, FontHost as rn, UiStreamReport as rr, storageErrorMessage as rt, UiSemanticsMap$1 as s, FanKey as si, RouteAnswer as sn, formatNodeReport as sr, registerUndoShortcuts as st, EditingState$1 as t, ResourceState as ti, FontFamilyDeclaration as tn, UiPropReport as tr, StorageRead as tt, markInstant as u, fanOut as ui, RouterRoutes as un, ComponentHostResolver as ur, UndoStack as ut, SemanticsMirror as v, ServiceRegistry as vi, RouteTarget as vn, ComponentElement as vr, createSyncApp as vt, ScrollService as w, parseUrl as wn, ChannelRegistration as wr, WorkerApp as wt, EditingProxySink as x, RouteParams as xn, structurallyEqual as xr, CreateAppOptions as xt, SemanticsMirrorSink as y, route as yn, FrameworkChild as yr, GessoAppBuilder as yt, FrameService as z, ShellFileResult as zn, themeTokenCell as zr, UiTreeNode as zt };
|
|
8484
|
-
//# sourceMappingURL=index-
|
|
8508
|
+
//# sourceMappingURL=index-D7J6_IUk.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as channel, a as isChannelHostMessage, c as applyPatch, d as ChannelSpec, f as ChannelToken, g as ViewOf, h as CommandsOf, i as isChannelClientMessage, l as applyPatches, m as CommandMap, n as ChannelHostMessage, o as Patch, p as Command, r as ChannelPort, s as PatchPath, t as ChannelClientMessage, u as diffProjection, v as defineChannel, y as viewKeys } from "./ChannelProtocol-ByNoHujM.js";
|
|
2
2
|
import { A as portHandle, C as MessageEndpoint, D as isHubMessage, E as WorkerHandle, F as JsonSchema, I as channelSchema, L as describeChannel, M as workerHandle, N as ChannelSchema, O as isPortErrorMessage, P as CommandSchema, S as APPLICATION_WORKER, T as PortHost, _ as serve, b as ProvidedChannel, g as ServedChannel, j as servePorts, k as isPortHandshake, v as serveChannels, w as PortHandshake, x as provide, y as ChannelSource } from "./ui-e4RHm8Mt.js";
|
|
3
|
-
import { C as
|
|
4
|
-
import { $ as StorageAdapter, $n as UiOwnerReport, $r as Resource, $t as FontFaceDeclaration, A as Presence, An as AudioState, Ar as Channel, At as ActionCause, B as PersistedOptions, Bn as ShellFileType, Br as bind, Bt as UiTreeSnapshot, C as FocusService, Cn as formatUrl, Cr as pickKeys, Ct as AppLogicEndpoint, D as FindService, Dn as AudioRequest, Dr as findUnplainPath, Dt as ShellHistoryMode, E as TextService, En as AudioMetadata, Er as createChannelRegistry, Et as ShellHistory, F as AudioSinkOptions, Fn as UiDuration, Fr as ControlledOptions, Ft as DevtoolsEvent, G as IndexedDbStorage, Gn as ShellStorageResult, Gr as EachKey, Gt as FrameMetrics, H as persisted, Hn as ShellRequest, Hr as ShowProps, Ht as RuntimeErrorSource, I as AudioSinkOutput, In as UiEasingChoice, Ir as ControlledValue, It as DevtoolsRequest, J as OpfsFileHandle, Jn as observeColorScheme, Jr as debounced, Jt as GessoRuntimeOptions, K as IndexedDbStorageOptions, Kn as ColorScheme, Kr as EachProps, Kt as FramePhaseTimings, L as MediaSessionLike, Ln as ShellFile, Lr as controlled, Lt as FrameEntry, M as RouterOutlet, Mn as AnimateOptions, Mr as Inject, Mt as ChannelErrorEntry, N as AudioElementLike, Nn as AnimationService, Nr as Input, Nt as CommandEntry, O as observeMediaQuery, On as AudioSample, Or as requirePlainData, Ot as ShellHistoryOptions, P as AudioSink, Pn as SpringOptions, Pr as Output, Pt as ConsoleEntry, Q as MemoryStorage, Qn as UiNodeReport, Qr as mutate, Qt as UiFramePhase, R as audioClock, Rn as ShellFileRequest, Rr as ThemeTokenCell, Rt as PatchEntry, S as writeClipboard, Sn as buildPath, Sr as pick, St as createApp, T as EditingService, Tn as AudioAction, Tr as ChannelRegistryHandle, Tt as WorkerAppOptions, U as ShellStorage, Un as ShellService, Ur as show, Ut as RuntimeToShellMessage, V as PersistedState, Vn as ShellRecentFile, Vr as Show, Vt as treeText, W as ShellStorageOptions, Wn as ShellStorageOp, Wr as Each, Wt as ShellToRuntimeMessage, X as OpfsStorageOptions, Xn as NodePathTarget, Xr as MutateOptions, Xt as RuntimeInput, Y as OpfsStorage, Yn as BoundStream, Yr as throttled, Yt as RendererChoice, Z as OpfsWritable, Zn as UiEnvironmentReport, Zr as Mutation, Zt as UI_FRAME_PHASES, _ as EditingMirrorTarget, _i as derive, _n as RouteOptions, _r as createComponent, _t as GessoAppOptions, a as UiRole, ai as select, an as MediaOptions, ar as formatAge, at as storageReadValue, b as EditingProxy, bn as to, br as isComponentElement, bt as WebMcpChoice, c as UiSemanticsPatch, ci as FanOut, cn as RouteMatch, cr as formatStream, ct as UndoableOptions, d as markNow, di as ComputedCell, dn as RouterService, dr as ComponentHost, dt as UndoStackOptions, ei as ResourceOptions, en as FontFaceLike, er as UiPropOrigin, et as StorageOutcome, f as measureSpan, fi as ComputedOptions, fn as RouteState, fr as OverlayLayer, ft as UndoTransaction, g as renderRoot, gi as Equality, gn as RouteGuard, gr as OverlayService, gt as GessoApp, h as RenderWorkerApp, hi as DeriveOptions, hn as RouteDefinition, hr as OverlayRect, ht as shellStorageDenied, i as UI_SEMANTIC_STATES, ii as SelectOptions, in as FontService, ir as describeStream, it as storageReadFailure, j as PresenceProps, jn as AudioStatus, jr as Define, jt as ActionEntry, k as observeReducedMotion, kn as AudioService, kr as ChannelRegistry, kt as createShellHistory, l as UiSemanticsRecord, li as FanOutOptions, ln as RouterHistorySink, lr as printPropValue, lt as undoable, m as setPerformanceMarks, mi as computed, mn as RouteContext, mr as OverlayPlacement, mt as performShellStorage, n as MARK_PREFIX, ni as ResourceStatus, nn as FontFamilyStatus, nr as UiSemanticsReport, nt as classifyStorageError, o as UiSemanticState, oi as FanCell, on as MediaService, or as formatNodePath, ot as UndoShortcutOptions, p as performanceMarksEnabled, pi as ReadSource, pn as OutletProps, pr as OverlayEntry, pt as ShellLocalStore, q as OpfsDirectory, qn as ColorSchemePreference, qr as each, qt as GessoRuntime, r as UI_ROLES, ri as resource, rn as FontHost, rr as UiStreamReport, rt as storageErrorMessage, s as UiSemanticsMap, si as FanKey, sn as RouteAnswer, sr as formatNodeReport, st as registerUndoShortcuts, t as EditingState, ti as ResourceState, tn as FontFamilyDeclaration, tr as UiPropReport, tt as StorageRead, u as markInstant, ui as fanOut, un as RouterRoutes, ur as ComponentHostResolver, ut as UndoStack, v as SemanticsMirror, vi as ServiceRegistry, vn as RouteTarget, vr as ComponentElement, vt as createSyncApp, w as ScrollService, wn as parseUrl, wr as ChannelRegistration, wt as WorkerApp, x as EditingProxySink, xn as RouteParams, xr as structurallyEqual, xt as CreateAppOptions, y as SemanticsMirrorSink, yn as route, yr as FrameworkChild, yt as GessoAppBuilder, z as FrameService, zn as ShellFileResult, zr as themeTokenCell, zt as UiTreeNode } from "./index-
|
|
5
|
-
export { APPLICATION_WORKER, type ActionCause, type ActionEntry, type AnimateOptions, AnimationService, type AppLogicEndpoint, type AudioAction, type AudioElementLike, type AudioMetadata, type AudioRequest, type AudioSample, AudioService, AudioSink, type AudioSinkOptions, type AudioSinkOutput, type AudioState, type AudioStatus, type BoundStream, BoundsCell, Channel, type ChannelClientMessage, type ChannelErrorEntry, type ChannelHostMessage, type ChannelPort, type ChannelRegistration, ChannelRegistry, type ChannelRegistryHandle, ChannelReplica, type ChannelSchema, type ChannelSource, type ChannelSpec, type ChannelToken, type ClassComponent, type ColorScheme, type ColorSchemePreference, type Command, type CommandEntry, type CommandMap, type CommandSchema, type CommandsOf, Component, type ComponentContext, type ComponentElement, ComponentHost, ComponentHostResolver, type ComponentProps, type ComponentType, ComputedCell, type ComputedOptions, type ConsoleEntry, type ControlledOptions, type ControlledValue, type CreateAppOptions, Define, type DeriveOptions, type DevtoolsEvent, type DevtoolsRequest, Each, type EachKey, type EachProps, type EditingMirrorTarget, EditingProxy, type EditingProxySink, EditingService, type EditingState, type EmitArgs, type EmitValue, type Equality, FanCell, type FanKey, FanOut, type FanOutOptions, FindService, FocusService, type FontFaceDeclaration, type FontFaceLike, type FontFamilyDeclaration, type FontFamilyStatus, type FontHost, FontService, type FrameEntry, type FrameMetrics, type FramePhaseTimings, FrameService, type FrameworkChild, type FunctionComponent, GessoApp, GessoAppBuilder, type GessoAppOptions, GessoRuntime, type GessoRuntimeOptions, IndexedDbStorage, type IndexedDbStorageOptions, Inject, Input, InputCell, type Inputs, InternalState, type JsonSchema, MARK_PREFIX, type MediaOptions, MediaService, type MediaSessionLike, MemoryStorage, type MessageEndpoint, type MutateOptions, type Mutation, type NodePathTarget, type OpfsDirectory, type OpfsFileHandle, OpfsStorage, type OpfsStorageOptions, type OpfsWritable, type OutletProps, Output, type OutputCell, type OutputTarget, type OverlayEntry, OverlayLayer, type OverlayPlacement, type OverlayRect, OverlayService, type Patch, type PatchEntry, type PatchPath, type PersistedOptions, PersistedState, type PortHandshake, type PortHost, Presence, type PresenceProps, ProvidedChannel, type ReadSource, type ReadableCell, RenderWorkerApp, type RendererChoice, Resource, type ResourceOptions, type ResourceState, type ResourceStatus, type RouteAnswer, type RouteContext, type RouteDefinition, type RouteGuard, type RouteMatch, type RouteOptions, type RouteParams, RouteState, type RouteTarget, type RouterHistorySink, RouterOutlet, type RouterRoutes, RouterService, type RuntimeErrorSource, type RuntimeInput, type RuntimeToShellMessage, ScrollService, type SelectOptions, SemanticsMirror, type SemanticsMirrorSink, type ServedChannel, ServiceRegistry, type ShellFile, type ShellFileRequest, type ShellFileResult, type ShellFileType, type ShellHistory, type ShellHistoryMode, type ShellHistoryOptions, type ShellLocalStore, type ShellRecentFile, type ShellRequest, ShellService, ShellStorage, type ShellStorageOp, type ShellStorageOptions, type ShellStorageResult, type ShellToRuntimeMessage, Show, type ShowProps, type SpringOptions, type StorageAdapter, type StorageOutcome, type StorageRead, TextService, ThemeTokenCell, UI_FRAME_PHASES, UI_ROLES, UI_SEMANTIC_STATES, type UiDuration, type UiEasingChoice, type UiEnvironmentReport, type UiFramePhase, type UiNodeReport, type UiOwnerReport, type UiPropOrigin, type UiPropReport, type UiRole, type UiSemanticState, type UiSemanticsMap, type UiSemanticsPatch, type UiSemanticsRecord, type UiSemanticsReport, type UiStreamReport, type UiTreeNode, type UiTreeSnapshot, type UndoShortcutOptions, UndoStack, type UndoStackOptions, type UndoTransaction, type UndoableOptions, type ViewOf, type WebMcpChoice, WorkerApp, type WorkerAppOptions, type WorkerHandle, applyPatch, applyPatches, audioClock, bind, bounds, buildPath, channel, channelSchema, classifyStorageError, computed, controlled, createApp, createChannelRegistry, createComponent, createShellHistory, createSyncApp, debounced, defineChannel, derive, describeChannel, describeStream, diffProjection, each, fanOut, findUnplainPath, formatAge, formatNodePath, formatNodeReport, formatStream, formatUrl, input, internalState, into, isChannelClientMessage, isChannelHostMessage, isClassComponent, isComponentElement, isHubMessage, isOutputTarget, isPortErrorMessage, isPortHandshake, markInstant, markNow, measureSpan, mutate, observeColorScheme, observeMediaQuery, observeReducedMotion, output, parseUrl, performShellStorage, performanceMarksEnabled, persisted, pick, pickKeys, portHandle, printPropValue, provide, registerUndoShortcuts, renderRoot, requirePlainData, resource, route, select, serve, serveChannels, servePorts, setPerformanceMarks, shellStorageDenied, show, storageErrorMessage, storageReadFailure, storageReadValue, structurallyEqual, themeTokenCell, throttled, to, treeText, undoable, viewKeys, workerHandle, writeClipboard };
|
|
3
|
+
import { C as InternalState, S as output, T as Component, _ as OutputTarget, a as ComponentType, b as into, c as Inputs, d as BoundsCell, f as bounds, g as OutputCell, h as InputCell, i as ComponentProps, l as isClassComponent, m as EmitValue, o as FunctionComponent, p as EmitArgs, r as ComponentContext, s as InputValue, t as ClassComponent, u as ChannelReplica, v as ReadableCell, w as internalState, x as isOutputTarget, y as input } from "./FunctionComponent-B1TJED62.js";
|
|
4
|
+
import { $ as StorageAdapter, $n as UiOwnerReport, $r as Resource, $t as FontFaceDeclaration, A as Presence, An as AudioState, Ar as Channel, At as ActionCause, B as PersistedOptions, Bn as ShellFileType, Br as bind, Bt as UiTreeSnapshot, C as FocusService, Cn as formatUrl, Cr as pickKeys, Ct as AppLogicEndpoint, D as FindService, Dn as AudioRequest, Dr as findUnplainPath, Dt as ShellHistoryMode, E as TextService, En as AudioMetadata, Er as createChannelRegistry, Et as ShellHistory, F as AudioSinkOptions, Fn as UiDuration, Fr as ControlledOptions, Ft as DevtoolsEvent, G as IndexedDbStorage, Gn as ShellStorageResult, Gr as EachKey, Gt as FrameMetrics, H as persisted, Hn as ShellRequest, Hr as ShowProps, Ht as RuntimeErrorSource, I as AudioSinkOutput, In as UiEasingChoice, Ir as ControlledValue, It as DevtoolsRequest, J as OpfsFileHandle, Jn as observeColorScheme, Jr as debounced, Jt as GessoRuntimeOptions, K as IndexedDbStorageOptions, Kn as ColorScheme, Kr as EachProps, Kt as FramePhaseTimings, L as MediaSessionLike, Ln as ShellFile, Lr as controlled, Lt as FrameEntry, M as RouterOutlet, Mn as AnimateOptions, Mr as Inject, Mt as ChannelErrorEntry, N as AudioElementLike, Nn as AnimationService, Nr as Input, Nt as CommandEntry, O as observeMediaQuery, On as AudioSample, Or as requirePlainData, Ot as ShellHistoryOptions, P as AudioSink, Pn as SpringOptions, Pr as Output, Pt as ConsoleEntry, Q as MemoryStorage, Qn as UiNodeReport, Qr as mutate, Qt as UiFramePhase, R as audioClock, Rn as ShellFileRequest, Rr as ThemeTokenCell, Rt as PatchEntry, S as writeClipboard, Sn as buildPath, Sr as pick, St as createApp, T as EditingService, Tn as AudioAction, Tr as ChannelRegistryHandle, Tt as WorkerAppOptions, U as ShellStorage, Un as ShellService, Ur as show, Ut as RuntimeToShellMessage, V as PersistedState, Vn as ShellRecentFile, Vr as Show, Vt as treeText, W as ShellStorageOptions, Wn as ShellStorageOp, Wr as Each, Wt as ShellToRuntimeMessage, X as OpfsStorageOptions, Xn as NodePathTarget, Xr as MutateOptions, Xt as RuntimeInput, Y as OpfsStorage, Yn as BoundStream, Yr as throttled, Yt as RendererChoice, Z as OpfsWritable, Zn as UiEnvironmentReport, Zr as Mutation, Zt as UI_FRAME_PHASES, _ as EditingMirrorTarget, _i as derive, _n as RouteOptions, _r as createComponent, _t as GessoAppOptions, a as UiRole, ai as select, an as MediaOptions, ar as formatAge, at as storageReadValue, b as EditingProxy, bn as to, br as isComponentElement, bt as WebMcpChoice, c as UiSemanticsPatch, ci as FanOut, cn as RouteMatch, cr as formatStream, ct as UndoableOptions, d as markNow, di as ComputedCell, dn as RouterService, dr as ComponentHost, dt as UndoStackOptions, ei as ResourceOptions, en as FontFaceLike, er as UiPropOrigin, et as StorageOutcome, f as measureSpan, fi as ComputedOptions, fn as RouteState, fr as OverlayLayer, ft as UndoTransaction, g as renderRoot, gi as Equality, gn as RouteGuard, gr as OverlayService, gt as GessoApp, h as RenderWorkerApp, hi as DeriveOptions, hn as RouteDefinition, hr as OverlayRect, ht as shellStorageDenied, i as UI_SEMANTIC_STATES, ii as SelectOptions, in as FontService, ir as describeStream, it as storageReadFailure, j as PresenceProps, jn as AudioStatus, jr as Define, jt as ActionEntry, k as observeReducedMotion, kn as AudioService, kr as ChannelRegistry, kt as createShellHistory, l as UiSemanticsRecord, li as FanOutOptions, ln as RouterHistorySink, lr as printPropValue, lt as undoable, m as setPerformanceMarks, mi as computed, mn as RouteContext, mr as OverlayPlacement, mt as performShellStorage, n as MARK_PREFIX, ni as ResourceStatus, nn as FontFamilyStatus, nr as UiSemanticsReport, nt as classifyStorageError, o as UiSemanticState, oi as FanCell, on as MediaService, or as formatNodePath, ot as UndoShortcutOptions, p as performanceMarksEnabled, pi as ReadSource, pn as OutletProps, pr as OverlayEntry, pt as ShellLocalStore, q as OpfsDirectory, qn as ColorSchemePreference, qr as each, qt as GessoRuntime, r as UI_ROLES, ri as resource, rn as FontHost, rr as UiStreamReport, rt as storageErrorMessage, s as UiSemanticsMap, si as FanKey, sn as RouteAnswer, sr as formatNodeReport, st as registerUndoShortcuts, t as EditingState, ti as ResourceState, tn as FontFamilyDeclaration, tr as UiPropReport, tt as StorageRead, u as markInstant, ui as fanOut, un as RouterRoutes, ur as ComponentHostResolver, ut as UndoStack, v as SemanticsMirror, vi as ServiceRegistry, vn as RouteTarget, vr as ComponentElement, vt as createSyncApp, w as ScrollService, wn as parseUrl, wr as ChannelRegistration, wt as WorkerApp, x as EditingProxySink, xn as RouteParams, xr as structurallyEqual, xt as CreateAppOptions, y as SemanticsMirrorSink, yn as route, yr as FrameworkChild, yt as GessoAppBuilder, z as FrameService, zn as ShellFileResult, zr as themeTokenCell, zt as UiTreeNode } from "./index-D7J6_IUk.js";
|
|
5
|
+
export { APPLICATION_WORKER, type ActionCause, type ActionEntry, type AnimateOptions, AnimationService, type AppLogicEndpoint, type AudioAction, type AudioElementLike, type AudioMetadata, type AudioRequest, type AudioSample, AudioService, AudioSink, type AudioSinkOptions, type AudioSinkOutput, type AudioState, type AudioStatus, type BoundStream, BoundsCell, Channel, type ChannelClientMessage, type ChannelErrorEntry, type ChannelHostMessage, type ChannelPort, type ChannelRegistration, ChannelRegistry, type ChannelRegistryHandle, ChannelReplica, type ChannelSchema, type ChannelSource, type ChannelSpec, type ChannelToken, type ClassComponent, type ColorScheme, type ColorSchemePreference, type Command, type CommandEntry, type CommandMap, type CommandSchema, type CommandsOf, Component, type ComponentContext, type ComponentElement, ComponentHost, ComponentHostResolver, type ComponentProps, type ComponentType, ComputedCell, type ComputedOptions, type ConsoleEntry, type ControlledOptions, type ControlledValue, type CreateAppOptions, Define, type DeriveOptions, type DevtoolsEvent, type DevtoolsRequest, Each, type EachKey, type EachProps, type EditingMirrorTarget, EditingProxy, type EditingProxySink, EditingService, type EditingState, type EmitArgs, type EmitValue, type Equality, FanCell, type FanKey, FanOut, type FanOutOptions, FindService, FocusService, type FontFaceDeclaration, type FontFaceLike, type FontFamilyDeclaration, type FontFamilyStatus, type FontHost, FontService, type FrameEntry, type FrameMetrics, type FramePhaseTimings, FrameService, type FrameworkChild, type FunctionComponent, GessoApp, GessoAppBuilder, type GessoAppOptions, GessoRuntime, type GessoRuntimeOptions, IndexedDbStorage, type IndexedDbStorageOptions, Inject, Input, InputCell, type InputValue, type Inputs, InternalState, type JsonSchema, MARK_PREFIX, type MediaOptions, MediaService, type MediaSessionLike, MemoryStorage, type MessageEndpoint, type MutateOptions, type Mutation, type NodePathTarget, type OpfsDirectory, type OpfsFileHandle, OpfsStorage, type OpfsStorageOptions, type OpfsWritable, type OutletProps, Output, type OutputCell, type OutputTarget, type OverlayEntry, OverlayLayer, type OverlayPlacement, type OverlayRect, OverlayService, type Patch, type PatchEntry, type PatchPath, type PersistedOptions, PersistedState, type PortHandshake, type PortHost, Presence, type PresenceProps, ProvidedChannel, type ReadSource, type ReadableCell, RenderWorkerApp, type RendererChoice, Resource, type ResourceOptions, type ResourceState, type ResourceStatus, type RouteAnswer, type RouteContext, type RouteDefinition, type RouteGuard, type RouteMatch, type RouteOptions, type RouteParams, RouteState, type RouteTarget, type RouterHistorySink, RouterOutlet, type RouterRoutes, RouterService, type RuntimeErrorSource, type RuntimeInput, type RuntimeToShellMessage, ScrollService, type SelectOptions, SemanticsMirror, type SemanticsMirrorSink, type ServedChannel, ServiceRegistry, type ShellFile, type ShellFileRequest, type ShellFileResult, type ShellFileType, type ShellHistory, type ShellHistoryMode, type ShellHistoryOptions, type ShellLocalStore, type ShellRecentFile, type ShellRequest, ShellService, ShellStorage, type ShellStorageOp, type ShellStorageOptions, type ShellStorageResult, type ShellToRuntimeMessage, Show, type ShowProps, type SpringOptions, type StorageAdapter, type StorageOutcome, type StorageRead, TextService, ThemeTokenCell, UI_FRAME_PHASES, UI_ROLES, UI_SEMANTIC_STATES, type UiDuration, type UiEasingChoice, type UiEnvironmentReport, type UiFramePhase, type UiNodeReport, type UiOwnerReport, type UiPropOrigin, type UiPropReport, type UiRole, type UiSemanticState, type UiSemanticsMap, type UiSemanticsPatch, type UiSemanticsRecord, type UiSemanticsReport, type UiStreamReport, type UiTreeNode, type UiTreeSnapshot, type UndoShortcutOptions, UndoStack, type UndoStackOptions, type UndoTransaction, type UndoableOptions, type ViewOf, type WebMcpChoice, WorkerApp, type WorkerAppOptions, type WorkerHandle, applyPatch, applyPatches, audioClock, bind, bounds, buildPath, channel, channelSchema, classifyStorageError, computed, controlled, createApp, createChannelRegistry, createComponent, createShellHistory, createSyncApp, debounced, defineChannel, derive, describeChannel, describeStream, diffProjection, each, fanOut, findUnplainPath, formatAge, formatNodePath, formatNodeReport, formatStream, formatUrl, input, internalState, into, isChannelClientMessage, isChannelHostMessage, isClassComponent, isComponentElement, isHubMessage, isOutputTarget, isPortErrorMessage, isPortHandshake, markInstant, markNow, measureSpan, mutate, observeColorScheme, observeMediaQuery, observeReducedMotion, output, parseUrl, performShellStorage, performanceMarksEnabled, persisted, pick, pickKeys, portHandle, printPropValue, provide, registerUndoShortcuts, renderRoot, requirePlainData, resource, route, select, serve, serveChannels, servePorts, setPerformanceMarks, shellStorageDenied, show, storageErrorMessage, storageReadFailure, storageReadValue, structurallyEqual, themeTokenCell, throttled, to, treeText, undoable, viewKeys, workerHandle, writeClipboard };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { A as output, C as equalityOf, D as input, E as InputCell, M as trackRead, N as withBodyOf, O as into, S as derive, T as internalState, _ as Resource, a as undoable, b as ComputedCell, c as classifyStorageError, d as storageReadValue, f as pick, g as mutate, h as throttled, i as OpfsStorage, j as outputTargetOf, k as isOutputTarget, l as storageErrorMessage, m as debounced, n as persisted, o as UndoStack, p as pickKeys, r as IndexedDbStorage, s as MemoryStorage, t as PersistedState, u as storageReadFailure, v as resource, w as InternalState, x as computed, y as select } from "./persisted-
|
|
2
|
-
import {
|
|
1
|
+
import { A as output, C as equalityOf, D as input, E as InputCell, M as trackRead, N as withBodyOf, O as into, S as derive, T as internalState, _ as Resource, a as undoable, b as ComputedCell, c as classifyStorageError, d as storageReadValue, f as pick, g as mutate, h as throttled, i as OpfsStorage, j as outputTargetOf, k as isOutputTarget, l as storageErrorMessage, m as debounced, n as persisted, o as UndoStack, p as pickKeys, r as IndexedDbStorage, s as MemoryStorage, t as PersistedState, u as storageReadFailure, v as resource, w as InternalState, x as computed, y as select } from "./persisted-m5v2fOju.js";
|
|
2
|
+
import { C as isChannelClientMessage, D as viewKeys, E as defineChannel, O as structurallyEqual, S as diffProjection, T as channel, _ as printPropValue, a as isPortErrorMessage, b as applyPatch, c as servePorts, d as isConsoleEntryMessage, f as describeStream, g as formatStream, h as formatNodeReport, i as isHubMessage, l as workerHandle, m as formatNodePath, n as serveChannels, o as isPortHandshake, p as formatAge, r as APPLICATION_WORKER, s as portHandle, t as serve, u as captureConsole, v as ProvidedChannel, w as isChannelHostMessage, x as applyPatches, y as provide } from "./serveChannels-DN2R2s0A.js";
|
|
3
3
|
import { a as Each, i as show, n as getComponentMetadata, o as each, r as Show, t as createComponent } from "./createComponent-3n1ZSql8.js";
|
|
4
|
-
import { c as
|
|
5
|
-
import { n as serveApplicationAgent } from "./app-
|
|
4
|
+
import { c as findUnplainPath, d as describeChannel, l as requirePlainData, t as AGENT_PORT, u as channelSchema } from "./remote-CSdwpwXz.js";
|
|
5
|
+
import { n as serveApplicationAgent } from "./app-NLcQF2Oh.js";
|
|
6
6
|
import { BehaviorSubject, EMPTY, Observable, Subject, Subscription, distinctUntilChanged, map } from "rxjs";
|
|
7
|
-
import { AnimationDriver, Box, Canvas2DRenderer, CanvasPlatformSurface, CanvasTextMeasurer, Constraints, DefaultImageResolver, DefaultVideoResolver, DirtyFlags, EnvironmentNotifier, FocusNotifier, IconRasterizer, LayoutEngine, LayoutInspector, LayoutNotifier, MARK_PREFIX, Stack, TEXT_RUN_ID_SEPARATOR, UI_ROLES, UI_SEMANTIC_STATES, UiAnimationFrameClock, UiEditingController, UiEnvironmentKeys, UiEventType, UiFindController, UiFocusManager, UiGestureRecognizer, UiGraph, UiGraphBuilder, UiHitTester, UiHostFrameClock, UiInputDispatcher, UiInsetRegistry, UiKeyboardController, UiNodeType, UiPlatformAdapter, UiPointerController, UiPointerEvent, UiScheduler, UiSelectionController, UiSharedElements, UiSpring, UiTimerFrameClock, UiTouchScroller, UiVirtualSheet, UiVirtualWindow, UiWheelController, VIRTUAL_INDEX_PROP, VIRTUAL_LEAD_PROP, VIRTUAL_SHEET_PROP, VIRTUAL_WINDOW_PROP, WebGPURenderer, buildSemanticsSubtree, buildSemanticsTree, bumpFontStack, capturePointer, createCanvasSurface, createTween, createWebGPUSurface, defaultMotion, defineModifier, describeOverrides, diffSemantics, dragSessionFor, dropIndexShifts, easings, fade, formatExplanation, insetsEqual, isComponentLikeElement, isObservable, isWebGPUAvailable, linear, linkOf, markInstant, markNow, measure, measureSpan, motion, noInsets, observeViewportInsets, percent, performanceMarksEnabled, pointerDeviceOf, prepareInputSurface, propertyEffects, recordsEqual, registerFontStack, resolveCursor, rewalkSemantics, scrollRange, scrollbarThumb, semanticsInertAbove, semanticsMemory, setPerformanceMarks, setPerformanceMarks as setPerformanceMarks$1, textRunOfRecordId, themeTokens, touchActionFor, wheelDeltaYOf } from "gesso-core";
|
|
7
|
+
import { AnimationDriver, Box, Canvas2DRenderer, CanvasPlatformSurface, CanvasTextMeasurer, Constraints, DefaultImageResolver, DefaultVideoResolver, DirtyFlags, EnvironmentNotifier, FocusNotifier, IconRasterizer, LayoutEngine, LayoutInspector, LayoutNotifier, MARK_PREFIX, Stack, TEXT_RUN_ID_SEPARATOR, UI_ROLES, UI_SEMANTIC_STATES, UiAnimationFrameClock, UiEditingController, UiEnvironmentKeys, UiEventType, UiFindController, UiFocusManager, UiGestureRecognizer, UiGraph, UiGraphBuilder, UiHitTester, UiHostFrameClock, UiInputDispatcher, UiInsetRegistry, UiKeyboardController, UiNodeType, UiPlatformAdapter, UiPointerController, UiPointerEvent, UiScheduler, UiSelectionController, UiSharedElements, UiSpring, UiTimerFrameClock, UiTouchScroller, UiVirtualSheet, UiVirtualWindow, UiWheelController, VIRTUAL_INDEX_PROP, VIRTUAL_LEAD_PROP, VIRTUAL_SHEET_PROP, VIRTUAL_WINDOW_PROP, WebGPURenderer, buildSemanticsSubtree, buildSemanticsTree, bumpFontStack, capturePointer, createCanvasSurface, createTween, createWebGPUSurface, defaultMotion, defineModifier, describeOverrides, diffSemantics, dragSessionFor, dropIndexShifts, easings, fade, formatExplanation, insetsEqual, isComponentLikeElement, isImeKey, isObservable, isWebGPUAvailable, linear, linkOf, markInstant, markNow, measure, measureSpan, motion, noInsets, observeViewportInsets, percent, performanceMarksEnabled, pointerDeviceOf, prepareInputSurface, propertyEffects, recordsEqual, registerFontStack, resolveCursor, rewalkSemantics, scrollRange, scrollbarThumb, semanticsInertAbove, semanticsMemory, setPerformanceMarks, setPerformanceMarks as setPerformanceMarks$1, textRunOfRecordId, themeTokens, touchActionFor, wheelDeltaYOf } from "gesso-core";
|
|
8
8
|
//#region src/Component.ts
|
|
9
9
|
/**
|
|
10
10
|
* Base class for all Gesso framework components.
|
|
@@ -3014,13 +3014,13 @@ var EditingProxy = class {
|
|
|
3014
3014
|
const state = this.state;
|
|
3015
3015
|
if (clipboard === null || state === null) return;
|
|
3016
3016
|
event.preventDefault();
|
|
3017
|
-
clipboard.setData("text/plain", state.text.slice(state.selectionStart, state.selectionEnd));
|
|
3017
|
+
clipboard.setData("text/plain", state.clipboard ?? state.text.slice(state.selectionStart, state.selectionEnd));
|
|
3018
3018
|
if (state.html !== void 0) clipboard.setData("text/html", state.html);
|
|
3019
3019
|
};
|
|
3020
3020
|
const onCut = (event) => {
|
|
3021
3021
|
const state = this.state;
|
|
3022
3022
|
onCopy(event);
|
|
3023
|
-
if (state !== null && state.selectionEnd > state.selectionStart) this.sink.beforeInput("deleteByCut", null);
|
|
3023
|
+
if (state !== null && (state.clipboard !== void 0 ? state.clipboard.length > 0 : state.selectionEnd > state.selectionStart)) this.sink.beforeInput("deleteByCut", null);
|
|
3024
3024
|
};
|
|
3025
3025
|
const onKeyDown = (event) => {
|
|
3026
3026
|
this.sink.keyDown?.(event);
|
|
@@ -4230,6 +4230,35 @@ function openUrlWith(handler, url) {
|
|
|
4230
4230
|
}
|
|
4231
4231
|
window.open(url, "_blank", "noopener,noreferrer");
|
|
4232
4232
|
}
|
|
4233
|
+
/**
|
|
4234
|
+
* What to say when the browser fails a worker at the worker object,
|
|
4235
|
+
* before the worker could say anything itself.
|
|
4236
|
+
*
|
|
4237
|
+
* Two different failures arrive this way. An exception thrown while the
|
|
4238
|
+
* worker's modules were evaluating is an `ErrorEvent` with a message,
|
|
4239
|
+
* and the message is the useful part. A script that never loaded at all
|
|
4240
|
+
* is a plain `Event` with no message and no filename, and the browser
|
|
4241
|
+
* says nothing more about it anywhere a script can read: the reason is
|
|
4242
|
+
* only in the network panel. That case used to be reported as "failed
|
|
4243
|
+
* to start: undefined", so it now says where to look and what the
|
|
4244
|
+
* usual reasons are. The last one is easy to hit: turn on
|
|
4245
|
+
* `Cross-Origin-Embedder-Policy` and a worker script the browser cached
|
|
4246
|
+
* before is refused, because a dev server's 304 does not repeat the
|
|
4247
|
+
* header.
|
|
4248
|
+
*/
|
|
4249
|
+
function workerFailureMessage(worker, event) {
|
|
4250
|
+
const name = worker === "render" ? "the render worker" : "the app worker";
|
|
4251
|
+
if (hasMessage(event)) {
|
|
4252
|
+
const filename = event.filename;
|
|
4253
|
+
const where = filename === void 0 || filename === "" ? "" : ` (${filename})`;
|
|
4254
|
+
return `${name} failed to start: ${event.message}${where}`;
|
|
4255
|
+
}
|
|
4256
|
+
return `${name} failed to start: its script did not load. The browser's network panel has the reason; usually the file is missing (404), is served with a MIME type that is not JavaScript, or was refused under the page's Cross-Origin-Embedder-Policy (including a copy cached before the policy was turned on; a hard reload clears it).`;
|
|
4257
|
+
}
|
|
4258
|
+
function hasMessage(event) {
|
|
4259
|
+
const message = event.message;
|
|
4260
|
+
return typeof message === "string" && message !== "";
|
|
4261
|
+
}
|
|
4233
4262
|
function resolveAppLogic(spec) {
|
|
4234
4263
|
if (typeof spec === "function") return {
|
|
4235
4264
|
endpoint: spec(),
|
|
@@ -4384,6 +4413,7 @@ var WorkerApp = class {
|
|
|
4384
4413
|
this.appLogicWorker = application;
|
|
4385
4414
|
this.ownsAppLogicWorker = resolved.owned;
|
|
4386
4415
|
application.addEventListener("message", this.handleAppWorkerMessage);
|
|
4416
|
+
if (resolved.owned) application.addEventListener("error", this.handleAppWorkerFailure);
|
|
4387
4417
|
application.start?.();
|
|
4388
4418
|
if (this.consoleForwarding) application.postMessage({
|
|
4389
4419
|
type: "gesso:console",
|
|
@@ -4462,7 +4492,7 @@ var WorkerApp = class {
|
|
|
4462
4492
|
})
|
|
4463
4493
|
}, this.proxy);
|
|
4464
4494
|
const webmcp = this.options.webmcp;
|
|
4465
|
-
if (webmcp !== void 0 && webmcp !== false) import("./webmcp-
|
|
4495
|
+
if (webmcp !== void 0 && webmcp !== false) import("./webmcp-BvQBxNjX.js").then((n) => n.a).then((agent) => agent.connectWebMcp(this, webmcp === true ? {} : webmcp)).then((disconnect) => {
|
|
4466
4496
|
if (this.renderWorker === worker) this.disconnectWebMcp = disconnect;
|
|
4467
4497
|
else disconnect();
|
|
4468
4498
|
}, (error) => console.warn("[gesso] WebMCP could not register the channels:", error));
|
|
@@ -4488,8 +4518,22 @@ var WorkerApp = class {
|
|
|
4488
4518
|
handleWorkerFailure = (event) => {
|
|
4489
4519
|
event.preventDefault();
|
|
4490
4520
|
if (this.ready) return;
|
|
4491
|
-
|
|
4492
|
-
|
|
4521
|
+
this.report(workerFailureMessage("render", event), void 0, "uncaught");
|
|
4522
|
+
};
|
|
4523
|
+
/**
|
|
4524
|
+
* The app worker's counterpart, for the one failure nothing else
|
|
4525
|
+
* reports: a script that never loaded. Without this, an app worker
|
|
4526
|
+
* blocked by a 404 or by the page's embedder policy left the screen
|
|
4527
|
+
* waiting on channels that would never arrive, and said nothing.
|
|
4528
|
+
*
|
|
4529
|
+
* An exception inside the app worker arrives here too, with a
|
|
4530
|
+
* message, and is left alone: the browser reports it from inside the
|
|
4531
|
+
* worker with its stack, which is better than anything said here.
|
|
4532
|
+
*/
|
|
4533
|
+
handleAppWorkerFailure = (event) => {
|
|
4534
|
+
if (hasMessage(event)) return;
|
|
4535
|
+
event.preventDefault();
|
|
4536
|
+
this.report(workerFailureMessage("app", event), void 0, "uncaught");
|
|
4493
4537
|
};
|
|
4494
4538
|
/** Reports an error, to `onError` or to the console it defaults to. */
|
|
4495
4539
|
report(message, stack, source) {
|
|
@@ -4513,22 +4557,26 @@ var WorkerApp = class {
|
|
|
4513
4557
|
* the first letter opens lives in exactly that gap.
|
|
4514
4558
|
*/
|
|
4515
4559
|
forwardKeyDown(event, viaProxy = false) {
|
|
4560
|
+
if (isImeKey(event)) return;
|
|
4516
4561
|
this.flushPendingMove();
|
|
4517
4562
|
if (this.options.interceptFind === true && isFind(event) || this.options.interceptKey?.(event) === true) event.preventDefault();
|
|
4518
4563
|
if (event.key === "Tab" || isSelectAll(event)) event.preventDefault();
|
|
4519
4564
|
this.post({
|
|
4520
4565
|
type: "keyDown",
|
|
4521
4566
|
key: event.key,
|
|
4567
|
+
code: event.code,
|
|
4522
4568
|
modifiers: modifiersFrom(event),
|
|
4523
4569
|
at: epochFromEvent(event),
|
|
4524
4570
|
textFollows: viaProxy
|
|
4525
4571
|
});
|
|
4526
4572
|
}
|
|
4527
4573
|
forwardKeyUp(event) {
|
|
4574
|
+
if (isImeKey(event)) return;
|
|
4528
4575
|
this.flushPendingMove();
|
|
4529
4576
|
this.post({
|
|
4530
4577
|
type: "keyUp",
|
|
4531
4578
|
key: event.key,
|
|
4579
|
+
code: event.code,
|
|
4532
4580
|
modifiers: modifiersFrom(event),
|
|
4533
4581
|
at: epochFromEvent(event)
|
|
4534
4582
|
});
|
|
@@ -4669,7 +4717,10 @@ var WorkerApp = class {
|
|
|
4669
4717
|
this.renderWorker = void 0;
|
|
4670
4718
|
}
|
|
4671
4719
|
this.appLogicWorker?.removeEventListener("message", this.handleAppWorkerMessage);
|
|
4672
|
-
if (this.ownsAppLogicWorker)
|
|
4720
|
+
if (this.ownsAppLogicWorker) {
|
|
4721
|
+
this.appLogicWorker?.removeEventListener("error", this.handleAppWorkerFailure);
|
|
4722
|
+
this.appLogicWorker?.terminate();
|
|
4723
|
+
}
|
|
4673
4724
|
this.appLogicWorker = void 0;
|
|
4674
4725
|
this.ownsAppLogicWorker = false;
|
|
4675
4726
|
if (this.canvas !== void 0 && this.canvas.parentElement === this.host) this.host?.removeChild(this.canvas);
|
|
@@ -9798,7 +9849,7 @@ function timeOrigin() {
|
|
|
9798
9849
|
}
|
|
9799
9850
|
function editingStatesEqual(a, b) {
|
|
9800
9851
|
if (a === null || b === null) return a === b;
|
|
9801
|
-
return a.text === b.text && a.selectionStart === b.selectionStart && a.selectionEnd === b.selectionEnd && a.multiline === b.multiline && a.composing === b.composing && a.html === b.html && a.caret.x === b.caret.x && a.caret.y === b.caret.y && a.caret.width === b.caret.width && a.caret.height === b.caret.height;
|
|
9852
|
+
return a.text === b.text && a.selectionStart === b.selectionStart && a.selectionEnd === b.selectionEnd && a.multiline === b.multiline && a.composing === b.composing && a.html === b.html && a.clipboard === b.clipboard && a.caret.x === b.caret.x && a.caret.y === b.caret.y && a.caret.width === b.caret.width && a.caret.height === b.caret.height;
|
|
9802
9853
|
}
|
|
9803
9854
|
/** A canvas for the text measurer when the draw canvas is not a 2D one. */
|
|
9804
9855
|
function createMeasureCanvas() {
|
|
@@ -10632,7 +10683,7 @@ var GessoAppBuilder = class {
|
|
|
10632
10683
|
if (app === void 0 || key !== "gesso:agent") return;
|
|
10633
10684
|
const pair = new MessageChannel();
|
|
10634
10685
|
const registrations = this.channelRegistrations;
|
|
10635
|
-
import("./app-
|
|
10686
|
+
import("./app-NLcQF2Oh.js").then((n) => n.t).then((agent) => agent.serveApplicationAgent(pair.port2, {
|
|
10636
10687
|
channels: () => registrations.filter((registration) => registration.source !== void 0).map((registration) => ({
|
|
10637
10688
|
token: registration.token,
|
|
10638
10689
|
source: registration.source
|
|
@@ -10645,7 +10696,7 @@ var GessoAppBuilder = class {
|
|
|
10645
10696
|
connectWebMcp(app) {
|
|
10646
10697
|
const choice = this.webmcpChoice;
|
|
10647
10698
|
if (choice === false) return;
|
|
10648
|
-
import("./webmcp-
|
|
10699
|
+
import("./webmcp-BvQBxNjX.js").then((n) => n.a).then((agent) => agent.connectWebMcp(this, choice === true ? {} : choice)).then((disconnect) => {
|
|
10649
10700
|
if (this.app === app) this.disconnectWebMcp = disconnect;
|
|
10650
10701
|
else disconnect();
|
|
10651
10702
|
}, (error) => console.warn("[gesso] WebMCP could not register the channels:", error));
|
|
@@ -11474,10 +11525,10 @@ var RenderWorkerApp = class {
|
|
|
11474
11525
|
runtime.input.wheel.wheel(message.x, message.y, message.deltaX, message.deltaY, message.modifiers, message.deltaMode, message.wheelDeltaY, message.at === void 0 ? void 0 : message.at - performance.timeOrigin);
|
|
11475
11526
|
break;
|
|
11476
11527
|
case "keyDown":
|
|
11477
|
-
runtime.input.keyboard.keyDown(message.key, message.modifiers, message.textFollows);
|
|
11528
|
+
runtime.input.keyboard.keyDown(message.key, message.modifiers, message.textFollows, message.code);
|
|
11478
11529
|
break;
|
|
11479
11530
|
case "keyUp":
|
|
11480
|
-
runtime.input.keyboard.keyUp(message.key, message.modifiers);
|
|
11531
|
+
runtime.input.keyboard.keyUp(message.key, message.modifiers, message.code);
|
|
11481
11532
|
break;
|
|
11482
11533
|
case "beforeInput":
|
|
11483
11534
|
runtime.input.editing.beforeInput(message.inputType, message.data);
|