qlogicagent 2.10.13 → 2.10.15
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/cli.js +331 -256
- package/dist/index.js +330 -255
- package/dist/protocol.js +1 -1
- package/dist/types/cli/handlers/memory-handler.d.ts +3 -0
- package/dist/types/cli/stdio-server.contract.test.d.ts +1 -0
- package/dist/types/cli/stdio-server.d.ts +11 -0
- package/dist/types/protocol/wire/agent-rpc.d.ts +14 -0
- package/dist/types/protocol/wire/gateway-contract.d.ts +61 -0
- package/dist/types/protocol/wire/gateway-contract.test.d.ts +1 -0
- package/dist/types/protocol/wire/gateway-rpc.d.ts +169 -1
- package/dist/types/protocol/wire/index.d.ts +3 -2
- package/dist/types/protocol/wire/memory-provider-lifecycle.d.ts +1 -1
- package/dist/types/runtime/pet/index.d.ts +0 -1
- package/dist/types/skills/memory/local-embedding.d.ts +4 -100
- package/dist/types/skills/memory/local-memory-provider.d.ts +18 -5
- package/dist/types/skills/memory/local-store.d.ts +70 -0
- package/dist/types/skills/memory/memory-provider-factory.d.ts +5 -11
- package/package.json +1 -4
- package/dist/types/runtime/pet/pet-context-injection.d.ts +0 -8
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - Without embedding: FTS-only search (still useful for exact/keyword matches)
|
|
10
10
|
*/
|
|
11
11
|
import type { MemoryProvider, MemorySearchResult, MemorySearchOptions, MemoryIngestMessage, MemoryIngestOptions } from "../../protocol/wire/index.js";
|
|
12
|
-
import type { SqliteDatabase } from "./local-store.js";
|
|
12
|
+
import type { MemoryUpdateInput, SqliteDatabase } from "./local-store.js";
|
|
13
13
|
import { type LocalEmbeddingConfig } from "./local-embedding.js";
|
|
14
14
|
/** A pre-extracted memory item ready to be stored (no LLM needed). */
|
|
15
15
|
export interface ExtractedMemoryItem {
|
|
@@ -38,6 +38,9 @@ export declare class LocalMemoryProvider implements MemoryProvider {
|
|
|
38
38
|
private dbPath;
|
|
39
39
|
constructor(config: LocalMemoryProviderConfig);
|
|
40
40
|
private resolveUserId;
|
|
41
|
+
private buildEmbedding;
|
|
42
|
+
private findExistingDuplicate;
|
|
43
|
+
private insertDeduped;
|
|
41
44
|
search(query: string, userId: string, options?: MemorySearchOptions): Promise<MemorySearchResult[]>;
|
|
42
45
|
ingest(messages: MemoryIngestMessage[], userId: string, options?: MemoryIngestOptions): Promise<void>;
|
|
43
46
|
addText(text: string, userId: string, options?: MemoryIngestOptions & {
|
|
@@ -47,6 +50,7 @@ export declare class LocalMemoryProvider implements MemoryProvider {
|
|
|
47
50
|
memoriesAdded: number;
|
|
48
51
|
}>;
|
|
49
52
|
remove(memoryId: string): Promise<boolean>;
|
|
53
|
+
update(memoryId: string, input: MemoryUpdateInput): Promise<boolean>;
|
|
50
54
|
/**
|
|
51
55
|
* Ingest pre-extracted memory items (no LLM needed).
|
|
52
56
|
* Compatible with qmemory-adapter's ingestExtracted interface.
|
|
@@ -129,6 +133,19 @@ export declare class LocalMemoryProvider implements MemoryProvider {
|
|
|
129
133
|
/**
|
|
130
134
|
* Find memories by event date (±tolerance). For temporal context retrieval.
|
|
131
135
|
*/
|
|
136
|
+
/**
|
|
137
|
+
* Return the final atlas payload: a bounded interactive record window plus
|
|
138
|
+
* whole-history buckets/clusters for large timelines.
|
|
139
|
+
*/
|
|
140
|
+
getAtlas(userId: string, options?: {
|
|
141
|
+
pageSize?: number;
|
|
142
|
+
windowStartAt?: number;
|
|
143
|
+
windowEndAt?: number;
|
|
144
|
+
windowCenterAt?: number;
|
|
145
|
+
bucketCount?: number;
|
|
146
|
+
clusterLimit?: number;
|
|
147
|
+
activeOnly?: boolean;
|
|
148
|
+
}): import("./local-store.js").MemoryAtlasResult;
|
|
132
149
|
findByEventDate(userId: string, targetDate: string, toleranceDays?: number): import("./local-store.js").MemorySearchHit[];
|
|
133
150
|
/**
|
|
134
151
|
* Find related memories (event continuity detection).
|
|
@@ -200,8 +217,4 @@ export declare class LocalMemoryProvider implements MemoryProvider {
|
|
|
200
217
|
*/
|
|
201
218
|
close(): void;
|
|
202
219
|
}
|
|
203
|
-
/**
|
|
204
|
-
* Create a local memory provider (convenience factory).
|
|
205
|
-
* Caller must provide the createDatabase factory to avoid hard dependency on better-sqlite3.
|
|
206
|
-
*/
|
|
207
220
|
export declare function createLocalMemoryProvider(config: LocalMemoryProviderConfig): LocalMemoryProvider;
|
|
@@ -42,6 +42,15 @@ export interface MemoryInsertInput {
|
|
|
42
42
|
tags?: string[];
|
|
43
43
|
embedding?: Float32Array;
|
|
44
44
|
}
|
|
45
|
+
export interface MemoryUpdateInput {
|
|
46
|
+
text?: string;
|
|
47
|
+
category?: string;
|
|
48
|
+
importance?: number;
|
|
49
|
+
source?: string;
|
|
50
|
+
eventDate?: string;
|
|
51
|
+
tags?: string[];
|
|
52
|
+
embedding?: Float32Array | null;
|
|
53
|
+
}
|
|
45
54
|
export interface MemorySearchHit {
|
|
46
55
|
id: string;
|
|
47
56
|
text: string;
|
|
@@ -50,6 +59,45 @@ export interface MemorySearchHit {
|
|
|
50
59
|
importance: number;
|
|
51
60
|
metadata: Record<string, unknown>;
|
|
52
61
|
}
|
|
62
|
+
export interface MemoryAtlasBucket {
|
|
63
|
+
id: string;
|
|
64
|
+
startAt: number;
|
|
65
|
+
endAt: number;
|
|
66
|
+
count: number;
|
|
67
|
+
avgImportance: number;
|
|
68
|
+
avgConfidence: number;
|
|
69
|
+
topCategory: string;
|
|
70
|
+
}
|
|
71
|
+
export interface MemoryAtlasCluster {
|
|
72
|
+
id: string;
|
|
73
|
+
label: string;
|
|
74
|
+
kind: "source" | "category" | "tag";
|
|
75
|
+
count: number;
|
|
76
|
+
startAt: number;
|
|
77
|
+
endAt: number;
|
|
78
|
+
avgImportance: number;
|
|
79
|
+
avgConfidence: number;
|
|
80
|
+
topCategory: string;
|
|
81
|
+
}
|
|
82
|
+
export interface MemoryAtlasWindowCursor {
|
|
83
|
+
startAt: number;
|
|
84
|
+
endAt: number;
|
|
85
|
+
centerAt: number;
|
|
86
|
+
pageSize: number;
|
|
87
|
+
hasBefore: boolean;
|
|
88
|
+
hasAfter: boolean;
|
|
89
|
+
}
|
|
90
|
+
export interface MemoryAtlasResult {
|
|
91
|
+
totalCount: number;
|
|
92
|
+
records: MemoryRecord[];
|
|
93
|
+
buckets: MemoryAtlasBucket[];
|
|
94
|
+
clusters: MemoryAtlasCluster[];
|
|
95
|
+
windowCursor: MemoryAtlasWindowCursor | null;
|
|
96
|
+
timeRange: {
|
|
97
|
+
startAt: number;
|
|
98
|
+
endAt: number;
|
|
99
|
+
} | null;
|
|
100
|
+
}
|
|
53
101
|
export interface SqliteDatabase {
|
|
54
102
|
exec(sql: string): void;
|
|
55
103
|
prepare(sql: string): SqliteStatement;
|
|
@@ -89,6 +137,24 @@ export declare class LocalMemoryStore {
|
|
|
89
137
|
* Get all memories for a user (paginated).
|
|
90
138
|
*/
|
|
91
139
|
listByUser(userId: string, page?: number, pageSize?: number, activeOnly?: boolean): MemoryRecord[];
|
|
140
|
+
/**
|
|
141
|
+
* Return a windowed atlas payload for large-history visualization.
|
|
142
|
+
*
|
|
143
|
+
* `records` are only the interactive window. `buckets` and `clusters` summarize
|
|
144
|
+
* the whole history so the UI can render distant history as star dust /
|
|
145
|
+
* aggregate galaxies without loading every memory as an interactive object.
|
|
146
|
+
*/
|
|
147
|
+
getAtlas(userId: string, options?: {
|
|
148
|
+
pageSize?: number;
|
|
149
|
+
windowStartAt?: number;
|
|
150
|
+
windowEndAt?: number;
|
|
151
|
+
windowCenterAt?: number;
|
|
152
|
+
bucketCount?: number;
|
|
153
|
+
clusterLimit?: number;
|
|
154
|
+
activeOnly?: boolean;
|
|
155
|
+
}): MemoryAtlasResult;
|
|
156
|
+
private getAtlasBuckets;
|
|
157
|
+
private getAtlasClusters;
|
|
92
158
|
/**
|
|
93
159
|
* Get a single memory by ID.
|
|
94
160
|
*/
|
|
@@ -97,6 +163,10 @@ export declare class LocalMemoryStore {
|
|
|
97
163
|
* Update memory text and bump updatedAt.
|
|
98
164
|
*/
|
|
99
165
|
updateText(id: string, text: string, embedding?: Float32Array): boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Update editable memory fields and bump updatedAt.
|
|
168
|
+
*/
|
|
169
|
+
update(id: string, input: MemoryUpdateInput): boolean;
|
|
100
170
|
/**
|
|
101
171
|
* Delete a memory by ID.
|
|
102
172
|
*/
|
|
@@ -29,19 +29,13 @@ export declare function createMemoryProvider(config: MemoryProviderFactoryConfig
|
|
|
29
29
|
* Used by stdio-server to auto-configure memory.
|
|
30
30
|
*
|
|
31
31
|
* Environment variables:
|
|
32
|
-
*
|
|
33
|
-
* - "auto": detect LLM provider → use their embedding API directly
|
|
34
|
-
* QMEMORY_EMBEDDING_BASE_URL — required when strategy=api
|
|
35
|
-
* QMEMORY_EMBEDDING_API_KEY — required when strategy=api
|
|
36
|
-
* QMEMORY_EMBEDDING_MODEL — model name (default: "text-embedding-3-small")
|
|
37
|
-
* QMEMORY_ONNX_MODEL_ID — model for ONNX (default: "Xenova/bge-small-zh-v1.5")
|
|
32
|
+
* QMEMORY_EMBEDDING_TIMEOUT_MS — embedding request timeout (default: 1500)
|
|
38
33
|
* QMEMORY_USER_PREFIX — user ID prefix for multi-tenant
|
|
39
34
|
*
|
|
40
|
-
*
|
|
41
|
-
* Layer 0:
|
|
42
|
-
* Layer 1:
|
|
43
|
-
* Layer 2:
|
|
44
|
-
* Layer 3: FTS5 pure text (NullEmbeddingProvider)
|
|
35
|
+
* Fixed embedding resolution:
|
|
36
|
+
* Layer 0: Explicit ModelRegistry "embedding" binding
|
|
37
|
+
* Layer 1: LLM Router default embedding endpoint (BAAI/bge-m3)
|
|
38
|
+
* Layer 2: FTS5 pure text (NullEmbeddingProvider)
|
|
45
39
|
*
|
|
46
40
|
* @param projectRoot — Project root for local storage path
|
|
47
41
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qlogicagent",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.15",
|
|
4
4
|
"description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -70,9 +70,6 @@
|
|
|
70
70
|
"pino": "^9.6.0",
|
|
71
71
|
"pino-pretty": "^13.0.0"
|
|
72
72
|
},
|
|
73
|
-
"optionalDependencies": {
|
|
74
|
-
"@xenova/transformers": "^2.17.2"
|
|
75
|
-
},
|
|
76
73
|
"devDependencies": {
|
|
77
74
|
"@types/better-sqlite3": "^7.6.13",
|
|
78
75
|
"@types/node": "^22.15.0",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pet Context Injection — injects pet soul into agent system prompt.
|
|
3
|
-
*
|
|
4
|
-
* When a pet is hatched, this adds a brief section to the system prompt
|
|
5
|
-
* so the LLM "knows" the pet exists and can occasionally respond in character.
|
|
6
|
-
*/
|
|
7
|
-
import type { PetSoul } from "./pet-soul-service.js";
|
|
8
|
-
export declare function petContextInjection(soul: PetSoul | null): string;
|