@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,9 @@
1
+ /** How many agents are working right now, and how to say so. */
2
+ /** The slice of a session row the count needs (a `SessionSummary` fits). */
3
+ export interface RunningSession {
4
+ readonly running: boolean;
5
+ }
6
+ /** Every running session counts, subagents included: each one is an agent doing work. */
7
+ export declare function countRunning(sessions: readonly RunningSession[]): number;
8
+ /** @returns "1 agent running" / "3 agents running", or null when nothing runs (the pill is then hidden). */
9
+ export declare function runningLabel(count: number): string | null;
@@ -0,0 +1,22 @@
1
+ import type { AgentId, WorkspacePtyView } from '../../pty/contract.ts';
2
+ import type { TerminalSize, WorkspacePtyApi } from '../terminal/pty-api.ts';
3
+ /**
4
+ * Client-activation owner for every Host PTY opened by one Workspace contribution.
5
+ * The Cordis declaration effect disposes this module before its slot disappears.
6
+ */
7
+ export declare class WorkspacePtyClient implements WorkspacePtyApi {
8
+ private readonly api;
9
+ private readonly sessions;
10
+ private readonly starting;
11
+ private disposed;
12
+ private disposePromise;
13
+ constructor(api: WorkspacePtyApi);
14
+ start(commandId: AgentId, cwd?: string, size?: TerminalSize): Promise<WorkspacePtyView>;
15
+ read(id: string): Promise<WorkspacePtyView>;
16
+ write(id: string, data: string): Promise<void>;
17
+ resize(id: string, cols: number, rows: number): Promise<void>;
18
+ close(id: string): Promise<void>;
19
+ /** Close all sessions, including starts that settle while disposal is active. */
20
+ dispose(): Promise<void>;
21
+ private settleAndClose;
22
+ }
@@ -0,0 +1,63 @@
1
+ import { WorkspaceState } from '../canvas/state.ts';
2
+ import type { RepoState } from '../worktrees/shell-state.ts';
3
+ export interface WorkspaceSessionNavigationProjection {
4
+ readonly current: string | undefined;
5
+ readonly blank: boolean | undefined;
6
+ }
7
+ /** The slice of a chat session `ensureWorktreeChatTabs` needs. */
8
+ export interface WorktreeChatSessionLike {
9
+ readonly cwd?: string;
10
+ readonly blank: boolean;
11
+ readonly displayTitle: string;
12
+ readonly title?: string;
13
+ readonly updatedAt?: number;
14
+ }
15
+ /** How many of a worktree's chats get a tab without being asked: the most recent ones. The tree lists every chat. */
16
+ export declare const RECENT_CHAT_TABS = 8;
17
+ /**
18
+ * Keep DSH session navigation visible inside the Workspace tab area: the session that becomes current gets
19
+ * its own chat tile (`addTile('chat', { chatSessionId })` finds-or-creates it by session id: one AcrylDSH Chat tab per open session,
20
+ * not one shared tab for all of them).
21
+ * Re-selecting a blank session is the New Session signal even when its id is unchanged. Ordinary updates to
22
+ * a non-blank current session leave the active Workspace tool tab alone.
23
+ */
24
+ export declare function synchronizeWorkspaceWithSessionNavigation(workspace: WorkspaceState, previousCurrent: string | undefined, projection: WorkspaceSessionNavigationProjection): string | undefined;
25
+ /**
26
+ * The worktree whose tab set holds a session's chat tab: the worktree that owns the session's folder, else the one on screen (a
27
+ * session outside every known worktree). A chat tab only ever lives in its owner's tab set. A tab in another worktree's set made
28
+ * two reactions chase each other: selecting the tab opened its session, the tree followed that session to its owning worktree,
29
+ * whose selected tab opened a session owned by the first worktree, and so on without end (a frozen window, 2026-10-12).
30
+ */
31
+ export declare function chatGroupFor(repos: readonly RepoState[], cwd: string | undefined, shown: string): string;
32
+ /**
33
+ * The session to open because the user selected a chat tab: the tab's own session when it is not the one on screen. Every
34
+ * chat tab shows the one main conversation, so selecting a tab without opening its session left the previous chat's conversation
35
+ * under the new tab's name. A tab not bound to a session (none yet) opens nothing.
36
+ */
37
+ export declare function sessionForSelectedChatTab(tile: {
38
+ readonly kind: string;
39
+ readonly chatSessionId?: string;
40
+ } | undefined, current: string | undefined): string | undefined;
41
+ /**
42
+ * Gives the worktree's most recent chats (`RECENT_CHAT_TABS`, by last update) their own tabs at once, instead of only the one that happens
43
+ * to be current; older chats open from the tree. Every chat of a busy worktree as a tab grew without bound (95 tabs) and never shrank.
44
+ * Each new tab's title is the session's real `displayTitle`, not the generic default.
45
+ * Adding tabs never moves the selection: afterwards the shown chat's tab is selected when this worktree has
46
+ * it, else the tab that was selected before (`addTile` focuses each tab it creates).
47
+ */
48
+ export declare function ensureWorktreeChatTabs(workspace: WorkspaceState, worktreePath: string, repos: readonly RepoState[], sessions: {
49
+ readonly ids: readonly string[];
50
+ readonly byId: Readonly<Record<string, WorktreeChatSessionLike | undefined>>;
51
+ readonly current: string | undefined;
52
+ }, dismissed?: ReadonlySet<string>): void;
53
+ /**
54
+ * Keep every open chat tab's title following its session's own title (a rename in the left tree or the tab strip shows in both).
55
+ * A tab's title is otherwise a static string set once at
56
+ * creation. Only a *change* in the session's label since the last time this ran is applied
57
+ * (`seen` remembers it per session): re-applying an unchanged title would revert a name the user just
58
+ * typed into a tab before the Host round trip has come back with it.
59
+ * @param seen - session id -> the displayTitle last applied; owned by the caller so it survives re-runs.
60
+ */
61
+ export declare function syncChatTabTitles(workspace: WorkspaceState, sessions: {
62
+ readonly byId: Readonly<Record<string, Pick<WorktreeChatSessionLike, 'blank' | 'displayTitle' | 'title'> | undefined>>;
63
+ }, seen: Map<string, string>): void;
@@ -0,0 +1,15 @@
1
+ /** Decide which existing chat to show for a worktree. */
2
+ import type { RepoState } from '../worktrees/shell-state.ts';
3
+ /** The slice of a session row the choice needs. */
4
+ export interface SessionRef {
5
+ readonly id: string;
6
+ readonly cwd?: string;
7
+ readonly blank: boolean;
8
+ readonly updatedAt: number;
9
+ }
10
+ /**
11
+ * The chat to open when the user picks a worktree: its most recently updated chat that has
12
+ * messages, else its most recently updated empty one (reusing it beats piling up empty chats).
13
+ * @returns the session id, or undefined when the worktree has no chat yet.
14
+ */
15
+ export declare function pickSession(repos: readonly RepoState[], sessions: readonly SessionRef[], worktreePath: string): string | undefined;
@@ -0,0 +1,5 @@
1
+ /** Dictionaries for the section names this package opens (the only text the Settings shell itself shows). */
2
+ export type SettingsSectionKey = 'agents' | 'tabs' | 'palette' | 'models';
3
+ export type SettingsLocaleKey = `${SettingsSectionKey}Nav`;
4
+ export declare const en: Record<SettingsLocaleKey, string>;
5
+ export declare const zh: Record<SettingsLocaleKey, string>;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Opens Settings on one of this package's sections from anywhere on the page (the "+" menu, the palette).
3
+ *
4
+ * The Settings panel keeps its open state inside the shell, so there is no call to open it. This uses what
5
+ * every user does: press the Settings button, then the section in its list. It looks the button up by its
6
+ * documented `aria-haspopup="dialog"`, and the section by its label in either shipped language. When either is
7
+ * missing (a different shell) it does nothing and says so, and the caller tells the user where to go.
8
+ */
9
+ import { type SettingsSectionKey } from './locales.ts';
10
+ /**
11
+ * The button that opens the Settings panel. Other buttons in the page also open dialogs (the Marketplace launcher,
12
+ * usage panels), so this looks only in the left pane: first the dialog button labelled "Settings" (DSH 0.2), then, for an
13
+ * older host, the one dialog button there with no label of its own that is not the Marketplace.
14
+ */
15
+ export declare function findSettingsTrigger(doc: Document): HTMLButtonElement | null;
16
+ /** Register the panel opener (the layout service's keyed `settings` panel); undefined clears it when the client unloads. */
17
+ export declare function setSettingsPanelOpener(open: (() => void) | undefined): void;
18
+ /** Window event that opens Settings (the desktop shell's application menu sends it: `Settings...`, Cmd/Ctrl+,). */
19
+ export declare const OPEN_SETTINGS_EVENT = "acryl:open-settings";
20
+ /**
21
+ * Open the Settings panel the way its own button does: the DSH sidebar trigger, else the layout's keyed panel. Settings that is already open stays
22
+ * open (its trigger toggles, so it is not pressed again).
23
+ * @returns true when Settings is open or was opened, false when this page has no way to open it.
24
+ */
25
+ export declare function openSettings(doc?: Document): boolean;
26
+ /** @returns disposer. Opens Settings whenever {@link OPEN_SETTINGS_EVENT} reaches `target`. */
27
+ export declare function startOpenSettingsListener(target: Pick<EventTarget, 'addEventListener' | 'removeEventListener'>, doc?: Document): () => void;
28
+ /**
29
+ * @param onSectionSettled - called once the section step resolves: `true` once its nav button was found and
30
+ * clicked, `false` if it never appeared within {@link SECTION_TIMEOUT_MS}. The Settings dialog is open either
31
+ * way (its trigger was found and clicked); a caller that cares whether it actually landed on the right section
32
+ * (rather than whatever section the shell defaulted to) uses this to tell the two apart instead of assuming
33
+ * success.
34
+ * @returns true when the Settings button was found and pressed; the section is then selected as soon as it
35
+ * appears, tried again on every scheduled frame up to the timeout.
36
+ */
37
+ export declare function openSettingsSection(section: SettingsSectionKey, doc?: Document, schedule?: (callback: () => void) => void, onSectionSettled?: (found: boolean) => void): boolean;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * The Settings sections this package adds (Agents, Tabs, Command palette): one shared plugin owns their dictionary and styles, and each
3
+ * section is a dependency-gated child plugin that only registers itself. The dictionary has one owner because DSH 0.2's locale service
4
+ * refuses a second registration of a namespace ("already has locale"): when every section registered it, only the first section loaded
5
+ * and the other two vanished from Settings.
6
+ */
7
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
8
+ import { type SettingsLocaleKey, type SettingsSectionKey } from './locales.ts';
9
+ export declare const SETTINGS_LOCALE_NAMESPACE = "acryl.workspace.settings";
10
+ declare module '@deepseek-ai/dsh-client-ui-slots' {
11
+ interface LocaleNamespaceMap {
12
+ 'acryl.workspace.settings': SettingsLocaleKey;
13
+ }
14
+ }
15
+ /** The sections' shared dictionary and styles, registered once for all of them. */
16
+ export declare function settingsSharedPlugin(): {
17
+ name: string;
18
+ inject: string[];
19
+ apply(ctx: ClientContext): void;
20
+ };
21
+ /** The options every section shares; the section adds its own `inject` and component. */
22
+ export interface SectionBase {
23
+ readonly name: 'settings.section';
24
+ readonly id: SettingsSectionKey;
25
+ readonly order: number;
26
+ readonly label: () => string;
27
+ readonly locale: typeof SETTINGS_LOCALE_NAMESPACE;
28
+ }
29
+ /**
30
+ * @param name - the Cordis plugin name.
31
+ * @param id - the section id; its nav label is `<id>Nav` in the dictionary.
32
+ * @param order - nav order among the sections (lower first).
33
+ * @param register - registers the section's component with the given base options; returns the slot disposer.
34
+ */
35
+ export declare function settingsSectionPlugin(name: string, id: SettingsSectionKey, order: number, register: (ctx: ClientContext, base: SectionBase) => () => void): {
36
+ name: string;
37
+ inject: string[];
38
+ apply(ctx: ClientContext): void;
39
+ };
@@ -0,0 +1,3 @@
1
+ /** Styles for the Settings sections this package adds (Agents, Tabs, Command palette), installed for the plugin's lifetime. */
2
+ /** @returns disposer, for one owning `ctx.effect`. */
3
+ export declare function installSettingsStyles(): () => void;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The Workspace brief tab (spec 043 T011): what a Shared Context workspace is for, its conventions and decisions, in plain markdown. Every
3
+ * agent in the workspace is told it. The tab edits the brief of the workspace it was opened in (kept in its state), and saves on request.
4
+ */
5
+ import { type ReactElement } from 'react';
6
+ import type { WorkspaceSummary } from '../../projects/contract.ts';
7
+ import type { WorkspaceTabProps, WorkspaceTabType } from '../tabs/registry/tab-registry.ts';
8
+ import type { BriefApi } from './brief-api.ts';
9
+ export declare const BRIEF_TAB_KIND = "acryl.workspace-brief";
10
+ export interface BriefTabDeps {
11
+ readonly api: BriefApi;
12
+ /** The shown workspace (a new tab edits its brief) and the workspaces by id. */
13
+ readonly current: () => string;
14
+ readonly workspaces: () => readonly WorkspaceSummary[];
15
+ }
16
+ export declare function BriefTab({ deps, tab }: {
17
+ readonly deps: BriefTabDeps;
18
+ readonly tab: WorkspaceTabProps;
19
+ }): ReactElement;
20
+ /** The tab type the workspace registers for itself. */
21
+ export declare function briefTabType(deps: BriefTabDeps): WorkspaceTabType;
@@ -0,0 +1,9 @@
1
+ /** Same-origin browser client for a workspace's brief (the Host keeps it; `shared-context/route.ts`). */
2
+ type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
3
+ export interface BriefApi {
4
+ read(id: string): Promise<string>;
5
+ /** @throws an Error whose message says what to fix. */
6
+ save(id: string, text: string): Promise<void>;
7
+ }
8
+ export declare function createBriefApi(fetchImpl?: FetchLike): BriefApi;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ /** Same-origin client for the agent status list (what each terminal agent reports it is doing). */
2
+ import { type AgentStatus } from '../../agents/status/agent-status.ts';
3
+ export interface AgentStatusApi {
4
+ list(): Promise<readonly AgentStatus[]>;
5
+ }
6
+ type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
7
+ /** @param value - unknown JSON from the route. @throws Error when it is not the expected shape. */
8
+ export declare function parseStatuses(value: unknown): AgentStatus[];
9
+ export declare function createAgentStatusApi(fetchImpl?: FetchLike): AgentStatusApi;
10
+ export {};
@@ -0,0 +1,27 @@
1
+ /**
2
+ * What each terminal agent reports it is doing, kept fresh by polling. A change of state is observable, and the
3
+ * moment an agent starts needing you is a separate event so the page can raise a notice exactly once.
4
+ */
5
+ import type { AgentState } from '../../agents/status/agent-status.ts';
6
+ import type { AgentStatusApi } from './agent-status-api.ts';
7
+ export declare const STATUS_POLL_MS = 2000;
8
+ export declare class AgentStatusState {
9
+ private readonly api;
10
+ private states;
11
+ private readonly listeners;
12
+ private readonly needsYouListeners;
13
+ private loaded;
14
+ constructor(api: AgentStatusApi);
15
+ /** A new map on every change, so it is safe as a `useSyncExternalStore` snapshot. */
16
+ getSnapshot: () => ReadonlyMap<string, AgentState>;
17
+ subscribe: (listener: () => void) => (() => void);
18
+ /** Be told when an agent goes from anything else to waiting for you. @returns disposer. */
19
+ onNeedsYou(listener: (terminalId: string) => void): () => void;
20
+ /** Ask the Host now. A Host without the route, or a failed request, leaves the last answer in place. */
21
+ refresh(): Promise<void>;
22
+ /**
23
+ * Poll while the page is visible.
24
+ * @returns disposer, for one owning effect.
25
+ */
26
+ start(intervalMs?: number, isVisible?: () => boolean): () => void;
27
+ }
@@ -0,0 +1,20 @@
1
+ /** Turning per-terminal agent states into what each worktree row and tab shows. Pure. */
2
+ import type { AgentState } from '../../agents/status/agent-status.ts';
3
+ /** The slice of a tab this needs. */
4
+ export interface AttentionTab {
5
+ readonly kind: string;
6
+ readonly commandId?: string | undefined;
7
+ readonly terminalId?: string | undefined;
8
+ }
9
+ export interface WorktreeAttention {
10
+ /** Agents that need you (a permission, a question). */
11
+ readonly waiting: number;
12
+ /** Agents that are busy. */
13
+ readonly working: number;
14
+ }
15
+ /**
16
+ * @param tabsByWorktree - the open tabs of each worktree, by worktree path.
17
+ * @param states - what each terminal agent last reported.
18
+ * @returns for each worktree with an agent that is working or waiting, how many of each. Plain shells never count.
19
+ */
20
+ export declare function attentionByWorktree(tabsByWorktree: ReadonlyMap<string, readonly AttentionTab[]>, states: ReadonlyMap<string, AgentState>): ReadonlyMap<string, WorktreeAttention>;
@@ -0,0 +1,2 @@
1
+ /** Install styles owned by one Workspace Client Fiber. */
2
+ export declare function installWorkspaceStyles(): () => void;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The badge that tells agents apart. Agents with a drawn mark show it (`agent-marks.tsx`); the other known agents and custom
3
+ * agents show the letter and colour its author chose.
4
+ */
5
+ /** @param custom - the badge of a custom agent; built-in agents use their own mark. */
6
+ export declare function AgentIcon({ commandId, custom }: {
7
+ readonly commandId: string;
8
+ readonly custom?: {
9
+ readonly letter: string;
10
+ readonly color: string;
11
+ } | undefined;
12
+ }): import("react").JSX.Element;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The "+" button and its menu: surfaces (terminal, browser, file, ...) and the agents that are installed and
3
+ * enabled. The plain "+" opens the default agent chosen in Settings > Agents (or the last thing opened when
4
+ * the default is Auto). "Manage agents..." turns the list into checkboxes so an agent can be enabled or disabled
5
+ * right here; "Add more agents..." opens Settings > Agents (flags, default, install links), and "Add your own tab
6
+ * type..." opens Settings > Tabs.
7
+ */
8
+ import type { AgentSettingsView } from '../../agents/contract.ts';
9
+ import type { CustomAgent } from '../../agents/definition.ts';
10
+ import { labelForCommand, type WorkspaceSurfaceAction } from '../terminal/agent-commands.ts';
11
+ import { type TabTypesState } from './tab-types-state.ts';
12
+ import type { WorkspaceTabRegistry } from './registry/tab-registry.ts';
13
+ export interface NewTabMenuProps {
14
+ readonly open: boolean;
15
+ readonly customAgents: readonly CustomAgent[];
16
+ /** What Settings > Agents says (installed, enabled, default), or null before the Host has answered. */
17
+ readonly settings: AgentSettingsView | null;
18
+ readonly storage: Storage | undefined;
19
+ /** Which tab types are turned on (Settings > Tabs). */
20
+ readonly tabTypes: TabTypesState;
21
+ /** The tab types plugins registered; the enabled ones follow the built-in ones. */
22
+ readonly tabRegistry: WorkspaceTabRegistry;
23
+ /** Opens a tab of a plugin's type. */
24
+ onCustomTab(kind: string, label: string): void;
25
+ setOpen(open: boolean): void;
26
+ onSurface(action: WorkspaceSurfaceAction): void;
27
+ onOpenAgent(id: string, title: string): void;
28
+ /** Starts a brand new AcrylDSH Chat session - its own tab, distinct from any already open. */
29
+ onOpenChat(): void;
30
+ /** The DSH chat is available. Off, the menu has no chat entry and never offers one as the last-used tab. Defaults to on. */
31
+ chatAvailable?: boolean;
32
+ /** Turns one agent on or off in the + menu (a Host setting, shared with Settings > Agents). */
33
+ onSetAgentEnabled(id: string, enabled: boolean): Promise<void>;
34
+ /**
35
+ * Opens Settings on a section; false when the Settings panel could not be found. `onSettled(false)` fires
36
+ * later if the panel opened but its section never appeared (e.g. still starting up), so a menu that closed
37
+ * on a `true` return can still tell the person it landed on the wrong tab instead of staying silent.
38
+ */
39
+ onManageSettings(section: 'agents' | 'tabs', onSettled?: (found: boolean) => void): boolean;
40
+ }
41
+ export declare function NewTabMenu({ open, customAgents, settings, storage, tabTypes, tabRegistry, onCustomTab, setOpen, onSurface, onOpenAgent, onOpenChat, chatAvailable, onSetAgentEnabled, onManageSettings }: NewTabMenuProps): import("react").JSX.Element;
42
+ export { labelForCommand };
@@ -0,0 +1,7 @@
1
+ /** A small marker on an agent tab: needs you, working now, waiting for your next message, or finished. */
2
+ import type { AgentState } from '../../agents/status/agent-status.ts';
3
+ import type { TerminalSession } from '../terminal/terminal-session.ts';
4
+ export declare function TabActivity({ session, state }: {
5
+ readonly session: TerminalSession | undefined; /** What the agent reported through its hooks, when it does. */
6
+ readonly state?: AgentState | undefined;
7
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * The workspace's tab strip: the branch, the tabs (each with an icon, renamable in place, scrollable when
3
+ * there are many), the running-agents pill, the "+" menu with its configurable agent list, and the
4
+ * right-panel toggle.
5
+ */
6
+ import type { AgentId } from '../../pty/contract.ts';
7
+ import type { WorkspaceSnapshot, WorkspaceState, WorkspaceTile } from '../canvas/state.ts';
8
+ import type { CustomAgent } from '../../agents/definition.ts';
9
+ import type { TerminalRegistry } from '../terminal/terminal-session.ts';
10
+ import type { AgentSettingsView } from '../../agents/contract.ts';
11
+ import type { AgentStatusState } from '../status/agent-status-state.ts';
12
+ import type { DockController } from '../dock/dock-controller.ts';
13
+ import { type RightPaneHandle } from '../dock/DockButtons.tsx';
14
+ import type { WorkspaceTabRegistry } from './registry/tab-registry.ts';
15
+ import type { TabTypesState } from './tab-types-state.ts';
16
+ export interface TabStripProps {
17
+ readonly snapshot: WorkspaceSnapshot;
18
+ readonly workspace: WorkspaceState;
19
+ /** The selected worktree's path, or the global group key when none is selected. */
20
+ readonly branchLabel: string | null;
21
+ readonly branchTitle: string;
22
+ readonly runningText: string | null;
23
+ /** The whole right pane's own open/collapsed state, so the mode-switch button can open it when a mode needs it. */
24
+ readonly rightPanel?: RightPaneHandle;
25
+ /** The terminal dock, for its mode-switch button. */
26
+ readonly dock: DockController;
27
+ /** What terminal agents report, for the marker on their tabs. */
28
+ readonly agentStatus: AgentStatusState;
29
+ readonly storage: Storage | undefined;
30
+ /** The user selected this tab (a chat tab also opens its session). */
31
+ onSelect(tile: WorkspaceTile): void;
32
+ onClose(tile: WorkspaceTile): void;
33
+ readonly customAgents: readonly CustomAgent[];
34
+ /** The live terminals, for the activity marker on agent tabs. */
35
+ readonly terminals: TerminalRegistry;
36
+ onOpenPty(commandId: AgentId, title: string): void;
37
+ /** Starts a brand new AcrylDSH Chat session, in its own tab. */
38
+ onOpenChat(): void;
39
+ /** The DSH chat is available (see NewTabMenu). Defaults to on. */
40
+ chatAvailable?: boolean;
41
+ /** Renames a chat tab's session itself, so the left tree (which reads the session's own title) follows. */
42
+ onRenameChat(sessionId: string, title: string): void;
43
+ /** What Settings > Agents says, for the "+" menu. */
44
+ readonly agentSettings: AgentSettingsView | null;
45
+ /** Which tab types are turned on, shared with Settings > Tabs and the palette. */
46
+ readonly tabTypes: TabTypesState;
47
+ /** The tab types plugins registered: their glyphs draw the tabs and they are listed in the + menu. */
48
+ readonly tabRegistry: WorkspaceTabRegistry;
49
+ /** Turns one agent on or off in the + menu. */
50
+ onSetAgentEnabled(id: string, enabled: boolean): Promise<void>;
51
+ onManageSettings(section: 'agents' | 'tabs', onSettled?: (found: boolean) => void): boolean;
52
+ }
53
+ export declare function TabStrip({ snapshot, workspace, branchLabel, branchTitle, runningText, rightPanel, dock, agentStatus, storage, customAgents, terminals, onSelect, onClose, onOpenPty, onOpenChat, chatAvailable, onRenameChat, agentSettings, tabTypes, tabRegistry, onSetAgentEnabled, onManageSettings }: TabStripProps): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Settings > Tabs: every kind of tab the workspace can open, each turned on or off. Turned-off types leave the
3
+ * "+" menu and the command palette. The terminal is always on. Tab types that plugins registered through the
4
+ * `workspaceTabs` service are listed below the built-in ones and can be turned off the same way.
5
+ */
6
+ import type { WorkspaceTabRegistry } from './registry/tab-registry.ts';
7
+ import type { TabTypesState } from './tab-types-state.ts';
8
+ export interface TabsSectionInjected {
9
+ readonly tabTypes: TabTypesState;
10
+ /** The tab types plugins registered. */
11
+ readonly tabRegistry: WorkspaceTabRegistry;
12
+ }
13
+ export declare function TabsPanel({ tabTypes, tabRegistry }: TabsSectionInjected): import("react").JSX.Element;
14
+ export declare function TabsSection(props: TabsSectionInjected): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The mark shown for each built-in agent: a small, simple SVG that tells agents apart at a glance.
3
+ * They are drawn here as plain geometric shapes (not copies of vendor artwork). Marks that would vanish on
4
+ * a light or a dark theme use `currentColor`, so they follow the theme.
5
+ */
6
+ import type { ReactNode } from 'react';
7
+ import type { WorkspacePtyCommandId } from '../../pty/contract.ts';
8
+ /** A mark per agent that has one; the rest show their letter badge (`known-agents.ts`). */
9
+ export declare const AGENT_MARKS: Partial<Record<WorkspacePtyCommandId, ReactNode>>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Which tab types the "+" menu lists. Every type is listed by default; the user hides the ones they never use
3
+ * from "Configure tabs" (an entry like `surface:diff`). Agents are not here: which agents are listed is set
4
+ * in Settings > Agents. The choice is remembered in the browser storage (a per-viewer convenience).
5
+ */
6
+ export declare const HIDDEN_AGENTS_KEY = "acryl-workspace:hidden-agents";
7
+ /** @returns the ids the user hid; anything unreadable counts as "nothing hidden". */
8
+ export declare function readHiddenAgents(storage: Pick<Storage, 'getItem'> | undefined): ReadonlySet<string>;
9
+ export declare function writeHiddenAgents(storage: Pick<Storage, 'setItem'> | undefined, hidden: ReadonlySet<string>): void;
10
+ /** @returns a new set with the agent shown or hidden. */
11
+ export declare function toggleAgent(hidden: ReadonlySet<string>, id: string): ReadonlySet<string>;
@@ -0,0 +1,15 @@
1
+ /** What the "+" button opens: the last thing the user opened from the menu (a terminal until they choose). */
2
+ export declare const LAST_TAB_KEY = "acryl-workspace:last-tab";
3
+ export type LastTab = {
4
+ readonly kind: 'agent';
5
+ readonly id: string;
6
+ readonly label: string;
7
+ } | {
8
+ readonly kind: 'surface';
9
+ readonly surface: 'pty' | 'browser' | 'file' | 'diff' | 'kanban' | 'doc';
10
+ } | {
11
+ readonly kind: 'chat';
12
+ };
13
+ export declare const DEFAULT_LAST_TAB: LastTab;
14
+ export declare function readLastTab(storage: Pick<Storage, 'getItem'> | undefined): LastTab;
15
+ export declare function writeLastTab(storage: Pick<Storage, 'setItem'> | undefined, tab: LastTab): void;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The pane for a plugin's tab. When the plugin is on, its component renders and its state is saved with the
3
+ * tab. When the plugin is off or not installed, the pane says so and the tab keeps its saved state, so turning
4
+ * the plugin back on restores the content exactly (T012).
5
+ */
6
+ import type { WorkspaceState, WorkspaceTile } from '../../canvas/state.ts';
7
+ import { type WorkspaceTabRegistry } from './tab-registry.ts';
8
+ export interface CustomTabPaneProps {
9
+ readonly tile: WorkspaceTile;
10
+ readonly workspace: WorkspaceState;
11
+ readonly registry: WorkspaceTabRegistry;
12
+ }
13
+ export declare function CustomTabPane({ tile, workspace, registry }: CustomTabPaneProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ /** Provides the tab registry to other client plugins as the `workspaceTabs` service, for one plugin lifetime. */
2
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
3
+ import type { WorkspaceTabRegistry } from './tab-registry.ts';
4
+ declare module '@deepseek-ai/cordis' {
5
+ interface Context {
6
+ /** Register tab types of your own: `ctx.workspaceTabs.register({ kind, label, description, glyph, component })`. */
7
+ workspaceTabs: WorkspaceTabRegistry;
8
+ }
9
+ }
10
+ /** @returns disposer for the service registration. */
11
+ export declare function provideWorkspaceTabs(ctx: ClientContext, registry: WorkspaceTabRegistry): () => void;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * The registry of tab types that plugins add to the workspace (spec 040 T125, design in
3
+ * `specs/040-agentic-multiplexer-ade/design-phase-10.md`). A plugin registers a type with a stable, namespaced
4
+ * kind; the workspace lists it in the "+" menu, the palette and Settings > Tabs, renders its component in a tab
5
+ * and saves the tab's state with the workspace. Provided to other client plugins as the `workspaceTabs` service.
6
+ */
7
+ import type { ComponentType } from 'react';
8
+ /** What a tab type's component receives. It owns nothing else: the workspace owns the tab. */
9
+ export interface WorkspaceTabProps {
10
+ readonly tileId: string;
11
+ readonly title: string;
12
+ /** The tab's saved state (text; JSON is the convention), or undefined for a new tab. */
13
+ readonly state: string | undefined;
14
+ /** Replace the saved state. It is written with the workspace shortly after. */
15
+ setState(next: string): void;
16
+ /** Rename the tab. */
17
+ setTitle(title: string): void;
18
+ }
19
+ export interface WorkspaceTabType {
20
+ /** Stable and namespaced: `<owner>.<name>`, lowercase letters, digits and dashes (`acme.whiteboard`). */
21
+ readonly kind: string;
22
+ /** The name in the "+" menu, `New <label>` is not added for you. */
23
+ readonly label: string;
24
+ /** One sentence for Settings > Tabs. */
25
+ readonly description: string;
26
+ /** One or two characters shown on the tab. */
27
+ readonly glyph: string;
28
+ readonly component: ComponentType<WorkspaceTabProps>;
29
+ }
30
+ export declare class TabTypeError extends Error {
31
+ constructor(message: string);
32
+ }
33
+ export declare const TAB_KIND_PATTERN: RegExp;
34
+ export declare const MAX_TAB_KIND_LENGTH = 80;
35
+ export declare const MAX_TAB_STATE_LENGTH = 200000;
36
+ /** @throws TabTypeError naming the first rule the type breaks. */
37
+ export declare function validateTabType(type: WorkspaceTabType): void;
38
+ /** Observable list of the registered tab types, in registration order. */
39
+ export declare class WorkspaceTabRegistry {
40
+ private types;
41
+ private readonly listeners;
42
+ /** A new array on every change, so it is safe as a `useSyncExternalStore` snapshot. */
43
+ getSnapshot: () => readonly WorkspaceTabType[];
44
+ subscribe: (listener: () => void) => (() => void);
45
+ get(kind: string): WorkspaceTabType | undefined;
46
+ /**
47
+ * @returns disposer that removes exactly this registration (idempotent).
48
+ * @throws TabTypeError for an invalid type or a kind that is already registered.
49
+ */
50
+ register(type: WorkspaceTabType): () => void;
51
+ private notify;
52
+ }
@@ -0,0 +1,4 @@
1
+ /** Which tabs "Close others" and "Close to the right" mean. */
2
+ export type CloseScope = 'others' | 'right';
3
+ /** @returns the ids to close, in tab order; the tab the menu was opened on is never among them. */
4
+ export declare function tabsToClose(tabIds: readonly string[], anchorId: string, scope: CloseScope): readonly string[];
@@ -0,0 +1,19 @@
1
+ /** Pure rules for the horizontally scrollable tab strip. */
2
+ export interface ScrollGeometry {
3
+ readonly scrollLeft: number;
4
+ readonly clientWidth: number;
5
+ readonly scrollWidth: number;
6
+ }
7
+ /** Which sides still hide tabs (a 1px slack absorbs sub-pixel rounding). */
8
+ export declare function hiddenEdges(g: ScrollGeometry): {
9
+ readonly start: boolean;
10
+ readonly end: boolean;
11
+ };
12
+ /**
13
+ * A mouse wheel only scrolls vertically, which a tab strip cannot use, so a mostly-vertical wheel turn
14
+ * becomes a horizontal scroll. A trackpad (or shift) already sends horizontal deltas and is left alone.
15
+ * @returns the horizontal amount to scroll by, or null when the event should keep its default behavior.
16
+ */
17
+ export declare function wheelToScroll(deltaX: number, deltaY: number): number | null;
18
+ /** @returns the scrollLeft that brings a tab fully into view with a little margin, or null when it already is. */
19
+ export declare function scrollToReveal(g: ScrollGeometry, tabLeft: number, tabWidth: number, margin?: number): number | null;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Which tab types the "+" menu, the palette and Settings > Tabs treat as enabled. Every type is enabled by
3
+ * default; the user turns off the ones they never use. The terminal cannot be turned off. The choice is kept in
4
+ * the browser storage (a per-viewer convenience) and shared, so a change in Settings shows up in the menu at once.
5
+ */
6
+ import type { WorkspaceSurfaceAction } from '../terminal/agent-commands.ts';
7
+ /** The remembered set holds `surface:<kind>` entries, and `custom:<kind>` for a plugin's tab type. */
8
+ export declare const tabTypeKey: (kind: WorkspaceSurfaceAction["kind"]) => string;
9
+ export declare const customTabTypeKey: (kind: string) => string;
10
+ export declare class TabTypesState {
11
+ private readonly storage;
12
+ private hidden;
13
+ private readonly listeners;
14
+ constructor(storage: Pick<Storage, 'getItem' | 'setItem'> | undefined);
15
+ getSnapshot: () => ReadonlySet<string>;
16
+ subscribe: (listener: () => void) => (() => void);
17
+ /** The terminal is always enabled. */
18
+ isEnabled(kind: WorkspaceSurfaceAction['kind']): boolean;
19
+ setEnabled(kind: WorkspaceSurfaceAction['kind'], enabled: boolean): void;
20
+ isCustomEnabled(kind: string): boolean;
21
+ setCustomEnabled(kind: string, enabled: boolean): void;
22
+ /** @returns the surface actions the + menu and the palette offer. */
23
+ enabled(all: readonly WorkspaceSurfaceAction[]): readonly WorkspaceSurfaceAction[];
24
+ }
@@ -0,0 +1,9 @@
1
+ /** Settings > Tabs, registered through the shared section plugin. */
2
+ import type { WorkspaceTabRegistry } from './registry/tab-registry.ts';
3
+ import type { TabTypesState } from './tab-types-state.ts';
4
+ /** @param tabTypes - the shared enable and disable state of the tab types. @param tabRegistry - the tab types plugins registered. */
5
+ export declare function tabsSettingsPlugin(tabTypes: TabTypesState, tabRegistry: WorkspaceTabRegistry): {
6
+ name: string;
7
+ inject: string[];
8
+ apply(ctx: import("@deepseek-ai/cordis").Context): void;
9
+ };