@acryldev/blends-frame 0.2.7 → 0.2.9
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/lib/client.js +155 -20
- package/lib/client.js.map +1 -1
- package/lib/contract.d.ts +9 -1
- package/lib/github-connect.d.ts +39 -22
- package/lib/index.d.ts +4 -2
- package/lib/index.js +150 -116
- package/lib/index.js.map +1 -1
- package/lib/types/client/frame-control.d.ts +39 -0
- package/lib/types/client/plugins-navigator.d.ts +5 -4
- package/lib/types/client/registry-api.d.ts +2 -0
- package/lib/types/contract.d.ts +9 -1
- package/package.json +3 -2
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The frame's own UI, operable by the agent (the door's `frame` verb): the left panel (branches and versions), the right panel (the agents), Build and
|
|
3
|
+
* Preview, and Settings. These are not part of the app page, so the door's page script, which runs in the canvas page, cannot see or click them; the
|
|
4
|
+
* frame publishes this control on its own window and the page reaches it through `window.parent`, the way {@link installFrameView} publishes the mode.
|
|
5
|
+
* The shapes match the door's page protocol (plugins/door/src/page/protocol.ts: `FRAME_CONTROL_KEY`, `FrameControl`); keep them in step.
|
|
6
|
+
*/
|
|
7
|
+
import type { FrameMode } from './view-state.ts';
|
|
8
|
+
export declare const FRAME_CONTROL_KEY: symbol;
|
|
9
|
+
export type FramePanel = 'left' | 'right';
|
|
10
|
+
export interface FrameControlState {
|
|
11
|
+
readonly left: boolean;
|
|
12
|
+
readonly right: boolean;
|
|
13
|
+
readonly mode: FrameMode;
|
|
14
|
+
readonly settings: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface FrameControlRequest {
|
|
17
|
+
readonly action: 'state' | 'open' | 'close' | 'toggle' | 'settings' | 'build' | 'preview';
|
|
18
|
+
readonly panel?: FramePanel;
|
|
19
|
+
readonly section?: string;
|
|
20
|
+
}
|
|
21
|
+
/** The part of the frame's view state the control uses (./view-state.ts). */
|
|
22
|
+
export interface FrameControlView {
|
|
23
|
+
getSnapshot(): {
|
|
24
|
+
readonly left: boolean;
|
|
25
|
+
readonly right: boolean;
|
|
26
|
+
readonly mode: FrameMode;
|
|
27
|
+
};
|
|
28
|
+
toggleLeft(): void;
|
|
29
|
+
toggleRight(): void;
|
|
30
|
+
showLeft(): void;
|
|
31
|
+
showRight(): void;
|
|
32
|
+
setMode(mode: FrameMode): void;
|
|
33
|
+
}
|
|
34
|
+
export declare function frameControl(view: FrameControlView, doc?: Document): {
|
|
35
|
+
state(): FrameControlState;
|
|
36
|
+
run(request: FrameControlRequest): Promise<string>;
|
|
37
|
+
};
|
|
38
|
+
/** Publish the control on the frame's window. @returns the disposer. */
|
|
39
|
+
export declare function installFrameControl(view: FrameControlView): () => void;
|
|
@@ -8,8 +8,9 @@ import { type AppPluginKind, type AppPluginsView, type AppPluginView, type Frame
|
|
|
8
8
|
export type ShareTarget = ShareVisibility | 'registry';
|
|
9
9
|
/** Sharing a local plugin: first what it would do, then, on the person's yes, exactly that. */
|
|
10
10
|
export interface PluginShare {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/** `owner`: the GitHub account or organization to share to; absent means the person's own. */
|
|
12
|
+
plan(target?: ShareTarget, owner?: string): Promise<SharePlan>;
|
|
13
|
+
publish(confirmed: SharePlan, owner?: string): Promise<SharedPluginView>;
|
|
13
14
|
}
|
|
14
15
|
/** What the person can do with one local plugin besides sharing it: keep a packed copy on this machine, and look at its code. */
|
|
15
16
|
export interface PluginActions {
|
|
@@ -71,9 +72,9 @@ export interface AppPluginsApi {
|
|
|
71
72
|
read(): Promise<AppPluginsView>;
|
|
72
73
|
switch(kind: AppPluginKind, name: string, on: boolean): Promise<void>;
|
|
73
74
|
/** What sharing one local plugin would do (private unless `visibility` says public); nothing is sent. */
|
|
74
|
-
planShare(name: string, target?: ShareTarget): Promise<SharePlan>;
|
|
75
|
+
planShare(name: string, target?: ShareTarget, owner?: string): Promise<SharePlan>;
|
|
75
76
|
/** Share one local plugin as the person confirmed it; answers where it went. */
|
|
76
|
-
share(name: string, confirmed: SharePlan): Promise<SharedPluginView>;
|
|
77
|
+
share(name: string, confirmed: SharePlan, owner?: string): Promise<SharedPluginView>;
|
|
77
78
|
/** Keep a packed copy of one local plugin on this machine. */
|
|
78
79
|
save(name: string): Promise<SavedPluginResult>;
|
|
79
80
|
}
|
|
@@ -16,6 +16,8 @@ export interface GithubConnectApi {
|
|
|
16
16
|
start(): Promise<GithubConnectState>;
|
|
17
17
|
/** Where the sign-in is now. */
|
|
18
18
|
state(): Promise<GithubConnectState>;
|
|
19
|
+
/** Forget the GitHub connection ACRYL made (in Control Center too); answers with the readiness that is left. */
|
|
20
|
+
disconnect(): Promise<GithubReadiness>;
|
|
19
21
|
}
|
|
20
22
|
export declare function createRegistryApi(fetcher?: FetchLike): RegistryApi;
|
|
21
23
|
export {};
|
package/lib/types/contract.d.ts
CHANGED
|
@@ -195,6 +195,11 @@ export interface AppSharedView {
|
|
|
195
195
|
}
|
|
196
196
|
export declare function parseAppSharePlan(value: unknown): AppSharePlanView;
|
|
197
197
|
export declare function parseAppShared(value: unknown): AppSharedView;
|
|
198
|
+
/**
|
|
199
|
+
* The GitHub account or organization a person typed to share a plugin to (blank: theirs). `undefined` when none was asked, `null` when what came is not a GitHub name
|
|
200
|
+
* (it goes to a command line: only a name that cannot start with a dash or hold a space or a slash).
|
|
201
|
+
*/
|
|
202
|
+
export declare function parseShareOwner(value: unknown): string | undefined | null;
|
|
198
203
|
export declare function parseAppShareRequest(value: unknown): AppShareRequest | undefined;
|
|
199
204
|
export declare const FRAME_PLUGINS_SHARE_PLAN_PATH = "/api/acryl-blends-frame/plugins/share-plan";
|
|
200
205
|
/** POST `{ name, confirm }`: publish it, only when `confirm` is the plan the person said yes to and it still holds. */
|
|
@@ -434,9 +439,12 @@ export interface PulledPluginView {
|
|
|
434
439
|
/** @throws when the value is not what a pull answers. */
|
|
435
440
|
export declare function parsePulledPlugin(value: unknown): PulledPluginView;
|
|
436
441
|
/** Whether the person can share to GitHub now, and when not, the single thing to do about it. */
|
|
437
|
-
export type GithubReadiness =
|
|
442
|
+
export type GithubReadiness =
|
|
443
|
+
/** `via: 'acryl'`: the connection made with ACRYL's own sign-in (shared with Control Center), which the person can disconnect; absent: gh's own login or the person's own token. */
|
|
444
|
+
{
|
|
438
445
|
readonly status: 'ready';
|
|
439
446
|
readonly account: string;
|
|
447
|
+
readonly via?: 'acryl';
|
|
440
448
|
} | {
|
|
441
449
|
readonly status: 'signed-out';
|
|
442
450
|
readonly say: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acryldev/blends-frame",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"description": "ACRYL Blends frame: the workbench around an app being built - a top bar, the branches and versions on the left, the app alone in the centre, and the agents on the right - as one Cordis plugin with a Host and a client half",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"node": "^22.19.0 || >=24.0.0"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
+
"@acryldev/app-persistence": "^0.1.5",
|
|
55
56
|
"@acryldev/app-shell": "0.2.1",
|
|
56
57
|
"@acryldev/blends-core": "^0.6.0",
|
|
57
58
|
"@acryldev/loopback-http": "0.2.0",
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
"react-dom": "18.3.1"
|
|
71
72
|
},
|
|
72
73
|
"devDependencies": {
|
|
73
|
-
"@acryldev/blends": "1.7.
|
|
74
|
+
"@acryldev/blends": "1.7.11",
|
|
74
75
|
"@acryldev/ui": "0.4.0",
|
|
75
76
|
"@deepseek-ai/cordis": "4.0.4",
|
|
76
77
|
"@deepseek-ai/cordis-plugin-loader": "1.0.5",
|