@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,21 @@
1
+ /**
2
+ * The New workspace dialog (spec 043): how the workspace is organized (Individual Projects, Shared Context, Remote Machine), and its name.
3
+ * A Remote Machine workspace saves its SSH target now; connecting comes later and the dialog says so.
4
+ */
5
+ import { type ReactElement } from 'react';
6
+ import type { WorkspaceKind } from '../../projects/contract.ts';
7
+ export interface NewWorkspaceInput {
8
+ readonly name: string;
9
+ readonly kind: WorkspaceKind;
10
+ readonly remote?: {
11
+ readonly host: string;
12
+ readonly user?: string;
13
+ readonly path?: string;
14
+ };
15
+ }
16
+ export interface NewWorkspaceDialogProps {
17
+ /** Resolves with a refusal to show, or null when the workspace was created (the dialog then closes). */
18
+ onCreate(input: NewWorkspaceInput): Promise<string | null>;
19
+ onCancel(): void;
20
+ }
21
+ export declare function NewWorkspaceDialog({ onCreate, onCancel }: NewWorkspaceDialogProps): ReactElement;
@@ -0,0 +1,39 @@
1
+ /** Left pane: one workspace-first tree (spec 040 T128-130) - no Chats | Projects mode switch. Each repo and
2
+ * each of its branches/worktrees collapses independently; an expanded worktree lists its running agent/
3
+ * terminal tabs and its AcrylDSH Chat sessions, never a file/browser/diff/board/doc tab. The upstream
4
+ * sidebar is mounted only as an invisible host for Settings (see `dshWorkspaceUpstreamHost`); there is no
5
+ * second, classic list to switch to. */
6
+ import type { PropsRuntime, UseSessions } from '@acryldev/ui/frame';
7
+ import type { AgentsState } from '../agents/agents-state.ts';
8
+ import type { WorkspaceGroups } from '../canvas/groups.ts';
9
+ import type { ProjectsControl } from './projects-control.ts';
10
+ import type { UpstreamPanels } from './upstream-panels.ts';
11
+ import type { AgentStatusState } from '../status/agent-status-state.ts';
12
+ import type { DesktopSidebarSurfaceOwnerProps } from '@acryldev/app-shell/client';
13
+ import type { WorkspaceShellState } from '../worktrees/shell-state.ts';
14
+ import type { ChatSelection } from '../chat/chat-selection.ts';
15
+ /** The left-pane owner interface the frame offers: the same one the frame's default sidebar receives. */
16
+ export type ProjectsSidebarOwnerProps = DesktopSidebarSurfaceOwnerProps;
17
+ export type ProjectsSidebarProps = Omit<PropsRuntime<'root'>, 'useSessions'> & ProjectsSidebarOwnerProps & {
18
+ readonly useSessions: UseSessions;
19
+ readonly shell: WorkspaceShellState;
20
+ readonly projects: ProjectsControl;
21
+ /** Which chat is shown: picking or expanding a worktree shows its chat through it. */
22
+ readonly chats: ChatSelection;
23
+ /** The tab groups, to show which agents are open in each worktree. */
24
+ readonly groups: WorkspaceGroups;
25
+ /** The user's custom agents, for their badges. */
26
+ readonly agents: AgentsState;
27
+ /** What each terminal agent reports it is doing, for the "needs you" dot. */
28
+ readonly status: AgentStatusState;
29
+ /** The pages DSH's own plugins contribute to its sidebar (Plugins, Automation tasks, ...), which this pane lists above Settings. */
30
+ readonly panels: UpstreamPanels;
31
+ };
32
+ /**
33
+ * The advanced shell's left pane: one workspace-first tree (spec 040 T128-130), nesting workspace ->
34
+ * branch/worktree, each independently collapsible. An expanded worktree lists its running agent/terminal
35
+ * tabs and its AcrylDSH Chat sessions - never a file, browser, diff, board or doc tab, so the tree cannot
36
+ * be polluted the way a flat "everything open" list would be. The upstream sidebar (its search, and
37
+ * anything else it owns) is mounted only to host Settings' trigger and dialog, never shown as a view.
38
+ */
39
+ export declare function ProjectsSidebar({ collapsed, renderUpstream, onToggleCollapse, useSessions, shell, projects, chats, groups, agents, status, panels }: ProjectsSidebarProps): import("react").JSX.Element;
@@ -0,0 +1,29 @@
1
+ /** The tree's rows: a workspace (repository or folder) with its worktrees, each worktree's button and its expanded list of agents and chats.
2
+ * Rendering only; every action is a callback from `ProjectsSidebar`. */
3
+ import type { CustomAgent } from '../../agents/definition.ts';
4
+ import type { RepoRow, WorktreeSessionEntry } from './sidebar-model.ts';
5
+ interface RepoSectionProps {
6
+ readonly repo: RepoRow;
7
+ readonly collapsed: boolean;
8
+ readonly onToggleCollapse: () => void;
9
+ readonly expandedWorktrees: ReadonlySet<string>;
10
+ readonly onToggleWorktree: (path: string) => void;
11
+ readonly entriesByWorktree: ReadonlyMap<string, readonly WorktreeSessionEntry[]>;
12
+ readonly onSelectAgent: (path: string, tileId: string) => void;
13
+ readonly onSelectChat: (path: string, id: string) => void;
14
+ readonly onCloseEntry: (path: string, entry: WorktreeSessionEntry) => void;
15
+ readonly onRenameEntry: (path: string, entry: WorktreeSessionEntry, title: string) => void;
16
+ /** Remove this whole workspace from the tree (its hover "x"). */
17
+ readonly onRemove: () => void;
18
+ readonly onSelect: (path: string) => void;
19
+ /** Undefined when the DSH chat is off: there is no chat to start, so no button for it. */
20
+ readonly onNewChat: ((path: string) => void) | undefined;
21
+ readonly customAgents: readonly CustomAgent[];
22
+ readonly creating: boolean;
23
+ readonly onToggleCreate: () => void;
24
+ readonly onCreate: (branch: string) => Promise<void>;
25
+ }
26
+ /** Top level of the tree: a workspace (a git repository or a plain folder), its own chevron collapsing
27
+ * every branch/worktree under it. */
28
+ export declare function RepoSection({ repo, collapsed, onToggleCollapse, expandedWorktrees, onToggleWorktree, entriesByWorktree, onSelectAgent, onSelectChat, onCloseEntry, onRenameEntry, onRemove, onSelect, onNewChat, customAgents, creating, onToggleCreate, onCreate, }: RepoSectionProps): import("react").JSX.Element;
29
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The strip below the project tree (spec 043): Add project (into the shown workspace), one button per workspace, and New workspace. The
3
+ * whole sidebar is the shown workspace; a button switches it.
4
+ */
5
+ import type { ReactElement } from 'react';
6
+ import { type WorkspaceSummary } from '../../projects/contract.ts';
7
+ export interface WorkspaceStripProps {
8
+ readonly workspaces: readonly WorkspaceSummary[];
9
+ readonly current: string;
10
+ onAddProject(): void;
11
+ onSwitch(id: string): void;
12
+ onNew(): void;
13
+ }
14
+ export declare function WorkspaceStrip({ workspaces, current, onAddProject, onSwitch, onNew }: WorkspaceStripProps): ReactElement;
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Actions behind the Projects tab: add a git project, and show the chat that belongs to a worktree.
3
+ * Every dependency is injected so the flows are testable without a browser or a Host.
4
+ */
5
+ import type { ShellPlatform } from '@acryldev/app-shell/client';
6
+ import type { WorkspaceKind, WorkspaceSummary } from '../../projects/contract.ts';
7
+ import type { ISessions, IWorkspaces } from '@acryldev/ui/frame';
8
+ import type { WorkspaceGitApi } from '../git/git-api.ts';
9
+ import type { ProjectRegistryState } from './registry-state.ts';
10
+ import type { WorkspaceShellState } from '../worktrees/shell-state.ts';
11
+ import type { SessionNavigator } from '../chat/chat-selection.ts';
12
+ export type ProjectAction = {
13
+ readonly ok: true; /** A hint to show the user, when the action continues elsewhere. */
14
+ readonly note?: string;
15
+ } | {
16
+ readonly ok: false;
17
+ readonly reason: string; /** The caller should offer typing the folder's path instead (no chooser here). */
18
+ readonly needsPath?: true;
19
+ };
20
+ export interface ProjectsControl {
21
+ /** Whether chats can be opened here at all (the DSH chat is running). Menus and buttons for chats are hidden when false. */
22
+ readonly chatAvailable: boolean;
23
+ /** Change-detection key for the shown workspace and its projects (a primitive, safe to subscribe to). */
24
+ projectsKey(): string;
25
+ /** The shown workspace's project folders, so a project appears even before it has a chat. */
26
+ projectPaths(): readonly string[];
27
+ /** Notified when the workspaces, the shown one or its projects change. */
28
+ subscribeProjects(listener: () => void): () => void;
29
+ /** Every workspace, Default first (spec 043); the same array until it changes. */
30
+ workspaces(): readonly WorkspaceSummary[];
31
+ /** The id of the workspace the sidebar shows. */
32
+ currentWorkspace(): string;
33
+ /** Create a workspace and show it. */
34
+ createWorkspace(input: {
35
+ readonly name: string;
36
+ readonly kind: WorkspaceKind;
37
+ readonly remote?: {
38
+ readonly host: string;
39
+ readonly user?: string;
40
+ readonly path?: string;
41
+ };
42
+ }): Promise<ProjectAction>;
43
+ /** Show another workspace. */
44
+ switchWorkspace(id: string): Promise<ProjectAction>;
45
+ /**
46
+ * How a folder is chosen here: the window's own native picker (desktop) or the Host's (everywhere
47
+ * else - Web, and desktop Linux where Electron has no picker seam of its own), or by typing the
48
+ * folder's path when neither is available.
49
+ */
50
+ chooserKind(): FolderChooserKind;
51
+ /** Choose a folder (by the picker or the upstream flow), require a git repository, register it and open a chat in it. */
52
+ addProject(): Promise<ProjectAction>;
53
+ /** The same, for a folder path the user typed; the Host checks it is a real git worktree. */
54
+ addProjectByPath(path: string): Promise<ProjectAction>;
55
+ /** Show the chat for a worktree: its latest one, or a new one started there. */
56
+ showChat(worktreePath: string): Promise<ProjectAction>;
57
+ /** Start an additional chat in a worktree that may already have some. */
58
+ newChat(worktreePath: string): Promise<ProjectAction>;
59
+ /**
60
+ * Open one specific chat session by id (the workspace tree's expanded session list, spec 040 T129). An
61
+ * empty chat that belongs to no Host workspace cannot be sent from ("Choose workspace" - and the folder
62
+ * it sits under in the tree may not even be a registered workspace to choose), so opening one from a
63
+ * worktree row starts a chat bound to that worktree instead (registering the workspace when needed),
64
+ * carrying the old chat's name over and retiring the empty one from the tree.
65
+ */
66
+ openChat(id: string): Promise<ProjectAction>;
67
+ /**
68
+ * Rename one chat session's durable title (from the left tree or the tab strip; both show it). Goes through the per-session face's own `rename` - the top-level sessions
69
+ * service has none - reached the way `agent-bridge.ts` already does: `scope(id)` then `sessionOf`.
70
+ * The list row's `displayTitle` and any open chat tab follow from the resulting title projection.
71
+ */
72
+ renameChat(id: string, title: string): Promise<ProjectAction>;
73
+ /** Create a branch and worktree in a repository, select it and open a chat there. */
74
+ newWorktree(repoRoot: string, branch: string): Promise<ProjectAction>;
75
+ /**
76
+ * Remove a workspace from the tree entirely. Deletes the real Host
77
+ * registration when one exists (`IWorkspaces.delete` - "without deleting Sessions or files", so this
78
+ * is a registration removal, never data loss); either way, also drops it from the shell's own repo
79
+ * list so it does not linger client-side, and lets a later session still rediscover the same path.
80
+ */
81
+ removeWorkspace(root: string): Promise<ProjectAction>;
82
+ /** Open the app's Settings dialog. */
83
+ openSettings(): ProjectAction;
84
+ }
85
+ export type FolderChooserKind = 'picker' | 'path';
86
+ export interface ProjectsControlDeps {
87
+ /** Which surface this page is. */
88
+ readonly platform: ShellPlatform;
89
+ readonly shell: WorkspaceShellState;
90
+ readonly gitApi: WorkspaceGitApi;
91
+ readonly getWorkspaces: () => IWorkspaces | undefined;
92
+ readonly getSessions: () => ISessions | undefined;
93
+ /** Shows a chat (`ChatSelection`, the one owner of the shown chat). */
94
+ readonly navigator: SessionNavigator;
95
+ /** ACRYL's own project list (the Host keeps it). The chat's workspaces only follow it, registered when a chat starts. */
96
+ readonly registry: ProjectRegistryState;
97
+ /** Looked up when needed, because the desktop installs its folder-picker seam after this plugin loads. */
98
+ readonly directory: () => DirectorySeams;
99
+ /** Opens the OS folder chooser on the machine running the Host (see `web-folder-picker.ts`): the only
100
+ * chooser on Web, and desktop Linux's fallback once Electron's own seam (`directory().pickDirectory`)
101
+ * is absent - both are served by the same Host route, so neither platform needs anything else. */
102
+ readonly webPickDirectory?: () => Promise<string | null>;
103
+ /** Whether the DSH chat is available; off, adding or selecting a project does not try to open a chat, and chat actions say so. */
104
+ readonly chatAvailable?: () => boolean;
105
+ }
106
+ export interface DirectorySeams {
107
+ /** Open the platform folder chooser; null when the user cancels. Undefined outside the desktop app. */
108
+ readonly pickDirectory: (() => Promise<string | null>) | undefined;
109
+ /** Ask the desktop whether a folder is safe to persist as a workspace. */
110
+ readonly validateDirectory?: ((path: string) => Promise<boolean>) | undefined;
111
+ }
112
+ export declare function createProjectsControl(deps: ProjectsControlDeps): ProjectsControl;
113
+ /** The desktop's folder chooser and path check, exposed on `window` for exactly this kind of caller. */
114
+ interface DesktopDirectoryWindow {
115
+ __DSH_DESKTOP_PICK_DIRECTORY__?: () => Promise<string | null>;
116
+ __DSH_DESKTOP_VALIDATE_DIRECTORY__?: (path: string) => Promise<boolean>;
117
+ }
118
+ export declare function desktopDirectorySeams(view?: DesktopDirectoryWindow): DirectorySeams;
119
+ export {};
@@ -0,0 +1,22 @@
1
+ /** Same-origin browser client for the project registry (the Host owns the list; see `projects/contract.ts`). */
2
+ import { type ProjectRegistryView, type ProjectRequest } from '../../projects/contract.ts';
3
+ type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
4
+ export interface ProjectRegistryApi {
5
+ load(): Promise<ProjectRegistryView>;
6
+ /** @throws an Error whose message says what to fix (the Host's own refusal text). */
7
+ send(request: ProjectRequest): Promise<ProjectRegistryView>;
8
+ }
9
+ /** @param fetchImpl - injectable for tests; defaults to the page's fetch. */
10
+ export declare function createProjectRegistryApi(fetchImpl?: FetchLike): ProjectRegistryApi;
11
+ /** What the page needs of `EventSource` (injectable for tests). */
12
+ export interface EventSourceLike {
13
+ addEventListener(type: 'message', listener: (event: MessageEvent<string>) => void): void;
14
+ close(): void;
15
+ }
16
+ /**
17
+ * Follow the Host's registry as it changes: every view it pushes goes to `receive`; a message that does not validate is ignored. The
18
+ * browser reconnects a dropped stream by itself.
19
+ * @returns disposer, for one owning effect.
20
+ */
21
+ export declare function followProjectRegistry(receive: (view: ProjectRegistryView) => void, open?: (url: string) => EventSourceLike): () => void;
22
+ export {};
@@ -0,0 +1,67 @@
1
+ /** What the page knows of the project registry: the Host's workspaces and the shown one's projects, the moment it arrived, and who is listening. */
2
+ import type { ProjectRegistryView, WorkspaceKind, WorkspaceSummary } from '../../projects/contract.ts';
3
+ import type { ProjectRegistryApi } from './registry-api.ts';
4
+ export type ProjectChange = {
5
+ readonly ok: true;
6
+ } | {
7
+ readonly ok: false;
8
+ readonly reason: string;
9
+ };
10
+ export declare class ProjectRegistryState {
11
+ private readonly api;
12
+ private view;
13
+ private loadedOnce;
14
+ private readonly listeners;
15
+ /** @param initial - a list already known (a test's, or one the page was handed), which counts as loaded. */
16
+ constructor(api: ProjectRegistryApi, initial?: ProjectRegistryView);
17
+ /** The list has been read from the Host at least once. Until then an empty list means "not known yet". */
18
+ get loaded(): boolean;
19
+ get adopted(): boolean;
20
+ /** The shown workspace's projects. */
21
+ paths(): readonly string[];
22
+ /** Every workspace, Default first. The same array until the Host's answer changes it. */
23
+ workspaces(): readonly WorkspaceSummary[];
24
+ /** The id of the workspace the sidebar shows. */
25
+ current(): string;
26
+ /** A primitive that changes exactly when the shown workspace or its projects do, safe to subscribe to. */
27
+ key(): string;
28
+ subscribe: (listener: () => void) => (() => void);
29
+ /** Read the list from the Host. A failure leaves the state as it was and says why. */
30
+ load(): Promise<ProjectChange>;
31
+ /** A view the Host pushed (its event stream): a change made elsewhere, by an agent's tool or another window. */
32
+ receive(view: ProjectRegistryView): void;
33
+ add(path: string): Promise<ProjectChange>;
34
+ remove(path: string): Promise<ProjectChange>;
35
+ adopt(paths: readonly string[]): Promise<ProjectChange>;
36
+ /** Create a workspace; the Host shows it at once. */
37
+ createWorkspace(input: {
38
+ readonly name: string;
39
+ readonly kind: WorkspaceKind;
40
+ readonly remote?: {
41
+ readonly host: string;
42
+ readonly user?: string;
43
+ readonly path?: string;
44
+ };
45
+ }): Promise<ProjectChange>;
46
+ switchWorkspace(id: string): Promise<ProjectChange>;
47
+ renameWorkspace(id: string, name: string): Promise<ProjectChange>;
48
+ deleteWorkspace(id: string): Promise<ProjectChange>;
49
+ private apply;
50
+ }
51
+ /** What adoption needs to read from the DeepSeek Harness chat's workspace list. */
52
+ export interface LegacyWorkspaceSource {
53
+ getSnapshot(): {
54
+ readonly phase: 'pending' | 'ready';
55
+ readonly items: ReadonlyArray<{
56
+ readonly path: string;
57
+ }>;
58
+ };
59
+ subscribe(listener: () => void): () => void;
60
+ }
61
+ /**
62
+ * Take over, once, the folders that were registered as chat workspaces before ACRYL owned the list. It waits until both the registry and the workspace
63
+ * list are known (adopting from a list that is still loading would mark the work done and lose the user's projects), then asks the Host to adopt them;
64
+ * the Host applies it only once, so a second page or a reload changes nothing.
65
+ * @returns disposer.
66
+ */
67
+ export declare function adoptLegacyProjects(state: ProjectRegistryState, source: LegacyWorkspaceSource): () => void;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * What changes on screen when the shown workspace does (spec 043), whoever changed it: a click on the strip, a new workspace, an agent's
3
+ * `acryl_workspace_switch`, another window. The tab sets become the workspace's own; the selected worktree stays when it belongs to one
4
+ * of the workspace's projects, else the workspace's first project is shown with its chat, and a workspace without projects shows none.
5
+ */
6
+ import type { WorkspaceGroups } from '../canvas/groups.ts';
7
+ import type { RepoState, WorkspaceShellState } from '../worktrees/shell-state.ts';
8
+ import type { ProjectRegistryState } from './registry-state.ts';
9
+ export interface ShownWorkspaceDeps {
10
+ readonly registry: Pick<ProjectRegistryState, 'current' | 'paths' | 'subscribe'>;
11
+ readonly groups: Pick<WorkspaceGroups, 'setWorkspace'>;
12
+ readonly shell: Pick<WorkspaceShellState, 'getSnapshot' | 'clearSelection'>;
13
+ /** Show a worktree and its chat, as picking it in the tree does. */
14
+ readonly showWorktree: (path: string) => void;
15
+ }
16
+ /** Whether the worktree at `selected` belongs to one of `projects`: its repository, or a worktree of it, is inside one. */
17
+ export declare function belongsToProjects(selected: string, repos: readonly RepoState[], projects: readonly string[]): boolean;
18
+ /** @returns disposer, for one owning effect. */
19
+ export declare function followShownWorkspace(deps: ShownWorkspaceDeps): () => void;
@@ -0,0 +1,113 @@
1
+ /** Pure view-model for the Projects list in the left pane. */
2
+ import type { WorktreeAttention } from '../status/attention-model.ts';
3
+ import type { RepoState, ShellSnapshot } from '../worktrees/shell-state.ts';
4
+ /** The slice of a session row the model needs. */
5
+ export interface SessionLike {
6
+ readonly id?: string;
7
+ readonly cwd?: string;
8
+ readonly running: boolean;
9
+ readonly completed?: boolean;
10
+ readonly blank: boolean;
11
+ }
12
+ /** What a worktree's status dot means, most urgent first. */
13
+ export type WorktreeDot = 'error' | 'attention' | 'running' | 'done' | 'loading' | 'dirty' | 'clean';
14
+ export interface WorktreeRow {
15
+ readonly path: string;
16
+ readonly label: string;
17
+ readonly main: boolean;
18
+ readonly dot: WorktreeDot;
19
+ readonly changeCount: number;
20
+ readonly added: number;
21
+ readonly removed: number;
22
+ /** Open chats here: running, or with a tab in this worktree (the ones its list shows; earlier chats are not counted). */
23
+ readonly sessions: number;
24
+ readonly selected: boolean;
25
+ /** Agents (not plain terminals) open in this worktree's tabs, for the icons on the row. */
26
+ readonly agents: readonly string[];
27
+ }
28
+ export interface RepoRow {
29
+ readonly root: string;
30
+ readonly name: string;
31
+ /** false for a plain folder workspace that is not a git repository - no branches, no
32
+ * "New branch" affordance, a distinct icon instead of the git one. */
33
+ readonly git: boolean;
34
+ readonly rows: readonly WorktreeRow[];
35
+ }
36
+ /** The slice of a canvas tile the tree needs to list a worktree's running agents/terminals (spec 040 T129). */
37
+ export interface AgentTileLike {
38
+ readonly id: string;
39
+ readonly kind: string;
40
+ readonly title: string;
41
+ readonly commandId?: string;
42
+ /** Set on a chat tile: the session it shows. */
43
+ readonly chatSessionId?: string;
44
+ }
45
+ /** The slice of a chat session the tree needs to list a worktree's AcrylDSH Chats (spec 040 T129/T130). */
46
+ export interface ChatSessionLike {
47
+ readonly id: string;
48
+ readonly cwd?: string;
49
+ readonly blank: boolean;
50
+ readonly running: boolean;
51
+ /** SessionSummary's own resolved label (durable title, then project basename, then session id) - never guess a title here. */
52
+ readonly displayTitle: string;
53
+ /** The session's own durable title, when the Host has projected one (absent until renamed or titled). */
54
+ readonly title?: string;
55
+ }
56
+ /**
57
+ * The one label a chat goes by, in the tree and on its tab alike: its own durable title first (so a
58
+ * rename shows even on a chat with no messages yet - a blank chat used to say "New chat" no matter what
59
+ * it was named), else "New chat" while blank, else the resolved display title.
60
+ */
61
+ export declare function chatLabel(chat: {
62
+ readonly blank: boolean;
63
+ readonly displayTitle: string;
64
+ readonly title?: string;
65
+ }): string;
66
+ /**
67
+ * One row under an expanded worktree: a running agent/terminal tab, or an AcrylDSH Chat scoped to it.
68
+ * Deliberately never a file, browser, diff, board or doc tab - the tree lists live sessions only.
69
+ */
70
+ export interface WorktreeSessionEntry {
71
+ readonly kind: 'agent' | 'chat';
72
+ readonly id: string;
73
+ readonly label: string;
74
+ /** Set for kind 'agent': which runtime, for its icon ('shell' for a plain terminal). */
75
+ readonly commandId?: string;
76
+ readonly running?: boolean;
77
+ /** Whether this entry is the tab strip's selected tile right now, so the selected tab's row is highlighted. */
78
+ readonly active?: boolean;
79
+ /** A chat that is neither open in a tab nor running: history, listed only under "earlier chats". */
80
+ readonly earlier?: boolean;
81
+ }
82
+ /** The worktree's currently active canvas tile, only as much as entry-highlighting needs. */
83
+ export interface ActiveTileLike {
84
+ readonly id: string;
85
+ readonly chatSessionId?: string;
86
+ }
87
+ /**
88
+ * Everything to list under one expanded worktree: its open agent/terminal tabs (any `pty` canvas tile - a
89
+ * named agent or a plain shell) and its AcrylDSH Chat sessions (by cwd). Never file/browser/diff/board/doc
90
+ * tiles - those stay reachable from their own tab strip, not duplicated into this tree (spec 040 T129).
91
+ * @param active - the worktree's active tile, so its row can be highlighted here to match
92
+ * the tab strip; undefined when nothing is active or the active tile is not a kind this list shows.
93
+ */
94
+ export declare function entriesForWorktree(path: string, repos: readonly RepoState[], tiles: readonly AgentTileLike[], chats: readonly ChatSessionLike[], active?: ActiveTileLike): WorktreeSessionEntry[];
95
+ /**
96
+ * The tree's repositories a workspace shows (spec 043): for each of its project folders, the repository that owns it - the one with the
97
+ * deepest root or worktree containing it, so a plain folder that merely contains the project (a parent like ~/projects) is not pulled in -
98
+ * and the repository of the worktree on screen (`selected`), so the shown chat's folder is never missing. Nothing else: a folder some chat
99
+ * once ran in is not a project.
100
+ */
101
+ export declare function reposInWorkspace(repos: readonly RepoRow[], projects: readonly string[], selected?: string): readonly RepoRow[];
102
+ /**
103
+ * The worktree that owns a session directory: the deepest worktree path containing it, so a
104
+ * linked worktree nested under the main checkout still claims its own sessions.
105
+ */
106
+ export declare function owningWorktree(repos: readonly RepoState[], cwd: string): string | undefined;
107
+ /**
108
+ * @param snapshot - shell state.
109
+ * @param sessions - chat sessions; blank ones are ignored.
110
+ * @param openChats - per worktree, the chat sessions with a tab there; with `running`, what the row's chat count counts.
111
+ * @returns one entry per repository, worktrees in git order.
112
+ */
113
+ export declare function buildProjectRows(snapshot: ShellSnapshot, sessions: readonly SessionLike[], agentsByPath?: ReadonlyMap<string, readonly string[]>, attention?: ReadonlyMap<string, WorktreeAttention>, openChats?: ReadonlyMap<string, ReadonlySet<string>>): RepoRow[];
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The main panels DSH's own plugins contribute to its sidebar (the Plugins page, Automation tasks, and whatever a plugin adds), as the ACRYL left pane
3
+ * lists them. DSH's sidebar draws these itself; ACRYL replaces that sidebar with the workspace tree, so without this the pages exist and cannot be opened.
4
+ *
5
+ * Read-only over the slot registry and one call on the layout: `entriesOfSlot('sidebar.panellist')` names each panel (its id is the keyed `main` panel it opens, its
6
+ * label may be text or a function of the current language) and `layout.selectPanel(id)` opens it in the main column, which the advanced frame already shows.
7
+ */
8
+ import type { MainPanelId } from '@acryldev/ui/frame';
9
+ /** One panel as the left pane shows it. */
10
+ export interface UpstreamPanel {
11
+ readonly id: MainPanelId;
12
+ readonly label: string;
13
+ }
14
+ /** What the left pane needs: the list, when it changes, which panel is open, and how to open one. */
15
+ export interface UpstreamPanels {
16
+ /** The pages, in order. Read through `useSyncExternalStore`, so it must return the SAME array until the list changes (a new array per call re-renders forever). */
17
+ list(): readonly UpstreamPanel[];
18
+ subscribe(listener: () => void): () => void;
19
+ /** The open panel, or null while the conversation (or the ACRYL workspace) is showing. */
20
+ active(): MainPanelId | null;
21
+ /** Open a panel; selecting the one that is already open closes it and returns to the conversation. */
22
+ select(id: MainPanelId): void;
23
+ /** Close whichever panel is open and show the workspace's tabs again. */
24
+ close(): void;
25
+ }
26
+ /** The slice of the registry this reads; `ctx.slots` provides it. */
27
+ export interface PanelSlotRegistry {
28
+ entriesOfSlot(name: 'sidebar.panellist'): ReadonlyArray<{
29
+ readonly options: {
30
+ readonly id?: unknown;
31
+ readonly order?: number;
32
+ readonly label?: string | (() => string) | undefined;
33
+ };
34
+ }>;
35
+ subscribe(name: 'sidebar.panellist', listener: () => void): () => void;
36
+ }
37
+ /** The slice of the layout service this uses. */
38
+ export interface PanelLayout {
39
+ selectPanel(panelId: MainPanelId | null): void;
40
+ readonly panelInfo: {
41
+ getSnapshot(): {
42
+ readonly activePanelId: MainPanelId | null;
43
+ };
44
+ subscribe(listener: () => void): () => void;
45
+ };
46
+ }
47
+ /**
48
+ * Build the panel list over a registry and a layout. Both are looked up on demand (`ctx.get` semantics): a profile without the sidebar plugin has no
49
+ * registry entries and the list is simply empty, and a missing layout makes `select` do nothing instead of throwing.
50
+ */
51
+ export declare function createUpstreamPanels(source: {
52
+ slots(): PanelSlotRegistry | undefined;
53
+ layout(): PanelLayout | undefined;
54
+ }): UpstreamPanels;
@@ -0,0 +1,13 @@
1
+ /** Browser client for the Host's native folder chooser route (Web has no chooser of its own). */
2
+ /** The machine running the Host has no folder chooser, so the caller should ask for a typed path. */
3
+ export declare class FolderChooserUnavailableError extends Error {
4
+ constructor();
5
+ }
6
+ type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
7
+ /**
8
+ * @param fetchImpl - injectable for tests; defaults to the page's fetch.
9
+ * @returns a function that opens the chooser and resolves the picked absolute path, or null when cancelled.
10
+ * @throws FolderChooserUnavailableError when the Host has no chooser; an Error for any other failure.
11
+ */
12
+ export declare function createWebFolderPicker(fetchImpl?: FetchLike): () => Promise<string | null>;
13
+ export {};
@@ -0,0 +1,9 @@
1
+ /** Right pane tab: the line comments sent to the agent for the selected worktree, with resolve tracking. */
2
+ import type { PropsRuntime } from '@acryldev/ui/frame';
3
+ import type { ReviewStore } from './review-store.ts';
4
+ import type { WorkspaceShellState } from '../worktrees/shell-state.ts';
5
+ export type ReviewBodyProps = PropsRuntime<'sidebar.right.pane.tab'> & {
6
+ readonly shell: WorkspaceShellState;
7
+ readonly review: ReviewStore;
8
+ };
9
+ export declare function ReviewBody({ shell, review }: ReviewBodyProps): import("react").JSX.Element;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The record of line comments the user sent to the agent, per worktree, so a Review tab can list
3
+ * them and track which are resolved. The comment itself is durable in the chat session log; this
4
+ * store only remembers the reviewer's own bookkeeping (what was raised, what is done), and is
5
+ * persisted in the renderer like the tab layout.
6
+ */
7
+ import type { CommentSide } from '../diff/comment-message.ts';
8
+ export interface ReviewThread {
9
+ readonly id: string;
10
+ /** Absolute worktree path the comment belongs to. */
11
+ readonly worktree: string;
12
+ readonly file: string;
13
+ readonly side: CommentSide;
14
+ readonly line: number;
15
+ /** Last line of a multi-line comment, when it covers more than one. */
16
+ readonly endLine?: number;
17
+ /** The diff line the comment was made on, without its marker. */
18
+ readonly lineText: string;
19
+ readonly comment: string;
20
+ readonly sentAt: number;
21
+ readonly resolved: boolean;
22
+ }
23
+ export type NewReviewThread = Omit<ReviewThread, 'id' | 'sentAt' | 'resolved'>;
24
+ export declare const REVIEW_STORAGE_KEY = "acryl-workspace:review:v1";
25
+ export declare const MAX_THREADS_PER_WORKTREE = 200;
26
+ /** Parse saved threads defensively: anything malformed is dropped, never thrown. */
27
+ export declare function parseSavedThreads(raw: string | null | undefined): ReviewThread[];
28
+ export declare class ReviewStore {
29
+ private readonly clock;
30
+ private threads;
31
+ private version;
32
+ private nextId;
33
+ private readonly listeners;
34
+ constructor(saved?: readonly ReviewThread[], clock?: () => number);
35
+ subscribe(listener: () => void): () => void;
36
+ /** Changes on every mutation; a cheap snapshot for `useSyncExternalStore`. */
37
+ getVersion(): number;
38
+ all(): readonly ReviewThread[];
39
+ forWorktree(worktree: string): readonly ReviewThread[];
40
+ add(input: NewReviewThread): ReviewThread;
41
+ setResolved(id: string, resolved: boolean): void;
42
+ remove(id: string): void;
43
+ private changed;
44
+ }
45
+ /** Save the store on every change. @returns a disposer that stops saving. */
46
+ export declare function startReviewPersistence(store: ReviewStore, storage: Pick<Storage, 'setItem'> | undefined): () => void;
@@ -0,0 +1,15 @@
1
+ /** The `review` right-sidebar tab type, registered like the Changes tab (dependency-gated child plugin). */
2
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
3
+ import type { ReviewStore } from './review-store.ts';
4
+ import type { WorkspaceShellState } from '../worktrees/shell-state.ts';
5
+ export declare const REVIEW_KIND = "review";
6
+ export declare const REVIEW_ID = "@acryldev/workspace/review";
7
+ /**
8
+ * PENDING (not failed) while the upstream right sidebar is absent; both registrations live in one
9
+ * effect so they unwind together.
10
+ */
11
+ export declare function reviewTabPlugin(shell: WorkspaceShellState, review: ReviewStore): {
12
+ name: string;
13
+ inject: string[];
14
+ apply(ctx: ClientContext): void;
15
+ };
@@ -0,0 +1,20 @@
1
+ /** Send a message to the agent of the chat session that is currently open. */
2
+ import type { ISessions } from '@acryldev/ui/frame';
3
+ export type SendResult = {
4
+ readonly ok: true;
5
+ } | {
6
+ readonly ok: false;
7
+ readonly reason: string;
8
+ };
9
+ export interface AgentBridge {
10
+ /**
11
+ * Deliver `text` as a user turn queued after whatever the agent is doing. The session log is
12
+ * the durable record of it.
13
+ */
14
+ sendToCurrentSession(text: string): Promise<SendResult>;
15
+ }
16
+ /**
17
+ * @param getSessions - resolves the sessions service when it is needed; undefined while it is not
18
+ * available, so the bridge reports that instead of holding a stale reference.
19
+ */
20
+ export declare function createAgentBridge(getSessions: () => ISessions | undefined): AgentBridge;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * ACRYL's "main session" over DSH 0.2's session contract.
3
+ *
4
+ * 0.1.5 had `ISessions.open(id)` and `SessionListState.current`. 0.2 removed both: a session is "the main view" while some holder
5
+ * retains it with `source: 'mainView'`, and DSH's conversation keeps showing its current session for as long as anything still holds
6
+ * it. DSH's own navigation (`uiWorkspace`, `dsh-client-ui-workspace`) is one such holder, and it never releases its hold for a
7
+ * switch made elsewhere: a second, parallel hold taken here left DSH's hold on the old session in place, so every chat tab and every
8
+ * chat picked in the tree went on showing that old session. ACRYL therefore asks DSH's navigation to open the session (one owner of
9
+ * the selection, the previous hold released by it), and holds a reference itself only where that navigation is not composed.
10
+ */
11
+ import type { ISessions, SessionListState } from '@acryldev/ui/frame';
12
+ type SessionId = Parameters<ISessions['retain']>[0];
13
+ /** The share of DSH's `uiWorkspace` service used here: select a session and show its conversation, as one navigation action. */
14
+ export interface MainViewNavigation {
15
+ openSession(target: SessionId): void;
16
+ }
17
+ /** The session some view currently retains as the main view, if any. */
18
+ export declare function currentSessionId(list: SessionListState): SessionListState['ids'][number] | undefined;
19
+ /**
20
+ * Make `sessionId` the main view. Through DSH's navigation when it is composed (it releases the session it held before); otherwise
21
+ * retain it here first and then release the one held before, so there is never a gap.
22
+ */
23
+ export declare function openMainSession(sessions: ISessions, sessionId: string, navigation?: MainViewNavigation): void;
24
+ export {};