@acryldev/launcher-desktop 0.1.0 → 0.1.2

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.
@@ -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
  }
@@ -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[];
@@ -92,12 +96,16 @@ export interface BlendView {
92
96
  readonly description: string;
93
97
  /** Who released it: the ACRYL project (`official`) or anyone else (`community`, not reviewed); the registry's `origin`. */
94
98
  readonly origin: 'official' | 'community';
99
+ /** A community Blend's release on GitHub (`github:owner/repo#tag`), what `--from` takes for a Blend outside the public registry; absent: `--from <id>`. */
100
+ readonly source?: string;
95
101
  }
96
102
  export interface BlendsResponse {
97
103
  readonly blends: readonly BlendView[];
98
104
  }
99
105
  /** A Blend id as `acryl new --from` takes it: it starts with a letter or digit, so it can never read as an option. */
100
106
  export declare const BLEND_ID: RegExp;
107
+ /** A Blend released on GitHub, as `--from` takes it (create-acrylblends `github:owner/repo#ref`): what a community Blend is made from. */
108
+ export declare const BLEND_SOURCE: RegExp;
101
109
  /** The app to make: from a starter (`acryl new <name> <starter>`) or from a registry Blend (`acryl new <name> --from <id>`), never both. */
102
110
  export interface NewAppRequest {
103
111
  readonly where: string;
@@ -165,7 +173,32 @@ export interface AppSharePlanRequest {
165
173
  readonly id: string;
166
174
  /** The account that owns a new repository; absent means the signed-in one. */
167
175
  readonly owner?: string;
168
- }
176
+ /** 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. */
177
+ readonly visibility?: 'private' | 'public';
178
+ }
179
+ /** The GitHub connection Control Center hands its apps (as GH_TOKEN): who is signed in, never the token. */
180
+ export interface GithubView {
181
+ /** False when this build has no GitHub app to sign in with. */
182
+ readonly available: boolean;
183
+ readonly login: string | null;
184
+ }
185
+ /** A sign-in under way: the code the person types at GitHub. The device code stays in the service. */
186
+ export interface GithubStartView {
187
+ readonly userCode: string;
188
+ readonly verificationUri: string;
189
+ /** Seconds between polls. */
190
+ readonly interval: number;
191
+ }
192
+ export type GithubPollView = {
193
+ readonly state: 'pending';
194
+ readonly interval?: number;
195
+ } | {
196
+ readonly state: 'connected';
197
+ readonly login: string;
198
+ } | {
199
+ readonly state: 'failed';
200
+ readonly reason: string;
201
+ };
169
202
  /** The person's yes: the plan they read, sent back as it was. */
170
203
  export interface AppShareRequest extends AppSharePlanRequest {
171
204
  readonly plan: AppSharePlanView;
@@ -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 { BlendView } from './contract.ts';
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
- /** The Blends an ACRYL app can be made from (registry entries whose runtime is `acrylblends`), by name. Throws `RegistryUnavailable` in words a person can act on. */
14
- export declare function readBlends(fetchImpl?: Fetch, url?: string): Promise<readonly BlendView[]>;
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 {};
@@ -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.0",
3
+ "version": "0.1.2",
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.0",
49
- "@acryldev/loopback-http": "0.2.0",
50
- "@acryldev/blends": "^1.7.1"
49
+ "@acryldev/launcher": "0.1.2",
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,