@acryldev/workspace 0.0.0-stage → 0.1.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 (229) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +61 -2
  3. package/cordis.patch.yml +3 -0
  4. package/lib/agents/argument-text.d.ts +9 -0
  5. package/lib/agents/catalog.d.ts +32 -0
  6. package/lib/agents/contract.d.ts +50 -0
  7. package/lib/agents/definition.d.ts +38 -0
  8. package/lib/agents/file-store.d.ts +7 -0
  9. package/lib/agents/known-agents.d.ts +52 -0
  10. package/lib/agents/launch.d.ts +26 -0
  11. package/lib/agents/preferences.d.ts +40 -0
  12. package/lib/agents/route.d.ts +10 -0
  13. package/lib/agents/settings.d.ts +28 -0
  14. package/lib/agents/status/agent-status.d.ts +38 -0
  15. package/lib/agents/status/claude-hooks.d.ts +18 -0
  16. package/lib/agents/status/route.d.ts +10 -0
  17. package/lib/capabilities/contract.d.ts +17 -0
  18. package/lib/capabilities/route.d.ts +8 -0
  19. package/lib/client.js +91109 -0
  20. package/lib/client.js.map +1 -0
  21. package/lib/files/contract.d.ts +74 -0
  22. package/lib/files/route.d.ts +9 -0
  23. package/lib/files/service.d.ts +48 -0
  24. package/lib/folder-picker/contract.d.ts +9 -0
  25. package/lib/folder-picker/picker.d.ts +23 -0
  26. package/lib/folder-picker/route.d.ts +5 -0
  27. package/lib/git/changes.d.ts +29 -0
  28. package/lib/git/checks.d.ts +8 -0
  29. package/lib/git/commits.d.ts +14 -0
  30. package/lib/git/contract.d.ts +136 -0
  31. package/lib/git/errors.d.ts +9 -0
  32. package/lib/git/guards.d.ts +9 -0
  33. package/lib/git/ignored.d.ts +9 -0
  34. package/lib/git/parsing.d.ts +13 -0
  35. package/lib/git/route.d.ts +9 -0
  36. package/lib/git/runner.d.ts +29 -0
  37. package/lib/git/search.d.ts +14 -0
  38. package/lib/git/service.d.ts +52 -0
  39. package/lib/git/worktrees.d.ts +26 -0
  40. package/lib/index.d.ts +39 -0
  41. package/lib/index.js +3799 -0
  42. package/lib/index.js.map +1 -0
  43. package/lib/private-route.d.ts +15 -0
  44. package/lib/projects/contract.d.ts +82 -0
  45. package/lib/projects/registry.d.ts +73 -0
  46. package/lib/projects/route.d.ts +16 -0
  47. package/lib/projects/tools.d.ts +24 -0
  48. package/lib/pty/contract.d.ts +52 -0
  49. package/lib/pty/node-pty-spawn.d.ts +3 -0
  50. package/lib/pty/route.d.ts +9 -0
  51. package/lib/pty/screen-model.d.ts +25 -0
  52. package/lib/pty/scrollback.d.ts +26 -0
  53. package/lib/pty/service.d.ts +156 -0
  54. package/lib/pty/stream.d.ts +19 -0
  55. package/lib/shared-context/chat.d.ts +34 -0
  56. package/lib/shared-context/launch.d.ts +24 -0
  57. package/lib/shared-context/render.d.ts +29 -0
  58. package/lib/shared-context/route.d.ts +13 -0
  59. package/lib/shared-context/service.d.ts +65 -0
  60. package/lib/shared-context/tool.d.ts +20 -0
  61. package/lib/types/agents/argument-text.d.ts +9 -0
  62. package/lib/types/agents/contract.d.ts +50 -0
  63. package/lib/types/agents/definition.d.ts +38 -0
  64. package/lib/types/agents/known-agents.d.ts +52 -0
  65. package/lib/types/agents/launch.d.ts +26 -0
  66. package/lib/types/agents/preferences.d.ts +40 -0
  67. package/lib/types/agents/status/agent-status.d.ts +38 -0
  68. package/lib/types/capabilities/contract.d.ts +17 -0
  69. package/lib/types/client/agents/AddAgentForm.d.ts +10 -0
  70. package/lib/types/client/agents/AgentRow.d.ts +11 -0
  71. package/lib/types/client/agents/AgentsSection.d.ts +14 -0
  72. package/lib/types/client/agents/acryl-logo-data.d.ts +3 -0
  73. package/lib/types/client/agents/agent-draft.d.ts +24 -0
  74. package/lib/types/client/agents/agents-api.d.ts +18 -0
  75. package/lib/types/client/agents/agents-section-model.d.ts +45 -0
  76. package/lib/types/client/agents/agents-settings-plugin.d.ts +8 -0
  77. package/lib/types/client/agents/agents-state.d.ts +26 -0
  78. package/lib/types/client/agents/controls.d.ts +40 -0
  79. package/lib/types/client/board/NoteColumn.d.ts +17 -0
  80. package/lib/types/client/board/SessionBoardPane.d.ts +16 -0
  81. package/lib/types/client/board/board-model.d.ts +36 -0
  82. package/lib/types/client/browser/BrowserPane.d.ts +28 -0
  83. package/lib/types/client/canvas/SplitDivider.d.ts +9 -0
  84. package/lib/types/client/canvas/WorkspaceCanvas.d.ts +78 -0
  85. package/lib/types/client/canvas/groups.d.ts +47 -0
  86. package/lib/types/client/canvas/persist.d.ts +17 -0
  87. package/lib/types/client/canvas/persistence.d.ts +78 -0
  88. package/lib/types/client/canvas/shell-requests.d.ts +16 -0
  89. package/lib/types/client/canvas/split-ratio.d.ts +12 -0
  90. package/lib/types/client/canvas/state.d.ts +181 -0
  91. package/lib/types/client/canvas/tab-title.d.ts +7 -0
  92. package/lib/types/client/capabilities/capabilities-api.d.ts +8 -0
  93. package/lib/types/client/changes/ChangesBody.d.ts +14 -0
  94. package/lib/types/client/changes/changes-tab.d.ts +20 -0
  95. package/lib/types/client/chat/chat-selection.d.ts +70 -0
  96. package/lib/types/client/chat/composer-focus.d.ts +16 -0
  97. package/lib/types/client/checks/ChecksBody.d.ts +9 -0
  98. package/lib/types/client/checks/checks-tab.d.ts +12 -0
  99. package/lib/types/client/chrome/StatusLine.d.ts +11 -0
  100. package/lib/types/client/chrome/panel-icons.d.ts +16 -0
  101. package/lib/types/client/chrome/status-line.d.ts +19 -0
  102. package/lib/types/client/chrome/worktree-agents.d.ts +13 -0
  103. package/lib/types/client/comments/CommentsBody.d.ts +24 -0
  104. package/lib/types/client/comments/comment-store.d.ts +38 -0
  105. package/lib/types/client/comments/comments-tab.d.ts +14 -0
  106. package/lib/types/client/comments/editor-comments.d.ts +6 -0
  107. package/lib/types/client/comments/terminal-targets.d.ts +35 -0
  108. package/lib/types/client/comments/use-comments.d.ts +27 -0
  109. package/lib/types/client/connection/session-banner.d.ts +51 -0
  110. package/lib/types/client/diff/GitDiffPane.d.ts +27 -0
  111. package/lib/types/client/diff/TextDiffPane.d.ts +6 -0
  112. package/lib/types/client/diff/comment-message.d.ts +29 -0
  113. package/lib/types/client/diff/diff-layout.d.ts +4 -0
  114. package/lib/types/client/diff/line-diff.d.ts +14 -0
  115. package/lib/types/client/diff/unified-diff.d.ts +31 -0
  116. package/lib/types/client/dock/DockButtons.d.ts +19 -0
  117. package/lib/types/client/dock/DockColumns.d.ts +21 -0
  118. package/lib/types/client/dock/DockDivider.d.ts +13 -0
  119. package/lib/types/client/dock/TerminalDockPanel.d.ts +13 -0
  120. package/lib/types/client/dock/dock-controller.d.ts +55 -0
  121. package/lib/types/client/dock/dock-hooks.d.ts +6 -0
  122. package/lib/types/client/dock/dock-host.d.ts +14 -0
  123. package/lib/types/client/dock/dock-icons.d.ts +10 -0
  124. package/lib/types/client/dock/dock-model.d.ts +35 -0
  125. package/lib/types/client/dock/dock-tabs.d.ts +72 -0
  126. package/lib/types/client/dock/terminal-stack.d.ts +19 -0
  127. package/lib/types/client/docs/DocFilePane.d.ts +12 -0
  128. package/lib/types/client/docs/DocPane.d.ts +6 -0
  129. package/lib/types/client/docs/DocView.d.ts +5 -0
  130. package/lib/types/client/docs/doc-format.d.ts +46 -0
  131. package/lib/types/client/dom/find-by-name.d.ts +18 -0
  132. package/lib/types/client/files/CodeEditor.d.ts +19 -0
  133. package/lib/types/client/files/FileBreadcrumbs.d.ts +15 -0
  134. package/lib/types/client/files/FileEditorPane.d.ts +12 -0
  135. package/lib/types/client/files/FileTree.d.ts +25 -0
  136. package/lib/types/client/files/FilesBody.d.ts +14 -0
  137. package/lib/types/client/files/ScratchFilePane.d.ts +6 -0
  138. package/lib/types/client/files/breadcrumbs.d.ts +18 -0
  139. package/lib/types/client/files/file-edit.d.ts +20 -0
  140. package/lib/types/client/files/file-icons.d.ts +17 -0
  141. package/lib/types/client/files/files-api.d.ts +26 -0
  142. package/lib/types/client/files/files-tab.d.ts +25 -0
  143. package/lib/types/client/files/line-comment.d.ts +26 -0
  144. package/lib/types/client/files/line-comments.d.ts +48 -0
  145. package/lib/types/client/files/tree-model.d.ts +60 -0
  146. package/lib/types/client/git/git-api.d.ts +35 -0
  147. package/lib/types/client/index.d.ts +28 -0
  148. package/lib/types/client/models/ModelConnect.d.ts +13 -0
  149. package/lib/types/client/models/model-connect.d.ts +145 -0
  150. package/lib/types/client/notifications/Toasts.d.ts +6 -0
  151. package/lib/types/client/notifications/system-notice.d.ts +19 -0
  152. package/lib/types/client/notifications/toast-state.d.ts +29 -0
  153. package/lib/types/client/palette/CommandPalette.d.ts +9 -0
  154. package/lib/types/client/palette/PalettePanel.d.ts +10 -0
  155. package/lib/types/client/palette/file-search.d.ts +9 -0
  156. package/lib/types/client/palette/fuzzy.d.ts +15 -0
  157. package/lib/types/client/palette/palette-commands.d.ts +64 -0
  158. package/lib/types/client/palette/palette-config.d.ts +21 -0
  159. package/lib/types/client/palette/palette-items.d.ts +40 -0
  160. package/lib/types/client/palette/palette-settings-plugin.d.ts +8 -0
  161. package/lib/types/client/palette/palette-shortcut.d.ts +10 -0
  162. package/lib/types/client/palette/palette-state.d.ts +68 -0
  163. package/lib/types/client/palette/use-workspace-palette.d.ts +39 -0
  164. package/lib/types/client/projects/NewWorkspaceDialog.d.ts +21 -0
  165. package/lib/types/client/projects/ProjectsSidebar.d.ts +39 -0
  166. package/lib/types/client/projects/RepoSection.d.ts +29 -0
  167. package/lib/types/client/projects/WorkspaceStrip.d.ts +14 -0
  168. package/lib/types/client/projects/projects-control.d.ts +119 -0
  169. package/lib/types/client/projects/registry-api.d.ts +22 -0
  170. package/lib/types/client/projects/registry-state.d.ts +67 -0
  171. package/lib/types/client/projects/shown-workspace.d.ts +19 -0
  172. package/lib/types/client/projects/sidebar-model.d.ts +113 -0
  173. package/lib/types/client/projects/upstream-panels.d.ts +54 -0
  174. package/lib/types/client/projects/web-folder-picker.d.ts +13 -0
  175. package/lib/types/client/review/ReviewBody.d.ts +9 -0
  176. package/lib/types/client/review/review-store.d.ts +46 -0
  177. package/lib/types/client/review/review-tab.d.ts +15 -0
  178. package/lib/types/client/sessions/agent-bridge.d.ts +20 -0
  179. package/lib/types/client/sessions/main-session.d.ts +24 -0
  180. package/lib/types/client/sessions/running-agents.d.ts +9 -0
  181. package/lib/types/client/sessions/session-client.d.ts +22 -0
  182. package/lib/types/client/sessions/session-navigation.d.ts +63 -0
  183. package/lib/types/client/sessions/session-pick.d.ts +15 -0
  184. package/lib/types/client/settings/locales.d.ts +5 -0
  185. package/lib/types/client/settings/open-settings.d.ts +37 -0
  186. package/lib/types/client/settings/section-plugin.d.ts +39 -0
  187. package/lib/types/client/settings/styles.d.ts +3 -0
  188. package/lib/types/client/shared-context/BriefTab.d.ts +21 -0
  189. package/lib/types/client/shared-context/brief-api.d.ts +9 -0
  190. package/lib/types/client/status/agent-status-api.d.ts +10 -0
  191. package/lib/types/client/status/agent-status-state.d.ts +27 -0
  192. package/lib/types/client/status/attention-model.d.ts +20 -0
  193. package/lib/types/client/styles.d.ts +2 -0
  194. package/lib/types/client/tabs/AgentIcon.d.ts +12 -0
  195. package/lib/types/client/tabs/NewTabMenu.d.ts +42 -0
  196. package/lib/types/client/tabs/TabActivity.d.ts +7 -0
  197. package/lib/types/client/tabs/TabStrip.d.ts +53 -0
  198. package/lib/types/client/tabs/TabsPanel.d.ts +14 -0
  199. package/lib/types/client/tabs/agent-marks.d.ts +9 -0
  200. package/lib/types/client/tabs/agent-visibility.d.ts +11 -0
  201. package/lib/types/client/tabs/last-tab.d.ts +15 -0
  202. package/lib/types/client/tabs/registry/CustomTabPane.d.ts +13 -0
  203. package/lib/types/client/tabs/registry/provide.d.ts +11 -0
  204. package/lib/types/client/tabs/registry/tab-registry.d.ts +52 -0
  205. package/lib/types/client/tabs/tab-close.d.ts +4 -0
  206. package/lib/types/client/tabs/tab-scroll.d.ts +19 -0
  207. package/lib/types/client/tabs/tab-types-state.d.ts +24 -0
  208. package/lib/types/client/tabs/tabs-settings-plugin.d.ts +9 -0
  209. package/lib/types/client/terminal/PtyPane.d.ts +8 -0
  210. package/lib/types/client/terminal/TerminalSearchBar.d.ts +7 -0
  211. package/lib/types/client/terminal/agent-commands.d.ts +15 -0
  212. package/lib/types/client/terminal/gpu-renderer.d.ts +10 -0
  213. package/lib/types/client/terminal/pty-api.d.ts +21 -0
  214. package/lib/types/client/terminal/pty-stream.d.ts +46 -0
  215. package/lib/types/client/terminal/terminal-links.d.ts +9 -0
  216. package/lib/types/client/terminal/terminal-search.d.ts +18 -0
  217. package/lib/types/client/terminal/terminal-session.d.ts +105 -0
  218. package/lib/types/client/terminal/terminal-size.d.ts +7 -0
  219. package/lib/types/client/ui.d.ts +18 -0
  220. package/lib/types/client/worktrees/shell-polling.d.ts +10 -0
  221. package/lib/types/client/worktrees/shell-state.d.ts +200 -0
  222. package/lib/types/files/contract.d.ts +74 -0
  223. package/lib/types/folder-picker/contract.d.ts +9 -0
  224. package/lib/types/git/contract.d.ts +136 -0
  225. package/lib/types/projects/contract.d.ts +82 -0
  226. package/lib/types/pty/contract.d.ts +52 -0
  227. package/lib/ui.js +12735 -0
  228. package/lib/ui.js.map +1 -0
  229. package/package.json +147 -4
@@ -0,0 +1,136 @@
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;
@@ -0,0 +1,82 @@
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
+ * `acryl-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;
@@ -0,0 +1,52 @@
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;