@acryldev/launcher-desktop 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,21 @@
1
+ export interface Run {
2
+ /** Output so far is delivered in chunks, stdout and stderr together. */
3
+ onOutput(listener: (text: string) => void): void;
4
+ /** The end, once: the exit code, or the reason the command could not start (`notFound` when the program is not on this machine). */
5
+ onEnd(listener: (end: {
6
+ code: number | null;
7
+ notFound: boolean;
8
+ error?: string;
9
+ }) => void): void;
10
+ stop(): void;
11
+ }
12
+ export interface Command {
13
+ readonly program: string;
14
+ readonly args: readonly string[];
15
+ readonly cwd: string;
16
+ readonly env: Readonly<Record<string, string | undefined>>;
17
+ }
18
+ export type Runner = (command: Command) => Run;
19
+ /** The environment a started app gets: this process's, without the keys above, plus the places Node usually lives (a Dock launch has a short PATH). */
20
+ export declare function appEnvironment(base: Readonly<Record<string, string | undefined>>, platform?: NodeJS.Platform): Record<string, string | undefined>;
21
+ export declare const spawnRunner: Runner;
@@ -0,0 +1,69 @@
1
+ import type { AppSharePlanRequest, AppSharePlanView, AppShareRequest, AppShareResponse, AppView, BlendView, HealthView, NewAppRequest, PluginPullResponse, PluginView, PublishPlanRequest, PublishPlanView, PublishRequest, PublishResponse, StateResponse, Surface } from './contract.ts';
2
+ import { type Door } from './door.ts';
3
+ import { type Runner } from './runner.ts';
4
+ /** A request the service cannot honour, in a sentence a person can act on. The route answers it as 409. */
5
+ export declare class LauncherRefusal extends Error {
6
+ }
7
+ export interface LauncherPorts {
8
+ /** ACRYL's home (`appInstance.home`): where `apps.json` and `model.json` are. */
9
+ readonly home: string;
10
+ /** The folder "+ New app" suggests. */
11
+ readonly appsFolder: string;
12
+ readonly runner: Runner;
13
+ /** The environment started apps inherit (before the desktop app's own keys are removed). */
14
+ readonly environment: () => Readonly<Record<string, string | undefined>>;
15
+ readonly exists: (path: string) => boolean;
16
+ readonly makeFolder: (path: string) => void;
17
+ /** The Blends in the public registry; rejects (`RegistryUnavailable`) when it cannot be read. */
18
+ readonly blends: () => Promise<readonly BlendView[]>;
19
+ /** The running apps' doors: what lists, pulls and publishes their plugins. */
20
+ readonly door: Door;
21
+ }
22
+ export declare class LauncherService {
23
+ #private;
24
+ constructor(ports: LauncherPorts);
25
+ state(): StateResponse;
26
+ add(path: string): AppView;
27
+ remove(id: string): void;
28
+ /**
29
+ * Start an app the way the terminal's "Open an app" does, with the saved model key: a Web app with `npm run dev` in its folder (its address opens in the
30
+ * browser), a Desktop app with `npm run desktop`, which starts the same app and opens it in its own window (Electron is fetched the first time).
31
+ */
32
+ start(id: string, surface?: Surface): void;
33
+ /**
34
+ * ACRYL ADE, the way `acryl ade` (`--gui`) opens it: the Blend `acryl.ade` in `<home>/ade`, made from the registry the first time (listed, installed and
35
+ * started as any app made here is), then started in a window or the browser. Already running, it is left as it is.
36
+ */
37
+ openAde(surface: 'web' | 'desktop'): void;
38
+ stop(id: string): void;
39
+ /**
40
+ * Bring the newer registry release of the app's Blend into it: `acrylblends update` in its folder (a git merge that keeps the person's changes, then npm
41
+ * install). A running app is stopped first and started again after.
42
+ */
43
+ update(id: string): void;
44
+ stopAll(): void;
45
+ /**
46
+ * Make an app: the same `acryl new <name> <starter>` the terminal runs, in the folder the person chose. `acryl new` goes on to install and start the app,
47
+ * so the process it began is the app's running process: when its blend.yaml appears the app is listed and that process is adopted as the app's.
48
+ */
49
+ create(request: NewAppRequest): void;
50
+ /** The registry's Blends, read again at most once a minute: the store is opened and closed often, and the registry is a public file. */
51
+ blends(): Promise<readonly BlendView[]>;
52
+ /** The apps folder, made when it is not there yet: the assistant's agent works in it, and a folder that does not exist cannot be worked in. */
53
+ assistantFolder(): string;
54
+ /** The plugins of a running app: the ones its people made (shareable) and the ones pulled from a registry. */
55
+ plugins(id: string): Promise<readonly PluginView[]>;
56
+ /** Pull a plugin into a running app from a registry source (`github:owner/repo@version`), the way `acryl plugin pull` does. */
57
+ pullPlugin(id: string, source: string): Promise<PluginPullResponse>;
58
+ /** What publishing a plugin would send (the account, repository, version, license and files). Sends nothing. */
59
+ publishPlan(request: PublishPlanRequest): Promise<PublishPlanView>;
60
+ /** The person's yes: publish exactly the plan they read. The app sends it only if the plugin still matches that plan. */
61
+ publish(request: PublishRequest): Promise<PublishResponse>;
62
+ /** What sharing the app would send: the repository (a new one, or the remote it has), its visibility and how many changed files are saved first. Sends nothing. */
63
+ sharePlan(request: AppSharePlanRequest): Promise<AppSharePlanView>;
64
+ /** The person's yes: share exactly the plan they read. The app sends it only if it still matches that plan. */
65
+ share(request: AppShareRequest): Promise<AppShareResponse>;
66
+ health(probe?: Runner): Promise<HealthView>;
67
+ /** The saved key, masked, for the screen's Settings and Health; never the key itself. */
68
+ maskedModelKey(): string | undefined;
69
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The launcher as tools an agent can call (spec 050 D11, T013): the same operations the screen offers, through the same `LauncherService`, so what an agent
3
+ * does and what a person clicks cannot drift apart. They go into ACRYL's tool registry (`acrylTools`): the DSH chat has them, and agents ACRYL does not run
4
+ * (Claude Code, Codex) reach them through `@acryldev/agent-control`'s loopback gateway, where their names are on the default allowlist. Nothing outward happens
5
+ * here: a publish only produces the plan the person reads, and the person's click on the screen is the yes.
6
+ */
7
+ import type { Context } from '@deepseek-ai/cordis';
8
+ import { type AcrylToolDefinition } from '@acryldev/control';
9
+ import type { LauncherService } from './service.ts';
10
+ export declare const LAUNCHER_TOOLS: readonly ["acryl_launcher_help", "acryl_launcher_apps", "acryl_launcher_blends", "acryl_launcher_new_app", "acryl_launcher_start_app", "acryl_launcher_stop_app", "acryl_launcher_plugins", "acryl_launcher_pull_plugin", "acryl_launcher_publish_plan"];
11
+ export declare const LAUNCHER_HELP = "The ACRYL launcher is the first screen of ACRYL (Web and Desktop). Where things are:\n- My apps (left nav): every app made with ACRYL on this machine, as cards with a state (running, stopped), a surface (Web = served at an address, Desktop = a window of its own) and a Blend name. Select a card for its panel: Start or Stop, Open, Remove from list, its folder, and, while it runs, its Plugins.\n- + New app (top): asks where, a name, a starter (Blank, Node.js, Notes, Chat, To-do, Agent) and a surface; it runs \"acryl new <name> <starter>\" and installs the app (about a minute), then starts it.\n- Blends store (left nav): the public registry of ready-made apps (acrylblends.github.io/blends); \"Make an app\" on a card runs \"acryl new <name> --from <id>\".\n- Add a folder (top): puts an app you already have in the list (\"acryl apps add <folder>\").\n- Plugins of a running app (its card's panel): \"Pull a plugin\" takes github:owner/repo@version; \"Share plugin\" shows exactly what would be published and sends nothing until the person clicks \"Yes, publish\". An agent never publishes: it can only prepare the plan.\n- Running, Made by agents, Updates (not built yet), WebBoxes.ai (deploy is coming), Health (Node, npm and the model key), Settings (the look: ACRYL ADE or acryl.dev).\n- Assistant (left nav): this panel. ACRYL ADE (the agentic development environment) opens from its card on My apps.\nTools: acryl_launcher_apps lists the apps; acryl_launcher_new_app, _start_app and _stop_app change them; acryl_launcher_blends searches the registry; acryl_launcher_plugins and _pull_plugin work on a running app; acryl_launcher_publish_plan prepares a publish for the person to confirm.";
12
+ /** The tool definitions over one service; separate from registering them so a test can call each. */
13
+ export declare function launcherTools(service: LauncherService): readonly AcrylToolDefinition[];
14
+ /** Register the tools in the registry; the disposer removes them. @returns disposer. */
15
+ export declare function registerLauncherTools(ctx: Context, service: LauncherService): () => void;
package/package.json CHANGED
@@ -1,6 +1,105 @@
1
1
  {
2
2
  "name": "@acryldev/launcher-desktop",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
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
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/acryldev/acryl.git",
9
+ "directory": "plugins/launcher-desktop"
10
+ },
11
+ "homepage": "https://github.com/acryldev/acryl/tree/main/plugins/launcher-desktop#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/acryldev/acryl/issues"
14
+ },
15
+ "type": "module",
16
+ "main": "lib/index.js",
17
+ "types": "lib/types/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./lib/types/index.d.ts",
21
+ "default": "./lib/index.js"
22
+ },
23
+ "./client": {
24
+ "types": "./lib/types/client/index.d.ts",
25
+ "default": "./lib/client.js"
26
+ },
27
+ "./package.json": "./package.json"
28
+ },
29
+ "dsh": {
30
+ "bundle": {
31
+ "patch": "./cordis.patch.yml"
32
+ },
33
+ "client": {
34
+ "inject": [],
35
+ "platform": "web"
36
+ }
37
+ },
38
+ "files": [
39
+ "cordis.patch.yml",
40
+ "lib/**",
41
+ "README.md"
42
+ ],
43
+ "engines": {
44
+ "node": "^22.19.0 || >=24.0.0"
45
+ },
46
+ "dependencies": {
47
+ "@acryldev/control": "0.3.0",
48
+ "@acryldev/launcher": "0.1.0",
49
+ "@acryldev/loopback-http": "0.2.0",
50
+ "@acryldev/blends": "^1.7.1"
51
+ },
52
+ "peerDependencies": {
53
+ "@deepseek-ai/cordis": "^4.0.2",
54
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2",
55
+ "react": "18.3.1"
56
+ },
57
+ "devDependencies": {
58
+ "@deepseek-ai/cordis": "4.0.4",
59
+ "@deepseek-ai/dsh-client-modules": "0.2.0-rc.2",
60
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2",
61
+ "@testing-library/dom": "^10.4.1",
62
+ "@testing-library/react": "^16.3.2",
63
+ "@types/node": "^22.20.0",
64
+ "@types/react": "^18",
65
+ "@types/react-dom": "^18",
66
+ "@acryldev/blends": "^1.7.1",
67
+ "jsdom": "29.1.1",
68
+ "react": "18.3.1",
69
+ "react-dom": "18.3.1",
70
+ "tsdown": "0.22.2",
71
+ "typescript": "6.0.3",
72
+ "vitest": "4.1.11",
73
+ "@acryldev/ui": "0.4.0"
74
+ },
75
+ "acryl": {
76
+ "schemaVersion": 1,
77
+ "artifacts": {
78
+ "plugins": [
79
+ "./lib/index.js",
80
+ "./lib/client.js"
81
+ ]
82
+ },
83
+ "surfaces": [
84
+ "desktop",
85
+ "web"
86
+ ],
87
+ "runtime": "cordis",
88
+ "compatibility": {
89
+ "acryl": ">=0.1.0 <1.0.0",
90
+ "node": "^22.19.0 || >=24.0.0",
91
+ "hosts": {
92
+ "@deepseek-ai/cordis": "^4.0.2"
93
+ }
94
+ },
95
+ "capabilities": [
96
+ "launcher-screen"
97
+ ]
98
+ },
99
+ "scripts": {
100
+ "build": "node scripts/clean.mjs && tsdown && tsc -p tsconfig.json --emitDeclarationOnly && tsc -p tsconfig.client.json --emitDeclarationOnly",
101
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit && tsc -p tsconfig.tests.json --noEmit",
102
+ "test": "vitest run",
103
+ "check": "pnpm run build && pnpm run typecheck && pnpm run test"
104
+ }
6
105
  }