@pstdio/ui 0.14.0 → 0.16.0

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 (226) hide show
  1. package/dist/{MermaidComponent-CatfVUxA.js → MermaidComponent-BCMQqPqu.js} +11 -11
  2. package/dist/{MermaidComponent-CatfVUxA.js.map → MermaidComponent-BCMQqPqu.js.map} +1 -1
  3. package/dist/browser-storage-BinyFNJX.js +40 -0
  4. package/dist/browser-storage-BinyFNJX.js.map +1 -0
  5. package/dist/chat-ui.js +1160 -1120
  6. package/dist/chat-ui.js.map +1 -1
  7. package/dist/checkbox-D5AzFRlb.js +70 -0
  8. package/dist/checkbox-D5AzFRlb.js.map +1 -0
  9. package/dist/components/chat-ui/components/ai-conversation.d.ts +1 -1
  10. package/dist/components/chat-ui/components/ai-message.d.ts +1 -1
  11. package/dist/components/chat-ui/components/ai-response.d.ts +0 -1
  12. package/dist/components/chat-ui/components/attachment-list.d.ts +1 -1
  13. package/dist/components/chat-ui/components/auto-scroll.d.ts +27 -0
  14. package/dist/components/chat-ui/components/chat-message-animation.d.ts +22 -0
  15. package/dist/components/chat-ui/components/timeline.d.ts +0 -2
  16. package/dist/components/chat-ui/performance/chat-performance-fixtures.d.ts +0 -1
  17. package/dist/components/chat-ui/tool-rendering/build-timeline.d.ts +2 -12
  18. package/dist/components/chat-ui/tool-rendering/shared.d.ts +1 -1
  19. package/dist/components/chat-ui/tool-rendering/types.d.ts +1 -2
  20. package/dist/components/command-palette/index.d.ts +4 -0
  21. package/dist/components/data-renderer/data-renderer-board.d.ts +1 -1
  22. package/dist/components/data-renderer/data-renderer-card.d.ts +1 -1
  23. package/dist/components/data-renderer/data-renderer-enum-helpers.d.ts +3 -3
  24. package/dist/components/data-renderer/data-renderer-helpers.d.ts +2 -0
  25. package/dist/components/data-renderer/data-renderer-list.d.ts +1 -1
  26. package/dist/components/data-renderer/data-renderer.d.ts +1 -1
  27. package/dist/components/data-renderer/index.d.ts +18 -0
  28. package/dist/components/data-renderer/types.d.ts +0 -6
  29. package/dist/components/diff-viewer/diff-card.d.ts +1 -0
  30. package/dist/components/diff-viewer/diff-drawer-scroll.d.ts +0 -19
  31. package/dist/components/diff-viewer/diff-drawer.d.ts +1 -0
  32. package/dist/components/diff-viewer/diff-viewer-options-menu.d.ts +16 -0
  33. package/dist/components/diff-viewer/index.d.ts +2 -0
  34. package/dist/components/diff-viewer/use-selected-diff-scroll.d.ts +7 -3
  35. package/dist/components/internal/style-guide.d.ts +14 -0
  36. package/dist/components/internal/token-editor-controls.d.ts +8 -0
  37. package/dist/components/internal/token-editor-data.d.ts +40 -0
  38. package/dist/components/internal/token-editor-state.d.ts +22 -0
  39. package/dist/components/layout/index.d.ts +6 -0
  40. package/dist/components/list-row/list-row.types.d.ts +1 -1
  41. package/dist/components/notification-center/index.d.ts +2 -0
  42. package/dist/components/notification-center/notification-center.d.ts +2 -0
  43. package/dist/components/notification-center/notification-center.types.d.ts +37 -0
  44. package/dist/components/{bubble-button.d.ts → overlays/bubble-button.d.ts} +1 -1
  45. package/dist/components/overlays/index.d.ts +12 -0
  46. package/dist/components/overlays/search-modal-content.d.ts +20 -0
  47. package/dist/components/{searchable-menu.d.ts → overlays/searchable-menu.d.ts} +1 -1
  48. package/dist/components/param-editor/index.d.ts +23 -0
  49. package/dist/components/param-editor/inputs/action-input.d.ts +13 -0
  50. package/dist/components/param-editor/inputs/anchor-grid-input.d.ts +12 -0
  51. package/dist/components/param-editor/inputs/anchor-grid.d.ts +4 -0
  52. package/dist/components/param-editor/inputs/file-accept.d.ts +22 -0
  53. package/dist/components/param-editor/inputs/file-drop-input.d.ts +14 -0
  54. package/dist/components/param-editor/inputs/numeric-value.d.ts +6 -0
  55. package/dist/components/param-editor/inputs/range-input.d.ts +17 -0
  56. package/dist/components/param-editor/inputs/range-value.d.ts +5 -0
  57. package/dist/components/param-editor/inputs/resource-input-chips.d.ts +15 -0
  58. package/dist/components/param-editor/inputs/resource-input.d.ts +18 -0
  59. package/dist/components/param-editor/inputs/segmented-input.d.ts +14 -0
  60. package/dist/components/param-editor/inputs/slider-marks.d.ts +5 -0
  61. package/dist/components/param-editor/inputs/vector-input.d.ts +17 -0
  62. package/dist/components/param-editor/inputs/vector-value.d.ts +7 -0
  63. package/dist/components/param-editor/param-editor-control-item.d.ts +15 -0
  64. package/dist/components/param-editor/param-editor-control-list.d.ts +5 -0
  65. package/dist/components/param-editor/param-editor-field-label.d.ts +1 -0
  66. package/dist/components/param-editor/param-editor-field.d.ts +11 -0
  67. package/dist/components/param-editor/param-editor-inline-group.d.ts +5 -0
  68. package/dist/components/param-editor/param-editor-section.d.ts +16 -0
  69. package/dist/components/param-editor/param-editor.d.ts +2 -1
  70. package/dist/components/param-editor/param-editor.types.d.ts +101 -19
  71. package/dist/components/{breadcrumb.d.ts → primitives/breadcrumb.d.ts} +1 -1
  72. package/dist/components/{icon-color-picker.d.ts → primitives/icon-color-picker.d.ts} +2 -6
  73. package/dist/components/primitives/index.d.ts +28 -0
  74. package/dist/components/{number-input.d.ts → primitives/number-input.d.ts} +0 -2
  75. package/dist/components/{session-indicator.d.ts → primitives/session-indicator.d.ts} +2 -1
  76. package/dist/components/{tooltip.d.ts → primitives/tooltip.d.ts} +0 -1
  77. package/dist/components/rich-text/prompt-input/commands.d.ts +0 -17
  78. package/dist/components/rich-text/prompt-input/events.d.ts +0 -13
  79. package/dist/components/rich-text/prompt-input/plugins/CommentPlugin/nodes/CommentNode/CommentNode.d.ts +1 -2
  80. package/dist/components/rich-text/prompt-input/plugins/ReferencePlugin/nodes/ReferenceNode/ReferenceNode.d.ts +1 -2
  81. package/dist/components/rich-text/prompt-input/utils.d.ts +1 -2
  82. package/dist/components/rich-text/shared/plugins/MermaidPlugin/MermaidNode.d.ts +0 -1
  83. package/dist/components/rich-text/utils/inferResourceType.d.ts +1 -1
  84. package/dist/components/sidebar/sidebar.types.d.ts +1 -1
  85. package/dist/components/tab-strip/tab-visibility-filter.d.ts +5 -3
  86. package/dist/components/tag-editor/tag-editor-row.d.ts +1 -1
  87. package/dist/components/tag-editor/tag-editor.types.d.ts +1 -1
  88. package/dist/components/terminal/bind-session.d.ts +33 -0
  89. package/dist/components/terminal/index.d.ts +6 -0
  90. package/dist/components/terminal/scripted-bridge.d.ts +35 -0
  91. package/dist/components/terminal/terminal-contract.d.ts +22 -0
  92. package/dist/components/terminal/terminal-theme.d.ts +12 -0
  93. package/dist/components/terminal/terminal.d.ts +45 -0
  94. package/dist/components/terminal/types.d.ts +35 -0
  95. package/dist/components/terminal/use-terminal-session.d.ts +21 -0
  96. package/dist/components/tree-list/tree-list-order-filter.d.ts +1 -2
  97. package/dist/components/tree-list/tree-list-visibility-filter.d.ts +12 -4
  98. package/dist/components/tree-list/tree-list.d.ts +1 -1
  99. package/dist/components/tree-list/tree-list.types.d.ts +7 -2
  100. package/dist/data-renderer.js +1669 -0
  101. package/dist/data-renderer.js.map +1 -0
  102. package/dist/diff-editor-BnfV8cYB.js +182 -0
  103. package/dist/diff-editor-BnfV8cYB.js.map +1 -0
  104. package/dist/diff.js +1313 -0
  105. package/dist/diff.js.map +1 -0
  106. package/dist/empty-state-Bo4HVrgr.js +34 -0
  107. package/dist/empty-state-Bo4HVrgr.js.map +1 -0
  108. package/dist/foundations/gallery/gallery-frame.d.ts +21 -0
  109. package/dist/foundations/gallery/sections/badges-section.d.ts +1 -0
  110. package/dist/foundations/gallery/sections/buttons-section.d.ts +1 -0
  111. package/dist/foundations/gallery/sections/composite-chat-section.d.ts +1 -0
  112. package/dist/foundations/gallery/sections/composites-section.d.ts +1 -0
  113. package/dist/foundations/gallery/sections/feedback-section.d.ts +1 -0
  114. package/dist/foundations/gallery/sections/input-authoring-card.d.ts +1 -0
  115. package/dist/foundations/gallery/sections/inputs-section.d.ts +1 -0
  116. package/dist/foundations/gallery/sections/layout-section.d.ts +1 -0
  117. package/dist/foundations/gallery/sections/navigation-identity-section.d.ts +1 -0
  118. package/dist/foundations/gallery/sections/overlays-section.d.ts +1 -0
  119. package/dist/foundations/gallery/sections/panels-section.d.ts +1 -0
  120. package/dist/foundations/gallery/sections/param-editor-composite-card.d.ts +1 -0
  121. package/dist/foundations/gallery/sections/settings-composite-cards.d.ts +1 -0
  122. package/dist/index.d.ts +15 -84
  123. package/dist/index.js +3594 -7450
  124. package/dist/index.js.map +1 -1
  125. package/dist/list-row-mi3Hn-Um.js +740 -0
  126. package/dist/list-row-mi3Hn-Um.js.map +1 -0
  127. package/dist/mermaid-renderer-DZo3qj6D.js +425 -0
  128. package/dist/mermaid-renderer-DZo3qj6D.js.map +1 -0
  129. package/dist/mermaid.js +5 -0
  130. package/dist/mermaid.js.map +1 -0
  131. package/dist/radio-cLMEBBZk.js +76 -0
  132. package/dist/radio-cLMEBBZk.js.map +1 -0
  133. package/dist/resource-badge-qCWHP-wQ.js +99 -0
  134. package/dist/resource-badge-qCWHP-wQ.js.map +1 -0
  135. package/dist/{rich-message-BFtvH9H7.js → rich-message-DBf_5YlW.js} +462 -481
  136. package/dist/rich-message-DBf_5YlW.js.map +1 -0
  137. package/dist/rich-text.js +397 -390
  138. package/dist/rich-text.js.map +1 -1
  139. package/dist/scroll-area-BMbg1WcD.js +91 -0
  140. package/dist/scroll-area-BMbg1WcD.js.map +1 -0
  141. package/dist/style.css +1 -1
  142. package/dist/terminal.js +339 -0
  143. package/dist/terminal.js.map +1 -0
  144. package/dist/theme/global.d.ts +3 -0
  145. package/dist/theme/recipes/badge.d.ts +50 -0
  146. package/dist/theme/recipes/button.d.ts +24 -19
  147. package/dist/theme/recipes/color-picker.d.ts +1 -0
  148. package/dist/theme/recipes/dialog.d.ts +1 -1
  149. package/dist/theme/recipes/drawer.d.ts +1 -1
  150. package/dist/theme/recipes/input.d.ts +55 -0
  151. package/dist/theme/recipes/number-input.d.ts +98 -0
  152. package/dist/theme/recipes/tabs.d.ts +49 -28
  153. package/dist/theme/recipes/textarea.d.ts +62 -1
  154. package/dist/theme/recipes/timeline.d.ts +74 -0
  155. package/dist/theme/shadowless-default-config.d.ts +2 -0
  156. package/dist/theme/tokens/borders.d.ts +0 -3
  157. package/dist/theme/tokens/colors.d.ts +100 -70
  158. package/dist/{theme-C5qHTCU9.js → theme-CJBYBJaA.js} +1264 -415
  159. package/dist/theme-CJBYBJaA.js.map +1 -0
  160. package/dist/theme-preference-DOzHx64J.js +123 -0
  161. package/dist/theme-preference-DOzHx64J.js.map +1 -0
  162. package/dist/theme.js +1 -1
  163. package/dist/tree-list-CcuZMLS5.js +930 -0
  164. package/dist/tree-list-CcuZMLS5.js.map +1 -0
  165. package/dist/workspace-badge-Fuo-1zPj.js +314 -0
  166. package/dist/workspace-badge-Fuo-1zPj.js.map +1 -0
  167. package/package.json +23 -3
  168. package/dist/components/file-tree-helpers.d.ts +0 -8
  169. package/dist/components/open-source-notices-screen.d.ts +0 -20
  170. package/dist/components/param-editor/input-group.d.ts +0 -10
  171. package/dist/components/rich-text/shared/plugins/MermaidPlugin/index.d.ts +0 -1
  172. package/dist/components/rich-text/shared/plugins/TableActionMenuPlugin/TableActionMenuPlugin.d.ts +0 -5
  173. package/dist/components/rich-text/shared/plugins/TableCellResizerPlugin/TableCellResizerPlugin.d.ts +0 -2
  174. package/dist/components/rich-text/theme/report-theme.d.ts +0 -3
  175. package/dist/components/sidebar/sidebar-project-menu.d.ts +0 -7
  176. package/dist/components/style-guide-data.d.ts +0 -46
  177. package/dist/components/style-guide.d.ts +0 -1
  178. package/dist/mermaid-renderer-DYEiYmYQ.js +0 -411
  179. package/dist/mermaid-renderer-DYEiYmYQ.js.map +0 -1
  180. package/dist/radio-DJtQY9po.js +0 -286
  181. package/dist/radio-DJtQY9po.js.map +0 -1
  182. package/dist/resource-badge-D33IFv74.js +0 -188
  183. package/dist/resource-badge-D33IFv74.js.map +0 -1
  184. package/dist/rich-message-BFtvH9H7.js.map +0 -1
  185. package/dist/theme/tokens/shadows.d.ts +0 -64
  186. package/dist/theme-C5qHTCU9.js.map +0 -1
  187. package/dist/utils/formats.d.ts +0 -7
  188. /package/dist/components/{palette-filter.d.ts → command-palette/palette-filter.d.ts} +0 -0
  189. /package/dist/components/{palette-list.d.ts → command-palette/palette-list.d.ts} +0 -0
  190. /package/dist/components/{palette-shortcut.d.ts → command-palette/palette-shortcut.d.ts} +0 -0
  191. /package/dist/components/{palette.d.ts → command-palette/palette.d.ts} +0 -0
  192. /package/dist/components/{code-editor.d.ts → diff-viewer/code-editor.d.ts} +0 -0
  193. /package/dist/components/{column-file-browser.d.ts → file-browser/column-file-browser.d.ts} +0 -0
  194. /package/dist/components/{performance-panel.d.ts → internal/performance-panel.d.ts} +0 -0
  195. /package/dist/components/{header.d.ts → layout/header.d.ts} +0 -0
  196. /package/dist/components/{horizontal-menu-stack.d.ts → layout/horizontal-menu-stack.d.ts} +0 -0
  197. /package/dist/components/{item-section.d.ts → layout/item-section.d.ts} +0 -0
  198. /package/dist/components/{panel-header.constants.d.ts → layout/panel-header.constants.d.ts} +0 -0
  199. /package/dist/components/{resizable-split-layout.d.ts → layout/resizable-split-layout.d.ts} +0 -0
  200. /package/dist/components/{resizable-split-layout.handle.d.ts → layout/resizable-split-layout.handle.d.ts} +0 -0
  201. /package/dist/components/{attached-panel.d.ts → overlays/attached-panel.d.ts} +0 -0
  202. /package/dist/components/{bubble-panel.d.ts → overlays/bubble-panel.d.ts} +0 -0
  203. /package/dist/components/{delete-confirmation-modal.d.ts → overlays/delete-confirmation-modal.d.ts} +0 -0
  204. /package/dist/components/{repo-picker-dialog.d.ts → overlays/repo-picker-dialog.d.ts} +0 -0
  205. /package/dist/components/{resource-context-menu.d.ts → overlays/resource-context-menu.d.ts} +0 -0
  206. /package/dist/components/param-editor/{color-input.d.ts → inputs/color-input.d.ts} +0 -0
  207. /package/dist/components/param-editor/{date-input.d.ts → inputs/date-input.d.ts} +0 -0
  208. /package/dist/components/param-editor/{horizontal-text-input.d.ts → inputs/horizontal-text-input.d.ts} +0 -0
  209. /package/dist/components/param-editor/{number-input.d.ts → inputs/number-input.d.ts} +0 -0
  210. /package/dist/components/param-editor/{selection-input.d.ts → inputs/selection-input.d.ts} +0 -0
  211. /package/dist/components/param-editor/{text-input.d.ts → inputs/text-input.d.ts} +0 -0
  212. /package/dist/components/{alert.d.ts → primitives/alert.d.ts} +0 -0
  213. /package/dist/components/{checkbox.d.ts → primitives/checkbox.d.ts} +0 -0
  214. /package/dist/components/{content-placeholder.d.ts → primitives/content-placeholder.d.ts} +0 -0
  215. /package/dist/components/{empty-state.d.ts → primitives/empty-state.d.ts} +0 -0
  216. /package/dist/components/{error-boundary.d.ts → primitives/error-boundary.d.ts} +0 -0
  217. /package/dist/components/{info-card.d.ts → primitives/info-card.d.ts} +0 -0
  218. /package/dist/components/{integration-card.d.ts → primitives/integration-card.d.ts} +0 -0
  219. /package/dist/components/{radio.d.ts → primitives/radio.d.ts} +0 -0
  220. /package/dist/components/{resource-badge.d.ts → primitives/resource-badge.d.ts} +0 -0
  221. /package/dist/components/{scroll-area.d.ts → primitives/scroll-area.d.ts} +0 -0
  222. /package/dist/components/{simple-card.d.ts → primitives/simple-card.d.ts} +0 -0
  223. /package/dist/components/{slider.d.ts → primitives/slider.d.ts} +0 -0
  224. /package/dist/components/{switch.d.ts → primitives/switch.d.ts} +0 -0
  225. /package/dist/components/{toaster.d.ts → primitives/toaster.d.ts} +0 -0
  226. /package/dist/components/{workspace-badge.d.ts → primitives/workspace-badge.d.ts} +0 -0
@@ -19,5 +19,4 @@ export declare class MermaidNode extends DecoratorNode<ReactNode> {
19
19
  setCode(code: string): void;
20
20
  decorate(): import("react/jsx-runtime").JSX.Element;
21
21
  }
22
- export declare function $createMermaidNode(code?: string): MermaidNode;
23
22
  export declare function $isMermaidNode(node: LexicalNode | null | undefined): node is MermaidNode;
@@ -1 +1 @@
1
- export declare function inferResourceTypeFromMediaType(mediaType: string): "text" | "table" | "image" | "json" | "markdown" | "pdf";
1
+ export declare function inferResourceTypeFromMediaType(mediaType: string): "text" | "table" | "image" | "json" | "pdf" | "markdown";
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { ResourceContextAction } from '../resource-context-menu';
2
+ import { ResourceContextAction } from '../overlays/resource-context-menu';
3
3
  import { TreeListLinkComponent, TreeListNavigateEvent, TreeListSection } from '../tree-list/tree-list.types';
4
4
  export interface SidebarProps {
5
5
  storageKey: string;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { ResourceContextAction } from '../resource-context-menu';
2
+ import { ResourceContextAction } from '../overlays/resource-context-menu';
3
3
  import { VisibilityOverride } from '../tree-list/tree-list-visibility.store';
4
4
  export interface TabVisibilityPlacement {
5
5
  closable?: boolean;
@@ -13,7 +13,9 @@ export interface TabVisibilityMenuActions {
13
13
  onResetAll: () => void;
14
14
  }
15
15
  interface BuildTabMenuOptions {
16
- checkmark: ReactNode;
16
+ visibleIcon: ReactNode;
17
+ hiddenIcon: ReactNode;
18
+ resetIcon?: ReactNode;
17
19
  }
18
- export declare const buildTabVisibilityMenuActions: <T extends TabVisibilityPlacement>(placements: T[], tabOverrides: Record<string, VisibilityOverride>, actions: TabVisibilityMenuActions, getKey: (placement: T) => string, options: BuildTabMenuOptions) => ResourceContextAction[];
20
+ export declare const buildTabVisibilityMenuActions: <T extends TabVisibilityPlacement>(placements: T[], tabOverrides: Record<string, VisibilityOverride>, actions: TabVisibilityMenuActions, getKey: (placement: T) => string, options: BuildTabMenuOptions, getIcon?: (placement: T) => ReactNode) => ResourceContextAction[];
19
21
  export {};
@@ -1,4 +1,4 @@
1
- import { IconColorPickerIconOption } from '../icon-color-picker';
1
+ import { IconColorPickerIconOption } from '../primitives/icon-color-picker';
2
2
  import { TagEditorAction, TagEditorValue } from './tag-editor.types';
3
3
  interface TagEditorRowProps {
4
4
  actionOptions?: TagEditorAction[];
@@ -1,4 +1,4 @@
1
- import { IconColorPickerIconOption } from '../icon-color-picker';
1
+ import { IconColorPickerIconOption } from '../primitives/icon-color-picker';
2
2
  export interface TagEditorValue {
3
3
  id: string;
4
4
  name: string;
@@ -0,0 +1,33 @@
1
+ import { TerminalSessionAdapter } from './types';
2
+ /**
3
+ * Minimal subset of xterm.js that the binding needs. Tests substitute a fake
4
+ * sink so the wire-up logic can be exercised without a DOM.
5
+ */
6
+ export interface TerminalSink {
7
+ write(data: string | Uint8Array): void;
8
+ onInput(handler: (data: string) => void): () => void;
9
+ onResize(handler: (size: {
10
+ cols: number;
11
+ rows: number;
12
+ }) => void): () => void;
13
+ }
14
+ export interface BindSessionOptions {
15
+ /** Forwarded to the session when the user types in the sink. */
16
+ onInput?: (data: string) => void;
17
+ /** Called once the session exits; useful for surfacing status. */
18
+ onExit?: (exit: {
19
+ code: number | null;
20
+ signal: string | null;
21
+ }) => void;
22
+ /** Called on transport errors. */
23
+ onError?: (error: {
24
+ message: string;
25
+ }) => void;
26
+ }
27
+ /**
28
+ * Wires a {@link TerminalSink} (typically xterm.js) to a
29
+ * {@link TerminalSessionAdapter}. Returns a disposer that detaches every
30
+ * subscription it created. The session itself is *not* killed — owning the
31
+ * session lifecycle is the caller's responsibility.
32
+ */
33
+ export declare const bindSessionToSink: (sink: TerminalSink, session: TerminalSessionAdapter, options?: BindSessionOptions) => () => void;
@@ -0,0 +1,6 @@
1
+ export { type BindSessionOptions, bindSessionToSink, type TerminalSink } from './bind-session';
2
+ export { createScriptedTerminalBridge, type ScriptedBridgeOptions, type ScriptedTerminalStep, } from './scripted-bridge';
3
+ export { Terminal, type TerminalProps } from './terminal';
4
+ export { darkTerminalTheme, lightTerminalTheme, resolveTerminalTheme, type TerminalThemeName, terminalThemes, } from './terminal-theme';
5
+ export type { TerminalBridge, TerminalSessionAdapter, TerminalSessionError, TerminalSessionExit, TerminalSessionRequest, } from './types';
6
+ export { type TerminalSessionStatus, type UseTerminalSessionOptions, type UseTerminalSessionResult, useTerminalSession, } from './use-terminal-session';
@@ -0,0 +1,35 @@
1
+ import { TerminalBridge } from './types';
2
+ export interface ScriptedTerminalStep {
3
+ /** Bytes the host pushes back to the renderer (utf-8 string is encoded for you). */
4
+ data?: string | Uint8Array;
5
+ /** Milliseconds to wait before delivering this step. */
6
+ delayMs?: number;
7
+ /** Marks the session as exited after this step. */
8
+ exit?: {
9
+ code: number | null;
10
+ signal?: string | null;
11
+ };
12
+ /** Delivers a transport error after this step. */
13
+ error?: string;
14
+ }
15
+ export interface ScriptedBridgeOptions {
16
+ /** Initial script delivered after the first data subscriber attaches. */
17
+ initial?: ScriptedTerminalStep[];
18
+ /**
19
+ * Responds to user input. Return additional steps to play, or `undefined`
20
+ * to ignore. Defaults to echoing the input followed by a newline.
21
+ */
22
+ onInput?: (input: string) => ScriptedTerminalStep[] | undefined;
23
+ /** Called whenever the renderer requests a resize. */
24
+ onResize?: (size: {
25
+ cols: number;
26
+ rows: number;
27
+ }) => void;
28
+ /** Called once when the renderer kills the session. */
29
+ onKill?: (signal?: string) => void;
30
+ }
31
+ /**
32
+ * Deterministic in-memory bridge. Used by stories and tests to exercise the
33
+ * terminal UI without a real PTY supervisor.
34
+ */
35
+ export declare const createScriptedTerminalBridge: (options?: ScriptedBridgeOptions) => TerminalBridge;
@@ -0,0 +1,22 @@
1
+ export interface TerminalSessionRequest {
2
+ /** Command + args to run; defaults to the user's login shell when omitted. */
3
+ command?: string[];
4
+ /** Working directory; falls back to the extension's workspace root. */
5
+ cwd?: string;
6
+ /** Extra env vars merged over the inherited environment. */
7
+ env?: Record<string, string>;
8
+ /** Initial column count; the renderer can resize later. */
9
+ cols: number;
10
+ /** Initial row count; the renderer can resize later. */
11
+ rows: number;
12
+ }
13
+ export type TerminalHostEvent = {
14
+ sessionId: string;
15
+ kind: "data";
16
+ chunk: Uint8Array;
17
+ } | {
18
+ sessionId: string;
19
+ kind: "exit";
20
+ code: number | null;
21
+ signal: string | null;
22
+ };
@@ -0,0 +1,12 @@
1
+ import { ITheme } from '@xterm/xterm';
2
+ /**
3
+ * xterm theme presets aligned with the workbench `bg.inverted` / `fg.inverted`
4
+ * pairings so the terminal blends with the surrounding chrome without the
5
+ * consuming extension touching xterm directly. Consumers can still pass any
6
+ * `ITheme` they like via the `theme` prop.
7
+ */
8
+ export type TerminalThemeName = "light" | "dark";
9
+ export declare const lightTerminalTheme: ITheme;
10
+ export declare const darkTerminalTheme: ITheme;
11
+ export declare const terminalThemes: Record<TerminalThemeName, ITheme>;
12
+ export declare const resolveTerminalTheme: (theme: TerminalThemeName | ITheme | undefined) => ITheme;
@@ -0,0 +1,45 @@
1
+ import { ITheme, Terminal as Xterm } from '@xterm/xterm';
2
+ import { TerminalSink } from './bind-session';
3
+ import { TerminalThemeName } from './terminal-theme';
4
+ import { TerminalBridge, TerminalSessionAdapter, TerminalSessionRequest } from './types';
5
+ export declare const createInitialTerminalSessionRequest: (request?: Partial<TerminalSessionRequest>) => TerminalSessionRequest;
6
+ export declare const resizeSessionToTerminalGeometry: (terminal: Pick<Xterm, "cols" | "rows">, session: Pick<TerminalSessionAdapter, "resize">) => void;
7
+ export declare const bindTerminalSession: (terminal: Pick<Xterm, "cols" | "rows">, sink: TerminalSink, session: TerminalSessionAdapter, options: Pick<TerminalProps, "onSessionOpen" | "onSessionExit">) => () => void;
8
+ export interface TerminalSessionCallbackRefs {
9
+ onSessionOpen: React.RefObject<TerminalProps["onSessionOpen"]>;
10
+ onSessionExit: React.RefObject<TerminalProps["onSessionExit"]>;
11
+ }
12
+ export declare const bindTerminalSessionWithCallbackRefs: (terminal: Pick<Xterm, "cols" | "rows">, sink: TerminalSink, session: TerminalSessionAdapter, callbackRefs: TerminalSessionCallbackRefs) => () => void;
13
+ export interface TerminalProps {
14
+ /** Bridge adapter the component opens its session through. */
15
+ bridge: TerminalBridge;
16
+ /**
17
+ * Optional initial session request overrides. `cols`/`rows` default to
18
+ * 80x24; container resizes are forwarded after the session opens.
19
+ */
20
+ request?: Partial<TerminalSessionRequest>;
21
+ /** Theme preset name or full xterm theme. */
22
+ theme?: TerminalThemeName | ITheme;
23
+ /** Monospace font family. */
24
+ fontFamily?: string;
25
+ fontSize?: number;
26
+ /** Whether to kill the session when the component unmounts. Defaults to true. */
27
+ killOnUnmount?: boolean;
28
+ /** Forwarded to the container element. */
29
+ className?: string;
30
+ style?: React.CSSProperties;
31
+ /** Called once the session is open; useful for imperative refs. */
32
+ onSessionOpen?: (sessionId: string) => void;
33
+ /** Called once the session exits. */
34
+ onSessionExit?: (exit: {
35
+ code: number | null;
36
+ signal: string | null;
37
+ }) => void;
38
+ }
39
+ /**
40
+ * High-level terminal component. Mounts xterm.js inside a `<div>` and binds it
41
+ * to the session opened from `bridge.openSession(...)`. Resize is driven by
42
+ * `ResizeObserver` so the terminal fills its container and the host PTY
43
+ * geometry stays in sync.
44
+ */
45
+ export declare const Terminal: (props: TerminalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { TerminalHostEvent, TerminalSessionRequest } from './terminal-contract';
2
+ export type { TerminalSessionRequest } from './terminal-contract';
3
+ /**
4
+ * Renderer-side projection of a single terminal session over the
5
+ * `terminal.session` bridge.
6
+ *
7
+ * The host-side `TerminalSessionHandle` exposes a single-consumer async
8
+ * iterable; that contract is impractical inside React, so the renderer side
9
+ * uses observable subscriptions instead. Implementations (real bridge,
10
+ * scripted stub, etc.) are responsible for translating their own transport
11
+ * into these callbacks.
12
+ */
13
+ export interface TerminalSessionAdapter {
14
+ readonly id: string;
15
+ write(data: string | Uint8Array): void;
16
+ resize(cols: number, rows: number): void;
17
+ kill(signal?: string): Promise<void> | void;
18
+ onData(handler: (chunk: Uint8Array) => void): () => void;
19
+ onExit(handler: (exit: TerminalSessionExit) => void): () => void;
20
+ onError(handler: (error: TerminalSessionError) => void): () => void;
21
+ }
22
+ export type TerminalSessionExit = Omit<Extract<TerminalHostEvent, {
23
+ kind: "exit";
24
+ }>, "kind" | "sessionId">;
25
+ export interface TerminalSessionError {
26
+ message: string;
27
+ }
28
+ /**
29
+ * Renderer-side projection of the `terminal.session` capability. A bridge
30
+ * adapter typically wraps the webview transport, but stubs that drive
31
+ * scripted output (storybook, tests) implement the same shape.
32
+ */
33
+ export interface TerminalBridge {
34
+ openSession(request: TerminalSessionRequest): Promise<TerminalSessionAdapter>;
35
+ }
@@ -0,0 +1,21 @@
1
+ import { TerminalBridge, TerminalSessionAdapter, TerminalSessionError, TerminalSessionExit, TerminalSessionRequest } from './types';
2
+ export type TerminalSessionStatus = "idle" | "opening" | "open" | "exited" | "error";
3
+ export interface UseTerminalSessionResult {
4
+ session: TerminalSessionAdapter | null;
5
+ status: TerminalSessionStatus;
6
+ exit: TerminalSessionExit | null;
7
+ error: TerminalSessionError | null;
8
+ }
9
+ export interface UseTerminalSessionOptions {
10
+ bridge: TerminalBridge | null;
11
+ request: TerminalSessionRequest;
12
+ /** Set to false to keep the session alive when the hook unmounts. */
13
+ killOnUnmount?: boolean;
14
+ }
15
+ export declare const createTerminalSessionRequestKey: (request: TerminalSessionRequest) => string;
16
+ /**
17
+ * Opens a terminal session via the provided bridge and surfaces its lifecycle
18
+ * for the renderer. The session is killed on unmount unless explicitly opted
19
+ * out; switching bridges or request contents triggers a fresh open.
20
+ */
21
+ export declare const useTerminalSession: ({ bridge, request, killOnUnmount }: UseTerminalSessionOptions) => UseTerminalSessionResult;
@@ -1,3 +1,2 @@
1
- import { TreeListNode, TreeListSection } from './tree-list.types';
1
+ import { TreeListSection } from './tree-list.types';
2
2
  export declare const applyTreeListOrder: (sections: TreeListSection[], sectionOrder: string[], nodeOrderBySection: Record<string, string[]>) => TreeListSection[];
3
- export declare const reorderNodesById: (nodes: TreeListNode[], order: string[]) => TreeListNode[];
@@ -1,8 +1,9 @@
1
1
  import { ReactNode } from 'react';
2
- import { ResourceContextAction } from '../resource-context-menu';
3
- import { TreeListSection } from './tree-list.types';
2
+ import { ResourceContextAction } from '../overlays/resource-context-menu';
3
+ import { TreeListNode, TreeListSection } from './tree-list.types';
4
4
  import { VisibilityOverride } from './tree-list-visibility.store';
5
5
  export declare const resolveVisibility: (override: VisibilityOverride | undefined, hiddenByDefault: boolean | undefined) => VisibilityOverride;
6
+ export declare const filterVisibleNodes: (nodes: TreeListNode[], nodeOverrides: Record<string, VisibilityOverride>) => TreeListNode[];
6
7
  export declare const filterVisibleSections: (sections: TreeListSection[], sectionOverrides: Record<string, VisibilityOverride>, nodeOverrides: Record<string, VisibilityOverride>) => TreeListSection[];
7
8
  export interface TreeVisibilityMenuActions {
8
9
  onToggleSection: (id: string, hiddenByDefault: boolean) => void;
@@ -11,7 +12,14 @@ export interface TreeVisibilityMenuActions {
11
12
  onResetOrder?: () => void;
12
13
  }
13
14
  interface BuildMenuOptions {
14
- checkmark: ReactNode;
15
+ visibleIcon: ReactNode;
16
+ hiddenIcon: ReactNode;
17
+ resetIcon?: ReactNode;
15
18
  }
16
- export declare const buildTreeVisibilityMenuActions: (sections: TreeListSection[], sectionOverrides: Record<string, VisibilityOverride>, nodeOverrides: Record<string, VisibilityOverride>, actions: TreeVisibilityMenuActions, options: BuildMenuOptions) => ResourceContextAction[];
19
+ export interface TreeVisibilityMenuItems {
20
+ headerNodes?: TreeListNode[];
21
+ sections: TreeListSection[];
22
+ footerNodes?: TreeListNode[];
23
+ }
24
+ export declare const buildTreeVisibilityMenuActions: (items: TreeVisibilityMenuItems, sectionOverrides: Record<string, VisibilityOverride>, nodeOverrides: Record<string, VisibilityOverride>, actions: TreeVisibilityMenuActions, options: BuildMenuOptions) => ResourceContextAction[];
17
25
  export {};
@@ -1,6 +1,6 @@
1
1
  import { StackProps } from '@chakra-ui/react';
2
2
  import { MouseEvent as ReactMouseEvent, RefObject } from 'react';
3
- import { ResourceContextAction } from '../resource-context-menu';
3
+ import { ResourceContextAction } from '../overlays/resource-context-menu';
4
4
  import { TreeListLinkComponent, TreeListNavigateEvent, TreeListSection } from './tree-list.types';
5
5
  export { buildVirtualRows } from './tree-list-model';
6
6
  type TreeListRowVariant = "compact" | "tree";
@@ -1,15 +1,18 @@
1
1
  import { ComponentType, ReactNode } from 'react';
2
- import { ListRowAction, ListRowActionContext, ListRowActionMenuItem, ListRowItem, ListRowNavigationIntent } from '../list-row/list-row.types';
2
+ import { ListRowAction, ListRowActionContext, ListRowActionMenuItem, ListRowItem, ListRowNavigationIntent, ListRowVariant } from '../list-row/list-row.types';
3
3
  export type TreeListNavigationIntent = ListRowNavigationIntent;
4
4
  export type TreeListActionContext = ListRowActionContext;
5
5
  export type TreeListActionMenuItem = ListRowActionMenuItem;
6
6
  export type TreeListAction = ListRowAction;
7
+ export type TreeListNodeRowVariant = Extract<ListRowVariant, "empty-state">;
7
8
  /** Tree node data rendered by `TreeList`; extends the row API used by `ListRow`. */
8
9
  export type TreeListNode = ListRowItem & {
9
10
  id: string;
10
11
  children?: TreeListNode[];
12
+ /** Per-node visual row variant. Used for non-interactive placeholder rows. */
13
+ rowVariant?: TreeListNodeRowVariant;
11
14
  hiddenByDefault?: boolean;
12
- /** When false, the node cannot be hidden from a tree-customization menu (rendered as a disabled, checked row). */
15
+ /** Opt in to the tree-customization (hide/show) menu. Items are non-hideable unless this is true. */
13
16
  canHide?: boolean;
14
17
  };
15
18
  /** Top-level tree section with optional header, actions, empty state, and child nodes. */
@@ -21,6 +24,8 @@ export interface TreeListSection {
21
24
  emptyState?: ReactNode;
22
25
  nodes: TreeListNode[];
23
26
  hiddenByDefault?: boolean;
27
+ /** Opt in to the tree-customization (hide/show) menu. Sections are non-hideable unless this is true. */
28
+ canHide?: boolean;
24
29
  }
25
30
  /** Navigation payload emitted when a navigable tree node is activated. */
26
31
  export interface TreeListNavigateEvent {