@hachej/boring-workspace 0.1.34 → 0.1.36

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.
@@ -0,0 +1,32 @@
1
+ type JSONSchema = Record<string, unknown>;
2
+ type ToolReadinessRequirement = 'workspace-fs' | 'sandbox-exec' | 'ui-bridge' | 'runtime-dependencies' | `runtime:${string}`;
3
+ interface ToolExecContext {
4
+ abortSignal: AbortSignal;
5
+ toolCallId: string;
6
+ onUpdate?: (partial: string) => void;
7
+ /** Agent chat/session id executing this tool, when known. */
8
+ sessionId?: string;
9
+ }
10
+ interface ToolResult {
11
+ content: Array<{
12
+ type: "text";
13
+ text: string;
14
+ }>;
15
+ isError?: boolean;
16
+ details?: unknown;
17
+ }
18
+ /**
19
+ * Structural tool contract accepted from workspace plugins and UI tool
20
+ * factories. Kept agent-runtime-neutral so only the app integration layer
21
+ * needs to import @hachej/boring-agent.
22
+ */
23
+ interface AgentTool {
24
+ name: string;
25
+ description: string;
26
+ promptSnippet?: string;
27
+ readinessRequirements?: ToolReadinessRequirement[];
28
+ parameters: JSONSchema;
29
+ execute(params: Record<string, unknown>, ctx: ToolExecContext): Promise<ToolResult>;
30
+ }
31
+
32
+ export type { AgentTool as A, JSONSchema as J, ToolExecContext as T, ToolResult as a };
@@ -13,6 +13,7 @@ declare interface BoringFrontAPI {
13
13
  registerPanelCommand(registration: BoringFrontPanelCommandRegistration): void;
14
14
  registerLeftTab<T = LeftTabParams>(registration: BoringFrontLeftTabRegistration<T>): void;
15
15
  registerSurfaceResolver(registration: BoringFrontSurfaceResolverRegistration): void;
16
+ registerToolRenderer(registration: BoringFrontToolRendererRegistration): void;
16
17
  }
17
18
 
18
19
  declare interface BoringFrontBindingRegistration {
@@ -86,6 +87,13 @@ declare interface BoringFrontSurfaceResolverRegistration {
86
87
  resolve: (request: SurfaceOpenRequest) => SurfacePanelResolution | null | undefined;
87
88
  }
88
89
 
90
+ declare type BoringFrontToolRenderer = (part: unknown) => ReactNode;
91
+
92
+ declare interface BoringFrontToolRendererRegistration {
93
+ id: string;
94
+ render: BoringFrontToolRenderer;
95
+ }
96
+
89
97
  declare type CatalogAdapter = {
90
98
  search(args: CatalogSearchArgs): Promise<CatalogSearchResult>;
91
99
  fetchFacets?(args: CatalogFacetsArgs): Promise<CatalogFacets>;
@@ -150,6 +158,13 @@ declare interface ChatLayoutProps {
150
158
  navParams?: Record<string, unknown>;
151
159
  center?: string;
152
160
  centerParams?: Record<string, unknown>;
161
+ chatPanes?: ChatPaneDescriptor[];
162
+ activeChatPaneId?: string | null;
163
+ onActiveChatPaneChange?: (id: string) => void;
164
+ onCloseChatPane?: (id: string) => void;
165
+ onCreateChatPaneAfter?: (id: string) => void;
166
+ onDropChatSession?: (sessionId: string) => void;
167
+ flashChatPaneId?: string | null;
153
168
  surface?: string | null;
154
169
  surfaceParams?: Record<string, unknown>;
155
170
  surfaceOverlay?: ReactNode;
@@ -163,6 +178,13 @@ declare interface ChatLayoutProps {
163
178
  className?: string;
164
179
  }
165
180
 
181
+ declare interface ChatPaneDescriptor {
182
+ id: string;
183
+ title?: string | null;
184
+ panel?: string;
185
+ params?: Record<string, unknown>;
186
+ }
187
+
166
188
  declare interface CommandConfig {
167
189
  id: string;
168
190
  title: string;
@@ -388,13 +410,15 @@ export declare function useLocalStorageSessions(store: WorkspaceLocalSessionsSto
388
410
  export declare type UseWorkspaceAgentSessions<TSession extends WorkspaceAgentSession = WorkspaceAgentSession> = (options: {
389
411
  requestHeaders: Record<string, string>;
390
412
  storageKey: string;
413
+ workspaceId?: string;
414
+ apiBaseUrl?: string;
391
415
  enabled?: boolean;
392
416
  refreshKey?: unknown;
393
417
  }) => WorkspaceAgentSessionsApi<TSession>;
394
418
 
395
- 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, fullPageBasePath, onAuthError, sessions, activeSessionId, onSwitchSession, onCreateSession, onDeleteSession, onActiveSessionIdChange, appTitle, defaultSessionTitle, navEnabled, defaultNavOpen, defaultSurfaceOpen, defaultWorkbenchLeftTab, surfaceInitialPanels, topBarLeft, topBarRight, showThemeToggle, chatParams, hotReloadEnabled, frontPluginHotReload, extraPanels, extraCommands, provisionWorkspace, bootPreloadPaths, onWorkspaceWarmupStatusChange, onOpenNav, onOpenSurface, surfaceButtonBottomOffset, className, }: WorkspaceAgentFrontProps<TSession>): JSX.Element;
419
+ 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, fullPageBasePath, onAuthError, sessions, activeSessionId, onSwitchSession, onCreateSession, onDeleteSession, onActiveSessionIdChange, appTitle, workspaceLabel, defaultSessionTitle, navEnabled, defaultNavOpen, defaultSurfaceOpen, defaultWorkbenchLeftTab, surfaceInitialPanels, topBarLeft, topBarRight, showThemeToggle, chatParams, hotReloadEnabled, frontPluginHotReload, extraPanels, extraCommands, provisionWorkspace, bootPreloadPaths, onWorkspaceWarmupStatusChange, onOpenNav, onOpenSurface, surfaceButtonBottomOffset, className, }: WorkspaceAgentFrontProps<TSession>): JSX.Element;
396
420
 
397
- 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"> {
421
+ export declare interface WorkspaceAgentFrontProps<TSession extends WorkspaceAgentSession = WorkspaceAgentSession> extends Omit<WorkspaceProviderProps, "children" | "workspaceId" | "storageKey" | "chatPanel">, Omit<ChatLayoutProps, "nav" | "navParams" | "center" | "centerParams" | "chatPanes" | "activeChatPaneId" | "onActiveChatPaneChange" | "onCloseChatPane" | "onCreateChatPaneAfter" | "onDropChatSession" | "flashChatPaneId" | "surface" | "surfaceParams" | "sidebar" | "sidebarParams" | "storageKey"> {
398
422
  workspaceId: string;
399
423
  chatPanel?: ComponentType<WorkspaceChatPanelProps>;
400
424
  useSessions?: UseWorkspaceAgentSessions<TSession>;
@@ -405,6 +429,7 @@ export declare interface WorkspaceAgentFrontProps<TSession extends WorkspaceAgen
405
429
  beforeShell?: ReactNode;
406
430
  afterShell?: ReactNode;
407
431
  appTitle?: string;
432
+ workspaceLabel?: string;
408
433
  defaultSessionTitle?: string;
409
434
  navEnabled?: boolean;
410
435
  defaultNavOpen?: boolean;
@@ -428,7 +453,7 @@ export declare interface WorkspaceAgentFrontProps<TSession extends WorkspaceAgen
428
453
  }>;
429
454
  activeSessionId?: string | null;
430
455
  onSwitchSession?: (id: string) => void;
431
- onCreateSession?: () => void;
456
+ onCreateSession?: () => unknown | Promise<unknown>;
432
457
  onDeleteSession?: (id: string) => void;
433
458
  onActiveSessionIdChange?: (sessionId: string | null) => void;
434
459
  chatParams?: Record<string, unknown>;
@@ -461,6 +486,7 @@ export declare interface WorkspaceAgentSessionsApi<TSession extends WorkspaceAge
461
486
  error?: Error | null;
462
487
  activeSessionId?: string | null;
463
488
  activeSession?: TSession | null;
489
+ workspaceId?: string | null;
464
490
  switch: (id: string) => void;
465
491
  create: (input?: {
466
492
  title?: string;
@@ -579,8 +605,10 @@ declare interface WorkspaceProviderProps {
579
605
  defaultTheme?: "light" | "dark" | undefined;
580
606
  onThemeChange?: (theme: "light" | "dark") => void;
581
607
  workspaceId?: string;
608
+ workspaceLabel?: string;
582
609
  storageKey?: string;
583
610
  persistenceEnabled?: boolean;
611
+ manageDocumentTitle?: boolean;
584
612
  bridgeEndpoint?: string | null;
585
613
  onAuthError?: (statusCode: number) => void;
586
614
  onOpenFile?: (path: string) => void;