@xpert-ai/plugin-sdk 3.8.4 → 3.9.0-beta.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.cjs.js +459 -320
- package/index.esm.js +442 -293
- package/package.json +4 -3
- package/src/index.d.ts +1 -0
- package/src/lib/agent/handoff/handoff-processor.decorator.d.ts +1 -1
- package/src/lib/agent/index.d.ts +1 -0
- package/src/lib/agent/middleware/strategy.decorator.d.ts +1 -1
- package/src/lib/agent/skill/skill-source-provider.decorator.d.ts +1 -1
- package/src/lib/agent/skill/skill-source-provider.interface.d.ts +1 -1
- package/src/lib/channel/strategy.interface.d.ts +0 -2
- package/src/lib/core/context/request-context.d.ts +7 -4
- package/src/lib/core/context/request-context.middleware.d.ts +0 -1
- package/src/lib/core/file-system.d.ts +1 -3
- package/src/lib/core/permissions/analytics.d.ts +2 -3
- package/src/lib/data/datasource/strategy.decorator.d.ts +1 -1
- package/src/lib/data/datasource/types.d.ts +0 -3
- package/src/lib/file/file-storage/provider.decorator.d.ts +1 -1
- package/src/lib/file/file-storage/provider.interface.d.ts +0 -2
- package/src/lib/file/file-upload/strategy.decorator.d.ts +1 -1
- package/src/lib/file/file-upload/strategy.interface.d.ts +0 -2
- package/src/lib/integration/strategy.decorator.d.ts +1 -1
- package/src/lib/rag/image/strategy.decorator.d.ts +1 -1
- package/src/lib/rag/knowledge/knowledge-strategy.decorator.d.ts +1 -1
- package/src/lib/rag/retriever/strategy.decorator.d.ts +1 -1
- package/src/lib/rag/source/strategy.decorator.d.ts +1 -1
- package/src/lib/rag/textsplitter/strategy.decorator.d.ts +1 -1
- package/src/lib/rag/transformer/strategy.decorator.d.ts +1 -1
- package/src/lib/sandbox/protocol.d.ts +4 -8
- package/src/lib/sandbox/sandbox.decorator.d.ts +1 -1
- package/src/lib/strategy.d.ts +3 -3
- package/src/lib/toolset/strategy.decorator.d.ts +1 -1
- package/src/lib/vectorstore/strategy.decorator.d.ts +1 -1
- package/src/lib/view-extension/index.d.ts +3 -0
- package/src/lib/view-extension/provider.decorator.d.ts +2 -0
- package/src/lib/view-extension/provider.interface.d.ts +7 -0
- package/src/lib/view-extension/provider.registry.d.ts +10 -0
- package/src/lib/workflow/node/strategy.decorator.d.ts +1 -1
- package/src/lib/workflow/trigger/strategy.decorator.d.ts +1 -1
- package/index.esm.d.ts +0 -1
- /package/{index.cjs.d.ts → index.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xpert-ai/plugin-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0-beta.0",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,5 +37,6 @@
|
|
|
37
37
|
"stream": "*",
|
|
38
38
|
"yaml": "*",
|
|
39
39
|
"zod": "*"
|
|
40
|
-
}
|
|
41
|
-
|
|
40
|
+
},
|
|
41
|
+
"types": "./index.d.ts"
|
|
42
|
+
}
|
package/src/index.d.ts
CHANGED
|
@@ -8,4 +8,4 @@ export declare const HANDOFF_PROCESSOR_STRATEGY = "HANDOFF_PROCESSOR_STRATEGY";
|
|
|
8
8
|
* 1) Which message types it handles
|
|
9
9
|
* 2) Default execution policy (lane/timeout)
|
|
10
10
|
*/
|
|
11
|
-
export declare function HandoffProcessorStrategy(provider: string, metadata: HandoffProcessorMetadata): <TFunction extends Function, Y>(target:
|
|
11
|
+
export declare function HandoffProcessorStrategy(provider: string, metadata: HandoffProcessorMetadata): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
package/src/lib/agent/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const AGENT_MIDDLEWARE_STRATEGY = "AGENT_MIDDLEWARE_STRATEGY";
|
|
2
|
-
export declare const AgentMiddlewareStrategy: (provider: string) => <TFunction extends Function, Y>(target:
|
|
2
|
+
export declare const AgentMiddlewareStrategy: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const SKILL_SOURCE_PROVIDER = "SKILL_SOURCE_PROVIDER";
|
|
2
|
-
export declare const SkillSourceProviderStrategy: (provider: string) => <TFunction extends Function, Y>(target:
|
|
2
|
+
export declare const SkillSourceProviderStrategy: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISkillRepository, ISkillRepositoryIndex, TSkillSourceMeta } from
|
|
1
|
+
import { ISkillRepository, ISkillRepositoryIndex, TSkillSourceMeta } from '@metad/contracts';
|
|
2
2
|
export interface ISkillSourceProvider {
|
|
3
3
|
type: string;
|
|
4
4
|
meta: TSkillSourceMeta;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import { IUser, LanguagesEnum, PermissionsEnum, RolesEnum } from '@metad/contracts';
|
|
1
|
+
import { IApiKey, IRequestScopeContext, IUser, LanguagesEnum, PermissionsEnum, RolesEnum } from '@metad/contracts';
|
|
4
2
|
import type { IncomingMessage, ServerResponse } from 'http';
|
|
5
3
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
6
4
|
export declare class RequestContext {
|
|
@@ -12,6 +10,7 @@ export declare class RequestContext {
|
|
|
12
10
|
constructor(request: IncomingMessage, response: ServerResponse, reqId: string, userId?: string, extras?: Record<string, any>);
|
|
13
11
|
static currentRequestContext(): RequestContext;
|
|
14
12
|
static currentRequest(): IncomingMessage;
|
|
13
|
+
static currentApiKey(): IApiKey | null;
|
|
15
14
|
static currentTenantId(): string;
|
|
16
15
|
static currentUserId(): string;
|
|
17
16
|
static currentRoleId(): string;
|
|
@@ -22,7 +21,11 @@ export declare class RequestContext {
|
|
|
22
21
|
* @returns The language code (LanguagesEnum) extracted from the headers, or the default language (ENGLISH) if not found.
|
|
23
22
|
*/
|
|
24
23
|
static getLanguageCode(): LanguagesEnum;
|
|
25
|
-
static
|
|
24
|
+
static getScope(): IRequestScopeContext;
|
|
25
|
+
static getOrganizationId(): string | null;
|
|
26
|
+
static isTenantScope(): boolean;
|
|
27
|
+
static isOrganizationScope(): boolean;
|
|
28
|
+
static requireOrganizationScope(): string;
|
|
26
29
|
static hasPermissions(findPermissions: Array<PermissionsEnum | string>, throwError?: boolean): boolean;
|
|
27
30
|
static hasAnyPermission(findPermissions: PermissionsEnum[], throwError?: boolean): boolean;
|
|
28
31
|
static currentToken(throwError?: boolean): any;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import { FileSystemPermission } from './permissions';
|
|
4
2
|
/**
|
|
5
3
|
* Restricted FileSystem based on granted permissions
|
|
@@ -35,7 +33,7 @@ export declare class XpFileSystem {
|
|
|
35
33
|
/**
|
|
36
34
|
* Read file contents
|
|
37
35
|
*/
|
|
38
|
-
readFile(filePath: string, encoding?: BufferEncoding): Promise<
|
|
36
|
+
readFile(filePath: string, encoding?: BufferEncoding): Promise<NonSharedBuffer>;
|
|
39
37
|
/**
|
|
40
38
|
* Write file contents
|
|
41
39
|
*/
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { DSCoreService } from '@metad/ocap-core';
|
|
2
1
|
import type { BasePermission } from './general';
|
|
3
2
|
export type AnalyticsPermissionOperation = 'dscore' | 'query' | 'model' | 'indicator' | 'create_indicator';
|
|
4
3
|
/**
|
|
@@ -37,9 +36,9 @@ export interface AnalyticsIndicatorValidationInput {
|
|
|
37
36
|
/**
|
|
38
37
|
* Analytics service exposed to plugins under permission control.
|
|
39
38
|
*/
|
|
40
|
-
export interface AnalyticsPermissionService {
|
|
39
|
+
export interface AnalyticsPermissionService<TDSCoreService = unknown> {
|
|
41
40
|
resolveChatBIModels(modelIds: string[]): Promise<AnalyticsResolvedChatBIModel[]>;
|
|
42
|
-
getDSCoreService(input?: AnalyticsDSCoreInput): Promise<
|
|
41
|
+
getDSCoreService(input?: AnalyticsDSCoreInput): Promise<TDSCoreService>;
|
|
43
42
|
visitChatBIModel(modelId: string, cubeName: string): Promise<void>;
|
|
44
43
|
ensureCreateIndicatorAccess(): Promise<void>;
|
|
45
44
|
validateIndicatorStatement(input: AnalyticsIndicatorValidationInput): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const DATASOURCE_STRATEGY = "DATASOURCE_STRATEGY";
|
|
2
|
-
export declare const DataSourceStrategy: (provider: string) => <TFunction extends Function, Y>(target:
|
|
2
|
+
export declare const DataSourceStrategy: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const FILE_STORAGE_PROVIDER = "FILE_STORAGE_PROVIDER";
|
|
2
|
-
export declare const FileStorageProvider: (provider: string) => <TFunction extends Function, Y>(target:
|
|
2
|
+
export declare const FileStorageProvider: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const FILE_UPLOAD_TARGET_STRATEGY = "FILE_UPLOAD_TARGET_STRATEGY";
|
|
2
|
-
export declare const FileUploadTargetStrategy: (type: string) => <TFunction extends Function, Y>(target:
|
|
2
|
+
export declare const FileUploadTargetStrategy: (type: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const INTEGRATION_STRATEGY = "INTEGRATION_STRATEGY";
|
|
2
|
-
export declare const IntegrationStrategyKey: (provider: string) => <TFunction extends Function, Y>(target:
|
|
2
|
+
export declare const IntegrationStrategyKey: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -2,4 +2,4 @@ export declare const IMAGE_UNDERSTANDING_STRATEGY = "IMAGE_UNDERSTANDING_STRATEG
|
|
|
2
2
|
/**
|
|
3
3
|
* Decorator to mark a provider as an Image Understanding Strategy
|
|
4
4
|
*/
|
|
5
|
-
export declare const ImageUnderstandingStrategy: (provider: string) => <TFunction extends Function, Y>(target:
|
|
5
|
+
export declare const ImageUnderstandingStrategy: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const KNOWLEDGE_STRATEGY = "KNOWLEDGE_STRATEGY";
|
|
2
|
-
export declare const KnowledgeStrategyKey: (provider: string) => <TFunction extends Function, Y>(target:
|
|
2
|
+
export declare const KnowledgeStrategyKey: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -2,4 +2,4 @@ export declare const RETRIEVER_STRATEGY = "RETRIEVER_STRATEGY";
|
|
|
2
2
|
/**
|
|
3
3
|
* Decorator to mark a provider as a Retriever Strategy
|
|
4
4
|
*/
|
|
5
|
-
export declare const RetrieverStrategy: (provider: string) => <TFunction extends Function, Y>(target:
|
|
5
|
+
export declare const RetrieverStrategy: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -2,4 +2,4 @@ export declare const DOCUMENT_SOURCE_STRATEGY = "DOCUMENT_SOURCE_STRATEGY";
|
|
|
2
2
|
/**
|
|
3
3
|
* Decorator to mark a provider as a Document Source Strategy
|
|
4
4
|
*/
|
|
5
|
-
export declare const DocumentSourceStrategy: (provider: string) => <TFunction extends Function, Y>(target:
|
|
5
|
+
export declare const DocumentSourceStrategy: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const TEXT_SPLITTER_STRATEGY = "TEXT_SPLITTER_STRATEGY";
|
|
2
|
-
export declare const TextSplitterStrategy: (provider: string) => <TFunction extends Function, Y>(target:
|
|
2
|
+
export declare const TextSplitterStrategy: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -2,4 +2,4 @@ export declare const DOCUMENT_TRANSFORMER_STRATEGY = "DOCUMENT_TRANSFORMER_STRAT
|
|
|
2
2
|
/**
|
|
3
3
|
* Decorator to mark a provider as a Document Transformer Strategy
|
|
4
4
|
*/
|
|
5
|
-
export declare const DocumentTransformerStrategy: (provider: string) => <TFunction extends Function, Y>(target:
|
|
5
|
+
export declare const DocumentTransformerStrategy: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IBackendProtocol, TSandboxConfigurable } from '@metad/contracts';
|
|
1
2
|
import type { SandboxExecutionOptions } from './execution';
|
|
2
3
|
/**
|
|
3
4
|
* Protocol definition for pluggable memory backends.
|
|
@@ -190,7 +191,7 @@ export interface FileUploadResponse {
|
|
|
190
191
|
* Methods can return either direct values or Promises, allowing both
|
|
191
192
|
* synchronous and asynchronous implementations.
|
|
192
193
|
*/
|
|
193
|
-
export interface BackendProtocol {
|
|
194
|
+
export interface BackendProtocol extends IBackendProtocol {
|
|
194
195
|
/**
|
|
195
196
|
* Structured listing with file metadata.
|
|
196
197
|
*
|
|
@@ -346,13 +347,8 @@ export interface SandboxBackendProtocol extends BackendProtocol {
|
|
|
346
347
|
/** Canonical sandbox environment identifier bound to this backend */
|
|
347
348
|
readonly environmentId?: string | null;
|
|
348
349
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
*
|
|
352
|
-
* @param backend - Backend instance to check
|
|
353
|
-
* @returns True if the backend implements SandboxBackendProtocol
|
|
354
|
-
*/
|
|
355
|
-
export declare function isSandboxBackend(backend: BackendProtocol): backend is SandboxBackendProtocol;
|
|
350
|
+
export declare function isSandboxBackend(backend: unknown): backend is SandboxBackendProtocol;
|
|
351
|
+
export declare function resolveSandboxBackend(sandbox: TSandboxConfigurable | SandboxBackendProtocol | null | undefined | unknown): SandboxBackendProtocol | null;
|
|
356
352
|
/**
|
|
357
353
|
* State and store container for backend initialization.
|
|
358
354
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const SANDBOX_PROVIDER = "SANDBOX_PROVIDER";
|
|
2
|
-
export declare const SandboxProviderStrategy: (provider: string) => <TFunction extends Function, Y>(target:
|
|
2
|
+
export declare const SandboxProviderStrategy: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
package/src/lib/strategy.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OnModuleInit } from
|
|
2
|
-
import { DiscoveryService, Reflector } from
|
|
3
|
-
import { StrategyBus } from
|
|
1
|
+
import { OnModuleInit } from '@nestjs/common';
|
|
2
|
+
import { DiscoveryService, Reflector } from '@nestjs/core';
|
|
3
|
+
import { StrategyBus } from './core/strategy-bus';
|
|
4
4
|
export declare class BaseStrategyRegistry<S> implements OnModuleInit {
|
|
5
5
|
protected readonly strategyKey: string;
|
|
6
6
|
protected discoveryService: DiscoveryService;
|
|
@@ -2,4 +2,4 @@ export declare const TOOLSET_STRATEGY = "TOOLSET_STRATEGY";
|
|
|
2
2
|
/**
|
|
3
3
|
* Decorator to mark a provider as a Toolset Strategy
|
|
4
4
|
*/
|
|
5
|
-
export declare const ToolsetStrategy: (provider: string) => <TFunction extends Function, Y>(target:
|
|
5
|
+
export declare const ToolsetStrategy: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const VECTOR_STORE_STRATEGY = "VECTOR_STORE_STRATEGY";
|
|
2
|
-
export declare const VectorStoreStrategy: (provider: string) => <TFunction extends Function, Y>(target:
|
|
2
|
+
export declare const VectorStoreStrategy: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const VIEW_EXTENSION_PROVIDER = "VIEW_EXTENSION_PROVIDER";
|
|
2
|
+
export declare const ViewExtensionProvider: (providerKey: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { XpertExtensionViewManifest, XpertResolvedViewHostContext, XpertViewActionRequest, XpertViewActionResult, XpertViewDataResult, XpertViewQuery } from '@metad/contracts';
|
|
2
|
+
export interface IXpertViewExtensionProvider {
|
|
3
|
+
supports(context: XpertResolvedViewHostContext): Promise<boolean> | boolean;
|
|
4
|
+
getViewManifests(context: XpertResolvedViewHostContext, slot: string): Promise<XpertExtensionViewManifest[]> | XpertExtensionViewManifest[];
|
|
5
|
+
getViewData(context: XpertResolvedViewHostContext, viewKey: string, query: XpertViewQuery): Promise<XpertViewDataResult> | XpertViewDataResult;
|
|
6
|
+
executeViewAction?(context: XpertResolvedViewHostContext, viewKey: string, actionKey: string, request: XpertViewActionRequest): Promise<XpertViewActionResult> | XpertViewActionResult;
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DiscoveryService, Reflector } from '@nestjs/core';
|
|
2
|
+
import { BaseStrategyRegistry } from '../strategy';
|
|
3
|
+
import { IXpertViewExtensionProvider } from './provider.interface';
|
|
4
|
+
export declare class ViewExtensionProviderRegistry extends BaseStrategyRegistry<IXpertViewExtensionProvider> {
|
|
5
|
+
constructor(discoveryService: DiscoveryService, reflector: Reflector);
|
|
6
|
+
listEntries(organizationId?: string): Array<{
|
|
7
|
+
providerKey: string;
|
|
8
|
+
provider: IXpertViewExtensionProvider;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
@@ -2,4 +2,4 @@ export declare const WORKFLOW_NODE_STRATEGY = "WORKFLOW_NODE_STRATEGY";
|
|
|
2
2
|
/**
|
|
3
3
|
* Decorator to mark a provider as a Workflow Node Strategy
|
|
4
4
|
*/
|
|
5
|
-
export declare const WorkflowNodeStrategy: (provider: string) => <TFunction extends Function, Y>(target:
|
|
5
|
+
export declare const WorkflowNodeStrategy: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const WORKFLOW_TRIGGER_STRATEGY = "WORKFLOW_TRIGGER_STRATEGY";
|
|
2
|
-
export declare const WorkflowTriggerStrategy: (provider: string) => <TFunction extends Function, Y>(target:
|
|
2
|
+
export declare const WorkflowTriggerStrategy: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
package/index.esm.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./src/index";
|
|
File without changes
|