gesso-framework 0.6.6 → 0.6.8
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 +18 -0
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +3 -3
- package/dist/{app-BvlIO1G9.js → app-bMsNOs1H.js} +2 -2
- package/dist/{app-BvlIO1G9.js.map → app-bMsNOs1H.js.map} +1 -1
- package/dist/{index-B8PU7Cf0.d.ts → index-D5bW2GUt.d.ts} +16 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/{persisted-pix1fS1D.js → persisted-i6TIWX8R.js} +5 -952
- package/dist/persisted-i6TIWX8R.js.map +1 -0
- package/dist/remote/index.d.ts +198 -0
- package/dist/remote/index.js +301 -0
- package/dist/remote/index.js.map +1 -0
- package/dist/{remote-xxij8zXe.js → remote-gRdwYo-q.js} +19 -4
- package/dist/remote-gRdwYo-q.js.map +1 -0
- package/dist/serveChannels-Cs22-p8X.js +952 -0
- package/dist/serveChannels-Cs22-p8X.js.map +1 -0
- package/dist/{ui-U39HjNFA.d.ts → ui-Bs6ywsAA.d.ts} +3 -2
- package/dist/{webmcp-CJVFvAHe.js → webmcp-F3OOy73w.js} +2 -2
- package/dist/{webmcp-CJVFvAHe.js.map → webmcp-F3OOy73w.js.map} +1 -1
- package/dist/worker/index.d.ts +2 -2
- package/dist/worker/index.js +2 -1
- package/package.json +6 -2
- package/dist/persisted-pix1fS1D.js.map +0 -1
- package/dist/remote-xxij8zXe.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# gesso-framework
|
|
2
2
|
|
|
3
|
+
## 0.6.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a7bb34e: `ShellService.saveFile` takes `remember: false`, for a file made to keep rather than to open again — an exported picture, a report. It is written where the picker says, as any save is, but does not join the recent files, and its answer has no handle to save back to.
|
|
8
|
+
- gesso-core@0.6.8
|
|
9
|
+
|
|
10
|
+
## 0.6.7
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 6493881: An agent that sends a command now gets the view after the command's effect, even when that effect takes longer than `quietMs` to arrive. Before, the call returned as soon as the view had been quiet for `quietMs` (50 ms by default), and a command that waits on a request (a fetch, a subprocess, a database) had usually changed nothing by then, so the agent was handed the view from before its own command and could conclude it had done nothing. Quiet now counts only once the view has changed since the command was sent. The cost is that a command which changes nothing in the view at all now returns at `settleMs` (1000 ms by default) rather than at `quietMs`.
|
|
15
|
+
- 4f622ec: Channels can now be served from another process without Electrobun. The bridge that carried a desktop window's channels to and from the main process has moved to `gesso-framework/remote`, under names that say what it is: `createRemoteBridge` in the page and `serveRemoteChannels` in the process that owns the data, with the frame format (`GessoFrame`, `frameData`, `FrameAssembler`, `isGessoFrame`, `DEFAULT_CHUNK_BYTES`) beside them. Neither half knows its transport; each takes a `send` function and has a `receive` method, so a web application whose data lives in a server on the person's machine can carry its channels over a WebSocket. The new page "Channels from another process" shows it end to end.
|
|
16
|
+
|
|
17
|
+
`gesso-electrobun` keeps every name it had: `createElectrobunBridge`, `serveChannelsToWindow`, `ChannelHost`, `ElectrobunBridge` and the frame exports are now re-exports of the same code, so a desktop application needs no change.
|
|
18
|
+
|
|
19
|
+
- gesso-core@0.6.7
|
|
20
|
+
|
|
3
21
|
## 0.6.6
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as WorkerHandle, F as JsonSchema, a as resolveTarget, c as AgentResource, d as AgentSurfaceOptions, f as AgentTool, g as ServedChannel, h as resourceUri, i as outline, l as AgentSurface, m as agentSurface, n as UiRefs, o as uiSurface, p as AgentToolResult, r as UiSurfaceOptions, s as AgentConfirmation, t as UiHost, u as AgentSurfaceLike } from "../ui-
|
|
1
|
+
import { E as WorkerHandle, F as JsonSchema, a as resolveTarget, c as AgentResource, d as AgentSurfaceOptions, f as AgentTool, g as ServedChannel, h as resourceUri, i as outline, l as AgentSurface, m as agentSurface, n as UiRefs, o as uiSurface, p as AgentToolResult, r as UiSurfaceOptions, s as AgentConfirmation, t as UiHost, u as AgentSurfaceLike } from "../ui-Bs6ywsAA.js";
|
|
2
2
|
//#region src/agent/mcp.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* An agent surface, served over the Model Context Protocol.
|
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-gRdwYo-q.js";
|
|
2
|
+
import { a as resolveTarget, i as outline, n as serveApplicationAgent, o as uiSurface, r as UiRefs } from "../app-bMsNOs1H.js";
|
|
3
|
+
import { i as registerWebMcpTools, n as connectWebMcp, r as pageModelContext, t as confirmInWindow } from "../webmcp-F3OOy73w.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-gRdwYo-q.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-bMsNOs1H.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-BvlIO1G9.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;E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,EAAE;EAAC,CAAC;CACvG,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"app-bMsNOs1H.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(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AE,CAAC,CACZ,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,5 +1,5 @@
|
|
|
1
1
|
import { f as ChannelToken, m as CommandMap, o as Patch, p as Command, r as ChannelPort } from "./ChannelProtocol-ByNoHujM.js";
|
|
2
|
-
import { E as WorkerHandle, s as AgentConfirmation, t as UiHost, y as ChannelSource } from "./ui-
|
|
2
|
+
import { E as WorkerHandle, s as AgentConfirmation, t as UiHost, y as ChannelSource } from "./ui-Bs6ywsAA.js";
|
|
3
3
|
import { S as InternalState, _ as ReadableCell, a as ComponentType, h as OutputCell, i as ComponentProps, l as ChannelReplica, m as InputCell, n as ComponentArgs, r as ComponentContext, s as Inputs, w as Component } from "./FunctionComponent-fYMdePtH.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";
|
|
@@ -1750,6 +1750,13 @@ type ShellFileRequest =
|
|
|
1750
1750
|
readonly bytes?: Uint8Array<ArrayBuffer>;
|
|
1751
1751
|
readonly handle?: number;
|
|
1752
1752
|
readonly accept: readonly ShellFileType[];
|
|
1753
|
+
/**
|
|
1754
|
+
* Whether a file saved through the picker joins the recent files
|
|
1755
|
+
* and gets a handle to save back to. Absent is true; an export —
|
|
1756
|
+
* a picture, a report — is false, so it is not offered for
|
|
1757
|
+
* opening as though it were a document.
|
|
1758
|
+
*/
|
|
1759
|
+
readonly remember?: boolean;
|
|
1753
1760
|
} |
|
|
1754
1761
|
/** The files the shell remembers, most recently used first. */
|
|
1755
1762
|
{
|
|
@@ -2144,6 +2151,13 @@ declare class ShellService {
|
|
|
2144
2151
|
readonly mediaType?: string;
|
|
2145
2152
|
readonly handle?: number;
|
|
2146
2153
|
readonly accept?: readonly ShellFileType[];
|
|
2154
|
+
/**
|
|
2155
|
+
* Whether the file joins the recent files, with a handle to save
|
|
2156
|
+
* back to. True unless said otherwise; false for a file made to
|
|
2157
|
+
* keep rather than to open again — an exported picture — whose
|
|
2158
|
+
* answer then has no handle.
|
|
2159
|
+
*/
|
|
2160
|
+
readonly remember?: boolean;
|
|
2147
2161
|
}): Promise<ShellFileResult>;
|
|
2148
2162
|
/** The files the shell remembers, most recently used first. */
|
|
2149
2163
|
recentFiles(): Promise<ShellFileResult>;
|
|
@@ -8439,4 +8453,4 @@ declare class RenderWorkerApp {
|
|
|
8439
8453
|
}
|
|
8440
8454
|
//#endregion
|
|
8441
8455
|
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 };
|
|
8442
|
-
//# sourceMappingURL=index-
|
|
8456
|
+
//# sourceMappingURL=index-D5bW2GUt.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
|
-
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-
|
|
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-Bs6ywsAA.js";
|
|
3
3
|
import { C as internalState, S as InternalState, _ as ReadableCell, a as ComponentType, b as isOutputTarget, c as isClassComponent, d as bounds, f as EmitArgs, g as OutputTarget, h as OutputCell, i as ComponentProps, l as ChannelReplica, m as InputCell, o as FunctionComponent, p as EmitValue, r as ComponentContext, s as Inputs, t as ClassComponent, u as BoundsCell, v as input, w as Component, x as output, y as into } from "./FunctionComponent-fYMdePtH.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-
|
|
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-D5bW2GUt.js";
|
|
5
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 };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
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-i6TIWX8R.js";
|
|
2
|
+
import { A as structurallyEqual, C as applyPatches, D as channel, E as isChannelHostMessage, O as defineChannel, S as applyPatch, T as isChannelClientMessage, _ as printPropValue, a as isPortErrorMessage, b as findUnplainPath, c as servePorts, d as isConsoleEntryMessage, f as describeStream, g as formatStream, h as formatNodeReport, i as isHubMessage, k as viewKeys, 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 diffProjection, x as requirePlainData, y as provide } from "./serveChannels-Cs22-p8X.js";
|
|
2
3
|
import { a as Each, i as show, n as getComponentMetadata, o as each, r as Show, t as createComponent } from "./createComponent-3n1ZSql8.js";
|
|
3
|
-
import { c as channelSchema, l as describeChannel, t as AGENT_PORT } from "./remote-
|
|
4
|
-
import { n as serveApplicationAgent } from "./app-
|
|
4
|
+
import { c as channelSchema, l as describeChannel, t as AGENT_PORT } from "./remote-gRdwYo-q.js";
|
|
5
|
+
import { n as serveApplicationAgent } from "./app-bMsNOs1H.js";
|
|
5
6
|
import { BehaviorSubject, EMPTY, Observable, Subject, Subscription, distinctUntilChanged, map } from "rxjs";
|
|
6
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
8
|
//#region src/Component.ts
|
|
@@ -2201,7 +2202,8 @@ var ShellService = class {
|
|
|
2201
2202
|
...options.bytes === void 0 ? {} : { bytes: options.bytes },
|
|
2202
2203
|
mediaType: options.mediaType ?? "application/octet-stream",
|
|
2203
2204
|
accept: options.accept ?? [],
|
|
2204
|
-
...options.handle === void 0 ? {} : { handle: options.handle }
|
|
2205
|
+
...options.handle === void 0 ? {} : { handle: options.handle },
|
|
2206
|
+
...options.remember === false ? { remember: false } : {}
|
|
2205
2207
|
});
|
|
2206
2208
|
}
|
|
2207
2209
|
/** The files the shell remembers, most recently used first. */
|
|
@@ -2341,7 +2343,7 @@ var ShellFiles = class {
|
|
|
2341
2343
|
suggestedName: request.name
|
|
2342
2344
|
});
|
|
2343
2345
|
await write(handle, request.bytes ?? request.text);
|
|
2344
|
-
const id = await this.remember(handle);
|
|
2346
|
+
const id = request.remember === false ? null : await this.remember(handle);
|
|
2345
2347
|
return ok({ saved: {
|
|
2346
2348
|
name: handle.name,
|
|
2347
2349
|
handle: id,
|
|
@@ -4375,7 +4377,7 @@ var WorkerApp = class {
|
|
|
4375
4377
|
})
|
|
4376
4378
|
}, this.proxy);
|
|
4377
4379
|
const webmcp = this.options.webmcp;
|
|
4378
|
-
if (webmcp !== void 0 && webmcp !== false) import("./webmcp-
|
|
4380
|
+
if (webmcp !== void 0 && webmcp !== false) import("./webmcp-F3OOy73w.js").then((n) => n.a).then((agent) => agent.connectWebMcp(this, webmcp === true ? {} : webmcp)).then((disconnect) => {
|
|
4379
4381
|
if (this.renderWorker === worker) this.disconnectWebMcp = disconnect;
|
|
4380
4382
|
else disconnect();
|
|
4381
4383
|
}, (error) => console.warn("[gesso] WebMCP could not register the channels:", error));
|
|
@@ -10506,7 +10508,7 @@ var GessoAppBuilder = class {
|
|
|
10506
10508
|
if (app === void 0 || key !== "gesso:agent") return;
|
|
10507
10509
|
const pair = new MessageChannel();
|
|
10508
10510
|
const registrations = this.channelRegistrations;
|
|
10509
|
-
import("./app-
|
|
10511
|
+
import("./app-bMsNOs1H.js").then((n) => n.t).then((agent) => agent.serveApplicationAgent(pair.port2, {
|
|
10510
10512
|
channels: () => registrations.filter((registration) => registration.source !== void 0).map((registration) => ({
|
|
10511
10513
|
token: registration.token,
|
|
10512
10514
|
source: registration.source
|
|
@@ -10519,7 +10521,7 @@ var GessoAppBuilder = class {
|
|
|
10519
10521
|
connectWebMcp(app) {
|
|
10520
10522
|
const choice = this.webmcpChoice;
|
|
10521
10523
|
if (choice === false) return;
|
|
10522
|
-
import("./webmcp-
|
|
10524
|
+
import("./webmcp-F3OOy73w.js").then((n) => n.a).then((agent) => agent.connectWebMcp(this, choice === true ? {} : choice)).then((disconnect) => {
|
|
10523
10525
|
if (this.app === app) this.disconnectWebMcp = disconnect;
|
|
10524
10526
|
else disconnect();
|
|
10525
10527
|
}, (error) => console.warn("[gesso] WebMCP could not register the channels:", error));
|