@page-speed/agent-everywhere 0.6.0 → 0.7.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/dist/index.d.cts CHANGED
@@ -2892,11 +2892,30 @@ interface AgentWorkspaceProps {
2892
2892
  onLeftPanelOpenChange?: (open: boolean) => void;
2893
2893
  onRightPanelOpenChange?: (open: boolean) => void;
2894
2894
  /**
2895
- * Render the built-in floating panel toggles in the top corners of the
2896
- * center column. Default true. Set false and mount
2897
- * `<AgentWorkspacePanelToggle/>` in your own chrome instead.
2895
+ * Render extra floating panel toggles in the top corners of the center
2896
+ * column. Default false the persistent workspace header already hosts a
2897
+ * toggle at each end. Mount `<AgentWorkspacePanelToggle/>` in your own
2898
+ * chrome for fully custom placement.
2898
2899
  */
2899
2900
  showPanelToggles?: boolean;
2901
+ /**
2902
+ * Show the workspace header bar: left panel toggle, icon + title + status
2903
+ * on the left; `headerActions`, reset, the conversation chevron, and the
2904
+ * right panel toggle on the right. Default true.
2905
+ */
2906
+ showHeader?: boolean;
2907
+ /** @deprecated Use `showHeader`. Honored when `showHeader` is not set. */
2908
+ showConversationHeader?: boolean;
2909
+ /**
2910
+ * Host actions rendered at the start of the header's right action group —
2911
+ * e.g. a "+ New" button that mirrors the page's primary action.
2912
+ */
2913
+ headerActions?: ReactNode;
2914
+ /**
2915
+ * Status line under the title. Defaults to the shared session's
2916
+ * error/status label; pass this when running disconnected (no provider).
2917
+ */
2918
+ headerStatus?: ReactNode;
2900
2919
  /**
2901
2920
  * Custom conversation node for the slide-in layer. Defaults to
2902
2921
  * `<AgentConversation/>` bound to the shared session.
@@ -2905,10 +2924,8 @@ interface AgentWorkspaceProps {
2905
2924
  /** Controlled visibility for the conversation layer. */
2906
2925
  conversationOpen?: boolean;
2907
2926
  onConversationOpenChange?: (open: boolean) => void;
2908
- /** Title shown in the conversation layer's header. Default "AI Assistant". */
2927
+ /** Title shown in the workspace header. Default "AI Assistant". */
2909
2928
  conversationTitle?: ReactNode;
2910
- /** Hide the conversation layer's header bar (title + reset + minimize). */
2911
- showConversationHeader?: boolean;
2912
2929
  /**
2913
2930
  * `false` removes the dock; a ReactNode replaces the default
2914
2931
  * `<AgentWorkspaceComposer/>`; `true`/omitted renders the default.
@@ -2933,7 +2950,7 @@ interface AgentWorkspaceProps {
2933
2950
  * conversation, composer) into a page-level workspace with toggleable side
2934
2951
  * panels and a sliding center conversation.
2935
2952
  */
2936
- declare function AgentWorkspace({ children, leftPanel, rightPanel, leftPanelWidth, rightPanelWidth, defaultLeftPanelOpen, defaultRightPanelOpen, leftPanelOpen: leftPanelOpenProp, rightPanelOpen: rightPanelOpenProp, onLeftPanelOpenChange, onRightPanelOpenChange, showPanelToggles, conversation, conversationOpen: conversationOpenProp, onConversationOpenChange, conversationTitle, showConversationHeader, composer, composerPlaceholder, composerHint, onComposerSubmit, className, contentClassName, conversationClassName, leftPanelClassName, rightPanelClassName, composerClassName, }: AgentWorkspaceProps): react.JSX.Element;
2953
+ declare function AgentWorkspace({ children, leftPanel, rightPanel, leftPanelWidth, rightPanelWidth, defaultLeftPanelOpen, defaultRightPanelOpen, leftPanelOpen: leftPanelOpenProp, rightPanelOpen: rightPanelOpenProp, onLeftPanelOpenChange, onRightPanelOpenChange, showPanelToggles, showHeader, showConversationHeader, headerActions, headerStatus, conversation, conversationOpen: conversationOpenProp, onConversationOpenChange, conversationTitle, composer, composerPlaceholder, composerHint, onComposerSubmit, className, contentClassName, conversationClassName, leftPanelClassName, rightPanelClassName, composerClassName, }: AgentWorkspaceProps): react.JSX.Element;
2937
2954
 
2938
2955
  interface AgentWorkspaceComposerProps {
2939
2956
  /** Controlled draft value. Pair with `onChange` for caller-controlled editing. */
package/dist/index.d.ts CHANGED
@@ -2892,11 +2892,30 @@ interface AgentWorkspaceProps {
2892
2892
  onLeftPanelOpenChange?: (open: boolean) => void;
2893
2893
  onRightPanelOpenChange?: (open: boolean) => void;
2894
2894
  /**
2895
- * Render the built-in floating panel toggles in the top corners of the
2896
- * center column. Default true. Set false and mount
2897
- * `<AgentWorkspacePanelToggle/>` in your own chrome instead.
2895
+ * Render extra floating panel toggles in the top corners of the center
2896
+ * column. Default false the persistent workspace header already hosts a
2897
+ * toggle at each end. Mount `<AgentWorkspacePanelToggle/>` in your own
2898
+ * chrome for fully custom placement.
2898
2899
  */
2899
2900
  showPanelToggles?: boolean;
2901
+ /**
2902
+ * Show the workspace header bar: left panel toggle, icon + title + status
2903
+ * on the left; `headerActions`, reset, the conversation chevron, and the
2904
+ * right panel toggle on the right. Default true.
2905
+ */
2906
+ showHeader?: boolean;
2907
+ /** @deprecated Use `showHeader`. Honored when `showHeader` is not set. */
2908
+ showConversationHeader?: boolean;
2909
+ /**
2910
+ * Host actions rendered at the start of the header's right action group —
2911
+ * e.g. a "+ New" button that mirrors the page's primary action.
2912
+ */
2913
+ headerActions?: ReactNode;
2914
+ /**
2915
+ * Status line under the title. Defaults to the shared session's
2916
+ * error/status label; pass this when running disconnected (no provider).
2917
+ */
2918
+ headerStatus?: ReactNode;
2900
2919
  /**
2901
2920
  * Custom conversation node for the slide-in layer. Defaults to
2902
2921
  * `<AgentConversation/>` bound to the shared session.
@@ -2905,10 +2924,8 @@ interface AgentWorkspaceProps {
2905
2924
  /** Controlled visibility for the conversation layer. */
2906
2925
  conversationOpen?: boolean;
2907
2926
  onConversationOpenChange?: (open: boolean) => void;
2908
- /** Title shown in the conversation layer's header. Default "AI Assistant". */
2927
+ /** Title shown in the workspace header. Default "AI Assistant". */
2909
2928
  conversationTitle?: ReactNode;
2910
- /** Hide the conversation layer's header bar (title + reset + minimize). */
2911
- showConversationHeader?: boolean;
2912
2929
  /**
2913
2930
  * `false` removes the dock; a ReactNode replaces the default
2914
2931
  * `<AgentWorkspaceComposer/>`; `true`/omitted renders the default.
@@ -2933,7 +2950,7 @@ interface AgentWorkspaceProps {
2933
2950
  * conversation, composer) into a page-level workspace with toggleable side
2934
2951
  * panels and a sliding center conversation.
2935
2952
  */
2936
- declare function AgentWorkspace({ children, leftPanel, rightPanel, leftPanelWidth, rightPanelWidth, defaultLeftPanelOpen, defaultRightPanelOpen, leftPanelOpen: leftPanelOpenProp, rightPanelOpen: rightPanelOpenProp, onLeftPanelOpenChange, onRightPanelOpenChange, showPanelToggles, conversation, conversationOpen: conversationOpenProp, onConversationOpenChange, conversationTitle, showConversationHeader, composer, composerPlaceholder, composerHint, onComposerSubmit, className, contentClassName, conversationClassName, leftPanelClassName, rightPanelClassName, composerClassName, }: AgentWorkspaceProps): react.JSX.Element;
2953
+ declare function AgentWorkspace({ children, leftPanel, rightPanel, leftPanelWidth, rightPanelWidth, defaultLeftPanelOpen, defaultRightPanelOpen, leftPanelOpen: leftPanelOpenProp, rightPanelOpen: rightPanelOpenProp, onLeftPanelOpenChange, onRightPanelOpenChange, showPanelToggles, showHeader, showConversationHeader, headerActions, headerStatus, conversation, conversationOpen: conversationOpenProp, onConversationOpenChange, conversationTitle, composer, composerPlaceholder, composerHint, onComposerSubmit, className, contentClassName, conversationClassName, leftPanelClassName, rightPanelClassName, composerClassName, }: AgentWorkspaceProps): react.JSX.Element;
2937
2954
 
2938
2955
  interface AgentWorkspaceComposerProps {
2939
2956
  /** Controlled draft value. Pair with `onChange` for caller-controlled editing. */
package/dist/index.js CHANGED
@@ -8727,12 +8727,15 @@ function AgentWorkspace({
8727
8727
  rightPanelOpen: rightPanelOpenProp,
8728
8728
  onLeftPanelOpenChange,
8729
8729
  onRightPanelOpenChange,
8730
- showPanelToggles = true,
8730
+ showPanelToggles = false,
8731
+ showHeader,
8732
+ showConversationHeader,
8733
+ headerActions,
8734
+ headerStatus,
8731
8735
  conversation,
8732
8736
  conversationOpen: conversationOpenProp,
8733
8737
  onConversationOpenChange,
8734
8738
  conversationTitle = "AI Assistant",
8735
- showConversationHeader = true,
8736
8739
  composer = true,
8737
8740
  composerPlaceholder,
8738
8741
  composerHint,
@@ -8804,7 +8807,8 @@ function AgentWorkspace({
8804
8807
  onSubmit: onComposerSubmit
8805
8808
  }
8806
8809
  ) : composer;
8807
- const statusLine = agent ? agent.error ?? agent.statusLabel : null;
8810
+ const headerVisible = showHeader ?? showConversationHeader ?? true;
8811
+ const statusLine = headerStatus ?? (agent ? agent.error ?? agent.statusLabel : null);
8808
8812
  return /* @__PURE__ */ jsx(AgentWorkspaceContext.Provider, { value, children: /* @__PURE__ */ jsxs(
8809
8813
  "div",
8810
8814
  {
@@ -8843,6 +8847,69 @@ function AgentWorkspace({
8843
8847
  className: "border border-border/60 bg-background/80 shadow-sm backdrop-blur"
8844
8848
  }
8845
8849
  ) }),
8850
+ headerVisible && /* @__PURE__ */ jsxs(
8851
+ "div",
8852
+ {
8853
+ "data-workspace-header": "",
8854
+ className: "flex shrink-0 items-center justify-between gap-3 border-b border-border bg-background px-3 py-2.5",
8855
+ children: [
8856
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2.5", children: [
8857
+ hasLeftPanel && /* @__PURE__ */ jsx(
8858
+ AgentWorkspacePanelToggle,
8859
+ {
8860
+ side: "left",
8861
+ className: "hidden lg:flex"
8862
+ }
8863
+ ),
8864
+ /* @__PURE__ */ jsx("span", { className: "flex size-7 shrink-0 items-center justify-center rounded-md bg-primary text-primary-foreground", children: /* @__PURE__ */ jsx(Sparkles, { className: "size-3.5" }) }),
8865
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
8866
+ /* @__PURE__ */ jsx("div", { className: "truncate text-sm font-medium", children: conversationTitle }),
8867
+ statusLine && /* @__PURE__ */ jsx("div", { className: "truncate text-xs text-muted-foreground", children: statusLine })
8868
+ ] })
8869
+ ] }),
8870
+ /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [
8871
+ headerActions,
8872
+ agent && /* @__PURE__ */ jsx(
8873
+ "button",
8874
+ {
8875
+ type: "button",
8876
+ onClick: () => agent.reset(),
8877
+ "aria-label": "Start a new conversation",
8878
+ title: "New conversation",
8879
+ className: "flex size-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground",
8880
+ children: /* @__PURE__ */ jsx(RotateCcw, { className: "size-4" })
8881
+ }
8882
+ ),
8883
+ /* @__PURE__ */ jsx(
8884
+ "button",
8885
+ {
8886
+ type: "button",
8887
+ onClick: () => setConversationOpen(!conversationOpen),
8888
+ "aria-label": conversationOpen ? "Hide conversation" : "Show conversation",
8889
+ title: conversationOpen ? "Hide conversation" : "Show conversation",
8890
+ className: "flex size-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground",
8891
+ children: /* @__PURE__ */ jsx(
8892
+ ChevronDown,
8893
+ {
8894
+ className: cn(
8895
+ "size-4 transition-transform duration-200",
8896
+ !conversationOpen && "rotate-180"
8897
+ )
8898
+ }
8899
+ )
8900
+ }
8901
+ ),
8902
+ hasRightPanel && /* @__PURE__ */ jsx(
8903
+ AgentWorkspacePanelToggle,
8904
+ {
8905
+ side: "right",
8906
+ className: "hidden lg:flex"
8907
+ }
8908
+ )
8909
+ ] })
8910
+ ]
8911
+ }
8912
+ ),
8846
8913
  /* @__PURE__ */ jsxs("div", { className: "relative min-h-0 grow", children: [
8847
8914
  /* @__PURE__ */ jsx(
8848
8915
  "div",
@@ -8853,7 +8920,7 @@ function AgentWorkspace({
8853
8920
  children
8854
8921
  }
8855
8922
  ),
8856
- /* @__PURE__ */ jsxs(
8923
+ /* @__PURE__ */ jsx(
8857
8924
  "div",
8858
8925
  {
8859
8926
  "data-state": conversationOpen ? "open" : "closed",
@@ -8864,52 +8931,13 @@ function AgentWorkspace({
8864
8931
  conversationOpen ? "translate-y-0 opacity-100" : "pointer-events-none translate-y-8 opacity-0",
8865
8932
  conversationClassName
8866
8933
  ),
8867
- children: [
8868
- showConversationHeader && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border bg-background px-4 py-2.5", children: [
8869
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2.5", children: [
8870
- /* @__PURE__ */ jsx("span", { className: "flex size-7 shrink-0 items-center justify-center rounded-md bg-primary text-primary-foreground", children: /* @__PURE__ */ jsx(Sparkles, { className: "size-3.5" }) }),
8871
- /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
8872
- /* @__PURE__ */ jsx("div", { className: "truncate text-sm font-medium", children: conversationTitle }),
8873
- statusLine && /* @__PURE__ */ jsx("div", { className: "truncate text-xs text-muted-foreground", children: statusLine })
8874
- ] })
8875
- ] }),
8876
- /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [
8877
- (hasLeftPanel || hasRightPanel) && /* @__PURE__ */ jsxs("div", { className: "mr-1 hidden items-center gap-1 border-r border-border pr-2 lg:flex", children: [
8878
- /* @__PURE__ */ jsx(AgentWorkspacePanelToggle, { side: "left" }),
8879
- /* @__PURE__ */ jsx(AgentWorkspacePanelToggle, { side: "right" })
8880
- ] }),
8881
- agent && /* @__PURE__ */ jsx(
8882
- "button",
8883
- {
8884
- type: "button",
8885
- onClick: () => agent.reset(),
8886
- "aria-label": "Start a new conversation",
8887
- title: "New conversation",
8888
- className: "flex size-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground",
8889
- children: /* @__PURE__ */ jsx(RotateCcw, { className: "size-4" })
8890
- }
8891
- ),
8892
- /* @__PURE__ */ jsx(
8893
- "button",
8894
- {
8895
- type: "button",
8896
- onClick: () => setConversationOpen(false),
8897
- "aria-label": "Hide conversation",
8898
- title: "Hide conversation",
8899
- className: "flex size-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground",
8900
- children: /* @__PURE__ */ jsx(ChevronDown, { className: "size-4" })
8901
- }
8902
- )
8903
- ] })
8904
- ] }),
8905
- /* @__PURE__ */ jsx("div", { className: "min-h-0 grow", children: conversation ?? /* @__PURE__ */ jsx(
8906
- AgentConversation,
8907
- {
8908
- contentClassName: "mx-auto w-full max-w-3xl",
8909
- showAvatars: true
8910
- }
8911
- ) })
8912
- ]
8934
+ children: /* @__PURE__ */ jsx("div", { className: "min-h-0 grow", children: conversation ?? /* @__PURE__ */ jsx(
8935
+ AgentConversation,
8936
+ {
8937
+ contentClassName: "mx-auto w-full max-w-3xl",
8938
+ showAvatars: true
8939
+ }
8940
+ ) })
8913
8941
  }
8914
8942
  )
8915
8943
  ] }),