@xpert-ai/plugin-sdk 3.15.17 → 3.15.18

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @xpert-ai/plugin-sdk
2
2
 
3
+ ## 3.15.18
4
+
5
+ ### Patch Changes
6
+
7
+ - 2f6bf18: Support localized plugin display names and descriptions across plugin metadata, the platform registry, and marketplace dialogs.
8
+ - Updated dependencies [2f6bf18]
9
+ - @xpert-ai/contracts@3.15.18
10
+
3
11
  ## 3.15.17
4
12
 
5
13
  ### Patch Changes
package/index.cjs.js CHANGED
@@ -554,9 +554,9 @@ class BaseStrategyRegistry {
554
554
  }
555
555
  const type = this.reflector.get(this.strategyKey, target);
556
556
  if (type) {
557
- const pluginName = this.reflector.get(PLUGIN_METADATA_KEY, target);
558
- var _this_reflector_get;
559
- const organizationId = (_this_reflector_get = this.reflector.get(ORGANIZATION_METADATA_KEY, target)) != null ? _this_reflector_get : pluginName ? GLOBAL_ORGANIZATION_SCOPE : BUILTIN_GLOBAL_SCOPE;
557
+ const source = this.getSource(instance);
558
+ const pluginName = source.kind === 'plugin' ? source.pluginName : undefined;
559
+ const organizationId = source.scopeKey;
560
560
  var _this_strategies_get;
561
561
  const orgMap = (_this_strategies_get = this.strategies.get(organizationId)) != null ? _this_strategies_get : new Map();
562
562
  orgMap.set(type, instance);
@@ -570,6 +570,29 @@ class BaseStrategyRegistry {
570
570
  }
571
571
  }
572
572
  }
573
+ /** Returns the explicit registry provenance attached by the plugin loader. */ getSource(instance) {
574
+ const target = resolveStrategyMetadataTarget(instance);
575
+ if (!target) {
576
+ return {
577
+ kind: 'builtin',
578
+ scopeKey: BUILTIN_GLOBAL_SCOPE
579
+ };
580
+ }
581
+ const pluginName = this.reflector.get(PLUGIN_METADATA_KEY, target);
582
+ if (!pluginName) {
583
+ var _this_reflector_get;
584
+ return {
585
+ kind: 'builtin',
586
+ scopeKey: (_this_reflector_get = this.reflector.get(ORGANIZATION_METADATA_KEY, target)) != null ? _this_reflector_get : BUILTIN_GLOBAL_SCOPE
587
+ };
588
+ }
589
+ var _this_reflector_get1;
590
+ return {
591
+ kind: 'plugin',
592
+ pluginName,
593
+ scopeKey: (_this_reflector_get1 = this.reflector.get(ORGANIZATION_METADATA_KEY, target)) != null ? _this_reflector_get1 : GLOBAL_ORGANIZATION_SCOPE
594
+ };
595
+ }
573
596
  /**
574
597
  * Remove all strategies registered by the given plugin for the given scope.
575
598
  */ remove(organizationId, pluginName) {
package/index.esm.js CHANGED
@@ -536,9 +536,9 @@ class BaseStrategyRegistry {
536
536
  }
537
537
  const type = this.reflector.get(this.strategyKey, target);
538
538
  if (type) {
539
- const pluginName = this.reflector.get(PLUGIN_METADATA_KEY, target);
540
- var _this_reflector_get;
541
- const organizationId = (_this_reflector_get = this.reflector.get(ORGANIZATION_METADATA_KEY, target)) != null ? _this_reflector_get : pluginName ? GLOBAL_ORGANIZATION_SCOPE : BUILTIN_GLOBAL_SCOPE;
539
+ const source = this.getSource(instance);
540
+ const pluginName = source.kind === 'plugin' ? source.pluginName : undefined;
541
+ const organizationId = source.scopeKey;
542
542
  var _this_strategies_get;
543
543
  const orgMap = (_this_strategies_get = this.strategies.get(organizationId)) != null ? _this_strategies_get : new Map();
544
544
  orgMap.set(type, instance);
@@ -552,6 +552,29 @@ class BaseStrategyRegistry {
552
552
  }
553
553
  }
554
554
  }
555
+ /** Returns the explicit registry provenance attached by the plugin loader. */ getSource(instance) {
556
+ const target = resolveStrategyMetadataTarget(instance);
557
+ if (!target) {
558
+ return {
559
+ kind: 'builtin',
560
+ scopeKey: BUILTIN_GLOBAL_SCOPE
561
+ };
562
+ }
563
+ const pluginName = this.reflector.get(PLUGIN_METADATA_KEY, target);
564
+ if (!pluginName) {
565
+ var _this_reflector_get;
566
+ return {
567
+ kind: 'builtin',
568
+ scopeKey: (_this_reflector_get = this.reflector.get(ORGANIZATION_METADATA_KEY, target)) != null ? _this_reflector_get : BUILTIN_GLOBAL_SCOPE
569
+ };
570
+ }
571
+ var _this_reflector_get1;
572
+ return {
573
+ kind: 'plugin',
574
+ pluginName,
575
+ scopeKey: (_this_reflector_get1 = this.reflector.get(ORGANIZATION_METADATA_KEY, target)) != null ? _this_reflector_get1 : GLOBAL_ORGANIZATION_SCOPE
576
+ };
577
+ }
555
578
  /**
556
579
  * Remove all strategies registered by the given plugin for the given scope.
557
580
  */ remove(organizationId, pluginName) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpert-ai/plugin-sdk",
3
- "version": "3.15.17",
3
+ "version": "3.15.18",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@langchain/openai": "0.6.9",
20
- "@xpert-ai/contracts": "3.15.17",
20
+ "@xpert-ai/contracts": "3.15.18",
21
21
  "express": "^4.22.1",
22
22
  "js-tiktoken": "^1.0.21"
23
23
  },
@@ -39,8 +39,12 @@ export type AgentMiddlewareAssistantTaskStatusInput = {
39
39
  clientMessageId?: string;
40
40
  xpertId?: string;
41
41
  };
42
+ export type AgentMiddlewareAssistantTaskCancelResult = {
43
+ canceledExecutionIds: string[];
44
+ };
42
45
  export interface AgentMiddlewareAssistantTaskApi {
43
46
  startTask(input: AgentMiddlewareAssistantTaskInput): Promise<AgentMiddlewareAssistantTaskResult>;
44
47
  getTaskStatus?(input: AgentMiddlewareAssistantTaskStatusInput): Promise<AgentMiddlewareAssistantTaskResult | null>;
48
+ cancelTask?(input: AgentMiddlewareAssistantTaskStatusInput): Promise<AgentMiddlewareAssistantTaskCancelResult>;
45
49
  }
46
50
  export declare const AssistantTaskRuntimeCapability: import("../../../core/runtime-capability").RuntimeCapabilityKey<AgentMiddlewareAssistantTaskApi>;
@@ -1,6 +1,14 @@
1
1
  import { OnModuleInit, type Type } from '@nestjs/common';
2
2
  import { DiscoveryService, Reflector } from '@nestjs/core';
3
3
  import { StrategyBus } from './core/strategy-bus';
4
+ export type StrategySource = {
5
+ kind: 'builtin';
6
+ scopeKey: string;
7
+ } | {
8
+ kind: 'plugin';
9
+ pluginName: string;
10
+ scopeKey: string;
11
+ };
4
12
  export declare class BaseStrategyRegistry<S> implements OnModuleInit {
5
13
  protected readonly strategyKey: string;
6
14
  protected discoveryService: DiscoveryService;
@@ -12,6 +20,8 @@ export declare class BaseStrategyRegistry<S> implements OnModuleInit {
12
20
  constructor(strategyKey: string, discoveryService: DiscoveryService, reflector: Reflector);
13
21
  onModuleInit(): void;
14
22
  upsert(instance: unknown): void;
23
+ /** Returns the explicit registry provenance attached by the plugin loader. */
24
+ getSource(instance: S): StrategySource;
15
25
  /**
16
26
  * Remove all strategies registered by the given plugin for the given scope.
17
27
  */