@acryldev/workspace 0.2.0 → 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 (54) hide show
  1. package/package.json +4 -4
  2. package/lib/agents/argument-text.d.ts +0 -9
  3. package/lib/agents/contract.d.ts +0 -50
  4. package/lib/agents/definition.d.ts +0 -38
  5. package/lib/agents/known-agents.d.ts +0 -52
  6. package/lib/agents/launch.d.ts +0 -26
  7. package/lib/agents/preferences.d.ts +0 -40
  8. package/lib/agents/status/agent-status.d.ts +0 -38
  9. package/lib/capabilities/contract.d.ts +0 -17
  10. package/lib/files/contract.d.ts +0 -74
  11. package/lib/folder-picker/contract.d.ts +0 -9
  12. package/lib/git/contract.d.ts +0 -136
  13. package/lib/projects/contract.d.ts +0 -82
  14. package/lib/pty/contract.d.ts +0 -52
  15. /package/lib/{agents → types/agents}/catalog.d.ts +0 -0
  16. /package/lib/{agents → types/agents}/file-store.d.ts +0 -0
  17. /package/lib/{agents → types/agents}/route.d.ts +0 -0
  18. /package/lib/{agents → types/agents}/settings.d.ts +0 -0
  19. /package/lib/{agents → types/agents}/status/claude-hooks.d.ts +0 -0
  20. /package/lib/{agents → types/agents}/status/route.d.ts +0 -0
  21. /package/lib/{capabilities → types/capabilities}/route.d.ts +0 -0
  22. /package/lib/{files → types/files}/route.d.ts +0 -0
  23. /package/lib/{files → types/files}/service.d.ts +0 -0
  24. /package/lib/{folder-picker → types/folder-picker}/picker.d.ts +0 -0
  25. /package/lib/{folder-picker → types/folder-picker}/route.d.ts +0 -0
  26. /package/lib/{git → types/git}/changes.d.ts +0 -0
  27. /package/lib/{git → types/git}/checks.d.ts +0 -0
  28. /package/lib/{git → types/git}/commits.d.ts +0 -0
  29. /package/lib/{git → types/git}/errors.d.ts +0 -0
  30. /package/lib/{git → types/git}/guards.d.ts +0 -0
  31. /package/lib/{git → types/git}/ignored.d.ts +0 -0
  32. /package/lib/{git → types/git}/parsing.d.ts +0 -0
  33. /package/lib/{git → types/git}/route.d.ts +0 -0
  34. /package/lib/{git → types/git}/runner.d.ts +0 -0
  35. /package/lib/{git → types/git}/search.d.ts +0 -0
  36. /package/lib/{git → types/git}/service.d.ts +0 -0
  37. /package/lib/{git → types/git}/worktrees.d.ts +0 -0
  38. /package/lib/{index.d.ts → types/index.d.ts} +0 -0
  39. /package/lib/{private-route.d.ts → types/private-route.d.ts} +0 -0
  40. /package/lib/{projects → types/projects}/registry.d.ts +0 -0
  41. /package/lib/{projects → types/projects}/route.d.ts +0 -0
  42. /package/lib/{projects → types/projects}/tools.d.ts +0 -0
  43. /package/lib/{pty → types/pty}/node-pty-spawn.d.ts +0 -0
  44. /package/lib/{pty → types/pty}/route.d.ts +0 -0
  45. /package/lib/{pty → types/pty}/screen-model.d.ts +0 -0
  46. /package/lib/{pty → types/pty}/scrollback.d.ts +0 -0
  47. /package/lib/{pty → types/pty}/service.d.ts +0 -0
  48. /package/lib/{pty → types/pty}/stream.d.ts +0 -0
  49. /package/lib/{shared-context → types/shared-context}/chat.d.ts +0 -0
  50. /package/lib/{shared-context → types/shared-context}/launch.d.ts +0 -0
  51. /package/lib/{shared-context → types/shared-context}/render.d.ts +0 -0
  52. /package/lib/{shared-context → types/shared-context}/route.d.ts +0 -0
  53. /package/lib/{shared-context → types/shared-context}/service.d.ts +0 -0
  54. /package/lib/{shared-context → types/shared-context}/tool.d.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acryldev/workspace",
3
- "version": "0.2.0",
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": {
@@ -68,7 +68,7 @@
68
68
  "@xterm/xterm": "5.5.0",
69
69
  "@acryldev/control": "0.3.0",
70
70
  "@acryldev/loopback-http": "0.2.0",
71
- "@acryldev/settings": "0.2.0",
71
+ "@acryldev/settings": "0.2.1",
72
72
  "codemirror": "6.0.2",
73
73
  "node-pty": "1.2.0-beta.15",
74
74
  "ws": "8.22.0"
@@ -101,8 +101,8 @@
101
101
  "@types/react": "^18",
102
102
  "@types/react-dom": "^18",
103
103
  "@types/ws": "8.18.1",
104
- "@acryldev/app-shell": "0.2.0",
105
- "@acryldev/blends": "^1.7.0",
104
+ "@acryldev/app-shell": "0.2.1",
105
+ "@acryldev/blends": "^1.7.3",
106
106
  "jsdom": "29.1.1",
107
107
  "react": "18.3.1",
108
108
  "react-dom": "18.3.1",
@@ -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;
@@ -1,82 +0,0 @@
1
- /**
2
- * The project registry's wire contract. A project is a folder the user added to ACRYL; ACRYL owns the list (it lives in the ACRYL home through
3
- * `@acryldev/settings`), and the DeepSeek Harness chat's workspaces follow it one way: a chat registers the folder it runs in when it starts, never the other
4
- * way round.
5
- */
6
- export declare const WORKSPACE_PROJECTS_PATH = "/api/acryl-workspace/projects";
7
- /** A server-sent event stream of the registry's view: one message now, then one per change (an agent's tool call, another window). */
8
- export declare const WORKSPACE_PROJECTS_EVENTS_PATH = "/api/acryl-workspace/projects/events";
9
- /** How a workspace is organized (spec 043): separate projects, projects that share context with every agent, or a remote machine. */
10
- export type WorkspaceKind = 'individual' | 'shared' | 'remote';
11
- export declare const WORKSPACE_KINDS: readonly WorkspaceKind[];
12
- /** The workspace every app has: it cannot be deleted, and the folders added before workspaces existed are its projects. */
13
- export declare const DEFAULT_WORKSPACE_ID = "default";
14
- /** One workspace as the page sees it. */
15
- export interface WorkspaceSummary {
16
- readonly id: string;
17
- readonly name: string;
18
- readonly kind: WorkspaceKind;
19
- /** Absolute folder paths, in the order they were added. */
20
- readonly projects: readonly string[];
21
- /** For a remote workspace: the SSH target saved for the connection that comes later. */
22
- readonly remote?: {
23
- readonly host: string;
24
- readonly user?: string;
25
- readonly path?: string;
26
- };
27
- }
28
- export interface ProjectRegistryView {
29
- /** The shown workspace's folders, in the order the user added them. */
30
- readonly paths: readonly string[];
31
- /** The projects that already existed as DSH workspaces were taken over once (see `adopt`). */
32
- readonly adopted: boolean;
33
- /** Every workspace, Default first. */
34
- readonly workspaces: readonly WorkspaceSummary[];
35
- /** The id of the workspace the sidebar shows. */
36
- readonly current: string;
37
- }
38
- export type ProjectRequest = {
39
- readonly op: 'add';
40
- readonly path: string;
41
- } | {
42
- readonly op: 'remove';
43
- readonly path: string;
44
- }
45
- /** Take over folders that were registered before ACRYL owned the list. Applied once; later calls change nothing. */
46
- | {
47
- readonly op: 'adopt';
48
- readonly paths: readonly string[];
49
- } | {
50
- readonly op: 'create-workspace';
51
- readonly name: string;
52
- readonly kind: WorkspaceKind;
53
- readonly remote?: {
54
- readonly host: string;
55
- readonly user?: string;
56
- readonly path?: string;
57
- };
58
- } | {
59
- readonly op: 'switch-workspace';
60
- readonly id: string;
61
- } | {
62
- readonly op: 'rename-workspace';
63
- readonly id: string;
64
- readonly name: string;
65
- } | {
66
- readonly op: 'delete-workspace';
67
- readonly id: string;
68
- };
69
- export type ProjectResponse = {
70
- readonly ok: true;
71
- readonly view: ProjectRegistryView;
72
- } | {
73
- readonly ok: false;
74
- readonly code: 'invalid' | 'not-a-folder' | 'workspace';
75
- readonly message: string;
76
- };
77
- export declare class ProjectRequestError extends Error {
78
- constructor(message: string);
79
- }
80
- /** @throws ProjectRequestError naming what is wrong; nothing is coerced. */
81
- export declare function parseProjectRequest(value: unknown): ProjectRequest;
82
- export declare function parseProjectRegistryView(value: unknown): ProjectRegistryView;
@@ -1,52 +0,0 @@
1
- /** Allowlisted ACRYL Workspace PTY commands and loopback routes. */
2
- import { type KnownAgentId } from '../agents/known-agents.ts';
3
- /** The terminal, then every agent ACRYL knows by name (`agents/known-agents.ts` owns that list). */
4
- export declare const WORKSPACE_PTY_COMMAND_IDS: readonly ["shell", ...string[]];
5
- export type WorkspacePtyCommandId = 'shell' | KnownAgentId;
6
- export declare const WORKSPACE_PTY_PATH = "/api/acryl-workspace/pty";
7
- export declare const WORKSPACE_PTY_INPUT_PATH = "/api/acryl-workspace/pty/input";
8
- export declare const WORKSPACE_PTY_RESIZE_PATH = "/api/acryl-workspace/pty/resize";
9
- export declare const WORKSPACE_PTY_CLOSE_PATH = "/api/acryl-workspace/pty/close";
10
- /** WebSocket: live output down, keystrokes and size up, in order. Query: `id`, `since` (cursor already shown). */
11
- export declare const WORKSPACE_PTY_STREAM_PATH = "/api/acryl-workspace/pty/stream";
12
- /** @param value - unknown command id from JSON. */
13
- export declare function isWorkspacePtyCommandId(value: unknown): value is WorkspacePtyCommandId;
14
- export type WorkspacePtyStatus = 'starting' | 'running' | 'exited' | 'error';
15
- export interface WorkspacePtyView {
16
- readonly id: string;
17
- readonly status: WorkspacePtyStatus;
18
- readonly output: string;
19
- readonly exitCode: number | null;
20
- readonly error: string | null;
21
- }
22
- /** What the Host sends over the stream. */
23
- export type PtyServerMessage =
24
- /** Output. `replace` clears the client's terminal first (it missed more than the Host kept). */
25
- {
26
- readonly t: 'out';
27
- readonly data: string;
28
- readonly cursor: number;
29
- readonly replace: boolean;
30
- } | {
31
- readonly t: 'exit';
32
- readonly exitCode: number | null;
33
- readonly error: string | null;
34
- };
35
- /** What the client sends over the stream. */
36
- export type PtyClientMessage = {
37
- readonly t: 'in';
38
- readonly data: string;
39
- } | {
40
- readonly t: 'resize';
41
- readonly cols: number;
42
- readonly rows: number;
43
- };
44
- export declare const MAX_PTY_INPUT_CHARS: number;
45
- export declare const MAX_PTY_COLS = 500;
46
- export declare const MAX_PTY_ROWS = 200;
47
- /** @param text - one text frame from the client; null when it is not a well-formed message. */
48
- export declare function parsePtyClientMessage(text: string): PtyClientMessage | null;
49
- /** @param text - one text frame from the Host; throws on anything unexpected. */
50
- export declare function parsePtyServerMessage(text: string): PtyServerMessage;
51
- /** Any agent id the Host may be asked to start: a built-in one or one from the user's catalog. */
52
- export type AgentId = string;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes