zen-code 1.0.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.
@@ -0,0 +1,64 @@
1
+ import { F as e } from "./sql-CJsUpKEQ.mjs";
2
+ class N {
3
+ db;
4
+ constructor(t) {
5
+ this.db = t;
6
+ }
7
+ dateToDb(t) {
8
+ return t.toISOString();
9
+ }
10
+ dbToDate(t) {
11
+ return new Date(t);
12
+ }
13
+ jsonToDb(t) {
14
+ return JSON.stringify(t);
15
+ }
16
+ dbToJson(t) {
17
+ if (typeof t == "string")
18
+ try {
19
+ return JSON.parse(t);
20
+ } catch {
21
+ return t;
22
+ }
23
+ return t;
24
+ }
25
+ buildJsonQuery(t, T, a, r) {
26
+ return e`json_extract(${e.ref(T)}, ${e.lit("$." + a)}) = ${e.lit(
27
+ JSON.stringify(r)
28
+ )}`;
29
+ }
30
+ now() {
31
+ return (/* @__PURE__ */ new Date()).toISOString();
32
+ }
33
+ async createTables(t) {
34
+ await e`
35
+ CREATE TABLE IF NOT EXISTS threads (
36
+ thread_id TEXT PRIMARY KEY,
37
+ created_at TEXT NOT NULL,
38
+ updated_at TEXT NOT NULL,
39
+ metadata TEXT NOT NULL DEFAULT '{}',
40
+ status TEXT NOT NULL DEFAULT 'idle',
41
+ "values" TEXT,
42
+ interrupts TEXT NOT NULL DEFAULT '{}'
43
+ )
44
+ `.execute(t), await e`
45
+ CREATE TABLE IF NOT EXISTS runs (
46
+ run_id TEXT PRIMARY KEY,
47
+ thread_id TEXT NOT NULL,
48
+ assistant_id TEXT NOT NULL,
49
+ created_at TEXT NOT NULL,
50
+ updated_at TEXT NOT NULL,
51
+ status TEXT NOT NULL DEFAULT 'pending',
52
+ metadata TEXT NOT NULL DEFAULT '{}',
53
+ multitask_strategy TEXT NOT NULL DEFAULT 'reject',
54
+ FOREIGN KEY (thread_id) REFERENCES threads(thread_id) ON DELETE CASCADE
55
+ )
56
+ `.execute(t);
57
+ }
58
+ async createIndexes(t) {
59
+ await e`CREATE INDEX IF NOT EXISTS idx_threads_status ON threads(status)`.execute(t), await e`CREATE INDEX IF NOT EXISTS idx_threads_created_at ON threads(created_at)`.execute(t), await e`CREATE INDEX IF NOT EXISTS idx_threads_updated_at ON threads(updated_at)`.execute(t), await e`CREATE INDEX IF NOT EXISTS idx_runs_thread_id ON runs(thread_id)`.execute(t), await e`CREATE INDEX IF NOT EXISTS idx_runs_status ON runs(status)`.execute(t);
60
+ }
61
+ }
62
+ export {
63
+ N as SQLiteAdapter
64
+ };
@@ -0,0 +1 @@
1
+ import "./app-CV_FJyjI.mjs";
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "zen-code",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "bin": "dist/app.js",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "keywords": [],
11
+ "author": "KonghaYao",
12
+ "license": "Apache-2.0",
13
+ "dependencies": {
14
+ "@lvce-editor/ripgrep": "^4.1.0",
15
+ "node-sqlite3-wasm": "^0.8.52"
16
+ },
17
+ "devDependencies": {
18
+ "chalk": "^5.6.2",
19
+ "@inkjs/ui": "^2.0.0",
20
+ "@langgraph-js/sdk": "^4.3.6",
21
+ "@nanostores/react": "^1.0.0",
22
+ "comlink": "^4.4.2",
23
+ "ink": "^6.2.3",
24
+ "ink-markdown": "^1.0.4",
25
+ "ink-select-input": "^6.2.0",
26
+ "ink-spinner": "^5.0.0",
27
+ "ink-syntax-highlight": "^2.0.2",
28
+ "ink-text-input": "^6.0.0",
29
+ "lowdb": "^7.0.1",
30
+ "marked": "^16.2.1",
31
+ "marked-terminal": "^7.3.0",
32
+ "react": "^19.1.1",
33
+ "@types/marked-terminal": "^6.1.1",
34
+ "@types/react": "^19.1.12",
35
+ "@vitejs/plugin-react": "^5.1.2",
36
+ "vite": "^7.3.0",
37
+ "vite-bundle-analyzer": "^1.3.2",
38
+ "vite-plugin-static-copy": "^3.1.4"
39
+ },
40
+ "babel": {
41
+ "presets": [
42
+ "@babel/preset-react"
43
+ ]
44
+ },
45
+ "scripts": {
46
+ "dev": "bun run src/app.tsx",
47
+ "build": "vite build"
48
+ }
49
+ }