acrylblends 1.0.5 → 1.0.6
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/docs/framework/agents/index.md +1 -1
- package/lib/{audit-D5z9uwOP.d.ts → audit-GcLtvNLV.d.ts} +4 -2
- package/lib/cordis/door.d.ts +90 -4
- package/lib/cordis/door.js +524 -13
- package/lib/door/host.d.ts +2 -2
- package/lib/door/host.js +1 -1
- package/lib/door/page.d.ts +3 -1
- package/lib/door/page.js +1 -1
- package/lib/door/protocol.d.ts +1 -1
- package/lib/{protocol-C37gPePD.d.ts → protocol-CR31M7K_.d.ts} +2 -0
- package/lib/{snapshot-text-Bbx43mN0.js → snapshot-text-CtQm3n8n.js} +14 -5
- package/package.json +1 -1
- package/plugins/acryl-door/src/cli/acryl.ts +36 -5
- package/plugins/acryl-door/src/host/channel.ts +14 -6
- package/plugins/acryl-door/src/host/door.ts +78 -10
- package/plugins/acryl-door/src/host/page-routes.ts +3 -1
- package/plugins/acryl-door/src/host/shell.ts +147 -0
- package/plugins/acryl-door/src/host/shim.ts +39 -3
- package/plugins/acryl-door/src/host/verbs.ts +39 -2
- package/plugins/acryl-door/src/index.ts +7 -1
- package/plugins/acryl-door/src/page/channel.ts +3 -1
- package/plugins/acryl-door/src/page/index.ts +2 -1
- package/plugins/acryl-door/src/page/protocol.ts +2 -0
- package/plugins/acryl-door/src/shell/protocol.ts +130 -0
- package/plugins/agent-panel/headless.ts +29 -8
- package/plugins/agent-panel/launch.ts +67 -0
- package/plugins/desktop/door-shell.ts +379 -0
- package/plugins/desktop/main.ts +66 -12
- package/templates/agent/AGENTS.md +2 -0
- package/plugins/acryl-router/src/connection.d.ts +0 -25
- package/plugins/acryl-router/src/core/app-base.d.ts +0 -215
- package/plugins/acryl-router/src/core/app.d.ts +0 -19
- package/plugins/acryl-router/src/core/client/client.d.ts +0 -4
- package/plugins/acryl-router/src/core/client/fetch-result-please.d.ts +0 -35
- package/plugins/acryl-router/src/core/client/index.d.ts +0 -7
- package/plugins/acryl-router/src/core/client/types.d.ts +0 -229
- package/plugins/acryl-router/src/core/client/utils.d.ts +0 -18
- package/plugins/acryl-router/src/core/compose.d.ts +0 -14
- package/plugins/acryl-router/src/core/context.d.ts +0 -443
- package/plugins/acryl-router/src/core/helper/accepts/accepts.d.ts +0 -30
- package/plugins/acryl-router/src/core/helper/accepts/index.d.ts +0 -5
- package/plugins/acryl-router/src/core/helper/conninfo/index.d.ts +0 -5
- package/plugins/acryl-router/src/core/helper/conninfo/types.d.ts +0 -36
- package/plugins/acryl-router/src/core/helper/cookie/index.d.ts +0 -25
- package/plugins/acryl-router/src/core/helper/css/common.d.ts +0 -59
- package/plugins/acryl-router/src/core/helper/css/index.d.ts +0 -80
- package/plugins/acryl-router/src/core/helper/dev/index.d.ts +0 -20
- package/plugins/acryl-router/src/core/helper/factory/index.d.ts +0 -82
- package/plugins/acryl-router/src/core/helper/html/index.d.ts +0 -8
- package/plugins/acryl-router/src/core/helper/proxy/index.d.ts +0 -73
- package/plugins/acryl-router/src/core/helper/route/index.d.ts +0 -75
- package/plugins/acryl-router/src/core/helper/ssg/index.d.ts +0 -7
- package/plugins/acryl-router/src/core/helper/ssg/middleware.d.ts +0 -44
- package/plugins/acryl-router/src/core/helper/ssg/plugins.d.ts +0 -27
- package/plugins/acryl-router/src/core/helper/ssg/ssg.d.ts +0 -91
- package/plugins/acryl-router/src/core/helper/ssg/utils.d.ts +0 -16
- package/plugins/acryl-router/src/core/helper/streaming/index.d.ts +0 -8
- package/plugins/acryl-router/src/core/helper/streaming/sse.d.ts +0 -13
- package/plugins/acryl-router/src/core/helper/streaming/stream.d.ts +0 -3
- package/plugins/acryl-router/src/core/helper/streaming/text.d.ts +0 -3
- package/plugins/acryl-router/src/core/helper/streaming/utils.d.ts +0 -1
- package/plugins/acryl-router/src/core/helper/testing/index.d.ts +0 -13
- package/plugins/acryl-router/src/core/helper/websocket/index.d.ts +0 -70
- package/plugins/acryl-router/src/core/http-exception.d.ts +0 -58
- package/plugins/acryl-router/src/core/index.d.ts +0 -37
- package/plugins/acryl-router/src/core/jsx/base.d.ts +0 -61
- package/plugins/acryl-router/src/core/jsx/children.d.ts +0 -9
- package/plugins/acryl-router/src/core/jsx/components.d.ts +0 -15
- package/plugins/acryl-router/src/core/jsx/constants.d.ts +0 -6
- package/plugins/acryl-router/src/core/jsx/context.d.ts +0 -51
- package/plugins/acryl-router/src/core/jsx/dom/components.d.ts +0 -10
- package/plugins/acryl-router/src/core/jsx/dom/context.d.ts +0 -3
- package/plugins/acryl-router/src/core/jsx/dom/css.d.ts +0 -83
- package/plugins/acryl-router/src/core/jsx/dom/hooks/index.d.ts +0 -39
- package/plugins/acryl-router/src/core/jsx/dom/intrinsic-element/components.d.ts +0 -16
- package/plugins/acryl-router/src/core/jsx/dom/jsx-dev-runtime.d.ts +0 -8
- package/plugins/acryl-router/src/core/jsx/dom/jsx-runtime.d.ts +0 -7
- package/plugins/acryl-router/src/core/jsx/dom/render.d.ts +0 -73
- package/plugins/acryl-router/src/core/jsx/dom/utils.d.ts +0 -1
- package/plugins/acryl-router/src/core/jsx/hooks/index.d.ts +0 -47
- package/plugins/acryl-router/src/core/jsx/index.d.ts +0 -76
- package/plugins/acryl-router/src/core/jsx/intrinsic-element/common.d.ts +0 -6
- package/plugins/acryl-router/src/core/jsx/intrinsic-element/components.d.ts +0 -13
- package/plugins/acryl-router/src/core/jsx/intrinsic-elements.d.ts +0 -735
- package/plugins/acryl-router/src/core/jsx/streaming.d.ts +0 -36
- package/plugins/acryl-router/src/core/jsx/types.d.ts +0 -36
- package/plugins/acryl-router/src/core/jsx/utils.d.ts +0 -4
- package/plugins/acryl-router/src/core/request/constants.d.ts +0 -1
- package/plugins/acryl-router/src/core/request.d.ts +0 -306
- package/plugins/acryl-router/src/core/router/reg-exp-router/index.d.ts +0 -6
- package/plugins/acryl-router/src/core/router/reg-exp-router/matcher.d.ts +0 -7
- package/plugins/acryl-router/src/core/router/reg-exp-router/node.d.ts +0 -13
- package/plugins/acryl-router/src/core/router/reg-exp-router/prepared-router.d.ts +0 -17
- package/plugins/acryl-router/src/core/router/reg-exp-router/router.d.ts +0 -11
- package/plugins/acryl-router/src/core/router/reg-exp-router/trie.d.ts +0 -8
- package/plugins/acryl-router/src/core/router/smart-router/index.d.ts +0 -5
- package/plugins/acryl-router/src/core/router/smart-router/router.d.ts +0 -11
- package/plugins/acryl-router/src/core/router/trie-router/index.d.ts +0 -5
- package/plugins/acryl-router/src/core/router/trie-router/node.d.ts +0 -6
- package/plugins/acryl-router/src/core/router/trie-router/router.d.ts +0 -7
- package/plugins/acryl-router/src/core/router/utils.d.ts +0 -1
- package/plugins/acryl-router/src/core/router.d.ts +0 -97
- package/plugins/acryl-router/src/core/types.d.ts +0 -573
- package/plugins/acryl-router/src/core/utils/accept.d.ts +0 -6
- package/plugins/acryl-router/src/core/utils/body.d.ts +0 -79
- package/plugins/acryl-router/src/core/utils/buffer.d.ts +0 -17
- package/plugins/acryl-router/src/core/utils/color.d.ts +0 -21
- package/plugins/acryl-router/src/core/utils/concurrent.d.ts +0 -11
- package/plugins/acryl-router/src/core/utils/constants.d.ts +0 -4
- package/plugins/acryl-router/src/core/utils/cookie.d.ts +0 -41
- package/plugins/acryl-router/src/core/utils/crypto.d.ts +0 -15
- package/plugins/acryl-router/src/core/utils/handler.d.ts +0 -6
- package/plugins/acryl-router/src/core/utils/headers.d.ts +0 -8
- package/plugins/acryl-router/src/core/utils/html.d.ts +0 -44
- package/plugins/acryl-router/src/core/utils/http-status.d.ts +0 -32
- package/plugins/acryl-router/src/core/utils/mime.d.ts +0 -70
- package/plugins/acryl-router/src/core/utils/stream.d.ts +0 -31
- package/plugins/acryl-router/src/core/utils/types.d.ts +0 -128
- package/plugins/acryl-router/src/core/utils/url.d.ts +0 -44
- package/plugins/acryl-router/src/core/validator/index.d.ts +0 -7
- package/plugins/acryl-router/src/core/validator/utils.d.ts +0 -29
- package/plugins/acryl-router/src/core/validator/validator.d.ts +0 -16
- package/plugins/acryl-router/src/helpers/index.d.ts +0 -17
- package/plugins/acryl-router/src/helpers/schema-validator.d.ts +0 -54
|
@@ -50,7 +50,7 @@ npm install
|
|
|
50
50
|
- `add driver-pty` puts the driver's row after the panel's in `blend.yaml` and registers it in `src/app.ts`.
|
|
51
51
|
- A **run belongs to the app, not to the page**: when the page reloads (the door reloads it after a plugin change) the panel shows the question and the events so far and follows the run to its end; **Stop** is the only thing that cancels it.
|
|
52
52
|
- **The panel's coding agents are yours.** `claude`, `codex` and `pi` run on the machine that runs the app, in the app folder, with the login of the person who started it: `claude` and `codex` use their own signed-in sessions, and `pi` is offered when `DEEPSEEK_API_KEY` is set or `pi` has stored a DeepSeek login (`~/.pi/agent/auth.json`, read from the `HOME` of the process that runs the app: an app started under another `HOME` does not see the login, and the panel then lists `pty:pi` but no chat `pi`). A program that is not installed, or is not logged in, is not offered; nothing is shared between machines, and a workshop laptop needs its own login. The panel's own `agent` (the offline scripted one) needs none.
|
|
53
|
-
- `pi` has to be an executable on the `PATH`; a shell function that wraps the binary is fine as long as the binary itself is found by `which pi`.
|
|
53
|
+
- `pi` has to be an executable on the `PATH`; a shell function that wraps the binary is fine as long as the binary itself is found by `which pi`. Install it with `npm i -g @earendil-works/pi-coding-agent` (the older `@mariozechner/pi-coding-agent` is deprecated). It reaches DeepSeek with `DEEPSEEK_API_KEY` in the environment of the app, or with the key it stored when its owner logged in (`~/.pi/agent/auth.json`, a `deepseek` entry); without one the panel does not offer it. On Windows an npm-installed `claude`, `codex` or `pi` is a `.cmd` shim: the panel reads the script the shim runs and starts it with Node (no shell, so the message is not passed through cmd.exe quoting), and Stop ends the whole process tree.
|
|
54
54
|
- `driver-pty` brings `node-pty`, which ships prebuilt binaries for macOS, Windows and Linux. npm 11 and pnpm warn that its install script was not run (they ask you to approve dependency install scripts); you can ignore the warning. If no `pty:` terminal is offered and the app prints why at start, approve and rebuild: `npm approve-scripts node-pty`, then `npm rebuild node-pty` (pnpm: `pnpm approve-builds`).
|
|
55
55
|
|
|
56
56
|
## Checking that an agent can use the docs
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as UiRequest, n as AuditEntry, r as ChannelToHost, v as UiResult } from "./protocol-
|
|
1
|
+
import { _ as UiRequest, n as AuditEntry, r as ChannelToHost, v as UiResult } from "./protocol-CR31M7K_.js";
|
|
2
2
|
|
|
3
3
|
//#region ../../plugins/acryl-door/src/host/channel.d.ts
|
|
4
4
|
/** The slice of a page's stream the channel needs, so tests can supply their own. */
|
|
@@ -18,7 +18,7 @@ declare class UiChannel {
|
|
|
18
18
|
* Register a page's stream. A stream already open for the same window is closed first, and its calls settle as `disconnected`.
|
|
19
19
|
* @returns the function to call when this stream ends.
|
|
20
20
|
*/
|
|
21
|
-
attach(windowId: string, focused: boolean, stream: PageStream): () => void;
|
|
21
|
+
attach(windowId: string, focused: boolean, stream: PageStream, shellWindow?: number): () => void;
|
|
22
22
|
/** A message a page sent by POST. Only the window that was asked may answer a call, so another page cannot forge a result. */
|
|
23
23
|
receive(windowId: string, message: ChannelToHost): void;
|
|
24
24
|
/** True when at least one page is connected. */
|
|
@@ -27,6 +27,7 @@ declare class UiChannel {
|
|
|
27
27
|
windows(): readonly {
|
|
28
28
|
windowId: string;
|
|
29
29
|
focused: boolean;
|
|
30
|
+
shellWindow?: number;
|
|
30
31
|
}[];
|
|
31
32
|
/**
|
|
32
33
|
* Ask the current page to do something.
|
|
@@ -35,6 +36,7 @@ declare class UiChannel {
|
|
|
35
36
|
call(request: UiRequest, options?: {
|
|
36
37
|
signal?: AbortSignal;
|
|
37
38
|
timeoutMs?: number;
|
|
39
|
+
window?: number;
|
|
38
40
|
}): Promise<UiResult>;
|
|
39
41
|
/**
|
|
40
42
|
* A promise for the next time a page connects (a page that reloaded or moved opens a new stream). Ask for it BEFORE the call that makes the page leave, or a fast page is missed.
|
package/lib/cordis/door.d.ts
CHANGED
|
@@ -1,10 +1,87 @@
|
|
|
1
|
-
import { f as UiActionResult, y as UiSnapshot } from "../protocol-
|
|
2
|
-
import { i as UiChannel, t as AuditLog } from "../audit-
|
|
1
|
+
import { f as UiActionResult, y as UiSnapshot } from "../protocol-CR31M7K_.js";
|
|
2
|
+
import { i as UiChannel, r as PageStream, t as AuditLog } from "../audit-GcLtvNLV.js";
|
|
3
3
|
import { Context } from "@deepseek-ai/cordis";
|
|
4
4
|
import z from "@deepseek-ai/schemastery";
|
|
5
5
|
|
|
6
|
+
//#region ../../plugins/acryl-door/src/shell/protocol.d.ts
|
|
7
|
+
type ShellRequest = {
|
|
8
|
+
readonly op: 'window-list';
|
|
9
|
+
} | {
|
|
10
|
+
readonly op: 'window-open';
|
|
11
|
+
readonly path?: string;
|
|
12
|
+
} | {
|
|
13
|
+
readonly op: 'window-focus';
|
|
14
|
+
readonly id: number;
|
|
15
|
+
} /** `force`: the window may be the last, and closing the last one ends the desktop app (and with it the server it started). */ | {
|
|
16
|
+
readonly op: 'window-close';
|
|
17
|
+
readonly id: number;
|
|
18
|
+
readonly force?: boolean;
|
|
19
|
+
} | {
|
|
20
|
+
readonly op: 'window-resize';
|
|
21
|
+
readonly id: number;
|
|
22
|
+
readonly width: number;
|
|
23
|
+
readonly height: number;
|
|
24
|
+
} | {
|
|
25
|
+
readonly op: 'menu-list';
|
|
26
|
+
} /** `force`: the item may end the desktop app (Quit, or Close Window on the last window). */ | {
|
|
27
|
+
readonly op: 'menu-click';
|
|
28
|
+
readonly path: string;
|
|
29
|
+
readonly force?: boolean;
|
|
30
|
+
};
|
|
31
|
+
interface ShellWindow {
|
|
32
|
+
/** Electron's own window id: the number `window list` prints and `--window` takes. */
|
|
33
|
+
readonly id: number;
|
|
34
|
+
readonly title: string;
|
|
35
|
+
/** The path (with query) the window shows, never the origin. */
|
|
36
|
+
readonly path: string;
|
|
37
|
+
readonly focused: boolean;
|
|
38
|
+
readonly width: number;
|
|
39
|
+
readonly height: number;
|
|
40
|
+
}
|
|
41
|
+
interface ShellMenuItem {
|
|
42
|
+
/** Labels from the top of the menu, joined with `>`: `File>New Note`. */
|
|
43
|
+
readonly path: string;
|
|
44
|
+
readonly label: string;
|
|
45
|
+
readonly enabled: boolean;
|
|
46
|
+
/** True for an item that ends the desktop app (Quit, or Close Window): `menu click` presses it only with `force`. */
|
|
47
|
+
readonly ends?: boolean;
|
|
48
|
+
}
|
|
49
|
+
type ShellResult = {
|
|
50
|
+
readonly windows: readonly ShellWindow[];
|
|
51
|
+
} | {
|
|
52
|
+
readonly items: readonly ShellMenuItem[];
|
|
53
|
+
} | {
|
|
54
|
+
readonly ok: true;
|
|
55
|
+
readonly detail: string;
|
|
56
|
+
readonly id?: number;
|
|
57
|
+
};
|
|
58
|
+
type ShellErrorCode = 'invalid' | 'no-desktop' | 'no-such-window' | 'last-window' | 'no-such-menu-item' | 'disabled' | 'quits-app' | 'timeout' | 'disconnected' | 'unloaded' | 'aborted' | 'failed';
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region ../../plugins/acryl-door/src/host/shell.d.ts
|
|
61
|
+
declare class ShellChannel {
|
|
62
|
+
private current;
|
|
63
|
+
private readonly pending;
|
|
64
|
+
private nextId;
|
|
65
|
+
private closed;
|
|
66
|
+
private readonly attachWaiters;
|
|
67
|
+
get connected(): boolean;
|
|
68
|
+
/** @returns the function to call when this stream ends. */
|
|
69
|
+
attach(stream: PageStream): () => void;
|
|
70
|
+
/** A promise for the shell connecting (it reconnects after the dev server restarted). */
|
|
71
|
+
waitForShell(timeoutMs: number): Promise<boolean>;
|
|
72
|
+
receive(body: unknown): void;
|
|
73
|
+
/** @throws ShellError `no-desktop` when no shell is attached, else what the shell refused with. */
|
|
74
|
+
call(request: ShellRequest, options?: {
|
|
75
|
+
signal?: AbortSignal;
|
|
76
|
+
timeoutMs?: number;
|
|
77
|
+
}): Promise<ShellResult>;
|
|
78
|
+
close(): void;
|
|
79
|
+
private failAll;
|
|
80
|
+
private settle;
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
6
83
|
//#region ../../plugins/acryl-door/src/host/door.d.ts
|
|
7
|
-
type DoorErrorCode = 'invalid' | 'unknown-verb' | 'unavailable' | 'not-exposed' | 'outside-app' | 'failed';
|
|
84
|
+
type DoorErrorCode = 'invalid' | 'unknown-verb' | 'unavailable' | 'not-exposed' | 'outside-app' | 'failed' | ShellErrorCode;
|
|
8
85
|
declare class DoorError extends Error {
|
|
9
86
|
readonly code: DoorErrorCode;
|
|
10
87
|
constructor(code: DoorErrorCode, message: string);
|
|
@@ -32,6 +109,8 @@ interface ToolsPort {
|
|
|
32
109
|
}
|
|
33
110
|
interface DoorDeps {
|
|
34
111
|
readonly channel: UiChannel;
|
|
112
|
+
/** The desktop shell (the Electron main process of `npm run desktop`), when the app can have one. */
|
|
113
|
+
readonly shell?: ShellChannel;
|
|
35
114
|
readonly audit: AuditLog;
|
|
36
115
|
/** The app's name, folder and, when it listens, its address (what `brief` prints so an agent can curl the running app). */
|
|
37
116
|
readonly app: {
|
|
@@ -67,6 +146,13 @@ declare class Door {
|
|
|
67
146
|
* A second GET of the same path (a page is read-only); nothing when the app has no address or does not answer in time.
|
|
68
147
|
*/
|
|
69
148
|
private statusAt;
|
|
149
|
+
/**
|
|
150
|
+
* The windows and the menu of the desktop app, through the shell. Every call is audited with the window it was about; a call with no shell attached answers one line that says what to run;
|
|
151
|
+
* closing the last window is refused unless the call says `force` (it ends the desktop app, and the session an agent works in with it).
|
|
152
|
+
*/
|
|
153
|
+
private desktop;
|
|
154
|
+
/** `window` on look and act: the desktop window (the number `window list` prints) whose page the call is for; without it, the page used last. */
|
|
155
|
+
private windowOf;
|
|
70
156
|
private parse;
|
|
71
157
|
/** Run one call on the page and record it. The audit holds which control was touched and how it ended, never what was typed. */
|
|
72
158
|
private callPage;
|
|
@@ -83,7 +169,7 @@ declare class Door {
|
|
|
83
169
|
* MCP (`tools/list`) and the built-in chat (the `tools` registry). A verb added here is in all three, or the comparison test fails.
|
|
84
170
|
*/
|
|
85
171
|
/** Every verb, in the order `brief` lists them. */
|
|
86
|
-
declare const VERBS: readonly ["brief", "look", "act", "plugin-list", "plugin-add", "plugin-remove", "plugin-reload", "tool-list", "tool-call"];
|
|
172
|
+
declare const VERBS: readonly ["brief", "look", "act", "plugin-list", "plugin-add", "plugin-remove", "plugin-reload", "tool-list", "tool-call", "window-list", "window-open", "window-focus", "window-close", "window-resize", "menu-list", "menu-click"];
|
|
87
173
|
type Verb = (typeof VERBS)[number];
|
|
88
174
|
/** The JSON Schema of a verb's arguments, as MCP lists it. */
|
|
89
175
|
interface ArgumentsSchema {
|