@next-bricks/ai-portal 0.60.3 → 0.61.1
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/bricks.json +22 -21
- package/dist/chunks/{1480.0de951a3.js → 1480.a7ffdf61.js} +2 -2
- package/dist/chunks/1480.a7ffdf61.js.map +1 -0
- package/dist/chunks/{2232.085b8abd.js → 2232.06e10f13.js} +2 -2
- package/dist/chunks/2232.06e10f13.js.map +1 -0
- package/dist/chunks/{5712.f692e3f5.js → 5712.6b8e0a77.js} +2 -2
- package/dist/chunks/5712.6b8e0a77.js.map +1 -0
- package/dist/chunks/9164.34a6f72c.js +2 -0
- package/dist/chunks/9164.34a6f72c.js.map +1 -0
- package/dist/chunks/9271.24992b40.js +2 -0
- package/dist/chunks/9271.24992b40.js.map +1 -0
- package/dist/chunks/action-buttons.68666920.js.map +1 -1
- package/dist/chunks/chat-box.3a31adcd.js +3 -0
- package/dist/chunks/chat-box.3a31adcd.js.map +1 -0
- package/dist/chunks/chat-input.8d663f4e.js +3 -0
- package/dist/chunks/chat-input.8d663f4e.js.LICENSE.txt +1 -0
- package/dist/chunks/chat-input.8d663f4e.js.map +1 -0
- package/dist/chunks/chat-stream.d3cde350.js +2 -0
- package/dist/chunks/chat-stream.d3cde350.js.map +1 -0
- package/dist/chunks/cruise-canvas.c1a7bc9f.js +2 -0
- package/dist/chunks/cruise-canvas.c1a7bc9f.js.map +1 -0
- package/dist/chunks/dropdown-select.336442ba.js.map +1 -1
- package/dist/chunks/home-container.f1829834.js.map +1 -1
- package/dist/chunks/icon-button.66d6d83a.js.map +1 -1
- package/dist/chunks/{main.fc9fd5d4.js → main.08d6c690.js} +2 -2
- package/dist/chunks/{main.fc9fd5d4.js.map → main.08d6c690.js.map} +1 -1
- package/dist/examples.json +12 -12
- package/dist/{index.f2850973.js → index.cd8279e0.js} +2 -2
- package/dist/{index.f2850973.js.map → index.cd8279e0.js.map} +1 -1
- package/dist/manifest.json +196 -160
- package/dist/types.json +667 -660
- package/dist-types/action-buttons/index.d.ts +1 -2
- package/dist-types/chat-box/index.d.ts +3 -10
- package/dist-types/chat-input/i18n.d.ts +3 -1
- package/dist-types/chat-input/index.d.ts +16 -1
- package/dist-types/chat-stream/ChatStream.d.ts +1 -1
- package/dist-types/chat-stream/index.d.ts +6 -0
- package/dist-types/cruise-canvas/CruiseCanvas.d.ts +1 -1
- package/dist-types/cruise-canvas/index.d.ts +6 -0
- package/dist-types/dropdown-select/index.d.ts +1 -2
- package/dist-types/home-container/index.d.ts +4 -1
- package/dist-types/icon-button/index.d.ts +5 -4
- package/dist-types/jsx.d.ts +81 -22
- package/dist-types/shared/ChatCompletions/useChatCompletions.d.ts +65 -0
- package/dist-types/shared/TaskContext.d.ts +3 -0
- package/dist-types/shared/interfaces.d.ts +1 -1
- package/package.json +2 -2
- package/dist/chunks/1480.0de951a3.js.map +0 -1
- package/dist/chunks/2232.085b8abd.js.map +0 -1
- package/dist/chunks/2324.a4a90c77.js +0 -2
- package/dist/chunks/2324.a4a90c77.js.map +0 -1
- package/dist/chunks/5712.f692e3f5.js.map +0 -1
- package/dist/chunks/6792.03e66697.js +0 -2
- package/dist/chunks/6792.03e66697.js.map +0 -1
- package/dist/chunks/chat-box.a8e58e50.js +0 -3
- package/dist/chunks/chat-box.a8e58e50.js.map +0 -1
- package/dist/chunks/chat-input.e999f79c.js +0 -2
- package/dist/chunks/chat-input.e999f79c.js.map +0 -1
- package/dist/chunks/chat-stream.8d8dc5a0.js +0 -2
- package/dist/chunks/chat-stream.8d8dc5a0.js.map +0 -1
- package/dist/chunks/cruise-canvas.4a0692fb.js +0 -2
- package/dist/chunks/cruise-canvas.4a0692fb.js.map +0 -1
- /package/dist/chunks/{chat-box.a8e58e50.js.LICENSE.txt → chat-box.3a31adcd.js.LICENSE.txt} +0 -0
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { ReactNextElement } from "@next-core/react-element";
|
|
3
3
|
import "@next-core/theme";
|
|
4
4
|
import type { GeneralIconProps } from "@next-bricks/icons/general-icon";
|
|
5
|
-
interface ActionItem {
|
|
5
|
+
export interface ActionItem {
|
|
6
6
|
text: string;
|
|
7
7
|
key: string;
|
|
8
8
|
icon?: GeneralIconProps;
|
|
@@ -21,4 +21,3 @@ export declare class ActionButtons extends ReactNextElement implements ActionBut
|
|
|
21
21
|
accessor activeKey: string | null | undefined;
|
|
22
22
|
render(): React.JSX.Element;
|
|
23
23
|
}
|
|
24
|
-
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
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,
|
|
4
|
+
import type { ChatPayload, UploadOptions } from "../shared/interfaces.js";
|
|
5
|
+
import { type Command } from "../shared/ChatCompletions/useChatCompletions.js";
|
|
5
6
|
export declare const ChatBoxComponent: React.ForwardRefExoticComponent<Omit<ChatBoxComponentProps, "ref"> & React.RefAttributes<ChatBoxRef>>;
|
|
6
7
|
export interface ChatBoxProps {
|
|
7
8
|
disabled?: boolean;
|
|
@@ -20,16 +21,8 @@ export interface ChatBoxRef {
|
|
|
20
21
|
getValue: () => string;
|
|
21
22
|
focusOnInput: () => void;
|
|
22
23
|
}
|
|
23
|
-
export interface Command {
|
|
24
|
-
label: string;
|
|
25
|
-
value: string;
|
|
26
|
-
groupKey?: string;
|
|
27
|
-
groupLabel?: string;
|
|
28
|
-
subCommands?: Command[];
|
|
29
|
-
payload?: CommandPayload;
|
|
30
|
-
}
|
|
31
24
|
/**
|
|
32
|
-
*
|
|
25
|
+
* 大型聊天输入框,用于首页
|
|
33
26
|
*/
|
|
34
27
|
export declare class ChatBox extends ReactNextElement implements ChatBoxProps {
|
|
35
28
|
#private;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare enum K {
|
|
2
|
-
TERMINATE_THE_TASK = "TERMINATE_THE_TASK"
|
|
2
|
+
TERMINATE_THE_TASK = "TERMINATE_THE_TASK",
|
|
3
|
+
COMMAND_TIPS = "COMMAND_TIPS",
|
|
4
|
+
SEARCH_COMMANDS_TIPS = "SEARCH_COMMANDS_TIPS"
|
|
3
5
|
}
|
|
4
6
|
export declare const NS = "bricks/ai-portal/chat-input";
|
|
5
7
|
export declare const locales: {
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ReactNextElement } from "@next-core/react-element";
|
|
3
3
|
import "@next-core/theme";
|
|
4
|
+
import type { ActionsEvents, ActionsEventsMapping, ActionsProps, EoActions } from "@next-bricks/basic/actions";
|
|
4
5
|
import type { ChatPayload, UploadOptions } from "../shared/interfaces.js";
|
|
6
|
+
import { type AIEmployee, type Command } from "../shared/ChatCompletions/useChatCompletions.js";
|
|
7
|
+
export declare const WrappedActions: import("@next-core/react-element").WrappedBrickWithEventsMap<EoActions, ActionsProps & {
|
|
8
|
+
activeKeys?: (string | number)[];
|
|
9
|
+
footerTips?: string;
|
|
10
|
+
}, ActionsEvents, ActionsEventsMapping>;
|
|
5
11
|
export interface ChatInputProps {
|
|
6
12
|
placeholder?: string;
|
|
7
13
|
autoFocus?: boolean;
|
|
@@ -9,6 +15,9 @@ export interface ChatInputProps {
|
|
|
9
15
|
supportsTerminate?: boolean;
|
|
10
16
|
terminating?: boolean;
|
|
11
17
|
uploadOptions?: UploadOptions;
|
|
18
|
+
aiEmployees?: AIEmployee[];
|
|
19
|
+
commands?: Command[];
|
|
20
|
+
suggestionsPlacement?: "top" | "bottom";
|
|
12
21
|
}
|
|
13
22
|
export interface ChatInputEvents {
|
|
14
23
|
"chat.submit": CustomEvent<ChatPayload>;
|
|
@@ -19,7 +28,7 @@ export interface ChatInputMapEvents {
|
|
|
19
28
|
onTerminate: "terminate";
|
|
20
29
|
}
|
|
21
30
|
/**
|
|
22
|
-
*
|
|
31
|
+
* 小型聊天输入框,用于对话等页面
|
|
23
32
|
*/
|
|
24
33
|
export declare class ChatInput extends ReactNextElement implements ChatInputProps {
|
|
25
34
|
#private;
|
|
@@ -29,5 +38,11 @@ export declare class ChatInput extends ReactNextElement implements ChatInputProp
|
|
|
29
38
|
accessor supportsTerminate: boolean | undefined;
|
|
30
39
|
accessor terminating: boolean | undefined;
|
|
31
40
|
accessor uploadOptions: UploadOptions | undefined;
|
|
41
|
+
accessor aiEmployees: AIEmployee[] | undefined;
|
|
42
|
+
accessor commands: Command[] | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* @default "bottom"
|
|
45
|
+
*/
|
|
46
|
+
accessor suggestionsPlacement: "top" | "bottom" | undefined;
|
|
32
47
|
render(): React.JSX.Element;
|
|
33
48
|
}
|
|
@@ -11,5 +11,5 @@ interface ChatStreamComponentProps extends ChatStreamProps {
|
|
|
11
11
|
onDetailChange: (detail: ConversationDetail) => void;
|
|
12
12
|
onSplitChange: (split: boolean) => void;
|
|
13
13
|
}
|
|
14
|
-
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, onSplitChange, }: ChatStreamComponentProps, ref: React.Ref<ChatStreamRef>): React.JSX.Element;
|
|
14
|
+
export declare function ChatStreamComponent({ conversationId, initialRequest, replay, replayDelay, supports, showHumanActions, showFeedback: propShowFeedback, showFeedbackAfterFailed, showFeedbackOnView, showUiSwitch, previewUrlTemplate, showCases, exampleProjects, tryItOutUrl, aiEmployees, commands, uploadOptions, onShare, onTerminate, onSubmitFeedback, onSwitchToCanvas, onFeedbackOnView, onDetailChange, onSplitChange, }: ChatStreamComponentProps, ref: React.Ref<ChatStreamRef>): React.JSX.Element;
|
|
15
15
|
export {};
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { ReactNextElement } from "@next-core/react-element";
|
|
3
3
|
import "@next-core/theme";
|
|
4
4
|
import type { ExampleProject, RequestStore, ShowCaseType, UploadOptions } from "../shared/interfaces.js";
|
|
5
|
+
import type { AIEmployee, Command } from "../shared/ChatCompletions/useChatCompletions.js";
|
|
5
6
|
export interface ChatStreamProps {
|
|
6
7
|
conversationId?: string;
|
|
7
8
|
initialRequest?: RequestStore | null;
|
|
@@ -17,7 +18,10 @@ export interface ChatStreamProps {
|
|
|
17
18
|
showCases?: ShowCaseType[];
|
|
18
19
|
exampleProjects?: ExampleProject[];
|
|
19
20
|
tryItOutUrl?: string;
|
|
21
|
+
aiEmployees?: AIEmployee[];
|
|
22
|
+
commands?: Command[];
|
|
20
23
|
uploadOptions?: UploadOptions;
|
|
24
|
+
hideMermaid?: boolean;
|
|
21
25
|
}
|
|
22
26
|
export interface ConversationDetail {
|
|
23
27
|
projectId?: string;
|
|
@@ -49,6 +53,8 @@ export declare class ChatStream extends ReactNextElement implements ChatStreamPr
|
|
|
49
53
|
accessor showCases: ShowCaseType[] | undefined;
|
|
50
54
|
accessor exampleProjects: ExampleProject[] | undefined;
|
|
51
55
|
accessor tryItOutUrl: string | undefined;
|
|
56
|
+
accessor aiEmployees: AIEmployee[] | undefined;
|
|
57
|
+
accessor commands: Command[] | undefined;
|
|
52
58
|
accessor uploadOptions: UploadOptions | undefined;
|
|
53
59
|
resumed(): void;
|
|
54
60
|
feedbackSubmitDone(): void;
|
|
@@ -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, uploadOptions, 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, aiEmployees, commands, uploadOptions, onShare, onTerminate, onSubmitFeedback, onSwitchToChat, onFeedbackOnView, onDetailChange, }: CruiseCanvasComponentProps, ref: React.Ref<CruiseCanvasRef>): React.JSX.Element;
|
|
21
21
|
export {};
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { ReactNextElement } from "@next-core/react-element";
|
|
3
3
|
import "@next-core/theme";
|
|
4
4
|
import type { ExampleProject, RequestStore, ShowCaseType, UploadOptions } from "../shared/interfaces.js";
|
|
5
|
+
import type { AIEmployee, Command } from "../shared/ChatCompletions/useChatCompletions.js";
|
|
5
6
|
export interface CruiseCanvasProps {
|
|
6
7
|
conversationId?: string;
|
|
7
8
|
initialRequest?: RequestStore | null;
|
|
@@ -20,7 +21,10 @@ export interface CruiseCanvasProps {
|
|
|
20
21
|
exampleProjects?: ExampleProject[];
|
|
21
22
|
tryItOutUrl?: string;
|
|
22
23
|
separateInstructions?: boolean;
|
|
24
|
+
aiEmployees?: AIEmployee[];
|
|
25
|
+
commands?: Command[];
|
|
23
26
|
uploadOptions?: UploadOptions;
|
|
27
|
+
hideMermaid?: boolean;
|
|
24
28
|
}
|
|
25
29
|
export interface ConversationDetail {
|
|
26
30
|
projectId?: string;
|
|
@@ -55,6 +59,8 @@ export declare class CruiseCanvas extends ReactNextElement implements CruiseCanv
|
|
|
55
59
|
accessor exampleProjects: ExampleProject[] | undefined;
|
|
56
60
|
accessor tryItOutUrl: string | undefined;
|
|
57
61
|
accessor separateInstructions: boolean | undefined;
|
|
62
|
+
accessor aiEmployees: AIEmployee[] | undefined;
|
|
63
|
+
accessor commands: Command[] | undefined;
|
|
58
64
|
accessor uploadOptions: UploadOptions | undefined;
|
|
59
65
|
resumed(): void;
|
|
60
66
|
feedbackSubmitDone(): void;
|
|
@@ -14,7 +14,7 @@ export interface DropdownSelectProps {
|
|
|
14
14
|
searchPlaceholder?: string;
|
|
15
15
|
loading?: boolean;
|
|
16
16
|
}
|
|
17
|
-
interface DropdownOptions {
|
|
17
|
+
export interface DropdownOptions {
|
|
18
18
|
label: string;
|
|
19
19
|
value: string;
|
|
20
20
|
disabled?: boolean;
|
|
@@ -39,4 +39,3 @@ export declare class DropdownSelect extends ReactNextElement implements Dropdown
|
|
|
39
39
|
accessor showSearch: boolean | undefined;
|
|
40
40
|
render(): React.JSX.Element;
|
|
41
41
|
}
|
|
42
|
-
export {};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ReactNextElement } from "@next-core/react-element";
|
|
3
3
|
import "@next-core/theme";
|
|
4
|
+
export interface HomeContainerProps {
|
|
5
|
+
sticky?: boolean;
|
|
6
|
+
}
|
|
4
7
|
/**
|
|
5
8
|
* 构件 `ai-portal.home-container`
|
|
6
9
|
*/
|
|
7
|
-
export declare class HomeContainer extends ReactNextElement {
|
|
10
|
+
export declare class HomeContainer extends ReactNextElement implements HomeContainerProps {
|
|
8
11
|
accessor sticky: boolean | undefined;
|
|
9
12
|
render(): React.JSX.Element;
|
|
10
13
|
}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { type HTMLAttributes } from "react";
|
|
2
2
|
import { ReactNextElement } from "@next-core/react-element";
|
|
3
3
|
import "@next-core/theme";
|
|
4
|
-
import type { GeneralIconProps } from "@next-bricks/icons/general-icon";
|
|
4
|
+
import type { GeneralIcon, GeneralIconProps } from "@next-bricks/icons/general-icon";
|
|
5
5
|
export interface IconButtonProps {
|
|
6
|
-
icon?: GeneralIconProps
|
|
6
|
+
icon?: GeneralIconProps & HTMLAttributes<GeneralIcon>;
|
|
7
7
|
tooltip?: string;
|
|
8
8
|
tooltipHoist?: boolean;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
variant?: IconButtonVariant;
|
|
11
|
+
reduceIconSize?: boolean;
|
|
11
12
|
}
|
|
12
13
|
export type IconButtonVariant = "default" | "light" | "mini" | "mini-light" | "bordered";
|
|
13
14
|
/**
|
|
14
15
|
* 构件 `ai-portal.icon-button`
|
|
15
16
|
*/
|
|
16
17
|
export declare class IconButton extends ReactNextElement implements IconButtonProps {
|
|
17
|
-
accessor icon: GeneralIconProps | undefined;
|
|
18
|
+
accessor icon: (GeneralIconProps & HTMLAttributes<GeneralIcon>) | undefined;
|
|
18
19
|
accessor tooltip: string | undefined;
|
|
19
20
|
accessor tooltipHoist: boolean | undefined;
|
|
20
21
|
accessor disabled: boolean | undefined;
|
package/dist-types/jsx.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import type { DetailedHTMLProps, HTMLAttributes } from "react";
|
|
2
|
-
import type { ActionButtons, ActionButtonsProps } from "./action-buttons";
|
|
2
|
+
import type { ActionButtons, ActionButtonsProps, ActionItem } from "./action-buttons";
|
|
3
3
|
import type { ActivityTimeline, ActivityTimelineProps } from "./activity-timeline";
|
|
4
4
|
import type { AIAgents, AIAgentsProps } from "./ai-agents";
|
|
5
5
|
import type { AIEmployees, AIEmployeesProps } from "./ai-employees";
|
|
6
6
|
import type { BlankState, BlankStateProps } from "./blank-state";
|
|
7
7
|
import type { ChatBox, ChatBoxProps } from "./chat-box";
|
|
8
8
|
import type { ChatInput, ChatInputProps } from "./chat-input";
|
|
9
|
-
import type { ChatStream, ChatStreamProps } from "./chat-stream";
|
|
9
|
+
import type { ChatStream, ChatStreamProps, ConversationDetail } from "./chat-stream";
|
|
10
10
|
import type { CruiseCanvas, CruiseCanvasProps } from "./cruise-canvas";
|
|
11
|
-
import type { DropdownSelect, DropdownSelectProps } from "./dropdown-select";
|
|
11
|
+
import type { DropdownSelect, DropdownSelectProps, DropdownOptions } from "./dropdown-select";
|
|
12
12
|
import type { ElevoCard, ElevoCardProps } from "./elevo-card";
|
|
13
13
|
import type { ElevoLogo } from "./elevo-logo";
|
|
14
14
|
import type { ActionClickDetail, ElevoSidebar, ElevoSidebarProps, ProjectActionClickDetail } from "./elevo-sidebar";
|
|
15
15
|
import type { FlowTabs, FlowTabsProps } from "./flow-tabs";
|
|
16
16
|
import type { GanttChart, GanttChartProps } from "./gantt-chart";
|
|
17
|
+
import type { GanttNode } from "./gantt-chart/interfaces";
|
|
17
18
|
import type { GoalCardList, GoalCardListProps } from "./goal-card-list";
|
|
18
19
|
import type { HomeContainer } from "./home-container";
|
|
19
20
|
import type { IconButton, IconButtonProps } from "./icon-button";
|
|
@@ -22,37 +23,75 @@ import type { NoticeDropdown, NoticeDropdownProps, NoticeItem } from "./notice-d
|
|
|
22
23
|
import type { NoticeList, NoticeListProps } from "./notice-list";
|
|
23
24
|
import type { PageContainer, PageContainerProps } from "./page-container";
|
|
24
25
|
import type { PreviewContainer, PreviewContainerProps } from "./preview-container";
|
|
25
|
-
import type { ProjectConversations, ProjectConversationsProps } from "./project-conversations";
|
|
26
|
-
import type { ProjectKnowledges, ProjectKnowledgesProps } from "./project-knowledges";
|
|
26
|
+
import type { ProjectConversations, ProjectConversationsProps, ActionClickDetail as PCActionClickDetail, Conversation } from "./project-conversations";
|
|
27
|
+
import type { Knowledge, ProjectKnowledges, ProjectKnowledgesProps } from "./project-knowledges";
|
|
27
28
|
import type { RunningFlow, RunningFlowProps } from "./running-flow";
|
|
28
29
|
import type { ShowCase, ShowCaseProps } from "./show-case";
|
|
29
30
|
import type { ShowCases, ShowCasesProps } from "./show-cases";
|
|
30
|
-
import type { StageFlow, StageFlowProps } from "./stage-flow";
|
|
31
|
+
import type { EditActivityDetail, Stage, StageFlow, StageFlowProps } from "./stage-flow";
|
|
31
32
|
import type { StatWithMiniChart, StatWithMiniChartProps } from "./stat-with-mini-chart";
|
|
32
33
|
import type { StickyContainer, StickyContainerProps } from "./sticky-container";
|
|
33
|
-
import type { TabList, TabListProps } from "./tab-list";
|
|
34
|
+
import type { Tab, TabList, TabListProps } from "./tab-list";
|
|
35
|
+
import type { ChatPayload } from "./shared/interfaces";
|
|
36
|
+
import type { FeedbackDetail } from "./cruise-canvas/interfaces";
|
|
37
|
+
import type { GoalItem } from "./goal-card-list/CardItem/CardItem";
|
|
34
38
|
declare global {
|
|
35
39
|
namespace JSX {
|
|
36
40
|
interface IntrinsicElements {
|
|
37
|
-
"ai-portal--action-buttons": DetailedHTMLProps<HTMLAttributes<ActionButtons>, ActionButtons> & ActionButtonsProps
|
|
41
|
+
"ai-portal--action-buttons": DetailedHTMLProps<HTMLAttributes<ActionButtons>, ActionButtons> & ActionButtonsProps & {
|
|
42
|
+
onChange?: (event: CustomEvent<ActionItem | null>) => void;
|
|
43
|
+
};
|
|
38
44
|
"ai-portal--activity-timeline": DetailedHTMLProps<HTMLAttributes<ActivityTimeline>, ActivityTimeline> & ActivityTimelineProps;
|
|
39
45
|
"ai-portal--ai-agents": DetailedHTMLProps<HTMLAttributes<AIAgents>, AIAgents> & AIAgentsProps;
|
|
40
46
|
"ai-portal--ai-employees": DetailedHTMLProps<HTMLAttributes<AIEmployees>, AIEmployees> & AIEmployeesProps;
|
|
41
47
|
"ai-portal--blank-state": DetailedHTMLProps<HTMLAttributes<BlankState>, BlankState> & BlankStateProps;
|
|
42
|
-
"ai-portal--chat-box": DetailedHTMLProps<HTMLAttributes<ChatBox>, ChatBox> & ChatBoxProps
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"ai-portal--
|
|
46
|
-
|
|
48
|
+
"ai-portal--chat-box": DetailedHTMLProps<HTMLAttributes<ChatBox>, ChatBox> & ChatBoxProps & {
|
|
49
|
+
onChatSubmit?: (event: CustomEvent<ChatPayload>) => void;
|
|
50
|
+
};
|
|
51
|
+
"ai-portal--chat-input": DetailedHTMLProps<HTMLAttributes<ChatInput>, ChatInput> & ChatInputProps & {
|
|
52
|
+
onChatSubmit?: (event: CustomEvent<ChatPayload>) => void;
|
|
53
|
+
};
|
|
54
|
+
"ai-portal--chat-stream": DetailedHTMLProps<HTMLAttributes<ChatStream>, ChatStream> & ChatStreamProps & {
|
|
55
|
+
onSplitChange?: (event: CustomEvent<boolean>) => void;
|
|
56
|
+
onShare?: (event: CustomEvent<void>) => void;
|
|
57
|
+
onTerminate?: (event: CustomEvent<void>) => void;
|
|
58
|
+
onFeedbackSubmit?: (event: CustomEvent<FeedbackDetail>) => void;
|
|
59
|
+
onFeedbackOnView?: (event: CustomEvent<string>) => void;
|
|
60
|
+
onUiSwitch?: (event: CustomEvent<"canvas" | "chat">) => void;
|
|
61
|
+
onDetailChange?: (event: CustomEvent<ConversationDetail>) => void;
|
|
62
|
+
};
|
|
63
|
+
"ai-portal--cruise-canvas": DetailedHTMLProps<HTMLAttributes<CruiseCanvas>, CruiseCanvas> & CruiseCanvasProps & {
|
|
64
|
+
onShare?: (event: CustomEvent<void>) => void;
|
|
65
|
+
onTerminate?: (event: CustomEvent<void>) => void;
|
|
66
|
+
onFeedbackSubmit?: (event: CustomEvent<FeedbackDetail>) => void;
|
|
67
|
+
onFeedbackOnView?: (event: CustomEvent<string>) => void;
|
|
68
|
+
onUiSwitch?: (event: CustomEvent<"canvas" | "chat">) => void;
|
|
69
|
+
onDetailChange?: (event: CustomEvent<ConversationDetail>) => void;
|
|
70
|
+
};
|
|
71
|
+
"ai-portal--dropdown-select": DetailedHTMLProps<HTMLAttributes<DropdownSelect>, DropdownSelect> & DropdownSelectProps & {
|
|
72
|
+
onChange?: (event: CustomEvent<DropdownOptions>) => void;
|
|
73
|
+
};
|
|
47
74
|
"ai-portal--elevo-card": DetailedHTMLProps<HTMLAttributes<ElevoCard>, ElevoCard> & ElevoCardProps;
|
|
48
75
|
"ai-portal--elevo-logo": DetailedHTMLProps<HTMLAttributes<ElevoLogo>, ElevoLogo>;
|
|
49
76
|
"ai-portal--elevo-sidebar": DetailedHTMLProps<HTMLAttributes<ElevoSidebar>, ElevoSidebar> & ElevoSidebarProps & {
|
|
77
|
+
onLogout?: () => void;
|
|
78
|
+
onAddProject?: () => void;
|
|
50
79
|
onActionClick?: (event: CustomEvent<ActionClickDetail>) => void;
|
|
51
80
|
onProjectActionClick?: (event: CustomEvent<ProjectActionClickDetail>) => void;
|
|
52
81
|
};
|
|
53
|
-
"ai-portal--flow-tabs": DetailedHTMLProps<HTMLAttributes<FlowTabs>, FlowTabs> & FlowTabsProps
|
|
54
|
-
|
|
55
|
-
|
|
82
|
+
"ai-portal--flow-tabs": DetailedHTMLProps<HTMLAttributes<FlowTabs>, FlowTabs> & FlowTabsProps & {
|
|
83
|
+
onTabClick?: (event: CustomEvent<Tab>) => void;
|
|
84
|
+
};
|
|
85
|
+
"ai-portal--gantt-chart": DetailedHTMLProps<HTMLAttributes<GanttChart>, GanttChart> & GanttChartProps & {
|
|
86
|
+
onNodeClick?: (event: CustomEvent<GanttNode>) => void;
|
|
87
|
+
onFullscreenClick?: (event: CustomEvent<void>) => void;
|
|
88
|
+
};
|
|
89
|
+
"ai-portal--goal-card-list": DetailedHTMLProps<HTMLAttributes<GoalCardList>, GoalCardList> & GoalCardListProps & {
|
|
90
|
+
onItemClick?: (event: CustomEvent<GoalItem>) => void;
|
|
91
|
+
onItemStatusChange?: (event: CustomEvent<GoalItem>) => void;
|
|
92
|
+
onItemTitleChange?: (event: CustomEvent<GoalItem>) => void;
|
|
93
|
+
onItemNewChat?: (event: CustomEvent<GoalItem>) => void;
|
|
94
|
+
};
|
|
56
95
|
"ai-portal--home-container": DetailedHTMLProps<HTMLAttributes<HomeContainer>, HomeContainer>;
|
|
57
96
|
"ai-portal--icon-button": DetailedHTMLProps<HTMLAttributes<IconButton>, IconButton> & IconButtonProps;
|
|
58
97
|
"ai-portal--mcp-tools": DetailedHTMLProps<HTMLAttributes<McpTools>, McpTools> & McpToolsProps;
|
|
@@ -60,18 +99,38 @@ declare global {
|
|
|
60
99
|
onMarkAllRead?: (event: CustomEvent<void>) => void;
|
|
61
100
|
onNoticeClick?: (event: CustomEvent<NoticeItem>) => void;
|
|
62
101
|
};
|
|
63
|
-
"ai-portal--notice-list": DetailedHTMLProps<HTMLAttributes<NoticeList>, NoticeList> & NoticeListProps
|
|
102
|
+
"ai-portal--notice-list": DetailedHTMLProps<HTMLAttributes<NoticeList>, NoticeList> & NoticeListProps & {
|
|
103
|
+
onNoticeClick?: (event: CustomEvent<NoticeItem>) => void;
|
|
104
|
+
onMarkItemsRead?: (event: CustomEvent<NoticeItem[]>) => void;
|
|
105
|
+
onMarkAllRead?: (event: CustomEvent<void>) => void;
|
|
106
|
+
};
|
|
64
107
|
"ai-portal--page-container": DetailedHTMLProps<HTMLAttributes<PageContainer>, PageContainer> & PageContainerProps;
|
|
65
108
|
"ai-portal--preview-container": DetailedHTMLProps<HTMLAttributes<PreviewContainer>, PreviewContainer> & PreviewContainerProps;
|
|
66
|
-
"ai-portal--project-conversations": DetailedHTMLProps<HTMLAttributes<ProjectConversations>, ProjectConversations> & ProjectConversationsProps
|
|
67
|
-
|
|
68
|
-
|
|
109
|
+
"ai-portal--project-conversations": DetailedHTMLProps<HTMLAttributes<ProjectConversations>, ProjectConversations> & ProjectConversationsProps & {
|
|
110
|
+
onActionClick?: (event: CustomEvent<PCActionClickDetail>) => void;
|
|
111
|
+
onGoalClick?: (event: CustomEvent<Conversation>) => void;
|
|
112
|
+
};
|
|
113
|
+
"ai-portal--project-knowledges": DetailedHTMLProps<HTMLAttributes<ProjectKnowledges>, ProjectKnowledges> & ProjectKnowledgesProps & {
|
|
114
|
+
onActionClick?: (event: CustomEvent<ActionClickDetail>) => void;
|
|
115
|
+
onItemClick?: (event: CustomEvent<Knowledge>) => void;
|
|
116
|
+
};
|
|
117
|
+
"ai-portal--running-flow": DetailedHTMLProps<HTMLAttributes<RunningFlow>, RunningFlow> & RunningFlowProps & {
|
|
118
|
+
onActiveChange?: (event: CustomEvent<string | null>) => void;
|
|
119
|
+
};
|
|
69
120
|
"ai-portal--show-case": DetailedHTMLProps<HTMLAttributes<ShowCase>, ShowCase> & ShowCaseProps;
|
|
70
121
|
"ai-portal--show-cases": DetailedHTMLProps<HTMLAttributes<ShowCases>, ShowCases> & ShowCasesProps;
|
|
71
|
-
"ai-portal--stage-flow": DetailedHTMLProps<HTMLAttributes<StageFlow>, StageFlow> & StageFlowProps
|
|
122
|
+
"ai-portal--stage-flow": DetailedHTMLProps<HTMLAttributes<StageFlow>, StageFlow> & StageFlowProps & {
|
|
123
|
+
onChange?: (event: CustomEvent<Stage[]>) => void;
|
|
124
|
+
onAddActivity?: (event: CustomEvent<{
|
|
125
|
+
stage: Stage;
|
|
126
|
+
}>) => void;
|
|
127
|
+
onEditActivity?: (event: CustomEvent<EditActivityDetail>) => void;
|
|
128
|
+
};
|
|
72
129
|
"ai-portal--stat-with-mini-chart": DetailedHTMLProps<HTMLAttributes<StatWithMiniChart>, StatWithMiniChart> & StatWithMiniChartProps;
|
|
73
130
|
"ai-portal--sticky-container": DetailedHTMLProps<HTMLAttributes<StickyContainer>, StickyContainer> & StickyContainerProps;
|
|
74
|
-
"ai-portal--tab-list": DetailedHTMLProps<HTMLAttributes<TabList>, TabList> & TabListProps
|
|
131
|
+
"ai-portal--tab-list": DetailedHTMLProps<HTMLAttributes<TabList>, TabList> & TabListProps & {
|
|
132
|
+
onTabClick?: (event: CustomEvent<Tab>) => void;
|
|
133
|
+
};
|
|
75
134
|
}
|
|
76
135
|
}
|
|
77
136
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { SimpleAction } from "@next-bricks/basic/actions";
|
|
2
|
+
import { type TextareaAutoResizeRef } from "@next-shared/form";
|
|
3
|
+
import type { CommandPayload } from "../interfaces";
|
|
4
|
+
import type { ChatCommand } from "../../data-providers/set-chat-command";
|
|
5
|
+
export declare const MAX_SHOWN_COMMANDS = 10;
|
|
6
|
+
export interface MentionPopover {
|
|
7
|
+
style: React.CSSProperties;
|
|
8
|
+
range: {
|
|
9
|
+
start: number;
|
|
10
|
+
end: number;
|
|
11
|
+
};
|
|
12
|
+
actions: ActionWithSubCommands[];
|
|
13
|
+
}
|
|
14
|
+
export type ActionWithSubCommands = SimpleAction & {
|
|
15
|
+
key: string | number;
|
|
16
|
+
subCommands?: Command[];
|
|
17
|
+
payload?: CommandPayload;
|
|
18
|
+
};
|
|
19
|
+
export interface Command {
|
|
20
|
+
label: string;
|
|
21
|
+
value: string;
|
|
22
|
+
groupKey?: string;
|
|
23
|
+
groupLabel?: string;
|
|
24
|
+
subCommands?: Command[];
|
|
25
|
+
payload?: CommandPayload;
|
|
26
|
+
}
|
|
27
|
+
export interface AIEmployee {
|
|
28
|
+
employeeId: string;
|
|
29
|
+
name: string;
|
|
30
|
+
}
|
|
31
|
+
export interface UseChatMentionsParams {
|
|
32
|
+
aiEmployees?: AIEmployee[];
|
|
33
|
+
commands?: Command[];
|
|
34
|
+
root: HTMLElement;
|
|
35
|
+
hasFiles: boolean;
|
|
36
|
+
/** @default "bottom" */
|
|
37
|
+
placement?: "top" | "bottom";
|
|
38
|
+
}
|
|
39
|
+
export declare function useChatCompletions({ aiEmployees, commands: propCommands, root, hasFiles, placement, }: UseChatMentionsParams): {
|
|
40
|
+
textareaRef: React.RefObject<TextareaAutoResizeRef>;
|
|
41
|
+
valueRef: React.MutableRefObject<string>;
|
|
42
|
+
value: string;
|
|
43
|
+
setValue: React.Dispatch<React.SetStateAction<string>>;
|
|
44
|
+
selectionRef: React.MutableRefObject<{
|
|
45
|
+
start: number;
|
|
46
|
+
end: number;
|
|
47
|
+
} | null>;
|
|
48
|
+
mentioned: string | null;
|
|
49
|
+
mentionedText: string;
|
|
50
|
+
mentionPopover: MentionPopover | null;
|
|
51
|
+
mentionOverlay: React.CSSProperties[] | null;
|
|
52
|
+
mentionActiveKeys: (string | number)[] | null;
|
|
53
|
+
setInitialMention: React.Dispatch<React.SetStateAction<string | null>>;
|
|
54
|
+
handleMention: (action: SimpleAction) => void;
|
|
55
|
+
command: CommandPayload | null;
|
|
56
|
+
commandText: string;
|
|
57
|
+
commandPrefix: string;
|
|
58
|
+
commandPopover: MentionPopover | null;
|
|
59
|
+
commandOverlay: React.CSSProperties[] | null;
|
|
60
|
+
commandActiveKeys: (string | number)[] | null;
|
|
61
|
+
setInitialCommand: React.Dispatch<React.SetStateAction<ChatCommand | null>>;
|
|
62
|
+
handleSelectCommand: (action: ActionWithSubCommands) => void;
|
|
63
|
+
handleChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
64
|
+
handleKeyDown: (e: React.KeyboardEvent<HTMLTextAreaElement>) => false | undefined;
|
|
65
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Dispatch } from "react";
|
|
2
2
|
import type { FeedbackDetail } from "../cruise-canvas/interfaces";
|
|
3
3
|
import type { ActiveDetail, ActiveImages, ConversationError, ConversationState, ExampleProject, ExtraChatPayload, FileInfo, GeneratedView, Job, ShowCaseType, Task, UploadOptions } from "./interfaces";
|
|
4
|
+
import type { AIEmployee, Command } from "./ChatCompletions/useChatCompletions";
|
|
4
5
|
export interface TaskContextValue {
|
|
5
6
|
conversationId?: string;
|
|
6
7
|
conversationState?: ConversationState;
|
|
@@ -11,6 +12,8 @@ export interface TaskContextValue {
|
|
|
11
12
|
replay?: boolean;
|
|
12
13
|
showCases?: ShowCaseType[];
|
|
13
14
|
exampleProjects?: ExampleProject[];
|
|
15
|
+
aiEmployees?: AIEmployee[];
|
|
16
|
+
commands?: Command[];
|
|
14
17
|
uploadOptions?: UploadOptions;
|
|
15
18
|
humanInput: (input: string | null, action?: string, extra?: ExtraChatPayload) => void;
|
|
16
19
|
onShare: () => void;
|
|
@@ -207,7 +207,7 @@ export interface CommandPayloadGoalPlan extends BaseCommandPayload {
|
|
|
207
207
|
export interface LegacyCommandPayloadServiceFlowStarting {
|
|
208
208
|
type: "serviceFlowStarting";
|
|
209
209
|
serviceFlowStarting: {
|
|
210
|
-
spaceInstanceId
|
|
210
|
+
spaceInstanceId?: string;
|
|
211
211
|
spaceName?: string;
|
|
212
212
|
flowInstanceId?: string;
|
|
213
213
|
flowName?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-bricks/ai-portal",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.61.1",
|
|
4
4
|
"homepage": "https://github.com/easyops-cn/next-advanced-bricks/tree/master/bricks/ai-portal",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"@next-bricks/presentational": "*",
|
|
50
50
|
"@next-bricks/vs": "*"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "acf4cd2e2492c1ff5cd58abfcb5c29d6e5ba9aea"
|
|
53
53
|
}
|