@hachej/boring-workspace 0.1.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.
- package/LICENSE +21 -0
- package/README.md +94 -0
- package/dist/CodeEditor-DQqOn4xz.js +266 -0
- package/dist/CommandPalette-aM61U-b0.js +5229 -0
- package/dist/FileTree-DRq_bfue.js +245 -0
- package/dist/MarkdownEditor-DjiHxnRv.js +349 -0
- package/dist/WorkspaceLoadingState-By0dZoPD.js +568 -0
- package/dist/agent-tool-NvxKfist.d.ts +28 -0
- package/dist/app-front.d.ts +485 -0
- package/dist/app-front.js +452 -0
- package/dist/app-server.d.ts +53 -0
- package/dist/app-server.js +769 -0
- package/dist/bootstrapServer-BRUqUpVW.d.ts +66 -0
- package/dist/boring-workspace.css +1 -0
- package/dist/charts.d.ts +114 -0
- package/dist/charts.js +143 -0
- package/dist/events.d.ts +178 -0
- package/dist/events.js +88 -0
- package/dist/explorer-DtLUnuah.d.ts +129 -0
- package/dist/panel-DnvDNQac.js +6 -0
- package/dist/server.d.ts +84 -0
- package/dist/server.js +811 -0
- package/dist/shared.d.ts +113 -0
- package/dist/shared.js +11 -0
- package/dist/testing-e2e.d.ts +68 -0
- package/dist/testing-e2e.js +45 -0
- package/dist/testing.d.ts +464 -0
- package/dist/testing.js +10984 -0
- package/dist/utils-B6yFEsav.js +8 -0
- package/dist/workspace.css +5780 -0
- package/dist/workspace.d.ts +2119 -0
- package/dist/workspace.js +1884 -0
- package/docs/INTERFACES.md +58 -0
- package/docs/PLUGIN_STRUCTURE.md +162 -0
- package/docs/README.md +19 -0
- package/docs/bridge.md +135 -0
- package/docs/panels.md +102 -0
- package/docs/plans/GENERIC_EXPLORER_PLUGIN_PLAN.md +455 -0
- package/docs/plans/MACRO_PLUGIN_GENERIC_HELPERS_AUDIT.md +962 -0
- package/docs/plans/PLUGIN_OUTPUTS_ISOLATION_PLAN.md +301 -0
- package/docs/plans/README.md +9 -0
- package/docs/plans/UI_BRIDGE_OWNERSHIP_REFACTOR.md +303 -0
- package/docs/plans/archive/CODE_OWNERSHIP_CLEANUP_PLAN.md +387 -0
- package/docs/plans/archive/COMMAND_PALETTE_REGISTRY.md +814 -0
- package/docs/plans/archive/DECLARATIVE_LAYOUT_MIGRATION.md +277 -0
- package/docs/plans/archive/PLUGIN_MODEL.md +3674 -0
- package/docs/plans/archive/SRC_FOLDER_REORG_PLAN.md +307 -0
- package/docs/plans/archive/UNIFIED_EVENT_BUS.md +647 -0
- package/docs/plans/archive/WORKSPACE_V2_PLAN.md +2489 -0
- package/docs/plugins.md +158 -0
- package/package.json +164 -0
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { DockviewApi } from 'dockview-react';
|
|
3
|
+
import { DockviewPanelApi } from 'dockview-react';
|
|
4
|
+
import { JSX } from 'react/jsx-runtime';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
import { SlashCommand } from '@hachej/boring-agent/front';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Structural tool contract accepted from workspace plugins and UI tool
|
|
10
|
+
* factories. Kept agent-runtime-neutral so only the app integration layer
|
|
11
|
+
* needs to import @hachej/boring-agent.
|
|
12
|
+
*/
|
|
13
|
+
declare interface AgentTool {
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
promptSnippet?: string;
|
|
17
|
+
parameters: JSONSchema;
|
|
18
|
+
execute(params: Record<string, unknown>, ctx: ToolExecContext): Promise<ToolResult>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare interface AgentToolOutput {
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Executable agent tools should be contributed by server
|
|
24
|
+
* plugins. This output remains for migration only.
|
|
25
|
+
*/
|
|
26
|
+
type: "agent-tool";
|
|
27
|
+
id: string;
|
|
28
|
+
tool: AgentTool;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* DataExplorer shared types — no runtime deps.
|
|
33
|
+
*
|
|
34
|
+
* Importable from BOTH front and server bundles without dragging in
|
|
35
|
+
* platform-specific code.
|
|
36
|
+
*/
|
|
37
|
+
declare type Badge = {
|
|
38
|
+
/** 1–4 char mono code rendered as a chip. */
|
|
39
|
+
code: string;
|
|
40
|
+
tooltip?: string;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
declare interface BindingOutput {
|
|
44
|
+
type: "binding";
|
|
45
|
+
id: string;
|
|
46
|
+
component: PluginBinding;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare interface CatalogConfig {
|
|
50
|
+
id: string;
|
|
51
|
+
label: string;
|
|
52
|
+
adapter: ExplorerAdapter;
|
|
53
|
+
onSelect: (row: ExplorerRow) => void;
|
|
54
|
+
pluginId?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare interface CatalogOutput {
|
|
58
|
+
type: "catalog";
|
|
59
|
+
catalog: CatalogConfig;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
declare interface ChatLayoutProps {
|
|
63
|
+
nav?: string | null;
|
|
64
|
+
navParams?: Record<string, unknown>;
|
|
65
|
+
center?: string;
|
|
66
|
+
centerParams?: Record<string, unknown>;
|
|
67
|
+
surface?: string | null;
|
|
68
|
+
surfaceParams?: Record<string, unknown>;
|
|
69
|
+
sidebar?: string | null;
|
|
70
|
+
sidebarParams?: Record<string, unknown>;
|
|
71
|
+
storageKey?: string;
|
|
72
|
+
onOpenNav?: () => void;
|
|
73
|
+
onOpenSurface?: () => void;
|
|
74
|
+
className?: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
declare interface CommandConfig {
|
|
78
|
+
id: string;
|
|
79
|
+
title: string;
|
|
80
|
+
run: () => void;
|
|
81
|
+
keywords?: string[];
|
|
82
|
+
shortcut?: string;
|
|
83
|
+
when?: () => boolean;
|
|
84
|
+
pluginId?: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
declare interface CommandOutput {
|
|
88
|
+
type: "command";
|
|
89
|
+
command: CommandConfig;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export declare function createLocalStorageSessions(opts?: CreateLocalStorageSessionsOptions): WorkspaceLocalSessionsStore;
|
|
93
|
+
|
|
94
|
+
export declare interface CreateLocalStorageSessionsOptions {
|
|
95
|
+
storageKey?: string;
|
|
96
|
+
initial?: () => WorkspaceLocalSessionsState;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
declare type ExplorerAdapter = {
|
|
100
|
+
search(args: SearchArgs): Promise<SearchResult>;
|
|
101
|
+
/** Optional. When omitted, the explorer renders flat (no facet popover). */
|
|
102
|
+
fetchFacets?(args: FacetsArgs): Promise<Facets>;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
declare type ExplorerRow = {
|
|
106
|
+
id: string;
|
|
107
|
+
title: string;
|
|
108
|
+
/** Optional muted second line (truncates with title). */
|
|
109
|
+
subtitle?: string;
|
|
110
|
+
/** Group key — must match one of the facet values for `groupBy`. */
|
|
111
|
+
group?: string;
|
|
112
|
+
/** Leading mono chip (e.g. type code, frequency). */
|
|
113
|
+
leading?: Badge;
|
|
114
|
+
/** Trailing mono chips for status flags (e.g. [D] derived, [LIVE]). */
|
|
115
|
+
trailing?: Badge[];
|
|
116
|
+
/** Right-aligned plain text for numeric metadata (e.g. "1.2M", "2.4s"). */
|
|
117
|
+
meta?: string;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
declare type Facets = Record<string, FacetValue[]>;
|
|
121
|
+
|
|
122
|
+
declare type FacetsArgs = {
|
|
123
|
+
filters: Record<string, string[]>;
|
|
124
|
+
signal?: AbortSignal;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
declare type FacetValue = {
|
|
128
|
+
value: string;
|
|
129
|
+
count: number;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
declare type JSONSchema = Record<string, unknown>;
|
|
133
|
+
|
|
134
|
+
declare interface LeftTabOutput<T = LeftTabParams> {
|
|
135
|
+
type: "left-tab";
|
|
136
|
+
id: string;
|
|
137
|
+
title: string;
|
|
138
|
+
icon?: PanelConfig<T>["icon"];
|
|
139
|
+
component: PanelConfig<T>["component"];
|
|
140
|
+
lazy?: PanelConfig<T>["lazy"];
|
|
141
|
+
requiresCapabilities?: PanelConfig<T>["requiresCapabilities"];
|
|
142
|
+
source?: PanelConfig<T>["source"];
|
|
143
|
+
chromeless?: PanelConfig<T>["chromeless"];
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
declare interface LeftTabParams {
|
|
147
|
+
rootDir?: string;
|
|
148
|
+
query?: string;
|
|
149
|
+
searchQuery?: string;
|
|
150
|
+
bridge?: unknown;
|
|
151
|
+
chromeless?: boolean;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
declare type OpenArtifactHandler = (path: string) => void;
|
|
155
|
+
|
|
156
|
+
declare interface OpenPanelConfig {
|
|
157
|
+
/** Panel instance id. If a panel with this id is already open, it's re-activated instead of duplicated. */
|
|
158
|
+
id: string;
|
|
159
|
+
/** Registered component id (must match a `PanelConfig.id` in WorkspaceProvider's panel registry). */
|
|
160
|
+
component: string;
|
|
161
|
+
/** Tab title. Defaults to `id`. */
|
|
162
|
+
title?: string;
|
|
163
|
+
/** Arbitrary params passed to the pane component. */
|
|
164
|
+
params?: Record<string, unknown>;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
declare interface PanelConfig<T = any> {
|
|
168
|
+
id: string;
|
|
169
|
+
title: string;
|
|
170
|
+
icon?: ComponentType<{
|
|
171
|
+
className?: string;
|
|
172
|
+
}>;
|
|
173
|
+
/** Placement hint: "left" | "center" | "right" | "bottom" | "left-tab" | "right-tab" */
|
|
174
|
+
placement?: string;
|
|
175
|
+
requiresCapabilities?: string[];
|
|
176
|
+
essential?: boolean;
|
|
177
|
+
chromeless?: boolean;
|
|
178
|
+
/** Source: "builtin" | "app" */
|
|
179
|
+
source?: string;
|
|
180
|
+
pluginId?: string;
|
|
181
|
+
/**
|
|
182
|
+
* Whether to wrap the component with React.lazy + Suspense. Omit to let
|
|
183
|
+
* the registry auto-detect: zero-arg functions (factories) are treated as
|
|
184
|
+
* lazy; components that accept a props argument are treated as eager.
|
|
185
|
+
*/
|
|
186
|
+
lazy?: boolean;
|
|
187
|
+
component: ComponentType<PaneProps<T>> | (() => Promise<{
|
|
188
|
+
default: ComponentType<PaneProps<T>>;
|
|
189
|
+
}>);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
declare interface PanelOutput<T = any> {
|
|
193
|
+
type: "panel";
|
|
194
|
+
panel: PanelConfig<T>;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Unified prop shape for panel components rendered inside DockviewShell.
|
|
199
|
+
*
|
|
200
|
+
* Structurally mirrors dockview's `IDockviewPanelProps<T>` so dockview
|
|
201
|
+
* can render registered components directly — no wrapper, no field
|
|
202
|
+
* renaming, no `as` casts. We re-state the shape (rather than re-export
|
|
203
|
+
* dockview's type) so the workspace package owns its public contract:
|
|
204
|
+
* if dockview's type ever drifts, only the wiring inside DockviewShell
|
|
205
|
+
* needs to change.
|
|
206
|
+
*
|
|
207
|
+
* Use {@link definePanel} for type-safe registration.
|
|
208
|
+
*
|
|
209
|
+
* @typeParam T - Shape of the panel-specific `params` payload. Defaults
|
|
210
|
+
* to `unknown` because layouts restored from JSON are inherently
|
|
211
|
+
* un-typed at runtime; use a generic param when you control the
|
|
212
|
+
* addPanel call site, otherwise read defensively.
|
|
213
|
+
*/
|
|
214
|
+
declare interface PaneProps<T = unknown> {
|
|
215
|
+
/** App-supplied data for this panel instance (e.g. `{ path: string }`). */
|
|
216
|
+
params: T;
|
|
217
|
+
/** Per-panel control surface (close, setActive, setTitle, …). */
|
|
218
|
+
api: DockviewPanelApi;
|
|
219
|
+
/** Top-level dockview API (groups, addPanel, removePanel, fromJSON, …). */
|
|
220
|
+
containerApi: DockviewApi;
|
|
221
|
+
/** Optional className forwarded to the pane's root element. */
|
|
222
|
+
className?: string;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
declare type PluginBinding = ComponentType<unknown>;
|
|
226
|
+
|
|
227
|
+
declare type PluginOutput = LeftTabOutput | PanelOutput | CommandOutput | CatalogOutput | BindingOutput | ProviderOutput | SurfaceResolverOutput | AgentToolOutput;
|
|
228
|
+
|
|
229
|
+
declare type PluginProvider = ComponentType<PluginProviderProps>;
|
|
230
|
+
|
|
231
|
+
declare interface PluginProviderProps {
|
|
232
|
+
apiBaseUrl: string;
|
|
233
|
+
authHeaders?: Record<string, string>;
|
|
234
|
+
onAuthError?: (statusCode: number) => void;
|
|
235
|
+
apiTimeout?: number;
|
|
236
|
+
children: ReactNode;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
declare interface ProviderOutput {
|
|
240
|
+
type: "provider";
|
|
241
|
+
id: string;
|
|
242
|
+
component: PluginProvider;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
declare type SearchArgs = {
|
|
246
|
+
query: string;
|
|
247
|
+
filters: Record<string, string[]>;
|
|
248
|
+
/** Scope to a single group's value (only set when paginating inside a group). */
|
|
249
|
+
group?: {
|
|
250
|
+
key: string;
|
|
251
|
+
value: string;
|
|
252
|
+
};
|
|
253
|
+
limit: number;
|
|
254
|
+
offset: number;
|
|
255
|
+
signal?: AbortSignal;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
declare type SearchResult = {
|
|
259
|
+
items: ExplorerRow[];
|
|
260
|
+
/** Total count for the current scope (query + filters + optional group). */
|
|
261
|
+
total: number;
|
|
262
|
+
hasMore: boolean;
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
declare interface SessionItem {
|
|
266
|
+
id: string;
|
|
267
|
+
title: string;
|
|
268
|
+
updatedAt?: string | number;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
declare interface SurfaceOpenRequest {
|
|
272
|
+
kind: string;
|
|
273
|
+
target: string;
|
|
274
|
+
meta?: Record<string, unknown>;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
declare interface SurfacePanelResolution {
|
|
278
|
+
component: string;
|
|
279
|
+
id?: string;
|
|
280
|
+
title?: string;
|
|
281
|
+
params?: Record<string, unknown>;
|
|
282
|
+
score?: number;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
declare interface SurfaceResolverConfig {
|
|
286
|
+
id: string;
|
|
287
|
+
resolve: (request: SurfaceOpenRequest) => SurfacePanelResolution | undefined;
|
|
288
|
+
source?: string;
|
|
289
|
+
pluginId?: string;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
declare interface SurfaceResolverOutput {
|
|
293
|
+
type: "surface-resolver";
|
|
294
|
+
resolver: SurfaceResolverConfig;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
declare interface SurfaceShellApi {
|
|
298
|
+
/** Open a file in the workbench. Idempotent — re-activates an existing pane for the same path. */
|
|
299
|
+
openFile: (path: string) => void;
|
|
300
|
+
/** Open a plugin-defined surface target through the registered surface resolvers. */
|
|
301
|
+
openSurface: (request: SurfaceOpenRequest) => void;
|
|
302
|
+
/**
|
|
303
|
+
* Open a non-file pane in the workbench. Idempotent on `id` —
|
|
304
|
+
* re-activates an existing panel with the same id rather than duplicating.
|
|
305
|
+
* Use this for app-specific panes (charts, dashboards, log viewers, …) that
|
|
306
|
+
* aren't anchored to a filesystem path.
|
|
307
|
+
*/
|
|
308
|
+
openPanel: (config: OpenPanelConfig) => void;
|
|
309
|
+
/** Hide the workbench's left sources/files pane while leaving the workbench open. */
|
|
310
|
+
closeWorkbenchLeftPane: () => void;
|
|
311
|
+
/** Current snapshot of open tabs + active tab. */
|
|
312
|
+
getSnapshot: () => SurfaceShellSnapshot;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
declare interface SurfaceShellSnapshot {
|
|
316
|
+
openTabs: SurfaceShellTab[];
|
|
317
|
+
activeTab: string | null;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
declare interface SurfaceShellTab {
|
|
321
|
+
id: string;
|
|
322
|
+
title: string;
|
|
323
|
+
params?: Record<string, unknown>;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
declare interface ToolExecContext {
|
|
327
|
+
abortSignal: AbortSignal;
|
|
328
|
+
toolCallId: string;
|
|
329
|
+
onUpdate?: (partial: string) => void;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
declare interface ToolResult {
|
|
333
|
+
content: Array<{
|
|
334
|
+
type: "text";
|
|
335
|
+
text: string;
|
|
336
|
+
}>;
|
|
337
|
+
isError?: boolean;
|
|
338
|
+
details?: unknown;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export declare function useLocalStorageSessions(store: WorkspaceLocalSessionsStore): WorkspaceLocalSessionsState;
|
|
342
|
+
|
|
343
|
+
export declare type UseWorkspaceAgentSessions<TSession extends WorkspaceAgentSession = WorkspaceAgentSession> = (options: {
|
|
344
|
+
requestHeaders: Record<string, string>;
|
|
345
|
+
storageKey: string;
|
|
346
|
+
}) => WorkspaceAgentSessionsApi<TSession>;
|
|
347
|
+
|
|
348
|
+
export declare function WorkspaceAgentFront<TSession extends WorkspaceAgentSession = WorkspaceAgentSession>({ workspaceId, chatPanel: chatPanelProp, useSessions: useSessionsProp, requestHeaders, sessionStorageKey, providerStorageKey, surfaceStorageKey, beforeShell, afterShell, panels, commands, catalogs, plugins, excludeDefaults, capabilities, apiBaseUrl, authHeaders, apiTimeout, defaultTheme, onThemeChange, persistenceEnabled, bridgeEndpoint, onAuthError, sessions, activeSessionId, onSwitchSession, onCreateSession, onDeleteSession, onActiveSessionIdChange, appTitle, defaultSessionTitle, topBarLeft, topBarRight, chatParams, extraPanels, extraCommands, onOpenNav, onOpenSurface, className, }: WorkspaceAgentFrontProps<TSession>): JSX.Element;
|
|
349
|
+
|
|
350
|
+
export declare interface WorkspaceAgentFrontProps<TSession extends WorkspaceAgentSession = WorkspaceAgentSession> extends Omit<WorkspaceProviderProps, "children" | "workspaceId" | "storageKey" | "chatPanel">, Omit<ChatLayoutProps, "nav" | "navParams" | "center" | "centerParams" | "surface" | "surfaceParams" | "sidebar" | "sidebarParams" | "storageKey"> {
|
|
351
|
+
workspaceId: string;
|
|
352
|
+
chatPanel?: ComponentType<WorkspaceChatPanelProps>;
|
|
353
|
+
useSessions?: UseWorkspaceAgentSessions<TSession>;
|
|
354
|
+
requestHeaders?: Record<string, string>;
|
|
355
|
+
sessionStorageKey?: string;
|
|
356
|
+
providerStorageKey?: string;
|
|
357
|
+
surfaceStorageKey?: string;
|
|
358
|
+
beforeShell?: ReactNode;
|
|
359
|
+
afterShell?: ReactNode;
|
|
360
|
+
appTitle?: string;
|
|
361
|
+
defaultSessionTitle?: string;
|
|
362
|
+
topBarLeft?: ReactNode;
|
|
363
|
+
topBarRight?: ReactNode;
|
|
364
|
+
sessions?: Array<{
|
|
365
|
+
id: string;
|
|
366
|
+
title?: string | null;
|
|
367
|
+
updatedAt?: string | number;
|
|
368
|
+
}>;
|
|
369
|
+
activeSessionId?: string | null;
|
|
370
|
+
onSwitchSession?: (id: string) => void;
|
|
371
|
+
onCreateSession?: () => void;
|
|
372
|
+
onDeleteSession?: (id: string) => void;
|
|
373
|
+
onActiveSessionIdChange?: (sessionId: string) => void;
|
|
374
|
+
chatParams?: Record<string, unknown>;
|
|
375
|
+
extraPanels?: string[];
|
|
376
|
+
extraCommands?: SlashCommand[];
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export declare interface WorkspaceAgentSession {
|
|
380
|
+
id: string;
|
|
381
|
+
title?: string | null;
|
|
382
|
+
updatedAt?: string | number;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export declare interface WorkspaceAgentSessionsApi<TSession extends WorkspaceAgentSession = WorkspaceAgentSession> {
|
|
386
|
+
sessions: TSession[];
|
|
387
|
+
loading: boolean;
|
|
388
|
+
activeSessionId?: string | null;
|
|
389
|
+
activeSession?: TSession | null;
|
|
390
|
+
switch: (id: string) => void;
|
|
391
|
+
create: (input?: {
|
|
392
|
+
title?: string;
|
|
393
|
+
}) => void | Promise<unknown>;
|
|
394
|
+
delete: (id: string) => void | Promise<unknown>;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
export declare function WorkspaceBootGate({ workspaceId, requestHeaders, apiBaseUrl, preloadPaths, loadingFallback, errorFallback, children, }: WorkspaceBootGateProps): JSX.Element;
|
|
398
|
+
|
|
399
|
+
export declare interface WorkspaceBootGateProps {
|
|
400
|
+
workspaceId: string;
|
|
401
|
+
requestHeaders?: Record<string, string>;
|
|
402
|
+
apiBaseUrl?: string | null;
|
|
403
|
+
preloadPaths?: string[];
|
|
404
|
+
loadingFallback?: ReactNode | ((status: string) => ReactNode);
|
|
405
|
+
errorFallback?: ReactNode | ((message: string) => ReactNode);
|
|
406
|
+
children: ReactNode;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
declare type WorkspaceChatPanelComponent = ComponentType<any>;
|
|
410
|
+
|
|
411
|
+
declare interface WorkspaceChatPanelProps {
|
|
412
|
+
sessionId: string;
|
|
413
|
+
onData?: (part: unknown) => void;
|
|
414
|
+
requestHeaders?: Record<string, string>;
|
|
415
|
+
onOpenArtifact?: OpenArtifactHandler;
|
|
416
|
+
className?: string;
|
|
417
|
+
/** Endpoint base for agent → visible-workbench UI commands. */
|
|
418
|
+
bridgeEndpoint?: string | null;
|
|
419
|
+
/** Imperative handle getter for the visible workbench surface. */
|
|
420
|
+
getSurface?: () => SurfaceShellApi | null;
|
|
421
|
+
/** Reads whether the visible workbench surface should be open. */
|
|
422
|
+
isWorkbenchOpen?: () => boolean;
|
|
423
|
+
/** Opens the visible workbench surface before dispatching a command. */
|
|
424
|
+
openWorkbench?: () => void;
|
|
425
|
+
[key: string]: unknown;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
declare interface WorkspaceFrontPlugin {
|
|
429
|
+
id: string;
|
|
430
|
+
label?: string;
|
|
431
|
+
/**
|
|
432
|
+
* Context prepended to the agent's system prompt at boot. Concatenated
|
|
433
|
+
* across all registered plugins (in registration order) and joined with
|
|
434
|
+
* double-newlines. Plain Markdown. ~200-500 chars recommended.
|
|
435
|
+
*/
|
|
436
|
+
systemPrompt?: string;
|
|
437
|
+
panels?: PanelConfig[];
|
|
438
|
+
commands?: CommandConfig[];
|
|
439
|
+
catalogs?: CatalogConfig[];
|
|
440
|
+
bindings?: PluginBinding[];
|
|
441
|
+
/**
|
|
442
|
+
* @deprecated Executable agent tools should be contributed by server
|
|
443
|
+
* plugins. This field remains for migration only.
|
|
444
|
+
*/
|
|
445
|
+
agentTools?: AgentTool[];
|
|
446
|
+
outputs?: PluginOutput[];
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
export declare interface WorkspaceLocalSessionsState {
|
|
450
|
+
sessions: SessionItem[];
|
|
451
|
+
activeId: string;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
export declare interface WorkspaceLocalSessionsStore {
|
|
455
|
+
getState: () => WorkspaceLocalSessionsState;
|
|
456
|
+
subscribe: (fn: () => void) => () => void;
|
|
457
|
+
switchTo: (id: string) => void;
|
|
458
|
+
create: () => void;
|
|
459
|
+
remove: (id: string) => void;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
declare interface WorkspaceProviderProps {
|
|
463
|
+
children: ReactNode;
|
|
464
|
+
chatPanel?: WorkspaceChatPanelComponent;
|
|
465
|
+
plugins?: WorkspaceFrontPlugin[];
|
|
466
|
+
excludeDefaults?: string[];
|
|
467
|
+
panels?: PanelConfig[];
|
|
468
|
+
commands?: CommandConfig[];
|
|
469
|
+
catalogs?: CatalogConfig[];
|
|
470
|
+
capabilities?: Record<string, boolean>;
|
|
471
|
+
apiBaseUrl?: string;
|
|
472
|
+
authHeaders?: Record<string, string>;
|
|
473
|
+
/** Per-request timeout for the data layer's FetchClient, in ms. */
|
|
474
|
+
apiTimeout?: number;
|
|
475
|
+
defaultTheme?: "light" | "dark" | undefined;
|
|
476
|
+
onThemeChange?: (theme: "light" | "dark") => void;
|
|
477
|
+
workspaceId?: string;
|
|
478
|
+
storageKey?: string;
|
|
479
|
+
persistenceEnabled?: boolean;
|
|
480
|
+
bridgeEndpoint?: string | null;
|
|
481
|
+
onAuthError?: (statusCode: number) => void;
|
|
482
|
+
onOpenFile?: (path: string) => void;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
export { }
|