@hachej/boring-workspace 0.1.63 → 0.1.65

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 (36) hide show
  1. package/dist/FileTree-B_fRS4Om.js +230 -0
  2. package/dist/MarkdownEditor-C55gVDyW.js +743 -0
  3. package/dist/WorkspaceLoadingState-D3i4X-eH.js +847 -0
  4. package/dist/WorkspaceProvider-Ddx7GByq.js +8770 -0
  5. package/dist/app-front.d.ts +106 -4
  6. package/dist/app-front.js +3110 -2427
  7. package/dist/app-server.d.ts +2 -2
  8. package/dist/app-server.js +6 -4
  9. package/dist/boring-workspace.css +2 -1
  10. package/dist/charts.d.ts +6 -1
  11. package/dist/charts.js +131 -138
  12. package/dist/plugin.d.ts +64 -1
  13. package/dist/plugin.js +32 -0
  14. package/dist/rolldown-runtime-Dqa2HsxW.js +20 -0
  15. package/dist/{runtimeEnv-HolIkcoB.d.ts → runtimeEnv-CU-c4kaV.d.ts} +7 -0
  16. package/dist/server.d.ts +2 -2
  17. package/dist/server.js +4 -3
  18. package/dist/testing-e2e.d.ts +5 -0
  19. package/dist/testing-e2e.js +33 -42
  20. package/dist/testing.d.ts +6 -1
  21. package/dist/testing.js +9474 -10814
  22. package/dist/utils-BRcxFdrz.js +8 -0
  23. package/dist/workspace.css +2790 -301
  24. package/dist/workspace.d.ts +164 -21
  25. package/dist/workspace.js +568 -734
  26. package/docs/plans/archive/CODE_OWNERSHIP_CLEANUP_PLAN.md +1 -1
  27. package/docs/plans/archive/DECLARATIVE_LAYOUT_MIGRATION.md +4 -4
  28. package/docs/plans/archive/GENERIC_EXPLORER_PLUGIN_PLAN.md +10 -10
  29. package/docs/plans/archive/PLUGIN_MODEL.md +37 -37
  30. package/docs/plans/archive/WORKSPACE_V2_PLAN.md +2 -2
  31. package/package.json +50 -50
  32. package/dist/FileTree-CUvn5K86.js +0 -315
  33. package/dist/MarkdownEditor-5f4lhBqc.js +0 -598
  34. package/dist/WorkspaceLoadingState-y087Q6ek.js +0 -866
  35. package/dist/WorkspaceProvider-U4izhS84.js +0 -8660
  36. package/dist/utils-B6yFEsav.js +0 -8
@@ -1,7 +1,7 @@
1
1
  import { ComponentType } from 'react';
2
2
  import { DockviewApi } from 'dockview-react';
3
3
  import { DockviewPanelApi } from 'dockview-react';
4
- import { JSX } from 'react/jsx-runtime';
4
+ import { JSX } from 'react';
5
5
  import { PiChatPanelProps } from '@hachej/boring-agent/front';
6
6
  import { ReactNode } from 'react';
7
7
  import { SlashCommand } from '@hachej/boring-agent/front';
@@ -13,10 +13,27 @@ declare interface BoringFrontAPI {
13
13
  registerPanel<T = unknown>(registration: BoringFrontPanelRegistration<T>): void;
14
14
  registerWorkspaceSource<T = unknown>(registration: BoringFrontWorkspaceSourceRegistration<T>): void;
15
15
  registerPanelCommand(registration: BoringFrontPanelCommandRegistration): void;
16
+ registerAppLeftAction(registration: BoringFrontAppLeftActionRegistration): void;
16
17
  registerSurfaceResolver(registration: BoringFrontSurfaceResolverRegistration): void;
17
18
  registerToolRenderer(registration: BoringFrontToolRendererRegistration): void;
18
19
  }
19
20
 
21
+ declare interface BoringFrontAppLeftActionRegistration {
22
+ id: string;
23
+ label: string;
24
+ icon?: ComponentType<{
25
+ className?: string;
26
+ }>;
27
+ trailing?: ComponentType;
28
+ overlay: ComponentType<BoringFrontAppLeftOverlayProps>;
29
+ order?: number;
30
+ emphasis?: boolean;
31
+ }
32
+
33
+ declare interface BoringFrontAppLeftOverlayProps {
34
+ onClose: () => void;
35
+ }
36
+
20
37
  declare interface BoringFrontBindingRegistration {
21
38
  id: string;
22
39
  component: PluginBinding;
@@ -102,6 +119,24 @@ declare interface BoringFrontWorkspaceSourceRegistration<T = unknown> {
102
119
  source?: string;
103
120
  }
104
121
 
122
+ declare interface CapturedBoringFrontRegistrations {
123
+ providers: BoringFrontProviderRegistration[];
124
+ bindings: BoringFrontBindingRegistration[];
125
+ catalogs: CatalogConfig[];
126
+ panels: BoringFrontPanelRegistration<any>[];
127
+ workspaceSources: BoringFrontWorkspaceSourceRegistration<any>[];
128
+ panelCommands: BoringFrontPanelCommandRegistration[];
129
+ appLeftActions: BoringFrontAppLeftActionRegistration[];
130
+ surfaceResolvers: BoringFrontSurfaceResolverRegistration[];
131
+ toolRenderers: BoringFrontToolRendererRegistration[];
132
+ }
133
+
134
+ declare interface CapturedFrontPlugin {
135
+ id: string;
136
+ label?: string;
137
+ registrations: CapturedBoringFrontRegistrations;
138
+ }
139
+
105
140
  declare type CatalogAdapter = {
106
141
  search(args: CatalogSearchArgs): Promise<CatalogSearchResult>;
107
142
  fetchFacets?(args: CatalogFacetsArgs): Promise<CatalogFacets>;
@@ -167,6 +202,8 @@ declare interface ChatLayoutProps {
167
202
  center?: string;
168
203
  centerParams?: Record<string, unknown>;
169
204
  chatPanes?: ChatPaneDescriptor[];
205
+ /** Optional host actions rendered in the active chat pane header. */
206
+ chatTopActions?: ReactNode;
170
207
  activeChatPaneId?: string | null;
171
208
  onActiveChatPaneChange?: (id: string) => void;
172
209
  onCloseChatPane?: (id: string) => void;
@@ -246,6 +283,10 @@ export declare const FULL_PAGE_PANEL_RENDER_FAILED = "FULL_PAGE_PANEL_RENDER_FAI
246
283
 
247
284
  export declare const FULL_PAGE_PANEL_UNKNOWN_COMPONENT = "FULL_PAGE_PANEL_UNKNOWN_COMPONENT";
248
285
 
286
+ declare type OpenArtifactHandler = (path: string, options?: {
287
+ filesystem?: FilesystemId;
288
+ }) => void;
289
+
249
290
  declare interface OpenPanelConfig {
250
291
  /** Panel instance id. If a panel with this id is already open, it's re-activated instead of duplicated. */
251
292
  id: string;
@@ -466,6 +507,22 @@ declare type WorkspaceAgentAppLeftHeaderMode = "full" | "workspace" | "hidden";
466
507
 
467
508
  declare type WorkspaceAgentAppLeftLayoutMode = "single-project" | "multi-project";
468
509
 
510
+ declare interface WorkspaceAgentAppLeftOverlayAction {
511
+ id: string;
512
+ label: string;
513
+ icon: ReactNode;
514
+ trailing?: ReactNode;
515
+ emphasis?: boolean;
516
+ render: (props: WorkspaceAgentAppLeftOverlayRenderProps) => ReactNode;
517
+ }
518
+
519
+ declare interface WorkspaceAgentAppLeftOverlayRenderProps {
520
+ onClose: () => void;
521
+ headerInsetStart: boolean;
522
+ headerInsetEnd: boolean;
523
+ workspaceId: string;
524
+ }
525
+
469
526
  declare interface WorkspaceAgentAppLeftProject {
470
527
  id: string;
471
528
  name: string;
@@ -483,9 +540,9 @@ declare interface WorkspaceAgentAppLeftProjectSession {
483
540
  updatedAt?: string | number;
484
541
  }
485
542
 
486
- 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, debug, bridgeEndpoint, fullPageBasePath, onAuthError, sessions, activeSessionId, onSwitchSession, onCreateSession, onDeleteSession, onActiveSessionIdChange, appTitle, workspaceLabel, workspaceSectionTitle, appLeftLayoutMode, appLeftHeaderMode, appLeftProjects, appLeftActiveProjectId, onSwitchAppLeftProject, onOpenAppLeftProjectSession, onShowMoreAppLeftProjectSessions, onCreateAppLeftProject, onOpenAppLeftProjectSettings, onOpenAppLeftProjectInNewTab, defaultSessionTitle, workspaceLayout, navEnabled, defaultNavOpen, defaultSurfaceOpen, defaultWorkbenchLeftTab, defaultWorkbenchLeftOpen, surfaceInitialPanels, topBarLeft, topBarRight, showThemeToggle, showSkills, showPlugins, appLeftActions, chatParams, externalPlugins, hotReloadEnabled, frontPluginHotReload, extraPanels, extraCommands, provisionWorkspace, bootPreloadPaths, onWorkspaceWarmupStatusChange, onOpenNav, onOpenSurface, surfaceButtonBottomOffset, className, }: WorkspaceAgentFrontProps<TSession>): JSX.Element;
543
+ 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, debug, bridgeEndpoint, fullPageBasePath, onAuthError, sessions, activeSessionId, onSwitchSession, onCreateSession, onDeleteSession, onActiveSessionIdChange, appTitle, workspaceLabel, workspaceSectionTitle, appLeftLayoutMode, appLeftHeaderMode, appLeftProjects, appLeftActiveProjectId, onSwitchAppLeftProject, onOpenAppLeftProjectSession, onShowMoreAppLeftProjectSessions, onCreateAppLeftProject, onOpenAppLeftProjectSettings, onOpenAppLeftProjectInNewTab, defaultSessionTitle, workspaceLayout, navEnabled, defaultNavOpen, defaultAppLeftPaneCollapsed, defaultSurfaceOpen, defaultWorkbenchLeftTab, defaultWorkbenchLeftOpen, surfaceInitialPanels, topBarLeft, topBarRight, showThemeToggle, defaultLeftOverlay, showSkills, showPlugins, appLeftActions, appLeftOverlayActions, chatParams, externalPlugins, hotReloadEnabled, frontPluginHotReload, extraPanels, extraCommands, provisionWorkspace, bootPreloadPaths, onWorkspaceWarmupStatusChange, onOpenNav, onOpenSurface, surfaceButtonBottomOffset, className, }: WorkspaceAgentFrontProps<TSession>): JSX.Element;
487
544
 
488
- export declare interface WorkspaceAgentFrontProps<TSession extends WorkspaceAgentSession = WorkspaceAgentSession> extends Omit<WorkspaceProviderProps, "children" | "workspaceId" | "storageKey" | "chatPanel" | "commandPaletteSessionSearch">, Omit<ChatLayoutProps, "nav" | "navParams" | "center" | "centerParams" | "chatPanes" | "activeChatPaneId" | "onActiveChatPaneChange" | "onCloseChatPane" | "onCreateChatPaneAfter" | "onDropChatSession" | "flashChatPaneId" | "surface" | "surfaceParams" | "sidebar" | "sidebarParams" | "storageKey"> {
545
+ export declare interface WorkspaceAgentFrontProps<TSession extends WorkspaceAgentSession = WorkspaceAgentSession> extends Omit<WorkspaceProviderProps, "children" | "workspaceId" | "storageKey" | "chatPanel" | "commandPaletteSessionSearch">, Omit<ChatLayoutProps, "nav" | "navParams" | "center" | "centerParams" | "chatPanes" | "chatTopActions" | "activeChatPaneId" | "onActiveChatPaneChange" | "onCloseChatPane" | "onCreateChatPaneAfter" | "onDropChatSession" | "flashChatPaneId" | "surface" | "surfaceParams" | "sidebar" | "sidebarParams" | "storageKey"> {
489
546
  workspaceId: string;
490
547
  chatPanel?: ComponentType<WorkspaceChatPanelProps>;
491
548
  useSessions?: UseWorkspaceAgentSessions<TSession>;
@@ -522,6 +579,8 @@ export declare interface WorkspaceAgentFrontProps<TSession extends WorkspaceAgen
522
579
  workspaceLayout?: WorkspaceAgentLayout;
523
580
  navEnabled?: boolean;
524
581
  defaultNavOpen?: boolean;
582
+ /** Initial collapsed state for the plugin-tabs app-left pane. */
583
+ defaultAppLeftPaneCollapsed?: boolean;
525
584
  defaultSurfaceOpen?: boolean;
526
585
  defaultWorkbenchLeftTab?: string;
527
586
  defaultWorkbenchLeftOpen?: boolean;
@@ -535,12 +594,16 @@ export declare interface WorkspaceAgentFrontProps<TSession extends WorkspaceAgen
535
594
  * UserMenu) should set this to false to avoid a duplicate control.
536
595
  */
537
596
  showThemeToggle?: boolean;
597
+ /** Initial plugin-tabs overlay, useful for demos/deep links. */
598
+ defaultLeftOverlay?: string | null;
538
599
  /** Show the plugin-tabs Skills action/overlay. Defaults to true. */
539
600
  showSkills?: boolean;
540
601
  /** Show the plugin-tabs Plugins action/overlay. Defaults to true. */
541
602
  showPlugins?: boolean;
542
603
  /** Extra actions inserted into the app-left primary action list before built-in management actions. */
543
604
  appLeftActions?: readonly WorkspaceAgentAppLeftAction[];
605
+ /** Extra chat-hosted management overlays opened from the app-left primary action list. */
606
+ appLeftOverlayActions?: readonly WorkspaceAgentAppLeftOverlayAction[];
544
607
  sessions?: Array<{
545
608
  id: string;
546
609
  title?: string | null;
@@ -612,6 +675,16 @@ declare type WorkspaceAttentionBlocker = {
612
675
  sessionId?: string;
613
676
  /** Optional generic session-row badge contributed by the plugin that owns this attention. */
614
677
  sessionBadge?: WorkspaceAttentionSessionBadge;
678
+ /**
679
+ * Remove this blocker once its workspace chat session disappears from the
680
+ * authoritative session list. Leave unset for external inbox items whose
681
+ * `sessionId` is a source/thread identifier rather than a local chat id.
682
+ */
683
+ pruneWhenSessionMissing?: boolean;
684
+ /** Explicit inbox projection metadata. New inbox-aware plugins should provide this instead of relying on reason parsing. */
685
+ inbox?: WorkspaceAttentionInboxMetadata;
686
+ /** Optional shell focus behavior requested by the plugin that owns this blocker. */
687
+ focus?: WorkspaceAttentionFocusMetadata;
615
688
  actions?: WorkspaceAttentionBlockerAction[];
616
689
  };
617
690
 
@@ -620,6 +693,19 @@ declare type WorkspaceAttentionBlockerAction = {
620
693
  label: string;
621
694
  };
622
695
 
696
+ declare type WorkspaceAttentionFocusMetadata = {
697
+ /** Close the workbench left pane when this blocker becomes active for the current session. */
698
+ closeWorkbenchLeftPane?: boolean;
699
+ };
700
+
701
+ declare type WorkspaceAttentionInboxMetadata = {
702
+ kind: "question" | "review" | "approval" | "notice";
703
+ sourceLabel: string;
704
+ createdAt?: string | number | Date;
705
+ updatedAt?: string | number | Date;
706
+ priority?: number;
707
+ };
708
+
623
709
  declare type WorkspaceAttentionSessionBadge = {
624
710
  /** Stable badge kind for data attributes and plugin-specific styling hooks. */
625
711
  kind: string;
@@ -657,8 +743,9 @@ export declare interface WorkspaceBootGateProps {
657
743
 
658
744
  declare type WorkspaceChatPanelComponent = ComponentType<any>;
659
745
 
660
- declare interface WorkspaceChatPanelProps extends PiChatPanelProps<WorkspaceAttentionBlocker> {
746
+ declare interface WorkspaceChatPanelProps extends Omit<PiChatPanelProps<WorkspaceAttentionBlocker>, "onOpenArtifact"> {
661
747
  sessionId: string;
748
+ onOpenArtifact?: OpenArtifactHandler;
662
749
  /** Endpoint base for agent → visible-workbench UI commands. */
663
750
  bridgeEndpoint?: string | null;
664
751
  /** Imperative handle getter for the visible workbench surface. */
@@ -671,6 +758,11 @@ declare interface WorkspaceChatPanelProps extends PiChatPanelProps<WorkspaceAtte
671
758
  openWorkbenchSources?: () => void;
672
759
  /** Closes the visible workbench surface after an ephemeral command finishes. */
673
760
  closeWorkbench?: () => void;
761
+ /** Host-injected composer blockers (for shell policies such as detached read-only chat). */
762
+ composerBlockers?: WorkspaceAttentionBlocker[];
763
+ onComposerStop?: () => void;
764
+ onComposerBlockerAction?: (blocker: WorkspaceAttentionBlocker, action: string) => void;
765
+ onData?: (part: unknown) => void;
674
766
  }
675
767
 
676
768
  export declare function WorkspaceFullPagePanel({ componentId, params }: WorkspaceFullPagePanelProps): JSX.Element;
@@ -703,6 +795,7 @@ declare interface WorkspaceProviderProps {
703
795
  * `@hachej/boring-workspace/plugin`.
704
796
  */
705
797
  plugins?: BoringFrontFactoryWithId[];
798
+ capturedPlugins?: CapturedFrontPlugin[];
706
799
  excludeDefaults?: string[];
707
800
  panels?: PanelConfig[];
708
801
  commands?: CommandConfig[];
@@ -716,6 +809,10 @@ declare interface WorkspaceProviderProps {
716
809
  activeSessionId?: string | null;
717
810
  /** Session ids that are currently open in chat panes, for plugins that must avoid opening closed-session UI. */
718
811
  openSessionIds?: readonly string[];
812
+ /** Authoritative chat session ids used to drop stale session-scoped Inbox/attention entries. */
813
+ attentionSessionIds?: readonly string[];
814
+ /** False while session data is loading or paginated; prevents pruning valid off-page attention entries. */
815
+ attentionSessionsAuthoritative?: boolean;
719
816
  defaultTheme?: "light" | "dark" | undefined;
720
817
  onThemeChange?: (theme: "light" | "dark") => void;
721
818
  workspaceId?: string;
@@ -779,3 +876,8 @@ export declare type WorkspaceWarmupStatus = {
779
876
  };
780
877
 
781
878
  export { }
879
+
880
+
881
+ declare global {
882
+ var __BORING_RUNTIME_SINGLETONS__: Record<string, unknown> | undefined;
883
+ }