@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.
Files changed (164) hide show
  1. package/index.cjs.d.ts +1 -0
  2. package/index.cjs.js +65517 -4
  3. package/index.esm.d.ts +1 -0
  4. package/index.esm.js +65419 -0
  5. package/package.json +4 -4
  6. package/src/index.d.ts +13 -0
  7. package/src/lib/ai-model/abstract-provider.d.ts +41 -0
  8. package/src/lib/ai-model/ai-model-provider.decorator.d.ts +2 -0
  9. package/src/lib/ai-model/ai-model-provider.interface.d.ts +42 -0
  10. package/src/lib/ai-model/ai-model-provider.registry.d.ts +6 -0
  11. package/src/lib/ai-model/ai-model.d.ts +33 -0
  12. package/src/lib/ai-model/entities/defaults.d.ts +3 -0
  13. package/src/lib/ai-model/entities/index.d.ts +2 -0
  14. package/src/lib/ai-model/entities/model_entities.d.ts +14 -0
  15. package/src/lib/ai-model/errors.d.ts +5 -0
  16. package/src/lib/ai-model/index.d.ts +8 -0
  17. package/src/lib/ai-model/llm.d.ts +49 -0
  18. package/src/lib/ai-model/openai-compatible/completions.d.ts +23 -0
  19. package/src/lib/ai-model/openai-compatible/index.d.ts +3 -0
  20. package/src/lib/ai-model/openai-compatible/rerank.d.ts +20 -0
  21. package/src/lib/ai-model/openai-compatible/speech2text.d.ts +17 -0
  22. package/src/lib/ai-model/types/index.d.ts +11 -0
  23. package/src/lib/ai-model/types/model.d.ts +43 -0
  24. package/src/lib/ai-model/types/rerank.d.ts +20 -0
  25. package/src/lib/ai-model/types/speech2text.d.ts +3 -0
  26. package/src/lib/ai-model/types/text-embedding-model.d.ts +7 -0
  27. package/src/lib/ai-model/types/tts.d.ts +5 -0
  28. package/src/lib/core/file-system.d.ts +55 -0
  29. package/src/lib/core/i18n.d.ts +2 -0
  30. package/src/lib/core/index.d.ts +5 -0
  31. package/src/lib/core/permissions.d.ts +74 -0
  32. package/src/lib/core/schema.d.ts +22 -0
  33. package/src/lib/core/utils.d.ts +12 -0
  34. package/src/lib/data/datasource/adapter.strategy.d.ts +20 -0
  35. package/src/lib/data/datasource/index.d.ts +5 -0
  36. package/src/lib/data/datasource/strategy.decorator.d.ts +2 -0
  37. package/src/lib/data/datasource/strategy.interface.d.ts +19 -0
  38. package/src/lib/data/datasource/strategy.registry.d.ts +7 -0
  39. package/src/lib/data/datasource/types.d.ts +255 -0
  40. package/src/lib/data/index.d.ts +1 -0
  41. package/src/lib/integration/index.d.ts +3 -0
  42. package/src/lib/integration/strategy.decorator.d.ts +2 -0
  43. package/src/lib/integration/strategy.interface.d.ts +9 -0
  44. package/src/lib/integration/strategy.registry.d.ts +6 -0
  45. package/src/lib/logger.d.ts +2 -0
  46. package/src/lib/plugin-metadata.d.ts +17 -0
  47. package/src/lib/plugin.d.ts +8 -0
  48. package/src/lib/{plugin.hook.ts → plugin.hook.d.ts} +0 -4
  49. package/src/lib/plugin.interface.d.ts +59 -0
  50. package/src/lib/rag/image/index.d.ts +3 -0
  51. package/src/lib/rag/image/strategy.decorator.d.ts +5 -0
  52. package/src/lib/rag/image/strategy.interface.d.ts +31 -0
  53. package/src/lib/rag/image/strategy.registry.d.ts +6 -0
  54. package/src/lib/rag/index.d.ts +7 -0
  55. package/src/lib/rag/knowledge/index.d.ts +3 -0
  56. package/src/lib/rag/knowledge/knowledge-strategy.decorator.d.ts +2 -0
  57. package/src/lib/rag/knowledge/knowledge-strategy.interface.d.ts +15 -0
  58. package/src/lib/rag/knowledge/knowledge-strategy.registry.d.ts +6 -0
  59. package/src/lib/rag/retriever/index.d.ts +3 -0
  60. package/src/lib/rag/retriever/strategy.decorator.d.ts +5 -0
  61. package/src/lib/rag/retriever/strategy.interface.d.ts +30 -0
  62. package/src/lib/rag/retriever/strategy.registry.d.ts +6 -0
  63. package/src/lib/rag/source/index.d.ts +3 -0
  64. package/src/lib/rag/source/strategy.decorator.d.ts +5 -0
  65. package/src/lib/rag/source/strategy.interface.d.ts +36 -0
  66. package/src/lib/rag/source/strategy.registry.d.ts +6 -0
  67. package/src/lib/rag/textsplitter/index.d.ts +3 -0
  68. package/src/lib/rag/textsplitter/strategy.decorator.d.ts +2 -0
  69. package/src/lib/rag/textsplitter/strategy.interface.d.ts +23 -0
  70. package/src/lib/rag/textsplitter/strategy.registry.d.ts +6 -0
  71. package/src/lib/rag/transformer/index.d.ts +3 -0
  72. package/src/lib/rag/transformer/strategy.decorator.d.ts +5 -0
  73. package/src/lib/rag/transformer/strategy.interface.d.ts +26 -0
  74. package/src/lib/rag/transformer/strategy.registry.d.ts +6 -0
  75. package/src/lib/rag/types.d.ts +18 -0
  76. package/src/lib/strategy.d.ts +12 -0
  77. package/src/lib/toolset/builtin.d.ts +54 -0
  78. package/src/lib/toolset/index.d.ts +5 -0
  79. package/src/lib/toolset/strategy.decorator.d.ts +5 -0
  80. package/src/lib/toolset/strategy.interface.d.ts +28 -0
  81. package/src/lib/toolset/strategy.registry.d.ts +6 -0
  82. package/src/lib/toolset/toolset.d.ts +53 -0
  83. package/src/lib/types.d.ts +47 -0
  84. package/src/lib/vectorstore/index.d.ts +3 -0
  85. package/src/lib/vectorstore/strategy.decorator.d.ts +2 -0
  86. package/src/lib/vectorstore/strategy.interface.d.ts +24 -0
  87. package/src/lib/vectorstore/strategy.registry.d.ts +6 -0
  88. package/src/lib/workflow/index.d.ts +2 -0
  89. package/src/lib/workflow/node/index.d.ts +3 -0
  90. package/src/lib/workflow/node/strategy.decorator.d.ts +5 -0
  91. package/src/lib/workflow/node/strategy.interface.d.ts +41 -0
  92. package/src/lib/workflow/node/strategy.registry.d.ts +9 -0
  93. package/src/lib/workflow/trigger/index.d.ts +3 -0
  94. package/src/lib/workflow/trigger/strategy.decorator.d.ts +2 -0
  95. package/src/lib/workflow/trigger/strategy.interface.d.ts +22 -0
  96. package/src/lib/workflow/trigger/strategy.registry.d.ts +6 -0
  97. package/.eslintrc.json +0 -30
  98. package/.swcrc +0 -29
  99. package/jest.config.ts +0 -28
  100. package/project.json +0 -59
  101. package/src/index.ts +0 -11
  102. package/src/lib/core/file-system.ts +0 -113
  103. package/src/lib/core/i18n.ts +0 -31
  104. package/src/lib/core/index.ts +0 -4
  105. package/src/lib/core/permissions.ts +0 -97
  106. package/src/lib/core/schema.ts +0 -23
  107. package/src/lib/integration/index.ts +0 -3
  108. package/src/lib/integration/strategy.decorator.ts +0 -6
  109. package/src/lib/integration/strategy.interface.ts +0 -11
  110. package/src/lib/integration/strategy.registry.ts +0 -12
  111. package/src/lib/logger.ts +0 -18
  112. package/src/lib/plugin-metadata.ts +0 -20
  113. package/src/lib/plugin.interface.ts +0 -67
  114. package/src/lib/plugin.ts +0 -32
  115. package/src/lib/rag/image/index.ts +0 -3
  116. package/src/lib/rag/image/strategy.decorator.ts +0 -9
  117. package/src/lib/rag/image/strategy.interface.ts +0 -37
  118. package/src/lib/rag/image/strategy.registry.ts +0 -17
  119. package/src/lib/rag/index.ts +0 -7
  120. package/src/lib/rag/knowledge/index.ts +0 -3
  121. package/src/lib/rag/knowledge/knowledge-strategy.decorator.ts +0 -6
  122. package/src/lib/rag/knowledge/knowledge-strategy.interface.ts +0 -15
  123. package/src/lib/rag/knowledge/knowledge-strategy.registry.ts +0 -12
  124. package/src/lib/rag/retriever/index.ts +0 -3
  125. package/src/lib/rag/retriever/strategy.decorator.ts +0 -9
  126. package/src/lib/rag/retriever/strategy.interface.ts +0 -32
  127. package/src/lib/rag/retriever/strategy.registry.ts +0 -12
  128. package/src/lib/rag/source/index.ts +0 -3
  129. package/src/lib/rag/source/strategy.decorator.ts +0 -9
  130. package/src/lib/rag/source/strategy.interface.ts +0 -36
  131. package/src/lib/rag/source/strategy.registry.ts +0 -17
  132. package/src/lib/rag/textsplitter/index.ts +0 -3
  133. package/src/lib/rag/textsplitter/strategy.decorator.ts +0 -6
  134. package/src/lib/rag/textsplitter/strategy.interface.ts +0 -28
  135. package/src/lib/rag/textsplitter/strategy.registry.ts +0 -17
  136. package/src/lib/rag/transformer/index.ts +0 -3
  137. package/src/lib/rag/transformer/strategy.decorator.ts +0 -9
  138. package/src/lib/rag/transformer/strategy.interface.ts +0 -34
  139. package/src/lib/rag/transformer/strategy.registry.ts +0 -14
  140. package/src/lib/rag/types.ts +0 -76
  141. package/src/lib/strategy.ts +0 -37
  142. package/src/lib/toolset/builtin.ts +0 -111
  143. package/src/lib/toolset/index.ts +0 -5
  144. package/src/lib/toolset/strategy.decorator.ts +0 -9
  145. package/src/lib/toolset/strategy.interface.ts +0 -32
  146. package/src/lib/toolset/strategy.registry.ts +0 -17
  147. package/src/lib/toolset/toolset.ts +0 -76
  148. package/src/lib/types.ts +0 -47
  149. package/src/lib/vectorstore/index.ts +0 -3
  150. package/src/lib/vectorstore/strategy.decorator.ts +0 -6
  151. package/src/lib/vectorstore/strategy.interface.ts +0 -25
  152. package/src/lib/vectorstore/strategy.registry.ts +0 -17
  153. package/src/lib/workflow/index.ts +0 -2
  154. package/src/lib/workflow/node/index.ts +0 -3
  155. package/src/lib/workflow/node/strategy.decorator.ts +0 -9
  156. package/src/lib/workflow/node/strategy.interface.ts +0 -51
  157. package/src/lib/workflow/node/strategy.registry.ts +0 -18
  158. package/src/lib/workflow/trigger/index.ts +0 -3
  159. package/src/lib/workflow/trigger/strategy.decorator.ts +0 -6
  160. package/src/lib/workflow/trigger/strategy.interface.ts +0 -27
  161. package/src/lib/workflow/trigger/strategy.registry.ts +0 -17
  162. package/tsconfig.json +0 -22
  163. package/tsconfig.lib.json +0 -10
  164. 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,3 +0,0 @@
1
- export * from './strategy.decorator'
2
- export * from './strategy.interface'
3
- export * from './strategy.registry'
@@ -1,6 +0,0 @@
1
- import { SetMetadata } from '@nestjs/common';
2
-
3
- export const WORKFLOW_TRIGGER_STRATEGY = 'WORKFLOW_TRIGGER_STRATEGY';
4
-
5
- export const WorkflowTriggerStrategy = (provider: string) =>
6
- SetMetadata(WORKFLOW_TRIGGER_STRATEGY, provider);
@@ -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
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../dist/out-tsc",
5
- "declaration": true,
6
- "types": ["node"]
7
- },
8
- "include": ["src/**/*.ts"],
9
- "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
10
- }
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../dist/out-tsc",
5
- "module": "commonjs",
6
- "types": ["jest", "node"]
7
- },
8
- "include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
9
- }