@xpert-ai/plugin-sdk 3.6.0 → 3.6.2
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.cjs.d.ts +1 -0
- package/index.cjs.js +65517 -4
- package/index.esm.d.ts +1 -0
- package/index.esm.js +65419 -0
- package/package.json +4 -4
- package/src/index.d.ts +13 -0
- package/src/lib/ai-model/abstract-provider.d.ts +41 -0
- package/src/lib/ai-model/ai-model-provider.decorator.d.ts +2 -0
- package/src/lib/ai-model/ai-model-provider.interface.d.ts +42 -0
- package/src/lib/ai-model/ai-model-provider.registry.d.ts +6 -0
- package/src/lib/ai-model/ai-model.d.ts +33 -0
- package/src/lib/ai-model/entities/defaults.d.ts +3 -0
- package/src/lib/ai-model/entities/index.d.ts +2 -0
- package/src/lib/ai-model/entities/model_entities.d.ts +14 -0
- package/src/lib/ai-model/errors.d.ts +5 -0
- package/src/lib/ai-model/index.d.ts +8 -0
- package/src/lib/ai-model/llm.d.ts +49 -0
- package/src/lib/ai-model/openai-compatible/completions.d.ts +23 -0
- package/src/lib/ai-model/openai-compatible/index.d.ts +3 -0
- package/src/lib/ai-model/openai-compatible/rerank.d.ts +20 -0
- package/src/lib/ai-model/openai-compatible/speech2text.d.ts +17 -0
- package/src/lib/ai-model/types/index.d.ts +11 -0
- package/src/lib/ai-model/types/model.d.ts +43 -0
- package/src/lib/ai-model/types/rerank.d.ts +20 -0
- package/src/lib/ai-model/types/speech2text.d.ts +3 -0
- package/src/lib/ai-model/types/text-embedding-model.d.ts +7 -0
- package/src/lib/ai-model/types/tts.d.ts +5 -0
- package/src/lib/core/file-system.d.ts +55 -0
- package/src/lib/core/i18n.d.ts +2 -0
- package/src/lib/core/index.d.ts +5 -0
- package/src/lib/core/permissions.d.ts +74 -0
- package/src/lib/core/schema.d.ts +22 -0
- package/src/lib/core/utils.d.ts +12 -0
- package/src/lib/data/datasource/adapter.strategy.d.ts +20 -0
- package/src/lib/data/datasource/index.d.ts +5 -0
- package/src/lib/data/datasource/strategy.decorator.d.ts +2 -0
- package/src/lib/data/datasource/strategy.interface.d.ts +19 -0
- package/src/lib/data/datasource/strategy.registry.d.ts +7 -0
- package/src/lib/data/datasource/types.d.ts +255 -0
- package/src/lib/data/index.d.ts +1 -0
- package/src/lib/integration/index.d.ts +3 -0
- package/src/lib/integration/strategy.decorator.d.ts +2 -0
- package/src/lib/integration/strategy.interface.d.ts +9 -0
- package/src/lib/integration/strategy.registry.d.ts +6 -0
- package/src/lib/logger.d.ts +2 -0
- package/src/lib/plugin-metadata.d.ts +17 -0
- package/src/lib/plugin.d.ts +8 -0
- package/src/lib/{plugin.hook.ts → plugin.hook.d.ts} +0 -4
- package/src/lib/plugin.interface.d.ts +59 -0
- package/src/lib/rag/image/index.d.ts +3 -0
- package/src/lib/rag/image/strategy.decorator.d.ts +5 -0
- package/src/lib/rag/image/strategy.interface.d.ts +31 -0
- package/src/lib/rag/image/strategy.registry.d.ts +6 -0
- package/src/lib/rag/index.d.ts +7 -0
- package/src/lib/rag/knowledge/index.d.ts +3 -0
- package/src/lib/rag/knowledge/knowledge-strategy.decorator.d.ts +2 -0
- package/src/lib/rag/knowledge/knowledge-strategy.interface.d.ts +15 -0
- package/src/lib/rag/knowledge/knowledge-strategy.registry.d.ts +6 -0
- package/src/lib/rag/retriever/index.d.ts +3 -0
- package/src/lib/rag/retriever/strategy.decorator.d.ts +5 -0
- package/src/lib/rag/retriever/strategy.interface.d.ts +30 -0
- package/src/lib/rag/retriever/strategy.registry.d.ts +6 -0
- package/src/lib/rag/source/index.d.ts +3 -0
- package/src/lib/rag/source/strategy.decorator.d.ts +5 -0
- package/src/lib/rag/source/strategy.interface.d.ts +36 -0
- package/src/lib/rag/source/strategy.registry.d.ts +6 -0
- package/src/lib/rag/textsplitter/index.d.ts +3 -0
- package/src/lib/rag/textsplitter/strategy.decorator.d.ts +2 -0
- package/src/lib/rag/textsplitter/strategy.interface.d.ts +23 -0
- package/src/lib/rag/textsplitter/strategy.registry.d.ts +6 -0
- package/src/lib/rag/transformer/index.d.ts +3 -0
- package/src/lib/rag/transformer/strategy.decorator.d.ts +5 -0
- package/src/lib/rag/transformer/strategy.interface.d.ts +26 -0
- package/src/lib/rag/transformer/strategy.registry.d.ts +6 -0
- package/src/lib/rag/types.d.ts +18 -0
- package/src/lib/strategy.d.ts +12 -0
- package/src/lib/toolset/builtin.d.ts +54 -0
- package/src/lib/toolset/index.d.ts +5 -0
- package/src/lib/toolset/strategy.decorator.d.ts +5 -0
- package/src/lib/toolset/strategy.interface.d.ts +28 -0
- package/src/lib/toolset/strategy.registry.d.ts +6 -0
- package/src/lib/toolset/toolset.d.ts +53 -0
- package/src/lib/types.d.ts +47 -0
- package/src/lib/vectorstore/index.d.ts +3 -0
- package/src/lib/vectorstore/strategy.decorator.d.ts +2 -0
- package/src/lib/vectorstore/strategy.interface.d.ts +24 -0
- package/src/lib/vectorstore/strategy.registry.d.ts +6 -0
- package/src/lib/workflow/index.d.ts +2 -0
- package/src/lib/workflow/node/index.d.ts +3 -0
- package/src/lib/workflow/node/strategy.decorator.d.ts +5 -0
- package/src/lib/workflow/node/strategy.interface.d.ts +41 -0
- package/src/lib/workflow/node/strategy.registry.d.ts +9 -0
- package/src/lib/workflow/trigger/index.d.ts +3 -0
- package/src/lib/workflow/trigger/strategy.decorator.d.ts +2 -0
- package/src/lib/workflow/trigger/strategy.interface.d.ts +22 -0
- package/src/lib/workflow/trigger/strategy.registry.d.ts +6 -0
- package/.eslintrc.json +0 -30
- package/.swcrc +0 -29
- package/jest.config.ts +0 -28
- package/project.json +0 -59
- package/src/index.ts +0 -11
- package/src/lib/core/file-system.ts +0 -113
- package/src/lib/core/i18n.ts +0 -31
- package/src/lib/core/index.ts +0 -4
- package/src/lib/core/permissions.ts +0 -97
- package/src/lib/core/schema.ts +0 -23
- package/src/lib/integration/index.ts +0 -3
- package/src/lib/integration/strategy.decorator.ts +0 -6
- package/src/lib/integration/strategy.interface.ts +0 -11
- package/src/lib/integration/strategy.registry.ts +0 -12
- package/src/lib/logger.ts +0 -18
- package/src/lib/plugin-metadata.ts +0 -20
- package/src/lib/plugin.interface.ts +0 -67
- package/src/lib/plugin.ts +0 -32
- package/src/lib/rag/image/index.ts +0 -3
- package/src/lib/rag/image/strategy.decorator.ts +0 -9
- package/src/lib/rag/image/strategy.interface.ts +0 -37
- package/src/lib/rag/image/strategy.registry.ts +0 -17
- package/src/lib/rag/index.ts +0 -7
- package/src/lib/rag/knowledge/index.ts +0 -3
- package/src/lib/rag/knowledge/knowledge-strategy.decorator.ts +0 -6
- package/src/lib/rag/knowledge/knowledge-strategy.interface.ts +0 -15
- package/src/lib/rag/knowledge/knowledge-strategy.registry.ts +0 -12
- package/src/lib/rag/retriever/index.ts +0 -3
- package/src/lib/rag/retriever/strategy.decorator.ts +0 -9
- package/src/lib/rag/retriever/strategy.interface.ts +0 -32
- package/src/lib/rag/retriever/strategy.registry.ts +0 -12
- package/src/lib/rag/source/index.ts +0 -3
- package/src/lib/rag/source/strategy.decorator.ts +0 -9
- package/src/lib/rag/source/strategy.interface.ts +0 -36
- package/src/lib/rag/source/strategy.registry.ts +0 -17
- package/src/lib/rag/textsplitter/index.ts +0 -3
- package/src/lib/rag/textsplitter/strategy.decorator.ts +0 -6
- package/src/lib/rag/textsplitter/strategy.interface.ts +0 -28
- package/src/lib/rag/textsplitter/strategy.registry.ts +0 -17
- package/src/lib/rag/transformer/index.ts +0 -3
- package/src/lib/rag/transformer/strategy.decorator.ts +0 -9
- package/src/lib/rag/transformer/strategy.interface.ts +0 -34
- package/src/lib/rag/transformer/strategy.registry.ts +0 -14
- package/src/lib/rag/types.ts +0 -76
- package/src/lib/strategy.ts +0 -37
- package/src/lib/toolset/builtin.ts +0 -111
- package/src/lib/toolset/index.ts +0 -5
- package/src/lib/toolset/strategy.decorator.ts +0 -9
- package/src/lib/toolset/strategy.interface.ts +0 -32
- package/src/lib/toolset/strategy.registry.ts +0 -17
- package/src/lib/toolset/toolset.ts +0 -76
- package/src/lib/types.ts +0 -47
- package/src/lib/vectorstore/index.ts +0 -3
- package/src/lib/vectorstore/strategy.decorator.ts +0 -6
- package/src/lib/vectorstore/strategy.interface.ts +0 -25
- package/src/lib/vectorstore/strategy.registry.ts +0 -17
- package/src/lib/workflow/index.ts +0 -2
- package/src/lib/workflow/node/index.ts +0 -3
- package/src/lib/workflow/node/strategy.decorator.ts +0 -9
- package/src/lib/workflow/node/strategy.interface.ts +0 -51
- package/src/lib/workflow/node/strategy.registry.ts +0 -18
- package/src/lib/workflow/trigger/index.ts +0 -3
- package/src/lib/workflow/trigger/strategy.decorator.ts +0 -6
- package/src/lib/workflow/trigger/strategy.interface.ts +0 -27
- package/src/lib/workflow/trigger/strategy.registry.ts +0 -17
- package/tsconfig.json +0 -22
- package/tsconfig.lib.json +0 -10
- package/tsconfig.spec.json +0 -9
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Runnable } from '@langchain/core/runnables'
|
|
2
|
-
import { BaseChannel } from '@langchain/langgraph'
|
|
3
|
-
import {
|
|
4
|
-
IEnvironment,
|
|
5
|
-
IWorkflowNode,
|
|
6
|
-
TWorkflowNodeMeta,
|
|
7
|
-
TXpertGraph,
|
|
8
|
-
TXpertParameter,
|
|
9
|
-
TXpertTeamNode
|
|
10
|
-
} from '@metad/contracts'
|
|
11
|
-
|
|
12
|
-
export type TWorkflowNodeParams<TConfig = any> = {
|
|
13
|
-
xpertId: string
|
|
14
|
-
agentKey?: string
|
|
15
|
-
node: TXpertTeamNode
|
|
16
|
-
config: TConfig
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type TWorkflowNodeResult = {
|
|
20
|
-
name?: string
|
|
21
|
-
graph: Runnable
|
|
22
|
-
ends: string[]
|
|
23
|
-
channel?: {
|
|
24
|
-
name: string
|
|
25
|
-
annotation: BaseChannel
|
|
26
|
-
}
|
|
27
|
-
navigator?: (state, config) => Promise<any>
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Workflow Node Strategy interface
|
|
32
|
-
*/
|
|
33
|
-
export interface IWorkflowNodeStrategy<TConfig = any, TResult = any> {
|
|
34
|
-
/**
|
|
35
|
-
* Metadata describing the node (type, label, description, config schema, etc.)
|
|
36
|
-
*/
|
|
37
|
-
meta: TWorkflowNodeMeta
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Create the node subgraph
|
|
41
|
-
*/
|
|
42
|
-
create(payload: {
|
|
43
|
-
graph: TXpertGraph
|
|
44
|
-
node: TXpertTeamNode & { type: 'workflow' }
|
|
45
|
-
xpertId: string
|
|
46
|
-
environment: IEnvironment
|
|
47
|
-
isDraft: boolean
|
|
48
|
-
}): TWorkflowNodeResult
|
|
49
|
-
|
|
50
|
-
outputVariables(entity: IWorkflowNode): TXpertParameter[]
|
|
51
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
2
|
-
import { DiscoveryService, Reflector } from '@nestjs/core';
|
|
3
|
-
import { BaseStrategyRegistry } from '../../strategy';
|
|
4
|
-
import { WORKFLOW_NODE_STRATEGY } from './strategy.decorator';
|
|
5
|
-
import { IWorkflowNodeStrategy } from './strategy.interface';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Registry for Workflow Node Strategies
|
|
9
|
-
*/
|
|
10
|
-
@Injectable()
|
|
11
|
-
export class WorkflowNodeRegistry<TConfig = any, TResult = any> extends BaseStrategyRegistry<IWorkflowNodeStrategy<TConfig, TResult>> {
|
|
12
|
-
constructor(
|
|
13
|
-
discoveryService: DiscoveryService,
|
|
14
|
-
reflector: Reflector
|
|
15
|
-
) {
|
|
16
|
-
super(WORKFLOW_NODE_STRATEGY, discoveryService, reflector);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { TWorkflowTriggerMeta, TXpertTeamNode } from '@metad/contracts'
|
|
2
|
-
|
|
3
|
-
export type TWorkflowTriggerParams<T> = {
|
|
4
|
-
xpertId: string
|
|
5
|
-
agentKey?: string
|
|
6
|
-
node?: TXpertTeamNode
|
|
7
|
-
config: T
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface IWorkflowTriggerStrategy<T> {
|
|
11
|
-
meta: TWorkflowTriggerMeta
|
|
12
|
-
|
|
13
|
-
validate(payload: TWorkflowTriggerParams<T>): Promise<any[]>
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Initialize the trigger when publish xpert workflow
|
|
17
|
-
*
|
|
18
|
-
* @param payload
|
|
19
|
-
* @param callback
|
|
20
|
-
*/
|
|
21
|
-
publish(payload: TWorkflowTriggerParams<T>, callback: (payload: any) => void): Promise<any> | void
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Stop the trigger
|
|
25
|
-
*/
|
|
26
|
-
stop(payload: TWorkflowTriggerParams<T>): void;
|
|
27
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common'
|
|
2
|
-
import { DiscoveryService, Reflector } from '@nestjs/core'
|
|
3
|
-
import { BaseStrategyRegistry } from '../../strategy'
|
|
4
|
-
import { WORKFLOW_TRIGGER_STRATEGY } from './strategy.decorator'
|
|
5
|
-
import { IWorkflowTriggerStrategy } from './strategy.interface'
|
|
6
|
-
|
|
7
|
-
@Injectable()
|
|
8
|
-
export class WorkflowTriggerRegistry<T = any> extends BaseStrategyRegistry<IWorkflowTriggerStrategy<T>> {
|
|
9
|
-
|
|
10
|
-
constructor(
|
|
11
|
-
discoveryService: DiscoveryService,
|
|
12
|
-
reflector: Reflector
|
|
13
|
-
) {
|
|
14
|
-
super(WORKFLOW_TRIGGER_STRATEGY, discoveryService, reflector);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"forceConsistentCasingInFileNames": true,
|
|
6
|
-
"strict": true,
|
|
7
|
-
"noImplicitOverride": true,
|
|
8
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
9
|
-
"noImplicitReturns": true,
|
|
10
|
-
"noFallthroughCasesInSwitch": true
|
|
11
|
-
},
|
|
12
|
-
"files": [],
|
|
13
|
-
"include": [],
|
|
14
|
-
"references": [
|
|
15
|
-
{
|
|
16
|
-
"path": "./tsconfig.lib.json"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"path": "./tsconfig.spec.json"
|
|
20
|
-
}
|
|
21
|
-
]
|
|
22
|
-
}
|
package/tsconfig.lib.json
DELETED
package/tsconfig.spec.json
DELETED