@acryldev/launcher-desktop 0.1.0 → 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/client.js +383 -134
- package/lib/client.js.map +1 -1
- package/lib/index.js +159 -13
- package/lib/index.js.map +1 -1
- package/lib/page.js +13 -13
- package/lib/types/client/api.d.ts +5 -1
- package/lib/types/contract.d.ts +40 -1
- package/lib/types/registry.d.ts +8 -3
- package/lib/types/service.d.ts +16 -1
- package/package.json +7 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Same-origin browser client for the launcher routes (`../contract.ts`). */
|
|
2
|
-
import { type AppSharePlanRequest, type AppSharePlanView, type AppShareRequest, type AppShareResponse, type BlendView, type HealthView, type NewAppRequest, type PluginPullResponse, type PluginView, type PublishPlanRequest, type PublishPlanView, type PublishRequest, type PublishResponse, type StateResponse } from '../contract.ts';
|
|
2
|
+
import { type AppSharePlanRequest, type AppSharePlanView, type GithubPollView, type GithubStartView, type GithubView, type AppShareRequest, type AppShareResponse, type BlendView, type HealthView, type NewAppRequest, type PluginPullResponse, type PluginView, type PublishPlanRequest, type PublishPlanView, type PublishRequest, type PublishResponse, type StateResponse } from '../contract.ts';
|
|
3
3
|
export interface HealthResponse extends HealthView {
|
|
4
4
|
/** The saved model key, masked (`sk-...1234`), or null. */
|
|
5
5
|
readonly keyMask: string | null;
|
|
@@ -29,6 +29,10 @@ export interface LauncherApi {
|
|
|
29
29
|
publish(request: PublishRequest): Promise<PublishResponse>;
|
|
30
30
|
/** What sharing a whole app would send (its repository, visibility, changed files); sends nothing. */
|
|
31
31
|
sharePlan(request: AppSharePlanRequest): Promise<AppSharePlanView>;
|
|
32
|
+
github(): Promise<GithubView>;
|
|
33
|
+
githubStart(): Promise<GithubStartView>;
|
|
34
|
+
githubPoll(): Promise<GithubPollView>;
|
|
35
|
+
githubDisconnect(): Promise<GithubView>;
|
|
32
36
|
/** The person's yes to the share plan they read. */
|
|
33
37
|
share(request: AppShareRequest): Promise<AppShareResponse>;
|
|
34
38
|
}
|
package/lib/types/contract.d.ts
CHANGED
|
@@ -19,6 +19,10 @@ export declare const LAUNCHER_PUBLISH_PLAN_PATH = "/api/acryl-launcher/publish-p
|
|
|
19
19
|
export declare const LAUNCHER_PUBLISH_PATH = "/api/acryl-launcher/publish";
|
|
20
20
|
export declare const LAUNCHER_SHARE_PLAN_PATH = "/api/acryl-launcher/share-plan";
|
|
21
21
|
export declare const LAUNCHER_SHARE_PATH = "/api/acryl-launcher/share";
|
|
22
|
+
export declare const LAUNCHER_GITHUB_PATH = "/api/acryl-launcher/github";
|
|
23
|
+
export declare const LAUNCHER_GITHUB_START_PATH = "/api/acryl-launcher/github-start";
|
|
24
|
+
export declare const LAUNCHER_GITHUB_POLL_PATH = "/api/acryl-launcher/github-poll";
|
|
25
|
+
export declare const LAUNCHER_GITHUB_DISCONNECT_PATH = "/api/acryl-launcher/github-disconnect";
|
|
22
26
|
/** The three kinds of app (spec 050 D10): a web app, a desktop window, and the lightest, a terminal app, which is listed but not yet made. */
|
|
23
27
|
export type Surface = 'web' | 'desktop' | 'tui';
|
|
24
28
|
export declare const SURFACES: readonly Surface[];
|
|
@@ -45,7 +49,11 @@ export interface AppView {
|
|
|
45
49
|
readonly version?: string;
|
|
46
50
|
/** A newer release of that Blend in the registry: `acrylblends update` brings it in, keeping the person's changes. */
|
|
47
51
|
readonly update?: string;
|
|
52
|
+
/** Where the app was shared to (`https://github.com/<owner>/<repo>`), from its origin remote; what WebBoxes.ai deploys from. */
|
|
53
|
+
readonly github?: string;
|
|
48
54
|
}
|
|
55
|
+
/** WebBoxes.ai's New WebBox form, opened with the app's repository filled in (the person signs in and presses Create there). */
|
|
56
|
+
export declare function webboxesDeployUrl(github: string, name: string): string;
|
|
49
57
|
export interface StarterView {
|
|
50
58
|
readonly value: string;
|
|
51
59
|
readonly label: string;
|
|
@@ -92,12 +100,18 @@ export interface BlendView {
|
|
|
92
100
|
readonly description: string;
|
|
93
101
|
/** Who released it: the ACRYL project (`official`) or anyone else (`community`, not reviewed); the registry's `origin`. */
|
|
94
102
|
readonly origin: 'official' | 'community';
|
|
103
|
+
/** A community Blend's release on GitHub (`github:owner/repo#tag`), what `--from` takes for a Blend outside the public registry; absent: `--from <id>`. */
|
|
104
|
+
readonly source?: string;
|
|
95
105
|
}
|
|
96
106
|
export interface BlendsResponse {
|
|
97
107
|
readonly blends: readonly BlendView[];
|
|
98
108
|
}
|
|
99
109
|
/** A Blend id as `acryl new --from` takes it: it starts with a letter or digit, so it can never read as an option. */
|
|
110
|
+
/** The New WebBox page of webboxes.ai, which takes `github` and `name` to fill its form. */
|
|
111
|
+
export declare const WEBBOXES_NEW_BOX = "https://webboxes.ai/dashboard/webboxes/new";
|
|
100
112
|
export declare const BLEND_ID: RegExp;
|
|
113
|
+
/** A Blend released on GitHub, as `--from` takes it (create-acrylblends `github:owner/repo#ref`): what a community Blend is made from. */
|
|
114
|
+
export declare const BLEND_SOURCE: RegExp;
|
|
101
115
|
/** The app to make: from a starter (`acryl new <name> <starter>`) or from a registry Blend (`acryl new <name> --from <id>`), never both. */
|
|
102
116
|
export interface NewAppRequest {
|
|
103
117
|
readonly where: string;
|
|
@@ -165,7 +179,32 @@ export interface AppSharePlanRequest {
|
|
|
165
179
|
readonly id: string;
|
|
166
180
|
/** The account that owns a new repository; absent means the signed-in one. */
|
|
167
181
|
readonly owner?: string;
|
|
168
|
-
|
|
182
|
+
/** Who may see it: written to the app's blend.yaml (metadata.visibility, the one place it is kept) before the plan is read; absent keeps it. */
|
|
183
|
+
readonly visibility?: 'private' | 'public';
|
|
184
|
+
}
|
|
185
|
+
/** The GitHub connection Control Center hands its apps (as GH_TOKEN): who is signed in, never the token. */
|
|
186
|
+
export interface GithubView {
|
|
187
|
+
/** False when this build has no GitHub app to sign in with. */
|
|
188
|
+
readonly available: boolean;
|
|
189
|
+
readonly login: string | null;
|
|
190
|
+
}
|
|
191
|
+
/** A sign-in under way: the code the person types at GitHub. The device code stays in the service. */
|
|
192
|
+
export interface GithubStartView {
|
|
193
|
+
readonly userCode: string;
|
|
194
|
+
readonly verificationUri: string;
|
|
195
|
+
/** Seconds between polls. */
|
|
196
|
+
readonly interval: number;
|
|
197
|
+
}
|
|
198
|
+
export type GithubPollView = {
|
|
199
|
+
readonly state: 'pending';
|
|
200
|
+
readonly interval?: number;
|
|
201
|
+
} | {
|
|
202
|
+
readonly state: 'connected';
|
|
203
|
+
readonly login: string;
|
|
204
|
+
} | {
|
|
205
|
+
readonly state: 'failed';
|
|
206
|
+
readonly reason: string;
|
|
207
|
+
};
|
|
169
208
|
/** The person's yes: the plan they read, sent back as it was. */
|
|
170
209
|
export interface AppShareRequest extends AppSharePlanRequest {
|
|
171
210
|
readonly plan: AppSharePlanView;
|
package/lib/types/registry.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/** The public Blend registry as the screen's store lists it: only reads (the same index `acryl new --from` and the terminal's "Install a Blend" use). */
|
|
2
|
-
import type
|
|
2
|
+
import { type BlendView } from './contract.ts';
|
|
3
3
|
export declare const REGISTRY_INDEX = "https://acrylblends.github.io/registry/index.json";
|
|
4
|
+
/** Blends released by people outside the ACRYL project and found on GitHub by the registry's hourly sync (origin `community`, each with its `source`). */
|
|
5
|
+
export declare const REGISTRY_DISCOVERED = "https://acrylblends.github.io/registry/discovered.json";
|
|
4
6
|
export declare class RegistryUnavailable extends Error {
|
|
5
7
|
}
|
|
6
8
|
type Fetch = (input: string, init?: {
|
|
@@ -10,6 +12,9 @@ type Fetch = (input: string, init?: {
|
|
|
10
12
|
status: number;
|
|
11
13
|
json: () => Promise<unknown>;
|
|
12
14
|
}>;
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The Blends an ACRYL app can be made from (registry entries whose runtime is `acrylblends`), by name: the public registry's, and the community ones
|
|
17
|
+
* the registry found on GitHub (made from their `source`). The community list is optional: when it cannot be read, the store still lists the rest.
|
|
18
|
+
*/
|
|
19
|
+
export declare function readBlends(fetchImpl?: Fetch, url?: string, discovered?: string | undefined): Promise<readonly BlendView[]>;
|
|
15
20
|
export {};
|
package/lib/types/service.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AppSharePlanRequest, AppSharePlanView, AppShareRequest, AppShareResponse, AppView, BlendView, HealthView, NewAppRequest, PluginPullResponse, PluginView, PublishPlanRequest, PublishPlanView, PublishRequest, PublishResponse, StateResponse, Surface } from './contract.ts';
|
|
1
|
+
import type { GithubPollView, GithubStartView, GithubView, AppSharePlanRequest, AppSharePlanView, AppShareRequest, AppShareResponse, AppView, BlendView, HealthView, NewAppRequest, PluginPullResponse, PluginView, PublishPlanRequest, PublishPlanView, PublishRequest, PublishResponse, StateResponse, Surface } from './contract.ts';
|
|
2
2
|
import { type Door } from './door.ts';
|
|
3
3
|
import { type Runner } from './runner.ts';
|
|
4
4
|
/** A request the service cannot honour, in a sentence a person can act on. The route answers it as 409. */
|
|
@@ -18,10 +18,17 @@ export interface LauncherPorts {
|
|
|
18
18
|
readonly blends: () => Promise<readonly BlendView[]>;
|
|
19
19
|
/** The running apps' doors: what lists, pulls and publishes their plugins. */
|
|
20
20
|
readonly door: Door;
|
|
21
|
+
/**
|
|
22
|
+
* Fetch whatever of Node.js (with npm) and gh this computer lacks into `<home>/tools` (`prepareTools` of @acryldev/launcher); absent, the
|
|
23
|
+
* computer's own tools are used as they are (tests, and a launcher run from a terminal).
|
|
24
|
+
*/
|
|
25
|
+
readonly prepareTools?: () => Promise<readonly string[]>;
|
|
21
26
|
}
|
|
22
27
|
export declare class LauncherService {
|
|
23
28
|
#private;
|
|
24
29
|
constructor(ports: LauncherPorts);
|
|
30
|
+
/** Start fetching what this computer lacks of Node.js and gh; apps wait for it (`#toolsReady`). Called once, when the launcher starts. */
|
|
31
|
+
prepareTools(): Promise<void>;
|
|
25
32
|
state(): StateResponse;
|
|
26
33
|
add(path: string): AppView;
|
|
27
34
|
remove(id: string): void;
|
|
@@ -66,4 +73,12 @@ export declare class LauncherService {
|
|
|
66
73
|
health(probe?: Runner): Promise<HealthView>;
|
|
67
74
|
/** The saved key, masked, for the screen's Settings and Health; never the key itself. */
|
|
68
75
|
maskedModelKey(): string | undefined;
|
|
76
|
+
/** Who is signed in to GitHub here (the token apps get as GH_TOKEN), never the token. */
|
|
77
|
+
github(): GithubView;
|
|
78
|
+
/** Start GitHub's device sign-in: the code for the person; the device code stays here until it is approved, refused or expires. */
|
|
79
|
+
githubStart(): Promise<GithubStartView>;
|
|
80
|
+
/** One poll of the sign-in under way: pending, connected (the token is saved and every app started from now on gets it), or failed. */
|
|
81
|
+
githubPoll(): Promise<GithubPollView>;
|
|
82
|
+
/** Forget the GitHub connection on this machine. Apps started from now on no longer get the token. */
|
|
83
|
+
githubDisconnect(): GithubView;
|
|
69
84
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acryldev/launcher-desktop",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "The ACRYL screen of the desktop app (spec 050): every app made with ACRYL on this machine, the surface of each (Web, Desktop, CLI/TUI), and New app, Add a folder, Start and Stop. The Host half serves the list and runs the commands; the Client half draws the Control Center design as the first screen",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"node": "^22.19.0 || >=24.0.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
+
"@acryldev/blends": "^1.7.3",
|
|
47
48
|
"@acryldev/control": "0.3.0",
|
|
48
|
-
"@acryldev/launcher": "0.1.
|
|
49
|
-
"@acryldev/loopback-http": "0.2.0"
|
|
50
|
-
"@acryldev/blends": "^1.7.1"
|
|
49
|
+
"@acryldev/launcher": "0.1.3",
|
|
50
|
+
"@acryldev/loopback-http": "0.2.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
@@ -55,6 +55,8 @@
|
|
|
55
55
|
"react": "18.3.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
+
"@acryldev/blends": "^1.7.3",
|
|
59
|
+
"@acryldev/ui": "0.4.0",
|
|
58
60
|
"@deepseek-ai/cordis": "4.0.4",
|
|
59
61
|
"@deepseek-ai/dsh-client-modules": "0.2.0-rc.2",
|
|
60
62
|
"@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2",
|
|
@@ -63,14 +65,12 @@
|
|
|
63
65
|
"@types/node": "^22.20.0",
|
|
64
66
|
"@types/react": "^18",
|
|
65
67
|
"@types/react-dom": "^18",
|
|
66
|
-
"@acryldev/blends": "^1.7.1",
|
|
67
68
|
"jsdom": "29.1.1",
|
|
68
69
|
"react": "18.3.1",
|
|
69
70
|
"react-dom": "18.3.1",
|
|
70
71
|
"tsdown": "0.22.2",
|
|
71
72
|
"typescript": "6.0.3",
|
|
72
|
-
"vitest": "4.1.11"
|
|
73
|
-
"@acryldev/ui": "0.4.0"
|
|
73
|
+
"vitest": "4.1.11"
|
|
74
74
|
},
|
|
75
75
|
"acryl": {
|
|
76
76
|
"schemaVersion": 1,
|