@smythos/sre 1.7.18 → 1.7.40

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 (69) hide show
  1. package/dist/index.js +120 -82
  2. package/dist/index.js.map +1 -1
  3. package/dist/types/Components/DataSourceIndexer.class.d.ts +4 -12
  4. package/dist/types/Components/GenAILLM.class.d.ts +5 -5
  5. package/dist/types/Components/RAG/DataSourceCleaner.class.d.ts +37 -0
  6. package/dist/types/Components/RAG/DataSourceComponent.class.d.ts +30 -0
  7. package/dist/types/Components/RAG/DataSourceIndexer.class.d.ts +14 -0
  8. package/dist/types/Components/RAG/DataSourceLookup.class.d.ts +36 -0
  9. package/dist/types/Components/index.d.ts +3 -3
  10. package/dist/types/helpers/Conversation.helper.d.ts +3 -0
  11. package/dist/types/index.d.ts +3 -3
  12. package/dist/types/subsystems/IO/VectorDB.service/connectors/MilvusVectorDB.class.d.ts +1 -0
  13. package/dist/types/subsystems/IO/VectorDB.service/connectors/PineconeVectorDB.class.d.ts +11 -4
  14. package/dist/types/subsystems/IO/VectorDB.service/embed/index.d.ts +5 -0
  15. package/dist/types/subsystems/LLMManager/LLM.inference.d.ts +10 -3
  16. package/dist/types/subsystems/LLMManager/LLM.service/connectors/GoogleAI.class.d.ts +4 -2
  17. package/dist/types/subsystems/LLMManager/ModelsProvider.service/connectors/JSONModelsProvider.class.d.ts +35 -0
  18. package/dist/types/subsystems/Security/Account.service/AccountConnector.d.ts +2 -2
  19. package/dist/types/subsystems/Security/ManagedVault.service/connectors/SecretManagerManagedVault.d.ts +10 -0
  20. package/dist/types/subsystems/Security/Vault.service/connectors/SecretsManager.class.d.ts +6 -2
  21. package/dist/types/types/LLM.types.d.ts +2 -0
  22. package/dist/types/types/VectorDB.types.d.ts +4 -0
  23. package/dist/types/utils/array.utils.d.ts +4 -0
  24. package/dist/types/utils/string.utils.d.ts +1 -0
  25. package/package.json +3 -3
  26. package/src/Components/APIEndpoint.class.ts +1 -6
  27. package/src/Components/Component.class.ts +14 -1
  28. package/src/Components/DataSourceIndexer.class.ts +148 -34
  29. package/src/Components/GenAILLM.class.ts +21 -11
  30. package/src/Components/RAG/DataSourceCleaner.class.ts +178 -0
  31. package/src/Components/RAG/DataSourceComponent.class.ts +111 -0
  32. package/src/Components/RAG/DataSourceIndexer.class.ts +254 -0
  33. package/src/Components/{DataSourceLookup.class.ts → RAG/DataSourceLookup.class.ts} +92 -3
  34. package/src/Components/ServerlessCode.class.ts +1 -4
  35. package/src/Components/index.ts +3 -3
  36. package/src/helpers/AWSLambdaCode.helper.ts +40 -45
  37. package/src/helpers/Conversation.helper.ts +14 -10
  38. package/src/helpers/S3Cache.helper.ts +2 -1
  39. package/src/index.ts +212 -212
  40. package/src/index.ts.bak +212 -212
  41. package/src/subsystems/IO/NKV.service/connectors/NKVRedis.class.ts +3 -1
  42. package/src/subsystems/IO/VectorDB.service/connectors/MilvusVectorDB.class.ts +145 -19
  43. package/src/subsystems/IO/VectorDB.service/connectors/PineconeVectorDB.class.ts +56 -22
  44. package/src/subsystems/IO/VectorDB.service/embed/GoogleEmbedding.ts +1 -0
  45. package/src/subsystems/IO/VectorDB.service/embed/OpenAIEmbedding.ts +2 -1
  46. package/src/subsystems/IO/VectorDB.service/embed/index.ts +18 -0
  47. package/src/subsystems/LLMManager/LLM.inference.ts +63 -47
  48. package/src/subsystems/LLMManager/LLM.service/connectors/Anthropic.class.ts +35 -10
  49. package/src/subsystems/LLMManager/LLM.service/connectors/Bedrock.class.ts +12 -4
  50. package/src/subsystems/LLMManager/LLM.service/connectors/Echo.class.ts +4 -4
  51. package/src/subsystems/LLMManager/LLM.service/connectors/GoogleAI.class.ts +105 -23
  52. package/src/subsystems/LLMManager/LLM.service/connectors/Groq.class.ts +17 -5
  53. package/src/subsystems/LLMManager/LLM.service/connectors/Ollama.class.ts +18 -3
  54. package/src/subsystems/LLMManager/LLM.service/connectors/Perplexity.class.ts +14 -5
  55. package/src/subsystems/LLMManager/LLM.service/connectors/VertexAI.class.ts +6 -4
  56. package/src/subsystems/LLMManager/LLM.service/connectors/openai/apiInterfaces/ChatCompletionsApiInterface.ts +5 -5
  57. package/src/subsystems/LLMManager/LLM.service/connectors/openai/apiInterfaces/ResponsesApiInterface.ts +8 -3
  58. package/src/subsystems/LLMManager/LLM.service/connectors/xAI.class.ts +9 -8
  59. package/src/subsystems/LLMManager/ModelsProvider.service/connectors/JSONModelsProvider.class.ts +126 -28
  60. package/src/subsystems/ObservabilityManager/Telemetry.service/connectors/OTel/OTel.class.ts +38 -6
  61. package/src/subsystems/Security/Account.service/AccountConnector.ts +3 -3
  62. package/src/subsystems/Security/ManagedVault.service/connectors/SecretManagerManagedVault.ts +111 -48
  63. package/src/subsystems/Security/Vault.service/connectors/SecretsManager.class.ts +41 -66
  64. package/src/types/LLM.types.ts +5 -0
  65. package/src/types/VectorDB.types.ts +4 -0
  66. package/src/utils/array.utils.ts +11 -0
  67. package/src/utils/base64.utils.ts +1 -1
  68. package/src/utils/string.utils.ts +3 -192
  69. package/src/Components/DataSourceCleaner.class.ts +0 -92
@@ -6,18 +6,10 @@ export declare class DataSourceIndexer extends Component {
6
6
  protected configSchema: Joi.ObjectSchema<any>;
7
7
  constructor();
8
8
  init(): void;
9
- process(input: any, config: any, agent: Agent): Promise<{
10
- _debug: string;
11
- Success: {
12
- result: any;
13
- id: any;
14
- };
15
- _error?: undefined;
16
- } | {
17
- _debug: string;
18
- _error: any;
19
- Success?: undefined;
20
- }>;
9
+ process(input: any, config: any, agent: Agent): Promise<any>;
10
+ private processV1;
11
+ private processV2;
12
+ private transformEmbedding;
21
13
  validateInput(input: any): Joi.ValidationResult<any>;
22
14
  private addDSFromText;
23
15
  static genDsId(providedId: string, teamId: string, namespaceId: string): string;
@@ -262,19 +262,19 @@ export declare class GenAILLM extends Component {
262
262
  process(input: any, config: any, agent: Agent): Promise<{
263
263
  Reply: any;
264
264
  } | {
265
- Reply: any;
265
+ Output: any;
266
266
  _error: string;
267
267
  _debug: string;
268
- Output?: undefined;
268
+ Reply?: undefined;
269
269
  } | {
270
- Output: any;
270
+ Reply: any;
271
271
  _error: string;
272
272
  _debug: string;
273
- Reply?: undefined;
273
+ Output?: undefined;
274
274
  } | {
275
275
  _error: any;
276
276
  _debug: string;
277
- Reply?: undefined;
278
277
  Output?: undefined;
278
+ Reply?: undefined;
279
279
  }>;
280
280
  }
@@ -0,0 +1,37 @@
1
+ import { IAgent as Agent } from '@sre/types/Agent.types';
2
+ import Joi from 'joi';
3
+ import { DataSourceComponent } from './DataSourceComponent.class';
4
+ export declare class DataSourceCleaner extends DataSourceComponent {
5
+ protected configSchema: Joi.ObjectSchema<any>;
6
+ constructor();
7
+ init(): void;
8
+ process(input: any, config: any, agent: Agent): Promise<{
9
+ _debug: string;
10
+ Success: boolean;
11
+ _error?: undefined;
12
+ } | {
13
+ _debug: string;
14
+ _error: any;
15
+ Success?: undefined;
16
+ }>;
17
+ processV1(input: any, config: any, agent: Agent): Promise<{
18
+ _debug: string;
19
+ Success: boolean;
20
+ _error?: undefined;
21
+ } | {
22
+ _debug: string;
23
+ _error: any;
24
+ Success?: undefined;
25
+ }>;
26
+ processV2(input: any, config: any, agent: Agent): Promise<{
27
+ _debug: string;
28
+ _error: any;
29
+ Success?: undefined;
30
+ } | {
31
+ _debug: string;
32
+ Success: boolean;
33
+ _error?: undefined;
34
+ }>;
35
+ validateInput(input: any): Joi.ValidationResult<any>;
36
+ validateConfigData(data: any): Joi.ValidationResult<any>;
37
+ }
@@ -0,0 +1,30 @@
1
+ import { Component } from '../Component.class';
2
+ import { TEmbeddings } from '@sre/IO/VectorDB.service/embed/BaseEmbedding';
3
+ import { VectorDBConnector } from '@sre/IO/VectorDB.service/VectorDBConnector';
4
+ export type NsRecord = {
5
+ credentialId: string;
6
+ embeddings: {
7
+ dimensions: string;
8
+ modelId: string;
9
+ };
10
+ label: string;
11
+ createdAt: string;
12
+ };
13
+ export declare enum TDataSourceCompErrorCodes {
14
+ NAMESPACE_NOT_FOUND = 1,
15
+ CREDENTIAL_NOT_FOUND = 2,
16
+ EMBEDDING_CONFIG_ERROR = 3
17
+ }
18
+ export declare class DataSourceCompError extends Error {
19
+ code: TDataSourceCompErrorCodes;
20
+ constructor(message: string, code: TDataSourceCompErrorCodes);
21
+ }
22
+ export declare class DataSourceComponent extends Component {
23
+ constructor();
24
+ resolveVectorDbConnector(namespace: string | NsRecord, teamId: string): Promise<VectorDBConnector>;
25
+ buildEmbeddingConfig(embedding: {
26
+ dimensions: string;
27
+ modelId: string;
28
+ }, teamId: string): Promise<TEmbeddings>;
29
+ static normalizeDsId(providedId: string, teamId: string, namespaceId: string): string;
30
+ }
@@ -0,0 +1,14 @@
1
+ import { IAgent as Agent } from '@sre/types/Agent.types';
2
+ import { DataSourceComponent } from './DataSourceComponent.class';
3
+ import Joi from 'joi';
4
+ export declare class DataSourceIndexer extends DataSourceComponent {
5
+ private MAX_ALLOWED_URLS_PER_INPUT;
6
+ protected configSchema: Joi.ObjectSchema<any>;
7
+ constructor();
8
+ init(): void;
9
+ process(input: any, config: any, agent: Agent): Promise<any>;
10
+ private processV1;
11
+ private processV2;
12
+ validateInput(input: any): Joi.ValidationResult<any>;
13
+ private addDSFromText;
14
+ }
@@ -0,0 +1,36 @@
1
+ import Joi from 'joi';
2
+ import { IAgent as Agent } from '@sre/types/Agent.types';
3
+ import { DataSourceComponent } from './DataSourceComponent.class';
4
+ export declare class DataSourceLookup extends DataSourceComponent {
5
+ protected configSchema: Joi.ObjectSchema<any>;
6
+ constructor();
7
+ init(): void;
8
+ process(input: any, config: any, agent: Agent): Promise<{
9
+ Results: string[] | {
10
+ content: string;
11
+ metadata: any;
12
+ score?: number;
13
+ }[];
14
+ _error: any;
15
+ _debug: string;
16
+ }>;
17
+ processV1(input: any, config: any, agent: Agent): Promise<{
18
+ Results: string[] | {
19
+ content: string;
20
+ metadata: any;
21
+ score?: number;
22
+ }[];
23
+ _error: any;
24
+ _debug: string;
25
+ }>;
26
+ processV2(input: any, config: any, agent: Agent): Promise<{
27
+ Results: string[] | {
28
+ content: string;
29
+ metadata: any;
30
+ score?: number;
31
+ }[];
32
+ _error: any;
33
+ _debug: string;
34
+ }>;
35
+ private parseMetadata;
36
+ }
@@ -8,9 +8,9 @@ import { FSleep } from './FSleep.class';
8
8
  import { FHash } from './FHash.class';
9
9
  import { FEncDec } from './FEncDec.class';
10
10
  import { FTimestamp } from './FTimestamp.class';
11
- import { DataSourceLookup } from './DataSourceLookup.class';
12
- import { DataSourceIndexer } from './DataSourceIndexer.class';
13
- import { DataSourceCleaner } from './DataSourceCleaner.class';
11
+ import { DataSourceLookup } from './RAG/DataSourceLookup.class';
12
+ import { DataSourceIndexer } from './RAG/DataSourceIndexer.class';
13
+ import { DataSourceCleaner } from './RAG/DataSourceCleaner.class';
14
14
  import { JSONFilter } from './JSONFilter.class';
15
15
  import { LogicAND } from './LogicAND.class';
16
16
  import { LogicOR } from './LogicOR.class';
@@ -1,3 +1,4 @@
1
+ import { LLMInference } from '@sre/LLMManager/LLM.inference';
1
2
  import { LLMContext } from '@sre/MemoryManager/LLMContext';
2
3
  import { ILLMContextStore, TLLMModel } from '@sre/types/LLM.types';
3
4
  import EventEmitter from 'events';
@@ -38,6 +39,8 @@ export declare class Conversation extends EventEmitter {
38
39
  set spec(specSource: any);
39
40
  set model(model: string | TLLMModel);
40
41
  get model(): string | TLLMModel;
42
+ private _llmInference;
43
+ get llmInference(): LLMInference;
41
44
  constructor(_model: string | TLLMModel, _specSource?: string | Record<string, any>, _settings?: {
42
45
  maxContextSize?: number;
43
46
  maxOutputTokens?: number;
@@ -9,9 +9,6 @@ export * from './Components/Await.class';
9
9
  export * from './Components/Classifier.class';
10
10
  export * from './Components/Component.class';
11
11
  export * from './Components/ComponentHost.class';
12
- export * from './Components/DataSourceCleaner.class';
13
- export * from './Components/DataSourceIndexer.class';
14
- export * from './Components/DataSourceLookup.class';
15
12
  export * from './Components/FEncDec.class';
16
13
  export * from './Components/FHash.class';
17
14
  export * from './Components/FileStore.class';
@@ -88,6 +85,9 @@ export * from './Components/APICall/parseHeaders';
88
85
  export * from './Components/APICall/parseProxy';
89
86
  export * from './Components/APICall/parseUrl';
90
87
  export * from './Components/Image/imageSettings.config';
88
+ export * from './Components/RAG/DataSourceCleaner.class';
89
+ export * from './Components/RAG/DataSourceComponent.class';
90
+ export * from './Components/RAG/DataSourceLookup.class';
91
91
  export * from './Components/Triggers/Gmail.trigger';
92
92
  export * from './Components/Triggers/JobScheduler.trigger';
93
93
  export * from './Components/Triggers/Trigger.class';
@@ -34,6 +34,7 @@ export declare class MilvusVectorDB extends VectorDBConnector {
34
34
  embedder: BaseEmbedding;
35
35
  private SCHEMA_DEFINITION;
36
36
  private INDEX_PARAMS;
37
+ private nkvConnector;
37
38
  constructor(_settings: MilvusConfig);
38
39
  protected createNamespace(acRequest: AccessRequest, namespace: string, metadata?: {
39
40
  [key: string]: any;
@@ -7,13 +7,20 @@ import { DatasourceDto, IStorageVectorDataSource, IVectorDataSourceDto, QueryOpt
7
7
  import { BaseEmbedding, TEmbeddings } from '../embed/BaseEmbedding';
8
8
  export type PineconeConfig = {
9
9
  /**
10
- * The Pinecone API key
10
+ * The Pinecone API key [LEGACY]
11
11
  */
12
- apiKey: string;
12
+ apiKey?: string;
13
13
  /**
14
- * The Pinecone index name
14
+ * The Pinecone index name [LEGACY]
15
15
  */
16
- indexName: string;
16
+ indexName?: string;
17
+ /**
18
+ * The Pinecone credentials [New unified format]
19
+ */
20
+ credentials?: {
21
+ apiKey: string;
22
+ indexName: string;
23
+ };
17
24
  /**
18
25
  * The embeddings model to use
19
26
  */
@@ -20,5 +20,10 @@ export declare class EmbeddingsFactory {
20
20
  static create(provider?: SupportedProviders, config?: TEmbeddings & {
21
21
  model?: SupportedModels[SupportedProviders] | TLLMModel;
22
22
  }): OpenAIEmbeds | GoogleEmbeds;
23
+ static getProviderByModel(model: SupportedModels): SupportedProviders;
24
+ static getModels(): {
25
+ provider: SupportedProviders;
26
+ model: SupportedModels[SupportedProviders];
27
+ }[];
23
28
  }
24
29
  export {};
@@ -2,6 +2,7 @@ import { AccessCandidate } from '@sre/Security/AccessControl/AccessCandidate.cla
2
2
  import { IAgent } from '@sre/types/Agent.types';
3
3
  import { TLLMModel, TLLMParams } from '@sre/types/LLM.types';
4
4
  import { LLMConnector } from './LLM.service/LLMConnector';
5
+ import { IModelsProviderRequest } from './ModelsProvider.service/ModelsProviderConnector';
5
6
  type TPromptParams = {
6
7
  query?: string;
7
8
  contextWindow?: any[];
@@ -10,9 +11,15 @@ type TPromptParams = {
10
11
  onFallback?: (data: any) => void;
11
12
  };
12
13
  export declare class LLMInference {
13
- private model;
14
- private llmConnector;
15
- private modelProviderReq;
14
+ private _model;
15
+ get model(): string | TLLMModel;
16
+ get modelId(): string;
17
+ private _llmConnector;
18
+ get llmConnector(): LLMConnector;
19
+ private _modelProviderReq;
20
+ get modelProviderReq(): IModelsProviderRequest;
21
+ private _llmProviderName;
22
+ get llmProviderName(): string;
16
23
  teamId?: string;
17
24
  static getInstance(model: string | TLLMModel, candidate: AccessCandidate): Promise<LLMInference>;
18
25
  static user(candidate: AccessCandidate): any;
@@ -28,12 +28,14 @@ export declare class GoogleAIConnector extends LLMConnector {
28
28
  output_tokens: number;
29
29
  input_tokens_audio: number;
30
30
  input_tokens_cache_read: number;
31
+ input_tokens_cache_read_audio: number;
31
32
  input_tokens_cache_write: number;
32
- reasoning_tokens: number;
33
33
  keySource: APIKeySource;
34
34
  agentId: string;
35
35
  teamId: string;
36
- tier: string;
36
+ inTier: string;
37
+ outTier: string;
38
+ crTier: string;
37
39
  };
38
40
  /**
39
41
  * Extract text and image tokens from Google AI usage metadata
@@ -35,6 +35,41 @@ export declare class JSONModelsProvider extends ModelsProviderConnector {
35
35
  private getValidModels;
36
36
  private isValidSingleModel;
37
37
  private isValidModel;
38
+ /**
39
+ * Determines whether a file path should be ignored by the directory watcher.
40
+ *
41
+ * This method implements a sophisticated filtering strategy for dot-segment paths
42
+ * (paths containing directories that start with a dot, like .git, .env, .cache).
43
+ *
44
+ * **Filtering Strategy:**
45
+ * 1. Paths WITHOUT dot segments: Never ignored
46
+ * 2. Paths WITH dot segments:
47
+ * - If SMYTH_PATH is not configured: All ignored
48
+ * - If SMYTH_PATH is configured:
49
+ * - Allow the watched directory even if SMYTH_PATH contains dot-segments
50
+ * (e.g., /home/user/.smyth/models/OpenAI/default.json is allowed)
51
+ * - Ignore dot-segments INSIDE the models directory
52
+ * (e.g., /home/user/.smyth/models/.hidden/model.json is ignored)
53
+ * - Paths outside watched directory: Ignored
54
+ *
55
+ * @param filePath - The file path to check
56
+ * @param watchedDir - The absolute path of the directory being watched (models folder)
57
+ * @param smythPath - The resolved SMYTH_PATH, or null if not configured
58
+ * @returns true if the path should be ignored, false if it should be watched
59
+ *
60
+ * @example
61
+ * ```typescript
62
+ * // Path without dot-segment (allowed)
63
+ * shouldIgnorePath('/models/OpenAI/default.json', '/models', '/home/.smyth') // => false
64
+ *
65
+ * // Dot-segment inside models directory (ignored)
66
+ * shouldIgnorePath('/models/.git/config', '/models', '/home/.smyth') // => true
67
+ *
68
+ * // Dot-segment in parent path only (allowed)
69
+ * shouldIgnorePath('/home/.smyth/models/OpenAI/default.json', '/home/.smyth/models', '/home/.smyth') // => false
70
+ * ```
71
+ */
72
+ private shouldIgnorePath;
38
73
  private initDirWatcher;
39
74
  }
40
75
  export {};
@@ -9,7 +9,7 @@ export interface ISmythAccountRequest {
9
9
  getCandidateTeam(): Promise<string | undefined>;
10
10
  getAllTeamSettings(): Promise<KeyValueObject>;
11
11
  getAllUserSettings(): Promise<KeyValueObject>;
12
- getTeamSetting(settingKey: string): Promise<string>;
12
+ getTeamSetting(settingKey: string, group?: string): Promise<string>;
13
13
  getUserSetting(settingKey: string): Promise<string>;
14
14
  getAgentSetting(settingKey: string): Promise<string>;
15
15
  getTeam(): Promise<string>;
@@ -23,7 +23,7 @@ export declare abstract class AccountConnector extends Connector {
23
23
  abstract getCandidateTeam(candidate: IAccessCandidate): Promise<string | undefined>;
24
24
  abstract getAllTeamSettings(acRequest: AccessRequest, teamId: string): Promise<KeyValueObject>;
25
25
  abstract getAllUserSettings(acRequest: AccessRequest, accountId: string): Promise<KeyValueObject>;
26
- abstract getTeamSetting(acRequest: AccessRequest, teamId: string, settingKey: string): Promise<string>;
26
+ abstract getTeamSetting(acRequest: AccessRequest, teamId: string, settingKey: string, group?: string): Promise<string>;
27
27
  abstract getUserSetting(acRequest: AccessRequest, accountId: string, settingKey: string): Promise<string>;
28
28
  abstract getAgentSetting(acRequest: AccessRequest, agentId: string, settingKey: string): Promise<string>;
29
29
  }
@@ -1,17 +1,21 @@
1
1
  import { AccessRequest } from '@sre/Security/AccessControl/AccessRequest.class';
2
2
  import { ACL } from '@sre/Security/AccessControl/ACL.class';
3
3
  import { IAccessCandidate } from '@sre/types/ACL.types';
4
+ import { GetSecretValueCommandOutput } from '@aws-sdk/client-secrets-manager';
4
5
  import { ManagedVaultConnector } from '../ManagedVaultConnector';
5
6
  import { SecretsManagerConfig } from '../../Vault.service/connectors/SecretsManager.class';
6
7
  export declare class SecretManagerManagedVault extends ManagedVaultConnector {
7
8
  protected _settings: SecretsManagerConfig & {
8
9
  vaultName: string;
10
+ prefix: string;
9
11
  };
10
12
  name: string;
11
13
  scope: string;
12
14
  private secretsManager;
15
+ private prefix;
13
16
  constructor(_settings: SecretsManagerConfig & {
14
17
  vaultName: string;
18
+ prefix: string;
15
19
  });
16
20
  protected get(acRequest: AccessRequest, secretName: string): Promise<any>;
17
21
  protected set(acRequest: AccessRequest, secretName: string, value: string): Promise<void>;
@@ -19,4 +23,10 @@ export declare class SecretManagerManagedVault extends ManagedVaultConnector {
19
23
  protected exists(acRequest: AccessRequest, secretName: string): Promise<boolean>;
20
24
  getResourceACL(resourceId: string, candidate: IAccessCandidate): Promise<ACL>;
21
25
  private getSecretByName;
26
+ getVaultKey(secretName: string, teamId: string): string;
27
+ getFormattedSecret(secret: GetSecretValueCommandOutput): {
28
+ secretId: string;
29
+ key: string;
30
+ value: string;
31
+ };
22
32
  }
@@ -6,15 +6,19 @@ export type SecretsManagerConfig = {
6
6
  region: string;
7
7
  awsAccessKeyId?: string;
8
8
  awsSecretAccessKey?: string;
9
+ prefix?: string;
9
10
  };
10
11
  export declare class SecretsManager extends VaultConnector {
11
12
  protected _settings: SecretsManagerConfig;
12
13
  name: string;
13
14
  private secretsManager;
15
+ private prefix;
14
16
  constructor(_settings: SecretsManagerConfig);
15
- protected get(acRequest: AccessRequest, secretName: string): Promise<any>;
17
+ protected get(acRequest: AccessRequest, secretName: string): Promise<string>;
16
18
  protected exists(acRequest: AccessRequest, keyId: string): Promise<boolean>;
17
19
  protected listKeys(acRequest: AccessRequest): Promise<any[]>;
18
20
  getResourceACL(resourceId: string, candidate: IAccessCandidate): Promise<ACL>;
19
- private getSecretByName;
21
+ private getVaultKey;
22
+ private getSecretById;
23
+ private extractSecretName;
20
24
  }
@@ -300,6 +300,7 @@ export type ToolData = {
300
300
  function?: any;
301
301
  error?: string;
302
302
  callId?: string;
303
+ thoughtSignature?: string;
303
304
  };
304
305
  /**
305
306
  * Base tool definition interface - only truly common properties
@@ -497,6 +498,7 @@ export interface TGoogleAIRequestBody {
497
498
  topK?: number;
498
499
  stopSequences?: string[];
499
500
  responseMimeType?: string;
501
+ media_resolution?: 'low' | 'medium' | 'high';
500
502
  };
501
503
  tools?: any;
502
504
  toolConfig?: any;
@@ -42,6 +42,10 @@ export interface IStorageVectorDataSource {
42
42
  id: string;
43
43
  candidateId: string;
44
44
  candidateRole: string;
45
+ datasourceSizeMb?: number;
46
+ createdAt?: Date;
47
+ chunkSize?: number;
48
+ chunkOverlap?: number;
45
49
  }
46
50
  export interface IStorageVectorNamespace {
47
51
  namespace: string;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Utility method to chunk arrays into smaller batches
3
+ */
4
+ export declare function chunkArr<T>(arr: T[], sizePerChunk: number): T[][];
@@ -22,3 +22,4 @@ export declare const kebabToCapitalize: (input: any) => any;
22
22
  * @param input
23
23
  */
24
24
  export declare const identifyMimetypeFromString: (input: string) => "application/json" | "text/plain" | "application/xml" | "text/html" | "text/css" | "text/csv" | "text/markdown" | "" | "image/svg+xml" | "application/javascript" | "application/yaml" | "application/sql";
25
+ export declare function calcSizeMb(text: string): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smythos/sre",
3
- "version": "1.7.18",
3
+ "version": "1.7.40",
4
4
  "description": "Smyth Runtime Environment",
5
5
  "author": "Alaa-eddine KADDOURI",
6
6
  "license": "MIT",
@@ -68,7 +68,7 @@
68
68
  "@pinecone-database/pinecone": "^3.0.0",
69
69
  "@runware/sdk-js": "^1.1.36",
70
70
  "@smithy/smithy-client": "^4.4.3",
71
- "@zilliz/milvus2-sdk-node": "^2.6.2",
71
+ "@zilliz/milvus2-sdk-node": "^2.6.4",
72
72
  "acorn": "^8.14.1",
73
73
  "axios": "^1.7.2",
74
74
  "chokidar": "^4.0.3",
@@ -117,7 +117,7 @@
117
117
  "scripts": {
118
118
  "gen:barrel": "ctix build",
119
119
  "build:types": "tsc --emitDeclarationOnly --declaration --outDir dist/types -p tsconfig.dts.json",
120
- "build:jsbundle": "cross-env rollup -c",
120
+ "build:jsbundle": "cross-env NODE_OPTIONS='--max-old-space-size=8192' rollup -c",
121
121
  "build": "pnpm run build:jsbundle && pnpm run build:types",
122
122
  "test:unit": "cd ../.. && vitest run packages/core/tests/unit",
123
123
  "test:unit:watch": "cd ../.. && vitest watch packages/core/tests/unit",
@@ -246,12 +246,7 @@ async function resolveTemplateVariables(data: any, input: any, agent: Agent): Pr
246
246
  if (isKeyTemplateVar(value as string)) {
247
247
  data[key] = await parseKey(value as string, agent.teamId);
248
248
  } else if (isTemplateVar(value as string)) {
249
- // Parse using input values first, then agent variables.
250
- // This correctly resolves cases where input values reference agent variables with the same name.
251
- // Example: agent variables { user_id: "123" }, input { user_id: "{{user_id}}" }.
252
- data[key] = TemplateString(value as string)
253
- .parse(input)
254
- .parse(agent.agentVariables).result;
249
+ data[key] = TemplateString(value as string).parse(input).result;
255
250
  }
256
251
  }
257
252
 
@@ -3,6 +3,7 @@ import { IAgent as Agent } from '@sre/types/Agent.types';
3
3
  import { Logger } from '@sre/helpers/Log.helper';
4
4
  import { performTypeInference } from '@sre/helpers/TypeChecker.helper';
5
5
  import { hookableClass, hookAsync } from '@sre/Core/HookService';
6
+ import { TemplateString } from '@sre/helpers/TemplateString.helper';
6
7
 
7
8
  export type TComponentSchema = {
8
9
  name: string;
@@ -123,7 +124,19 @@ export class Component {
123
124
  if (agent.isKilled()) {
124
125
  throw new Error('Agent killed');
125
126
  }
126
- const _input = await performTypeInference(input, config?.inputs, agent);
127
+
128
+ let _input = {};
129
+
130
+ // #region Resolve agent variables so that:
131
+ // - type inference works correctly
132
+ // - we don’t need a separate resolution step when the variable name
133
+ // matches the component input name
134
+ for (let [key, value] of Object.entries(input)) {
135
+ _input[key] = TemplateString(value as string).parse(agent.agentVariables).result;
136
+ }
137
+ // #endregion
138
+
139
+ _input = await performTypeInference(_input, config?.inputs, agent);
127
140
 
128
141
  // modify the input object for component's process method
129
142
  for (const [key, value] of Object.entries(_input)) {