@hachej/boring-workspace 0.1.61 → 0.1.63

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.
package/dist/testing.d.ts CHANGED
@@ -57,6 +57,7 @@ declare interface BridgeEventMap {
57
57
  "file:opened": {
58
58
  path: string;
59
59
  mode: "view" | "edit" | "diff";
60
+ filesystem?: FilesystemId;
60
61
  };
61
62
  "file:saved": {
62
63
  path: string;
@@ -145,6 +146,8 @@ declare interface DynamicPaneConfig {
145
146
  title?: string;
146
147
  }
147
148
 
149
+ declare type FilesystemId = "user" | "company_context" | (string & {});
150
+
148
151
  export declare interface MockBridgeState {
149
152
  openPanels: PanelState[];
150
153
  activeFile: string | null;
@@ -389,6 +392,7 @@ declare interface WorkspaceBridge {
389
392
  getVisibleFiles(): string[];
390
393
  openFile(path: string, opts?: {
391
394
  mode?: "view" | "edit" | "diff";
395
+ filesystem?: FilesystemId;
392
396
  }): Promise<CommandResult>;
393
397
  openPanel(config: DynamicPaneConfig): Promise<CommandResult>;
394
398
  closePanel(id: string): Promise<CommandResult>;
package/dist/testing.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx as Ba } from "react/jsx-runtime";
2
2
  import * as Pa from "react";
3
3
  import { createElement as is, useMemo as wn, useLayoutEffect as us, isValidElement as ss, cloneElement as ds, useSyncExternalStore as Gi } from "react";
4
- import { i as cs, O as fs, x as ps, v as ms } from "./WorkspaceProvider-kf-pjz6V.js";
4
+ import { i as cs, O as fs, x as ps, v as ms } from "./WorkspaceProvider-U4izhS84.js";
5
5
  import * as bs from "react-dom/test-utils";
6
6
  import ka from "react-dom";
7
7
  import * as xn from "react-dom/client";
@@ -1,3 +1,5 @@
1
+ import { F as FilesystemId } from './filesystem-vhLA0ERd.js';
2
+
1
3
  interface UiBridge {
2
4
  getState(): Promise<UiState | null>;
3
5
  setState(state: UiState): Promise<void>;
@@ -20,12 +22,14 @@ type UiCommand = {
20
22
  params: {
21
23
  path: string;
22
24
  mode?: 'view' | 'edit' | 'diff';
25
+ filesystem?: FilesystemId;
23
26
  };
24
27
  } | {
25
28
  kind: 'openSurface';
26
29
  params: {
27
30
  kind: string;
28
31
  target: string;
32
+ filesystem?: FilesystemId;
29
33
  meta?: Record<string, unknown>;
30
34
  };
31
35
  } | {
@@ -3706,6 +3706,8 @@
3706
3706
  @layer theme, utilities;
3707
3707
  @layer theme {
3708
3708
  :root, :host {
3709
+ --font-sans: var(--boring-font-sans);
3710
+ --font-mono: var(--boring-font-mono);
3709
3711
  --color-black: #000;
3710
3712
  --spacing: 0.25rem;
3711
3713
  --container-xs: 20rem;
@@ -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;
@@ -435,6 +436,7 @@ export declare function CodeEditorPane({ params, api, className }: CodeEditorPan
435
436
 
436
437
  export declare type CodeEditorPaneProps = PaneProps<{
437
438
  path?: string;
439
+ filesystem?: FilesystemId;
438
440
  mode?: "view" | "edit" | "diff";
439
441
  }>;
440
442
 
@@ -732,7 +734,7 @@ declare class FetchClient {
732
734
  constructor(opts: FetchClientOptions);
733
735
  private request;
734
736
  getTree(path: string, signal?: AbortSignal): Promise<FileEntry[]>;
735
- getFile(path: string, signal?: AbortSignal): Promise<FileContent>;
737
+ getFile(path: string, signal?: AbortSignal, filesystem?: string): Promise<FileContent>;
736
738
  /**
737
739
  * Write file content. When `expectedMtimeMs` is supplied, the server
738
740
  * runs an optimistic-concurrency check and returns 409 if the file
@@ -748,15 +750,22 @@ declare class FetchClient {
748
750
  writeFile(path: string, content: string, opts?: {
749
751
  expectedMtimeMs?: number;
750
752
  returnMtimeMs?: boolean;
753
+ filesystem?: string;
751
754
  }): Promise<{
752
755
  mtimeMs?: number;
753
756
  }>;
754
- deleteFile(path: string): Promise<void>;
755
- stat(path: string, signal?: AbortSignal): Promise<FileStat>;
757
+ deleteFile(path: string, options?: {
758
+ filesystem?: string;
759
+ }): Promise<void>;
760
+ stat(path: string, signal?: AbortSignal, filesystem?: string): Promise<FileStat>;
756
761
  getGitUrlMetadata(path: string, signal?: AbortSignal): Promise<GitUrlMetadata>;
757
762
  search(query: string, limit?: number, signal?: AbortSignal): Promise<string[]>;
758
- createDir(path: string): Promise<void>;
759
- moveFile(from: string, to: string): Promise<void>;
763
+ createDir(path: string, options?: {
764
+ filesystem?: string;
765
+ }): Promise<void>;
766
+ moveFile(from: string, to: string, options?: {
767
+ filesystem?: string;
768
+ }): Promise<void>;
760
769
  }
761
770
 
762
771
  declare interface FetchClientOptions {
@@ -873,6 +882,7 @@ export declare type FilesystemEventMeta = ({
873
882
  toolCallId?: string;
874
883
  }) & {
875
884
  ts: number;
885
+ filesystem?: FilesystemId;
876
886
  };
877
887
 
878
888
  export declare const filesystemEvents: {
@@ -882,6 +892,8 @@ export declare const filesystemEvents: {
882
892
  readonly deleted: "filesystem:file.deleted";
883
893
  };
884
894
 
895
+ declare type FilesystemId = "user" | "company_context" | (string & {});
896
+
885
897
  export declare const filesystemPlugin: BoringFrontFactoryWithId;
886
898
 
887
899
  export declare function FileTree({ files, selectedPath, searchQuery, height, editing, revealPath, pendingPaths, onSelect, onExpand, onCollapse, onContextMenu, onSubmitEdit, onCancelEdit, onRevealHandled, onDragDrop, className, }: FileTreeProps): JSX.Element;
@@ -1077,6 +1089,7 @@ export declare function MarkdownEditorPane({ params, api, className }: MarkdownE
1077
1089
 
1078
1090
  export declare type MarkdownEditorPaneProps = PaneProps<{
1079
1091
  path?: string;
1092
+ filesystem?: FilesystemId;
1080
1093
  mode?: "view" | "edit" | "diff";
1081
1094
  }>;
1082
1095
 
@@ -1132,11 +1145,14 @@ export declare type OpenArtifactHandler = (path: string) => void;
1132
1145
  export declare const openFileSchema: z.ZodObject<{
1133
1146
  path: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
1134
1147
  mode: z.ZodOptional<z.ZodEnum<["view", "edit", "diff"]>>;
1148
+ filesystem: z.ZodOptional<z.ZodString>;
1135
1149
  }, "strip", z.ZodTypeAny, {
1136
1150
  path: string;
1151
+ filesystem?: string | undefined;
1137
1152
  mode?: "view" | "edit" | "diff" | undefined;
1138
1153
  }, {
1139
1154
  path: string;
1155
+ filesystem?: string | undefined;
1140
1156
  mode?: "view" | "edit" | "diff" | undefined;
1141
1157
  }>;
1142
1158
 
@@ -1518,6 +1534,7 @@ declare type StoreApi_2 = {
1518
1534
  export declare interface SurfaceOpenRequest {
1519
1535
  kind: string;
1520
1536
  target: string;
1537
+ filesystem?: FilesystemId;
1521
1538
  meta?: Record<string, unknown>;
1522
1539
  }
1523
1540
 
@@ -1584,10 +1601,8 @@ export declare interface SurfaceResolverRegistryLike {
1584
1601
  export declare function SurfaceShell({ rootDir, sidebarDefaultWidth, sidebarMinWidth, sidebarMaxWidth, storageKey, onReady, onChange, onClose, showCloseAction, extraPanels, defaultLeftTab, onReloadAgentPlugins, initialPanels, className, }: SurfaceShellProps): JSX.Element;
1585
1602
 
1586
1603
  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;
1604
+ /** Open a file in the workbench. Idempotent — re-activates an existing pane for the same filesystem/path. */
1605
+ openFile: (path: string, options?: SurfaceShellOpenFileOptions) => void;
1591
1606
  /** Open a plugin-defined surface target through the registered surface resolvers. */
1592
1607
  openSurface: (request: SurfaceOpenRequest) => void;
1593
1608
  /**
@@ -1605,6 +1620,11 @@ export declare interface SurfaceShellApi {
1605
1620
  getSnapshot: () => SurfaceShellSnapshot;
1606
1621
  }
1607
1622
 
1623
+ declare interface SurfaceShellOpenFileOptions {
1624
+ filesystem?: FilesystemId;
1625
+ mode?: "view" | "edit" | "diff";
1626
+ }
1627
+
1608
1628
  export declare interface SurfaceShellProps {
1609
1629
  rootDir?: string;
1610
1630
  sidebarDefaultWidth?: number;
@@ -1857,6 +1877,8 @@ export declare function useFilePane(options: UseFilePaneOptions): UseFilePaneRet
1857
1877
  export declare interface UseFilePaneOptions {
1858
1878
  /** The file path to load/edit. If empty/undefined, pane shows "no file selected". */
1859
1879
  path: string;
1880
+ /** Filesystem identity for cache/dirty/stale separation. Defaults to user. */
1881
+ filesystem?: FilesystemId;
1860
1882
  /** Unique panel ID for lifecycle tracking. Omit to use a stable per-pane fallback ID. */
1861
1883
  panelId?: string;
1862
1884
  /** Initial content (optional, for draft/unsaved files). */
@@ -1948,6 +1970,24 @@ export declare function useWorkspaceContext(): WorkspaceContextValue;
1948
1970
 
1949
1971
  export declare function useWorkspaceContextOptional(): WorkspaceContextValue | null;
1950
1972
 
1973
+ export declare function useWorkspaceLeftPaneActions(options?: UseWorkspaceLeftPaneActionsOptions): WorkspaceLeftPaneAction[];
1974
+
1975
+ export declare interface UseWorkspaceLeftPaneActionsOptions {
1976
+ defaultTab?: WorkbenchLeftTabId;
1977
+ activeTab?: WorkbenchLeftTabId;
1978
+ activePanelId?: string | null;
1979
+ onActiveTabChange?: (tab: WorkbenchLeftTabId) => void;
1980
+ revealFileTreeRequest?: {
1981
+ path: string;
1982
+ seq: number;
1983
+ } | null;
1984
+ onOpenPanel?: (config: WorkspaceLeftPaneOpenPanelConfig) => void;
1985
+ onReloadAgentPlugins?: () => void | Promise<unknown>;
1986
+ onExpand?: (tab?: WorkbenchLeftTabId) => void;
1987
+ onCloseSourcePane?: () => void;
1988
+ railOnly?: boolean;
1989
+ }
1990
+
1951
1991
  export declare function useWorkspacePluginClient(): WorkspacePluginClient;
1952
1992
 
1953
1993
  export declare function useWorkspaceRequestId(): string | null;
@@ -1956,13 +1996,6 @@ export declare function useWorkspaceSourceRegistry(): WorkspaceSourceRegistry;
1956
1996
 
1957
1997
  export declare function WorkbenchLeftPane({ rootDir, bridge, defaultTab, activeTab: controlledActiveTab, activePanelId, onActiveTabChange, revealFileTreeRequest, onOpenPanel, onReloadAgentPlugins, onCollapse, onExpand, onCloseSourcePane, railOnly, className, }: WorkbenchLeftPaneProps): JSX.Element;
1958
1998
 
1959
- declare interface WorkbenchLeftPaneOpenPanelConfig {
1960
- id: string;
1961
- component: string;
1962
- title?: string;
1963
- params?: Record<string, unknown>;
1964
- }
1965
-
1966
1999
  export declare interface WorkbenchLeftPaneProps {
1967
2000
  rootDir?: string;
1968
2001
  bridge?: FileTreeBridge;
@@ -1979,7 +2012,7 @@ export declare interface WorkbenchLeftPaneProps {
1979
2012
  path: string;
1980
2013
  seq: number;
1981
2014
  } | null;
1982
- onOpenPanel?: (config: WorkbenchLeftPaneOpenPanelConfig) => void;
2015
+ onOpenPanel?: (config: WorkspaceLeftPaneOpenPanelConfig) => void;
1983
2016
  onReloadAgentPlugins?: () => void | Promise<unknown>;
1984
2017
  onCollapse?: () => void;
1985
2018
  onExpand?: (tab?: WorkbenchLeftTabId) => void;
@@ -2084,6 +2117,7 @@ export declare interface WorkspaceBridge {
2084
2117
  getVisibleFiles(): string[];
2085
2118
  openFile(path: string, opts?: {
2086
2119
  mode?: "view" | "edit" | "diff";
2120
+ filesystem?: FilesystemId;
2087
2121
  }): Promise<CommandResult>;
2088
2122
  openPanel(config: DynamicPaneConfig): Promise<CommandResult>;
2089
2123
  closePanel(id: string): Promise<CommandResult>;
@@ -2190,6 +2224,23 @@ declare interface WorkspaceHostEventMap {
2190
2224
  };
2191
2225
  }
2192
2226
 
2227
+ export declare interface WorkspaceLeftPaneAction {
2228
+ id: WorkbenchLeftTabId;
2229
+ title: string;
2230
+ icon: ReactNode;
2231
+ kind: "source" | "workspace-page";
2232
+ active: boolean;
2233
+ select: () => void;
2234
+ reloadAgentPlugins?: () => void | Promise<unknown>;
2235
+ }
2236
+
2237
+ export declare interface WorkspaceLeftPaneOpenPanelConfig {
2238
+ id: string;
2239
+ component: string;
2240
+ title?: string;
2241
+ params?: Record<string, unknown>;
2242
+ }
2243
+
2193
2244
  export declare function WorkspaceLink({ to, children, className, title, href, onClick }: WorkspaceLinkProps): ReactElement;
2194
2245
 
2195
2246
  export declare function workspaceLinkCommand(to: WorkspaceLinkTarget): UiCommand;
@@ -2209,10 +2260,12 @@ export declare type WorkspaceLinkTarget = {
2209
2260
  kind: "openFile";
2210
2261
  path: string;
2211
2262
  mode?: "view" | "edit" | "diff";
2263
+ filesystem?: FilesystemId;
2212
2264
  } | {
2213
2265
  kind: "openSurface";
2214
2266
  surfaceKind: string;
2215
2267
  target: string;
2268
+ filesystem?: FilesystemId;
2216
2269
  meta?: Record<string, unknown>;
2217
2270
  } | {
2218
2271
  kind: "openPanel";
@@ -2240,9 +2293,12 @@ declare type WorkspacePanelMatch = {
2240
2293
  } | {
2241
2294
  param: string;
2242
2295
  value: unknown;
2296
+ } | {
2297
+ params: Record<string, unknown>;
2243
2298
  } | {
2244
2299
  paramPrefix: string;
2245
2300
  value: string;
2301
+ params?: Record<string, unknown>;
2246
2302
  };
2247
2303
 
2248
2304
  export declare interface WorkspacePluginClient {
@@ -2285,17 +2341,21 @@ declare interface WorkspacePluginClientProviderProps {
2285
2341
  */
2286
2342
  export declare interface WorkspacePluginEventMap {
2287
2343
  "filesystem:file.changed": EventMeta & {
2344
+ filesystem?: FilesystemId;
2288
2345
  path: string;
2289
2346
  };
2290
2347
  "filesystem:file.created": EventMeta & {
2348
+ filesystem?: FilesystemId;
2291
2349
  path: string;
2292
2350
  kind: "file" | "dir";
2293
2351
  };
2294
2352
  "filesystem:file.moved": EventMeta & {
2353
+ filesystem?: FilesystemId;
2295
2354
  from: string;
2296
2355
  to: string;
2297
2356
  };
2298
2357
  "filesystem:file.deleted": EventMeta & {
2358
+ filesystem?: FilesystemId;
2299
2359
  path: string;
2300
2360
  };
2301
2361
  }