@acrylblends/blends-frame 0.1.1 → 0.1.3
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/app-plugins.d.ts +32 -5
- package/lib/client.js +31886 -367
- package/lib/client.js.map +1 -1
- package/lib/contract.d.ts +116 -0
- package/lib/github-connect.d.ts +44 -0
- package/lib/graph-contract.d.ts +85 -0
- package/lib/graph-inspect.d.ts +16 -0
- package/lib/index.d.ts +20 -3
- package/lib/index.js +1040 -36
- package/lib/index.js.map +1 -1
- package/lib/plain.d.ts +26 -0
- package/lib/plugin-graph.d.ts +38 -0
- package/lib/registry.d.ts +71 -0
- package/lib/types/client/AppSection.d.ts +10 -0
- package/lib/types/client/BlendsFrame.d.ts +7 -1
- package/lib/types/client/GraphView.d.ts +22 -0
- package/lib/types/client/NameYourApp.d.ts +10 -0
- package/lib/types/client/PluginsSection.d.ts +11 -1
- package/lib/types/client/RegistryView.d.ts +11 -0
- package/lib/types/client/SettingsExpand.d.ts +6 -0
- package/lib/types/client/ShareChooser.d.ts +21 -0
- package/lib/types/client/desktop-app.d.ts +65 -0
- package/lib/types/client/graph-api.d.ts +11 -0
- package/lib/types/client/graph-canvas.d.ts +63 -0
- package/lib/types/client/graph-link.d.ts +21 -0
- package/lib/types/client/graph-model.d.ts +23 -0
- package/lib/types/client/graph-styles.d.ts +3 -0
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/plain-failure.d.ts +10 -0
- package/lib/types/client/plugins-navigator.d.ts +37 -7
- package/lib/types/client/registry-api.d.ts +21 -0
- package/lib/types/client/registry-list.d.ts +14 -0
- package/lib/types/client/settings-fullscreen.d.ts +13 -0
- package/lib/types/client/theme-switch.d.ts +27 -0
- package/lib/types/contract.d.ts +116 -0
- package/lib/types/graph-contract.d.ts +85 -0
- package/lib/types/graph-inspect.d.ts +16 -0
- package/package.json +9 -7
package/lib/contract.d.ts
CHANGED
|
@@ -147,12 +147,35 @@ export declare const FRAME_PLUGINS_SWITCH_PATH = "/api/acryl-blends-frame/plugin
|
|
|
147
147
|
export declare const FRAME_PLUGINS_SHARE_PLAN_PATH = "/api/acryl-blends-frame/plugins/share-plan";
|
|
148
148
|
/** POST `{ name, confirm }`: publish it, only when `confirm` is the plan the person said yes to and it still holds. */
|
|
149
149
|
export declare const FRAME_PLUGINS_SHARE_PATH = "/api/acryl-blends-frame/plugins/share";
|
|
150
|
+
/** POST `{ name }`: keep a packed copy of this local plugin on this machine (the app's plugin store); nothing leaves the machine. */
|
|
151
|
+
export declare const FRAME_PLUGINS_SAVE_PATH = "/api/acryl-blends-frame/plugins/save";
|
|
152
|
+
/** GET: the public plugin registry (cordisplugins.github.io), each entry marked when this app already has it; read fresh by the Host, never by the page. */
|
|
153
|
+
export declare const FRAME_PLUGINS_REGISTRY_PATH = "/api/acryl-blends-frame/plugins/registry";
|
|
154
|
+
/** GET: whether this computer can share to GitHub (the helper program is installed and signed in), read before the person is asked anything. */
|
|
155
|
+
export declare const FRAME_PLUGINS_GITHUB_PATH = "/api/acryl-blends-frame/plugins/github";
|
|
156
|
+
/** POST: start GitHub's browser sign-in (a one-time code for github.com/login/device); GET: where it is; DELETE: stop one still waiting. */
|
|
157
|
+
export declare const FRAME_PLUGINS_GITHUB_CONNECT_PATH = "/api/acryl-blends-frame/plugins/github/connect";
|
|
158
|
+
/** POST `{ source }`: pull one released plugin (`github:<owner>/<repo>@<version>`) into the running app, through the app's plugin-share checks. */
|
|
159
|
+
export declare const FRAME_PLUGINS_PULL_PATH = "/api/acryl-blends-frame/plugins/pull";
|
|
160
|
+
/** A packed copy of a plugin kept on this machine: its version and where the tarball is. */
|
|
161
|
+
export interface SavedPluginView {
|
|
162
|
+
readonly version: string;
|
|
163
|
+
/** Absolute path of the packed copy (the store's `.tgz`). */
|
|
164
|
+
readonly path: string;
|
|
165
|
+
}
|
|
166
|
+
/** What a save did: the copy, whether it is new, and whether the version was raised because that version was already saved with other content. */
|
|
167
|
+
export interface SavedPluginResult extends SavedPluginView {
|
|
168
|
+
readonly added: boolean;
|
|
169
|
+
readonly bumped: boolean;
|
|
170
|
+
}
|
|
150
171
|
/** Where a shared plugin went: its GitHub repository and the released version other apps install. */
|
|
151
172
|
export interface SharedPluginView {
|
|
152
173
|
readonly url: string;
|
|
153
174
|
readonly version: string;
|
|
154
175
|
/** GitHub says the repository no longer exists (deleted or renamed): the row shows it gone and offers a new share. */
|
|
155
176
|
readonly gone?: boolean;
|
|
177
|
+
/** It was shared to the public registry (the `cordis-plugin` topic is set), not only as a public repository. */
|
|
178
|
+
readonly registry?: boolean;
|
|
156
179
|
}
|
|
157
180
|
export type ShareVisibility = 'private' | 'public';
|
|
158
181
|
/**
|
|
@@ -168,9 +191,15 @@ export interface SharePlan {
|
|
|
168
191
|
readonly createsRepository: boolean;
|
|
169
192
|
/** The version already released there; the plan then releases the next patch. */
|
|
170
193
|
readonly released?: string;
|
|
194
|
+
/** The license a public share is offered under, as an SPDX id (MIT unless the app says otherwise); a private share has none. */
|
|
195
|
+
readonly license?: string;
|
|
196
|
+
/** The public registry (cordisplugins.github.io) lists it: the share sets the `cordis-plugin` topic. Only a public share can be listed. */
|
|
197
|
+
readonly registry?: boolean;
|
|
171
198
|
}
|
|
172
199
|
/** @throws when the value is not a share plan. */
|
|
173
200
|
export declare function parseSharePlan(value: unknown): SharePlan;
|
|
201
|
+
/** @throws when the value is not what a save answers. */
|
|
202
|
+
export declare function parseSavedPlugin(value: unknown): SavedPluginResult;
|
|
174
203
|
/** The same plan: what the person confirmed is what would be published now. */
|
|
175
204
|
export declare function samePlan(a: SharePlan, b: SharePlan): boolean;
|
|
176
205
|
/**
|
|
@@ -192,6 +221,12 @@ export interface AppPluginView {
|
|
|
192
221
|
readonly version?: string;
|
|
193
222
|
/** A local plugin this app shared: where it went (a GitHub repository) and the version it released. */
|
|
194
223
|
readonly shared?: SharedPluginView;
|
|
224
|
+
/** The newest packed copy of it kept on this machine (the app's plugin store). */
|
|
225
|
+
readonly saved?: SavedPluginView;
|
|
226
|
+
/** Absolute path of the plugin's folder, where its code is. */
|
|
227
|
+
readonly folder?: string;
|
|
228
|
+
/** The plugin's main file, relative to the app's folder: absent when that file is outside the app (a package of `node_modules` elsewhere). */
|
|
229
|
+
readonly main?: string;
|
|
195
230
|
readonly description: string;
|
|
196
231
|
readonly on: boolean;
|
|
197
232
|
}
|
|
@@ -204,6 +239,10 @@ export interface FramePluginView {
|
|
|
204
239
|
readonly version?: string;
|
|
205
240
|
readonly description: string;
|
|
206
241
|
readonly state: FramePluginState;
|
|
242
|
+
/** Absolute path of the package folder, where its code is. */
|
|
243
|
+
readonly folder?: string;
|
|
244
|
+
/** The package's main file relative to the app's folder; absent when it is outside the app. */
|
|
245
|
+
readonly main?: string;
|
|
207
246
|
}
|
|
208
247
|
export interface AppPluginsView {
|
|
209
248
|
readonly plugins: readonly AppPluginView[];
|
|
@@ -291,3 +330,80 @@ export interface AppReloadView {
|
|
|
291
330
|
}
|
|
292
331
|
/** @throws an Error naming the field when the answer is not an app reload view. */
|
|
293
332
|
export declare function parseAppReloadView(value: unknown): AppReloadView;
|
|
333
|
+
/** What a plugin of the registry offers, as the registry's index lists it (`https://cordisplugins.github.io/registry/index.json`, formatVersion 1). */
|
|
334
|
+
export interface RegistryEntryView {
|
|
335
|
+
/** The plugin's name; a scoped name keeps its scope. */
|
|
336
|
+
readonly name: string;
|
|
337
|
+
readonly description: string;
|
|
338
|
+
/** The GitHub account or organization that released it. */
|
|
339
|
+
readonly owner: string;
|
|
340
|
+
/** The repository's address. */
|
|
341
|
+
readonly url: string;
|
|
342
|
+
readonly version: string;
|
|
343
|
+
/** The day of the release (`YYYY-MM-DD`), when the index says. */
|
|
344
|
+
readonly published?: string;
|
|
345
|
+
/** Where it runs: `ACRYL` (needs an ACRYL service), `Both`, or `DSH stock` (a Harness plugin, which an app of this kind cannot run). */
|
|
346
|
+
readonly compatibility: string;
|
|
347
|
+
/** The source a pull takes: `github:<owner>/<repo>@<version>`. */
|
|
348
|
+
readonly source: string;
|
|
349
|
+
/** This app already has a plugin of this name or pulled from this source. */
|
|
350
|
+
readonly installed: boolean;
|
|
351
|
+
/** The account the person is signed in to GitHub with (or shares to) released it. */
|
|
352
|
+
readonly mine: boolean;
|
|
353
|
+
}
|
|
354
|
+
/** The registry as the Host read it: its entries, or why they could not be read (offline, rate limited, the site changed). */
|
|
355
|
+
export type RegistryView = {
|
|
356
|
+
readonly status: 'ready';
|
|
357
|
+
readonly entries: readonly RegistryEntryView[];
|
|
358
|
+
readonly readAt: string;
|
|
359
|
+
} | {
|
|
360
|
+
readonly status: 'unavailable';
|
|
361
|
+
readonly message: string;
|
|
362
|
+
};
|
|
363
|
+
/** @throws when the value is not a registry view. */
|
|
364
|
+
export declare function parseRegistryView(value: unknown): RegistryView;
|
|
365
|
+
/** What a pull did: the plugin now running, or why it was refused (nothing changed then). */
|
|
366
|
+
export interface PulledPluginView {
|
|
367
|
+
readonly name: string;
|
|
368
|
+
readonly version: string;
|
|
369
|
+
readonly action: 'installed' | 'updated' | 'unchanged';
|
|
370
|
+
readonly state: string;
|
|
371
|
+
}
|
|
372
|
+
/** @throws when the value is not what a pull answers. */
|
|
373
|
+
export declare function parsePulledPlugin(value: unknown): PulledPluginView;
|
|
374
|
+
/** Whether the person can share to GitHub now, and when not, the single thing to do about it. */
|
|
375
|
+
export type GithubReadiness = {
|
|
376
|
+
readonly status: 'ready';
|
|
377
|
+
readonly account: string;
|
|
378
|
+
} | {
|
|
379
|
+
readonly status: 'signed-out';
|
|
380
|
+
readonly say: string;
|
|
381
|
+
readonly command: string;
|
|
382
|
+
} | {
|
|
383
|
+
readonly status: 'missing';
|
|
384
|
+
readonly say: string;
|
|
385
|
+
readonly link: string;
|
|
386
|
+
} | {
|
|
387
|
+
readonly status: 'unavailable';
|
|
388
|
+
readonly say: string;
|
|
389
|
+
};
|
|
390
|
+
/** Where connecting GitHub from the app is (`./github-connect.ts`). */
|
|
391
|
+
export type GithubConnectState = {
|
|
392
|
+
readonly status: 'idle';
|
|
393
|
+
} | {
|
|
394
|
+
readonly status: 'starting';
|
|
395
|
+
} | {
|
|
396
|
+
readonly status: 'code';
|
|
397
|
+
readonly code: string;
|
|
398
|
+
readonly url: string;
|
|
399
|
+
} | {
|
|
400
|
+
readonly status: 'connected';
|
|
401
|
+
} | {
|
|
402
|
+
readonly status: 'failed';
|
|
403
|
+
readonly say: string;
|
|
404
|
+
readonly details?: string;
|
|
405
|
+
};
|
|
406
|
+
/** @throws when the value is not a connect state. */
|
|
407
|
+
export declare function parseGithubConnectState(value: unknown): GithubConnectState;
|
|
408
|
+
/** @throws when the value is not a GitHub readiness. */
|
|
409
|
+
export declare function parseGithubReadiness(value: unknown): GithubReadiness;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connect GitHub from the app, for a person who has never opened a terminal: GitHub's own browser sign-in (`gh auth login --web`), started by a button.
|
|
3
|
+
*
|
|
4
|
+
* gh prints a one-time code and the address github.com/login/device, then waits until the person enters the code there and says yes. This module runs
|
|
5
|
+
* that one gh process, reads the code from what it prints, and reports where the sign-in is. No password or token passes through the app: the person
|
|
6
|
+
* signs in on github.com, and gh keeps its credential where it always does. When the sign-in succeeded, `gh auth setup-git` lets git push over HTTPS
|
|
7
|
+
* with the same account, which a share needs.
|
|
8
|
+
*
|
|
9
|
+
* One sign-in at a time. The owner (the frame's Host) disposes it with the plugin, which ends a sign-in still waiting.
|
|
10
|
+
*/
|
|
11
|
+
import { type ChildProcess } from 'node:child_process';
|
|
12
|
+
import type { GithubConnectState } from './contract.ts';
|
|
13
|
+
export type { GithubConnectState };
|
|
14
|
+
/** What this module needs from the computer: start gh's sign-in, and run one gh command to the end. Tests give their own. */
|
|
15
|
+
export interface GithubConnectPorts {
|
|
16
|
+
/** Start `gh auth login --web`; undefined when gh is not installed. */
|
|
17
|
+
readonly startLogin: () => ChildProcess | undefined;
|
|
18
|
+
/** Run `gh <args>` to the end; the exit status (non-zero when gh is missing). */
|
|
19
|
+
readonly run: (args: readonly string[]) => number;
|
|
20
|
+
}
|
|
21
|
+
export declare const GITHUB_CONNECT_MISSING = "Connecting needs a free helper program from GitHub, and it is not installed on this computer. Install it from cli.github.com, then try again.";
|
|
22
|
+
/** The gh this computer has, without a terminal: no prompts, no browser opened by gh itself (the page offers the link). */
|
|
23
|
+
export declare function githubConnectPorts(): GithubConnectPorts;
|
|
24
|
+
export declare class GithubConnect {
|
|
25
|
+
private readonly ports;
|
|
26
|
+
private readonly giveUpMs;
|
|
27
|
+
private current;
|
|
28
|
+
private child;
|
|
29
|
+
private timer;
|
|
30
|
+
private disposed;
|
|
31
|
+
constructor(ports: GithubConnectPorts, giveUpMs?: number);
|
|
32
|
+
state(): GithubConnectState;
|
|
33
|
+
/**
|
|
34
|
+
* Start a sign-in, or return the one already waiting. Resolves when the code is known (or the start failed), which is well before the person
|
|
35
|
+
* finishes on github.com; ask `state()` for the rest.
|
|
36
|
+
*/
|
|
37
|
+
start(): Promise<GithubConnectState>;
|
|
38
|
+
/** End a waiting sign-in (the person closed the chooser, or the plugin unloads). Nothing on GitHub changes. */
|
|
39
|
+
cancel(): void;
|
|
40
|
+
dispose(): void;
|
|
41
|
+
private finish;
|
|
42
|
+
/** The code usually arrives within a second; give up waiting for it after a few, and let the page ask again. */
|
|
43
|
+
private waitForCode;
|
|
44
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plugin graph's wire types: what the frame's Host answers and what the browser draws (Settings > Plugins > Graph). Ported from cordis-plugin-graph
|
|
3
|
+
* (MIT, github.com/cordisplugins/cordis-plugin-graph, commit e9bf6b5, `src/inspect.ts`), with two additions the original did not have: a node says where its
|
|
4
|
+
* code is (`source`), and the Host keeps a numbered list of fiber lifecycle events (`GraphEvent`) so the browser hears a change instead of asking again.
|
|
5
|
+
* No Node or browser import: both sides read this file.
|
|
6
|
+
*/
|
|
7
|
+
/** The whole graph of the Host's Cordis context, now. */
|
|
8
|
+
export declare const FRAME_GRAPH_PATH = "/api/acryl-blends-frame/graph";
|
|
9
|
+
/** The fiber events after `?after=<seq>`: answered at once when there are some, else when the next one happens (or after about 20 s with none). */
|
|
10
|
+
export declare const FRAME_GRAPH_EVENTS_PATH = "/api/acryl-blends-frame/graph/events";
|
|
11
|
+
/** Fiber lifecycle phase, or `disabled` for a Loader row turned off. */
|
|
12
|
+
export type NodePhase = 'pending' | 'loading' | 'active' | 'failed' | 'unloading' | 'disposed' | 'disabled';
|
|
13
|
+
/** Edge kinds, all directed consumer -> dependency / child -> parent. */
|
|
14
|
+
export type EdgeKind = 'inject' | 'provider' | 'nesting';
|
|
15
|
+
/** Where a plugin's code is: the file to open, whether it is inside the app's folder (the Files tab opens only those), and the folder the plugin lives in. */
|
|
16
|
+
export interface GraphSource {
|
|
17
|
+
/** Absolute path of the plugin's main file. */
|
|
18
|
+
readonly file: string;
|
|
19
|
+
/** Absolute path of its folder (the package folder for an installed package). */
|
|
20
|
+
readonly folder: string;
|
|
21
|
+
/** The file relative to the app's folder, when it is inside it: the path the Files tab opens. */
|
|
22
|
+
readonly inApp?: string;
|
|
23
|
+
}
|
|
24
|
+
/** One plugin fiber (or a disabled Loader row) in the graph. */
|
|
25
|
+
export interface GraphNode {
|
|
26
|
+
/** Registry-unique fiber id (0 = root); a synthetic negative id for a disabled row with no fiber. */
|
|
27
|
+
readonly uid: number;
|
|
28
|
+
/** Display name (nearest named ancestor, else `root`). */
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly phase: NodePhase;
|
|
31
|
+
/** Whether the owning Loader row is enabled. */
|
|
32
|
+
readonly enabled: boolean;
|
|
33
|
+
/** Exact module specifier the Loader entry imports, when this fiber/row owns one. */
|
|
34
|
+
readonly moduleName: string | null;
|
|
35
|
+
/** Stable Loader entry id owning this fiber, when it maps to one. */
|
|
36
|
+
readonly loaderEntryId: string | null;
|
|
37
|
+
/** Service names this fiber currently provides into the shared store. */
|
|
38
|
+
readonly provides: readonly string[];
|
|
39
|
+
/** Labels of this fiber's top-level live effects (registrations, listeners, timers...). */
|
|
40
|
+
readonly effects: readonly string[];
|
|
41
|
+
/** Where its code is, when the Host could find it. */
|
|
42
|
+
readonly source?: GraphSource;
|
|
43
|
+
}
|
|
44
|
+
/** One relation between two fibers. */
|
|
45
|
+
export interface GraphEdge {
|
|
46
|
+
readonly kind: EdgeKind;
|
|
47
|
+
readonly from: number;
|
|
48
|
+
readonly to: number;
|
|
49
|
+
/** For `inject` / `provider`: the service name. */
|
|
50
|
+
readonly service?: string;
|
|
51
|
+
/** For `inject`: whether the required service resolved to an active provider. */
|
|
52
|
+
readonly resolved?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/** Point-in-time relation graph of one Cordis context. */
|
|
55
|
+
export interface GraphSnapshot {
|
|
56
|
+
readonly capturedAt: string;
|
|
57
|
+
/** `host` for the frame's Host (the app's plugins run there), `client` for the browser's. */
|
|
58
|
+
readonly plane: string;
|
|
59
|
+
readonly nodes: readonly GraphNode[];
|
|
60
|
+
readonly edges: readonly GraphEdge[];
|
|
61
|
+
}
|
|
62
|
+
/** The change a fiber went through, as the Host saw it: created, removed, or moved from one phase to another. */
|
|
63
|
+
export interface GraphEvent {
|
|
64
|
+
/** 1, 2, 3...: the order the Host saw them in; a browser asks for those after the last number it has. */
|
|
65
|
+
readonly seq: number;
|
|
66
|
+
/** Epoch ms. */
|
|
67
|
+
readonly at: number;
|
|
68
|
+
readonly uid: number;
|
|
69
|
+
readonly name: string;
|
|
70
|
+
readonly kind: 'created' | 'removed' | 'status';
|
|
71
|
+
readonly from?: NodePhase;
|
|
72
|
+
readonly to?: NodePhase;
|
|
73
|
+
}
|
|
74
|
+
export interface GraphView {
|
|
75
|
+
readonly snapshot: GraphSnapshot;
|
|
76
|
+
/** The newest event number when the snapshot was taken: the browser asks for events after it. */
|
|
77
|
+
readonly seq: number;
|
|
78
|
+
}
|
|
79
|
+
export interface GraphEventsAnswer {
|
|
80
|
+
/** The newest event number now. */
|
|
81
|
+
readonly seq: number;
|
|
82
|
+
readonly events: readonly GraphEvent[];
|
|
83
|
+
}
|
|
84
|
+
export declare function parseGraphView(value: unknown): GraphView;
|
|
85
|
+
export declare function parseGraphEvents(value: unknown): GraphEventsAnswer;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading a live Cordis context into a plugin graph: every fiber, the disabled Loader rows, and the relations between them (requires, provides to, nested in).
|
|
3
|
+
* Ported from cordis-plugin-graph (MIT, github.com/cordisplugins/cordis-plugin-graph, commit e9bf6b5, `src/inspect.ts`): the same walk of the public Cordis and
|
|
4
|
+
* Loader API, with a `source` on each node added. It imports nothing from Node, so the Host reads its own context with it and the browser reads the
|
|
5
|
+
* client's (the two planes).
|
|
6
|
+
*/
|
|
7
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
8
|
+
import type { EdgeKind, GraphSnapshot, GraphSource, NodePhase } from './graph-contract.ts';
|
|
9
|
+
export declare const PHASE: Record<number, NodePhase>;
|
|
10
|
+
/** Where a node's code is, found from what the Loader entry names; undefined when it cannot be found. */
|
|
11
|
+
export type SourceOf = (moduleName: string | null, name: string) => GraphSource | undefined;
|
|
12
|
+
export declare const clamp: (value: string) => string;
|
|
13
|
+
/** The current Cordis graph of `ctx`: every fiber, the disabled Loader rows, and the three kinds of relation. */
|
|
14
|
+
export declare function inspectCordisContext(ctx: Context, plane: string, sourceOf?: SourceOf): GraphSnapshot;
|
|
15
|
+
/** The relation kinds, for the browser's toggles. */
|
|
16
|
+
export declare const EDGE_KINDS: readonly EdgeKind[];
|
package/lib/index.d.ts
CHANGED
|
@@ -10,10 +10,11 @@ import type { Context } from '@deepseek-ai/cordis';
|
|
|
10
10
|
import { Acryl } from 'acrylblends';
|
|
11
11
|
import { GitRunner, Versions } from '@acrylblends/versions';
|
|
12
12
|
import { type ShareAppPluginResult } from './app-plugins.ts';
|
|
13
|
+
import { type GraphPort } from './plugin-graph.ts';
|
|
13
14
|
import { type AppRow } from './app-reload.ts';
|
|
14
15
|
import { SelectionInbox } from './selection-context.ts';
|
|
15
16
|
import { type BranchChatsRecord } from './branch-chats.ts';
|
|
16
|
-
import { type AppPluginKind, type AppReloadView, type AppPluginsView, type ChatSavesView, type FeedbackView, type PushPlan, type SharePlan, type FrameBranch, type FrameState, type GitRemoteState, type GitSyncResult } from './contract.ts';
|
|
17
|
+
import { type AppPluginKind, type AppReloadView, type AppPluginsView, type ChatSavesView, type FeedbackView, type PulledPluginView, type PushPlan, type RegistryView, type SavedPluginResult, type SharePlan, type ShareVisibility, type FrameBranch, type FrameState, type GithubConnectState, type GithubReadiness, type GitRemoteState, type GitSyncResult } from './contract.ts';
|
|
17
18
|
import { type AppSnapshotService } from './app-snapshot.ts';
|
|
18
19
|
/**
|
|
19
20
|
* The part of the runtime's `appInstance` service ACRYL plugins read (a separated interface: plugins do not import the runtime). Every plugin
|
|
@@ -60,9 +61,23 @@ export interface PluginsPort {
|
|
|
60
61
|
read(): Promise<AppPluginsView>;
|
|
61
62
|
switch(kind: AppPluginKind, name: string, on: boolean): Promise<void>;
|
|
62
63
|
/** What sharing one local plugin would do (repository, version, visibility); nothing is sent. */
|
|
63
|
-
planShare(name: string): Promise<SharePlan>;
|
|
64
|
+
planShare(name: string, visibility?: ShareVisibility, registry?: boolean): Promise<SharePlan>;
|
|
64
65
|
/** Publish one local plugin to its GitHub repository and release, through the plugin-hub path: only the plan the person confirmed. */
|
|
65
66
|
share(name: string, confirmed: SharePlan): Promise<ShareAppPluginResult>;
|
|
67
|
+
/** Keep a packed copy of one local plugin on this machine (the app's plugin store); nothing leaves the machine. */
|
|
68
|
+
save(name: string): Promise<SavedPluginResult>;
|
|
69
|
+
/** The public registry (cordisplugins.github.io), each entry marked with what this app has. Unreadable is an answer, not a failure. */
|
|
70
|
+
registry(): Promise<RegistryView>;
|
|
71
|
+
/** Add one released plugin (`github:<owner>/<repo>@<version>`) to the running app, through the app's plugin-share checks. @throws PlainError when it is refused. */
|
|
72
|
+
pull(source: string): Promise<PulledPluginView>;
|
|
73
|
+
/** Whether this computer can share to GitHub now; read before the person is asked anything. */
|
|
74
|
+
github(): Promise<GithubReadiness>;
|
|
75
|
+
/** Connect GitHub from the app: start (or rejoin) GitHub's browser sign-in, read where it is, or stop it. */
|
|
76
|
+
readonly connect: {
|
|
77
|
+
start(): Promise<GithubConnectState>;
|
|
78
|
+
state(): GithubConnectState;
|
|
79
|
+
cancel(): void;
|
|
80
|
+
};
|
|
66
81
|
}
|
|
67
82
|
/** A note's screenshot as the frame serves it: the bytes and their image type. */
|
|
68
83
|
export interface FeedbackShot {
|
|
@@ -131,6 +146,8 @@ export interface FrameRoutesDeps {
|
|
|
131
146
|
readonly state: () => Promise<FrameState>;
|
|
132
147
|
readonly report?: (cause: unknown) => void;
|
|
133
148
|
readonly plugins?: PluginsPort;
|
|
149
|
+
/** The Host's plugin graph and the changes of its fibers (Settings > Plugins > Graph). */
|
|
150
|
+
readonly graph?: GraphPort;
|
|
134
151
|
readonly feedback?: FeedbackPort;
|
|
135
152
|
readonly branches?: BranchesPort;
|
|
136
153
|
readonly branchChats?: BranchChatsPort;
|
|
@@ -146,7 +163,7 @@ export interface FrameRoutesDeps {
|
|
|
146
163
|
/** The element picks waiting for the step that reads the message they belong to (./selection-context.ts). */
|
|
147
164
|
readonly selection?: SelectionInbox;
|
|
148
165
|
}
|
|
149
|
-
export declare function frameRoutes({ state, report, plugins, feedback, branches, branchChats, chatSaves, shared, realChats, gitSync, snapshot, appReload, selection }: FrameRoutesDeps): Acryl;
|
|
166
|
+
export declare function frameRoutes({ state, report, plugins, graph, feedback, branches, branchChats, chatSaves, shared, realChats, gitSync, snapshot, appReload, selection }: FrameRoutesDeps): Acryl;
|
|
150
167
|
/**
|
|
151
168
|
* The app's rows, plugins first and routes after (the order they start in): each as the reloader drives it. A row's module is imported under the
|
|
152
169
|
* current generation (`./app-generation.ts`) by the loader itself, so `restart` stops the row's plugin and has the loader start the entry again - not
|