@hachej/boring-workspace 0.1.62 → 0.1.64

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.
@@ -226,6 +226,7 @@ export declare interface BridgeEventMap {
226
226
  "file:opened": {
227
227
  path: string;
228
228
  mode: "view" | "edit" | "diff";
229
+ filesystem?: FilesystemId;
229
230
  };
230
231
  "file:saved": {
231
232
  path: string;
@@ -389,6 +390,8 @@ export declare interface ChatLayoutProps {
389
390
  center?: string;
390
391
  centerParams?: Record<string, unknown>;
391
392
  chatPanes?: ChatPaneDescriptor[];
393
+ /** Optional host actions rendered in the active chat pane header. */
394
+ chatTopActions?: ReactNode;
392
395
  activeChatPaneId?: string | null;
393
396
  onActiveChatPaneChange?: (id: string) => void;
394
397
  onCloseChatPane?: (id: string) => void;
@@ -435,6 +438,7 @@ export declare function CodeEditorPane({ params, api, className }: CodeEditorPan
435
438
 
436
439
  export declare type CodeEditorPaneProps = PaneProps<{
437
440
  path?: string;
441
+ filesystem?: FilesystemId;
438
442
  mode?: "view" | "edit" | "diff";
439
443
  }>;
440
444
 
@@ -731,8 +735,8 @@ declare class FetchClient {
731
735
  private retryBaseMs;
732
736
  constructor(opts: FetchClientOptions);
733
737
  private request;
734
- getTree(path: string, signal?: AbortSignal): Promise<FileEntry[]>;
735
- getFile(path: string, signal?: AbortSignal): Promise<FileContent>;
738
+ getTree(path: string, signal?: AbortSignal, filesystem?: string): Promise<FileEntry[]>;
739
+ getFile(path: string, signal?: AbortSignal, filesystem?: string): Promise<FileContent>;
736
740
  /**
737
741
  * Write file content. When `expectedMtimeMs` is supplied, the server
738
742
  * runs an optimistic-concurrency check and returns 409 if the file
@@ -748,15 +752,22 @@ declare class FetchClient {
748
752
  writeFile(path: string, content: string, opts?: {
749
753
  expectedMtimeMs?: number;
750
754
  returnMtimeMs?: boolean;
755
+ filesystem?: string;
751
756
  }): Promise<{
752
757
  mtimeMs?: number;
753
758
  }>;
754
- deleteFile(path: string): Promise<void>;
755
- stat(path: string, signal?: AbortSignal): Promise<FileStat>;
759
+ deleteFile(path: string, options?: {
760
+ filesystem?: string;
761
+ }): Promise<void>;
762
+ stat(path: string, signal?: AbortSignal, filesystem?: string): Promise<FileStat>;
756
763
  getGitUrlMetadata(path: string, signal?: AbortSignal): Promise<GitUrlMetadata>;
757
764
  search(query: string, limit?: number, signal?: AbortSignal): Promise<string[]>;
758
- createDir(path: string): Promise<void>;
759
- moveFile(from: string, to: string): Promise<void>;
765
+ createDir(path: string, options?: {
766
+ filesystem?: string;
767
+ }): Promise<void>;
768
+ moveFile(from: string, to: string, options?: {
769
+ filesystem?: string;
770
+ }): Promise<void>;
760
771
  }
761
772
 
762
773
  declare interface FetchClientOptions {
@@ -791,6 +802,8 @@ declare class FileConflictError extends Error {
791
802
 
792
803
  declare interface FileContent {
793
804
  content: string;
805
+ /** Access granted by the resolved filesystem binding, when the server exposes it. */
806
+ access?: "readonly" | "readwrite";
794
807
  /**
795
808
  * Server-stat'd modification time. Used as the OCC baseline for the
796
809
  * next write — the client sends it back as `expectedMtimeMs` so the
@@ -873,6 +886,7 @@ export declare type FilesystemEventMeta = ({
873
886
  toolCallId?: string;
874
887
  }) & {
875
888
  ts: number;
889
+ filesystem?: FilesystemId;
876
890
  };
877
891
 
878
892
  export declare const filesystemEvents: {
@@ -882,6 +896,8 @@ export declare const filesystemEvents: {
882
896
  readonly deleted: "filesystem:file.deleted";
883
897
  };
884
898
 
899
+ declare type FilesystemId = "user" | "company_context" | (string & {});
900
+
885
901
  export declare const filesystemPlugin: BoringFrontFactoryWithId;
886
902
 
887
903
  export declare function FileTree({ files, selectedPath, searchQuery, height, editing, revealPath, pendingPaths, onSelect, onExpand, onCollapse, onContextMenu, onSubmitEdit, onCancelEdit, onRevealHandled, onDragDrop, className, }: FileTreeProps): JSX.Element;
@@ -922,7 +938,7 @@ export declare interface FileTreeNode {
922
938
  * `<FileTreeView>`. Drop into a dockview registry as-is, or compose
923
939
  * `FileTreeView` directly when you want different chrome/search UX.
924
940
  */
925
- export declare function FileTreePane({ params, rootDir, searchQuery: controlledSearchQuery, panelApi, bridge, api, chromeless, className, }: FileTreePaneProps): JSX.Element;
941
+ export declare function FileTreePane({ params, rootDir, searchQuery: controlledSearchQuery, panelApi, bridge, api, chromeless, filesystem, access, roots, className, }: FileTreePaneProps): JSX.Element;
926
942
 
927
943
  declare interface FileTreePaneParams extends LeftTabParams {
928
944
  rootDir?: string;
@@ -930,6 +946,9 @@ declare interface FileTreePaneParams extends LeftTabParams {
930
946
  query?: string;
931
947
  bridge?: unknown;
932
948
  chromeless?: boolean;
949
+ filesystem?: FilesystemId;
950
+ access?: "readonly" | "readwrite";
951
+ roots?: FileTreeRootConfig[];
933
952
  revealFileTreeRequest?: {
934
953
  path: string;
935
954
  seq: number;
@@ -942,6 +961,9 @@ export declare interface FileTreePaneProps extends Partial<PaneProps<FileTreePan
942
961
  panelApi?: DockviewPanelApi;
943
962
  bridge?: FileTreeBridge;
944
963
  chromeless?: boolean;
964
+ filesystem?: FilesystemId;
965
+ access?: "readonly" | "readwrite";
966
+ roots?: FileTreeRootConfig[];
945
967
  className?: string;
946
968
  }
947
969
 
@@ -970,6 +992,14 @@ export declare interface FileTreeProps {
970
992
  className?: string;
971
993
  }
972
994
 
995
+ declare interface FileTreeRootConfig {
996
+ filesystem: FilesystemId;
997
+ label: string;
998
+ rootDir?: string;
999
+ access?: "readonly" | "readwrite";
1000
+ searchPlaceholder?: string;
1001
+ }
1002
+
973
1003
  /**
974
1004
  * File tree with the full workbench actions: tracks container height,
975
1005
  * routes selects through `bridge.openFile`, and provides a right-click
@@ -981,7 +1011,7 @@ export declare interface FileTreeProps {
981
1011
  * want a "Files" panel; `WorkbenchLeftPane` uses this primitive directly to
982
1012
  * share its search input with the Data tab.
983
1013
  */
984
- export declare function FileTreeView({ rootDir, searchQuery, bridge, revealFileTreeRequest, ignoreNames, className, }: FileTreeViewProps): JSX.Element;
1014
+ export declare function FileTreeView({ rootDir, searchQuery, bridge, revealFileTreeRequest, filesystem, access, ignoreNames, className, }: FileTreeViewProps): JSX.Element;
985
1015
 
986
1016
  export declare interface FileTreeViewProps {
987
1017
  rootDir?: string;
@@ -992,6 +1022,8 @@ export declare interface FileTreeViewProps {
992
1022
  path: string;
993
1023
  seq: number;
994
1024
  } | null;
1025
+ filesystem?: FilesystemId;
1026
+ access?: "readonly" | "readwrite";
995
1027
  /**
996
1028
  * Names (or regex patterns) to hide from the tree. Defaults to
997
1029
  * `DEFAULT_TREE_IGNORE` (node_modules, .git, dist, …). Pass `[]` to
@@ -1071,12 +1103,13 @@ export declare interface LeftTabParams {
1071
1103
  } | null;
1072
1104
  }
1073
1105
 
1074
- export declare function MarkdownEditor({ content, onChange, readOnly, placeholder, className, documentPath, }: MarkdownEditorProps): JSX.Element;
1106
+ export declare function MarkdownEditor({ content, onChange, readOnly, placeholder, className, documentPath, filesystem: rawFilesystem, }: MarkdownEditorProps): JSX.Element;
1075
1107
 
1076
1108
  export declare function MarkdownEditorPane({ params, api, className }: MarkdownEditorPaneProps): JSX.Element;
1077
1109
 
1078
1110
  export declare type MarkdownEditorPaneProps = PaneProps<{
1079
1111
  path?: string;
1112
+ filesystem?: FilesystemId;
1080
1113
  mode?: "view" | "edit" | "diff";
1081
1114
  }>;
1082
1115
 
@@ -1088,6 +1121,8 @@ export declare interface MarkdownEditorProps {
1088
1121
  className?: string;
1089
1122
  /** Workspace-relative markdown file path, used to make uploaded image links relative. */
1090
1123
  documentPath?: string;
1124
+ /** Filesystem identity for relative markdown links/assets. Defaults to user. */
1125
+ filesystem?: FilesystemId;
1091
1126
  }
1092
1127
 
1093
1128
  export declare const MAX_PANELS = 50;
@@ -1127,16 +1162,21 @@ export declare function onFilesystemChanged(handler: (payload: FilesystemEventMe
1127
1162
  path: string;
1128
1163
  }) => void): () => void;
1129
1164
 
1130
- export declare type OpenArtifactHandler = (path: string) => void;
1165
+ export declare type OpenArtifactHandler = (path: string, options?: {
1166
+ filesystem?: FilesystemId;
1167
+ }) => void;
1131
1168
 
1132
1169
  export declare const openFileSchema: z.ZodObject<{
1133
1170
  path: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
1134
1171
  mode: z.ZodOptional<z.ZodEnum<["view", "edit", "diff"]>>;
1172
+ filesystem: z.ZodOptional<z.ZodString>;
1135
1173
  }, "strip", z.ZodTypeAny, {
1136
1174
  path: string;
1175
+ filesystem?: string | undefined;
1137
1176
  mode?: "view" | "edit" | "diff" | undefined;
1138
1177
  }, {
1139
1178
  path: string;
1179
+ filesystem?: string | undefined;
1140
1180
  mode?: "view" | "edit" | "diff" | undefined;
1141
1181
  }>;
1142
1182
 
@@ -1518,6 +1558,7 @@ declare type StoreApi_2 = {
1518
1558
  export declare interface SurfaceOpenRequest {
1519
1559
  kind: string;
1520
1560
  target: string;
1561
+ filesystem?: FilesystemId;
1521
1562
  meta?: Record<string, unknown>;
1522
1563
  }
1523
1564
 
@@ -1584,10 +1625,8 @@ export declare interface SurfaceResolverRegistryLike {
1584
1625
  export declare function SurfaceShell({ rootDir, sidebarDefaultWidth, sidebarMinWidth, sidebarMaxWidth, storageKey, onReady, onChange, onClose, showCloseAction, extraPanels, defaultLeftTab, onReloadAgentPlugins, initialPanels, className, }: SurfaceShellProps): JSX.Element;
1585
1626
 
1586
1627
  export declare interface SurfaceShellApi {
1587
- /** Open a file in the workbench. Idempotent — re-activates an existing pane for the same path. */
1588
- openFile: (path: string, opts?: {
1589
- mode?: "view" | "edit" | "diff";
1590
- }) => void;
1628
+ /** Open a file in the workbench. Idempotent — re-activates an existing pane for the same filesystem/path. */
1629
+ openFile: (path: string, options?: SurfaceShellOpenFileOptions) => void;
1591
1630
  /** Open a plugin-defined surface target through the registered surface resolvers. */
1592
1631
  openSurface: (request: SurfaceOpenRequest) => void;
1593
1632
  /**
@@ -1605,6 +1644,11 @@ export declare interface SurfaceShellApi {
1605
1644
  getSnapshot: () => SurfaceShellSnapshot;
1606
1645
  }
1607
1646
 
1647
+ declare interface SurfaceShellOpenFileOptions {
1648
+ filesystem?: FilesystemId;
1649
+ mode?: "view" | "edit" | "diff";
1650
+ }
1651
+
1608
1652
  export declare interface SurfaceShellProps {
1609
1653
  rootDir?: string;
1610
1654
  sidebarDefaultWidth?: number;
@@ -1857,6 +1901,8 @@ export declare function useFilePane(options: UseFilePaneOptions): UseFilePaneRet
1857
1901
  export declare interface UseFilePaneOptions {
1858
1902
  /** The file path to load/edit. If empty/undefined, pane shows "no file selected". */
1859
1903
  path: string;
1904
+ /** Filesystem identity for cache/dirty/stale separation. Defaults to user. */
1905
+ filesystem?: FilesystemId;
1860
1906
  /** Unique panel ID for lifecycle tracking. Omit to use a stable per-pane fallback ID. */
1861
1907
  panelId?: string;
1862
1908
  /** Initial content (optional, for draft/unsaved files). */
@@ -1870,6 +1916,7 @@ export declare interface UseFilePaneReturn {
1870
1916
  error: Error | null;
1871
1917
  content: string | null;
1872
1918
  isDirty: boolean;
1919
+ isReadonly: boolean;
1873
1920
  conflict: FileConflictError | null;
1874
1921
  onReloadFromServer: () => Promise<void>;
1875
1922
  onOverwrite: () => Promise<void>;
@@ -1948,6 +1995,24 @@ export declare function useWorkspaceContext(): WorkspaceContextValue;
1948
1995
 
1949
1996
  export declare function useWorkspaceContextOptional(): WorkspaceContextValue | null;
1950
1997
 
1998
+ export declare function useWorkspaceLeftPaneActions(options?: UseWorkspaceLeftPaneActionsOptions): WorkspaceLeftPaneAction[];
1999
+
2000
+ export declare interface UseWorkspaceLeftPaneActionsOptions {
2001
+ defaultTab?: WorkbenchLeftTabId;
2002
+ activeTab?: WorkbenchLeftTabId;
2003
+ activePanelId?: string | null;
2004
+ onActiveTabChange?: (tab: WorkbenchLeftTabId) => void;
2005
+ revealFileTreeRequest?: {
2006
+ path: string;
2007
+ seq: number;
2008
+ } | null;
2009
+ onOpenPanel?: (config: WorkspaceLeftPaneOpenPanelConfig) => void;
2010
+ onReloadAgentPlugins?: () => void | Promise<unknown>;
2011
+ onExpand?: (tab?: WorkbenchLeftTabId) => void;
2012
+ onCloseSourcePane?: () => void;
2013
+ railOnly?: boolean;
2014
+ }
2015
+
1951
2016
  export declare function useWorkspacePluginClient(): WorkspacePluginClient;
1952
2017
 
1953
2018
  export declare function useWorkspaceRequestId(): string | null;
@@ -1956,13 +2021,6 @@ export declare function useWorkspaceSourceRegistry(): WorkspaceSourceRegistry;
1956
2021
 
1957
2022
  export declare function WorkbenchLeftPane({ rootDir, bridge, defaultTab, activeTab: controlledActiveTab, activePanelId, onActiveTabChange, revealFileTreeRequest, onOpenPanel, onReloadAgentPlugins, onCollapse, onExpand, onCloseSourcePane, railOnly, className, }: WorkbenchLeftPaneProps): JSX.Element;
1958
2023
 
1959
- declare interface WorkbenchLeftPaneOpenPanelConfig {
1960
- id: string;
1961
- component: string;
1962
- title?: string;
1963
- params?: Record<string, unknown>;
1964
- }
1965
-
1966
2024
  export declare interface WorkbenchLeftPaneProps {
1967
2025
  rootDir?: string;
1968
2026
  bridge?: FileTreeBridge;
@@ -1979,7 +2037,7 @@ export declare interface WorkbenchLeftPaneProps {
1979
2037
  path: string;
1980
2038
  seq: number;
1981
2039
  } | null;
1982
- onOpenPanel?: (config: WorkbenchLeftPaneOpenPanelConfig) => void;
2040
+ onOpenPanel?: (config: WorkspaceLeftPaneOpenPanelConfig) => void;
1983
2041
  onReloadAgentPlugins?: () => void | Promise<unknown>;
1984
2042
  onCollapse?: () => void;
1985
2043
  onExpand?: (tab?: WorkbenchLeftTabId) => void;
@@ -2084,6 +2142,7 @@ export declare interface WorkspaceBridge {
2084
2142
  getVisibleFiles(): string[];
2085
2143
  openFile(path: string, opts?: {
2086
2144
  mode?: "view" | "edit" | "diff";
2145
+ filesystem?: FilesystemId;
2087
2146
  }): Promise<CommandResult>;
2088
2147
  openPanel(config: DynamicPaneConfig): Promise<CommandResult>;
2089
2148
  closePanel(id: string): Promise<CommandResult>;
@@ -2103,8 +2162,9 @@ export declare interface WorkspaceBridgeContextValue {
2103
2162
 
2104
2163
  export declare type WorkspaceChatPanelComponent = ComponentType<any>;
2105
2164
 
2106
- export declare interface WorkspaceChatPanelProps extends PiChatPanelProps<WorkspaceAttentionBlocker> {
2165
+ export declare interface WorkspaceChatPanelProps extends Omit<PiChatPanelProps<WorkspaceAttentionBlocker>, "onOpenArtifact"> {
2107
2166
  sessionId: string;
2167
+ onOpenArtifact?: OpenArtifactHandler;
2108
2168
  /** Endpoint base for agent → visible-workbench UI commands. */
2109
2169
  bridgeEndpoint?: string | null;
2110
2170
  /** Imperative handle getter for the visible workbench surface. */
@@ -2190,6 +2250,23 @@ declare interface WorkspaceHostEventMap {
2190
2250
  };
2191
2251
  }
2192
2252
 
2253
+ export declare interface WorkspaceLeftPaneAction {
2254
+ id: WorkbenchLeftTabId;
2255
+ title: string;
2256
+ icon: ReactNode;
2257
+ kind: "source" | "workspace-page";
2258
+ active: boolean;
2259
+ select: () => void;
2260
+ reloadAgentPlugins?: () => void | Promise<unknown>;
2261
+ }
2262
+
2263
+ export declare interface WorkspaceLeftPaneOpenPanelConfig {
2264
+ id: string;
2265
+ component: string;
2266
+ title?: string;
2267
+ params?: Record<string, unknown>;
2268
+ }
2269
+
2193
2270
  export declare function WorkspaceLink({ to, children, className, title, href, onClick }: WorkspaceLinkProps): ReactElement;
2194
2271
 
2195
2272
  export declare function workspaceLinkCommand(to: WorkspaceLinkTarget): UiCommand;
@@ -2209,10 +2286,12 @@ export declare type WorkspaceLinkTarget = {
2209
2286
  kind: "openFile";
2210
2287
  path: string;
2211
2288
  mode?: "view" | "edit" | "diff";
2289
+ filesystem?: FilesystemId;
2212
2290
  } | {
2213
2291
  kind: "openSurface";
2214
2292
  surfaceKind: string;
2215
2293
  target: string;
2294
+ filesystem?: FilesystemId;
2216
2295
  meta?: Record<string, unknown>;
2217
2296
  } | {
2218
2297
  kind: "openPanel";
@@ -2240,9 +2319,12 @@ declare type WorkspacePanelMatch = {
2240
2319
  } | {
2241
2320
  param: string;
2242
2321
  value: unknown;
2322
+ } | {
2323
+ params: Record<string, unknown>;
2243
2324
  } | {
2244
2325
  paramPrefix: string;
2245
2326
  value: string;
2327
+ params?: Record<string, unknown>;
2246
2328
  };
2247
2329
 
2248
2330
  export declare interface WorkspacePluginClient {
@@ -2285,17 +2367,21 @@ declare interface WorkspacePluginClientProviderProps {
2285
2367
  */
2286
2368
  export declare interface WorkspacePluginEventMap {
2287
2369
  "filesystem:file.changed": EventMeta & {
2370
+ filesystem?: FilesystemId;
2288
2371
  path: string;
2289
2372
  };
2290
2373
  "filesystem:file.created": EventMeta & {
2374
+ filesystem?: FilesystemId;
2291
2375
  path: string;
2292
2376
  kind: "file" | "dir";
2293
2377
  };
2294
2378
  "filesystem:file.moved": EventMeta & {
2379
+ filesystem?: FilesystemId;
2295
2380
  from: string;
2296
2381
  to: string;
2297
2382
  };
2298
2383
  "filesystem:file.deleted": EventMeta & {
2384
+ filesystem?: FilesystemId;
2299
2385
  path: string;
2300
2386
  };
2301
2387
  }