@next-bricks/ai-portal 0.65.2 → 0.65.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.
Files changed (67) hide show
  1. package/dist/bricks.json +54 -57
  2. package/dist/chunks/{2742.f24782f8.js → 2742.3340a00e.js} +2 -2
  3. package/dist/chunks/2742.3340a00e.js.map +1 -0
  4. package/dist/chunks/3186.81f0a2f0.js +2 -0
  5. package/dist/chunks/3186.81f0a2f0.js.map +1 -0
  6. package/dist/chunks/4208.002ac189.js +2 -0
  7. package/dist/chunks/4208.002ac189.js.map +1 -0
  8. package/dist/chunks/4577.66294512.js +2 -0
  9. package/dist/chunks/4577.66294512.js.map +1 -0
  10. package/dist/chunks/4864.03882076.js +2 -0
  11. package/dist/chunks/4864.03882076.js.map +1 -0
  12. package/dist/chunks/5452.e451b025.js +2 -0
  13. package/dist/chunks/5452.e451b025.js.map +1 -0
  14. package/dist/chunks/{6450.ade6ef3e.js → 6450.9e9165f9.js} +2 -2
  15. package/dist/chunks/{6450.ade6ef3e.js.map → 6450.9e9165f9.js.map} +1 -1
  16. package/dist/chunks/{9515.468a8527.js → 9515.b58eb80e.js} +2 -2
  17. package/dist/chunks/9515.b58eb80e.js.map +1 -0
  18. package/dist/chunks/{9525.9e5140be.js → 9525.a53ee2a7.js} +3 -3
  19. package/dist/chunks/{9525.9e5140be.js.map → 9525.a53ee2a7.js.map} +1 -1
  20. package/dist/chunks/chat-panel.e8afa537.js +2 -0
  21. package/dist/chunks/chat-panel.e8afa537.js.map +1 -0
  22. package/dist/chunks/{chat-stream.90aa7647.js → chat-stream.cef88ead.js} +2 -2
  23. package/dist/chunks/{chat-stream.90aa7647.js.map → chat-stream.cef88ead.js.map} +1 -1
  24. package/dist/chunks/{main.51248f49.js → main.abe54caf.js} +2 -2
  25. package/dist/chunks/{main.51248f49.js.map → main.abe54caf.js.map} +1 -1
  26. package/dist/chunks/running-flow.37a428cf.js +3 -0
  27. package/dist/chunks/running-flow.37a428cf.js.map +1 -0
  28. package/dist/examples.json +23 -23
  29. package/dist/index.d03181ae.js +2 -0
  30. package/dist/{index.16143768.js.map → index.d03181ae.js.map} +1 -1
  31. package/dist/manifest.json +316 -320
  32. package/dist/types.json +1646 -1671
  33. package/dist-types/chat-stream/Aside/TaskApp/TaskApp.d.ts +6 -0
  34. package/dist-types/chat-stream/interfaces.d.ts +6 -1
  35. package/dist-types/chat-stream/useConversationStream.d.ts +7 -2
  36. package/dist-types/running-flow/index.d.ts +2 -4
  37. package/dist-types/shared/ActivityPlan/PlanStateIcon.d.ts +7 -0
  38. package/dist-types/shared/ActivityPlan/i18n.d.ts +2 -1
  39. package/dist-types/shared/AskUser/AskUser.d.ts +6 -0
  40. package/dist-types/shared/AskUserTag/AskUserTag.d.ts +7 -0
  41. package/dist-types/shared/ChatBox/ChatBox.d.ts +3 -1
  42. package/dist-types/shared/TaskContext.d.ts +2 -0
  43. package/dist-types/shared/bricks.d.ts +0 -2
  44. package/dist-types/shared/getFlatChunks.d.ts +11 -2
  45. package/dist-types/shared/interfaces.d.ts +7 -2
  46. package/dist-types/shared/useFulfilledActiveDetail.d.ts +2 -2
  47. package/package.json +2 -2
  48. package/dist/chunks/2742.f24782f8.js.map +0 -1
  49. package/dist/chunks/3186.5c0ff6ad.js +0 -2
  50. package/dist/chunks/3186.5c0ff6ad.js.map +0 -1
  51. package/dist/chunks/4208.7ad3b395.js +0 -2
  52. package/dist/chunks/4208.7ad3b395.js.map +0 -1
  53. package/dist/chunks/5452.a5594a29.js +0 -2
  54. package/dist/chunks/5452.a5594a29.js.map +0 -1
  55. package/dist/chunks/7139.b585e5ea.js +0 -2
  56. package/dist/chunks/7139.b585e5ea.js.map +0 -1
  57. package/dist/chunks/7159.bd59ed3e.js +0 -2
  58. package/dist/chunks/7159.bd59ed3e.js.map +0 -1
  59. package/dist/chunks/9515.468a8527.js.map +0 -1
  60. package/dist/chunks/chat-panel.bbb24c5a.js +0 -2
  61. package/dist/chunks/chat-panel.bbb24c5a.js.map +0 -1
  62. package/dist/chunks/running-flow.4b117f11.js +0 -3
  63. package/dist/chunks/running-flow.4b117f11.js.map +0 -1
  64. package/dist/index.16143768.js +0 -2
  65. package/dist-types/shared/ActivityPlan/getStateIcon.d.ts +0 -6
  66. /package/dist/chunks/{9525.9e5140be.js.LICENSE.txt → 9525.a53ee2a7.js.LICENSE.txt} +0 -0
  67. /package/dist/chunks/{running-flow.4b117f11.js.LICENSE.txt → running-flow.37a428cf.js.LICENSE.txt} +0 -0
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import type { Task } from "../../../shared/interfaces";
3
+ export interface TaskAppProps {
4
+ task: Task;
5
+ }
6
+ export declare function TaskApp({ task }: TaskAppProps): React.JSX.Element;
@@ -12,7 +12,7 @@ export interface MessageFromAssistant {
12
12
  role: "assistant";
13
13
  chunks: MessageChunk[];
14
14
  }
15
- export type MessageChunk = MessageChunkOfJob | MessageChunkOfPlan | MessageChunkOfFlow | MessageChunkOfActivity | MessageChunkOfError;
15
+ export type MessageChunk = MessageChunkOfJob | MessageChunkOfPlan | MessageChunkOfAskUser | MessageChunkOfFlow | MessageChunkOfActivity | MessageChunkOfError;
16
16
  export interface MessageChunkOfJob {
17
17
  type: "job";
18
18
  job: Job;
@@ -23,6 +23,11 @@ export interface MessageChunkOfPlan {
23
23
  type: "plan";
24
24
  task: Task;
25
25
  }
26
+ export interface MessageChunkOfAskUser {
27
+ type: "askUser";
28
+ job: Job;
29
+ task: Task | undefined;
30
+ }
26
31
  export interface MessageChunkOfFlow {
27
32
  type: "flow";
28
33
  flow: ServiceFlowRun;
@@ -1,15 +1,20 @@
1
1
  import type { ChatMessage } from "./interfaces.js";
2
2
  import type { ActiveDetail, ActivityWithFlow, ConversationError, ConversationState, ServiceFlowRun, Task, TaskState } from "../shared/interfaces.js";
3
- export declare function useConversationStream(conversationAvailable: boolean, state: ConversationState | TaskState | undefined, tasks: Task[], errors: ConversationError[], flowMap?: Map<string, ServiceFlowRun>, activityMap?: Map<string, ActivityWithFlow>, options?: {
3
+ export interface UseConversationStreamOptions {
4
+ flowMap?: Map<string, ServiceFlowRun>;
5
+ activityMap?: Map<string, ActivityWithFlow>;
4
6
  showHumanActions?: boolean;
5
7
  skipActivitySubTasks?: boolean;
6
8
  rootTaskId?: string;
7
- }): {
9
+ }
10
+ export declare function useConversationStream(conversationAvailable: boolean, state: ConversationState | TaskState | undefined, tasks: Task[], errors: ConversationError[], options?: UseConversationStreamOptions): {
8
11
  messages: never[];
9
12
  lastDetail: null;
13
+ activeAskUser: null;
10
14
  jobMap?: undefined;
11
15
  } | {
12
16
  messages: ChatMessage[];
13
17
  jobMap: Map<string, import("../shared/interfaces.js").Job>;
14
18
  lastDetail: ActiveDetail | null;
19
+ activeAskUser: import("./interfaces.js").MessageChunkOfAskUser | null;
15
20
  };
@@ -4,7 +4,6 @@ import "@next-core/theme";
4
4
  import type { JobState, TaskState } from "../shared/interfaces.js";
5
5
  export interface RunningFlowProps {
6
6
  spec?: FlowStage[];
7
- activeActivityId?: string | null;
8
7
  }
9
8
  export interface FlowStage {
10
9
  name: string;
@@ -18,10 +17,10 @@ export interface FlowActivity {
18
17
  endTime?: number;
19
18
  }
20
19
  export interface RunningFlowEvents {
21
- "active.change": CustomEvent<string | null>;
20
+ "activity.click": CustomEvent<string>;
22
21
  }
23
22
  export interface RunningFlowMapEvents {
24
- onActiveChange: "active.change";
23
+ onActivityClick: "activity.click";
25
24
  }
26
25
  /**
27
26
  * 构件 `ai-portal.running-flow`
@@ -29,6 +28,5 @@ export interface RunningFlowMapEvents {
29
28
  export declare class RunningFlow extends ReactNextElement implements RunningFlowProps {
30
29
  #private;
31
30
  accessor spec: FlowStage[] | undefined;
32
- accessor activeActivityId: string | null | undefined;
33
31
  render(): React.JSX.Element;
34
32
  }
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import type { ConversationState, JobState, TaskState } from "../interfaces";
3
+ export interface PlanStateIconProps {
4
+ state: TaskState | JobState | ConversationState | undefined;
5
+ filled?: boolean;
6
+ }
7
+ export declare function PlanStateIcon({ state, filled }: PlanStateIconProps): React.JSX.Element;
@@ -1,6 +1,7 @@
1
1
  export declare enum K {
2
2
  ACTIVITY_PLAN = "ACTIVITY_PLAN",
3
- SHOW_PROCESS = "SHOW_PROCESS"
3
+ SHOW_PROCESS = "SHOW_PROCESS",
4
+ STARTING_SERVICE_FLOW = "STARTING_SERVICE_FLOW"
4
5
  }
5
6
  export declare const NS = "bricks/ai-portal/ActivityPlan";
6
7
  export declare const locales: {
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import type { Task } from "../interfaces";
3
+ export interface AskUserProps {
4
+ task: Task | undefined;
5
+ }
6
+ export declare function AskUser({ task }: AskUserProps): React.JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import type { Job, Task } from "../interfaces";
3
+ export interface AskUserTagProps {
4
+ job: Job;
5
+ task: Task | undefined;
6
+ }
7
+ export declare function AskUserTag({ job, task }: AskUserTagProps): React.JSX.Element | null;
@@ -2,5 +2,7 @@ import type { ConversationState } from "../interfaces";
2
2
  export interface ChatBoxProps {
3
3
  state: ConversationState | undefined;
4
4
  canChat: boolean;
5
+ showInput?: "auto" | "always" | "never";
6
+ className?: string;
5
7
  }
6
- export declare function ChatBox({ state, canChat }: ChatBoxProps): JSX.Element;
8
+ export declare function ChatBox({ state, canChat, showInput, className, }: ChatBoxProps): JSX.Element;
@@ -7,6 +7,8 @@ export interface TaskContextValue {
7
7
  conversationState?: ConversationState;
8
8
  tasks: Task[];
9
9
  errors: ConversationError[];
10
+ finished?: boolean;
11
+ earlyFinished?: boolean;
10
12
  jobMap?: Map<string, Job>;
11
13
  flowMap?: Map<string, ServiceFlowRun>;
12
14
  activityMap?: Map<string, ActivityWithFlow>;
@@ -8,7 +8,6 @@ import type { IconButton, IconButtonProps } from "../icon-button";
8
8
  import type { ChatInput, ChatInputEvents, ChatInputMapEvents, ChatInputProps } from "../chat-input";
9
9
  import type { ShowCase, ShowCaseProps } from "../show-case";
10
10
  import type { RunningFlow, RunningFlowEvents, RunningFlowMapEvents, RunningFlowProps } from "../running-flow";
11
- import type { BlankState, BlankStateProps } from "../blank-state";
12
11
  export declare const WrappedIcon: import("@next-core/react-element").WrappedBrick<GeneralIcon, GeneralIconProps>;
13
12
  export declare const WrappedButton: import("@next-core/react-element").WrappedBrick<Button, ButtonProps>;
14
13
  export declare const WrappedLink: import("@next-core/react-element").WrappedBrick<Link, LinkProps>;
@@ -21,7 +20,6 @@ export declare const WrappedIconButton: import("@next-core/react-element").Wrapp
21
20
  export declare const WrappedChatInput: import("@next-core/react-element").WrappedBrickWithEventsMap<ChatInput, ChatInputProps, ChatInputEvents, ChatInputMapEvents>;
22
21
  export declare const WrappedShowCase: import("@next-core/react-element").WrappedBrick<ShowCase, ShowCaseProps>;
23
22
  export declare const WrappedCodeBlock: import("@next-core/react-element").WrappedBrick<CodeBlock, CodeBlockProps>;
24
- export declare const WrappedBlankState: import("@next-core/react-element").WrappedBrick<BlankState, BlankStateProps>;
25
23
  export declare const WrappedRunningFlow: import("@next-core/react-element").WrappedBrickWithEventsMap<RunningFlow, RunningFlowProps, RunningFlowEvents, RunningFlowMapEvents>;
26
24
  export declare const showDialog: (options: import("@next-bricks/basic/data-providers/show-dialog/show-dialog").DialogOptions) => Promise<void>;
27
25
  export declare const copyToClipboard: (text: string) => Promise<void>;
@@ -1,8 +1,17 @@
1
- import type { MessageChunk } from "../chat-stream/interfaces";
1
+ import type { MessageChunk, MessageChunkOfAskUser } from "../chat-stream/interfaces";
2
2
  import type { Task, ServiceFlowRun, ActivityWithFlow, ConversationError, Job } from "../shared/interfaces";
3
- export declare function getFlatChunks(tasks: Task[], errors: ConversationError[], flowMap?: Map<string, ServiceFlowRun>, activityMap?: Map<string, ActivityWithFlow>, skipActivitySubTasks?: boolean, enablePlan?: boolean, rootTaskId?: string): {
3
+ export interface FlatChunkOptions {
4
+ flowMap?: Map<string, ServiceFlowRun>;
5
+ activityMap?: Map<string, ActivityWithFlow>;
6
+ skipActivitySubTasks?: boolean;
7
+ enablePlan?: boolean;
8
+ rootTaskId?: string;
9
+ }
10
+ export declare function getFlatChunks(tasks: Task[], errors: ConversationError[], options?: FlatChunkOptions): {
4
11
  /** Message chunks, excluding those from skipped subtasks */
5
12
  chunks: MessageChunk[];
6
13
  /** All jobs including those nested within subtasks */
7
14
  jobMap: Map<string, Job>;
15
+ /** The active askUser chunk, if any */
16
+ activeAskUser: MessageChunkOfAskUser | null;
8
17
  };
@@ -54,6 +54,7 @@ export interface Job {
54
54
  cmd?: CommandPayload;
55
55
  mentionedAiEmployeeId?: string;
56
56
  ignoreDetails?: boolean;
57
+ summary?: string;
57
58
  }
58
59
  export type HumanAction = HumanActionConfirm | HumanActionSelect;
59
60
  export interface HumanActionConfirm {
@@ -262,14 +263,18 @@ export interface ActivityWithFlow {
262
263
  activity: ActivityRun;
263
264
  }
264
265
  export interface ActiveDetail {
265
- type: "job" | "flow" | "activity";
266
+ type: "job" | "flow" | "activity" | "task";
266
267
  id: string;
267
268
  }
268
- export type FulfilledActiveDetail = ActiveDetailOfJob | ActiveDetailOfFlow | ActiveDetailOfActivity;
269
+ export type FulfilledActiveDetail = ActiveDetailOfJob | ActiveDetailOfTask | ActiveDetailOfFlow | ActiveDetailOfActivity;
269
270
  export interface ActiveDetailOfJob {
270
271
  type: "job";
271
272
  job: Job;
272
273
  }
274
+ export interface ActiveDetailOfTask {
275
+ type: "task";
276
+ task: Task;
277
+ }
273
278
  export interface ActiveDetailOfFlow {
274
279
  type: "flow";
275
280
  flow: ServiceFlowRun;
@@ -1,2 +1,2 @@
1
- import type { ActiveDetail, ActivityWithFlow, FulfilledActiveDetail, Job, ServiceFlowRun } from "./interfaces";
2
- export declare function useFulfilledActiveDetail(activeDetail: ActiveDetail | null, jobMap: Map<string, Job> | undefined, flowMap: Map<string, ServiceFlowRun>, activityMap: Map<string, ActivityWithFlow>): FulfilledActiveDetail | null;
1
+ import type { ActiveDetail, ActivityWithFlow, FulfilledActiveDetail, Job, ServiceFlowRun, Task } from "./interfaces";
2
+ export declare function useFulfilledActiveDetail(activeDetail: ActiveDetail | null, tasks: Task[], jobMap: Map<string, Job> | undefined, flowMap: Map<string, ServiceFlowRun>, activityMap: Map<string, ActivityWithFlow>): FulfilledActiveDetail | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-bricks/ai-portal",
3
- "version": "0.65.2",
3
+ "version": "0.65.3",
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": "8a8388ff5412d60c3d17cf48a07f8da859e26d45"
52
+ "gitHead": "ec2a2ba458f2e3123d6d5c9ddc4266c43afe0133"
53
53
  }