dexto 1.0.1 → 1.1.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 +14 -12
- package/agents/agent-registry.json +53 -0
- package/agents/database-agent/README.md +35 -0
- package/agents/database-agent/data/example.db +0 -0
- package/agents/database-agent/database-agent-example.sql +98 -0
- package/agents/database-agent/database-agent.yml +116 -0
- package/agents/database-agent/setup-database.sh +64 -0
- package/agents/{agent.yml → default-agent.yml} +1 -1
- package/agents/image-editor-agent/Lenna.webp +0 -0
- package/agents/image-editor-agent/README.md +435 -0
- package/agents/image-editor-agent/image-editor-agent.yml +45 -0
- package/agents/music-agent/README.md +294 -0
- package/agents/music-agent/music-agent.yml +43 -0
- package/agents/product-name-researcher/README.md +98 -0
- package/agents/product-name-researcher/product-name-researcher.yml +161 -0
- package/agents/talk2pdf-agent/README.md +166 -0
- package/agents/talk2pdf-agent/talk2pdf-agent.yml +42 -0
- package/agents/triage-demo/README.md +337 -0
- package/agents/triage-demo/billing-agent.yml +76 -0
- package/agents/triage-demo/docs/billing-policies.md +246 -0
- package/agents/triage-demo/docs/company-overview.md +94 -0
- package/agents/triage-demo/docs/escalation-policies.md +301 -0
- package/agents/triage-demo/docs/product-features.md +253 -0
- package/agents/triage-demo/docs/technical-documentation.md +226 -0
- package/agents/triage-demo/escalation-agent.yml +82 -0
- package/agents/triage-demo/product-info-agent.yml +86 -0
- package/agents/triage-demo/technical-support-agent.yml +71 -0
- package/agents/triage-demo/test-scenarios.md +209 -0
- package/agents/triage-demo/triage-agent.yml +172 -0
- package/dist/src/app/{chunk-M4OZIDPC.js → chunk-CLDYRNV6.js} +7241 -5753
- package/dist/src/app/chunk-DYNVXGAH.js +137 -0
- package/dist/src/app/chunk-PW2PHCHR.js +83 -0
- package/dist/src/app/chunk-R4Q522DR.js +205 -0
- package/dist/src/app/chunk-UXCBS3TR.js +281 -0
- package/dist/src/app/chunk-X6LEX724.js +108 -0
- package/dist/src/app/chunk-Y33BS5SA.js +39 -0
- package/dist/src/app/{cli-confirmation-handler-2APQRKHG.js → cli-confirmation-handler-GJHPLGOL.js} +4 -1
- package/dist/src/app/errors-5MNETGOV.js +8 -0
- package/dist/src/app/index.js +2184 -612
- package/dist/src/app/loader-EFMKWNNQ.js +20 -0
- package/dist/src/app/path-7FT4SZMO.js +23 -0
- package/dist/src/app/{postgres-backend-7HVVW3RL.js → postgres-backend-U5MIIMUY.js} +12 -1
- package/dist/src/app/{redis-backend-2YBZSSSV.js → redis-backend-NGI67ILT.js} +38 -9
- package/dist/src/app/registry-RALMVM3P.js +14 -0
- package/dist/src/app/sqlite-backend-752UUBD4.js +245 -0
- package/dist/src/app/webui/.next/standalone/.next/BUILD_ID +1 -1
- package/dist/src/app/webui/.next/standalone/.next/app-build-manifest.json +20 -21
- package/dist/src/app/webui/.next/standalone/.next/app-path-routes-manifest.json +0 -1
- package/dist/src/app/webui/.next/standalone/.next/build-manifest.json +4 -4
- package/dist/src/app/webui/.next/standalone/.next/prerender-manifest.json +4 -82
- package/dist/src/app/webui/.next/standalone/.next/required-server-files.json +2 -3
- package/dist/src/app/webui/.next/standalone/.next/routes-manifest.json +0 -6
- package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found/page.js +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/page.js +7 -3
- package/dist/src/app/webui/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/playground/page.js +8 -8
- package/dist/src/app/webui/.next/standalone/.next/server/app/playground/page.js.nft.json +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/playground/page_client-reference-manifest.js +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app-paths-manifest.json +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/176.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/195.js +24 -0
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/620.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/80.js +5 -0
- package/dist/src/app/webui/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/pages/500.html +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/pages-manifest.json +1 -2
- package/dist/src/app/webui/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/webpack-runtime.js +1 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/190-b897ef36fde616bf.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/487-a77054bd2c64c79c.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/588-dbe47a44489742dd.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/62-35030b5cb176bd7b.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/layout-91c0cb9eb1ee327a.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/page-3279aaf14db87f45.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/playground/page-200aad53af9ca53f.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/static/css/af71306827be150e.css +3 -0
- package/dist/src/app/webui/.next/standalone/.next/static/tpCURR82LyyGfdALJ4Qvl/_buildManifest.js +1 -0
- package/dist/src/app/webui/.next/standalone/package.json +4 -3
- package/dist/src/app/webui/.next/standalone/public/favicon2.ico +0 -0
- package/dist/src/app/webui/.next/standalone/public/logo.svg +1 -0
- package/dist/src/app/webui/.next/standalone/public/logo_no_text.png +0 -0
- package/dist/src/app/webui/.next/standalone/server.js +1 -1
- package/dist/src/app/webui/.next/static/chunks/190-b897ef36fde616bf.js +1 -0
- package/dist/src/app/webui/.next/static/chunks/487-a77054bd2c64c79c.js +1 -0
- package/dist/src/app/webui/.next/static/chunks/588-dbe47a44489742dd.js +1 -0
- package/dist/src/app/webui/.next/static/chunks/62-35030b5cb176bd7b.js +1 -0
- package/dist/src/app/webui/.next/static/chunks/app/layout-91c0cb9eb1ee327a.js +1 -0
- package/dist/src/app/webui/.next/static/chunks/app/page-3279aaf14db87f45.js +1 -0
- package/dist/src/app/webui/.next/static/chunks/app/playground/page-200aad53af9ca53f.js +1 -0
- package/dist/src/app/webui/.next/static/css/af71306827be150e.css +3 -0
- package/dist/src/app/webui/.next/static/tpCURR82LyyGfdALJ4Qvl/_buildManifest.js +1 -0
- package/dist/src/app/webui/package.json +4 -3
- package/dist/src/app/webui/public/favicon2.ico +0 -0
- package/dist/src/app/webui/public/logo.svg +1 -0
- package/dist/src/app/webui/public/logo_no_text.png +0 -0
- package/dist/src/core/chunk-7A6NQKQ3.js +193 -0
- package/dist/src/core/chunk-CZIXQNMZ.js +12191 -0
- package/dist/src/core/index.cjs +10601 -8012
- package/dist/src/core/index.d.cts +4356 -3907
- package/dist/src/core/index.d.ts +4356 -3907
- package/dist/src/core/index.js +117 -8396
- package/dist/src/core/{postgres-backend-ERZ6DP76.js → postgres-backend-LOLKTD2T.js} +9 -2
- package/dist/src/core/{redis-backend-46O7Y44C.js → redis-backend-APZ576PJ.js} +35 -10
- package/dist/src/core/sqlite-backend-KQ75DPR7.js +245 -0
- package/package.json +20 -12
- package/dist/src/app/chunk-O5YHNFMH.js +0 -435
- package/dist/src/app/interactive-api-key-setup-V3GAACLN.js +0 -269
- package/dist/src/app/sqlite-backend-KIJZ5IP3.js +0 -180
- package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found.html +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found.meta +0 -8
- package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found.rsc +0 -21
- package/dist/src/app/webui/.next/standalone/.next/server/app/favicon.ico/route.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/favicon.ico/route.js.nft.json +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/favicon.ico.body +0 -0
- package/dist/src/app/webui/.next/standalone/.next/server/app/favicon.ico.meta +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/index.html +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/index.meta +0 -7
- package/dist/src/app/webui/.next/standalone/.next/server/app/index.rsc +0 -22
- package/dist/src/app/webui/.next/standalone/.next/server/app/playground.html +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/playground.meta +0 -7
- package/dist/src/app/webui/.next/standalone/.next/server/app/playground.rsc +0 -25
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/447.js +0 -20
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/504.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/54.js +0 -5
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/624.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/985.js +0 -5
- package/dist/src/app/webui/.next/standalone/.next/server/pages/404.html +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/H-71qcBOOk528tDEa_ldn/_buildManifest.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/125-9b34ec01f112cdb2.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/487-c6ea8b63ca68db1c.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/588-20dc7f3a8664c387.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/687-3e614f30982093f6.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/879-cf875984faa0b72f.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/layout-ed56660b7ecaf47b.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/page-b05580de36ce0e36.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/playground/page-ac5443cddbe824aa.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/css/d44f09bc2605dc76.css +0 -3
- package/dist/src/app/webui/.next/standalone/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js +0 -19
- package/dist/src/app/webui/.next/standalone/public/favicon.svg +0 -26
- package/dist/src/app/webui/.next/standalone/public/logo.png +0 -0
- package/dist/src/app/webui/.next/static/H-71qcBOOk528tDEa_ldn/_buildManifest.js +0 -1
- package/dist/src/app/webui/.next/static/chunks/125-9b34ec01f112cdb2.js +0 -1
- package/dist/src/app/webui/.next/static/chunks/487-c6ea8b63ca68db1c.js +0 -1
- package/dist/src/app/webui/.next/static/chunks/588-20dc7f3a8664c387.js +0 -1
- package/dist/src/app/webui/.next/static/chunks/687-3e614f30982093f6.js +0 -1
- package/dist/src/app/webui/.next/static/chunks/879-cf875984faa0b72f.js +0 -1
- package/dist/src/app/webui/.next/static/chunks/app/layout-ed56660b7ecaf47b.js +0 -1
- package/dist/src/app/webui/.next/static/chunks/app/page-b05580de36ce0e36.js +0 -1
- package/dist/src/app/webui/.next/static/chunks/app/playground/page-ac5443cddbe824aa.js +0 -1
- package/dist/src/app/webui/.next/static/css/d44f09bc2605dc76.css +0 -3
- package/dist/src/app/webui/public/favicon.svg +0 -26
- package/dist/src/app/webui/public/logo.png +0 -0
- package/dist/src/core/chunk-BGO5B3L4.js +0 -2124
- package/dist/src/core/chunk-BYHW25EA.js +0 -41
- package/dist/src/core/sqlite-backend-RKK4WBHE.js +0 -184
- /package/dist/src/app/webui/.next/standalone/.next/static/chunks/{4bd1b696-2df85d4b3b58aed5.js → 4bd1b696-c95fa02060335229.js} +0 -0
- /package/dist/src/app/webui/.next/standalone/.next/static/chunks/{684-058c08971e023037.js → 684-2e7175657246b549.js} +0 -0
- /package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/_not-found/{page-7b137d85f9de4771.js → page-b63df5a8d3225455.js} +0 -0
- /package/dist/src/app/webui/.next/standalone/.next/static/{H-71qcBOOk528tDEa_ldn → tpCURR82LyyGfdALJ4Qvl}/_ssgManifest.js +0 -0
- /package/dist/src/app/webui/.next/static/chunks/{4bd1b696-2df85d4b3b58aed5.js → 4bd1b696-c95fa02060335229.js} +0 -0
- /package/dist/src/app/webui/.next/static/chunks/{684-058c08971e023037.js → 684-2e7175657246b549.js} +0 -0
- /package/dist/src/app/webui/.next/static/chunks/app/_not-found/{page-7b137d85f9de4771.js → page-b63df5a8d3225455.js} +0 -0
- /package/dist/src/app/webui/.next/static/{H-71qcBOOk528tDEa_ldn → tpCURR82LyyGfdALJ4Qvl}/_ssgManifest.js +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
+
StorageError,
|
|
2
3
|
init_esm_shims
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7A6NQKQ3.js";
|
|
4
5
|
|
|
5
6
|
// src/core/storage/backend/postgres-backend.ts
|
|
6
7
|
init_esm_shims();
|
|
@@ -49,6 +50,12 @@ var PostgresBackend = class {
|
|
|
49
50
|
try {
|
|
50
51
|
const result = await client.query("SELECT value FROM kv WHERE key = $1", [key]);
|
|
51
52
|
return result.rows[0] ? result.rows[0].value : void 0;
|
|
53
|
+
} catch (error) {
|
|
54
|
+
throw StorageError.readFailed(
|
|
55
|
+
"get",
|
|
56
|
+
error instanceof Error ? error.message : String(error),
|
|
57
|
+
{ key }
|
|
58
|
+
);
|
|
52
59
|
} finally {
|
|
53
60
|
client.release();
|
|
54
61
|
}
|
|
@@ -152,7 +159,7 @@ var PostgresBackend = class {
|
|
|
152
159
|
}
|
|
153
160
|
checkConnection() {
|
|
154
161
|
if (!this.connected || !this.pool) {
|
|
155
|
-
throw
|
|
162
|
+
throw StorageError.notConnected("PostgresBackend");
|
|
156
163
|
}
|
|
157
164
|
}
|
|
158
165
|
// Advanced operations
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
+
StorageError,
|
|
2
3
|
init_esm_shims
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7A6NQKQ3.js";
|
|
4
5
|
|
|
5
6
|
// src/core/storage/backend/redis-backend.ts
|
|
6
7
|
init_esm_shims();
|
|
@@ -57,21 +58,45 @@ var RedisBackend = class {
|
|
|
57
58
|
// Core operations
|
|
58
59
|
async get(key) {
|
|
59
60
|
this.checkConnection();
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
try {
|
|
62
|
+
const value = await this.redis.get(key);
|
|
63
|
+
return value ? JSON.parse(value) : void 0;
|
|
64
|
+
} catch (error) {
|
|
65
|
+
throw StorageError.readFailed(
|
|
66
|
+
"get",
|
|
67
|
+
error instanceof Error ? error.message : String(error),
|
|
68
|
+
{ key }
|
|
69
|
+
);
|
|
70
|
+
}
|
|
62
71
|
}
|
|
63
72
|
async set(key, value, ttlSeconds) {
|
|
64
73
|
this.checkConnection();
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
try {
|
|
75
|
+
const serialized = JSON.stringify(value);
|
|
76
|
+
if (ttlSeconds) {
|
|
77
|
+
await this.redis.setex(key, ttlSeconds, serialized);
|
|
78
|
+
} else {
|
|
79
|
+
await this.redis.set(key, serialized);
|
|
80
|
+
}
|
|
81
|
+
} catch (error) {
|
|
82
|
+
throw StorageError.writeFailed(
|
|
83
|
+
"set",
|
|
84
|
+
error instanceof Error ? error.message : String(error),
|
|
85
|
+
{ key }
|
|
86
|
+
);
|
|
70
87
|
}
|
|
71
88
|
}
|
|
72
89
|
async delete(key) {
|
|
73
90
|
this.checkConnection();
|
|
74
|
-
|
|
91
|
+
try {
|
|
92
|
+
await this.redis.del(key);
|
|
93
|
+
} catch (error) {
|
|
94
|
+
throw StorageError.deleteFailed(
|
|
95
|
+
"delete",
|
|
96
|
+
error instanceof Error ? error.message : String(error),
|
|
97
|
+
{ key }
|
|
98
|
+
);
|
|
99
|
+
}
|
|
75
100
|
}
|
|
76
101
|
// Redis-specific optimizations
|
|
77
102
|
async mget(keys) {
|
|
@@ -123,7 +148,7 @@ var RedisBackend = class {
|
|
|
123
148
|
}
|
|
124
149
|
checkConnection() {
|
|
125
150
|
if (!this.connected || !this.redis || this.redis.status !== "ready") {
|
|
126
|
-
throw
|
|
151
|
+
throw StorageError.notConnected("RedisBackend");
|
|
127
152
|
}
|
|
128
153
|
}
|
|
129
154
|
// Maintenance operations
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getDextoPath,
|
|
3
|
+
logger
|
|
4
|
+
} from "./chunk-CZIXQNMZ.js";
|
|
5
|
+
import {
|
|
6
|
+
StorageError,
|
|
7
|
+
init_esm_shims
|
|
8
|
+
} from "./chunk-7A6NQKQ3.js";
|
|
9
|
+
|
|
10
|
+
// src/core/storage/backend/sqlite-backend.ts
|
|
11
|
+
init_esm_shims();
|
|
12
|
+
import { dirname } from "path";
|
|
13
|
+
import { mkdirSync } from "fs";
|
|
14
|
+
import * as path from "path";
|
|
15
|
+
var Database;
|
|
16
|
+
var SQLiteBackend = class {
|
|
17
|
+
db;
|
|
18
|
+
// Database.Database
|
|
19
|
+
dbPath;
|
|
20
|
+
config;
|
|
21
|
+
constructor(config) {
|
|
22
|
+
this.config = config;
|
|
23
|
+
this.dbPath = "";
|
|
24
|
+
}
|
|
25
|
+
resolveDefaultPath(dbName) {
|
|
26
|
+
const storageDir = getDextoPath("database");
|
|
27
|
+
const finalPath = path.join(storageDir, dbName);
|
|
28
|
+
logger.info(`SQLite storage directory: ${storageDir}`);
|
|
29
|
+
logger.debug(`SQLite database file: ${finalPath}`);
|
|
30
|
+
return finalPath;
|
|
31
|
+
}
|
|
32
|
+
initializeTables() {
|
|
33
|
+
logger.debug("SQLite initializing database schema...");
|
|
34
|
+
try {
|
|
35
|
+
this.db.exec(`
|
|
36
|
+
CREATE TABLE IF NOT EXISTS kv_store (
|
|
37
|
+
key TEXT PRIMARY KEY,
|
|
38
|
+
value TEXT NOT NULL,
|
|
39
|
+
created_at INTEGER DEFAULT (strftime('%s', 'now')),
|
|
40
|
+
updated_at INTEGER DEFAULT (strftime('%s', 'now'))
|
|
41
|
+
)
|
|
42
|
+
`);
|
|
43
|
+
this.db.exec(`
|
|
44
|
+
CREATE TABLE IF NOT EXISTS list_store (
|
|
45
|
+
key TEXT NOT NULL,
|
|
46
|
+
value TEXT NOT NULL,
|
|
47
|
+
sequence INTEGER,
|
|
48
|
+
created_at INTEGER DEFAULT (strftime('%s', 'now')),
|
|
49
|
+
PRIMARY KEY (key, sequence)
|
|
50
|
+
)
|
|
51
|
+
`);
|
|
52
|
+
this.db.exec(`
|
|
53
|
+
CREATE INDEX IF NOT EXISTS idx_kv_store_key ON kv_store(key);
|
|
54
|
+
CREATE INDEX IF NOT EXISTS idx_list_store_key ON list_store(key);
|
|
55
|
+
CREATE INDEX IF NOT EXISTS idx_list_store_sequence ON list_store(key, sequence);
|
|
56
|
+
`);
|
|
57
|
+
logger.debug(
|
|
58
|
+
"SQLite database schema initialized: kv_store, list_store tables with indexes"
|
|
59
|
+
);
|
|
60
|
+
} catch (error) {
|
|
61
|
+
throw StorageError.migrationFailed(
|
|
62
|
+
error instanceof Error ? error.message : String(error),
|
|
63
|
+
{
|
|
64
|
+
operation: "table_initialization",
|
|
65
|
+
backend: "sqlite"
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async connect() {
|
|
71
|
+
if (!Database) {
|
|
72
|
+
try {
|
|
73
|
+
const module = await import("better-sqlite3");
|
|
74
|
+
Database = module.default || module;
|
|
75
|
+
} catch (error) {
|
|
76
|
+
throw StorageError.connectionFailed(
|
|
77
|
+
`Failed to import better-sqlite3: ${error instanceof Error ? error.message : String(error)}`
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (this.config.path) {
|
|
82
|
+
this.dbPath = this.config.path;
|
|
83
|
+
logger.info(`SQLite using custom path: ${this.dbPath}`);
|
|
84
|
+
} else {
|
|
85
|
+
this.dbPath = this.resolveDefaultPath(this.config.database || "dexto.db");
|
|
86
|
+
}
|
|
87
|
+
const dir = dirname(this.dbPath);
|
|
88
|
+
logger.debug(`SQLite ensuring directory exists: ${dir}`);
|
|
89
|
+
try {
|
|
90
|
+
mkdirSync(dir, { recursive: true });
|
|
91
|
+
} catch (error) {
|
|
92
|
+
logger.debug(`Directory creation result: ${error ? "exists" : "created"}`);
|
|
93
|
+
}
|
|
94
|
+
const sqliteOptions = this.config.options || {};
|
|
95
|
+
logger.debug(`SQLite initializing database with config:`, {
|
|
96
|
+
readonly: sqliteOptions.readonly || false,
|
|
97
|
+
fileMustExist: sqliteOptions.fileMustExist || false,
|
|
98
|
+
timeout: sqliteOptions.timeout || 5e3
|
|
99
|
+
});
|
|
100
|
+
this.db = new Database(this.dbPath, {
|
|
101
|
+
readonly: sqliteOptions.readonly || false,
|
|
102
|
+
fileMustExist: sqliteOptions.fileMustExist || false,
|
|
103
|
+
timeout: sqliteOptions.timeout || 5e3,
|
|
104
|
+
verbose: sqliteOptions.verbose ? (message, ...additionalArgs) => {
|
|
105
|
+
logger.debug(
|
|
106
|
+
typeof message === "string" || typeof message === "object" && message !== null ? message : String(message),
|
|
107
|
+
...additionalArgs
|
|
108
|
+
);
|
|
109
|
+
} : void 0
|
|
110
|
+
});
|
|
111
|
+
this.db.pragma("journal_mode = WAL");
|
|
112
|
+
logger.debug("SQLite enabled WAL mode for better concurrency");
|
|
113
|
+
this.initializeTables();
|
|
114
|
+
logger.info(`\u2705 SQLite backend successfully connected to: ${this.dbPath}`);
|
|
115
|
+
}
|
|
116
|
+
async disconnect() {
|
|
117
|
+
if (this.db) {
|
|
118
|
+
this.db.close();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
isConnected() {
|
|
122
|
+
return this.db !== null;
|
|
123
|
+
}
|
|
124
|
+
getBackendType() {
|
|
125
|
+
return "sqlite";
|
|
126
|
+
}
|
|
127
|
+
// Core operations
|
|
128
|
+
async get(key) {
|
|
129
|
+
this.checkConnection();
|
|
130
|
+
try {
|
|
131
|
+
const row = this.db.prepare("SELECT value FROM kv_store WHERE key = ?").get(key);
|
|
132
|
+
return row ? JSON.parse(row.value) : void 0;
|
|
133
|
+
} catch (error) {
|
|
134
|
+
throw StorageError.readFailed(
|
|
135
|
+
"get",
|
|
136
|
+
error instanceof Error ? error.message : String(error),
|
|
137
|
+
{ key }
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
async set(key, value) {
|
|
142
|
+
this.checkConnection();
|
|
143
|
+
try {
|
|
144
|
+
const serialized = JSON.stringify(value);
|
|
145
|
+
this.db.prepare(
|
|
146
|
+
"INSERT OR REPLACE INTO kv_store (key, value, updated_at) VALUES (?, ?, ?)"
|
|
147
|
+
).run(key, serialized, Date.now());
|
|
148
|
+
} catch (error) {
|
|
149
|
+
throw StorageError.writeFailed(
|
|
150
|
+
"set",
|
|
151
|
+
error instanceof Error ? error.message : String(error),
|
|
152
|
+
{ key }
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
async delete(key) {
|
|
157
|
+
this.checkConnection();
|
|
158
|
+
try {
|
|
159
|
+
this.db.prepare("DELETE FROM kv_store WHERE key = ?").run(key);
|
|
160
|
+
this.db.prepare("DELETE FROM list_store WHERE key = ?").run(key);
|
|
161
|
+
} catch (error) {
|
|
162
|
+
throw StorageError.deleteFailed(
|
|
163
|
+
"delete",
|
|
164
|
+
error instanceof Error ? error.message : String(error),
|
|
165
|
+
{ key }
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
// List operations
|
|
170
|
+
async list(prefix) {
|
|
171
|
+
this.checkConnection();
|
|
172
|
+
try {
|
|
173
|
+
const kvKeys = this.db.prepare("SELECT key FROM kv_store WHERE key LIKE ?").all(`${prefix}%`);
|
|
174
|
+
const listKeys = this.db.prepare("SELECT DISTINCT key FROM list_store WHERE key LIKE ?").all(`${prefix}%`);
|
|
175
|
+
const allKeys = /* @__PURE__ */ new Set([
|
|
176
|
+
...kvKeys.map((row) => row.key),
|
|
177
|
+
...listKeys.map((row) => row.key)
|
|
178
|
+
]);
|
|
179
|
+
return Array.from(allKeys).sort();
|
|
180
|
+
} catch (error) {
|
|
181
|
+
throw StorageError.readFailed(
|
|
182
|
+
"list",
|
|
183
|
+
error instanceof Error ? error.message : String(error),
|
|
184
|
+
{ prefix }
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
async append(key, item) {
|
|
189
|
+
this.checkConnection();
|
|
190
|
+
try {
|
|
191
|
+
const serialized = JSON.stringify(item);
|
|
192
|
+
this.db.prepare(
|
|
193
|
+
"INSERT INTO list_store (key, value, sequence) VALUES (?, ?, (SELECT COALESCE(MAX(sequence), 0) + 1 FROM list_store WHERE key = ?))"
|
|
194
|
+
).run(key, serialized, key);
|
|
195
|
+
} catch (error) {
|
|
196
|
+
throw StorageError.writeFailed(
|
|
197
|
+
"append",
|
|
198
|
+
error instanceof Error ? error.message : String(error),
|
|
199
|
+
{ key }
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
async getRange(key, start, count) {
|
|
204
|
+
this.checkConnection();
|
|
205
|
+
try {
|
|
206
|
+
const rows = this.db.prepare(
|
|
207
|
+
"SELECT value FROM list_store WHERE key = ? ORDER BY sequence ASC LIMIT ? OFFSET ?"
|
|
208
|
+
).all(key, count, start);
|
|
209
|
+
return rows.map((row) => JSON.parse(row.value));
|
|
210
|
+
} catch (error) {
|
|
211
|
+
throw StorageError.readFailed(
|
|
212
|
+
"getRange",
|
|
213
|
+
error instanceof Error ? error.message : String(error),
|
|
214
|
+
{ key, start, count }
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
// Schema management
|
|
219
|
+
checkConnection() {
|
|
220
|
+
if (!this.db) {
|
|
221
|
+
throw StorageError.notConnected("SQLiteBackend");
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
// Maintenance operations
|
|
225
|
+
async vacuum() {
|
|
226
|
+
this.checkConnection();
|
|
227
|
+
this.db.exec("VACUUM");
|
|
228
|
+
}
|
|
229
|
+
async getStats() {
|
|
230
|
+
this.checkConnection();
|
|
231
|
+
const kvCount = this.db.prepare("SELECT COUNT(*) as count FROM kv_store").get();
|
|
232
|
+
const listCount = this.db.prepare("SELECT COUNT(*) as count FROM list_store").get();
|
|
233
|
+
const dbSize = this.db.prepare(
|
|
234
|
+
"SELECT page_count * page_size as size FROM pragma_page_count(), pragma_page_size()"
|
|
235
|
+
).get();
|
|
236
|
+
return {
|
|
237
|
+
kvCount: kvCount.count,
|
|
238
|
+
listCount: listCount.count,
|
|
239
|
+
dbSize: dbSize.size
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
export {
|
|
244
|
+
SQLiteBackend
|
|
245
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dexto",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20.0.0",
|
|
6
6
|
"npm": ">=8.3.0"
|
|
@@ -56,27 +56,35 @@
|
|
|
56
56
|
"cli",
|
|
57
57
|
"natural-language",
|
|
58
58
|
"openai",
|
|
59
|
-
"truffle-ai"
|
|
59
|
+
"truffle-ai",
|
|
60
|
+
"dexto"
|
|
60
61
|
],
|
|
61
62
|
"author": "",
|
|
62
63
|
"license": "Elastic-2.0",
|
|
63
64
|
"files": [
|
|
64
65
|
"dist/",
|
|
65
|
-
"agents/agent.
|
|
66
|
+
"agents/agent-registry.json",
|
|
66
67
|
"agents/agent-template.yml",
|
|
68
|
+
"agents/default-agent.yml",
|
|
69
|
+
"agents/database-agent/",
|
|
70
|
+
"agents/talk2pdf-agent/",
|
|
71
|
+
"agents/image-editor-agent/",
|
|
72
|
+
"agents/music-agent/",
|
|
73
|
+
"agents/product-name-researcher/",
|
|
74
|
+
"agents/triage-demo/",
|
|
67
75
|
"public/"
|
|
68
76
|
],
|
|
69
77
|
"dependencies": {
|
|
70
|
-
"@ai-sdk/anthropic": "^
|
|
71
|
-
"@ai-sdk/cohere": "^
|
|
72
|
-
"@ai-sdk/google": "^
|
|
73
|
-
"@ai-sdk/groq": "^
|
|
74
|
-
"@ai-sdk/openai": "^
|
|
75
|
-
"@ai-sdk/xai": "^
|
|
78
|
+
"@ai-sdk/anthropic": "^2.0.0",
|
|
79
|
+
"@ai-sdk/cohere": "^2.0.0",
|
|
80
|
+
"@ai-sdk/google": "^2.0.0",
|
|
81
|
+
"@ai-sdk/groq": "^2.0.0",
|
|
82
|
+
"@ai-sdk/openai": "^2.0.0",
|
|
83
|
+
"@ai-sdk/xai": "^2.0.0",
|
|
76
84
|
"@anthropic-ai/sdk": "^0.39.0",
|
|
77
85
|
"@clack/prompts": "^0.10.1",
|
|
78
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
79
|
-
"ai": "^
|
|
86
|
+
"@modelcontextprotocol/sdk": "^1.17.2",
|
|
87
|
+
"ai": "^5.0.0",
|
|
80
88
|
"better-sqlite3": "^11.10.0",
|
|
81
89
|
"boxen": "^7.1.1",
|
|
82
90
|
"chalk": "^5.4.1",
|
|
@@ -99,7 +107,7 @@
|
|
|
99
107
|
"winston": "^3.17.0",
|
|
100
108
|
"ws": "^8.18.1",
|
|
101
109
|
"yaml": "^2.7.1",
|
|
102
|
-
"zod": "^3.
|
|
110
|
+
"zod": "^3.25.0",
|
|
103
111
|
"zod-to-json-schema": "^3.24.6"
|
|
104
112
|
},
|
|
105
113
|
"devDependencies": {
|