@shenghuabi/workflow 1.0.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/index.d.ts +14 -0
- package/index.js +2078 -0
- package/index.js.map +7 -0
- package/index.mjs +2035 -0
- package/index.mjs.map +7 -0
- package/inline/inline.service.d.ts +8 -0
- package/inline/node/chat/chat.node.define.d.ts +185 -0
- package/inline/node/chat/common.d.ts +2 -0
- package/inline/node/chat/main/index.d.ts +209 -0
- package/inline/node/chat/main/llm.runner.d.ts +41 -0
- package/inline/node/chat/util.d.ts +8 -0
- package/inline/node/chat/webview/index.d.ts +2 -0
- package/inline/node/index.browser.d.ts +2 -0
- package/inline/node/index.node.d.ts +2 -0
- package/inline/node/text/common.d.ts +2 -0
- package/inline/node/text/main/index.d.ts +30 -0
- package/inline/node/text/main/textarea.runner.d.ts +7 -0
- package/inline/node/text/text.node.define.d.ts +6 -0
- package/inline/node/text/webview/index.d.ts +2 -0
- package/module.d.ts +23 -0
- package/package.json +52 -0
- package/plugin/plugin.service.d.ts +7 -0
- package/preset/context-build.service.d.ts +102 -0
- package/preset/inline-build.service.d.ts +11 -0
- package/preset/inline-runner.service.d.ts +16 -0
- package/runner/define.d.ts +12 -0
- package/runner/inline-input-item.runner.d.ts +8 -0
- package/runner/input-params.runner.d.ts +7 -0
- package/runner/iteration-start.runner.d.ts +7 -0
- package/runner/iteration.runner.d.ts +7 -0
- package/runner/parameters.runner.d.ts +10 -0
- package/runner/runner-error.d.ts +12 -0
- package/runner/runner-item.d.ts +35 -0
- package/runner/workflow-runner.service.d.ts +35 -0
- package/share/common/const.d.ts +2 -0
- package/share/common/define.d.ts +71 -0
- package/share/common/examples.define.d.ts +53 -0
- package/share/common/handle.define.d.ts +5 -0
- package/share/common/index.d.ts +5 -0
- package/share/common/inline-template.define.d.ts +15 -0
- package/share/common/llm.define.d.ts +29 -0
- package/share/const.d.ts +5 -0
- package/share/handle-node.d.ts +60 -0
- package/share/index.d.ts +8 -0
- package/share/index.js +336 -0
- package/share/index.js.map +7 -0
- package/share/index.mjs +296 -0
- package/share/index.mjs.map +7 -0
- package/share/type.d.ts +89 -0
- package/share/type2.d.ts +132 -0
- package/share/util/layout.d.ts +2 -0
- package/share/util.d.ts +5 -0
- package/share/workflow.const.d.ts +8 -0
- package/share/workflow.emit.d.ts +9 -0
- package/template-format.service.d.ts +29 -0
- package/test/chat.spec.d.ts +1 -0
- package/test/file.spec.d.ts +1 -0
- package/test/hello.spec.d.ts +1 -0
- package/test/plugin.spec.d.ts +1 -0
- package/token.d.ts +68 -0
- package/type/type.d.ts +5 -0
- package/webview/index.d.ts +1 -0
- package/webview/index.js +399 -0
- package/webview/index.js.map +7 -0
- package/webview/index.mjs +388 -0
- package/webview/index.mjs.map +7 -0
- package/workflow-exec.service.d.ts +41 -0
- package/workflow-file.service.d.ts +9 -0
- package/workflow-parser.service.d.ts +24 -0
- package/workflow-select.service.d.ts +13 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Injector } from 'static-injector';
|
|
2
|
+
export type RunnerResult = Promise<(output: string) => Promise<{
|
|
3
|
+
extra?: any;
|
|
4
|
+
value: any;
|
|
5
|
+
}>>;
|
|
6
|
+
export type OutputResult = ReturnType<Awaited<RunnerResult>>;
|
|
7
|
+
import * as v from 'valibot';
|
|
8
|
+
import { WorkflowEmitter } from '../share';
|
|
9
|
+
import { ChatMetadata } from '../share/type';
|
|
10
|
+
import { ChatModelOptions } from '@shenghuabi/openai';
|
|
11
|
+
import { ModelInputConfig } from '../share/common';
|
|
12
|
+
export declare class NodeRunnerBase {
|
|
13
|
+
#private;
|
|
14
|
+
protected node: import("..").ParsedNode;
|
|
15
|
+
protected callNode: import("..").ParsedNode;
|
|
16
|
+
protected context: import("./workflow-runner.service").WorkflowRunnerContext;
|
|
17
|
+
protected inputParams: import("..").WorkflowRunnerInputs;
|
|
18
|
+
protected injector: Injector;
|
|
19
|
+
protected emitter: WorkflowEmitter;
|
|
20
|
+
protected abortSignal: AbortSignal | undefined;
|
|
21
|
+
run(): RunnerResult;
|
|
22
|
+
inputs$$: import("static-injector").Signal<Record<string, {
|
|
23
|
+
value: any;
|
|
24
|
+
extra?: any;
|
|
25
|
+
}>>;
|
|
26
|
+
inputValueObject$$: import("static-injector").Signal<Record<string, any>>;
|
|
27
|
+
inputMetadataList$$: import("static-injector").Signal<any[]>;
|
|
28
|
+
getInputMetadata(input: string): any;
|
|
29
|
+
getInputChat(): Promise<{
|
|
30
|
+
metadataList: ChatMetadata[];
|
|
31
|
+
obj: Record<string, any>;
|
|
32
|
+
}>;
|
|
33
|
+
mergeChatModel(input?: ModelInputConfig): Partial<ChatModelOptions>;
|
|
34
|
+
getParsedNode<T extends v.BaseSchema<any, any, any>>(schema: T): v.InferOutput<T>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Injector } from 'static-injector';
|
|
2
|
+
import { WorkflowRunnerInputs, WorkflowRunnerInputsWithContext } from '../share/type2';
|
|
3
|
+
import { ParsedNode, ResolvedWorkflow } from '../share/handle-node';
|
|
4
|
+
import { LogType } from '@cyia/external-call';
|
|
5
|
+
import { Observer } from '../share';
|
|
6
|
+
/** 用于上下文start */
|
|
7
|
+
export declare const ITERATION_ITEM_SYMBOL: unique symbol;
|
|
8
|
+
export declare class WorkflowRunnerContext {
|
|
9
|
+
#private;
|
|
10
|
+
data: ResolvedWorkflow;
|
|
11
|
+
parent: WorkflowRunnerContext | undefined;
|
|
12
|
+
inputs: WorkflowRunnerInputs;
|
|
13
|
+
getNodeById(id: string): ParsedNode;
|
|
14
|
+
startRun(): Promise<{
|
|
15
|
+
extra?: any;
|
|
16
|
+
value: any;
|
|
17
|
+
}>;
|
|
18
|
+
run(): Promise<{
|
|
19
|
+
extra?: any;
|
|
20
|
+
value: any;
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
23
|
+
export declare class WorkflowRunnerService {
|
|
24
|
+
#private;
|
|
25
|
+
/** 自己使用
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
createContext(data: ResolvedWorkflow, inputs: WorkflowRunnerInputs, parent?: WorkflowRunnerContext, parentInjector?: Injector): WorkflowRunnerContext;
|
|
29
|
+
get log(): LogType | undefined;
|
|
30
|
+
/** 入口 */
|
|
31
|
+
run(data: ResolvedWorkflow, input: WorkflowRunnerInputsWithContext, ob?: Observer<any, any>, signal?: AbortSignal): Promise<{
|
|
32
|
+
extra?: any;
|
|
33
|
+
value: any;
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export declare const HandleDefine: v.ObjectSchema<{
|
|
3
|
+
readonly label: v.StringSchema<undefined>;
|
|
4
|
+
readonly value: v.StringSchema<undefined>;
|
|
5
|
+
}, undefined>;
|
|
6
|
+
export declare const InputHandleDefine: v.ObjectSchema<{
|
|
7
|
+
readonly inputType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
8
|
+
readonly optional: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
9
|
+
readonly label: v.StringSchema<undefined>;
|
|
10
|
+
readonly value: v.StringSchema<undefined>;
|
|
11
|
+
}, undefined>;
|
|
12
|
+
export declare const IconSet: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
13
|
+
/** codicon: https://microsoft.github.io/vscode-codicons/dist/codicon.html
|
|
14
|
+
*
|
|
15
|
+
* 默认: https://marella.github.io/material-icons/demo/
|
|
16
|
+
*/
|
|
17
|
+
readonly fontIcon: v.StringSchema<undefined>;
|
|
18
|
+
/** 可为 codicon / 默认不填 */
|
|
19
|
+
readonly fontSet: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
20
|
+
}, undefined>, v.TransformAction<{
|
|
21
|
+
fontIcon: string;
|
|
22
|
+
fontSet?: string | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
fontIcon: string;
|
|
25
|
+
fontSet?: string | undefined;
|
|
26
|
+
}>]>;
|
|
27
|
+
export declare const IconStr: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, {
|
|
28
|
+
fontIcon: string;
|
|
29
|
+
fontSet: undefined;
|
|
30
|
+
}>]>;
|
|
31
|
+
export declare const NodeDefine: v.ObjectSchema<{
|
|
32
|
+
readonly type: v.StringSchema<undefined>;
|
|
33
|
+
readonly label: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
34
|
+
/** */
|
|
35
|
+
readonly icon: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, {
|
|
36
|
+
fontIcon: string;
|
|
37
|
+
fontSet: undefined;
|
|
38
|
+
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
39
|
+
/** codicon: https://microsoft.github.io/vscode-codicons/dist/codicon.html
|
|
40
|
+
*
|
|
41
|
+
* 默认: https://marella.github.io/material-icons/demo/
|
|
42
|
+
*/
|
|
43
|
+
readonly fontIcon: v.StringSchema<undefined>;
|
|
44
|
+
/** 可为 codicon / 默认不填 */
|
|
45
|
+
readonly fontSet: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
46
|
+
}, undefined>, v.TransformAction<{
|
|
47
|
+
fontIcon: string;
|
|
48
|
+
fontSet?: string | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
fontIcon: string;
|
|
51
|
+
fontSet?: string | undefined;
|
|
52
|
+
}>]>], undefined>, undefined>;
|
|
53
|
+
readonly color: v.OptionalSchema<v.PicklistSchema<["primary", "accent", "warn"], undefined>, undefined>;
|
|
54
|
+
readonly help: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
55
|
+
readonly inputs: v.OptionalSchema<v.ArraySchema<v.ArraySchema<v.ObjectSchema<{
|
|
56
|
+
readonly inputType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
57
|
+
readonly optional: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
58
|
+
readonly label: v.StringSchema<undefined>;
|
|
59
|
+
readonly value: v.StringSchema<undefined>;
|
|
60
|
+
}, undefined>, undefined>, undefined>, undefined>;
|
|
61
|
+
readonly outputs: v.OptionalSchema<v.ArraySchema<v.ArraySchema<v.ObjectSchema<{
|
|
62
|
+
readonly label: v.StringSchema<undefined>;
|
|
63
|
+
readonly value: v.StringSchema<undefined>;
|
|
64
|
+
}, undefined>, undefined>, undefined>, undefined>;
|
|
65
|
+
readonly disableHead: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
66
|
+
readonly disableConnect: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
67
|
+
/** 出口表示分支 */
|
|
68
|
+
readonly nodeMode: v.OptionalSchema<v.PicklistSchema<["condition", "default"], undefined>, undefined>;
|
|
69
|
+
}, undefined>;
|
|
70
|
+
export type WorkflowNodeConfigInputType = v.InferInput<typeof NodeDefine>;
|
|
71
|
+
export type WorkflowNodeConfigOutputType = v.InferOutput<typeof NodeDefine>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export declare const EXAMPLES_DEFINE: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
3
|
+
readonly input: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
4
|
+
readonly format: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "选中后会尝试使用yaml解析为对象,再序列化为对应的响应类型">, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", boolean, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
5
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TitleAction<string, "问题">, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", string, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
6
|
+
}, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", {
|
|
7
|
+
format: boolean;
|
|
8
|
+
value: string;
|
|
9
|
+
}, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
10
|
+
readonly output: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
11
|
+
readonly format: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "是否需要格式化">, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", boolean, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
12
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TitleAction<string, "回答">, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", string, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
13
|
+
}, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", {
|
|
14
|
+
format: boolean;
|
|
15
|
+
value: string;
|
|
16
|
+
}, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
17
|
+
}, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", {
|
|
18
|
+
input: {
|
|
19
|
+
format: boolean;
|
|
20
|
+
value: string;
|
|
21
|
+
};
|
|
22
|
+
output: {
|
|
23
|
+
format: boolean;
|
|
24
|
+
value: string;
|
|
25
|
+
};
|
|
26
|
+
}, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>, undefined>, readonly []>, v.TitleAction<{
|
|
27
|
+
input: {
|
|
28
|
+
format: boolean;
|
|
29
|
+
value: string;
|
|
30
|
+
};
|
|
31
|
+
output: {
|
|
32
|
+
format: boolean;
|
|
33
|
+
value: string;
|
|
34
|
+
};
|
|
35
|
+
}[], "用例">, v.DescriptionAction<{
|
|
36
|
+
input: {
|
|
37
|
+
format: boolean;
|
|
38
|
+
value: string;
|
|
39
|
+
};
|
|
40
|
+
output: {
|
|
41
|
+
format: boolean;
|
|
42
|
+
value: string;
|
|
43
|
+
};
|
|
44
|
+
}[], "回答问题之前,会参考定义的用例格式进行回复,用于规范回答">, import("@piying/valibot-visit").ConditionAction<{
|
|
45
|
+
input: {
|
|
46
|
+
format: boolean;
|
|
47
|
+
value: string;
|
|
48
|
+
};
|
|
49
|
+
output: {
|
|
50
|
+
format: boolean;
|
|
51
|
+
value: string;
|
|
52
|
+
};
|
|
53
|
+
}[]>]>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export declare const HandleDataDefine: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
3
|
+
readonly output: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.OptionalSchema<v.AnySchema, undefined>, import("@piying/valibot-visit").ConditionAction<any>]>, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", any[], import("@piying/view-angular-core").AnyCoreSchemaHandle>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", any[], import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
4
|
+
readonly input: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.OptionalSchema<v.AnySchema, undefined>, import("@piying/valibot-visit").ConditionAction<any>]>, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", any[], import("@piying/view-angular-core").AnyCoreSchemaHandle>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", any[], import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
5
|
+
}, undefined>, undefined>, import("@piying/valibot-visit").ConditionAction<any>]>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export declare const INLINE_Template: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
3
|
+
readonly enable: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
4
|
+
readonly value: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, "{{NODE.description}}">, v.TitleAction<string, "模板">, v.DescriptionAction<string, "允许使用变量:{{NODE.xxx}}(参考节点帮助)">, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", string, import("@piying/view-angular-core").AnyCoreSchemaHandle>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", string, import("@piying/view-angular-core").AnyCoreSchemaHandle>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", string, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
5
|
+
}, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", {
|
|
6
|
+
enable: boolean;
|
|
7
|
+
value: string;
|
|
8
|
+
}, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
9
|
+
export declare const INLINE_Template2: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
10
|
+
readonly enable: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
11
|
+
readonly value: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, undefined>, v.TitleAction<string | undefined, "模板">, v.DescriptionAction<string | undefined, "允许使用变量:{{ENTRY.xxx}}(参考节点帮助)">, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", string | undefined, import("@piying/view-angular-core").AnyCoreSchemaHandle>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", string | undefined, import("@piying/view-angular-core").AnyCoreSchemaHandle>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", string | undefined, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
12
|
+
}, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", {
|
|
13
|
+
enable: boolean;
|
|
14
|
+
value?: string | undefined;
|
|
15
|
+
}, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export declare function llmModelConfig(item?: {
|
|
3
|
+
label: string;
|
|
4
|
+
}): v.SchemaWithPipe<readonly [v.IntersectSchema<[v.SchemaWithPipe<readonly [v.IntersectSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
5
|
+
readonly name: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, undefined>, v.TitleAction<string | undefined, "预定义模型配置">, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", string | undefined, import("@piying/view-angular-core").AnyCoreSchemaHandle>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", string | undefined, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
6
|
+
readonly model: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, undefined>, v.TitleAction<string | undefined, "模型">]>;
|
|
7
|
+
readonly baseURL: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, undefined>, v.TitleAction<string | undefined, "地址">]>;
|
|
8
|
+
}, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", {
|
|
9
|
+
name?: string | undefined;
|
|
10
|
+
model?: string | undefined;
|
|
11
|
+
baseURL?: string | undefined;
|
|
12
|
+
}, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>], undefined>, v.TitleAction<{
|
|
13
|
+
name?: string | undefined;
|
|
14
|
+
model?: string | undefined;
|
|
15
|
+
baseURL?: string | undefined;
|
|
16
|
+
}, string>, import("@piying/valibot-visit").ConditionAction<{
|
|
17
|
+
name?: string | undefined;
|
|
18
|
+
model?: string | undefined;
|
|
19
|
+
baseURL?: string | undefined;
|
|
20
|
+
}>]>], undefined>, import("@piying/valibot-visit").ConditionAction<{
|
|
21
|
+
name?: string | undefined;
|
|
22
|
+
model?: string | undefined;
|
|
23
|
+
baseURL?: string | undefined;
|
|
24
|
+
}>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", {
|
|
25
|
+
name?: string | undefined;
|
|
26
|
+
model?: string | undefined;
|
|
27
|
+
baseURL?: string | undefined;
|
|
28
|
+
}, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
29
|
+
export type ModelInputConfig = v.InferOutput<ReturnType<typeof llmModelConfig>>;
|
package/share/const.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ChatInput2, ChatInputType } from './type';
|
|
2
|
+
import { WorkflowNodeType } from './workflow.const';
|
|
3
|
+
import type { Node, ReactFlowJsonObject } from '@xyflow/react';
|
|
4
|
+
export interface HandleNode {
|
|
5
|
+
id: string;
|
|
6
|
+
/** 真正赋值使用 */
|
|
7
|
+
value: string;
|
|
8
|
+
/** 应该应用于tooltip显示,不应该被其他显示 */
|
|
9
|
+
label: string;
|
|
10
|
+
type?: 'connect';
|
|
11
|
+
inputType?: ChatInputType;
|
|
12
|
+
/** 是否可选,用于某些不用传入的参数 */
|
|
13
|
+
optional?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** 将handle节点全部拍平 */
|
|
16
|
+
export declare function flatFilterHandleList(list: HandleNode[][] | undefined): HandleNode[];
|
|
17
|
+
/** 继承 handleNode */
|
|
18
|
+
export type ResolvedInputNode = Omit<HandleNode, 'label'> & {
|
|
19
|
+
nodeId?: string;
|
|
20
|
+
outputName?: string;
|
|
21
|
+
};
|
|
22
|
+
export interface WorkflowNodeData {
|
|
23
|
+
value?: any;
|
|
24
|
+
handle?: {
|
|
25
|
+
input: HandleNode[][];
|
|
26
|
+
output: HandleNode[][];
|
|
27
|
+
};
|
|
28
|
+
config?: Record<string, any>;
|
|
29
|
+
title?: string;
|
|
30
|
+
outputName?: string;
|
|
31
|
+
/** 在工作流中禁止使用 @internal */
|
|
32
|
+
excludeUsage?: boolean;
|
|
33
|
+
[name: string]: any;
|
|
34
|
+
}
|
|
35
|
+
/** 工作流定义 */
|
|
36
|
+
export interface WorkflowData {
|
|
37
|
+
flow: ReactFlowJsonObject<Node<WorkflowNodeData>>;
|
|
38
|
+
version: number;
|
|
39
|
+
}
|
|
40
|
+
export type RawWorkflowNode = Omit<Node<WorkflowNodeData>, 'position'>;
|
|
41
|
+
export interface ParsedNode {
|
|
42
|
+
id: string;
|
|
43
|
+
type: WorkflowNodeType;
|
|
44
|
+
data: WorkflowNodeData;
|
|
45
|
+
/** 所有输入是都是需要节点连接的,如果没有节点连接会酌情处理 handleinput过来的 */
|
|
46
|
+
inputs: ResolvedInputNode[];
|
|
47
|
+
/** 可能是多出口 */
|
|
48
|
+
outputs: HandleNode[];
|
|
49
|
+
subFlowList?: {
|
|
50
|
+
key: any;
|
|
51
|
+
flow: ResolvedWorkflow;
|
|
52
|
+
startId?: string;
|
|
53
|
+
}[];
|
|
54
|
+
}
|
|
55
|
+
export interface ResolvedWorkflow {
|
|
56
|
+
nodes: Record<string, ParsedNode>;
|
|
57
|
+
/** 出口 */
|
|
58
|
+
end: string;
|
|
59
|
+
inputList: ChatInput2[];
|
|
60
|
+
}
|
package/share/index.d.ts
ADDED