@acryldev/harness-runtime 0.0.0-stage → 0.2.12
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/LICENSE +49 -0
- package/README.md +14 -2
- package/lib/index.mjs +5693 -0
- package/lib/index.mjs.map +1 -0
- package/lib/types/acryl-home.d.ts +81 -0
- package/lib/types/app/new-app.d.ts +65 -0
- package/lib/types/app/start-source.d.ts +47 -0
- package/lib/types/blueprint/blueprint.d.ts +74 -0
- package/lib/types/blueprint/brand-identity.d.ts +26 -0
- package/lib/types/blueprint/compose.d.ts +53 -0
- package/lib/types/blueprint/definition.d.ts +22 -0
- package/lib/types/blueprint/index.d.ts +7 -0
- package/lib/types/blueprint/manifest.d.ts +35 -0
- package/lib/types/blueprint/selection.d.ts +19 -0
- package/lib/types/cli-market-install.d.ts +97 -0
- package/lib/types/cli-market-plugins.d.ts +81 -0
- package/lib/types/coding-capabilities.d.ts +29 -0
- package/lib/types/durable-message.d.ts +18 -0
- package/lib/types/engine-dsh.d.ts +181 -0
- package/lib/types/engine-files.d.ts +8 -0
- package/lib/types/engine-host.d.ts +32 -0
- package/lib/types/engine-tools.d.ts +11 -0
- package/lib/types/index.d.ts +67 -0
- package/lib/types/instance/announce-self.d.ts +38 -0
- package/lib/types/instance/app-instance.d.ts +125 -0
- package/lib/types/instance/index.d.ts +6 -0
- package/lib/types/instance/offline-lock.d.ts +29 -0
- package/lib/types/instance/online-secret.d.ts +29 -0
- package/lib/types/instance/registry.d.ts +26 -0
- package/lib/types/instance/select.d.ts +43 -0
- package/lib/types/module-hooks.d.ts +19 -0
- package/lib/types/module-resolution.d.ts +31 -0
- package/lib/types/package-overlay.d.ts +41 -0
- package/lib/types/pinned-pnpm.d.ts +15 -0
- package/lib/types/plugin-acryl-workspace-status.d.ts +24 -0
- package/lib/types/plugin-doctor.d.ts +49 -0
- package/lib/types/plugin-lifecycle-state.d.ts +92 -0
- package/lib/types/plugin-lifecycle.d.ts +87 -0
- package/lib/types/profile-layout.d.ts +17 -0
- package/lib/types/profile-owner.d.ts +25 -0
- package/lib/types/profile-repair/backup.d.ts +37 -0
- package/lib/types/profile-repair/findings.d.ts +29 -0
- package/lib/types/profile-repair/index.d.ts +9 -0
- package/lib/types/profile-repair/inspector.d.ts +11 -0
- package/lib/types/profile-repair/repair.d.ts +38 -0
- package/lib/types/profile-resolution/moved-framework.d.ts +21 -0
- package/lib/types/profile-resolution/resolver.d.ts +41 -0
- package/lib/types/profile-resolution/service.d.ts +22 -0
- package/lib/types/prompt-budget.d.ts +44 -0
- package/lib/types/session-bridge.d.ts +57 -0
- package/lib/types/session-log-exporter.d.ts +31 -0
- package/lib/types/system-prompt-capture.d.ts +29 -0
- package/lib/types/web-favicon-data.d.ts +5 -0
- package/lib/types/web-favicon.d.ts +23 -0
- package/lib/types/web-market-install.d.ts +114 -0
- package/lib/types/web-market-plugins.d.ts +106 -0
- package/lib/types/web-port.d.ts +15 -0
- package/package.json +211 -3
- package/src/acryl-home.ts +103 -0
- package/src/app/new-app.ts +239 -0
- package/src/app/start-source.ts +110 -0
- package/src/blueprint/blueprint.ts +141 -0
- package/src/blueprint/brand-identity.ts +75 -0
- package/src/blueprint/compose.ts +222 -0
- package/src/blueprint/definition.ts +92 -0
- package/src/blueprint/index.ts +20 -0
- package/src/blueprint/manifest.ts +145 -0
- package/src/blueprint/selection.ts +74 -0
- package/src/cli-market-install.ts +181 -0
- package/src/cli-market-plugins.ts +176 -0
- package/src/coding-capabilities.ts +61 -0
- package/src/durable-message.ts +23 -0
- package/src/engine-dsh.ts +856 -0
- package/src/engine-files.ts +9 -0
- package/src/engine-host.ts +128 -0
- package/src/engine-tools.ts +26 -0
- package/src/index.ts +436 -0
- package/src/instance/announce-self.ts +88 -0
- package/src/instance/app-instance.ts +240 -0
- package/src/instance/index.ts +45 -0
- package/src/instance/offline-lock.ts +71 -0
- package/src/instance/online-secret.ts +55 -0
- package/src/instance/registry.ts +53 -0
- package/src/instance/select.ts +134 -0
- package/src/module-hooks.ts +41 -0
- package/src/module-resolution.ts +187 -0
- package/src/package-overlay.ts +160 -0
- package/src/pinned-pnpm.ts +67 -0
- package/src/plugin-acryl-workspace-status.ts +99 -0
- package/src/plugin-doctor.ts +141 -0
- package/src/plugin-lifecycle-state.ts +347 -0
- package/src/plugin-lifecycle.ts +223 -0
- package/src/profile-layout.ts +97 -0
- package/src/profile-owner.ts +52 -0
- package/src/profile-repair/backup.ts +119 -0
- package/src/profile-repair/findings.ts +43 -0
- package/src/profile-repair/index.ts +10 -0
- package/src/profile-repair/inspector.ts +156 -0
- package/src/profile-repair/repair.ts +137 -0
- package/src/profile-resolution/moved-framework.ts +64 -0
- package/src/profile-resolution/resolver.ts +876 -0
- package/src/profile-resolution/service.ts +99 -0
- package/src/prompt-budget.ts +118 -0
- package/src/session-bridge.ts +350 -0
- package/src/session-log-exporter.ts +68 -0
- package/src/system-prompt-capture.ts +99 -0
- package/src/web-favicon-data.ts +6 -0
- package/src/web-favicon.ts +43 -0
- package/src/web-market-install.ts +206 -0
- package/src/web-market-plugins.ts +215 -0
- package/src/web-port.ts +39 -0
- package/tests/account-callback.spec.ts +173 -0
- package/tests/acryl-home.spec.ts +39 -0
- package/tests/agent-self-hosting.spec.ts +101 -0
- package/tests/announce-self.spec.ts +84 -0
- package/tests/app-lifecycle.spec.ts +99 -0
- package/tests/blank-blueprint.spec.ts +110 -0
- package/tests/blueprint-definition.spec.ts +128 -0
- package/tests/blueprint.spec.ts +138 -0
- package/tests/bulkhead.spec.ts +187 -0
- package/tests/coding-vocabulary.spec.ts +15 -0
- package/tests/dump-system-prompt.spec.ts +65 -0
- package/tests/e2e-real-model.spec.ts +71 -0
- package/tests/e2e-restart-real-model.spec.ts +77 -0
- package/tests/engine-dsh.spec.ts +340 -0
- package/tests/engine-host-mount-root-include.spec.ts +118 -0
- package/tests/engine-host.spec.ts +176 -0
- package/tests/engine-optional.spec.ts +81 -0
- package/tests/extension-examples.spec.ts +261 -0
- package/tests/hooks-thread-stack.ts +27 -0
- package/tests/instance-patches.spec.ts +25 -0
- package/tests/instance.spec.ts +235 -0
- package/tests/live/community-plugins.spec.ts +83 -0
- package/tests/module-hooks.spec.ts +35 -0
- package/tests/module-resolution.spec.ts +265 -0
- package/tests/moved-framework.spec.ts +61 -0
- package/tests/new-app.spec.ts +132 -0
- package/tests/organizer-growth.spec.ts +117 -0
- package/tests/pinned-pnpm.spec.ts +34 -0
- package/tests/plugin-acryl-workspace-status.spec.ts +63 -0
- package/tests/plugin-context.spec.ts +640 -0
- package/tests/plugin-doctor.spec.ts +183 -0
- package/tests/plugin-enablement-one-store.spec.ts +130 -0
- package/tests/plugin-lifecycle-state.spec.ts +169 -0
- package/tests/profile-layout.spec.ts +58 -0
- package/tests/profile-owner.spec.ts +38 -0
- package/tests/profile-repair/profile-repair.spec.ts +231 -0
- package/tests/profile-resolution-port.spec.ts +30 -0
- package/tests/profile-resolution-service.spec.ts +273 -0
- package/tests/profile-resolution-swap.spec.ts +69 -0
- package/tests/profile-resolution.spec.ts +2535 -0
- package/tests/profile.spec.ts +70 -0
- package/tests/project-registry.spec.ts +81 -0
- package/tests/prompt-budget.spec.ts +58 -0
- package/tests/real-home-guard.spec.ts +178 -0
- package/tests/session-bridge.spec.ts +316 -0
- package/tests/start-source.spec.ts +65 -0
- package/tests/system-prompt-shape.spec.ts +95 -0
- package/tests/three-levels.spec.ts +84 -0
- package/tests/tool-gateway.spec.ts +116 -0
- package/tests/tool-schemas.spec.ts +41 -0
- package/tests/web-favicon.spec.ts +42 -0
- package/tests/web-port.spec.ts +38 -0
- package/tests/web-startup-hold.spec.ts +79 -0
- package/tsconfig.json +24 -0
- package/tsdown.config.ts +2 -0
- package/vitest.config.ts +18 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ACRYL's own data root, nested one level above the DSH engine home it
|
|
3
|
+
* composes.
|
|
4
|
+
*
|
|
5
|
+
* The stock DSH Desktop app (from dshdesktop.com) uses plain `~/.dsh`, and so
|
|
6
|
+
* did every ACRYL surface until now — sharing that root made the two
|
|
7
|
+
* genuinely different products silently share credentials/settings/sessions,
|
|
8
|
+
* which is both confusing and useless for comparing ACRYL against a stock
|
|
9
|
+
* DSH Desktop install side by side. ACRYL now owns `~/.acryl` and nests each
|
|
10
|
+
* engine's artifacts under it by engine name:
|
|
11
|
+
*
|
|
12
|
+
* ```txt
|
|
13
|
+
* ~/.acryl/ ACRYL's own root — everything not engine-specific
|
|
14
|
+
* ~/.acryl/.dsh/ the DSH engine home (what DSH_HOME resolves to)
|
|
15
|
+
* ~/.acryl/.pi/ reserved for a future pi.dev engine
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* `$ACRYL_HOME`, if a caller has set it, is authoritative: it is the
|
|
19
|
+
* product-level root, so the DSH engine home becomes `<ACRYL_HOME>/.dsh`
|
|
20
|
+
* regardless of any ambient `$DSH_HOME`. That is what makes
|
|
21
|
+
* `ACRYL_HOME=/tmp/x acryl ...` a complete isolation switch. When
|
|
22
|
+
* `$ACRYL_HOME` is unset, an explicit `$DSH_HOME` is still honored, and with
|
|
23
|
+
* neither set the default is `<~/.acryl>/.dsh` rather than the harness's own
|
|
24
|
+
* bare `~/.dsh`.
|
|
25
|
+
*
|
|
26
|
+
* @module @acryldev/harness-runtime/acryl-home
|
|
27
|
+
*/
|
|
28
|
+
/** ACRYL's own root directory name under the OS home. */
|
|
29
|
+
export declare const ACRYL_HOME_DIR_NAME = ".acryl";
|
|
30
|
+
/** The DSH engine's directory name, nested under ACRYL's root. */
|
|
31
|
+
export declare const ACRYL_DSH_ENGINE_DIR_NAME = ".dsh";
|
|
32
|
+
/** ACRYL's own root — `~/.acryl` unless `$ACRYL_HOME` overrides it. */
|
|
33
|
+
export declare function resolveAcrylHome(env?: Record<string, string | undefined>): string;
|
|
34
|
+
/**
|
|
35
|
+
* The DSH engine home ACRYL boots against. Precedence, highest first:
|
|
36
|
+
*
|
|
37
|
+
* 1. `$ACRYL_HOME` set -> `<acrylHome>/.dsh`. ACRYL is the product that owns
|
|
38
|
+
* the root and engines nest inside it, so pinning ACRYL's root is a
|
|
39
|
+
* **complete** isolation switch.
|
|
40
|
+
* 2. `$DSH_HOME` set (and `$ACRYL_HOME` unset) -> that value, for callers
|
|
41
|
+
* pointing ACRYL at an existing DSH home.
|
|
42
|
+
* 3. Neither -> `<~/.acryl>/.dsh`, never the harness's own bare `~/.dsh`.
|
|
43
|
+
*
|
|
44
|
+
* An ambient `$DSH_HOME` must NOT outrank an explicit `$ACRYL_HOME`. That
|
|
45
|
+
* ordering used to invert these, which made isolation silently unenforceable:
|
|
46
|
+
* `DSH_HOME` is commonly exported in a developer shell (and set by the DSH
|
|
47
|
+
* Desktop app), so `ACRYL_HOME=/tmp/x` would read and write the operator's
|
|
48
|
+
* real `~/.dsh` unchanged - credentials, sessions and all. A cold-start or
|
|
49
|
+
* clean-room test written that way passes while never being isolated.
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveAcrylDshHome(env?: Record<string, string | undefined>): string;
|
|
52
|
+
/**
|
|
53
|
+
* The isolated local-dev DSH home (`~/.acryl-dev/.dsh`) — a third root,
|
|
54
|
+
* deliberately sibling to (not nested inside) both `resolveAcrylDshHome`'s
|
|
55
|
+
* packaged-install default (`~/.acryl/.dsh`) and the stock DSH Desktop's
|
|
56
|
+
* plain `~/.dsh`, so a dev run never collides with either.
|
|
57
|
+
*
|
|
58
|
+
* `scripts/dev-local.mjs` at the repo root is this value's one canonical,
|
|
59
|
+
* hand-written definition (it runs before any workspace package builds, so
|
|
60
|
+
* it cannot import this module) and is what actually sets `$DSH_HOME` for
|
|
61
|
+
* `pnpm run dev`. Every *other* desktop dev-mode entry point - `apps/
|
|
62
|
+
* acryl-desktop/scripts/launch-dev.mjs`, `verify-loader-boot.mjs`,
|
|
63
|
+
* `verify-profile-boot.mjs` - runs strictly after that package already
|
|
64
|
+
* built, so they import this exported copy instead of re-deriving it, and
|
|
65
|
+
* default `$DSH_HOME` to it when unset. That is what makes running the
|
|
66
|
+
* desktop package's own script directly (`pnpm --filter acryl-desktop run
|
|
67
|
+
* dev`, bypassing the root orchestrator) resolve the identical isolated
|
|
68
|
+
* home rather than silently falling back to `resolveAcrylDshHome`'s
|
|
69
|
+
* packaged-install default - a real, reproduced footgun (2026-09-14) that
|
|
70
|
+
* this function exists to close for good.
|
|
71
|
+
*/
|
|
72
|
+
export declare const ACRYL_DEV_HOME_DIR_NAME = ".acryl-dev";
|
|
73
|
+
/** The isolated local-dev DSH home - see {@link ACRYL_DEV_HOME_DIR_NAME}'s doc comment. */
|
|
74
|
+
export declare function resolveAcrylDevDshHome(): string;
|
|
75
|
+
/**
|
|
76
|
+
* Default `$DSH_HOME` (in-place, on the given env) to the isolated
|
|
77
|
+
* local-dev home when neither `$ACRYL_HOME` nor `$DSH_HOME` is already set.
|
|
78
|
+
* Call this once, at the very top of a desktop dev-mode script, before
|
|
79
|
+
* anything else reads the environment.
|
|
80
|
+
*/
|
|
81
|
+
export declare function applyIsolatedDevHomeDefault(env?: Record<string, string | undefined>): void;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `acryl new <dir>`: create an ACRYL Blends app, the way `rails new` creates a Rails app. Convention over configuration: every app has the same shape, so
|
|
3
|
+
* the builder inside it (the agent) and every tool know where everything is without being told.
|
|
4
|
+
*
|
|
5
|
+
* <app>/blend.yaml what the app is: a Blends manifest (name, brand, the Blueprint it grew from) commit
|
|
6
|
+
* <app>/plugins/ the app's own plugins; the agent inside builds them here; they load at every start commit (not plugins/.store/)
|
|
7
|
+
* <app>/AGENTS.md the conventions, read by the agent inside at the start of every session commit
|
|
8
|
+
* <app>/bin/acryl start it: bin/acryl web | desktop | cli
|
|
9
|
+
* <app>/.dsh/ what the runtime keeps (sessions, settings, profile) ignored
|
|
10
|
+
* <app>/desktop-data/ the desktop window's own data (window state, storage, logs, crash evidence) ignored
|
|
11
|
+
*
|
|
12
|
+
* The app folder is the app's ACRYL home, so an app is self-contained like a container: it can be copied, committed, run beside any other app and deleted
|
|
13
|
+
* without touching anything else. It is the user's project from the first second: nothing in it is ACRYL-branded, it gets its own git repository, and its
|
|
14
|
+
* license is the user's choice (closed source and commercial included; the framework and the harness it uses are MIT). Pure file planning plus one write boundary.
|
|
15
|
+
*
|
|
16
|
+
* @module @acryldev/harness-runtime/app/new-app
|
|
17
|
+
*/
|
|
18
|
+
import { type BrandIdentity } from '../blueprint/brand-identity.ts';
|
|
19
|
+
import { type Blueprint } from '../blueprint/blueprint.ts';
|
|
20
|
+
export declare const APP_MANIFEST_FILE = "blend.yaml";
|
|
21
|
+
export declare const APP_PLUGINS_DIR = "plugins";
|
|
22
|
+
export declare class NewAppError extends Error {
|
|
23
|
+
constructor(message: string);
|
|
24
|
+
}
|
|
25
|
+
export interface NewAppOptions {
|
|
26
|
+
/** Display name; defaults to the folder name. */
|
|
27
|
+
readonly title?: string;
|
|
28
|
+
/** Blueprint the app grows from; `acryl.blank` by default. */
|
|
29
|
+
readonly blueprint?: string;
|
|
30
|
+
readonly brand?: Partial<Omit<BrandIdentity, 'name'>>;
|
|
31
|
+
/** Absolute path of the launcher `bin/acryl` hands off to (the framework's `scripts/blank.mjs`). */
|
|
32
|
+
readonly launcher: string;
|
|
33
|
+
/**
|
|
34
|
+
* Create the app from an existing app or captured Blend (its `blend.yaml`, and its `blend.lock.json` when it has one) instead of a Blueprint: the new
|
|
35
|
+
* app keeps what the source grew (rows, brand, lineage) under its own name and id. Its `plugins/` are copied by `writeNewApp`.
|
|
36
|
+
*/
|
|
37
|
+
readonly from?: {
|
|
38
|
+
readonly manifestText: string;
|
|
39
|
+
readonly lockText?: string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export interface PlannedApp {
|
|
43
|
+
readonly root: string;
|
|
44
|
+
readonly name: string;
|
|
45
|
+
readonly blueprint: Blueprint;
|
|
46
|
+
readonly files: Readonly<Record<string, string>>;
|
|
47
|
+
}
|
|
48
|
+
/** Pure: everything `acryl new` would write, by relative path. */
|
|
49
|
+
export declare function planNewApp(dir: string, options: NewAppOptions): PlannedApp;
|
|
50
|
+
/** Write the app. The folder must not exist or must be empty: `new` never overwrites. `runtimeDir` hands the app its own Web runtime (see below). */
|
|
51
|
+
/** A file of the launcher an app carries: copied from the framework, or written with the given content. */
|
|
52
|
+
export type LauncherFile = {
|
|
53
|
+
readonly from: string;
|
|
54
|
+
} | {
|
|
55
|
+
readonly content: string;
|
|
56
|
+
};
|
|
57
|
+
export declare function writeNewApp(planned: PlannedApp, options?: {
|
|
58
|
+
readonly runtimeDir?: string;
|
|
59
|
+
readonly launcherFiles?: Readonly<Record<string, LauncherFile>>;
|
|
60
|
+
readonly git?: boolean;
|
|
61
|
+
readonly pluginsFrom?: string;
|
|
62
|
+
readonly blueprintsFrom?: string;
|
|
63
|
+
}): {
|
|
64
|
+
readonly git: 'initialized' | 'skipped' | 'unavailable';
|
|
65
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a new app starts from (`acryl new --from`, spec 036 `persistence-and-registries.md`): an app or captured Blend folder, a git repository (public or
|
|
3
|
+
* private, reached with the user's own git credentials), or a starter id in a registry (a git repository or folder with `index.json`). Everything is
|
|
4
|
+
* resolved to a local folder that has `blend.yaml`, which `planNewApp` / `writeNewApp` take from there.
|
|
5
|
+
*
|
|
6
|
+
* Git is a port (`GitClone`): the rules here are pure; `gitClone` below is the adapter that shells out to the user's git, never prompting for credentials.
|
|
7
|
+
*
|
|
8
|
+
* @module @acryldev/harness-runtime/app/start-source
|
|
9
|
+
*/
|
|
10
|
+
/** The public registry: a folder of the acrylblends.github.io repository. `#<folder>` names the folder inside a repository. */
|
|
11
|
+
export declare const PUBLIC_REGISTRY = "https://github.com/acrylblends/acrylblends.github.io.git#registry";
|
|
12
|
+
export type StartSource = {
|
|
13
|
+
readonly kind: 'folder';
|
|
14
|
+
readonly path: string;
|
|
15
|
+
} | {
|
|
16
|
+
readonly kind: 'git';
|
|
17
|
+
readonly url: string;
|
|
18
|
+
readonly subdir?: string;
|
|
19
|
+
} | {
|
|
20
|
+
readonly kind: 'registry';
|
|
21
|
+
readonly id: string;
|
|
22
|
+
};
|
|
23
|
+
export declare class StartSourceError extends Error {
|
|
24
|
+
constructor(message: string);
|
|
25
|
+
}
|
|
26
|
+
/** Clone `url` (shallow) into `into`. Throws with git's own message on failure. */
|
|
27
|
+
export type GitClone = (url: string, into: string) => void;
|
|
28
|
+
/** Pure: what `--from` names. A path that exists is a folder; a git URL is a repository; a dotted id is a registry starter. */
|
|
29
|
+
export declare function classifyStartSource(from: string, isDirectory: (path: string) => boolean): StartSource;
|
|
30
|
+
/** The adapter: the user's git, shallow, and never waiting on a credentials prompt (a private repository needs the user's own git login). */
|
|
31
|
+
export declare const gitClone: GitClone;
|
|
32
|
+
export interface ResolvedStartSource {
|
|
33
|
+
/** A local folder with `blend.yaml`. */
|
|
34
|
+
readonly folder: string;
|
|
35
|
+
/** Where it came from, for the new app's description and the user's report. */
|
|
36
|
+
readonly origin: string;
|
|
37
|
+
/** Remove the temporary clone, if any. */
|
|
38
|
+
dispose(): void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Resolve `--from` to a local folder. `registry` is a folder or git URL (`#<folder>` allowed) holding `index.json`; the public registry by default.
|
|
42
|
+
* The caller disposes the result when the new app is written.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveStartSource(from: string, options?: {
|
|
45
|
+
readonly registry?: string;
|
|
46
|
+
readonly clone?: GitClone;
|
|
47
|
+
}): ResolvedStartSource;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blueprint: a named, minimal starting composition of ACRYL. The stem cell of the framework: `blank` is the smallest
|
|
3
|
+
* thing that is still a working agent, and everything else is grown from it by adding Cordis plugins (locally first,
|
|
4
|
+
* published when worth sharing). `acryl.ide`, the agentic coding IDE the team ships, is not a separate product: it is one
|
|
5
|
+
* Blend grown from `acryl.blank` (the flagship example of what the framework builds), and `grewFrom` records that lineage.
|
|
6
|
+
*
|
|
7
|
+
* A Blueprint is pure data, keyed by the ubiquitous language of the Blends spec: it names capabilities and optional
|
|
8
|
+
* rows, never Loader mechanics. Turning it into Loader patches is `compose.ts`; choosing one is `selection.ts`.
|
|
9
|
+
* Nothing here is special-cased in the runtime: every row a Blueprint names is an ordinary Cordis plugin, so adding
|
|
10
|
+
* one later, or disabling one, is the same reversible row edit for a human, an agent or a Blend file.
|
|
11
|
+
*
|
|
12
|
+
* @module @acryldev/harness-runtime/blueprint/blueprint
|
|
13
|
+
*/
|
|
14
|
+
import { type AcrylCodingCapabilityId, type AcrylShellMode } from '../coding-capabilities.ts';
|
|
15
|
+
import { type BrandIdentity } from './brand-identity.ts';
|
|
16
|
+
/** ACRYL-owned rows a Blueprint may include on top of the capabilities. Each is one independently replaceable plugin. */
|
|
17
|
+
export type BlueprintRowId = 'plugin-context' | 'system-prompt' | 'ui-library' | 'community-market' | 'shortcuts' | 'mount-anchors' | 'app-save' | 'plugin-hub' | 'app-shell' | 'framework-kit' | 'command-reply';
|
|
18
|
+
/** Every row id, as data: what a Blueprint file may name. Kept next to the type so the two cannot drift (a test asserts it). */
|
|
19
|
+
export declare const BLUEPRINT_ROW_IDS: readonly BlueprintRowId[];
|
|
20
|
+
/** Row ids a Blueprint file once used, read as their current names (spec 044 step 1b); never written. */
|
|
21
|
+
export declare const RENAMED_BLUEPRINT_ROW_IDS: Readonly<Record<string, BlueprintRowId>>;
|
|
22
|
+
/** `acryl`: the stock ACRYL brand plugin. `custom`: the configurable `@acryldev/brand` plugin carrying this identity. */
|
|
23
|
+
export type BlueprintBrand = {
|
|
24
|
+
readonly kind: 'acryl';
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: 'custom';
|
|
27
|
+
readonly identity: BrandIdentity;
|
|
28
|
+
};
|
|
29
|
+
export interface Blueprint {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
readonly name: string;
|
|
32
|
+
readonly description: string;
|
|
33
|
+
readonly capabilities: readonly AcrylCodingCapabilityId[];
|
|
34
|
+
readonly rows: readonly BlueprintRowId[];
|
|
35
|
+
readonly brand: BlueprintBrand;
|
|
36
|
+
readonly shell: AcrylShellMode;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the DeepSeek Harness chat (its agent loop and model providers) is part of this composition. Off, the app keeps its frame
|
|
39
|
+
* (tab stripe, workspaces, canvas, terminals, Agent Control) and other agents work in it; the DSH chat is one agent, not the foundation.
|
|
40
|
+
* Applies to the Web and Desktop surfaces: the terminal UI is the DSH chat.
|
|
41
|
+
*/
|
|
42
|
+
readonly dshChat: boolean;
|
|
43
|
+
/** The Blueprint this one was grown from, when it is a Blend of another (the IDE grew from the blank canvas). */
|
|
44
|
+
readonly grewFrom?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The stem cell: an agent to talk to, a model chooser (authorization), an input, and the plugin context pack so the agent can
|
|
48
|
+
* grow the rest. No workspace, no Market, no admin panel. The brand is configurable so it can be renamed without code.
|
|
49
|
+
*/
|
|
50
|
+
export declare const BLANK_BLUEPRINT: Blueprint;
|
|
51
|
+
/**
|
|
52
|
+
* ACRYL the agentic coding IDE: the blank canvas grown into a development environment (workspace, plugin admin, Market, shortcuts, mount anchors, the
|
|
53
|
+
* advanced shell, the ACRYL brand). Written as blank plus what it added, so the lineage is the definition, not a comment. Still the default when no
|
|
54
|
+
* Blueprint is selected, because it is what ACRYL's own installs are.
|
|
55
|
+
*/
|
|
56
|
+
export declare const IDE_BLUEPRINT: Blueprint;
|
|
57
|
+
/**
|
|
58
|
+
* The IDE for people who bring their own agents: the same frame and rows, with the DeepSeek Harness chat switched off. Claude Code, Codex or any
|
|
59
|
+
* agent in a terminal tab (or driving the page through Agent Control) works in it; turning the chat back on is one row edit, not a rebuild.
|
|
60
|
+
*/
|
|
61
|
+
export declare const AGENTS_BLUEPRINT: Blueprint;
|
|
62
|
+
/** Read-only port: where Blueprints come from. Built-ins today; a hub, a Blend lock or a private registry later. */
|
|
63
|
+
export interface BlueprintCatalog {
|
|
64
|
+
get(id: string): Blueprint | undefined;
|
|
65
|
+
list(): readonly Blueprint[];
|
|
66
|
+
}
|
|
67
|
+
export declare function builtInCatalog(): BlueprintCatalog;
|
|
68
|
+
export declare class UnknownBlueprintError extends Error {
|
|
69
|
+
constructor(id: string, known: readonly Blueprint[]);
|
|
70
|
+
}
|
|
71
|
+
/** Use case: pick the Blueprint a surface boots with. No selection means the IDE, what ACRYL's own installs are. */
|
|
72
|
+
export declare function selectBlueprint(id: string | undefined, catalog?: BlueprintCatalog): Blueprint;
|
|
73
|
+
/** A copy of a Blueprint under a different brand. Immutable: the original is untouched. */
|
|
74
|
+
export declare function withBrand(blueprint: Blueprint, identity: BrandIdentity): Blueprint;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BrandIdentity: the value object a Blueprint carries so anyone who builds on ACRYL can ship it under their own name
|
|
3
|
+
* (a private, closed-source product or an internal tool). Pure: no I/O, no framework types. Every invariant is
|
|
4
|
+
* enforced at construction, so a Blueprint can never hold a brand the client cannot render.
|
|
5
|
+
*
|
|
6
|
+
* @module @acryldev/harness-runtime/blueprint/brand-identity
|
|
7
|
+
*/
|
|
8
|
+
export interface BrandIdentity {
|
|
9
|
+
/** Product name shown in the sidebar, the tab or window title and the agent's own identity line. */
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly tagline?: string;
|
|
12
|
+
/** Accent color as `#rrggbb`; `accentDark` is the dark-mode variant (defaults to `accent`). */
|
|
13
|
+
readonly accent?: string;
|
|
14
|
+
readonly accentDark?: string;
|
|
15
|
+
/** A CSS font-family list. */
|
|
16
|
+
readonly fontFamily?: string;
|
|
17
|
+
/** One to three characters drawn as the logo mark when no image is supplied (defaults to the name's first letter). */
|
|
18
|
+
readonly mark?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class InvalidBrandIdentityError extends Error {
|
|
21
|
+
constructor(detail: string);
|
|
22
|
+
}
|
|
23
|
+
/** Validate untrusted input (a YAML row config, an environment value) into a BrandIdentity. */
|
|
24
|
+
export declare function brandIdentity(input: unknown): BrandIdentity;
|
|
25
|
+
/** The agent's opening identity line under this brand (what the system prompt says the agent is). */
|
|
26
|
+
export declare function identityLine(brand: BrandIdentity): string;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compose: the pure translation from a Blueprint to what a surface's Loader needs: which ACRYL-owned packages must be
|
|
3
|
+
* resolvable, and which Loader patches to apply. No I/O and no framework handles; the composition root
|
|
4
|
+
* (`engine-dsh.ts`) does the materializing and mounting. The row table below is the single place a row's package, id
|
|
5
|
+
* and surfaces are declared, in the order the rows must mount (the shortcut registry before anything that reads it).
|
|
6
|
+
*
|
|
7
|
+
* @module @acryldev/harness-runtime/blueprint/compose
|
|
8
|
+
*/
|
|
9
|
+
import type { PatchOptions } from '@deepseek-ai/cordis-plugin-include';
|
|
10
|
+
import type { AcrylSurface } from '../coding-capabilities.ts';
|
|
11
|
+
import type { Blueprint, BlueprintRowId } from './blueprint.ts';
|
|
12
|
+
/** One Loader row: its id, the module it loads (`name`), and the package that module lives in, which the profile must resolve. */
|
|
13
|
+
interface RowModule {
|
|
14
|
+
readonly rowId: string;
|
|
15
|
+
readonly module: string;
|
|
16
|
+
readonly packageName: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The DSH rows that make it a chat: the agent, the model registry and the pi-ai provider. Disabling them leaves the web server, the session
|
|
20
|
+
* store, the client and every ACRYL row running; Cordis parks the consumers that need them as PENDING (measured on 0.2.0-rc.2: 17 rows, among them
|
|
21
|
+
* the chat session controller and the model providers) and reactivates them when the rows come back.
|
|
22
|
+
*/
|
|
23
|
+
export declare const DSH_CHAT_ROW_IDS: readonly string[];
|
|
24
|
+
/** DSH's base-bundle row providing `pluginManager`, and the hub's row that takes its place (its id is its module, by the row-naming rule). */
|
|
25
|
+
export declare const DSH_PLUGIN_MANAGER_ROW_ID = "plugin-manager";
|
|
26
|
+
/** The plugin manager row's id, from before the rename (persisted); the module it mounts is the scoped package's subpath. */
|
|
27
|
+
export declare const PLUGIN_MANAGER_ROW_ID = "acryl-plugin-hub/manager";
|
|
28
|
+
/**
|
|
29
|
+
* Modules a Blend once named, read as their current names and never written: `@acryldev/plugin-context`'s old name (spec 044 step 1b), and the
|
|
30
|
+
* framework packages that became subpaths of `acrylblends` when the framework moved to its own repository (spec 049 slice 17).
|
|
31
|
+
*/
|
|
32
|
+
export declare const RENAMED_MODULES: Readonly<Record<string, string>>;
|
|
33
|
+
/** A module as it is named today: a renamed one under its current name, anything else unchanged. */
|
|
34
|
+
export declare function currentModule(module: string): string;
|
|
35
|
+
/** The package a module specifier lives in: `acrylblends/cordis/router` is in `acrylblends`, `@acryldev/ui` in itself. */
|
|
36
|
+
export declare function packageOfModule(module: string): string;
|
|
37
|
+
/** Which Blueprint row a module is, if it is one of ACRYL's own rows (used to read a Blends manifest's rows back into a Blueprint). */
|
|
38
|
+
export declare function blueprintRowForModule(module: string): BlueprintRowId | undefined;
|
|
39
|
+
/** The row that fills a Blueprint row (used to write a Blueprint as a Blends manifest). */
|
|
40
|
+
export declare function rowForBlueprintRow(id: BlueprintRowId): RowModule;
|
|
41
|
+
export interface BlueprintComposition {
|
|
42
|
+
/** ACRYL-owned packages to make resolvable from the profile. */
|
|
43
|
+
readonly packages: readonly string[];
|
|
44
|
+
readonly patches: readonly PatchOptions[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The ACRYL-owned rows and brand for one surface. `existingRowIds` are rows the profile's own bundle already composes:
|
|
48
|
+
* an `insert` of the same id would throw at boot, so those rows are skipped rather than composed twice.
|
|
49
|
+
*/
|
|
50
|
+
export declare function composeBlueprintRows(blueprint: Blueprint, surface: AcrylSurface, existingRowIds?: ReadonlySet<string>,
|
|
51
|
+
/** The rows the advanced shell replaces, from the surface's composition (`@acryldev/coding-capabilities`' `ADVANCED_SHELL_PATCHES`). */
|
|
52
|
+
appFramePatches?: readonly PatchOptions[]): BlueprintComposition;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blueprint definition: the pure translation from untrusted data (a parsed YAML or JSON file) into a Blueprint, so a team can
|
|
3
|
+
* define its own starter and brand it without writing code. No I/O here; `selection.ts` reads the file.
|
|
4
|
+
*
|
|
5
|
+
* ```yaml
|
|
6
|
+
* id: acme.notes
|
|
7
|
+
* name: Acme Notes
|
|
8
|
+
* extends: acryl.blank # optional: start from a known Blueprint, then override
|
|
9
|
+
* brand: { name: Acme Notes, accent: '#0a7d4b' }
|
|
10
|
+
* rows: [plugin-context, system-prompt, ui-library, community-market]
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* Unknown keys, unknown capabilities and unknown rows are rejected, so a typo is an error at start-up, not a silently missing feature.
|
|
14
|
+
*
|
|
15
|
+
* @module @acryldev/harness-runtime/blueprint/definition
|
|
16
|
+
*/
|
|
17
|
+
import { type Blueprint, type BlueprintCatalog } from './blueprint.ts';
|
|
18
|
+
export declare class InvalidBlueprintError extends Error {
|
|
19
|
+
constructor(detail: string);
|
|
20
|
+
}
|
|
21
|
+
/** Turn parsed data into a Blueprint. `extends` resolves against `catalog` (built-ins by default). */
|
|
22
|
+
export declare function parseBlueprint(input: unknown, catalog?: BlueprintCatalog): Blueprint;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { brandIdentity, identityLine, InvalidBrandIdentityError, type BrandIdentity } from './brand-identity.ts';
|
|
2
|
+
export { AGENTS_BLUEPRINT, BLANK_BLUEPRINT, IDE_BLUEPRINT, UnknownBlueprintError, BLUEPRINT_ROW_IDS, builtInCatalog, selectBlueprint, withBrand, type Blueprint, type BlueprintBrand, type BlueprintCatalog, type BlueprintRowId, } from './blueprint.ts';
|
|
3
|
+
export { blueprintRowForModule, composeBlueprintRows, currentModule, DSH_CHAT_ROW_IDS, DSH_PLUGIN_MANAGER_ROW_ID, packageOfModule, PLUGIN_MANAGER_ROW_ID, RENAMED_MODULES, rowForBlueprintRow, type BlueprintComposition } from './compose.ts';
|
|
4
|
+
export { blueprintFromEnvironment } from './selection.ts';
|
|
5
|
+
export { InvalidBlueprintError, parseBlueprint } from './definition.ts';
|
|
6
|
+
export { readBlueprintFile, readStarters } from './selection.ts';
|
|
7
|
+
export { BLENDS_API_VERSION, BRAND_PACKAGE, appManifest, blueprintFromManifest, catalogWithStarters, isBlendsManifest } from './manifest.ts';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The app definition file (`blend.yaml`) is a Blends manifest (`blends.acryl.dev/v1alpha1`), so one file is both what the Blends tooling reads, captures
|
|
3
|
+
* and publishes and what this runtime boots from. The format itself (schema, structural rules, lineage) is validated by `@acryldev/blends-core`, the one
|
|
4
|
+
* reader of the format; this module is only the translation between the two vocabularies, pure and in both directions:
|
|
5
|
+
*
|
|
6
|
+
* manifest -> Blueprint `kind: Blend` grows from `spec.lineage.blueprint` (a known Blueprint); `kind: Blueprint` names one. Rows whose package is one of
|
|
7
|
+
* ACRYL's own rows turn that capability on (or off with `disabled: true`); the `@acryldev/brand` row's config is the brand. Any other
|
|
8
|
+
* row is an app plugin: it lives in the app's `extensions/` and loads from there, so the Blueprint does not compose it.
|
|
9
|
+
* Blueprint -> manifest what `acryl new` writes.
|
|
10
|
+
*
|
|
11
|
+
* @module @acryldev/harness-runtime/blueprint/manifest
|
|
12
|
+
*/
|
|
13
|
+
import { type BrandIdentity } from './brand-identity.ts';
|
|
14
|
+
import { type Blueprint, type BlueprintCatalog } from './blueprint.ts';
|
|
15
|
+
export declare const BLENDS_API_VERSION = "blends.acryl.dev/v1alpha1";
|
|
16
|
+
export declare const BRAND_PACKAGE = "@acryldev/brand";
|
|
17
|
+
export declare function isBlendsManifest(input: unknown): boolean;
|
|
18
|
+
/** Turn a parsed Blends manifest into the Blueprint this runtime boots. */
|
|
19
|
+
export declare function blueprintFromManifest(input: unknown, catalog?: BlueprintCatalog): Blueprint;
|
|
20
|
+
/** The manifest `acryl new` writes: a Blend grown from `blueprint`, carrying the brand as a row. */
|
|
21
|
+
export declare function appManifest(input: {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
blueprint: Blueprint;
|
|
25
|
+
brand: BrandIdentity;
|
|
26
|
+
description?: string;
|
|
27
|
+
}): Record<string, unknown>;
|
|
28
|
+
/**
|
|
29
|
+
* The Blueprints an app can grow from: the built-ins, plus the starter definitions it keeps in its `blueprints/` folder (`acryl new --from <starter>` copies
|
|
30
|
+
* the starter there, like a lock of the parent). A starter may extend another starter; each is resolved on first use, and a cycle is refused.
|
|
31
|
+
*/
|
|
32
|
+
export declare function catalogWithStarters(starters: ReadonlyArray<{
|
|
33
|
+
readonly id: string;
|
|
34
|
+
readonly document: unknown;
|
|
35
|
+
}>, base?: BlueprintCatalog): BlueprintCatalog;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The boundary that reads the environment to choose a Blueprint. Kept apart from the pure domain modules so the only
|
|
3
|
+
* `process.env` access in the blueprint context is in one named place.
|
|
4
|
+
*
|
|
5
|
+
* `ACRYL_BLUEPRINT` names a built-in Blueprint id (`acryl.blank`, `acryl.ide`) or a `.yaml`, `.yml` or `.json` file that defines one
|
|
6
|
+
* (see `definition.ts`); unset means `acryl.ide`.
|
|
7
|
+
* `ACRYL_BRAND_NAME` (and the other `ACRYL_BRAND_*` values) rebrand the selected Blueprint without editing any file.
|
|
8
|
+
*
|
|
9
|
+
* @module @acryldev/harness-runtime/blueprint/selection
|
|
10
|
+
*/
|
|
11
|
+
import { type Blueprint } from './blueprint.ts';
|
|
12
|
+
/** Read and validate a Blueprint file. A missing or malformed file fails loudly: a silent fallback would boot the wrong product. */
|
|
13
|
+
export declare function readBlueprintFile(path: string): Blueprint;
|
|
14
|
+
/** The starter definitions an app keeps in its `blueprints/` folder, each a Blends manifest of kind Blueprint. */
|
|
15
|
+
export declare function readStarters(folder: string): Array<{
|
|
16
|
+
id: string;
|
|
17
|
+
document: unknown;
|
|
18
|
+
}>;
|
|
19
|
+
export declare function blueprintFromEnvironment(env?: NodeJS.ProcessEnv): Blueprint;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI/TUI's own `desktopProfiles`/`desktopPnpm` capabilities (spec 034,
|
|
3
|
+
* completing T006 for the third surface) - what `@acryldev/cordis-plugin-market`'s
|
|
4
|
+
* install service needs for a CLI-driven Market install/uninstall to do a
|
|
5
|
+
* real package operation, instead of the "ACRYL is required" gate it shows
|
|
6
|
+
* without them.
|
|
7
|
+
*
|
|
8
|
+
* Adapted directly from `web-market-install.ts` - see that file's own doc
|
|
9
|
+
* comment for why this is deliberately not a port of Desktop's much larger
|
|
10
|
+
* `pnpm.ts`/`install-recovery.ts` (a crash-recovery WAL built around
|
|
11
|
+
* Electron's own generation-restart cycle, which neither Web nor a CLI
|
|
12
|
+
* process has an equivalent of). The one real difference from Web: the CLI
|
|
13
|
+
* has more than one named profile (Web's is always `web`), so the profile
|
|
14
|
+
* name is a constructor parameter here, not a literal.
|
|
15
|
+
*
|
|
16
|
+
* Install mechanics reuse `dsh plugin --profile <name> add/remove`, the same
|
|
17
|
+
* path a human operator already uses - confirmed (like Web) to have no
|
|
18
|
+
* `--profile` restriction, unlike Desktop's packaged CLI.
|
|
19
|
+
*/
|
|
20
|
+
import { Readable } from 'node:stream';
|
|
21
|
+
import { type Context, Service } from '@deepseek-ai/cordis';
|
|
22
|
+
import { type PnpmProfileConfig } from './profile-layout.ts';
|
|
23
|
+
/** Matches `@acryldev/cordis-plugin-market`'s own `MarketDesktopProfile` shape. */
|
|
24
|
+
export interface CliMarketProfile {
|
|
25
|
+
readonly name: string;
|
|
26
|
+
readonly dir: string;
|
|
27
|
+
}
|
|
28
|
+
/** Matches `@acryldev/cordis-plugin-market`'s own `MarketDesktopPnpmOutcome` shape. */
|
|
29
|
+
export interface CliMarketPnpmOutcome {
|
|
30
|
+
readonly exitCode: number | null;
|
|
31
|
+
readonly signal: NodeJS.Signals | null;
|
|
32
|
+
}
|
|
33
|
+
/** Matches `@acryldev/cordis-plugin-market`'s own `MarketDesktopPnpmHandle` shape. */
|
|
34
|
+
export interface CliMarketPnpmHandle {
|
|
35
|
+
readonly stdout: Readable;
|
|
36
|
+
readonly stderr: Readable;
|
|
37
|
+
readonly done: Promise<CliMarketPnpmOutcome>;
|
|
38
|
+
cancel(): void;
|
|
39
|
+
}
|
|
40
|
+
/** Matches `@acryldev/cordis-plugin-market`'s own `MarketDesktopPnpm` shape exactly. */
|
|
41
|
+
export interface CliMarketPnpm {
|
|
42
|
+
runPlugin(args: readonly string[], invokingDir: string, signal?: AbortSignal): CliMarketPnpmHandle;
|
|
43
|
+
installPlugin(request: {
|
|
44
|
+
readonly pnpmOptions?: readonly string[];
|
|
45
|
+
readonly invokingDir: string;
|
|
46
|
+
readonly recovery: {
|
|
47
|
+
readonly packageName: string;
|
|
48
|
+
readonly packageVersion: string;
|
|
49
|
+
readonly receiptId: string;
|
|
50
|
+
};
|
|
51
|
+
readonly signal?: AbortSignal;
|
|
52
|
+
}): Promise<CliMarketPnpmHandle>;
|
|
53
|
+
recoveredInstallReceiptIds(): Promise<readonly string[]>;
|
|
54
|
+
acknowledgeRecoveredInstall(receiptId: string): Promise<void>;
|
|
55
|
+
rollbackPluginInstall(receiptId: string): Promise<boolean>;
|
|
56
|
+
acknowledgeLiveInstall(packageName: string): Promise<void>;
|
|
57
|
+
}
|
|
58
|
+
/** The one profile this TUI process actually booted. */
|
|
59
|
+
export declare class CliProfilesService extends Service {
|
|
60
|
+
private readonly profile;
|
|
61
|
+
constructor(ctx: Context, profile: CliMarketProfile);
|
|
62
|
+
get current(): CliMarketProfile;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Runs `dsh plugin --profile <name> <verb> <...args>` as a real child
|
|
66
|
+
* process, inheriting this process's own `DSH_HOME` - `-w` included for
|
|
67
|
+
* pnpm's own workspace-root safety check on a profile's single-package pnpm
|
|
68
|
+
* workspace (identical reproduction to Web's and Desktop's own install path).
|
|
69
|
+
*/
|
|
70
|
+
export declare class CliPnpmService extends Service implements CliMarketPnpm {
|
|
71
|
+
private readonly dshBin;
|
|
72
|
+
private readonly profileName;
|
|
73
|
+
private readonly profileDir;
|
|
74
|
+
constructor(ctx: Context, config: PnpmProfileConfig);
|
|
75
|
+
runPlugin(args: readonly string[], _invokingDir: string, signal?: AbortSignal): CliMarketPnpmHandle;
|
|
76
|
+
installPlugin(request: {
|
|
77
|
+
readonly pnpmOptions?: readonly string[];
|
|
78
|
+
readonly invokingDir: string;
|
|
79
|
+
readonly recovery: {
|
|
80
|
+
readonly packageName: string;
|
|
81
|
+
readonly packageVersion: string;
|
|
82
|
+
readonly receiptId: string;
|
|
83
|
+
};
|
|
84
|
+
readonly signal?: AbortSignal;
|
|
85
|
+
}): Promise<CliMarketPnpmHandle>;
|
|
86
|
+
recoveredInstallReceiptIds(): Promise<readonly string[]>;
|
|
87
|
+
acknowledgeRecoveredInstall(_receiptId: string): Promise<void>;
|
|
88
|
+
rollbackPluginInstall(_receiptId: string): Promise<boolean>;
|
|
89
|
+
acknowledgeLiveInstall(_packageName: string): Promise<void>;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Provide `desktopProfiles`/`desktopPnpm` on the host root for this CLI
|
|
93
|
+
* process's own booted profile.
|
|
94
|
+
* @param ctx - the host root.
|
|
95
|
+
* @param profile - the profile this TUI process actually composed.
|
|
96
|
+
*/
|
|
97
|
+
export declare function provideCliMarketInstall(ctx: Context, profile: CliMarketProfile): void;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI/TUI's own `desktopPlugins` + `livePluginActivation` capabilities (spec
|
|
3
|
+
* 034, completing T006 for the third surface) - the package-name-shaped view
|
|
4
|
+
* `@acryldev/cordis-plugin-market`'s install service needs, plus real live activation
|
|
5
|
+
* so an install through the TUI's own `/plugins` command takes effect
|
|
6
|
+
* without restarting the process.
|
|
7
|
+
*
|
|
8
|
+
* Adapted directly from `web-market-plugins.ts` - not a new lifecycle
|
|
9
|
+
* implementation. It wraps the same shared `AcrPluginLifecycleController`
|
|
10
|
+
* (spec 034 T005) the CLI's own `acryl plugin enable/disable` and Desktop's
|
|
11
|
+
* Lifecycle tab already drive.
|
|
12
|
+
*/
|
|
13
|
+
import { type Context, Service } from '@deepseek-ai/cordis';
|
|
14
|
+
import type { AcrPluginLifecycleController } from '@acryldev/control';
|
|
15
|
+
import { type DshPluginLifecycleOptions } from './plugin-lifecycle.ts';
|
|
16
|
+
export interface CliMarketPluginBundle {
|
|
17
|
+
readonly bundleId: string;
|
|
18
|
+
readonly packageName: string;
|
|
19
|
+
readonly status: 'active' | 'disabled';
|
|
20
|
+
readonly mutable: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** Matches `@acryldev/cordis-plugin-market`'s own `MarketDesktopPlugins` shape exactly. */
|
|
23
|
+
export declare class CliPluginsService extends Service {
|
|
24
|
+
private readonly previews;
|
|
25
|
+
private readonly controller;
|
|
26
|
+
private readonly profileName;
|
|
27
|
+
constructor(ctx: Context, options: {
|
|
28
|
+
readonly controller: AcrPluginLifecycleController;
|
|
29
|
+
readonly profileName: string;
|
|
30
|
+
});
|
|
31
|
+
list(): readonly CliMarketPluginBundle[];
|
|
32
|
+
disabledPackageNames(): readonly string[];
|
|
33
|
+
isDisabled(packageName: string): boolean;
|
|
34
|
+
private mintPreview;
|
|
35
|
+
previewDisable(bundleId: string): {
|
|
36
|
+
readonly previewId: string;
|
|
37
|
+
readonly profileName: string;
|
|
38
|
+
readonly packageName: string;
|
|
39
|
+
readonly expiresAt: string;
|
|
40
|
+
};
|
|
41
|
+
previewEnable(bundleId: string): {
|
|
42
|
+
readonly previewId: string;
|
|
43
|
+
readonly profileName: string;
|
|
44
|
+
readonly packageName: string;
|
|
45
|
+
readonly expiresAt: string;
|
|
46
|
+
};
|
|
47
|
+
private execute;
|
|
48
|
+
executeDisable(previewId: string): Promise<{
|
|
49
|
+
readonly packageName: string;
|
|
50
|
+
readonly live: boolean;
|
|
51
|
+
}>;
|
|
52
|
+
executeEnable(previewId: string): Promise<{
|
|
53
|
+
readonly packageName: string;
|
|
54
|
+
readonly live: boolean;
|
|
55
|
+
}>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Live activation for a CLI/TUI process - the same shared
|
|
59
|
+
* `AcrPluginLifecycleController` Web and Desktop already drive, mounting a
|
|
60
|
+
* just-installed package into the live Loader tree without a process
|
|
61
|
+
* restart. The TUI's own `/plugins` command calls this directly after a
|
|
62
|
+
* successful install and then refreshes its own dynamic slash-command list
|
|
63
|
+
* (spec 034 T009) - there is no separate renderer process to reload here,
|
|
64
|
+
* unlike Web's `location.reload()` or Desktop's Client webContents reload.
|
|
65
|
+
*/
|
|
66
|
+
export declare class CliLiveActivationService extends Service {
|
|
67
|
+
private readonly controller;
|
|
68
|
+
constructor(ctx: Context, controller: AcrPluginLifecycleController);
|
|
69
|
+
activate(packageName: string): Promise<void>;
|
|
70
|
+
deactivate(packageName: string): Promise<void>;
|
|
71
|
+
requireModules(owner: string, modules: readonly string[]): Promise<void>;
|
|
72
|
+
setEnabled(packageName: string, enabled: boolean): Promise<boolean>;
|
|
73
|
+
statusOf(packageName: string): 'active' | 'disabled' | undefined;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Mount the shared plugin lifecycle for this CLI process and provide the
|
|
77
|
+
* market-shaped view over it, plus live activation.
|
|
78
|
+
* @param ctx - the host root.
|
|
79
|
+
* @param options - the same options shape the CLI's own `plugin-command.ts` already builds.
|
|
80
|
+
*/
|
|
81
|
+
export declare function provideCliMarketPlugins(ctx: Context, options: DshPluginLifecycleOptions): AcrPluginLifecycleController;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Blueprint vocabulary of ACRYL's coding capabilities: which capability ids exist, which product surfaces each one declares itself for,
|
|
3
|
+
* and which of them need the framework router. Blueprint parsing and the built-in IDE Blueprint are runtime domain and read this table.
|
|
4
|
+
*
|
|
5
|
+
* How a capability composes on a surface (its Loader rows, the packages the surface must make resolvable, the shell-mode split) lives in
|
|
6
|
+
* `@acryldev/coding-capabilities`, which the surfaces compose from: the runtime decides what a Blueprint may name, the surface decides what
|
|
7
|
+
* runs. The two tables must name the same ids; the composition package's test asserts it both ways (spec 051 T021).
|
|
8
|
+
*
|
|
9
|
+
* @module @acryldev/harness-runtime/coding-capabilities
|
|
10
|
+
*/
|
|
11
|
+
export type AcrylSurface = 'tui' | 'web' | 'desktop';
|
|
12
|
+
export type AcrylCodingCapabilityId = 'persona' | 'agent-roster' | 'session-stats' | 'authorization' | 'acryl-settings' | 'workspace' | 'plugin-admin' | 'sign-in' | 'launcher-screen' | 'account-callback' | 'support' | 'agent-control-ui' | 'advanced-shell';
|
|
13
|
+
/**
|
|
14
|
+
* The shell a surface renders the coding UI in. `advanced` replaces the stock DSH frame with the ACRYL
|
|
15
|
+
* shell (Projects list, tabbed canvas, right panel); `compatibility` keeps the stock frame. Desktop lets
|
|
16
|
+
* the user choose; Web always runs `advanced`, so both surfaces share one workspace.
|
|
17
|
+
*/
|
|
18
|
+
export type AcrylShellMode = 'compatibility' | 'advanced';
|
|
19
|
+
/** One capability as a Blueprint names it. Its composition (rows and packages) is `@acryldev/coding-capabilities`'. */
|
|
20
|
+
export interface AcrylCodingCapabilityDeclaration {
|
|
21
|
+
readonly id: AcrylCodingCapabilityId;
|
|
22
|
+
/**
|
|
23
|
+
* The capability serves its HTTP through the framework's router (`ctx.router`, `ctx.routerHttp`), which the `framework-kit` row brings.
|
|
24
|
+
* Without that row its plugin waits PENDING with nothing said, so a Blueprint that composes it must also compose the kit.
|
|
25
|
+
*/
|
|
26
|
+
readonly needsRouter?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** Every capability a Blueprint may name, and which of them need the framework router. */
|
|
29
|
+
export declare const ACRYL_CODING_CAPABILITIES: readonly AcrylCodingCapabilityDeclaration[];
|