@next-bricks/ai-portal 0.26.2 → 0.27.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 (83) hide show
  1. package/dist/bricks.json +5 -2
  2. package/dist/chunks/4820.4b53e1d4.js +2 -0
  3. package/dist/chunks/4820.4b53e1d4.js.map +1 -0
  4. package/dist/chunks/{5054.b5664d8e.js → 5054.dee4d597.js} +2 -2
  5. package/dist/chunks/5054.dee4d597.js.map +1 -0
  6. package/dist/chunks/6677.2fea9748.js +3 -0
  7. package/dist/chunks/6677.2fea9748.js.map +1 -0
  8. package/dist/chunks/8928.9ff21a2f.js +3 -0
  9. package/dist/chunks/8928.9ff21a2f.js.map +1 -0
  10. package/dist/chunks/981.2e62aa2d.js +2 -0
  11. package/dist/chunks/981.2e62aa2d.js.map +1 -0
  12. package/dist/chunks/{chat-history.98d87d99.js → chat-history.a7ed7639.js} +3 -3
  13. package/dist/chunks/chat-history.a7ed7639.js.map +1 -0
  14. package/dist/chunks/chat-stream.47e68ddf.js +2 -0
  15. package/dist/chunks/chat-stream.47e68ddf.js.map +1 -0
  16. package/dist/chunks/cruise-canvas.847fcd10.js +2 -0
  17. package/dist/chunks/cruise-canvas.847fcd10.js.map +1 -0
  18. package/dist/chunks/{elevo-sidebar.1761f230.js → elevo-sidebar.c1b8a33b.js} +3 -3
  19. package/dist/chunks/elevo-sidebar.c1b8a33b.js.map +1 -0
  20. package/dist/chunks/load-request-store.291fe1bf.js +2 -0
  21. package/dist/chunks/load-request-store.291fe1bf.js.map +1 -0
  22. package/dist/chunks/main.9f8de325.js +2 -0
  23. package/dist/chunks/{main.25b9de22.js.map → main.9f8de325.js.map} +1 -1
  24. package/dist/index.59c2883c.js +2 -0
  25. package/dist/index.59c2883c.js.map +1 -0
  26. package/dist/manifest.json +57 -23
  27. package/dist/types.json +304 -37
  28. package/dist-types/bootstrap.d.ts +1 -0
  29. package/dist-types/chat-stream/index.d.ts +3 -0
  30. package/dist-types/cruise-canvas/CruiseCanvas.d.ts +20 -0
  31. package/dist-types/cruise-canvas/LegacyCruiseCanvas.d.ts +19 -0
  32. package/dist-types/cruise-canvas/Nav/Nav.d.ts +2 -2
  33. package/dist-types/cruise-canvas/getFlatOrderedJobs.d.ts +10 -0
  34. package/dist-types/cruise-canvas/getOrderedNodes.d.ts +18 -0
  35. package/dist-types/cruise-canvas/index.d.ts +9 -0
  36. package/dist-types/cruise-canvas/interfaces.d.ts +7 -2
  37. package/dist-types/cruise-canvas/legacy-reducers/error.d.ts +3 -0
  38. package/dist-types/cruise-canvas/legacy-reducers/index.d.ts +3 -0
  39. package/dist-types/cruise-canvas/legacy-reducers/interfaces.d.ts +15 -0
  40. package/dist-types/cruise-canvas/legacy-reducers/task.spec.d.ts +1 -0
  41. package/dist-types/cruise-canvas/reducers/conversation.d.ts +4 -0
  42. package/dist-types/cruise-canvas/reducers/interfaces.d.ts +7 -8
  43. package/dist-types/cruise-canvas/reducers/tasks.d.ts +4 -0
  44. package/dist-types/cruise-canvas/useConversationDetail.d.ts +9 -0
  45. package/dist-types/cruise-canvas/useConversationGraph.d.ts +12 -0
  46. package/dist-types/cruise-canvas/useTaskGraph.d.ts +4 -2
  47. package/dist-types/cruise-canvas/utils/jsx-converters/convertJsx.d.ts +2 -2
  48. package/dist-types/cruise-canvas/utils/jsx-converters/isJsxView.d.ts +2 -2
  49. package/dist-types/data-providers/request-store.d.ts +4 -0
  50. package/dist-types/data-providers/request-store.spec.d.ts +1 -0
  51. package/dist-types/shared/CreatedView/i18n.d.ts +2 -1
  52. package/dist-types/shared/TaskContext.d.ts +7 -7
  53. package/dist-types/shared/constants.d.ts +1 -0
  54. package/dist-types/shared/interfaces.d.ts +97 -0
  55. package/dist-types/shared/useViewFeedbackDone.d.ts +1 -0
  56. package/package.json +2 -2
  57. package/dist/chunks/3624.fa6c9a8b.js +0 -2
  58. package/dist/chunks/3624.fa6c9a8b.js.map +0 -1
  59. package/dist/chunks/3800.8a37614f.js +0 -2
  60. package/dist/chunks/3800.8a37614f.js.map +0 -1
  61. package/dist/chunks/5054.b5664d8e.js.map +0 -1
  62. package/dist/chunks/6175.18e07f1a.js +0 -3
  63. package/dist/chunks/6175.18e07f1a.js.map +0 -1
  64. package/dist/chunks/6677.4ed7510b.js +0 -3
  65. package/dist/chunks/6677.4ed7510b.js.map +0 -1
  66. package/dist/chunks/chat-history.98d87d99.js.map +0 -1
  67. package/dist/chunks/chat-stream.20c70bf3.js +0 -2
  68. package/dist/chunks/chat-stream.20c70bf3.js.map +0 -1
  69. package/dist/chunks/cruise-canvas.3fdcba20.js +0 -2
  70. package/dist/chunks/cruise-canvas.3fdcba20.js.map +0 -1
  71. package/dist/chunks/elevo-sidebar.1761f230.js.map +0 -1
  72. package/dist/chunks/main.25b9de22.js +0 -2
  73. package/dist/index.80bf5579.js +0 -2
  74. package/dist/index.80bf5579.js.map +0 -1
  75. package/dist-types/cruise-canvas/getOrderedJobs.d.ts +0 -11
  76. /package/dist/chunks/{6677.4ed7510b.js.LICENSE.txt → 6677.2fea9748.js.LICENSE.txt} +0 -0
  77. /package/dist/chunks/{6175.18e07f1a.js.LICENSE.txt → 8928.9ff21a2f.js.LICENSE.txt} +0 -0
  78. /package/dist/chunks/{chat-history.98d87d99.js.LICENSE.txt → chat-history.a7ed7639.js.LICENSE.txt} +0 -0
  79. /package/dist/chunks/{elevo-sidebar.1761f230.js.LICENSE.txt → elevo-sidebar.c1b8a33b.js.LICENSE.txt} +0 -0
  80. /package/dist-types/cruise-canvas/{reducers/jobs.spec.d.ts → legacy-reducers/error.spec.d.ts} +0 -0
  81. /package/dist-types/cruise-canvas/{reducers → legacy-reducers}/jobs.d.ts +0 -0
  82. /package/dist-types/cruise-canvas/{reducers/task.spec.d.ts → legacy-reducers/jobs.spec.d.ts} +0 -0
  83. /package/dist-types/cruise-canvas/{reducers → legacy-reducers}/task.d.ts +0 -0
@@ -1,15 +1,14 @@
1
- import type { Job, TaskBaseDetail, TaskPatch } from "../interfaces";
1
+ import type { ConversationBaseDetail, ConversationPatch, Task } from "../../shared/interfaces";
2
2
  export interface CruiseCanvasState {
3
- task: TaskBaseDetail | null;
4
- jobs: Job[];
3
+ conversation: ConversationBaseDetail | null;
4
+ tasks: Task[];
5
5
  error: string | null;
6
6
  }
7
- export type CruiseCanvasAction = TaskSSEAction | TaskResetAction;
8
- export interface TaskSSEAction {
7
+ export type CruiseCanvasAction = ConversationSSEAction | ConversationResetAction;
8
+ export interface ConversationSSEAction {
9
9
  type: "sse";
10
- payload: TaskPatch;
11
- isInitial?: boolean;
10
+ payload: ConversationPatch;
12
11
  }
13
- export interface TaskResetAction {
12
+ export interface ConversationResetAction {
14
13
  type: "reset";
15
14
  }
@@ -0,0 +1,4 @@
1
+ import type { Reducer } from "react";
2
+ import type { Task } from "../../shared/interfaces";
3
+ import type { CruiseCanvasAction } from "./interfaces";
4
+ export declare const tasks: Reducer<Task[], CruiseCanvasAction>;
@@ -0,0 +1,9 @@
1
+ import type { RequestStore } from "../shared/interfaces";
2
+ export declare function useConversationDetail(conversationId: string, initialRequest?: RequestStore | null, replay?: boolean, replayDelay?: number): {
3
+ conversation: import("../shared/interfaces").ConversationBaseDetail | null;
4
+ tasks: import("../shared/interfaces").Task[];
5
+ error: string | null;
6
+ humanInputRef: React.MutableRefObject<((jobId: string, input: string) => void) | undefined>;
7
+ skipToResults: () => void;
8
+ watchAgain: () => Promise<void>;
9
+ };
@@ -0,0 +1,12 @@
1
+ import type { GraphEdge, GraphNode, GraphNavItem, GraphGeneratedView } from "./interfaces";
2
+ import type { ConversationBaseDetail, Task } from "../shared/interfaces";
3
+ export declare function useConversationGraph(conversation: ConversationBaseDetail | null | undefined, tasks: Task[], options?: {
4
+ showHiddenJobs?: boolean;
5
+ }): {
6
+ nodes: GraphNode[];
7
+ edges: GraphEdge[];
8
+ nav: GraphNavItem[];
9
+ views: GraphGeneratedView[];
10
+ jobMap: Map<string, import("../shared/interfaces").Job>;
11
+ jobLevels: Map<string, number>;
12
+ } | null | undefined;
@@ -1,9 +1,11 @@
1
1
  import type { Job, GraphEdge, GraphNode, TaskBaseDetail, GraphNavItem, GraphGeneratedView } from "./interfaces";
2
- import { type GetOrderedJobsOptions } from "./getOrderedJobs";
3
- export declare function useTaskGraph(task: TaskBaseDetail | null | undefined, jobs: Job[] | null | undefined, options?: GetOrderedJobsOptions): {
2
+ export declare function useTaskGraph(task: TaskBaseDetail | null | undefined, jobs: Job[] | null | undefined, options?: {
3
+ showHiddenJobs?: boolean;
4
+ }): {
4
5
  nodes: GraphNode[];
5
6
  edges: GraphEdge[];
6
7
  nav: GraphNavItem[];
7
8
  views: GraphGeneratedView[];
9
+ jobMap: Map<string, Job>;
8
10
  jobLevels: Map<string, number>;
9
11
  } | null;
@@ -1,7 +1,7 @@
1
1
  import type { BrickConf, ContextConf } from "@next-core/types";
2
- import type { ConstructResult } from "@next-shared/jsx-storyboard";
3
2
  import type { ConvertViewOptions } from "../converters/interfaces";
4
- export declare function convertJsx(result: ConstructResult, options: ConvertViewOptions): Promise<{
3
+ import type { ConstructedView } from "../../interfaces";
4
+ export declare function convertJsx(result: ConstructedView, options: ConvertViewOptions): Promise<{
5
5
  brick: string;
6
6
  children: BrickConf[];
7
7
  context: ContextConf[];
@@ -1,3 +1,3 @@
1
- import type { ConstructResult } from "@next-shared/jsx-storyboard";
2
1
  import type { ViewWithInfo } from "../converters/interfaces";
3
- export declare function isJsxView(result: ConstructResult | ViewWithInfo): result is ConstructResult;
2
+ import type { ConstructedView } from "../../interfaces";
3
+ export declare function isJsxView(result: ConstructedView | ViewWithInfo): result is ConstructedView;
@@ -0,0 +1,4 @@
1
+ import type { RequestStore } from "../shared/interfaces";
2
+ export declare function saveRequestStore(value: RequestStore): void;
3
+ export declare function loadRequestStore(): RequestStore | null;
4
+ export declare function clearRequestStore(): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
1
  export declare enum K {
2
- FULLSCREEN = "FULLSCREEN"
2
+ FULLSCREEN = "FULLSCREEN",
3
+ FEEDBACK = "FEEDBACK"
3
4
  }
4
5
  export declare const NS = "bricks/ai-portal/CreatedView";
5
6
  export declare const locales: {
@@ -1,12 +1,9 @@
1
1
  import { type Dispatch } from "react";
2
- import type { ConstructResult } from "@next-shared/jsx-storyboard";
3
- import type { FeedbackDetail, Job } from "../cruise-canvas/interfaces";
2
+ import type { ConstructedView, FeedbackDetail, Job } from "../cruise-canvas/interfaces";
4
3
  export interface TaskContextValue {
5
4
  humanInput: (jobId: string, input: string) => void;
6
5
  onShare: () => void;
7
- onPause: () => void;
8
- onResume: () => void;
9
- onCancel: () => void;
6
+ onTerminate: () => void;
10
7
  supports?: Record<string, boolean>;
11
8
  activeExpandedViewJobId: string | null;
12
9
  setActiveExpandedViewJobId: Dispatch<React.SetStateAction<string | null>>;
@@ -19,7 +16,10 @@ export interface TaskContextValue {
19
16
  showJsxEditor?: boolean;
20
17
  activeJsxEditorJob?: Job;
21
18
  setActiveJsxEditorJob?: Dispatch<React.SetStateAction<Job | undefined>>;
22
- manuallyUpdatedViews?: Map<string, ConstructResult>;
23
- updateView?: (jobId: string, view: ConstructResult) => void;
19
+ manuallyUpdatedViews?: Map<string, ConstructedView>;
20
+ updateView?: (jobId: string, view: ConstructedView) => void;
21
+ showFeedbackOnView?: boolean;
22
+ onFeedbackOnView?: (viewId: string) => void;
23
+ feedbackDoneViews?: Set<string>;
24
24
  }
25
25
  export declare const TaskContext: React.Context<TaskContextValue>;
@@ -7,3 +7,4 @@ export declare const ICON_CLOSE: GeneralIconProps;
7
7
  export declare const ICON_LOADING: GeneralIconProps;
8
8
  export declare const ICON_CANVAS: GeneralIconProps;
9
9
  export declare const ICON_CHAT: GeneralIconProps;
10
+ export declare const ICON_FEEDBACK: GeneralIconProps;
@@ -0,0 +1,97 @@
1
+ import type { ConstructResult } from "@next-shared/jsx-storyboard";
2
+ export interface Conversation {
3
+ id: string;
4
+ title: string;
5
+ state: ConversationState;
6
+ tasks: Task[];
7
+ startTime: number;
8
+ endTime?: number;
9
+ }
10
+ export interface Task {
11
+ id: string;
12
+ upstream?: string[];
13
+ parent?: string;
14
+ state: TaskState;
15
+ plan: Step[];
16
+ jobs: Job[];
17
+ startTime: number;
18
+ endTime?: number;
19
+ }
20
+ export type ConversationState = "working" | "completed";
21
+ export type TaskState = "free" | "confirming" | "executing" | "completed";
22
+ export type JobState = "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "skipped" | "unknown";
23
+ export interface Job {
24
+ id: string;
25
+ upstream?: string[];
26
+ parent?: string;
27
+ instruction?: string;
28
+ state: JobState;
29
+ toolCall?: ToolCall;
30
+ messages?: Message[];
31
+ isError?: boolean;
32
+ hidden?: boolean;
33
+ startTime: number;
34
+ endTime?: number;
35
+ generatedView?: ConstructedView;
36
+ staticDataView?: ConstructedView;
37
+ level?: number;
38
+ }
39
+ export interface Step {
40
+ id: string;
41
+ instruction: string;
42
+ }
43
+ export interface Message {
44
+ role: string;
45
+ parts: Part[];
46
+ }
47
+ export type Part = TextPart | FilePart | DataPart;
48
+ export interface TextPart {
49
+ type: "text";
50
+ text: string;
51
+ }
52
+ export interface FilePart {
53
+ type: "file";
54
+ file: FileInfo;
55
+ }
56
+ export interface FileInfo {
57
+ name?: string;
58
+ mimeType?: string;
59
+ size?: number;
60
+ bytes?: string;
61
+ uri?: string;
62
+ }
63
+ export interface DataPart {
64
+ type: "data";
65
+ data: Record<string, any>;
66
+ }
67
+ export interface ToolCall {
68
+ name: string;
69
+ arguments?: Record<string, unknown>;
70
+ argumentsParseFailed?: boolean;
71
+ argumentsParseError?: unknown;
72
+ originalArguments?: string;
73
+ annotations?: {
74
+ title?: string;
75
+ };
76
+ }
77
+ export type ConversationBaseDetail = Omit<Conversation, "tasks">;
78
+ export interface ConversationPatch extends Omit<Partial<Conversation>, "tasks"> {
79
+ tasks?: TaskPatch[];
80
+ error?: string;
81
+ time?: number;
82
+ }
83
+ export interface TaskPatch extends Omit<Partial<Task>, "jobs"> {
84
+ id: string;
85
+ jobs?: JobPatch[];
86
+ }
87
+ export interface JobPatch extends Partial<Job> {
88
+ id: string;
89
+ }
90
+ export interface RequestStore {
91
+ conversationId: string;
92
+ content: string;
93
+ }
94
+ export interface ConstructedView extends ConstructResult {
95
+ viewId: string;
96
+ withContexts?: Record<string, unknown>;
97
+ }
@@ -0,0 +1 @@
1
+ export declare function useViewFeedbackDone(viewId: string | undefined, showFeedbackOnView?: boolean): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-bricks/ai-portal",
3
- "version": "0.26.2",
3
+ "version": "0.27.0",
4
4
  "homepage": "https://github.com/easyops-cn/next-advanced-bricks/tree/master/bricks/ai-portal",
5
5
  "repository": {
6
6
  "type": "git",
@@ -46,5 +46,5 @@
46
46
  "@next-bricks/presentational": "*",
47
47
  "@next-bricks/vs": "*"
48
48
  },
49
- "gitHead": "efe57b8d5ea6affa50c0b6d2a3755c271fa489dc"
49
+ "gitHead": "cd61d85cd0737ef0e86e25934540b8c785b5a926"
50
50
  }