@next-bricks/ai-portal 0.56.2 → 0.58.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.
Files changed (108) hide show
  1. package/dist/bricks.json +44 -34
  2. package/dist/chunks/1488.89557180.js +2 -0
  3. package/dist/chunks/1488.89557180.js.map +1 -0
  4. package/dist/chunks/151.b87bccc0.js +2 -0
  5. package/dist/chunks/151.b87bccc0.js.map +1 -0
  6. package/dist/chunks/2232.75f1ab0f.js +2 -0
  7. package/dist/chunks/2232.75f1ab0f.js.map +1 -0
  8. package/dist/chunks/3848.01a4987f.js +3 -0
  9. package/dist/chunks/3848.01a4987f.js.map +1 -0
  10. package/dist/chunks/4002.68156a0e.js +3 -0
  11. package/dist/chunks/4002.68156a0e.js.map +1 -0
  12. package/dist/chunks/7041.d7408449.js +2 -0
  13. package/dist/chunks/7041.d7408449.js.map +1 -0
  14. package/dist/chunks/9496.08074e2b.js +2 -0
  15. package/dist/chunks/9496.08074e2b.js.map +1 -0
  16. package/dist/chunks/chat-box.1b2a4a02.js +2 -0
  17. package/dist/chunks/chat-box.1b2a4a02.js.map +1 -0
  18. package/dist/chunks/chat-input.3ca07b82.js +2 -0
  19. package/dist/chunks/chat-input.3ca07b82.js.map +1 -0
  20. package/dist/chunks/chat-stream.a7c4f58d.js +2 -0
  21. package/dist/chunks/chat-stream.a7c4f58d.js.map +1 -0
  22. package/dist/chunks/cruise-canvas.b444c4ca.js +2 -0
  23. package/dist/chunks/cruise-canvas.b444c4ca.js.map +1 -0
  24. package/dist/chunks/{main.e3031a8c.js → main.703a0465.js} +2 -2
  25. package/dist/chunks/{main.e3031a8c.js.map → main.703a0465.js.map} +1 -1
  26. package/dist/chunks/notice-dropdown.37b8ffb2.js +2 -0
  27. package/dist/chunks/notice-dropdown.37b8ffb2.js.map +1 -0
  28. package/dist/examples.json +20 -17
  29. package/dist/images/0155287e.svg +18 -0
  30. package/dist/images/0e89dec0.svg +19 -0
  31. package/dist/images/218d5865.svg +18 -0
  32. package/dist/images/391238ae.png +0 -0
  33. package/dist/images/96be9327.png +0 -0
  34. package/dist/images/dcee4821.svg +12 -0
  35. package/dist/index.7d751c21.js +2 -0
  36. package/dist/index.7d751c21.js.map +1 -0
  37. package/dist/manifest.json +299 -214
  38. package/dist/types.json +1442 -511
  39. package/dist-types/bootstrap.d.ts +1 -0
  40. package/dist-types/chat-box/index.d.ts +3 -12
  41. package/dist-types/chat-input/index.d.ts +5 -2
  42. package/dist-types/chat-stream/ChatStream.d.ts +1 -1
  43. package/dist-types/chat-stream/UserMessage/UserMessage.d.ts +3 -2
  44. package/dist-types/chat-stream/index.d.ts +3 -1
  45. package/dist-types/chat-stream/interfaces.d.ts +2 -1
  46. package/dist-types/cruise-canvas/CanvasContext.d.ts +0 -2
  47. package/dist-types/cruise-canvas/CruiseCanvas.d.ts +1 -1
  48. package/dist-types/cruise-canvas/FileList/FileList.d.ts +2 -1
  49. package/dist-types/cruise-canvas/Nav/Nav.d.ts +3 -6
  50. package/dist-types/cruise-canvas/NodeRequirement/NodeRequirement.d.ts +3 -2
  51. package/dist-types/cruise-canvas/i18n.d.ts +0 -2
  52. package/dist-types/cruise-canvas/index.d.ts +3 -1
  53. package/dist-types/cruise-canvas/interfaces.d.ts +2 -5
  54. package/dist-types/cruise-canvas/useConversationDetail.d.ts +2 -2
  55. package/dist-types/cruise-canvas/useConversationGraph.d.ts +0 -1
  56. package/dist-types/notice-dropdown/i18n.d.ts +18 -0
  57. package/dist-types/notice-dropdown/index.d.ts +61 -0
  58. package/dist-types/notice-dropdown/index.spec.d.ts +1 -0
  59. package/dist-types/shared/FilePreview/FilePreview.d.ts +9 -0
  60. package/dist-types/shared/FilePreview/FilePreviewDrawer.d.ts +6 -0
  61. package/dist-types/shared/FilePreview/i18n.d.ts +18 -0
  62. package/dist-types/shared/FileUpload/GlobalDragOverlay.d.ts +8 -0
  63. package/dist-types/shared/FileUpload/GlobalDragOverlay.spec.d.ts +1 -0
  64. package/dist-types/{chat-box → shared/FileUpload}/UploadButton.d.ts +2 -0
  65. package/dist-types/shared/FileUpload/UploadedFiles.d.ts +10 -0
  66. package/dist-types/shared/FileUpload/acceptFiles.d.ts +1 -0
  67. package/dist-types/shared/FileUpload/acceptFiles.spec.d.ts +1 -0
  68. package/dist-types/shared/FileUpload/i18n.d.ts +18 -0
  69. package/dist-types/{chat-box → shared/FileUpload}/interfaces.d.ts +1 -1
  70. package/dist-types/shared/PlanProgress/PlanProgress.d.ts +15 -0
  71. package/dist-types/shared/PlanProgress/i18n.d.ts +15 -0
  72. package/dist-types/shared/TaskContext.d.ts +4 -2
  73. package/dist-types/shared/bricks.d.ts +1 -0
  74. package/dist-types/shared/interfaces.d.ts +23 -5
  75. package/dist-types/shared/useFilesUploading.d.ts +12 -0
  76. package/dist-types/shared/useFilesUploading.spec.d.ts +1 -0
  77. package/dist-types/shared/useServiceFlowPlan.d.ts +2 -0
  78. package/dist-types/shared/useServiceFlowPlan.spec.d.ts +1 -0
  79. package/docs/notice-dropdown.md +101 -0
  80. package/package.json +2 -2
  81. package/dist/chunks/1510.ba18a788.js +0 -2
  82. package/dist/chunks/1510.ba18a788.js.map +0 -1
  83. package/dist/chunks/161.6c50f07c.js +0 -3
  84. package/dist/chunks/161.6c50f07c.js.map +0 -1
  85. package/dist/chunks/1864.7e31d8fe.js +0 -2
  86. package/dist/chunks/1864.7e31d8fe.js.map +0 -1
  87. package/dist/chunks/6995.65da5073.js +0 -2
  88. package/dist/chunks/6995.65da5073.js.map +0 -1
  89. package/dist/chunks/7279.af201b60.js +0 -3
  90. package/dist/chunks/7279.af201b60.js.map +0 -1
  91. package/dist/chunks/7517.f62fe00f.js +0 -2
  92. package/dist/chunks/7517.f62fe00f.js.map +0 -1
  93. package/dist/chunks/9270.e909e789.js +0 -2
  94. package/dist/chunks/9270.e909e789.js.map +0 -1
  95. package/dist/chunks/chat-box.4d1d4fd9.js +0 -2
  96. package/dist/chunks/chat-box.4d1d4fd9.js.map +0 -1
  97. package/dist/chunks/chat-input.dd3d2035.js +0 -2
  98. package/dist/chunks/chat-input.dd3d2035.js.map +0 -1
  99. package/dist/chunks/chat-stream.9f07e680.js +0 -2
  100. package/dist/chunks/chat-stream.9f07e680.js.map +0 -1
  101. package/dist/chunks/cruise-canvas.eca7469a.js +0 -2
  102. package/dist/chunks/cruise-canvas.eca7469a.js.map +0 -1
  103. package/dist/index.9a811707.js +0 -2
  104. package/dist/index.9a811707.js.map +0 -1
  105. package/dist-types/chat-box/FileListComponent.d.ts +0 -8
  106. package/dist-types/cruise-canvas/FilePreview/FilePreview.d.ts +0 -6
  107. /package/dist/chunks/{7279.af201b60.js.LICENSE.txt → 3848.01a4987f.js.LICENSE.txt} +0 -0
  108. /package/dist/chunks/{161.6c50f07c.js.LICENSE.txt → 4002.68156a0e.js.LICENSE.txt} +0 -0
@@ -30,3 +30,4 @@ import "./flow-tabs/index.js";
30
30
  import "./stage-flow/index.js";
31
31
  import "./data-providers/set-chat-command.js";
32
32
  import "./running-flow/index.js";
33
+ import "./notice-dropdown/index.js";
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { ReactNextElement } from "@next-core/react-element";
3
3
  import "@next-core/theme";
4
- import type { CommandPayload, UploadFileInfo } from "../shared/interfaces.js";
4
+ import type { ChatPayload, CommandPayload, UploadOptions } from "../shared/interfaces.js";
5
5
  export declare const ChatBoxComponent: React.ForwardRefExoticComponent<Omit<ChatBoxComponentProps, "ref"> & React.RefAttributes<ChatBoxRef>>;
6
6
  export interface ChatBoxProps {
7
7
  disabled?: boolean;
@@ -9,7 +9,7 @@ export interface ChatBoxProps {
9
9
  autoFocus?: boolean;
10
10
  aiEmployees?: AIEmployee[];
11
11
  commands?: Command[];
12
- uploadFiles?: UploadFileOptions;
12
+ uploadOptions?: UploadOptions;
13
13
  }
14
14
  export interface AIEmployee {
15
15
  employeeId: string;
@@ -26,14 +26,6 @@ export interface Command {
26
26
  options?: Command[];
27
27
  payload?: CommandPayload;
28
28
  }
29
- export interface UploadFileOptions {
30
- enabled?: boolean;
31
- accept?: string;
32
- }
33
- export interface ChatPayload {
34
- content: string;
35
- files?: UploadFileInfo[];
36
- }
37
29
  /**
38
30
  * 构件 `ai-portal.chat-box`
39
31
  */
@@ -45,7 +37,7 @@ export declare class ChatBox extends ReactNextElement implements ChatBoxProps {
45
37
  accessor autoFocus: boolean | undefined;
46
38
  accessor aiEmployees: AIEmployee[] | undefined;
47
39
  accessor commands: Command[] | undefined;
48
- accessor uploadFiles: UploadFileOptions | undefined;
40
+ accessor uploadOptions: UploadOptions | undefined;
49
41
  setValue(value: string): void;
50
42
  getValue(): string | undefined;
51
43
  focusOnInput(): void | undefined;
@@ -54,7 +46,6 @@ export declare class ChatBox extends ReactNextElement implements ChatBoxProps {
54
46
  interface ChatBoxComponentProps extends ChatBoxProps {
55
47
  onMessageSubmit: (value: string) => void;
56
48
  onChatSubmit: (payload: ChatPayload) => void;
57
- onEmployeeMention: (employee: AIEmployee | null) => void;
58
49
  onCommandSelect: (command: CommandPayload | null) => void;
59
50
  ref?: React.Ref<ChatBoxRef>;
60
51
  }
@@ -1,19 +1,21 @@
1
1
  import React from "react";
2
2
  import { ReactNextElement } from "@next-core/react-element";
3
3
  import "@next-core/theme";
4
+ import type { ChatPayload, UploadOptions } from "../shared/interfaces.js";
4
5
  export interface ChatInputProps {
5
6
  placeholder?: string;
6
7
  autoFocus?: boolean;
7
8
  submitDisabled?: boolean;
8
9
  supportsTerminate?: boolean;
9
10
  terminating?: boolean;
11
+ uploadOptions?: UploadOptions;
10
12
  }
11
13
  export interface ChatInputEvents {
12
- "message.submit": CustomEvent<string>;
14
+ "chat.submit": CustomEvent<ChatPayload>;
13
15
  terminate: Event;
14
16
  }
15
17
  export interface ChatInputMapEvents {
16
- onMessageSubmit: "message.submit";
18
+ onChatSubmit: "chat.submit";
17
19
  onTerminate: "terminate";
18
20
  }
19
21
  /**
@@ -26,5 +28,6 @@ export declare class ChatInput extends ReactNextElement implements ChatInputProp
26
28
  accessor submitDisabled: boolean | undefined;
27
29
  accessor supportsTerminate: boolean | undefined;
28
30
  accessor terminating: boolean | undefined;
31
+ accessor uploadOptions: UploadOptions | undefined;
29
32
  render(): React.JSX.Element;
30
33
  }
@@ -10,5 +10,5 @@ interface ChatStreamComponentProps extends ChatStreamProps {
10
10
  onFeedbackOnView: (viewId: string) => void;
11
11
  onDetailChange: (detail: ConversationDetail) => void;
12
12
  }
13
- export declare function ChatStreamComponent({ conversationId, initialRequest, replay, replayDelay, supports, showHumanActions, showFeedback: propShowFeedback, showFeedbackAfterFailed, showFeedbackOnView, showUiSwitch, previewUrlTemplate, showCases, exampleProjects, tryItOutUrl, onShare, onTerminate, onSubmitFeedback, onSwitchToCanvas, onFeedbackOnView, onDetailChange, }: ChatStreamComponentProps, ref: React.Ref<ChatStreamRef>): React.JSX.Element;
13
+ export declare function ChatStreamComponent({ conversationId, initialRequest, replay, replayDelay, supports, showHumanActions, showFeedback: propShowFeedback, showFeedbackAfterFailed, showFeedbackOnView, showUiSwitch, previewUrlTemplate, showCases, exampleProjects, tryItOutUrl, uploadOptions, onShare, onTerminate, onSubmitFeedback, onSwitchToCanvas, onFeedbackOnView, onDetailChange, }: ChatStreamComponentProps, ref: React.Ref<ChatStreamRef>): React.JSX.Element;
14
14
  export {};
@@ -1,7 +1,8 @@
1
1
  import React from "react";
2
- import type { CommandPayload } from "../../shared/interfaces";
2
+ import type { CommandPayload, FileInfo } from "../../shared/interfaces";
3
3
  export interface UserMessageProps {
4
4
  content: string;
5
5
  cmd?: CommandPayload;
6
+ files?: FileInfo[];
6
7
  }
7
- export declare function UserMessage({ content, cmd }: UserMessageProps): React.JSX.Element;
8
+ export declare function UserMessage({ content, cmd, files }: UserMessageProps): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { ReactNextElement } from "@next-core/react-element";
3
3
  import "@next-core/theme";
4
- import type { ExampleProject, RequestStore, ShowCaseType } from "../shared/interfaces.js";
4
+ import type { ExampleProject, RequestStore, ShowCaseType, UploadOptions } from "../shared/interfaces.js";
5
5
  export interface ChatStreamProps {
6
6
  conversationId?: string;
7
7
  initialRequest?: RequestStore | null;
@@ -17,6 +17,7 @@ export interface ChatStreamProps {
17
17
  showCases?: ShowCaseType[];
18
18
  exampleProjects?: ExampleProject[];
19
19
  tryItOutUrl?: string;
20
+ uploadOptions?: UploadOptions;
20
21
  }
21
22
  export interface ConversationDetail {
22
23
  projectId?: string;
@@ -48,6 +49,7 @@ export declare class ChatStream extends ReactNextElement implements ChatStreamPr
48
49
  accessor showCases: ShowCaseType[] | undefined;
49
50
  accessor exampleProjects: ExampleProject[] | undefined;
50
51
  accessor tryItOutUrl: string | undefined;
52
+ accessor uploadOptions: UploadOptions | undefined;
51
53
  resumed(): void;
52
54
  feedbackSubmitDone(): void;
53
55
  feedbackSubmitFailed(): void;
@@ -1,10 +1,11 @@
1
- import type { ActivityRun, CommandPayload, Job, ServiceFlowRun, Task } from "../shared/interfaces.js";
1
+ import type { ActivityRun, CommandPayload, FileInfo, Job, ServiceFlowRun, Task } from "../shared/interfaces.js";
2
2
  export type ChatMessage = MessageFromUser | MessageFromAssistant;
3
3
  export interface MessageFromUser {
4
4
  role: "user";
5
5
  content: string;
6
6
  cmd?: CommandPayload;
7
7
  fromSkippedSubTask?: boolean;
8
+ files?: FileInfo[];
8
9
  }
9
10
  export interface MessageFromAssistant {
10
11
  role: "assistant";
@@ -1,12 +1,10 @@
1
1
  import { type Dispatch } from "react";
2
2
  import type { SizeTuple } from "./interfaces";
3
- import type { FileInfo } from "../shared/interfaces";
4
3
  export interface CanvasContextValue {
5
4
  onNodeResize: (id: string, size: SizeTuple | null) => void;
6
5
  setActiveNodeId: Dispatch<React.SetStateAction<string | null>>;
7
6
  hoverOnScrollableContent: boolean;
8
7
  setHoverOnScrollableContent: Dispatch<React.SetStateAction<boolean>>;
9
8
  supports?: Record<string, boolean>;
10
- setActiveFile: Dispatch<React.SetStateAction<FileInfo | null>>;
11
9
  }
12
10
  export declare const CanvasContext: React.Context<CanvasContextValue>;
@@ -17,5 +17,5 @@ export interface CruiseCanvasRef {
17
17
  feedbackSubmitFailed: () => void;
18
18
  feedbackOnViewDone: (viewId: string) => void;
19
19
  }
20
- export declare function CruiseCanvasComponent({ conversationId, initialRequest, replay, replayDelay, supports, showHiddenJobs, showHumanActions, showFeedback: propShowFeedback, showFeedbackAfterFailed, showFeedbackOnView, showUiSwitch, showJsxEditor, previewUrlTemplate, showCases, exampleProjects, tryItOutUrl, separateInstructions, onShare, onTerminate, onSubmitFeedback, onSwitchToChat, onFeedbackOnView, onDetailChange, }: CruiseCanvasComponentProps, ref: React.Ref<CruiseCanvasRef>): React.JSX.Element;
20
+ export declare function CruiseCanvasComponent({ conversationId, initialRequest, replay, replayDelay, supports, showHiddenJobs, showHumanActions, showFeedback: propShowFeedback, showFeedbackAfterFailed, showFeedbackOnView, showUiSwitch, showJsxEditor, previewUrlTemplate, showCases, exampleProjects, tryItOutUrl, separateInstructions, uploadOptions, onShare, onTerminate, onSubmitFeedback, onSwitchToChat, onFeedbackOnView, onDetailChange, }: CruiseCanvasComponentProps, ref: React.Ref<CruiseCanvasRef>): React.JSX.Element;
21
21
  export {};
@@ -3,5 +3,6 @@ import type { FileInfo } from "../../shared/interfaces";
3
3
  export interface FileListProps {
4
4
  files: FileInfo[];
5
5
  large?: boolean;
6
+ onFileClick?: (file: FileInfo) => void;
6
7
  }
7
- export declare function FileList({ files, large }: FileListProps): React.JSX.Element;
8
+ export declare function FileList({ files, large, onFileClick }: FileListProps): React.JSX.Element;
@@ -1,13 +1,10 @@
1
1
  import React from "react";
2
- import type { GraphNavItem, Step } from "../interfaces";
3
- import type { ConversationState, Job, TaskState } from "../../shared/interfaces";
2
+ import type { GraphNavItem } from "../interfaces";
3
+ import type { ConversationState, TaskState } from "../../shared/interfaces";
4
4
  export interface NavProps {
5
5
  nav: GraphNavItem[] | undefined;
6
- plan: Step[] | undefined;
7
- jobMap: Map<string, Job> | undefined;
8
- jobLevels: Map<string, number> | undefined;
9
6
  currentNavId: string | null;
10
7
  taskState: TaskState | ConversationState | undefined;
11
8
  onClick: (jobId: string) => void;
12
9
  }
13
- export declare function Nav({ nav, plan, jobMap, jobLevels, currentNavId, taskState, onClick, }: NavProps): React.JSX.Element;
10
+ export declare function Nav({ nav, currentNavId, taskState, onClick }: NavProps): React.JSX.Element;
@@ -1,9 +1,10 @@
1
- import type { CommandPayload } from "../../shared/interfaces";
1
+ import type { CommandPayload, FileInfo } from "../../shared/interfaces";
2
2
  export interface NodeRequirementProps {
3
3
  username?: string;
4
4
  content?: string;
5
5
  startTime?: number;
6
6
  active?: boolean;
7
7
  cmd?: CommandPayload;
8
+ files?: FileInfo[];
8
9
  }
9
- export declare function NodeRequirement({ username, content, startTime, active, cmd, }: NodeRequirementProps): JSX.Element;
10
+ export declare function NodeRequirement({ username, content, startTime, active, cmd, files, }: NodeRequirementProps): JSX.Element;
@@ -14,8 +14,6 @@ export declare enum K {
14
14
  FULLSCREEN = "FULLSCREEN",
15
15
  SEND_MESSAGE = "SEND_MESSAGE",
16
16
  UNTITLED = "UNTITLED",
17
- FILE_PREVIEW_UNPREVIEWABLE_TIP_PREFIX = "FILE_PREVIEW_UNPREVIEWABLE_TIP_PREFIX",
18
- FILE_PREVIEW_UNPREVIEWABLE_TIP_SUFFIX = "FILE_PREVIEW_UNPREVIEWABLE_TIP_SUFFIX",
19
17
  DOWNLOAD = "DOWNLOAD",
20
18
  INITIATING_SERVICE_FLOW = "INITIATING_SERVICE_FLOW",
21
19
  STARTING_SERVICE_FLOW_ACTIVITY = "STARTING_SERVICE_FLOW_ACTIVITY"
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { ReactNextElement } from "@next-core/react-element";
3
3
  import "@next-core/theme";
4
- import type { ExampleProject, RequestStore, ShowCaseType } from "../shared/interfaces.js";
4
+ import type { ExampleProject, RequestStore, ShowCaseType, UploadOptions } from "../shared/interfaces.js";
5
5
  export interface CruiseCanvasProps {
6
6
  conversationId?: string;
7
7
  initialRequest?: RequestStore | null;
@@ -20,6 +20,7 @@ export interface CruiseCanvasProps {
20
20
  exampleProjects?: ExampleProject[];
21
21
  tryItOutUrl?: string;
22
22
  separateInstructions?: boolean;
23
+ uploadOptions?: UploadOptions;
23
24
  }
24
25
  export interface ConversationDetail {
25
26
  projectId?: string;
@@ -54,6 +55,7 @@ export declare class CruiseCanvas extends ReactNextElement implements CruiseCanv
54
55
  accessor exampleProjects: ExampleProject[] | undefined;
55
56
  accessor tryItOutUrl: string | undefined;
56
57
  accessor separateInstructions: boolean | undefined;
58
+ accessor uploadOptions: UploadOptions | undefined;
57
59
  resumed(): void;
58
60
  feedbackSubmitDone(): void;
59
61
  feedbackSubmitFailed(): void;
@@ -1,5 +1,5 @@
1
1
  import type { JSONSchema } from "./json-schema";
2
- import type { ActivityRun, CommandPayload, GeneratedView, Job, JobState, ServiceFlowRun } from "../shared/interfaces";
2
+ import type { ActivityRun, CommandPayload, FileInfo, GeneratedView, Job, JobState, ServiceFlowRun } from "../shared/interfaces";
3
3
  export type RangeTuple = [min: number, max: number];
4
4
  export type SizeTuple = [width: number, height: number];
5
5
  export interface NodePosition {
@@ -17,6 +17,7 @@ export interface RequirementGraphNode extends BaseGraphNode {
17
17
  content: string;
18
18
  username?: string;
19
19
  cmd?: CommandPayload;
20
+ files?: FileInfo[];
20
21
  }
21
22
  export interface LoadingGraphNode extends BaseGraphNode {
22
23
  type: "loading";
@@ -73,10 +74,6 @@ export interface NodeRect extends NodePosition {
73
74
  export interface Edge {
74
75
  points: NodePosition[];
75
76
  }
76
- export interface Step {
77
- id: string;
78
- instruction: string;
79
- }
80
77
  export interface GraphNavItem {
81
78
  id: string;
82
79
  title: string;
@@ -1,10 +1,10 @@
1
- import type { RequestStore } from "../shared/interfaces";
1
+ import type { ExtraChatPayload, RequestStore } from "../shared/interfaces";
2
2
  export declare function useConversationDetail(conversationId: string, initialRequest?: RequestStore | null, replay?: boolean, replayDelay?: number): {
3
3
  conversation: import("../shared/interfaces").ConversationBaseDetail | null;
4
4
  tasks: import("../shared/interfaces").Task[];
5
5
  serviceFlows: import("../shared/interfaces").ServiceFlowRun[];
6
6
  errors: import("../shared/interfaces").ConversationError[];
7
- humanInputRef: React.MutableRefObject<((jobId: string, input: string | null, action?: string) => void) | undefined>;
7
+ humanInputRef: React.MutableRefObject<((input: string | null, action?: string, extra?: ExtraChatPayload) => void) | undefined>;
8
8
  skipToResults: () => void;
9
9
  watchAgain: () => Promise<void>;
10
10
  };
@@ -10,5 +10,4 @@ export declare function useConversationGraph(conversation: ConversationBaseDetai
10
10
  nav: GraphNavItem[];
11
11
  views: GraphGeneratedView[];
12
12
  jobMap: Map<string, import("../shared/interfaces").Job>;
13
- jobLevels: Map<string, number>;
14
13
  } | null;
@@ -0,0 +1,18 @@
1
+ export declare enum K {
2
+ MESSAGE_LIST = "MESSAGE_LIST",
3
+ NO_NEW_MESSAGE = "NO_NEW_MESSAGE",
4
+ MARK_ALL_READ = "MARK_ALL_READ",
5
+ ENTER_MESSAGE_CENTER = "ENTER_MESSAGE_CENTER"
6
+ }
7
+ export declare const NS = "bricks/ai-portal/notice-dropdown";
8
+ export declare const locales: {
9
+ en: Locale;
10
+ zh: Locale;
11
+ };
12
+ export declare const t: any;
13
+ type Locale = {
14
+ [k in K]: string;
15
+ } & {
16
+ [k in K as `${k}_plural`]?: string;
17
+ };
18
+ export {};
@@ -0,0 +1,61 @@
1
+ import React from "react";
2
+ import { ReactNextElement } from "@next-core/react-element";
3
+ import "@next-core/theme";
4
+ import { Placement } from "@next-bricks/basic/popover";
5
+ export interface NoticeItem {
6
+ /** 消息唯一标识 */
7
+ id: string;
8
+ /** 消息类型 */
9
+ type: string;
10
+ /** 是否未读 */
11
+ isUnread: boolean;
12
+ /** 主标题 */
13
+ title: string;
14
+ /** 副标题/描述 */
15
+ description: string;
16
+ }
17
+ export interface NoticeDropdownProps {
18
+ /** 消息数据列表 */
19
+ dataSource?: NoticeItem[];
20
+ /** 弹窗位置 */
21
+ popoverPlacement?: Placement;
22
+ /** 空状态文案 */
23
+ emptyText?: string;
24
+ /** 通知中心URL */
25
+ notifyCenterUrl?: string;
26
+ /** 详情链接 */
27
+ urlTemplate?: string;
28
+ /** 下拉框最大宽度 */
29
+ dropdownMaxWidth?: string | number;
30
+ /** 下拉框内容样式 */
31
+ dropdownContentStyle?: React.CSSProperties;
32
+ /** 是否隐藏进入消息中心按钮 */
33
+ hideNotifyCenterButton?: boolean;
34
+ }
35
+ /**
36
+ * 构件 `ai-portal.notice-dropdown`
37
+ *
38
+ * 消息通知下拉框构件,用于展示消息列表
39
+ */
40
+ export declare class NoticeDropdown extends ReactNextElement implements NoticeDropdownProps {
41
+ #private;
42
+ /** 消息数据列表 */
43
+ accessor dataSource: NoticeItem[] | undefined;
44
+ /**
45
+ * 弹窗位置
46
+ */
47
+ accessor popoverPlacement: Placement | undefined;
48
+ /** 空状态文案 */
49
+ accessor emptyText: string | undefined;
50
+ /** 通知中心URL */
51
+ accessor notifyCenterUrl: string | undefined;
52
+ /** 详情链接 */
53
+ accessor urlTemplate: string | undefined;
54
+ /** 下拉框最大宽度 */
55
+ accessor dropdownMaxWidth: string | number | undefined;
56
+ /** 下拉框内容样式 */
57
+ accessor dropdownContentStyle: React.CSSProperties | undefined;
58
+ /** 是否隐藏进入消息中心按钮 */
59
+ accessor hideNotifyCenterButton: boolean | undefined;
60
+ render(): React.JSX.Element;
61
+ }
@@ -0,0 +1 @@
1
+ import "./";
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import type { FileInfo } from "../../shared/interfaces";
3
+ export interface FilePreviewProps {
4
+ file: FileInfo;
5
+ }
6
+ export interface FilePreviewRef {
7
+ download: () => void;
8
+ }
9
+ export declare const FilePreview: React.ForwardRefExoticComponent<FilePreviewProps & React.RefAttributes<FilePreviewRef>>;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import type { FileInfo } from "../interfaces";
3
+ export interface FilePreviewDrawerProps {
4
+ file: FileInfo;
5
+ }
6
+ export declare function FilePreviewDrawer({ file }: FilePreviewDrawerProps): React.JSX.Element;
@@ -0,0 +1,18 @@
1
+ export declare enum K {
2
+ UNTITLED = "UNTITLED",
3
+ FILE_PREVIEW_UNPREVIEWABLE_TIP_PREFIX = "FILE_PREVIEW_UNPREVIEWABLE_TIP_PREFIX",
4
+ FILE_PREVIEW_UNPREVIEWABLE_TIP_SUFFIX = "FILE_PREVIEW_UNPREVIEWABLE_TIP_SUFFIX",
5
+ DOWNLOAD = "DOWNLOAD"
6
+ }
7
+ export declare const NS = "bricks/ai-portal/FilePreview";
8
+ export declare const locales: {
9
+ en: Locale;
10
+ zh: Locale;
11
+ };
12
+ export declare const t: any;
13
+ type Locale = {
14
+ [k in K]: string;
15
+ } & {
16
+ [k in K as `${k}_plural`]?: string;
17
+ };
18
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ export interface GlobalDragOverlayProps {
3
+ disabled?: boolean;
4
+ accept?: string;
5
+ dragTips?: string;
6
+ onFilesDropped?: (files: File[]) => void;
7
+ }
8
+ export default function GlobalDragOverlay({ disabled, accept, dragTips, onFilesDropped, }: GlobalDragOverlayProps): React.ReactPortal | null;
@@ -0,0 +1 @@
1
+ import "@testing-library/jest-dom";
@@ -1,7 +1,9 @@
1
1
  import React from "react";
2
2
  import type { FileItem } from "./interfaces";
3
+ export declare function getNextUid(): number;
3
4
  export interface UploadButtonProps {
4
5
  accept?: string;
6
+ disabled?: boolean;
5
7
  onChange?: (files: FileItem[] | undefined) => void;
6
8
  }
7
9
  export interface UploadButtonRef {
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import type { FileItem } from "./interfaces";
3
+ export interface UploadedFilesProps {
4
+ files: FileItem[];
5
+ maxFiles?: number;
6
+ className?: string;
7
+ onRemove: (uid: number, abortController: AbortController | undefined) => void;
8
+ onAdd: () => void;
9
+ }
10
+ export declare function UploadedFiles({ files, maxFiles, className, onRemove, onAdd, }: UploadedFilesProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function acceptFiles(accept: string, files: File[]): boolean;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ export declare enum K {
2
+ UPLOAD_FILES = "UPLOAD_FILES",
3
+ UPLOADING = "UPLOADING",
4
+ UPLOAD_FAILED = "UPLOAD_FAILED",
5
+ DROP_FILES_HERE = "DROP_FILES_HERE"
6
+ }
7
+ export declare const NS = "bricks/ai-portal/FileUpload";
8
+ export declare const locales: {
9
+ en: Locale;
10
+ zh: Locale;
11
+ };
12
+ export declare const t: any;
13
+ type Locale = {
14
+ [k in K]: string;
15
+ } & {
16
+ [k in K as `${k}_plural`]?: string;
17
+ };
18
+ export {};
@@ -1,4 +1,4 @@
1
- import type { UploadFileInfo } from "../shared/interfaces";
1
+ import type { UploadFileInfo } from "../interfaces";
2
2
  export interface FileItem {
3
3
  uid: number;
4
4
  file: File;
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import type { ConversationState, PlanStep, TaskState } from "../interfaces";
3
+ export interface PlanProgressProps {
4
+ plan: PlanStep[];
5
+ conversationState?: ConversationState;
6
+ style?: React.CSSProperties;
7
+ }
8
+ export declare function PlanProgress({ plan, conversationState, style, }: PlanProgressProps): JSX.Element | null;
9
+ interface PlanStepProps {
10
+ state?: TaskState;
11
+ conversationState?: ConversationState;
12
+ name: string;
13
+ }
14
+ declare function PlanStep({ state, conversationState, name }: PlanStepProps): React.JSX.Element;
15
+ export {};
@@ -0,0 +1,15 @@
1
+ export declare enum K {
2
+ PLAN_COMPLETED = "PLAN_COMPLETED"
3
+ }
4
+ export declare const NS = "bricks/ai-portal/PlanProgress";
5
+ export declare const locales: {
6
+ en: Locale;
7
+ zh: Locale;
8
+ };
9
+ export declare const t: any;
10
+ type Locale = {
11
+ [k in K]: string;
12
+ } & {
13
+ [k in K as `${k}_plural`]?: string;
14
+ };
15
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { type Dispatch } from "react";
2
2
  import type { FeedbackDetail } from "../cruise-canvas/interfaces";
3
- import type { ActiveDetail, ConversationError, ConversationState, ExampleProject, GeneratedView, Job, ShowCaseType, Task } from "./interfaces";
3
+ import type { ActiveDetail, ConversationError, ConversationState, ExampleProject, ExtraChatPayload, FileInfo, GeneratedView, Job, ShowCaseType, Task, UploadOptions } from "./interfaces";
4
4
  export interface TaskContextValue {
5
5
  conversationId?: string;
6
6
  conversationState?: ConversationState;
@@ -11,7 +11,8 @@ export interface TaskContextValue {
11
11
  replay?: boolean;
12
12
  showCases?: ShowCaseType[];
13
13
  exampleProjects?: ExampleProject[];
14
- humanInput: (jobId: string, input: string | null, action?: string) => void;
14
+ uploadOptions?: UploadOptions;
15
+ humanInput: (input: string | null, action?: string, extra?: ExtraChatPayload) => void;
15
16
  onShare: () => void;
16
17
  onTerminate: () => void;
17
18
  supports?: Record<string, boolean>;
@@ -37,5 +38,6 @@ export interface TaskContextValue {
37
38
  watchAgain?: () => void;
38
39
  tryItOut?: () => void;
39
40
  separateInstructions?: boolean;
41
+ setActiveFile: Dispatch<React.SetStateAction<FileInfo | null>>;
40
42
  }
41
43
  export declare const TaskContext: React.Context<TaskContextValue>;
@@ -19,6 +19,7 @@ export declare const WrappedTooltip: import("@next-core/react-element").WrappedB
19
19
  export declare const WrappedPopover: import("@next-core/react-element").WrappedBrick<Popover, PopoverProps>;
20
20
  export declare const WrappedDrawer: import("@next-core/react-element").WrappedBrickWithEventsMap<Drawer, DrawerProps & {
21
21
  keyboard?: boolean;
22
+ themeVariant?: "default" | "elevo";
22
23
  }, DrawerEvents, DrawerMapEvents>;
23
24
  export declare const WrappedIconButton: import("@next-core/react-element").WrappedBrick<IconButton, IconButtonProps>;
24
25
  export declare const WrappedChatInput: import("@next-core/react-element").WrappedBrickWithEventsMap<ChatInput, ChatInputProps, ChatInputEvents, ChatInputMapEvents>;
@@ -15,14 +15,13 @@ export interface Task {
15
15
  upstream?: string[];
16
16
  parent?: string;
17
17
  state: TaskState;
18
- plan: Step[];
19
18
  jobs: Job[];
20
19
  startTime: number;
21
20
  endTime?: number;
22
21
  aiEmployeeId?: string;
23
22
  }
24
23
  export type ConversationState = "working" | "completed" | "failed" | "input-required" | "terminated";
25
- export type TaskState = "free" | "confirming" | "executing" | "input-required" | "completed" | "failed";
24
+ export type TaskState = "working" | "input-required" | "completed" | "failed";
26
25
  export type JobState = "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "skipped" | "unknown";
27
26
  export interface Job {
28
27
  id: string;
@@ -47,6 +46,7 @@ export interface Job {
47
46
  aiEmployeeId?: string;
48
47
  username?: string;
49
48
  cmd?: CommandPayload;
49
+ mentionedAiEmployeeId?: string;
50
50
  }
51
51
  export type HumanAction = HumanActionConfirm | HumanActionSelect;
52
52
  export interface HumanActionConfirm {
@@ -109,15 +109,28 @@ export interface TaskPatch extends Omit<Partial<Task>, "jobs"> {
109
109
  export interface JobPatch extends Partial<Job> {
110
110
  id: string;
111
111
  }
112
- export interface RequestStore {
112
+ export interface RequestStore extends ExtraChatPayload {
113
113
  conversationId: string;
114
114
  content: string;
115
- cmd?: CommandPayload;
116
- files?: UploadFileInfo[];
117
115
  }
118
116
  export interface UploadFileInfo {
119
117
  fileId: string;
120
118
  }
119
+ export interface UploadOptions {
120
+ enabled?: boolean;
121
+ dragDisabled?: boolean;
122
+ dragTips?: string;
123
+ accept?: string;
124
+ maxFiles?: number;
125
+ }
126
+ export interface ChatPayload extends ExtraChatPayload {
127
+ content: string;
128
+ }
129
+ export interface ExtraChatPayload {
130
+ files?: UploadFileInfo[];
131
+ cmd?: CommandPayload | null;
132
+ aiEmployeeId?: string | null;
133
+ }
121
134
  export interface GeneratedView {
122
135
  viewId: string;
123
136
  code: string;
@@ -207,3 +220,8 @@ export interface ActiveDetailOfActivity {
207
220
  activity: ActivityRun;
208
221
  flow: ServiceFlowRun;
209
222
  }
223
+ export interface PlanStep {
224
+ name: string;
225
+ taskId?: string;
226
+ state?: TaskState;
227
+ }
@@ -0,0 +1,12 @@
1
+ import type { FileItem } from "./FileUpload/interfaces";
2
+ import type { UploadFileInfo } from "./interfaces";
3
+ export declare function useFilesUploading(maxFiles?: number): {
4
+ files: FileItem[] | undefined;
5
+ resetFiles: () => void;
6
+ appendFiles: (newFiles: FileItem[] | undefined) => void;
7
+ removeFile: (uid: number) => void;
8
+ hasFiles: boolean;
9
+ allFilesDone: boolean;
10
+ fileInfos: UploadFileInfo[] | undefined;
11
+ exceeded: boolean;
12
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { PlanStep, ServiceFlowRun, Task } from "./interfaces";
2
+ export declare function useServiceFlowPlan(serviceFlows: ServiceFlowRun[], tasks: Task[]): PlanStep[];
@@ -0,0 +1 @@
1
+ export {};