s3db.js 13.6.0 → 14.0.2

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 (193) hide show
  1. package/README.md +139 -43
  2. package/dist/s3db.cjs +72425 -38970
  3. package/dist/s3db.cjs.map +1 -1
  4. package/dist/s3db.es.js +72177 -38764
  5. package/dist/s3db.es.js.map +1 -1
  6. package/mcp/lib/base-handler.js +157 -0
  7. package/mcp/lib/handlers/connection-handler.js +280 -0
  8. package/mcp/lib/handlers/query-handler.js +533 -0
  9. package/mcp/lib/handlers/resource-handler.js +428 -0
  10. package/mcp/lib/tool-registry.js +336 -0
  11. package/mcp/lib/tools/connection-tools.js +161 -0
  12. package/mcp/lib/tools/query-tools.js +267 -0
  13. package/mcp/lib/tools/resource-tools.js +404 -0
  14. package/package.json +94 -49
  15. package/src/clients/memory-client.class.js +346 -191
  16. package/src/clients/memory-storage.class.js +300 -84
  17. package/src/clients/s3-client.class.js +7 -6
  18. package/src/concerns/geo-encoding.js +19 -2
  19. package/src/concerns/ip.js +59 -9
  20. package/src/concerns/money.js +8 -1
  21. package/src/concerns/password-hashing.js +49 -8
  22. package/src/concerns/plugin-storage.js +186 -18
  23. package/src/concerns/storage-drivers/filesystem-driver.js +284 -0
  24. package/src/database.class.js +139 -29
  25. package/src/errors.js +332 -42
  26. package/src/plugins/api/auth/oidc-auth.js +66 -17
  27. package/src/plugins/api/auth/strategies/base-strategy.class.js +74 -0
  28. package/src/plugins/api/auth/strategies/factory.class.js +63 -0
  29. package/src/plugins/api/auth/strategies/global-strategy.class.js +44 -0
  30. package/src/plugins/api/auth/strategies/path-based-strategy.class.js +83 -0
  31. package/src/plugins/api/auth/strategies/path-rules-strategy.class.js +118 -0
  32. package/src/plugins/api/concerns/failban-manager.js +106 -57
  33. package/src/plugins/api/concerns/opengraph-helper.js +116 -0
  34. package/src/plugins/api/concerns/route-context.js +601 -0
  35. package/src/plugins/api/concerns/state-machine.js +288 -0
  36. package/src/plugins/api/index.js +180 -41
  37. package/src/plugins/api/routes/auth-routes.js +198 -30
  38. package/src/plugins/api/routes/resource-routes.js +19 -4
  39. package/src/plugins/api/server/health-manager.class.js +163 -0
  40. package/src/plugins/api/server/middleware-chain.class.js +310 -0
  41. package/src/plugins/api/server/router.class.js +472 -0
  42. package/src/plugins/api/server.js +280 -1303
  43. package/src/plugins/api/utils/custom-routes.js +17 -5
  44. package/src/plugins/api/utils/guards.js +76 -17
  45. package/src/plugins/api/utils/openapi-generator-cached.class.js +133 -0
  46. package/src/plugins/api/utils/openapi-generator.js +7 -6
  47. package/src/plugins/api/utils/template-engine.js +77 -3
  48. package/src/plugins/audit.plugin.js +30 -8
  49. package/src/plugins/backup.plugin.js +110 -14
  50. package/src/plugins/cache/cache.class.js +22 -5
  51. package/src/plugins/cache/filesystem-cache.class.js +116 -19
  52. package/src/plugins/cache/memory-cache.class.js +211 -57
  53. package/src/plugins/cache/multi-tier-cache.class.js +371 -0
  54. package/src/plugins/cache/partition-aware-filesystem-cache.class.js +168 -47
  55. package/src/plugins/cache/redis-cache.class.js +552 -0
  56. package/src/plugins/cache/s3-cache.class.js +17 -8
  57. package/src/plugins/cache.plugin.js +176 -61
  58. package/src/plugins/cloud-inventory/drivers/alibaba-driver.js +8 -1
  59. package/src/plugins/cloud-inventory/drivers/aws-driver.js +60 -29
  60. package/src/plugins/cloud-inventory/drivers/azure-driver.js +8 -1
  61. package/src/plugins/cloud-inventory/drivers/base-driver.js +16 -2
  62. package/src/plugins/cloud-inventory/drivers/cloudflare-driver.js +8 -1
  63. package/src/plugins/cloud-inventory/drivers/digitalocean-driver.js +8 -1
  64. package/src/plugins/cloud-inventory/drivers/hetzner-driver.js +8 -1
  65. package/src/plugins/cloud-inventory/drivers/linode-driver.js +8 -1
  66. package/src/plugins/cloud-inventory/drivers/mongodb-atlas-driver.js +8 -1
  67. package/src/plugins/cloud-inventory/drivers/vultr-driver.js +8 -1
  68. package/src/plugins/cloud-inventory/index.js +29 -8
  69. package/src/plugins/cloud-inventory/registry.js +64 -42
  70. package/src/plugins/cloud-inventory.plugin.js +240 -138
  71. package/src/plugins/concerns/plugin-dependencies.js +54 -0
  72. package/src/plugins/concerns/resource-names.js +100 -0
  73. package/src/plugins/consumers/index.js +10 -2
  74. package/src/plugins/consumers/sqs-consumer.js +12 -2
  75. package/src/plugins/cookie-farm-suite.plugin.js +278 -0
  76. package/src/plugins/cookie-farm.errors.js +73 -0
  77. package/src/plugins/cookie-farm.plugin.js +869 -0
  78. package/src/plugins/costs.plugin.js +7 -1
  79. package/src/plugins/eventual-consistency/analytics.js +94 -19
  80. package/src/plugins/eventual-consistency/config.js +15 -7
  81. package/src/plugins/eventual-consistency/consolidation.js +29 -11
  82. package/src/plugins/eventual-consistency/garbage-collection.js +3 -1
  83. package/src/plugins/eventual-consistency/helpers.js +39 -14
  84. package/src/plugins/eventual-consistency/install.js +21 -2
  85. package/src/plugins/eventual-consistency/utils.js +32 -10
  86. package/src/plugins/fulltext.plugin.js +38 -11
  87. package/src/plugins/geo.plugin.js +61 -9
  88. package/src/plugins/identity/concerns/config.js +61 -0
  89. package/src/plugins/identity/concerns/mfa-manager.js +15 -2
  90. package/src/plugins/identity/concerns/rate-limit.js +124 -0
  91. package/src/plugins/identity/concerns/resource-schemas.js +9 -1
  92. package/src/plugins/identity/concerns/token-generator.js +29 -4
  93. package/src/plugins/identity/drivers/auth-driver.interface.js +76 -0
  94. package/src/plugins/identity/drivers/client-credentials-driver.js +127 -0
  95. package/src/plugins/identity/drivers/index.js +18 -0
  96. package/src/plugins/identity/drivers/password-driver.js +122 -0
  97. package/src/plugins/identity/email-service.js +17 -2
  98. package/src/plugins/identity/index.js +413 -69
  99. package/src/plugins/identity/oauth2-server.js +413 -30
  100. package/src/plugins/identity/oidc-discovery.js +16 -8
  101. package/src/plugins/identity/rsa-keys.js +115 -35
  102. package/src/plugins/identity/server.js +166 -45
  103. package/src/plugins/identity/session-manager.js +53 -7
  104. package/src/plugins/identity/ui/pages/mfa-verification.js +17 -15
  105. package/src/plugins/identity/ui/routes.js +363 -255
  106. package/src/plugins/importer/index.js +153 -20
  107. package/src/plugins/index.js +9 -2
  108. package/src/plugins/kubernetes-inventory/index.js +6 -0
  109. package/src/plugins/kubernetes-inventory/k8s-driver.js +867 -0
  110. package/src/plugins/kubernetes-inventory/resource-types.js +274 -0
  111. package/src/plugins/kubernetes-inventory.plugin.js +980 -0
  112. package/src/plugins/metrics.plugin.js +64 -16
  113. package/src/plugins/ml/base-model.class.js +25 -15
  114. package/src/plugins/ml/regression-model.class.js +1 -1
  115. package/src/plugins/ml.errors.js +57 -25
  116. package/src/plugins/ml.plugin.js +28 -4
  117. package/src/plugins/namespace.js +210 -0
  118. package/src/plugins/plugin.class.js +180 -8
  119. package/src/plugins/puppeteer/console-monitor.js +729 -0
  120. package/src/plugins/puppeteer/cookie-manager.js +492 -0
  121. package/src/plugins/puppeteer/network-monitor.js +816 -0
  122. package/src/plugins/puppeteer/performance-manager.js +746 -0
  123. package/src/plugins/puppeteer/proxy-manager.js +478 -0
  124. package/src/plugins/puppeteer/stealth-manager.js +556 -0
  125. package/src/plugins/puppeteer.errors.js +81 -0
  126. package/src/plugins/puppeteer.plugin.js +1327 -0
  127. package/src/plugins/queue-consumer.plugin.js +69 -14
  128. package/src/plugins/recon/behaviors/uptime-behavior.js +691 -0
  129. package/src/plugins/recon/concerns/command-runner.js +148 -0
  130. package/src/plugins/recon/concerns/diff-detector.js +372 -0
  131. package/src/plugins/recon/concerns/fingerprint-builder.js +307 -0
  132. package/src/plugins/recon/concerns/process-manager.js +338 -0
  133. package/src/plugins/recon/concerns/report-generator.js +478 -0
  134. package/src/plugins/recon/concerns/security-analyzer.js +571 -0
  135. package/src/plugins/recon/concerns/target-normalizer.js +68 -0
  136. package/src/plugins/recon/config/defaults.js +321 -0
  137. package/src/plugins/recon/config/resources.js +370 -0
  138. package/src/plugins/recon/index.js +778 -0
  139. package/src/plugins/recon/managers/dependency-manager.js +174 -0
  140. package/src/plugins/recon/managers/scheduler-manager.js +179 -0
  141. package/src/plugins/recon/managers/storage-manager.js +745 -0
  142. package/src/plugins/recon/managers/target-manager.js +274 -0
  143. package/src/plugins/recon/stages/asn-stage.js +314 -0
  144. package/src/plugins/recon/stages/certificate-stage.js +84 -0
  145. package/src/plugins/recon/stages/dns-stage.js +107 -0
  146. package/src/plugins/recon/stages/dnsdumpster-stage.js +362 -0
  147. package/src/plugins/recon/stages/fingerprint-stage.js +71 -0
  148. package/src/plugins/recon/stages/google-dorks-stage.js +440 -0
  149. package/src/plugins/recon/stages/http-stage.js +89 -0
  150. package/src/plugins/recon/stages/latency-stage.js +148 -0
  151. package/src/plugins/recon/stages/massdns-stage.js +302 -0
  152. package/src/plugins/recon/stages/osint-stage.js +1373 -0
  153. package/src/plugins/recon/stages/ports-stage.js +169 -0
  154. package/src/plugins/recon/stages/screenshot-stage.js +94 -0
  155. package/src/plugins/recon/stages/secrets-stage.js +514 -0
  156. package/src/plugins/recon/stages/subdomains-stage.js +295 -0
  157. package/src/plugins/recon/stages/tls-audit-stage.js +78 -0
  158. package/src/plugins/recon/stages/vulnerability-stage.js +78 -0
  159. package/src/plugins/recon/stages/web-discovery-stage.js +113 -0
  160. package/src/plugins/recon/stages/whois-stage.js +349 -0
  161. package/src/plugins/recon.plugin.js +75 -0
  162. package/src/plugins/recon.plugin.js.backup +2635 -0
  163. package/src/plugins/relation.errors.js +87 -14
  164. package/src/plugins/replicator.plugin.js +514 -137
  165. package/src/plugins/replicators/base-replicator.class.js +89 -1
  166. package/src/plugins/replicators/bigquery-replicator.class.js +66 -22
  167. package/src/plugins/replicators/dynamodb-replicator.class.js +22 -15
  168. package/src/plugins/replicators/mongodb-replicator.class.js +22 -15
  169. package/src/plugins/replicators/mysql-replicator.class.js +52 -17
  170. package/src/plugins/replicators/planetscale-replicator.class.js +30 -4
  171. package/src/plugins/replicators/postgres-replicator.class.js +62 -27
  172. package/src/plugins/replicators/s3db-replicator.class.js +25 -18
  173. package/src/plugins/replicators/schema-sync.helper.js +3 -3
  174. package/src/plugins/replicators/sqs-replicator.class.js +8 -2
  175. package/src/plugins/replicators/turso-replicator.class.js +23 -3
  176. package/src/plugins/replicators/webhook-replicator.class.js +42 -4
  177. package/src/plugins/s3-queue.plugin.js +464 -65
  178. package/src/plugins/scheduler.plugin.js +20 -6
  179. package/src/plugins/state-machine.plugin.js +40 -9
  180. package/src/plugins/tfstate/README.md +126 -126
  181. package/src/plugins/tfstate/base-driver.js +28 -4
  182. package/src/plugins/tfstate/errors.js +65 -10
  183. package/src/plugins/tfstate/filesystem-driver.js +52 -8
  184. package/src/plugins/tfstate/index.js +163 -90
  185. package/src/plugins/tfstate/s3-driver.js +64 -6
  186. package/src/plugins/ttl.plugin.js +72 -17
  187. package/src/plugins/vector/distances.js +18 -12
  188. package/src/plugins/vector/kmeans.js +26 -4
  189. package/src/resource.class.js +115 -19
  190. package/src/testing/factory.class.js +20 -3
  191. package/src/testing/seeder.class.js +7 -1
  192. package/src/clients/memory-client.md +0 -917
  193. package/src/plugins/cloud-inventory/drivers/mock-drivers.js +0 -449
@@ -0,0 +1,336 @@
1
+ /**
2
+ * Tool Registry for MCP Server
3
+ * Manages tool definitions and routing
4
+ */
5
+ export class ToolRegistry {
6
+ constructor() {
7
+ this.tools = new Map();
8
+ this.handlers = new Map();
9
+ this.middleware = [];
10
+ }
11
+
12
+ /**
13
+ * Register a tool with its definition and handler
14
+ */
15
+ registerTool(name, definition, handler) {
16
+ this.tools.set(name, {
17
+ name,
18
+ description: definition.description,
19
+ inputSchema: definition.inputSchema,
20
+ handler
21
+ });
22
+ }
23
+
24
+ /**
25
+ * Register multiple tools from a handler class
26
+ */
27
+ registerHandler(handlerInstance, prefix = '') {
28
+ const tools = handlerInstance.constructor.tools || [];
29
+
30
+ for (const tool of tools) {
31
+ const fullName = prefix ? `${prefix}${tool.name}` : tool.name;
32
+ this.registerTool(fullName, tool, async (args) => {
33
+ return handlerInstance[tool.method](args);
34
+ });
35
+ }
36
+
37
+ this.handlers.set(handlerInstance.constructor.name, handlerInstance);
38
+ }
39
+
40
+ /**
41
+ * Register tools from definitions object
42
+ */
43
+ registerTools(definitions) {
44
+ for (const [category, tools] of Object.entries(definitions)) {
45
+ for (const tool of tools) {
46
+ this.registerTool(tool.name, tool, tool.handler);
47
+ }
48
+ }
49
+ }
50
+
51
+ /**
52
+ * Add middleware for tool execution
53
+ */
54
+ use(middleware) {
55
+ this.middleware.push(middleware);
56
+ }
57
+
58
+ /**
59
+ * Get all registered tools for listing
60
+ */
61
+ listTools() {
62
+ const tools = [];
63
+
64
+ for (const [name, tool] of this.tools) {
65
+ tools.push({
66
+ name: tool.name,
67
+ description: tool.description,
68
+ inputSchema: tool.inputSchema
69
+ });
70
+ }
71
+
72
+ return tools.sort((a, b) => a.name.localeCompare(b.name));
73
+ }
74
+
75
+ /**
76
+ * Execute a tool with middleware
77
+ */
78
+ async executeTool(name, args) {
79
+ const tool = this.tools.get(name);
80
+
81
+ if (!tool) {
82
+ throw new Error(`Tool '${name}' not found`);
83
+ }
84
+
85
+ // Build middleware chain
86
+ const chain = [...this.middleware];
87
+ let index = 0;
88
+
89
+ const next = async () => {
90
+ if (index >= chain.length) {
91
+ return tool.handler(args);
92
+ }
93
+
94
+ const middleware = chain[index++];
95
+ return middleware(args, next, { toolName: name, tool });
96
+ };
97
+
98
+ return next();
99
+ }
100
+
101
+ /**
102
+ * Get handler instance by name
103
+ */
104
+ getHandler(name) {
105
+ return this.handlers.get(name);
106
+ }
107
+
108
+ /**
109
+ * Group tools by category
110
+ */
111
+ getToolsByCategory() {
112
+ const categories = {
113
+ connection: [],
114
+ resource: [],
115
+ query: [],
116
+ batch: [],
117
+ stream: [],
118
+ schema: [],
119
+ introspection: [],
120
+ export: [],
121
+ performance: [],
122
+ monitoring: [],
123
+ advanced: []
124
+ };
125
+
126
+ for (const [name, tool] of this.tools) {
127
+ const category = this.categorize(name);
128
+ if (categories[category]) {
129
+ categories[category].push({
130
+ name: tool.name,
131
+ description: tool.description
132
+ });
133
+ }
134
+ }
135
+
136
+ return categories;
137
+ }
138
+
139
+ /**
140
+ * Categorize tool by name
141
+ */
142
+ private categorize(toolName) {
143
+ const prefixes = {
144
+ db: 'connection',
145
+ resource: 'resource',
146
+ query: 'query',
147
+ batch: 'batch',
148
+ stream: 'stream',
149
+ schema: 'schema',
150
+ export: 'export',
151
+ import: 'export',
152
+ analyze: 'introspection',
153
+ inspect: 'introspection',
154
+ validate: 'introspection',
155
+ optimize: 'performance',
156
+ index: 'performance',
157
+ metrics: 'monitoring',
158
+ alert: 'monitoring',
159
+ backup: 'advanced',
160
+ restore: 'advanced',
161
+ hook: 'advanced',
162
+ plugin: 'advanced'
163
+ };
164
+
165
+ for (const [prefix, category] of Object.entries(prefixes)) {
166
+ if (toolName.toLowerCase().startsWith(prefix)) {
167
+ return category;
168
+ }
169
+ }
170
+
171
+ return 'resource';
172
+ }
173
+
174
+ /**
175
+ * Validate tool arguments
176
+ */
177
+ validateArgs(toolName, args) {
178
+ const tool = this.tools.get(toolName);
179
+ if (!tool) return { valid: false, error: 'Tool not found' };
180
+
181
+ const schema = tool.inputSchema;
182
+ if (!schema) return { valid: true };
183
+
184
+ // Validate required properties
185
+ if (schema.required) {
186
+ for (const prop of schema.required) {
187
+ if (args[prop] === undefined) {
188
+ return {
189
+ valid: false,
190
+ error: `Missing required parameter: ${prop}`
191
+ };
192
+ }
193
+ }
194
+ }
195
+
196
+ // Validate property types
197
+ if (schema.properties) {
198
+ for (const [prop, propSchema] of Object.entries(schema.properties)) {
199
+ if (args[prop] !== undefined) {
200
+ const validation = this.validateProperty(args[prop], propSchema);
201
+ if (!validation.valid) {
202
+ return {
203
+ valid: false,
204
+ error: `Invalid ${prop}: ${validation.error}`
205
+ };
206
+ }
207
+ }
208
+ }
209
+ }
210
+
211
+ return { valid: true };
212
+ }
213
+
214
+ /**
215
+ * Validate a single property
216
+ */
217
+ private validateProperty(value, schema) {
218
+ // Type validation
219
+ if (schema.type) {
220
+ const actualType = Array.isArray(value) ? 'array' : typeof value;
221
+ if (schema.type !== actualType) {
222
+ return {
223
+ valid: false,
224
+ error: `Expected ${schema.type}, got ${actualType}`
225
+ };
226
+ }
227
+ }
228
+
229
+ // Enum validation
230
+ if (schema.enum && !schema.enum.includes(value)) {
231
+ return {
232
+ valid: false,
233
+ error: `Must be one of: ${schema.enum.join(', ')}`
234
+ };
235
+ }
236
+
237
+ // String pattern validation
238
+ if (schema.pattern && typeof value === 'string') {
239
+ const regex = new RegExp(schema.pattern);
240
+ if (!regex.test(value)) {
241
+ return {
242
+ valid: false,
243
+ error: `Does not match pattern: ${schema.pattern}`
244
+ };
245
+ }
246
+ }
247
+
248
+ // Number range validation
249
+ if (typeof value === 'number') {
250
+ if (schema.minimum !== undefined && value < schema.minimum) {
251
+ return {
252
+ valid: false,
253
+ error: `Must be >= ${schema.minimum}`
254
+ };
255
+ }
256
+ if (schema.maximum !== undefined && value > schema.maximum) {
257
+ return {
258
+ valid: false,
259
+ error: `Must be <= ${schema.maximum}`
260
+ };
261
+ }
262
+ }
263
+
264
+ // Array length validation
265
+ if (Array.isArray(value)) {
266
+ if (schema.minItems !== undefined && value.length < schema.minItems) {
267
+ return {
268
+ valid: false,
269
+ error: `Must have at least ${schema.minItems} items`
270
+ };
271
+ }
272
+ if (schema.maxItems !== undefined && value.length > schema.maxItems) {
273
+ return {
274
+ valid: false,
275
+ error: `Must have at most ${schema.maxItems} items`
276
+ };
277
+ }
278
+ }
279
+
280
+ return { valid: true };
281
+ }
282
+
283
+ /**
284
+ * Get tool documentation
285
+ */
286
+ getDocumentation(toolName) {
287
+ const tool = this.tools.get(toolName);
288
+ if (!tool) return null;
289
+
290
+ const schema = tool.inputSchema;
291
+ const params = [];
292
+
293
+ if (schema?.properties) {
294
+ for (const [name, prop] of Object.entries(schema.properties)) {
295
+ params.push({
296
+ name,
297
+ type: prop.type,
298
+ description: prop.description,
299
+ required: schema.required?.includes(name),
300
+ default: prop.default,
301
+ enum: prop.enum
302
+ });
303
+ }
304
+ }
305
+
306
+ return {
307
+ name: tool.name,
308
+ description: tool.description,
309
+ parameters: params,
310
+ examples: tool.examples || []
311
+ };
312
+ }
313
+
314
+ /**
315
+ * Search tools by keyword
316
+ */
317
+ searchTools(keyword) {
318
+ const results = [];
319
+ const query = keyword.toLowerCase();
320
+
321
+ for (const [name, tool] of this.tools) {
322
+ if (
323
+ name.toLowerCase().includes(query) ||
324
+ tool.description.toLowerCase().includes(query)
325
+ ) {
326
+ results.push({
327
+ name: tool.name,
328
+ description: tool.description,
329
+ relevance: name.toLowerCase() === query ? 1 : 0.5
330
+ });
331
+ }
332
+ }
333
+
334
+ return results.sort((a, b) => b.relevance - a.relevance);
335
+ }
336
+ }
@@ -0,0 +1,161 @@
1
+ /**
2
+ * Connection tool definitions
3
+ */
4
+ export const connectionTools = [
5
+ {
6
+ name: 'dbConnect',
7
+ method: 'connect',
8
+ description: 'Connect to S3DB database with advanced configuration',
9
+ inputSchema: {
10
+ type: 'object',
11
+ properties: {
12
+ connectionString: {
13
+ type: 'string',
14
+ description: 'S3DB connection string (s3://key:secret@bucket/path)',
15
+ pattern: '^(s3|https?)://'
16
+ },
17
+ verbose: {
18
+ type: 'boolean',
19
+ description: 'Enable verbose logging',
20
+ default: false
21
+ },
22
+ parallelism: {
23
+ type: 'number',
24
+ description: 'Number of parallel operations',
25
+ default: 10,
26
+ minimum: 1,
27
+ maximum: 100
28
+ },
29
+ passphrase: {
30
+ type: 'string',
31
+ description: 'Encryption passphrase',
32
+ default: 'secret'
33
+ },
34
+ versioningEnabled: {
35
+ type: 'boolean',
36
+ description: 'Enable resource versioning',
37
+ default: false
38
+ },
39
+ persistHooks: {
40
+ type: 'boolean',
41
+ description: 'Persist hooks in S3',
42
+ default: false
43
+ },
44
+ enableCache: {
45
+ type: 'boolean',
46
+ description: 'Enable caching',
47
+ default: true
48
+ },
49
+ enableCosts: {
50
+ type: 'boolean',
51
+ description: 'Track AWS costs',
52
+ default: true
53
+ },
54
+ enableMetrics: {
55
+ type: 'boolean',
56
+ description: 'Enable metrics collection',
57
+ default: false
58
+ },
59
+ cacheDriver: {
60
+ type: 'string',
61
+ enum: ['memory', 'filesystem', 's3'],
62
+ description: 'Cache storage driver',
63
+ default: 'memory'
64
+ },
65
+ cacheMaxSize: {
66
+ type: 'number',
67
+ description: 'Max cache entries (memory driver)',
68
+ default: 1000,
69
+ minimum: 1
70
+ },
71
+ cacheTtl: {
72
+ type: 'number',
73
+ description: 'Cache TTL in milliseconds',
74
+ default: 300000,
75
+ minimum: 0
76
+ },
77
+ cacheDirectory: {
78
+ type: 'string',
79
+ description: 'Directory for filesystem cache',
80
+ default: './cache'
81
+ },
82
+ cachePrefix: {
83
+ type: 'string',
84
+ description: 'Cache file prefix',
85
+ default: 'cache'
86
+ },
87
+ cacheCompress: {
88
+ type: 'boolean',
89
+ description: 'Compress cached data',
90
+ default: true
91
+ }
92
+ },
93
+ required: ['connectionString']
94
+ },
95
+ examples: [
96
+ {
97
+ description: 'Connect to AWS S3',
98
+ args: {
99
+ connectionString: 's3://AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI@my-bucket/databases/prod'
100
+ }
101
+ },
102
+ {
103
+ description: 'Connect to MinIO with filesystem cache',
104
+ args: {
105
+ connectionString: 'http://minioadmin:minioadmin@localhost:9000/test-bucket',
106
+ cacheDriver: 'filesystem',
107
+ cacheDirectory: './s3db-cache'
108
+ }
109
+ }
110
+ ]
111
+ },
112
+
113
+ {
114
+ name: 'dbDisconnect',
115
+ method: 'disconnect',
116
+ description: 'Disconnect from S3DB database',
117
+ inputSchema: {
118
+ type: 'object',
119
+ properties: {},
120
+ required: []
121
+ }
122
+ },
123
+
124
+ {
125
+ name: 'dbStatus',
126
+ method: 'status',
127
+ description: 'Get database connection status',
128
+ inputSchema: {
129
+ type: 'object',
130
+ properties: {},
131
+ required: []
132
+ }
133
+ },
134
+
135
+ {
136
+ name: 'dbGetStats',
137
+ method: 'getStats',
138
+ description: 'Get detailed database statistics',
139
+ inputSchema: {
140
+ type: 'object',
141
+ properties: {},
142
+ required: []
143
+ }
144
+ },
145
+
146
+ {
147
+ name: 'dbClearCache',
148
+ method: 'clearCache',
149
+ description: 'Clear cache for all or specific resource',
150
+ inputSchema: {
151
+ type: 'object',
152
+ properties: {
153
+ resourceName: {
154
+ type: 'string',
155
+ description: 'Resource to clear cache for (optional)'
156
+ }
157
+ },
158
+ required: []
159
+ }
160
+ }
161
+ ];