@nyte-ai/plugin 0.0.0-stage → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/THIRD-PARTY-NOTICES.md +866 -0
- package/dist/chunks/billing-0y7dfkp2.js +146 -0
- package/dist/chunks/billing-2v3g7rd9.js +190 -0
- package/dist/chunks/billing-3j77ss7y.js +86 -0
- package/dist/chunks/billing-3scqmkzb.js +559 -0
- package/dist/chunks/billing-4vz9pxyx.js +22 -0
- package/dist/chunks/billing-6z2kgtyt.js +51 -0
- package/dist/chunks/billing-8rjk35gr.js +444 -0
- package/dist/chunks/billing-9nn3yp18.js +176 -0
- package/dist/chunks/billing-9qc0eqh4.js +174 -0
- package/dist/chunks/billing-a9vqn66p.js +351 -0
- package/dist/chunks/billing-bv5zr32b.js +369 -0
- package/dist/chunks/billing-cy1rg619.js +302 -0
- package/dist/chunks/billing-ejx2hv52.js +323 -0
- package/dist/chunks/billing-h13r0byk.js +80 -0
- package/dist/chunks/billing-hg64tqf1.js +97 -0
- package/dist/chunks/billing-j643d12p.js +197 -0
- package/dist/chunks/billing-kn3d30b4.js +276 -0
- package/dist/chunks/billing-mvc33pv6.js +36 -0
- package/dist/chunks/billing-s4rrspsk.js +7 -0
- package/dist/chunks/billing-svrhh5a5.js +307 -0
- package/dist/chunks/billing-sxc70w72.js +161 -0
- package/dist/chunks/billing-t1qrxe16.js +41 -0
- package/dist/chunks/billing-tm34gm2p.js +528 -0
- package/dist/chunks/billing-tzr3cebf.js +20 -0
- package/dist/chunks/billing-v3hg5rc7.js +373 -0
- package/dist/chunks/billing-wmcbg6fw.js +52 -0
- package/dist/chunks/billing-ye3wk5r3.js +205 -0
- package/dist/chunks/billing-zfpm2rt0.js +29 -0
- package/dist/examples/claude-code/LICENSE +21 -0
- package/dist/examples/claude-code/billing.d.ts +7 -0
- package/dist/examples/claude-code/billing.js +11 -0
- package/dist/examples/claude-code/claude-cli.d.ts +35 -0
- package/dist/examples/claude-code/claude-cli.js +15 -0
- package/dist/examples/claude-code/env.d.ts +1 -0
- package/dist/examples/claude-code/env.js +6 -0
- package/dist/examples/claude-code/index.d.ts +24 -0
- package/dist/examples/claude-code/index.js +149 -0
- package/dist/examples/claude-code/inert-mcp.d.ts +1 -0
- package/dist/examples/claude-code/inert-mcp.js +6 -0
- package/dist/examples/claude-code/model-catalog.d.ts +27 -0
- package/dist/examples/claude-code/model-catalog.js +12 -0
- package/dist/examples/claude-code/process.d.ts +22 -0
- package/dist/examples/claude-code/process.js +25 -0
- package/dist/examples/claude-code/replay.d.ts +4 -0
- package/dist/examples/claude-code/replay.js +11 -0
- package/dist/examples/claude-code/stream.d.ts +3 -0
- package/dist/examples/claude-code/stream.js +16 -0
- package/dist/examples/claude-code/transcript.d.ts +83 -0
- package/dist/examples/claude-code/transcript.js +23 -0
- package/dist/examples/claude-code/turn-relay.d.ts +48 -0
- package/dist/examples/claude-code/turn-relay.js +9 -0
- package/dist/examples/claude-code/wire.d.ts +372 -0
- package/dist/examples/claude-code/wire.js +18 -0
- package/dist/src/acp/connection.d.ts +24 -0
- package/dist/src/acp/connection.js +8 -0
- package/dist/src/acp/index.d.ts +54 -0
- package/dist/src/acp/index.js +1005 -0
- package/dist/src/acp/registry.d.ts +18 -0
- package/dist/src/acp/registry.js +9 -0
- package/dist/src/acp/thread.d.ts +46 -0
- package/dist/src/acp/thread.js +7 -0
- package/dist/src/acp/transcript.d.ts +8 -0
- package/dist/src/acp/transcript.js +11 -0
- package/dist/src/acp/translate.d.ts +33 -0
- package/dist/src/acp/translate.js +20 -0
- package/dist/src/approvals/approvals.d.ts +189 -0
- package/dist/src/approvals/approvals.js +143 -0
- package/dist/src/approvals/schema.d.ts +169 -0
- package/dist/src/approvals/schema.js +18 -0
- package/dist/src/bash-description.d.ts +30 -0
- package/dist/src/bash-description.js +18 -0
- package/dist/src/browser-tools.d.ts +25 -0
- package/dist/src/browser-tools.js +246 -0
- package/dist/src/canvas/canvas-compile.d.ts +48 -0
- package/dist/src/canvas/canvas-compile.js +8 -0
- package/dist/src/canvas/canvas-libraries.d.ts +32 -0
- package/dist/src/canvas/canvas-libraries.js +6 -0
- package/dist/src/canvas/canvas-preview.d.ts +107 -0
- package/dist/src/canvas/canvas-preview.js +12 -0
- package/dist/src/canvas/canvas-protocol.d.ts +184 -0
- package/dist/src/canvas/canvas-protocol.js +75 -0
- package/dist/src/canvas/canvas.d.ts +50 -0
- package/dist/src/canvas/canvas.js +221 -0
- package/dist/src/canvas/schema.d.ts +47 -0
- package/dist/src/canvas/schema.js +8 -0
- package/dist/src/claude-code-sdk/index.d.ts +35 -0
- package/dist/src/claude-code-sdk/index.js +379 -0
- package/dist/src/claude-code-sdk/session.d.ts +50 -0
- package/dist/src/claude-code-sdk/session.js +7 -0
- package/dist/src/claude-code-sdk/transcript.d.ts +19 -0
- package/dist/src/claude-code-sdk/transcript.js +15 -0
- package/dist/src/claude-code-sdk/translate.d.ts +18 -0
- package/dist/src/claude-code-sdk/translate.js +20 -0
- package/dist/src/client/mount.d.ts +44 -0
- package/dist/src/client/mount.js +252 -0
- package/dist/src/client/notifications.d.ts +36 -0
- package/dist/src/client/notifications.js +24 -0
- package/dist/src/client/presentation.d.ts +362 -0
- package/dist/src/client/presentation.js +391 -0
- package/dist/src/client/transcript-tui.d.ts +23 -0
- package/dist/src/client/transcript-tui.js +20 -0
- package/dist/src/client/transcript.d.ts +23 -0
- package/dist/src/client/transcript.js +51 -0
- package/dist/src/client.d.ts +53 -0
- package/dist/src/client.js +22 -0
- package/dist/src/codemode-runtime.d.ts +11 -0
- package/dist/src/codemode-runtime.js +10 -0
- package/dist/src/codemode-worker.d.ts +1 -0
- package/dist/src/codemode-worker.js +2 -0
- package/dist/src/codemode.d.ts +21 -0
- package/dist/src/codemode.js +170 -0
- package/dist/src/core.d.ts +43 -0
- package/dist/src/core.js +11 -0
- package/dist/src/find-on-path.d.ts +4 -0
- package/dist/src/find-on-path.js +8 -0
- package/dist/src/openai-astra-context.d.ts +23 -0
- package/dist/src/openai-astra-context.js +14 -0
- package/dist/src/openai-compaction.d.ts +15 -0
- package/dist/src/openai-compaction.js +55 -0
- package/dist/src/question/client/questions-tui.d.ts +9 -0
- package/dist/src/question/client/questions-tui.js +19 -0
- package/dist/src/question/client/questions.d.ts +9 -0
- package/dist/src/question/client/questions.js +160 -0
- package/dist/src/question/question.d.ts +63 -0
- package/dist/src/question/question.js +9 -0
- package/dist/src/question/schema.d.ts +101 -0
- package/dist/src/question/schema.js +14 -0
- package/dist/src/rename.d.ts +79 -0
- package/dist/src/rename.js +91 -0
- package/dist/src/telemetry.d.ts +36 -0
- package/dist/src/telemetry.js +84 -0
- package/dist/src/web-search.d.ts +78 -0
- package/dist/src/web-search.js +219 -0
- package/package.json +190 -3
- package/README.md +0 -3
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PERMISSIONS2,
|
|
3
|
+
approvalPolicy2,
|
|
4
|
+
APPROVAL_POLICIES2,
|
|
5
|
+
APPROVAL_ACTIONS2,
|
|
6
|
+
approvalPrompt2,
|
|
7
|
+
approval2,
|
|
8
|
+
openApprovals2
|
|
9
|
+
} from "../../chunks/billing-h13r0byk.js";
|
|
10
|
+
export {
|
|
11
|
+
APPROVAL_ACTIONS2 as APPROVAL_ACTIONS,
|
|
12
|
+
APPROVAL_POLICIES2 as APPROVAL_POLICIES,
|
|
13
|
+
PERMISSIONS2 as PERMISSIONS,
|
|
14
|
+
approval2 as approval,
|
|
15
|
+
approvalPolicy2 as approvalPolicy,
|
|
16
|
+
approvalPrompt2 as approvalPrompt,
|
|
17
|
+
openApprovals2 as openApprovals
|
|
18
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Makes the model say what each `bash` call does. A derive wraps the
|
|
3
|
+
* environment's `bash` tool, keeping its identity, execute and class, and
|
|
4
|
+
* requires `description` in its parameters; the tool's class already carries
|
|
5
|
+
* it as `ToolClass.shell.description`, so a client heads the call with it.
|
|
6
|
+
*
|
|
7
|
+
* @category plugins
|
|
8
|
+
* @since 0.1.0
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: {
|
|
11
|
+
id: string;
|
|
12
|
+
activate(api: {
|
|
13
|
+
readonly side: "core";
|
|
14
|
+
readonly sdk: import("@nyte-ai/core").Connection;
|
|
15
|
+
readonly contribute: import("@nyte-ai/core").Registries<"core">;
|
|
16
|
+
readonly storage: import("@nyte-ai/core").PluginStorage;
|
|
17
|
+
readonly signal: AbortSignal;
|
|
18
|
+
hook<N extends "session_activated" | "before_send" | "run_started" | "transform_transcript" | "before_compaction" | "before_request" | "before_tool" | "after_tool" | "after_request" | "run_ended">(name: N, entry: import("@nyte-ai/core").HookEntry<"core", N>): import("@nyte-ai/schema").Disposer;
|
|
19
|
+
report(issue: import("@nyte-ai/schema").ValidationIssue): void;
|
|
20
|
+
reload(): void;
|
|
21
|
+
} & {
|
|
22
|
+
readonly session: import("@nyte-ai/core").Session;
|
|
23
|
+
readonly env: import("@nyte-ai/core").ExecutionEnv;
|
|
24
|
+
wrapEnv(wrap: import("@nyte-ai/core").EnvironmentWrap): import("@nyte-ai/schema").Disposer;
|
|
25
|
+
readonly inputs: import("@nyte-ai/core").Resources;
|
|
26
|
+
request<T = string>(input: import("@nyte-ai/schema").ModelRequestInput<T>): Promise<import("@nyte-ai/schema").ModelRequestOutcome<T>>;
|
|
27
|
+
approve(call: import("@nyte-ai/core").RuntimeCall, signal: AbortSignal): Promise<import("@nyte-ai/core").RuntimeVerdict>;
|
|
28
|
+
}): void;
|
|
29
|
+
};
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/bash-description.ts
|
|
2
|
+
import { standard } from "@nyte-ai/schema";
|
|
3
|
+
import { Type } from "typebox";
|
|
4
|
+
var parameters = standard(Type.Object({
|
|
5
|
+
command: Type.String({ description: "The shell command to run." }),
|
|
6
|
+
description: Type.String({
|
|
7
|
+
description: "Clear, concise description of what this command does in 5-10 words, in active voice."
|
|
8
|
+
})
|
|
9
|
+
}));
|
|
10
|
+
var bash_description_default = {
|
|
11
|
+
id: "bash-description",
|
|
12
|
+
activate(api) {
|
|
13
|
+
api.contribute.tools.add((draft) => draft.wrap("bash", (bash) => ({ ...bash, parameters })));
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
bash_description_default as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ToolDefinition } from "@nyte-ai/core";
|
|
2
|
+
/**
|
|
3
|
+
* The browser tools: open, snapshot, click, type, press, scroll, wait,
|
|
4
|
+
* console, capture and evaluate, over the workspace's browser capability
|
|
5
|
+
* (`workspace.browser()`, which a desktop adds through `wrapEnv`). Actions
|
|
6
|
+
* address nodes by the refs of the latest snapshot.
|
|
7
|
+
*
|
|
8
|
+
* @category plugins
|
|
9
|
+
* @since 0.1.0
|
|
10
|
+
*/
|
|
11
|
+
export declare const browserTools: readonly ToolDefinition[];
|
|
12
|
+
/**
|
|
13
|
+
* Adds the browser tools to every session; a session whose workspace has no
|
|
14
|
+
* browser answers each call with why.
|
|
15
|
+
*
|
|
16
|
+
* @category plugins
|
|
17
|
+
* @since 0.1.0
|
|
18
|
+
*/
|
|
19
|
+
declare const _default: {
|
|
20
|
+
id: string;
|
|
21
|
+
contribute: {
|
|
22
|
+
tools: readonly ToolDefinition<unknown, unknown>[];
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
var __dispose = Symbol.dispose || /* @__PURE__ */ Symbol.for("Symbol.dispose");
|
|
2
|
+
var __asyncDispose = Symbol.asyncDispose || /* @__PURE__ */ Symbol.for("Symbol.asyncDispose");
|
|
3
|
+
var __using = (stack, value, async) => {
|
|
4
|
+
if (value != null) {
|
|
5
|
+
if (typeof value !== "object" && typeof value !== "function")
|
|
6
|
+
throw TypeError('Object expected to be assigned to "using" declaration');
|
|
7
|
+
var dispose;
|
|
8
|
+
if (async)
|
|
9
|
+
dispose = value[__asyncDispose];
|
|
10
|
+
if (dispose === undefined)
|
|
11
|
+
dispose = value[__dispose];
|
|
12
|
+
if (typeof dispose !== "function")
|
|
13
|
+
throw TypeError("Object not disposable");
|
|
14
|
+
stack.push([async, dispose, value]);
|
|
15
|
+
} else if (async) {
|
|
16
|
+
stack.push([async]);
|
|
17
|
+
}
|
|
18
|
+
return value;
|
|
19
|
+
};
|
|
20
|
+
var __callDispose = (stack, error, hasError) => {
|
|
21
|
+
var E = typeof SuppressedError === "function" ? SuppressedError : function(e, s, m, _) {
|
|
22
|
+
return _ = Error(m), _.name = "SuppressedError", _.error = e, _.suppressed = s, _;
|
|
23
|
+
}, fail = (e) => error = hasError ? new E(e, error, "An error was suppressed during disposal") : (hasError = true, e), next = (it) => {
|
|
24
|
+
while (it = stack.pop()) {
|
|
25
|
+
try {
|
|
26
|
+
var result = it[1] && it[1].call(it[2]);
|
|
27
|
+
if (it[0])
|
|
28
|
+
return Promise.resolve(result).then(next, (e) => (fail(e), next()));
|
|
29
|
+
} catch (e) {
|
|
30
|
+
fail(e);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (hasError)
|
|
34
|
+
throw error;
|
|
35
|
+
};
|
|
36
|
+
return next();
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/browser-tools.ts
|
|
40
|
+
import { asId, standard } from "@nyte-ai/schema";
|
|
41
|
+
import { Type } from "typebox";
|
|
42
|
+
var page = Type.Optional(Type.String({ description: "The page id; omit for the page opened last." }));
|
|
43
|
+
var ref = Type.String({ description: "A node's ref from the latest snapshot." });
|
|
44
|
+
function on(properties) {
|
|
45
|
+
return standard(Type.Object({ page, ...properties }));
|
|
46
|
+
}
|
|
47
|
+
async function requireBrowser(invocation) {
|
|
48
|
+
const capability = await invocation.workspace.browser();
|
|
49
|
+
if (capability.kind !== "available")
|
|
50
|
+
throw new Error(`No browser is available here: ${capability.reason}`);
|
|
51
|
+
return capability.api;
|
|
52
|
+
}
|
|
53
|
+
async function withPage(invocation, id, operate) {
|
|
54
|
+
let __stack = [];
|
|
55
|
+
try {
|
|
56
|
+
const browser = await requireBrowser(invocation);
|
|
57
|
+
const target = id ?? (await browser.list()).at(-1)?.id;
|
|
58
|
+
if (target === undefined)
|
|
59
|
+
throw new Error("No page is open. Call browser_open first.");
|
|
60
|
+
const held = __using(__stack, await browser.adopt(asId(target)), 1);
|
|
61
|
+
return operate(held);
|
|
62
|
+
} catch (_catch) {
|
|
63
|
+
var _err = _catch, _hasErr = 1;
|
|
64
|
+
} finally {
|
|
65
|
+
var _promise = __callDispose(__stack, _err, _hasErr);
|
|
66
|
+
_promise && await _promise;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function render(snapshot) {
|
|
70
|
+
return [
|
|
71
|
+
`Revision ${snapshot.revision}`,
|
|
72
|
+
...snapshot.nodes.map((node) => `${" ".repeat(node.depth)}[${node.ref}] ${node.role} "${node.name}"${node.editable ? " (editable)" : ""}`)
|
|
73
|
+
].join(`
|
|
74
|
+
`);
|
|
75
|
+
}
|
|
76
|
+
function outcomeText(outcome) {
|
|
77
|
+
if (outcome.kind === "applied")
|
|
78
|
+
return render(outcome.snapshot);
|
|
79
|
+
if (outcome.kind === "stale")
|
|
80
|
+
return `The page changed (now revision ${outcome.revision}). Take a snapshot and try again.`;
|
|
81
|
+
return outcome.kind === "refused" ? `Refused: ${outcome.reason}.` : `The page is closed: ${outcome.reason}.`;
|
|
82
|
+
}
|
|
83
|
+
function browserTool(input) {
|
|
84
|
+
return {
|
|
85
|
+
name: input.name,
|
|
86
|
+
description: input.description,
|
|
87
|
+
parameters: input.parameters,
|
|
88
|
+
class: () => ({ kind: "custom", label: input.name.replace("browser_", "Browser: ") }),
|
|
89
|
+
effects: "none",
|
|
90
|
+
approval: input.approval,
|
|
91
|
+
replay: input.replay,
|
|
92
|
+
execute: async (args, invocation) => ({
|
|
93
|
+
content: [{ kind: "text", text: await input.run(args, invocation) }]
|
|
94
|
+
})
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
var open = {
|
|
98
|
+
name: "browser_open",
|
|
99
|
+
description: "Open a URL in a new browser page and return the page id and its snapshot.",
|
|
100
|
+
parameters: standard(Type.Object({ url: Type.String({ minLength: 1, description: "The URL to open." }) })),
|
|
101
|
+
class: (args) => ({ kind: "custom", label: `Opening ${args.url}` }),
|
|
102
|
+
effects: "none",
|
|
103
|
+
approval: "never",
|
|
104
|
+
replay: "safe",
|
|
105
|
+
async execute(args, invocation) {
|
|
106
|
+
const opened = await (await requireBrowser(invocation)).open({ url: args.url });
|
|
107
|
+
const view = await opened.view();
|
|
108
|
+
return {
|
|
109
|
+
content: [
|
|
110
|
+
{
|
|
111
|
+
kind: "text",
|
|
112
|
+
text: `Page ${opened.id}: ${view.title} (${view.url})
|
|
113
|
+
${render(await opened.snapshot())}`
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
var capture = {
|
|
120
|
+
name: "browser_capture",
|
|
121
|
+
description: "Take a screenshot of the page.",
|
|
122
|
+
parameters: on({}),
|
|
123
|
+
class: () => ({ kind: "custom", label: "Browser: capture" }),
|
|
124
|
+
effects: "none",
|
|
125
|
+
approval: "never",
|
|
126
|
+
replay: "safe",
|
|
127
|
+
execute: (args, invocation) => withPage(invocation, args.page, async (held) => {
|
|
128
|
+
const image = await held.capture();
|
|
129
|
+
try {
|
|
130
|
+
const blob = await invocation.env.files.upload(image.chunks());
|
|
131
|
+
return { content: [{ kind: "file", blob, mime: image.mime ?? "image/png" }] };
|
|
132
|
+
} finally {
|
|
133
|
+
await image.close();
|
|
134
|
+
}
|
|
135
|
+
})
|
|
136
|
+
};
|
|
137
|
+
var browserTools = [
|
|
138
|
+
open,
|
|
139
|
+
browserTool({
|
|
140
|
+
name: "browser_snapshot",
|
|
141
|
+
description: "Read the page's accessibility tree: one line per node with its ref, role and name.",
|
|
142
|
+
parameters: on({ ref: Type.Optional(ref) }),
|
|
143
|
+
replay: "safe",
|
|
144
|
+
approval: "never",
|
|
145
|
+
run: (args, invocation) => withPage(invocation, args.page, async (held) => render(await held.snapshot({ ref: args.ref })))
|
|
146
|
+
}),
|
|
147
|
+
browserTool({
|
|
148
|
+
name: "browser_click",
|
|
149
|
+
description: "Click a node by its ref.",
|
|
150
|
+
parameters: on({
|
|
151
|
+
ref,
|
|
152
|
+
button: Type.Optional(Type.Union([Type.Literal("left"), Type.Literal("right"), Type.Literal("middle")])),
|
|
153
|
+
double: Type.Optional(Type.Boolean())
|
|
154
|
+
}),
|
|
155
|
+
replay: "never",
|
|
156
|
+
run: (args, invocation) => withPage(invocation, args.page, async (held) => outcomeText(await held.click({ ref: args.ref, button: args.button, double: args.double })))
|
|
157
|
+
}),
|
|
158
|
+
browserTool({
|
|
159
|
+
name: "browser_type",
|
|
160
|
+
description: "Type text into a node by its ref.",
|
|
161
|
+
parameters: on({
|
|
162
|
+
ref,
|
|
163
|
+
text: Type.String(),
|
|
164
|
+
clear: Type.Optional(Type.Boolean()),
|
|
165
|
+
submit: Type.Optional(Type.Boolean())
|
|
166
|
+
}),
|
|
167
|
+
replay: "never",
|
|
168
|
+
run: (args, invocation) => withPage(invocation, args.page, async (held) => outcomeText(await held.type({
|
|
169
|
+
ref: args.ref,
|
|
170
|
+
text: args.text,
|
|
171
|
+
clear: args.clear,
|
|
172
|
+
submit: args.submit
|
|
173
|
+
})))
|
|
174
|
+
}),
|
|
175
|
+
browserTool({
|
|
176
|
+
name: "browser_press",
|
|
177
|
+
description: "Press a key or chord, such as Enter or Control+a, on a node or the page.",
|
|
178
|
+
parameters: on({ key: Type.String(), ref: Type.Optional(ref) }),
|
|
179
|
+
replay: "never",
|
|
180
|
+
run: (args, invocation) => withPage(invocation, args.page, async (held) => outcomeText(await held.press({ key: args.key, ref: args.ref })))
|
|
181
|
+
}),
|
|
182
|
+
browserTool({
|
|
183
|
+
name: "browser_scroll",
|
|
184
|
+
description: "Scroll the page or a node.",
|
|
185
|
+
parameters: on({
|
|
186
|
+
direction: Type.Union([
|
|
187
|
+
Type.Literal("up"),
|
|
188
|
+
Type.Literal("down"),
|
|
189
|
+
Type.Literal("top"),
|
|
190
|
+
Type.Literal("bottom")
|
|
191
|
+
]),
|
|
192
|
+
ref: Type.Optional(ref),
|
|
193
|
+
pages: Type.Optional(Type.Number({ minimum: 0.1 }))
|
|
194
|
+
}),
|
|
195
|
+
replay: "never",
|
|
196
|
+
approval: "never",
|
|
197
|
+
run: (args, invocation) => withPage(invocation, args.page, async (held) => outcomeText(await held.scroll({ direction: args.direction, ref: args.ref, pages: args.pages })))
|
|
198
|
+
}),
|
|
199
|
+
browserTool({
|
|
200
|
+
name: "browser_wait",
|
|
201
|
+
description: "Wait for the page to load, for text to appear or disappear, or for a delay in milliseconds.",
|
|
202
|
+
parameters: on({
|
|
203
|
+
for: Type.Union([Type.Literal("loaded"), Type.Literal("text"), Type.Literal("delay")]),
|
|
204
|
+
text: Type.Optional(Type.String()),
|
|
205
|
+
gone: Type.Optional(Type.Boolean({ description: "With text: wait for it to disappear." })),
|
|
206
|
+
ms: Type.Optional(Type.Number({ minimum: 0 }))
|
|
207
|
+
}),
|
|
208
|
+
replay: "never",
|
|
209
|
+
approval: "never",
|
|
210
|
+
run: (args, invocation) => withPage(invocation, args.page, async (held) => outcomeText(await held.wait(args.for === "text" ? { kind: "text", text: args.text ?? "", present: args.gone !== true } : args.for === "delay" ? { kind: "delay", ms: args.ms ?? 1000 } : { kind: "loaded" })))
|
|
211
|
+
}),
|
|
212
|
+
browserTool({
|
|
213
|
+
name: "browser_console",
|
|
214
|
+
description: "Read the page's console, newest first.",
|
|
215
|
+
parameters: on({
|
|
216
|
+
limit: Type.Optional(Type.Integer({ minimum: 1, maximum: 200 })),
|
|
217
|
+
clear: Type.Optional(Type.Boolean())
|
|
218
|
+
}),
|
|
219
|
+
replay: "never",
|
|
220
|
+
approval: "never",
|
|
221
|
+
run: (args, invocation) => withPage(invocation, args.page, async (held) => {
|
|
222
|
+
const entries = await held.console({ limit: args.limit, clear: args.clear });
|
|
223
|
+
return entries.length === 0 ? "The console is empty." : entries.map((entry) => `[${entry.level}] ${entry.text}`).join(`
|
|
224
|
+
`);
|
|
225
|
+
})
|
|
226
|
+
}),
|
|
227
|
+
capture,
|
|
228
|
+
browserTool({
|
|
229
|
+
name: "browser_evaluate",
|
|
230
|
+
description: "Evaluate a JavaScript expression in the page; with a ref, the node is `this`.",
|
|
231
|
+
parameters: on({ expression: Type.String(), ref: Type.Optional(ref) }),
|
|
232
|
+
replay: "never",
|
|
233
|
+
run: (args, invocation) => withPage(invocation, args.page, async (held) => {
|
|
234
|
+
const result = await held.evaluate(args.expression, { ref: args.ref });
|
|
235
|
+
return result.kind === "value" ? JSON.stringify(result.value) : `Threw: ${result.message}`;
|
|
236
|
+
})
|
|
237
|
+
})
|
|
238
|
+
];
|
|
239
|
+
var browser_tools_default = {
|
|
240
|
+
id: "browser-tools",
|
|
241
|
+
contribute: { tools: browserTools }
|
|
242
|
+
};
|
|
243
|
+
export {
|
|
244
|
+
browserTools,
|
|
245
|
+
browser_tools_default as default
|
|
246
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns what the compiler answers for one canvas: the ESM module to ship,
|
|
3
|
+
* with the runtime it targets, or the diagnostics the model fixes.
|
|
4
|
+
*
|
|
5
|
+
* @category plugins
|
|
6
|
+
* @since 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
export type CompileOutcome = {
|
|
9
|
+
readonly kind: "compiled";
|
|
10
|
+
readonly code: string;
|
|
11
|
+
readonly runtime: number;
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: "failed";
|
|
14
|
+
readonly errors: readonly CompileError[];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Returns one diagnostic, positioned in a source file when the compiler
|
|
18
|
+
* knows where; `file` is null for one about the canvas as a whole.
|
|
19
|
+
*
|
|
20
|
+
* @category plugins
|
|
21
|
+
* @since 0.1.0
|
|
22
|
+
*/
|
|
23
|
+
export type CompileError = {
|
|
24
|
+
readonly file: string | null;
|
|
25
|
+
readonly line: number | null;
|
|
26
|
+
readonly column: number | null;
|
|
27
|
+
readonly text: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Returns a canvas's other files, keyed by their path from `main.tsx`'s
|
|
31
|
+
* folder, such as `chart.tsx` or `lib/scale.ts`.
|
|
32
|
+
*
|
|
33
|
+
* @category plugins
|
|
34
|
+
* @since 0.1.0
|
|
35
|
+
*/
|
|
36
|
+
export type CanvasFiles = Readonly<Record<string, string>>;
|
|
37
|
+
/**
|
|
38
|
+
* Compiles a canvas, `source` as `main.tsx` plus the `files` it imports,
|
|
39
|
+
* to the one module the shell imports. The caps default to the contract's;
|
|
40
|
+
* a test narrows them.
|
|
41
|
+
*
|
|
42
|
+
* @category plugins
|
|
43
|
+
* @since 0.1.0
|
|
44
|
+
*/
|
|
45
|
+
export declare function compileCanvas(source: string, files?: CanvasFiles, limits?: {
|
|
46
|
+
readonly source?: number;
|
|
47
|
+
readonly code?: number;
|
|
48
|
+
}): Promise<CompileOutcome>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The libraries a canvas may import, each pinned in packages/canvas and
|
|
3
|
+
* served by the shell as its own chunk, with every name its module exports.
|
|
4
|
+
* Written by `packages/canvas/scripts/library-exports.mjs`; a canvas test
|
|
5
|
+
* checks it against the installed packages.
|
|
6
|
+
*/
|
|
7
|
+
export declare const CANVAS_LIBRARIES: {
|
|
8
|
+
readonly three: {
|
|
9
|
+
readonly version: "0.186.1";
|
|
10
|
+
readonly exports: "ACESFilmicToneMapping AddEquation AddOperation AdditiveAnimationBlendMode AdditiveBlending AgXToneMapping AlphaFormat AlwaysCompare AlwaysDepth AlwaysStencilFunc AmbientLight AnimationAction AnimationClip AnimationLoader AnimationMixer AnimationObjectGroup AnimationUtils ArcCurve ArrayCamera ArrowHelper AttachedBindMode Audio AudioAnalyser AudioContext AudioListener AudioLoader AxesHelper BackSide BasicDepthPacking BasicShadowMap BatchedMesh BezierInterpolant Bone BooleanKeyframeTrack Box2 Box3 Box3Helper BoxGeometry BoxHelper BufferAttribute BufferGeometry BufferGeometryLoader ByteType Cache Camera CameraHelper CanvasTexture CapsuleGeometry CatmullRomCurve3 CineonToneMapping CircleGeometry ClampToEdgeWrapping Clock Color ColorKeyframeTrack ColorManagement Compatibility CompressedArrayTexture CompressedCubeTexture CompressedTexture CompressedTextureLoader ConeGeometry ConstantAlphaFactor ConstantColorFactor Controls CubeCamera CubeDepthTexture CubeReflectionMapping CubeRefractionMapping CubeTexture CubeTextureLoader CubeUVReflectionMapping CubicBezierCurve CubicBezierCurve3 CubicInterpolant CullFaceBack CullFaceFront CullFaceFrontBack CullFaceNone Curve CurvePath CustomBlending CustomToneMapping CylinderGeometry Cylindrical Data3DTexture DataArrayTexture DataTexture DataTextureLoader DataUtils DecrementStencilOp DecrementWrapStencilOp DefaultLoadingManager DepthFormat DepthStencilFormat DepthTexture DetachedBindMode DirectionalLight DirectionalLightHelper DiscreteInterpolant DodecahedronGeometry DoubleSide DstAlphaFactor DstColorFactor DynamicCopyUsage DynamicDrawUsage DynamicReadUsage EdgesGeometry EllipseCurve EqualCompare EqualDepth EqualStencilFunc EquirectangularReflectionMapping EquirectangularRefractionMapping Euler EventDispatcher ExternalTexture ExtrudeGeometry FileLoader Float16BufferAttribute Float32BufferAttribute FloatType Fog FogExp2 FramebufferTexture FrontSide Frustum FrustumArray GLBufferAttribute GLSL1 GLSL3 GreaterCompare GreaterDepth GreaterEqualCompare GreaterEqualDepth GreaterEqualStencilFunc GreaterStencilFunc GridHelper Group HTMLTexture HalfFloatType HemisphereLight HemisphereLightHelper IcosahedronGeometry ImageBitmapLoader ImageLoader ImageUtils IncrementStencilOp IncrementWrapStencilOp InstancedBufferAttribute InstancedBufferGeometry InstancedInterleavedBuffer InstancedMesh Int16BufferAttribute Int32BufferAttribute Int8BufferAttribute IntType InterleavedBuffer InterleavedBufferAttribute Interpolant InterpolateBezier InterpolateDiscrete InterpolateLinear InterpolateSmooth InterpolationSamplingMode InterpolationSamplingType InvertStencilOp KeepStencilOp KeyframeTrack LOD LatheGeometry Layers LessCompare LessDepth LessEqualCompare LessEqualDepth LessEqualStencilFunc LessStencilFunc Light LightProbe LightShadow Line Line3 LineBasicMaterial LineCurve LineCurve3 LineDashedMaterial LineLoop LineSegments LinearFilter LinearInterpolant LinearMipMapLinearFilter LinearMipMapNearestFilter LinearMipmapLinearFilter LinearMipmapNearestFilter LinearSRGBColorSpace LinearToneMapping LinearTransfer Loader LoaderUtils LoadingManager LoopOnce LoopPingPong LoopRepeat MOUSE Material MaterialBlending MaterialLoader MathUtils Matrix2 Matrix3 Matrix4 MaxEquation Mesh MeshBasicMaterial MeshDepthMaterial MeshDistanceMaterial MeshLambertMaterial MeshMatcapMaterial MeshNormalMaterial MeshPhongMaterial MeshPhysicalMaterial MeshStandardMaterial MeshToonMaterial MinEquation MirroredRepeatWrapping MixOperation MultiplyBlending MultiplyOperation NearestFilter NearestMipMapLinearFilter NearestMipMapNearestFilter NearestMipmapLinearFilter NearestMipmapNearestFilter NeutralToneMapping NeverCompare NeverDepth NeverStencilFunc NoBlending NoColorSpace NoNormalPacking NoToneMapping NormalAnimationBlendMode NormalBlending NormalGAPacking NormalRGPacking NotEqualCompare NotEqualDepth NotEqualStencilFunc NumberKeyframeTrack Object3D ObjectLoader ObjectSpaceNormalMap OctahedronGeometry OneFactor OneMinusConstantAlphaFactor OneMinusConstantColorFactor OneMinusDstAlphaFactor OneMinusDstColorFactor OneMinusSrcAlphaFactor OneMinusSrcColorFactor OrthographicCamera PCFShadowMap PCFSoftShadowMap PMREMGenerator Path PerspectiveCamera Plane PlaneGeometry PlaneHelper PointLight PointLightHelper Points PointsMaterial PolarGridHelper PolyhedronGeometry PositionalAudio PropertyBinding PropertyMixer QuadraticBezierCurve QuadraticBezierCurve3 Quaternion QuaternionKeyframeTrack QuaternionLinearInterpolant R11_EAC_Format RED_GREEN_RGTC2_Format RED_RGTC1_Format REVISION RG11_EAC_Format RGBADepthPacking RGBAFormat RGBAIntegerFormat RGBA_ASTC_10x10_Format RGBA_ASTC_10x5_Format RGBA_ASTC_10x6_Format RGBA_ASTC_10x8_Format RGBA_ASTC_12x10_Format RGBA_ASTC_12x12_Format RGBA_ASTC_4x4_Format RGBA_ASTC_5x4_Format RGBA_ASTC_5x5_Format RGBA_ASTC_6x5_Format RGBA_ASTC_6x6_Format RGBA_ASTC_8x5_Format RGBA_ASTC_8x6_Format RGBA_ASTC_8x8_Format RGBA_BPTC_Format RGBA_ETC2_EAC_Format RGBA_PVRTC_2BPPV1_Format RGBA_PVRTC_4BPPV1_Format RGBA_S3TC_DXT1_Format RGBA_S3TC_DXT3_Format RGBA_S3TC_DXT5_Format RGBDepthPacking RGBFormat RGBIntegerFormat RGB_BPTC_SIGNED_Format RGB_BPTC_UNSIGNED_Format RGB_ETC1_Format RGB_ETC2_Format RGB_PVRTC_2BPPV1_Format RGB_PVRTC_4BPPV1_Format RGB_S3TC_DXT1_Format RGDepthPacking RGFormat RGIntegerFormat RawShaderMaterial Ray Raycaster RectAreaLight RedFormat RedIntegerFormat ReinhardToneMapping RenderObjectRefreshType RenderTarget RenderTarget3D RepeatWrapping ReplaceStencilOp ReverseSubtractEquation RingGeometry SIGNED_R11_EAC_Format SIGNED_RED_GREEN_RGTC2_Format SIGNED_RED_RGTC1_Format SIGNED_RG11_EAC_Format SRGBColorSpace SRGBTransfer Scene ShaderChunk ShaderLib ShaderMaterial ShadowMaterial Shape ShapeGeometry ShapePath ShapeUtils ShortType Skeleton SkeletonHelper SkinnedMesh Source Sphere SphereGeometry Spherical SphericalHarmonics3 SplineCurve SpotLight SpotLightHelper Sprite SpriteMaterial SrcAlphaFactor SrcAlphaSaturateFactor SrcColorFactor StaticCopyUsage StaticDrawUsage StaticReadUsage StereoCamera StreamCopyUsage StreamDrawUsage StreamReadUsage StringKeyframeTrack SubtractEquation SubtractiveBlending TOUCH TangentSpaceNormalMap TetrahedronGeometry Texture TextureLoader TextureSource TextureUtils Timer TimestampQuery TorusGeometry TorusKnotGeometry Triangle TriangleFanDrawMode TriangleStripDrawMode TrianglesDrawMode TubeGeometry UVMapping Uint16BufferAttribute Uint32BufferAttribute Uint8BufferAttribute Uint8ClampedBufferAttribute Uniform UniformsGroup UniformsLib UniformsUtils UnsignedByteType UnsignedInt101111Type UnsignedInt248Type UnsignedInt5999Type UnsignedIntType UnsignedShort4444Type UnsignedShort5551Type UnsignedShortType VSMShadowMap Vector2 Vector3 Vector4 VectorKeyframeTrack VideoFrameTexture VideoTexture WebGL3DRenderTarget WebGLArrayRenderTarget WebGLCoordinateSystem WebGLCubeRenderTarget WebGLRenderTarget WebGLRenderer WebGLUtils WebGPUCoordinateSystem WebXRController WireframeGeometry WrapAroundEnding ZeroCurvatureEnding ZeroFactor ZeroSlopeEnding ZeroStencilOp createCanvasElement error getConsoleFunction log setConsoleFunction warn warnOnce";
|
|
11
|
+
};
|
|
12
|
+
readonly "d3-array": {
|
|
13
|
+
readonly version: "3.2.4";
|
|
14
|
+
readonly exports: "Adder InternMap InternSet ascending bin bisect bisectCenter bisectLeft bisectRight bisector blur blur2 blurImage count cross cumsum descending deviation difference disjoint every extent fcumsum filter flatGroup flatRollup fsum greatest greatestIndex group groupSort groups histogram index indexes intersection least leastIndex map max maxIndex mean median medianIndex merge min minIndex mode nice pairs permute quantile quantileIndex quantileSorted quickselect range rank reduce reverse rollup rollups scan shuffle shuffler some sort subset sum superset thresholdFreedmanDiaconis thresholdScott thresholdSturges tickIncrement tickStep ticks transpose union variance zip";
|
|
15
|
+
};
|
|
16
|
+
readonly "d3-scale": {
|
|
17
|
+
readonly version: "4.0.2";
|
|
18
|
+
readonly exports: "scaleBand scaleDiverging scaleDivergingLog scaleDivergingPow scaleDivergingSqrt scaleDivergingSymlog scaleIdentity scaleImplicit scaleLinear scaleLog scaleOrdinal scalePoint scalePow scaleQuantile scaleQuantize scaleRadial scaleSequential scaleSequentialLog scaleSequentialPow scaleSequentialQuantile scaleSequentialSqrt scaleSequentialSymlog scaleSqrt scaleSymlog scaleThreshold scaleTime scaleUtc tickFormat";
|
|
19
|
+
};
|
|
20
|
+
readonly "d3-shape": {
|
|
21
|
+
readonly version: "3.2.0";
|
|
22
|
+
readonly exports: "arc area areaRadial curveBasis curveBasisClosed curveBasisOpen curveBumpX curveBumpY curveBundle curveCardinal curveCardinalClosed curveCardinalOpen curveCatmullRom curveCatmullRomClosed curveCatmullRomOpen curveLinear curveLinearClosed curveMonotoneX curveMonotoneY curveNatural curveStep curveStepAfter curveStepBefore line lineRadial link linkHorizontal linkRadial linkVertical pie pointRadial radialArea radialLine stack stackOffsetDiverging stackOffsetExpand stackOffsetNone stackOffsetSilhouette stackOffsetWiggle stackOrderAppearance stackOrderAscending stackOrderDescending stackOrderInsideOut stackOrderNone stackOrderReverse symbol symbolAsterisk symbolCircle symbolCross symbolDiamond symbolDiamond2 symbolPlus symbolSquare symbolSquare2 symbolStar symbolTimes symbolTriangle symbolTriangle2 symbolWye symbolX symbols symbolsFill symbolsStroke";
|
|
23
|
+
};
|
|
24
|
+
readonly "d3-hierarchy": {
|
|
25
|
+
readonly version: "3.1.2";
|
|
26
|
+
readonly exports: "Node cluster hierarchy pack packEnclose packSiblings partition stratify tree treemap treemapBinary treemapDice treemapResquarify treemapSlice treemapSliceDice treemapSquarify";
|
|
27
|
+
};
|
|
28
|
+
readonly "d3-force": {
|
|
29
|
+
readonly version: "3.0.0";
|
|
30
|
+
readonly exports: "forceCenter forceCollide forceLink forceManyBody forceRadial forceSimulation forceX forceY";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { CanvasModule } from "./canvas-protocol.ts";
|
|
2
|
+
/** The widths a preview measures at, in CSS pixels: the desktop chat column (its 840 px measure less the gutters) and a phone's. */
|
|
3
|
+
export declare const CANVAS_PREVIEW_WIDTHS: {
|
|
4
|
+
readonly chat: 808;
|
|
5
|
+
readonly phone: 358;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Returns what a previewer renders: the compiled module and the theme to
|
|
9
|
+
* show it in.
|
|
10
|
+
*
|
|
11
|
+
* @category plugins
|
|
12
|
+
* @since 0.1.0
|
|
13
|
+
*/
|
|
14
|
+
export type CanvasPreviewRequest = {
|
|
15
|
+
readonly module: CanvasModule;
|
|
16
|
+
readonly theme: "light" | "dark";
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Returns one error the shell reported while the preview ran, its message
|
|
20
|
+
* ending in the canvas file and line when the stack named one.
|
|
21
|
+
*
|
|
22
|
+
* @category plugins
|
|
23
|
+
* @since 0.1.0
|
|
24
|
+
*/
|
|
25
|
+
export type CanvasPreviewError = {
|
|
26
|
+
readonly phase: "load" | "render";
|
|
27
|
+
readonly message: string;
|
|
28
|
+
readonly stack: string | null;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Returns one console call the canvas made while the preview ran.
|
|
32
|
+
*
|
|
33
|
+
* @category plugins
|
|
34
|
+
* @since 0.1.0
|
|
35
|
+
*/
|
|
36
|
+
export type CanvasPreviewLog = {
|
|
37
|
+
readonly level: string;
|
|
38
|
+
readonly text: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Returns what a preview saw: a PNG of the canvas at the chat column's
|
|
42
|
+
* width, its height there and at a phone's (`CANVAS_PREVIEW_WIDTHS`), its
|
|
43
|
+
* errors and its console.
|
|
44
|
+
*
|
|
45
|
+
* @category plugins
|
|
46
|
+
* @since 0.1.0
|
|
47
|
+
*/
|
|
48
|
+
export type CanvasPreviewReport = {
|
|
49
|
+
readonly png: Uint8Array;
|
|
50
|
+
readonly heights: {
|
|
51
|
+
readonly chat: number;
|
|
52
|
+
readonly phone: number;
|
|
53
|
+
};
|
|
54
|
+
readonly errors: readonly CanvasPreviewError[];
|
|
55
|
+
readonly console: readonly CanvasPreviewLog[];
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Returns a previewer's answer: the report, or why this host cannot render
|
|
59
|
+
* a preview (no renderer installed, the renderer failed to start).
|
|
60
|
+
*
|
|
61
|
+
* @category plugins
|
|
62
|
+
* @since 0.1.0
|
|
63
|
+
*/
|
|
64
|
+
export type CanvasPreviewOutcome = {
|
|
65
|
+
readonly kind: "rendered";
|
|
66
|
+
readonly report: CanvasPreviewReport;
|
|
67
|
+
} | {
|
|
68
|
+
readonly kind: "unavailable";
|
|
69
|
+
readonly reason: string;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Renders a compiled canvas off-screen in the real shell. A host passes one
|
|
73
|
+
* to `canvasPlugin` to give the model `canvas_preview`, which gives each
|
|
74
|
+
* preview 45 seconds. When `signal` aborts (past that, or the turn
|
|
75
|
+
* stopped), the previewer tears its renderer down, so a canvas that hangs
|
|
76
|
+
* its page holds up no later preview.
|
|
77
|
+
*
|
|
78
|
+
* @category plugins
|
|
79
|
+
* @since 0.1.0
|
|
80
|
+
*/
|
|
81
|
+
export type CanvasPreviewer = (request: CanvasPreviewRequest, signal: AbortSignal) => Promise<CanvasPreviewOutcome>;
|
|
82
|
+
/**
|
|
83
|
+
* Returns the page a previewer loaded the shell in, top-level, for
|
|
84
|
+
* `runCanvasPreview` to drive: `evaluate` runs an expression in the page
|
|
85
|
+
* and resolves with its JSON-safe value (awaiting a promise), `resize` sets
|
|
86
|
+
* the viewport in CSS pixels, `capture` takes a PNG of the viewport.
|
|
87
|
+
*
|
|
88
|
+
* @category plugins
|
|
89
|
+
* @since 0.1.0
|
|
90
|
+
*/
|
|
91
|
+
export type CanvasPreviewPage = {
|
|
92
|
+
evaluate(expression: string): Promise<unknown>;
|
|
93
|
+
resize(width: number, height: number): Promise<void>;
|
|
94
|
+
capture(): Promise<Uint8Array>;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Runs a preview on a page that has loaded the shell: installs the harness
|
|
98
|
+
* (retrying while the shell's script has not run yet), settles at the chat
|
|
99
|
+
* column's width and captures it there, then settles again at a phone's
|
|
100
|
+
* width for its height.
|
|
101
|
+
*
|
|
102
|
+
* @category plugins
|
|
103
|
+
* @since 0.1.0
|
|
104
|
+
*/
|
|
105
|
+
export declare function runCanvasPreview(page: CanvasPreviewPage, request: CanvasPreviewRequest): Promise<CanvasPreviewReport>;
|
|
106
|
+
/** Returns the preview as the model reads it beside the screenshot: heights, errors, console. */
|
|
107
|
+
export declare function describeCanvasPreview(report: CanvasPreviewReport): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CANVAS_PREVIEW_WIDTHS2,
|
|
3
|
+
runCanvasPreview2,
|
|
4
|
+
describeCanvasPreview2
|
|
5
|
+
} from "../../chunks/billing-sxc70w72.js";
|
|
6
|
+
import"../../chunks/billing-bv5zr32b.js";
|
|
7
|
+
import"../../chunks/billing-zfpm2rt0.js";
|
|
8
|
+
export {
|
|
9
|
+
CANVAS_PREVIEW_WIDTHS2 as CANVAS_PREVIEW_WIDTHS,
|
|
10
|
+
describeCanvasPreview2 as describeCanvasPreview,
|
|
11
|
+
runCanvasPreview2 as runCanvasPreview
|
|
12
|
+
};
|