@acryldev/blends 1.7.10 → 1.7.12
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/dist/index.d.ts +13 -1
- package/dist/index.js +24 -5
- package/dist/index.js.map +1 -1
- package/lib/{audit-B2H3sUfg.d.ts → audit-D0McL8hN.d.ts} +1 -1
- package/lib/cordis/door.d.ts +4 -4
- package/lib/cordis/door.js +52 -3
- package/lib/door/host.d.ts +2 -2
- package/lib/door/host.js +1 -1
- package/lib/door/page.d.ts +5 -1
- package/lib/door/page.js +28 -5
- package/lib/door/protocol.d.ts +2 -2
- package/lib/door/protocol.js +2 -2
- package/lib/{protocol-8HjYa5OX.js → protocol-BKXK53WF.js} +39 -3
- package/lib/{protocol-DdQgl224.d.ts → protocol-CbLZdkJ5.d.ts} +31 -2
- package/lib/{snapshot-text-Cyl69OKv.js → snapshot-text-BYY2gA98.js} +2 -2
- package/pack/lib/create-source.mjs +12 -0
- package/pack/pack-blank-mac.mjs +693 -0
- package/package.json +3 -2
- package/plugins/door/package.json +1 -1
- package/plugins/door/src/cli/acryl.ts +12 -1
- package/plugins/door/src/host/door.ts +6 -0
- package/plugins/door/src/host/verbs.ts +15 -2
- package/plugins/door/src/page/driver/driver.ts +23 -2
- package/plugins/door/src/page/index.ts +11 -0
- package/plugins/door/src/page/protocol.ts +37 -2
- package/plugins/door/src/page/snapshot-text.ts +2 -1
- package/plugins/plugin-share/package.json +1 -1
- package/plugins/plugin-share/plugin.json +1 -1
- package/plugins/save/cli.ts +2 -0
- package/plugins/save/package.json +1 -1
- package/plugins/save/plugin.json +2 -4
- package/plugins/save/share-cli.ts +8 -1
- package/plugins/save/share.ts +123 -36
- package/shared/AGENTS.core.md +9 -0
- package/shared/library-history-versions.json +3 -1
- package/shared/library-history.json +9 -3
- package/shared/skills/acryl-app/SKILL.md +4 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as UiRequest, n as AuditEntry, r as ChannelToHost, w as UiResult } from "./protocol-CbLZdkJ5.js";
|
|
2
2
|
|
|
3
3
|
//#region ../../../plugins/door/src/host/channel.d.ts
|
|
4
4
|
/** The slice of a page's stream the channel needs, so tests can supply their own. */
|
package/lib/cordis/door.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as UiChannel, r as PageStream, t as AuditLog } from "../audit-
|
|
1
|
+
import { T as UiSnapshot, v as UiActionResult } from "../protocol-CbLZdkJ5.js";
|
|
2
|
+
import { i as UiChannel, r as PageStream, t as AuditLog } from "../audit-D0McL8hN.js";
|
|
3
3
|
import { Context } from "@deepseek-ai/cordis";
|
|
4
4
|
import z from "@deepseek-ai/schemastery";
|
|
5
5
|
|
|
@@ -283,8 +283,8 @@ declare class Door {
|
|
|
283
283
|
*/
|
|
284
284
|
/** Every verb, in the order `brief` lists them. */
|
|
285
285
|
/** The verbs that only use the page: what a page-only door (a production assistant) offers. */
|
|
286
|
-
declare const PAGE_VERBS: readonly ["look", "act"];
|
|
287
|
-
declare const VERBS: readonly ["brief", "look", "act", "plugin-list", "plugin-add", "plugin-pull", "plugin-publish", "plugin-remove", "plugin-reload", "tool-list", "tool-call", "window-list", "window-open", "window-focus", "window-close", "window-resize", "menu-list", "menu-click"];
|
|
286
|
+
declare const PAGE_VERBS: readonly ["look", "act", "frame"];
|
|
287
|
+
declare const VERBS: readonly ["brief", "look", "act", "frame", "plugin-list", "plugin-add", "plugin-pull", "plugin-publish", "plugin-remove", "plugin-reload", "tool-list", "tool-call", "window-list", "window-open", "window-focus", "window-close", "window-resize", "menu-list", "menu-click"];
|
|
288
288
|
type Verb = (typeof VERBS)[number];
|
|
289
289
|
/** The JSON Schema of a verb's arguments, as MCP lists it. */
|
|
290
290
|
interface ArgumentsSchema {
|
package/lib/cordis/door.js
CHANGED
|
@@ -3,8 +3,8 @@ import { r as streamSSE } from "../streaming-CL2i3hX_.js";
|
|
|
3
3
|
import { o as pageAuthority } from "../loopback-only-0nTL30Zt.js";
|
|
4
4
|
import "../helpers-qmReU164.js";
|
|
5
5
|
import { n as clientModules } from "../client-modules-ChLgW0l9.js";
|
|
6
|
-
import { a as
|
|
7
|
-
import { a as INVALID_JSON, c as operatorOnly, d as AuditLog, f as auditPath, i as DOOR_PREFIX, l as privateApi, o as error, p as UiChannel, r as pageChannelRoutes, s as jsonBody, t as renderSnapshot, u as readJson } from "../snapshot-text-
|
|
6
|
+
import { a as MAX_SNAPSHOT_NODES, d as UiControlError, f as WINDOW_ID, h as parseUiRequest, p as parseChannelToHost, s as MAX_WAIT_MS } from "../protocol-BKXK53WF.js";
|
|
7
|
+
import { a as INVALID_JSON, c as operatorOnly, d as AuditLog, f as auditPath, i as DOOR_PREFIX, l as privateApi, o as error, p as UiChannel, r as pageChannelRoutes, s as jsonBody, t as renderSnapshot, u as readJson } from "../snapshot-text-BYY2gA98.js";
|
|
8
8
|
import "../src-BycZ1HUQ.js";
|
|
9
9
|
import "../middleware-B8gJUDgl.js";
|
|
10
10
|
import { isAbsolute, join, relative, resolve } from "node:path";
|
|
@@ -299,11 +299,16 @@ function shellRoutes(prefix, secret, channel, heartbeatMs = SHELL_HEARTBEAT_MS)
|
|
|
299
299
|
*/
|
|
300
300
|
/** Every verb, in the order `brief` lists them. */
|
|
301
301
|
/** The verbs that only use the page: what a page-only door (a production assistant) offers. */
|
|
302
|
-
const PAGE_VERBS = [
|
|
302
|
+
const PAGE_VERBS = [
|
|
303
|
+
"look",
|
|
304
|
+
"act",
|
|
305
|
+
"frame"
|
|
306
|
+
];
|
|
303
307
|
const VERBS = [
|
|
304
308
|
"brief",
|
|
305
309
|
"look",
|
|
306
310
|
"act",
|
|
311
|
+
"frame",
|
|
307
312
|
"plugin-list",
|
|
308
313
|
"plugin-add",
|
|
309
314
|
"plugin-pull",
|
|
@@ -445,6 +450,38 @@ const VERB_SPECS = {
|
|
|
445
450
|
additionalProperties: false
|
|
446
451
|
}
|
|
447
452
|
},
|
|
453
|
+
"frame": {
|
|
454
|
+
usage: "frame [open|close|toggle left|right | settings [<section>] | build | preview]: the ACRYL frame around the app (its panels, mode, Settings); alone, its state",
|
|
455
|
+
description: "Operate the ACRYL frame around the app, which is not part of the app's page: open, close or toggle its left panel (branches and versions) or right panel (the agents), open Settings (optionally at a section such as App or Share), or switch Build and Preview. Without an action it says what is open (look says it too). A request to collapse, open or show these is done here, never by editing the app.",
|
|
456
|
+
arguments: {
|
|
457
|
+
type: "object",
|
|
458
|
+
properties: {
|
|
459
|
+
action: {
|
|
460
|
+
type: "string",
|
|
461
|
+
enum: [
|
|
462
|
+
"state",
|
|
463
|
+
"open",
|
|
464
|
+
"close",
|
|
465
|
+
"toggle",
|
|
466
|
+
"settings",
|
|
467
|
+
"build",
|
|
468
|
+
"preview"
|
|
469
|
+
],
|
|
470
|
+
description: "default: state"
|
|
471
|
+
},
|
|
472
|
+
panel: {
|
|
473
|
+
type: "string",
|
|
474
|
+
enum: ["left", "right"],
|
|
475
|
+
description: "open, close, toggle: left is branches and versions, right is the agents"
|
|
476
|
+
},
|
|
477
|
+
section: {
|
|
478
|
+
type: "string",
|
|
479
|
+
description: "settings: the section to show, e.g. App, Share, Plugins"
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
additionalProperties: false
|
|
483
|
+
}
|
|
484
|
+
},
|
|
448
485
|
"plugin-list": {
|
|
449
486
|
usage: "plugin list: the plugins installed while the app runs",
|
|
450
487
|
description: "The plugins installed into the running app.",
|
|
@@ -715,6 +752,17 @@ var Door = class {
|
|
|
715
752
|
text: `done${result.target === void 0 ? "" : `: ${result.target.role} "${result.target.name}"`}${result.detail === void 0 ? "" : ` (${result.detail})`}; look again before the next act`
|
|
716
753
|
};
|
|
717
754
|
}
|
|
755
|
+
case "frame": {
|
|
756
|
+
const { window, rest } = this.windowOf(input, scope);
|
|
757
|
+
const result = await this.callPage("frame", this.parse({
|
|
758
|
+
...rest,
|
|
759
|
+
op: "frame"
|
|
760
|
+
}), signal, window, scope.page);
|
|
761
|
+
return {
|
|
762
|
+
value: result,
|
|
763
|
+
text: result.detail ?? "done"
|
|
764
|
+
};
|
|
765
|
+
}
|
|
718
766
|
case "plugin-list": return this.plugin((plugins) => plugins.list(), false, this.installed());
|
|
719
767
|
case "plugin-add": return this.plugin((extensions) => extensions.install(this.insideApp(input.folder)));
|
|
720
768
|
case "plugin-pull": return input.from === void 0 ? this.pull(input.source) : this.pullList(input.from, input.source);
|
|
@@ -763,6 +811,7 @@ var Door = class {
|
|
|
763
811
|
read.length === 0 ? "No AGENTS.md or skill in the folder." : `Read first: ${read.join(", ")}.`,
|
|
764
812
|
`Page: ${value.page}${value.page === "not open" ? " (open the app in a browser to look and act)" : ""}.`,
|
|
765
813
|
`Live plugins: ${value.plugins}.`,
|
|
814
|
+
"Asked to click, open, close, collapse, show or type on screen? Operate the interface (look, then act inside the page, frame for the ACRYL frame around it); never edit code for it unless the person asks to change the app.",
|
|
766
815
|
"Verbs:",
|
|
767
816
|
...value.verbs.map((line) => ` ${line}`)
|
|
768
817
|
].join("\n")
|
package/lib/door/host.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as Acryl } from "../app-DGqSNBSd.js";
|
|
2
|
-
import {
|
|
3
|
-
import { i as UiChannel, n as auditPath, r as PageStream, t as AuditLog } from "../audit-
|
|
2
|
+
import { T as UiSnapshot, n as AuditEntry } from "../protocol-CbLZdkJ5.js";
|
|
3
|
+
import { i as UiChannel, n as auditPath, r as PageStream, t as AuditLog } from "../audit-D0McL8hN.js";
|
|
4
4
|
|
|
5
5
|
//#region ../../../plugins/door/src/host/page-routes.d.ts
|
|
6
6
|
/** How often the Host writes a `ping`; the page gives up on a stream that is silent for three of these. */
|
package/lib/door/host.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { d as AuditLog, f as auditPath, n as HEARTBEAT_MS, p as UiChannel, r as pageChannelRoutes, t as renderSnapshot } from "../snapshot-text-
|
|
1
|
+
import { d as AuditLog, f as auditPath, n as HEARTBEAT_MS, p as UiChannel, r as pageChannelRoutes, t as renderSnapshot } from "../snapshot-text-BYY2gA98.js";
|
|
2
2
|
export { AuditLog, HEARTBEAT_MS, UiChannel, auditPath, pageChannelRoutes, renderSnapshot };
|
package/lib/door/page.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as UiRequest, l as FrameControl, w as UiResult } from "../protocol-CbLZdkJ5.js";
|
|
2
2
|
|
|
3
3
|
//#region ../../../plugins/door/src/page/driver/driver.d.ts
|
|
4
4
|
interface DriverActivity {
|
|
@@ -24,6 +24,8 @@ interface UiDriverOptions {
|
|
|
24
24
|
} | {
|
|
25
25
|
readonly path: string;
|
|
26
26
|
}) => void;
|
|
27
|
+
/** The ACRYL frame around the page, when there is one: `look` reports it and `frame` operates it. */
|
|
28
|
+
readonly frame?: () => FrameControl | undefined;
|
|
27
29
|
}
|
|
28
30
|
declare class UiDriver {
|
|
29
31
|
private readonly refs;
|
|
@@ -56,6 +58,8 @@ declare class UiDriver {
|
|
|
56
58
|
/** @param signal - the Host cancelled the call. @throws UiControlError. */
|
|
57
59
|
handle(request: UiRequest, signal?: AbortSignal): Promise<UiResult>;
|
|
58
60
|
private run;
|
|
61
|
+
/** The frame's state, or undefined when the page is not in a frame or the frame cannot be read. */
|
|
62
|
+
private frameState;
|
|
59
63
|
/**
|
|
60
64
|
* Run an act that may start a navigation (a click on a link, Enter in a form) and say so: the browser asks `beforeunload` when a navigation starts, during the act or a
|
|
61
65
|
* moment after it. The answer is sent before the page goes; the Host then waits for the next page instead of reading this one again.
|
package/lib/door/page.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as MAX_SNAPSHOT_NODES, c as MUTATING_OPS, d as UiControlError, m as parseChannelToPage, s as MAX_WAIT_MS } from "../protocol-BKXK53WF.js";
|
|
2
2
|
//#region ../../../plugins/door/src/page/socket-source.ts
|
|
3
3
|
function socketSource(socket) {
|
|
4
4
|
const listeners = /* @__PURE__ */ new Map();
|
|
@@ -1062,10 +1062,25 @@ var UiDriver = class {
|
|
|
1062
1062
|
}
|
|
1063
1063
|
async run(request, signal) {
|
|
1064
1064
|
switch (request.op) {
|
|
1065
|
-
case "snapshot":
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1065
|
+
case "snapshot": {
|
|
1066
|
+
const snapshot = this.snapshots.snapshot({
|
|
1067
|
+
...request.cursor === void 0 ? {} : { cursor: request.cursor },
|
|
1068
|
+
...request.maxNodes === void 0 ? {} : { maxNodes: request.maxNodes }
|
|
1069
|
+
});
|
|
1070
|
+
const frame = this.frameState();
|
|
1071
|
+
return frame === void 0 ? snapshot : {
|
|
1072
|
+
...snapshot,
|
|
1073
|
+
frame
|
|
1074
|
+
};
|
|
1075
|
+
}
|
|
1076
|
+
case "frame": {
|
|
1077
|
+
const control = this.options.frame?.();
|
|
1078
|
+
if (control === void 0) throw new UiControlError("not-actionable", "this page is not inside the ACRYL frame (it runs on its own), so there is no frame to operate");
|
|
1079
|
+
return {
|
|
1080
|
+
ok: true,
|
|
1081
|
+
detail: await control.run(request)
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1069
1084
|
case "click": return await this.watchLeaving(() => click(this.env, request), signal);
|
|
1070
1085
|
case "type": return await this.watchLeaving(() => typeText(this.env, request), signal);
|
|
1071
1086
|
case "select": return selectOption(this.env, request);
|
|
@@ -1076,6 +1091,14 @@ var UiDriver = class {
|
|
|
1076
1091
|
case "navigate": return this.leave({ path: request.path }, `going to ${request.path}`);
|
|
1077
1092
|
}
|
|
1078
1093
|
}
|
|
1094
|
+
/** The frame's state, or undefined when the page is not in a frame or the frame cannot be read. */
|
|
1095
|
+
frameState() {
|
|
1096
|
+
try {
|
|
1097
|
+
return this.options.frame?.()?.state();
|
|
1098
|
+
} catch {
|
|
1099
|
+
return;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1079
1102
|
/**
|
|
1080
1103
|
* Run an act that may start a navigation (a click on a link, Enter in a form) and say so: the browser asks `beforeunload` when a navigation starts, during the act or a
|
|
1081
1104
|
* moment after it. The answer is sent before the page goes; the Host then waits for the next page instead of reading this one again.
|
package/lib/door/protocol.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
export { APP_PATH, AuditEntry, ChannelToHost, ChannelToPage, DEFAULT_SNAPSHOT_NODES, MAX_SNAPSHOT_NODES, MAX_TEXT_LENGTH, MAX_WAIT_MS, MUTATING_OPS, UI_ERROR_CODES, UI_OPS, UiActionResult, UiControlError, UiErrorCode, UiNode, UiOp, UiRequest, UiResult, UiSnapshot, WINDOW_ID, parseChannelToHost, parseChannelToPage, parseUiRequest };
|
|
1
|
+
import { C as UiRequest, D as parseChannelToHost, E as WINDOW_ID, O as parseChannelToPage, S as UiOp, T as UiSnapshot, _ as UI_OPS, a as DEFAULT_SNAPSHOT_NODES, b as UiErrorCode, c as FrameAction, d as FrameState, f as MAX_SNAPSHOT_NODES, g as UI_ERROR_CODES, h as MUTATING_OPS, i as ChannelToPage, k as parseUiRequest, l as FrameControl, m as MAX_WAIT_MS, n as AuditEntry, o as FRAME_ACTIONS, p as MAX_TEXT_LENGTH, r as ChannelToHost, s as FRAME_CONTROL_KEY, t as APP_PATH, u as FramePanel, v as UiActionResult, w as UiResult, x as UiNode, y as UiControlError } from "../protocol-CbLZdkJ5.js";
|
|
2
|
+
export { APP_PATH, AuditEntry, ChannelToHost, ChannelToPage, DEFAULT_SNAPSHOT_NODES, FRAME_ACTIONS, FRAME_CONTROL_KEY, FrameAction, FrameControl, FramePanel, FrameState, MAX_SNAPSHOT_NODES, MAX_TEXT_LENGTH, MAX_WAIT_MS, MUTATING_OPS, UI_ERROR_CODES, UI_OPS, UiActionResult, UiControlError, UiErrorCode, UiNode, UiOp, UiRequest, UiResult, UiSnapshot, WINDOW_ID, parseChannelToHost, parseChannelToPage, parseUiRequest };
|
package/lib/door/protocol.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { APP_PATH, DEFAULT_SNAPSHOT_NODES, MAX_SNAPSHOT_NODES, MAX_TEXT_LENGTH, MAX_WAIT_MS, MUTATING_OPS, UI_ERROR_CODES, UI_OPS, UiControlError, WINDOW_ID, parseChannelToHost, parseChannelToPage, parseUiRequest };
|
|
1
|
+
import { a as MAX_SNAPSHOT_NODES, c as MUTATING_OPS, d as UiControlError, f as WINDOW_ID, h as parseUiRequest, i as FRAME_CONTROL_KEY, l as UI_ERROR_CODES, m as parseChannelToPage, n as DEFAULT_SNAPSHOT_NODES, o as MAX_TEXT_LENGTH, p as parseChannelToHost, r as FRAME_ACTIONS, s as MAX_WAIT_MS, t as APP_PATH, u as UI_OPS } from "../protocol-BKXK53WF.js";
|
|
2
|
+
export { APP_PATH, DEFAULT_SNAPSHOT_NODES, FRAME_ACTIONS, FRAME_CONTROL_KEY, MAX_SNAPSHOT_NODES, MAX_TEXT_LENGTH, MAX_WAIT_MS, MUTATING_OPS, UI_ERROR_CODES, UI_OPS, UiControlError, WINDOW_ID, parseChannelToHost, parseChannelToPage, parseUiRequest };
|
|
@@ -6,6 +6,20 @@
|
|
|
6
6
|
* Everything crossing the channel is validated here once, so neither side trusts the other's JSON. The page imports this file too, so it
|
|
7
7
|
* lives with the page code and has no Node imports.
|
|
8
8
|
*/
|
|
9
|
+
/**
|
|
10
|
+
* The ACRYL frame around a canvas page: its own panels, mode and Settings, which are not part of the app's page. The frame publishes a
|
|
11
|
+
* {@link FrameControl} on its window under {@link FRAME_CONTROL_KEY}; the door's page script, running in the canvas, reaches it as `window.parent`.
|
|
12
|
+
*/
|
|
13
|
+
const FRAME_CONTROL_KEY = Symbol.for("acryl.frame.control");
|
|
14
|
+
const FRAME_ACTIONS = [
|
|
15
|
+
"state",
|
|
16
|
+
"open",
|
|
17
|
+
"close",
|
|
18
|
+
"toggle",
|
|
19
|
+
"settings",
|
|
20
|
+
"build",
|
|
21
|
+
"preview"
|
|
22
|
+
];
|
|
9
23
|
/** The operations the driver performs on the page. */
|
|
10
24
|
const UI_OPS = [
|
|
11
25
|
"snapshot",
|
|
@@ -16,7 +30,8 @@ const UI_OPS = [
|
|
|
16
30
|
"scroll",
|
|
17
31
|
"wait",
|
|
18
32
|
"reload",
|
|
19
|
-
"navigate"
|
|
33
|
+
"navigate",
|
|
34
|
+
"frame"
|
|
20
35
|
];
|
|
21
36
|
/** Operations that change the page, so each call needs approval. `snapshot`, `scroll` and `wait` only look. */
|
|
22
37
|
const MUTATING_OPS = [
|
|
@@ -25,7 +40,8 @@ const MUTATING_OPS = [
|
|
|
25
40
|
"select",
|
|
26
41
|
"press",
|
|
27
42
|
"reload",
|
|
28
|
-
"navigate"
|
|
43
|
+
"navigate",
|
|
44
|
+
"frame"
|
|
29
45
|
];
|
|
30
46
|
/** A place in the app to go to: a path on the page's own origin (`/demo`, `/notes?q=a#top`), never another site and never a `//host` address. */
|
|
31
47
|
const APP_PATH = /^\/(?![/\\])[^\0\\]{0,2000}$/u;
|
|
@@ -158,6 +174,26 @@ function parseUiRequest(value) {
|
|
|
158
174
|
op,
|
|
159
175
|
path: value.path
|
|
160
176
|
};
|
|
177
|
+
case "frame": {
|
|
178
|
+
only([
|
|
179
|
+
"action",
|
|
180
|
+
"panel",
|
|
181
|
+
"section"
|
|
182
|
+
]);
|
|
183
|
+
const action = value.action === void 0 ? "state" : value.action;
|
|
184
|
+
if (!FRAME_ACTIONS.includes(action)) return invalid(`frame action must be one of ${FRAME_ACTIONS.join(", ")}`);
|
|
185
|
+
const panel = value.panel;
|
|
186
|
+
if (panel !== void 0 && panel !== "left" && panel !== "right") return invalid("panel must be left or right");
|
|
187
|
+
if ((action === "open" || action === "close" || action === "toggle") && panel === void 0) return invalid(`frame ${String(action)} needs a panel: left (branches and versions) or right (the agents)`);
|
|
188
|
+
const section = value.section === void 0 ? void 0 : text(value.section, 80);
|
|
189
|
+
if (section !== void 0 && action !== "settings") return invalid("section goes with settings");
|
|
190
|
+
return {
|
|
191
|
+
op,
|
|
192
|
+
action,
|
|
193
|
+
...panel === void 0 ? {} : { panel },
|
|
194
|
+
...section === void 0 ? {} : { section }
|
|
195
|
+
};
|
|
196
|
+
}
|
|
161
197
|
default: return invalid(`unknown op ${String(op)}`);
|
|
162
198
|
}
|
|
163
199
|
}
|
|
@@ -214,4 +250,4 @@ function parseChannelToHost(value) {
|
|
|
214
250
|
return null;
|
|
215
251
|
}
|
|
216
252
|
//#endregion
|
|
217
|
-
export {
|
|
253
|
+
export { MAX_SNAPSHOT_NODES as a, MUTATING_OPS as c, UiControlError as d, WINDOW_ID as f, parseUiRequest as h, FRAME_CONTROL_KEY as i, UI_ERROR_CODES as l, parseChannelToPage as m, DEFAULT_SNAPSHOT_NODES as n, MAX_TEXT_LENGTH as o, parseChannelToHost as p, FRAME_ACTIONS as r, MAX_WAIT_MS as s, APP_PATH as t, UI_OPS as u };
|
|
@@ -6,8 +6,30 @@
|
|
|
6
6
|
* Everything crossing the channel is validated here once, so neither side trusts the other's JSON. The page imports this file too, so it
|
|
7
7
|
* lives with the page code and has no Node imports.
|
|
8
8
|
*/
|
|
9
|
+
/**
|
|
10
|
+
* The ACRYL frame around a canvas page: its own panels, mode and Settings, which are not part of the app's page. The frame publishes a
|
|
11
|
+
* {@link FrameControl} on its window under {@link FRAME_CONTROL_KEY}; the door's page script, running in the canvas, reaches it as `window.parent`.
|
|
12
|
+
*/
|
|
13
|
+
declare const FRAME_CONTROL_KEY: symbol;
|
|
14
|
+
declare const FRAME_ACTIONS: readonly ["state", "open", "close", "toggle", "settings", "build", "preview"];
|
|
15
|
+
type FrameAction = (typeof FRAME_ACTIONS)[number];
|
|
16
|
+
type FramePanel = 'left' | 'right';
|
|
17
|
+
/** What the frame shows: its left panel (branches and versions), its right panel (the agents), its mode, and whether Settings is open. */
|
|
18
|
+
interface FrameState {
|
|
19
|
+
readonly left: boolean;
|
|
20
|
+
readonly right: boolean;
|
|
21
|
+
readonly mode: 'build' | 'preview';
|
|
22
|
+
readonly settings: boolean;
|
|
23
|
+
}
|
|
24
|
+
interface FrameControl {
|
|
25
|
+
state(): FrameState;
|
|
26
|
+
/** Do one frame action; the answer says what changed. @throws Error with a reason a person can read. */
|
|
27
|
+
run(request: Extract<UiRequest, {
|
|
28
|
+
readonly op: 'frame';
|
|
29
|
+
}>): string | Promise<string>;
|
|
30
|
+
}
|
|
9
31
|
/** The operations the driver performs on the page. */
|
|
10
|
-
declare const UI_OPS: readonly ["snapshot", "click", "type", "select", "press", "scroll", "wait", "reload", "navigate"];
|
|
32
|
+
declare const UI_OPS: readonly ["snapshot", "click", "type", "select", "press", "scroll", "wait", "reload", "navigate", "frame"];
|
|
11
33
|
type UiOp = (typeof UI_OPS)[number];
|
|
12
34
|
/** Operations that change the page, so each call needs approval. `snapshot`, `scroll` and `wait` only look. */
|
|
13
35
|
declare const MUTATING_OPS: readonly UiOp[];
|
|
@@ -47,6 +69,8 @@ interface UiSnapshot {
|
|
|
47
69
|
readonly total: number;
|
|
48
70
|
/** Pass to the next snapshot call to continue, or absent when this is everything. */
|
|
49
71
|
readonly nextCursor?: number;
|
|
72
|
+
/** The ACRYL frame around this page, when the page is in one. */
|
|
73
|
+
readonly frame?: FrameState;
|
|
50
74
|
}
|
|
51
75
|
type UiRequest = {
|
|
52
76
|
readonly op: 'snapshot';
|
|
@@ -86,6 +110,11 @@ type UiRequest = {
|
|
|
86
110
|
} | {
|
|
87
111
|
readonly op: 'navigate';
|
|
88
112
|
readonly path: string;
|
|
113
|
+
} | {
|
|
114
|
+
readonly op: 'frame';
|
|
115
|
+
readonly action: FrameAction;
|
|
116
|
+
readonly panel?: FramePanel;
|
|
117
|
+
readonly section?: string;
|
|
89
118
|
};
|
|
90
119
|
/** What the page did, and to which control (for the audit log and the approval prompt). */
|
|
91
120
|
interface UiActionResult {
|
|
@@ -157,4 +186,4 @@ interface AuditEntry {
|
|
|
157
186
|
readonly approval: 'asked' | 'none' | 'not-needed' | 'token';
|
|
158
187
|
}
|
|
159
188
|
//#endregion
|
|
160
|
-
export {
|
|
189
|
+
export { UiRequest as C, parseChannelToHost as D, WINDOW_ID as E, parseChannelToPage as O, UiOp as S, UiSnapshot as T, UI_OPS as _, DEFAULT_SNAPSHOT_NODES as a, UiErrorCode as b, FrameAction as c, FrameState as d, MAX_SNAPSHOT_NODES as f, UI_ERROR_CODES as g, MUTATING_OPS as h, ChannelToPage as i, parseUiRequest as k, FrameControl as l, MAX_WAIT_MS as m, AuditEntry as n, FRAME_ACTIONS as o, MAX_TEXT_LENGTH as p, ChannelToHost as r, FRAME_CONTROL_KEY as s, APP_PATH as t, FramePanel as u, UiActionResult as v, UiResult as w, UiNode as x, UiControlError as y };
|
|
@@ -4,7 +4,7 @@ import { t as methodNotAllowed } from "./method-not-allowed-B3nMAp1f.js";
|
|
|
4
4
|
import { r as streamSSE } from "./streaming-CL2i3hX_.js";
|
|
5
5
|
import { a as loopbackOnly, i as loopbackAuthority } from "./loopback-only-0nTL30Zt.js";
|
|
6
6
|
import "./helpers-qmReU164.js";
|
|
7
|
-
import { d as
|
|
7
|
+
import { d as UiControlError, f as WINDOW_ID, p as parseChannelToHost } from "./protocol-BKXK53WF.js";
|
|
8
8
|
import "./src-BycZ1HUQ.js";
|
|
9
9
|
import "./middleware-B8gJUDgl.js";
|
|
10
10
|
import { dirname, join } from "node:path";
|
|
@@ -591,7 +591,7 @@ function renderSnapshot(snapshot, more = (cursor) => `call ui_snapshot with curs
|
|
|
591
591
|
return `${" ".repeat(Math.min(node.depth, 8))}- ${node.role}${node.name === "" ? "" : ` ${JSON.stringify(node.name)}`}${level}${states}${value}${options} [ref=${node.ref}]`;
|
|
592
592
|
});
|
|
593
593
|
const rest = snapshot.nextCursor === void 0 ? "" : `\n(${String(snapshot.total - snapshot.nextCursor)} more elements; ${more(snapshot.nextCursor)})`;
|
|
594
|
-
return `Page: ${snapshot.title || "(untitled)"}\nSnapshot ${String(snapshot.generation)}, ${String(snapshot.nodes.length)} of ${String(snapshot.total)} elements:\n${lines.join("\n")}${rest}`;
|
|
594
|
+
return `${snapshot.frame === void 0 ? "" : `Frame (the ACRYL window around the app, not part of the app): left panel (branches, versions) ${snapshot.frame.left ? "open" : "closed"}, right panel (agents) ${snapshot.frame.right ? "open" : "closed"}, ${snapshot.frame.mode} mode${snapshot.frame.settings ? ", Settings open" : ""}. Operate it with frame (open|close|toggle left|right, settings [section], build, preview), never by editing code.\n`}Page: ${snapshot.title || "(untitled)"}\nSnapshot ${String(snapshot.generation)}, ${String(snapshot.nodes.length)} of ${String(snapshot.total)} elements:\n${lines.join("\n")}${rest}`;
|
|
595
595
|
}
|
|
596
596
|
//#endregion
|
|
597
597
|
export { INVALID_JSON as a, operatorOnly as c, AuditLog as d, auditPath as f, DOOR_PREFIX as i, privateApi as l, HEARTBEAT_MS as n, error as o, UiChannel as p, pageChannelRoutes as r, jsonBody as s, renderSnapshot as t, readJson as u };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs'
|
|
2
|
+
import { resolve } from 'node:path'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The `--from` a packer hands to create: an existing folder as an absolute path, anything else (a registry id such as acrylblends.small-crm) as given.
|
|
6
|
+
* create takes a folder source only when it is written as one (./x, ../x, /x, C:\x), so a template name is never read as a folder; a release workflow
|
|
7
|
+
* passes apps/<product> bare, which create would refuse as an unknown source (product-release run 44482560217 failed that way on all six runners).
|
|
8
|
+
*/
|
|
9
|
+
export function createSource(from, cwd = process.cwd()) {
|
|
10
|
+
const folder = resolve(cwd, from)
|
|
11
|
+
return existsSync(folder) ? folder : from
|
|
12
|
+
}
|