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,41 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __esm = (fn, res) => function __init() {
|
|
8
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
9
|
-
};
|
|
10
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
|
|
30
|
-
// node_modules/tsup/assets/esm_shims.js
|
|
31
|
-
var init_esm_shims = __esm({
|
|
32
|
-
"node_modules/tsup/assets/esm_shims.js"() {
|
|
33
|
-
"use strict";
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
export {
|
|
38
|
-
__commonJS,
|
|
39
|
-
__toESM,
|
|
40
|
-
init_esm_shims
|
|
41
|
-
};
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getDextoPath,
|
|
3
|
-
logger
|
|
4
|
-
} from "./chunk-BGO5B3L4.js";
|
|
5
|
-
import {
|
|
6
|
-
init_esm_shims
|
|
7
|
-
} from "./chunk-BYHW25EA.js";
|
|
8
|
-
|
|
9
|
-
// src/core/storage/backend/sqlite-backend.ts
|
|
10
|
-
init_esm_shims();
|
|
11
|
-
import { dirname } from "path";
|
|
12
|
-
import { mkdirSync } from "fs";
|
|
13
|
-
import * as path from "path";
|
|
14
|
-
var Database;
|
|
15
|
-
var SQLiteBackend = class {
|
|
16
|
-
db;
|
|
17
|
-
// Database.Database
|
|
18
|
-
dbPath;
|
|
19
|
-
config;
|
|
20
|
-
constructor(config) {
|
|
21
|
-
this.config = config;
|
|
22
|
-
this.dbPath = "";
|
|
23
|
-
}
|
|
24
|
-
resolveDefaultPath(dbName) {
|
|
25
|
-
const storageDir = getDextoPath("database");
|
|
26
|
-
const finalPath = path.join(storageDir, dbName);
|
|
27
|
-
logger.info(`SQLite storage directory: ${storageDir}`);
|
|
28
|
-
logger.debug(`SQLite database file: ${finalPath}`);
|
|
29
|
-
return finalPath;
|
|
30
|
-
}
|
|
31
|
-
initializeTables() {
|
|
32
|
-
logger.debug("SQLite initializing database schema...");
|
|
33
|
-
this.db.exec(`
|
|
34
|
-
CREATE TABLE IF NOT EXISTS kv_store (
|
|
35
|
-
key TEXT PRIMARY KEY,
|
|
36
|
-
value TEXT NOT NULL,
|
|
37
|
-
created_at INTEGER DEFAULT (strftime('%s', 'now')),
|
|
38
|
-
updated_at INTEGER DEFAULT (strftime('%s', 'now'))
|
|
39
|
-
)
|
|
40
|
-
`);
|
|
41
|
-
this.db.exec(`
|
|
42
|
-
CREATE TABLE IF NOT EXISTS list_store (
|
|
43
|
-
key TEXT NOT NULL,
|
|
44
|
-
value TEXT NOT NULL,
|
|
45
|
-
sequence INTEGER,
|
|
46
|
-
created_at INTEGER DEFAULT (strftime('%s', 'now')),
|
|
47
|
-
PRIMARY KEY (key, sequence)
|
|
48
|
-
)
|
|
49
|
-
`);
|
|
50
|
-
this.db.exec(`
|
|
51
|
-
CREATE INDEX IF NOT EXISTS idx_kv_store_key ON kv_store(key);
|
|
52
|
-
CREATE INDEX IF NOT EXISTS idx_list_store_key ON list_store(key);
|
|
53
|
-
CREATE INDEX IF NOT EXISTS idx_list_store_sequence ON list_store(key, sequence);
|
|
54
|
-
`);
|
|
55
|
-
logger.debug(
|
|
56
|
-
"SQLite database schema initialized: kv_store, list_store tables with indexes"
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
async connect() {
|
|
60
|
-
if (!Database) {
|
|
61
|
-
try {
|
|
62
|
-
const module = await import("better-sqlite3");
|
|
63
|
-
Database = module.default || module;
|
|
64
|
-
} catch (error) {
|
|
65
|
-
throw new Error(
|
|
66
|
-
`Failed to import better-sqlite3: ${error instanceof Error ? error.message : String(error)}`
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (this.config.path) {
|
|
71
|
-
this.dbPath = this.config.path;
|
|
72
|
-
logger.info(`SQLite using custom path: ${this.dbPath}`);
|
|
73
|
-
} else {
|
|
74
|
-
this.dbPath = this.resolveDefaultPath(this.config.database || "dexto.db");
|
|
75
|
-
}
|
|
76
|
-
const dir = dirname(this.dbPath);
|
|
77
|
-
logger.debug(`SQLite ensuring directory exists: ${dir}`);
|
|
78
|
-
try {
|
|
79
|
-
mkdirSync(dir, { recursive: true });
|
|
80
|
-
} catch (error) {
|
|
81
|
-
logger.debug(`Directory creation result: ${error ? "exists" : "created"}`);
|
|
82
|
-
}
|
|
83
|
-
const sqliteOptions = this.config.options || {};
|
|
84
|
-
logger.debug(`SQLite initializing database with config:`, {
|
|
85
|
-
readonly: sqliteOptions.readonly || false,
|
|
86
|
-
fileMustExist: sqliteOptions.fileMustExist || false,
|
|
87
|
-
timeout: sqliteOptions.timeout || 5e3
|
|
88
|
-
});
|
|
89
|
-
this.db = new Database(this.dbPath, {
|
|
90
|
-
readonly: sqliteOptions.readonly || false,
|
|
91
|
-
fileMustExist: sqliteOptions.fileMustExist || false,
|
|
92
|
-
timeout: sqliteOptions.timeout || 5e3,
|
|
93
|
-
verbose: sqliteOptions.verbose ? (message, ...additionalArgs) => {
|
|
94
|
-
logger.debug(
|
|
95
|
-
typeof message === "string" || typeof message === "object" && message !== null ? message : String(message),
|
|
96
|
-
...additionalArgs
|
|
97
|
-
);
|
|
98
|
-
} : void 0
|
|
99
|
-
});
|
|
100
|
-
this.db.pragma("journal_mode = WAL");
|
|
101
|
-
logger.debug("SQLite enabled WAL mode for better concurrency");
|
|
102
|
-
this.initializeTables();
|
|
103
|
-
logger.info(`\u2705 SQLite backend successfully connected to: ${this.dbPath}`);
|
|
104
|
-
}
|
|
105
|
-
async disconnect() {
|
|
106
|
-
if (this.db) {
|
|
107
|
-
this.db.close();
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
isConnected() {
|
|
111
|
-
return this.db !== null;
|
|
112
|
-
}
|
|
113
|
-
getBackendType() {
|
|
114
|
-
return "sqlite";
|
|
115
|
-
}
|
|
116
|
-
// Core operations
|
|
117
|
-
async get(key) {
|
|
118
|
-
this.checkConnection();
|
|
119
|
-
const row = this.db.prepare("SELECT value FROM kv_store WHERE key = ?").get(key);
|
|
120
|
-
return row ? JSON.parse(row.value) : void 0;
|
|
121
|
-
}
|
|
122
|
-
async set(key, value) {
|
|
123
|
-
this.checkConnection();
|
|
124
|
-
const serialized = JSON.stringify(value);
|
|
125
|
-
this.db.prepare("INSERT OR REPLACE INTO kv_store (key, value, updated_at) VALUES (?, ?, ?)").run(key, serialized, Date.now());
|
|
126
|
-
}
|
|
127
|
-
async delete(key) {
|
|
128
|
-
this.checkConnection();
|
|
129
|
-
this.db.prepare("DELETE FROM kv_store WHERE key = ?").run(key);
|
|
130
|
-
this.db.prepare("DELETE FROM list_store WHERE key = ?").run(key);
|
|
131
|
-
}
|
|
132
|
-
// List operations
|
|
133
|
-
async list(prefix) {
|
|
134
|
-
this.checkConnection();
|
|
135
|
-
const kvKeys = this.db.prepare("SELECT key FROM kv_store WHERE key LIKE ?").all(`${prefix}%`);
|
|
136
|
-
const listKeys = this.db.prepare("SELECT DISTINCT key FROM list_store WHERE key LIKE ?").all(`${prefix}%`);
|
|
137
|
-
const allKeys = /* @__PURE__ */ new Set([
|
|
138
|
-
...kvKeys.map((row) => row.key),
|
|
139
|
-
...listKeys.map((row) => row.key)
|
|
140
|
-
]);
|
|
141
|
-
return Array.from(allKeys).sort();
|
|
142
|
-
}
|
|
143
|
-
async append(key, item) {
|
|
144
|
-
this.checkConnection();
|
|
145
|
-
const serialized = JSON.stringify(item);
|
|
146
|
-
this.db.prepare(
|
|
147
|
-
"INSERT INTO list_store (key, value, sequence) VALUES (?, ?, (SELECT COALESCE(MAX(sequence), 0) + 1 FROM list_store WHERE key = ?))"
|
|
148
|
-
).run(key, serialized, key);
|
|
149
|
-
}
|
|
150
|
-
async getRange(key, start, count) {
|
|
151
|
-
this.checkConnection();
|
|
152
|
-
const rows = this.db.prepare(
|
|
153
|
-
"SELECT value FROM list_store WHERE key = ? ORDER BY sequence ASC LIMIT ? OFFSET ?"
|
|
154
|
-
).all(key, count, start);
|
|
155
|
-
return rows.map((row) => JSON.parse(row.value));
|
|
156
|
-
}
|
|
157
|
-
// Schema management
|
|
158
|
-
checkConnection() {
|
|
159
|
-
if (!this.db) {
|
|
160
|
-
throw new Error("SQLiteBackend not connected");
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
// Maintenance operations
|
|
164
|
-
async vacuum() {
|
|
165
|
-
this.checkConnection();
|
|
166
|
-
this.db.exec("VACUUM");
|
|
167
|
-
}
|
|
168
|
-
async getStats() {
|
|
169
|
-
this.checkConnection();
|
|
170
|
-
const kvCount = this.db.prepare("SELECT COUNT(*) as count FROM kv_store").get();
|
|
171
|
-
const listCount = this.db.prepare("SELECT COUNT(*) as count FROM list_store").get();
|
|
172
|
-
const dbSize = this.db.prepare(
|
|
173
|
-
"SELECT page_count * page_size as size FROM pragma_page_count(), pragma_page_size()"
|
|
174
|
-
).get();
|
|
175
|
-
return {
|
|
176
|
-
kvCount: kvCount.count,
|
|
177
|
-
listCount: listCount.count,
|
|
178
|
-
dbSize: dbSize.size
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
export {
|
|
183
|
-
SQLiteBackend
|
|
184
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/src/app/webui/.next/static/chunks/{684-058c08971e023037.js → 684-2e7175657246b549.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|