@dexto/core 1.2.6 → 1.3.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.
Files changed (82) hide show
  1. package/README.md +47 -13
  2. package/dist/agent/DextoAgent.cjs +92 -34
  3. package/dist/agent/DextoAgent.d.ts +3 -3
  4. package/dist/agent/DextoAgent.d.ts.map +1 -1
  5. package/dist/agent/DextoAgent.js +93 -36
  6. package/dist/agent/schemas.cjs +1 -1
  7. package/dist/agent/schemas.js +1 -1
  8. package/dist/agent/types.d.ts +0 -1
  9. package/dist/agent/types.d.ts.map +1 -1
  10. package/dist/approval/schemas.cjs +2 -1
  11. package/dist/approval/schemas.d.ts +21 -20
  12. package/dist/approval/schemas.d.ts.map +1 -1
  13. package/dist/approval/schemas.js +2 -1
  14. package/dist/context/manager.cjs +7 -0
  15. package/dist/context/manager.d.ts.map +1 -1
  16. package/dist/context/manager.js +7 -0
  17. package/dist/context/types.d.ts +6 -2
  18. package/dist/context/types.d.ts.map +1 -1
  19. package/dist/errors/types.cjs +1 -0
  20. package/dist/errors/types.d.ts +4 -2
  21. package/dist/errors/types.d.ts.map +1 -1
  22. package/dist/errors/types.js +1 -0
  23. package/dist/events/index.cjs +4 -1
  24. package/dist/events/index.d.ts +23 -52
  25. package/dist/events/index.d.ts.map +1 -1
  26. package/dist/events/index.js +4 -1
  27. package/dist/llm/formatters/openai.cjs +8 -1
  28. package/dist/llm/formatters/openai.d.ts.map +1 -1
  29. package/dist/llm/formatters/openai.js +8 -1
  30. package/dist/llm/tokenizer/openai.d.ts +8 -0
  31. package/dist/llm/tokenizer/openai.d.ts.map +1 -1
  32. package/dist/logger/v2/schemas.cjs +1 -1
  33. package/dist/logger/v2/schemas.js +1 -1
  34. package/dist/plugins/error-codes.cjs +1 -0
  35. package/dist/plugins/error-codes.d.ts +3 -1
  36. package/dist/plugins/error-codes.d.ts.map +1 -1
  37. package/dist/plugins/error-codes.js +1 -0
  38. package/dist/plugins/loader.cjs +25 -5
  39. package/dist/plugins/loader.d.ts.map +1 -1
  40. package/dist/plugins/loader.js +25 -5
  41. package/dist/prompts/providers/custom-prompt-provider.cjs +2 -2
  42. package/dist/prompts/providers/custom-prompt-provider.d.ts +1 -1
  43. package/dist/prompts/providers/custom-prompt-provider.d.ts.map +1 -1
  44. package/dist/prompts/providers/custom-prompt-provider.js +2 -2
  45. package/dist/storage/cache/factory.cjs +6 -2
  46. package/dist/storage/cache/factory.d.ts +2 -1
  47. package/dist/storage/cache/factory.d.ts.map +1 -1
  48. package/dist/storage/cache/factory.js +6 -2
  49. package/dist/storage/database/factory.cjs +11 -17
  50. package/dist/storage/database/factory.d.ts +2 -1
  51. package/dist/storage/database/factory.d.ts.map +1 -1
  52. package/dist/storage/database/factory.js +11 -17
  53. package/dist/storage/database/sqlite-store.cjs +8 -0
  54. package/dist/storage/database/sqlite-store.d.ts.map +1 -1
  55. package/dist/storage/database/sqlite-store.js +8 -0
  56. package/dist/storage/error-codes.cjs +1 -0
  57. package/dist/storage/error-codes.d.ts +1 -0
  58. package/dist/storage/error-codes.d.ts.map +1 -1
  59. package/dist/storage/error-codes.js +1 -0
  60. package/dist/storage/errors.cjs +17 -0
  61. package/dist/storage/errors.d.ts +9 -0
  62. package/dist/storage/errors.d.ts.map +1 -1
  63. package/dist/storage/errors.js +17 -0
  64. package/dist/telemetry/error-codes.cjs +36 -0
  65. package/dist/telemetry/error-codes.d.ts +13 -0
  66. package/dist/telemetry/error-codes.d.ts.map +1 -0
  67. package/dist/telemetry/error-codes.js +13 -0
  68. package/dist/telemetry/errors.cjs +105 -0
  69. package/dist/telemetry/errors.d.ts +28 -0
  70. package/dist/telemetry/errors.d.ts.map +1 -0
  71. package/dist/telemetry/errors.js +82 -0
  72. package/dist/telemetry/telemetry.cjs +92 -26
  73. package/dist/telemetry/telemetry.d.ts +1 -1
  74. package/dist/telemetry/telemetry.d.ts.map +1 -1
  75. package/dist/telemetry/telemetry.js +74 -18
  76. package/dist/tools/schemas.cjs +1 -1
  77. package/dist/tools/schemas.js +1 -1
  78. package/dist/tools/types.d.ts +0 -11
  79. package/dist/tools/types.d.ts.map +1 -1
  80. package/dist/utils/schema.d.ts +6 -0
  81. package/dist/utils/schema.d.ts.map +1 -1
  82. package/package.json +52 -14
@@ -31,6 +31,7 @@ var PluginErrorCode = /* @__PURE__ */ ((PluginErrorCode2) => {
31
31
  PluginErrorCode2["PLUGIN_EXECUTION_TIMEOUT"] = "PLUGIN_EXECUTION_TIMEOUT";
32
32
  PluginErrorCode2["PLUGIN_BLOCKED_EXECUTION"] = "PLUGIN_BLOCKED_EXECUTION";
33
33
  PluginErrorCode2["PLUGIN_DUPLICATE_PRIORITY"] = "PLUGIN_DUPLICATE_PRIORITY";
34
+ PluginErrorCode2["PLUGIN_DEPENDENCY_NOT_INSTALLED"] = "PLUGIN_DEPENDENCY_NOT_INSTALLED";
34
35
  return PluginErrorCode2;
35
36
  })(PluginErrorCode || {});
36
37
  // Annotate the CommonJS export names for ESM import in node:
@@ -20,7 +20,9 @@ export declare enum PluginErrorCode {
20
20
  /** Plugin blocked execution */
21
21
  PLUGIN_BLOCKED_EXECUTION = "PLUGIN_BLOCKED_EXECUTION",
22
22
  /** Duplicate plugin priority */
23
- PLUGIN_DUPLICATE_PRIORITY = "PLUGIN_DUPLICATE_PRIORITY"
23
+ PLUGIN_DUPLICATE_PRIORITY = "PLUGIN_DUPLICATE_PRIORITY",
24
+ /** Required dependency not installed for plugin loading */
25
+ PLUGIN_DEPENDENCY_NOT_INSTALLED = "PLUGIN_DEPENDENCY_NOT_INSTALLED"
24
26
  }
25
27
  export type { PluginErrorCode as default };
26
28
  //# sourceMappingURL=error-codes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/plugins/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,eAAe;IACvB,gDAAgD;IAChD,kBAAkB,uBAAuB;IAEzC,mDAAmD;IACnD,oBAAoB,yBAAyB;IAE7C,wCAAwC;IACxC,2BAA2B,gCAAgC;IAE3D,mCAAmC;IACnC,4BAA4B,iCAAiC;IAE7D,sCAAsC;IACtC,4BAA4B,iCAAiC;IAE7D,8BAA8B;IAC9B,uBAAuB,4BAA4B;IAEnD,iCAAiC;IACjC,wBAAwB,6BAA6B;IAErD,+BAA+B;IAC/B,wBAAwB,6BAA6B;IAErD,gCAAgC;IAChC,yBAAyB,8BAA8B;CAC1D;AAED,YAAY,EAAE,eAAe,IAAI,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/plugins/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,eAAe;IACvB,gDAAgD;IAChD,kBAAkB,uBAAuB;IAEzC,mDAAmD;IACnD,oBAAoB,yBAAyB;IAE7C,wCAAwC;IACxC,2BAA2B,gCAAgC;IAE3D,mCAAmC;IACnC,4BAA4B,iCAAiC;IAE7D,sCAAsC;IACtC,4BAA4B,iCAAiC;IAE7D,8BAA8B;IAC9B,uBAAuB,4BAA4B;IAEnD,iCAAiC;IACjC,wBAAwB,6BAA6B;IAErD,+BAA+B;IAC/B,wBAAwB,6BAA6B;IAErD,gCAAgC;IAChC,yBAAyB,8BAA8B;IAEvD,2DAA2D;IAC3D,+BAA+B,oCAAoC;CACtE;AAED,YAAY,EAAE,eAAe,IAAI,OAAO,EAAE,CAAC"}
@@ -9,6 +9,7 @@ var PluginErrorCode = /* @__PURE__ */ ((PluginErrorCode2) => {
9
9
  PluginErrorCode2["PLUGIN_EXECUTION_TIMEOUT"] = "PLUGIN_EXECUTION_TIMEOUT";
10
10
  PluginErrorCode2["PLUGIN_BLOCKED_EXECUTION"] = "PLUGIN_BLOCKED_EXECUTION";
11
11
  PluginErrorCode2["PLUGIN_DUPLICATE_PRIORITY"] = "PLUGIN_DUPLICATE_PRIORITY";
12
+ PluginErrorCode2["PLUGIN_DEPENDENCY_NOT_INSTALLED"] = "PLUGIN_DEPENDENCY_NOT_INSTALLED";
12
13
  return PluginErrorCode2;
13
14
  })(PluginErrorCode || {});
14
15
  export {
@@ -101,10 +101,27 @@ async function loadPluginModule(modulePath, pluginName) {
101
101
  );
102
102
  }
103
103
  const tsxPackage = "tsx/esm/api";
104
- const tsx = await import(
105
- /* webpackIgnore: true */
106
- tsxPackage
107
- );
104
+ let tsx;
105
+ try {
106
+ tsx = await import(
107
+ /* webpackIgnore: true */
108
+ tsxPackage
109
+ );
110
+ } catch (importError) {
111
+ const err = importError;
112
+ if (err.code === "ERR_MODULE_NOT_FOUND") {
113
+ throw new import_errors.DextoRuntimeError(
114
+ import_error_codes.PluginErrorCode.PLUGIN_DEPENDENCY_NOT_INSTALLED,
115
+ import_errors.ErrorScope.PLUGIN,
116
+ import_errors.ErrorType.USER,
117
+ `Cannot load TypeScript plugin '${pluginName}': tsx package is not installed.
118
+ Install with: npm install tsx
119
+ Or pre-compile your plugin to .js for production use.`,
120
+ { modulePath, pluginName, packageName: "tsx" }
121
+ );
122
+ }
123
+ throw importError;
124
+ }
108
125
  const moduleUrl = (0, import_url.pathToFileURL)(modulePath).href;
109
126
  pluginModule = await tsx.tsImport(moduleUrl, import_meta.url);
110
127
  } else {
@@ -114,7 +131,10 @@ async function loadPluginModule(modulePath, pluginName) {
114
131
  moduleUrl
115
132
  );
116
133
  }
117
- const PluginClass = pluginModule.default;
134
+ let PluginClass = pluginModule.default;
135
+ if (PluginClass && typeof PluginClass === "object" && "default" in PluginClass) {
136
+ PluginClass = PluginClass.default;
137
+ }
118
138
  if (!PluginClass) {
119
139
  throw new import_errors.DextoRuntimeError(
120
140
  import_error_codes.PluginErrorCode.PLUGIN_INVALID_SHAPE,
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/plugins/loader.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAqD9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAoB/E;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAiF3F"}
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/plugins/loader.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAqD9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAoB/E;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAuG3F"}
@@ -76,10 +76,27 @@ async function loadPluginModule(modulePath, pluginName) {
76
76
  );
77
77
  }
78
78
  const tsxPackage = "tsx/esm/api";
79
- const tsx = await import(
80
- /* webpackIgnore: true */
81
- tsxPackage
82
- );
79
+ let tsx;
80
+ try {
81
+ tsx = await import(
82
+ /* webpackIgnore: true */
83
+ tsxPackage
84
+ );
85
+ } catch (importError) {
86
+ const err = importError;
87
+ if (err.code === "ERR_MODULE_NOT_FOUND") {
88
+ throw new DextoRuntimeError(
89
+ PluginErrorCode.PLUGIN_DEPENDENCY_NOT_INSTALLED,
90
+ ErrorScope.PLUGIN,
91
+ ErrorType.USER,
92
+ `Cannot load TypeScript plugin '${pluginName}': tsx package is not installed.
93
+ Install with: npm install tsx
94
+ Or pre-compile your plugin to .js for production use.`,
95
+ { modulePath, pluginName, packageName: "tsx" }
96
+ );
97
+ }
98
+ throw importError;
99
+ }
83
100
  const moduleUrl = pathToFileURL(modulePath).href;
84
101
  pluginModule = await tsx.tsImport(moduleUrl, import.meta.url);
85
102
  } else {
@@ -89,7 +106,10 @@ async function loadPluginModule(modulePath, pluginName) {
89
106
  moduleUrl
90
107
  );
91
108
  }
92
- const PluginClass = pluginModule.default;
109
+ let PluginClass = pluginModule.default;
110
+ if (PluginClass && typeof PluginClass === "object" && "default" in PluginClass) {
111
+ PluginClass = PluginClass.default;
112
+ }
93
113
  if (!PluginClass) {
94
114
  throw new DextoRuntimeError(
95
115
  PluginErrorCode.PLUGIN_INVALID_SHAPE,
@@ -134,8 +134,8 @@ class CustomPromptProvider {
134
134
  if (input.resource) {
135
135
  try {
136
136
  const blobService = this.resourceManager.getBlobStore();
137
- const { base64, mimeType, filename } = input.resource;
138
- const blobRef = await blobService.store(base64, {
137
+ const { data, mimeType, filename } = input.resource;
138
+ const blobRef = await blobService.store(data, {
139
139
  mimeType,
140
140
  originalName: filename,
141
141
  source: "system"
@@ -10,7 +10,7 @@ export interface CreateCustomPromptInput {
10
10
  content: string;
11
11
  arguments?: PromptArgument[];
12
12
  resource?: {
13
- base64: string;
13
+ data: string;
14
14
  mimeType: string;
15
15
  filename?: string;
16
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"custom-prompt-provider.d.ts","sourceRoot":"","sources":["../../../src/prompts/providers/custom-prompt-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAuB7D,MAAM,WAAW,uBAAuB;IAC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eAAe,CAAC;IAiEjF,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAcnE,YAAY,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC;IAsEjE,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAuBjC,UAAU;IAkDxB,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,OAAO;IAUf,OAAO,CAAC,cAAc;CA4CzB"}
@@ -112,8 +112,8 @@ class CustomPromptProvider {
112
112
  if (input.resource) {
113
113
  try {
114
114
  const blobService = this.resourceManager.getBlobStore();
115
- const { base64, mimeType, filename } = input.resource;
116
- const blobRef = await blobService.store(base64, {
115
+ const { data, mimeType, filename } = input.resource;
116
+ const blobRef = await blobService.store(data, {
117
117
  mimeType,
118
118
  originalName: filename,
119
119
  source: "system"
@@ -32,6 +32,7 @@ __export(factory_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(factory_exports);
34
34
  var import_memory_cache_store = require("./memory-cache-store.js");
35
+ var import_errors = require("../errors.js");
35
36
  let RedisStore = null;
36
37
  async function createCache(config, logger) {
37
38
  switch (config.type) {
@@ -52,8 +53,11 @@ async function createRedisStore(config, logger) {
52
53
  logger.info(`Connecting to Redis at ${config.host}:${config.port}`);
53
54
  return new RedisStore(config, logger);
54
55
  } catch (error) {
55
- logger.warn(`Redis not available, falling back to in-memory cache: ${error}`);
56
- return new import_memory_cache_store.MemoryCacheStore();
56
+ const err = error;
57
+ if (err.code === "ERR_MODULE_NOT_FOUND") {
58
+ throw import_errors.StorageError.dependencyNotInstalled("Redis", "ioredis", "npm install ioredis");
59
+ }
60
+ throw error;
57
61
  }
58
62
  }
59
63
  // Annotate the CommonJS export names for ESM import in node:
@@ -3,7 +3,8 @@ import type { CacheConfig } from '../schemas.js';
3
3
  import type { IDextoLogger } from '../../logger/v2/types.js';
4
4
  /**
5
5
  * Create a cache store based on configuration.
6
- * Handles lazy loading of optional dependencies with automatic fallback.
6
+ * Handles lazy loading of optional dependencies.
7
+ * Throws StorageError.dependencyNotInstalled if required package is missing.
7
8
  * @param config Cache configuration
8
9
  * @param logger Logger instance for logging
9
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/storage/cache/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAoB,WAAW,EAAE,MAAM,eAAe,CAAC;AAEnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAU7D;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,CAU3F"}
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/storage/cache/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAoB,WAAW,EAAE,MAAM,eAAe,CAAC;AAEnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAW7D;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,CAU3F"}
@@ -1,5 +1,6 @@
1
1
  import "../../chunk-C6A6W6XS.js";
2
2
  import { MemoryCacheStore } from "./memory-cache-store.js";
3
+ import { StorageError } from "../errors.js";
3
4
  let RedisStore = null;
4
5
  async function createCache(config, logger) {
5
6
  switch (config.type) {
@@ -20,8 +21,11 @@ async function createRedisStore(config, logger) {
20
21
  logger.info(`Connecting to Redis at ${config.host}:${config.port}`);
21
22
  return new RedisStore(config, logger);
22
23
  } catch (error) {
23
- logger.warn(`Redis not available, falling back to in-memory cache: ${error}`);
24
- return new MemoryCacheStore();
24
+ const err = error;
25
+ if (err.code === "ERR_MODULE_NOT_FOUND") {
26
+ throw StorageError.dependencyNotInstalled("Redis", "ioredis", "npm install ioredis");
27
+ }
28
+ throw error;
25
29
  }
26
30
  }
27
31
  export {
@@ -32,6 +32,7 @@ __export(factory_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(factory_exports);
34
34
  var import_memory_database_store = require("./memory-database-store.js");
35
+ var import_errors = require("../errors.js");
35
36
  let SQLiteStore = null;
36
37
  let PostgresStore = null;
37
38
  async function createDatabase(config, logger) {
@@ -55,27 +56,20 @@ async function createPostgresStore(config, logger) {
55
56
  logger.info("Connecting to PostgreSQL database");
56
57
  return new PostgresStore(config, logger);
57
58
  } catch (error) {
58
- const errorMessage = error instanceof Error ? error.message : String(error);
59
- logger.warn(
60
- `PostgreSQL not available, falling back to in-memory database: ${errorMessage}`
61
- );
62
- return new import_memory_database_store.MemoryDatabaseStore();
59
+ const err = error;
60
+ if (err.code === "ERR_MODULE_NOT_FOUND") {
61
+ throw import_errors.StorageError.dependencyNotInstalled("PostgreSQL", "pg", "npm install pg");
62
+ }
63
+ throw error;
63
64
  }
64
65
  }
65
66
  async function createSQLiteStore(config, logger) {
66
- try {
67
- if (!SQLiteStore) {
68
- const module2 = await import("./sqlite-store.js");
69
- SQLiteStore = module2.SQLiteStore;
70
- }
71
- logger.info(`Creating SQLite database store: ${config.path}`);
72
- return new SQLiteStore(config, logger);
73
- } catch (error) {
74
- const err = error instanceof Error ? error : new Error(String(error));
75
- logger.error(`SQLite store failed to load: ${err.message}`, { error: err.message });
76
- logger.warn("Falling back to in-memory database store");
77
- return new import_memory_database_store.MemoryDatabaseStore();
67
+ if (!SQLiteStore) {
68
+ const module2 = await import("./sqlite-store.js");
69
+ SQLiteStore = module2.SQLiteStore;
78
70
  }
71
+ logger.info(`Creating SQLite database store: ${config.path}`);
72
+ return new SQLiteStore(config, logger);
79
73
  }
80
74
  // Annotate the CommonJS export names for ESM import in node:
81
75
  0 && (module.exports = {
@@ -3,7 +3,8 @@ import type { DatabaseConfig } from '../schemas.js';
3
3
  import type { IDextoLogger } from '../../logger/v2/types.js';
4
4
  /**
5
5
  * Create a database store based on configuration.
6
- * Handles lazy loading of optional dependencies with automatic fallback.
6
+ * Handles lazy loading of optional dependencies.
7
+ * Throws StorageError.dependencyNotInstalled if required package is missing.
7
8
  * Database paths are provided via CLI enrichment layer.
8
9
  * @param config Database configuration with explicit paths
9
10
  * @param logger Logger instance for logging
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/storage/database/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAgD,MAAM,eAAe,CAAC;AAElG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAe7D;;;;;;GAMG;AACH,wBAAsB,cAAc,CAChC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY,GACrB,OAAO,CAAC,QAAQ,CAAC,CAanB"}
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/storage/database/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAgD,MAAM,eAAe,CAAC;AAElG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAgB7D;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAChC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY,GACrB,OAAO,CAAC,QAAQ,CAAC,CAanB"}
@@ -1,5 +1,6 @@
1
1
  import "../../chunk-C6A6W6XS.js";
2
2
  import { MemoryDatabaseStore } from "./memory-database-store.js";
3
+ import { StorageError } from "../errors.js";
3
4
  let SQLiteStore = null;
4
5
  let PostgresStore = null;
5
6
  async function createDatabase(config, logger) {
@@ -23,27 +24,20 @@ async function createPostgresStore(config, logger) {
23
24
  logger.info("Connecting to PostgreSQL database");
24
25
  return new PostgresStore(config, logger);
25
26
  } catch (error) {
26
- const errorMessage = error instanceof Error ? error.message : String(error);
27
- logger.warn(
28
- `PostgreSQL not available, falling back to in-memory database: ${errorMessage}`
29
- );
30
- return new MemoryDatabaseStore();
27
+ const err = error;
28
+ if (err.code === "ERR_MODULE_NOT_FOUND") {
29
+ throw StorageError.dependencyNotInstalled("PostgreSQL", "pg", "npm install pg");
30
+ }
31
+ throw error;
31
32
  }
32
33
  }
33
34
  async function createSQLiteStore(config, logger) {
34
- try {
35
- if (!SQLiteStore) {
36
- const module = await import("./sqlite-store.js");
37
- SQLiteStore = module.SQLiteStore;
38
- }
39
- logger.info(`Creating SQLite database store: ${config.path}`);
40
- return new SQLiteStore(config, logger);
41
- } catch (error) {
42
- const err = error instanceof Error ? error : new Error(String(error));
43
- logger.error(`SQLite store failed to load: ${err.message}`, { error: err.message });
44
- logger.warn("Falling back to in-memory database store");
45
- return new MemoryDatabaseStore();
35
+ if (!SQLiteStore) {
36
+ const module = await import("./sqlite-store.js");
37
+ SQLiteStore = module.SQLiteStore;
46
38
  }
39
+ logger.info(`Creating SQLite database store: ${config.path}`);
40
+ return new SQLiteStore(config, logger);
47
41
  }
48
42
  export {
49
43
  createDatabase
@@ -91,6 +91,14 @@ class SQLiteStore {
91
91
  const module2 = await import("better-sqlite3");
92
92
  BetterSqlite3Database = module2.default || module2;
93
93
  } catch (error) {
94
+ const err = error;
95
+ if (err.code === "ERR_MODULE_NOT_FOUND") {
96
+ throw import_errors.StorageError.dependencyNotInstalled(
97
+ "SQLite",
98
+ "better-sqlite3",
99
+ "npm install better-sqlite3"
100
+ );
101
+ }
94
102
  throw import_errors.StorageError.connectionFailed(
95
103
  `Failed to import better-sqlite3: ${error instanceof Error ? error.message : String(error)}`
96
104
  );
@@ -1 +1 @@
1
- {"version":3,"file":"sqlite-store.d.ts","sour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G,OAAO,CAAC,IAAI,CAAC;IAqB9C,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAqB1E,OAAO,CAAC,eAAe;IAOjB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAKvB,QAAQ,IAAI,OAAO,CAAC;QACtB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;CAqBL"}
@@ -59,6 +59,14 @@ class SQLiteStore {
59
59
  const module = await import("better-sqlite3");
60
60
  BetterSqlite3Database = module.default || module;
61
61
  } catch (error) {
62
+ const err = error;
63
+ if (err.code === "ERR_MODULE_NOT_FOUND") {
64
+ throw StorageError.dependencyNotInstalled(
65
+ "SQLite",
66
+ "better-sqlite3",
67
+ "npm install better-sqlite3"
68
+ );
69
+ }
62
70
  throw StorageError.connectionFailed(
63
71
  `Failed to import better-sqlite3: ${error instanceof Error ? error.message : String(error)}`
64
72
  );
@@ -24,6 +24,7 @@ module.exports = __toCommonJS(error_codes_exports);
24
24
  var StorageErrorCode = /* @__PURE__ */ ((StorageErrorCode2) => {
25
25
  StorageErrorCode2["MANAGER_NOT_INITIALIZED"] = "storage_manager_not_initialized";
26
26
  StorageErrorCode2["MANAGER_NOT_CONNECTED"] = "storage_manager_not_connected";
27
+ StorageErrorCode2["DEPENDENCY_NOT_INSTALLED"] = "storage_dependency_not_installed";
27
28
  StorageErrorCode2["CONNECTION_FAILED"] = "storage_connection_failed";
28
29
  StorageErrorCode2["CONNECTION_CONFIG_MISSING"] = "storage_connection_config_missing";
29
30
  StorageErrorCode2["READ_FAILED"] = "storage_read_failed";
@@ -5,6 +5,7 @@
5
5
  export declare enum StorageErrorCode {
6
6
  MANAGER_NOT_INITIALIZED = "storage_manager_not_initialized",
7
7
  MANAGER_NOT_CONNECTED = "storage_manager_not_connected",
8
+ DEPENDENCY_NOT_INSTALLED = "storage_dependency_not_installed",
8
9
  CONNECTION_FAILED = "storage_connection_failed",
9
10
  CONNECTION_CONFIG_MISSING = "storage_connection_config_missing",
10
11
  READ_FAILED = "storage_read_failed",
@@ -1 +1 @@
1
- {"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/storage/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,gBAAgB;IAExB,uBAAuB,oCAAoC;IAC3D,qBAAqB,kCAAkC;IAGvD,iBAAiB,8BAA8B;IAC/C,yBAAyB,sCAAsC;IAG/D,WAAW,wBAAwB;IACnC,YAAY,yBAAyB;IACrC,aAAa,0BAA0B;IAGvC,gBAAgB,6BAA6B;IAC7C,uBAAuB,oCAAoC;IAG3D,mBAAmB,wBAAwB;IAG3C,kBAAkB,uBAAuB;IACzC,wBAAwB,6BAA6B;IACrD,kBAAkB,uBAAuB;IACzC,mBAAmB,wBAAwB;IAG3C,cAAc,mBAAmB;IACjC,sBAAsB,2BAA2B;IACjD,kBAAkB,uBAAuB;IACzC,cAAc,mBAAmB;IAGjC,0BAA0B,+BAA+B;IACzD,wBAAwB,6BAA6B;IAGrD,mBAAmB,wBAAwB;IAC3C,qBAAqB,0BAA0B;CAClD"}
1
+ {"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/storage/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,gBAAgB;IAExB,uBAAuB,oCAAoC;IAC3D,qBAAqB,kCAAkC;IAGvD,wBAAwB,qCAAqC;IAG7D,iBAAiB,8BAA8B;IAC/C,yBAAyB,sCAAsC;IAG/D,WAAW,wBAAwB;IACnC,YAAY,yBAAyB;IACrC,aAAa,0BAA0B;IAGvC,gBAAgB,6BAA6B;IAC7C,uBAAuB,oCAAoC;IAG3D,mBAAmB,wBAAwB;IAG3C,kBAAkB,uBAAuB;IACzC,wBAAwB,6BAA6B;IACrD,kBAAkB,uBAAuB;IACzC,mBAAmB,wBAAwB;IAG3C,cAAc,mBAAmB;IACjC,sBAAsB,2BAA2B;IACjD,kBAAkB,uBAAuB;IACzC,cAAc,mBAAmB;IAGjC,0BAA0B,+BAA+B;IACzD,wBAAwB,6BAA6B;IAGrD,mBAAmB,wBAAwB;IAC3C,qBAAqB,0BAA0B;CAClD"}
@@ -2,6 +2,7 @@ import "../chunk-C6A6W6XS.js";
2
2
  var StorageErrorCode = /* @__PURE__ */ ((StorageErrorCode2) => {
3
3
  StorageErrorCode2["MANAGER_NOT_INITIALIZED"] = "storage_manager_not_initialized";
4
4
  StorageErrorCode2["MANAGER_NOT_CONNECTED"] = "storage_manager_not_connected";
5
+ StorageErrorCode2["DEPENDENCY_NOT_INSTALLED"] = "storage_dependency_not_installed";
5
6
  StorageErrorCode2["CONNECTION_FAILED"] = "storage_connection_failed";
6
7
  StorageErrorCode2["CONNECTION_CONFIG_MISSING"] = "storage_connection_config_missing";
7
8
  StorageErrorCode2["READ_FAILED"] = "storage_read_failed";
@@ -73,6 +73,23 @@ class StorageError {
73
73
  { method, hint: "Call await manager.connect() after initialize()" }
74
74
  );
75
75
  }
76
+ /**
77
+ * Required storage dependency not installed
78
+ */
79
+ static dependencyNotInstalled(backendType, packageName, installCommand) {
80
+ return new import_errors.DextoRuntimeError(
81
+ import_error_codes.StorageErrorCode.DEPENDENCY_NOT_INSTALLED,
82
+ import_types.ErrorScope.STORAGE,
83
+ import_types.ErrorType.USER,
84
+ `${backendType} storage configured but '${packageName}' package is not installed`,
85
+ {
86
+ backendType,
87
+ packageName,
88
+ hint: `Install with: ${installCommand}`,
89
+ recovery: `Either install the package or change storage type to 'in-memory'`
90
+ }
91
+ );
92
+ }
76
93
  /**
77
94
  * Read operation failed
78
95
  */
@@ -32,6 +32,15 @@ export declare class StorageError {
32
32
  method: string;
33
33
  hint: string;
34
34
  }>;
35
+ /**
36
+ * Required storage dependency not installed
37
+ */
38
+ static dependencyNotInstalled(backendType: string, packageName: string, installCommand: string): DextoRuntimeError<{
39
+ backendType: string;
40
+ packageName: string;
41
+ hint: string;
42
+ recovery: string;
43
+ }>;
35
44
  /**
36
45
  * Read operation failed
37
46
  */
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/storage/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAIhF;;;;GAIG;AACH,qBAAa,YAAY;IACrB;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;IAUxE;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM;;;IAUvC;;OAEG;IACH,MAAM,CAAC,qBAAqB,CAAC,MAAM,EAAE,MAAM;;;;IAU3C;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM;;;;IAUzC;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;IAUtF;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;IAUvF;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;IAUxF;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;IAUxE;;OAEG;IACH,MAAM,CAAC,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;IAU1E;;OAEG;IACH,MAAM,CAAC,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,iBAAiB;IAUtE;;OAEG;IACH,MAAM,CAAC,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,iBAAiB;IAUrF;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,iBAAiB;IAUhF;;OAEG;IACH,MAAM,CAAC,mBAAmB,CACtB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,OAAO,GACf,iBAAiB;CAavB"}
@@ -51,6 +51,23 @@ class StorageError {
51
51
  { method, hint: "Call await manager.connect() after initialize()" }
52
52
  );
53
53
  }
54
+ /**
55
+ * Required storage dependency not installed
56
+ */
57
+ static dependencyNotInstalled(backendType, packageName, installCommand) {
58
+ return new DextoRuntimeError(
59
+ StorageErrorCode.DEPENDENCY_NOT_INSTALLED,
60
+ ErrorScope.STORAGE,
61
+ ErrorType.USER,
62
+ `${backendType} storage configured but '${packageName}' package is not installed`,
63
+ {
64
+ backendType,
65
+ packageName,
66
+ hint: `Install with: ${installCommand}`,
67
+ recovery: `Either install the package or change storage type to 'in-memory'`
68
+ }
69
+ );
70
+ }
54
71
  /**
55
72
  * Read operation failed
56
73
  */
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var error_codes_exports = {};
20
+ __export(error_codes_exports, {
21
+ TelemetryErrorCode: () => TelemetryErrorCode
22
+ });
23
+ module.exports = __toCommonJS(error_codes_exports);
24
+ var TelemetryErrorCode = /* @__PURE__ */ ((TelemetryErrorCode2) => {
25
+ TelemetryErrorCode2["INITIALIZATION_FAILED"] = "telemetry_initialization_failed";
26
+ TelemetryErrorCode2["NOT_INITIALIZED"] = "telemetry_not_initialized";
27
+ TelemetryErrorCode2["DEPENDENCY_NOT_INSTALLED"] = "telemetry_dependency_not_installed";
28
+ TelemetryErrorCode2["EXPORTER_DEPENDENCY_NOT_INSTALLED"] = "telemetry_exporter_dependency_not_installed";
29
+ TelemetryErrorCode2["INVALID_CONFIG"] = "telemetry_invalid_config";
30
+ TelemetryErrorCode2["SHUTDOWN_FAILED"] = "telemetry_shutdown_failed";
31
+ return TelemetryErrorCode2;
32
+ })(TelemetryErrorCode || {});
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ TelemetryErrorCode
36
+ });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Telemetry-specific error codes
3
+ * Covers initialization, dependencies, and export operations
4
+ */
5
+ export declare enum TelemetryErrorCode {
6
+ INITIALIZATION_FAILED = "telemetry_initialization_failed",
7
+ NOT_INITIALIZED = "telemetry_not_initialized",
8
+ DEPENDENCY_NOT_INSTALLED = "telemetry_dependency_not_installed",
9
+ EXPORTER_DEPENDENCY_NOT_INSTALLED = "telemetry_exporter_dependency_not_installed",
10
+ INVALID_CONFIG = "telemetry_invalid_config",
11
+ SHUTDOWN_FAILED = "telemetry_shutdown_failed"
12
+ }
13
+ //# sourceMappingURL=error-codes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/telemetry/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,kBAAkB;IAE1B,qBAAqB,oCAAoC;IACzD,eAAe,8BAA8B;IAG7C,wBAAwB,uCAAuC;IAC/D,iCAAiC,gDAAgD;IAGjF,cAAc,6BAA6B;IAG3C,eAAe,8BAA8B;CAChD"}
@@ -0,0 +1,13 @@
1
+ import "../chunk-C6A6W6XS.js";
2
+ var TelemetryErrorCode = /* @__PURE__ */ ((TelemetryErrorCode2) => {
3
+ TelemetryErrorCode2["INITIALIZATION_FAILED"] = "telemetry_initialization_failed";
4
+ TelemetryErrorCode2["NOT_INITIALIZED"] = "telemetry_not_initialized";
5
+ TelemetryErrorCode2["DEPENDENCY_NOT_INSTALLED"] = "telemetry_dependency_not_installed";
6
+ TelemetryErrorCode2["EXPORTER_DEPENDENCY_NOT_INSTALLED"] = "telemetry_exporter_dependency_not_installed";
7
+ TelemetryErrorCode2["INVALID_CONFIG"] = "telemetry_invalid_config";
8
+ TelemetryErrorCode2["SHUTDOWN_FAILED"] = "telemetry_shutdown_failed";
9
+ return TelemetryErrorCode2;
10
+ })(TelemetryErrorCode || {});
11
+ export {
12
+ TelemetryErrorCode
13
+ };