@acryldev/blends-frame 0.1.6 → 0.2.1
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/README.md +4 -4
- package/cordis.patch.yml +1 -1
- package/lib/app-plugins.d.ts +1 -1
- package/lib/app-share.d.ts +22 -0
- package/lib/auto-save.d.ts +1 -1
- package/lib/client.js +323 -49
- package/lib/client.js.map +1 -1
- package/lib/contract.d.ts +26 -0
- package/lib/git-sync.d.ts +1 -1
- package/lib/index.d.ts +7 -4
- package/lib/index.js +166 -24
- package/lib/index.js.map +1 -1
- package/lib/types/client/SettingsLauncher.d.ts +1 -1
- package/lib/types/client/ShareAppSection.d.ts +20 -0
- package/lib/types/client/ShareChooser.d.ts +10 -0
- package/lib/types/client/canvas/app-canvas.d.ts +1 -1
- package/lib/types/client/chat-draft.d.ts +1 -1
- package/lib/types/client/chats.d.ts +1 -1
- package/lib/types/client/desktop-app.d.ts +1 -1
- package/lib/types/client/frame-state.d.ts +13 -1
- package/lib/types/client/index.d.ts +2 -2
- package/lib/types/client/tools.d.ts +1 -1
- package/lib/types/client/versions.d.ts +1 -1
- package/lib/types/contract.d.ts +26 -0
- package/package.json +21 -22
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @acryldev/blends-frame
|
|
2
2
|
|
|
3
3
|
The workbench around an app made with ACRYL Blends, as the owner's mockup draws it (`docs/design/blends-frame-mockup.html`):
|
|
4
4
|
|
|
@@ -18,14 +18,14 @@ through `window.parent`; a page opened directly is unchanged.
|
|
|
18
18
|
|
|
19
19
|
A feedback note shows its screenshot as a thumbnail, and handing it to the chat puts the page and selector text in the composer with the picture as a real attachment. Settings > Plugins shares a local plugin: the frame packages it under the app's home (`plugin-packages/<name>`; the builder's package shape,
|
|
20
20
|
plus the Loader patch the plugin-hub needs) and first says what it will do, for example "Create repository ana/notes on GitHub and publish
|
|
21
|
-
v0.1.0? It will be private.", with Cancel as the default. Only on the person's yes does it publish, with `@
|
|
21
|
+
v0.1.0? It will be private.", with Cancel as the default. Only on the person's yes does it publish, with `@acryldev/plugin-hub-core` through the user's
|
|
22
22
|
own `gh` and `git`, exactly that repository, version and visibility; when the plan changed meanwhile nothing is sent. The Host refuses a share
|
|
23
23
|
that does not carry the confirmed plan. The row then shows the repository and version. A second app installs it with `acrylblends add <the
|
|
24
24
|
package folder>`; the plugin-hub refuses a package with secrets before anything is sent. `shareOwner` in the frame row's config names the GitHub
|
|
25
25
|
account or organization (the signed-in account when absent); a rehearsal sets a test organization there (`shareOwner: inboxxobni`). A version
|
|
26
26
|
already released there is planned as the next patch, and the question says so.
|
|
27
27
|
|
|
28
|
-
It owns the page's `root` slot, so it is mounted instead of the IDE's workbench (
|
|
28
|
+
It owns the page's `root` slot, so it is mounted instead of the IDE's workbench (`@acryldev/workspace`), never beside it. The Host half serves one
|
|
29
29
|
private route, `GET /api/acryl-blends-frame/state` (the app's name, folder, page and branches); `appPage` in the row's config says where the
|
|
30
30
|
app's page is served.
|
|
31
31
|
|
|
@@ -92,7 +92,7 @@ line typed in an editor or a `git switch` shows in the canvas without a restart
|
|
|
92
92
|
the Host loads the app's code again whenever `blend.yaml` or a file under `src/` or `plugins/` changes, whoever changed it (300 ms after the last
|
|
93
93
|
change).
|
|
94
94
|
|
|
95
|
-
How it works: the launcher (`scripts/ide-host.mjs`) loads
|
|
95
|
+
How it works: the launcher (`scripts/ide-host.mjs`) loads `@acryldev/blends-frame/app-generation` before anything of the app does. It installs a resolve
|
|
96
96
|
hook that, once the Host raises the generation, gives every file of the app's `src/`, of its own plugins (the
|
|
97
97
|
folders of `plugins/` that `plugins/library.json` does not list) and of the generated `frame/` rows a `?gen=N` query, so a new import of them - and
|
|
98
98
|
of everything they import - is a fresh copy. Nothing in `node_modules` or the library copies in `plugins/` gets one, so their services stay single
|
package/cordis.patch.yml
CHANGED
package/lib/app-plugins.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* `extensions` row finds it). `blend.yaml` is edited by lines, so its comments and layout stay as the person wrote them. The running app takes a
|
|
5
5
|
* switch when its Loader row (`app-plugins`) loads again, which the client asks for.
|
|
6
6
|
*/
|
|
7
|
-
import { type PublishGitPort, type RepositoryHostPort } from '@
|
|
7
|
+
import { type PublishGitPort, type RepositoryHostPort } from '@acryldev/plugin-hub-core';
|
|
8
8
|
import { type AppPluginView, type FramePluginState, type FramePluginView, type SavedPluginResult, type SavedPluginView, type ShareVisibility, type SharedPluginView, type SharePlan } from './contract.ts';
|
|
9
9
|
/** One row of `blend.yaml`'s `spec.rows`: where its block starts and ends (line indexes, end exclusive). */
|
|
10
10
|
export interface BlendRow {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Share the whole app to GitHub from Settings > Share, through the app's own share command (`plugins/save/share-cli.ts`, the save plugin): the
|
|
3
|
+
* same command `npm run share` and ACRYL Control Center's Share run, so the rules (a plan first, sent only on the person's yes, refused on a
|
|
4
|
+
* secret, visibility kept in blend.yaml) live in one place. The command runs on the Node.js this host runs on (inside a desktop product that is
|
|
5
|
+
* Electron's, as Node).
|
|
6
|
+
*/
|
|
7
|
+
import { type AppSharePlanView, type AppShareRequest, type AppSharedView } from './contract.ts';
|
|
8
|
+
export declare const SHARE_COMMAND: string;
|
|
9
|
+
/** A share the app refused, in its own words (not signed in, a secret in a file, the app changed since the plan). */
|
|
10
|
+
export declare class AppShareRefused extends Error {
|
|
11
|
+
}
|
|
12
|
+
export interface AppSharePort {
|
|
13
|
+
plan(request: AppShareRequest): Promise<AppSharePlanView>;
|
|
14
|
+
share(request: AppShareRequest, confirmed: AppSharePlanView): Promise<AppSharedView>;
|
|
15
|
+
}
|
|
16
|
+
type Run = (args: readonly string[]) => Promise<{
|
|
17
|
+
readonly code: number | null;
|
|
18
|
+
readonly stdout: string;
|
|
19
|
+
readonly stderr: string;
|
|
20
|
+
}>;
|
|
21
|
+
export declare function appShareCommand(root: string, env?: NodeJS.ProcessEnv, run?: Run): AppSharePort;
|
|
22
|
+
export {};
|
package/lib/auto-save.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* The turn-end signal is DSH's own: its `workspace-changes` plugin diffs the working tree around every turn (the person's earlier unsaved edits never
|
|
7
7
|
* enter a turn's list) and appends a `workspace/changes` session event only when files changed, so a turn that changed nothing makes no version here.
|
|
8
|
-
* The Host hears that event on `session/event`, reads the turn's file list from `ctx.workspaceChanges.summary`, and saves through
|
|
8
|
+
* The Host hears that event on `session/event`, reads the turn's file list from `ctx.workspaceChanges.summary`, and saves through `@acryldev/versions`.
|
|
9
9
|
*/
|
|
10
10
|
import type { TurnSaveView } from './contract.ts';
|
|
11
11
|
/** The person's request, shortened into a version's name: its first sentence or clause, one line, cut at a word. */
|