@docyrus/ui-pro-ai-assistant 0.3.1 → 0.3.3

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/README.md CHANGED
@@ -269,6 +269,9 @@ The main chat interface component.
269
269
  | Prop | Type | Default | Description |
270
270
  |------|------|---------|-------------|
271
271
  | `initialPrompt` | `string` | — | When provided, the assistant auto-sends this message on mount. Useful when launching the assistant from an agent trigger widget or deep link |
272
+ | `initialModelId` | `string` | — | Model ID to pre-select when auto-sending the initial prompt |
273
+ | `initialFeatures` | `{ webSearch?, thinking?, deepResearch?, documentSearch?, workCanvas?, files? }` | — | Feature flags to enable when auto-sending the initial prompt |
274
+ | `initialFiles` | `File[]` | — | Files to attach when auto-sending the initial prompt |
272
275
 
273
276
  ---
274
277
 
package/dist/index.js CHANGED
@@ -24553,6 +24553,7 @@ function ThreadHeaderInline({
24553
24553
  onMoveToProject,
24554
24554
  onProjectContextClick,
24555
24555
  isFullscreen = false,
24556
+ isSidebarOpen = true,
24556
24557
  t
24557
24558
  }) {
24558
24559
  const dropdownZClass = isFullscreen ? "z-[10000]" : "";
@@ -24572,7 +24573,7 @@ function ThreadHeaderInline({
24572
24573
  setEditValue(null);
24573
24574
  }
24574
24575
  };
24575
- return /* @__PURE__ */ jsxs("div", { className: "flex-none h-10 flex bg-background items-center justify-between border-b border-x border-border px-3 mx-3 rounded-b-md shrink-0", children: [
24576
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex-none h-10 flex bg-background items-center justify-between border-b border-x border-border px-3 mx-3 rounded-b-md shrink-0", !isSidebarOpen && "ml-12"), children: [
24576
24577
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
24577
24578
  projectContext?.id && onProjectContextClick && /* @__PURE__ */ jsx(
24578
24579
  Button,
@@ -24901,9 +24902,7 @@ var DocyAssistant = ({
24901
24902
  apiClient,
24902
24903
  configUser.id,
24903
24904
  projectActions.setProjects,
24904
- (project) => {
24905
- fetchProjectThreads2(project.id);
24906
- fetchProjectWorks2(project.id);
24905
+ () => {
24907
24906
  },
24908
24907
  () => projectActions.setProjectsLoaded(true),
24909
24908
  activeAgentId
@@ -24912,8 +24911,6 @@ var DocyAssistant = ({
24912
24911
  apiClient,
24913
24912
  configUser.id,
24914
24913
  projectActions,
24915
- fetchProjectThreads2,
24916
- fetchProjectWorks2,
24917
24914
  activeAgentId
24918
24915
  ]);
24919
24916
  const fetchWorks2 = useCallback(async () => {
@@ -24935,9 +24932,7 @@ var DocyAssistant = ({
24935
24932
  fetchThreads
24936
24933
  ]);
24937
24934
  useEffect(() => {
24938
- if (isOpen && (enableSidebar || enableNavDropdown) && uiState.activeTab === 3) {
24939
- fetchWorks2();
24940
- } else if (isOpen && (enableSidebar || enableNavDropdown)) {
24935
+ if (isOpen && (enableSidebar || enableNavDropdown)) {
24941
24936
  projectActions.setProjectsLoaded(false);
24942
24937
  fetchProjects2();
24943
24938
  }
@@ -24945,9 +24940,18 @@ var DocyAssistant = ({
24945
24940
  isOpen,
24946
24941
  enableSidebar,
24947
24942
  enableNavDropdown,
24948
- uiState.activeTab,
24949
24943
  projectActions,
24950
- fetchProjects2,
24944
+ fetchProjects2
24945
+ ]);
24946
+ useEffect(() => {
24947
+ if (isOpen && (enableSidebar || enableNavDropdown) && uiState.activeTab === 3) {
24948
+ fetchWorks2();
24949
+ }
24950
+ }, [
24951
+ isOpen,
24952
+ enableSidebar,
24953
+ enableNavDropdown,
24954
+ uiState.activeTab,
24951
24955
  fetchWorks2
24952
24956
  ]);
24953
24957
  useEffect(() => {
@@ -24955,6 +24959,17 @@ var DocyAssistant = ({
24955
24959
  fetchWorks2();
24956
24960
  }
24957
24961
  }, [isOpen, uiState.isRightSidebarOpen, fetchWorks2]);
24962
+ useEffect(() => {
24963
+ const { selectedProject, projectThreads, projectWorks } = projectState;
24964
+ if (!selectedProject) return;
24965
+ const { id: projectId } = selectedProject;
24966
+ if (!projectThreads[projectId]) {
24967
+ fetchProjectThreads2(projectId);
24968
+ }
24969
+ if (!projectWorks[projectId]) {
24970
+ fetchProjectWorks2(projectId);
24971
+ }
24972
+ }, [projectState, fetchProjectThreads2, fetchProjectWorks2]);
24958
24973
  const updateProject2 = async () => {
24959
24974
  await updateProject(apiClient, projectState, projectActions, fetchProjects2, t);
24960
24975
  };
@@ -25281,6 +25296,7 @@ var DocyAssistant = ({
25281
25296
  projects: projectState.projects,
25282
25297
  projectContext: projectState.projectContext,
25283
25298
  isFullscreen: opts.isFullscreen,
25299
+ isSidebarOpen: uiState.isSidebarOpen,
25284
25300
  onSaveTitle: async (newTitle) => {
25285
25301
  await updateSession(
25286
25302
  apiClient,