@dexto/core 1.5.0 → 1.5.1
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/dist/agent/schemas.d.ts +48 -0
- package/dist/agent/schemas.d.ts.map +1 -1
- package/dist/events/index.cjs +4 -1
- package/dist/events/index.d.ts +20 -4
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +3 -1
- package/dist/llm/executor/provider-options.cjs +87 -0
- package/dist/llm/executor/provider-options.d.ts +49 -0
- package/dist/llm/executor/provider-options.d.ts.map +1 -0
- package/dist/llm/executor/provider-options.js +63 -0
- package/dist/llm/executor/stream-processor.cjs +11 -8
- package/dist/llm/executor/stream-processor.d.ts.map +1 -1
- package/dist/llm/executor/stream-processor.js +11 -8
- package/dist/llm/executor/turn-executor.cjs +10 -0
- package/dist/llm/executor/turn-executor.d.ts +1 -0
- package/dist/llm/executor/turn-executor.d.ts.map +1 -1
- package/dist/llm/executor/turn-executor.js +10 -0
- package/dist/llm/formatters/vercel.cjs +9 -1
- package/dist/llm/formatters/vercel.d.ts.map +1 -1
- package/dist/llm/formatters/vercel.js +9 -1
- package/dist/llm/registry.cjs +69 -0
- package/dist/llm/registry.d.ts +9 -0
- package/dist/llm/registry.d.ts.map +1 -1
- package/dist/llm/registry.js +68 -0
- package/dist/llm/schemas.cjs +17 -1
- package/dist/llm/schemas.d.ts +23 -0
- package/dist/llm/schemas.d.ts.map +1 -1
- package/dist/llm/schemas.js +17 -1
- package/dist/llm/services/vercel.cjs +3 -1
- package/dist/llm/services/vercel.d.ts.map +1 -1
- package/dist/llm/services/vercel.js +3 -1
- package/dist/logger/logger.cjs +7 -3
- package/dist/logger/logger.d.ts.map +1 -1
- package/dist/logger/logger.js +7 -3
- package/dist/memory/schemas.d.ts +2 -2
- package/dist/providers/discovery.cjs +14 -0
- package/dist/providers/discovery.d.ts +4 -2
- package/dist/providers/discovery.d.ts.map +1 -1
- package/dist/providers/discovery.js +14 -0
- package/dist/session/history/database.cjs +49 -15
- package/dist/session/history/database.d.ts.map +1 -1
- package/dist/session/history/database.js +49 -15
- package/dist/session/session-manager.cjs +2 -1
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +2 -1
- package/dist/storage/database/postgres-store.cjs +174 -78
- package/dist/storage/database/postgres-store.d.ts +19 -0
- package/dist/storage/database/postgres-store.d.ts.map +1 -1
- package/dist/storage/database/postgres-store.js +174 -78
- package/dist/storage/database/schemas.cjs +4 -1
- package/dist/storage/database/schemas.d.ts +8 -0
- package/dist/storage/database/schemas.d.ts.map +1 -1
- package/dist/storage/database/schemas.js +4 -1
- package/dist/storage/schemas.d.ts +7 -0
- package/dist/storage/schemas.d.ts.map +1 -1
- package/dist/tools/custom-tool-registry.d.ts +9 -3
- package/dist/tools/custom-tool-registry.d.ts.map +1 -1
- package/dist/tools/internal-tools/provider.cjs +5 -2
- package/dist/tools/internal-tools/provider.d.ts.map +1 -1
- package/dist/tools/internal-tools/provider.js +5 -2
- package/package.json +1 -1
|
@@ -12,20 +12,89 @@ class PostgresStore {
|
|
|
12
12
|
logger;
|
|
13
13
|
async connect() {
|
|
14
14
|
if (this.connected) return;
|
|
15
|
+
const connectionString = this.config.connectionString || this.config.url;
|
|
16
|
+
if (connectionString?.startsWith("$")) {
|
|
17
|
+
throw StorageError.connectionFailed(
|
|
18
|
+
`PostgreSQL: Connection string contains unexpanded environment variable: ${connectionString}. Ensure the environment variable is set in your .env file.`
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
if (!connectionString) {
|
|
22
|
+
throw StorageError.connectionFailed(
|
|
23
|
+
"PostgreSQL: No connection string provided. Set url or connectionString in database config."
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
const { schema, ...pgOptions } = this.config.options || {};
|
|
27
|
+
this.logger.info("Connecting to PostgreSQL database...");
|
|
15
28
|
this.pool = new Pool({
|
|
16
|
-
connectionString
|
|
29
|
+
connectionString,
|
|
17
30
|
max: this.config.maxConnections || 20,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
31
|
+
// Shorter idle timeout for serverless DBs (Neon) - connections go stale quickly
|
|
32
|
+
idleTimeoutMillis: this.config.idleTimeoutMillis || 1e4,
|
|
33
|
+
connectionTimeoutMillis: this.config.connectionTimeoutMillis || 1e4,
|
|
34
|
+
// Enable TCP keepalive to detect dead connections
|
|
35
|
+
keepAlive: true,
|
|
36
|
+
keepAliveInitialDelayMillis: 1e4,
|
|
37
|
+
...pgOptions
|
|
21
38
|
});
|
|
22
|
-
|
|
39
|
+
this.pool.on("error", (err) => {
|
|
40
|
+
this.logger.warn(`PostgreSQL pool error (will retry on next query): ${err.message}`);
|
|
41
|
+
});
|
|
42
|
+
if (schema) {
|
|
43
|
+
if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(schema)) {
|
|
44
|
+
throw StorageError.connectionFailed(
|
|
45
|
+
`PostgreSQL: Invalid schema name "${schema}". Schema names must start with a letter or underscore and contain only alphanumeric characters and underscores.`
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
this.pool.on("connect", async (client2) => {
|
|
49
|
+
try {
|
|
50
|
+
await client2.query(`SET search_path TO "${schema}", public`);
|
|
51
|
+
} catch (err) {
|
|
52
|
+
this.logger.error(`Failed to set search_path to "${schema}": ${err}`);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
this.logger.info(`Using custom schema: "${schema}"`);
|
|
56
|
+
}
|
|
57
|
+
let client;
|
|
23
58
|
try {
|
|
59
|
+
client = await this.pool.connect();
|
|
24
60
|
await client.query("SELECT NOW()");
|
|
61
|
+
if (schema) {
|
|
62
|
+
await this.createSchema(client, schema);
|
|
63
|
+
}
|
|
25
64
|
await this.createTables(client);
|
|
26
65
|
this.connected = true;
|
|
66
|
+
this.logger.info("PostgreSQL database connected successfully");
|
|
67
|
+
} catch (error) {
|
|
68
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
69
|
+
this.logger.error(`PostgreSQL connection failed: ${errorMessage}`);
|
|
70
|
+
if (this.pool) {
|
|
71
|
+
await this.pool.end().catch(() => {
|
|
72
|
+
});
|
|
73
|
+
this.pool = null;
|
|
74
|
+
}
|
|
75
|
+
throw StorageError.connectionFailed(`PostgreSQL: ${errorMessage}`);
|
|
27
76
|
} finally {
|
|
28
|
-
client
|
|
77
|
+
if (client) {
|
|
78
|
+
client.release();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Creates a PostgreSQL schema if it doesn't exist.
|
|
84
|
+
*/
|
|
85
|
+
async createSchema(client, schemaName) {
|
|
86
|
+
if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(schemaName)) {
|
|
87
|
+
throw StorageError.connectionFailed(
|
|
88
|
+
`PostgreSQL: Invalid schema name "${schemaName}". Schema names must start with a letter or underscore and contain only alphanumeric characters and underscores.`
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
await client.query(`CREATE SCHEMA IF NOT EXISTS "${schemaName}"`);
|
|
93
|
+
this.logger.debug(`Schema "${schemaName}" ready`);
|
|
94
|
+
} catch (error) {
|
|
95
|
+
this.logger.warn(
|
|
96
|
+
`Could not create schema "${schemaName}": ${error}. Assuming it exists.`
|
|
97
|
+
);
|
|
29
98
|
}
|
|
30
99
|
}
|
|
31
100
|
async disconnect() {
|
|
@@ -41,61 +110,54 @@ class PostgresStore {
|
|
|
41
110
|
getStoreType() {
|
|
42
111
|
return "postgres";
|
|
43
112
|
}
|
|
44
|
-
// Core operations
|
|
113
|
+
// Core operations - all use withRetry for serverless DB resilience
|
|
45
114
|
async get(key) {
|
|
46
|
-
this.checkConnection();
|
|
47
|
-
const client = await this.pool.connect();
|
|
48
115
|
try {
|
|
49
|
-
|
|
50
|
-
|
|
116
|
+
return await this.withRetry("get", async (client) => {
|
|
117
|
+
const result = await client.query("SELECT value FROM kv WHERE key = $1", [key]);
|
|
118
|
+
return result.rows[0] ? result.rows[0].value : void 0;
|
|
119
|
+
});
|
|
51
120
|
} catch (error) {
|
|
52
121
|
throw StorageError.readFailed(
|
|
53
122
|
"get",
|
|
54
123
|
error instanceof Error ? error.message : String(error),
|
|
55
124
|
{ key }
|
|
56
125
|
);
|
|
57
|
-
} finally {
|
|
58
|
-
client.release();
|
|
59
126
|
}
|
|
60
127
|
}
|
|
61
128
|
async set(key, value) {
|
|
62
|
-
this.checkConnection();
|
|
63
|
-
const client = await this.pool.connect();
|
|
64
129
|
try {
|
|
65
|
-
await
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
130
|
+
await this.withRetry("set", async (client) => {
|
|
131
|
+
const jsonValue = JSON.stringify(value);
|
|
132
|
+
await client.query(
|
|
133
|
+
"INSERT INTO kv (key, value, updated_at) VALUES ($1, $2::jsonb, $3) ON CONFLICT (key) DO UPDATE SET value = $2::jsonb, updated_at = $3",
|
|
134
|
+
[key, jsonValue, /* @__PURE__ */ new Date()]
|
|
135
|
+
);
|
|
136
|
+
});
|
|
69
137
|
} catch (error) {
|
|
70
138
|
throw StorageError.writeFailed(
|
|
71
139
|
"set",
|
|
72
140
|
error instanceof Error ? error.message : String(error),
|
|
73
141
|
{ key }
|
|
74
142
|
);
|
|
75
|
-
} finally {
|
|
76
|
-
client.release();
|
|
77
143
|
}
|
|
78
144
|
}
|
|
79
145
|
async delete(key) {
|
|
80
|
-
this.
|
|
81
|
-
const client = await this.pool.connect();
|
|
82
|
-
try {
|
|
146
|
+
await this.withRetry("delete", async (client) => {
|
|
83
147
|
await client.query("BEGIN");
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
148
|
+
try {
|
|
149
|
+
await client.query("DELETE FROM kv WHERE key = $1", [key]);
|
|
150
|
+
await client.query("DELETE FROM lists WHERE key = $1", [key]);
|
|
151
|
+
await client.query("COMMIT");
|
|
152
|
+
} catch (error) {
|
|
153
|
+
await client.query("ROLLBACK");
|
|
154
|
+
throw error;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
93
157
|
}
|
|
94
158
|
// List operations
|
|
95
159
|
async list(prefix) {
|
|
96
|
-
this.
|
|
97
|
-
const client = await this.pool.connect();
|
|
98
|
-
try {
|
|
160
|
+
return await this.withRetry("list", async (client) => {
|
|
99
161
|
const kvResult = await client.query("SELECT key FROM kv WHERE key LIKE $1", [
|
|
100
162
|
`${prefix}%`
|
|
101
163
|
]);
|
|
@@ -108,41 +170,33 @@ class PostgresStore {
|
|
|
108
170
|
...listResult.rows.map((row) => row.key)
|
|
109
171
|
]);
|
|
110
172
|
return Array.from(allKeys).sort();
|
|
111
|
-
}
|
|
112
|
-
client.release();
|
|
113
|
-
}
|
|
173
|
+
});
|
|
114
174
|
}
|
|
115
175
|
async append(key, item) {
|
|
116
|
-
this.checkConnection();
|
|
117
|
-
const client = await this.pool.connect();
|
|
118
176
|
try {
|
|
119
|
-
await
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
177
|
+
await this.withRetry("append", async (client) => {
|
|
178
|
+
const jsonItem = JSON.stringify(item);
|
|
179
|
+
await client.query(
|
|
180
|
+
"INSERT INTO lists (key, item, created_at) VALUES ($1, $2::jsonb, $3)",
|
|
181
|
+
[key, jsonItem, /* @__PURE__ */ new Date()]
|
|
182
|
+
);
|
|
183
|
+
});
|
|
124
184
|
} catch (error) {
|
|
125
185
|
throw StorageError.writeFailed(
|
|
126
186
|
"append",
|
|
127
187
|
error instanceof Error ? error.message : String(error),
|
|
128
188
|
{ key }
|
|
129
189
|
);
|
|
130
|
-
} finally {
|
|
131
|
-
client.release();
|
|
132
190
|
}
|
|
133
191
|
}
|
|
134
192
|
async getRange(key, start, count) {
|
|
135
|
-
this.
|
|
136
|
-
const client = await this.pool.connect();
|
|
137
|
-
try {
|
|
193
|
+
return await this.withRetry("getRange", async (client) => {
|
|
138
194
|
const result = await client.query(
|
|
139
195
|
"SELECT item FROM lists WHERE key = $1 ORDER BY created_at ASC LIMIT $2 OFFSET $3",
|
|
140
196
|
[key, count, start]
|
|
141
197
|
);
|
|
142
198
|
return result.rows.map((row) => row.item);
|
|
143
|
-
}
|
|
144
|
-
client.release();
|
|
145
|
-
}
|
|
199
|
+
});
|
|
146
200
|
}
|
|
147
201
|
// Schema management
|
|
148
202
|
async createTables(client) {
|
|
@@ -172,26 +226,74 @@ class PostgresStore {
|
|
|
172
226
|
throw StorageError.notConnected("PostgresStore");
|
|
173
227
|
}
|
|
174
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* Check if an error is a connection error that should trigger a retry.
|
|
231
|
+
* Common with serverless databases (Neon) where connections go stale.
|
|
232
|
+
*/
|
|
233
|
+
isConnectionError(error) {
|
|
234
|
+
if (!(error instanceof Error)) return false;
|
|
235
|
+
const code = error.code;
|
|
236
|
+
return code === "ETIMEDOUT" || code === "ECONNRESET" || code === "ECONNREFUSED" || code === "EPIPE" || code === "57P01" || // admin_shutdown
|
|
237
|
+
code === "57P02" || // crash_shutdown
|
|
238
|
+
code === "57P03" || // cannot_connect_now
|
|
239
|
+
error.message.includes("Connection terminated") || error.message.includes("connection lost");
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Execute a database operation with automatic retry on connection errors.
|
|
243
|
+
* Handles serverless DB connection issues (Neon cold starts, stale connections).
|
|
244
|
+
*/
|
|
245
|
+
async withRetry(operation, fn, maxRetries = 2) {
|
|
246
|
+
this.checkConnection();
|
|
247
|
+
let lastError;
|
|
248
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
249
|
+
let client;
|
|
250
|
+
try {
|
|
251
|
+
client = await this.pool.connect();
|
|
252
|
+
const result = await fn(client);
|
|
253
|
+
return result;
|
|
254
|
+
} catch (error) {
|
|
255
|
+
lastError = error instanceof Error ? error : new Error(String(error));
|
|
256
|
+
if (client) {
|
|
257
|
+
client.release(true);
|
|
258
|
+
client = void 0;
|
|
259
|
+
}
|
|
260
|
+
if (this.isConnectionError(error) && attempt < maxRetries) {
|
|
261
|
+
this.logger.warn(
|
|
262
|
+
`PostgreSQL ${operation} failed with connection error (attempt ${attempt + 1}/${maxRetries + 1}): ${lastError.message}. Retrying...`
|
|
263
|
+
);
|
|
264
|
+
await new Promise((resolve) => setTimeout(resolve, 100 * (attempt + 1)));
|
|
265
|
+
continue;
|
|
266
|
+
}
|
|
267
|
+
throw error;
|
|
268
|
+
} finally {
|
|
269
|
+
if (client) {
|
|
270
|
+
client.release();
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
throw lastError;
|
|
275
|
+
}
|
|
175
276
|
// Advanced operations
|
|
277
|
+
/**
|
|
278
|
+
* Execute a callback within a database transaction.
|
|
279
|
+
* Note: On connection failure, the entire callback will be retried on a new connection.
|
|
280
|
+
* Ensure callback operations are idempotent or use this only for read operations.
|
|
281
|
+
*/
|
|
176
282
|
async transaction(callback) {
|
|
177
|
-
this.
|
|
178
|
-
const client = await this.pool.connect();
|
|
179
|
-
try {
|
|
283
|
+
return await this.withRetry("transaction", async (client) => {
|
|
180
284
|
await client.query("BEGIN");
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
285
|
+
try {
|
|
286
|
+
const result = await callback(client);
|
|
287
|
+
await client.query("COMMIT");
|
|
288
|
+
return result;
|
|
289
|
+
} catch (error) {
|
|
290
|
+
await client.query("ROLLBACK");
|
|
291
|
+
throw error;
|
|
292
|
+
}
|
|
293
|
+
});
|
|
190
294
|
}
|
|
191
295
|
async getStats() {
|
|
192
|
-
this.
|
|
193
|
-
const client = await this.pool.connect();
|
|
194
|
-
try {
|
|
296
|
+
return await this.withRetry("getStats", async (client) => {
|
|
195
297
|
const kvResult = await client.query("SELECT COUNT(*) as count FROM kv");
|
|
196
298
|
const listResult = await client.query("SELECT COUNT(*) as count FROM lists");
|
|
197
299
|
const sizeResult = await client.query(
|
|
@@ -203,19 +305,13 @@ class PostgresStore {
|
|
|
203
305
|
listCount: parseInt(listResult.rows[0].count),
|
|
204
306
|
totalSize: sizeResult.rows[0].size
|
|
205
307
|
};
|
|
206
|
-
}
|
|
207
|
-
client.release();
|
|
208
|
-
}
|
|
308
|
+
});
|
|
209
309
|
}
|
|
210
310
|
// Maintenance operations
|
|
211
311
|
async vacuum() {
|
|
212
|
-
this.
|
|
213
|
-
const client = await this.pool.connect();
|
|
214
|
-
try {
|
|
312
|
+
await this.withRetry("vacuum", async (client) => {
|
|
215
313
|
await client.query("VACUUM ANALYZE kv, lists");
|
|
216
|
-
}
|
|
217
|
-
client.release();
|
|
218
|
-
}
|
|
314
|
+
});
|
|
219
315
|
}
|
|
220
316
|
}
|
|
221
317
|
export {
|
|
@@ -53,7 +53,10 @@ const PostgresDatabaseSchema = BaseDatabaseSchema.extend({
|
|
|
53
53
|
host: import_zod.z.string().optional().describe("PostgreSQL host"),
|
|
54
54
|
port: import_zod.z.number().int().positive().optional().describe("PostgreSQL port"),
|
|
55
55
|
database: import_zod.z.string().optional().describe("PostgreSQL database name"),
|
|
56
|
-
password: import_zod.z.string().optional().describe("PostgreSQL password")
|
|
56
|
+
password: import_zod.z.string().optional().describe("PostgreSQL password"),
|
|
57
|
+
// TODO: keyPrefix is reserved for future use - allows namespacing keys when multiple
|
|
58
|
+
// agents or environments share the same database (e.g., "dev:agent1:" vs "prod:agent2:")
|
|
59
|
+
keyPrefix: import_zod.z.string().optional().describe('Optional key prefix for namespacing (e.g., "dev:myagent:")')
|
|
57
60
|
}).strict();
|
|
58
61
|
const DatabaseConfigSchema = import_zod.z.discriminatedUnion(
|
|
59
62
|
"type",
|
|
@@ -59,6 +59,7 @@ export declare const PostgresDatabaseSchema: z.ZodObject<{
|
|
|
59
59
|
port: z.ZodOptional<z.ZodNumber>;
|
|
60
60
|
database: z.ZodOptional<z.ZodString>;
|
|
61
61
|
password: z.ZodOptional<z.ZodString>;
|
|
62
|
+
keyPrefix: z.ZodOptional<z.ZodString>;
|
|
62
63
|
}, "strict", z.ZodTypeAny, {
|
|
63
64
|
type: "postgres";
|
|
64
65
|
password?: string | undefined;
|
|
@@ -71,6 +72,7 @@ export declare const PostgresDatabaseSchema: z.ZodObject<{
|
|
|
71
72
|
port?: number | undefined;
|
|
72
73
|
database?: string | undefined;
|
|
73
74
|
connectionString?: string | undefined;
|
|
75
|
+
keyPrefix?: string | undefined;
|
|
74
76
|
}, {
|
|
75
77
|
type: "postgres";
|
|
76
78
|
password?: string | undefined;
|
|
@@ -83,6 +85,7 @@ export declare const PostgresDatabaseSchema: z.ZodObject<{
|
|
|
83
85
|
port?: number | undefined;
|
|
84
86
|
database?: string | undefined;
|
|
85
87
|
connectionString?: string | undefined;
|
|
88
|
+
keyPrefix?: string | undefined;
|
|
86
89
|
}>;
|
|
87
90
|
export type PostgresDatabaseConfig = z.output<typeof PostgresDatabaseSchema>;
|
|
88
91
|
export declare const DatabaseConfigSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -139,6 +142,7 @@ export declare const DatabaseConfigSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
139
142
|
port: z.ZodOptional<z.ZodNumber>;
|
|
140
143
|
database: z.ZodOptional<z.ZodString>;
|
|
141
144
|
password: z.ZodOptional<z.ZodString>;
|
|
145
|
+
keyPrefix: z.ZodOptional<z.ZodString>;
|
|
142
146
|
}, "strict", z.ZodTypeAny, {
|
|
143
147
|
type: "postgres";
|
|
144
148
|
password?: string | undefined;
|
|
@@ -151,6 +155,7 @@ export declare const DatabaseConfigSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
151
155
|
port?: number | undefined;
|
|
152
156
|
database?: string | undefined;
|
|
153
157
|
connectionString?: string | undefined;
|
|
158
|
+
keyPrefix?: string | undefined;
|
|
154
159
|
}, {
|
|
155
160
|
type: "postgres";
|
|
156
161
|
password?: string | undefined;
|
|
@@ -163,6 +168,7 @@ export declare const DatabaseConfigSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
163
168
|
port?: number | undefined;
|
|
164
169
|
database?: string | undefined;
|
|
165
170
|
connectionString?: string | undefined;
|
|
171
|
+
keyPrefix?: string | undefined;
|
|
166
172
|
}>]>, {
|
|
167
173
|
type: "in-memory";
|
|
168
174
|
options?: Record<string, any> | undefined;
|
|
@@ -188,6 +194,7 @@ export declare const DatabaseConfigSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
188
194
|
port?: number | undefined;
|
|
189
195
|
database?: string | undefined;
|
|
190
196
|
connectionString?: string | undefined;
|
|
197
|
+
keyPrefix?: string | undefined;
|
|
191
198
|
}, {
|
|
192
199
|
type: "in-memory";
|
|
193
200
|
options?: Record<string, any> | undefined;
|
|
@@ -213,6 +220,7 @@ export declare const DatabaseConfigSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
213
220
|
port?: number | undefined;
|
|
214
221
|
database?: string | undefined;
|
|
215
222
|
connectionString?: string | undefined;
|
|
223
|
+
keyPrefix?: string | undefined;
|
|
216
224
|
}>;
|
|
217
225
|
export type DatabaseConfig = z.output<typeof DatabaseConfigSchema>;
|
|
218
226
|
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/storage/database/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,cAAc,8CAA+C,CAAC;AAC3E,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAoB3D,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;EAGxB,CAAC;AAEZ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC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atabaseSchema.extend({
|
|
|
27
27
|
host: z.string().optional().describe("PostgreSQL host"),
|
|
28
28
|
port: z.number().int().positive().optional().describe("PostgreSQL port"),
|
|
29
29
|
database: z.string().optional().describe("PostgreSQL database name"),
|
|
30
|
-
password: z.string().optional().describe("PostgreSQL password")
|
|
30
|
+
password: z.string().optional().describe("PostgreSQL password"),
|
|
31
|
+
// TODO: keyPrefix is reserved for future use - allows namespacing keys when multiple
|
|
32
|
+
// agents or environments share the same database (e.g., "dev:agent1:" vs "prod:agent2:")
|
|
33
|
+
keyPrefix: z.string().optional().describe('Optional key prefix for namespacing (e.g., "dev:myagent:")')
|
|
31
34
|
}).strict();
|
|
32
35
|
const DatabaseConfigSchema = z.discriminatedUnion(
|
|
33
36
|
"type",
|
|
@@ -152,6 +152,7 @@ export declare const StorageSchema: z.ZodBranded<z.ZodObject<{
|
|
|
152
152
|
port: z.ZodOptional<z.ZodNumber>;
|
|
153
153
|
database: z.ZodOptional<z.ZodString>;
|
|
154
154
|
password: z.ZodOptional<z.ZodString>;
|
|
155
|
+
keyPrefix: z.ZodOptional<z.ZodString>;
|
|
155
156
|
}, "strict", z.ZodTypeAny, {
|
|
156
157
|
type: "postgres";
|
|
157
158
|
password?: string | undefined;
|
|
@@ -164,6 +165,7 @@ export declare const StorageSchema: z.ZodBranded<z.ZodObject<{
|
|
|
164
165
|
port?: number | undefined;
|
|
165
166
|
database?: string | undefined;
|
|
166
167
|
connectionString?: string | undefined;
|
|
168
|
+
keyPrefix?: string | undefined;
|
|
167
169
|
}, {
|
|
168
170
|
type: "postgres";
|
|
169
171
|
password?: string | undefined;
|
|
@@ -176,6 +178,7 @@ export declare const StorageSchema: z.ZodBranded<z.ZodObject<{
|
|
|
176
178
|
port?: number | undefined;
|
|
177
179
|
database?: string | undefined;
|
|
178
180
|
connectionString?: string | undefined;
|
|
181
|
+
keyPrefix?: string | undefined;
|
|
179
182
|
}>]>, {
|
|
180
183
|
type: "in-memory";
|
|
181
184
|
options?: Record<string, any> | undefined;
|
|
@@ -201,6 +204,7 @@ export declare const StorageSchema: z.ZodBranded<z.ZodObject<{
|
|
|
201
204
|
port?: number | undefined;
|
|
202
205
|
database?: string | undefined;
|
|
203
206
|
connectionString?: string | undefined;
|
|
207
|
+
keyPrefix?: string | undefined;
|
|
204
208
|
}, {
|
|
205
209
|
type: "in-memory";
|
|
206
210
|
options?: Record<string, any> | undefined;
|
|
@@ -226,6 +230,7 @@ export declare const StorageSchema: z.ZodBranded<z.ZodObject<{
|
|
|
226
230
|
port?: number | undefined;
|
|
227
231
|
database?: string | undefined;
|
|
228
232
|
connectionString?: string | undefined;
|
|
233
|
+
keyPrefix?: string | undefined;
|
|
229
234
|
}>;
|
|
230
235
|
blob: z.ZodObject<{
|
|
231
236
|
type: z.ZodString;
|
|
@@ -260,6 +265,7 @@ export declare const StorageSchema: z.ZodBranded<z.ZodObject<{
|
|
|
260
265
|
port?: number | undefined;
|
|
261
266
|
database?: string | undefined;
|
|
262
267
|
connectionString?: string | undefined;
|
|
268
|
+
keyPrefix?: string | undefined;
|
|
263
269
|
};
|
|
264
270
|
cache: {
|
|
265
271
|
type: "in-memory";
|
|
@@ -310,6 +316,7 @@ export declare const StorageSchema: z.ZodBranded<z.ZodObject<{
|
|
|
310
316
|
port?: number | undefined;
|
|
311
317
|
database?: string | undefined;
|
|
312
318
|
connectionString?: string | undefined;
|
|
319
|
+
keyPrefix?: string | undefined;
|
|
313
320
|
};
|
|
314
321
|
cache: {
|
|
315
322
|
type: "in-memory";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/storage/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EACH,WAAW,EACX,iBAAiB,EACjB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACxB,MAAM,oBAAoB,CAAC;AAG5B,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAUY,CAAC;AAEvC,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -40,14 +40,20 @@ export interface ToolCreationContext {
|
|
|
40
40
|
agent: DextoAgent;
|
|
41
41
|
/**
|
|
42
42
|
* Optional services available to custom tool providers.
|
|
43
|
-
*
|
|
43
|
+
*
|
|
44
|
+
* Core services (provided by agent):
|
|
45
|
+
* - approvalManager: For tools that need approval flows
|
|
46
|
+
* - storageManager: For tools that need persistence
|
|
47
|
+
* - resourceManager: For tools that need resource access
|
|
48
|
+
* - searchService: For tools that need search capabilities
|
|
49
|
+
*
|
|
50
|
+
* External tool providers can add their own services using the index signature.
|
|
44
51
|
*/
|
|
45
52
|
services?: {
|
|
46
53
|
searchService?: any;
|
|
47
54
|
approvalManager?: any;
|
|
48
|
-
fileSystemService?: any;
|
|
49
|
-
processService?: any;
|
|
50
55
|
resourceManager?: any;
|
|
56
|
+
storageManager?: import('../storage/index.js').StorageManager;
|
|
51
57
|
[key: string]: any;
|
|
52
58
|
};
|
|
53
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-tool-registry.d.ts","sourceRoot":"","sources":["../../src/tools/custom-tool-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAw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E;IAClE,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAE3C;;;;;OAKG;IACH,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB,GAAG,YAAY,EAAE,CAAC;IAEtE,uDAAuD;IACvD,QAAQ,CAAC,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACL;AAYD;;;;;;;;;;;GAWG;AACH,qBAAa,kBAAmB,SAAQ,YAAY,CAAC,kBAAkB,CAAC;;IAKpE;;;;;;OAMG;IACM,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI;IAQrD;;;;;;;OAOG;IACM,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;CAK7C;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
|
|
@@ -136,8 +136,11 @@ class InternalToolsProvider {
|
|
|
136
136
|
const context = {
|
|
137
137
|
logger: this.logger,
|
|
138
138
|
agent: this.agent,
|
|
139
|
-
services:
|
|
140
|
-
|
|
139
|
+
services: {
|
|
140
|
+
...this.services,
|
|
141
|
+
// Include storageManager from agent services for custom tools that need persistence
|
|
142
|
+
storageManager: this.agent.services?.storageManager
|
|
143
|
+
}
|
|
141
144
|
};
|
|
142
145
|
for (const toolConfig of this.customToolConfigs) {
|
|
143
146
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/tools/internal-tools/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC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,IAAI,MAAM;IAI9B;;OAEG;IACH,kBAAkB,IAAI,MAAM;CAG/B"}
|
|
@@ -114,8 +114,11 @@ class InternalToolsProvider {
|
|
|
114
114
|
const context = {
|
|
115
115
|
logger: this.logger,
|
|
116
116
|
agent: this.agent,
|
|
117
|
-
services:
|
|
118
|
-
|
|
117
|
+
services: {
|
|
118
|
+
...this.services,
|
|
119
|
+
// Include storageManager from agent services for custom tools that need persistence
|
|
120
|
+
storageManager: this.agent.services?.storageManager
|
|
121
|
+
}
|
|
119
122
|
};
|
|
120
123
|
for (const toolConfig of this.customToolConfigs) {
|
|
121
124
|
try {
|