mcard-js 2.1.39 → 2.1.41
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/AbstractSqlEngine-BSfp8S_Y.d.cts +451 -0
- package/dist/AbstractSqlEngine-BSfp8S_Y.d.ts +451 -0
- package/dist/CardCollection-MXTUJV4J.js +9 -0
- package/dist/EventProducer-AWD6YMZR.js +47 -0
- package/dist/Handle-3N4QOA3U.js +13 -0
- package/dist/IndexedDBEngine-2G5KCISA.js +11 -0
- package/dist/LLMRuntime-LBWUJ7ON.js +16 -0
- package/dist/LambdaRuntime-B6D6IQKZ.js +18 -0
- package/dist/Loader-3LSJXJQG.js +11 -0
- package/dist/MCard-H56VOJLR.js +8 -0
- package/dist/NetworkRuntime-IAFHPQSX.js +1570 -0
- package/dist/OllamaProvider-QPX2JXL2.js +8 -0
- package/dist/chunk-2R4ESMZB.js +110 -0
- package/dist/chunk-3EIBJPNF.js +17 -0
- package/dist/chunk-3LPY36OG.js +355 -0
- package/dist/chunk-3MMMJ7NH.js +1068 -0
- package/dist/chunk-42VF42KH.js +273 -0
- package/dist/chunk-4PDYHPR6.js +297 -0
- package/dist/chunk-ADV52544.js +95 -0
- package/dist/chunk-FIE4LAJG.js +215 -0
- package/dist/chunk-PNKVD2UK.js +26 -0
- package/dist/chunk-RSTKX7WM.js +907 -0
- package/dist/chunk-VXV35I5J.js +2315 -0
- package/dist/index.browser.cjs +375 -276
- package/dist/index.browser.d.cts +4 -4
- package/dist/index.browser.d.ts +4 -4
- package/dist/index.browser.js +18 -13
- package/dist/index.cjs +382 -453
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +26 -21
- package/dist/storage/SqliteNodeEngine.cjs +395 -270
- package/dist/storage/SqliteNodeEngine.d.cts +9 -94
- package/dist/storage/SqliteNodeEngine.d.ts +9 -94
- package/dist/storage/SqliteNodeEngine.js +6 -5
- package/dist/storage/SqliteWasmEngine.cjs +382 -252
- package/dist/storage/SqliteWasmEngine.d.cts +8 -29
- package/dist/storage/SqliteWasmEngine.d.ts +8 -29
- package/dist/storage/SqliteWasmEngine.js +6 -5
- package/package.json +1 -1
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as AbstractSqlEngine, M as MCard, P as Page } from '../AbstractSqlEngine-BSfp8S_Y.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* SqliteNodeEngine - Native SQLite backend for Node.js using better-sqlite3
|
|
5
5
|
*
|
|
6
6
|
* Provides synchronous SQLite operations with the same schema as Python implementation.
|
|
7
7
|
* Supports both file-based and in-memory databases.
|
|
8
|
+
*
|
|
9
|
+
* Handle operations (register, resolve, update, rename, prune, etc.) are
|
|
10
|
+
* inherited from AbstractSqlEngine — only card operations and sync helpers
|
|
11
|
+
* are implemented here.
|
|
8
12
|
*/
|
|
9
13
|
|
|
10
14
|
/**
|
|
@@ -12,13 +16,13 @@ import { S as StorageEngine, M as MCard, P as Page } from '../StorageAdapter-DdD
|
|
|
12
16
|
*
|
|
13
17
|
* Uses better-sqlite3 for synchronous, high-performance SQLite operations.
|
|
14
18
|
*/
|
|
15
|
-
declare class SqliteNodeEngine
|
|
19
|
+
declare class SqliteNodeEngine extends AbstractSqlEngine {
|
|
16
20
|
private db;
|
|
17
21
|
private dbPath;
|
|
18
22
|
/**
|
|
19
23
|
* Convert a database row into an MCard instance.
|
|
20
24
|
*/
|
|
21
|
-
|
|
25
|
+
protected rowToCard(row: Record<string, unknown>): MCard;
|
|
22
26
|
/**
|
|
23
27
|
* Create a new SqliteNodeEngine via async factory.
|
|
24
28
|
* @param dbPath Path to database file, or ':memory:' for in-memory database
|
|
@@ -30,6 +34,8 @@ declare class SqliteNodeEngine implements StorageEngine {
|
|
|
30
34
|
* Initialize database schema
|
|
31
35
|
*/
|
|
32
36
|
private setupDatabase;
|
|
37
|
+
protected queryRows(sql: string, ...params: unknown[]): Promise<Record<string, unknown>[]>;
|
|
38
|
+
protected execSql(sql: string, ...params: unknown[]): Promise<number>;
|
|
33
39
|
/**
|
|
34
40
|
* Close the database connection
|
|
35
41
|
*/
|
|
@@ -39,106 +45,15 @@ declare class SqliteNodeEngine implements StorageEngine {
|
|
|
39
45
|
*/
|
|
40
46
|
getDbPath(): string;
|
|
41
47
|
add(card: MCard): Promise<string>;
|
|
42
|
-
/**
|
|
43
|
-
* Add a card synchronously (for performance-critical paths)
|
|
44
|
-
*/
|
|
45
48
|
addSync(card: MCard): string;
|
|
46
|
-
get(hash: string): Promise<MCard | null>;
|
|
47
|
-
/**
|
|
48
|
-
* Get a card synchronously
|
|
49
|
-
*/
|
|
50
49
|
getSync(hash: string): MCard | null;
|
|
51
|
-
delete(hash: string): Promise<void>;
|
|
52
|
-
/**
|
|
53
|
-
* Delete a card synchronously
|
|
54
|
-
*/
|
|
55
50
|
deleteSync(hash: string): boolean;
|
|
56
|
-
getPage(pageNumber?: number, pageSize?: number): Promise<Page<MCard>>;
|
|
57
|
-
/**
|
|
58
|
-
* Get a page of cards synchronously
|
|
59
|
-
*/
|
|
60
51
|
getPageSync(pageNumber?: number, pageSize?: number): Page<MCard>;
|
|
61
|
-
count(): Promise<number>;
|
|
62
|
-
/**
|
|
63
|
-
* Count cards synchronously
|
|
64
|
-
*/
|
|
65
52
|
countSync(): number;
|
|
66
|
-
searchByHash(hashPrefix: string): Promise<MCard[]>;
|
|
67
|
-
search(query: string, pageNumber: number, pageSize: number): Promise<Page<MCard>>;
|
|
68
|
-
getAll(): Promise<MCard[]>;
|
|
69
|
-
clear(): Promise<void>;
|
|
70
|
-
/**
|
|
71
|
-
* Clear all data synchronously
|
|
72
|
-
* Delete in FK-safe order: children first, then parents
|
|
73
|
-
*/
|
|
74
53
|
clearSync(): void;
|
|
75
|
-
/**
|
|
76
|
-
* Search cards by string in content, hash, or g_time
|
|
77
|
-
*/
|
|
78
54
|
searchByString(searchString: string, pageNumber?: number, pageSize?: number): Page<MCard>;
|
|
79
|
-
/**
|
|
80
|
-
* Search cards by content pattern (binary-safe)
|
|
81
|
-
*/
|
|
82
55
|
searchByContent(searchPattern: string | Uint8Array, pageNumber?: number, pageSize?: number): Page<MCard>;
|
|
83
|
-
/**
|
|
84
|
-
* Get all cards (single page with all items)
|
|
85
|
-
*/
|
|
86
56
|
getAllCards(): Page<MCard>;
|
|
87
|
-
registerHandle(handle: string, hash: string): Promise<void>;
|
|
88
|
-
/**
|
|
89
|
-
* Register a handle synchronously
|
|
90
|
-
*/
|
|
91
|
-
registerHandleSync(handle: string, hash: string): void;
|
|
92
|
-
resolveHandle(handle: string): Promise<string | null>;
|
|
93
|
-
/**
|
|
94
|
-
* Resolve a handle synchronously
|
|
95
|
-
*/
|
|
96
|
-
resolveHandleSync(handle: string): string | null;
|
|
97
|
-
getByHandle(handle: string): Promise<MCard | null>;
|
|
98
|
-
/**
|
|
99
|
-
* Get card by handle synchronously
|
|
100
|
-
*/
|
|
101
|
-
getByHandleSync(handle: string): MCard | null;
|
|
102
|
-
updateHandle(handle: string, newHash: string): Promise<string>;
|
|
103
|
-
/**
|
|
104
|
-
* Update a handle synchronously
|
|
105
|
-
*/
|
|
106
|
-
updateHandleSync(handle: string, newHash: string): string;
|
|
107
|
-
getHandleHistory(handle: string): Promise<{
|
|
108
|
-
previousHash: string;
|
|
109
|
-
changedAt: string;
|
|
110
|
-
}[]>;
|
|
111
|
-
/**
|
|
112
|
-
* Get handle history synchronously
|
|
113
|
-
*/
|
|
114
|
-
getHandleHistorySync(handle: string): {
|
|
115
|
-
previousHash: string;
|
|
116
|
-
changedAt: string;
|
|
117
|
-
}[];
|
|
118
|
-
pruneHandleHistory(handle: string, options?: {
|
|
119
|
-
olderThan?: string;
|
|
120
|
-
deleteAll?: boolean;
|
|
121
|
-
}): Promise<number>;
|
|
122
|
-
/**
|
|
123
|
-
* Prune handle history synchronously
|
|
124
|
-
*/
|
|
125
|
-
pruneHandleHistorySync(handle: string, options?: {
|
|
126
|
-
olderThan?: string;
|
|
127
|
-
deleteAll?: boolean;
|
|
128
|
-
}): number;
|
|
129
|
-
getAllHandles(): Promise<{
|
|
130
|
-
handle: string;
|
|
131
|
-
hash: string;
|
|
132
|
-
}[]>;
|
|
133
|
-
getAllHandlesSync(): {
|
|
134
|
-
handle: string;
|
|
135
|
-
hash: string;
|
|
136
|
-
}[];
|
|
137
|
-
removeHandle(handle: string): Promise<void>;
|
|
138
|
-
removeHandleSync(handle: string): void;
|
|
139
|
-
renameHandle(oldHandle: string, newHandle: string): Promise<void>;
|
|
140
|
-
renameHandleSync(oldHandle: string, newHandle: string): void;
|
|
141
|
-
deleteHistoryEntry(handle: string, previousHash: string): Promise<void>;
|
|
142
57
|
deleteHistoryEntrySync(handle: string, previousHash: string): void;
|
|
143
58
|
}
|
|
144
59
|
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as AbstractSqlEngine, M as MCard, P as Page } from '../AbstractSqlEngine-BSfp8S_Y.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* SqliteNodeEngine - Native SQLite backend for Node.js using better-sqlite3
|
|
5
5
|
*
|
|
6
6
|
* Provides synchronous SQLite operations with the same schema as Python implementation.
|
|
7
7
|
* Supports both file-based and in-memory databases.
|
|
8
|
+
*
|
|
9
|
+
* Handle operations (register, resolve, update, rename, prune, etc.) are
|
|
10
|
+
* inherited from AbstractSqlEngine — only card operations and sync helpers
|
|
11
|
+
* are implemented here.
|
|
8
12
|
*/
|
|
9
13
|
|
|
10
14
|
/**
|
|
@@ -12,13 +16,13 @@ import { S as StorageEngine, M as MCard, P as Page } from '../StorageAdapter-DdD
|
|
|
12
16
|
*
|
|
13
17
|
* Uses better-sqlite3 for synchronous, high-performance SQLite operations.
|
|
14
18
|
*/
|
|
15
|
-
declare class SqliteNodeEngine
|
|
19
|
+
declare class SqliteNodeEngine extends AbstractSqlEngine {
|
|
16
20
|
private db;
|
|
17
21
|
private dbPath;
|
|
18
22
|
/**
|
|
19
23
|
* Convert a database row into an MCard instance.
|
|
20
24
|
*/
|
|
21
|
-
|
|
25
|
+
protected rowToCard(row: Record<string, unknown>): MCard;
|
|
22
26
|
/**
|
|
23
27
|
* Create a new SqliteNodeEngine via async factory.
|
|
24
28
|
* @param dbPath Path to database file, or ':memory:' for in-memory database
|
|
@@ -30,6 +34,8 @@ declare class SqliteNodeEngine implements StorageEngine {
|
|
|
30
34
|
* Initialize database schema
|
|
31
35
|
*/
|
|
32
36
|
private setupDatabase;
|
|
37
|
+
protected queryRows(sql: string, ...params: unknown[]): Promise<Record<string, unknown>[]>;
|
|
38
|
+
protected execSql(sql: string, ...params: unknown[]): Promise<number>;
|
|
33
39
|
/**
|
|
34
40
|
* Close the database connection
|
|
35
41
|
*/
|
|
@@ -39,106 +45,15 @@ declare class SqliteNodeEngine implements StorageEngine {
|
|
|
39
45
|
*/
|
|
40
46
|
getDbPath(): string;
|
|
41
47
|
add(card: MCard): Promise<string>;
|
|
42
|
-
/**
|
|
43
|
-
* Add a card synchronously (for performance-critical paths)
|
|
44
|
-
*/
|
|
45
48
|
addSync(card: MCard): string;
|
|
46
|
-
get(hash: string): Promise<MCard | null>;
|
|
47
|
-
/**
|
|
48
|
-
* Get a card synchronously
|
|
49
|
-
*/
|
|
50
49
|
getSync(hash: string): MCard | null;
|
|
51
|
-
delete(hash: string): Promise<void>;
|
|
52
|
-
/**
|
|
53
|
-
* Delete a card synchronously
|
|
54
|
-
*/
|
|
55
50
|
deleteSync(hash: string): boolean;
|
|
56
|
-
getPage(pageNumber?: number, pageSize?: number): Promise<Page<MCard>>;
|
|
57
|
-
/**
|
|
58
|
-
* Get a page of cards synchronously
|
|
59
|
-
*/
|
|
60
51
|
getPageSync(pageNumber?: number, pageSize?: number): Page<MCard>;
|
|
61
|
-
count(): Promise<number>;
|
|
62
|
-
/**
|
|
63
|
-
* Count cards synchronously
|
|
64
|
-
*/
|
|
65
52
|
countSync(): number;
|
|
66
|
-
searchByHash(hashPrefix: string): Promise<MCard[]>;
|
|
67
|
-
search(query: string, pageNumber: number, pageSize: number): Promise<Page<MCard>>;
|
|
68
|
-
getAll(): Promise<MCard[]>;
|
|
69
|
-
clear(): Promise<void>;
|
|
70
|
-
/**
|
|
71
|
-
* Clear all data synchronously
|
|
72
|
-
* Delete in FK-safe order: children first, then parents
|
|
73
|
-
*/
|
|
74
53
|
clearSync(): void;
|
|
75
|
-
/**
|
|
76
|
-
* Search cards by string in content, hash, or g_time
|
|
77
|
-
*/
|
|
78
54
|
searchByString(searchString: string, pageNumber?: number, pageSize?: number): Page<MCard>;
|
|
79
|
-
/**
|
|
80
|
-
* Search cards by content pattern (binary-safe)
|
|
81
|
-
*/
|
|
82
55
|
searchByContent(searchPattern: string | Uint8Array, pageNumber?: number, pageSize?: number): Page<MCard>;
|
|
83
|
-
/**
|
|
84
|
-
* Get all cards (single page with all items)
|
|
85
|
-
*/
|
|
86
56
|
getAllCards(): Page<MCard>;
|
|
87
|
-
registerHandle(handle: string, hash: string): Promise<void>;
|
|
88
|
-
/**
|
|
89
|
-
* Register a handle synchronously
|
|
90
|
-
*/
|
|
91
|
-
registerHandleSync(handle: string, hash: string): void;
|
|
92
|
-
resolveHandle(handle: string): Promise<string | null>;
|
|
93
|
-
/**
|
|
94
|
-
* Resolve a handle synchronously
|
|
95
|
-
*/
|
|
96
|
-
resolveHandleSync(handle: string): string | null;
|
|
97
|
-
getByHandle(handle: string): Promise<MCard | null>;
|
|
98
|
-
/**
|
|
99
|
-
* Get card by handle synchronously
|
|
100
|
-
*/
|
|
101
|
-
getByHandleSync(handle: string): MCard | null;
|
|
102
|
-
updateHandle(handle: string, newHash: string): Promise<string>;
|
|
103
|
-
/**
|
|
104
|
-
* Update a handle synchronously
|
|
105
|
-
*/
|
|
106
|
-
updateHandleSync(handle: string, newHash: string): string;
|
|
107
|
-
getHandleHistory(handle: string): Promise<{
|
|
108
|
-
previousHash: string;
|
|
109
|
-
changedAt: string;
|
|
110
|
-
}[]>;
|
|
111
|
-
/**
|
|
112
|
-
* Get handle history synchronously
|
|
113
|
-
*/
|
|
114
|
-
getHandleHistorySync(handle: string): {
|
|
115
|
-
previousHash: string;
|
|
116
|
-
changedAt: string;
|
|
117
|
-
}[];
|
|
118
|
-
pruneHandleHistory(handle: string, options?: {
|
|
119
|
-
olderThan?: string;
|
|
120
|
-
deleteAll?: boolean;
|
|
121
|
-
}): Promise<number>;
|
|
122
|
-
/**
|
|
123
|
-
* Prune handle history synchronously
|
|
124
|
-
*/
|
|
125
|
-
pruneHandleHistorySync(handle: string, options?: {
|
|
126
|
-
olderThan?: string;
|
|
127
|
-
deleteAll?: boolean;
|
|
128
|
-
}): number;
|
|
129
|
-
getAllHandles(): Promise<{
|
|
130
|
-
handle: string;
|
|
131
|
-
hash: string;
|
|
132
|
-
}[]>;
|
|
133
|
-
getAllHandlesSync(): {
|
|
134
|
-
handle: string;
|
|
135
|
-
hash: string;
|
|
136
|
-
}[];
|
|
137
|
-
removeHandle(handle: string): Promise<void>;
|
|
138
|
-
removeHandleSync(handle: string): void;
|
|
139
|
-
renameHandle(oldHandle: string, newHandle: string): Promise<void>;
|
|
140
|
-
renameHandleSync(oldHandle: string, newHandle: string): void;
|
|
141
|
-
deleteHistoryEntry(handle: string, previousHash: string): Promise<void>;
|
|
142
57
|
deleteHistoryEntrySync(handle: string, previousHash: string): void;
|
|
143
58
|
}
|
|
144
59
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SqliteNodeEngine
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-FIE4LAJG.js";
|
|
4
|
+
import "../chunk-RSTKX7WM.js";
|
|
5
|
+
import "../chunk-3EIBJPNF.js";
|
|
6
|
+
import "../chunk-ADV52544.js";
|
|
7
|
+
import "../chunk-3MMMJ7NH.js";
|
|
7
8
|
import "../chunk-7NKII2JA.js";
|
|
8
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-PNKVD2UK.js";
|
|
9
10
|
export {
|
|
10
11
|
SqliteNodeEngine
|
|
11
12
|
};
|