@ibm/ibmi-mcp-server 0.1.2 → 0.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.
- package/README.md +2178 -46
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +57 -24
- package/dist/config/index.js.map +1 -1
- package/dist/config/resolver.d.ts.map +1 -1
- package/dist/config/resolver.js.map +1 -1
- package/dist/ibmi-mcp-server/auth/httpAuthEndpoint.js +1 -1
- package/dist/ibmi-mcp-server/services/connectionPool.js +2 -2
- package/dist/ibmi-mcp-server/tools/executeSql.tool.d.ts +80 -0
- package/dist/ibmi-mcp-server/tools/executeSql.tool.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/tools/executeSql.tool.js +356 -0
- package/dist/ibmi-mcp-server/tools/executeSql.tool.js.map +1 -0
- package/dist/ibmi-mcp-server/tools/generateSql.tool.d.ts +36 -0
- package/dist/ibmi-mcp-server/tools/generateSql.tool.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/tools/generateSql.tool.js +281 -0
- package/dist/ibmi-mcp-server/tools/generateSql.tool.js.map +1 -0
- package/dist/ibmi-mcp-server/tools/index.d.ts +85 -0
- package/dist/ibmi-mcp-server/tools/index.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/tools/index.js +21 -0
- package/dist/ibmi-mcp-server/tools/index.js.map +1 -0
- package/dist/ibmi-mcp-server/utils/config/configParser.d.ts +9 -0
- package/dist/ibmi-mcp-server/utils/config/configParser.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/configParser.js +58 -0
- package/dist/ibmi-mcp-server/utils/config/configParser.js.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolConfigBuilder.js +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolConfigBuilder.js.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolDefinitions.d.ts +4 -4
- package/dist/ibmi-mcp-server/utils/config/toolDefinitions.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolDefinitions.js +7 -8
- package/dist/ibmi-mcp-server/utils/config/toolDefinitions.js.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolFactory.d.ts +0 -8
- package/dist/ibmi-mcp-server/utils/config/toolFactory.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolFactory.js +0 -31
- package/dist/ibmi-mcp-server/utils/config/toolFactory.js.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolsetManager.d.ts +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolsetManager.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolsetManager.js +2 -2
- package/dist/ibmi-mcp-server/utils/config/toolsetManager.js.map +1 -1
- package/dist/ibmi-mcp-server/utils/language/document.d.ts +26 -0
- package/dist/ibmi-mcp-server/utils/language/document.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/utils/language/document.js +318 -0
- package/dist/ibmi-mcp-server/utils/language/document.js.map +1 -0
- package/dist/ibmi-mcp-server/utils/language/statement.d.ts +43 -0
- package/dist/ibmi-mcp-server/utils/language/statement.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/utils/language/statement.js +796 -0
- package/dist/ibmi-mcp-server/utils/language/statement.js.map +1 -0
- package/dist/ibmi-mcp-server/utils/language/tokens.d.ts +32 -0
- package/dist/ibmi-mcp-server/utils/language/tokens.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/utils/language/tokens.js +532 -0
- package/dist/ibmi-mcp-server/utils/language/tokens.js.map +1 -0
- package/dist/ibmi-mcp-server/utils/language/types.d.ts +138 -0
- package/dist/ibmi-mcp-server/utils/language/types.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/utils/language/types.js +93 -0
- package/dist/ibmi-mcp-server/utils/language/types.js.map +1 -0
- package/dist/ibmi-mcp-server/utils/security/ibmiSqlParser.d.ts +48 -0
- package/dist/ibmi-mcp-server/utils/security/ibmiSqlParser.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/utils/security/ibmiSqlParser.js +93 -0
- package/dist/ibmi-mcp-server/utils/security/ibmiSqlParser.js.map +1 -0
- package/dist/ibmi-mcp-server/utils/security/sqlSecurityValidator.d.ts +35 -59
- package/dist/ibmi-mcp-server/utils/security/sqlSecurityValidator.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/utils/security/sqlSecurityValidator.js +108 -288
- package/dist/ibmi-mcp-server/utils/security/sqlSecurityValidator.js.map +1 -1
- package/dist/ibmi-mcp-server/utils/security/sqlSecurityValidatorFallback.d.ts +54 -0
- package/dist/ibmi-mcp-server/utils/security/sqlSecurityValidatorFallback.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/utils/security/sqlSecurityValidatorFallback.js +91 -0
- package/dist/ibmi-mcp-server/utils/security/sqlSecurityValidatorFallback.js.map +1 -0
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/index.d.ts +13 -2
- package/dist/mcp-server/tools/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/index.js +29 -9
- package/dist/mcp-server/tools/index.js.map +1 -1
- package/dist/mcp-server/tools/utils/index.d.ts +7 -0
- package/dist/mcp-server/tools/utils/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/utils/index.js +7 -0
- package/dist/mcp-server/tools/utils/index.js.map +1 -0
- package/dist/mcp-server/tools/utils/tool-factory.d.ts +129 -0
- package/dist/mcp-server/tools/utils/tool-factory.d.ts.map +1 -0
- package/dist/mcp-server/tools/utils/tool-factory.js +179 -0
- package/dist/mcp-server/tools/utils/tool-factory.js.map +1 -0
- package/dist/mcp-server/tools/utils/types.d.ts +117 -0
- package/dist/mcp-server/tools/utils/types.d.ts.map +1 -0
- package/dist/mcp-server/tools/utils/types.js +11 -0
- package/dist/mcp-server/tools/utils/types.js.map +1 -0
- package/dist/mcp-server/transports/core/cleanupTransformStream.d.ts +26 -0
- package/dist/mcp-server/transports/core/cleanupTransformStream.d.ts.map +1 -0
- package/dist/mcp-server/transports/core/cleanupTransformStream.js +60 -0
- package/dist/mcp-server/transports/core/cleanupTransformStream.js.map +1 -0
- package/dist/mcp-server/transports/core/statefulTransportManager.d.ts +1 -1
- package/dist/mcp-server/transports/core/statefulTransportManager.d.ts.map +1 -1
- package/dist/mcp-server/transports/core/statefulTransportManager.js +50 -40
- package/dist/mcp-server/transports/core/statefulTransportManager.js.map +1 -1
- package/dist/mcp-server/transports/core/statelessTransportManager.d.ts +2 -13
- package/dist/mcp-server/transports/core/statelessTransportManager.d.ts.map +1 -1
- package/dist/mcp-server/transports/core/statelessTransportManager.js +35 -62
- package/dist/mcp-server/transports/core/statelessTransportManager.js.map +1 -1
- package/dist/mcp-server/transports/core/transportRequest.d.ts +1 -2
- package/dist/mcp-server/transports/core/transportRequest.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/mcpTransportMiddleware.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/mcpTransportMiddleware.js +1 -3
- package/dist/mcp-server/transports/http/mcpTransportMiddleware.js.map +1 -1
- package/dist/utils/internal/logger.d.ts +5 -0
- package/dist/utils/internal/logger.d.ts.map +1 -1
- package/dist/utils/internal/logger.js +65 -36
- package/dist/utils/internal/logger.js.map +1 -1
- package/package.json +29 -23
- package/dist/ibmi-mcp-server/tools/executeSql/index.d.ts +0 -9
- package/dist/ibmi-mcp-server/tools/executeSql/index.d.ts.map +0 -1
- package/dist/ibmi-mcp-server/tools/executeSql/index.js +0 -9
- package/dist/ibmi-mcp-server/tools/executeSql/index.js.map +0 -1
- package/dist/ibmi-mcp-server/tools/executeSql/logic.d.ts +0 -51
- package/dist/ibmi-mcp-server/tools/executeSql/logic.d.ts.map +0 -1
- package/dist/ibmi-mcp-server/tools/executeSql/logic.js +0 -179
- package/dist/ibmi-mcp-server/tools/executeSql/logic.js.map +0 -1
- package/dist/ibmi-mcp-server/tools/executeSql/registration.d.ts +0 -52
- package/dist/ibmi-mcp-server/tools/executeSql/registration.d.ts.map +0 -1
- package/dist/ibmi-mcp-server/tools/executeSql/registration.js +0 -161
- package/dist/ibmi-mcp-server/tools/executeSql/registration.js.map +0 -1
- package/dist/ibmi-mcp-server/tools/generateSql/index.d.ts +0 -13
- package/dist/ibmi-mcp-server/tools/generateSql/index.d.ts.map +0 -1
- package/dist/ibmi-mcp-server/tools/generateSql/index.js +0 -13
- package/dist/ibmi-mcp-server/tools/generateSql/index.js.map +0 -1
- package/dist/ibmi-mcp-server/tools/generateSql/logic.d.ts +0 -64
- package/dist/ibmi-mcp-server/tools/generateSql/logic.d.ts.map +0 -1
- package/dist/ibmi-mcp-server/tools/generateSql/logic.js +0 -190
- package/dist/ibmi-mcp-server/tools/generateSql/logic.js.map +0 -1
- package/dist/ibmi-mcp-server/tools/generateSql/registration.d.ts +0 -18
- package/dist/ibmi-mcp-server/tools/generateSql/registration.d.ts.map +0 -1
- package/dist/ibmi-mcp-server/tools/generateSql/registration.js +0 -64
- package/dist/ibmi-mcp-server/tools/generateSql/registration.js.map +0 -1
- package/dist/mcp-server/tools/catFactFetcher/index.d.ts +0 -8
- package/dist/mcp-server/tools/catFactFetcher/index.d.ts.map +0 -1
- package/dist/mcp-server/tools/catFactFetcher/index.js +0 -8
- package/dist/mcp-server/tools/catFactFetcher/index.js.map +0 -1
- package/dist/mcp-server/tools/catFactFetcher/logic.d.ts +0 -52
- package/dist/mcp-server/tools/catFactFetcher/logic.d.ts.map +0 -1
- package/dist/mcp-server/tools/catFactFetcher/logic.js +0 -95
- package/dist/mcp-server/tools/catFactFetcher/logic.js.map +0 -1
- package/dist/mcp-server/tools/catFactFetcher/registration.d.ts +0 -9
- package/dist/mcp-server/tools/catFactFetcher/registration.d.ts.map +0 -1
- package/dist/mcp-server/tools/catFactFetcher/registration.js +0 -43
- package/dist/mcp-server/tools/catFactFetcher/registration.js.map +0 -1
- package/dist/mcp-server/tools/echoTool/index.d.ts +0 -13
- package/dist/mcp-server/tools/echoTool/index.d.ts.map +0 -1
- package/dist/mcp-server/tools/echoTool/index.js +0 -13
- package/dist/mcp-server/tools/echoTool/index.js.map +0 -1
- package/dist/mcp-server/tools/echoTool/logic.d.ts +0 -69
- package/dist/mcp-server/tools/echoTool/logic.d.ts.map +0 -1
- package/dist/mcp-server/tools/echoTool/logic.js +0 -119
- package/dist/mcp-server/tools/echoTool/logic.js.map +0 -1
- package/dist/mcp-server/tools/echoTool/registration.d.ts +0 -9
- package/dist/mcp-server/tools/echoTool/registration.d.ts.map +0 -1
- package/dist/mcp-server/tools/echoTool/registration.js +0 -45
- package/dist/mcp-server/tools/echoTool/registration.js.map +0 -1
- package/dist/mcp-server/tools/imageTest/index.d.ts +0 -7
- package/dist/mcp-server/tools/imageTest/index.d.ts.map +0 -1
- package/dist/mcp-server/tools/imageTest/index.js +0 -7
- package/dist/mcp-server/tools/imageTest/index.js.map +0 -1
- package/dist/mcp-server/tools/imageTest/logic.d.ts +0 -27
- package/dist/mcp-server/tools/imageTest/logic.d.ts.map +0 -1
- package/dist/mcp-server/tools/imageTest/logic.js +0 -44
- package/dist/mcp-server/tools/imageTest/logic.js.map +0 -1
- package/dist/mcp-server/tools/imageTest/registration.d.ts +0 -9
- package/dist/mcp-server/tools/imageTest/registration.d.ts.map +0 -1
- package/dist/mcp-server/tools/imageTest/registration.js +0 -49
- package/dist/mcp-server/tools/imageTest/registration.js.map +0 -1
- package/dist/mcp-server/tools/utils/tool-utils.d.ts +0 -43
- package/dist/mcp-server/tools/utils/tool-utils.d.ts.map +0 -1
- package/dist/mcp-server/tools/utils/tool-utils.js +0 -44
- package/dist/mcp-server/tools/utils/tool-utils.js.map +0 -1
- package/dist/mcp-server/transports/core/headerUtils.d.ts +0 -27
- package/dist/mcp-server/transports/core/headerUtils.d.ts.map +0 -1
- package/dist/mcp-server/transports/core/headerUtils.js +0 -53
- package/dist/mcp-server/transports/core/headerUtils.js.map +0 -1
- package/dist/mcp-server/transports/core/honoNodeBridge.d.ts +0 -77
- package/dist/mcp-server/transports/core/honoNodeBridge.d.ts.map +0 -1
- package/dist/mcp-server/transports/core/honoNodeBridge.js +0 -150
- package/dist/mcp-server/transports/core/honoNodeBridge.js.map +0 -1
- package/dist/services/duck-db/duckDBConnectionManager.d.ts +0 -55
- package/dist/services/duck-db/duckDBConnectionManager.d.ts.map +0 -1
- package/dist/services/duck-db/duckDBConnectionManager.js +0 -184
- package/dist/services/duck-db/duckDBConnectionManager.js.map +0 -1
- package/dist/services/duck-db/duckDBQueryExecutor.d.ts +0 -18
- package/dist/services/duck-db/duckDBQueryExecutor.d.ts.map +0 -1
- package/dist/services/duck-db/duckDBQueryExecutor.js +0 -115
- package/dist/services/duck-db/duckDBQueryExecutor.js.map +0 -1
- package/dist/services/duck-db/duckDBService.d.ts +0 -27
- package/dist/services/duck-db/duckDBService.d.ts.map +0 -1
- package/dist/services/duck-db/duckDBService.js +0 -151
- package/dist/services/duck-db/duckDBService.js.map +0 -1
- package/dist/services/duck-db/types.d.ts +0 -135
- package/dist/services/duck-db/types.d.ts.map +0 -1
- package/dist/services/duck-db/types.js +0 -6
- package/dist/services/duck-db/types.js.map +0 -1
- package/dist/services/llm-providers/openRouterProvider.d.ts +0 -36
- package/dist/services/llm-providers/openRouterProvider.d.ts.map +0 -1
- package/dist/services/llm-providers/openRouterProvider.js +0 -235
- package/dist/services/llm-providers/openRouterProvider.js.map +0 -1
- package/dist/services/supabase/supabaseClient.d.ts +0 -25
- package/dist/services/supabase/supabaseClient.d.ts.map +0 -1
- package/dist/services/supabase/supabaseClient.js +0 -68
- package/dist/services/supabase/supabaseClient.js.map +0 -1
- package/dist/storage/duckdbExample.d.ts +0 -8
- package/dist/storage/duckdbExample.d.ts.map +0 -1
- package/dist/storage/duckdbExample.js +0 -197
- package/dist/storage/duckdbExample.js.map +0 -1
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Defines types and interfaces for the DuckDB service.
|
|
3
|
-
* @module services/duck-db/types
|
|
4
|
-
*/
|
|
5
|
-
import * as duckdb from "@duckdb/node-api";
|
|
6
|
-
/**
|
|
7
|
-
* Configuration options for initializing the DuckDB service.
|
|
8
|
-
*/
|
|
9
|
-
export interface DuckDBServiceConfig {
|
|
10
|
-
/**
|
|
11
|
-
* The path to the database file.
|
|
12
|
-
* Use ':memory:' for an in-memory database.
|
|
13
|
-
* If undefined, defaults to an in-memory database.
|
|
14
|
-
*/
|
|
15
|
-
dbPath?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Optional DuckDB launch configurations.
|
|
18
|
-
* Refer to DuckDB documentation for available options.
|
|
19
|
-
* Example: { allow_unsigned_extensions: 'true' }
|
|
20
|
-
*/
|
|
21
|
-
launchConfig?: Record<string, string>;
|
|
22
|
-
/**
|
|
23
|
-
* List of extensions to install and load upon initialization.
|
|
24
|
-
* Example: ['httpfs', 'json']
|
|
25
|
-
*/
|
|
26
|
-
extensions?: string[];
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Represents a query to be executed.
|
|
30
|
-
*/
|
|
31
|
-
export interface DuckDBQuery {
|
|
32
|
-
sql: string;
|
|
33
|
-
params?: unknown[];
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Represents the result of a query execution.
|
|
37
|
-
*/
|
|
38
|
-
export interface DuckDBQueryResult<T = Record<string, unknown>> {
|
|
39
|
-
rows: T[];
|
|
40
|
-
columnNames: string[];
|
|
41
|
-
columnTypes: duckdb.DuckDBTypeId[];
|
|
42
|
-
rowCount: number;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Interface for the DuckDB service.
|
|
46
|
-
*/
|
|
47
|
-
export interface IDuckDBService {
|
|
48
|
-
/**
|
|
49
|
-
* Initializes the DuckDB service with the given configuration.
|
|
50
|
-
* Must be called before any other operations.
|
|
51
|
-
* @param {DuckDBServiceConfig} config - The configuration for the DuckDB service.
|
|
52
|
-
* @returns {Promise<void>}
|
|
53
|
-
* @throws {McpError} If initialization fails.
|
|
54
|
-
*/
|
|
55
|
-
initialize(config?: DuckDBServiceConfig): Promise<void>;
|
|
56
|
-
/**
|
|
57
|
-
* Executes a SQL query that does not return a large result set (e.g., CREATE, INSERT, UPDATE, DELETE).
|
|
58
|
-
* @param {string} sql - The SQL query string.
|
|
59
|
-
* @param {unknown[]} [params] - Optional parameters for the query.
|
|
60
|
-
* @returns {Promise<void>}
|
|
61
|
-
* @throws {McpError} If the query fails or the service is not initialized.
|
|
62
|
-
*/
|
|
63
|
-
run(sql: string, params?: unknown[]): Promise<void>;
|
|
64
|
-
/**
|
|
65
|
-
* Executes a SQL query and returns all resulting rows.
|
|
66
|
-
* Suitable for queries that return a manageable number of rows.
|
|
67
|
-
* @template T - The expected type of the row objects.
|
|
68
|
-
* @param {string} sql - The SQL query string.
|
|
69
|
-
* @param {unknown[]} [params] - Optional parameters for the query.
|
|
70
|
-
* @returns {Promise<DuckDBQueryResult<T>>} The query result.
|
|
71
|
-
* @throws {McpError} If the query fails or the service is not initialized.
|
|
72
|
-
*/
|
|
73
|
-
query<T = Record<string, unknown>>(sql: string, params?: unknown[]): Promise<DuckDBQueryResult<T>>;
|
|
74
|
-
/**
|
|
75
|
-
* Executes a SQL query and provides a streaming result reader.
|
|
76
|
-
* Suitable for queries that return very large result sets.
|
|
77
|
-
* The caller is responsible for closing the stream.
|
|
78
|
-
* @param {string} sql - The SQL query string.
|
|
79
|
-
* @param {unknown[]} [params] - Optional parameters for the query.
|
|
80
|
-
* @returns {Promise<duckdb.DuckDBStreamingResult>} A streaming result object.
|
|
81
|
-
* @throws {McpError} If the query fails or the service is not initialized.
|
|
82
|
-
*/
|
|
83
|
-
stream(sql: string, params?: unknown[]): Promise<duckdb.DuckDBResult>;
|
|
84
|
-
/**
|
|
85
|
-
* Creates a prepared statement.
|
|
86
|
-
* @param {string} sql - The SQL query string for the prepared statement.
|
|
87
|
-
* @returns {Promise<duckdb.DuckDBPreparedStatement>} The prepared statement object.
|
|
88
|
-
* @throws {McpError} If preparing the statement fails or the service is not initialized.
|
|
89
|
-
*/
|
|
90
|
-
prepare(sql: string): Promise<duckdb.DuckDBPreparedStatement>;
|
|
91
|
-
/**
|
|
92
|
-
* Begins a new transaction.
|
|
93
|
-
* @returns {Promise<void>}
|
|
94
|
-
* @throws {McpError} If starting the transaction fails or the service is not initialized.
|
|
95
|
-
*/
|
|
96
|
-
beginTransaction(): Promise<void>;
|
|
97
|
-
/**
|
|
98
|
-
* Commits the current transaction.
|
|
99
|
-
* @returns {Promise<void>}
|
|
100
|
-
* @throws {McpError} If committing the transaction fails or the service is not initialized.
|
|
101
|
-
*/
|
|
102
|
-
commitTransaction(): Promise<void>;
|
|
103
|
-
/**
|
|
104
|
-
* Rolls back the current transaction.
|
|
105
|
-
* @returns {Promise<void>}
|
|
106
|
-
* @throws {McpError} If rolling back the transaction fails or the service is not initialized.
|
|
107
|
-
*/
|
|
108
|
-
rollbackTransaction(): Promise<void>;
|
|
109
|
-
/**
|
|
110
|
-
* Installs and loads a DuckDB extension.
|
|
111
|
-
* @param {string} extensionName - The name of the extension to install and load.
|
|
112
|
-
* @returns {Promise<void>}
|
|
113
|
-
* @throws {McpError} If installing or loading the extension fails or the service is not initialized.
|
|
114
|
-
*/
|
|
115
|
-
loadExtension(extensionName: string): Promise<void>;
|
|
116
|
-
/**
|
|
117
|
-
* Closes the DuckDB connection and instance.
|
|
118
|
-
* @returns {Promise<void>}
|
|
119
|
-
* @throws {McpError} If closing fails.
|
|
120
|
-
*/
|
|
121
|
-
close(): Promise<void>;
|
|
122
|
-
/**
|
|
123
|
-
* Gets the underlying DuckDB connection object.
|
|
124
|
-
* Use with caution, primarily for advanced scenarios not covered by the service interface.
|
|
125
|
-
* @returns {duckdb.DuckDBConnection | null} The connection object, or null if not initialized.
|
|
126
|
-
*/
|
|
127
|
-
getRawConnection(): duckdb.DuckDBConnection | null;
|
|
128
|
-
/**
|
|
129
|
-
* Gets the underlying DuckDB instance object.
|
|
130
|
-
* Use with caution, primarily for advanced scenarios not covered by the service interface.
|
|
131
|
-
* @returns {duckdb.DuckDBInstance | null} The instance object, or null if not initialized.
|
|
132
|
-
*/
|
|
133
|
-
getRawInstance(): duckdb.DuckDBInstance | null;
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/duck-db/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEtC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC5D,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;OAMG;IACH,UAAU,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExD;;;;;;OAMG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;;;;;;OAQG;IACH,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,OAAO,EAAE,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IAEjC;;;;;;;;OAQG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAEtE;;;;;OAKG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAE9D;;;;OAIG;IACH,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC;;;;OAIG;IACH,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnC;;;;OAIG;IACH,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAErC;;;;;OAKG;IACH,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;;OAIG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;OAIG;IACH,gBAAgB,IAAI,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAEnD;;;;OAIG;IACH,cAAc,IAAI,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;CAChD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/duck-db/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ChatCompletion, ChatCompletionChunk, ChatCompletionCreateParamsNonStreaming, ChatCompletionCreateParamsStreaming } from "openai/resources/chat/completions";
|
|
2
|
-
import { Stream } from "openai/streaming";
|
|
3
|
-
import { RequestContext } from "../../utils/internal/requestContext.js";
|
|
4
|
-
/**
|
|
5
|
-
* Options for configuring the OpenRouter client.
|
|
6
|
-
*/
|
|
7
|
-
export interface OpenRouterClientOptions {
|
|
8
|
-
apiKey?: string;
|
|
9
|
-
baseURL?: string;
|
|
10
|
-
siteUrl?: string;
|
|
11
|
-
siteName?: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Defines the parameters for an OpenRouter chat completion request.
|
|
15
|
-
*/
|
|
16
|
-
export type OpenRouterChatParams = (ChatCompletionCreateParamsNonStreaming | ChatCompletionCreateParamsStreaming) & {
|
|
17
|
-
top_k?: number;
|
|
18
|
-
min_p?: number;
|
|
19
|
-
transforms?: string[];
|
|
20
|
-
models?: string[];
|
|
21
|
-
route?: "fallback";
|
|
22
|
-
provider?: Record<string, unknown>;
|
|
23
|
-
};
|
|
24
|
-
declare class OpenRouterProvider {
|
|
25
|
-
private client?;
|
|
26
|
-
status: "unconfigured" | "initializing" | "ready" | "error";
|
|
27
|
-
private initializationError;
|
|
28
|
-
constructor();
|
|
29
|
-
initialize(options?: OpenRouterClientOptions): void;
|
|
30
|
-
private checkReady;
|
|
31
|
-
chatCompletion(params: OpenRouterChatParams, context: RequestContext): Promise<ChatCompletion | Stream<ChatCompletionChunk>>;
|
|
32
|
-
chatCompletionStream(params: OpenRouterChatParams, context: RequestContext): Promise<AsyncIterable<ChatCompletionChunk>>;
|
|
33
|
-
}
|
|
34
|
-
declare const openRouterProviderInstance: OpenRouterProvider;
|
|
35
|
-
export { openRouterProviderInstance as openRouterProvider, OpenRouterProvider };
|
|
36
|
-
//# sourceMappingURL=openRouterProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openRouterProvider.d.ts","sourceRoot":"","sources":["../../../src/services/llm-providers/openRouterProvider.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,sCAAsC,EACtC,mCAAmC,EACpC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAK1C,O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
-
/**
|
|
2
|
-
* @fileoverview Provides a service class (`OpenRouterProvider`) for interacting with the
|
|
3
|
-
* OpenRouter API. This file implements the "handler" pattern internally, where the
|
|
4
|
-
* OpenRouterProvider class manages state and error handling, while private logic functions
|
|
5
|
-
* execute the core API interactions and throw structured errors.
|
|
6
|
-
* @module src/services/llm-providers/openRouterProvider
|
|
7
|
-
*/
|
|
8
|
-
import OpenAI from "openai";
|
|
9
|
-
import { config } from "../../config/index.js";
|
|
10
|
-
import { JsonRpcErrorCode, McpError } from "../../types-global/errors.js";
|
|
11
|
-
import { ErrorHandler } from "../../utils/internal/errorHandler.js";
|
|
12
|
-
import { logger } from "../../utils/internal/logger.js";
|
|
13
|
-
import { requestContextService, } from "../../utils/internal/requestContext.js";
|
|
14
|
-
import { rateLimiter } from "../../utils/security/rateLimiter.js";
|
|
15
|
-
import { sanitization } from "../../utils/security/sanitization.js";
|
|
16
|
-
// #region Internal Logic Functions (Throwing Errors)
|
|
17
|
-
/**
|
|
18
|
-
* Prepares parameters for the OpenRouter API call, separating standard
|
|
19
|
-
* and extra parameters and applying defaults.
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
function _prepareApiParameters(params) {
|
|
23
|
-
const effectiveModelId = params.model || config.llmDefaultModel;
|
|
24
|
-
const standardParams = {
|
|
25
|
-
model: effectiveModelId,
|
|
26
|
-
messages: params.messages,
|
|
27
|
-
...(params.temperature !== undefined ||
|
|
28
|
-
config.llmDefaultTemperature !== undefined
|
|
29
|
-
? { temperature: params.temperature ?? config.llmDefaultTemperature }
|
|
30
|
-
: {}),
|
|
31
|
-
...(params.top_p !== undefined || config.llmDefaultTopP !== undefined
|
|
32
|
-
? { top_p: params.top_p ?? config.llmDefaultTopP }
|
|
33
|
-
: {}),
|
|
34
|
-
...(params.presence_penalty !== undefined
|
|
35
|
-
? { presence_penalty: params.presence_penalty }
|
|
36
|
-
: {}),
|
|
37
|
-
...(params.stream !== undefined && { stream: params.stream }),
|
|
38
|
-
...(params.tools !== undefined && { tools: params.tools }),
|
|
39
|
-
...(params.tool_choice !== undefined && {
|
|
40
|
-
tool_choice: params.tool_choice,
|
|
41
|
-
}),
|
|
42
|
-
...(params.response_format !== undefined && {
|
|
43
|
-
response_format: params.response_format,
|
|
44
|
-
}),
|
|
45
|
-
...(params.stop !== undefined && { stop: params.stop }),
|
|
46
|
-
...(params.seed !== undefined && { seed: params.seed }),
|
|
47
|
-
...(params.frequency_penalty !== undefined
|
|
48
|
-
? { frequency_penalty: params.frequency_penalty }
|
|
49
|
-
: {}),
|
|
50
|
-
...(params.logit_bias !== undefined && { logit_bias: params.logit_bias }),
|
|
51
|
-
};
|
|
52
|
-
const extraBody = {};
|
|
53
|
-
const standardKeys = new Set(Object.keys(standardParams));
|
|
54
|
-
standardKeys.add("messages");
|
|
55
|
-
for (const key in params) {
|
|
56
|
-
if (Object.prototype.hasOwnProperty.call(params, key) &&
|
|
57
|
-
!standardKeys.has(key) &&
|
|
58
|
-
key !== "max_tokens") {
|
|
59
|
-
extraBody[key] = params[key];
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (extraBody.top_k === undefined && config.llmDefaultTopK !== undefined) {
|
|
63
|
-
extraBody.top_k = config.llmDefaultTopK;
|
|
64
|
-
}
|
|
65
|
-
if (extraBody.min_p === undefined && config.llmDefaultMinP !== undefined) {
|
|
66
|
-
extraBody.min_p = config.llmDefaultMinP;
|
|
67
|
-
}
|
|
68
|
-
if (extraBody.provider &&
|
|
69
|
-
typeof extraBody.provider === "object" &&
|
|
70
|
-
extraBody.provider !== null) {
|
|
71
|
-
const provider = extraBody.provider;
|
|
72
|
-
if (!provider.sort) {
|
|
73
|
-
provider.sort = "throughput";
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
else if (extraBody.provider === undefined) {
|
|
77
|
-
extraBody.provider = { sort: "throughput" };
|
|
78
|
-
}
|
|
79
|
-
const modelsRequiringMaxCompletionTokens = ["openai/o1", "openai/gpt-4.1"];
|
|
80
|
-
const needsMaxCompletionTokens = modelsRequiringMaxCompletionTokens.some((modelPrefix) => effectiveModelId.startsWith(modelPrefix));
|
|
81
|
-
const effectiveMaxTokensValue = params.max_tokens ?? config.llmDefaultMaxTokens;
|
|
82
|
-
if (effectiveMaxTokensValue !== undefined) {
|
|
83
|
-
if (needsMaxCompletionTokens) {
|
|
84
|
-
extraBody.max_completion_tokens = effectiveMaxTokensValue;
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
standardParams.max_tokens = effectiveMaxTokensValue;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return { standardParams, extraBody };
|
|
91
|
-
}
|
|
92
|
-
async function _openRouterChatCompletionLogic(client, params, context) {
|
|
93
|
-
const isStreaming = params.stream === true;
|
|
94
|
-
const { standardParams, extraBody } = _prepareApiParameters(params);
|
|
95
|
-
const apiParams = { ...standardParams };
|
|
96
|
-
if (Object.keys(extraBody).length > 0) {
|
|
97
|
-
apiParams.extra_body = extraBody;
|
|
98
|
-
}
|
|
99
|
-
logger.logInteraction("OpenRouterRequest", {
|
|
100
|
-
context,
|
|
101
|
-
request: apiParams,
|
|
102
|
-
});
|
|
103
|
-
try {
|
|
104
|
-
if (isStreaming) {
|
|
105
|
-
return await client.chat.completions.create(apiParams);
|
|
106
|
-
}
|
|
107
|
-
const response = await client.chat.completions.create(apiParams);
|
|
108
|
-
logger.logInteraction("OpenRouterResponse", {
|
|
109
|
-
context,
|
|
110
|
-
response,
|
|
111
|
-
streaming: false,
|
|
112
|
-
});
|
|
113
|
-
return response;
|
|
114
|
-
}
|
|
115
|
-
catch (e) {
|
|
116
|
-
const error = e;
|
|
117
|
-
logger.logInteraction("OpenRouterError", {
|
|
118
|
-
context,
|
|
119
|
-
error: {
|
|
120
|
-
message: error.message,
|
|
121
|
-
stack: error.stack,
|
|
122
|
-
status: error.status,
|
|
123
|
-
cause: error.cause,
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
const errorDetails = {
|
|
127
|
-
providerStatus: error.status,
|
|
128
|
-
providerMessage: error.message,
|
|
129
|
-
cause: error?.cause,
|
|
130
|
-
};
|
|
131
|
-
if (error.status === 401) {
|
|
132
|
-
throw new McpError(JsonRpcErrorCode.Unauthorized, `OpenRouter authentication failed: ${error.message}`, errorDetails);
|
|
133
|
-
}
|
|
134
|
-
else if (error.status === 429) {
|
|
135
|
-
throw new McpError(JsonRpcErrorCode.RateLimited, `OpenRouter rate limit exceeded: ${error.message}`, errorDetails);
|
|
136
|
-
}
|
|
137
|
-
else if (error.status === 402) {
|
|
138
|
-
throw new McpError(JsonRpcErrorCode.Forbidden, `OpenRouter insufficient credits or payment required: ${error.message}`, errorDetails);
|
|
139
|
-
}
|
|
140
|
-
throw new McpError(JsonRpcErrorCode.InternalError, `OpenRouter API error (${error.status || "unknown status"}): ${error.message}`, errorDetails);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
class OpenRouterProvider {
|
|
144
|
-
client;
|
|
145
|
-
status;
|
|
146
|
-
initializationError = null;
|
|
147
|
-
constructor() {
|
|
148
|
-
this.status = "unconfigured";
|
|
149
|
-
}
|
|
150
|
-
initialize(options) {
|
|
151
|
-
const opContext = requestContextService.createRequestContext({
|
|
152
|
-
operation: "OpenRouterProvider.initialize",
|
|
153
|
-
});
|
|
154
|
-
this.status = "initializing";
|
|
155
|
-
const apiKey = options?.apiKey !== undefined ? options.apiKey : config.openrouterApiKey;
|
|
156
|
-
if (!apiKey) {
|
|
157
|
-
this.status = "unconfigured";
|
|
158
|
-
this.initializationError = new McpError(JsonRpcErrorCode.ConfigurationError, "OpenRouter API key is not configured.");
|
|
159
|
-
logger.error({
|
|
160
|
-
...opContext,
|
|
161
|
-
error: this.initializationError,
|
|
162
|
-
}, this.initializationError.message);
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
try {
|
|
166
|
-
this.client = new OpenAI({
|
|
167
|
-
baseURL: options?.baseURL || "https://openrouter.ai/api/v1",
|
|
168
|
-
apiKey,
|
|
169
|
-
defaultHeaders: {
|
|
170
|
-
"HTTP-Referer": options?.siteUrl || config.openrouterAppUrl,
|
|
171
|
-
"X-Title": options?.siteName || config.openrouterAppName,
|
|
172
|
-
},
|
|
173
|
-
maxRetries: 0,
|
|
174
|
-
});
|
|
175
|
-
this.status = "ready";
|
|
176
|
-
logger.info(opContext, "OpenRouter Service Initialized and Ready");
|
|
177
|
-
}
|
|
178
|
-
catch (e) {
|
|
179
|
-
const error = e;
|
|
180
|
-
this.status = "error";
|
|
181
|
-
this.initializationError = error;
|
|
182
|
-
logger.error({
|
|
183
|
-
...opContext,
|
|
184
|
-
error,
|
|
185
|
-
}, "Failed to initialize OpenRouter client");
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
checkReady(operation, context) {
|
|
189
|
-
if (this.status !== "ready" || !this.client) {
|
|
190
|
-
const message = `OpenRouter service is not available (status: ${this.status}).`;
|
|
191
|
-
logger.error({
|
|
192
|
-
...context,
|
|
193
|
-
status: this.status,
|
|
194
|
-
}, `[${operation}] ${message}`);
|
|
195
|
-
throw new McpError(JsonRpcErrorCode.ServiceUnavailable, message, {
|
|
196
|
-
cause: this.initializationError,
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
async chatCompletion(params, context) {
|
|
201
|
-
const operation = "OpenRouterProvider.chatCompletion";
|
|
202
|
-
const sanitizedParams = sanitization.sanitizeForLogging(params);
|
|
203
|
-
return await ErrorHandler.tryCatch(async () => {
|
|
204
|
-
this.checkReady(operation, context);
|
|
205
|
-
const rateLimitKey = context.requestId || "openrouter_default_key";
|
|
206
|
-
rateLimiter.check(rateLimitKey, context);
|
|
207
|
-
return await _openRouterChatCompletionLogic(this.client, params, context);
|
|
208
|
-
}, { operation, context, input: sanitizedParams });
|
|
209
|
-
}
|
|
210
|
-
async chatCompletionStream(params, context) {
|
|
211
|
-
const streamParams = { ...params, stream: true };
|
|
212
|
-
const response = await this.chatCompletion(streamParams, context);
|
|
213
|
-
const responseStream = response;
|
|
214
|
-
async function* loggingStream() {
|
|
215
|
-
const chunks = [];
|
|
216
|
-
try {
|
|
217
|
-
for await (const chunk of responseStream) {
|
|
218
|
-
chunks.push(chunk);
|
|
219
|
-
yield chunk;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
finally {
|
|
223
|
-
logger.logInteraction("OpenRouterResponse", {
|
|
224
|
-
context,
|
|
225
|
-
response: chunks,
|
|
226
|
-
streaming: true,
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
return loggingStream();
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
const openRouterProviderInstance = new OpenRouterProvider();
|
|
234
|
-
export { openRouterProviderInstance as openRouterProvider, OpenRouterProvider };
|
|
235
|
-
//# sourceMappingURL=openRouterProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openRouterProvider.js","sourceRoot":"","sources":["../../../src/services/llm-providers/openRouterProvider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,MAAM,MAAM,QAAQ,CAAC;AAQ5B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAEL,qBAAqB,GACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AA8BhE,qDAAqD;AAErD;;;;GAIG;AACH,SAAS,qBAAqB,CAAC,MAA4B;IACzD,MAAM,gBAAgB,GAAG,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,eAAe,CAAC;IAEhE,MAAM,cAAc,GAEhB;Q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AAG,IAAI,kBAAkB,EAAE,CAAC;AAE5D,OAAO,EAAE,0BAA0B,IAAI,kBAAkB,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Initializes and exports a singleton Supabase client instance.
|
|
3
|
-
* This module ensures that the Supabase client is initialized once and shared
|
|
4
|
-
* across the application, using credentials from the central configuration.
|
|
5
|
-
* It handles both the standard client and the admin client (using the service role key).
|
|
6
|
-
*
|
|
7
|
-
* @module src/services/supabase/supabaseClient
|
|
8
|
-
*/
|
|
9
|
-
import { SupabaseClient } from "@supabase/supabase-js";
|
|
10
|
-
type Database = Record<string, unknown>;
|
|
11
|
-
/**
|
|
12
|
-
* Returns the singleton Supabase client instance.
|
|
13
|
-
* Throws an McpError if the client is not initialized.
|
|
14
|
-
* @returns The Supabase client.
|
|
15
|
-
*/
|
|
16
|
-
export declare const getSupabaseClient: () => SupabaseClient<Database>;
|
|
17
|
-
/**
|
|
18
|
-
* Returns the singleton Supabase admin client instance.
|
|
19
|
-
* This client uses the service role key and bypasses RLS.
|
|
20
|
-
* Throws an McpError if the admin client is not initialized.
|
|
21
|
-
* @returns The Supabase admin client.
|
|
22
|
-
*/
|
|
23
|
-
export declare const getSupabaseAdminClient: () => SupabaseClient<Database>;
|
|
24
|
-
export {};
|
|
25
|
-
//# sourceMappingURL=supabaseClient.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"supabaseClient.d.ts","sourceRoot":"","sources":["../../../src/services/supabase/supabaseClient.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAgB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAOrE,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAiDxC;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAO,cAAc,CAAC,QAAQ,CAQ3D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,QAAO,cAAc,CAAC,QAAQ,CAQhE,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Initializes and exports a singleton Supabase client instance.
|
|
3
|
-
* This module ensures that the Supabase client is initialized once and shared
|
|
4
|
-
* across the application, using credentials from the central configuration.
|
|
5
|
-
* It handles both the standard client and the admin client (using the service role key).
|
|
6
|
-
*
|
|
7
|
-
* @module src/services/supabase/supabaseClient
|
|
8
|
-
*/
|
|
9
|
-
import { createClient } from "@supabase/supabase-js";
|
|
10
|
-
import { config } from "../../config/index.js";
|
|
11
|
-
import { JsonRpcErrorCode, McpError } from "../../types-global/errors.js";
|
|
12
|
-
import { logger, requestContextService } from "../../utils/index.js";
|
|
13
|
-
let supabase = null;
|
|
14
|
-
let supabaseAdmin = null;
|
|
15
|
-
const initializeSupabase = () => {
|
|
16
|
-
const context = requestContextService.createRequestContext({
|
|
17
|
-
operation: "initializeSupabase",
|
|
18
|
-
});
|
|
19
|
-
if (config.supabase?.url && config.supabase?.anonKey) {
|
|
20
|
-
if (!supabase) {
|
|
21
|
-
supabase = createClient(config.supabase.url, config.supabase.anonKey, {
|
|
22
|
-
auth: {
|
|
23
|
-
persistSession: false,
|
|
24
|
-
autoRefreshToken: false,
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
logger.info(context, "Supabase client initialized.");
|
|
28
|
-
}
|
|
29
|
-
if (!supabaseAdmin && config.supabase.serviceRoleKey) {
|
|
30
|
-
supabaseAdmin = createClient(config.supabase.url, config.supabase.serviceRoleKey, {
|
|
31
|
-
auth: {
|
|
32
|
-
persistSession: false,
|
|
33
|
-
autoRefreshToken: false,
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
logger.info(context, "Supabase admin client initialized.");
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
logger.warning(context, "Supabase URL or anon key is missing. Supabase clients not initialized.");
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
// Initialize on load
|
|
44
|
-
initializeSupabase();
|
|
45
|
-
/**
|
|
46
|
-
* Returns the singleton Supabase client instance.
|
|
47
|
-
* Throws an McpError if the client is not initialized.
|
|
48
|
-
* @returns The Supabase client.
|
|
49
|
-
*/
|
|
50
|
-
export const getSupabaseClient = () => {
|
|
51
|
-
if (!supabase) {
|
|
52
|
-
throw new McpError(JsonRpcErrorCode.ServiceUnavailable, "Supabase client has not been initialized. Please check your SUPABASE_URL and SUPABASE_ANON_KEY environment variables.");
|
|
53
|
-
}
|
|
54
|
-
return supabase;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Returns the singleton Supabase admin client instance.
|
|
58
|
-
* This client uses the service role key and bypasses RLS.
|
|
59
|
-
* Throws an McpError if the admin client is not initialized.
|
|
60
|
-
* @returns The Supabase admin client.
|
|
61
|
-
*/
|
|
62
|
-
export const getSupabaseAdminClient = () => {
|
|
63
|
-
if (!supabaseAdmin) {
|
|
64
|
-
throw new McpError(JsonRpcErrorCode.ServiceUnavailable, "Supabase admin client has not been initialized. Please check your SUPABASE_SERVICE_ROLE_KEY environment variable.");
|
|
65
|
-
}
|
|
66
|
-
return supabaseAdmin;
|
|
67
|
-
};
|
|
68
|
-
//# sourceMappingURL=supabaseClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"supabaseClient.js","sourceRoot":"","sources":["../../../src/services/supabase/supabaseClient.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAkB,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAMjE,IAAI,QAAQ,GAAoC,IAAI,CAAC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AkB,EACnC,uHAAuH,CACxH,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAA6B,EAAE;IACnE,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,IAAI,QAAQ,CAChB,gBAAgB,CAAC,kBAAkB,EACnC,mHAAmH,CACpH,CAAC;IACJ,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Example script to demonstrate usage of the DuckDBService.
|
|
3
|
-
* Creates a sample database, table, inserts data, queries it, and logs results.
|
|
4
|
-
* Database files will be stored in the './duckdata/' directory.
|
|
5
|
-
* @module storage/duckdbExample
|
|
6
|
-
*/
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=duckdbExample.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"duckdbExample.d.ts","sourceRoot":"","sources":["../../src/storage/duckdbExample.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|