@next-bricks/ai-portal 0.1.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.
- package/dist/bricks.json +21 -0
- package/dist/chunks/1045.07fed1b5.js +2 -0
- package/dist/chunks/1045.07fed1b5.js.map +1 -0
- package/dist/chunks/1086.139e75b4.js +2 -0
- package/dist/chunks/1086.139e75b4.js.map +1 -0
- package/dist/chunks/1122.9dcaa54e.js +2 -0
- package/dist/chunks/1122.9dcaa54e.js.map +1 -0
- package/dist/chunks/114.edeb665e.js +2 -0
- package/dist/chunks/114.edeb665e.js.map +1 -0
- package/dist/chunks/1370.25ebf7b8.js +2 -0
- package/dist/chunks/1370.25ebf7b8.js.map +1 -0
- package/dist/chunks/1889.e5637ffa.js +2 -0
- package/dist/chunks/1889.e5637ffa.js.map +1 -0
- package/dist/chunks/1940.674f0e20.js +2 -0
- package/dist/chunks/1940.674f0e20.js.map +1 -0
- package/dist/chunks/2052.12bb32f3.js +2 -0
- package/dist/chunks/2052.12bb32f3.js.map +1 -0
- package/dist/chunks/2259.fc89bbe1.js +3 -0
- package/dist/chunks/2259.fc89bbe1.js.LICENSE.txt +17 -0
- package/dist/chunks/2259.fc89bbe1.js.map +1 -0
- package/dist/chunks/2277.a95810e5.js +2 -0
- package/dist/chunks/2277.a95810e5.js.map +1 -0
- package/dist/chunks/2569.af96d40a.js +2 -0
- package/dist/chunks/2569.af96d40a.js.map +1 -0
- package/dist/chunks/3144.a54c8d65.js +3 -0
- package/dist/chunks/3144.a54c8d65.js.LICENSE.txt +19 -0
- package/dist/chunks/3144.a54c8d65.js.map +1 -0
- package/dist/chunks/3171.33dbd1c2.js +2 -0
- package/dist/chunks/3171.33dbd1c2.js.map +1 -0
- package/dist/chunks/3426.053742ef.js +2 -0
- package/dist/chunks/3426.053742ef.js.map +1 -0
- package/dist/chunks/3458.90f259f4.js +3 -0
- package/dist/chunks/3458.90f259f4.js.LICENSE.txt +11 -0
- package/dist/chunks/3458.90f259f4.js.map +1 -0
- package/dist/chunks/3506.0d6e4b61.js +2 -0
- package/dist/chunks/3506.0d6e4b61.js.map +1 -0
- package/dist/chunks/3933.46c6b203.js +2 -0
- package/dist/chunks/3933.46c6b203.js.map +1 -0
- package/dist/chunks/4041.6ba6fafa.js +3 -0
- package/dist/chunks/4041.6ba6fafa.js.LICENSE.txt +9 -0
- package/dist/chunks/4041.6ba6fafa.js.map +1 -0
- package/dist/chunks/4306.7ea515ce.js +2 -0
- package/dist/chunks/4306.7ea515ce.js.map +1 -0
- package/dist/chunks/4507.5ef68765.js +3 -0
- package/dist/chunks/4507.5ef68765.js.LICENSE.txt +1 -0
- package/dist/chunks/4507.5ef68765.js.map +1 -0
- package/dist/chunks/4658.b0138e9e.js +2 -0
- package/dist/chunks/4658.b0138e9e.js.map +1 -0
- package/dist/chunks/5105.e769a484.js +2 -0
- package/dist/chunks/5105.e769a484.js.map +1 -0
- package/dist/chunks/5250.7614fa5b.js +3 -0
- package/dist/chunks/5250.7614fa5b.js.LICENSE.txt +8 -0
- package/dist/chunks/5250.7614fa5b.js.map +1 -0
- package/dist/chunks/5384.451ded3d.js +2 -0
- package/dist/chunks/5384.451ded3d.js.map +1 -0
- package/dist/chunks/5399.da78e6e2.js +2 -0
- package/dist/chunks/5399.da78e6e2.js.map +1 -0
- package/dist/chunks/5552.53db1092.js +2 -0
- package/dist/chunks/5552.53db1092.js.map +1 -0
- package/dist/chunks/6314.11c44a7e.js +2 -0
- package/dist/chunks/6314.11c44a7e.js.map +1 -0
- package/dist/chunks/6519.836946b6.js +2 -0
- package/dist/chunks/6519.836946b6.js.map +1 -0
- package/dist/chunks/6773.7fbec27a.js +2 -0
- package/dist/chunks/6773.7fbec27a.js.map +1 -0
- package/dist/chunks/7039.5503f3d9.js +2 -0
- package/dist/chunks/7039.5503f3d9.js.map +1 -0
- package/dist/chunks/726.0bc62720.js +2 -0
- package/dist/chunks/726.0bc62720.js.map +1 -0
- package/dist/chunks/7486.d3328a25.js +2 -0
- package/dist/chunks/7486.d3328a25.js.map +1 -0
- package/dist/chunks/7721.4c786e0a.js +3 -0
- package/dist/chunks/7721.4c786e0a.js.LICENSE.txt +3 -0
- package/dist/chunks/7721.4c786e0a.js.map +1 -0
- package/dist/chunks/7733.777c181e.js +2 -0
- package/dist/chunks/7733.777c181e.js.map +1 -0
- package/dist/chunks/843.0c7e4c28.js +2 -0
- package/dist/chunks/843.0c7e4c28.js.map +1 -0
- package/dist/chunks/871.623e9948.js +2 -0
- package/dist/chunks/871.623e9948.js.map +1 -0
- package/dist/chunks/8989.6f404d42.js +2 -0
- package/dist/chunks/8989.6f404d42.js.map +1 -0
- package/dist/chunks/9515.02c68755.js +2 -0
- package/dist/chunks/9515.02c68755.js.map +1 -0
- package/dist/chunks/9559.4479bc89.js +2 -0
- package/dist/chunks/9559.4479bc89.js.map +1 -0
- package/dist/chunks/9844.a4320543.js +2 -0
- package/dist/chunks/9844.a4320543.js.map +1 -0
- package/dist/chunks/chat-box.1ad19f84.js +2 -0
- package/dist/chunks/chat-box.1ad19f84.js.map +1 -0
- package/dist/chunks/cruise-canvas.a760429c.js +2 -0
- package/dist/chunks/cruise-canvas.a760429c.js.map +1 -0
- package/dist/chunks/main.c636a19a.js +2 -0
- package/dist/chunks/main.c636a19a.js.map +1 -0
- package/dist/examples.json +8 -0
- package/dist/images/854a0152.png +0 -0
- package/dist/images/a1d108f4.png +0 -0
- package/dist/images/b1e65906.png +0 -0
- package/dist/images/d4ea5a5c.png +0 -0
- package/dist/images/e7d89ec3.png +0 -0
- package/dist/index.bd9bab76.js +2 -0
- package/dist/index.bd9bab76.js.map +1 -0
- package/dist/manifest.json +60 -0
- package/dist/types.json +742 -0
- package/dist-types/bootstrap.d.ts +2 -0
- package/dist-types/chat-box/i18n.d.ts +15 -0
- package/dist-types/chat-box/index.d.ts +18 -0
- package/dist-types/chat-box/index.spec.d.ts +1 -0
- package/dist-types/cruise-canvas/NodeEnd/NodeEnd.d.ts +4 -0
- package/dist-types/cruise-canvas/NodeInstruction/NodeInstruction.d.ts +5 -0
- package/dist-types/cruise-canvas/NodeJob/NodeJob.d.ts +7 -0
- package/dist-types/cruise-canvas/NodeRequirement/NodeRequirement.d.ts +6 -0
- package/dist-types/cruise-canvas/NodeStart/NodeStart.d.ts +1 -0
- package/dist-types/cruise-canvas/PlanProgress/PlanProgress.d.ts +5 -0
- package/dist-types/cruise-canvas/ZoomBar/ZoomBar.d.ts +6 -0
- package/dist-types/cruise-canvas/bricks.d.ts +4 -0
- package/dist-types/cruise-canvas/cmdb.d.ts +14 -0
- package/dist-types/cruise-canvas/constants.d.ts +7 -0
- package/dist-types/cruise-canvas/i18n.d.ts +19 -0
- package/dist-types/cruise-canvas/index.d.ts +23 -0
- package/dist-types/cruise-canvas/interfaces.d.ts +114 -0
- package/dist-types/cruise-canvas/reducers/error.d.ts +3 -0
- package/dist-types/cruise-canvas/reducers/error.spec.d.ts +1 -0
- package/dist-types/cruise-canvas/reducers/index.d.ts +3 -0
- package/dist-types/cruise-canvas/reducers/interfaces.d.ts +15 -0
- package/dist-types/cruise-canvas/reducers/jobs.d.ts +4 -0
- package/dist-types/cruise-canvas/reducers/jobs.spec.d.ts +1 -0
- package/dist-types/cruise-canvas/reducers/task.d.ts +4 -0
- package/dist-types/cruise-canvas/reducers/task.spec.d.ts +1 -0
- package/dist-types/cruise-canvas/useAutoCenter.d.ts +14 -0
- package/dist-types/cruise-canvas/useAutoCenter.spec.d.ts +1 -0
- package/dist-types/cruise-canvas/useLayout.d.ts +16 -0
- package/dist-types/cruise-canvas/useLayout.spec.d.ts +1 -0
- package/dist-types/cruise-canvas/useTaskDetail.d.ts +8 -0
- package/dist-types/cruise-canvas/useTaskGraph.d.ts +5 -0
- package/dist-types/cruise-canvas/useZoom.d.ts +20 -0
- package/dist-types/index.d.ts +0 -0
- package/docs/chat-box.md +67 -0
- package/docs/cruise-canvas.md +165 -0
- package/package.json +45 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum K {
|
|
2
|
+
HOW_CAN_I_HELP = "HOW_CAN_I_HELP"
|
|
3
|
+
}
|
|
4
|
+
export declare const NS = "bricks/ai-portal/chat-box";
|
|
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 {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ReactNextElement } from "@next-core/react-element";
|
|
3
|
+
import "@next-core/theme";
|
|
4
|
+
export interface ChatBoxProps {
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 构件 `ai-portal.chat-box`
|
|
9
|
+
*/
|
|
10
|
+
export declare class ChatBox extends ReactNextElement implements ChatBoxProps {
|
|
11
|
+
#private;
|
|
12
|
+
accessor disabled: boolean | undefined;
|
|
13
|
+
render(): React.JSX.Element;
|
|
14
|
+
}
|
|
15
|
+
export interface ChatBoxComponentProps extends ChatBoxProps {
|
|
16
|
+
onSubmit?: (value: string) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function ChatBoxComponent({ disabled, onSubmit, }: ChatBoxComponentProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function NodeStart(): JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { GeneralIcon, GeneralIconProps } from "@next-bricks/icons/general-icon";
|
|
2
|
+
import type { Button, ButtonProps } from "@next-bricks/basic/button";
|
|
3
|
+
export declare const WrappedIcon: import("@next-core/react-element").WrappedBrick<GeneralIcon, GeneralIconProps>;
|
|
4
|
+
export declare const WrappedButton: import("@next-core/react-element").WrappedBrick<Button, ButtonProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface CMDBSelectProps {
|
|
3
|
+
objectId?: string | null;
|
|
4
|
+
fieldId?: string | null;
|
|
5
|
+
objectList?: any[] | null;
|
|
6
|
+
}
|
|
7
|
+
interface CMDBSelectEvents {
|
|
8
|
+
"cmdb.instance.form.change.v2": CustomEvent<any[]>;
|
|
9
|
+
}
|
|
10
|
+
interface CMDBSelectEvensMapping {
|
|
11
|
+
onChangeV2: "cmdb.instance.form.change.v2";
|
|
12
|
+
}
|
|
13
|
+
export declare const AsyncWrappedCMDB: React.LazyExoticComponent<import("@next-core/react-element").WrappedBrickWithEventsMap<HTMLElement, CMDBSelectProps, CMDBSelectEvents, CMDBSelectEvensMapping>>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { JobState } from "./interfaces.js";
|
|
2
|
+
export declare const DEFAULT_SCALE_RANGE_MIN = 0.5;
|
|
3
|
+
export declare const DEFAULT_SCALE_RANGE_MAX = 2;
|
|
4
|
+
export declare const START_NODE_ID = "<START>";
|
|
5
|
+
export declare const END_NODE_ID = "<END>";
|
|
6
|
+
export declare const CANVAS_PADDING_BOTTOM = 96;
|
|
7
|
+
export declare const DONE_STATES: JobState[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum K {
|
|
2
|
+
YES = "YES",
|
|
3
|
+
NO = "NO",
|
|
4
|
+
PLAN_COMPLETED = "PLAN_COMPLETED",
|
|
5
|
+
TASK_COMPLETED = "TASK_COMPLETED",
|
|
6
|
+
SHARE = "SHARE"
|
|
7
|
+
}
|
|
8
|
+
export declare const NS = "bricks/ai-portal/cruise-canvas";
|
|
9
|
+
export declare const locales: {
|
|
10
|
+
en: Locale;
|
|
11
|
+
zh: Locale;
|
|
12
|
+
};
|
|
13
|
+
export declare const t: any;
|
|
14
|
+
type Locale = {
|
|
15
|
+
[k in K]: string;
|
|
16
|
+
} & {
|
|
17
|
+
[k in K as `${k}_plural`]?: string;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ReactNextElement } from "@next-core/react-element";
|
|
3
|
+
import "@next-core/theme";
|
|
4
|
+
import type { Job, TaskBaseDetail } from "./interfaces.js";
|
|
5
|
+
export interface CruiseCanvasProps {
|
|
6
|
+
taskId: string | undefined;
|
|
7
|
+
task: TaskBaseDetail | undefined;
|
|
8
|
+
jobs: Job[] | undefined;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 构件 `ai-portal.cruise-canvas`
|
|
12
|
+
*/
|
|
13
|
+
export declare class CruiseCanvas extends ReactNextElement implements CruiseCanvasProps {
|
|
14
|
+
#private;
|
|
15
|
+
accessor taskId: string | undefined;
|
|
16
|
+
accessor task: TaskBaseDetail | undefined;
|
|
17
|
+
accessor jobs: Job[] | undefined;
|
|
18
|
+
render(): React.JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
export interface CruiseCanvasComponentProps extends CruiseCanvasProps {
|
|
21
|
+
onShare?: () => void;
|
|
22
|
+
}
|
|
23
|
+
export declare function CruiseCanvasComponent({ taskId, task: propTask, jobs: propJobs, onShare, }: CruiseCanvasComponentProps): React.JSX.Element;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export type RangeTuple = [min: number, max: number];
|
|
2
|
+
export type SizeTuple = [width: number, height: number];
|
|
3
|
+
export interface NodePosition {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
}
|
|
7
|
+
export interface TransformLiteral {
|
|
8
|
+
k: number;
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}
|
|
12
|
+
export type GraphNode = RequirementGraphNode | InstructionGraphNode | JobGraphNode | StartGraphNode | EndGraphNode;
|
|
13
|
+
export interface RequirementGraphNode extends BaseGraphNode {
|
|
14
|
+
type: "requirement";
|
|
15
|
+
content: string;
|
|
16
|
+
}
|
|
17
|
+
export interface InstructionGraphNode extends BaseGraphNode {
|
|
18
|
+
type: "instruction";
|
|
19
|
+
job: Job;
|
|
20
|
+
}
|
|
21
|
+
export interface JobGraphNode extends BaseGraphNode {
|
|
22
|
+
type: "job";
|
|
23
|
+
job: Job;
|
|
24
|
+
}
|
|
25
|
+
export interface StartGraphNode extends BaseGraphNode {
|
|
26
|
+
type: "start";
|
|
27
|
+
}
|
|
28
|
+
export interface EndGraphNode extends BaseGraphNode {
|
|
29
|
+
type: "end";
|
|
30
|
+
}
|
|
31
|
+
export interface BaseGraphNode {
|
|
32
|
+
id: string;
|
|
33
|
+
type: string;
|
|
34
|
+
state?: string;
|
|
35
|
+
view?: NodeView;
|
|
36
|
+
}
|
|
37
|
+
export interface GraphEdge {
|
|
38
|
+
source: string;
|
|
39
|
+
target: string;
|
|
40
|
+
}
|
|
41
|
+
export interface NodeView extends NodePosition {
|
|
42
|
+
width: number;
|
|
43
|
+
height: number;
|
|
44
|
+
}
|
|
45
|
+
export interface Edge {
|
|
46
|
+
points: NodePosition[];
|
|
47
|
+
}
|
|
48
|
+
export type TaskBaseDetail = Omit<Task, "jobs">;
|
|
49
|
+
export interface Task {
|
|
50
|
+
id: string;
|
|
51
|
+
title: string;
|
|
52
|
+
requirement: string;
|
|
53
|
+
state: TaskState;
|
|
54
|
+
plan: Step[];
|
|
55
|
+
jobs: Job[];
|
|
56
|
+
startTime: number;
|
|
57
|
+
endTime?: number;
|
|
58
|
+
}
|
|
59
|
+
export interface Step {
|
|
60
|
+
id: string;
|
|
61
|
+
instruction: string;
|
|
62
|
+
}
|
|
63
|
+
export interface StepWithState extends Step {
|
|
64
|
+
state?: JobState;
|
|
65
|
+
}
|
|
66
|
+
export interface Job {
|
|
67
|
+
id: string;
|
|
68
|
+
upstream?: string[];
|
|
69
|
+
parent?: string;
|
|
70
|
+
instruction?: string;
|
|
71
|
+
state: JobState;
|
|
72
|
+
toolCall?: ToolCall;
|
|
73
|
+
messages?: Message[];
|
|
74
|
+
isError?: boolean;
|
|
75
|
+
startTime: number;
|
|
76
|
+
endTime?: number;
|
|
77
|
+
}
|
|
78
|
+
export interface TaskPatch extends Omit<Partial<Task>, "jobs"> {
|
|
79
|
+
jobs?: JobPatch[];
|
|
80
|
+
error?: string;
|
|
81
|
+
}
|
|
82
|
+
export interface JobPatch extends Partial<Job> {
|
|
83
|
+
id: string;
|
|
84
|
+
}
|
|
85
|
+
export type TaskState = "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "unknown";
|
|
86
|
+
export type JobState = TaskState;
|
|
87
|
+
export interface Message {
|
|
88
|
+
role: string;
|
|
89
|
+
parts: Part[];
|
|
90
|
+
}
|
|
91
|
+
export type Part = TextPart | FilePart | DataPart;
|
|
92
|
+
export interface TextPart {
|
|
93
|
+
type: "text";
|
|
94
|
+
text: string;
|
|
95
|
+
}
|
|
96
|
+
export interface FilePart {
|
|
97
|
+
type: "file";
|
|
98
|
+
file: {
|
|
99
|
+
name?: string;
|
|
100
|
+
mimeType?: string;
|
|
101
|
+
bytes?: string;
|
|
102
|
+
uri?: string;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
export interface DataPart {
|
|
106
|
+
type: "data";
|
|
107
|
+
data: Record<string, unknown>;
|
|
108
|
+
}
|
|
109
|
+
export interface ToolCall {
|
|
110
|
+
name: string;
|
|
111
|
+
arguments?: Record<string, unknown>;
|
|
112
|
+
argumentsParseFailed?: boolean;
|
|
113
|
+
argumentsParseError?: unknown;
|
|
114
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Job, TaskBaseDetail, TaskPatch } from "../interfaces";
|
|
2
|
+
export interface CruiseCanvasState {
|
|
3
|
+
task: TaskBaseDetail | null;
|
|
4
|
+
jobs: Job[];
|
|
5
|
+
error: string | null;
|
|
6
|
+
}
|
|
7
|
+
export type CruiseCanvasAction = TaskSSEAction | TaskResetAction;
|
|
8
|
+
export interface TaskSSEAction {
|
|
9
|
+
type: "sse";
|
|
10
|
+
payload: TaskPatch;
|
|
11
|
+
isInitial?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface TaskResetAction {
|
|
14
|
+
type: "reset";
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import { type ZoomBehavior } from "d3-zoom";
|
|
3
|
+
import type { GraphNode } from "./interfaces";
|
|
4
|
+
export interface UseAutoCenterOptions {
|
|
5
|
+
nodes: GraphNode[];
|
|
6
|
+
sizeReady: boolean;
|
|
7
|
+
zoomer: ZoomBehavior<HTMLDivElement, unknown>;
|
|
8
|
+
rootRef: RefObject<HTMLDivElement>;
|
|
9
|
+
}
|
|
10
|
+
export declare function useAutoCenter({ nodes, sizeReady, zoomer, rootRef, }: UseAutoCenterOptions): {
|
|
11
|
+
centered: boolean;
|
|
12
|
+
setCentered: React.Dispatch<React.SetStateAction<boolean>>;
|
|
13
|
+
reCenterRef: React.MutableRefObject<boolean>;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NodePosition, GraphEdge, GraphNode, SizeTuple, TaskState } from "./interfaces";
|
|
2
|
+
export interface UseLayoutOptions {
|
|
3
|
+
rawNodes: GraphNode[] | undefined;
|
|
4
|
+
rawEdges: GraphEdge[] | undefined;
|
|
5
|
+
sizeMap: Map<string, SizeTuple> | null;
|
|
6
|
+
state?: TaskState;
|
|
7
|
+
}
|
|
8
|
+
export declare function useLayout({ rawNodes: _rawNodes, rawEdges: _rawEdges, sizeMap, state, }: UseLayoutOptions): {
|
|
9
|
+
sizeReady: boolean;
|
|
10
|
+
nodes: GraphNode[];
|
|
11
|
+
edges: {
|
|
12
|
+
points: NodePosition[];
|
|
13
|
+
source: string;
|
|
14
|
+
target: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Job, StepWithState } from "./interfaces";
|
|
2
|
+
export declare function useTaskDetail(taskId: string | undefined): {
|
|
3
|
+
task: import("./interfaces").TaskBaseDetail | null;
|
|
4
|
+
jobs: Job[];
|
|
5
|
+
plan: StepWithState[];
|
|
6
|
+
error: string | null;
|
|
7
|
+
humanInputRef: React.MutableRefObject<((jobId: string, input: string) => void) | undefined>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type ZoomBehavior } from "d3-zoom";
|
|
3
|
+
import type { RangeTuple, TransformLiteral } from "./interfaces";
|
|
4
|
+
export interface UseZoomOptions {
|
|
5
|
+
rootRef: React.RefObject<HTMLDivElement>;
|
|
6
|
+
zoomable?: boolean;
|
|
7
|
+
scrollable?: boolean;
|
|
8
|
+
pannable?: boolean;
|
|
9
|
+
pannableWithCtrl?: boolean;
|
|
10
|
+
scaleRange?: RangeTuple;
|
|
11
|
+
onSwitchActiveTarget?(target: unknown | null): void;
|
|
12
|
+
}
|
|
13
|
+
export interface UseZoomResult {
|
|
14
|
+
grabbing: boolean;
|
|
15
|
+
transform: TransformLiteral;
|
|
16
|
+
transformRef: React.MutableRefObject<TransformLiteral>;
|
|
17
|
+
scaleRange: RangeTuple;
|
|
18
|
+
zoomer: ZoomBehavior<HTMLDivElement, unknown>;
|
|
19
|
+
}
|
|
20
|
+
export declare function useZoom({ rootRef, zoomable, scrollable, pannable, pannableWithCtrl, scaleRange: _scaleRange, onSwitchActiveTarget, }: UseZoomOptions): UseZoomResult;
|
|
File without changes
|
package/docs/chat-box.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
构件 `ai-portal.chat-box`
|
|
2
|
+
|
|
3
|
+
## Examples
|
|
4
|
+
|
|
5
|
+
### Basic
|
|
6
|
+
|
|
7
|
+
```yaml preview
|
|
8
|
+
brick: ai-portal.chat-box
|
|
9
|
+
properties:
|
|
10
|
+
textContent: Hello world
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### With cruise canvas
|
|
14
|
+
|
|
15
|
+
```yaml preview minHeight="600px"
|
|
16
|
+
brick: div
|
|
17
|
+
properties:
|
|
18
|
+
style:
|
|
19
|
+
width: 100vw
|
|
20
|
+
height: 100vh
|
|
21
|
+
position: fixed
|
|
22
|
+
top: 0
|
|
23
|
+
left: 0
|
|
24
|
+
context:
|
|
25
|
+
- name: task
|
|
26
|
+
children:
|
|
27
|
+
- brick: ai-portal.chat-box
|
|
28
|
+
if: <%= !CTX.task %>
|
|
29
|
+
properties:
|
|
30
|
+
style:
|
|
31
|
+
position: absolute
|
|
32
|
+
width: 500px
|
|
33
|
+
maxWidth: 90vw
|
|
34
|
+
maxHeight: 90vh
|
|
35
|
+
top: 50%
|
|
36
|
+
left: 50%
|
|
37
|
+
transform: translate(-50%, -50%)
|
|
38
|
+
events:
|
|
39
|
+
message.submit:
|
|
40
|
+
useProvider: basic.http-request
|
|
41
|
+
args:
|
|
42
|
+
- "<% `${BASE_URL}/api/gateway/logic.llm.aiops_service/api/v1/llm/agent/flow/create` %>"
|
|
43
|
+
# - /api/mocks/task/send
|
|
44
|
+
# - "http://localhost:8888/.netlify/functions/task-send"
|
|
45
|
+
# - "https://serverless-mocks.netlify.app/.netlify/functions/task-send"
|
|
46
|
+
- method: POST
|
|
47
|
+
body: |
|
|
48
|
+
<%
|
|
49
|
+
JSON.stringify({
|
|
50
|
+
input: EVENT.detail
|
|
51
|
+
})
|
|
52
|
+
%>
|
|
53
|
+
headers:
|
|
54
|
+
Content-Type: application/json
|
|
55
|
+
callback:
|
|
56
|
+
error:
|
|
57
|
+
action: handleHttpError
|
|
58
|
+
success:
|
|
59
|
+
action: context.replace
|
|
60
|
+
args:
|
|
61
|
+
- task
|
|
62
|
+
- <% EVENT.detail %>
|
|
63
|
+
- brick: ai-portal.cruise-canvas
|
|
64
|
+
if: <%= !!CTX.task %>
|
|
65
|
+
properties:
|
|
66
|
+
taskId: <% CTX.task.id %>
|
|
67
|
+
```
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
构件 `ai-portal.cruise-canvas`
|
|
2
|
+
|
|
3
|
+
## Examples
|
|
4
|
+
|
|
5
|
+
### Basic
|
|
6
|
+
|
|
7
|
+
```yaml preview minHeight="600px"
|
|
8
|
+
brick: div
|
|
9
|
+
properties:
|
|
10
|
+
style:
|
|
11
|
+
width: 100vw
|
|
12
|
+
height: 100vh
|
|
13
|
+
position: fixed
|
|
14
|
+
top: 0
|
|
15
|
+
left: 0
|
|
16
|
+
children:
|
|
17
|
+
- brick: ai-portal.cruise-canvas
|
|
18
|
+
properties:
|
|
19
|
+
task:
|
|
20
|
+
state: completed
|
|
21
|
+
requirement: |-
|
|
22
|
+
帮我在CMDB中完成手机银行系统的资源纳管
|
|
23
|
+
plan:
|
|
24
|
+
- id: "2"
|
|
25
|
+
state: completed
|
|
26
|
+
instruction: |-
|
|
27
|
+
深度搜素内部知识库,确认手机银行系统包含的逻辑组件和部署要求
|
|
28
|
+
- id: "8"
|
|
29
|
+
state: completed
|
|
30
|
+
instruction: |-
|
|
31
|
+
深度搜素CMDB给出资源的纳管现状
|
|
32
|
+
- id: "10"
|
|
33
|
+
state: completed
|
|
34
|
+
instruction: |-
|
|
35
|
+
利用深度思考能力,给出手机银行系统的资源纳管优化方案,该方案用户可以微调或确认
|
|
36
|
+
- id: "12"
|
|
37
|
+
state: completed
|
|
38
|
+
instruction: |-
|
|
39
|
+
在CMDB中完成手机银行系统的资源纳管
|
|
40
|
+
- id: "14"
|
|
41
|
+
state: completed
|
|
42
|
+
instruction: |-
|
|
43
|
+
生成纳管后手机银行系统的逻辑架构和部署架构图
|
|
44
|
+
jobs:
|
|
45
|
+
- id: "2"
|
|
46
|
+
state: completed
|
|
47
|
+
instruction: |-
|
|
48
|
+
深度搜素内部知识库,确认手机银行系统包含的逻辑组件和部署要求
|
|
49
|
+
- id: "4"
|
|
50
|
+
upstream: ["2"]
|
|
51
|
+
toolCall:
|
|
52
|
+
name: online_search
|
|
53
|
+
state: completed
|
|
54
|
+
messages:
|
|
55
|
+
- role: assistant
|
|
56
|
+
parts:
|
|
57
|
+
- type: text
|
|
58
|
+
text: |-
|
|
59
|
+
《手机银行系统》
|
|
60
|
+
|
|
61
|
+
依据内部知识库,手机银行系统的逻辑组件包含用户认证,交易接入和理财中心三个模块组成。
|
|
62
|
+
- id: "5"
|
|
63
|
+
upstream: ["2"]
|
|
64
|
+
state: completed
|
|
65
|
+
toolCall:
|
|
66
|
+
name: online_search
|
|
67
|
+
messages:
|
|
68
|
+
- role: assistant
|
|
69
|
+
parts:
|
|
70
|
+
- type: text
|
|
71
|
+
text: |-
|
|
72
|
+
《XX公司运维管理文件》
|
|
73
|
+
|
|
74
|
+
依据《XX公司运维管理文件》该系统的重要等级为一级,可用性要求99.999%,MTTR为小于3分钟,该系统部署需要实现异地容灾,建议采用双中心部署,且单中心内核心模块无单点。
|
|
75
|
+
- id: "7"
|
|
76
|
+
upstream: ["4", "5"]
|
|
77
|
+
state: completed
|
|
78
|
+
messages:
|
|
79
|
+
- role: assistant
|
|
80
|
+
parts:
|
|
81
|
+
- type: text
|
|
82
|
+
text: |-
|
|
83
|
+
依据内部知识库,手机银行系统的逻辑组件包含用户认证,交易接入和理财中心三个模块组成。依据《XX公司运维管理文件》该系统的重要等级为一级,可用性要求99.999%,MTTR为小于3分钟,该系统部署需要实现异地容灾,建议采用双中心部署,且单中心内核心模块无单点。
|
|
84
|
+
- id: "8"
|
|
85
|
+
upstream: ["7"]
|
|
86
|
+
instruction: |-
|
|
87
|
+
深度搜素CMDB给出资源的纳管现状
|
|
88
|
+
state: completed
|
|
89
|
+
messages:
|
|
90
|
+
- role: assistant
|
|
91
|
+
parts:
|
|
92
|
+
- type: text
|
|
93
|
+
text: |-
|
|
94
|
+
基于CMDB查询手机银行的资源纳管情况,纳管现状总结如下:
|
|
95
|
+
|
|
96
|
+
实例数据的完整性
|
|
97
|
+
1. 系统录入(已完成)
|
|
98
|
+
2. 模块录入(部分完成),交易接入模块未录入
|
|
99
|
+
3. 环境录入(已完成)
|
|
100
|
+
4. 主机录入(部分完成),交易接入模块主机未录入
|
|
101
|
+
5. 部署实例录入(部分完成),交易接入模块的部署实例未录入
|
|
102
|
+
|
|
103
|
+
关系数据的完整性
|
|
104
|
+
1. 系统和模块(部分完成),系统和交易接入模块的关系未建立
|
|
105
|
+
2. 系统和环境(√)
|
|
106
|
+
3. 模块和主机(部分完成)
|
|
107
|
+
4. ...
|
|
108
|
+
- id: "10"
|
|
109
|
+
upstream: ["8"]
|
|
110
|
+
toolCall:
|
|
111
|
+
name: ask_human
|
|
112
|
+
arguments:
|
|
113
|
+
command: ask_user_more
|
|
114
|
+
question: |-
|
|
115
|
+
- 交易接入模块的录入;
|
|
116
|
+
- 系统和交易接入模块的关系创建 ;
|
|
117
|
+
- 部署实例自动采集特征录入。
|
|
118
|
+
instruction: |-
|
|
119
|
+
利用深度思考能力,给出手机银行系统的资源纳管优化方案,该方案用户可以微调或确认
|
|
120
|
+
state: completed
|
|
121
|
+
messages:
|
|
122
|
+
- role: user
|
|
123
|
+
parts:
|
|
124
|
+
- type: text
|
|
125
|
+
text: |-
|
|
126
|
+
我补充下...
|
|
127
|
+
- id: "12"
|
|
128
|
+
upstream: ["10"]
|
|
129
|
+
instruction: |-
|
|
130
|
+
在CMDB中完成手机银行系统的资源纳管
|
|
131
|
+
toolCall:
|
|
132
|
+
name: ask_human
|
|
133
|
+
arguments:
|
|
134
|
+
command: ask_user_confirm
|
|
135
|
+
question: |-
|
|
136
|
+
方案执行的过程信息
|
|
137
|
+
state: completed
|
|
138
|
+
messages:
|
|
139
|
+
- role: tool
|
|
140
|
+
parts:
|
|
141
|
+
- type: text
|
|
142
|
+
text: |-
|
|
143
|
+
确认
|
|
144
|
+
- id: "14"
|
|
145
|
+
upstream: ["12"]
|
|
146
|
+
instruction: |-
|
|
147
|
+
生成纳管后手机银行系统的逻辑架构和部署架构图
|
|
148
|
+
tag: topology
|
|
149
|
+
state: completed
|
|
150
|
+
messages:
|
|
151
|
+
- role: assistant
|
|
152
|
+
parts:
|
|
153
|
+
- type: text
|
|
154
|
+
text: |-
|
|
155
|
+
https://example.com/topology
|
|
156
|
+
- id: "16"
|
|
157
|
+
upstream: ["14"]
|
|
158
|
+
state: completed
|
|
159
|
+
messages:
|
|
160
|
+
- role: assistant
|
|
161
|
+
parts:
|
|
162
|
+
- type: text
|
|
163
|
+
text: |-
|
|
164
|
+
该手机银行系统的资源纳管已经完成,本次纳管新增了交易接入模块和该模块相关的主机,以及部署实例信息,模块的纳管建议和架构管理平台打通,部署实例的纳管建议和自动发布平台打通,以便自动完成数据变更,确保数据的准确性,降低架构维护成本。
|
|
165
|
+
```
|