@acryldev/workspace 0.1.1 → 0.2.1

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.
Files changed (73) hide show
  1. package/README.md +2 -2
  2. package/cordis.patch.yml +1 -1
  3. package/lib/client.js +52 -52
  4. package/lib/client.js.map +1 -1
  5. package/lib/index.js +23 -23
  6. package/lib/index.js.map +1 -1
  7. package/lib/{agents → types/agents}/route.d.ts +1 -1
  8. package/lib/{agents → types/agents}/status/route.d.ts +1 -1
  9. package/lib/{capabilities → types/capabilities}/route.d.ts +1 -1
  10. package/lib/types/client/agents/controls.d.ts +2 -2
  11. package/lib/types/client/changes/changes-tab.d.ts +1 -1
  12. package/lib/types/client/checks/checks-tab.d.ts +1 -1
  13. package/lib/types/client/comments/comments-tab.d.ts +1 -1
  14. package/lib/types/client/dock/dock-hooks.d.ts +1 -1
  15. package/lib/types/client/dom/find-by-name.d.ts +1 -1
  16. package/lib/types/client/files/files-tab.d.ts +2 -2
  17. package/lib/types/client/palette/palette-commands.d.ts +2 -2
  18. package/lib/types/client/palette/palette-shortcut.d.ts +3 -3
  19. package/lib/types/client/review/review-tab.d.ts +1 -1
  20. package/lib/{files → types/files}/route.d.ts +1 -1
  21. package/lib/{folder-picker → types/folder-picker}/picker.d.ts +1 -1
  22. package/lib/{folder-picker → types/folder-picker}/route.d.ts +1 -1
  23. package/lib/{git → types/git}/route.d.ts +1 -1
  24. package/lib/{index.d.ts → types/index.d.ts} +1 -1
  25. package/lib/{private-route.d.ts → types/private-route.d.ts} +2 -2
  26. package/lib/types/projects/contract.d.ts +1 -1
  27. package/lib/{projects → types/projects}/registry.d.ts +1 -1
  28. package/lib/{projects → types/projects}/route.d.ts +1 -1
  29. package/lib/{pty → types/pty}/route.d.ts +1 -1
  30. package/lib/{pty → types/pty}/stream.d.ts +2 -2
  31. package/lib/{shared-context → types/shared-context}/route.d.ts +1 -1
  32. package/lib/ui.js +8 -8
  33. package/lib/ui.js.map +1 -1
  34. package/package.json +20 -21
  35. package/lib/agents/argument-text.d.ts +0 -9
  36. package/lib/agents/contract.d.ts +0 -50
  37. package/lib/agents/definition.d.ts +0 -38
  38. package/lib/agents/known-agents.d.ts +0 -52
  39. package/lib/agents/launch.d.ts +0 -26
  40. package/lib/agents/preferences.d.ts +0 -40
  41. package/lib/agents/status/agent-status.d.ts +0 -38
  42. package/lib/capabilities/contract.d.ts +0 -17
  43. package/lib/files/contract.d.ts +0 -74
  44. package/lib/folder-picker/contract.d.ts +0 -9
  45. package/lib/git/contract.d.ts +0 -136
  46. package/lib/projects/contract.d.ts +0 -82
  47. package/lib/pty/contract.d.ts +0 -52
  48. /package/lib/{agents → types/agents}/catalog.d.ts +0 -0
  49. /package/lib/{agents → types/agents}/file-store.d.ts +0 -0
  50. /package/lib/{agents → types/agents}/settings.d.ts +0 -0
  51. /package/lib/{agents → types/agents}/status/claude-hooks.d.ts +0 -0
  52. /package/lib/{files → types/files}/service.d.ts +0 -0
  53. /package/lib/{git → types/git}/changes.d.ts +0 -0
  54. /package/lib/{git → types/git}/checks.d.ts +0 -0
  55. /package/lib/{git → types/git}/commits.d.ts +0 -0
  56. /package/lib/{git → types/git}/errors.d.ts +0 -0
  57. /package/lib/{git → types/git}/guards.d.ts +0 -0
  58. /package/lib/{git → types/git}/ignored.d.ts +0 -0
  59. /package/lib/{git → types/git}/parsing.d.ts +0 -0
  60. /package/lib/{git → types/git}/runner.d.ts +0 -0
  61. /package/lib/{git → types/git}/search.d.ts +0 -0
  62. /package/lib/{git → types/git}/service.d.ts +0 -0
  63. /package/lib/{git → types/git}/worktrees.d.ts +0 -0
  64. /package/lib/{projects → types/projects}/tools.d.ts +0 -0
  65. /package/lib/{pty → types/pty}/node-pty-spawn.d.ts +0 -0
  66. /package/lib/{pty → types/pty}/screen-model.d.ts +0 -0
  67. /package/lib/{pty → types/pty}/scrollback.d.ts +0 -0
  68. /package/lib/{pty → types/pty}/service.d.ts +0 -0
  69. /package/lib/{shared-context → types/shared-context}/chat.d.ts +0 -0
  70. /package/lib/{shared-context → types/shared-context}/launch.d.ts +0 -0
  71. /package/lib/{shared-context → types/shared-context}/render.d.ts +0 -0
  72. /package/lib/{shared-context → types/shared-context}/service.d.ts +0 -0
  73. /package/lib/{shared-context → types/shared-context}/tool.d.ts +0 -0
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@acryldev/workspace",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "ACRYL's first-party workspace shell (spec 040-agentic-multiplexer-ade): a worktree-aware sidebar, a tile-based main canvas (chat/terminal/file/browser/diff/kanban/doc), and a git-aware details panel, required in advanced desktop mode",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/acryldev/acryl.git",
9
- "directory": "plugins/acryl-workspace"
9
+ "directory": "plugins/workspace"
10
10
  },
11
- "homepage": "https://github.com/acryldev/acryl/tree/main/plugins/acryl-workspace#readme",
11
+ "homepage": "https://github.com/acryldev/acryl/tree/main/plugins/workspace#readme",
12
12
  "bugs": {
13
13
  "url": "https://github.com/acryldev/acryl/issues"
14
14
  },
@@ -53,16 +53,8 @@
53
53
  "engines": {
54
54
  "node": "^22.19.0 || >=24.0.0"
55
55
  },
56
- "scripts": {
57
- "generate:logo": "node scripts/generate-acryl-logo-data.mjs",
58
- "build": "pnpm run generate:logo && node scripts/clean.mjs && tsdown && tsc -p tsconfig.json --emitDeclarationOnly && tsc -p tsconfig.client.json --emitDeclarationOnly",
59
- "typecheck": "pnpm run generate:logo && tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit && tsc -p tsconfig.tests.json --noEmit",
60
- "test": "vitest run",
61
- "check": "pnpm run build && pnpm run typecheck && pnpm run test",
62
- "prepack": "pnpm run check"
63
- },
64
56
  "dependencies": {
65
- "@acryldev/ui": "^0.3.0",
57
+ "@acryldev/ui": "0.4.0",
66
58
  "@codemirror/language": "6.12.4",
67
59
  "@codemirror/language-data": "6.5.2",
68
60
  "@codemirror/state": "6.7.6",
@@ -74,15 +66,15 @@
74
66
  "@xterm/addon-webgl": "0.18.0",
75
67
  "@xterm/headless": "5.5.0",
76
68
  "@xterm/xterm": "5.5.0",
77
- "@acryldev/control": "^0.2.11",
78
- "@acryldev/loopback-http": "^0.1.0",
79
- "@acryldev/settings": "^0.1.0",
69
+ "@acryldev/control": "0.3.0",
70
+ "@acryldev/loopback-http": "0.2.0",
71
+ "@acryldev/settings": "0.2.1",
80
72
  "codemirror": "6.0.2",
81
73
  "node-pty": "1.2.0-beta.15",
82
74
  "ws": "8.22.0"
83
75
  },
84
76
  "peerDependencies": {
85
- "@deepseek-ai/cordis": "^4.0.4",
77
+ "@deepseek-ai/cordis": "^4.0.2",
86
78
  "@deepseek-ai/dsh-api-session-controller": "0.2.0-rc.2",
87
79
  "@deepseek-ai/dsh-api-workspace-controller": "0.2.0-rc.2",
88
80
  "@deepseek-ai/dsh-client-store": "0.2.0-rc.2",
@@ -90,11 +82,11 @@
90
82
  "@deepseek-ai/dsh-client-ui-session": "0.2.0-rc.2",
91
83
  "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2",
92
84
  "@deepseek-ai/dsh-session": "0.2.0-rc.2",
93
- "acrylblends": "^1.0.0",
85
+ "@acryldev/blends": "^1.0.0",
94
86
  "react": "18.3.1"
95
87
  },
96
88
  "devDependencies": {
97
- "@acryldev/ui": "^0.3.0",
89
+ "@acryldev/ui": "0.4.0",
98
90
  "@deepseek-ai/cordis": "4.0.4",
99
91
  "@deepseek-ai/dsh-api-session-controller": "0.2.0-rc.2",
100
92
  "@deepseek-ai/dsh-api-workspace-controller": "0.2.0-rc.2",
@@ -109,8 +101,8 @@
109
101
  "@types/react": "^18",
110
102
  "@types/react-dom": "^18",
111
103
  "@types/ws": "8.18.1",
112
- "@acryldev/app-shell": "^0.1.1",
113
- "acrylblends": "^0.1.1",
104
+ "@acryldev/app-shell": "0.2.1",
105
+ "@acryldev/blends": "^1.7.3",
114
106
  "jsdom": "29.1.1",
115
107
  "react": "18.3.1",
116
108
  "react-dom": "18.3.1",
@@ -145,5 +137,12 @@
145
137
  "desktop-main-slot",
146
138
  "details-slot"
147
139
  ]
140
+ },
141
+ "scripts": {
142
+ "generate:logo": "node scripts/generate-acryl-logo-data.mjs",
143
+ "build": "pnpm run generate:logo && node scripts/clean.mjs && tsdown && tsc -p tsconfig.json --emitDeclarationOnly && tsc -p tsconfig.client.json --emitDeclarationOnly",
144
+ "typecheck": "pnpm run generate:logo && tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit && tsc -p tsconfig.tests.json --noEmit",
145
+ "test": "vitest run",
146
+ "check": "pnpm run build && pnpm run typecheck && pnpm run test"
148
147
  }
149
- }
148
+ }
@@ -1,9 +0,0 @@
1
- /**
2
- * Arguments as a person types them on one line, and back. `--model "big one" -v` is three arguments.
3
- * Pure text handling shared by the page (the field) and its tests; nothing here runs a shell, and the
4
- * Host still receives an argument array.
5
- */
6
- /** @throws Error when a quote is left open. */
7
- export declare function splitArguments(text: string): string[];
8
- /** The inverse of {@link splitArguments}: quotes only the arguments that need it. */
9
- export declare function joinArguments(args: readonly string[]): string;
@@ -1,50 +0,0 @@
1
- /** Loopback routes and JSON shapes for the custom agent catalog. */
2
- import { type CustomAgent } from './definition.ts';
3
- /** GET the catalog; POST `{ agent }` to add one. */
4
- export declare const WORKSPACE_AGENTS_PATH = "/api/acryl-workspace/agents";
5
- /** POST `{ id }` to remove one. */
6
- export declare const WORKSPACE_AGENTS_REMOVE_PATH = "/api/acryl-workspace/agents/remove";
7
- export interface AgentsView {
8
- readonly agents: readonly CustomAgent[];
9
- }
10
- /** @param value - unknown JSON from the agents routes. */
11
- export declare function parseAgentsView(value: unknown): AgentsView;
12
- /** GET the settings view; POST a {@link PreferencesPatch} to change one thing. Both answer with the whole view. */
13
- export declare const WORKSPACE_AGENT_SETTINGS_PATH = "/api/acryl-workspace/agents/settings";
14
- /** One row of Settings > Agents. */
15
- export interface AgentSettingsEntry {
16
- readonly id: string;
17
- readonly label: string;
18
- readonly kind: 'known' | 'custom';
19
- /** The agent's install page (known agents only). */
20
- readonly homepageUrl: string | null;
21
- /** The executable the agent ships with. */
22
- readonly defaultCommand: string;
23
- /** What runs: the user's replacement when set, otherwise {@link defaultCommand}. */
24
- readonly command: string;
25
- /** The user's extra arguments (known agents), or the definition's own arguments (custom agents). */
26
- readonly args: readonly string[];
27
- /** What the permission mode adds right now. */
28
- readonly permissionArgs: readonly string[];
29
- readonly permissionEnv: Readonly<Record<string, string>>;
30
- readonly enabled: boolean;
31
- /** The executable was found on this machine. */
32
- readonly installed: boolean;
33
- /** The exact command line a new tab runs. */
34
- readonly preview: string;
35
- /** Custom agents only: the badge chosen when it was added. */
36
- readonly badge: {
37
- readonly letter: string;
38
- readonly color: string;
39
- } | null;
40
- }
41
- export interface AgentSettingsView {
42
- readonly permissions: 'yolo' | 'manual';
43
- /** `auto`, `none`, or the id of an existing agent. */
44
- readonly defaultAgent: string;
45
- /** Agents that support hooks report working, waiting and done (the attention queue). */
46
- readonly statusHooks: boolean;
47
- readonly agents: readonly AgentSettingsEntry[];
48
- }
49
- /** @param value - unknown JSON from the settings route. */
50
- export declare function parseAgentSettingsView(value: unknown): AgentSettingsView;
@@ -1,38 +0,0 @@
1
- /**
2
- * A custom coding agent: something the user added to the "+" menu. Pure rules, shared by the Host (which
3
- * enforces them) and the page (which uses the same rules to explain a refusal before asking).
4
- *
5
- * The Host starts an agent only by its id from the catalog, so what a definition may contain is the whole
6
- * safety story: a bare executable name or absolute path, an argument list that never goes through a shell,
7
- * and nothing else. See `specs/040-agentic-multiplexer-ade/design-phase-9.md`.
8
- */
9
- export declare const MAX_CUSTOM_AGENTS = 32;
10
- export declare const MAX_AGENT_ARGS = 16;
11
- export declare const MAX_AGENT_ARG_LENGTH = 200;
12
- export declare const MAX_AGENT_LABEL = 40;
13
- /** The colours a badge may use, so a definition can never carry arbitrary CSS. */
14
- export declare const BADGE_COLORS: readonly ["#94a3b8", "#d97757", "#10a37f", "#4285f4", "#a78bfa", "#34d399", "#f59e0b", "#ef4444", "#38bdf8", "#fb923c"];
15
- export interface AgentBadge {
16
- readonly letter: string;
17
- readonly color: (typeof BADGE_COLORS)[number];
18
- }
19
- export interface CustomAgent {
20
- readonly id: string;
21
- readonly label: string;
22
- /** An absolute path, or a bare executable name found on the Host's PATH. */
23
- readonly command: string;
24
- /** Passed as an argument array to the process; never interpreted by a shell. */
25
- readonly args: readonly string[];
26
- readonly badge: AgentBadge;
27
- }
28
- /** Thrown for a definition that breaks a rule; the message is fit to show the user. */
29
- export declare class AgentDefinitionError extends Error {
30
- constructor(message: string);
31
- }
32
- export declare function isBuiltinAgentId(id: string): boolean;
33
- /** @param value - untrusted JSON. @returns a command that is an absolute path or a bare program name. @throws AgentDefinitionError. */
34
- export declare function parseAgentCommand(value: unknown): string;
35
- /** @param value - untrusted JSON; absent means no arguments. @throws AgentDefinitionError. */
36
- export declare function parseAgentArgs(value: unknown): readonly string[];
37
- /** @param value - untrusted JSON. @throws AgentDefinitionError with a user-facing message. */
38
- export declare function parseCustomAgent(value: unknown): CustomAgent;
@@ -1,52 +0,0 @@
1
- /**
2
- * The coding agents ACRYL knows by name: what to run, which flags mean "do not ask me", and where to install
3
- * them. This is the single source for the "+" menu, the launcher and Settings > Agents; the closed list of
4
- * ids is also the Host's allowlist of what a terminal tab may start.
5
- *
6
- * The launch commands, permission flags and install pages follow the public documentation of each agent
7
- * (the shape of the list is inspired by Orca's agent catalog, MIT licensed).
8
- */
9
- /** The permission mode a launch uses. `yolo` adds the agent's own "skip approvals" flags; `manual` adds none. */
10
- export type PermissionMode = 'yolo' | 'manual';
11
- export interface KnownAgent {
12
- readonly id: string;
13
- readonly label: string;
14
- /** The executable looked up on PATH. */
15
- readonly command: string;
16
- /** Added to a launch in `yolo` mode, one argument per entry. */
17
- readonly yoloArgs: readonly string[];
18
- /** Environment added to a launch in `yolo` mode. */
19
- readonly yoloEnv?: Readonly<Record<string, string>>;
20
- /** Where the agent's install instructions live. */
21
- readonly homepageUrl: string;
22
- /** How this agent reports what it is doing, when it can (hooks): its own launch settings carry the reporting. */
23
- readonly statusHooks?: 'claude';
24
- /** The letter and colour of its tab icon when no drawn mark exists. */
25
- readonly badge: {
26
- readonly letter: string;
27
- readonly color: string;
28
- };
29
- }
30
- /** In the order the lists show them. Ids of agents that shipped earlier keep their spelling. */
31
- export declare const KNOWN_AGENTS: readonly [{
32
- readonly statusHooks: "claude";
33
- readonly id: string;
34
- readonly label: string;
35
- /** The executable looked up on PATH. */
36
- readonly command: string;
37
- /** Added to a launch in `yolo` mode, one argument per entry. */
38
- readonly yoloArgs: readonly string[];
39
- /** Environment added to a launch in `yolo` mode. */
40
- readonly yoloEnv?: Readonly<Record<string, string>>;
41
- /** Where the agent's install instructions live. */
42
- readonly homepageUrl: string;
43
- /** The letter and colour of its tab icon when no drawn mark exists. */
44
- readonly badge: {
45
- readonly letter: string;
46
- readonly color: string;
47
- };
48
- }, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent, KnownAgent];
49
- export type KnownAgentId = (typeof KNOWN_AGENTS)[number]['id'];
50
- export declare const KNOWN_AGENT_IDS: readonly KnownAgentId[];
51
- /** @returns the known agent with this id, or undefined (a custom agent, the terminal, or nothing). */
52
- export declare function knownAgent(id: string): KnownAgent | undefined;
@@ -1,26 +0,0 @@
1
- /**
2
- * What a terminal tab actually runs for an agent: the command, the arguments and the environment, from the
3
- * agent's own definition, the user's overrides and the permission mode. Pure: no disk, no process table.
4
- */
5
- import type { KnownAgent, PermissionMode } from './known-agents.ts';
6
- /** What the user changed for one agent in Settings. */
7
- export interface AgentOverride {
8
- /** Listed in the "+" menu. Off hides it; it can still be opened from an existing tab. */
9
- readonly enabled: boolean;
10
- /** Replaces the agent's own executable (an absolute path or a bare name). */
11
- readonly command?: string;
12
- /** Added after the permission flags, one argument per entry. */
13
- readonly args: readonly string[];
14
- }
15
- export declare const DEFAULT_OVERRIDE: AgentOverride;
16
- export interface AgentLaunch {
17
- readonly command: string;
18
- readonly args: readonly string[];
19
- readonly env?: Readonly<Record<string, string>>;
20
- /** This launch reports its state through hooks of this kind; the Host adds the reporting at start. */
21
- readonly statusHooks?: 'claude';
22
- }
23
- /** @returns the launch for a known agent: `yolo` adds the agent's own skip-approvals flags first. */
24
- export declare function planKnownLaunch(agent: KnownAgent, override: AgentOverride, mode: PermissionMode, statusHooks?: boolean): AgentLaunch;
25
- /** The command line for a person to read, with any environment first (`GOOSE_MODE=auto goose`). */
26
- export declare function describeLaunch(launch: AgentLaunch): string;
@@ -1,40 +0,0 @@
1
- /**
2
- * The user's agent preferences: the permission mode, the default agent, and per-agent overrides. Pure rules for
3
- * reading the stored file and for applying one change at a time; the file itself is a port (`file-store.ts`).
4
- */
5
- import { type AgentOverride } from './launch.ts';
6
- import type { PermissionMode } from './known-agents.ts';
7
- /** `auto`: follow what was opened last. `none`: a blank terminal. Otherwise an agent id. */
8
- export type DefaultAgent = string;
9
- export interface AgentPreferences {
10
- readonly permissions: PermissionMode;
11
- readonly defaultAgent: DefaultAgent;
12
- readonly overrides: Readonly<Record<string, AgentOverride>>;
13
- /** Agents that support hooks report working, waiting and done to ACRYL (the attention queue). */
14
- readonly statusHooks: boolean;
15
- }
16
- /** Manual is the default: an agent that skips approvals is something the user turns on. */
17
- export declare const DEFAULT_PREFERENCES: AgentPreferences;
18
- /** @param value - the parsed stored JSON. A damaged file gives the defaults; one bad override is dropped. */
19
- export declare function parseStoredPreferences(value: unknown): AgentPreferences;
20
- /** One change from Settings. `command: null` clears the override. */
21
- export interface PreferencesPatch {
22
- readonly permissions?: PermissionMode;
23
- readonly defaultAgent?: DefaultAgent;
24
- readonly statusHooks?: boolean;
25
- readonly agent?: {
26
- readonly id: string;
27
- readonly enabled?: boolean;
28
- readonly command?: string | null;
29
- readonly args?: readonly string[];
30
- };
31
- }
32
- /** @param value - untrusted JSON from the route. @throws AgentDefinitionError with a message fit to show. */
33
- export declare function parsePreferencesPatch(value: unknown): PreferencesPatch;
34
- /**
35
- * @param current - the preferences now.
36
- * @param patch - one validated change.
37
- * @param isAgent - whether an id names an agent the Host knows (built in or custom).
38
- * @throws AgentDefinitionError for an unknown agent.
39
- */
40
- export declare function applyPreferencesPatch(current: AgentPreferences, patch: PreferencesPatch, isAgent: (id: string) => boolean): AgentPreferences;
@@ -1,38 +0,0 @@
1
- /**
2
- * What a terminal agent is doing right now, as the agent itself reports it (spec 040 T127).
3
- *
4
- * Reading this off the screen would be guessing, so the agents that support hooks tell ACRYL instead: Claude Code
5
- * runs a small command on "prompt submitted", "tool finished", "needs you" and "turn finished", and that command
6
- * posts the state here. The store keeps the latest state per terminal and only ever answers for terminals the Host
7
- * still has.
8
- */
9
- /** GET from the page: every live terminal's status. POST from an agent's hook: one report. */
10
- export declare const WORKSPACE_AGENT_STATUS_PATH = "/api/acryl-workspace/agent-status";
11
- export declare const AGENT_STATES: readonly ["working", "waiting", "done"];
12
- /** `working`: busy. `waiting`: it needs you (a permission, a question). `done`: it finished its turn. */
13
- export type AgentState = (typeof AGENT_STATES)[number];
14
- export interface AgentStatus {
15
- readonly terminalId: string;
16
- readonly state: AgentState;
17
- /** Milliseconds since the epoch when it was reported. */
18
- readonly at: number;
19
- }
20
- export declare class AgentStatusError extends Error {
21
- constructor(message: string);
22
- }
23
- /** @param body - untrusted JSON from a hook. @throws AgentStatusError. */
24
- export declare function parseStatusReport(body: unknown): {
25
- readonly terminal: string;
26
- readonly state: AgentState;
27
- };
28
- export declare class AgentStatusStore {
29
- private readonly isLive;
30
- private readonly now;
31
- private readonly statuses;
32
- /** @param isLive - whether the Host still has a terminal with this id. @param now - the clock. */
33
- constructor(isLive: (terminalId: string) => boolean, now?: () => number);
34
- /** @returns false when no such terminal exists (a stale or forged report is ignored). */
35
- report(terminalId: string, state: AgentState): boolean;
36
- /** The latest status of every terminal that still exists; the others are forgotten here. */
37
- list(): readonly AgentStatus[];
38
- }
@@ -1,17 +0,0 @@
1
- /** What the Host composition can do for the page, so the page offers only what will work. */
2
- export declare const WORKSPACE_CAPABILITIES_PATH = "/api/acryl-workspace/capabilities";
3
- export interface WorkspaceCapabilities {
4
- /** The DeepSeek Harness chat (its agent) is running, so "AcrylDSH Chat" tabs can be opened and sent from. */
5
- readonly chat: boolean;
6
- /**
7
- * Where the Host serves this app's own page, as a path on the frame's origin (`/app` in the ACRYL frame). Present only when the Host hosts an
8
- * app: the frame then opens that page in a browser tile on first run, instead of an empty canvas.
9
- */
10
- readonly appPage?: string;
11
- /** The app's folder: the worktree the frame opens on first run, so the app and its chats share one tab set. */
12
- readonly appRoot?: string;
13
- /** The app's name, used as the tile's title (`my-app`), instead of the address's host. */
14
- readonly appName?: string;
15
- }
16
- /** @throws when the body is not exactly the capabilities this page understands. */
17
- export declare function parseWorkspaceCapabilities(value: unknown): WorkspaceCapabilities;
@@ -1,74 +0,0 @@
1
- /** Loopback routes and JSON shapes for browsing, reading and saving files inside a git worktree. */
2
- export declare const WORKSPACE_FILES_TREE_PATH = "/api/acryl-workspace/files/tree";
3
- export declare const WORKSPACE_FILES_READ_PATH = "/api/acryl-workspace/files/read";
4
- export declare const WORKSPACE_FILES_WRITE_PATH = "/api/acryl-workspace/files/write";
5
- export declare const WORKSPACE_FILES_ENTRY_PATH = "/api/acryl-workspace/files/entry";
6
- /** The largest file the editor opens or saves. */
7
- export declare const MAX_EDITABLE_BYTES: number;
8
- export type FileEntryKind = 'file' | 'dir';
9
- export interface FileEntry {
10
- /** Base name, without any directory part. */
11
- readonly name: string;
12
- readonly kind: FileEntryKind;
13
- /** Git ignores it (build output, dependencies, local settings); the tree shows it dimmed. */
14
- readonly ignored?: boolean;
15
- }
16
- /** One directory of a worktree. */
17
- export interface FilesTreeView {
18
- /** Absolute worktree path. */
19
- readonly path: string;
20
- /** Directory relative to the worktree, `''` for its root. */
21
- readonly dir: string;
22
- /** Directories first, then files, each alphabetical. */
23
- readonly entries: readonly FileEntry[];
24
- /** True when the directory had more entries than the cap. */
25
- readonly truncated: boolean;
26
- }
27
- export interface FileContentView {
28
- readonly path: string;
29
- readonly file: string;
30
- /** UTF-8 text; empty when `binary`. */
31
- readonly content: string;
32
- readonly binary: boolean;
33
- readonly size: number;
34
- /** Modification time on disk, sent back when saving to detect an outside change. */
35
- readonly mtimeMs: number;
36
- }
37
- export interface FileSavedView {
38
- readonly path: string;
39
- readonly file: string;
40
- readonly size: number;
41
- readonly mtimeMs: number;
42
- }
43
- /** @param value - unknown JSON from the tree route. */
44
- export declare function parseFilesTreeView(value: unknown): FilesTreeView;
45
- /** @param value - unknown JSON from the read route. */
46
- export declare function parseFileContentView(value: unknown): FileContentView;
47
- /** @param value - unknown JSON from the write route. */
48
- export declare function parseFileSavedView(value: unknown): FileSavedView;
49
- /**
50
- * One structural change to a worktree's files. Deliberately small: create a file or an empty folder,
51
- * rename or move an entry, delete a file or an empty folder. Nothing overwrites, nothing recurses.
52
- */
53
- export type FileEntryChange = {
54
- readonly op: 'create';
55
- readonly kind: FileEntryKind;
56
- readonly file: string;
57
- } | {
58
- readonly op: 'rename';
59
- readonly file: string;
60
- readonly to: string;
61
- } | {
62
- readonly op: 'delete';
63
- readonly file: string;
64
- };
65
- /** The result of a structural change: what now exists (null after a delete). */
66
- export interface FileEntryChangedView {
67
- readonly path: string;
68
- readonly op: FileEntryChange['op'];
69
- readonly file: string | null;
70
- }
71
- /** @param value - unknown JSON from the entry route. */
72
- export declare function parseFileEntryChangedView(value: unknown): FileEntryChangedView;
73
- /** Validate an untrusted request body into a change, or null when it is not one. */
74
- export declare function parseFileEntryChange(value: unknown): FileEntryChange | null;
@@ -1,9 +0,0 @@
1
- /** Same-origin route that opens the operating system's own folder chooser on the machine running the Host. */
2
- export declare const WORKSPACE_PICK_FOLDER_PATH = "/api/acryl-workspace/pick-folder";
3
- /** What the chooser answered: the picked absolute path, or null when it was cancelled. */
4
- export interface PickFolderView {
5
- readonly path: string | null;
6
- }
7
- /** HTTP status the route uses when this machine has no native chooser (a headless Linux box, say). */
8
- export declare const PICK_FOLDER_UNAVAILABLE_STATUS = 501;
9
- export declare function parsePickFolderView(value: unknown): PickFolderView;
@@ -1,136 +0,0 @@
1
- /** Read-only git routes and view types shared by the ACRYL Workspace Host and Client. */
2
- export declare const WORKSPACE_GIT_REPO_PATH = "/api/acryl-workspace/git/repo";
3
- export declare const WORKSPACE_GIT_STATUS_PATH = "/api/acryl-workspace/git/status";
4
- export declare const WORKSPACE_GIT_DIFF_PATH = "/api/acryl-workspace/git/diff";
5
- export declare const WORKSPACE_GIT_WORKTREE_PATH = "/api/acryl-workspace/git/worktree";
6
- export declare const WORKSPACE_GIT_CHECKS_PATH = "/api/acryl-workspace/git/checks";
7
- export declare const WORKSPACE_GIT_SEARCH_PATH = "/api/acryl-workspace/git/search";
8
- export declare const WORKSPACE_GIT_STAGE_PATH = "/api/acryl-workspace/git/stage";
9
- export declare const WORKSPACE_GIT_UNSTAGE_PATH = "/api/acryl-workspace/git/unstage";
10
- export declare const WORKSPACE_GIT_COMMIT_PATH = "/api/acryl-workspace/git/commit";
11
- /** The most hits one search returns. */
12
- export declare const MAX_SEARCH_RESULTS = 200;
13
- /** The longest query the search route accepts. */
14
- export declare const MAX_SEARCH_QUERY = 200;
15
- /** The most files one stage or unstage request may name. */
16
- export declare const MAX_STAGE_FILES = 1000;
17
- /** The longest commit message the commit route accepts. */
18
- export declare const MAX_COMMIT_MESSAGE = 5000;
19
- /** One worktree of a repository, as `git worktree list` reports it. */
20
- export interface GitWorktree {
21
- /** Absolute path of the worktree directory. */
22
- readonly path: string;
23
- /** Checked-out branch name, or null when HEAD is detached or bare. */
24
- readonly branch: string | null;
25
- /** Full commit id HEAD points at. */
26
- readonly head: string;
27
- /** True for the repository's main worktree (git always lists it first). */
28
- readonly main: boolean;
29
- }
30
- /** A repository and every worktree attached to it. */
31
- export interface GitRepoView {
32
- /** Display name: the main worktree's directory name. */
33
- readonly name: string;
34
- /** Absolute path of the main worktree. */
35
- readonly root: string;
36
- /** Path of the worktree that contains the directory the request named. */
37
- readonly current: string;
38
- readonly worktrees: readonly GitWorktree[];
39
- }
40
- /** Status letters shown next to a changed file. `?` is untracked, `U` is unmerged. */
41
- export type GitChangeCode = 'M' | 'A' | 'D' | 'R' | 'U' | '?';
42
- export interface GitChange {
43
- /** Path relative to the worktree root, forward slashes. */
44
- readonly path: string;
45
- readonly code: GitChangeCode;
46
- /** True when the index already holds a change for this path. */
47
- readonly staged: boolean;
48
- /** Lines added versus HEAD, or null for binary and untracked files. */
49
- readonly added: number | null;
50
- /** Lines removed versus HEAD, or null for binary and untracked files. */
51
- readonly removed: number | null;
52
- /** Previous path for a rename. */
53
- readonly oldPath?: string;
54
- }
55
- export interface GitStatusView {
56
- /** Worktree path this status describes. */
57
- readonly path: string;
58
- /** Current branch, or null when detached. */
59
- readonly branch: string | null;
60
- readonly changes: readonly GitChange[];
61
- /** True when the change list was cut at the entry cap. */
62
- readonly truncated: boolean;
63
- }
64
- export interface GitDiffView {
65
- readonly path: string;
66
- readonly file: string;
67
- /** Unified diff text against HEAD; empty for binary files. */
68
- readonly text: string;
69
- readonly binary: boolean;
70
- /** True when the diff exceeded the output cap and was cut. */
71
- readonly truncated: boolean;
72
- }
73
- /** The result of creating a branch and its worktree. */
74
- export interface GitWorktreeCreatedView {
75
- /** Absolute path of the new worktree. */
76
- readonly path: string;
77
- readonly branch: string;
78
- /** The repository after the change, so the caller does not need a second request. */
79
- readonly repo: GitRepoView;
80
- }
81
- export type CheckManager = 'pnpm' | 'npm' | 'yarn' | 'bun';
82
- export interface CheckScript {
83
- /** A plain script name (letters, digits and `:_.-`), safe to type into a shell. */
84
- readonly name: string;
85
- /** The script's command line, for display only. */
86
- readonly command: string;
87
- /** True for check-like names (check, test, lint, typecheck, build, format, ...). */
88
- readonly primary: boolean;
89
- }
90
- /** What a worktree can run: its package scripts and the package manager its lockfile names. */
91
- export interface GitChecksView {
92
- readonly path: string;
93
- /** The project's own manager, or null when no lockfile says (then `npm` is the neutral default). */
94
- readonly manager: CheckManager | null;
95
- readonly scripts: readonly CheckScript[];
96
- }
97
- export type GitSearchMode = 'name' | 'content';
98
- /** One search hit: a file, and for a content search the line and its text. */
99
- export interface GitSearchHit {
100
- readonly file: string;
101
- readonly line?: number;
102
- readonly text?: string;
103
- }
104
- /** Search results over the tracked and untracked (not ignored) files of a worktree. */
105
- export interface GitSearchView {
106
- readonly path: string;
107
- readonly query: string;
108
- readonly mode: GitSearchMode;
109
- readonly hits: readonly GitSearchHit[];
110
- /** True when there were more matches than the cap. */
111
- readonly truncated: boolean;
112
- }
113
- /** The result of a commit: the new commit and the worktree's status afterwards. */
114
- export interface GitCommitView {
115
- /** Abbreviated hash of the new commit. */
116
- readonly hash: string;
117
- /** First line of its message. */
118
- readonly subject: string;
119
- readonly status: GitStatusView;
120
- }
121
- /** @param value - unknown JSON from the repo route. */
122
- export declare function parseGitRepoView(value: unknown): GitRepoView;
123
- /** @param value - unknown JSON from the status route. */
124
- export declare function parseGitStatusView(value: unknown): GitStatusView;
125
- /** @param value - unknown JSON from the diff route. */
126
- export declare function parseGitDiffView(value: unknown): GitDiffView;
127
- /** @param value - unknown JSON from the worktree route. */
128
- export declare function parseGitWorktreeCreatedView(value: unknown): GitWorktreeCreatedView;
129
- /** @param value - unknown JSON from the checks route. */
130
- export declare function parseGitChecksView(value: unknown): GitChecksView;
131
- /** The command line to type for one script, using the project's own package manager. */
132
- export declare function checkCommandLine(manager: CheckManager | null, script: string): string;
133
- /** @param value - unknown JSON from the commit route. */
134
- export declare function parseGitCommitView(value: unknown): GitCommitView;
135
- /** @param value - unknown JSON from the search route. */
136
- export declare function parseGitSearchView(value: unknown): GitSearchView;