@equationalapplications/expo-llm-wiki 2.2.0 → 2.4.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 +31 -235
- package/dist/chunk-6DVBBIYR.mjs +24 -0
- package/dist/chunk-6DVBBIYR.mjs.map +1 -0
- package/dist/factory.d.mts +12 -0
- package/dist/factory.d.ts +12 -0
- package/dist/factory.js +56 -0
- package/dist/factory.js.map +1 -0
- package/dist/factory.mjs +13 -0
- package/dist/factory.mjs.map +1 -0
- package/dist/index.d.mts +4 -5
- package/dist/index.d.ts +4 -5
- package/dist/index.js +25 -1095
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +9 -1095
- package/dist/index.mjs.map +1 -0
- package/package.json +19 -46
- package/dist/WikiMemory-CjlQ68X0.d.mts +0 -180
- package/dist/WikiMemory-CjlQ68X0.d.ts +0 -180
- package/dist/react/index.d.mts +0 -79
- package/dist/react/index.d.ts +0 -79
- package/dist/react/index.js +0 -260
- package/dist/react/index.mjs +0 -226
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type * as SQLite from 'expo-sqlite';\nimport { WikiMemory, type WikiOptions } from '@equationalapplications/core-llm-wiki';\nimport { createExpoAdapter } from './adapter';\n\n// Re-exports all core types and utilities. The `createWiki` exported below\n// intentionally shadows the one from @equationalapplications/core-llm-wiki, binding the expo-sqlite adapter.\nexport * from '@equationalapplications/core-llm-wiki';\nexport * from '@equationalapplications/react-llm-wiki';\n\nexport function createWiki(db: SQLite.SQLiteDatabase, options: WikiOptions): WikiMemory {\n return new WikiMemory(createExpoAdapter(db), options);\n}\n"],"mappings":";;;;;AACA,SAAS,kBAAoC;AAK7C,cAAc;AACd,cAAc;AAEP,SAAS,WAAW,IAA2B,SAAkC;AACtF,SAAO,IAAI,WAAW,kBAAkB,EAAE,GAAG,OAAO;AACtD;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equationalapplications/expo-llm-wiki",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.4.0",
|
|
4
|
+
"description": "Expo/React Native adapter for @equationalapplications/core-llm-wiki.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -11,67 +11,40 @@
|
|
|
11
11
|
"require": "./dist/index.js",
|
|
12
12
|
"import": "./dist/index.mjs"
|
|
13
13
|
},
|
|
14
|
-
"./
|
|
15
|
-
"types": "./dist/
|
|
16
|
-
"require": "./dist/
|
|
17
|
-
"import": "./dist/
|
|
14
|
+
"./factory": {
|
|
15
|
+
"types": "./dist/factory.d.ts",
|
|
16
|
+
"require": "./dist/factory.js",
|
|
17
|
+
"import": "./dist/factory.mjs"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "tsup src/index.ts src/react/index.ts --format cjs,esm --dts --external react",
|
|
22
|
-
"dev": "tsup src/index.ts src/react/index.ts --format cjs,esm --dts --external react --watch",
|
|
23
|
-
"typecheck": "tsc --noEmit",
|
|
24
|
-
"test": "vitest run",
|
|
25
|
-
"test:watch": "vitest"
|
|
26
|
-
},
|
|
27
20
|
"files": [
|
|
28
21
|
"dist",
|
|
29
22
|
"LICENSE",
|
|
30
23
|
"README.md"
|
|
31
24
|
],
|
|
32
|
-
"keywords": [
|
|
33
|
-
"expo",
|
|
34
|
-
"react-native",
|
|
35
|
-
"llm",
|
|
36
|
-
"memory",
|
|
37
|
-
"sqlite",
|
|
38
|
-
"fts5"
|
|
39
|
-
],
|
|
40
|
-
"author": "",
|
|
41
25
|
"license": "MIT",
|
|
42
26
|
"publishConfig": {
|
|
43
27
|
"access": "public",
|
|
44
28
|
"registry": "https://registry.npmjs.org"
|
|
45
29
|
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@equationalapplications/core-llm-wiki": "2.4.0",
|
|
32
|
+
"@equationalapplications/react-llm-wiki": "2.4.0"
|
|
33
|
+
},
|
|
46
34
|
"peerDependencies": {
|
|
47
35
|
"expo-sqlite": "^14.0.0 || ^15.0.0 || ^55.0.0",
|
|
48
36
|
"react": ">=17"
|
|
49
37
|
},
|
|
50
|
-
"peerDependenciesMeta": {
|
|
51
|
-
"react": {
|
|
52
|
-
"optional": true
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
"engines": {
|
|
56
|
-
"node": ">=20"
|
|
57
|
-
},
|
|
58
38
|
"devDependencies": {
|
|
59
|
-
"@semantic-release/changelog": "^6.0.0",
|
|
60
|
-
"@semantic-release/git": "^10.0.0",
|
|
61
|
-
"@types/better-sqlite3": "^7.6.13",
|
|
62
|
-
"@types/node": "^20.0.0",
|
|
63
|
-
"@types/react": "^19.0.0",
|
|
64
|
-
"@vitest/coverage-v8": "^4.1.5",
|
|
65
|
-
"better-sqlite3": "^12.9.0",
|
|
66
|
-
"expo-sqlite": "^55.0.15",
|
|
67
|
-
"react": "19.2.0",
|
|
68
|
-
"semantic-release": "^24.0.0",
|
|
69
39
|
"tsup": "^8.0.0",
|
|
70
|
-
"typescript": "^5.
|
|
71
|
-
"vitest": "
|
|
40
|
+
"typescript": "^5.4.0",
|
|
41
|
+
"vitest": "4.1.5"
|
|
72
42
|
},
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsup",
|
|
45
|
+
"dev": "tsup --watch",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"test:watch": "vitest"
|
|
76
49
|
}
|
|
77
|
-
}
|
|
50
|
+
}
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import * as SQLite from 'expo-sqlite';
|
|
2
|
-
|
|
3
|
-
interface WikiConfig {
|
|
4
|
-
tablePrefix?: string;
|
|
5
|
-
maxFtsResults?: number;
|
|
6
|
-
pruneEventsAfter?: number;
|
|
7
|
-
pruneRetainSoftDeletedFor?: number;
|
|
8
|
-
autoLibrarianThreshold?: number;
|
|
9
|
-
autoHealThreshold?: number;
|
|
10
|
-
orphanAfterDays?: number | null;
|
|
11
|
-
staleInferredAfterDays?: number | null;
|
|
12
|
-
maxChunkLength?: number;
|
|
13
|
-
chunkOverlap?: number;
|
|
14
|
-
chunkConcurrency?: number;
|
|
15
|
-
/**
|
|
16
|
-
* Static caller-supplied synonym expansions applied at query time.
|
|
17
|
-
* Keys must match the same normalization pipeline used by query formatting:
|
|
18
|
-
* the query is lowercased, stripped to `[a-z0-9 ]`, split into tokens, and
|
|
19
|
-
* only tokens with length >= 3 are considered for synonym lookup.
|
|
20
|
-
* Values are appended to the FTS5 query token list (multi-word values are
|
|
21
|
-
* split into tokens), then deduped and sliced to 12.
|
|
22
|
-
*/
|
|
23
|
-
synonymMap?: Record<string, string[]>;
|
|
24
|
-
}
|
|
25
|
-
interface WikiFact {
|
|
26
|
-
id: string;
|
|
27
|
-
entity_id: string;
|
|
28
|
-
title: string;
|
|
29
|
-
body: string;
|
|
30
|
-
tags: string[];
|
|
31
|
-
confidence: 'certain' | 'inferred' | 'tentative';
|
|
32
|
-
source_type: 'user_stated' | 'agent_inferred' | 'user_confirmed' | 'user_document';
|
|
33
|
-
source_hash: string | null;
|
|
34
|
-
source_ref: string | null;
|
|
35
|
-
created_at: number;
|
|
36
|
-
updated_at: number;
|
|
37
|
-
last_accessed_at: number | null;
|
|
38
|
-
access_count: number;
|
|
39
|
-
deleted_at: number | null;
|
|
40
|
-
}
|
|
41
|
-
interface WikiTask {
|
|
42
|
-
id: string;
|
|
43
|
-
entity_id: string;
|
|
44
|
-
description: string;
|
|
45
|
-
status: 'pending' | 'in_progress' | 'done' | 'abandoned';
|
|
46
|
-
priority: number;
|
|
47
|
-
created_at: number;
|
|
48
|
-
updated_at: number;
|
|
49
|
-
resolved_at: number | null;
|
|
50
|
-
deleted_at: number | null;
|
|
51
|
-
}
|
|
52
|
-
interface WikiEvent {
|
|
53
|
-
id: string;
|
|
54
|
-
entity_id: string;
|
|
55
|
-
event_type: 'observation' | 'decision' | 'action' | 'outcome';
|
|
56
|
-
summary: string;
|
|
57
|
-
related_entry_id?: string | null;
|
|
58
|
-
created_at: number;
|
|
59
|
-
}
|
|
60
|
-
interface WikiCheckpoint {
|
|
61
|
-
entity_id: string;
|
|
62
|
-
heal_checkpoint: number;
|
|
63
|
-
memory_checkpoint: number;
|
|
64
|
-
}
|
|
65
|
-
interface ExtractedFact {
|
|
66
|
-
title: string;
|
|
67
|
-
body: string;
|
|
68
|
-
tags: string[];
|
|
69
|
-
confidence: 'certain' | 'inferred' | 'tentative';
|
|
70
|
-
}
|
|
71
|
-
interface ExtractedTask {
|
|
72
|
-
description: string;
|
|
73
|
-
priority: number;
|
|
74
|
-
}
|
|
75
|
-
interface LLMProvider {
|
|
76
|
-
/**
|
|
77
|
-
* Generates text using the developer's LLM of choice.
|
|
78
|
-
* Expected to return the raw text response (typically a JSON string).
|
|
79
|
-
*/
|
|
80
|
-
generateText: (params: {
|
|
81
|
-
systemPrompt: string;
|
|
82
|
-
userPrompt: string;
|
|
83
|
-
}) => Promise<string>;
|
|
84
|
-
}
|
|
85
|
-
interface WikiOptions {
|
|
86
|
-
config?: WikiConfig;
|
|
87
|
-
llmProvider: LLMProvider;
|
|
88
|
-
}
|
|
89
|
-
interface MemoryBundle {
|
|
90
|
-
facts: WikiFact[];
|
|
91
|
-
tasks: WikiTask[];
|
|
92
|
-
events: WikiEvent[];
|
|
93
|
-
}
|
|
94
|
-
interface MemoryDump {
|
|
95
|
-
generatedAt: number;
|
|
96
|
-
entities: Record<string, MemoryBundle>;
|
|
97
|
-
}
|
|
98
|
-
interface FormattedMemoryDump {
|
|
99
|
-
manifest: string;
|
|
100
|
-
files: Array<{
|
|
101
|
-
name: string;
|
|
102
|
-
content: string;
|
|
103
|
-
}>;
|
|
104
|
-
}
|
|
105
|
-
interface FormatContextOptions {
|
|
106
|
-
format?: 'markdown' | 'plain';
|
|
107
|
-
maxFacts?: number;
|
|
108
|
-
maxTasks?: number;
|
|
109
|
-
maxEvents?: number;
|
|
110
|
-
includeConfidence?: boolean;
|
|
111
|
-
includeTags?: boolean;
|
|
112
|
-
factWeights?: {
|
|
113
|
-
confidence?: number;
|
|
114
|
-
accessCount?: number;
|
|
115
|
-
recency?: number;
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
interface EntityStatus {
|
|
119
|
-
ingesting: boolean;
|
|
120
|
-
librarian: boolean;
|
|
121
|
-
heal: boolean;
|
|
122
|
-
}
|
|
123
|
-
declare class WikiBusyError extends Error {
|
|
124
|
-
readonly operation: 'ingest' | 'librarian' | 'heal' | 'prune';
|
|
125
|
-
readonly entityId: string;
|
|
126
|
-
constructor(operation: 'ingest' | 'librarian' | 'heal' | 'prune', entityId: string);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
declare class WikiMemory {
|
|
130
|
-
private db;
|
|
131
|
-
private prefix;
|
|
132
|
-
private options;
|
|
133
|
-
private activeMaintenanceJobs;
|
|
134
|
-
private activeIngestJobs;
|
|
135
|
-
private _librarianKey;
|
|
136
|
-
private _healKey;
|
|
137
|
-
private _warnCrossEntityCollision;
|
|
138
|
-
constructor(db: SQLite.SQLiteDatabase, options: WikiOptions);
|
|
139
|
-
setup(): Promise<void>;
|
|
140
|
-
private formatSearchQuery;
|
|
141
|
-
read(entityId: string, query: string): Promise<MemoryBundle>;
|
|
142
|
-
getMemoryBundle(entityId: string): Promise<MemoryBundle>;
|
|
143
|
-
write(entityId: string, event: Omit<WikiEvent, 'id' | 'entity_id' | 'created_at'>): Promise<void>;
|
|
144
|
-
private runLibrarianThenMaybeHeal;
|
|
145
|
-
private _doRunLibrarian;
|
|
146
|
-
private _doRunHeal;
|
|
147
|
-
runLibrarian(entityId: string): Promise<void>;
|
|
148
|
-
runHeal(entityId: string): Promise<void>;
|
|
149
|
-
getEntityStatus(entityId: string): EntityStatus;
|
|
150
|
-
private _getFullBundle;
|
|
151
|
-
exportDump(entityIds?: string[]): Promise<MemoryDump>;
|
|
152
|
-
importDump(dump: MemoryDump, opts?: {
|
|
153
|
-
merge?: boolean;
|
|
154
|
-
}): Promise<void>;
|
|
155
|
-
forget(entityId: string, params: {
|
|
156
|
-
entryId?: string;
|
|
157
|
-
taskId?: string;
|
|
158
|
-
sourceRef?: string;
|
|
159
|
-
sourceHash?: string;
|
|
160
|
-
clearAll?: boolean;
|
|
161
|
-
}): Promise<{
|
|
162
|
-
deleted: {
|
|
163
|
-
entries: number;
|
|
164
|
-
tasks: number;
|
|
165
|
-
};
|
|
166
|
-
}>;
|
|
167
|
-
ingestDocument(entityId: string, params: {
|
|
168
|
-
sourceRef: string;
|
|
169
|
-
sourceHash: string;
|
|
170
|
-
documentChunk: string;
|
|
171
|
-
maxChunkLength?: number;
|
|
172
|
-
chunkOverlap?: number;
|
|
173
|
-
chunkConcurrency?: number;
|
|
174
|
-
}): Promise<{
|
|
175
|
-
truncated: boolean;
|
|
176
|
-
chunks: number;
|
|
177
|
-
}>;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export { type EntityStatus as E, type FormattedMemoryDump as F, type LLMProvider as L, type MemoryDump as M, type WikiOptions as W, WikiMemory as a, type ExtractedFact as b, type ExtractedTask as c, type FormatContextOptions as d, type MemoryBundle as e, WikiBusyError as f, type WikiCheckpoint as g, type WikiConfig as h, type WikiEvent as i, type WikiFact as j, type WikiTask as k };
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import * as SQLite from 'expo-sqlite';
|
|
2
|
-
|
|
3
|
-
interface WikiConfig {
|
|
4
|
-
tablePrefix?: string;
|
|
5
|
-
maxFtsResults?: number;
|
|
6
|
-
pruneEventsAfter?: number;
|
|
7
|
-
pruneRetainSoftDeletedFor?: number;
|
|
8
|
-
autoLibrarianThreshold?: number;
|
|
9
|
-
autoHealThreshold?: number;
|
|
10
|
-
orphanAfterDays?: number | null;
|
|
11
|
-
staleInferredAfterDays?: number | null;
|
|
12
|
-
maxChunkLength?: number;
|
|
13
|
-
chunkOverlap?: number;
|
|
14
|
-
chunkConcurrency?: number;
|
|
15
|
-
/**
|
|
16
|
-
* Static caller-supplied synonym expansions applied at query time.
|
|
17
|
-
* Keys must match the same normalization pipeline used by query formatting:
|
|
18
|
-
* the query is lowercased, stripped to `[a-z0-9 ]`, split into tokens, and
|
|
19
|
-
* only tokens with length >= 3 are considered for synonym lookup.
|
|
20
|
-
* Values are appended to the FTS5 query token list (multi-word values are
|
|
21
|
-
* split into tokens), then deduped and sliced to 12.
|
|
22
|
-
*/
|
|
23
|
-
synonymMap?: Record<string, string[]>;
|
|
24
|
-
}
|
|
25
|
-
interface WikiFact {
|
|
26
|
-
id: string;
|
|
27
|
-
entity_id: string;
|
|
28
|
-
title: string;
|
|
29
|
-
body: string;
|
|
30
|
-
tags: string[];
|
|
31
|
-
confidence: 'certain' | 'inferred' | 'tentative';
|
|
32
|
-
source_type: 'user_stated' | 'agent_inferred' | 'user_confirmed' | 'user_document';
|
|
33
|
-
source_hash: string | null;
|
|
34
|
-
source_ref: string | null;
|
|
35
|
-
created_at: number;
|
|
36
|
-
updated_at: number;
|
|
37
|
-
last_accessed_at: number | null;
|
|
38
|
-
access_count: number;
|
|
39
|
-
deleted_at: number | null;
|
|
40
|
-
}
|
|
41
|
-
interface WikiTask {
|
|
42
|
-
id: string;
|
|
43
|
-
entity_id: string;
|
|
44
|
-
description: string;
|
|
45
|
-
status: 'pending' | 'in_progress' | 'done' | 'abandoned';
|
|
46
|
-
priority: number;
|
|
47
|
-
created_at: number;
|
|
48
|
-
updated_at: number;
|
|
49
|
-
resolved_at: number | null;
|
|
50
|
-
deleted_at: number | null;
|
|
51
|
-
}
|
|
52
|
-
interface WikiEvent {
|
|
53
|
-
id: string;
|
|
54
|
-
entity_id: string;
|
|
55
|
-
event_type: 'observation' | 'decision' | 'action' | 'outcome';
|
|
56
|
-
summary: string;
|
|
57
|
-
related_entry_id?: string | null;
|
|
58
|
-
created_at: number;
|
|
59
|
-
}
|
|
60
|
-
interface WikiCheckpoint {
|
|
61
|
-
entity_id: string;
|
|
62
|
-
heal_checkpoint: number;
|
|
63
|
-
memory_checkpoint: number;
|
|
64
|
-
}
|
|
65
|
-
interface ExtractedFact {
|
|
66
|
-
title: string;
|
|
67
|
-
body: string;
|
|
68
|
-
tags: string[];
|
|
69
|
-
confidence: 'certain' | 'inferred' | 'tentative';
|
|
70
|
-
}
|
|
71
|
-
interface ExtractedTask {
|
|
72
|
-
description: string;
|
|
73
|
-
priority: number;
|
|
74
|
-
}
|
|
75
|
-
interface LLMProvider {
|
|
76
|
-
/**
|
|
77
|
-
* Generates text using the developer's LLM of choice.
|
|
78
|
-
* Expected to return the raw text response (typically a JSON string).
|
|
79
|
-
*/
|
|
80
|
-
generateText: (params: {
|
|
81
|
-
systemPrompt: string;
|
|
82
|
-
userPrompt: string;
|
|
83
|
-
}) => Promise<string>;
|
|
84
|
-
}
|
|
85
|
-
interface WikiOptions {
|
|
86
|
-
config?: WikiConfig;
|
|
87
|
-
llmProvider: LLMProvider;
|
|
88
|
-
}
|
|
89
|
-
interface MemoryBundle {
|
|
90
|
-
facts: WikiFact[];
|
|
91
|
-
tasks: WikiTask[];
|
|
92
|
-
events: WikiEvent[];
|
|
93
|
-
}
|
|
94
|
-
interface MemoryDump {
|
|
95
|
-
generatedAt: number;
|
|
96
|
-
entities: Record<string, MemoryBundle>;
|
|
97
|
-
}
|
|
98
|
-
interface FormattedMemoryDump {
|
|
99
|
-
manifest: string;
|
|
100
|
-
files: Array<{
|
|
101
|
-
name: string;
|
|
102
|
-
content: string;
|
|
103
|
-
}>;
|
|
104
|
-
}
|
|
105
|
-
interface FormatContextOptions {
|
|
106
|
-
format?: 'markdown' | 'plain';
|
|
107
|
-
maxFacts?: number;
|
|
108
|
-
maxTasks?: number;
|
|
109
|
-
maxEvents?: number;
|
|
110
|
-
includeConfidence?: boolean;
|
|
111
|
-
includeTags?: boolean;
|
|
112
|
-
factWeights?: {
|
|
113
|
-
confidence?: number;
|
|
114
|
-
accessCount?: number;
|
|
115
|
-
recency?: number;
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
interface EntityStatus {
|
|
119
|
-
ingesting: boolean;
|
|
120
|
-
librarian: boolean;
|
|
121
|
-
heal: boolean;
|
|
122
|
-
}
|
|
123
|
-
declare class WikiBusyError extends Error {
|
|
124
|
-
readonly operation: 'ingest' | 'librarian' | 'heal' | 'prune';
|
|
125
|
-
readonly entityId: string;
|
|
126
|
-
constructor(operation: 'ingest' | 'librarian' | 'heal' | 'prune', entityId: string);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
declare class WikiMemory {
|
|
130
|
-
private db;
|
|
131
|
-
private prefix;
|
|
132
|
-
private options;
|
|
133
|
-
private activeMaintenanceJobs;
|
|
134
|
-
private activeIngestJobs;
|
|
135
|
-
private _librarianKey;
|
|
136
|
-
private _healKey;
|
|
137
|
-
private _warnCrossEntityCollision;
|
|
138
|
-
constructor(db: SQLite.SQLiteDatabase, options: WikiOptions);
|
|
139
|
-
setup(): Promise<void>;
|
|
140
|
-
private formatSearchQuery;
|
|
141
|
-
read(entityId: string, query: string): Promise<MemoryBundle>;
|
|
142
|
-
getMemoryBundle(entityId: string): Promise<MemoryBundle>;
|
|
143
|
-
write(entityId: string, event: Omit<WikiEvent, 'id' | 'entity_id' | 'created_at'>): Promise<void>;
|
|
144
|
-
private runLibrarianThenMaybeHeal;
|
|
145
|
-
private _doRunLibrarian;
|
|
146
|
-
private _doRunHeal;
|
|
147
|
-
runLibrarian(entityId: string): Promise<void>;
|
|
148
|
-
runHeal(entityId: string): Promise<void>;
|
|
149
|
-
getEntityStatus(entityId: string): EntityStatus;
|
|
150
|
-
private _getFullBundle;
|
|
151
|
-
exportDump(entityIds?: string[]): Promise<MemoryDump>;
|
|
152
|
-
importDump(dump: MemoryDump, opts?: {
|
|
153
|
-
merge?: boolean;
|
|
154
|
-
}): Promise<void>;
|
|
155
|
-
forget(entityId: string, params: {
|
|
156
|
-
entryId?: string;
|
|
157
|
-
taskId?: string;
|
|
158
|
-
sourceRef?: string;
|
|
159
|
-
sourceHash?: string;
|
|
160
|
-
clearAll?: boolean;
|
|
161
|
-
}): Promise<{
|
|
162
|
-
deleted: {
|
|
163
|
-
entries: number;
|
|
164
|
-
tasks: number;
|
|
165
|
-
};
|
|
166
|
-
}>;
|
|
167
|
-
ingestDocument(entityId: string, params: {
|
|
168
|
-
sourceRef: string;
|
|
169
|
-
sourceHash: string;
|
|
170
|
-
documentChunk: string;
|
|
171
|
-
maxChunkLength?: number;
|
|
172
|
-
chunkOverlap?: number;
|
|
173
|
-
chunkConcurrency?: number;
|
|
174
|
-
}): Promise<{
|
|
175
|
-
truncated: boolean;
|
|
176
|
-
chunks: number;
|
|
177
|
-
}>;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export { type EntityStatus as E, type FormattedMemoryDump as F, type LLMProvider as L, type MemoryDump as M, type WikiOptions as W, WikiMemory as a, type ExtractedFact as b, type ExtractedTask as c, type FormatContextOptions as d, type MemoryBundle as e, WikiBusyError as f, type WikiCheckpoint as g, type WikiConfig as h, type WikiEvent as i, type WikiFact as j, type WikiTask as k };
|
package/dist/react/index.d.mts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { a as WikiMemory, e as MemoryBundle, i as WikiEvent, M as MemoryDump } from '../WikiMemory-CjlQ68X0.mjs';
|
|
4
|
-
import 'expo-sqlite';
|
|
5
|
-
|
|
6
|
-
declare function WikiProvider({ wiki, children }: {
|
|
7
|
-
wiki: WikiMemory;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
}): react_jsx_runtime.JSX.Element;
|
|
10
|
-
declare function useWiki(): WikiMemory;
|
|
11
|
-
|
|
12
|
-
declare function useMemoryRead(entityId: string, query: string): {
|
|
13
|
-
data: MemoryBundle | null;
|
|
14
|
-
isPending: boolean;
|
|
15
|
-
error: Error | null;
|
|
16
|
-
refetch: () => void;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
type WriteEvent = Omit<WikiEvent, 'id' | 'entity_id' | 'created_at'>;
|
|
20
|
-
declare function useWikiWrite(): {
|
|
21
|
-
execute: (entityId: string, event: WriteEvent) => Promise<void>;
|
|
22
|
-
lastResult: void | null;
|
|
23
|
-
isPending: boolean;
|
|
24
|
-
error: Error | null;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
declare function useWikiMaintenance(): {
|
|
28
|
-
runLibrarian: (entityId: string) => Promise<void>;
|
|
29
|
-
runHeal: (entityId: string) => Promise<void>;
|
|
30
|
-
lastResult: void | null;
|
|
31
|
-
isPending: boolean;
|
|
32
|
-
error: Error | null;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
interface IngestParams {
|
|
36
|
-
sourceRef: string;
|
|
37
|
-
sourceHash: string;
|
|
38
|
-
documentChunk: string;
|
|
39
|
-
maxChunkLength?: number;
|
|
40
|
-
}
|
|
41
|
-
type IngestResult = {
|
|
42
|
-
truncated: boolean;
|
|
43
|
-
chunks: number;
|
|
44
|
-
};
|
|
45
|
-
declare function useWikiIngest(): {
|
|
46
|
-
execute: (entityId: string, params: IngestParams) => Promise<IngestResult>;
|
|
47
|
-
lastResult: IngestResult | null;
|
|
48
|
-
isPending: boolean;
|
|
49
|
-
error: Error | null;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
interface ForgetParams {
|
|
53
|
-
entryId?: string;
|
|
54
|
-
taskId?: string;
|
|
55
|
-
sourceRef?: string;
|
|
56
|
-
sourceHash?: string;
|
|
57
|
-
clearAll?: boolean;
|
|
58
|
-
}
|
|
59
|
-
type ForgetResult = {
|
|
60
|
-
deleted: {
|
|
61
|
-
entries: number;
|
|
62
|
-
tasks: number;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
declare function useWikiForget(): {
|
|
66
|
-
execute: (entityId: string, params: ForgetParams) => Promise<ForgetResult>;
|
|
67
|
-
lastResult: ForgetResult | null;
|
|
68
|
-
isPending: boolean;
|
|
69
|
-
error: Error | null;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
declare function useWikiExport(): {
|
|
73
|
-
execute: (entityIds?: string[]) => Promise<MemoryDump>;
|
|
74
|
-
lastResult: MemoryDump | null;
|
|
75
|
-
isPending: boolean;
|
|
76
|
-
error: Error | null;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export { WikiProvider, useMemoryRead, useWiki, useWikiExport, useWikiForget, useWikiIngest, useWikiMaintenance, useWikiWrite };
|
package/dist/react/index.d.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { a as WikiMemory, e as MemoryBundle, i as WikiEvent, M as MemoryDump } from '../WikiMemory-CjlQ68X0.js';
|
|
4
|
-
import 'expo-sqlite';
|
|
5
|
-
|
|
6
|
-
declare function WikiProvider({ wiki, children }: {
|
|
7
|
-
wiki: WikiMemory;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
}): react_jsx_runtime.JSX.Element;
|
|
10
|
-
declare function useWiki(): WikiMemory;
|
|
11
|
-
|
|
12
|
-
declare function useMemoryRead(entityId: string, query: string): {
|
|
13
|
-
data: MemoryBundle | null;
|
|
14
|
-
isPending: boolean;
|
|
15
|
-
error: Error | null;
|
|
16
|
-
refetch: () => void;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
type WriteEvent = Omit<WikiEvent, 'id' | 'entity_id' | 'created_at'>;
|
|
20
|
-
declare function useWikiWrite(): {
|
|
21
|
-
execute: (entityId: string, event: WriteEvent) => Promise<void>;
|
|
22
|
-
lastResult: void | null;
|
|
23
|
-
isPending: boolean;
|
|
24
|
-
error: Error | null;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
declare function useWikiMaintenance(): {
|
|
28
|
-
runLibrarian: (entityId: string) => Promise<void>;
|
|
29
|
-
runHeal: (entityId: string) => Promise<void>;
|
|
30
|
-
lastResult: void | null;
|
|
31
|
-
isPending: boolean;
|
|
32
|
-
error: Error | null;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
interface IngestParams {
|
|
36
|
-
sourceRef: string;
|
|
37
|
-
sourceHash: string;
|
|
38
|
-
documentChunk: string;
|
|
39
|
-
maxChunkLength?: number;
|
|
40
|
-
}
|
|
41
|
-
type IngestResult = {
|
|
42
|
-
truncated: boolean;
|
|
43
|
-
chunks: number;
|
|
44
|
-
};
|
|
45
|
-
declare function useWikiIngest(): {
|
|
46
|
-
execute: (entityId: string, params: IngestParams) => Promise<IngestResult>;
|
|
47
|
-
lastResult: IngestResult | null;
|
|
48
|
-
isPending: boolean;
|
|
49
|
-
error: Error | null;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
interface ForgetParams {
|
|
53
|
-
entryId?: string;
|
|
54
|
-
taskId?: string;
|
|
55
|
-
sourceRef?: string;
|
|
56
|
-
sourceHash?: string;
|
|
57
|
-
clearAll?: boolean;
|
|
58
|
-
}
|
|
59
|
-
type ForgetResult = {
|
|
60
|
-
deleted: {
|
|
61
|
-
entries: number;
|
|
62
|
-
tasks: number;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
declare function useWikiForget(): {
|
|
66
|
-
execute: (entityId: string, params: ForgetParams) => Promise<ForgetResult>;
|
|
67
|
-
lastResult: ForgetResult | null;
|
|
68
|
-
isPending: boolean;
|
|
69
|
-
error: Error | null;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
declare function useWikiExport(): {
|
|
73
|
-
execute: (entityIds?: string[]) => Promise<MemoryDump>;
|
|
74
|
-
lastResult: MemoryDump | null;
|
|
75
|
-
isPending: boolean;
|
|
76
|
-
error: Error | null;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export { WikiProvider, useMemoryRead, useWiki, useWikiExport, useWikiForget, useWikiIngest, useWikiMaintenance, useWikiWrite };
|